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