| 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 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2264 __ fmul_i(1); | 2264 __ fmul_i(1); |
| 2265 break; | 2265 break; |
| 2266 case Token::DIV: | 2266 case Token::DIV: |
| 2267 __ fdiv_i(1); | 2267 __ fdiv_i(1); |
| 2268 break; | 2268 break; |
| 2269 case Token::MOD: { | 2269 case Token::MOD: { |
| 2270 // Pass two doubles as arguments on the stack. | 2270 // Pass two doubles as arguments on the stack. |
| 2271 __ PrepareCallCFunction(4, eax); | 2271 __ PrepareCallCFunction(4, eax); |
| 2272 X87Mov(Operand(esp, 1 * kDoubleSize), right); | 2272 X87Mov(Operand(esp, 1 * kDoubleSize), right); |
| 2273 X87Mov(Operand(esp, 0), left); | 2273 X87Mov(Operand(esp, 0), left); |
| 2274 X87Free(right); |
| 2275 ASSERT(left.is(result)); |
| 2274 X87PrepareToWrite(result); | 2276 X87PrepareToWrite(result); |
| 2275 __ CallCFunction( | 2277 __ CallCFunction( |
| 2276 ExternalReference::double_fp_operation(Token::MOD, isolate()), | 2278 ExternalReference::double_fp_operation(Token::MOD, isolate()), |
| 2277 4); | 2279 4); |
| 2278 | 2280 |
| 2279 // Return value is in st(0) on ia32. | 2281 // Return value is in st(0) on ia32. |
| 2280 X87CommitWrite(result); | 2282 X87CommitWrite(result); |
| 2281 break; | 2283 break; |
| 2282 } | 2284 } |
| 2283 default: | 2285 default: |
| (...skipping 2723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5007 Register input = ToRegister(instr->value()); | 5009 Register input = ToRegister(instr->value()); |
| 5008 __ SmiTag(input); | 5010 __ SmiTag(input); |
| 5009 if (!instr->hydrogen()->value()->HasRange() || | 5011 if (!instr->hydrogen()->value()->HasRange() || |
| 5010 !instr->hydrogen()->value()->range()->IsInSmiRange()) { | 5012 !instr->hydrogen()->value()->range()->IsInSmiRange()) { |
| 5011 DeoptimizeIf(overflow, instr->environment()); | 5013 DeoptimizeIf(overflow, instr->environment()); |
| 5012 } | 5014 } |
| 5013 } | 5015 } |
| 5014 | 5016 |
| 5015 | 5017 |
| 5016 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { | 5018 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
| 5017 CpuFeatureScope scope(masm(), SSE2); | |
| 5018 LOperand* input = instr->value(); | 5019 LOperand* input = instr->value(); |
| 5019 LOperand* output = instr->result(); | 5020 LOperand* output = instr->result(); |
| 5020 LOperand* temp = instr->temp(); | 5021 if (CpuFeatures::IsSupported(SSE2)) { |
| 5022 CpuFeatureScope scope(masm(), SSE2); |
| 5023 LOperand* temp = instr->temp(); |
| 5021 | 5024 |
| 5022 __ LoadUint32(ToDoubleRegister(output), | 5025 __ LoadUint32(ToDoubleRegister(output), |
| 5023 ToRegister(input), | 5026 ToRegister(input), |
| 5024 ToDoubleRegister(temp)); | 5027 ToDoubleRegister(temp)); |
| 5028 } else { |
| 5029 X87Register res = ToX87Register(output); |
| 5030 X87PrepareToWrite(res); |
| 5031 __ LoadUint32NoSSE2(ToRegister(input)); |
| 5032 X87CommitWrite(res); |
| 5033 } |
| 5025 } | 5034 } |
| 5026 | 5035 |
| 5027 | 5036 |
| 5028 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { | 5037 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
| 5029 class DeferredNumberTagI V8_FINAL : public LDeferredCode { | 5038 class DeferredNumberTagI V8_FINAL : public LDeferredCode { |
| 5030 public: | 5039 public: |
| 5031 DeferredNumberTagI(LCodeGen* codegen, | 5040 DeferredNumberTagI(LCodeGen* codegen, |
| 5032 LNumberTagI* instr, | 5041 LNumberTagI* instr, |
| 5033 const X87Stack& x87_stack) | 5042 const X87Stack& x87_stack) |
| 5034 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 5043 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
| (...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6380 FixedArray::kHeaderSize - kPointerSize)); | 6389 FixedArray::kHeaderSize - kPointerSize)); |
| 6381 __ bind(&done); | 6390 __ bind(&done); |
| 6382 } | 6391 } |
| 6383 | 6392 |
| 6384 | 6393 |
| 6385 #undef __ | 6394 #undef __ |
| 6386 | 6395 |
| 6387 } } // namespace v8::internal | 6396 } } // namespace v8::internal |
| 6388 | 6397 |
| 6389 #endif // V8_TARGET_ARCH_IA32 | 6398 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |