Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Unified Diff: src/mips/assembler-mips-inl.h

Issue 1025453003: MIPS: Fix 'MIPS: Serializer: serialize internal references via object visitor.' (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comment. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips/assembler-mips.h ('k') | src/mips64/assembler-mips64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/assembler-mips-inl.h
diff --git a/src/mips/assembler-mips-inl.h b/src/mips/assembler-mips-inl.h
index ce3d4767370a434407ee68d498b025359db068cd..7b6b3f8c76067b658aa67ff1f3edde6083ea6b45 100644
--- a/src/mips/assembler-mips-inl.h
+++ b/src/mips/assembler-mips-inl.h
@@ -200,23 +200,34 @@ Address Assembler::break_address_from_return_address(Address pc) {
}
+void Assembler::set_target_internal_reference_encoded_at(Address pc,
+ Address target) {
+ // Encoded internal references are lui/ori load of 32-bit abolute address.
+ Instr instr_lui = Assembler::instr_at(pc + 0 * Assembler::kInstrSize);
+ Instr instr_ori = Assembler::instr_at(pc + 1 * Assembler::kInstrSize);
+ DCHECK(Assembler::IsLui(instr_lui));
+ DCHECK(Assembler::IsOri(instr_ori));
+ instr_lui &= ~kImm16Mask;
+ instr_ori &= ~kImm16Mask;
+ int32_t imm = reinterpret_cast<int32_t>(target);
+ DCHECK((imm & 3) == 0);
+ Assembler::instr_at_put(pc + 0 * Assembler::kInstrSize,
+ instr_lui | ((imm >> kLuiShift) & kImm16Mask));
+ Assembler::instr_at_put(pc + 1 * Assembler::kInstrSize,
+ instr_ori | (imm & kImm16Mask));
+
+ // Currently used only by deserializer, and all code will be flushed
+ // after complete deserialization, no need to flush on each reference.
+}
+
+
void Assembler::deserialization_set_target_internal_reference_at(
- Address pc, Address target) {
- if (IsLui(instr_at(pc))) {
- // Encoded internal references are lui/ori load of 32-bit abolute address.
- Instr instr_lui = Assembler::instr_at(pc + 0 * Assembler::kInstrSize);
- Instr instr_ori = Assembler::instr_at(pc + 1 * Assembler::kInstrSize);
- DCHECK(Assembler::IsLui(instr_lui));
- DCHECK(Assembler::IsOri(instr_ori));
- instr_lui &= ~kImm16Mask;
- instr_ori &= ~kImm16Mask;
- int32_t imm = reinterpret_cast<int32_t>(target);
- DCHECK((imm & 3) == 0);
- Assembler::instr_at_put(pc + 0 * Assembler::kInstrSize,
- instr_lui | ((imm >> kLuiShift) & kImm16Mask));
- Assembler::instr_at_put(pc + 1 * Assembler::kInstrSize,
- instr_ori | (imm & kImm16Mask));
+ Address pc, Address target, RelocInfo::Mode mode) {
+ if (mode == RelocInfo::INTERNAL_REFERENCE_ENCODED) {
+ DCHECK(IsLui(instr_at(pc)));
+ set_target_internal_reference_encoded_at(pc, target);
} else {
+ DCHECK(mode == RelocInfo::INTERNAL_REFERENCE);
Memory::Address_at(pc) = target;
}
}
@@ -397,19 +408,7 @@ void RelocInfo::WipeOut() {
if (IsInternalReference(rmode_)) {
Memory::Address_at(pc_) = NULL;
} else if (IsInternalReferenceEncoded(rmode_)) {
- Instr instr_lui = Assembler::instr_at(pc_ + 0 * Assembler::kInstrSize);
- Instr instr_ori = Assembler::instr_at(pc_ + 1 * Assembler::kInstrSize);
- DCHECK(Assembler::IsLui(instr_lui));
- DCHECK(Assembler::IsOri(instr_ori));
- instr_lui &= ~kImm16Mask;
- instr_ori &= ~kImm16Mask;
- int32_t imm = 0;
- Assembler::instr_at_put(pc_ + 0 * Assembler::kInstrSize,
- instr_lui | ((imm >> kLuiShift) & kImm16Mask));
- Assembler::instr_at_put(pc_ + 1 * Assembler::kInstrSize,
- instr_ori | (imm & kImm16Mask));
- // Currently used only by deserializer, and all code will be flushed
- // after complete deserialization, no need to flush on each reference.
+ Assembler::set_target_internal_reference_encoded_at(pc_, nullptr);
} else {
Assembler::set_target_address_at(pc_, host_, NULL);
}
« no previous file with comments | « src/mips/assembler-mips.h ('k') | src/mips64/assembler-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698