#7191 [C1] Fix an error in MacroAssembler::eden_allocate

Wed, 20 Jun 2018 18:01:16 +0800

author
fujie
date
Wed, 20 Jun 2018 18:01:16 +0800
changeset 9152
2d7317b44659
parent 9151
8b3f792d7727
child 9153
7ebfb115ed31

#7191 [C1] Fix an error in MacroAssembler::eden_allocate

src/cpu/mips/vm/c1_CodeStubs_mips.cpp file | annotate | diff | comparison | revisions
src/cpu/mips/vm/macroAssembler_mips.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/cpu/mips/vm/c1_CodeStubs_mips.cpp	Tue Jun 19 11:18:58 2018 +0800
     1.2 +++ b/src/cpu/mips/vm/c1_CodeStubs_mips.cpp	Wed Jun 20 18:01:16 2018 +0800
     1.3 @@ -199,7 +199,7 @@
     1.4  void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
     1.5    assert(__ sp_offset() == 0, "frame size should be fixed");
     1.6    __ bind(_entry);
     1.7 -  assert(_length->as_register() == T2, "length must in ebx");
     1.8 +  assert(_length->as_register() == T2, "length must in T2");
     1.9  #ifndef _LP64
    1.10    assert(_klass_reg->as_register() == T4, "klass_reg must in T4");
    1.11  #else
    1.12 @@ -209,7 +209,7 @@
    1.13    __ delayed()->nop();
    1.14    ce->add_call_info_here(_info);
    1.15    ce->verify_oop_map(_info);
    1.16 -  assert(_result->as_register() == V0, "result must in eax");
    1.17 +  assert(_result->as_register() == V0, "result must in V0");
    1.18    __ b_far(_continuation);
    1.19    __ delayed()->nop();
    1.20  }
     2.1 --- a/src/cpu/mips/vm/macroAssembler_mips.cpp	Tue Jun 19 11:18:58 2018 +0800
     2.2 +++ b/src/cpu/mips/vm/macroAssembler_mips.cpp	Wed Jun 20 18:01:16 2018 +0800
     2.3 @@ -1883,6 +1883,7 @@
     2.4      delayed()->nop();
     2.5  
     2.6      li(AT, (long)Universe::heap()->end_addr());
     2.7 +    ld_ptr(AT, AT, 0);
     2.8      sltu(AT, AT, end);
     2.9      bne_far(AT, R0, slow_case);
    2.10      delayed()->nop();
    2.11 @@ -1897,7 +1898,6 @@
    2.12      cmpxchg(end, heap_top, obj);
    2.13      beq_far(AT, R0, retry);    //by yyq
    2.14      delayed()->nop();
    2.15 -
    2.16    }
    2.17  }
    2.18  
    2.19 @@ -1905,28 +1905,12 @@
    2.20  void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case) {
    2.21    Register top = T0;
    2.22    Register t1  = T1;
    2.23 -/* Jin: tlab_refill() is called in
    2.24 -
    2.25 -     [c1_Runtime1_mips.cpp] Runtime1::generate_code_for(new_type_array_id);
    2.26 -
    2.27 -  In generate_code_for(), T2 has been assigned as a register(length), which is used
    2.28 - after calling tlab_refill();
    2.29 -  Therefore, tlab_refill() should not use T2.
    2.30 -
    2.31 - Source:
    2.32 -
    2.33 -Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
    2.34 -        at java.lang.System.arraycopy(Native Method)
    2.35 -        at java.util.Arrays.copyOf(Arrays.java:2799)  <-- alloc_array
    2.36 -        at sun.misc.Resource.getBytes(Resource.java:117)
    2.37 -        at java.net.URLClassLoader.defineClass(URLClassLoader.java:273)
    2.38 -        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    2.39 -        at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    2.40 - */
    2.41    Register t2  = T9;
    2.42    Register t3  = T3;
    2.43    Register thread_reg = T8;
    2.44 +  assert_different_registers(top, thread_reg, t1, t2, /* preserve: */ T2, A4);
    2.45    Label do_refill, discard_tlab;
    2.46 +
    2.47    if (CMSIncrementalMode || !Universe::heap()->supports_inline_contig_alloc()) { //by yyq
    2.48      // No allocation in the shared eden.
    2.49      b(slow_case);
    2.50 @@ -1936,7 +1920,7 @@
    2.51    get_thread(thread_reg);
    2.52  
    2.53    ld_ptr(top, thread_reg, in_bytes(JavaThread::tlab_top_offset()));
    2.54 -  ld_ptr(t1, thread_reg, in_bytes(JavaThread::tlab_end_offset()));
    2.55 +  ld_ptr(t1,  thread_reg, in_bytes(JavaThread::tlab_end_offset()));
    2.56  
    2.57    // calculate amount of free space
    2.58    sub(t1, t1, top);
    2.59 @@ -1950,7 +1934,6 @@
    2.60    delayed()->nop();
    2.61  
    2.62    // Retain
    2.63 -
    2.64  #ifndef _LP64
    2.65    move(AT, ThreadLocalAllocBuffer::refill_waste_limit_increment());
    2.66  #else

mercurial