| 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.h" | 5 #include "src/compiler.h" |
| 6 | 6 |
| 7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
| 8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
| 9 #include "src/compiler/js-operator.h" | 9 #include "src/compiler/js-operator.h" |
| 10 #include "src/compiler/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 Node* ReturnLoadNamedFromGlobal( | 77 Node* ReturnLoadNamedFromGlobal( |
| 78 const char* string, Node* effect, Node* control, | 78 const char* string, Node* effect, Node* control, |
| 79 JSTypeFeedbackSpecializer::DeoptimizationMode mode) { | 79 JSTypeFeedbackSpecializer::DeoptimizationMode mode) { |
| 80 VectorSlotPair feedback; | 80 VectorSlotPair feedback; |
| 81 Node* global = UndefinedConstant(); | 81 Node* global = UndefinedConstant(); |
| 82 Node* vector = UndefinedConstant(); | 82 Node* vector = UndefinedConstant(); |
| 83 Node* context = UndefinedConstant(); | 83 Node* context = UndefinedConstant(); |
| 84 | 84 |
| 85 Handle<Name> name = isolate()->factory()->InternalizeUtf8String(string); | 85 Handle<Name> name = isolate()->factory()->InternalizeUtf8String(string); |
| 86 const Operator* op = javascript()->LoadGlobal(name, feedback); | 86 const Operator* op = javascript()->LoadGlobal(name, feedback); |
| 87 Node* load = graph()->NewNode(op, context, global, vector, context); | 87 Node* load = |
| 88 if (mode == JSTypeFeedbackSpecializer::kDeoptimizationEnabled) { | 88 graph()->NewNode(op, context, global, vector, context, |
| 89 for (int i = 0; i < OperatorProperties::GetFrameStateInputCount(op); | 89 EmptyFrameState(), EmptyFrameState(), effect, control); |
| 90 i++) { | |
| 91 load->AppendInput(zone(), EmptyFrameState()); | |
| 92 } | |
| 93 } | |
| 94 load->AppendInput(zone(), effect); | |
| 95 load->AppendInput(zone(), control); | |
| 96 Node* if_success = graph()->NewNode(common()->IfSuccess(), load); | 90 Node* if_success = graph()->NewNode(common()->IfSuccess(), load); |
| 97 return graph()->NewNode(common()->Return(), load, load, if_success); | 91 return graph()->NewNode(common()->Return(), load, load, if_success); |
| 98 } | 92 } |
| 99 | 93 |
| 100 CompilationDependencies* dependencies() { return &dependencies_; } | 94 CompilationDependencies* dependencies() { return &dependencies_; } |
| 101 | 95 |
| 102 private: | 96 private: |
| 103 JSOperatorBuilder javascript_; | 97 JSOperatorBuilder javascript_; |
| 104 CompilationDependencies dependencies_; | 98 CompilationDependencies dependencies_; |
| 105 }; | 99 }; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 IsReturn(load_field_match, load_field_match, graph()->start())); | 326 IsReturn(load_field_match, load_field_match, graph()->start())); |
| 333 EXPECT_THAT(graph()->end(), IsEnd(ret)); | 327 EXPECT_THAT(graph()->end(), IsEnd(ret)); |
| 334 | 328 |
| 335 EXPECT_FALSE(dependencies()->IsEmpty()); | 329 EXPECT_FALSE(dependencies()->IsEmpty()); |
| 336 dependencies()->Rollback(); | 330 dependencies()->Rollback(); |
| 337 } | 331 } |
| 338 | 332 |
| 339 } // namespace compiler | 333 } // namespace compiler |
| 340 } // namespace internal | 334 } // namespace internal |
| 341 } // namespace v8 | 335 } // namespace v8 |
| OLD | NEW |