| 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/compiler/bytecode-branch-analysis.h" | 7 #include "src/compiler/bytecode-branch-analysis.h" |
| 8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
| 9 #include "src/compiler/operator-properties.h" | 9 #include "src/compiler/operator-properties.h" |
| 10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 } | 148 } |
| 149 | 149 |
| 150 | 150 |
| 151 Node* BytecodeGraphBuilder::Environment::LookupAccumulator() const { | 151 Node* BytecodeGraphBuilder::Environment::LookupAccumulator() const { |
| 152 return values()->at(accumulator_base_); | 152 return values()->at(accumulator_base_); |
| 153 } | 153 } |
| 154 | 154 |
| 155 | 155 |
| 156 Node* BytecodeGraphBuilder::Environment::LookupRegister( | 156 Node* BytecodeGraphBuilder::Environment::LookupRegister( |
| 157 interpreter::Register the_register) const { | 157 interpreter::Register the_register) const { |
| 158 if (the_register.is_function_context()) { | 158 if (the_register.is_current_context()) { |
| 159 return builder()->GetFunctionContext(); | 159 return Context(); |
| 160 } else if (the_register.is_function_closure()) { | 160 } else if (the_register.is_function_closure()) { |
| 161 return builder()->GetFunctionClosure(); | 161 return builder()->GetFunctionClosure(); |
| 162 } else if (the_register.is_new_target()) { | 162 } else if (the_register.is_new_target()) { |
| 163 return builder()->GetNewTarget(); | 163 return builder()->GetNewTarget(); |
| 164 } else { | 164 } else { |
| 165 int values_index = RegisterToValuesIndex(the_register); | 165 int values_index = RegisterToValuesIndex(the_register); |
| 166 return values()->at(values_index); | 166 return values()->at(values_index); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| (...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 | 1027 |
| 1028 void BytecodeGraphBuilder::VisitKeyedStoreICStrictWide( | 1028 void BytecodeGraphBuilder::VisitKeyedStoreICStrictWide( |
| 1029 const interpreter::BytecodeArrayIterator& iterator) { | 1029 const interpreter::BytecodeArrayIterator& iterator) { |
| 1030 DCHECK(is_strict(language_mode())); | 1030 DCHECK(is_strict(language_mode())); |
| 1031 BuildKeyedStore(iterator); | 1031 BuildKeyedStore(iterator); |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 | 1034 |
| 1035 void BytecodeGraphBuilder::VisitPushContext( | 1035 void BytecodeGraphBuilder::VisitPushContext( |
| 1036 const interpreter::BytecodeArrayIterator& iterator) { | 1036 const interpreter::BytecodeArrayIterator& iterator) { |
| 1037 Node* context = environment()->LookupAccumulator(); | 1037 Node* new_context = environment()->LookupAccumulator(); |
| 1038 environment()->BindRegister(iterator.GetRegisterOperand(0), context); | 1038 environment()->BindRegister(iterator.GetRegisterOperand(0), |
| 1039 environment()->SetContext(context); | 1039 environment()->Context()); |
| 1040 environment()->SetContext(new_context); |
| 1040 } | 1041 } |
| 1041 | 1042 |
| 1042 | 1043 |
| 1043 void BytecodeGraphBuilder::VisitPopContext( | 1044 void BytecodeGraphBuilder::VisitPopContext( |
| 1044 const interpreter::BytecodeArrayIterator& iterator) { | 1045 const interpreter::BytecodeArrayIterator& iterator) { |
| 1045 Node* context = environment()->LookupRegister(iterator.GetRegisterOperand(0)); | 1046 Node* context = environment()->LookupRegister(iterator.GetRegisterOperand(0)); |
| 1046 environment()->SetContext(context); | 1047 environment()->SetContext(context); |
| 1047 } | 1048 } |
| 1048 | 1049 |
| 1049 | 1050 |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2100 | 2101 |
| 2101 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 2102 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
| 2102 if (environment()->IsMarkedAsUnreachable()) return; | 2103 if (environment()->IsMarkedAsUnreachable()) return; |
| 2103 environment()->MarkAsUnreachable(); | 2104 environment()->MarkAsUnreachable(); |
| 2104 exit_controls_.push_back(exit); | 2105 exit_controls_.push_back(exit); |
| 2105 } | 2106 } |
| 2106 | 2107 |
| 2107 } // namespace compiler | 2108 } // namespace compiler |
| 2108 } // namespace internal | 2109 } // namespace internal |
| 2109 } // namespace v8 | 2110 } // namespace v8 |
| OLD | NEW |