Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: src/heap/heap.cc

Issue 767253002: Refactor Map::ConstructionCount. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix assert Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after
2358 if (FLAG_unbox_double_fields) { 2358 if (FLAG_unbox_double_fields) {
2359 reinterpret_cast<Map*>(result) 2359 reinterpret_cast<Map*>(result)
2360 ->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); 2360 ->set_layout_descriptor(LayoutDescriptor::FastPointerLayout());
2361 } 2361 }
2362 reinterpret_cast<Map*>(result)->set_inobject_properties(0); 2362 reinterpret_cast<Map*>(result)->set_inobject_properties(0);
2363 reinterpret_cast<Map*>(result)->set_pre_allocated_property_fields(0); 2363 reinterpret_cast<Map*>(result)->set_pre_allocated_property_fields(0);
2364 reinterpret_cast<Map*>(result)->set_unused_property_fields(0); 2364 reinterpret_cast<Map*>(result)->set_unused_property_fields(0);
2365 reinterpret_cast<Map*>(result)->set_bit_field(0); 2365 reinterpret_cast<Map*>(result)->set_bit_field(0);
2366 reinterpret_cast<Map*>(result)->set_bit_field2(0); 2366 reinterpret_cast<Map*>(result)->set_bit_field2(0);
2367 int bit_field3 = Map::EnumLengthBits::encode(kInvalidEnumCacheSentinel) | 2367 int bit_field3 = Map::EnumLengthBits::encode(kInvalidEnumCacheSentinel) |
2368 Map::OwnsDescriptors::encode(true); 2368 Map::OwnsDescriptors::encode(true) |
2369 Map::Counter::encode(Map::kRetainingCounterStart);
2369 reinterpret_cast<Map*>(result)->set_bit_field3(bit_field3); 2370 reinterpret_cast<Map*>(result)->set_bit_field3(bit_field3);
2370 return result; 2371 return result;
2371 } 2372 }
2372 2373
2373 2374
2374 AllocationResult Heap::AllocateMap(InstanceType instance_type, 2375 AllocationResult Heap::AllocateMap(InstanceType instance_type,
2375 int instance_size, 2376 int instance_size,
2376 ElementsKind elements_kind) { 2377 ElementsKind elements_kind) {
2377 HeapObject* result; 2378 HeapObject* result;
2378 AllocationResult allocation = AllocateRaw(Map::kSize, MAP_SPACE, MAP_SPACE); 2379 AllocationResult allocation = AllocateRaw(Map::kSize, MAP_SPACE, MAP_SPACE);
(...skipping 15 matching lines...) Expand all
2394 map->set_instance_descriptors(empty_descriptor_array()); 2395 map->set_instance_descriptors(empty_descriptor_array());
2395 if (FLAG_unbox_double_fields) { 2396 if (FLAG_unbox_double_fields) {
2396 map->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); 2397 map->set_layout_descriptor(LayoutDescriptor::FastPointerLayout());
2397 } 2398 }
2398 // Must be called only after |instance_type|, |instance_size| and 2399 // Must be called only after |instance_type|, |instance_size| and
2399 // |layout_descriptor| are set. 2400 // |layout_descriptor| are set.
2400 map->set_visitor_id(StaticVisitorBase::GetVisitorId(map)); 2401 map->set_visitor_id(StaticVisitorBase::GetVisitorId(map));
2401 map->set_bit_field(0); 2402 map->set_bit_field(0);
2402 map->set_bit_field2(1 << Map::kIsExtensible); 2403 map->set_bit_field2(1 << Map::kIsExtensible);
2403 int bit_field3 = Map::EnumLengthBits::encode(kInvalidEnumCacheSentinel) | 2404 int bit_field3 = Map::EnumLengthBits::encode(kInvalidEnumCacheSentinel) |
2404 Map::OwnsDescriptors::encode(true); 2405 Map::OwnsDescriptors::encode(true) |
2406 Map::Counter::encode(Map::kRetainingCounterStart);
2405 map->set_bit_field3(bit_field3); 2407 map->set_bit_field3(bit_field3);
2406 map->set_elements_kind(elements_kind); 2408 map->set_elements_kind(elements_kind);
2407 2409
2408 return map; 2410 return map;
2409 } 2411 }
2410 2412
2411 2413
2412 AllocationResult Heap::AllocateFillerObject(int size, bool double_align, 2414 AllocationResult Heap::AllocateFillerObject(int size, bool double_align,
2413 AllocationSpace space) { 2415 AllocationSpace space) {
2414 HeapObject* obj; 2416 HeapObject* obj;
(...skipping 3979 matching lines...) Expand 10 before | Expand all | Expand 10 after
6394 static_cast<int>(object_sizes_last_time_[index])); 6396 static_cast<int>(object_sizes_last_time_[index]));
6395 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6397 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6396 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6398 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6397 6399
6398 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6400 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6399 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6401 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6400 ClearObjectStats(); 6402 ClearObjectStats();
6401 } 6403 }
6402 } 6404 }
6403 } // namespace v8::internal 6405 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698