OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 2893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2904 | 2904 |
2905 | 2905 |
2906 void Heap::CreateInitialObjects() { | 2906 void Heap::CreateInitialObjects() { |
2907 HandleScope scope(isolate()); | 2907 HandleScope scope(isolate()); |
2908 Factory* factory = isolate()->factory(); | 2908 Factory* factory = isolate()->factory(); |
2909 | 2909 |
2910 // The -0 value must be set before NewNumber works. | 2910 // The -0 value must be set before NewNumber works. |
2911 set_minus_zero_value(*factory->NewHeapNumber(-0.0, IMMUTABLE, TENURED)); | 2911 set_minus_zero_value(*factory->NewHeapNumber(-0.0, IMMUTABLE, TENURED)); |
2912 DCHECK(std::signbit(minus_zero_value()->Number()) != 0); | 2912 DCHECK(std::signbit(minus_zero_value()->Number()) != 0); |
2913 | 2913 |
2914 set_nan_value( | 2914 set_nan_value(*factory->NewHeapNumber( |
2915 *factory->NewHeapNumber(base::OS::nan_value(), IMMUTABLE, TENURED)); | 2915 std::numeric_limits<double>::quiet_NaN(), IMMUTABLE, TENURED)); |
2916 set_infinity_value(*factory->NewHeapNumber(V8_INFINITY, IMMUTABLE, TENURED)); | 2916 set_infinity_value(*factory->NewHeapNumber(V8_INFINITY, IMMUTABLE, TENURED)); |
2917 | 2917 |
2918 // The hole has not been created yet, but we want to put something | 2918 // The hole has not been created yet, but we want to put something |
2919 // predictable in the gaps in the string table, so lets make that Smi zero. | 2919 // predictable in the gaps in the string table, so lets make that Smi zero. |
2920 set_the_hole_value(reinterpret_cast<Oddball*>(Smi::FromInt(0))); | 2920 set_the_hole_value(reinterpret_cast<Oddball*>(Smi::FromInt(0))); |
2921 | 2921 |
2922 // Allocate initial string table. | 2922 // Allocate initial string table. |
2923 set_string_table(*StringTable::New(isolate(), kInitialStringTableSize)); | 2923 set_string_table(*StringTable::New(isolate(), kInitialStringTableSize)); |
2924 | 2924 |
2925 // Finish initializing oddballs after creating the string table. | 2925 // Finish initializing oddballs after creating the string table. |
(...skipping 3512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6438 static_cast<int>(object_sizes_last_time_[index])); | 6438 static_cast<int>(object_sizes_last_time_[index])); |
6439 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6439 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6440 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6440 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6441 | 6441 |
6442 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6442 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6443 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6443 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6444 ClearObjectStats(); | 6444 ClearObjectStats(); |
6445 } | 6445 } |
6446 } | 6446 } |
6447 } // namespace v8::internal | 6447 } // namespace v8::internal |
OLD | NEW |