diff options
Diffstat (limited to 'deps/v8/src/runtime/runtime-array.cc')
-rw-r--r-- | deps/v8/src/runtime/runtime-array.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/deps/v8/src/runtime/runtime-array.cc b/deps/v8/src/runtime/runtime-array.cc index f2a217d7f7..f651ed40e1 100644 --- a/deps/v8/src/runtime/runtime-array.cc +++ b/deps/v8/src/runtime/runtime-array.cc @@ -201,6 +201,15 @@ RUNTIME_FUNCTION(Runtime_GetArrayKeys) { CONVERT_ARG_HANDLE_CHECKED(JSObject, array, 0); CONVERT_NUMBER_CHECKED(uint32_t, length, Uint32, args[1]); + if (array->HasFastStringWrapperElements()) { + int string_length = + String::cast(Handle<JSValue>::cast(array)->value())->length(); + int backing_store_length = array->elements()->length(); + return *isolate->factory()->NewNumberFromUint( + Min(length, + static_cast<uint32_t>(Max(string_length, backing_store_length)))); + } + if (!array->elements()->IsDictionary()) { RUNTIME_ASSERT(array->HasFastSmiOrObjectElements() || array->HasFastDoubleElements()); @@ -208,8 +217,8 @@ RUNTIME_FUNCTION(Runtime_GetArrayKeys) { return *isolate->factory()->NewNumberFromUint(Min(actual_length, length)); } - KeyAccumulator accumulator(isolate, ALL_PROPERTIES); - // No need to separate protoype levels since we only get numbers/element keys + KeyAccumulator accumulator(isolate, OWN_ONLY, ALL_PROPERTIES); + // No need to separate prototype levels since we only get element keys. for (PrototypeIterator iter(isolate, array, PrototypeIterator::START_AT_RECEIVER); !iter.IsAtEnd(); iter.Advance()) { @@ -482,15 +491,6 @@ RUNTIME_FUNCTION(Runtime_GetCachedArrayIndex) { } -RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { - SealHandleScope shs(isolate); - DCHECK(args.length() == 2); - // Returning undefined means that this fast path fails and one has to resort - // to a slow path. - return isolate->heap()->undefined_value(); -} - - RUNTIME_FUNCTION(Runtime_ArraySpeciesConstructor) { HandleScope scope(isolate); DCHECK(args.length() == 1); |