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 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 } | 1131 } |
1132 | 1132 |
1133 void BytecodeGraphBuilder::VisitStaKeyedPropertySloppy() { | 1133 void BytecodeGraphBuilder::VisitStaKeyedPropertySloppy() { |
1134 BuildKeyedStore(LanguageMode::SLOPPY); | 1134 BuildKeyedStore(LanguageMode::SLOPPY); |
1135 } | 1135 } |
1136 | 1136 |
1137 void BytecodeGraphBuilder::VisitStaKeyedPropertyStrict() { | 1137 void BytecodeGraphBuilder::VisitStaKeyedPropertyStrict() { |
1138 BuildKeyedStore(LanguageMode::STRICT); | 1138 BuildKeyedStore(LanguageMode::STRICT); |
1139 } | 1139 } |
1140 | 1140 |
| 1141 void BytecodeGraphBuilder::VisitLdaModuleVariable() { |
| 1142 // TODO(neis): Don't call the runtime. |
| 1143 PrepareEagerCheckpoint(); |
| 1144 Node* index = jsgraph()->Constant(bytecode_iterator().GetImmediateOperand(0)); |
| 1145 const Operator* op = javascript()->CallRuntime(Runtime::kLoadModuleVariable); |
| 1146 Node* value = NewNode(op, index); |
| 1147 environment()->BindAccumulator(value, Environment::kAttachFrameState); |
| 1148 } |
| 1149 |
| 1150 void BytecodeGraphBuilder::VisitStaModuleVariable() { |
| 1151 // TODO(neis): Don't call the runtime. |
| 1152 PrepareEagerCheckpoint(); |
| 1153 Node* index = jsgraph()->Constant(bytecode_iterator().GetImmediateOperand(0)); |
| 1154 Node* value = environment()->LookupAccumulator(); |
| 1155 const Operator* op = javascript()->CallRuntime(Runtime::kStoreModuleVariable); |
| 1156 Node* store = NewNode(op, index, value); |
| 1157 environment()->RecordAfterState(store, Environment::kAttachFrameState); |
| 1158 } |
| 1159 |
1141 void BytecodeGraphBuilder::VisitPushContext() { | 1160 void BytecodeGraphBuilder::VisitPushContext() { |
1142 Node* new_context = environment()->LookupAccumulator(); | 1161 Node* new_context = environment()->LookupAccumulator(); |
1143 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), | 1162 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), |
1144 environment()->Context()); | 1163 environment()->Context()); |
1145 environment()->SetContext(new_context); | 1164 environment()->SetContext(new_context); |
1146 } | 1165 } |
1147 | 1166 |
1148 void BytecodeGraphBuilder::VisitPopContext() { | 1167 void BytecodeGraphBuilder::VisitPopContext() { |
1149 Node* context = | 1168 Node* context = |
1150 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 1169 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2240 source_positions_->set_current_position(it->source_position()); | 2259 source_positions_->set_current_position(it->source_position()); |
2241 it->Advance(); | 2260 it->Advance(); |
2242 } else { | 2261 } else { |
2243 DCHECK_GT(it->code_offset(), offset); | 2262 DCHECK_GT(it->code_offset(), offset); |
2244 } | 2263 } |
2245 } | 2264 } |
2246 | 2265 |
2247 } // namespace compiler | 2266 } // namespace compiler |
2248 } // namespace internal | 2267 } // namespace internal |
2249 } // namespace v8 | 2268 } // namespace v8 |
OLD | NEW |