Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef VM_ASSEMBLER_MIPS_H_ | 5 #ifndef VM_ASSEMBLER_MIPS_H_ |
| 6 #define VM_ASSEMBLER_MIPS_H_ | 6 #define VM_ASSEMBLER_MIPS_H_ |
| 7 | 7 |
| 8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
| 9 #error Do not include assembler_mips.h directly; use assembler.h instead. | 9 #error Do not include assembler_mips.h directly; use assembler.h instead. |
| 10 #endif | 10 #endif |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 508 EmitRType(SPECIAL, rs, rt, rd, 0, XOR); | 508 EmitRType(SPECIAL, rs, rt, rd, 0, XOR); |
| 509 } | 509 } |
| 510 | 510 |
| 511 // Macros in alphabetical order. | 511 // Macros in alphabetical order. |
| 512 | 512 |
| 513 void Branch(const ExternalLabel* label) { | 513 void Branch(const ExternalLabel* label) { |
| 514 LoadImmediate(TMP, label->address()); | 514 LoadImmediate(TMP, label->address()); |
| 515 jr(TMP); | 515 jr(TMP); |
| 516 } | 516 } |
| 517 | 517 |
| 518 void BranchPatchable(const ExternalLabel* label) { | |
| 519 const uint16_t low = Utils::Low16Bits(label->address()); | |
| 520 const uint16_t high = Utils::High16Bits(label->address()); | |
| 521 lui(TMP, Immediate(high)); | |
| 522 ori(TMP, TMP, Immediate(low)); | |
| 523 jr(TMP); | |
| 524 } | |
|
regis
2013/04/02 20:16:03
Ah, it is back :-)
But you should make the delay s
zra
2013/04/02 20:24:40
Done.
| |
| 525 | |
| 518 void BranchLink(const ExternalLabel* label) { | 526 void BranchLink(const ExternalLabel* label) { |
| 519 LoadImmediate(TMP, label->address()); | 527 LoadImmediate(TMP, label->address()); |
| 520 jalr(TMP); | 528 jalr(TMP); |
| 521 } | 529 } |
| 522 | 530 |
| 523 void BranchLinkPatchable(const ExternalLabel* label) { | 531 void BranchLinkPatchable(const ExternalLabel* label) { |
| 524 const int32_t offset = | 532 const int32_t offset = |
| 525 Array::data_offset() + 4*AddExternalLabel(label) - kHeapObjectTag; | 533 Array::data_offset() + 4*AddExternalLabel(label) - kHeapObjectTag; |
| 526 LoadWordFromPoolOffset(TMP, offset); | 534 LoadWordFromPoolOffset(TMP, offset); |
| 527 jalr(TMP); | 535 jalr(TMP); |
|
regis
2013/04/02 20:16:03
Same here. Make delay slot unavailable.
zra
2013/04/02 20:24:40
Done.
| |
| 528 } | 536 } |
| 529 | 537 |
| 530 // If the signed value in rs is less than value, rd is 1, and 0 otherwise. | 538 // If the signed value in rs is less than value, rd is 1, and 0 otherwise. |
| 531 void LessThanSImmediate(Register rd, Register rs, int32_t value) { | 539 void LessThanSImmediate(Register rd, Register rs, int32_t value) { |
| 532 LoadImmediate(TMP, value); | 540 LoadImmediate(TMP, value); |
| 533 slt(rd, rs, TMP); | 541 slt(rd, rs, TMP); |
| 534 } | 542 } |
| 535 | 543 |
| 536 // If the unsigned value in rs is less than value, rd is 1, and 0 otherwise. | 544 // If the unsigned value in rs is less than value, rd is 1, and 0 otherwise. |
| 537 void LessThanUImmediate(Register rd, Register rs, uint32_t value) { | 545 void LessThanUImmediate(Register rd, Register rs, uint32_t value) { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 717 delay_slot_available_ = true; | 725 delay_slot_available_ = true; |
| 718 } | 726 } |
| 719 | 727 |
| 720 DISALLOW_ALLOCATION(); | 728 DISALLOW_ALLOCATION(); |
| 721 DISALLOW_COPY_AND_ASSIGN(Assembler); | 729 DISALLOW_COPY_AND_ASSIGN(Assembler); |
| 722 }; | 730 }; |
| 723 | 731 |
| 724 } // namespace dart | 732 } // namespace dart |
| 725 | 733 |
| 726 #endif // VM_ASSEMBLER_MIPS_H_ | 734 #endif // VM_ASSEMBLER_MIPS_H_ |
| OLD | NEW |