| Index: test/unittests/compiler/js-typed-lowering-unittest.cc
|
| diff --git a/test/unittests/compiler/js-typed-lowering-unittest.cc b/test/unittests/compiler/js-typed-lowering-unittest.cc
|
| index c58c1cd490bc1261025f14224d11751a11c37f2b..6fc89bb0ea44bc1b19bd2f40a95515feb3764e36 100644
|
| --- a/test/unittests/compiler/js-typed-lowering-unittest.cc
|
| +++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
|
| @@ -952,6 +952,25 @@ TEST_F(JSTypedLoweringTest, JSCreateArgumentsViaStub) {
|
| }
|
|
|
|
|
| +TEST_F(JSTypedLoweringTest, JSCreateArgumentsRestArrayViaStub) {
|
| + Node* const closure = Parameter(Type::Any());
|
| + Node* const context = UndefinedConstant();
|
| + Node* const effect = graph()->start();
|
| + Node* const control = graph()->start();
|
| + Handle<SharedFunctionInfo> shared(isolate()->object_function()->shared());
|
| + Node* const frame_state = FrameState(shared, graph()->start());
|
| + Reduction r = Reduce(graph()->NewNode(
|
| + javascript()->CreateArguments(CreateArgumentsParameters::kRestArray, 0),
|
| + closure, context, frame_state, effect, control));
|
| + ASSERT_TRUE(r.Changed());
|
| + EXPECT_THAT(
|
| + r.replacement(),
|
| + IsCall(_,
|
| + IsHeapConstant(CodeFactory::RestArgumentsAccess(isolate()).code()),
|
| + IsNumberConstant(0), _, IsNumberConstant(0), _, effect, control));
|
| +}
|
| +
|
| +
|
| TEST_F(JSTypedLoweringTest, JSCreateArgumentsInlinedMapped) {
|
| Node* const closure = Parameter(Type::Any());
|
| Node* const context = UndefinedConstant();
|
| @@ -968,7 +987,7 @@ TEST_F(JSTypedLoweringTest, JSCreateArgumentsInlinedMapped) {
|
| EXPECT_THAT(r.replacement(),
|
| IsFinishRegion(
|
| IsAllocate(IsNumberConstant(Heap::kSloppyArgumentsObjectSize),
|
| - IsBeginRegion(effect), control),
|
| + _, control),
|
| _));
|
| }
|
|
|
| @@ -989,11 +1008,29 @@ TEST_F(JSTypedLoweringTest, JSCreateArgumentsInlinedUnmapped) {
|
| EXPECT_THAT(r.replacement(),
|
| IsFinishRegion(
|
| IsAllocate(IsNumberConstant(Heap::kStrictArgumentsObjectSize),
|
| - IsBeginRegion(effect), control),
|
| + _, control),
|
| _));
|
| }
|
|
|
|
|
| +TEST_F(JSTypedLoweringTest, JSCreateArgumentsInlinedRestArray) {
|
| + Node* const closure = Parameter(Type::Any());
|
| + Node* const context = UndefinedConstant();
|
| + Node* const effect = graph()->start();
|
| + Node* const control = graph()->start();
|
| + Handle<SharedFunctionInfo> shared(isolate()->object_function()->shared());
|
| + Node* const frame_state_outer = FrameState(shared, graph()->start());
|
| + Node* const frame_state_inner = FrameState(shared, frame_state_outer);
|
| + Reduction r = Reduce(graph()->NewNode(
|
| + javascript()->CreateArguments(CreateArgumentsParameters::kRestArray, 0),
|
| + closure, context, frame_state_inner, effect, control));
|
| + ASSERT_TRUE(r.Changed());
|
| + EXPECT_THAT(r.replacement(),
|
| + IsFinishRegion(
|
| + IsAllocate(IsNumberConstant(JSArray::kSize), _, control), _));
|
| +}
|
| +
|
| +
|
| // -----------------------------------------------------------------------------
|
| // JSCreateClosure
|
|
|
|
|