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/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
8 #include "src/compiler/node-properties-inl.h" | 8 #include "src/compiler/node-properties-inl.h" |
9 #include "src/compiler/typer.h" | 9 #include "src/compiler/typer.h" |
10 #include "src/types.h" | 10 #include "src/types.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 } | 220 } |
221 } | 221 } |
222 | 222 |
223 | 223 |
224 TEST(NumberTypes) { | 224 TEST(NumberTypes) { |
225 JSConstantCacheTester T; | 225 JSConstantCacheTester T; |
226 | 226 |
227 FOR_FLOAT64_INPUTS(i) { | 227 FOR_FLOAT64_INPUTS(i) { |
228 double value = *i; | 228 double value = *i; |
229 Node* node = T.Constant(value); | 229 Node* node = T.Constant(value); |
230 CHECK(T.upper(node)->Is(Type::Of(value, T.main_zone()))); | 230 CHECK(T.upper(node)->Equals(Type::Of(value, T.main_zone()))); |
231 } | 231 } |
232 } | 232 } |
233 | 233 |
234 | 234 |
235 TEST(HeapNumbers) { | 235 TEST(HeapNumbers) { |
236 JSConstantCacheTester T; | 236 JSConstantCacheTester T; |
237 | 237 |
238 FOR_FLOAT64_INPUTS(i) { | 238 FOR_FLOAT64_INPUTS(i) { |
239 double value = *i; | 239 double value = *i; |
240 Handle<Object> num = T.factory()->NewNumber(value); | 240 Handle<Object> num = T.factory()->NewNumber(value); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 CHECK(T.upper(T.NullConstant())->Is(Type::Null())); | 282 CHECK(T.upper(T.NullConstant())->Is(Type::Null())); |
283 CHECK(T.upper(T.ZeroConstant())->Is(Type::Number())); | 283 CHECK(T.upper(T.ZeroConstant())->Is(Type::Number())); |
284 CHECK(T.upper(T.OneConstant())->Is(Type::Number())); | 284 CHECK(T.upper(T.OneConstant())->Is(Type::Number())); |
285 CHECK(T.upper(T.NaNConstant())->Is(Type::NaN())); | 285 CHECK(T.upper(T.NaNConstant())->Is(Type::NaN())); |
286 } | 286 } |
287 | 287 |
288 | 288 |
289 TEST(ExternalReferences) { | 289 TEST(ExternalReferences) { |
290 // TODO(titzer): test canonicalization of external references. | 290 // TODO(titzer): test canonicalization of external references. |
291 } | 291 } |
OLD | NEW |