Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: runtime/vm/intrinsifier_x64.cc

Issue 11280121: Intrinsify ExternalUint8Array.[]. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 // Load double value into XMM7. 693 // Load double value into XMM7.
694 __ movsd(XMM7, FieldAddress(RDX, Double::value_offset())); 694 __ movsd(XMM7, FieldAddress(RDX, Double::value_offset()));
695 // Store into array. 695 // Store into array.
696 __ movsd(FieldAddress(RAX, R12, TIMES_4, Float64Array::data_offset()), XMM7); 696 __ movsd(FieldAddress(RAX, R12, TIMES_4, Float64Array::data_offset()), XMM7);
697 __ ret(); 697 __ ret();
698 __ Bind(&fall_through); 698 __ Bind(&fall_through);
699 return false; 699 return false;
700 } 700 }
701 701
702 702
703 bool Intrinsifier::ExternalUint8Array_getIndexed(Assembler* assembler) {
704 Label fall_through;
705 TestByteArrayIndex(assembler, &fall_through);
706 __ SmiUntag(R12);
707 __ movq(RAX, FieldAddress(RAX, ExternalUint8Array::external_data_offset()));
708 __ movq(RAX, Address(RAX, ExternalByteArrayData<uint8_t>::data_offset()));
709 __ movzxb(RAX, Address(RAX, R12, TIMES_1, 0));
710 __ SmiTag(RAX);
711 __ ret();
712 __ Bind(&fall_through);
713 return false;
714 }
715
716
703 // Tests if two top most arguments are smis, jumps to label not_smi if not. 717 // Tests if two top most arguments are smis, jumps to label not_smi if not.
704 // Topmost argument is in RAX. 718 // Topmost argument is in RAX.
705 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) { 719 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) {
706 __ movq(RAX, Address(RSP, + 1 * kWordSize)); 720 __ movq(RAX, Address(RSP, + 1 * kWordSize));
707 __ movq(RCX, Address(RSP, + 2 * kWordSize)); 721 __ movq(RCX, Address(RSP, + 2 * kWordSize));
708 __ orq(RCX, RAX); 722 __ orq(RCX, RAX);
709 __ testq(RCX, Immediate(kSmiTagMask)); 723 __ testq(RCX, Immediate(kSmiTagMask));
710 __ j(NOT_ZERO, not_smi, Assembler::kNearJump); 724 __ j(NOT_ZERO, not_smi, Assembler::kNearJump);
711 } 725 }
712 726
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 __ LoadObject(RAX, bool_true); 1571 __ LoadObject(RAX, bool_true);
1558 __ ret(); 1572 __ ret();
1559 return true; 1573 return true;
1560 } 1574 }
1561 1575
1562 #undef __ 1576 #undef __
1563 1577
1564 } // namespace dart 1578 } // namespace dart
1565 1579
1566 #endif // defined TARGET_ARCH_X64 1580 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | runtime/vm/object.h » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698