src/share/vm/c1/c1_Runtime1.cpp

changeset 8856
ac27a9c85bea
parent 8604
04d83ba48607
child 8865
ffcdff41a92f
     1.1 --- a/src/share/vm/c1/c1_Runtime1.cpp	Wed Sep 06 00:35:24 2017 -0700
     1.2 +++ b/src/share/vm/c1/c1_Runtime1.cpp	Thu May 24 18:41:44 2018 +0800
     1.3 @@ -22,6 +22,12 @@
     1.4   *
     1.5   */
     1.6  
     1.7 +/*
     1.8 + * This file has been modified by Loongson Technology in 2015. These
     1.9 + * modifications are Copyright (c) 2015 Loongson Technology, and are made
    1.10 + * available on the same license terms set forth above.
    1.11 + */
    1.12 +
    1.13  #include "precompiled.hpp"
    1.14  #include "asm/codeBuffer.hpp"
    1.15  #include "c1/c1_CodeStubs.hpp"
    1.16 @@ -972,11 +978,31 @@
    1.17          //    ....             <-- call destination
    1.18  
    1.19          address stub_location = caller_frame.pc() + PatchingStub::patch_info_offset();
    1.20 +
    1.21 +#if defined(MIPS32) && defined(_LP64)
    1.22 +/* Jin: In MIPS64, byte_skip is much larger than that in X86. It can not be contained in a byte:
    1.23 + *	int bc = 0x20;
    1.24 + *	int bs = 0x190;
    1.25 + *	int bi = 0x1b0;
    1.26 + * 
    1.27 + *   To minimize the modification of share codes, the values are decreased 4 times when generated.
    1.28 + *   See [mips/c1_CodeStubs_mips.cpp 307] PatchingStub::emit_code().
    1.29 + */
    1.30 +        int bc = *(unsigned char*) (stub_location - 1) * 4;
    1.31 +        int bs = *(unsigned char*) (stub_location - 2) * 4;
    1.32 +        int bi = *(unsigned char*) (stub_location - 3) * 4;
    1.33 +
    1.34 +	int *byte_count = &bc;
    1.35 +	int *byte_skip = &bs;
    1.36 +	int *being_initialized_entry_offset = &bi;
    1.37 +#else
    1.38          unsigned char* byte_count = (unsigned char*) (stub_location - 1);
    1.39          unsigned char* byte_skip = (unsigned char*) (stub_location - 2);
    1.40          unsigned char* being_initialized_entry_offset = (unsigned char*) (stub_location - 3);
    1.41 +#endif
    1.42          address copy_buff = stub_location - *byte_skip - *byte_count;
    1.43          address being_initialized_entry = stub_location - *being_initialized_entry_offset;
    1.44 +
    1.45          if (TracePatching) {
    1.46            tty->print_cr(" Patching %s at bci %d at address " INTPTR_FORMAT "  (%s)", Bytecodes::name(code), bci,
    1.47                          p2i(instr_pc), (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass");

mercurial