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_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 194 } |
195 | 195 |
196 | 196 |
197 void LCodeGen::GenerateOsrPrologue() { | 197 void LCodeGen::GenerateOsrPrologue() { |
198 // Generate the OSR entry prologue at the first unknown OSR value, or if there | 198 // Generate the OSR entry prologue at the first unknown OSR value, or if there |
199 // are none, at the OSR entrypoint instruction. | 199 // are none, at the OSR entrypoint instruction. |
200 if (osr_pc_offset_ >= 0) return; | 200 if (osr_pc_offset_ >= 0) return; |
201 | 201 |
202 osr_pc_offset_ = masm()->pc_offset(); | 202 osr_pc_offset_ = masm()->pc_offset(); |
203 | 203 |
| 204 // Interpreter is the first tier compiler now. It will run the code generated |
| 205 // by TurboFan compiler which will always put "1" on x87 FPU stack. |
| 206 // This behavior will affect crankshaft's x87 FPU stack depth check under |
| 207 // debug mode. |
| 208 // Need to reset the FPU stack here for this scenario. |
| 209 __ fninit(); |
| 210 |
204 // Adjust the frame size, subsuming the unoptimized frame into the | 211 // Adjust the frame size, subsuming the unoptimized frame into the |
205 // optimized frame. | 212 // optimized frame. |
206 int slots = GetStackSlotCount() - graph()->osr()->UnoptimizedFrameSlots(); | 213 int slots = GetStackSlotCount() - graph()->osr()->UnoptimizedFrameSlots(); |
207 DCHECK(slots >= 0); | 214 DCHECK(slots >= 0); |
208 __ sub(esp, Immediate(slots * kPointerSize)); | 215 __ sub(esp, Immediate(slots * kPointerSize)); |
209 } | 216 } |
210 | 217 |
211 | 218 |
212 void LCodeGen::GenerateBodyInstructionPre(LInstruction* instr) { | 219 void LCodeGen::GenerateBodyInstructionPre(LInstruction* instr) { |
213 if (instr->IsCall()) { | 220 if (instr->IsCall()) { |
(...skipping 5619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5833 __ bind(deferred->exit()); | 5840 __ bind(deferred->exit()); |
5834 __ bind(&done); | 5841 __ bind(&done); |
5835 } | 5842 } |
5836 | 5843 |
5837 #undef __ | 5844 #undef __ |
5838 | 5845 |
5839 } // namespace internal | 5846 } // namespace internal |
5840 } // namespace v8 | 5847 } // namespace v8 |
5841 | 5848 |
5842 #endif // V8_TARGET_ARCH_X87 | 5849 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |