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

Unified Diff: src/objects.cc

Issue 228483005: Bugfix: A TransitionArray can disappear during copy. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 8 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/objects.h ('k') | src/transitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 34e0e023edc17512d21740dc1eb868bea710cfb2..f66275a3ae46d1f802db1e313190d11a6b201698 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -2375,7 +2375,7 @@ bool Map::InstancesNeedRewriting(Map* target,
Handle<TransitionArray> Map::SetElementsTransitionMap(
Handle<Map> map, Handle<Map> transitioned_map) {
- Handle<TransitionArray> transitions = Map::AddTransition(
+ Handle<TransitionArray> transitions = TransitionArray::CopyInsert(
map,
map->GetIsolate()->factory()->elements_transition_symbol(),
transitioned_map,
@@ -2505,18 +2505,6 @@ void JSObject::MigrateToMap(Handle<JSObject> object, Handle<Map> new_map) {
}
-Handle<TransitionArray> Map::AddTransition(Handle<Map> map,
- Handle<Name> key,
- Handle<Map> target,
- SimpleTransitionFlag flag) {
- if (map->HasTransitionArray()) {
- return TransitionArray::CopyInsert(map, key, target);
- }
- return TransitionArray::NewWith(
- flag, key, target, handle(map->GetBackPointer(), map->GetIsolate()));
-}
-
-
void JSObject::GeneralizeFieldRepresentation(Handle<JSObject> object,
int modify_index,
Representation new_representation,
@@ -6875,7 +6863,7 @@ Handle<Map> Map::ShareDescriptor(Handle<Map> map,
Handle<Map> result = Map::CopyDropDescriptors(map);
Handle<Name> name = descriptor->GetKey();
Handle<TransitionArray> transitions =
- Map::AddTransition(map, name, result, SIMPLE_TRANSITION);
+ TransitionArray::CopyInsert(map, name, result, SIMPLE_TRANSITION);
// Ensure there's space for the new descriptor in the shared descriptor array.
if (descriptors->NumberOfSlackDescriptors() == 0) {
@@ -6924,7 +6912,7 @@ Handle<Map> Map::CopyReplaceDescriptors(Handle<Map> map,
result->InitializeDescriptors(*descriptors);
if (flag == INSERT_TRANSITION && map->CanHaveMoreTransitions()) {
- Handle<TransitionArray> transitions = Map::AddTransition(
+ Handle<TransitionArray> transitions = TransitionArray::CopyInsert(
map, name, result, simple_flag);
map->set_transitions(*transitions);
result->SetBackPointer(*map);
@@ -6960,8 +6948,8 @@ Handle<Map> Map::CopyInstallDescriptors(Handle<Map> map,
result->set_owns_descriptors(false);
Handle<Name> name = handle(descriptors->GetKey(new_descriptor));
- Handle<TransitionArray> transitions = Map::AddTransition(map, name, result,
- SIMPLE_TRANSITION);
+ Handle<TransitionArray> transitions = TransitionArray::CopyInsert(
+ map, name, result, SIMPLE_TRANSITION);
map->set_transitions(*transitions);
result->SetBackPointer(*map);
@@ -7032,9 +7020,8 @@ Handle<Map> Map::CopyForObserved(Handle<Map> map) {
new_map = Map::Copy(map);
}
- Handle<TransitionArray> transitions =
- Map::AddTransition(map, isolate->factory()->observed_symbol(), new_map,
- FULL_TRANSITION);
+ Handle<TransitionArray> transitions = TransitionArray::CopyInsert(
+ map, isolate->factory()->observed_symbol(), new_map, FULL_TRANSITION);
map->set_transitions(*transitions);
« no previous file with comments | « src/objects.h ('k') | src/transitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698