OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 6734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6745 case Token::SHL: | 6745 case Token::SHL: |
6746 case Token::SHR: { | 6746 case Token::SHR: { |
6747 FloatingPointHelper::CheckFloatOperands(masm, &call_runtime, ebx); | 6747 FloatingPointHelper::CheckFloatOperands(masm, &call_runtime, ebx); |
6748 FloatingPointHelper::LoadFloatOperands(masm, ecx); | 6748 FloatingPointHelper::LoadFloatOperands(masm, ecx); |
6749 | 6749 |
6750 Label skip_allocation, non_smi_result, operand_conversion_failure; | 6750 Label skip_allocation, non_smi_result, operand_conversion_failure; |
6751 | 6751 |
6752 // Reserve space for converted numbers. | 6752 // Reserve space for converted numbers. |
6753 __ sub(Operand(esp), Immediate(2 * kPointerSize)); | 6753 __ sub(Operand(esp), Immediate(2 * kPointerSize)); |
6754 | 6754 |
6755 bool use_sse3 = CpuFeatures::IsSupported(CpuFeatures::SSE3); | 6755 if (use_sse3_) { |
6756 if (use_sse3) { | |
6757 // Truncate the operands to 32-bit integers and check for | 6756 // Truncate the operands to 32-bit integers and check for |
6758 // exceptions in doing so. | 6757 // exceptions in doing so. |
6759 CpuFeatures::Scope scope(CpuFeatures::SSE3); | 6758 CpuFeatures::Scope scope(CpuFeatures::SSE3); |
6760 __ fisttp_s(Operand(esp, 0 * kPointerSize)); | 6759 __ fisttp_s(Operand(esp, 0 * kPointerSize)); |
6761 __ fisttp_s(Operand(esp, 1 * kPointerSize)); | 6760 __ fisttp_s(Operand(esp, 1 * kPointerSize)); |
6762 __ fnstsw_ax(); | 6761 __ fnstsw_ax(); |
6763 __ test(eax, Immediate(1)); | 6762 __ test(eax, Immediate(1)); |
6764 __ j(not_zero, &operand_conversion_failure); | 6763 __ j(not_zero, &operand_conversion_failure); |
6765 } else { | 6764 } else { |
6766 // Check if right operand is int32. | 6765 // Check if right operand is int32. |
6767 __ fist_s(Operand(esp, 0 * kPointerSize)); | 6766 __ fist_s(Operand(esp, 0 * kPointerSize)); |
6768 __ fild_s(Operand(esp, 0 * kPointerSize)); | 6767 __ fild_s(Operand(esp, 0 * kPointerSize)); |
6769 __ fucompp(); | 6768 __ fucompp(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6834 __ mov(Operand(esp, 1 * kPointerSize), ebx); | 6833 __ mov(Operand(esp, 1 * kPointerSize), ebx); |
6835 __ fild_s(Operand(esp, 1 * kPointerSize)); | 6834 __ fild_s(Operand(esp, 1 * kPointerSize)); |
6836 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); | 6835 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); |
6837 __ ret(2 * kPointerSize); | 6836 __ ret(2 * kPointerSize); |
6838 } | 6837 } |
6839 | 6838 |
6840 // Clear the FPU exception flag and reset the stack before calling | 6839 // Clear the FPU exception flag and reset the stack before calling |
6841 // the runtime system. | 6840 // the runtime system. |
6842 __ bind(&operand_conversion_failure); | 6841 __ bind(&operand_conversion_failure); |
6843 __ add(Operand(esp), Immediate(2 * kPointerSize)); | 6842 __ add(Operand(esp), Immediate(2 * kPointerSize)); |
6844 if (use_sse3) { | 6843 if (use_sse3_) { |
6845 // If we've used the SSE3 instructions for truncating the | 6844 // If we've used the SSE3 instructions for truncating the |
6846 // floating point values to integers and it failed, we have a | 6845 // floating point values to integers and it failed, we have a |
6847 // pending #IA exception. Clear it. | 6846 // pending #IA exception. Clear it. |
6848 __ fnclex(); | 6847 __ fnclex(); |
6849 } else { | 6848 } else { |
6850 // The non-SSE3 variant does early bailout if the right | 6849 // The non-SSE3 variant does early bailout if the right |
6851 // operand isn't a 32-bit integer, so we may have a single | 6850 // operand isn't a 32-bit integer, so we may have a single |
6852 // value on the FPU stack we need to get rid of. | 6851 // value on the FPU stack we need to get rid of. |
6853 __ ffree(0); | 6852 __ ffree(0); |
6854 } | 6853 } |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7868 | 7867 |
7869 int CompareStub::MinorKey() { | 7868 int CompareStub::MinorKey() { |
7870 // Encode the two parameters in a unique 16 bit value. | 7869 // Encode the two parameters in a unique 16 bit value. |
7871 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); | 7870 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); |
7872 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); | 7871 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); |
7873 } | 7872 } |
7874 | 7873 |
7875 #undef __ | 7874 #undef __ |
7876 | 7875 |
7877 } } // namespace v8::internal | 7876 } } // namespace v8::internal |
OLD | NEW |