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

Unified Diff: src/objects.cc

Issue 218753005: Replace set_map_and_elements by MigrateToMap-based SetMapAndElements (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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/objects-inl.h » ('j') | src/objects-inl.h » ('J')
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 9a6b26aaf11a9afd280ccd0bfca53a0c1e54cad5..ce31bf02f39fd7056ad9d651c34f6639dd39e46d 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -4672,6 +4672,13 @@ void JSObject::TransformToFastProperties(Handle<JSObject> object,
}
+void JSObject::ResetElements(Handle<JSObject> object) {
+ CALL_HEAP_FUNCTION_VOID(
+ object->GetIsolate(),
+ object->ResetElements());
+}
+
+
static Handle<SeededNumberDictionary> CopyFastElementsToDictionary(
Handle<FixedArrayBase> array,
int length,
@@ -11174,7 +11181,7 @@ Handle<FixedArray> JSObject::SetFastElementsCapacityAndLength(
? GetElementsTransitionMap(object, new_elements_kind)
: handle(object->map());
object->ValidateElements();
- object->set_map_and_elements(*new_map, *new_elements);
+ JSObject::SetMapAndElements(object, new_map, new_elements);
// Transition through the allocation site as well if present.
JSObject::UpdateAllocationSite(object, new_elements_kind);
@@ -11220,7 +11227,7 @@ void JSObject::SetFastDoubleElementsCapacityAndLength(Handle<JSObject> object,
accessor->CopyElements(object, elems, elements_kind);
object->ValidateElements();
- object->set_map_and_elements(*new_map, *elems);
+ JSObject::SetMapAndElements(object, new_map, elems);
if (FLAG_trace_elements_transitions) {
PrintElementsTransition(stdout, object, elements_kind, old_elements,
@@ -14360,7 +14367,7 @@ Handle<Object> JSObject::PrepareElementsForSort(Handle<JSObject> object,
dict->CopyValuesTo(*fast_elements);
object->ValidateElements();
- object->set_map_and_elements(*new_map, *fast_elements);
+ JSObject::SetMapAndElements(object, new_map, fast_elements);
} else if (object->HasExternalArrayElements() ||
object->HasFixedTypedArrayElements()) {
// Typed arrays cannot have holes or undefined elements.
@@ -16354,7 +16361,7 @@ Handle<JSArrayBuffer> JSTypedArray::MaterializeArrayBuffer(
buffer->set_weak_first_view(*typed_array);
ASSERT(typed_array->weak_next() == isolate->heap()->undefined_value());
typed_array->set_buffer(*buffer);
- typed_array->set_map_and_elements(*new_map, *new_elements);
+ JSObject::SetMapAndElements(typed_array, new_map, new_elements);
return buffer;
}
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698