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

Unified Diff: src/transitions.cc

Issue 232883003: Some tests and simplified TransitionArray copying (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Patch one. 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.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/transitions.cc
diff --git a/src/transitions.cc b/src/transitions.cc
index 43a0eb7f9944ce39d1b2382fb7be1d0d8aa74c41..320fc7018129ce6fdd7fa120f6d7ec741028b888 100644
--- a/src/transitions.cc
+++ b/src/transitions.cc
@@ -131,26 +131,11 @@ Handle<TransitionArray> TransitionArray::CopyInsert(Handle<Map> map,
Handle<TransitionArray> result =
map->GetIsolate()->factory()->NewTransitionArray(new_size);
- // The map's transition array may have disappeared or grown smaller during
- // the allocation above as it was weakly traversed. Trim the result copy if
- // needed, and recompute variables.
+ // The map's transition array may grown smaller during the allocation above as
+ // it was weakly traversed, though it is guaranteed not to disappear. Trim the
+ // result copy if needed, and recompute variables.
+ ASSERT(map->HasTransitionArray());
DisallowHeapAllocation no_gc;
- if (!map->HasTransitionArray()) {
- if (flag == SIMPLE_TRANSITION) {
- ASSERT(result->length() >= kSimpleTransitionSize);
- result->Shrink(kSimpleTransitionSize);
- result->set(kSimpleTransitionTarget, *target);
- } else {
- ASSERT(result->length() >= ToKeyIndex(1));
- result->Shrink(ToKeyIndex(1));
- result->set(kPrototypeTransitionsIndex, Smi::FromInt(0));
- result->NoIncrementalWriteBarrierSet(0, *name, *target);
- }
- result->set_back_pointer_storage(map->GetBackPointer());
-
- return result;
- }
-
TransitionArray* array = map->transitions();
if (array->number_of_transitions() != number_of_transitions) {
ASSERT(array->number_of_transitions() < number_of_transitions);
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698