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

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: Addressed comment 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') | 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 78d2b8a038feb2fda955af5b39a24dd2d74ad1ea..b5a202cb28871f550558463c5b7ceb0ca4fd55b1 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,
@@ -11183,7 +11190,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);
@@ -11229,7 +11236,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,
@@ -14369,7 +14376,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.
@@ -16363,7 +16370,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698