Fix failing test test-api/CheckCOWArraysCreatedRuntimeCounter

R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/85743002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18051 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
mvstanton@chromium.org 2013-11-25 13:27:36 +00:00
parent c04659215a
commit 149516c63f

View File

@ -5738,6 +5738,13 @@ Handle<JSObject> JSObjectWalkVisitor<ContextObject>::StructureWalk(
ASSERT(copying || copy.is_identical_to(object)); ASSERT(copying || copy.is_identical_to(object));
ElementsKind kind = copy->GetElementsKind();
if (copying && IsFastSmiOrObjectElementsKind(kind) &&
FixedArray::cast(copy->elements())->map() ==
isolate->heap()->fixed_cow_array_map()) {
isolate->counters()->cow_arrays_created_runtime()->Increment();
}
if (!shallow) { if (!shallow) {
HandleScope scope(isolate); HandleScope scope(isolate);
@ -5793,16 +5800,13 @@ Handle<JSObject> JSObjectWalkVisitor<ContextObject>::StructureWalk(
// Deep copy local elements. // Deep copy local elements.
// Pixel elements cannot be created using an object literal. // Pixel elements cannot be created using an object literal.
ASSERT(!copy->HasExternalArrayElements()); ASSERT(!copy->HasExternalArrayElements());
switch (copy->GetElementsKind()) { switch (kind) {
case FAST_SMI_ELEMENTS: case FAST_SMI_ELEMENTS:
case FAST_ELEMENTS: case FAST_ELEMENTS:
case FAST_HOLEY_SMI_ELEMENTS: case FAST_HOLEY_SMI_ELEMENTS:
case FAST_HOLEY_ELEMENTS: { case FAST_HOLEY_ELEMENTS: {
Handle<FixedArray> elements(FixedArray::cast(copy->elements())); Handle<FixedArray> elements(FixedArray::cast(copy->elements()));
if (elements->map() == isolate->heap()->fixed_cow_array_map()) { if (elements->map() == isolate->heap()->fixed_cow_array_map()) {
if (copying) {
isolate->counters()->cow_arrays_created_runtime()->Increment();
}
#ifdef DEBUG #ifdef DEBUG
for (int i = 0; i < elements->length(); i++) { for (int i = 0; i < elements->length(); i++) {
ASSERT(!elements->get(i)->IsJSObject()); ASSERT(!elements->get(i)->IsJSObject());