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

Side by Side Diff: src/builtins.cc

Issue 1436493002: [builtins] Introduce specialized Call/CallFunction builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/code-factory.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.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 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 BUILTIN(HandleApiCallConstruct) { 1875 BUILTIN(HandleApiCallConstruct) {
1876 HandleScope scope(isolate); 1876 HandleScope scope(isolate);
1877 DCHECK(CalledAsConstructor(isolate)); 1877 DCHECK(CalledAsConstructor(isolate));
1878 Handle<Object> result; 1878 Handle<Object> result;
1879 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 1879 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
1880 HandleApiCallHelper<true>(isolate, args)); 1880 HandleApiCallHelper<true>(isolate, args));
1881 return *result; 1881 return *result;
1882 } 1882 }
1883 1883
1884 1884
1885 Handle<Code> Builtins::CallFunction(ConvertReceiverMode mode) {
1886 switch (mode) {
1887 case ConvertReceiverMode::kNullOrUndefined:
1888 return CallFunction_ReceiverIsNullOrUndefined();
1889 case ConvertReceiverMode::kNotNullOrUndefined:
1890 return CallFunction_ReceiverIsNotNullOrUndefined();
1891 case ConvertReceiverMode::kAny:
1892 return CallFunction_ReceiverIsAny();
1893 }
1894 UNREACHABLE();
1895 return Handle<Code>::null();
1896 }
1897
1898
1899 Handle<Code> Builtins::Call(ConvertReceiverMode mode) {
1900 switch (mode) {
1901 case ConvertReceiverMode::kNullOrUndefined:
1902 return Call_ReceiverIsNullOrUndefined();
1903 case ConvertReceiverMode::kNotNullOrUndefined:
1904 return Call_ReceiverIsNotNullOrUndefined();
1905 case ConvertReceiverMode::kAny:
1906 return Call_ReceiverIsAny();
1907 }
1908 UNREACHABLE();
1909 return Handle<Code>::null();
1910 }
1911
1912
1885 namespace { 1913 namespace {
1886 1914
1887 class RelocatableArguments : public BuiltinArguments<NEEDS_CALLED_FUNCTION>, 1915 class RelocatableArguments : public BuiltinArguments<NEEDS_CALLED_FUNCTION>,
1888 public Relocatable { 1916 public Relocatable {
1889 public: 1917 public:
1890 RelocatableArguments(Isolate* isolate, int length, Object** arguments) 1918 RelocatableArguments(Isolate* isolate, int length, Object** arguments)
1891 : BuiltinArguments<NEEDS_CALLED_FUNCTION>(length, arguments), 1919 : BuiltinArguments<NEEDS_CALLED_FUNCTION>(length, arguments),
1892 Relocatable(isolate) {} 1920 Relocatable(isolate) {}
1893 1921
1894 virtual inline void IterateInstance(ObjectVisitor* v) { 1922 virtual inline void IterateInstance(ObjectVisitor* v) {
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
2363 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 2391 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
2364 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 2392 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
2365 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 2393 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
2366 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 2394 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
2367 #undef DEFINE_BUILTIN_ACCESSOR_C 2395 #undef DEFINE_BUILTIN_ACCESSOR_C
2368 #undef DEFINE_BUILTIN_ACCESSOR_A 2396 #undef DEFINE_BUILTIN_ACCESSOR_A
2369 2397
2370 2398
2371 } // namespace internal 2399 } // namespace internal
2372 } // namespace v8 2400 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins.h ('k') | src/code-factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698