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

Unified Diff: src/transitions.cc

Issue 234873004: Gcstress bug fix: Transition arrays may get smaller during gc. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/transitions.h ('k') | no next file » | 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 dc0a307cf077a54560883af20a9005dd980bd9a9..2397fc138f762ec5157b801ab82bdc107efdcd78 100644
--- a/src/transitions.cc
+++ b/src/transitions.cc
@@ -86,17 +86,23 @@ Handle<TransitionArray> TransitionArray::NewWith(Handle<Map> map,
Handle<TransitionArray> TransitionArray::ExtendToFullTransitionArray(
- Handle<TransitionArray> array) {
- ASSERT(!array->IsFullTransitionArray());
- int nof = array->number_of_transitions();
- Handle<TransitionArray> result = Allocate(array->GetIsolate(), nof);
-
- if (nof == 1) {
+ Handle<Map> containing_map) {
+ ASSERT(!containing_map->transitions()->IsFullTransitionArray());
+ int nof = containing_map->transitions()->number_of_transitions();
+
+ // A transition array may shrink during GC.
+ Handle<TransitionArray> result = Allocate(containing_map->GetIsolate(), nof);
+ int new_nof = containing_map->transitions()->number_of_transitions();
+ if (new_nof != nof) {
+ ASSERT(new_nof == 0);
+ result->Shrink(ToKeyIndex(0));
+ } else if (nof == 1) {
result->NoIncrementalWriteBarrierCopyFrom(
- *array, kSimpleTransitionIndex, 0);
+ containing_map->transitions(), kSimpleTransitionIndex, 0);
}
- result->set_back_pointer_storage(array->back_pointer_storage());
+ result->set_back_pointer_storage(
+ containing_map->transitions()->back_pointer_storage());
return result;
}
« no previous file with comments | « src/transitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698