OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1949 // | f()'s arg 1 | 1949 // | f()'s arg 1 |
1950 // | f()'s receiver arg <- sp (f()'s caller pc is not on the stack yet!) | 1950 // | f()'s receiver arg <- sp (f()'s caller pc is not on the stack yet!) |
1951 // ---------------------- | 1951 // ---------------------- |
1952 // | 1952 // |
1953 void PrepareForTailCall(MacroAssembler* masm, Register args_reg, | 1953 void PrepareForTailCall(MacroAssembler* masm, Register args_reg, |
1954 Register scratch1, Register scratch2, | 1954 Register scratch1, Register scratch2, |
1955 Register scratch3) { | 1955 Register scratch3) { |
1956 DCHECK(!AreAliased(args_reg, scratch1, scratch2, scratch3)); | 1956 DCHECK(!AreAliased(args_reg, scratch1, scratch2, scratch3)); |
1957 Comment cmnt(masm, "[ PrepareForTailCall"); | 1957 Comment cmnt(masm, "[ PrepareForTailCall"); |
1958 | 1958 |
1959 // Prepare for tail call only if the debugger is not active. | |
1960 Label done; | |
1961 ExternalReference debug_is_active = | |
1962 ExternalReference::debug_is_active_address(masm->isolate()); | |
1963 __ li(at, Operand(debug_is_active)); | |
1964 __ lb(scratch1, MemOperand(at)); | |
1965 __ Branch(&done, ne, scratch1, Operand(zero_reg)); | |
1966 | |
1967 // Drop possible interpreter handler/stub frame. | 1959 // Drop possible interpreter handler/stub frame. |
1968 { | 1960 { |
1969 Label no_interpreter_frame; | 1961 Label no_interpreter_frame; |
1970 __ ld(scratch3, | 1962 __ ld(scratch3, |
1971 MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset)); | 1963 MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset)); |
1972 __ Branch(&no_interpreter_frame, ne, scratch3, | 1964 __ Branch(&no_interpreter_frame, ne, scratch3, |
1973 Operand(Smi::FromInt(StackFrame::STUB))); | 1965 Operand(Smi::FromInt(StackFrame::STUB))); |
1974 __ ld(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 1966 __ ld(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
1975 __ bind(&no_interpreter_frame); | 1967 __ bind(&no_interpreter_frame); |
1976 } | 1968 } |
(...skipping 22 matching lines...) Expand all Loading... |
1999 FieldMemOperand(scratch1, JSFunction::kSharedFunctionInfoOffset)); | 1991 FieldMemOperand(scratch1, JSFunction::kSharedFunctionInfoOffset)); |
2000 __ lw(caller_args_count_reg, | 1992 __ lw(caller_args_count_reg, |
2001 FieldMemOperand(scratch1, | 1993 FieldMemOperand(scratch1, |
2002 SharedFunctionInfo::kFormalParameterCountOffset)); | 1994 SharedFunctionInfo::kFormalParameterCountOffset)); |
2003 | 1995 |
2004 __ bind(&formal_parameter_count_loaded); | 1996 __ bind(&formal_parameter_count_loaded); |
2005 | 1997 |
2006 ParameterCount callee_args_count(args_reg); | 1998 ParameterCount callee_args_count(args_reg); |
2007 __ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2, | 1999 __ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2, |
2008 scratch3); | 2000 scratch3); |
2009 __ bind(&done); | |
2010 } | 2001 } |
2011 } // namespace | 2002 } // namespace |
2012 | 2003 |
2013 // static | 2004 // static |
2014 void Builtins::Generate_CallFunction(MacroAssembler* masm, | 2005 void Builtins::Generate_CallFunction(MacroAssembler* masm, |
2015 ConvertReceiverMode mode, | 2006 ConvertReceiverMode mode, |
2016 TailCallMode tail_call_mode) { | 2007 TailCallMode tail_call_mode) { |
2017 // ----------- S t a t e ------------- | 2008 // ----------- S t a t e ------------- |
2018 // -- a0 : the number of arguments (not including the receiver) | 2009 // -- a0 : the number of arguments (not including the receiver) |
2019 // -- a1 : the function to call (checked to be a JSFunction) | 2010 // -- a1 : the function to call (checked to be a JSFunction) |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2594 } | 2585 } |
2595 } | 2586 } |
2596 | 2587 |
2597 | 2588 |
2598 #undef __ | 2589 #undef __ |
2599 | 2590 |
2600 } // namespace internal | 2591 } // namespace internal |
2601 } // namespace v8 | 2592 } // namespace v8 |
2602 | 2593 |
2603 #endif // V8_TARGET_ARCH_MIPS64 | 2594 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |