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

Side by Side Diff: src/builtins.cc

Issue 1922453002: Migrate Object.getPrototypeOf from v8natives to builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/contexts.h » ('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-arguments.h" 7 #include "src/api-arguments.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1789 Handle<Object> object = args.atOrUndefined(isolate, 1); 1789 Handle<Object> object = args.atOrUndefined(isolate, 1);
1790 if (object->IsJSReceiver()) { 1790 if (object->IsJSReceiver()) {
1791 MAYBE_RETURN(JSReceiver::SetIntegrityLevel(Handle<JSReceiver>::cast(object), 1791 MAYBE_RETURN(JSReceiver::SetIntegrityLevel(Handle<JSReceiver>::cast(object),
1792 FROZEN, Object::THROW_ON_ERROR), 1792 FROZEN, Object::THROW_ON_ERROR),
1793 isolate->heap()->exception()); 1793 isolate->heap()->exception());
1794 } 1794 }
1795 return *object; 1795 return *object;
1796 } 1796 }
1797 1797
1798 1798
1799 // ES section 19.1.2.9 Object.getPrototypeOf ( O )
1800 BUILTIN(ObjectGetPrototypeOf) {
1801 HandleScope scope(isolate);
1802 Handle<Object> object = args.atOrUndefined(isolate, 1);
1803
1804 Handle<JSReceiver> receiver;
1805 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1806 isolate, receiver, Object::ToObject(isolate, object));
1807
1808 Handle<Object> prototype;
1809 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1810 isolate, prototype, JSReceiver::GetPrototype(isolate, receiver));
1811
1812 return *prototype;
1813 }
1814
1815
1799 // ES6 section 19.1.2.6 Object.getOwnPropertyDescriptor ( O, P ) 1816 // ES6 section 19.1.2.6 Object.getOwnPropertyDescriptor ( O, P )
1800 BUILTIN(ObjectGetOwnPropertyDescriptor) { 1817 BUILTIN(ObjectGetOwnPropertyDescriptor) {
1801 HandleScope scope(isolate); 1818 HandleScope scope(isolate);
1802 // 1. Let obj be ? ToObject(O). 1819 // 1. Let obj be ? ToObject(O).
1803 Handle<Object> object = args.atOrUndefined(isolate, 1); 1820 Handle<Object> object = args.atOrUndefined(isolate, 1);
1804 Handle<JSReceiver> receiver; 1821 Handle<JSReceiver> receiver;
1805 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver, 1822 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver,
1806 Object::ToObject(isolate, object)); 1823 Object::ToObject(isolate, object));
1807 // 2. Let key be ? ToPropertyKey(P). 1824 // 2. Let key be ? ToPropertyKey(P).
1808 Handle<Object> property = args.atOrUndefined(isolate, 2); 1825 Handle<Object> property = args.atOrUndefined(isolate, 2);
(...skipping 3537 matching lines...) Expand 10 before | Expand all | Expand 10 after
5346 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T) 5363 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T)
5347 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 5364 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
5348 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 5365 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
5349 #undef DEFINE_BUILTIN_ACCESSOR_C 5366 #undef DEFINE_BUILTIN_ACCESSOR_C
5350 #undef DEFINE_BUILTIN_ACCESSOR_A 5367 #undef DEFINE_BUILTIN_ACCESSOR_A
5351 #undef DEFINE_BUILTIN_ACCESSOR_T 5368 #undef DEFINE_BUILTIN_ACCESSOR_T
5352 #undef DEFINE_BUILTIN_ACCESSOR_H 5369 #undef DEFINE_BUILTIN_ACCESSOR_H
5353 5370
5354 } // namespace internal 5371 } // namespace internal
5355 } // namespace v8 5372 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins.h ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698