Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 505 __ movl(RAX, FieldAddress(RAX, | 505 __ movl(RAX, FieldAddress(RAX, |
| 506 RBX, | 506 RBX, |
| 507 TIMES_2, | 507 TIMES_2, |
| 508 Uint32Array::data_offset())); | 508 Uint32Array::data_offset())); |
| 509 __ SmiTag(RAX); | 509 __ SmiTag(RAX); |
| 510 __ ret(); | 510 __ ret(); |
| 511 __ Bind(&fall_through); | 511 __ Bind(&fall_through); |
| 512 return false; | 512 return false; |
| 513 } | 513 } |
| 514 | 514 |
| 515 bool Intrinsifier::Float32Array_getIndexed(Assembler* assembler) { | |
| 516 Label fall_through; | |
| 517 TestByteArrayIndex(assembler, &fall_through); | |
| 518 // After TestByteArrayIndex: | |
| 519 // RAX has the base address of the byte array | |
| 520 // RBX has the index into the array | |
| 521 | |
| 522 // Load single precision float into XMM7 | |
| 523 __ movss(XMM7, FieldAddress(RAX, RBX, TIMES_4, | |
| 524 Float32Array::data_offset())); | |
| 525 // Convert into a double precision float | |
| 526 __ cvtss2sd(XMM6, XMM7); | |
| 527 // Allocate a double instance | |
| 528 const Class& double_class = Class::Handle( | |
| 529 Isolate::Current()->object_store()->double_class()); | |
| 530 AssemblerMacros::TryAllocate(assembler, | |
| 531 double_class, | |
| 532 &fall_through, | |
| 533 Assembler::kNearJump, RAX); | |
| 534 // Store XMM6 into double instance | |
|
srdjan
2012/09/09 14:26:52
ditto for comments here
Cutch
2012/09/10 14:44:43
Done.
| |
| 535 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM6); | |
| 536 __ ret(); | |
| 537 __ Bind(&fall_through); | |
| 538 return false; | |
| 539 } | |
| 540 | |
| 541 bool Intrinsifier::Float32Array_setIndexed(Assembler* assembler) { | |
| 542 return false; | |
| 543 } | |
| 544 | |
| 515 | 545 |
| 516 // Tests if two top most arguments are smis, jumps to label not_smi if not. | 546 // Tests if two top most arguments are smis, jumps to label not_smi if not. |
| 517 // Topmost argument is in RAX. | 547 // Topmost argument is in RAX. |
| 518 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) { | 548 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) { |
| 519 __ movq(RAX, Address(RSP, + 1 * kWordSize)); | 549 __ movq(RAX, Address(RSP, + 1 * kWordSize)); |
| 520 __ movq(RCX, Address(RSP, + 2 * kWordSize)); | 550 __ movq(RCX, Address(RSP, + 2 * kWordSize)); |
| 521 __ orq(RCX, RAX); | 551 __ orq(RCX, RAX); |
| 522 __ testq(RCX, Immediate(kSmiTagMask)); | 552 __ testq(RCX, Immediate(kSmiTagMask)); |
| 523 __ j(NOT_ZERO, not_smi, Assembler::kNearJump); | 553 __ j(NOT_ZERO, not_smi, Assembler::kNearJump); |
| 524 } | 554 } |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1362 __ LoadObject(RAX, bool_true); | 1392 __ LoadObject(RAX, bool_true); |
| 1363 __ ret(); | 1393 __ ret(); |
| 1364 return true; | 1394 return true; |
| 1365 } | 1395 } |
| 1366 | 1396 |
| 1367 #undef __ | 1397 #undef __ |
| 1368 | 1398 |
| 1369 } // namespace dart | 1399 } // namespace dart |
| 1370 | 1400 |
| 1371 #endif // defined TARGET_ARCH_X64 | 1401 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |