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

Unified Diff: src/objects.cc

Issue 1989263002: [keys] KeyAccumulator cleanups (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/keys.cc ('k') | no next file » | 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 6f24eee0afeaab064e0051b737894db1ffe414bd..8492afc721e654fe4353f04b3a5c6cd2116491e1 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -8152,16 +8152,6 @@ int Map::NextFreePropertyIndex() {
}
-static bool ContainsOnlyValidKeys(Handle<FixedArray> array) {
- int len = array->length();
- for (int i = 0; i < len; i++) {
- Object* e = array->get(i);
- if (!(e->IsName() || e->IsNumber())) return false;
- }
- return true;
-}
-
-
bool Map::OnlyHasSimpleProperties() {
// Wrapped string elements aren't explicitly stored in the elements backing
// store, but are loaded indirectly from the underlying string.
@@ -8175,15 +8165,8 @@ MaybeHandle<FixedArray> JSReceiver::GetKeys(Handle<JSReceiver> object,
PropertyFilter filter,
GetKeysConversion keys_conversion,
bool filter_proxy_keys) {
- USE(ContainsOnlyValidKeys);
- Isolate* isolate = object->GetIsolate();
- KeyAccumulator accumulator(isolate, type, filter);
- accumulator.set_filter_proxy_keys(filter_proxy_keys);
- MAYBE_RETURN(accumulator.CollectKeys(object, object),
- MaybeHandle<FixedArray>());
- Handle<FixedArray> keys = accumulator.GetKeys(keys_conversion);
- DCHECK(ContainsOnlyValidKeys(keys));
- return keys;
+ return KeyAccumulator::GetKeys(object, type, filter, keys_conversion,
+ filter_proxy_keys);
}
MUST_USE_RESULT Maybe<bool> FastGetOwnValuesOrEntries(
@@ -8280,7 +8263,6 @@ MaybeHandle<FixedArray> GetOwnValuesOrEntries(Isolate* isolate,
MAYBE_RETURN(accumulator.CollectKeys(object, object),
MaybeHandle<FixedArray>());
Handle<FixedArray> keys = accumulator.GetKeys(CONVERT_TO_STRING);
- DCHECK(ContainsOnlyValidKeys(keys));
values_or_entries = isolate->factory()->NewFixedArray(keys->length());
int length = 0;
« no previous file with comments | « src/keys.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698