OLD | NEW |
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 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 __ bind(&stack_overflow); | 1195 __ bind(&stack_overflow); |
1196 { | 1196 { |
1197 __ TailCallRuntime(Runtime::kThrowStackOverflow); | 1197 __ TailCallRuntime(Runtime::kThrowStackOverflow); |
1198 // Unreachable Code. | 1198 // Unreachable Code. |
1199 __ bkpt(0); | 1199 __ bkpt(0); |
1200 } | 1200 } |
1201 } | 1201 } |
1202 | 1202 |
1203 // static | 1203 // static |
1204 void Builtins::Generate_InterpreterPushArgsAndConstructImpl( | 1204 void Builtins::Generate_InterpreterPushArgsAndConstructImpl( |
1205 MacroAssembler* masm, CallableType construct_type) { | 1205 MacroAssembler* masm, PushArgsConstructMode mode) { |
1206 // ----------- S t a t e ------------- | 1206 // ----------- S t a t e ------------- |
1207 // -- r3 : argument count (not including receiver) | 1207 // -- r3 : argument count (not including receiver) |
1208 // -- r6 : new target | 1208 // -- r6 : new target |
1209 // -- r4 : constructor to call | 1209 // -- r4 : constructor to call |
1210 // -- r5 : allocation site feedback if available, undefined otherwise. | 1210 // -- r5 : allocation site feedback if available, undefined otherwise. |
1211 // -- r7 : address of the first argument | 1211 // -- r7 : address of the first argument |
1212 // ----------------------------------- | 1212 // ----------------------------------- |
1213 Label stack_overflow; | 1213 Label stack_overflow; |
1214 | 1214 |
1215 // Push a slot for the receiver to be constructed. | 1215 // Push a slot for the receiver to be constructed. |
1216 __ li(r0, Operand::Zero()); | 1216 __ li(r0, Operand::Zero()); |
1217 __ push(r0); | 1217 __ push(r0); |
1218 | 1218 |
1219 // Push the arguments (skip if none). | 1219 // Push the arguments (skip if none). |
1220 Label skip; | 1220 Label skip; |
1221 __ cmpi(r3, Operand::Zero()); | 1221 __ cmpi(r3, Operand::Zero()); |
1222 __ beq(&skip); | 1222 __ beq(&skip); |
1223 // Push the arguments. r8, r7, r9 will be modified. | 1223 // Push the arguments. r8, r7, r9 will be modified. |
1224 Generate_InterpreterPushArgs(masm, r3, r7, r3, r8, &stack_overflow); | 1224 Generate_InterpreterPushArgs(masm, r3, r7, r3, r8, &stack_overflow); |
1225 __ bind(&skip); | 1225 __ bind(&skip); |
1226 | 1226 |
1227 __ AssertUndefinedOrAllocationSite(r5, r8); | 1227 __ AssertUndefinedOrAllocationSite(r5, r8); |
1228 if (construct_type == CallableType::kJSFunction) { | 1228 if (mode == PushArgsConstructMode::kJSFunction) { |
1229 __ AssertFunction(r4); | 1229 __ AssertFunction(r4); |
1230 | 1230 |
1231 // Tail call to the function-specific construct stub (still in the caller | 1231 // Tail call to the function-specific construct stub (still in the caller |
1232 // context at this point). | 1232 // context at this point). |
1233 __ LoadP(r7, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); | 1233 __ LoadP(r7, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
1234 __ LoadP(r7, FieldMemOperand(r7, SharedFunctionInfo::kConstructStubOffset)); | 1234 __ LoadP(r7, FieldMemOperand(r7, SharedFunctionInfo::kConstructStubOffset)); |
1235 // Jump to the construct function. | 1235 // Jump to the construct function. |
1236 __ addi(ip, r7, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1236 __ addi(ip, r7, Operand(Code::kHeaderSize - kHeapObjectTag)); |
1237 __ Jump(ip); | 1237 __ Jump(ip); |
1238 | 1238 } else if (mode == PushArgsConstructMode::kWithFinalSpread) { |
| 1239 // Call the constructor with r3, r4, and r6 unmodified. |
| 1240 __ Jump(masm->isolate()->builtins()->ConstructWithSpread(), |
| 1241 RelocInfo::CODE_TARGET); |
1239 } else { | 1242 } else { |
1240 DCHECK_EQ(construct_type, CallableType::kAny); | 1243 DCHECK_EQ(PushArgsConstructMode::kOther, mode); |
1241 // Call the constructor with r3, r4, and r6 unmodified. | 1244 // Call the constructor with r3, r4, and r6 unmodified. |
1242 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 1245 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
1243 } | 1246 } |
1244 | 1247 |
1245 __ bind(&stack_overflow); | 1248 __ bind(&stack_overflow); |
1246 { | 1249 { |
1247 __ TailCallRuntime(Runtime::kThrowStackOverflow); | 1250 __ TailCallRuntime(Runtime::kThrowStackOverflow); |
1248 // Unreachable Code. | 1251 // Unreachable Code. |
1249 __ bkpt(0); | 1252 __ bkpt(0); |
1250 } | 1253 } |
(...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2972 __ CallRuntime(Runtime::kThrowStackOverflow); | 2975 __ CallRuntime(Runtime::kThrowStackOverflow); |
2973 __ bkpt(0); | 2976 __ bkpt(0); |
2974 } | 2977 } |
2975 } | 2978 } |
2976 | 2979 |
2977 #undef __ | 2980 #undef __ |
2978 } // namespace internal | 2981 } // namespace internal |
2979 } // namespace v8 | 2982 } // namespace v8 |
2980 | 2983 |
2981 #endif // V8_TARGET_ARCH_PPC | 2984 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |