| 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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 379 |
| 380 friend class Assembler; | 380 friend class Assembler; |
| 381 friend class MacroAssembler; | 381 friend class MacroAssembler; |
| 382 }; | 382 }; |
| 383 | 383 |
| 384 | 384 |
| 385 // On MIPS we have only one adressing mode with base_reg + offset. | 385 // On MIPS we have only one adressing mode with base_reg + offset. |
| 386 // Class MemOperand represents a memory operand in load and store instructions. | 386 // Class MemOperand represents a memory operand in load and store instructions. |
| 387 class MemOperand : public Operand { | 387 class MemOperand : public Operand { |
| 388 public: | 388 public: |
| 389 // Immediate value attached to offset. |
| 390 enum OffsetAddend { |
| 391 offset_minus_one = -1, |
| 392 offset_zero = 0 |
| 393 }; |
| 394 |
| 389 explicit MemOperand(Register rn, int32_t offset = 0); | 395 explicit MemOperand(Register rn, int32_t offset = 0); |
| 396 explicit MemOperand(Register rn, int32_t unit, int32_t multiplier, |
| 397 OffsetAddend offset_addend = offset_zero); |
| 390 int32_t offset() const { return offset_; } | 398 int32_t offset() const { return offset_; } |
| 391 | 399 |
| 392 bool OffsetIsInt16Encodable() const { | 400 bool OffsetIsInt16Encodable() const { |
| 393 return is_int16(offset_); | 401 return is_int16(offset_); |
| 394 } | 402 } |
| 395 | 403 |
| 396 private: | 404 private: |
| 397 int32_t offset_; | 405 int32_t offset_; |
| 398 | 406 |
| 399 friend class Assembler; | 407 friend class Assembler; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 // This sets the branch destination (which gets loaded at the call address). | 538 // This sets the branch destination (which gets loaded at the call address). |
| 531 // This is for calls and branches within generated code. The serializer | 539 // This is for calls and branches within generated code. The serializer |
| 532 // has already deserialized the lui/ori instructions etc. | 540 // has already deserialized the lui/ori instructions etc. |
| 533 inline static void deserialization_set_special_target_at( | 541 inline static void deserialization_set_special_target_at( |
| 534 Address instruction_payload, Address target) { | 542 Address instruction_payload, Address target) { |
| 535 set_target_address_at( | 543 set_target_address_at( |
| 536 instruction_payload - kInstructionsFor32BitConstant * kInstrSize, | 544 instruction_payload - kInstructionsFor32BitConstant * kInstrSize, |
| 537 target); | 545 target); |
| 538 } | 546 } |
| 539 | 547 |
| 540 // This sets the branch destination. | |
| 541 // This is for calls and branches to runtime code. | |
| 542 inline static void set_external_target_at(Address instruction_payload, | |
| 543 Address target) { | |
| 544 set_target_address_at(instruction_payload, target); | |
| 545 } | |
| 546 | |
| 547 // Size of an instruction. | 548 // Size of an instruction. |
| 548 static const int kInstrSize = sizeof(Instr); | 549 static const int kInstrSize = sizeof(Instr); |
| 549 | 550 |
| 550 // Difference between address of current opcode and target address offset. | 551 // Difference between address of current opcode and target address offset. |
| 551 static const int kBranchPCOffset = 4; | 552 static const int kBranchPCOffset = 4; |
| 552 | 553 |
| 553 // Here we are patching the address in the LUI/ORI instruction pair. | 554 // Here we are patching the address in the LUI/ORI instruction pair. |
| 554 // These values are used in the serialization process and must be zero for | 555 // These values are used in the serialization process and must be zero for |
| 555 // MIPS platform, as Code, Embedded Object or External-reference pointers | 556 // MIPS platform, as Code, Embedded Object or External-reference pointers |
| 556 // are split across two consecutive instructions and don't exist separately | 557 // are split across two consecutive instructions and don't exist separately |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 void lw(Register rd, const MemOperand& rs); | 712 void lw(Register rd, const MemOperand& rs); |
| 712 void lwl(Register rd, const MemOperand& rs); | 713 void lwl(Register rd, const MemOperand& rs); |
| 713 void lwr(Register rd, const MemOperand& rs); | 714 void lwr(Register rd, const MemOperand& rs); |
| 714 void sb(Register rd, const MemOperand& rs); | 715 void sb(Register rd, const MemOperand& rs); |
| 715 void sh(Register rd, const MemOperand& rs); | 716 void sh(Register rd, const MemOperand& rs); |
| 716 void sw(Register rd, const MemOperand& rs); | 717 void sw(Register rd, const MemOperand& rs); |
| 717 void swl(Register rd, const MemOperand& rs); | 718 void swl(Register rd, const MemOperand& rs); |
| 718 void swr(Register rd, const MemOperand& rs); | 719 void swr(Register rd, const MemOperand& rs); |
| 719 | 720 |
| 720 | 721 |
| 722 //----------------Prefetch-------------------- |
| 723 |
| 724 void pref(int32_t hint, const MemOperand& rs); |
| 725 |
| 726 |
| 721 //-------------Misc-instructions-------------- | 727 //-------------Misc-instructions-------------- |
| 722 | 728 |
| 723 // Break / Trap instructions. | 729 // Break / Trap instructions. |
| 724 void break_(uint32_t code, bool break_as_stop = false); | 730 void break_(uint32_t code, bool break_as_stop = false); |
| 725 void stop(const char* msg, uint32_t code = kMaxStopCode); | 731 void stop(const char* msg, uint32_t code = kMaxStopCode); |
| 726 void tge(Register rs, Register rt, uint16_t code); | 732 void tge(Register rs, Register rt, uint16_t code); |
| 727 void tgeu(Register rs, Register rt, uint16_t code); | 733 void tgeu(Register rs, Register rt, uint16_t code); |
| 728 void tlt(Register rs, Register rt, uint16_t code); | 734 void tlt(Register rs, Register rt, uint16_t code); |
| 729 void tltu(Register rs, Register rt, uint16_t code); | 735 void tltu(Register rs, Register rt, uint16_t code); |
| 730 void teq(Register rs, Register rt, uint16_t code); | 736 void teq(Register rs, Register rt, uint16_t code); |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 class EnsureSpace BASE_EMBEDDED { | 1247 class EnsureSpace BASE_EMBEDDED { |
| 1242 public: | 1248 public: |
| 1243 explicit EnsureSpace(Assembler* assembler) { | 1249 explicit EnsureSpace(Assembler* assembler) { |
| 1244 assembler->CheckBuffer(); | 1250 assembler->CheckBuffer(); |
| 1245 } | 1251 } |
| 1246 }; | 1252 }; |
| 1247 | 1253 |
| 1248 } } // namespace v8::internal | 1254 } } // namespace v8::internal |
| 1249 | 1255 |
| 1250 #endif // V8_ARM_ASSEMBLER_MIPS_H_ | 1256 #endif // V8_ARM_ASSEMBLER_MIPS_H_ |
| OLD | NEW |