Merge V8 5.2.361.47 DO NOT MERGE
https://chromium.googlesource.com/v8/v8/+/5.2.361.47
FPIIM-449
Change-Id: Ibec421b85a9b88cb3a432ada642e469fe7e78346
(cherry picked from commit bcf72ee8e3b26f1d0726869c7ddb3921c68b09a8)
diff --git a/src/interpreter/bytecode-generator.h b/src/interpreter/bytecode-generator.h
index 4ef1738..0dcc9be 100644
--- a/src/interpreter/bytecode-generator.h
+++ b/src/interpreter/bytecode-generator.h
@@ -11,15 +11,18 @@
namespace v8 {
namespace internal {
+
+class CompilationInfo;
+
namespace interpreter {
class LoopBuilder;
class BytecodeGenerator final : public AstVisitor {
public:
- BytecodeGenerator(Isolate* isolate, Zone* zone);
+ explicit BytecodeGenerator(CompilationInfo* info);
- Handle<BytecodeArray> MakeBytecode(CompilationInfo* info);
+ Handle<BytecodeArray> MakeBytecode();
#define DECLARE_VISIT(type) void Visit##type(type* node) override;
AST_NODE_LIST(DECLARE_VISIT)
@@ -109,6 +112,13 @@
void BuildHoleCheckForVariableLoad(VariableMode mode, Handle<String> name);
void BuildHoleCheckForVariableAssignment(Variable* variable, Token::Value op);
+ // Build jump to targets[value], where
+ // start_index <= value < start_index + size.
+ void BuildIndexedJump(Register value, size_t start_index, size_t size,
+ ZoneVector<BytecodeLabel>& targets);
+
+ void VisitGeneratorPrologue();
+
void VisitArgumentsObject(Variable* variable);
void VisitRestArgumentsArray(Variable* rest);
void VisitCallSuper(Call* call);
@@ -133,7 +143,9 @@
Register value_out);
void VisitForInAssignment(Expression* expr, FeedbackVectorSlot slot);
- // Visit the body of a loop iteration.
+ // Visit the header/body of a loop iteration.
+ void VisitIterationHeader(IterationStatement* stmt,
+ LoopBuilder* loop_builder);
void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop_builder);
// Visit a statement and switch scopes, the context is in the accumulator.
@@ -159,16 +171,11 @@
template <size_t N>
void InitializeWithConsecutiveRegisters(Register (®isters)[N]);
- inline void set_builder(BytecodeArrayBuilder* builder) { builder_ = builder; }
inline BytecodeArrayBuilder* builder() const { return builder_; }
-
inline Isolate* isolate() const { return isolate_; }
inline Zone* zone() const { return zone_; }
-
inline Scope* scope() const { return scope_; }
- inline void set_scope(Scope* scope) { scope_ = scope; }
inline CompilationInfo* info() const { return info_; }
- inline void set_info(CompilationInfo* info) { info_ = info; }
inline ControlScope* execution_control() const { return execution_control_; }
inline void set_execution_control(ControlScope* scope) {
@@ -204,6 +211,8 @@
ContextScope* execution_context_;
ExpressionResultScope* execution_result_;
RegisterAllocationScope* register_allocator_;
+ ZoneVector<BytecodeLabel> generator_resume_points_;
+ Register generator_state_;
int try_catch_nesting_level_;
int try_finally_nesting_level_;
};