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 2504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2515 AllocationResult allocation = AllocateMap(entry.type, entry.size); | 2515 AllocationResult allocation = AllocateMap(entry.type, entry.size); |
2516 if (!allocation.To(&obj)) return false; | 2516 if (!allocation.To(&obj)) return false; |
2517 } | 2517 } |
2518 // Mark cons string maps as unstable, because their objects can change | 2518 // Mark cons string maps as unstable, because their objects can change |
2519 // maps during GC. | 2519 // maps during GC. |
2520 Map* map = Map::cast(obj); | 2520 Map* map = Map::cast(obj); |
2521 if (StringShape(entry.type).IsCons()) map->mark_unstable(); | 2521 if (StringShape(entry.type).IsCons()) map->mark_unstable(); |
2522 roots_[entry.index] = map; | 2522 roots_[entry.index] = map; |
2523 } | 2523 } |
2524 | 2524 |
| 2525 { // Create a separate external one byte string map for native sources. |
| 2526 AllocationResult allocation = AllocateMap(EXTERNAL_ONE_BYTE_STRING_TYPE, |
| 2527 ExternalOneByteString::kSize); |
| 2528 if (!allocation.To(&obj)) return false; |
| 2529 set_native_source_string_map(Map::cast(obj)); |
| 2530 } |
| 2531 |
2525 ALLOCATE_VARSIZE_MAP(STRING_TYPE, undetectable_string) | 2532 ALLOCATE_VARSIZE_MAP(STRING_TYPE, undetectable_string) |
2526 undetectable_string_map()->set_is_undetectable(); | 2533 undetectable_string_map()->set_is_undetectable(); |
2527 | 2534 |
2528 ALLOCATE_VARSIZE_MAP(ONE_BYTE_STRING_TYPE, undetectable_one_byte_string); | 2535 ALLOCATE_VARSIZE_MAP(ONE_BYTE_STRING_TYPE, undetectable_one_byte_string); |
2529 undetectable_one_byte_string_map()->set_is_undetectable(); | 2536 undetectable_one_byte_string_map()->set_is_undetectable(); |
2530 | 2537 |
2531 ALLOCATE_VARSIZE_MAP(FIXED_DOUBLE_ARRAY_TYPE, fixed_double_array) | 2538 ALLOCATE_VARSIZE_MAP(FIXED_DOUBLE_ARRAY_TYPE, fixed_double_array) |
2532 ALLOCATE_VARSIZE_MAP(BYTE_ARRAY_TYPE, byte_array) | 2539 ALLOCATE_VARSIZE_MAP(BYTE_ARRAY_TYPE, byte_array) |
2533 ALLOCATE_VARSIZE_MAP(FREE_SPACE_TYPE, free_space) | 2540 ALLOCATE_VARSIZE_MAP(FREE_SPACE_TYPE, free_space) |
2534 | 2541 |
(...skipping 3611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6146 static_cast<int>(object_sizes_last_time_[index])); | 6153 static_cast<int>(object_sizes_last_time_[index])); |
6147 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6154 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6148 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6155 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6149 | 6156 |
6150 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6157 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6151 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6158 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6152 ClearObjectStats(); | 6159 ClearObjectStats(); |
6153 } | 6160 } |
6154 } | 6161 } |
6155 } // namespace v8::internal | 6162 } // namespace v8::internal |
OLD | NEW |