| Index: src/runtime/runtime-object.cc
|
| diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
|
| index 3d02572a0e0cae4c6a8ef8defcc932bf035d36eb..12dece522f08610cbc5d903f4818d0f62f3e6530 100644
|
| --- a/src/runtime/runtime-object.cc
|
| +++ b/src/runtime/runtime-object.cc
|
| @@ -983,11 +983,7 @@ RUNTIME_FUNCTION(Runtime_OwnKeys) {
|
| ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
|
| isolate, contents, JSReceiver::GetKeys(object, JSReceiver::OWN_ONLY));
|
|
|
| - // Some fast paths through GetKeysInFixedArrayFor reuse a cached
|
| - // property array and since the result is mutable we have to create
|
| - // a fresh clone on each invocation.
|
| int length = contents->length();
|
| - Handle<FixedArray> copy = isolate->factory()->NewFixedArray(length);
|
| int offset = 0;
|
| // Use an outer loop to avoid creating too many handles in the current
|
| // handle scope.
|
| @@ -997,18 +993,16 @@ RUNTIME_FUNCTION(Runtime_OwnKeys) {
|
| int end = Min(offset, length);
|
| for (int i = offset - 100; i < end; i++) {
|
| Object* entry = contents->get(i);
|
| - if (entry->IsString()) {
|
| - copy->set(i, entry);
|
| - } else {
|
| - DCHECK(entry->IsNumber());
|
| - Handle<Object> entry_handle(entry, isolate);
|
| - Handle<Object> entry_str =
|
| - isolate->factory()->NumberToString(entry_handle);
|
| - copy->set(i, *entry_str);
|
| - }
|
| + if (entry->IsString()) continue;
|
| +
|
| + DCHECK(entry->IsNumber());
|
| + Handle<Object> entry_handle(entry, isolate);
|
| + Handle<Object> entry_str =
|
| + isolate->factory()->NumberToString(entry_handle);
|
| + contents->set(i, *entry_str);
|
| }
|
| }
|
| - return *isolate->factory()->NewJSArrayWithElements(copy);
|
| + return *isolate->factory()->NewJSArrayWithElements(contents);
|
| }
|
|
|
|
|
|
|