| 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 2470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2481 // UNTAGGED case: | 2481 // UNTAGGED case: |
| 2482 // Input:: | 2482 // Input:: |
| 2483 // esp[0]: return address. | 2483 // esp[0]: return address. |
| 2484 // xmm1: untagged double input argument | 2484 // xmm1: untagged double input argument |
| 2485 // Output: | 2485 // Output: |
| 2486 // xmm1: untagged double result. | 2486 // xmm1: untagged double result. |
| 2487 | 2487 |
| 2488 Label runtime_call; | 2488 Label runtime_call; |
| 2489 Label runtime_call_clear_stack; | 2489 Label runtime_call_clear_stack; |
| 2490 Label skip_cache; | 2490 Label skip_cache; |
| 2491 Label call_runtime; | |
| 2492 const bool tagged = (argument_type_ == TAGGED); | 2491 const bool tagged = (argument_type_ == TAGGED); |
| 2493 if (tagged) { | 2492 if (tagged) { |
| 2494 // Test that eax is a number. | 2493 // Test that eax is a number. |
| 2495 NearLabel input_not_smi; | 2494 NearLabel input_not_smi; |
| 2496 NearLabel loaded; | 2495 NearLabel loaded; |
| 2497 __ mov(eax, Operand(esp, kPointerSize)); | 2496 __ mov(eax, Operand(esp, kPointerSize)); |
| 2498 __ test(eax, Immediate(kSmiTagMask)); | 2497 __ test(eax, Immediate(kSmiTagMask)); |
| 2499 __ j(not_zero, &input_not_smi); | 2498 __ j(not_zero, &input_not_smi); |
| 2500 // Input is a smi. Untag and load it onto the FPU stack. | 2499 // Input is a smi. Untag and load it onto the FPU stack. |
| 2501 // Then load the low and high words of the double into ebx, edx. | 2500 // Then load the low and high words of the double into ebx, edx. |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2628 __ Ret(); | 2627 __ Ret(); |
| 2629 } | 2628 } |
| 2630 | 2629 |
| 2631 // Call runtime, doing whatever allocation and cleanup is necessary. | 2630 // Call runtime, doing whatever allocation and cleanup is necessary. |
| 2632 if (tagged) { | 2631 if (tagged) { |
| 2633 __ bind(&runtime_call_clear_stack); | 2632 __ bind(&runtime_call_clear_stack); |
| 2634 __ fstp(0); | 2633 __ fstp(0); |
| 2635 __ bind(&runtime_call); | 2634 __ bind(&runtime_call); |
| 2636 __ TailCallExternalReference(ExternalReference(RuntimeFunction()), 1, 1); | 2635 __ TailCallExternalReference(ExternalReference(RuntimeFunction()), 1, 1); |
| 2637 } else { // UNTAGGED. | 2636 } else { // UNTAGGED. |
| 2638 __ bind(&call_runtime); | 2637 __ bind(&runtime_call_clear_stack); |
| 2638 __ bind(&runtime_call); |
| 2639 __ AllocateHeapNumber(eax, edi, no_reg, &skip_cache); | 2639 __ AllocateHeapNumber(eax, edi, no_reg, &skip_cache); |
| 2640 __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm1); | 2640 __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm1); |
| 2641 __ EnterInternalFrame(); | 2641 __ EnterInternalFrame(); |
| 2642 __ push(eax); | 2642 __ push(eax); |
| 2643 __ CallRuntime(RuntimeFunction(), 1); | 2643 __ CallRuntime(RuntimeFunction(), 1); |
| 2644 __ LeaveInternalFrame(); | 2644 __ LeaveInternalFrame(); |
| 2645 __ movdbl(xmm1, FieldOperand(eax, HeapNumber::kValueOffset)); | 2645 __ movdbl(xmm1, FieldOperand(eax, HeapNumber::kValueOffset)); |
| 2646 __ Ret(); | 2646 __ Ret(); |
| 2647 } | 2647 } |
| 2648 } | 2648 } |
| (...skipping 3749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6398 // Do a tail call to the rewritten stub. | 6398 // Do a tail call to the rewritten stub. |
| 6399 __ jmp(Operand(edi)); | 6399 __ jmp(Operand(edi)); |
| 6400 } | 6400 } |
| 6401 | 6401 |
| 6402 | 6402 |
| 6403 #undef __ | 6403 #undef __ |
| 6404 | 6404 |
| 6405 } } // namespace v8::internal | 6405 } } // namespace v8::internal |
| 6406 | 6406 |
| 6407 #endif // V8_TARGET_ARCH_IA32 | 6407 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |