| 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1166 __ bind(&switch_to_different_code_kind); | 1166 __ bind(&switch_to_different_code_kind); |
| 1167 __ LeaveFrame(StackFrame::JAVA_SCRIPT); | 1167 __ LeaveFrame(StackFrame::JAVA_SCRIPT); |
| 1168 __ LoadP(r7, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); | 1168 __ LoadP(r7, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
| 1169 __ LoadP(r7, FieldMemOperand(r7, SharedFunctionInfo::kCodeOffset)); | 1169 __ LoadP(r7, FieldMemOperand(r7, SharedFunctionInfo::kCodeOffset)); |
| 1170 __ addi(r7, r7, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1170 __ addi(r7, r7, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 1171 __ StoreP(r7, FieldMemOperand(r4, JSFunction::kCodeEntryOffset), r0); | 1171 __ StoreP(r7, FieldMemOperand(r4, JSFunction::kCodeEntryOffset), r0); |
| 1172 __ RecordWriteCodeEntryField(r4, r7, r8); | 1172 __ RecordWriteCodeEntryField(r4, r7, r8); |
| 1173 __ JumpToJSEntry(r7); | 1173 __ JumpToJSEntry(r7); |
| 1174 } | 1174 } |
| 1175 | 1175 |
| 1176 void Builtins::Generate_InterpreterMarkBaselineOnReturn(MacroAssembler* masm) { | |
| 1177 // Save the function and context for call to CompileBaseline. | |
| 1178 __ LoadP(r4, MemOperand(fp, StandardFrameConstants::kFunctionOffset)); | |
| 1179 __ LoadP(kContextRegister, | |
| 1180 MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
| 1181 | |
| 1182 // Leave the frame before recompiling for baseline so that we don't count as | |
| 1183 // an activation on the stack. | |
| 1184 LeaveInterpreterFrame(masm, r5); | |
| 1185 | |
| 1186 { | |
| 1187 FrameScope frame_scope(masm, StackFrame::INTERNAL); | |
| 1188 // Push return value. | |
| 1189 __ push(r3); | |
| 1190 | |
| 1191 // Push function as argument and compile for baseline. | |
| 1192 __ push(r4); | |
| 1193 __ CallRuntime(Runtime::kCompileBaseline); | |
| 1194 | |
| 1195 // Restore return value. | |
| 1196 __ pop(r3); | |
| 1197 } | |
| 1198 __ blr(); | |
| 1199 } | |
| 1200 | |
| 1201 static void Generate_StackOverflowCheck(MacroAssembler* masm, Register num_args, | 1176 static void Generate_StackOverflowCheck(MacroAssembler* masm, Register num_args, |
| 1202 Register scratch, | 1177 Register scratch, |
| 1203 Label* stack_overflow) { | 1178 Label* stack_overflow) { |
| 1204 // Check the stack for overflow. We are not trying to catch | 1179 // Check the stack for overflow. We are not trying to catch |
| 1205 // interruptions (e.g. debug break and preemption) here, so the "real stack | 1180 // interruptions (e.g. debug break and preemption) here, so the "real stack |
| 1206 // limit" is checked. | 1181 // limit" is checked. |
| 1207 __ LoadRoot(scratch, Heap::kRealStackLimitRootIndex); | 1182 __ LoadRoot(scratch, Heap::kRealStackLimitRootIndex); |
| 1208 // Make scratch the space we have left. The stack might already be overflowed | 1183 // Make scratch the space we have left. The stack might already be overflowed |
| 1209 // here which will cause scratch to become negative. | 1184 // here which will cause scratch to become negative. |
| 1210 __ sub(scratch, sp, scratch); | 1185 __ sub(scratch, sp, scratch); |
| (...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3001 __ CallRuntime(Runtime::kThrowStackOverflow); | 2976 __ CallRuntime(Runtime::kThrowStackOverflow); |
| 3002 __ bkpt(0); | 2977 __ bkpt(0); |
| 3003 } | 2978 } |
| 3004 } | 2979 } |
| 3005 | 2980 |
| 3006 #undef __ | 2981 #undef __ |
| 3007 } // namespace internal | 2982 } // namespace internal |
| 3008 } // namespace v8 | 2983 } // namespace v8 |
| 3009 | 2984 |
| 3010 #endif // V8_TARGET_ARCH_PPC | 2985 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |