Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(859)

Side by Side Diff: test/unittests/compiler/js-typed-lowering-unittest.cc

Issue 1109773002: [turbofan] Add SimplifiedOperator::Allocate operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 input0, input1, input2, context, frame_state, effect, control)); 960 input0, input1, input2, context, frame_state, effect, control));
961 ASSERT_TRUE(r.Changed()); 961 ASSERT_TRUE(r.Changed());
962 EXPECT_THAT( 962 EXPECT_THAT(
963 r.replacement(), 963 r.replacement(),
964 IsCall(_, IsHeapConstant(Unique<HeapObject>::CreateImmovable( 964 IsCall(_, IsHeapConstant(Unique<HeapObject>::CreateImmovable(
965 CodeFactory::FastCloneShallowObject(isolate(), 6).code())), 965 CodeFactory::FastCloneShallowObject(isolate(), 6).code())),
966 input0, input1, input2, _, context, frame_state, effect, control)); 966 input0, input1, input2, _, context, frame_state, effect, control));
967 } 967 }
968 #endif 968 #endif
969 969
970
971 // -----------------------------------------------------------------------------
972 // JSCreateWithContext
973
974
975 TEST_F(JSTypedLoweringTest, JSCreateWithContext) {
976 FLAG_turbo_allocate = true;
977 Node* const object = Parameter(Type::Receiver());
978 Node* const closure = Parameter(Type::Any());
979 Node* const context = Parameter(Type::Any());
980 Node* const frame_state = EmptyFrameState();
981 Node* const effect = graph()->start();
982 Node* const control = graph()->start();
983 Reduction r =
984 Reduce(graph()->NewNode(javascript()->CreateWithContext(), object,
985 closure, context, frame_state, effect, control));
986 ASSERT_TRUE(r.Changed());
987 EXPECT_THAT(r.replacement(),
988 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor(
989 Context::MIN_CONTEXT_SLOTS)),
990 effect, control),
991 _));
992 }
993
970 } // namespace compiler 994 } // namespace compiler
971 } // namespace internal 995 } // namespace internal
972 } // namespace v8 996 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-simplified-lowering.cc ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698