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

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

Issue 2649143002: [Turbofan] Implement call with spread bytecode in assembly code. (Closed)
Patch Set: Mips ports Created 3 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
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/builtins.h" 5 #include "src/builtins/builtins.h"
6 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 10
11 Handle<Code> Builtins::InterpreterPushArgsAndCall(TailCallMode tail_call_mode, 11 Handle<Code> Builtins::InterpreterPushArgsAndCall(TailCallMode tail_call_mode,
12 CallableType function_type) { 12 PushArgsMode mode) {
13 switch (tail_call_mode) { 13 switch (mode) {
14 case TailCallMode::kDisallow: 14 case PushArgsMode::kJSFunction:
15 if (function_type == CallableType::kJSFunction) { 15 if (tail_call_mode == TailCallMode::kDisallow) {
16 return InterpreterPushArgsAndCallFunction(); 16 return InterpreterPushArgsAndCallFunction();
17 } else { 17 } else {
18 return InterpreterPushArgsAndTailCallFunction();
19 }
20 case PushArgsMode::kWithFinalSpread:
21 CHECK(tail_call_mode == TailCallMode::kDisallow);
22 return InterpreterPushArgsAndCallWithFinalSpread();
23 case PushArgsMode::kOther:
24 if (tail_call_mode == TailCallMode::kDisallow) {
18 return InterpreterPushArgsAndCall(); 25 return InterpreterPushArgsAndCall();
19 }
20 case TailCallMode::kAllow:
21 if (function_type == CallableType::kJSFunction) {
22 return InterpreterPushArgsAndTailCallFunction();
23 } else { 26 } else {
24 return InterpreterPushArgsAndTailCall(); 27 return InterpreterPushArgsAndTailCall();
25 } 28 }
26 } 29 }
27 UNREACHABLE(); 30 UNREACHABLE();
28 return Handle<Code>::null(); 31 return Handle<Code>::null();
29 } 32 }
30 33
31 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { 34 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
32 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kDisallow, 35 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kDisallow,
33 CallableType::kAny); 36 PushArgsMode::kOther);
34 } 37 }
35 38
36 void Builtins::Generate_InterpreterPushArgsAndCallFunction( 39 void Builtins::Generate_InterpreterPushArgsAndCallFunction(
37 MacroAssembler* masm) { 40 MacroAssembler* masm) {
38 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kDisallow, 41 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kDisallow,
39 CallableType::kJSFunction); 42 PushArgsMode::kJSFunction);
43 }
44
45 void Builtins::Generate_InterpreterPushArgsAndCallWithFinalSpread(
46 MacroAssembler* masm) {
47 return Generate_InterpreterPushArgsAndCallImpl(
48 masm, TailCallMode::kDisallow, PushArgsMode::kWithFinalSpread);
40 } 49 }
41 50
42 void Builtins::Generate_InterpreterPushArgsAndTailCall(MacroAssembler* masm) { 51 void Builtins::Generate_InterpreterPushArgsAndTailCall(MacroAssembler* masm) {
43 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow, 52 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow,
44 CallableType::kAny); 53 PushArgsMode::kOther);
45 } 54 }
46 55
47 void Builtins::Generate_InterpreterPushArgsAndTailCallFunction( 56 void Builtins::Generate_InterpreterPushArgsAndTailCallFunction(
48 MacroAssembler* masm) { 57 MacroAssembler* masm) {
49 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow, 58 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow,
50 CallableType::kJSFunction); 59 PushArgsMode::kJSFunction);
51 } 60 }
52 61
53 Handle<Code> Builtins::InterpreterPushArgsAndConstruct( 62 Handle<Code> Builtins::InterpreterPushArgsAndConstruct(PushArgsMode mode) {
54 PushArgsConstructMode mode) {
55 switch (mode) { 63 switch (mode) {
56 case PushArgsConstructMode::kJSFunction: 64 case PushArgsMode::kJSFunction:
57 return InterpreterPushArgsAndConstructFunction(); 65 return InterpreterPushArgsAndConstructFunction();
58 case PushArgsConstructMode::kWithFinalSpread: 66 case PushArgsMode::kWithFinalSpread:
59 return InterpreterPushArgsAndConstructWithFinalSpread(); 67 return InterpreterPushArgsAndConstructWithFinalSpread();
60 case PushArgsConstructMode::kOther: 68 case PushArgsMode::kOther:
61 return InterpreterPushArgsAndConstruct(); 69 return InterpreterPushArgsAndConstruct();
62 } 70 }
63 UNREACHABLE(); 71 UNREACHABLE();
64 return Handle<Code>::null(); 72 return Handle<Code>::null();
65 } 73 }
66 74
67 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { 75 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
68 return Generate_InterpreterPushArgsAndConstructImpl( 76 return Generate_InterpreterPushArgsAndConstructImpl(masm,
69 masm, PushArgsConstructMode::kOther); 77 PushArgsMode::kOther);
70 } 78 }
71 79
72 void Builtins::Generate_InterpreterPushArgsAndConstructWithFinalSpread( 80 void Builtins::Generate_InterpreterPushArgsAndConstructWithFinalSpread(
73 MacroAssembler* masm) { 81 MacroAssembler* masm) {
74 return Generate_InterpreterPushArgsAndConstructImpl( 82 return Generate_InterpreterPushArgsAndConstructImpl(
75 masm, PushArgsConstructMode::kWithFinalSpread); 83 masm, PushArgsMode::kWithFinalSpread);
76 } 84 }
77 85
78 void Builtins::Generate_InterpreterPushArgsAndConstructFunction( 86 void Builtins::Generate_InterpreterPushArgsAndConstructFunction(
79 MacroAssembler* masm) { 87 MacroAssembler* masm) {
80 return Generate_InterpreterPushArgsAndConstructImpl( 88 return Generate_InterpreterPushArgsAndConstructImpl(
81 masm, PushArgsConstructMode::kJSFunction); 89 masm, PushArgsMode::kJSFunction);
82 } 90 }
83 91
84 } // namespace internal 92 } // namespace internal
85 } // namespace v8 93 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698