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

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

Issue 1156593002: Cache current thread in a reserved register and use it in LoadIsolate (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added more comments. Created 5 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
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" // NOLINT 5 #include "vm/globals.h" // NOLINT
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/longjump.h" 9 #include "vm/longjump.h"
10 #include "vm/runtime_entry.h" 10 #include "vm/runtime_entry.h"
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 if (Address::CanHoldOffset(offset - kHeapObjectTag)) { 619 if (Address::CanHoldOffset(offset - kHeapObjectTag)) {
620 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value); 620 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value);
621 } else { 621 } else {
622 AddImmediate(TMP, object, offset - kHeapObjectTag); 622 AddImmediate(TMP, object, offset - kHeapObjectTag);
623 StoreIntoObjectNoBarrier(object, Address(TMP), value); 623 StoreIntoObjectNoBarrier(object, Address(TMP), value);
624 } 624 }
625 } 625 }
626 626
627 627
628 void Assembler::LoadIsolate(Register result) { 628 void Assembler::LoadIsolate(Register result) {
629 LoadImmediate(result, reinterpret_cast<uword>(Isolate::Current())); 629 lw(result, Address(THR, Thread::isolate_offset()));
630 } 630 }
631 631
632 632
633 void Assembler::LoadClassId(Register result, Register object) { 633 void Assembler::LoadClassId(Register result, Register object) {
634 ASSERT(RawObject::kClassIdTagPos == 16); 634 ASSERT(RawObject::kClassIdTagPos == 16);
635 ASSERT(RawObject::kClassIdTagSize == 16); 635 ASSERT(RawObject::kClassIdTagSize == 16);
636 const intptr_t class_id_offset = Object::tags_offset() + 636 const intptr_t class_id_offset = Object::tags_offset() +
637 RawObject::kClassIdTagPos / kBitsPerByte; 637 RawObject::kClassIdTagPos / kBitsPerByte;
638 lhu(result, FieldAddress(object, class_id_offset)); 638 lhu(result, FieldAddress(object, class_id_offset));
639 } 639 }
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 Label stop; 1211 Label stop;
1212 b(&stop); 1212 b(&stop);
1213 Emit(reinterpret_cast<int32_t>(message)); 1213 Emit(reinterpret_cast<int32_t>(message));
1214 Bind(&stop); 1214 Bind(&stop);
1215 break_(Instr::kStopMessageCode); 1215 break_(Instr::kStopMessageCode);
1216 } 1216 }
1217 1217
1218 } // namespace dart 1218 } // namespace dart
1219 1219
1220 #endif // defined TARGET_ARCH_MIPS 1220 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698