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

Side by Side Diff: runtime/vm/assembler_arm64.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) 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" // NOLINT 5 #include "vm/globals.h" // NOLINT
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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 const ExternalLabel* label, 454 const ExternalLabel* label,
455 Patchability patchable, 455 Patchability patchable,
456 Register pp) { 456 Register pp) {
457 const int32_t offset = 457 const int32_t offset =
458 Array::element_offset(object_pool_.FindExternalLabel(label, patchable)); 458 Array::element_offset(object_pool_.FindExternalLabel(label, patchable));
459 LoadWordFromPoolOffsetFixed(dst, pp, offset); 459 LoadWordFromPoolOffsetFixed(dst, pp, offset);
460 } 460 }
461 461
462 462
463 void Assembler::LoadIsolate(Register dst, Register pp) { 463 void Assembler::LoadIsolate(Register dst, Register pp) {
464 LoadImmediate(dst, reinterpret_cast<uword>(Isolate::Current()), pp); 464 ldr(dst, Address(THR, Thread::isolate_offset()));
465 } 465 }
466 466
467 467
468 void Assembler::LoadObject(Register dst, const Object& object, Register pp) { 468 void Assembler::LoadObject(Register dst, const Object& object, Register pp) {
469 if (CanLoadObjectFromPool(object)) { 469 if (CanLoadObjectFromPool(object)) {
470 const int32_t offset = 470 const int32_t offset =
471 Array::element_offset(object_pool_.FindObject(object, kNotPatchable)); 471 Array::element_offset(object_pool_.FindObject(object, kNotPatchable));
472 LoadWordFromPoolOffset(dst, pp, offset); 472 LoadWordFromPoolOffset(dst, pp, offset);
473 } else { 473 } else {
474 ASSERT((Isolate::Current() == Dart::vm_isolate()) || 474 ASSERT((Isolate::Current() == Dart::vm_isolate()) ||
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 add(base, array, Operand(index, LSL, shift)); 1462 add(base, array, Operand(index, LSL, shift));
1463 } 1463 }
1464 const OperandSize size = Address::OperandSizeFor(cid); 1464 const OperandSize size = Address::OperandSizeFor(cid);
1465 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); 1465 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size));
1466 return Address(base, offset, Address::Offset, size); 1466 return Address(base, offset, Address::Offset, size);
1467 } 1467 }
1468 1468
1469 } // namespace dart 1469 } // namespace dart
1470 1470
1471 #endif // defined TARGET_ARCH_ARM64 1471 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698