| 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 // The high 8 bits are set to zero. | 546 // The high 8 bits are set to zero. |
| 547 void label_at_put(Label* L, int at_offset); | 547 void label_at_put(Label* L, int at_offset); |
| 548 | 548 |
| 549 // Read/Modify the code target address in the branch/call instruction at pc. | 549 // Read/Modify the code target address in the branch/call instruction at pc. |
| 550 static Address target_address_at(Address pc); | 550 static Address target_address_at(Address pc); |
| 551 static void set_target_address_at(Address pc, Address target); | 551 static void set_target_address_at(Address pc, Address target); |
| 552 | 552 |
| 553 static void JumpLabelToJumpRegister(Address pc); | 553 static void JumpLabelToJumpRegister(Address pc); |
| 554 | 554 |
| 555 // This sets the branch destination (which gets loaded at the call address). | 555 // This sets the branch destination (which gets loaded at the call address). |
| 556 // This is for calls and branches within generated code. | 556 // This is for calls and branches within generated code. The serializer |
| 557 inline static void set_target_at(Address instruction_payload, | 557 // has already deserialized the lui/ori instructions etc. |
| 558 Address target) { | 558 inline static void deserialization_set_special_target_at( |
| 559 set_target_address_at(instruction_payload, target); | 559 Address instruction_payload, Address target) { |
| 560 set_target_address_at( |
| 561 instruction_payload - kInstructionsFor32BitConstant * kInstrSize, |
| 562 target); |
| 560 } | 563 } |
| 561 | 564 |
| 562 // This sets the branch destination. | 565 // This sets the branch destination. |
| 563 // This is for calls and branches to runtime code. | 566 // This is for calls and branches to runtime code. |
| 564 inline static void set_external_target_at(Address instruction_payload, | 567 inline static void set_external_target_at(Address instruction_payload, |
| 565 Address target) { | 568 Address target) { |
| 566 set_target_address_at(instruction_payload, target); | 569 set_target_address_at(instruction_payload, target); |
| 567 } | 570 } |
| 568 | 571 |
| 569 // Size of an instruction. | 572 // Size of an instruction. |
| 570 static const int kInstrSize = sizeof(Instr); | 573 static const int kInstrSize = sizeof(Instr); |
| 571 | 574 |
| 572 // Difference between address of current opcode and target address offset. | 575 // Difference between address of current opcode and target address offset. |
| 573 static const int kBranchPCOffset = 4; | 576 static const int kBranchPCOffset = 4; |
| 574 | 577 |
| 575 // Here we are patching the address in the LUI/ORI instruction pair. | 578 // Here we are patching the address in the LUI/ORI instruction pair. |
| 576 // These values are used in the serialization process and must be zero for | 579 // These values are used in the serialization process and must be zero for |
| 577 // MIPS platform, as Code, Embedded Object or External-reference pointers | 580 // MIPS platform, as Code, Embedded Object or External-reference pointers |
| 578 // are split across two consecutive instructions and don't exist separately | 581 // are split across two consecutive instructions and don't exist separately |
| 579 // in the code, so the serializer should not step forwards in memory after | 582 // in the code, so the serializer should not step forwards in memory after |
| 580 // a target is resolved and written. | 583 // a target is resolved and written. |
| 581 static const int kCallTargetSize = 0 * kInstrSize; | 584 static const int kSpecialTargetSize = 0; |
| 582 static const int kExternalTargetSize = 0 * kInstrSize; | |
| 583 | 585 |
| 584 // Number of consecutive instructions used to store 32bit constant. | 586 // Number of consecutive instructions used to store 32bit constant. |
| 585 // Before jump-optimizations, this constant was used in | 587 // Before jump-optimizations, this constant was used in |
| 586 // RelocInfo::target_address_address() function to tell serializer address of | 588 // RelocInfo::target_address_address() function to tell serializer address of |
| 587 // the instruction that follows LUI/ORI instruction pair. Now, with new jump | 589 // the instruction that follows LUI/ORI instruction pair. Now, with new jump |
| 588 // optimization, where jump-through-register instruction that usually | 590 // optimization, where jump-through-register instruction that usually |
| 589 // follows LUI/ORI pair is substituted with J/JAL, this constant equals | 591 // follows LUI/ORI pair is substituted with J/JAL, this constant equals |
| 590 // to 3 instructions (LUI+ORI+J/JAL/JR/JALR). | 592 // to 3 instructions (LUI+ORI+J/JAL/JR/JALR). |
| 591 static const int kInstructionsFor32BitConstant = 3; | 593 static const int kInstructionsFor32BitConstant = 3; |
| 592 | 594 |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1257 class EnsureSpace BASE_EMBEDDED { | 1259 class EnsureSpace BASE_EMBEDDED { |
| 1258 public: | 1260 public: |
| 1259 explicit EnsureSpace(Assembler* assembler) { | 1261 explicit EnsureSpace(Assembler* assembler) { |
| 1260 assembler->CheckBuffer(); | 1262 assembler->CheckBuffer(); |
| 1261 } | 1263 } |
| 1262 }; | 1264 }; |
| 1263 | 1265 |
| 1264 } } // namespace v8::internal | 1266 } } // namespace v8::internal |
| 1265 | 1267 |
| 1266 #endif // V8_ARM_ASSEMBLER_MIPS_H_ | 1268 #endif // V8_ARM_ASSEMBLER_MIPS_H_ |
| OLD | NEW |