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 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1727 case Token::SUB: __ fsubp(1); break; | 1727 case Token::SUB: __ fsubp(1); break; |
1728 case Token::MUL: __ fmulp(1); break; | 1728 case Token::MUL: __ fmulp(1); break; |
1729 case Token::DIV: __ fdivp(1); break; | 1729 case Token::DIV: __ fdivp(1); break; |
1730 default: UNREACHABLE(); | 1730 default: UNREACHABLE(); |
1731 } | 1731 } |
1732 Label after_alloc_failure; | 1732 Label after_alloc_failure; |
1733 GenerateHeapResultAllocation(masm, &after_alloc_failure); | 1733 GenerateHeapResultAllocation(masm, &after_alloc_failure); |
1734 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); | 1734 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); |
1735 __ ret(0); | 1735 __ ret(0); |
1736 __ bind(&after_alloc_failure); | 1736 __ bind(&after_alloc_failure); |
1737 __ ffree(); | 1737 __ fstp(0); // Pop FPU stack before calling runtime. |
1738 __ jmp(&call_runtime); | 1738 __ jmp(&call_runtime); |
1739 } | 1739 } |
1740 | 1740 |
1741 __ bind(¬_floats); | 1741 __ bind(¬_floats); |
1742 __ bind(¬_int32); | 1742 __ bind(¬_int32); |
1743 GenerateTypeTransition(masm); | 1743 GenerateTypeTransition(masm); |
1744 break; | 1744 break; |
1745 } | 1745 } |
1746 | 1746 |
1747 case Token::MOD: { | 1747 case Token::MOD: { |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1950 case Token::SUB: __ fsubp(1); break; | 1950 case Token::SUB: __ fsubp(1); break; |
1951 case Token::MUL: __ fmulp(1); break; | 1951 case Token::MUL: __ fmulp(1); break; |
1952 case Token::DIV: __ fdivp(1); break; | 1952 case Token::DIV: __ fdivp(1); break; |
1953 default: UNREACHABLE(); | 1953 default: UNREACHABLE(); |
1954 } | 1954 } |
1955 Label after_alloc_failure; | 1955 Label after_alloc_failure; |
1956 GenerateHeapResultAllocation(masm, &after_alloc_failure); | 1956 GenerateHeapResultAllocation(masm, &after_alloc_failure); |
1957 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); | 1957 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); |
1958 __ ret(0); | 1958 __ ret(0); |
1959 __ bind(&after_alloc_failure); | 1959 __ bind(&after_alloc_failure); |
1960 __ ffree(); | 1960 __ fstp(0); // Pop FPU stack before calling runtime. |
1961 __ jmp(&call_runtime); | 1961 __ jmp(&call_runtime); |
1962 } | 1962 } |
1963 | 1963 |
1964 __ bind(¬_floats); | 1964 __ bind(¬_floats); |
1965 GenerateTypeTransition(masm); | 1965 GenerateTypeTransition(masm); |
1966 break; | 1966 break; |
1967 } | 1967 } |
1968 | 1968 |
1969 case Token::MOD: { | 1969 case Token::MOD: { |
1970 // For MOD we go directly to runtime in the non-smi case. | 1970 // For MOD we go directly to runtime in the non-smi case. |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2154 case Token::SUB: __ fsubp(1); break; | 2154 case Token::SUB: __ fsubp(1); break; |
2155 case Token::MUL: __ fmulp(1); break; | 2155 case Token::MUL: __ fmulp(1); break; |
2156 case Token::DIV: __ fdivp(1); break; | 2156 case Token::DIV: __ fdivp(1); break; |
2157 default: UNREACHABLE(); | 2157 default: UNREACHABLE(); |
2158 } | 2158 } |
2159 Label after_alloc_failure; | 2159 Label after_alloc_failure; |
2160 GenerateHeapResultAllocation(masm, &after_alloc_failure); | 2160 GenerateHeapResultAllocation(masm, &after_alloc_failure); |
2161 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); | 2161 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); |
2162 __ ret(0); | 2162 __ ret(0); |
2163 __ bind(&after_alloc_failure); | 2163 __ bind(&after_alloc_failure); |
2164 __ ffree(); | 2164 __ fstp(0); // Pop FPU stack before calling runtime. |
2165 __ jmp(&call_runtime); | 2165 __ jmp(&call_runtime); |
2166 } | 2166 } |
2167 __ bind(¬_floats); | 2167 __ bind(¬_floats); |
2168 break; | 2168 break; |
2169 } | 2169 } |
2170 case Token::MOD: { | 2170 case Token::MOD: { |
2171 // For MOD we go directly to runtime in the non-smi case. | 2171 // For MOD we go directly to runtime in the non-smi case. |
2172 break; | 2172 break; |
2173 } | 2173 } |
2174 case Token::BIT_OR: | 2174 case Token::BIT_OR: |
2175 case Token::BIT_AND: | 2175 case Token::BIT_AND: |
(...skipping 5203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7379 false); | 7379 false); |
7380 __ pop(edx); | 7380 __ pop(edx); |
7381 __ ret(0); | 7381 __ ret(0); |
7382 } | 7382 } |
7383 | 7383 |
7384 #undef __ | 7384 #undef __ |
7385 | 7385 |
7386 } } // namespace v8::internal | 7386 } } // namespace v8::internal |
7387 | 7387 |
7388 #endif // V8_TARGET_ARCH_IA32 | 7388 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |