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

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