Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2772 __ add(Operand(esp), Immediate(kDoubleSize)); | 2772 __ add(Operand(esp), Immediate(kDoubleSize)); |
| 2773 GenerateOperation(masm); | 2773 GenerateOperation(masm); |
| 2774 __ mov(Operand(ecx, 0), ebx); | 2774 __ mov(Operand(ecx, 0), ebx); |
| 2775 __ mov(Operand(ecx, kIntSize), edx); | 2775 __ mov(Operand(ecx, kIntSize), edx); |
| 2776 __ mov(Operand(ecx, 2 * kIntSize), eax); | 2776 __ mov(Operand(ecx, 2 * kIntSize), eax); |
| 2777 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); | 2777 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); |
| 2778 __ movdbl(xmm1, FieldOperand(eax, HeapNumber::kValueOffset)); | 2778 __ movdbl(xmm1, FieldOperand(eax, HeapNumber::kValueOffset)); |
| 2779 __ Ret(); | 2779 __ Ret(); |
| 2780 | 2780 |
| 2781 __ bind(&skip_cache); | 2781 __ bind(&skip_cache); |
| 2782 // Do not allocate an answer to put it in the cache | |
| 2782 __ sub(Operand(esp), Immediate(kDoubleSize)); | 2783 __ sub(Operand(esp), Immediate(kDoubleSize)); |
| 2783 __ movdbl(Operand(esp, 0), xmm1); | 2784 __ movdbl(Operand(esp, 0), xmm1); |
| 2784 __ fld_d(Operand(esp, 0)); | 2785 __ fld_d(Operand(esp, 0)); |
| 2785 GenerateOperation(masm); | 2786 GenerateOperation(masm); |
| 2786 __ fstp_d(Operand(esp, 0)); | 2787 __ fstp_d(Operand(esp, 0)); |
| 2787 __ movdbl(xmm1, Operand(esp, 0)); | 2788 __ movdbl(xmm1, Operand(esp, 0)); |
| 2788 __ add(Operand(esp), Immediate(kDoubleSize)); | 2789 __ add(Operand(esp), Immediate(kDoubleSize)); |
| 2790 // We return the value in xmm1 without adding it to the cache, but | |
| 2791 // we cause a scavenging GC so that future allocations will succeed. | |
| 2792 __ EnterInternalFrame(); | |
| 2793 __ push(Immediate(Smi::FromInt(kDoubleSize))); // Unused aligned object. | |
| 2794 __ CallRuntimeSaveDoubles(Runtime::kAllocateInNewSpace); | |
|
Kevin Millikin (Chromium)
2010/12/17 13:47:57
There is a Runtime::PerformGC function. It would
| |
| 2795 __ LeaveInternalFrame(); | |
| 2789 __ Ret(); | 2796 __ Ret(); |
| 2790 | 2797 |
| 2791 __ bind(&call_runtime); | 2798 __ bind(&call_runtime); |
| 2792 __ AllocateHeapNumber(eax, edi, no_reg, &skip_cache); | 2799 __ AllocateHeapNumber(eax, edi, no_reg, &skip_cache); |
| 2793 __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm1); | 2800 __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm1); |
| 2794 __ EnterInternalFrame(); | 2801 __ EnterInternalFrame(); |
| 2795 __ push(eax); | 2802 __ push(eax); |
| 2796 __ CallRuntime(RuntimeFunction(), 1); | 2803 __ CallRuntime(RuntimeFunction(), 1); |
| 2797 __ LeaveInternalFrame(); | 2804 __ LeaveInternalFrame(); |
| 2798 __ movdbl(xmm1, FieldOperand(eax, HeapNumber::kValueOffset)); | 2805 __ movdbl(xmm1, FieldOperand(eax, HeapNumber::kValueOffset)); |
| (...skipping 3672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6471 // Do a tail call to the rewritten stub. | 6478 // Do a tail call to the rewritten stub. |
| 6472 __ jmp(Operand(edi)); | 6479 __ jmp(Operand(edi)); |
| 6473 } | 6480 } |
| 6474 | 6481 |
| 6475 | 6482 |
| 6476 #undef __ | 6483 #undef __ |
| 6477 | 6484 |
| 6478 } } // namespace v8::internal | 6485 } } // namespace v8::internal |
| 6479 | 6486 |
| 6480 #endif // V8_TARGET_ARCH_IA32 | 6487 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |