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

Side by Side Diff: src/builtins.cc

Issue 1609023003: Revert of [builtins] Migrate Object.getOwnPropertyDescriptor to C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/builtins.h ('k') | src/js/v8natives.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/builtins.h" 5 #include "src/builtins.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 Handle<Object> object = args.atOrUndefined(isolate, 1); 1559 Handle<Object> object = args.atOrUndefined(isolate, 1);
1560 if (object->IsJSReceiver()) { 1560 if (object->IsJSReceiver()) {
1561 MAYBE_RETURN(JSReceiver::SetIntegrityLevel(Handle<JSReceiver>::cast(object), 1561 MAYBE_RETURN(JSReceiver::SetIntegrityLevel(Handle<JSReceiver>::cast(object),
1562 FROZEN, Object::THROW_ON_ERROR), 1562 FROZEN, Object::THROW_ON_ERROR),
1563 isolate->heap()->exception()); 1563 isolate->heap()->exception());
1564 } 1564 }
1565 return *object; 1565 return *object;
1566 } 1566 }
1567 1567
1568 1568
1569 // ES6 section 19.1.2.6 Object.getOwnPropertyDescriptor ( O, P )
1570 BUILTIN(ObjectGetOwnPropertyDescriptor) {
1571 HandleScope scope(isolate);
1572 // 1. Let obj be ? ToObject(O).
1573 Handle<Object> object = args.atOrUndefined(isolate, 1);
1574 Handle<JSReceiver> receiver;
1575 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver,
1576 Object::ToObject(isolate, object));
1577 // 2. Let key be ? ToPropertyKey(P).
1578 Handle<Object> property = args.atOrUndefined(isolate, 2);
1579 Handle<Name> key;
1580 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, key,
1581 Object::ToName(isolate, property));
1582 // 3. Let desc be ? obj.[[GetOwnProperty]](key).
1583 PropertyDescriptor desc;
1584 Maybe<bool> found =
1585 JSReceiver::GetOwnPropertyDescriptor(isolate, receiver, key, &desc);
1586 MAYBE_RETURN(found, isolate->heap()->exception());
1587 // 4. Return FromPropertyDescriptor(desc).
1588 if (!found.FromJust()) return isolate->heap()->undefined_value();
1589 return *desc.ToObject(isolate);
1590 }
1591
1592
1593 // ES6 section 19.1.2.8 Object.getOwnPropertySymbols ( O ) 1569 // ES6 section 19.1.2.8 Object.getOwnPropertySymbols ( O )
1594 BUILTIN(ObjectGetOwnPropertySymbols) { 1570 BUILTIN(ObjectGetOwnPropertySymbols) {
1595 HandleScope scope(isolate); 1571 HandleScope scope(isolate);
1596 Handle<Object> object = args.atOrUndefined(isolate, 1); 1572 Handle<Object> object = args.atOrUndefined(isolate, 1);
1597 Handle<JSReceiver> receiver; 1573 Handle<JSReceiver> receiver;
1598 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver, 1574 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver,
1599 Object::ToObject(isolate, object)); 1575 Object::ToObject(isolate, object));
1600 Handle<FixedArray> keys; 1576 Handle<FixedArray> keys;
1601 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 1577 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1602 isolate, keys, JSReceiver::GetKeys(receiver, JSReceiver::OWN_ONLY, 1578 isolate, keys, JSReceiver::GetKeys(receiver, JSReceiver::OWN_ONLY,
(...skipping 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after
4005 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 3981 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
4006 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 3982 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
4007 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 3983 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
4008 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 3984 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
4009 #undef DEFINE_BUILTIN_ACCESSOR_C 3985 #undef DEFINE_BUILTIN_ACCESSOR_C
4010 #undef DEFINE_BUILTIN_ACCESSOR_A 3986 #undef DEFINE_BUILTIN_ACCESSOR_A
4011 3987
4012 3988
4013 } // namespace internal 3989 } // namespace internal
4014 } // namespace v8 3990 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins.h ('k') | src/js/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698