| 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 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 } | 1036 } |
| 1037 | 1037 |
| 1038 void BytecodeGraphBuilder::VisitStaLookupSlotSloppy() { | 1038 void BytecodeGraphBuilder::VisitStaLookupSlotSloppy() { |
| 1039 BuildStaLookupSlot(LanguageMode::SLOPPY); | 1039 BuildStaLookupSlot(LanguageMode::SLOPPY); |
| 1040 } | 1040 } |
| 1041 | 1041 |
| 1042 void BytecodeGraphBuilder::VisitStaLookupSlotStrict() { | 1042 void BytecodeGraphBuilder::VisitStaLookupSlotStrict() { |
| 1043 BuildStaLookupSlot(LanguageMode::STRICT); | 1043 BuildStaLookupSlot(LanguageMode::STRICT); |
| 1044 } | 1044 } |
| 1045 | 1045 |
| 1046 Node* BytecodeGraphBuilder::BuildNamedLoad() { | 1046 void BytecodeGraphBuilder::VisitLdaNamedProperty() { |
| 1047 PrepareEagerCheckpoint(); |
| 1047 Node* object = | 1048 Node* object = |
| 1048 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 1049 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| 1049 Handle<Name> name = | 1050 Handle<Name> name = |
| 1050 Handle<Name>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); | 1051 Handle<Name>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); |
| 1051 VectorSlotPair feedback = | 1052 VectorSlotPair feedback = |
| 1052 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2)); | 1053 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2)); |
| 1053 | 1054 |
| 1054 const Operator* op = javascript()->LoadNamed(name, feedback); | 1055 const Operator* op = javascript()->LoadNamed(name, feedback); |
| 1055 return NewNode(op, object, GetFunctionClosure()); | 1056 Node* node = NewNode(op, object, GetFunctionClosure()); |
| 1056 } | |
| 1057 | |
| 1058 void BytecodeGraphBuilder::VisitLdaNamedProperty() { | |
| 1059 PrepareEagerCheckpoint(); | |
| 1060 Node* node = BuildNamedLoad(); | |
| 1061 environment()->BindAccumulator(node, Environment::kAttachFrameState); | 1057 environment()->BindAccumulator(node, Environment::kAttachFrameState); |
| 1062 } | 1058 } |
| 1063 | 1059 |
| 1064 void BytecodeGraphBuilder::VisitLdrNamedProperty() { | 1060 void BytecodeGraphBuilder::VisitLdaKeyedProperty() { |
| 1065 PrepareEagerCheckpoint(); | 1061 PrepareEagerCheckpoint(); |
| 1066 Node* node = BuildNamedLoad(); | |
| 1067 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(3), node, | |
| 1068 Environment::kAttachFrameState); | |
| 1069 } | |
| 1070 | |
| 1071 Node* BytecodeGraphBuilder::BuildKeyedLoad() { | |
| 1072 Node* key = environment()->LookupAccumulator(); | 1062 Node* key = environment()->LookupAccumulator(); |
| 1073 Node* object = | 1063 Node* object = |
| 1074 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 1064 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| 1075 VectorSlotPair feedback = | 1065 VectorSlotPair feedback = |
| 1076 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1)); | 1066 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1)); |
| 1077 | 1067 |
| 1078 const Operator* op = javascript()->LoadProperty(feedback); | 1068 const Operator* op = javascript()->LoadProperty(feedback); |
| 1079 return NewNode(op, object, key, GetFunctionClosure()); | 1069 Node* node = NewNode(op, object, key, GetFunctionClosure()); |
| 1080 } | |
| 1081 | |
| 1082 void BytecodeGraphBuilder::VisitLdaKeyedProperty() { | |
| 1083 PrepareEagerCheckpoint(); | |
| 1084 Node* node = BuildKeyedLoad(); | |
| 1085 environment()->BindAccumulator(node, Environment::kAttachFrameState); | 1070 environment()->BindAccumulator(node, Environment::kAttachFrameState); |
| 1086 } | 1071 } |
| 1087 | 1072 |
| 1088 void BytecodeGraphBuilder::VisitLdrKeyedProperty() { | |
| 1089 PrepareEagerCheckpoint(); | |
| 1090 Node* node = BuildKeyedLoad(); | |
| 1091 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(2), node, | |
| 1092 Environment::kAttachFrameState); | |
| 1093 } | |
| 1094 | |
| 1095 void BytecodeGraphBuilder::BuildNamedStore(LanguageMode language_mode) { | 1073 void BytecodeGraphBuilder::BuildNamedStore(LanguageMode language_mode) { |
| 1096 PrepareEagerCheckpoint(); | 1074 PrepareEagerCheckpoint(); |
| 1097 Node* value = environment()->LookupAccumulator(); | 1075 Node* value = environment()->LookupAccumulator(); |
| 1098 Node* object = | 1076 Node* object = |
| 1099 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 1077 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| 1100 Handle<Name> name = | 1078 Handle<Name> name = |
| 1101 Handle<Name>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); | 1079 Handle<Name>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); |
| 1102 VectorSlotPair feedback = | 1080 VectorSlotPair feedback = |
| 1103 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2)); | 1081 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2)); |
| 1104 | 1082 |
| (...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2259 source_positions_->set_current_position(it->source_position()); | 2237 source_positions_->set_current_position(it->source_position()); |
| 2260 it->Advance(); | 2238 it->Advance(); |
| 2261 } else { | 2239 } else { |
| 2262 DCHECK_GT(it->code_offset(), offset); | 2240 DCHECK_GT(it->code_offset(), offset); |
| 2263 } | 2241 } |
| 2264 } | 2242 } |
| 2265 | 2243 |
| 2266 } // namespace compiler | 2244 } // namespace compiler |
| 2267 } // namespace internal | 2245 } // namespace internal |
| 2268 } // namespace v8 | 2246 } // namespace v8 |
| OLD | NEW |