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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_INTERPRETER_BYTECODE_GENERATOR_H_ 5 #ifndef V8_INTERPRETER_BYTECODE_GENERATOR_H_
6 #define V8_INTERPRETER_BYTECODE_GENERATOR_H_ 6 #define V8_INTERPRETER_BYTECODE_GENERATOR_H_
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/interpreter/bytecode-array-builder.h" 9 #include "src/interpreter/bytecode-array-builder.h"
10 #include "src/interpreter/bytecodes.h" 10 #include "src/interpreter/bytecodes.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 void BuildKeyedSuperPropertyLoad(Register receiver, Register home_object, 102 void BuildKeyedSuperPropertyLoad(Register receiver, Register home_object,
103 Register key); 103 Register key);
104 104
105 void BuildThrowIfHole(Handle<String> name); 105 void BuildThrowIfHole(Handle<String> name);
106 void BuildThrowIfNotHole(Handle<String> name); 106 void BuildThrowIfNotHole(Handle<String> name);
107 void BuildThrowReassignConstant(Handle<String> name); 107 void BuildThrowReassignConstant(Handle<String> name);
108 void BuildThrowReferenceError(Handle<String> name); 108 void BuildThrowReferenceError(Handle<String> name);
109 void BuildHoleCheckForVariableLoad(VariableMode mode, Handle<String> name); 109 void BuildHoleCheckForVariableLoad(VariableMode mode, Handle<String> name);
110 void BuildHoleCheckForVariableAssignment(Variable* variable, Token::Value op); 110 void BuildHoleCheckForVariableAssignment(Variable* variable, Token::Value op);
111 111
112 // Build jump to targets[value], where min <= value < min + size.
113 void BuildIndexedJump(Register value, int min, size_t size,
114 ZoneVector<BytecodeLabel>& targets);
115
112 void VisitGeneratorPrologue(); 116 void VisitGeneratorPrologue();
113 117
114 void VisitArgumentsObject(Variable* variable); 118 void VisitArgumentsObject(Variable* variable);
115 void VisitRestArgumentsArray(Variable* rest); 119 void VisitRestArgumentsArray(Variable* rest);
116 void VisitCallSuper(Call* call); 120 void VisitCallSuper(Call* call);
117 void VisitClassLiteralContents(ClassLiteral* expr); 121 void VisitClassLiteralContents(ClassLiteral* expr);
118 void VisitClassLiteralForRuntimeDefinition(ClassLiteral* expr); 122 void VisitClassLiteralForRuntimeDefinition(ClassLiteral* expr);
119 void VisitClassLiteralProperties(ClassLiteral* expr, Register literal, 123 void VisitClassLiteralProperties(ClassLiteral* expr, Register literal,
120 Register prototype); 124 Register prototype);
121 void VisitClassLiteralStaticPrototypeWithComputedName(Register name); 125 void VisitClassLiteralStaticPrototypeWithComputedName(Register name);
122 void VisitThisFunctionVariable(Variable* variable); 126 void VisitThisFunctionVariable(Variable* variable);
123 void VisitNewTargetVariable(Variable* variable); 127 void VisitNewTargetVariable(Variable* variable);
124 void VisitNewLocalFunctionContext(); 128 void VisitNewLocalFunctionContext();
125 void VisitBuildLocalActivationContext(); 129 void VisitBuildLocalActivationContext();
126 void VisitBlockDeclarationsAndStatements(Block* stmt); 130 void VisitBlockDeclarationsAndStatements(Block* stmt);
127 void VisitNewLocalBlockContext(Scope* scope); 131 void VisitNewLocalBlockContext(Scope* scope);
128 void VisitNewLocalCatchContext(Variable* variable); 132 void VisitNewLocalCatchContext(Variable* variable);
129 void VisitNewLocalWithContext(); 133 void VisitNewLocalWithContext();
130 void VisitFunctionClosureForContext(); 134 void VisitFunctionClosureForContext();
131 void VisitSetHomeObject(Register value, Register home_object, 135 void VisitSetHomeObject(Register value, Register home_object,
132 ObjectLiteralProperty* property, int slot_number = 0); 136 ObjectLiteralProperty* property, int slot_number = 0);
133 void VisitObjectLiteralAccessor(Register home_object, 137 void VisitObjectLiteralAccessor(Register home_object,
134 ObjectLiteralProperty* property, 138 ObjectLiteralProperty* property,
135 Register value_out); 139 Register value_out);
136 void VisitForInAssignment(Expression* expr, FeedbackVectorSlot slot); 140 void VisitForInAssignment(Expression* expr, FeedbackVectorSlot slot);
137 141
138 // Visit the body of a loop iteration. 142 // Visit the header/body of a loop iteration.
143 void VisitIterationHeader(IterationStatement* stmt,
144 LoopBuilder* loop_builder);
139 void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop_builder); 145 void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop_builder);
140 146
141 // Visit a statement and switch scopes, the context is in the accumulator. 147 // Visit a statement and switch scopes, the context is in the accumulator.
142 void VisitInScope(Statement* stmt, Scope* scope); 148 void VisitInScope(Statement* stmt, Scope* scope);
143 149
144 // Visitors for obtaining expression result in the accumulator, in a 150 // Visitors for obtaining expression result in the accumulator, in a
145 // register, or just getting the effect. 151 // register, or just getting the effect.
146 void VisitForAccumulatorValue(Expression* expr); 152 void VisitForAccumulatorValue(Expression* expr);
147 void VisitForAccumulatorValueOrTheHole(Expression* expr); 153 void VisitForAccumulatorValueOrTheHole(Expression* expr);
148 MUST_USE_RESULT Register VisitForRegisterValue(Expression* expr); 154 MUST_USE_RESULT Register VisitForRegisterValue(Expression* expr);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 Zone* zone_; 201 Zone* zone_;
196 BytecodeArrayBuilder* builder_; 202 BytecodeArrayBuilder* builder_;
197 CompilationInfo* info_; 203 CompilationInfo* info_;
198 Scope* scope_; 204 Scope* scope_;
199 ZoneVector<Handle<Object>> globals_; 205 ZoneVector<Handle<Object>> globals_;
200 ControlScope* execution_control_; 206 ControlScope* execution_control_;
201 ContextScope* execution_context_; 207 ContextScope* execution_context_;
202 ExpressionResultScope* execution_result_; 208 ExpressionResultScope* execution_result_;
203 RegisterAllocationScope* register_allocator_; 209 RegisterAllocationScope* register_allocator_;
204 ZoneVector<BytecodeLabel> generator_resume_points_; 210 ZoneVector<BytecodeLabel> generator_resume_points_;
211 Register generator_state_;
212 int generator_yields_seen_;
205 int try_catch_nesting_level_; 213 int try_catch_nesting_level_;
206 int try_finally_nesting_level_; 214 int try_finally_nesting_level_;
207 int generator_yields_seen_;
208 }; 215 };
209 216
210 } // namespace interpreter 217 } // namespace interpreter
211 } // namespace internal 218 } // namespace internal
212 } // namespace v8 219 } // namespace v8
213 220
214 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ 221 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_
OLDNEW
« no previous file with comments | « no previous file | src/interpreter/bytecode-generator.cc » ('j') | src/interpreter/bytecode-generator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698