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 2339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2350 if (FLAG_unbox_double_fields) { | 2350 if (FLAG_unbox_double_fields) { |
2351 reinterpret_cast<Map*>(result) | 2351 reinterpret_cast<Map*>(result) |
2352 ->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); | 2352 ->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); |
2353 } | 2353 } |
2354 reinterpret_cast<Map*>(result)->set_inobject_properties(0); | 2354 reinterpret_cast<Map*>(result)->set_inobject_properties(0); |
2355 reinterpret_cast<Map*>(result)->set_pre_allocated_property_fields(0); | 2355 reinterpret_cast<Map*>(result)->set_pre_allocated_property_fields(0); |
2356 reinterpret_cast<Map*>(result)->set_unused_property_fields(0); | 2356 reinterpret_cast<Map*>(result)->set_unused_property_fields(0); |
2357 reinterpret_cast<Map*>(result)->set_bit_field(0); | 2357 reinterpret_cast<Map*>(result)->set_bit_field(0); |
2358 reinterpret_cast<Map*>(result)->set_bit_field2(0); | 2358 reinterpret_cast<Map*>(result)->set_bit_field2(0); |
2359 int bit_field3 = Map::EnumLengthBits::encode(kInvalidEnumCacheSentinel) | | 2359 int bit_field3 = Map::EnumLengthBits::encode(kInvalidEnumCacheSentinel) | |
2360 Map::OwnsDescriptors::encode(true); | 2360 Map::OwnsDescriptors::encode(true); |
Igor Sheludko
2014/12/04 10:11:08
| Map::Counter::encode(Map::kRetainingCounterStart
ulan
2014/12/05 14:04:44
Done.
| |
2361 reinterpret_cast<Map*>(result)->set_bit_field3(bit_field3); | 2361 reinterpret_cast<Map*>(result)->set_bit_field3(bit_field3); |
2362 return result; | 2362 return result; |
2363 } | 2363 } |
2364 | 2364 |
2365 | 2365 |
2366 AllocationResult Heap::AllocateMap(InstanceType instance_type, | 2366 AllocationResult Heap::AllocateMap(InstanceType instance_type, |
2367 int instance_size, | 2367 int instance_size, |
2368 ElementsKind elements_kind) { | 2368 ElementsKind elements_kind) { |
2369 HeapObject* result; | 2369 HeapObject* result; |
2370 AllocationResult allocation = AllocateRaw(Map::kSize, MAP_SPACE, MAP_SPACE); | 2370 AllocationResult allocation = AllocateRaw(Map::kSize, MAP_SPACE, MAP_SPACE); |
(...skipping 15 matching lines...) Expand all Loading... | |
2386 map->set_instance_descriptors(empty_descriptor_array()); | 2386 map->set_instance_descriptors(empty_descriptor_array()); |
2387 if (FLAG_unbox_double_fields) { | 2387 if (FLAG_unbox_double_fields) { |
2388 map->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); | 2388 map->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); |
2389 } | 2389 } |
2390 // Must be called only after |instance_type|, |instance_size| and | 2390 // Must be called only after |instance_type|, |instance_size| and |
2391 // |layout_descriptor| are set. | 2391 // |layout_descriptor| are set. |
2392 map->set_visitor_id(StaticVisitorBase::GetVisitorId(map)); | 2392 map->set_visitor_id(StaticVisitorBase::GetVisitorId(map)); |
2393 map->set_bit_field(0); | 2393 map->set_bit_field(0); |
2394 map->set_bit_field2(1 << Map::kIsExtensible); | 2394 map->set_bit_field2(1 << Map::kIsExtensible); |
2395 int bit_field3 = Map::EnumLengthBits::encode(kInvalidEnumCacheSentinel) | | 2395 int bit_field3 = Map::EnumLengthBits::encode(kInvalidEnumCacheSentinel) | |
2396 Map::OwnsDescriptors::encode(true); | 2396 Map::OwnsDescriptors::encode(true) | |
2397 Map::Counter::encode(Map::kRetainingCounterStart); | |
2397 map->set_bit_field3(bit_field3); | 2398 map->set_bit_field3(bit_field3); |
2398 map->set_elements_kind(elements_kind); | 2399 map->set_elements_kind(elements_kind); |
2399 | 2400 |
2400 return map; | 2401 return map; |
2401 } | 2402 } |
2402 | 2403 |
2403 | 2404 |
2404 AllocationResult Heap::AllocateFillerObject(int size, bool double_align, | 2405 AllocationResult Heap::AllocateFillerObject(int size, bool double_align, |
2405 AllocationSpace space) { | 2406 AllocationSpace space) { |
2406 HeapObject* obj; | 2407 HeapObject* obj; |
(...skipping 3963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6370 static_cast<int>(object_sizes_last_time_[index])); | 6371 static_cast<int>(object_sizes_last_time_[index])); |
6371 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6372 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6372 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6373 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6373 | 6374 |
6374 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6375 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6375 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6376 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6376 ClearObjectStats(); | 6377 ClearObjectStats(); |
6377 } | 6378 } |
6378 } | 6379 } |
6379 } // namespace v8::internal | 6380 } // namespace v8::internal |
OLD | NEW |