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

Side by Side Diff: src/mips/builtins-mips.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/ia32/builtins-ia32.cc ('k') | src/mips64/builtins-mips64.cc » ('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 #if V8_TARGET_ARCH_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
11 #include "src/runtime/runtime.h" 11 #include "src/runtime/runtime.h"
12 12
13 13
14 namespace v8 { 14 namespace v8 {
15 namespace internal { 15 namespace internal {
16 16
17 17
18 #define __ ACCESS_MASM(masm) 18 #define __ ACCESS_MASM(masm)
19 19
20 20
21 void Builtins::Generate_Adaptor(MacroAssembler* masm, 21 void Builtins::Generate_Adaptor(MacroAssembler* masm,
22 CFunctionId id, 22 CFunctionId id,
23 BuiltinExtraArguments extra_args) { 23 BuiltinExtraArguments extra_args) {
24 // ----------- S t a t e ------------- 24 // ----------- S t a t e -------------
25 // -- a0 : number of arguments excluding receiver 25 // -- a0 : number of arguments excluding receiver
26 // -- a1 : called function 26 // -- a1 : target
27 // -- a3 : new.target
27 // -- sp[0] : last argument 28 // -- sp[0] : last argument
28 // -- ... 29 // -- ...
29 // -- sp[4 * (argc - 1)] : first argument 30 // -- sp[4 * (argc - 1)] : first argument
30 // -- sp[4 * agrc] : receiver 31 // -- sp[4 * agrc] : receiver
31 // ----------------------------------- 32 // -----------------------------------
32 __ AssertFunction(a1); 33 __ AssertFunction(a1);
33 34
34 // Insert extra arguments. 35 // Insert extra arguments.
35 int num_extra_args = 0; 36 int num_extra_args = 0;
36 if (extra_args == NEEDS_CALLED_FUNCTION) { 37 switch (extra_args) {
37 num_extra_args = 1; 38 case BuiltinExtraArguments::kTarget:
38 __ push(a1); 39 __ Push(a1);
39 } else { 40 ++num_extra_args;
40 DCHECK(extra_args == NO_EXTRA_ARGUMENTS); 41 break;
42 case BuiltinExtraArguments::kNewTarget:
43 __ Push(a3);
44 ++num_extra_args;
45 break;
46 case BuiltinExtraArguments::kTargetAndNewTarget:
47 __ Push(a1, a3);
48 num_extra_args += 2;
49 break;
50 case BuiltinExtraArguments::kNone:
51 break;
41 } 52 }
42 53
43 // JumpToExternalReference expects a0 to contain the number of arguments 54 // JumpToExternalReference expects a0 to contain the number of arguments
44 // including the receiver and the extra arguments. 55 // including the receiver and the extra arguments.
45 __ Addu(a0, a0, num_extra_args + 1); 56 __ Addu(a0, a0, num_extra_args + 1);
46 57
47 __ JumpToExternalReference(ExternalReference(id, masm->isolate())); 58 __ JumpToExternalReference(ExternalReference(id, masm->isolate()));
48 } 59 }
49 60
50 61
(...skipping 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after
1963 } 1974 }
1964 } 1975 }
1965 1976
1966 1977
1967 #undef __ 1978 #undef __
1968 1979
1969 } // namespace internal 1980 } // namespace internal
1970 } // namespace v8 1981 } // namespace v8
1971 1982
1972 #endif // V8_TARGET_ARCH_MIPS 1983 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698