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

Side by Side Diff: src/arm64/builtins-arm64.cc

Issue 1491883002: [builtins] Some refactoring on the builtin mechanism. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/arm/builtins-arm.cc ('k') | src/builtins.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #if V8_TARGET_ARCH_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 20 matching lines...) Expand all
31 // Load the InternalArray function from the native context. 31 // Load the InternalArray function from the native context.
32 __ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result); 32 __ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result);
33 } 33 }
34 34
35 35
36 void Builtins::Generate_Adaptor(MacroAssembler* masm, 36 void Builtins::Generate_Adaptor(MacroAssembler* masm,
37 CFunctionId id, 37 CFunctionId id,
38 BuiltinExtraArguments extra_args) { 38 BuiltinExtraArguments extra_args) {
39 // ----------- S t a t e ------------- 39 // ----------- S t a t e -------------
40 // -- x0 : number of arguments excluding receiver 40 // -- x0 : number of arguments excluding receiver
41 // -- x1 : called function 41 // -- x1 : target
42 // -- x3 : new target
42 // -- sp[0] : last argument 43 // -- sp[0] : last argument
43 // -- ... 44 // -- ...
44 // -- sp[4 * (argc - 1)] : first argument 45 // -- sp[4 * (argc - 1)] : first argument
45 // -- sp[4 * argc] : receiver 46 // -- sp[4 * argc] : receiver
46 // ----------------------------------- 47 // -----------------------------------
47 __ AssertFunction(x1); 48 __ AssertFunction(x1);
48 49
49 // Insert extra arguments. 50 // Insert extra arguments.
50 int num_extra_args = 0; 51 int num_extra_args = 0;
51 if (extra_args == NEEDS_CALLED_FUNCTION) { 52 switch (extra_args) {
52 num_extra_args = 1; 53 case BuiltinExtraArguments::kTarget:
53 __ Push(x1); 54 __ Push(x1);
54 } else { 55 ++num_extra_args;
55 DCHECK(extra_args == NO_EXTRA_ARGUMENTS); 56 break;
57 case BuiltinExtraArguments::kNewTarget:
58 __ Push(x3);
59 ++num_extra_args;
60 break;
61 case BuiltinExtraArguments::kTargetAndNewTarget:
62 __ Push(x1, x3);
63 num_extra_args += 2;
64 break;
65 case BuiltinExtraArguments::kNone:
66 break;
56 } 67 }
57 68
58 // JumpToExternalReference expects x0 to contain the number of arguments 69 // JumpToExternalReference expects x0 to contain the number of arguments
59 // including the receiver and the extra arguments. 70 // including the receiver and the extra arguments.
60 __ Add(x0, x0, num_extra_args + 1); 71 __ Add(x0, x0, num_extra_args + 1);
61 72
62 __ JumpToExternalReference(ExternalReference(id, masm->isolate())); 73 __ JumpToExternalReference(ExternalReference(id, masm->isolate()));
63 } 74 }
64 75
65 76
(...skipping 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 } 2038 }
2028 } 2039 }
2029 2040
2030 2041
2031 #undef __ 2042 #undef __
2032 2043
2033 } // namespace internal 2044 } // namespace internal
2034 } // namespace v8 2045 } // namespace v8
2035 2046
2036 #endif // V8_TARGET_ARCH_ARM 2047 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698