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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "test/cctest/cctest.h" | 7 #include "test/cctest/cctest.h" |
8 #include "test/cctest/compiler/codegen-tester.h" | 8 #include "test/cctest/compiler/codegen-tester.h" |
9 #include "test/cctest/compiler/value-helper.h" | 9 #include "test/cctest/compiler/value-helper.h" |
10 | 10 |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 CHECK_EQ(expect, m->Call(input_a, input_b)); | 366 CHECK_EQ(expect, m->Call(input_a, input_b)); |
367 } | 367 } |
368 } | 368 } |
369 | 369 |
370 | 370 |
371 #if V8_TURBOFAN_TARGET | 371 #if V8_TURBOFAN_TARGET |
372 | 372 |
373 TEST(ParametersEqual) { | 373 TEST(ParametersEqual) { |
374 RawMachineAssemblerTester<int32_t> m(kMachInt32, kMachInt32); | 374 RawMachineAssemblerTester<int32_t> m(kMachInt32, kMachInt32); |
375 Node* p1 = m.Parameter(1); | 375 Node* p1 = m.Parameter(1); |
376 CHECK_NE(NULL, p1); | 376 CHECK(p1); |
377 Node* p0 = m.Parameter(0); | 377 Node* p0 = m.Parameter(0); |
378 CHECK_NE(NULL, p0); | 378 CHECK(p0); |
379 CHECK_EQ(p0, m.Parameter(0)); | 379 CHECK_EQ(p0, m.Parameter(0)); |
380 CHECK_EQ(p1, m.Parameter(1)); | 380 CHECK_EQ(p1, m.Parameter(1)); |
381 } | 381 } |
382 | 382 |
383 | 383 |
384 void RunSmiConstant(int32_t v) { | 384 void RunSmiConstant(int32_t v) { |
385 // TODO(dcarney): on x64 Smis are generated with the SmiConstantRegister | 385 // TODO(dcarney): on x64 Smis are generated with the SmiConstantRegister |
386 #if !V8_TARGET_ARCH_X64 | 386 #if !V8_TARGET_ARCH_X64 |
387 if (Smi::IsValid(v)) { | 387 if (Smi::IsValid(v)) { |
388 RawMachineAssemblerTester<Object*> m; | 388 RawMachineAssemblerTester<Object*> m; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 bt.AddReturn(bt.param1); | 554 bt.AddReturn(bt.param1); |
555 | 555 |
556 FOR_INT32_INPUTS(i) { CHECK_EQ(*i, bt.call(666, *i)); } | 556 FOR_INT32_INPUTS(i) { CHECK_EQ(*i, bt.call(666, *i)); } |
557 } | 557 } |
558 | 558 |
559 { | 559 { |
560 RawMachineAssemblerTester<int32_t> m; | 560 RawMachineAssemblerTester<int32_t> m; |
561 Float64BinopTester bt(&m); | 561 Float64BinopTester bt(&m); |
562 bt.AddReturn(bt.param0); | 562 bt.AddReturn(bt.param0); |
563 | 563 |
564 FOR_FLOAT64_INPUTS(i) { CHECK_EQ(*i, bt.call(*i, 9.0)); } | 564 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(*i, bt.call(*i, 9.0)); } |
565 } | 565 } |
566 | 566 |
567 { | 567 { |
568 RawMachineAssemblerTester<int32_t> m; | 568 RawMachineAssemblerTester<int32_t> m; |
569 Float64BinopTester bt(&m); | 569 Float64BinopTester bt(&m); |
570 bt.AddReturn(bt.param1); | 570 bt.AddReturn(bt.param1); |
571 | 571 |
572 FOR_FLOAT64_INPUTS(i) { CHECK_EQ(*i, bt.call(-11.25, *i)); } | 572 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(*i, bt.call(-11.25, *i)); } |
573 } | 573 } |
574 } | 574 } |
575 | 575 |
576 #endif // V8_TURBOFAN_TARGET | 576 #endif // V8_TURBOFAN_TARGET |
OLD | NEW |