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

Unified Diff: runtime/vm/intrinsifier_x64.cc

Issue 11139004: Intrinsify natural word size typed array getters on IA32 and X64 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Codereview Created 8 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | tests/standalone/int_array_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_x64.cc
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index b3f7be7953ee6c6df140d28514fa8870b59d99fe..6ddaf93d355121a774fa60e1d9eb2f6e6755bda7 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -532,6 +532,47 @@ bool Intrinsifier::Uint32Array_getIndexed(Assembler* assembler) {
}
+bool Intrinsifier::Int64Array_getIndexed(Assembler* assembler) {
+ Label fall_through;
+ TestByteArrayIndex(assembler, &fall_through);
+ __ movq(RAX, FieldAddress(RAX,
+ R12,
+ TIMES_4,
+ Int64Array::data_offset()));
+ // Copy RAX into R12.
+ // We destroy R12 while testing if RAX can fit inside a Smi.
+ __ movq(R12, RAX);
+ // Verify that the signed value in RAX can fit inside a Smi.
+ __ shlq(R12, Immediate(0x1));
+ // Jump to fall_through if it can not.
+ __ j(OVERFLOW, &fall_through, Assembler::kNearJump);
+ __ SmiTag(RAX);
+ __ ret();
+ __ Bind(&fall_through);
+ return false;
+}
+
+
+bool Intrinsifier::Uint64Array_getIndexed(Assembler* assembler) {
+ Label fall_through;
+ TestByteArrayIndex(assembler, &fall_through);
+ __ movq(RAX, FieldAddress(RAX,
+ R12,
+ TIMES_4,
+ Uint64Array::data_offset()));
+ // Copy RAX into R12.
+ // We destroy R12 while testing if RAX can fit inside a Smi.
+ __ movq(R12, RAX);
+ // Verify that the unsigned value in RAX can be stored in a Smi.
+ __ shrq(R12, Immediate(kSmiBits));
+ __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Won't fit Smi.
+ __ SmiTag(RAX);
+ __ ret();
+ __ Bind(&fall_through);
+ return false;
+}
+
+
bool Intrinsifier::Float32Array_getIndexed(Assembler* assembler) {
Label fall_through;
TestByteArrayIndex(assembler, &fall_through);
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | tests/standalone/int_array_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698