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

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

Issue 2571563004: [Turbofan] Implement super calls with spread bytecode in assembly code. (Closed)
Patch Set: MIPS64 port 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
« no previous file with comments | « src/builtins/mips64/builtins-mips64.cc ('k') | src/builtins/s390/builtins-s390.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 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 __ bind(&stack_overflow); 1194 __ bind(&stack_overflow);
1195 { 1195 {
1196 __ TailCallRuntime(Runtime::kThrowStackOverflow); 1196 __ TailCallRuntime(Runtime::kThrowStackOverflow);
1197 // Unreachable Code. 1197 // Unreachable Code.
1198 __ bkpt(0); 1198 __ bkpt(0);
1199 } 1199 }
1200 } 1200 }
1201 1201
1202 // static 1202 // static
1203 void Builtins::Generate_InterpreterPushArgsAndConstructImpl( 1203 void Builtins::Generate_InterpreterPushArgsAndConstructImpl(
1204 MacroAssembler* masm, CallableType construct_type) { 1204 MacroAssembler* masm, PushArgsConstructMode mode) {
1205 // ----------- S t a t e ------------- 1205 // ----------- S t a t e -------------
1206 // -- r3 : argument count (not including receiver) 1206 // -- r3 : argument count (not including receiver)
1207 // -- r6 : new target 1207 // -- r6 : new target
1208 // -- r4 : constructor to call 1208 // -- r4 : constructor to call
1209 // -- r5 : allocation site feedback if available, undefined otherwise. 1209 // -- r5 : allocation site feedback if available, undefined otherwise.
1210 // -- r7 : address of the first argument 1210 // -- r7 : address of the first argument
1211 // ----------------------------------- 1211 // -----------------------------------
1212 Label stack_overflow; 1212 Label stack_overflow;
1213 1213
1214 // Push a slot for the receiver to be constructed. 1214 // Push a slot for the receiver to be constructed.
1215 __ li(r0, Operand::Zero()); 1215 __ li(r0, Operand::Zero());
1216 __ push(r0); 1216 __ push(r0);
1217 1217
1218 // Push the arguments (skip if none). 1218 // Push the arguments (skip if none).
1219 Label skip; 1219 Label skip;
1220 __ cmpi(r3, Operand::Zero()); 1220 __ cmpi(r3, Operand::Zero());
1221 __ beq(&skip); 1221 __ beq(&skip);
1222 // Push the arguments. r8, r7, r9 will be modified. 1222 // Push the arguments. r8, r7, r9 will be modified.
1223 Generate_InterpreterPushArgs(masm, r3, r7, r3, r8, &stack_overflow); 1223 Generate_InterpreterPushArgs(masm, r3, r7, r3, r8, &stack_overflow);
1224 __ bind(&skip); 1224 __ bind(&skip);
1225 1225
1226 __ AssertUndefinedOrAllocationSite(r5, r8); 1226 __ AssertUndefinedOrAllocationSite(r5, r8);
1227 if (construct_type == CallableType::kJSFunction) { 1227 if (mode == PushArgsConstructMode::kJSFunction) {
1228 __ AssertFunction(r4); 1228 __ AssertFunction(r4);
1229 1229
1230 // Tail call to the function-specific construct stub (still in the caller 1230 // Tail call to the function-specific construct stub (still in the caller
1231 // context at this point). 1231 // context at this point).
1232 __ LoadP(r7, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); 1232 __ LoadP(r7, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
1233 __ LoadP(r7, FieldMemOperand(r7, SharedFunctionInfo::kConstructStubOffset)); 1233 __ LoadP(r7, FieldMemOperand(r7, SharedFunctionInfo::kConstructStubOffset));
1234 // Jump to the construct function. 1234 // Jump to the construct function.
1235 __ addi(ip, r7, Operand(Code::kHeaderSize - kHeapObjectTag)); 1235 __ addi(ip, r7, Operand(Code::kHeaderSize - kHeapObjectTag));
1236 __ Jump(ip); 1236 __ Jump(ip);
1237 1237 } else if (mode == PushArgsConstructMode::kWithFinalSpread) {
1238 // Call the constructor with r3, r4, and r6 unmodified.
1239 __ Jump(masm->isolate()->builtins()->ConstructWithSpread(),
1240 RelocInfo::CODE_TARGET);
1238 } else { 1241 } else {
1239 DCHECK_EQ(construct_type, CallableType::kAny); 1242 DCHECK_EQ(PushArgsConstructMode::kOther, mode);
1240 // Call the constructor with r3, r4, and r6 unmodified. 1243 // Call the constructor with r3, r4, and r6 unmodified.
1241 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); 1244 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
1242 } 1245 }
1243 1246
1244 __ bind(&stack_overflow); 1247 __ bind(&stack_overflow);
1245 { 1248 {
1246 __ TailCallRuntime(Runtime::kThrowStackOverflow); 1249 __ TailCallRuntime(Runtime::kThrowStackOverflow);
1247 // Unreachable Code. 1250 // Unreachable Code.
1248 __ bkpt(0); 1251 __ bkpt(0);
1249 } 1252 }
(...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after
2962 __ CallRuntime(Runtime::kThrowStackOverflow); 2965 __ CallRuntime(Runtime::kThrowStackOverflow);
2963 __ bkpt(0); 2966 __ bkpt(0);
2964 } 2967 }
2965 } 2968 }
2966 2969
2967 #undef __ 2970 #undef __
2968 } // namespace internal 2971 } // namespace internal
2969 } // namespace v8 2972 } // namespace v8
2970 2973
2971 #endif // V8_TARGET_ARCH_PPC 2974 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/builtins/mips64/builtins-mips64.cc ('k') | src/builtins/s390/builtins-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698