src/cpu/mips/vm/templateInterpreter_mips_64.cpp

changeset 8004
941851413ebf
parent 8000
1510f9dcc0fa
child 8006
b70d88852ac9
     1.1 --- a/src/cpu/mips/vm/templateInterpreter_mips_64.cpp	Wed Oct 25 11:25:31 2017 +0800
     1.2 +++ b/src/cpu/mips/vm/templateInterpreter_mips_64.cpp	Wed Oct 25 17:02:26 2017 +0800
     1.3 @@ -787,9 +787,14 @@
     1.4    //
     1.5    // This code is based on generate_accessor_enty.
     1.6    //
     1.7 -  // rbx: Method*
     1.8 +  // rbx: Method* (Rmethod)
     1.9  
    1.10 -  // r13: senderSP must preserve for slow path, set SP to it on fast path
    1.11 +  // r13: senderSP must preserve for slow path, set SP to it on fast path (Rsender)
    1.12 +
    1.13 +  // rax: V0
    1.14 +  // rbx: Rmethod
    1.15 +  // r13: Rsender
    1.16 +  // rdi: T9 
    1.17  
    1.18    address entry = __ pc();
    1.19  
    1.20 @@ -797,13 +802,18 @@
    1.21    guarantee(referent_offset > 0, "referent offset not initialized");
    1.22  
    1.23    if (UseG1GC) {
    1.24 -    warning("UseG1GC unimplemented yet!"); 
    1.25 -    __ should_not_reach_here();
    1.26      Label slow_path;
    1.27      // rbx: method
    1.28  
    1.29      // Check if local 0 != NULL
    1.30      // If the receiver is null then it is OK to jump to the slow path.
    1.31 +    //__ movptr(rax, Address(rsp, wordSize));
    1.32 +    __ ld(V0, SP, 0);
    1.33 +
    1.34 +    //__ testptr(rax, rax);
    1.35 +    //__ jcc(Assembler::zero, slow_path);
    1.36 +    __ beq(V0, R0, slow_path);
    1.37 +    __ nop();
    1.38  
    1.39      // rax: local 0
    1.40      // rbx: method (but can be used as scratch now)
    1.41 @@ -814,6 +824,30 @@
    1.42      // the referent field in an SATB buffer.
    1.43  
    1.44      // Load the value of the referent field.
    1.45 +    const Address field_address(V0, referent_offset);
    1.46 +    __ load_heap_oop(V0, field_address);
    1.47 +
    1.48 +    // Generate the G1 pre-barrier code to log the value of
    1.49 +    // the referent field in an SATB buffer.
    1.50 +    __ g1_write_barrier_pre(noreg /* obj */,
    1.51 +                            V0 /* pre_val */,
    1.52 +                            TREG /* thread */,
    1.53 +                            Rmethod /* tmp */,
    1.54 +                            true /* tosca_live */,
    1.55 +                            true /* expand_call */);
    1.56 +
    1.57 +    // _areturn
    1.58 +    //__ pop(rdi);             // get return address
    1.59 +    __ move(SP, Rsender);      // set sp to sender sp
    1.60 +
    1.61 +    //__ jmp(rdi);
    1.62 +    //__ ret(0);
    1.63 +    __ jr(RA);
    1.64 +    __ nop();
    1.65 +
    1.66 +    // generate a vanilla interpreter entry as the slow path
    1.67 +    __ bind(slow_path);
    1.68 +    (void) generate_normal_entry(false);
    1.69  
    1.70      return entry;
    1.71    }
    1.72 @@ -823,6 +857,7 @@
    1.73    // Reference.get is an accessor
    1.74    return generate_accessor_entry();
    1.75  }
    1.76 +
    1.77  // Interpreter stub for calling a native method. (asm interpreter)
    1.78  // This sets up a somewhat different looking stack for calling the
    1.79  // native method than the typical interpreter frame setup.

mercurial