src/cpu/mips/vm/mips_64.ad

changeset 386
f50649f9eda6
parent 385
ee9f465c10a9
child 388
854749bf3dde
     1.1 --- a/src/cpu/mips/vm/mips_64.ad	Wed Mar 22 11:43:05 2017 -0400
     1.2 +++ b/src/cpu/mips/vm/mips_64.ad	Tue Mar 28 06:08:41 2017 -0400
     1.3 @@ -536,18 +536,6 @@
     1.4  // Emit exception handler code.
     1.5  // Stuff framesize into a register and call a VM stub routine.
     1.6  int HandlerImpl::emit_exception_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_exception_handler());
    1.12 -  if (base == NULL)  return 0;  // CodeBuffer::expand failed
    1.13 -  int offset = __ offset();
    1.14 -  __ jump(RuntimeAddress(OptoRuntime::exception_blob()->entry_point()));
    1.15 -  assert(__ offset() - offset <= (int) size_exception_handler(), "overflow");
    1.16 -  __ end_a_stub();
    1.17 -  return offset;
    1.18 -*/
    1.19    // Note that the code buffer's insts_mark is always relative to insts.
    1.20    // That's why we must use the macroassembler to generate a handler.
    1.21    MacroAssembler _masm(&cbuf);
    1.22 @@ -558,24 +546,9 @@
    1.23  
    1.24    __ block_comment("; emit_exception_handler");
    1.25  
    1.26 -  /* 2012/9/25 FIXME Jin: According to X86, we should use direct jumpt.
    1.27 - *    *  However, this will trigger an assert after the 40th method:
    1.28 - *       *
    1.29 - *          *        39   b   java.lang.Throwable::<init> (25 bytes)
    1.30 - *             *       ---   ns  java.lang.Throwable::fillInStackTrace
    1.31 - *                *        40  !b   java.net.URLClassLoader::findClass (29 bytes)
    1.32 - *                   *       /vm/opto/runtime.cpp, 900 , assert(caller.is_compiled_frame(),"must be")
    1.33 - *                      *        40   made not entrant  (2)  java.net.URLClassLoader::findClass (29 bytes)
    1.34 - *                         *
    1.35 - *                            *  If we change from JR to JALR, the assert will disappear, but WebClient will
    1.36 - *                               *  fail  after the 403th method with unknown reason.
    1.37 - *                                  */
    1.38    cbuf.set_insts_mark();
    1.39    __ relocate(relocInfo::runtime_call_type);
    1.40 -
    1.41 -  __ patchable_set48(T9, (long)OptoRuntime::exception_blob()->entry_point());
    1.42 -  __ jr(T9);
    1.43 -  __ delayed()->nop();
    1.44 +  __ patchable_jump((address)OptoRuntime::exception_blob()->entry_point());
    1.45    __ align(16);
    1.46    assert(__ offset() - offset <= (int) size_exception_handler(), "overflow");
    1.47    __ end_a_stub();
    1.48 @@ -598,10 +571,7 @@
    1.49  
    1.50    cbuf.set_insts_mark();
    1.51    __ relocate(relocInfo::runtime_call_type);
    1.52 -
    1.53 -  __ patchable_set48(T9, (long)SharedRuntime::deopt_blob()->unpack());
    1.54 -  __ jalr(T9);
    1.55 -  __ delayed()->nop();
    1.56 +  __ patchable_call(SharedRuntime::deopt_blob()->unpack());
    1.57    __ align(16);
    1.58    assert(__ offset() - offset <= (int) size_deopt_handler(), "overflow");
    1.59    __ end_a_stub();
    1.60 @@ -651,13 +621,6 @@
    1.61  
    1.62    __ relocate(static_stub_Relocation::spec(mark), 0);
    1.63  
    1.64 -  /* 2012/10/29 Jin: Rmethod contains methodOop, it should be relocated for GC */
    1.65 -/*
    1.66 -  int oop_index = __ oop_recorder()->allocate_index(NULL);
    1.67 -  RelocationHolder rspec = oop_Relocation::spec(oop_index);
    1.68 -  __ relocate(rspec);
    1.69 -*/
    1.70 -
    1.71    // static stub relocation also tags the methodOop in the code-stream.
    1.72    __ patchable_set48(S3, (long)0);
    1.73    // This is recognized as unresolved by relocs/nativeInst/ic code
    1.74 @@ -666,9 +629,7 @@
    1.75  
    1.76    cbuf.set_insts_mark();
    1.77    address call_pc = (address)-1;
    1.78 -  __ patchable_set48(AT, (long)call_pc);
    1.79 -  __ jr(AT);
    1.80 -  __ nop();
    1.81 +  __ patchable_jump(call_pc);
    1.82    __ align(16);
    1.83    __ end_a_stub();
    1.84    // Update current stubs pointer and restore code_end.
    1.85 @@ -1574,9 +1535,7 @@
    1.86    __ nop();
    1.87  
    1.88    __ relocate(relocInfo::runtime_call_type);
    1.89 -  __ patchable_set48(T9, (long)SharedRuntime::get_ic_miss_stub());
    1.90 -  __ jr(T9);
    1.91 -  __ nop();
    1.92 +  __ patchable_jump((address)SharedRuntime::get_ic_miss_stub());
    1.93  
    1.94    /* WARNING these NOPs are critical so that verified entry point is properly
    1.95     *      8 bytes aligned for patching by NativeJump::patch_verified_entry() */
    1.96 @@ -5388,9 +5347,7 @@
    1.97      cbuf.relocate(cbuf.insts_mark(), runtime_call_Relocation::spec());
    1.98  
    1.99      // call OptoRuntime::rethrow_stub to get the exception handler in parent method
   1.100 -    __ patchable_set48(T9, (jlong)OptoRuntime::rethrow_stub());
   1.101 -    __ jr(T9);
   1.102 -    __ nop();
   1.103 +    __ patchable_jump((address)OptoRuntime::rethrow_stub());
   1.104    %}
   1.105    ins_pipe( pipe_jump );
   1.106  %}

mercurial