| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 isolate()->factory()->NewStringFromAsciiChecked(string); | 74 isolate()->factory()->NewStringFromAsciiChecked(string); |
| 75 MaybeHandle<Object> result = | 75 MaybeHandle<Object> result = |
| 76 JSReceiver::SetProperty(global, name, value, SLOPPY); | 76 JSReceiver::SetProperty(global, name, value, SLOPPY); |
| 77 result.Assert(); | 77 result.Assert(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 Node* ReturnLoadNamedFromGlobal( | 80 Node* ReturnLoadNamedFromGlobal( |
| 81 const char* string, Node* effect, Node* control, | 81 const char* string, Node* effect, Node* control, |
| 82 JSTypeFeedbackSpecializer::DeoptimizationMode mode) { | 82 JSTypeFeedbackSpecializer::DeoptimizationMode mode) { |
| 83 VectorSlotPair feedback; | 83 VectorSlotPair feedback; |
| 84 Node* global = UndefinedConstant(); | |
| 85 Node* vector = UndefinedConstant(); | 84 Node* vector = UndefinedConstant(); |
| 86 Node* context = UndefinedConstant(); | 85 Node* context = UndefinedConstant(); |
| 87 | 86 |
| 88 Handle<Name> name = isolate()->factory()->InternalizeUtf8String(string); | 87 Handle<Name> name = isolate()->factory()->InternalizeUtf8String(string); |
| 89 const Operator* op = javascript()->LoadGlobal(name, feedback); | 88 const Operator* op = javascript()->LoadGlobal(name, feedback); |
| 90 Node* load = | 89 Node* load = graph()->NewNode(op, vector, context, EmptyFrameState(), |
| 91 graph()->NewNode(op, context, global, vector, context, | 90 EmptyFrameState(), effect, control); |
| 92 EmptyFrameState(), EmptyFrameState(), effect, control); | |
| 93 Node* if_success = graph()->NewNode(common()->IfSuccess(), load); | 91 Node* if_success = graph()->NewNode(common()->IfSuccess(), load); |
| 94 return graph()->NewNode(common()->Return(), load, load, if_success); | 92 return graph()->NewNode(common()->Return(), load, load, if_success); |
| 95 } | 93 } |
| 96 | 94 |
| 97 CompilationDependencies* dependencies() { return &dependencies_; } | 95 CompilationDependencies* dependencies() { return &dependencies_; } |
| 98 | 96 |
| 99 private: | 97 private: |
| 100 JSOperatorBuilder javascript_; | 98 JSOperatorBuilder javascript_; |
| 101 CompilationDependencies dependencies_; | 99 CompilationDependencies dependencies_; |
| 102 }; | 100 }; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 IsReturn(load_field_match, load_field_match, graph()->start())); | 327 IsReturn(load_field_match, load_field_match, graph()->start())); |
| 330 EXPECT_THAT(graph()->end(), IsEnd(ret)); | 328 EXPECT_THAT(graph()->end(), IsEnd(ret)); |
| 331 | 329 |
| 332 EXPECT_FALSE(dependencies()->IsEmpty()); | 330 EXPECT_FALSE(dependencies()->IsEmpty()); |
| 333 dependencies()->Rollback(); | 331 dependencies()->Rollback(); |
| 334 } | 332 } |
| 335 | 333 |
| 336 } // namespace compiler | 334 } // namespace compiler |
| 337 } // namespace internal | 335 } // namespace internal |
| 338 } // namespace v8 | 336 } // namespace v8 |
| OLD | NEW |