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

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

Issue 259903002: Enables all codegen tests for arm64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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) 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 LoadWordFromPoolOffset(dst, pp, offset); 421 LoadWordFromPoolOffset(dst, pp, offset);
422 } else { 422 } else {
423 ASSERT((Isolate::Current() == Dart::vm_isolate()) || 423 ASSERT((Isolate::Current() == Dart::vm_isolate()) ||
424 object.IsSmi() || 424 object.IsSmi() ||
425 object.InVMHeap()); 425 object.InVMHeap());
426 LoadDecodableImmediate(dst, reinterpret_cast<int64_t>(object.raw()), pp); 426 LoadDecodableImmediate(dst, reinterpret_cast<int64_t>(object.raw()), pp);
427 } 427 }
428 } 428 }
429 429
430 430
431 void Assembler::CompareObject(Register reg, const Object& object, Register pp) {
432 if (CanLoadObjectFromPool(object)) {
433 LoadObject(TMP, object, pp);
434 CompareRegisters(reg, TMP);
435 } else {
436 CompareImmediate(
437 reg, reinterpret_cast<int64_t>(object.raw()), pp);
regis 2014/04/25 21:17:51 one line
zra 2014/04/25 21:28:28 Done.
438 }
439 }
440
441
431 void Assembler::LoadDecodableImmediate(Register reg, int64_t imm, Register pp) { 442 void Assembler::LoadDecodableImmediate(Register reg, int64_t imm, Register pp) {
432 if ((pp != kNoRegister) && (Isolate::Current() != Dart::vm_isolate())) { 443 if ((pp != kNoRegister) && (Isolate::Current() != Dart::vm_isolate())) {
433 int64_t val_smi_tag = imm & kSmiTagMask; 444 int64_t val_smi_tag = imm & kSmiTagMask;
434 imm &= ~kSmiTagMask; // Mask off the tag bits. 445 imm &= ~kSmiTagMask; // Mask off the tag bits.
435 const int32_t offset = Array::element_offset(FindImmediate(imm)); 446 const int32_t offset = Array::element_offset(FindImmediate(imm));
436 LoadWordFromPoolOffset(reg, pp, offset); 447 LoadWordFromPoolOffset(reg, pp, offset);
437 if (val_smi_tag != 0) { 448 if (val_smi_tag != 0) {
438 // Add back the tag bits. 449 // Add back the tag bits.
439 orri(reg, reg, val_smi_tag); 450 orri(reg, reg, val_smi_tag);
440 } 451 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 } else if (Operand::CanHold(-imm, kXRegSizeInBits, &op) == 574 } else if (Operand::CanHold(-imm, kXRegSizeInBits, &op) ==
564 Operand::Immediate) { 575 Operand::Immediate) {
565 sub(dest, rn, op); 576 sub(dest, rn, op);
566 } else { 577 } else {
567 LoadImmediate(TMP2, imm, pp); 578 LoadImmediate(TMP2, imm, pp);
568 add(dest, rn, Operand(TMP2)); 579 add(dest, rn, Operand(TMP2));
569 } 580 }
570 } 581 }
571 582
572 583
584 void Assembler::TestImmediate(Register rn, int64_t imm, Register pp) {
585 Operand imm_op;
586 if (Operand::IsImmLogical(imm, kXRegSizeInBits, &imm_op)) {
587 tsti(rn, imm);
588 } else {
589 LoadImmediate(TMP, imm, pp);
590 tst(rn, Operand(TMP));
591 }
592 }
593
594
573 void Assembler::CompareImmediate(Register rn, int64_t imm, Register pp) { 595 void Assembler::CompareImmediate(Register rn, int64_t imm, Register pp) {
574 ASSERT(rn != TMP2); 596 ASSERT(rn != TMP2);
575 Operand op; 597 Operand op;
576 if (Operand::CanHold(imm, kXRegSizeInBits, &op) == Operand::Immediate) { 598 if (Operand::CanHold(imm, kXRegSizeInBits, &op) == Operand::Immediate) {
577 cmp(rn, op); 599 cmp(rn, op);
578 } else if (Operand::CanHold(-imm, kXRegSizeInBits, &op) == 600 } else if (Operand::CanHold(-imm, kXRegSizeInBits, &op) ==
579 Operand::Immediate) { 601 Operand::Immediate) {
580 cmn(rn, op); 602 cmn(rn, op);
581 } else { 603 } else {
582 LoadImmediate(TMP2, imm, pp); 604 LoadImmediate(TMP2, imm, pp);
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 } 912 }
891 913
892 914
893 void Assembler::LeaveStubFrame() { 915 void Assembler::LeaveStubFrame() {
894 // Restore and untag PP. 916 // Restore and untag PP.
895 LoadFromOffset(PP, FP, kSavedCallerPpSlotFromFp * kWordSize); 917 LoadFromOffset(PP, FP, kSavedCallerPpSlotFromFp * kWordSize);
896 sub(PP, PP, Operand(kHeapObjectTag)); 918 sub(PP, PP, Operand(kHeapObjectTag));
897 LeaveFrame(); 919 LeaveFrame();
898 } 920 }
899 921
922
923 void Assembler::UpdateAllocationStats(intptr_t cid,
924 Register temp_reg,
925 Heap::Space space) {
926 ASSERT(temp_reg != kNoRegister);
927 ASSERT(temp_reg != TMP);
928 ASSERT(cid > 0);
929 Isolate* isolate = Isolate::Current();
930 ClassTable* class_table = isolate->class_table();
931 if (cid < kNumPredefinedCids) {
932 const uword class_heap_stats_table_address =
933 class_table->PredefinedClassHeapStatsTableAddress();
934 const uword class_offset = cid * sizeof(ClassHeapStats); // NOLINT
935 const uword count_field_offset = (space == Heap::kNew) ?
936 ClassHeapStats::allocated_since_gc_new_space_offset() :
937 ClassHeapStats::allocated_since_gc_old_space_offset();
938 LoadImmediate(temp_reg, class_heap_stats_table_address + class_offset, PP);
939 const Address& count_address = Address(temp_reg, count_field_offset);
940 ldr(TMP, count_address);
941 AddImmediate(TMP, TMP, 1, PP);
942 str(TMP, count_address);
943 } else {
944 ASSERT(temp_reg != kNoRegister);
945 const uword class_offset = cid * sizeof(ClassHeapStats); // NOLINT
946 const uword count_field_offset = (space == Heap::kNew) ?
947 ClassHeapStats::allocated_since_gc_new_space_offset() :
948 ClassHeapStats::allocated_since_gc_old_space_offset();
949 LoadImmediate(temp_reg, class_table->ClassStatsTableAddress(), PP);
950 ldr(temp_reg, Address(temp_reg));
951 AddImmediate(temp_reg, temp_reg, class_offset, PP);
952 ldr(TMP, Address(temp_reg, count_field_offset));
953 AddImmediate(TMP, TMP, 1, PP);
954 str(TMP, Address(temp_reg, count_field_offset));
955 }
956 }
957
900 } // namespace dart 958 } // namespace dart
901 959
902 #endif // defined TARGET_ARCH_ARM64 960 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698