提交 8862f1b8 编写于 作者: T twisti

8004548: remove unused AbstractAssembler::print(Label&)

Reviewed-by: kvn, twisti
Contributed-by: NBharadwaj Yadavalli <bharadwaj.yadavalli@oracle.com>
上级 9e163d6c
......@@ -100,34 +100,6 @@ const char* Argument::name() const {
bool AbstractAssembler::pd_check_instruction_mark() { return false; }
#endif
void MacroAssembler::print_instruction(int inst) {
const char* s;
switch (inv_op(inst)) {
default: s = "????"; break;
case call_op: s = "call"; break;
case branch_op:
switch (inv_op2(inst)) {
case fb_op2: s = "fb"; break;
case fbp_op2: s = "fbp"; break;
case br_op2: s = "br"; break;
case bp_op2: s = "bp"; break;
case cb_op2: s = "cb"; break;
case bpr_op2: {
if (is_cbcond(inst)) {
s = is_cxb(inst) ? "cxb" : "cwb";
} else {
s = "bpr";
}
break;
}
default: s = "????"; break;
}
}
::tty->print("%s", s);
}
// Patch instruction inst at offset inst_pos to refer to dest_pos
// and return the resulting instruction.
// We should have pcs, not offsets, but since all is relative, it will work out
......
......@@ -603,7 +603,6 @@ class MacroAssembler : public Assembler {
friend class Label;
protected:
static void print_instruction(int inst);
static int patched_branch(int dest_pos, int inst, int inst_pos);
static int branch_destination(int inst, int pos);
......@@ -759,9 +758,6 @@ class MacroAssembler : public Assembler {
// Required platform-specific helpers for Label::patch_instructions.
// They _shadow_ the declarations in AbstractAssembler, which are undefined.
void pd_patch_instruction(address branch, address target);
#ifndef PRODUCT
static void pd_print_patched_instruction(address branch);
#endif
// sethi Macro handles optimizations and relocations
private:
......
......@@ -43,14 +43,6 @@ inline void MacroAssembler::pd_patch_instruction(address branch, address target)
stub_inst = patched_branch(target - branch, stub_inst, 0);
}
#ifndef PRODUCT
inline void MacroAssembler::pd_print_patched_instruction(address branch) {
jint stub_inst = *(jint*) branch;
print_instruction(stub_inst);
::tty->print("%s", " (unresolved)");
}
#endif // PRODUCT
// Use the right loads/stores for the platform
inline void MacroAssembler::ld_ptr( Register s1, Register s2, Register d ) {
#ifdef _LP64
......
......@@ -126,25 +126,6 @@ class MacroAssembler: public Assembler {
}
}
#ifndef PRODUCT
static void pd_print_patched_instruction(address branch) {
const char* s;
unsigned char op = branch[0];
if (op == 0xE8) {
s = "call";
} else if (op == 0xE9 || op == 0xEB) {
s = "jmp";
} else if ((op & 0xF0) == 0x70) {
s = "jcc";
} else if (op == 0x0F) {
s = "jcc";
} else {
s = "????";
}
tty->print("%s (unresolved)", s);
}
#endif
// The following 4 methods return the offset of the appropriate move instruction
// Support for fast byte/short loading with zero extension (depending on particular CPU)
......
......@@ -56,12 +56,6 @@ void Assembler::pd_patch_instruction(address branch, address target) {
ShouldNotCallThis();
}
#ifndef PRODUCT
void Assembler::pd_print_patched_instruction(address branch) {
ShouldNotCallThis();
}
#endif // PRODUCT
void MacroAssembler::align(int modulus) {
while (offset() % modulus != 0)
emit_byte(AbstractAssembler::code_fill_byte());
......
......@@ -37,9 +37,6 @@ class Assembler : public AbstractAssembler {
public:
void pd_patch_instruction(address branch, address target);
#ifndef PRODUCT
static void pd_print_patched_instruction(address branch);
#endif // PRODUCT
};
class MacroAssembler : public Assembler {
......
......@@ -119,26 +119,6 @@ void AbstractAssembler::a_long(jint x) {
emit_long(x);
}
// Labels refer to positions in the (to be) generated code. There are bound
// and unbound
//
// Bound labels refer to known positions in the already generated code.
// offset() is the position the label refers to.
//
// Unbound labels refer to unknown positions in the code to be generated; it
// may contain a list of unresolved displacements that refer to it
#ifndef PRODUCT
void AbstractAssembler::print(Label& L) {
if (L.is_bound()) {
tty->print_cr("bound label to %d|%d", L.loc_pos(), L.loc_sect());
} else if (L.is_unbound()) {
L.print_instructions((MacroAssembler*)this);
} else {
tty->print_cr("label in inconsistent state (loc = %d)", L.loc());
}
}
#endif // PRODUCT
void AbstractAssembler::bind(Label& L) {
if (L.is_bound()) {
......@@ -342,28 +322,3 @@ bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
#endif
return offset < 0 || os::vm_page_size() <= offset;
}
#ifndef PRODUCT
void Label::print_instructions(MacroAssembler* masm) const {
CodeBuffer* cb = masm->code();
for (int i = 0; i < _patch_index; ++i) {
int branch_loc;
if (i >= PatchCacheSize) {
branch_loc = _patch_overflow->at(i - PatchCacheSize);
} else {
branch_loc = _patches[i];
}
int branch_pos = CodeBuffer::locator_pos(branch_loc);
int branch_sect = CodeBuffer::locator_sect(branch_loc);
address branch = cb->locator_address(branch_loc);
tty->print_cr("unbound label");
tty->print("@ %d|%d ", branch_pos, branch_sect);
if (branch_sect == CodeBuffer::SECT_CONSTS) {
tty->print_cr(PTR_FORMAT, *(address*)branch);
continue;
}
masm->pd_print_patched_instruction(branch);
tty->cr();
}
}
#endif // ndef PRODUCT
......@@ -277,9 +277,6 @@ class AbstractAssembler : public ResourceObj {
};
#endif
// Label functions
void print(Label& L);
public:
// Creation
......@@ -441,15 +438,6 @@ class AbstractAssembler : public ResourceObj {
*/
void pd_patch_instruction(address branch, address target);
#ifndef PRODUCT
/**
* Platform-dependent method of printing an instruction that needs to be
* patched.
*
* @param branch the instruction to be patched in the buffer.
*/
static void pd_print_patched_instruction(address branch);
#endif // PRODUCT
};
#ifdef TARGET_ARCH_x86
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册