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/heap/heap.h" | 5 #include "src/heap/heap.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/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 2311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2322 ALLOCATE_MAP(FOREIGN_TYPE, Foreign::kSize, foreign) | 2322 ALLOCATE_MAP(FOREIGN_TYPE, Foreign::kSize, foreign) |
2323 | 2323 |
2324 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, the_hole); | 2324 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, the_hole); |
2325 ALLOCATE_PRIMITIVE_MAP(ODDBALL_TYPE, Oddball::kSize, boolean, | 2325 ALLOCATE_PRIMITIVE_MAP(ODDBALL_TYPE, Oddball::kSize, boolean, |
2326 Context::BOOLEAN_FUNCTION_INDEX); | 2326 Context::BOOLEAN_FUNCTION_INDEX); |
2327 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, uninitialized); | 2327 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, uninitialized); |
2328 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, arguments_marker); | 2328 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, arguments_marker); |
2329 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, no_interceptor_result_sentinel); | 2329 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, no_interceptor_result_sentinel); |
2330 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, exception); | 2330 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, exception); |
2331 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, termination_exception); | 2331 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, termination_exception); |
| 2332 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, optimized_out); |
2332 | 2333 |
2333 for (unsigned i = 0; i < arraysize(string_type_table); i++) { | 2334 for (unsigned i = 0; i < arraysize(string_type_table); i++) { |
2334 const StringTypeTable& entry = string_type_table[i]; | 2335 const StringTypeTable& entry = string_type_table[i]; |
2335 { | 2336 { |
2336 AllocationResult allocation = AllocateMap(entry.type, entry.size); | 2337 AllocationResult allocation = AllocateMap(entry.type, entry.size); |
2337 if (!allocation.To(&obj)) return false; | 2338 if (!allocation.To(&obj)) return false; |
2338 } | 2339 } |
2339 Map* map = Map::cast(obj); | 2340 Map* map = Map::cast(obj); |
2340 map->SetConstructorFunctionIndex(Context::STRING_FUNCTION_INDEX); | 2341 map->SetConstructorFunctionIndex(Context::STRING_FUNCTION_INDEX); |
2341 // Mark cons string maps as unstable, because their objects can change | 2342 // Mark cons string maps as unstable, because their objects can change |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2693 | 2694 |
2694 set_termination_exception(*factory->NewOddball( | 2695 set_termination_exception(*factory->NewOddball( |
2695 factory->termination_exception_map(), "termination_exception", | 2696 factory->termination_exception_map(), "termination_exception", |
2696 handle(Smi::FromInt(-3), isolate()), false, "undefined", | 2697 handle(Smi::FromInt(-3), isolate()), false, "undefined", |
2697 Oddball::kOther)); | 2698 Oddball::kOther)); |
2698 | 2699 |
2699 set_exception(*factory->NewOddball(factory->exception_map(), "exception", | 2700 set_exception(*factory->NewOddball(factory->exception_map(), "exception", |
2700 handle(Smi::FromInt(-5), isolate()), false, | 2701 handle(Smi::FromInt(-5), isolate()), false, |
2701 "undefined", Oddball::kException)); | 2702 "undefined", Oddball::kException)); |
2702 | 2703 |
| 2704 set_optimized_out( |
| 2705 *factory->NewOddball(factory->optimized_out_map(), "optimized_out", |
| 2706 handle(Smi::FromInt(-6), isolate()), false, |
| 2707 "undefined", Oddball::kOptimizedOut)); |
| 2708 |
2703 for (unsigned i = 0; i < arraysize(constant_string_table); i++) { | 2709 for (unsigned i = 0; i < arraysize(constant_string_table); i++) { |
2704 Handle<String> str = | 2710 Handle<String> str = |
2705 factory->InternalizeUtf8String(constant_string_table[i].contents); | 2711 factory->InternalizeUtf8String(constant_string_table[i].contents); |
2706 roots_[constant_string_table[i].index] = *str; | 2712 roots_[constant_string_table[i].index] = *str; |
2707 } | 2713 } |
2708 | 2714 |
2709 // Create the code_stubs dictionary. The initial size is set to avoid | 2715 // Create the code_stubs dictionary. The initial size is set to avoid |
2710 // expanding the dictionary during bootstrapping. | 2716 // expanding the dictionary during bootstrapping. |
2711 set_code_stubs(*UnseededNumberDictionary::New(isolate(), 128)); | 2717 set_code_stubs(*UnseededNumberDictionary::New(isolate(), 128)); |
2712 | 2718 |
(...skipping 3684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6397 } | 6403 } |
6398 | 6404 |
6399 | 6405 |
6400 // static | 6406 // static |
6401 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6407 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6402 return StaticVisitorBase::GetVisitorId(map); | 6408 return StaticVisitorBase::GetVisitorId(map); |
6403 } | 6409 } |
6404 | 6410 |
6405 } // namespace internal | 6411 } // namespace internal |
6406 } // namespace v8 | 6412 } // namespace v8 |
OLD | NEW |