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

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

Issue 1846063002: - Fix the hash code for raw objects that are added into the object pool (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix Created 4 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
« no previous file with comments | « runtime/vm/assembler_arm64.cc ('k') | runtime/vm/assembler_x64.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) 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 486
487 487
488 void Assembler::RestoreCodePointer() { 488 void Assembler::RestoreCodePointer() {
489 lw(CODE_REG, Address(FP, kPcMarkerSlotFromFp * kWordSize)); 489 lw(CODE_REG, Address(FP, kPcMarkerSlotFromFp * kWordSize));
490 CheckCodePointer(); 490 CheckCodePointer();
491 } 491 }
492 492
493 493
494 void Assembler::Branch(const StubEntry& stub_entry, Register pp) { 494 void Assembler::Branch(const StubEntry& stub_entry, Register pp) {
495 ASSERT(!in_delay_slot_); 495 ASSERT(!in_delay_slot_);
496 const Code& target_code = Code::Handle(stub_entry.code()); 496 const Code& target_code = Code::ZoneHandle(stub_entry.code());
497 const int32_t offset = ObjectPool::element_offset( 497 const int32_t offset = ObjectPool::element_offset(
498 object_pool_wrapper_.FindObject(target_code, kPatchable)); 498 object_pool_wrapper_.AddObject(target_code, kPatchable));
499 LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag, pp); 499 LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag, pp);
500 lw(TMP, FieldAddress(CODE_REG, Code::entry_point_offset())); 500 lw(TMP, FieldAddress(CODE_REG, Code::entry_point_offset()));
501 jr(TMP); 501 jr(TMP);
502 } 502 }
503 503
504 504
505 void Assembler::BranchLink(const ExternalLabel* label) { 505 void Assembler::BranchLink(const ExternalLabel* label) {
506 ASSERT(!in_delay_slot_); 506 ASSERT(!in_delay_slot_);
507 LoadImmediate(T9, label->address()); 507 LoadImmediate(T9, label->address());
508 jalr(T9); 508 jalr(T9);
509 } 509 }
510 510
511 511
512 void Assembler::BranchLink(const Code& target, Patchability patchable) { 512 void Assembler::BranchLink(const Code& target, Patchability patchable) {
513 ASSERT(!in_delay_slot_); 513 ASSERT(!in_delay_slot_);
514 const int32_t offset = ObjectPool::element_offset( 514 const int32_t offset = ObjectPool::element_offset(
515 object_pool_wrapper_.FindObject(target, patchable)); 515 object_pool_wrapper_.FindObject(target, patchable));
516 LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag); 516 LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag);
517 lw(T9, FieldAddress(CODE_REG, Code::entry_point_offset())); 517 lw(T9, FieldAddress(CODE_REG, Code::entry_point_offset()));
518 jalr(T9); 518 jalr(T9);
519 if (patchable == kPatchable) { 519 if (patchable == kPatchable) {
520 delay_slot_available_ = false; // CodePatcher expects a nop. 520 delay_slot_available_ = false; // CodePatcher expects a nop.
521 } 521 }
522 } 522 }
523 523
524 524
525 void Assembler::BranchLink(const StubEntry& stub_entry, 525 void Assembler::BranchLink(const StubEntry& stub_entry,
526 Patchability patchable) { 526 Patchability patchable) {
527 BranchLink(Code::Handle(stub_entry.code()), patchable); 527 BranchLink(Code::ZoneHandle(stub_entry.code()), patchable);
528 } 528 }
529 529
530 530
531 void Assembler::BranchLinkPatchable(const StubEntry& stub_entry) { 531 void Assembler::BranchLinkPatchable(const StubEntry& stub_entry) {
532 BranchLink(Code::Handle(stub_entry.code()), kPatchable); 532 BranchLink(Code::ZoneHandle(stub_entry.code()), kPatchable);
533 } 533 }
534 534
535 535
536 void Assembler::BranchLinkToRuntime() { 536 void Assembler::BranchLinkToRuntime() {
537 lw(T9, Address(THR, Thread::call_to_runtime_entry_point_offset())); 537 lw(T9, Address(THR, Thread::call_to_runtime_entry_point_offset()));
538 lw(CODE_REG, Address(THR, Thread::call_to_runtime_stub_offset())); 538 lw(CODE_REG, Address(THR, Thread::call_to_runtime_stub_offset()));
539 jalr(T9); 539 jalr(T9);
540 } 540 }
541 541
542 542
543 void Assembler::BranchLinkWithEquivalence(const StubEntry& stub_entry, 543 void Assembler::BranchLinkWithEquivalence(const StubEntry& stub_entry,
544 const Object& equivalence) { 544 const Object& equivalence) {
545 const Code& target = Code::Handle(stub_entry.code()); 545 const Code& target = Code::ZoneHandle(stub_entry.code());
546 ASSERT(!in_delay_slot_); 546 ASSERT(!in_delay_slot_);
547 const int32_t offset = ObjectPool::element_offset( 547 const int32_t offset = ObjectPool::element_offset(
548 object_pool_wrapper_.FindObject(target, equivalence)); 548 object_pool_wrapper_.FindObject(target, equivalence));
549 LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag); 549 LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag);
550 lw(T9, FieldAddress(CODE_REG, Code::entry_point_offset())); 550 lw(T9, FieldAddress(CODE_REG, Code::entry_point_offset()));
551 jalr(T9); 551 jalr(T9);
552 delay_slot_available_ = false; // CodePatcher expects a nop. 552 delay_slot_available_ = false; // CodePatcher expects a nop.
553 } 553 }
554 554
555 555
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
1362 Label stop; 1362 Label stop;
1363 b(&stop); 1363 b(&stop);
1364 Emit(reinterpret_cast<int32_t>(message)); 1364 Emit(reinterpret_cast<int32_t>(message));
1365 Bind(&stop); 1365 Bind(&stop);
1366 break_(Instr::kStopMessageCode); 1366 break_(Instr::kStopMessageCode);
1367 } 1367 }
1368 1368
1369 } // namespace dart 1369 } // namespace dart
1370 1370
1371 #endif // defined TARGET_ARCH_MIPS 1371 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm64.cc ('k') | runtime/vm/assembler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698