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

Unified Diff: src/heap/heap.cc

Issue 950283002: Move Maps' back pointers from "transitions" to "constructor" field (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix stupidity on arm64 Created 5 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index e1817ba8b46435a234050b6c4db2746a52075827..ef0a0e941aa1b4cc9e8b01f37c7d989061c20c28 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -2464,14 +2464,14 @@ AllocationResult Heap::AllocateMap(InstanceType instance_type,
Map* map = Map::cast(result);
map->set_instance_type(instance_type);
map->set_prototype(null_value(), SKIP_WRITE_BARRIER);
- map->set_constructor(null_value(), SKIP_WRITE_BARRIER);
+ map->set_constructor_or_backpointer(null_value(), SKIP_WRITE_BARRIER);
map->set_instance_size(instance_size);
map->set_inobject_properties(0);
map->set_pre_allocated_property_fields(0);
map->set_code_cache(empty_fixed_array(), SKIP_WRITE_BARRIER);
map->set_dependent_code(DependentCode::cast(empty_fixed_array()),
SKIP_WRITE_BARRIER);
- map->init_back_pointer(undefined_value());
+ map->init_transitions(undefined_value());
map->set_unused_property_fields(0);
map->set_instance_descriptors(empty_descriptor_array());
if (FLAG_unbox_double_fields) {
@@ -2605,7 +2605,7 @@ bool Heap::CreateInitialMaps() {
// Fix the instance_descriptors for the existing maps.
meta_map()->set_code_cache(empty_fixed_array());
meta_map()->set_dependent_code(DependentCode::cast(empty_fixed_array()));
- meta_map()->init_back_pointer(undefined_value());
+ meta_map()->init_transitions(undefined_value());
meta_map()->set_instance_descriptors(empty_descriptor_array());
if (FLAG_unbox_double_fields) {
meta_map()->set_layout_descriptor(LayoutDescriptor::FastPointerLayout());
@@ -2614,7 +2614,7 @@ bool Heap::CreateInitialMaps() {
fixed_array_map()->set_code_cache(empty_fixed_array());
fixed_array_map()->set_dependent_code(
DependentCode::cast(empty_fixed_array()));
- fixed_array_map()->init_back_pointer(undefined_value());
+ fixed_array_map()->init_transitions(undefined_value());
fixed_array_map()->set_instance_descriptors(empty_descriptor_array());
if (FLAG_unbox_double_fields) {
fixed_array_map()->set_layout_descriptor(
@@ -2623,7 +2623,7 @@ bool Heap::CreateInitialMaps() {
undefined_map()->set_code_cache(empty_fixed_array());
undefined_map()->set_dependent_code(DependentCode::cast(empty_fixed_array()));
- undefined_map()->init_back_pointer(undefined_value());
+ undefined_map()->init_transitions(undefined_value());
undefined_map()->set_instance_descriptors(empty_descriptor_array());
if (FLAG_unbox_double_fields) {
undefined_map()->set_layout_descriptor(
@@ -2632,7 +2632,7 @@ bool Heap::CreateInitialMaps() {
null_map()->set_code_cache(empty_fixed_array());
null_map()->set_dependent_code(DependentCode::cast(empty_fixed_array()));
- null_map()->init_back_pointer(undefined_value());
+ null_map()->init_transitions(undefined_value());
null_map()->set_instance_descriptors(empty_descriptor_array());
if (FLAG_unbox_double_fields) {
null_map()->set_layout_descriptor(LayoutDescriptor::FastPointerLayout());
@@ -2641,7 +2641,7 @@ bool Heap::CreateInitialMaps() {
constant_pool_array_map()->set_code_cache(empty_fixed_array());
constant_pool_array_map()->set_dependent_code(
DependentCode::cast(empty_fixed_array()));
- constant_pool_array_map()->init_back_pointer(undefined_value());
+ constant_pool_array_map()->init_transitions(undefined_value());
constant_pool_array_map()->set_instance_descriptors(empty_descriptor_array());
if (FLAG_unbox_double_fields) {
constant_pool_array_map()->set_layout_descriptor(
@@ -2650,19 +2650,19 @@ bool Heap::CreateInitialMaps() {
// Fix prototype object for existing maps.
meta_map()->set_prototype(null_value());
- meta_map()->set_constructor(null_value());
+ meta_map()->set_constructor_or_backpointer(null_value());
fixed_array_map()->set_prototype(null_value());
- fixed_array_map()->set_constructor(null_value());
+ fixed_array_map()->set_constructor_or_backpointer(null_value());
undefined_map()->set_prototype(null_value());
- undefined_map()->set_constructor(null_value());
+ undefined_map()->set_constructor_or_backpointer(null_value());
null_map()->set_prototype(null_value());
- null_map()->set_constructor(null_value());
+ null_map()->set_constructor_or_backpointer(null_value());
constant_pool_array_map()->set_prototype(null_value());
- constant_pool_array_map()->set_constructor(null_value());
+ constant_pool_array_map()->set_constructor_or_backpointer(null_value());
{ // Map allocation
#define ALLOCATE_MAP(instance_type, size, field_name) \
@@ -3849,9 +3849,9 @@ void Heap::InitializeJSObjectFromMap(JSObject* obj, FixedArray* properties,
// Pre-allocated fields need to be initialized with undefined_value as well
// so that object accesses before the constructor completes (e.g. in the
// debugger) will not cause a crash.
- if (map->constructor()->IsJSFunction() &&
- JSFunction::cast(map->constructor())
- ->IsInobjectSlackTrackingInProgress()) {
+ Object* constructor = map->GetConstructor();
+ if (constructor->IsJSFunction() &&
+ JSFunction::cast(constructor)->IsInobjectSlackTrackingInProgress()) {
// We might want to shrink the object later.
DCHECK(obj->GetInternalFieldCount() == 0);
filler = Heap::one_pointer_filler_map();
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698