| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 CpuFeatures::Scope scope(SSE2); | 1207 CpuFeatures::Scope scope(SSE2); |
| 1208 // Fill in the double input registers. | 1208 // Fill in the double input registers. |
| 1209 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { | 1209 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { |
| 1210 int dst_offset = i * kDoubleSize + double_regs_offset; | 1210 int dst_offset = i * kDoubleSize + double_regs_offset; |
| 1211 int src_offset = i * kDoubleSize; | 1211 int src_offset = i * kDoubleSize; |
| 1212 __ movdbl(xmm0, Operand(esp, src_offset)); | 1212 __ movdbl(xmm0, Operand(esp, src_offset)); |
| 1213 __ movdbl(Operand(ebx, dst_offset), xmm0); | 1213 __ movdbl(Operand(ebx, dst_offset), xmm0); |
| 1214 } | 1214 } |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 // Check that the TOP register is zero and clear all exceptions. | 1217 // Clear FPU all exceptions. |
| 1218 const int kTopMask = 0x3800; | 1218 // TODO(ulan): Find out why the TOP register is not zero here in some cases, |
| 1219 __ push(eax); | 1219 // and check that the generated code never deoptimizes with unbalanced stack. |
| 1220 __ fwait(); | |
| 1221 __ fnstsw_ax(); | |
| 1222 __ test(eax, Immediate(kTopMask)); | |
| 1223 __ Check(zero, "FPU TOP is not zero in deoptimizer."); | |
| 1224 __ fnclex(); | 1220 __ fnclex(); |
| 1225 __ pop(eax); | |
| 1226 | 1221 |
| 1227 // Remove the bailout id and the double registers from the stack. | 1222 // Remove the bailout id and the double registers from the stack. |
| 1228 if (type() == EAGER) { | 1223 if (type() == EAGER) { |
| 1229 __ add(esp, Immediate(kDoubleRegsSize + kPointerSize)); | 1224 __ add(esp, Immediate(kDoubleRegsSize + kPointerSize)); |
| 1230 } else { | 1225 } else { |
| 1231 __ add(esp, Immediate(kDoubleRegsSize + 2 * kPointerSize)); | 1226 __ add(esp, Immediate(kDoubleRegsSize + 2 * kPointerSize)); |
| 1232 } | 1227 } |
| 1233 | 1228 |
| 1234 // Compute a pointer to the unwinding limit in register ecx; that is | 1229 // Compute a pointer to the unwinding limit in register ecx; that is |
| 1235 // the first stack slot not part of the input frame. | 1230 // the first stack slot not part of the input frame. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1352 } | 1347 } |
| 1353 __ bind(&done); | 1348 __ bind(&done); |
| 1354 } | 1349 } |
| 1355 | 1350 |
| 1356 #undef __ | 1351 #undef __ |
| 1357 | 1352 |
| 1358 | 1353 |
| 1359 } } // namespace v8::internal | 1354 } } // namespace v8::internal |
| 1360 | 1355 |
| 1361 #endif // V8_TARGET_ARCH_IA32 | 1356 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |