Commit e801d554 authored by cbruni's avatar cbruni Committed by Commit bot

[keys] Cleanup: removing unused parameters in elements.cc and keys.cc

- Cleanup CL to remove unused parameters in elements.cc. Additionally use fields
  from the KeyAccumulator wherever possible.
- Make method names in KeyAccumulator more consistent

BUG=

Review-Url: https://codereview.chromium.org/1944703002
Cr-Commit-Position: refs/heads/master@{#36073}
parent 19a8e09c
...@@ -865,8 +865,7 @@ class ElementsAccessorBase : public ElementsAccessor { ...@@ -865,8 +865,7 @@ class ElementsAccessorBase : public ElementsAccessor {
KeyAccumulator accumulator(isolate, OWN_ONLY, ALL_PROPERTIES); KeyAccumulator accumulator(isolate, OWN_ONLY, ALL_PROPERTIES);
accumulator.NextPrototype(); accumulator.NextPrototype();
Subclass::CollectElementIndicesImpl( Subclass::CollectElementIndicesImpl(
object, handle(object->elements(), isolate), &accumulator, kMaxUInt32, object, handle(object->elements(), isolate), &accumulator);
ALL_PROPERTIES, 0);
Handle<FixedArray> keys = accumulator.GetKeys(); Handle<FixedArray> keys = accumulator.GetKeys();
for (int i = 0; i < keys->length(); ++i) { for (int i = 0; i < keys->length(); ++i) {
...@@ -900,23 +899,19 @@ class ElementsAccessorBase : public ElementsAccessor { ...@@ -900,23 +899,19 @@ class ElementsAccessorBase : public ElementsAccessor {
void CollectElementIndices(Handle<JSObject> object, void CollectElementIndices(Handle<JSObject> object,
Handle<FixedArrayBase> backing_store, Handle<FixedArrayBase> backing_store,
KeyAccumulator* keys, uint32_t range, KeyAccumulator* keys) final {
PropertyFilter filter, uint32_t offset) final { if (keys->filter() & ONLY_ALL_CAN_READ) return;
if (filter & ONLY_ALL_CAN_READ) return; Subclass::CollectElementIndicesImpl(object, backing_store, keys);
Subclass::CollectElementIndicesImpl(object, backing_store, keys, range,
filter, offset);
} }
static void CollectElementIndicesImpl(Handle<JSObject> object, static void CollectElementIndicesImpl(Handle<JSObject> object,
Handle<FixedArrayBase> backing_store, Handle<FixedArrayBase> backing_store,
KeyAccumulator* keys, uint32_t range, KeyAccumulator* keys) {
PropertyFilter filter,
uint32_t offset) {
DCHECK_NE(DICTIONARY_ELEMENTS, kind()); DCHECK_NE(DICTIONARY_ELEMENTS, kind());
// Non-dictionary elements can't have all-can-read accessors. // Non-dictionary elements can't have all-can-read accessors.
uint32_t length = GetIterationLength(*object, *backing_store); uint32_t length = GetIterationLength(*object, *backing_store);
if (range < length) length = range; PropertyFilter filter = keys->filter();
for (uint32_t i = offset; i < length; i++) { for (uint32_t i = 0; i < length; i++) {
if (Subclass::HasElementImpl(object, i, backing_store, filter)) { if (Subclass::HasElementImpl(object, i, backing_store, filter)) {
keys->AddKey(i); keys->AddKey(i);
} }
...@@ -1316,16 +1311,15 @@ class DictionaryElementsAccessor ...@@ -1316,16 +1311,15 @@ class DictionaryElementsAccessor
static void CollectElementIndicesImpl(Handle<JSObject> object, static void CollectElementIndicesImpl(Handle<JSObject> object,
Handle<FixedArrayBase> backing_store, Handle<FixedArrayBase> backing_store,
KeyAccumulator* keys, uint32_t range, KeyAccumulator* keys) {
PropertyFilter filter, if (keys->filter() & SKIP_STRINGS) return;
uint32_t offset) {
if (filter & SKIP_STRINGS) return;
Isolate* isolate = keys->isolate(); Isolate* isolate = keys->isolate();
Handle<Object> undefined = isolate->factory()->undefined_value(); Handle<Object> undefined = isolate->factory()->undefined_value();
Handle<Object> the_hole = isolate->factory()->the_hole_value(); Handle<Object> the_hole = isolate->factory()->the_hole_value();
Handle<SeededNumberDictionary> dictionary = Handle<SeededNumberDictionary> dictionary =
Handle<SeededNumberDictionary>::cast(backing_store); Handle<SeededNumberDictionary>::cast(backing_store);
int capacity = dictionary->Capacity(); int capacity = dictionary->Capacity();
PropertyFilter filter = keys->filter();
for (int i = 0; i < capacity; i++) { for (int i = 0; i < capacity; i++) {
uint32_t key = uint32_t key =
GetKeyForEntryImpl(dictionary, i, filter, *undefined, *the_hole); GetKeyForEntryImpl(dictionary, i, filter, *undefined, *the_hole);
...@@ -2391,22 +2385,17 @@ class SloppyArgumentsElementsAccessor ...@@ -2391,22 +2385,17 @@ class SloppyArgumentsElementsAccessor
static void CollectElementIndicesImpl(Handle<JSObject> object, static void CollectElementIndicesImpl(Handle<JSObject> object,
Handle<FixedArrayBase> backing_store, Handle<FixedArrayBase> backing_store,
KeyAccumulator* keys, uint32_t range, KeyAccumulator* keys) {
PropertyFilter filter,
uint32_t offset) {
FixedArray* parameter_map = FixedArray::cast(*backing_store); FixedArray* parameter_map = FixedArray::cast(*backing_store);
uint32_t length = parameter_map->length() - 2; uint32_t length = parameter_map->length() - 2;
if (range < length) length = range; for (uint32_t i = 0; i < length; ++i) {
for (uint32_t i = offset; i < length; ++i) {
if (!parameter_map->get(i + 2)->IsTheHole()) { if (!parameter_map->get(i + 2)->IsTheHole()) {
keys->AddKey(i); keys->AddKey(i);
} }
} }
Handle<FixedArrayBase> store(FixedArrayBase::cast(parameter_map->get(1))); Handle<FixedArrayBase> store(FixedArrayBase::cast(parameter_map->get(1)));
ArgumentsAccessor::CollectElementIndicesImpl(object, store, keys, range, ArgumentsAccessor::CollectElementIndicesImpl(object, store, keys);
filter, offset);
if (Subclass::kind() == FAST_SLOPPY_ARGUMENTS_ELEMENTS) { if (Subclass::kind() == FAST_SLOPPY_ARGUMENTS_ELEMENTS) {
keys->SortCurrentElementsList(); keys->SortCurrentElementsList();
} }
...@@ -2754,15 +2743,13 @@ class StringWrapperElementsAccessor ...@@ -2754,15 +2743,13 @@ class StringWrapperElementsAccessor
static void CollectElementIndicesImpl(Handle<JSObject> object, static void CollectElementIndicesImpl(Handle<JSObject> object,
Handle<FixedArrayBase> backing_store, Handle<FixedArrayBase> backing_store,
KeyAccumulator* keys, uint32_t range, KeyAccumulator* keys) {
PropertyFilter filter,
uint32_t offset) {
uint32_t length = GetString(*object)->length(); uint32_t length = GetString(*object)->length();
for (uint32_t i = 0; i < length; i++) { for (uint32_t i = 0; i < length; i++) {
keys->AddKey(i); keys->AddKey(i);
} }
BackingStoreAccessor::CollectElementIndicesImpl(object, backing_store, keys, BackingStoreAccessor::CollectElementIndicesImpl(object, backing_store,
range, filter, offset); keys);
} }
static void GrowCapacityAndConvertImpl(Handle<JSObject> object, static void GrowCapacityAndConvertImpl(Handle<JSObject> object,
......
...@@ -81,18 +81,12 @@ class ElementsAccessor { ...@@ -81,18 +81,12 @@ class ElementsAccessor {
// whose PropertyAttribute match |filter|. // whose PropertyAttribute match |filter|.
virtual void CollectElementIndices(Handle<JSObject> object, virtual void CollectElementIndices(Handle<JSObject> object,
Handle<FixedArrayBase> backing_store, Handle<FixedArrayBase> backing_store,
KeyAccumulator* keys, KeyAccumulator* keys) = 0;
uint32_t range = kMaxUInt32,
PropertyFilter filter = ALL_PROPERTIES,
uint32_t offset = 0) = 0;
inline void CollectElementIndices(Handle<JSObject> object, inline void CollectElementIndices(Handle<JSObject> object,
KeyAccumulator* keys, KeyAccumulator* keys) {
uint32_t range = kMaxUInt32, CollectElementIndices(object, handle(object->elements(), keys->isolate()),
PropertyFilter filter = ALL_PROPERTIES, keys);
uint32_t offset = 0) {
CollectElementIndices(object, handle(object->elements()), keys, range,
filter, offset);
} }
virtual Maybe<bool> CollectValuesOrEntries( virtual Maybe<bool> CollectValuesOrEntries(
...@@ -100,7 +94,6 @@ class ElementsAccessor { ...@@ -100,7 +94,6 @@ class ElementsAccessor {
Handle<FixedArray> values_or_entries, bool get_entries, int* nof_items, Handle<FixedArray> values_or_entries, bool get_entries, int* nof_items,
PropertyFilter filter = ALL_PROPERTIES) = 0; PropertyFilter filter = ALL_PROPERTIES) = 0;
//
virtual Handle<FixedArray> PrependElementIndices( virtual Handle<FixedArray> PrependElementIndices(
Handle<JSObject> object, Handle<FixedArrayBase> backing_store, Handle<JSObject> object, Handle<FixedArrayBase> backing_store,
Handle<FixedArray> keys, GetKeysConversion convert, Handle<FixedArray> keys, GetKeysConversion convert,
......
...@@ -314,20 +314,18 @@ void KeyAccumulator::NextPrototype() { ...@@ -314,20 +314,18 @@ void KeyAccumulator::NextPrototype() {
level_symbol_length_ = 0; level_symbol_length_ = 0;
} }
Maybe<bool> KeyAccumulator::GetKeys_Internal(Handle<JSReceiver> receiver, Maybe<bool> KeyAccumulator::CollectKeys(Handle<JSReceiver> receiver,
Handle<JSReceiver> object, Handle<JSReceiver> object) {
KeyCollectionType type) {
// Proxies have no hidden prototype and we should not trigger the // Proxies have no hidden prototype and we should not trigger the
// [[GetPrototypeOf]] trap on the last iteration when using // [[GetPrototypeOf]] trap on the last iteration when using
// AdvanceFollowingProxies. // AdvanceFollowingProxies.
if (type == OWN_ONLY && object->IsJSProxy()) { if (type_ == OWN_ONLY && object->IsJSProxy()) {
MAYBE_RETURN( MAYBE_RETURN(CollectOwnJSProxyKeys(receiver, Handle<JSProxy>::cast(object)),
JSProxyOwnPropertyKeys(receiver, Handle<JSProxy>::cast(object)), Nothing<bool>());
Nothing<bool>());
return Just(true); return Just(true);
} }
PrototypeIterator::WhereToEnd end = type == OWN_ONLY PrototypeIterator::WhereToEnd end = type_ == OWN_ONLY
? PrototypeIterator::END_AT_NON_HIDDEN ? PrototypeIterator::END_AT_NON_HIDDEN
: PrototypeIterator::END_AT_NULL; : PrototypeIterator::END_AT_NULL;
for (PrototypeIterator iter(isolate_, object, for (PrototypeIterator iter(isolate_, object,
...@@ -337,16 +335,15 @@ Maybe<bool> KeyAccumulator::GetKeys_Internal(Handle<JSReceiver> receiver, ...@@ -337,16 +335,15 @@ Maybe<bool> KeyAccumulator::GetKeys_Internal(Handle<JSReceiver> receiver,
PrototypeIterator::GetCurrent<JSReceiver>(iter); PrototypeIterator::GetCurrent<JSReceiver>(iter);
Maybe<bool> result = Just(false); // Dummy initialization. Maybe<bool> result = Just(false); // Dummy initialization.
if (current->IsJSProxy()) { if (current->IsJSProxy()) {
result = JSProxyOwnPropertyKeys(receiver, Handle<JSProxy>::cast(current)); result = CollectOwnJSProxyKeys(receiver, Handle<JSProxy>::cast(current));
} else { } else {
DCHECK(current->IsJSObject()); DCHECK(current->IsJSObject());
result = result = CollectOwnKeys(receiver, Handle<JSObject>::cast(current));
GetKeysFromJSObject(receiver, Handle<JSObject>::cast(current), type);
} }
MAYBE_RETURN(result, Nothing<bool>()); MAYBE_RETURN(result, Nothing<bool>());
if (!result.FromJust()) break; // |false| means "stop iterating". if (!result.FromJust()) break; // |false| means "stop iterating".
// Iterate through proxies but ignore access checks for the ALL_CAN_READ // Iterate through proxies but ignore access checks for the ALL_CAN_READ
// case on API objects for OWN_ONLY keys handled in GetKeysFromJSObject. // case on API objects for OWN_ONLY keys handled in CollectOwnKeys.
if (!iter.AdvanceFollowingProxiesIgnoringAccessChecks()) { if (!iter.AdvanceFollowingProxiesIgnoringAccessChecks()) {
return Nothing<bool>(); return Nothing<bool>();
} }
...@@ -629,10 +626,10 @@ static Maybe<bool> GetKeysFromInterceptor(Handle<JSReceiver> receiver, ...@@ -629,10 +626,10 @@ static Maybe<bool> GetKeysFromInterceptor(Handle<JSReceiver> receiver,
return Just(true); return Just(true);
} }
void KeyAccumulator::CollectOwnElementKeys(Handle<JSObject> object) { void KeyAccumulator::CollectOwnElementIndices(Handle<JSObject> object) {
if (filter_ & SKIP_STRINGS) return; if (filter_ & SKIP_STRINGS) return;
ElementsAccessor* accessor = object->GetElementsAccessor(); ElementsAccessor* accessor = object->GetElementsAccessor();
accessor->CollectElementIndices(object, this, kMaxUInt32, filter_, 0); accessor->CollectElementIndices(object, this);
} }
void KeyAccumulator::CollectOwnPropertyNames(Handle<JSObject> object) { void KeyAccumulator::CollectOwnPropertyNames(Handle<JSObject> object) {
...@@ -664,24 +661,23 @@ void KeyAccumulator::CollectOwnPropertyNames(Handle<JSObject> object) { ...@@ -664,24 +661,23 @@ void KeyAccumulator::CollectOwnPropertyNames(Handle<JSObject> object) {
// Returns |true| on success, |false| if prototype walking should be stopped, // Returns |true| on success, |false| if prototype walking should be stopped,
// |nothing| if an exception was thrown. // |nothing| if an exception was thrown.
Maybe<bool> KeyAccumulator::GetKeysFromJSObject(Handle<JSReceiver> receiver, Maybe<bool> KeyAccumulator::CollectOwnKeys(Handle<JSReceiver> receiver,
Handle<JSObject> object, Handle<JSObject> object) {
KeyCollectionType type) {
this->NextPrototype(); this->NextPrototype();
// Check access rights if required. // Check access rights if required.
if (object->IsAccessCheckNeeded() && if (object->IsAccessCheckNeeded() &&
!isolate_->MayAccess(handle(isolate_->context()), object)) { !isolate_->MayAccess(handle(isolate_->context()), object)) {
// The cross-origin spec says that [[Enumerate]] shall return an empty // The cross-origin spec says that [[Enumerate]] shall return an empty
// iterator when it doesn't have access... // iterator when it doesn't have access...
if (type == INCLUDE_PROTOS) { if (type_ == INCLUDE_PROTOS) {
return Just(false); return Just(false);
} }
// ...whereas [[OwnPropertyKeys]] shall return whitelisted properties. // ...whereas [[OwnPropertyKeys]] shall return whitelisted properties.
DCHECK_EQ(OWN_ONLY, type); DCHECK_EQ(OWN_ONLY, type_);
filter_ = static_cast<PropertyFilter>(filter_ | ONLY_ALL_CAN_READ); filter_ = static_cast<PropertyFilter>(filter_ | ONLY_ALL_CAN_READ);
} }
this->CollectOwnElementKeys(object); this->CollectOwnElementIndices(object);
// Add the element keys from the interceptor. // Add the element keys from the interceptor.
Maybe<bool> success = Maybe<bool> success =
...@@ -732,8 +728,8 @@ Handle<FixedArray> KeyAccumulator::GetEnumPropertyKeys( ...@@ -732,8 +728,8 @@ Handle<FixedArray> KeyAccumulator::GetEnumPropertyKeys(
// ES6 9.5.12 // ES6 9.5.12
// Returns |true| on success, |nothing| in case of exception. // Returns |true| on success, |nothing| in case of exception.
Maybe<bool> KeyAccumulator::JSProxyOwnPropertyKeys(Handle<JSReceiver> receiver, Maybe<bool> KeyAccumulator::CollectOwnJSProxyKeys(Handle<JSReceiver> receiver,
Handle<JSProxy> proxy) { Handle<JSProxy> proxy) {
STACK_CHECK(isolate_, Nothing<bool>()); STACK_CHECK(isolate_, Nothing<bool>());
// 1. Let handler be the value of the [[ProxyHandler]] internal slot of O. // 1. Let handler be the value of the [[ProxyHandler]] internal slot of O.
Handle<Object> handler(proxy->handler(), isolate_); Handle<Object> handler(proxy->handler(), isolate_);
...@@ -755,7 +751,11 @@ Maybe<bool> KeyAccumulator::JSProxyOwnPropertyKeys(Handle<JSReceiver> receiver, ...@@ -755,7 +751,11 @@ Maybe<bool> KeyAccumulator::JSProxyOwnPropertyKeys(Handle<JSReceiver> receiver,
// 6. If trap is undefined, then // 6. If trap is undefined, then
if (trap->IsUndefined()) { if (trap->IsUndefined()) {
// 6a. Return target.[[OwnPropertyKeys]](). // 6a. Return target.[[OwnPropertyKeys]]().
return this->GetKeys_Internal(receiver, target, OWN_ONLY); KeyCollectionType previous_type = type_;
type_ = OWN_ONLY;
Maybe<bool> result = this->CollectKeys(receiver, target);
type_ = previous_type;
return result;
} }
// 7. Let trapResultArray be Call(trap, handler, «target»). // 7. Let trapResultArray be Call(trap, handler, «target»).
Handle<Object> trap_result_array; Handle<Object> trap_result_array;
......
...@@ -36,6 +36,15 @@ class KeyAccumulator final BASE_EMBEDDED { ...@@ -36,6 +36,15 @@ class KeyAccumulator final BASE_EMBEDDED {
: isolate_(isolate), type_(type), filter_(filter) {} : isolate_(isolate), type_(type), filter_(filter) {}
~KeyAccumulator(); ~KeyAccumulator();
Handle<FixedArray> GetKeys(GetKeysConversion convert = KEEP_NUMBERS);
Maybe<bool> CollectKeys(Handle<JSReceiver> receiver,
Handle<JSReceiver> object);
void CollectOwnElementIndices(Handle<JSObject> object);
void CollectOwnPropertyNames(Handle<JSObject> object);
static Handle<FixedArray> GetEnumPropertyKeys(Isolate* isolate,
Handle<JSObject> object);
bool AddKey(uint32_t key); bool AddKey(uint32_t key);
bool AddKey(Object* key, AddKeyConversion convert); bool AddKey(Object* key, AddKeyConversion convert);
bool AddKey(Handle<Object> key, AddKeyConversion convert); bool AddKey(Handle<Object> key, AddKeyConversion convert);
...@@ -44,38 +53,27 @@ class KeyAccumulator final BASE_EMBEDDED { ...@@ -44,38 +53,27 @@ class KeyAccumulator final BASE_EMBEDDED {
void AddKeysFromProxy(Handle<JSObject> array); void AddKeysFromProxy(Handle<JSObject> array);
Maybe<bool> AddKeysFromProxy(Handle<JSProxy> proxy, Handle<FixedArray> keys); Maybe<bool> AddKeysFromProxy(Handle<JSProxy> proxy, Handle<FixedArray> keys);
void AddElementKeysFromInterceptor(Handle<JSObject> array); void AddElementKeysFromInterceptor(Handle<JSObject> array);
// Jump to the next level, pushing the current |levelLength_| to // Jump to the next level, pushing the current |levelLength_| to
// |levelLengths_| and adding a new list to |elements_|. // |levelLengths_| and adding a new list to |elements_|.
void NextPrototype(); void NextPrototype();
// Sort the integer indices in the last list in |elements_| // Sort the integer indices in the last list in |elements_|
void SortCurrentElementsList(); void SortCurrentElementsList();
Handle<FixedArray> GetKeys(GetKeysConversion convert = KEEP_NUMBERS);
int length() { return length_; } int length() { return length_; }
Isolate* isolate() { return isolate_; } Isolate* isolate() { return isolate_; }
void set_filter_proxy_keys(bool filter) { filter_proxy_keys_ = filter; }
PropertyFilter filter() { return filter_; } PropertyFilter filter() { return filter_; }
void set_filter_proxy_keys(bool filter) { filter_proxy_keys_ = filter; }
Maybe<bool> GetKeys_Internal(Handle<JSReceiver> receiver,
Handle<JSReceiver> object,
KeyCollectionType type);
static Handle<FixedArray> GetEnumPropertyKeys(Isolate* isolate,
Handle<JSObject> object);
void CollectOwnElementKeys(Handle<JSObject> object);
void CollectOwnPropertyNames(Handle<JSObject> object);
private: private:
Maybe<bool> CollectOwnJSProxyKeys(Handle<JSReceiver> receiver,
Handle<JSProxy> proxy);
Maybe<bool> CollectOwnKeys(Handle<JSReceiver> receiver,
Handle<JSObject> object);
bool AddIntegerKey(uint32_t key); bool AddIntegerKey(uint32_t key);
bool AddStringKey(Handle<Object> key, AddKeyConversion convert); bool AddStringKey(Handle<Object> key, AddKeyConversion convert);
bool AddSymbolKey(Handle<Object> array); bool AddSymbolKey(Handle<Object> array);
void SortCurrentElementsListRemoveDuplicates(); void SortCurrentElementsListRemoveDuplicates();
Maybe<bool> JSProxyOwnPropertyKeys(Handle<JSReceiver> receiver,
Handle<JSProxy> proxy);
Maybe<bool> GetKeysFromJSObject(Handle<JSReceiver> receiver,
Handle<JSObject> object,
KeyCollectionType type);
Isolate* isolate_; Isolate* isolate_;
KeyCollectionType type_; KeyCollectionType type_;
PropertyFilter filter_; PropertyFilter filter_;
......
...@@ -8065,7 +8065,7 @@ MaybeHandle<FixedArray> JSReceiver::GetKeys(Handle<JSReceiver> object, ...@@ -8065,7 +8065,7 @@ MaybeHandle<FixedArray> JSReceiver::GetKeys(Handle<JSReceiver> object,
Isolate* isolate = object->GetIsolate(); Isolate* isolate = object->GetIsolate();
KeyAccumulator accumulator(isolate, type, filter); KeyAccumulator accumulator(isolate, type, filter);
accumulator.set_filter_proxy_keys(filter_proxy_keys); accumulator.set_filter_proxy_keys(filter_proxy_keys);
MAYBE_RETURN(accumulator.GetKeys_Internal(object, object, type), MAYBE_RETURN(accumulator.CollectKeys(object, object),
MaybeHandle<FixedArray>()); MaybeHandle<FixedArray>());
Handle<FixedArray> keys = accumulator.GetKeys(keys_conversion); Handle<FixedArray> keys = accumulator.GetKeys(keys_conversion);
DCHECK(ContainsOnlyValidKeys(keys)); DCHECK(ContainsOnlyValidKeys(keys));
...@@ -8163,7 +8163,7 @@ MaybeHandle<FixedArray> GetOwnValuesOrEntries(Isolate* isolate, ...@@ -8163,7 +8163,7 @@ MaybeHandle<FixedArray> GetOwnValuesOrEntries(Isolate* isolate,
PropertyFilter key_filter = PropertyFilter key_filter =
static_cast<PropertyFilter>(filter & ~ONLY_ENUMERABLE); static_cast<PropertyFilter>(filter & ~ONLY_ENUMERABLE);
KeyAccumulator accumulator(isolate, OWN_ONLY, key_filter); KeyAccumulator accumulator(isolate, OWN_ONLY, key_filter);
MAYBE_RETURN(accumulator.GetKeys_Internal(object, object, OWN_ONLY), MAYBE_RETURN(accumulator.CollectKeys(object, object),
MaybeHandle<FixedArray>()); MaybeHandle<FixedArray>());
Handle<FixedArray> keys = accumulator.GetKeys(CONVERT_TO_STRING); Handle<FixedArray> keys = accumulator.GetKeys(CONVERT_TO_STRING);
DCHECK(ContainsOnlyValidKeys(keys)); DCHECK(ContainsOnlyValidKeys(keys));
......
...@@ -213,7 +213,7 @@ RUNTIME_FUNCTION(Runtime_GetArrayKeys) { ...@@ -213,7 +213,7 @@ RUNTIME_FUNCTION(Runtime_GetArrayKeys) {
} }
accumulator.NextPrototype(); accumulator.NextPrototype();
Handle<JSObject> current = PrototypeIterator::GetCurrent<JSObject>(iter); Handle<JSObject> current = PrototypeIterator::GetCurrent<JSObject>(iter);
accumulator.CollectOwnElementKeys(current); accumulator.CollectOwnElementIndices(current);
} }
// Erase any keys >= length. // Erase any keys >= length.
Handle<FixedArray> keys = accumulator.GetKeys(KEEP_NUMBERS); Handle<FixedArray> keys = accumulator.GetKeys(KEEP_NUMBERS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment