Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "src/compiler/bytecode-graph-builder.h" | 5 #include "src/compiler/bytecode-graph-builder.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
| 10 #include "src/compiler/bytecode-branch-analysis.h" | 10 #include "src/compiler/bytecode-branch-analysis.h" |
| (...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 void BytecodeGraphBuilder::VisitStaKeyedPropertySloppy() { | 1127 void BytecodeGraphBuilder::VisitStaKeyedPropertySloppy() { |
| 1128 BuildKeyedStore(LanguageMode::SLOPPY); | 1128 BuildKeyedStore(LanguageMode::SLOPPY); |
| 1129 } | 1129 } |
| 1130 | 1130 |
| 1131 void BytecodeGraphBuilder::VisitStaKeyedPropertyStrict() { | 1131 void BytecodeGraphBuilder::VisitStaKeyedPropertyStrict() { |
| 1132 BuildKeyedStore(LanguageMode::STRICT); | 1132 BuildKeyedStore(LanguageMode::STRICT); |
| 1133 } | 1133 } |
| 1134 | 1134 |
| 1135 void BytecodeGraphBuilder::VisitLdaModuleVariable() { | |
| 1136 // TODO(neis): Don't call the runtime. | |
|
Benedikt Meurer
2016/11/04 16:45:59
So next step is to introduce JSLoadModuleVariable
| |
| 1137 PrepareEagerCheckpoint(); | |
| 1138 Node* index = jsgraph()->Constant(bytecode_iterator().GetImmediateOperand(0)); | |
| 1139 const Operator* op = javascript()->CallRuntime(Runtime::kLoadModuleVariable); | |
| 1140 Node* value = NewNode(op, index); | |
| 1141 environment()->BindAccumulator(value, Environment::kAttachFrameState); | |
| 1142 } | |
| 1143 | |
| 1144 void BytecodeGraphBuilder::VisitStaModuleVariable() { | |
| 1145 // TODO(neis): Don't call the runtime. | |
| 1146 PrepareEagerCheckpoint(); | |
| 1147 Node* index = jsgraph()->Constant(bytecode_iterator().GetImmediateOperand(0)); | |
| 1148 Node* value = environment()->LookupAccumulator(); | |
| 1149 const Operator* op = javascript()->CallRuntime(Runtime::kStoreModuleVariable); | |
| 1150 Node* store = NewNode(op, index, value); | |
| 1151 environment()->RecordAfterState(store, Environment::kAttachFrameState); | |
| 1152 } | |
| 1153 | |
| 1135 void BytecodeGraphBuilder::VisitPushContext() { | 1154 void BytecodeGraphBuilder::VisitPushContext() { |
| 1136 Node* new_context = environment()->LookupAccumulator(); | 1155 Node* new_context = environment()->LookupAccumulator(); |
| 1137 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), | 1156 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), |
| 1138 environment()->Context()); | 1157 environment()->Context()); |
| 1139 environment()->SetContext(new_context); | 1158 environment()->SetContext(new_context); |
| 1140 } | 1159 } |
| 1141 | 1160 |
| 1142 void BytecodeGraphBuilder::VisitPopContext() { | 1161 void BytecodeGraphBuilder::VisitPopContext() { |
| 1143 Node* context = | 1162 Node* context = |
| 1144 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 1163 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2233 source_positions_->set_current_position(it->source_position()); | 2252 source_positions_->set_current_position(it->source_position()); |
| 2234 it->Advance(); | 2253 it->Advance(); |
| 2235 } else { | 2254 } else { |
| 2236 DCHECK_GT(it->code_offset(), offset); | 2255 DCHECK_GT(it->code_offset(), offset); |
| 2237 } | 2256 } |
| 2238 } | 2257 } |
| 2239 | 2258 |
| 2240 } // namespace compiler | 2259 } // namespace compiler |
| 2241 } // namespace internal | 2260 } // namespace internal |
| 2242 } // namespace v8 | 2261 } // namespace v8 |
| OLD | NEW |