| 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 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 __ bind(&switch_to_different_code_kind); | 1139 __ bind(&switch_to_different_code_kind); |
| 1140 __ LeaveFrame(StackFrame::JAVA_SCRIPT); | 1140 __ LeaveFrame(StackFrame::JAVA_SCRIPT); |
| 1141 __ ldr(r4, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); | 1141 __ ldr(r4, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
| 1142 __ ldr(r4, FieldMemOperand(r4, SharedFunctionInfo::kCodeOffset)); | 1142 __ ldr(r4, FieldMemOperand(r4, SharedFunctionInfo::kCodeOffset)); |
| 1143 __ add(r4, r4, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1143 __ add(r4, r4, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 1144 __ str(r4, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); | 1144 __ str(r4, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); |
| 1145 __ RecordWriteCodeEntryField(r1, r4, r5); | 1145 __ RecordWriteCodeEntryField(r1, r4, r5); |
| 1146 __ Jump(r4); | 1146 __ Jump(r4); |
| 1147 } | 1147 } |
| 1148 | 1148 |
| 1149 void Builtins::Generate_InterpreterMarkBaselineOnReturn(MacroAssembler* masm) { | |
| 1150 // Save the function and context for call to CompileBaseline. | |
| 1151 __ ldr(r1, MemOperand(fp, StandardFrameConstants::kFunctionOffset)); | |
| 1152 __ ldr(kContextRegister, | |
| 1153 MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
| 1154 | |
| 1155 // Leave the frame before recompiling for baseline so that we don't count as | |
| 1156 // an activation on the stack. | |
| 1157 LeaveInterpreterFrame(masm, r2); | |
| 1158 | |
| 1159 { | |
| 1160 FrameScope frame_scope(masm, StackFrame::INTERNAL); | |
| 1161 // Push return value. | |
| 1162 __ push(r0); | |
| 1163 | |
| 1164 // Push function as argument and compile for baseline. | |
| 1165 __ push(r1); | |
| 1166 __ CallRuntime(Runtime::kCompileBaseline); | |
| 1167 | |
| 1168 // Restore return value. | |
| 1169 __ pop(r0); | |
| 1170 } | |
| 1171 __ Jump(lr); | |
| 1172 } | |
| 1173 | |
| 1174 static void Generate_StackOverflowCheck(MacroAssembler* masm, Register num_args, | 1149 static void Generate_StackOverflowCheck(MacroAssembler* masm, Register num_args, |
| 1175 Register scratch, | 1150 Register scratch, |
| 1176 Label* stack_overflow) { | 1151 Label* stack_overflow) { |
| 1177 // Check the stack for overflow. We are not trying to catch | 1152 // Check the stack for overflow. We are not trying to catch |
| 1178 // interruptions (e.g. debug break and preemption) here, so the "real stack | 1153 // interruptions (e.g. debug break and preemption) here, so the "real stack |
| 1179 // limit" is checked. | 1154 // limit" is checked. |
| 1180 __ LoadRoot(scratch, Heap::kRealStackLimitRootIndex); | 1155 __ LoadRoot(scratch, Heap::kRealStackLimitRootIndex); |
| 1181 // Make scratch the space we have left. The stack might already be overflowed | 1156 // Make scratch the space we have left. The stack might already be overflowed |
| 1182 // here which will cause scratch to become negative. | 1157 // here which will cause scratch to become negative. |
| 1183 __ sub(scratch, sp, scratch); | 1158 __ sub(scratch, sp, scratch); |
| (...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2912 __ bkpt(0); | 2887 __ bkpt(0); |
| 2913 } | 2888 } |
| 2914 } | 2889 } |
| 2915 | 2890 |
| 2916 #undef __ | 2891 #undef __ |
| 2917 | 2892 |
| 2918 } // namespace internal | 2893 } // namespace internal |
| 2919 } // namespace v8 | 2894 } // namespace v8 |
| 2920 | 2895 |
| 2921 #endif // V8_TARGET_ARCH_ARM | 2896 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |