1.1 --- a/src/cpu/mips/vm/mips_64.ad Wed Mar 01 03:42:17 2017 -0500 1.2 +++ b/src/cpu/mips/vm/mips_64.ad Wed Mar 01 07:47:24 2017 -0500 1.3 @@ -581,35 +581,6 @@ 1.4 1.5 // Emit deopt handler code. 1.6 int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf) { 1.7 -/* 1.8 - // Note that the code buffer's insts_mark is always relative to insts. 1.9 - // That's why we must use the macroassembler to generate a handler. 1.10 - MacroAssembler _masm(&cbuf); 1.11 - address base = __ start_a_stub(size_deopt_handler()); 1.12 - if (base == NULL) return 0; // CodeBuffer::expand failed 1.13 - int offset = __ offset(); 1.14 - 1.15 -#ifdef _LP64 1.16 - address the_pc = (address) __ pc(); 1.17 - Label next; 1.18 - // push a "the_pc" on the stack without destroying any registers 1.19 - // as they all may be live. 1.20 - 1.21 - // push address of "next" 1.22 - __ call(next, relocInfo::none); // reloc none is fine since it is a disp32 1.23 - __ bind(next); 1.24 - // adjust it so it matches "the_pc" 1.25 - __ subptr(Address(rsp, 0), __ offset() - offset); 1.26 -#else 1.27 - InternalAddress here(__ pc()); 1.28 - __ pushptr(here.addr()); 1.29 -#endif 1.30 - 1.31 - __ jump(RuntimeAddress(SharedRuntime::deopt_blob()->unpack())); 1.32 - assert(__ offset() - offset <= (int) size_deopt_handler(), "overflow"); 1.33 - __ end_a_stub(); 1.34 - return offset; 1.35 -*/ 1.36 // Note that the code buffer's insts_mark is always relative to insts. 1.37 // That's why we must use the macroassembler to generate a handler. 1.38 MacroAssembler _masm(&cbuf); 1.39 @@ -1009,20 +980,6 @@ 1.40 1.41 } 1.42 1.43 -/* 1.44 -// EMIT_OPCODE() 1.45 -void emit_opcode(CodeBuffer &cbuf, int code) { 1.46 - *(cbuf.code_end()) = (unsigned char)code; 1.47 - cbuf.set_code_end(cbuf.code_end() + 1); 1.48 -} 1.49 -*/ 1.50 - 1.51 -void emit_d32_reloc(CodeBuffer &cbuf, int d32, relocInfo::relocType reloc, 1.52 - int format) { 1.53 - cbuf.relocate(cbuf.insts_mark(), reloc, format); 1.54 - cbuf.insts()->emit_int32(d32); 1.55 -} 1.56 - 1.57 //============================================================================= 1.58 1.59 // Figure out which register class each belongs in: rc_int, rc_float, rc_stack 1.60 @@ -3130,16 +3087,10 @@ 1.61 1.62 if ( !_method ) { 1.63 __ relocate(relocInfo::runtime_call_type); 1.64 - //emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.code_end()) - 4), 1.65 - // runtime_call_Relocation::spec(), RELOC_IMM32 ); 1.66 } else if(_optimized_virtual) { 1.67 __ relocate(relocInfo::opt_virtual_call_type); 1.68 - //emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.code_end()) - 4), 1.69 - // opt_virtual_call_Relocation::spec(), RELOC_IMM32 ); 1.70 } else { 1.71 __ relocate(relocInfo::static_call_type); 1.72 - //emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.code_end()) - 4), 1.73 - // static_call_Relocation::spec(), RELOC_IMM32 ); 1.74 } 1.75 1.76 __ li(T9, $meth$$method); 1.77 @@ -6235,31 +6186,22 @@ 1.78 1.79 ins_encode %{ 1.80 Register dst = $dst$$Register; 1.81 - long* value = (long*)$src$$constant; 1.82 - bool is_need_reloc = $src->constant_reloc() != relocInfo::none; 1.83 - 1.84 - /* During GC, klassOop may be moved to new position in the heap. 1.85 - * It must be relocated. 1.86 - * Refer: [c1_LIRAssembler_mips.cpp] jobject2reg() 1.87 - */ 1.88 - if (is_need_reloc) { 1.89 - if($src->constant_reloc() == relocInfo::metadata_type){ 1.90 - int klass_index = __ oop_recorder()->find_index((Klass*)value); 1.91 - RelocationHolder rspec = metadata_Relocation::spec(klass_index); 1.92 - 1.93 - __ relocate(rspec); 1.94 - __ li48(dst, (long)value); 1.95 - } 1.96 - 1.97 - if($src->constant_reloc() == relocInfo::oop_type){ 1.98 - int oop_index = __ oop_recorder()->find_index((jobject)value); 1.99 - RelocationHolder rspec = oop_Relocation::spec(oop_index); 1.100 - 1.101 - __ relocate(rspec); 1.102 - __ li48(dst, (long)value); 1.103 - } 1.104 - } else { 1.105 - __ set64(dst, (long)value); 1.106 + long* value = (long*)$src$$constant; 1.107 + 1.108 + if($src->constant_reloc() == relocInfo::metadata_type){ 1.109 + int klass_index = __ oop_recorder()->find_index((Klass*)value); 1.110 + RelocationHolder rspec = metadata_Relocation::spec(klass_index); 1.111 + 1.112 + __ relocate(rspec); 1.113 + __ li48(dst, (long)value); 1.114 + }else if($src->constant_reloc() == relocInfo::oop_type){ 1.115 + int oop_index = __ oop_recorder()->find_index((jobject)value); 1.116 + RelocationHolder rspec = oop_Relocation::spec(oop_index); 1.117 + 1.118 + __ relocate(rspec); 1.119 + __ li48(dst, (long)value); 1.120 + } else if ($src->constant_reloc() == relocInfo::none) { 1.121 + __ set64(dst, (long)value); 1.122 } 1.123 %} 1.124