| 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 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 | 1110 |
| 1111 void BytecodeGraphBuilder::VisitStaKeyedPropertySloppy() { | 1111 void BytecodeGraphBuilder::VisitStaKeyedPropertySloppy() { |
| 1112 BuildKeyedStore(LanguageMode::SLOPPY); | 1112 BuildKeyedStore(LanguageMode::SLOPPY); |
| 1113 } | 1113 } |
| 1114 | 1114 |
| 1115 void BytecodeGraphBuilder::VisitStaKeyedPropertyStrict() { | 1115 void BytecodeGraphBuilder::VisitStaKeyedPropertyStrict() { |
| 1116 BuildKeyedStore(LanguageMode::STRICT); | 1116 BuildKeyedStore(LanguageMode::STRICT); |
| 1117 } | 1117 } |
| 1118 | 1118 |
| 1119 void BytecodeGraphBuilder::VisitLdaModuleVariable() { | 1119 void BytecodeGraphBuilder::VisitLdaModuleVariable() { |
| 1120 // TODO(neis): Don't call the runtime. | 1120 int32_t cell_index = bytecode_iterator().GetImmediateOperand(0); |
| 1121 PrepareEagerCheckpoint(); | 1121 uint32_t depth = bytecode_iterator().GetUnsignedImmediateOperand(1); |
| 1122 Node* index = jsgraph()->Constant(bytecode_iterator().GetImmediateOperand(0)); | 1122 Node* module = |
| 1123 const Operator* op = javascript()->CallRuntime(Runtime::kLoadModuleVariable); | 1123 NewNode(javascript()->LoadContext(depth, Context::EXTENSION_INDEX, false), |
| 1124 Node* value = NewNode(op, index); | 1124 environment()->Context()); |
| 1125 environment()->BindAccumulator(value, Environment::kAttachFrameState); | 1125 Node* value = NewNode(javascript()->LoadModule(cell_index), module); |
| 1126 environment()->BindAccumulator(value); |
| 1126 } | 1127 } |
| 1127 | 1128 |
| 1128 void BytecodeGraphBuilder::VisitStaModuleVariable() { | 1129 void BytecodeGraphBuilder::VisitStaModuleVariable() { |
| 1129 // TODO(neis): Don't call the runtime. | 1130 int32_t cell_index = bytecode_iterator().GetImmediateOperand(0); |
| 1130 PrepareEagerCheckpoint(); | 1131 uint32_t depth = bytecode_iterator().GetUnsignedImmediateOperand(1); |
| 1131 Node* index = jsgraph()->Constant(bytecode_iterator().GetImmediateOperand(0)); | 1132 Node* module = |
| 1133 NewNode(javascript()->LoadContext(depth, Context::EXTENSION_INDEX, false), |
| 1134 environment()->Context()); |
| 1132 Node* value = environment()->LookupAccumulator(); | 1135 Node* value = environment()->LookupAccumulator(); |
| 1133 const Operator* op = javascript()->CallRuntime(Runtime::kStoreModuleVariable); | 1136 NewNode(javascript()->StoreModule(cell_index), module, value); |
| 1134 Node* store = NewNode(op, index, value); | |
| 1135 environment()->RecordAfterState(store, Environment::kAttachFrameState); | |
| 1136 } | 1137 } |
| 1137 | 1138 |
| 1138 void BytecodeGraphBuilder::VisitPushContext() { | 1139 void BytecodeGraphBuilder::VisitPushContext() { |
| 1139 Node* new_context = environment()->LookupAccumulator(); | 1140 Node* new_context = environment()->LookupAccumulator(); |
| 1140 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), | 1141 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), |
| 1141 environment()->Context()); | 1142 environment()->Context()); |
| 1142 environment()->SetContext(new_context); | 1143 environment()->SetContext(new_context); |
| 1143 } | 1144 } |
| 1144 | 1145 |
| 1145 void BytecodeGraphBuilder::VisitPopContext() { | 1146 void BytecodeGraphBuilder::VisitPopContext() { |
| (...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2237 source_positions_->set_current_position(it->source_position()); | 2238 source_positions_->set_current_position(it->source_position()); |
| 2238 it->Advance(); | 2239 it->Advance(); |
| 2239 } else { | 2240 } else { |
| 2240 DCHECK_GT(it->code_offset(), offset); | 2241 DCHECK_GT(it->code_offset(), offset); |
| 2241 } | 2242 } |
| 2242 } | 2243 } |
| 2243 | 2244 |
| 2244 } // namespace compiler | 2245 } // namespace compiler |
| 2245 } // namespace internal | 2246 } // namespace internal |
| 2246 } // namespace v8 | 2247 } // namespace v8 |
| OLD | NEW |