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 "src/assembler.h" | 7 #include "src/assembler.h" |
8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 #include "src/compiler/typer.h" | 10 #include "src/compiler/typer.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 CHECK(t->Is(Type::MinusZero())); | 96 CHECK(t->Is(Type::MinusZero())); |
97 CHECK(!t->Is(Type::Integral32())); | 97 CHECK(!t->Is(Type::Integral32())); |
98 CHECK(!t->Is(Type::Signed32())); | 98 CHECK(!t->Is(Type::Signed32())); |
99 CHECK(!t->Is(Type::Unsigned32())); | 99 CHECK(!t->Is(Type::Unsigned32())); |
100 CHECK(!t->Is(Type::SignedSmall())); | 100 CHECK(!t->Is(Type::SignedSmall())); |
101 CHECK(!t->Is(Type::UnsignedSmall())); | 101 CHECK(!t->Is(Type::UnsignedSmall())); |
102 | 102 |
103 double zero_value = OpParameter<double>(zero); | 103 double zero_value = OpParameter<double>(zero); |
104 double minus_zero_value = OpParameter<double>(minus_zero); | 104 double minus_zero_value = OpParameter<double>(minus_zero); |
105 | 105 |
106 CHECK_EQ(0.0, zero_value); | 106 CHECK(bit_cast<uint64_t>(0.0) == bit_cast<uint64_t>(zero_value)); |
107 CHECK_NE(-0.0, zero_value); | 107 CHECK(bit_cast<uint64_t>(-0.0) != bit_cast<uint64_t>(zero_value)); |
108 CHECK_EQ(-0.0, minus_zero_value); | 108 CHECK(bit_cast<uint64_t>(0.0) != bit_cast<uint64_t>(minus_zero_value)); |
109 CHECK_NE(0.0, minus_zero_value); | 109 CHECK(bit_cast<uint64_t>(-0.0) == bit_cast<uint64_t>(minus_zero_value)); |
110 } | 110 } |
111 | 111 |
112 | 112 |
113 TEST(ZeroConstant2) { | 113 TEST(ZeroConstant2) { |
114 JSConstantCacheTester T; | 114 JSConstantCacheTester T; |
115 | 115 |
116 Node* zero = T.Constant(0); | 116 Node* zero = T.Constant(0); |
117 | 117 |
118 CHECK_EQ(IrOpcode::kNumberConstant, zero->opcode()); | 118 CHECK_EQ(IrOpcode::kNumberConstant, zero->opcode()); |
119 CHECK_EQ(zero, T.ZeroConstant()); | 119 CHECK_EQ(zero, T.ZeroConstant()); |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 T.Constant(1.11), | 465 T.Constant(1.11), |
466 T.ExternalConstant(ExternalReference::address_of_one_half())}; | 466 T.ExternalConstant(ExternalReference::address_of_one_half())}; |
467 | 467 |
468 NodeVector nodes(T.main_zone()); | 468 NodeVector nodes(T.main_zone()); |
469 T.GetCachedNodes(&nodes); | 469 T.GetCachedNodes(&nodes); |
470 | 470 |
471 for (size_t i = 0; i < arraysize(constants); i++) { | 471 for (size_t i = 0; i < arraysize(constants); i++) { |
472 CHECK(Contains(&nodes, constants[i])); | 472 CHECK(Contains(&nodes, constants[i])); |
473 } | 473 } |
474 } | 474 } |
OLD | NEW |