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 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2299 } | 2299 } |
2300 Map* map = Map::cast(obj); | 2300 Map* map = Map::cast(obj); |
2301 map->SetConstructorFunctionIndex(Context::STRING_FUNCTION_INDEX); | 2301 map->SetConstructorFunctionIndex(Context::STRING_FUNCTION_INDEX); |
2302 // Mark cons string maps as unstable, because their objects can change | 2302 // Mark cons string maps as unstable, because their objects can change |
2303 // maps during GC. | 2303 // maps during GC. |
2304 if (StringShape(entry.type).IsCons()) map->mark_unstable(); | 2304 if (StringShape(entry.type).IsCons()) map->mark_unstable(); |
2305 roots_[entry.index] = map; | 2305 roots_[entry.index] = map; |
2306 } | 2306 } |
2307 | 2307 |
2308 { // Create a separate external one byte string map for native sources. | 2308 { // Create a separate external one byte string map for native sources. |
2309 AllocationResult allocation = AllocateMap(EXTERNAL_ONE_BYTE_STRING_TYPE, | 2309 AllocationResult allocation = |
2310 ExternalOneByteString::kSize); | 2310 AllocateMap(SHORT_EXTERNAL_ONE_BYTE_STRING_TYPE, |
| 2311 ExternalOneByteString::kShortSize); |
2311 if (!allocation.To(&obj)) return false; | 2312 if (!allocation.To(&obj)) return false; |
2312 Map* map = Map::cast(obj); | 2313 Map* map = Map::cast(obj); |
2313 map->SetConstructorFunctionIndex(Context::STRING_FUNCTION_INDEX); | 2314 map->SetConstructorFunctionIndex(Context::STRING_FUNCTION_INDEX); |
2314 set_native_source_string_map(map); | 2315 set_native_source_string_map(map); |
2315 } | 2316 } |
2316 | 2317 |
2317 ALLOCATE_VARSIZE_MAP(FIXED_DOUBLE_ARRAY_TYPE, fixed_double_array) | 2318 ALLOCATE_VARSIZE_MAP(FIXED_DOUBLE_ARRAY_TYPE, fixed_double_array) |
2318 fixed_double_array_map()->set_elements_kind(FAST_HOLEY_DOUBLE_ELEMENTS); | 2319 fixed_double_array_map()->set_elements_kind(FAST_HOLEY_DOUBLE_ELEMENTS); |
2319 ALLOCATE_VARSIZE_MAP(BYTE_ARRAY_TYPE, byte_array) | 2320 ALLOCATE_VARSIZE_MAP(BYTE_ARRAY_TYPE, byte_array) |
2320 ALLOCATE_VARSIZE_MAP(BYTECODE_ARRAY_TYPE, bytecode_array) | 2321 ALLOCATE_VARSIZE_MAP(BYTECODE_ARRAY_TYPE, bytecode_array) |
(...skipping 4039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6360 } | 6361 } |
6361 | 6362 |
6362 | 6363 |
6363 // static | 6364 // static |
6364 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6365 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6365 return StaticVisitorBase::GetVisitorId(map); | 6366 return StaticVisitorBase::GetVisitorId(map); |
6366 } | 6367 } |
6367 | 6368 |
6368 } // namespace internal | 6369 } // namespace internal |
6369 } // namespace v8 | 6370 } // namespace v8 |
OLD | NEW |