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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 bool Operand::is_reg() const { | 76 bool Operand::is_reg() const { |
77 return rm_.is_valid(); | 77 return rm_.is_valid(); |
78 } | 78 } |
79 | 79 |
80 | 80 |
81 | 81 |
82 // ----------------------------------------------------------------------------- | 82 // ----------------------------------------------------------------------------- |
83 // RelocInfo. | 83 // RelocInfo. |
84 | 84 |
85 void RelocInfo::apply(intptr_t delta) { | 85 void RelocInfo::apply(intptr_t delta) { |
| 86 if (IsCodeTarget(rmode_)) { |
| 87 uint32_t scope1 = (uint32_t) target_address() & ~kImm28Mask; |
| 88 uint32_t scope2 = reinterpret_cast<uint32_t>(pc_) & ~kImm28Mask; |
| 89 |
| 90 if (scope1 != scope2) { |
| 91 Assembler::JumpLabelToJumpRegister(pc_); |
| 92 } |
| 93 } |
86 if (IsInternalReference(rmode_)) { | 94 if (IsInternalReference(rmode_)) { |
87 // Absolute code pointer inside code object moves with the code object. | 95 // Absolute code pointer inside code object moves with the code object. |
88 byte* p = reinterpret_cast<byte*>(pc_); | 96 byte* p = reinterpret_cast<byte*>(pc_); |
89 int count = Assembler::RelocateInternalReference(p, delta); | 97 int count = Assembler::RelocateInternalReference(p, delta); |
90 CPU::FlushICache(p, count * sizeof(uint32_t)); | 98 CPU::FlushICache(p, count * sizeof(uint32_t)); |
91 } | 99 } |
92 } | 100 } |
93 | 101 |
94 | 102 |
95 Address RelocInfo::target_address() { | 103 Address RelocInfo::target_address() { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 *call_object_address() = target; | 219 *call_object_address() = target; |
212 } | 220 } |
213 | 221 |
214 | 222 |
215 bool RelocInfo::IsPatchedReturnSequence() { | 223 bool RelocInfo::IsPatchedReturnSequence() { |
216 Instr instr0 = Assembler::instr_at(pc_); | 224 Instr instr0 = Assembler::instr_at(pc_); |
217 Instr instr1 = Assembler::instr_at(pc_ + 1 * Assembler::kInstrSize); | 225 Instr instr1 = Assembler::instr_at(pc_ + 1 * Assembler::kInstrSize); |
218 Instr instr2 = Assembler::instr_at(pc_ + 2 * Assembler::kInstrSize); | 226 Instr instr2 = Assembler::instr_at(pc_ + 2 * Assembler::kInstrSize); |
219 bool patched_return = ((instr0 & kOpcodeMask) == LUI && | 227 bool patched_return = ((instr0 & kOpcodeMask) == LUI && |
220 (instr1 & kOpcodeMask) == ORI && | 228 (instr1 & kOpcodeMask) == ORI && |
221 (instr2 & kOpcodeMask) == SPECIAL && | 229 ((instr2 & kOpcodeMask) == JAL || |
222 (instr2 & kFunctionFieldMask) == JALR); | 230 ((instr2 & kOpcodeMask) == SPECIAL && |
| 231 (instr2 & kFunctionFieldMask) == JALR))); |
223 return patched_return; | 232 return patched_return; |
224 } | 233 } |
225 | 234 |
226 | 235 |
227 bool RelocInfo::IsPatchedDebugBreakSlotSequence() { | 236 bool RelocInfo::IsPatchedDebugBreakSlotSequence() { |
228 Instr current_instr = Assembler::instr_at(pc_); | 237 Instr current_instr = Assembler::instr_at(pc_); |
229 return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP); | 238 return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP); |
230 } | 239 } |
231 | 240 |
232 | 241 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 } | 318 } |
310 *reinterpret_cast<Instr*>(pc_) = x; | 319 *reinterpret_cast<Instr*>(pc_) = x; |
311 pc_ += kInstrSize; | 320 pc_ += kInstrSize; |
312 CheckTrampolinePoolQuick(); | 321 CheckTrampolinePoolQuick(); |
313 } | 322 } |
314 | 323 |
315 | 324 |
316 } } // namespace v8::internal | 325 } } // namespace v8::internal |
317 | 326 |
318 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ | 327 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ |
OLD | NEW |