OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "src/hydrogen-types.h" | 7 #include "src/hydrogen-types.h" |
8 #include "src/isolate-inl.h" | 8 #include "src/isolate-inl.h" |
9 #include "src/types.h" | 9 #include "src/types.h" |
10 #include "test/cctest/cctest.h" | 10 #include "test/cctest/cctest.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 CHECK(T.Constant(fac->NewNumber(-0x7fffffff - 2.0))->Is(T.PlainNumber)); | 332 CHECK(T.Constant(fac->NewNumber(-0x7fffffff - 2.0))->Is(T.PlainNumber)); |
333 CHECK(!T.Constant(fac->NewNumber(-0x7fffffff - 2.0))->Is(T.Integral32)); | 333 CHECK(!T.Constant(fac->NewNumber(-0x7fffffff - 2.0))->Is(T.Integral32)); |
334 CHECK(T.Constant(fac->NewNumber(0.1))->Is(T.PlainNumber)); | 334 CHECK(T.Constant(fac->NewNumber(0.1))->Is(T.PlainNumber)); |
335 CHECK(!T.Constant(fac->NewNumber(0.1))->Is(T.Integral32)); | 335 CHECK(!T.Constant(fac->NewNumber(0.1))->Is(T.Integral32)); |
336 CHECK(T.Constant(fac->NewNumber(-10.1))->Is(T.PlainNumber)); | 336 CHECK(T.Constant(fac->NewNumber(-10.1))->Is(T.PlainNumber)); |
337 CHECK(!T.Constant(fac->NewNumber(-10.1))->Is(T.Integral32)); | 337 CHECK(!T.Constant(fac->NewNumber(-10.1))->Is(T.Integral32)); |
338 CHECK(T.Constant(fac->NewNumber(10e60))->Is(T.PlainNumber)); | 338 CHECK(T.Constant(fac->NewNumber(10e60))->Is(T.PlainNumber)); |
339 CHECK(!T.Constant(fac->NewNumber(10e60))->Is(T.Integral32)); | 339 CHECK(!T.Constant(fac->NewNumber(10e60))->Is(T.Integral32)); |
340 CHECK(T.Constant(fac->NewNumber(-1.0*0.0))->Is(T.MinusZero)); | 340 CHECK(T.Constant(fac->NewNumber(-1.0*0.0))->Is(T.MinusZero)); |
341 CHECK(T.Constant(fac->NewNumber(v8::base::OS::nan_value()))->Is(T.NaN)); | 341 CHECK(T.Constant(fac->NewNumber(v8::base::OS::nan_value()))->Is(T.NaN)); |
342 CHECK(T.Constant(fac->NewNumber(V8_INFINITY))->Is(T.PlainNumber)); | 342 CHECK(T.Constant(fac->NewNumber(std::numeric_limits<double>::infinity())) |
343 CHECK(!T.Constant(fac->NewNumber(V8_INFINITY))->Is(T.Integral32)); | 343 ->Is(T.PlainNumber)); |
344 CHECK(T.Constant(fac->NewNumber(-V8_INFINITY))->Is(T.PlainNumber)); | 344 CHECK(!T.Constant(fac->NewNumber(std::numeric_limits<double>::infinity())) |
345 CHECK(!T.Constant(fac->NewNumber(-V8_INFINITY))->Is(T.Integral32)); | 345 ->Is(T.Integral32)); |
| 346 CHECK(T.Constant(fac->NewNumber(-std::numeric_limits<double>::infinity())) |
| 347 ->Is(T.PlainNumber)); |
| 348 CHECK(!T.Constant(fac->NewNumber(-std::numeric_limits<double>::infinity())) |
| 349 ->Is(T.Integral32)); |
346 } | 350 } |
347 | 351 |
348 void Range() { | 352 void Range() { |
349 // Constructor | 353 // Constructor |
350 for (ValueIterator i = T.integers.begin(); i != T.integers.end(); ++i) { | 354 for (ValueIterator i = T.integers.begin(); i != T.integers.end(); ++i) { |
351 for (ValueIterator j = T.integers.begin(); j != T.integers.end(); ++j) { | 355 for (ValueIterator j = T.integers.begin(); j != T.integers.end(); ++j) { |
352 i::Handle<i::Object> min = *i; | 356 i::Handle<i::Object> min = *i; |
353 i::Handle<i::Object> max = *j; | 357 i::Handle<i::Object> max = *j; |
354 if (min->Number() > max->Number()) std::swap(min, max); | 358 if (min->Number() > max->Number()) std::swap(min, max); |
355 TypeHandle type = T.Range(min, max); | 359 TypeHandle type = T.Range(min, max); |
(...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2080 ZoneTests().Convert<HeapType, Handle<HeapType>, Isolate, HeapRep>(); | 2084 ZoneTests().Convert<HeapType, Handle<HeapType>, Isolate, HeapRep>(); |
2081 HeapTests().Convert<Type, Type*, Zone, ZoneRep>(); | 2085 HeapTests().Convert<Type, Type*, Zone, ZoneRep>(); |
2082 } | 2086 } |
2083 | 2087 |
2084 | 2088 |
2085 TEST(HTypeFromType) { | 2089 TEST(HTypeFromType) { |
2086 CcTest::InitializeVM(); | 2090 CcTest::InitializeVM(); |
2087 ZoneTests().HTypeFromType(); | 2091 ZoneTests().HTypeFromType(); |
2088 HeapTests().HTypeFromType(); | 2092 HeapTests().HTypeFromType(); |
2089 } | 2093 } |
OLD | NEW |