OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 12329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12340 CHECK_EQ(static_cast<int>(heap_statistics.total_heap_size()), 0); | 12340 CHECK_EQ(static_cast<int>(heap_statistics.total_heap_size()), 0); |
12341 CHECK_EQ(static_cast<int>(heap_statistics.used_heap_size()), 0); | 12341 CHECK_EQ(static_cast<int>(heap_statistics.used_heap_size()), 0); |
12342 v8::V8::GetHeapStatistics(&heap_statistics); | 12342 v8::V8::GetHeapStatistics(&heap_statistics); |
12343 CHECK_NE(static_cast<int>(heap_statistics.total_heap_size()), 0); | 12343 CHECK_NE(static_cast<int>(heap_statistics.total_heap_size()), 0); |
12344 CHECK_NE(static_cast<int>(heap_statistics.used_heap_size()), 0); | 12344 CHECK_NE(static_cast<int>(heap_statistics.used_heap_size()), 0); |
12345 } | 12345 } |
12346 | 12346 |
12347 | 12347 |
12348 static double DoubleFromBits(uint64_t value) { | 12348 static double DoubleFromBits(uint64_t value) { |
12349 double target; | 12349 double target; |
12350 #ifdef BIG_ENDIAN_FLOATING_POINT | |
12351 const int kIntSize = 4; | |
12352 // Somebody swapped the lower and higher half of doubles. | |
12353 memcpy(&target, reinterpret_cast<char*>(&value) + kIntSize, kIntSize); | |
12354 memcpy(reinterpret_cast<char*>(&target) + kIntSize, &value, kIntSize); | |
12355 #else | |
12356 memcpy(&target, &value, sizeof(target)); | 12350 memcpy(&target, &value, sizeof(target)); |
12357 #endif | |
12358 return target; | 12351 return target; |
12359 } | 12352 } |
12360 | 12353 |
12361 | 12354 |
12362 static uint64_t DoubleToBits(double value) { | 12355 static uint64_t DoubleToBits(double value) { |
12363 uint64_t target; | 12356 uint64_t target; |
12364 #ifdef BIG_ENDIAN_FLOATING_POINT | |
12365 const int kIntSize = 4; | |
12366 // Somebody swapped the lower and higher half of doubles. | |
12367 memcpy(&target, reinterpret_cast<char*>(&value) + kIntSize, kIntSize); | |
12368 memcpy(reinterpret_cast<char*>(&target) + kIntSize, &value, kIntSize); | |
12369 #else | |
12370 memcpy(&target, &value, sizeof(target)); | 12357 memcpy(&target, &value, sizeof(target)); |
12371 #endif | |
12372 return target; | 12358 return target; |
12373 } | 12359 } |
12374 | 12360 |
12375 | 12361 |
12376 static double DoubleToDateTime(double input) { | 12362 static double DoubleToDateTime(double input) { |
12377 double date_limit = 864e13; | 12363 double date_limit = 864e13; |
12378 if (IsNaN(input) || input < -date_limit || input > date_limit) { | 12364 if (IsNaN(input) || input < -date_limit || input > date_limit) { |
12379 return i::OS::nan_value(); | 12365 return i::OS::nan_value(); |
12380 } | 12366 } |
12381 return (input < 0) ? -(floor(-input)) : floor(input); | 12367 return (input < 0) ? -(floor(-input)) : floor(input); |
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13899 CHECK(func2->CreationContext() == context2); | 13885 CHECK(func2->CreationContext() == context2); |
13900 CheckContextId(func2, 2); | 13886 CheckContextId(func2, 2); |
13901 CHECK(instance2->CreationContext() == context2); | 13887 CHECK(instance2->CreationContext() == context2); |
13902 CheckContextId(instance2, 2); | 13888 CheckContextId(instance2, 2); |
13903 } | 13889 } |
13904 | 13890 |
13905 context1.Dispose(); | 13891 context1.Dispose(); |
13906 context2.Dispose(); | 13892 context2.Dispose(); |
13907 context3.Dispose(); | 13893 context3.Dispose(); |
13908 } | 13894 } |
OLD | NEW |