OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 5350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5361 __ divsd(xmm3, xmm1); | 5361 __ divsd(xmm3, xmm1); |
5362 __ movsd(xmm1, xmm3); | 5362 __ movsd(xmm1, xmm3); |
5363 __ jmp(&allocate_and_return); | 5363 __ jmp(&allocate_and_return); |
5364 | 5364 |
5365 // y (or both) is a double - no matter what we should now work | 5365 // y (or both) is a double - no matter what we should now work |
5366 // on doubles. | 5366 // on doubles. |
5367 __ bind(&y_nonsmi); | 5367 __ bind(&y_nonsmi); |
5368 __ cmp(FieldOperand(y.reg(), HeapObject::kMapOffset), | 5368 __ cmp(FieldOperand(y.reg(), HeapObject::kMapOffset), |
5369 Factory::heap_number_map()); | 5369 Factory::heap_number_map()); |
5370 __ j(not_equal, &go_runtime); | 5370 __ j(not_equal, &go_runtime); |
| 5371 // Y must be a double. |
| 5372 __ movdbl(xmm1, FieldOperand(y.reg(), HeapNumber::kValueOffset)); |
5371 // Test if y is nan. | 5373 // Test if y is nan. |
5372 __ ucomisd(xmm1, xmm1); | 5374 __ ucomisd(xmm1, xmm1); |
5373 __ j(parity_even, &go_runtime); | 5375 __ j(parity_even, &go_runtime); |
5374 | 5376 |
5375 // Y must be a double. | |
5376 __ movdbl(xmm1, FieldOperand(y.reg(), HeapNumber::kValueOffset)); | |
5377 | |
5378 Label x_not_smi; | 5377 Label x_not_smi; |
5379 Label handle_special_cases; | 5378 Label handle_special_cases; |
5380 __ test(x.reg(), Immediate(kSmiTagMask)); | 5379 __ test(x.reg(), Immediate(kSmiTagMask)); |
5381 __ j(not_zero, &x_not_smi); | 5380 __ j(not_zero, &x_not_smi); |
5382 __ SmiUntag(x.reg()); | 5381 __ SmiUntag(x.reg()); |
5383 __ cvtsi2sd(xmm0, Operand(x.reg())); | 5382 __ cvtsi2sd(xmm0, Operand(x.reg())); |
5384 __ jmp(&handle_special_cases); | 5383 __ jmp(&handle_special_cases); |
5385 __ bind(&x_not_smi); | 5384 __ bind(&x_not_smi); |
5386 __ cmp(FieldOperand(x.reg(), HeapObject::kMapOffset), | 5385 __ cmp(FieldOperand(x.reg(), HeapObject::kMapOffset), |
5387 Factory::heap_number_map()); | 5386 Factory::heap_number_map()); |
(...skipping 5843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11231 | 11230 |
11232 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 11231 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
11233 // tagged as a small integer. | 11232 // tagged as a small integer. |
11234 __ bind(&runtime); | 11233 __ bind(&runtime); |
11235 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 11234 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
11236 } | 11235 } |
11237 | 11236 |
11238 #undef __ | 11237 #undef __ |
11239 | 11238 |
11240 } } // namespace v8::internal | 11239 } } // namespace v8::internal |
OLD | NEW |