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 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1920 // | f()'s arg 1 | 1920 // | f()'s arg 1 |
1921 // | f()'s receiver arg <- sp (f()'s caller pc is not on the stack yet!) | 1921 // | f()'s receiver arg <- sp (f()'s caller pc is not on the stack yet!) |
1922 // ---------------------- | 1922 // ---------------------- |
1923 // | 1923 // |
1924 void PrepareForTailCall(MacroAssembler* masm, Register args_reg, | 1924 void PrepareForTailCall(MacroAssembler* masm, Register args_reg, |
1925 Register scratch1, Register scratch2, | 1925 Register scratch1, Register scratch2, |
1926 Register scratch3) { | 1926 Register scratch3) { |
1927 DCHECK(!AreAliased(args_reg, scratch1, scratch2, scratch3)); | 1927 DCHECK(!AreAliased(args_reg, scratch1, scratch2, scratch3)); |
1928 Comment cmnt(masm, "[ PrepareForTailCall"); | 1928 Comment cmnt(masm, "[ PrepareForTailCall"); |
1929 | 1929 |
1930 // Prepare for tail call only if the debugger is not active. | |
1931 Label done; | |
1932 ExternalReference debug_is_active = | |
1933 ExternalReference::debug_is_active_address(masm->isolate()); | |
1934 __ mov(scratch1, Operand(debug_is_active)); | |
1935 __ LoadlB(scratch1, MemOperand(scratch1)); | |
1936 __ CmpP(scratch1, Operand::Zero()); | |
1937 __ bne(&done); | |
1938 | |
1939 // Drop possible interpreter handler/stub frame. | 1930 // Drop possible interpreter handler/stub frame. |
1940 { | 1931 { |
1941 Label no_interpreter_frame; | 1932 Label no_interpreter_frame; |
1942 __ LoadP(scratch3, | 1933 __ LoadP(scratch3, |
1943 MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset)); | 1934 MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset)); |
1944 __ CmpSmiLiteral(scratch3, Smi::FromInt(StackFrame::STUB), r0); | 1935 __ CmpSmiLiteral(scratch3, Smi::FromInt(StackFrame::STUB), r0); |
1945 __ bne(&no_interpreter_frame); | 1936 __ bne(&no_interpreter_frame); |
1946 __ LoadP(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 1937 __ LoadP(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
1947 __ bind(&no_interpreter_frame); | 1938 __ bind(&no_interpreter_frame); |
1948 } | 1939 } |
(...skipping 26 matching lines...) Expand all Loading... |
1975 SharedFunctionInfo::kFormalParameterCountOffset)); | 1966 SharedFunctionInfo::kFormalParameterCountOffset)); |
1976 #if !V8_TARGET_ARCH_S390X | 1967 #if !V8_TARGET_ARCH_S390X |
1977 __ SmiUntag(caller_args_count_reg); | 1968 __ SmiUntag(caller_args_count_reg); |
1978 #endif | 1969 #endif |
1979 | 1970 |
1980 __ bind(&formal_parameter_count_loaded); | 1971 __ bind(&formal_parameter_count_loaded); |
1981 | 1972 |
1982 ParameterCount callee_args_count(args_reg); | 1973 ParameterCount callee_args_count(args_reg); |
1983 __ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2, | 1974 __ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2, |
1984 scratch3); | 1975 scratch3); |
1985 __ bind(&done); | |
1986 } | 1976 } |
1987 } // namespace | 1977 } // namespace |
1988 | 1978 |
1989 // static | 1979 // static |
1990 void Builtins::Generate_CallFunction(MacroAssembler* masm, | 1980 void Builtins::Generate_CallFunction(MacroAssembler* masm, |
1991 ConvertReceiverMode mode, | 1981 ConvertReceiverMode mode, |
1992 TailCallMode tail_call_mode) { | 1982 TailCallMode tail_call_mode) { |
1993 // ----------- S t a t e ------------- | 1983 // ----------- S t a t e ------------- |
1994 // -- r2 : the number of arguments (not including the receiver) | 1984 // -- r2 : the number of arguments (not including the receiver) |
1995 // -- r3 : the function to call (checked to be a JSFunction) | 1985 // -- r3 : the function to call (checked to be a JSFunction) |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2523 __ bkpt(0); | 2513 __ bkpt(0); |
2524 } | 2514 } |
2525 } | 2515 } |
2526 | 2516 |
2527 #undef __ | 2517 #undef __ |
2528 | 2518 |
2529 } // namespace internal | 2519 } // namespace internal |
2530 } // namespace v8 | 2520 } // namespace v8 |
2531 | 2521 |
2532 #endif // V8_TARGET_ARCH_S390 | 2522 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |