Commit 4fdac75d authored by machenbach's avatar machenbach Committed by Commit bot

Revert of MIPS: Fix 'Assembler support for internal references.' (patchset #1...

Revert of MIPS: Fix 'Assembler support for internal references.' (patchset #1 id:1 of https://codereview.chromium.org/922043005/)

Reason for revert:
Breaks http://build.chromium.org/p/chromium.fyi/builders/Android%20MIPS%20Builder%20(dbg)

Original issue's description:
> MIPS: Fix 'Assembler support for internal references.'
>
> Added new INTERNAL_REFERENCE_ENCODED RelocInfo type to differentiate MIPS existing use of internal references in instructions from the new raw pointer reference needed for dd(Label*).
>
> BUG=
> TEST=cctest/test-assembler-mips/jump_tables1, cctest/test-assembler-mips/jump_tables2, cctest/test-assembler-mips/jump_tables3, cctest/test-run-machops/RunSwitch1
>
> Committed: https://crrev.com/244ac6de8316259bc5878480e05348a369c08e2f
> Cr-Commit-Position: refs/heads/master@{#26651}

TBR=danno@chromium.org,bmeurer@chromium.org,jkummerow@chromium.org,paul.lind@imgtec.com,gergely.kis@imgtec.com,akos.palfi@imgtec.com,dusan.milosavljevic@imgtec.com,balazs.kilvady@imgtec.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/934623003

Cr-Commit-Position: refs/heads/master@{#26675}
parent 90734ca1
......@@ -393,11 +393,6 @@ class RelocInfo {
NONE64, // never recorded 64-bit value
CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by
// code aging.
// Encoded internal reference, used only on MIPS and MIPS64.
// Re-uses previous ARM-only encoding, to fit in RealRelocMode space.
INTERNAL_REFERENCE_ENCODED = CONST_POOL,
FIRST_REAL_RELOC_MODE = CODE_TARGET,
LAST_REAL_RELOC_MODE = VENEER_POOL,
FIRST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE,
......@@ -470,9 +465,6 @@ class RelocInfo {
static inline bool IsInternalReference(Mode mode) {
return mode == INTERNAL_REFERENCE;
}
static inline bool IsInternalReferenceEncoded(Mode mode) {
return mode == INTERNAL_REFERENCE_ENCODED;
}
static inline bool IsDebugBreakSlot(Mode mode) {
return mode == DEBUG_BREAK_SLOT;
}
......
......@@ -126,10 +126,10 @@ void RelocInfo::apply(intptr_t delta, ICacheFlushMode icache_flush_mode) {
Assembler::JumpLabelToJumpRegister(pc_);
}
}
if (IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_)) {
if (IsInternalReference(rmode_)) {
// Absolute code pointer inside code object moves with the code object.
byte* p = reinterpret_cast<byte*>(pc_);
int count = Assembler::RelocateInternalReference(rmode_, p, delta);
int count = Assembler::RelocateInternalReference(p, delta);
CpuFeatures::FlushICache(p, count * sizeof(uint32_t));
}
}
......
This diff is collapsed.
......@@ -38,8 +38,6 @@
#include <stdio.h>
#include <tr1/unordered_set>
#include "src/assembler.h"
#include "src/mips/constants-mips.h"
#include "src/serialize.h"
......@@ -1023,8 +1021,7 @@ class Assembler : public AssemblerBase {
void RecordDeoptReason(const int reason, const int raw_position);
static int RelocateInternalReference(RelocInfo::Mode rmode, byte* pc,
intptr_t pc_delta);
static int RelocateInternalReference(byte* pc, intptr_t pc_delta);
// Writes a single byte or word of data in the code stream. Used for
// inline tables, e.g., jump-tables.
......@@ -1129,10 +1126,10 @@ class Assembler : public AssemblerBase {
int32_t buffer_space() const { return reloc_info_writer.pos() - pc_; }
// Decode branch instruction at pos and return branch target pos.
int target_at(int32_t pos, bool is_internal);
int target_at(int32_t pos);
// Patch branch instruction at pos to branch to given branch target pos.
void target_at_put(int32_t pos, int32_t target_pos, bool is_internal);
void target_at_put(int32_t pos, int32_t target_pos);
// Say if we need to relocate with this mode.
bool MustUseReg(RelocInfo::Mode rmode);
......@@ -1301,7 +1298,7 @@ class Assembler : public AssemblerBase {
// Labels.
void print(Label* L);
void bind_to(Label* L, int pos);
void next(Label* L, bool is_internal);
void next(Label* L);
// One trampoline consists of:
// - space for trampoline slots,
......@@ -1366,10 +1363,6 @@ class Assembler : public AssemblerBase {
static const int kMaxBranchOffset = (1 << (18 - 1)) - 1;
static const int kInvalidSlotPos = -1;
// Internal reference positions, required for unbounded internal reference
// labels.
std::tr1::unordered_set<int> internal_reference_positions_;
Trampoline trampoline_;
bool internal_trampoline_exception_;
......
......@@ -339,6 +339,7 @@ enum Opcode {
DADDI = ((3 << 3) + 0) << kOpcodeShift, // This is also BNEC.
SPECIAL2 = ((3 << 3) + 4) << kOpcodeShift,
LABEL = ((3 << 3) + 5) << kOpcodeShift,
SPECIAL3 = ((3 << 3) + 7) << kOpcodeShift,
LB = ((4 << 3) + 0) << kOpcodeShift,
......
......@@ -3087,7 +3087,7 @@ void MacroAssembler::J(Label* L, BranchDelaySlot bdslot) {
{ BlockGrowBufferScope block_buf_growth(this);
// Buffer growth (and relocation) must be blocked for internal references
// until associated instructions are emitted and available to be patched.
RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED);
RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE);
j(imm28);
}
// Emit a nop in the branch delay slot if required.
......@@ -3104,7 +3104,7 @@ void MacroAssembler::Jr(Label* L, BranchDelaySlot bdslot) {
{ BlockGrowBufferScope block_buf_growth(this);
// Buffer growth (and relocation) must be blocked for internal references
// until associated instructions are emitted and available to be patched.
RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED);
RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE);
lui(at, (imm32 & kHiMask) >> kLuiShift);
ori(at, at, (imm32 & kImm16Mask));
}
......@@ -3124,7 +3124,7 @@ void MacroAssembler::Jalr(Label* L, BranchDelaySlot bdslot) {
{ BlockGrowBufferScope block_buf_growth(this);
// Buffer growth (and relocation) must be blocked for internal references
// until associated instructions are emitted and available to be patched.
RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED);
RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE);
lui(at, (imm32 & kHiMask) >> kLuiShift);
ori(at, at, (imm32 & kImm16Mask));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment