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_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 2143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2154 // 4c. The new.target is not a constructor, throw an appropriate TypeError. | 2154 // 4c. The new.target is not a constructor, throw an appropriate TypeError. |
2155 __ bind(&new_target_not_constructor); | 2155 __ bind(&new_target_not_constructor); |
2156 { | 2156 { |
2157 __ StoreP(r5, MemOperand(sp, 0)); | 2157 __ StoreP(r5, MemOperand(sp, 0)); |
2158 __ TailCallRuntime(Runtime::kThrowNotConstructor); | 2158 __ TailCallRuntime(Runtime::kThrowNotConstructor); |
2159 } | 2159 } |
2160 } | 2160 } |
2161 | 2161 |
2162 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { | 2162 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { |
2163 __ SmiTag(r2); | 2163 __ SmiTag(r2); |
2164 __ LoadSmiLiteral(r6, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); | 2164 __ Load(r6, Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR))); |
2165 // Stack updated as such: | 2165 // Stack updated as such: |
2166 // old SP ---> | 2166 // old SP ---> |
2167 // R14 Return Addr | 2167 // R14 Return Addr |
2168 // Old FP <--- New FP | 2168 // Old FP <--- New FP |
2169 // Argument Adapter SMI | 2169 // Argument Adapter SMI |
2170 // Function | 2170 // Function |
2171 // ArgC as SMI <--- New SP | 2171 // ArgC as SMI <--- New SP |
2172 __ lay(sp, MemOperand(sp, -5 * kPointerSize)); | 2172 __ lay(sp, MemOperand(sp, -5 * kPointerSize)); |
2173 | 2173 |
2174 // Cleanse the top nibble of 31-bit pointers. | 2174 // Cleanse the top nibble of 31-bit pointers. |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2352 // -- r3 : the target to call (can be any Object) | 2352 // -- r3 : the target to call (can be any Object) |
2353 // -- r4 : start index (to support rest parameters) | 2353 // -- r4 : start index (to support rest parameters) |
2354 // -- lr : return address. | 2354 // -- lr : return address. |
2355 // -- sp[0] : thisArgument | 2355 // -- sp[0] : thisArgument |
2356 // ----------------------------------- | 2356 // ----------------------------------- |
2357 | 2357 |
2358 // Check if we have an arguments adaptor frame below the function frame. | 2358 // Check if we have an arguments adaptor frame below the function frame. |
2359 Label arguments_adaptor, arguments_done; | 2359 Label arguments_adaptor, arguments_done; |
2360 __ LoadP(r5, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2360 __ LoadP(r5, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
2361 __ LoadP(ip, MemOperand(r5, CommonFrameConstants::kContextOrFrameTypeOffset)); | 2361 __ LoadP(ip, MemOperand(r5, CommonFrameConstants::kContextOrFrameTypeOffset)); |
2362 __ CmpSmiLiteral(ip, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); | 2362 __ CmpP(ip, Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR))); |
2363 __ beq(&arguments_adaptor); | 2363 __ beq(&arguments_adaptor); |
2364 { | 2364 { |
2365 __ LoadP(r2, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 2365 __ LoadP(r2, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
2366 __ LoadP(r2, FieldMemOperand(r2, JSFunction::kSharedFunctionInfoOffset)); | 2366 __ LoadP(r2, FieldMemOperand(r2, JSFunction::kSharedFunctionInfoOffset)); |
2367 __ LoadW(r2, FieldMemOperand( | 2367 __ LoadW(r2, FieldMemOperand( |
2368 r2, SharedFunctionInfo::kFormalParameterCountOffset)); | 2368 r2, SharedFunctionInfo::kFormalParameterCountOffset)); |
2369 __ LoadRR(r5, fp); | 2369 __ LoadRR(r5, fp); |
2370 } | 2370 } |
2371 __ b(&arguments_done); | 2371 __ b(&arguments_done); |
2372 __ bind(&arguments_adaptor); | 2372 __ bind(&arguments_adaptor); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2457 __ mov(scratch1, Operand(is_tail_call_elimination_enabled)); | 2457 __ mov(scratch1, Operand(is_tail_call_elimination_enabled)); |
2458 __ LoadlB(scratch1, MemOperand(scratch1)); | 2458 __ LoadlB(scratch1, MemOperand(scratch1)); |
2459 __ CmpP(scratch1, Operand::Zero()); | 2459 __ CmpP(scratch1, Operand::Zero()); |
2460 __ beq(&done); | 2460 __ beq(&done); |
2461 | 2461 |
2462 // Drop possible interpreter handler/stub frame. | 2462 // Drop possible interpreter handler/stub frame. |
2463 { | 2463 { |
2464 Label no_interpreter_frame; | 2464 Label no_interpreter_frame; |
2465 __ LoadP(scratch3, | 2465 __ LoadP(scratch3, |
2466 MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset)); | 2466 MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset)); |
2467 __ CmpSmiLiteral(scratch3, Smi::FromInt(StackFrame::STUB), r0); | 2467 __ CmpP(scratch3, Operand(StackFrame::TypeToMarker(StackFrame::STUB))); |
2468 __ bne(&no_interpreter_frame); | 2468 __ bne(&no_interpreter_frame); |
2469 __ LoadP(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2469 __ LoadP(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
2470 __ bind(&no_interpreter_frame); | 2470 __ bind(&no_interpreter_frame); |
2471 } | 2471 } |
2472 | 2472 |
2473 // Check if next frame is an arguments adaptor frame. | 2473 // Check if next frame is an arguments adaptor frame. |
2474 Register caller_args_count_reg = scratch1; | 2474 Register caller_args_count_reg = scratch1; |
2475 Label no_arguments_adaptor, formal_parameter_count_loaded; | 2475 Label no_arguments_adaptor, formal_parameter_count_loaded; |
2476 __ LoadP(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2476 __ LoadP(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
2477 __ LoadP( | 2477 __ LoadP( |
2478 scratch3, | 2478 scratch3, |
2479 MemOperand(scratch2, CommonFrameConstants::kContextOrFrameTypeOffset)); | 2479 MemOperand(scratch2, CommonFrameConstants::kContextOrFrameTypeOffset)); |
2480 __ CmpSmiLiteral(scratch3, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); | 2480 __ CmpP(scratch3, |
| 2481 Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR))); |
2481 __ bne(&no_arguments_adaptor); | 2482 __ bne(&no_arguments_adaptor); |
2482 | 2483 |
2483 // Drop current frame and load arguments count from arguments adaptor frame. | 2484 // Drop current frame and load arguments count from arguments adaptor frame. |
2484 __ LoadRR(fp, scratch2); | 2485 __ LoadRR(fp, scratch2); |
2485 __ LoadP(caller_args_count_reg, | 2486 __ LoadP(caller_args_count_reg, |
2486 MemOperand(fp, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 2487 MemOperand(fp, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
2487 __ SmiUntag(caller_args_count_reg); | 2488 __ SmiUntag(caller_args_count_reg); |
2488 __ b(&formal_parameter_count_loaded); | 2489 __ b(&formal_parameter_count_loaded); |
2489 | 2490 |
2490 __ bind(&no_arguments_adaptor); | 2491 __ bind(&no_arguments_adaptor); |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3248 __ bkpt(0); | 3249 __ bkpt(0); |
3249 } | 3250 } |
3250 } | 3251 } |
3251 | 3252 |
3252 #undef __ | 3253 #undef __ |
3253 | 3254 |
3254 } // namespace internal | 3255 } // namespace internal |
3255 } // namespace v8 | 3256 } // namespace v8 |
3256 | 3257 |
3257 #endif // V8_TARGET_ARCH_S390 | 3258 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |