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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 __ bind(&loop_header); | 1096 __ bind(&loop_header); |
1097 __ ldr(scratch, MemOperand(index, -kPointerSize, PostIndex)); | 1097 __ ldr(scratch, MemOperand(index, -kPointerSize, PostIndex)); |
1098 __ push(scratch); | 1098 __ push(scratch); |
1099 __ bind(&loop_check); | 1099 __ bind(&loop_check); |
1100 __ cmp(index, limit); | 1100 __ cmp(index, limit); |
1101 __ b(gt, &loop_header); | 1101 __ b(gt, &loop_header); |
1102 } | 1102 } |
1103 | 1103 |
1104 | 1104 |
1105 // static | 1105 // static |
1106 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { | 1106 void Builtins::Generate_InterpreterPushArgsAndCallImpl( |
| 1107 MacroAssembler* masm, TailCallMode tail_call_mode) { |
1107 // ----------- S t a t e ------------- | 1108 // ----------- S t a t e ------------- |
1108 // -- r0 : the number of arguments (not including the receiver) | 1109 // -- r0 : the number of arguments (not including the receiver) |
1109 // -- r2 : the address of the first argument to be pushed. Subsequent | 1110 // -- r2 : the address of the first argument to be pushed. Subsequent |
1110 // arguments should be consecutive above this, in the same order as | 1111 // arguments should be consecutive above this, in the same order as |
1111 // they are to be pushed onto the stack. | 1112 // they are to be pushed onto the stack. |
1112 // -- r1 : the target to call (can be any Object). | 1113 // -- r1 : the target to call (can be any Object). |
1113 // ----------------------------------- | 1114 // ----------------------------------- |
1114 | 1115 |
1115 // Find the address of the last argument. | 1116 // Find the address of the last argument. |
1116 __ add(r3, r0, Operand(1)); // Add one for receiver. | 1117 __ add(r3, r0, Operand(1)); // Add one for receiver. |
1117 __ mov(r3, Operand(r3, LSL, kPointerSizeLog2)); | 1118 __ mov(r3, Operand(r3, LSL, kPointerSizeLog2)); |
1118 __ sub(r3, r2, r3); | 1119 __ sub(r3, r2, r3); |
1119 | 1120 |
1120 // Push the arguments. | 1121 // Push the arguments. |
1121 Generate_InterpreterPushArgs(masm, r2, r3, r4); | 1122 Generate_InterpreterPushArgs(masm, r2, r3, r4); |
1122 | 1123 |
1123 // Call the target. | 1124 // Call the target. |
1124 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 1125 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, |
| 1126 tail_call_mode), |
| 1127 RelocInfo::CODE_TARGET); |
1125 } | 1128 } |
1126 | 1129 |
1127 | 1130 |
1128 // static | 1131 // static |
1129 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | 1132 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
1130 // ----------- S t a t e ------------- | 1133 // ----------- S t a t e ------------- |
1131 // -- r0 : argument count (not including receiver) | 1134 // -- r0 : argument count (not including receiver) |
1132 // -- r3 : new target | 1135 // -- r3 : new target |
1133 // -- r1 : constructor to call | 1136 // -- r1 : constructor to call |
1134 // -- r2 : address of the first argument | 1137 // -- r2 : address of the first argument |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 | 2061 |
2059 // Prepare for tail call only if the debugger is not active. | 2062 // Prepare for tail call only if the debugger is not active. |
2060 Label done; | 2063 Label done; |
2061 ExternalReference debug_is_active = | 2064 ExternalReference debug_is_active = |
2062 ExternalReference::debug_is_active_address(masm->isolate()); | 2065 ExternalReference::debug_is_active_address(masm->isolate()); |
2063 __ mov(scratch1, Operand(debug_is_active)); | 2066 __ mov(scratch1, Operand(debug_is_active)); |
2064 __ ldrb(scratch1, MemOperand(scratch1)); | 2067 __ ldrb(scratch1, MemOperand(scratch1)); |
2065 __ cmp(scratch1, Operand(0)); | 2068 __ cmp(scratch1, Operand(0)); |
2066 __ b(ne, &done); | 2069 __ b(ne, &done); |
2067 | 2070 |
| 2071 // Drop possible interpreter handler/stub frame. |
| 2072 { |
| 2073 Label no_interpreter_frame; |
| 2074 __ ldr(scratch3, MemOperand(fp, StandardFrameConstants::kMarkerOffset)); |
| 2075 __ cmp(scratch3, Operand(Smi::FromInt(StackFrame::STUB))); |
| 2076 __ b(ne, &no_interpreter_frame); |
| 2077 __ ldr(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 2078 __ bind(&no_interpreter_frame); |
| 2079 } |
| 2080 |
2068 // Check if next frame is an arguments adaptor frame. | 2081 // Check if next frame is an arguments adaptor frame. |
2069 Label no_arguments_adaptor, formal_parameter_count_loaded; | 2082 Label no_arguments_adaptor, formal_parameter_count_loaded; |
2070 __ ldr(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2083 __ ldr(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
2071 __ ldr(scratch3, | 2084 __ ldr(scratch3, |
2072 MemOperand(scratch2, StandardFrameConstants::kContextOffset)); | 2085 MemOperand(scratch2, StandardFrameConstants::kContextOffset)); |
2073 __ cmp(scratch3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 2086 __ cmp(scratch3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
2074 __ b(ne, &no_arguments_adaptor); | 2087 __ b(ne, &no_arguments_adaptor); |
2075 | 2088 |
2076 // Drop arguments adaptor frame and load arguments count. | 2089 // Drop arguments adaptor frame and load arguments count. |
2077 __ mov(fp, scratch2); | 2090 __ mov(fp, scratch2); |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2678 } | 2691 } |
2679 } | 2692 } |
2680 | 2693 |
2681 | 2694 |
2682 #undef __ | 2695 #undef __ |
2683 | 2696 |
2684 } // namespace internal | 2697 } // namespace internal |
2685 } // namespace v8 | 2698 } // namespace v8 |
2686 | 2699 |
2687 #endif // V8_TARGET_ARCH_ARM | 2700 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |