OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/compiler/access-builder.h" | 6 #include "src/compiler/access-builder.h" |
7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
8 #include "src/compiler/js-operator.h" | 8 #include "src/compiler/js-operator.h" |
9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 javascript()->CreateLiteralObject(ObjectLiteral::kShallowProperties), | 947 javascript()->CreateLiteralObject(ObjectLiteral::kShallowProperties), |
948 input0, input1, input2, context, frame_state, effect, control)); | 948 input0, input1, input2, context, frame_state, effect, control)); |
949 ASSERT_TRUE(r.Changed()); | 949 ASSERT_TRUE(r.Changed()); |
950 EXPECT_THAT( | 950 EXPECT_THAT( |
951 r.replacement(), | 951 r.replacement(), |
952 IsCall(_, IsHeapConstant(Unique<HeapObject>::CreateImmovable( | 952 IsCall(_, IsHeapConstant(Unique<HeapObject>::CreateImmovable( |
953 CodeFactory::FastCloneShallowObject(isolate(), 6).code())), | 953 CodeFactory::FastCloneShallowObject(isolate(), 6).code())), |
954 input0, input1, input2, _, context, frame_state, effect, control)); | 954 input0, input1, input2, _, context, frame_state, effect, control)); |
955 } | 955 } |
956 | 956 |
| 957 |
| 958 // ----------------------------------------------------------------------------- |
| 959 // JSCreateWithContext |
| 960 |
| 961 |
| 962 TEST_F(JSTypedLoweringTest, JSCreateWithContext) { |
| 963 FLAG_turbo_allocate = true; |
| 964 Node* const object = Parameter(Type::Receiver()); |
| 965 Node* const closure = Parameter(Type::Any()); |
| 966 Node* const context = Parameter(Type::Any()); |
| 967 Node* const frame_state = EmptyFrameState(); |
| 968 Node* const effect = graph()->start(); |
| 969 Node* const control = graph()->start(); |
| 970 Reduction r = |
| 971 Reduce(graph()->NewNode(javascript()->CreateWithContext(), object, |
| 972 closure, context, frame_state, effect, control)); |
| 973 ASSERT_TRUE(r.Changed()); |
| 974 EXPECT_THAT(r.replacement(), |
| 975 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( |
| 976 Context::MIN_CONTEXT_SLOTS)), |
| 977 effect, control), |
| 978 _)); |
| 979 } |
| 980 |
957 } // namespace compiler | 981 } // namespace compiler |
958 } // namespace internal | 982 } // namespace internal |
959 } // namespace v8 | 983 } // namespace v8 |
OLD | NEW |