| 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 5052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5063 | 5063 |
| 5064 Label no_special_nan_handling; | 5064 Label no_special_nan_handling; |
| 5065 Label done; | 5065 Label done; |
| 5066 if (convert_hole) { | 5066 if (convert_hole) { |
| 5067 if (use_sse2) { | 5067 if (use_sse2) { |
| 5068 CpuFeatureScope scope(masm(), SSE2); | 5068 CpuFeatureScope scope(masm(), SSE2); |
| 5069 XMMRegister input_reg = ToDoubleRegister(instr->value()); | 5069 XMMRegister input_reg = ToDoubleRegister(instr->value()); |
| 5070 __ ucomisd(input_reg, input_reg); | 5070 __ ucomisd(input_reg, input_reg); |
| 5071 } else { | 5071 } else { |
| 5072 __ fld(0); | 5072 __ fld(0); |
| 5073 __ fld(0); |
| 5073 __ FCmp(); | 5074 __ FCmp(); |
| 5074 } | 5075 } |
| 5075 | 5076 |
| 5076 __ j(parity_odd, &no_special_nan_handling); | 5077 __ j(parity_odd, &no_special_nan_handling); |
| 5077 __ sub(esp, Immediate(kDoubleSize)); | 5078 __ sub(esp, Immediate(kDoubleSize)); |
| 5078 if (use_sse2) { | 5079 if (use_sse2) { |
| 5079 CpuFeatureScope scope(masm(), SSE2); | 5080 CpuFeatureScope scope(masm(), SSE2); |
| 5080 XMMRegister input_reg = ToDoubleRegister(instr->value()); | 5081 XMMRegister input_reg = ToDoubleRegister(instr->value()); |
| 5081 __ movdbl(MemOperand(esp, 0), input_reg); | 5082 __ movdbl(MemOperand(esp, 0), input_reg); |
| 5082 } else { | 5083 } else { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 5109 | 5110 |
| 5110 __ bind(&no_special_nan_handling); | 5111 __ bind(&no_special_nan_handling); |
| 5111 DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr); | 5112 DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr); |
| 5112 if (FLAG_inline_new) { | 5113 if (FLAG_inline_new) { |
| 5113 Register tmp = ToRegister(instr->temp()); | 5114 Register tmp = ToRegister(instr->temp()); |
| 5114 __ AllocateHeapNumber(reg, tmp, no_reg, deferred->entry()); | 5115 __ AllocateHeapNumber(reg, tmp, no_reg, deferred->entry()); |
| 5115 } else { | 5116 } else { |
| 5116 __ jmp(deferred->entry()); | 5117 __ jmp(deferred->entry()); |
| 5117 } | 5118 } |
| 5118 __ bind(deferred->exit()); | 5119 __ bind(deferred->exit()); |
| 5119 if (CpuFeatures::IsSupported(SSE2)) { | 5120 if (use_sse2) { |
| 5120 CpuFeatureScope scope(masm(), SSE2); | 5121 CpuFeatureScope scope(masm(), SSE2); |
| 5121 XMMRegister input_reg = ToDoubleRegister(instr->value()); | 5122 XMMRegister input_reg = ToDoubleRegister(instr->value()); |
| 5122 __ movdbl(FieldOperand(reg, HeapNumber::kValueOffset), input_reg); | 5123 __ movdbl(FieldOperand(reg, HeapNumber::kValueOffset), input_reg); |
| 5123 } else { | 5124 } else { |
| 5124 __ fst_d(FieldOperand(reg, HeapNumber::kValueOffset)); | 5125 __ fstp_d(FieldOperand(reg, HeapNumber::kValueOffset)); |
| 5125 } | |
| 5126 if (!use_sse2) { | |
| 5127 // clean up the stack | |
| 5128 __ fstp(0); | |
| 5129 } | 5126 } |
| 5130 __ bind(&done); | 5127 __ bind(&done); |
| 5131 } | 5128 } |
| 5132 | 5129 |
| 5133 | 5130 |
| 5134 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { | 5131 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
| 5135 // TODO(3095996): Get rid of this. For now, we need to make the | 5132 // TODO(3095996): Get rid of this. For now, we need to make the |
| 5136 // result register contain a valid pointer because it is already | 5133 // result register contain a valid pointer because it is already |
| 5137 // contained in the register pointer map. | 5134 // contained in the register pointer map. |
| 5138 Register reg = ToRegister(instr->result()); | 5135 Register reg = ToRegister(instr->result()); |
| (...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6574 FixedArray::kHeaderSize - kPointerSize)); | 6571 FixedArray::kHeaderSize - kPointerSize)); |
| 6575 __ bind(&done); | 6572 __ bind(&done); |
| 6576 } | 6573 } |
| 6577 | 6574 |
| 6578 | 6575 |
| 6579 #undef __ | 6576 #undef __ |
| 6580 | 6577 |
| 6581 } } // namespace v8::internal | 6578 } } // namespace v8::internal |
| 6582 | 6579 |
| 6583 #endif // V8_TARGET_ARCH_IA32 | 6580 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |