OLD | NEW |
---|---|
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
432 // Return true if this is a register operand. | 432 // Return true if this is a register operand. |
433 INLINE(bool is_reg() const); | 433 INLINE(bool is_reg() const); |
434 | 434 |
435 inline int32_t immediate() const { | 435 inline int32_t immediate() const { |
436 DCHECK(!is_reg()); | 436 DCHECK(!is_reg()); |
437 return imm32_; | 437 return imm32_; |
438 } | 438 } |
439 | 439 |
440 Register rm() const { return rm_; } | 440 Register rm() const { return rm_; } |
441 | 441 |
442 RelocInfo::Mode rmode() const { return rmode_; } | |
443 | |
442 private: | 444 private: |
443 Register rm_; | 445 Register rm_; |
444 int32_t imm32_; // Valid if rm_ == no_reg. | 446 int32_t imm32_; // Valid if rm_ == no_reg. |
445 RelocInfo::Mode rmode_; | 447 RelocInfo::Mode rmode_; |
446 | 448 |
447 friend class Assembler; | 449 friend class Assembler; |
448 friend class MacroAssembler; | 450 friend class MacroAssembler; |
449 }; | 451 }; |
450 | 452 |
451 | 453 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
587 inline static Address target_address_from_return_address(Address pc); | 589 inline static Address target_address_from_return_address(Address pc); |
588 | 590 |
589 static void QuietNaN(HeapObject* nan); | 591 static void QuietNaN(HeapObject* nan); |
590 | 592 |
591 // This sets the branch destination (which gets loaded at the call address). | 593 // This sets the branch destination (which gets loaded at the call address). |
592 // This is for calls and branches within generated code. The serializer | 594 // This is for calls and branches within generated code. The serializer |
593 // has already deserialized the lui/ori instructions etc. | 595 // has already deserialized the lui/ori instructions etc. |
594 inline static void deserialization_set_special_target_at( | 596 inline static void deserialization_set_special_target_at( |
595 Isolate* isolate, Address instruction_payload, Code* code, | 597 Isolate* isolate, Address instruction_payload, Code* code, |
596 Address target) { | 598 Address target) { |
597 set_target_address_at( | 599 if (IsMipsArchVariant(kMips32r6)) { |
598 isolate, | 600 // On R6 the address location is shifted by one instruction |
599 instruction_payload - kInstructionsFor32BitConstant * kInstrSize, code, | 601 set_target_address_at( |
600 target); | 602 isolate, |
603 instruction_payload - | |
604 (kInstructionsFor32BitConstant - 1) * kInstrSize, | |
dusan.simicic
2017/04/24 14:48:56
If you changed this constant expression for R6 in
| |
605 code, target); | |
606 } else { | |
607 set_target_address_at( | |
608 isolate, | |
609 instruction_payload - kInstructionsFor32BitConstant * kInstrSize, | |
610 code, target); | |
611 } | |
601 } | 612 } |
602 | 613 |
603 // This sets the internal reference at the pc. | 614 // This sets the internal reference at the pc. |
604 inline static void deserialization_set_target_internal_reference_at( | 615 inline static void deserialization_set_target_internal_reference_at( |
605 Isolate* isolate, Address pc, Address target, | 616 Isolate* isolate, Address pc, Address target, |
606 RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE); | 617 RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE); |
607 | 618 |
608 // Size of an instruction. | 619 // Size of an instruction. |
609 static constexpr int kInstrSize = sizeof(Instr); | 620 static constexpr int kInstrSize = sizeof(Instr); |
610 | 621 |
(...skipping 10 matching lines...) Expand all Loading... | |
621 | 632 |
622 // Number of consecutive instructions used to store 32bit constant. This | 633 // Number of consecutive instructions used to store 32bit constant. This |
623 // constant is used in RelocInfo::target_address_address() function to tell | 634 // constant is used in RelocInfo::target_address_address() function to tell |
624 // serializer address of the instruction that follows LUI/ORI instruction | 635 // serializer address of the instruction that follows LUI/ORI instruction |
625 // pair. | 636 // pair. |
626 static constexpr int kInstructionsFor32BitConstant = 2; | 637 static constexpr int kInstructionsFor32BitConstant = 2; |
627 | 638 |
628 // Distance between the instruction referring to the address of the call | 639 // Distance between the instruction referring to the address of the call |
629 // target and the return address. | 640 // target and the return address. |
630 #ifdef _MIPS_ARCH_MIPS32R6 | 641 #ifdef _MIPS_ARCH_MIPS32R6 |
631 static constexpr int kCallTargetAddressOffset = 3 * kInstrSize; | 642 static constexpr int kCallTargetAddressOffset = 2 * kInstrSize; |
632 #else | 643 #else |
633 static constexpr int kCallTargetAddressOffset = 4 * kInstrSize; | 644 static constexpr int kCallTargetAddressOffset = 4 * kInstrSize; |
634 #endif | 645 #endif |
635 | 646 |
636 // Distance between start of patched debug break slot and the emitted address | 647 // Distance between start of patched debug break slot and the emitted address |
637 // to jump to. | 648 // to jump to. |
638 static constexpr int kPatchDebugBreakSlotAddressOffset = 4 * kInstrSize; | 649 static constexpr int kPatchDebugBreakSlotAddressOffset = 4 * kInstrSize; |
639 | 650 |
640 // Difference between address of current opcode and value read from pc | 651 // Difference between address of current opcode and value read from pc |
641 // register. | 652 // register. |
(...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2202 public: | 2213 public: |
2203 explicit EnsureSpace(Assembler* assembler) { | 2214 explicit EnsureSpace(Assembler* assembler) { |
2204 assembler->CheckBuffer(); | 2215 assembler->CheckBuffer(); |
2205 } | 2216 } |
2206 }; | 2217 }; |
2207 | 2218 |
2208 } // namespace internal | 2219 } // namespace internal |
2209 } // namespace v8 | 2220 } // namespace v8 |
2210 | 2221 |
2211 #endif // V8_ARM_ASSEMBLER_MIPS_H_ | 2222 #endif // V8_ARM_ASSEMBLER_MIPS_H_ |
OLD | NEW |