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 <limits> |
| 6 |
5 #include "src/v8.h" | 7 #include "src/v8.h" |
6 | 8 |
7 #include "src/accessors.h" | 9 #include "src/accessors.h" |
8 #include "src/api.h" | 10 #include "src/api.h" |
9 #include "src/base/bits.h" | 11 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 12 #include "src/base/once.h" |
11 #include "src/base/utils/random-number-generator.h" | 13 #include "src/base/utils/random-number-generator.h" |
12 #include "src/bootstrapper.h" | 14 #include "src/bootstrapper.h" |
13 #include "src/codegen.h" | 15 #include "src/codegen.h" |
14 #include "src/compilation-cache.h" | 16 #include "src/compilation-cache.h" |
(...skipping 2886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2901 void Heap::CreateInitialObjects() { | 2903 void Heap::CreateInitialObjects() { |
2902 HandleScope scope(isolate()); | 2904 HandleScope scope(isolate()); |
2903 Factory* factory = isolate()->factory(); | 2905 Factory* factory = isolate()->factory(); |
2904 | 2906 |
2905 // The -0 value must be set before NewNumber works. | 2907 // The -0 value must be set before NewNumber works. |
2906 set_minus_zero_value(*factory->NewHeapNumber(-0.0, IMMUTABLE, TENURED)); | 2908 set_minus_zero_value(*factory->NewHeapNumber(-0.0, IMMUTABLE, TENURED)); |
2907 DCHECK(std::signbit(minus_zero_value()->Number()) != 0); | 2909 DCHECK(std::signbit(minus_zero_value()->Number()) != 0); |
2908 | 2910 |
2909 set_nan_value( | 2911 set_nan_value( |
2910 *factory->NewHeapNumber(base::OS::nan_value(), IMMUTABLE, TENURED)); | 2912 *factory->NewHeapNumber(base::OS::nan_value(), IMMUTABLE, TENURED)); |
2911 set_infinity_value(*factory->NewHeapNumber(V8_INFINITY, IMMUTABLE, TENURED)); | 2913 set_infinity_value(*factory->NewHeapNumber( |
| 2914 std::numeric_limits<double>::infinity(), IMMUTABLE, TENURED)); |
2912 | 2915 |
2913 // The hole has not been created yet, but we want to put something | 2916 // The hole has not been created yet, but we want to put something |
2914 // predictable in the gaps in the string table, so lets make that Smi zero. | 2917 // predictable in the gaps in the string table, so lets make that Smi zero. |
2915 set_the_hole_value(reinterpret_cast<Oddball*>(Smi::FromInt(0))); | 2918 set_the_hole_value(reinterpret_cast<Oddball*>(Smi::FromInt(0))); |
2916 | 2919 |
2917 // Allocate initial string table. | 2920 // Allocate initial string table. |
2918 set_string_table(*StringTable::New(isolate(), kInitialStringTableSize)); | 2921 set_string_table(*StringTable::New(isolate(), kInitialStringTableSize)); |
2919 | 2922 |
2920 // Finish initializing oddballs after creating the string table. | 2923 // Finish initializing oddballs after creating the string table. |
2921 Oddball::Initialize(isolate(), factory->undefined_value(), "undefined", | 2924 Oddball::Initialize(isolate(), factory->undefined_value(), "undefined", |
(...skipping 3511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6433 static_cast<int>(object_sizes_last_time_[index])); | 6436 static_cast<int>(object_sizes_last_time_[index])); |
6434 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6437 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6435 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6438 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6436 | 6439 |
6437 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6440 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6438 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6441 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6439 ClearObjectStats(); | 6442 ClearObjectStats(); |
6440 } | 6443 } |
6441 } | 6444 } |
6442 } // namespace v8::internal | 6445 } // namespace v8::internal |
OLD | NEW |