Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: src/interpreter/bytecode-generator.h

Issue 1901713003: [generators] Perform state dispatch in loop header. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.h
diff --git a/src/interpreter/bytecode-generator.h b/src/interpreter/bytecode-generator.h
index 83e027f792e4ba174521d2a888150bb980871bed..4b78c9cbfc874395a8701b95d7261d123a98289c 100644
--- a/src/interpreter/bytecode-generator.h
+++ b/src/interpreter/bytecode-generator.h
@@ -109,6 +109,11 @@ class BytecodeGenerator final : public AstVisitor {
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);
@@ -135,7 +140,9 @@ class BytecodeGenerator final : public AstVisitor {
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.
@@ -202,9 +209,10 @@ class BytecodeGenerator final : public AstVisitor {
ExpressionResultScope* execution_result_;
RegisterAllocationScope* register_allocator_;
ZoneVector<BytecodeLabel> generator_resume_points_;
+ Register generator_state_;
+ size_t generator_yields_seen_;
int try_catch_nesting_level_;
int try_finally_nesting_level_;
- int generator_yields_seen_;
};
} // namespace interpreter
« no previous file with comments | « no previous file | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698