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(std::numeric_limits<double>::infinity())) | 342 CHECK(T.Constant(fac->NewNumber(V8_INFINITY))->Is(T.PlainNumber)); |
343 ->Is(T.PlainNumber)); | 343 CHECK(!T.Constant(fac->NewNumber(V8_INFINITY))->Is(T.Integral32)); |
344 CHECK(!T.Constant(fac->NewNumber(std::numeric_limits<double>::infinity())) | 344 CHECK(T.Constant(fac->NewNumber(-V8_INFINITY))->Is(T.PlainNumber)); |
345 ->Is(T.Integral32)); | 345 CHECK(!T.Constant(fac->NewNumber(-V8_INFINITY))->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)); | |
350 } | 346 } |
351 | 347 |
352 void Range() { | 348 void Range() { |
353 // Constructor | 349 // Constructor |
354 for (ValueIterator i = T.integers.begin(); i != T.integers.end(); ++i) { | 350 for (ValueIterator i = T.integers.begin(); i != T.integers.end(); ++i) { |
355 for (ValueIterator j = T.integers.begin(); j != T.integers.end(); ++j) { | 351 for (ValueIterator j = T.integers.begin(); j != T.integers.end(); ++j) { |
356 i::Handle<i::Object> min = *i; | 352 i::Handle<i::Object> min = *i; |
357 i::Handle<i::Object> max = *j; | 353 i::Handle<i::Object> max = *j; |
358 if (min->Number() > max->Number()) std::swap(min, max); | 354 if (min->Number() > max->Number()) std::swap(min, max); |
359 TypeHandle type = T.Range(min, max); | 355 TypeHandle type = T.Range(min, max); |
(...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2084 ZoneTests().Convert<HeapType, Handle<HeapType>, Isolate, HeapRep>(); | 2080 ZoneTests().Convert<HeapType, Handle<HeapType>, Isolate, HeapRep>(); |
2085 HeapTests().Convert<Type, Type*, Zone, ZoneRep>(); | 2081 HeapTests().Convert<Type, Type*, Zone, ZoneRep>(); |
2086 } | 2082 } |
2087 | 2083 |
2088 | 2084 |
2089 TEST(HTypeFromType) { | 2085 TEST(HTypeFromType) { |
2090 CcTest::InitializeVM(); | 2086 CcTest::InitializeVM(); |
2091 ZoneTests().HTypeFromType(); | 2087 ZoneTests().HTypeFromType(); |
2092 HeapTests().HTypeFromType(); | 2088 HeapTests().HTypeFromType(); |
2093 } | 2089 } |
OLD | NEW |