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

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

Issue 2571563004: [Turbofan] Implement super calls with spread bytecode in assembly code. (Closed)
Patch Set: Update builtins for new push args modes 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_S390 5 #if V8_TARGET_ARCH_S390
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"
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 __ bind(&stack_overflow); 1202 __ bind(&stack_overflow);
1203 { 1203 {
1204 __ TailCallRuntime(Runtime::kThrowStackOverflow); 1204 __ TailCallRuntime(Runtime::kThrowStackOverflow);
1205 // Unreachable Code. 1205 // Unreachable Code.
1206 __ bkpt(0); 1206 __ bkpt(0);
1207 } 1207 }
1208 } 1208 }
1209 1209
1210 // static 1210 // static
1211 void Builtins::Generate_InterpreterPushArgsAndConstructImpl( 1211 void Builtins::Generate_InterpreterPushArgsAndConstructImpl(
1212 MacroAssembler* masm, CallableType construct_type) { 1212 MacroAssembler* masm, PushArgsConstructMode mode) {
1213 // ----------- S t a t e ------------- 1213 // ----------- S t a t e -------------
1214 // -- r2 : argument count (not including receiver) 1214 // -- r2 : argument count (not including receiver)
1215 // -- r5 : new target 1215 // -- r5 : new target
1216 // -- r3 : constructor to call 1216 // -- r3 : constructor to call
1217 // -- r4 : allocation site feedback if available, undefined otherwise. 1217 // -- r4 : allocation site feedback if available, undefined otherwise.
1218 // -- r6 : address of the first argument 1218 // -- r6 : address of the first argument
1219 // ----------------------------------- 1219 // -----------------------------------
1220 Label stack_overflow; 1220 Label stack_overflow;
1221 1221
1222 // Push a slot for the receiver to be constructed. 1222 // Push a slot for the receiver to be constructed.
1223 __ LoadImmP(r0, Operand::Zero()); 1223 __ LoadImmP(r0, Operand::Zero());
1224 __ push(r0); 1224 __ push(r0);
1225 1225
1226 // Push the arguments (skip if none). 1226 // Push the arguments (skip if none).
1227 Label skip; 1227 Label skip;
1228 __ CmpP(r2, Operand::Zero()); 1228 __ CmpP(r2, Operand::Zero());
1229 __ beq(&skip); 1229 __ beq(&skip);
1230 Generate_InterpreterPushArgs(masm, r2, r6, r2, r7, &stack_overflow); 1230 Generate_InterpreterPushArgs(masm, r2, r6, r2, r7, &stack_overflow);
1231 __ bind(&skip); 1231 __ bind(&skip);
1232 1232
1233 __ AssertUndefinedOrAllocationSite(r4, r7); 1233 __ AssertUndefinedOrAllocationSite(r4, r7);
1234 if (construct_type == CallableType::kJSFunction) { 1234 if (mode == PushArgsConstructMode::kJSFunction) {
1235 __ AssertFunction(r3); 1235 __ AssertFunction(r3);
1236 1236
1237 // Tail call to the function-specific construct stub (still in the caller 1237 // Tail call to the function-specific construct stub (still in the caller
1238 // context at this point). 1238 // context at this point).
1239 __ LoadP(r6, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); 1239 __ LoadP(r6, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset));
1240 __ LoadP(r6, FieldMemOperand(r6, SharedFunctionInfo::kConstructStubOffset)); 1240 __ LoadP(r6, FieldMemOperand(r6, SharedFunctionInfo::kConstructStubOffset));
1241 // Jump to the construct function. 1241 // Jump to the construct function.
1242 __ AddP(ip, r6, Operand(Code::kHeaderSize - kHeapObjectTag)); 1242 __ AddP(ip, r6, Operand(Code::kHeaderSize - kHeapObjectTag));
1243 __ Jump(ip); 1243 __ Jump(ip);
1244 1244 } else if (mode == PushArgsConstructMode::kWithFinalSpread) {
1245 // Call the constructor with r2, r3, and r5 unmodified.
1246 __ Jump(masm->isolate()->builtins()->ConstructWithSpread(),
1247 RelocInfo::CODE_TARGET);
1245 } else { 1248 } else {
1246 DCHECK_EQ(construct_type, CallableType::kAny); 1249 DCHECK_EQ(PushArgsConstructMode::kOther, mode);
1247 // Call the constructor with r2, r3, and r5 unmodified. 1250 // Call the constructor with r2, r3, and r5 unmodified.
1248 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); 1251 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
1249 } 1252 }
1250 1253
1251 __ bind(&stack_overflow); 1254 __ bind(&stack_overflow);
1252 { 1255 {
1253 __ TailCallRuntime(Runtime::kThrowStackOverflow); 1256 __ TailCallRuntime(Runtime::kThrowStackOverflow);
1254 // Unreachable Code. 1257 // Unreachable Code.
1255 __ bkpt(0); 1258 __ bkpt(0);
1256 } 1259 }
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after
2985 __ bkpt(0); 2988 __ bkpt(0);
2986 } 2989 }
2987 } 2990 }
2988 2991
2989 #undef __ 2992 #undef __
2990 2993
2991 } // namespace internal 2994 } // namespace internal
2992 } // namespace v8 2995 } // namespace v8
2993 2996
2994 #endif // V8_TARGET_ARCH_S390 2997 #endif // V8_TARGET_ARCH_S390
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698