| 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/access-builder.h" | 5 #include "src/compiler/access-builder.h" |
| 6 #include "src/compiler/diamond.h" | 6 #include "src/compiler/diamond.h" |
| 7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
| 8 #include "src/compiler/js-intrinsic-lowering.h" | 8 #include "src/compiler/js-intrinsic-lowering.h" |
| 9 #include "src/compiler/js-operator.h" | 9 #include "src/compiler/js-operator.h" |
| 10 #include "test/unittests/compiler/graph-unittest.h" | 10 #include "test/unittests/compiler/graph-unittest.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 Node* const context = Parameter(1); | 137 Node* const context = Parameter(1); |
| 138 Node* const effect = graph()->start(); | 138 Node* const effect = graph()->start(); |
| 139 Node* const control = graph()->start(); | 139 Node* const control = graph()->start(); |
| 140 Reduction const r = Reduce(graph()->NewNode( | 140 Reduction const r = Reduce(graph()->NewNode( |
| 141 javascript()->CallRuntime(Runtime::kInlineIsJSReceiver, 1), input, | 141 javascript()->CallRuntime(Runtime::kInlineIsJSReceiver, 1), input, |
| 142 context, effect, control)); | 142 context, effect, control)); |
| 143 ASSERT_TRUE(r.Changed()); | 143 ASSERT_TRUE(r.Changed()); |
| 144 EXPECT_THAT(r.replacement(), IsObjectIsReceiver(input)); | 144 EXPECT_THAT(r.replacement(), IsObjectIsReceiver(input)); |
| 145 } | 145 } |
| 146 | 146 |
| 147 // ----------------------------------------------------------------------------- |
| 148 // %_CreateJSGeneratorObject |
| 149 |
| 150 TEST_F(JSIntrinsicLoweringTest, InlineCreateJSGeneratorObject) { |
| 151 Node* const function = Parameter(0); |
| 152 Node* const receiver = Parameter(1); |
| 153 Node* const context = Parameter(2); |
| 154 Node* const effect = graph()->start(); |
| 155 Node* const control = graph()->start(); |
| 156 Reduction const r = Reduce(graph()->NewNode( |
| 157 javascript()->CallRuntime(Runtime::kInlineCreateJSGeneratorObject, 2), |
| 158 function, receiver, context, effect, control)); |
| 159 ASSERT_TRUE(r.Changed()); |
| 160 EXPECT_EQ(IrOpcode::kJSCreateGeneratorObject, |
| 161 r.replacement()->op()->opcode()); |
| 162 } |
| 163 |
| 147 } // namespace compiler | 164 } // namespace compiler |
| 148 } // namespace internal | 165 } // namespace internal |
| 149 } // namespace v8 | 166 } // namespace v8 |
| OLD | NEW |