| 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 2141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2152 // 4c. The new.target is not a constructor, throw an appropriate TypeError. | 2152 // 4c. The new.target is not a constructor, throw an appropriate TypeError. |
| 2153 __ bind(&new_target_not_constructor); | 2153 __ bind(&new_target_not_constructor); |
| 2154 { | 2154 { |
| 2155 __ StoreP(r6, MemOperand(sp, 0)); | 2155 __ StoreP(r6, MemOperand(sp, 0)); |
| 2156 __ TailCallRuntime(Runtime::kThrowNotConstructor); | 2156 __ TailCallRuntime(Runtime::kThrowNotConstructor); |
| 2157 } | 2157 } |
| 2158 } | 2158 } |
| 2159 | 2159 |
| 2160 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { | 2160 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { |
| 2161 __ SmiTag(r3); | 2161 __ SmiTag(r3); |
| 2162 __ LoadSmiLiteral(r7, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); | 2162 __ mov(r7, Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR))); |
| 2163 __ mflr(r0); | 2163 __ mflr(r0); |
| 2164 __ push(r0); | 2164 __ push(r0); |
| 2165 if (FLAG_enable_embedded_constant_pool) { | 2165 if (FLAG_enable_embedded_constant_pool) { |
| 2166 __ Push(fp, kConstantPoolRegister, r7, r4, r3); | 2166 __ Push(fp, kConstantPoolRegister, r7, r4, r3); |
| 2167 } else { | 2167 } else { |
| 2168 __ Push(fp, r7, r4, r3); | 2168 __ Push(fp, r7, r4, r3); |
| 2169 } | 2169 } |
| 2170 __ addi(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp + | 2170 __ addi(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp + |
| 2171 kPointerSize)); | 2171 kPointerSize)); |
| 2172 } | 2172 } |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2340 // -- r4 : the target to call (can be any Object) | 2340 // -- r4 : the target to call (can be any Object) |
| 2341 // -- r5 : start index (to support rest parameters) | 2341 // -- r5 : start index (to support rest parameters) |
| 2342 // -- lr : return address. | 2342 // -- lr : return address. |
| 2343 // -- sp[0] : thisArgument | 2343 // -- sp[0] : thisArgument |
| 2344 // ----------------------------------- | 2344 // ----------------------------------- |
| 2345 | 2345 |
| 2346 // Check if we have an arguments adaptor frame below the function frame. | 2346 // Check if we have an arguments adaptor frame below the function frame. |
| 2347 Label arguments_adaptor, arguments_done; | 2347 Label arguments_adaptor, arguments_done; |
| 2348 __ LoadP(r6, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2348 __ LoadP(r6, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 2349 __ LoadP(ip, MemOperand(r6, CommonFrameConstants::kContextOrFrameTypeOffset)); | 2349 __ LoadP(ip, MemOperand(r6, CommonFrameConstants::kContextOrFrameTypeOffset)); |
| 2350 __ CmpSmiLiteral(ip, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); | 2350 __ cmpi(ip, Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR))); |
| 2351 __ beq(&arguments_adaptor); | 2351 __ beq(&arguments_adaptor); |
| 2352 { | 2352 { |
| 2353 __ LoadP(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 2353 __ LoadP(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 2354 __ LoadP(r3, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); | 2354 __ LoadP(r3, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); |
| 2355 __ LoadWordArith( | 2355 __ LoadWordArith( |
| 2356 r3, | 2356 r3, |
| 2357 FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset)); | 2357 FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset)); |
| 2358 __ mr(r6, fp); | 2358 __ mr(r6, fp); |
| 2359 } | 2359 } |
| 2360 __ b(&arguments_done); | 2360 __ b(&arguments_done); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2446 __ mov(scratch1, Operand(is_tail_call_elimination_enabled)); | 2446 __ mov(scratch1, Operand(is_tail_call_elimination_enabled)); |
| 2447 __ lbz(scratch1, MemOperand(scratch1)); | 2447 __ lbz(scratch1, MemOperand(scratch1)); |
| 2448 __ cmpi(scratch1, Operand::Zero()); | 2448 __ cmpi(scratch1, Operand::Zero()); |
| 2449 __ beq(&done); | 2449 __ beq(&done); |
| 2450 | 2450 |
| 2451 // Drop possible interpreter handler/stub frame. | 2451 // Drop possible interpreter handler/stub frame. |
| 2452 { | 2452 { |
| 2453 Label no_interpreter_frame; | 2453 Label no_interpreter_frame; |
| 2454 __ LoadP(scratch3, | 2454 __ LoadP(scratch3, |
| 2455 MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset)); | 2455 MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset)); |
| 2456 __ CmpSmiLiteral(scratch3, Smi::FromInt(StackFrame::STUB), r0); | 2456 __ cmpi(scratch3, Operand(StackFrame::TypeToMarker(StackFrame::STUB))); |
| 2457 __ bne(&no_interpreter_frame); | 2457 __ bne(&no_interpreter_frame); |
| 2458 __ LoadP(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2458 __ LoadP(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 2459 __ bind(&no_interpreter_frame); | 2459 __ bind(&no_interpreter_frame); |
| 2460 } | 2460 } |
| 2461 | 2461 |
| 2462 // Check if next frame is an arguments adaptor frame. | 2462 // Check if next frame is an arguments adaptor frame. |
| 2463 Register caller_args_count_reg = scratch1; | 2463 Register caller_args_count_reg = scratch1; |
| 2464 Label no_arguments_adaptor, formal_parameter_count_loaded; | 2464 Label no_arguments_adaptor, formal_parameter_count_loaded; |
| 2465 __ LoadP(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2465 __ LoadP(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 2466 __ LoadP( | 2466 __ LoadP( |
| 2467 scratch3, | 2467 scratch3, |
| 2468 MemOperand(scratch2, CommonFrameConstants::kContextOrFrameTypeOffset)); | 2468 MemOperand(scratch2, CommonFrameConstants::kContextOrFrameTypeOffset)); |
| 2469 __ CmpSmiLiteral(scratch3, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); | 2469 __ cmpi(scratch3, |
| 2470 Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR))); |
| 2470 __ bne(&no_arguments_adaptor); | 2471 __ bne(&no_arguments_adaptor); |
| 2471 | 2472 |
| 2472 // Drop current frame and load arguments count from arguments adaptor frame. | 2473 // Drop current frame and load arguments count from arguments adaptor frame. |
| 2473 __ mr(fp, scratch2); | 2474 __ mr(fp, scratch2); |
| 2474 __ LoadP(caller_args_count_reg, | 2475 __ LoadP(caller_args_count_reg, |
| 2475 MemOperand(fp, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 2476 MemOperand(fp, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 2476 __ SmiUntag(caller_args_count_reg); | 2477 __ SmiUntag(caller_args_count_reg); |
| 2477 __ b(&formal_parameter_count_loaded); | 2478 __ b(&formal_parameter_count_loaded); |
| 2478 | 2479 |
| 2479 __ bind(&no_arguments_adaptor); | 2480 __ bind(&no_arguments_adaptor); |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3236 __ CallRuntime(Runtime::kThrowStackOverflow); | 3237 __ CallRuntime(Runtime::kThrowStackOverflow); |
| 3237 __ bkpt(0); | 3238 __ bkpt(0); |
| 3238 } | 3239 } |
| 3239 } | 3240 } |
| 3240 | 3241 |
| 3241 #undef __ | 3242 #undef __ |
| 3242 } // namespace internal | 3243 } // namespace internal |
| 3243 } // namespace v8 | 3244 } // namespace v8 |
| 3244 | 3245 |
| 3245 #endif // V8_TARGET_ARCH_PPC | 3246 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |