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

Side by Side Diff: src/interpreter/bytecode-generator.h

Issue 2423053002: Install the 'name' property in classes at runtime (Closed)
Patch Set: Check for 'name' properties at parse-time Created 4 years 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/bytecode-label.h" 10 #include "src/interpreter/bytecode-label.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 void BuildNewLocalCatchContext(Variable* variable, Scope* scope); 125 void BuildNewLocalCatchContext(Variable* variable, Scope* scope);
126 void BuildNewLocalWithContext(Scope* scope); 126 void BuildNewLocalWithContext(Scope* scope);
127 127
128 void VisitGeneratorPrologue(); 128 void VisitGeneratorPrologue();
129 129
130 void VisitArgumentsObject(Variable* variable); 130 void VisitArgumentsObject(Variable* variable);
131 void VisitRestArgumentsArray(Variable* rest); 131 void VisitRestArgumentsArray(Variable* rest);
132 void VisitCallSuper(Call* call); 132 void VisitCallSuper(Call* call);
133 void VisitClassLiteralForRuntimeDefinition(ClassLiteral* expr); 133 void VisitClassLiteralForRuntimeDefinition(ClassLiteral* expr);
134 void VisitClassLiteralProperties(ClassLiteral* expr, Register literal, 134 void VisitClassLiteralProperties(ClassLiteral* expr, Register literal,
135 Register prototype); 135 Register prototype, Register needs_name);
136 void VisitClassLiteralStaticPrototypeWithComputedName(Register name);
137 void BuildClassLiteralNameProperty(ClassLiteral* expr, Register literal,
138 Register needs_name);
136 void VisitThisFunctionVariable(Variable* variable); 139 void VisitThisFunctionVariable(Variable* variable);
137 void VisitNewTargetVariable(Variable* variable); 140 void VisitNewTargetVariable(Variable* variable);
138 void VisitBlockDeclarationsAndStatements(Block* stmt); 141 void VisitBlockDeclarationsAndStatements(Block* stmt);
139 void VisitFunctionClosureForContext(); 142 void VisitFunctionClosureForContext();
140 void VisitSetHomeObject(Register value, Register home_object, 143 void VisitSetHomeObject(Register value, Register home_object,
141 LiteralProperty* property, int slot_number = 0); 144 LiteralProperty* property, int slot_number = 0);
142 void VisitObjectLiteralAccessor(Register home_object, 145 void VisitObjectLiteralAccessor(Register home_object,
143 ObjectLiteralProperty* property, 146 ObjectLiteralProperty* property,
144 Register value_out); 147 Register value_out);
145 void VisitForInAssignment(Expression* expr, FeedbackVectorSlot slot); 148 void VisitForInAssignment(Expression* expr, FeedbackVectorSlot slot);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 BytecodeRegisterAllocator* register_allocator() const { 191 BytecodeRegisterAllocator* register_allocator() const {
189 return builder()->register_allocator(); 192 return builder()->register_allocator();
190 } 193 }
191 194
192 GlobalDeclarationsBuilder* globals_builder() { return globals_builder_; } 195 GlobalDeclarationsBuilder* globals_builder() { return globals_builder_; }
193 inline LanguageMode language_mode() const; 196 inline LanguageMode language_mode() const;
194 int feedback_index(FeedbackVectorSlot slot) const; 197 int feedback_index(FeedbackVectorSlot slot) const;
195 198
196 Handle<Name> home_object_symbol() const { return home_object_symbol_; } 199 Handle<Name> home_object_symbol() const { return home_object_symbol_; }
197 Handle<Name> prototype_string() const { return prototype_string_; } 200 Handle<Name> prototype_string() const { return prototype_string_; }
201 Handle<Name> name_string() const { return name_string_; }
198 202
199 Zone* zone_; 203 Zone* zone_;
200 BytecodeArrayBuilder* builder_; 204 BytecodeArrayBuilder* builder_;
201 CompilationInfo* info_; 205 CompilationInfo* info_;
202 DeclarationScope* scope_; 206 DeclarationScope* scope_;
203 207
204 GlobalDeclarationsBuilder* globals_builder_; 208 GlobalDeclarationsBuilder* globals_builder_;
205 ZoneVector<GlobalDeclarationsBuilder*> global_declarations_; 209 ZoneVector<GlobalDeclarationsBuilder*> global_declarations_;
206 ZoneVector<std::pair<FunctionLiteral*, size_t>> function_literals_; 210 ZoneVector<std::pair<FunctionLiteral*, size_t>> function_literals_;
207 ZoneVector<std::pair<NativeFunctionLiteral*, size_t>> 211 ZoneVector<std::pair<NativeFunctionLiteral*, size_t>>
208 native_function_literals_; 212 native_function_literals_;
209 213
210 ControlScope* execution_control_; 214 ControlScope* execution_control_;
211 ContextScope* execution_context_; 215 ContextScope* execution_context_;
212 ExpressionResultScope* execution_result_; 216 ExpressionResultScope* execution_result_;
213 217
214 ZoneVector<BytecodeLabel> generator_resume_points_; 218 ZoneVector<BytecodeLabel> generator_resume_points_;
215 Register generator_state_; 219 Register generator_state_;
216 int loop_depth_; 220 int loop_depth_;
217 221
218 Handle<Name> home_object_symbol_; 222 Handle<Name> home_object_symbol_;
219 Handle<Name> prototype_string_; 223 Handle<Name> prototype_string_;
224 Handle<Name> name_string_;
220 }; 225 };
221 226
222 } // namespace interpreter 227 } // namespace interpreter
223 } // namespace internal 228 } // namespace internal
224 } // namespace v8 229 } // namespace v8
225 230
226 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ 231 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698