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

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

Issue 1721723002: [interpreter] Clean super property handling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 24 matching lines...) Expand all
35 class ControlScopeForBreakable; 35 class ControlScopeForBreakable;
36 class ControlScopeForIteration; 36 class ControlScopeForIteration;
37 class ControlScopeForTopLevel; 37 class ControlScopeForTopLevel;
38 class ControlScopeForTryCatch; 38 class ControlScopeForTryCatch;
39 class ControlScopeForTryFinally; 39 class ControlScopeForTryFinally;
40 class ExpressionResultScope; 40 class ExpressionResultScope;
41 class EffectResultScope; 41 class EffectResultScope;
42 class AccumulatorResultScope; 42 class AccumulatorResultScope;
43 class RegisterResultScope; 43 class RegisterResultScope;
44 class RegisterAllocationScope; 44 class RegisterAllocationScope;
45 class SuperPropertyArguments;
46 45
47 void MakeBytecodeBody(); 46 void MakeBytecodeBody();
48 47
49 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); 48 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
50 49
51 // Dispatched from VisitBinaryOperation. 50 // Dispatched from VisitBinaryOperation.
52 void VisitArithmeticExpression(BinaryOperation* binop); 51 void VisitArithmeticExpression(BinaryOperation* binop);
53 void VisitCommaExpression(BinaryOperation* binop); 52 void VisitCommaExpression(BinaryOperation* binop);
54 void VisitLogicalOrExpression(BinaryOperation* binop); 53 void VisitLogicalOrExpression(BinaryOperation* binop);
55 void VisitLogicalAndExpression(BinaryOperation* binop); 54 void VisitLogicalAndExpression(BinaryOperation* binop);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); 86 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF);
88 void VisitVariableLoadForAccumulatorValue( 87 void VisitVariableLoadForAccumulatorValue(
89 Variable* variable, FeedbackVectorSlot slot, 88 Variable* variable, FeedbackVectorSlot slot,
90 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); 89 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF);
91 MUST_USE_RESULT Register 90 MUST_USE_RESULT Register
92 VisitVariableLoadForRegisterValue(Variable* variable, FeedbackVectorSlot slot, 91 VisitVariableLoadForRegisterValue(Variable* variable, FeedbackVectorSlot slot,
93 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); 92 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF);
94 void VisitVariableAssignment(Variable* variable, Token::Value op, 93 void VisitVariableAssignment(Variable* variable, Token::Value op,
95 FeedbackVectorSlot slot); 94 FeedbackVectorSlot slot);
96 95
97 void PrepareNamedSuperPropertyArguments( 96 void BuildNamedSuperPropertyStore(Register receiver);
98 SuperPropertyReference* super_property, Handle<Name> name, 97 void BuildKeyedSuperPropertyStore(Register receiver);
99 SuperPropertyArguments* super_property_args); 98 void BuildNamedSuperPropertyLoad(Register receiver);
100 void PrepareKeyedSuperPropertyArguments( 99 void BuildKeyedSuperPropertyLoad(Register receiver);
101 SuperPropertyReference* super_property, Expression* key,
102 SuperPropertyArguments* super_property_args);
103 void BuildNamedSuperPropertyLoad(SuperPropertyArguments* super_property_args);
104 void BuildKeyedSuperPropertyLoad(SuperPropertyArguments* super_property_args);
105 void BuildNamedSuperPropertyStore(
106 SuperPropertyArguments* super_property_args);
107 void BuildKeyedSuperPropertyStore(
108 SuperPropertyArguments* super_property_args);
109 100
110 void BuildThrowIfHole(Handle<String> name); 101 void BuildThrowIfHole(Handle<String> name);
111 void BuildThrowIfNotHole(Handle<String> name); 102 void BuildThrowIfNotHole(Handle<String> name);
112 void BuildThrowReassignConstant(Handle<String> name); 103 void BuildThrowReassignConstant(Handle<String> name);
113 void BuildThrowReferenceError(Handle<String> name); 104 void BuildThrowReferenceError(Handle<String> name);
114 void BuildHoleCheckForVariableLoad(VariableMode mode, Handle<String> name); 105 void BuildHoleCheckForVariableLoad(VariableMode mode, Handle<String> name);
115 void BuildHoleCheckForVariableAssignment(Variable* variable, Token::Value op); 106 void BuildHoleCheckForVariableAssignment(Variable* variable, Token::Value op);
116 107
117 void VisitArgumentsObject(Variable* variable); 108 void VisitArgumentsObject(Variable* variable);
118 void VisitRestArgumentsArray(Variable* rest); 109 void VisitRestArgumentsArray(Variable* rest);
(...skipping 23 matching lines...) Expand all
142 void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop_builder); 133 void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop_builder);
143 134
144 // Visit a statement and switch scopes, the context is in the accumulator. 135 // Visit a statement and switch scopes, the context is in the accumulator.
145 void VisitInScope(Statement* stmt, Scope* scope); 136 void VisitInScope(Statement* stmt, Scope* scope);
146 137
147 // Visitors for obtaining expression result in the accumulator, in a 138 // Visitors for obtaining expression result in the accumulator, in a
148 // register, or just getting the effect. 139 // register, or just getting the effect.
149 void VisitForAccumulatorValue(Expression* expr); 140 void VisitForAccumulatorValue(Expression* expr);
150 void VisitForAccumulatorValueOrTheHole(Expression* expr); 141 void VisitForAccumulatorValueOrTheHole(Expression* expr);
151 MUST_USE_RESULT Register VisitForRegisterValue(Expression* expr); 142 MUST_USE_RESULT Register VisitForRegisterValue(Expression* expr);
143 void VisitForRegisterValue(Expression* expr, Register destination);
152 void VisitForEffect(Expression* expr); 144 void VisitForEffect(Expression* expr);
153 145
154 // Methods for tracking and remapping register. 146 // Methods for tracking and remapping register.
155 void RecordStoreToRegister(Register reg); 147 void RecordStoreToRegister(Register reg);
156 Register LoadFromAliasedRegister(Register reg); 148 Register LoadFromAliasedRegister(Register reg);
157 149
158 // Methods for tracking try-block nesting. 150 // Methods for tracking try-block nesting.
159 bool IsInsideTryCatch() const { return try_catch_nesting_level_ > 0; } 151 bool IsInsideTryCatch() const { return try_catch_nesting_level_ > 0; }
160 bool IsInsideTryFinally() const { return try_finally_nesting_level_ > 0; } 152 bool IsInsideTryFinally() const { return try_finally_nesting_level_ > 0; }
161 153
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 RegisterAllocationScope* register_allocator_; 202 RegisterAllocationScope* register_allocator_;
211 int try_catch_nesting_level_; 203 int try_catch_nesting_level_;
212 int try_finally_nesting_level_; 204 int try_finally_nesting_level_;
213 }; 205 };
214 206
215 } // namespace interpreter 207 } // namespace interpreter
216 } // namespace internal 208 } // namespace internal
217 } // namespace v8 209 } // namespace v8
218 210
219 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ 211 #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