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

Unified Diff: src/builtins/builtins-object.cc

Issue 2853393002: [builtins] Migrate Object.keys to CodeStubAssembler builtin. (Closed)
Patch Set: Really fix the test, meh. Created 3 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/builtins/builtins-definitions.h ('k') | src/builtins/builtins-object-gen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-object.cc
diff --git a/src/builtins/builtins-object.cc b/src/builtins/builtins-object.cc
index 8f7de84f4b3e1226cd3f164edf19810cce556fcb..95d2149f31a21e09d506a46bb2fb665d71ea184b 100644
--- a/src/builtins/builtins-object.cc
+++ b/src/builtins/builtins-object.cc
@@ -437,41 +437,6 @@ BUILTIN(ObjectIsSealed) {
return isolate->heap()->ToBoolean(result.FromJust());
}
-// ES6 section 19.1.2.14 Object.keys ( O )
-BUILTIN(ObjectKeys) {
- HandleScope scope(isolate);
- Handle<Object> object = args.atOrUndefined(isolate, 1);
- Handle<JSReceiver> receiver;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver,
- Object::ToObject(isolate, object));
-
- Handle<FixedArray> keys;
- int enum_length = receiver->map()->EnumLength();
- if (enum_length != kInvalidEnumCacheSentinel &&
- JSObject::cast(*receiver)->elements() ==
- isolate->heap()->empty_fixed_array()) {
- DCHECK(receiver->IsJSObject());
- DCHECK(!JSObject::cast(*receiver)->HasNamedInterceptor());
- DCHECK(!JSObject::cast(*receiver)->IsAccessCheckNeeded());
- DCHECK(!receiver->map()->has_hidden_prototype());
- DCHECK(JSObject::cast(*receiver)->HasFastProperties());
- if (enum_length == 0) {
- keys = isolate->factory()->empty_fixed_array();
- } else {
- Handle<FixedArray> cache(
- receiver->map()->instance_descriptors()->GetEnumCache());
- keys = isolate->factory()->CopyFixedArrayUpTo(cache, enum_length);
- }
- } else {
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, keys,
- KeyAccumulator::GetKeys(receiver, KeyCollectionMode::kOwnOnly,
- ENUMERABLE_STRINGS,
- GetKeysConversion::kConvertToString));
- }
- return *isolate->factory()->NewJSArrayWithElements(keys, FAST_ELEMENTS);
-}
-
BUILTIN(ObjectValues) {
HandleScope scope(isolate);
Handle<Object> object = args.atOrUndefined(isolate, 1);
« no previous file with comments | « src/builtins/builtins-definitions.h ('k') | src/builtins/builtins-object-gen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698