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

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

Issue 255633002: Enables simple static call test on arm64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/code_generator_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 } else if (Operand::CanHold(-imm, kXRegSizeInBits, &op) == 554 } else if (Operand::CanHold(-imm, kXRegSizeInBits, &op) ==
555 Operand::Immediate) { 555 Operand::Immediate) {
556 cmn(rn, op); 556 cmn(rn, op);
557 } else { 557 } else {
558 LoadImmediate(TMP2, imm, pp); 558 LoadImmediate(TMP2, imm, pp);
559 cmp(rn, Operand(TMP2)); 559 cmp(rn, Operand(TMP2));
560 } 560 }
561 } 561 }
562 562
563 563
564 void Assembler::LoadFromOffset(Register dest, Register base, int32_t offset) { 564 void Assembler::LoadFromOffset(
565 Register dest, Register base, int32_t offset, OperandSize sz) {
565 ASSERT(base != TMP2); 566 ASSERT(base != TMP2);
566 if (Address::CanHoldOffset(offset)) { 567 if (Address::CanHoldOffset(offset)) {
567 ldr(dest, Address(base, offset)); 568 ldr(dest, Address(base, offset), sz);
568 } else { 569 } else {
569 // Since offset is 32-bits, it won't be loaded from the pool. 570 // Since offset is 32-bits, it won't be loaded from the pool.
570 AddImmediate(TMP2, base, offset, kNoRegister); 571 AddImmediate(TMP2, base, offset, kNoRegister);
571 ldr(dest, Address(TMP2)); 572 ldr(dest, Address(TMP2), sz);
572 } 573 }
573 } 574 }
574 575
575 576
576 void Assembler::StoreToOffset(Register src, Register base, int32_t offset) { 577 void Assembler::StoreToOffset(
578 Register src, Register base, int32_t offset, OperandSize sz) {
577 ASSERT(src != TMP2); 579 ASSERT(src != TMP2);
578 ASSERT(base != TMP2); 580 ASSERT(base != TMP2);
579 if (Address::CanHoldOffset(offset)) { 581 if (Address::CanHoldOffset(offset)) {
580 str(src, Address(base, offset)); 582 str(src, Address(base, offset), sz);
581 } else if (Address::CanHoldOffset(offset, Address::PreIndex)) {
582 mov(TMP2, base);
583 str(src, Address(TMP2, offset, Address::PreIndex));
584 } else { 583 } else {
585 // Since offset is 32-bits, it won't be loaded from the pool. 584 // Since offset is 32-bits, it won't be loaded from the pool.
586 AddImmediate(TMP2, base, offset, kNoRegister); 585 AddImmediate(TMP2, base, offset, kNoRegister);
587 str(src, Address(TMP2)); 586 str(src, Address(TMP2), sz);
588 } 587 }
589 } 588 }
590 589
591 590
592 // Store into object. 591 // Store into object.
593 // Preserves object and value registers. 592 // Preserves object and value registers.
594 void Assembler::StoreIntoObjectFilterNoSmi(Register object, 593 void Assembler::StoreIntoObjectFilterNoSmi(Register object,
595 Register value, 594 Register value,
596 Label* no_update) { 595 Label* no_update) {
597 COMPILE_ASSERT((kNewObjectAlignmentOffset == kWordSize) && 596 COMPILE_ASSERT((kNewObjectAlignmentOffset == kWordSize) &&
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 Pop(FP); 810 Pop(FP);
812 Pop(LR); 811 Pop(LR);
813 } 812 }
814 813
815 814
816 void Assembler::CallRuntime(const RuntimeEntry& entry, 815 void Assembler::CallRuntime(const RuntimeEntry& entry,
817 intptr_t argument_count) { 816 intptr_t argument_count) {
818 entry.Call(this, argument_count); 817 entry.Call(this, argument_count);
819 } 818 }
820 819
820
821 void Assembler::EnterStubFrame(bool load_pp) {
822 EnterFrame(0);
823 Push(ZR); // Push 0 in the saved PC area for stub frames.
824 PushPP(); // Save caller's pool pointer
825 if (load_pp) {
826 LoadPoolPointer(PP);
827 }
828 }
829
830
831 void Assembler::LeaveStubFrame() {
832 // Restore and untag PP.
833 LoadFromOffset(PP, FP, kSavedCallerPpSlotFromFp * kWordSize);
834 sub(PP, PP, Operand(kHeapObjectTag));
regis 2014/04/24 16:20:07 It is surprising to see this untag operation when
zra 2014/04/24 16:29:01 Done.
835 LeaveFrame();
836 }
837
821 } // namespace dart 838 } // namespace dart
822 839
823 #endif // defined TARGET_ARCH_ARM64 840 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/code_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698