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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 314 |
315 TEST_F(JSTypedLoweringTest, JSToNumberWithPlainPrimitive) { | 315 TEST_F(JSTypedLoweringTest, JSToNumberWithPlainPrimitive) { |
316 Node* const input = Parameter(Type::PlainPrimitive(), 0); | 316 Node* const input = Parameter(Type::PlainPrimitive(), 0); |
317 Node* const context = Parameter(Type::Any(), 1); | 317 Node* const context = Parameter(Type::Any(), 1); |
318 Node* const effect = graph()->start(); | 318 Node* const effect = graph()->start(); |
319 Node* const control = graph()->start(); | 319 Node* const control = graph()->start(); |
320 Reduction r = | 320 Reduction r = |
321 Reduce(graph()->NewNode(javascript()->ToNumber(), input, context, | 321 Reduce(graph()->NewNode(javascript()->ToNumber(), input, context, |
322 EmptyFrameState(), effect, control)); | 322 EmptyFrameState(), effect, control)); |
323 ASSERT_TRUE(r.Changed()); | 323 ASSERT_TRUE(r.Changed()); |
324 EXPECT_THAT(r.replacement(), IsToNumber(input, IsNumberConstant(BitEq(0.0)), | 324 EXPECT_THAT(r.replacement(), IsPlainPrimitiveToNumber(input)); |
325 graph()->start(), control)); | |
326 } | 325 } |
327 | 326 |
328 | 327 |
329 // ----------------------------------------------------------------------------- | 328 // ----------------------------------------------------------------------------- |
330 // JSToObject | 329 // JSToObject |
331 | 330 |
332 | 331 |
333 TEST_F(JSTypedLoweringTest, JSToObjectWithAny) { | 332 TEST_F(JSTypedLoweringTest, JSToObjectWithAny) { |
334 Node* const input = Parameter(Type::Any(), 0); | 333 Node* const input = Parameter(Type::Any(), 0); |
335 Node* const context = Parameter(Type::Any(), 1); | 334 Node* const context = Parameter(Type::Any(), 1); |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 Node* dummy = graph()->NewNode(javascript()->ToObject(), instanceOf, context, | 945 Node* dummy = graph()->NewNode(javascript()->ToObject(), instanceOf, context, |
947 frame_state, effect, control); | 946 frame_state, effect, control); |
948 Reduction r = Reduce(instanceOf); | 947 Reduction r = Reduce(instanceOf); |
949 ASSERT_FALSE(r.Changed()); | 948 ASSERT_FALSE(r.Changed()); |
950 ASSERT_EQ(instanceOf, dummy->InputAt(0)); | 949 ASSERT_EQ(instanceOf, dummy->InputAt(0)); |
951 } | 950 } |
952 | 951 |
953 } // namespace compiler | 952 } // namespace compiler |
954 } // namespace internal | 953 } // namespace internal |
955 } // namespace v8 | 954 } // namespace v8 |
OLD | NEW |