OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 __ subq(rsp, Immediate(kDoubleSize)); | 1147 __ subq(rsp, Immediate(kDoubleSize)); |
1148 __ cvtlsi2sd(xmm1, rax); | 1148 __ cvtlsi2sd(xmm1, rax); |
1149 __ movsd(Operand(rsp, 0), xmm1); | 1149 __ movsd(Operand(rsp, 0), xmm1); |
1150 __ movq(rbx, xmm1); | 1150 __ movq(rbx, xmm1); |
1151 __ movq(rdx, xmm1); | 1151 __ movq(rdx, xmm1); |
1152 __ fld_d(Operand(rsp, 0)); | 1152 __ fld_d(Operand(rsp, 0)); |
1153 __ addq(rsp, Immediate(kDoubleSize)); | 1153 __ addq(rsp, Immediate(kDoubleSize)); |
1154 __ jmp(&loaded, Label::kNear); | 1154 __ jmp(&loaded, Label::kNear); |
1155 | 1155 |
1156 __ bind(&input_not_smi); | 1156 __ bind(&input_not_smi); |
1157 __ TaggedToI(rbx, rax, xmm1, TREAT_MINUS_ZERO_AS_ZERO, &runtime_call); | 1157 // Check if input is a HeapNumber. |
| 1158 __ LoadRoot(rbx, Heap::kHeapNumberMapRootIndex); |
| 1159 __ cmpq(rbx, FieldOperand(rax, HeapObject::kMapOffset)); |
| 1160 __ j(not_equal, &runtime_call); |
| 1161 // Input is a HeapNumber. Push it on the FPU stack and load its |
| 1162 // bits into rbx. |
| 1163 __ fld_d(FieldOperand(rax, HeapNumber::kValueOffset)); |
| 1164 __ movq(rbx, FieldOperand(rax, HeapNumber::kValueOffset)); |
1158 __ movq(rdx, rbx); | 1165 __ movq(rdx, rbx); |
1159 | 1166 |
1160 __ bind(&loaded); | 1167 __ bind(&loaded); |
1161 } else { // UNTAGGED. | 1168 } else { // UNTAGGED. |
1162 __ movq(rbx, xmm1); | 1169 __ movq(rbx, xmm1); |
1163 __ movq(rdx, xmm1); | 1170 __ movq(rdx, xmm1); |
1164 } | 1171 } |
1165 | 1172 |
1166 // ST[0] == double value, if TAGGED. | 1173 // ST[0] == double value, if TAGGED. |
1167 // rbx = bits of double value. | 1174 // rbx = bits of double value. |
(...skipping 5446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6614 __ bind(&fast_elements_case); | 6621 __ bind(&fast_elements_case); |
6615 GenerateCase(masm, FAST_ELEMENTS); | 6622 GenerateCase(masm, FAST_ELEMENTS); |
6616 } | 6623 } |
6617 | 6624 |
6618 | 6625 |
6619 #undef __ | 6626 #undef __ |
6620 | 6627 |
6621 } } // namespace v8::internal | 6628 } } // namespace v8::internal |
6622 | 6629 |
6623 #endif // V8_TARGET_ARCH_X64 | 6630 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |