| 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/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
| 9 | 9 |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1203 Assembler::kNearJump, | 1203 Assembler::kNearJump, |
| 1204 RAX, // Result register. | 1204 RAX, // Result register. |
| 1205 kNoRegister); // Pool pointer might not be loaded. | 1205 kNoRegister); // Pool pointer might not be loaded. |
| 1206 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM0); | 1206 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM0); |
| 1207 __ ret(); | 1207 __ ret(); |
| 1208 __ Bind(&fall_through); | 1208 __ Bind(&fall_through); |
| 1209 } | 1209 } |
| 1210 | 1210 |
| 1211 | 1211 |
| 1212 // Left is double right is integer (Bigint, Mint or Smi) | 1212 // Left is double right is integer (Bigint, Mint or Smi) |
| 1213 void Intrinsifier::Double_fromInteger(Assembler* assembler) { | 1213 void Intrinsifier::DoubleFromInteger(Assembler* assembler) { |
| 1214 Label fall_through; | 1214 Label fall_through; |
| 1215 __ movq(RAX, Address(RSP, +1 * kWordSize)); | 1215 __ movq(RAX, Address(RSP, +1 * kWordSize)); |
| 1216 __ testq(RAX, Immediate(kSmiTagMask)); | 1216 __ testq(RAX, Immediate(kSmiTagMask)); |
| 1217 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); | 1217 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); |
| 1218 // Is Smi. | 1218 // Is Smi. |
| 1219 __ SmiUntag(RAX); | 1219 __ SmiUntag(RAX); |
| 1220 __ cvtsi2sd(XMM0, RAX); | 1220 __ cvtsi2sd(XMM0, RAX); |
| 1221 const Class& double_class = Class::Handle( | 1221 const Class& double_class = Class::Handle( |
| 1222 Isolate::Current()->object_store()->double_class()); | 1222 Isolate::Current()->object_store()->double_class()); |
| 1223 __ TryAllocate(double_class, | 1223 __ TryAllocate(double_class, |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1403 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); | 1403 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); |
| 1404 ASSERT(kSmiTagShift == 1); | 1404 ASSERT(kSmiTagShift == 1); |
| 1405 __ movzxw(RAX, FieldAddress(RAX, RCX, TIMES_1, OneByteString::data_offset())); | 1405 __ movzxw(RAX, FieldAddress(RAX, RCX, TIMES_1, OneByteString::data_offset())); |
| 1406 __ SmiTag(RAX); | 1406 __ SmiTag(RAX); |
| 1407 __ ret(); | 1407 __ ret(); |
| 1408 | 1408 |
| 1409 __ Bind(&fall_through); | 1409 __ Bind(&fall_through); |
| 1410 } | 1410 } |
| 1411 | 1411 |
| 1412 | 1412 |
| 1413 void Intrinsifier::StringBase_charAt(Assembler* assembler) { | 1413 void Intrinsifier::StringBaseCharAt(Assembler* assembler) { |
| 1414 Label fall_through, try_two_byte_string; | 1414 Label fall_through, try_two_byte_string; |
| 1415 __ movq(RCX, Address(RSP, + 1 * kWordSize)); // Index. | 1415 __ movq(RCX, Address(RSP, + 1 * kWordSize)); // Index. |
| 1416 __ movq(RAX, Address(RSP, + 2 * kWordSize)); // String. | 1416 __ movq(RAX, Address(RSP, + 2 * kWordSize)); // String. |
| 1417 __ testq(RCX, Immediate(kSmiTagMask)); | 1417 __ testq(RCX, Immediate(kSmiTagMask)); |
| 1418 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi index. | 1418 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi index. |
| 1419 // Range check. | 1419 // Range check. |
| 1420 __ cmpq(RCX, FieldAddress(RAX, String::length_offset())); | 1420 __ cmpq(RCX, FieldAddress(RAX, String::length_offset())); |
| 1421 // Runtime throws exception. | 1421 // Runtime throws exception. |
| 1422 __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump); | 1422 __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump); |
| 1423 __ CompareClassId(RAX, kOneByteStringCid); | 1423 __ CompareClassId(RAX, kOneByteStringCid); |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 // Set return value to Isolate::current_tag_. | 1799 // Set return value to Isolate::current_tag_. |
| 1800 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); | 1800 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); |
| 1801 __ ret(); | 1801 __ ret(); |
| 1802 } | 1802 } |
| 1803 | 1803 |
| 1804 #undef __ | 1804 #undef __ |
| 1805 | 1805 |
| 1806 } // namespace dart | 1806 } // namespace dart |
| 1807 | 1807 |
| 1808 #endif // defined TARGET_ARCH_X64 | 1808 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |