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

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

Issue 513213002: Generate some intrinsics using our IR. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 393
394 394
395 // Gets the length of a TypedData. 395 // Gets the length of a TypedData.
396 void Intrinsifier::TypedDataLength(Assembler* assembler) { 396 void Intrinsifier::TypedDataLength(Assembler* assembler) {
397 __ ldr(R0, Address(SP, 0 * kWordSize)); 397 __ ldr(R0, Address(SP, 0 * kWordSize));
398 __ ldr(R0, FieldAddress(R0, TypedData::length_offset())); 398 __ ldr(R0, FieldAddress(R0, TypedData::length_offset()));
399 __ Ret(); 399 __ Ret();
400 } 400 }
401 401
402 402
403 void Intrinsifier::Uint8ArrayGetIndexed(Assembler* assembler) {
404 Label fall_through;
405 __ ldr(R0, Address(SP, + 0 * kWordSize)); // Index.
406 __ ldr(R1, Address(SP, + 1 * kWordSize)); // Array.
407 __ tst(R0, Operand(kSmiTagMask));
408 __ b(&fall_through, NE); // Index is not a smi, fall through.
409
410 // Range check.
411 __ ldr(R6, FieldAddress(R1, TypedData::length_offset()));
412 __ cmp(R0, Operand(R6));
413 __ b(&fall_through, CS);
414
415 __ SmiUntag(R0);
416 __ AddImmediate(R1, TypedData::data_offset() - kHeapObjectTag);
417 __ ldrb(R0, Address(R1, R0));
418 __ SmiTag(R0);
419 __ Ret();
420 __ Bind(&fall_through);
421 }
422
423
424 void Intrinsifier::ExternalUint8ArrayGetIndexed(Assembler* assembler) {
425 Label fall_through;
426
427 __ ldr(R0, Address(SP, + 0 * kWordSize)); // Index.
428 __ ldr(R1, Address(SP, + 1 * kWordSize)); // Array.
429 __ tst(R0, Operand(kSmiTagMask));
430 __ b(&fall_through, NE); // Index is not a smi, fall through.
431
432 // Range check.
433 __ ldr(R6, FieldAddress(R1, TypedData::length_offset()));
434 __ cmp(R0, Operand(R6));
435 __ b(&fall_through, CS);
436
437 __ LoadFromOffset(kWord, R1, R1,
438 ExternalTypedData::data_offset() - kHeapObjectTag);
439 __ SmiUntag(R0);
440 __ ldrb(R0, Address(R1, R0));
441 __ SmiTag(R0);
442 __ Ret();
443 __ Bind(&fall_through);
444 }
445
446
447 void Intrinsifier::Float64ArrayGetIndexed(Assembler* assembler) { 403 void Intrinsifier::Float64ArrayGetIndexed(Assembler* assembler) {
448 if (!TargetCPUFeatures::vfp_supported()) { 404 if (!TargetCPUFeatures::vfp_supported()) {
449 return; 405 return;
450 } 406 }
451 Label fall_through; 407 Label fall_through;
452 __ ldr(R0, Address(SP, + 0 * kWordSize)); // Index. 408 __ ldr(R0, Address(SP, + 0 * kWordSize)); // Index.
453 __ ldr(R1, Address(SP, + 1 * kWordSize)); // Array. 409 __ ldr(R1, Address(SP, + 1 * kWordSize)); // Array.
454 __ tst(R0, Operand(kSmiTagMask)); 410 __ tst(R0, Operand(kSmiTagMask));
455 __ b(&fall_through, NE); // Index is not a smi, fall through. 411 __ b(&fall_through, NE); // Index is not a smi, fall through.
456 412
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 Isolate* isolate = Isolate::Current(); 1748 Isolate* isolate = Isolate::Current();
1793 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); 1749 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate));
1794 // Set return value to Isolate::current_tag_. 1750 // Set return value to Isolate::current_tag_.
1795 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); 1751 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
1796 __ Ret(); 1752 __ Ret();
1797 } 1753 }
1798 1754
1799 } // namespace dart 1755 } // namespace dart
1800 1756
1801 #endif // defined TARGET_ARCH_ARM 1757 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698