OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 4907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4918 // Return NaN. | 4918 // Return NaN. |
4919 __ Bind(&return_nan); | 4919 __ Bind(&return_nan); |
4920 __ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(NAN)), PP); | 4920 __ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(NAN)), PP); |
4921 __ movsd(result, FieldAddress(temp, Double::value_offset())); | 4921 __ movsd(result, FieldAddress(temp, Double::value_offset())); |
4922 __ jmp(&skip_call); | 4922 __ jmp(&skip_call); |
4923 | 4923 |
4924 Label do_pow, return_zero; | 4924 Label do_pow, return_zero; |
4925 __ Bind(&try_sqrt); | 4925 __ Bind(&try_sqrt); |
4926 // Before calling pow, check if we could use sqrt instead of pow. | 4926 // Before calling pow, check if we could use sqrt instead of pow. |
4927 __ LoadObject(temp, | 4927 __ LoadObject(temp, |
4928 Double::ZoneHandle(Double::NewCanonical(-INFINITY)), PP); | 4928 Double::ZoneHandle(Double::NewCanonical(kNegInfinity)), PP); |
4929 __ movsd(result, FieldAddress(temp, Double::value_offset())); | 4929 __ movsd(result, FieldAddress(temp, Double::value_offset())); |
4930 // base == -Infinity -> call pow; | 4930 // base == -Infinity -> call pow; |
4931 __ comisd(base, result); | 4931 __ comisd(base, result); |
4932 __ j(EQUAL, &do_pow, Assembler::kNearJump); | 4932 __ j(EQUAL, &do_pow, Assembler::kNearJump); |
4933 | 4933 |
4934 // exponent == 0.5 ? | 4934 // exponent == 0.5 ? |
4935 __ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(0.5)), PP); | 4935 __ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(0.5)), PP); |
4936 __ movsd(result, FieldAddress(temp, Double::value_offset())); | 4936 __ movsd(result, FieldAddress(temp, Double::value_offset())); |
4937 __ comisd(exp, result); | 4937 __ comisd(exp, result); |
4938 __ j(NOT_EQUAL, &do_pow, Assembler::kNearJump); | 4938 __ j(NOT_EQUAL, &do_pow, Assembler::kNearJump); |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5922 __ movq(R10, Immediate(kInvalidObjectPointer)); | 5922 __ movq(R10, Immediate(kInvalidObjectPointer)); |
5923 __ movq(RBX, Immediate(kInvalidObjectPointer)); | 5923 __ movq(RBX, Immediate(kInvalidObjectPointer)); |
5924 #endif | 5924 #endif |
5925 } | 5925 } |
5926 | 5926 |
5927 } // namespace dart | 5927 } // namespace dart |
5928 | 5928 |
5929 #undef __ | 5929 #undef __ |
5930 | 5930 |
5931 #endif // defined TARGET_ARCH_X64 | 5931 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |