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

Side by Side Diff: src/heap.cc

Issue 10692026: Moving prototype transitions into the header of the transition array. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing comments Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/mark-compact.cc » ('j') | src/transitions.h » ('J')
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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2064 matching lines...) Expand 10 before | Expand all | Expand 10 after
2075 map->set_instance_type(instance_type); 2075 map->set_instance_type(instance_type);
2076 map->set_visitor_id( 2076 map->set_visitor_id(
2077 StaticVisitorBase::GetVisitorId(instance_type, instance_size)); 2077 StaticVisitorBase::GetVisitorId(instance_type, instance_size));
2078 map->set_prototype(null_value(), SKIP_WRITE_BARRIER); 2078 map->set_prototype(null_value(), SKIP_WRITE_BARRIER);
2079 map->set_constructor(null_value(), SKIP_WRITE_BARRIER); 2079 map->set_constructor(null_value(), SKIP_WRITE_BARRIER);
2080 map->set_instance_size(instance_size); 2080 map->set_instance_size(instance_size);
2081 map->set_inobject_properties(0); 2081 map->set_inobject_properties(0);
2082 map->set_pre_allocated_property_fields(0); 2082 map->set_pre_allocated_property_fields(0);
2083 map->init_instance_descriptors(); 2083 map->init_instance_descriptors();
2084 map->set_code_cache(empty_fixed_array(), SKIP_WRITE_BARRIER); 2084 map->set_code_cache(empty_fixed_array(), SKIP_WRITE_BARRIER);
2085 map->init_prototype_transitions(undefined_value()); 2085 map->init_back_pointer(undefined_value());
2086 map->set_unused_property_fields(0); 2086 map->set_unused_property_fields(0);
2087 map->set_bit_field(0); 2087 map->set_bit_field(0);
2088 map->set_bit_field2(1 << Map::kIsExtensible); 2088 map->set_bit_field2(1 << Map::kIsExtensible);
2089 map->set_elements_kind(elements_kind); 2089 map->set_elements_kind(elements_kind);
2090 2090
2091 // If the map object is aligned fill the padding area with Smi 0 objects. 2091 // If the map object is aligned fill the padding area with Smi 0 objects.
2092 if (Map::kPadStart < Map::kSize) { 2092 if (Map::kPadStart < Map::kSize) {
2093 memset(reinterpret_cast<byte*>(map) + Map::kPadStart - kHeapObjectTag, 2093 memset(reinterpret_cast<byte*>(map) + Map::kPadStart - kHeapObjectTag,
2094 0, 2094 0,
2095 Map::kSize - Map::kPadStart); 2095 Map::kSize - Map::kPadStart);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2214 2214
2215 // Allocate the empty descriptor array. 2215 // Allocate the empty descriptor array.
2216 { MaybeObject* maybe_obj = AllocateEmptyFixedArray(); 2216 { MaybeObject* maybe_obj = AllocateEmptyFixedArray();
2217 if (!maybe_obj->ToObject(&obj)) return false; 2217 if (!maybe_obj->ToObject(&obj)) return false;
2218 } 2218 }
2219 set_empty_descriptor_array(DescriptorArray::cast(obj)); 2219 set_empty_descriptor_array(DescriptorArray::cast(obj));
2220 2220
2221 // Fix the instance_descriptors for the existing maps. 2221 // Fix the instance_descriptors for the existing maps.
2222 meta_map()->init_instance_descriptors(); 2222 meta_map()->init_instance_descriptors();
2223 meta_map()->set_code_cache(empty_fixed_array()); 2223 meta_map()->set_code_cache(empty_fixed_array());
2224 meta_map()->init_prototype_transitions(undefined_value()); 2224 meta_map()->init_back_pointer(undefined_value());
2225 2225
2226 fixed_array_map()->init_instance_descriptors(); 2226 fixed_array_map()->init_instance_descriptors();
2227 fixed_array_map()->set_code_cache(empty_fixed_array()); 2227 fixed_array_map()->set_code_cache(empty_fixed_array());
2228 fixed_array_map()->init_prototype_transitions(undefined_value()); 2228 fixed_array_map()->init_back_pointer(undefined_value());
2229 2229
2230 oddball_map()->init_instance_descriptors(); 2230 oddball_map()->init_instance_descriptors();
2231 oddball_map()->set_code_cache(empty_fixed_array()); 2231 oddball_map()->set_code_cache(empty_fixed_array());
2232 oddball_map()->init_prototype_transitions(undefined_value()); 2232 oddball_map()->init_back_pointer(undefined_value());
2233 2233
2234 // Fix prototype object for existing maps. 2234 // Fix prototype object for existing maps.
2235 meta_map()->set_prototype(null_value()); 2235 meta_map()->set_prototype(null_value());
2236 meta_map()->set_constructor(null_value()); 2236 meta_map()->set_constructor(null_value());
2237 2237
2238 fixed_array_map()->set_prototype(null_value()); 2238 fixed_array_map()->set_prototype(null_value());
2239 fixed_array_map()->set_constructor(null_value()); 2239 fixed_array_map()->set_constructor(null_value());
2240 2240
2241 oddball_map()->set_prototype(null_value()); 2241 oddball_map()->set_prototype(null_value());
2242 oddball_map()->set_constructor(null_value()); 2242 oddball_map()->set_constructor(null_value());
(...skipping 4978 matching lines...) Expand 10 before | Expand all | Expand 10 after
7221 } else { 7221 } else {
7222 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. 7222 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died.
7223 } 7223 }
7224 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = 7224 remembered_unmapped_pages_[remembered_unmapped_pages_index_] =
7225 reinterpret_cast<Address>(p); 7225 reinterpret_cast<Address>(p);
7226 remembered_unmapped_pages_index_++; 7226 remembered_unmapped_pages_index_++;
7227 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; 7227 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages;
7228 } 7228 }
7229 7229
7230 } } // namespace v8::internal 7230 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mark-compact.cc » ('j') | src/transitions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698