7172967: Eliminate constMethod's _method backpointer to methodOop.

Wed, 06 Jun 2012 14:33:43 -0400

author
jiangli
date
Wed, 06 Jun 2012 14:33:43 -0400
changeset 3826
2fe087c3e814
parent 3818
6e2633440960
child 3827
ab6ab9f84b2d

7172967: Eliminate constMethod's _method backpointer to methodOop.
Summary: Eliminate constMethod's _method backpointer to methodOop, and move the _constant field from methodOop to constMethod.
Reviewed-by: roland, bdelsart, kamg

agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java file | annotate | diff | comparison | revisions
agent/src/share/classes/sun/jvm/hotspot/oops/Method.java file | annotate | diff | comparison | revisions
src/cpu/sparc/vm/cppInterpreter_sparc.cpp file | annotate | diff | comparison | revisions
src/cpu/sparc/vm/interp_masm_sparc.cpp file | annotate | diff | comparison | revisions
src/cpu/sparc/vm/interp_masm_sparc.hpp file | annotate | diff | comparison | revisions
src/cpu/sparc/vm/templateInterpreter_sparc.cpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/cppInterpreter_x86.cpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/interp_masm_x86_32.hpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/interp_masm_x86_64.hpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/templateInterpreter_x86_32.cpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/templateInterpreter_x86_64.cpp file | annotate | diff | comparison | revisions
src/os/solaris/dtrace/generateJvmOffsets.cpp file | annotate | diff | comparison | revisions
src/os/solaris/dtrace/jhelper.d file | annotate | diff | comparison | revisions
src/os/solaris/dtrace/libjvm_db.c file | annotate | diff | comparison | revisions
src/share/vm/oops/constMethodKlass.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/constMethodOop.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/constMethodOop.hpp file | annotate | diff | comparison | revisions
src/share/vm/oops/methodKlass.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/methodOop.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/methodOop.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/vmStructs.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java	Fri Jun 01 15:30:44 2012 -0700
     1.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java	Wed Jun 06 14:33:43 2012 -0400
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -50,8 +50,7 @@
    1.11  
    1.12    private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
    1.13      Type type                  = db.lookupType("constMethodOopDesc");
    1.14 -    // Backpointer to non-const methodOop
    1.15 -    method                     = new OopField(type.getOopField("_method"), 0);
    1.16 +    constants                  = new OopField(type.getOopField("_constants"), 0);
    1.17      // The exception handler table. 4-tuples of ints [start_pc, end_pc,
    1.18      // handler_pc, catch_type index] For methods with no exceptions the
    1.19      // table is pointing to Universe::the_empty_int_array
    1.20 @@ -69,6 +68,7 @@
    1.21      nameIndex                  = new CIntField(type.getCIntegerField("_name_index"), 0);
    1.22      signatureIndex             = new CIntField(type.getCIntegerField("_signature_index"), 0);
    1.23      genericSignatureIndex      = new CIntField(type.getCIntegerField("_generic_signature_index"),0);
    1.24 +    idnum                      = new CIntField(type.getCIntegerField("_method_idnum"), 0);
    1.25  
    1.26      // start of byte code
    1.27      bytecodeOffset = type.getSize();
    1.28 @@ -85,7 +85,7 @@
    1.29    }
    1.30  
    1.31    // Fields
    1.32 -  private static OopField  method;
    1.33 +  private static OopField  constants;
    1.34    private static OopField  exceptionTable;
    1.35    private static CIntField constMethodSize;
    1.36    private static ByteField flags;
    1.37 @@ -93,6 +93,7 @@
    1.38    private static CIntField nameIndex;
    1.39    private static CIntField signatureIndex;
    1.40    private static CIntField genericSignatureIndex;
    1.41 +  private static CIntField idnum;
    1.42  
    1.43    // start of bytecode
    1.44    private static long bytecodeOffset;
    1.45 @@ -100,9 +101,15 @@
    1.46    private static long checkedExceptionElementSize;
    1.47    private static long localVariableTableElementSize;
    1.48  
    1.49 +  public Method getMethod() {
    1.50 +    InstanceKlass ik = (InstanceKlass)getConstants().getPoolHolder();
    1.51 +    ObjArray methods = ik.getMethods();
    1.52 +    return (Method)methods.getObjAt(getIdNum());
    1.53 +  }
    1.54 +
    1.55    // Accessors for declared fields
    1.56 -  public Method getMethod() {
    1.57 -    return (Method) method.getValue(this);
    1.58 +  public ConstantPool getConstants() {
    1.59 +    return (ConstantPool) constants.getValue(this);
    1.60    }
    1.61  
    1.62    public TypeArray getExceptionTable() {
    1.63 @@ -133,6 +140,10 @@
    1.64      return genericSignatureIndex.getValue(this);
    1.65    }
    1.66  
    1.67 +  public long getIdNum() {
    1.68 +    return idnum.getValue(this);
    1.69 +  }
    1.70 +
    1.71    public Symbol getName() {
    1.72      return getMethod().getName();
    1.73    }
    1.74 @@ -223,7 +234,7 @@
    1.75    public void iterateFields(OopVisitor visitor, boolean doVMFields) {
    1.76      super.iterateFields(visitor, doVMFields);
    1.77      if (doVMFields) {
    1.78 -      visitor.doOop(method, true);
    1.79 +      visitor.doOop(constants, true);
    1.80        visitor.doOop(exceptionTable, true);
    1.81        visitor.doCInt(constMethodSize, true);
    1.82        visitor.doByte(flags, true);
     2.1 --- a/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java	Fri Jun 01 15:30:44 2012 -0700
     2.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java	Wed Jun 06 14:33:43 2012 -0400
     2.3 @@ -1,5 +1,5 @@
     2.4  /*
     2.5 - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
     2.6 + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
     2.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.8   *
     2.9   * This code is free software; you can redistribute it and/or modify it
    2.10 @@ -48,7 +48,6 @@
    2.11    private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
    2.12      Type type                  = db.lookupType("methodOopDesc");
    2.13      constMethod                = new OopField(type.getOopField("_constMethod"), 0);
    2.14 -    constants                  = new OopField(type.getOopField("_constants"), 0);
    2.15      methodData                 = new OopField(type.getOopField("_method_data"), 0);
    2.16      methodSize                 = new CIntField(type.getCIntegerField("_method_size"), 0);
    2.17      maxStack                   = new CIntField(type.getCIntegerField("_max_stack"), 0);
    2.18 @@ -83,7 +82,6 @@
    2.19  
    2.20    // Fields
    2.21    private static OopField  constMethod;
    2.22 -  private static OopField  constants;
    2.23    private static OopField  methodData;
    2.24    private static CIntField methodSize;
    2.25    private static CIntField maxStack;
    2.26 @@ -125,7 +123,9 @@
    2.27  
    2.28    // Accessors for declared fields
    2.29    public ConstMethod  getConstMethod()                { return (ConstMethod)  constMethod.getValue(this);       }
    2.30 -  public ConstantPool getConstants()                  { return (ConstantPool) constants.getValue(this);         }
    2.31 +  public ConstantPool getConstants()                  {
    2.32 +    return getConstMethod().getConstants();
    2.33 +  }
    2.34    public MethodData   getMethodData()                 { return (MethodData) methodData.getValue(this);          }
    2.35    public TypeArray    getExceptionTable()             { return getConstMethod().getExceptionTable();            }
    2.36    /** WARNING: this is in words, not useful in this system; use getObjectSize() instead */
    2.37 @@ -281,7 +281,6 @@
    2.38      super.iterateFields(visitor, doVMFields);
    2.39      if (doVMFields) {
    2.40        visitor.doOop(constMethod, true);
    2.41 -      visitor.doOop(constants, true);
    2.42        visitor.doCInt(methodSize, true);
    2.43        visitor.doCInt(maxStack, true);
    2.44        visitor.doCInt(maxLocals, true);
     3.1 --- a/src/cpu/sparc/vm/cppInterpreter_sparc.cpp	Fri Jun 01 15:30:44 2012 -0700
     3.2 +++ b/src/cpu/sparc/vm/cppInterpreter_sparc.cpp	Wed Jun 06 14:33:43 2012 -0400
     3.3 @@ -1,5 +1,5 @@
     3.4  /*
     3.5 - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
     3.6 + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
     3.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.8   *
     3.9   * This code is free software; you can redistribute it and/or modify it
    3.10 @@ -490,7 +490,8 @@
    3.11                        ConstantPoolCacheEntry::size()) * BytesPerWord), G1_scratch);
    3.12  
    3.13      // get constant pool cache
    3.14 -    __ ld_ptr(G5_method, in_bytes(methodOopDesc::constants_offset()), G3_scratch);
    3.15 +    __ ld_ptr(G5_method, in_bytes(methodOopDesc::const_offset()), G3_scratch);
    3.16 +    __ ld_ptr(G3_scratch, in_bytes(constMethodOopDesc::constants_offset()), G3_scratch);
    3.17      __ ld_ptr(G3_scratch, constantPoolOopDesc::cache_offset_in_bytes(), G3_scratch);
    3.18  
    3.19      // get specific constant pool cache entry
    3.20 @@ -768,7 +769,8 @@
    3.21      // for static methods insert the mirror argument
    3.22      const int mirror_offset = in_bytes(Klass::java_mirror_offset());
    3.23  
    3.24 -    __ ld_ptr(Address(G5_method, 0, in_bytes(methodOopDesc:: constants_offset())), O1);
    3.25 +    __ ld_ptr(Address(G5_method, 0, in_bytes(methodOopDesc:: const_offset())), O1);
    3.26 +    __ ld_ptr(Address(O1, 0, in_bytes(constMethodOopDesc::constants_offset())), O1);
    3.27      __ ld_ptr(Address(O1, 0, constantPoolOopDesc::pool_holder_offset_in_bytes()), O1);
    3.28      __ ld_ptr(O1, mirror_offset, O1);
    3.29      // where the mirror handle body is allocated:
    3.30 @@ -1047,7 +1049,7 @@
    3.31    assert_different_registers(state, prev_state);
    3.32    assert_different_registers(prev_state, G3_scratch);
    3.33    const Register Gtmp = G3_scratch;
    3.34 -  const Address constants         (G5_method, 0, in_bytes(methodOopDesc::constants_offset()));
    3.35 +  const Address constMethod       (G5_method, 0, in_bytes(methodOopDesc::const_offset()));
    3.36    const Address access_flags      (G5_method, 0, in_bytes(methodOopDesc::access_flags_offset()));
    3.37    const Address size_of_parameters(G5_method, 0, in_bytes(methodOopDesc::size_of_parameters_offset()));
    3.38    const Address max_stack         (G5_method, 0, in_bytes(methodOopDesc::max_stack_offset()));
    3.39 @@ -1155,7 +1157,8 @@
    3.40    __ set((int) BytecodeInterpreter::method_entry, O1);
    3.41    __ st(O1, XXX_STATE(_msg));
    3.42  
    3.43 -  __ ld_ptr(constants, O3);
    3.44 +  __ ld_ptr(constMethod, O3);
    3.45 +  __ ld_ptr(O3, in_bytes(constMethodOopDesc::constants_offset()), O3);
    3.46    __ ld_ptr(O3, constantPoolOopDesc::cache_offset_in_bytes(), O2);
    3.47    __ st_ptr(O2, XXX_STATE(_constants));
    3.48  
    3.49 @@ -1178,7 +1181,8 @@
    3.50      __ ld_ptr(XXX_STATE(_locals), O1);
    3.51      __ br( Assembler::zero, true, Assembler::pt, got_obj);
    3.52      __ delayed()->ld_ptr(O1, 0, O1);                  // get receiver for not-static case
    3.53 -    __ ld_ptr(constants, O1);
    3.54 +    __ ld_ptr(constMethod, O1);
    3.55 +    __ ld_ptr( O1, in_bytes(constMethodOopDesc::constants_offset()), O1);
    3.56      __ ld_ptr( O1, constantPoolOopDesc::pool_holder_offset_in_bytes(), O1);
    3.57      // lock the mirror, not the klassOop
    3.58      __ ld_ptr( O1, mirror_offset, O1);
    3.59 @@ -1536,7 +1540,7 @@
    3.60    const Register Gtmp1 = G3_scratch;
    3.61    // const Register Lmirror = L1;     // native mirror (native calls only)
    3.62  
    3.63 -  const Address constants         (G5_method, 0, in_bytes(methodOopDesc::constants_offset()));
    3.64 +  const Address constMethod       (G5_method, 0, in_bytes(methodOopDesc::const_offset()));
    3.65    const Address access_flags      (G5_method, 0, in_bytes(methodOopDesc::access_flags_offset()));
    3.66    const Address size_of_parameters(G5_method, 0, in_bytes(methodOopDesc::size_of_parameters_offset()));
    3.67    const Address max_stack         (G5_method, 0, in_bytes(methodOopDesc::max_stack_offset()));
     4.1 --- a/src/cpu/sparc/vm/interp_masm_sparc.cpp	Fri Jun 01 15:30:44 2012 -0700
     4.2 +++ b/src/cpu/sparc/vm/interp_masm_sparc.cpp	Wed Jun 06 14:33:43 2012 -0400
     4.3 @@ -1,5 +1,5 @@
     4.4  /*
     4.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     4.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     4.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.8   *
     4.9   * This code is free software; you can redistribute it and/or modify it
    4.10 @@ -934,8 +934,14 @@
    4.11  }
    4.12  
    4.13  
    4.14 +void InterpreterMacroAssembler::get_const(Register Rdst) {
    4.15 +  ld_ptr(Lmethod, in_bytes(methodOopDesc::const_offset()), Rdst);
    4.16 +}
    4.17 +
    4.18 +
    4.19  void InterpreterMacroAssembler::get_constant_pool(Register Rdst) {
    4.20 -  ld_ptr(Lmethod, in_bytes(methodOopDesc::constants_offset()), Rdst);
    4.21 +  get_const(Rdst);
    4.22 +  ld_ptr(Rdst, in_bytes(constMethodOopDesc::constants_offset()), Rdst);
    4.23  }
    4.24  
    4.25  
     5.1 --- a/src/cpu/sparc/vm/interp_masm_sparc.hpp	Fri Jun 01 15:30:44 2012 -0700
     5.2 +++ b/src/cpu/sparc/vm/interp_masm_sparc.hpp	Wed Jun 06 14:33:43 2012 -0400
     5.3 @@ -1,5 +1,5 @@
     5.4  /*
     5.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     5.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     5.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.8   *
     5.9   * This code is free software; you can redistribute it and/or modify it
    5.10 @@ -205,6 +205,7 @@
    5.11    void index_check(Register array, Register index, int index_shift, Register tmp, Register res);
    5.12    void index_check_without_pop(Register array, Register index, int index_shift, Register tmp, Register res);
    5.13  
    5.14 +  void get_const(Register Rdst);
    5.15    void get_constant_pool(Register Rdst);
    5.16    void get_constant_pool_cache(Register Rdst);
    5.17    void get_cpool_and_tags(Register Rcpool, Register Rtags);
     6.1 --- a/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Fri Jun 01 15:30:44 2012 -0700
     6.2 +++ b/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Wed Jun 06 14:33:43 2012 -0400
     6.3 @@ -1,5 +1,5 @@
     6.4  /*
     6.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     6.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     6.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     6.8   *
     6.9   * This code is free software; you can redistribute it and/or modify it
    6.10 @@ -371,7 +371,8 @@
    6.11      __ br( Assembler::zero, true, Assembler::pt, done);
    6.12      __ delayed()->ld_ptr(Llocals, Interpreter::local_offset_in_bytes(0), O0); // get receiver for not-static case
    6.13  
    6.14 -    __ ld_ptr( Lmethod, in_bytes(methodOopDesc::constants_offset()), O0);
    6.15 +    __ ld_ptr( Lmethod, in_bytes(methodOopDesc::const_offset()), O0);
    6.16 +    __ ld_ptr( O0, in_bytes(constMethodOopDesc::constants_offset()), O0);
    6.17      __ ld_ptr( O0, constantPoolOopDesc::pool_holder_offset_in_bytes(), O0);
    6.18  
    6.19      // lock the mirror, not the klassOop
    6.20 @@ -670,7 +671,8 @@
    6.21                        ConstantPoolCacheEntry::size()) * BytesPerWord), G1_scratch);
    6.22  
    6.23      // get constant pool cache
    6.24 -    __ ld_ptr(G5_method, methodOopDesc::constants_offset(), G3_scratch);
    6.25 +    __ ld_ptr(G5_method, methodOopDesc::const_offset(), G3_scratch);
    6.26 +    __ ld_ptr(G3_scratch, constMethodOopDesc::constants_offset(), G3_scratch);
    6.27      __ ld_ptr(G3_scratch, constantPoolOopDesc::cache_offset_in_bytes(), G3_scratch);
    6.28  
    6.29      // get specific constant pool cache entry
    6.30 @@ -993,7 +995,8 @@
    6.31      // for static methods insert the mirror argument
    6.32      const int mirror_offset = in_bytes(Klass::java_mirror_offset());
    6.33  
    6.34 -    __ ld_ptr(Lmethod, methodOopDesc:: constants_offset(), O1);
    6.35 +    __ ld_ptr(Lmethod, methodOopDesc:: const_offset(), O1);
    6.36 +    __ ld_ptr(O1, constMethodOopDesc::constants_offset(), O1);
    6.37      __ ld_ptr(O1, constantPoolOopDesc::pool_holder_offset_in_bytes(), O1);
    6.38      __ ld_ptr(O1, mirror_offset, O1);
    6.39  #ifdef ASSERT
     7.1 --- a/src/cpu/x86/vm/cppInterpreter_x86.cpp	Fri Jun 01 15:30:44 2012 -0700
     7.2 +++ b/src/cpu/x86/vm/cppInterpreter_x86.cpp	Wed Jun 06 14:33:43 2012 -0400
     7.3 @@ -1,5 +1,5 @@
     7.4  /*
     7.5 - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
     7.6 + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
     7.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     7.8   *
     7.9   * This code is free software; you can redistribute it and/or modify it
    7.10 @@ -481,7 +481,8 @@
    7.11    __ xorptr(rdx, rdx);
    7.12    __ movptr(STATE(_oop_temp), rdx);                     // state->_oop_temp = NULL (only really needed for native)
    7.13    __ movptr(STATE(_mdx), rdx);                          // state->_mdx = NULL
    7.14 -  __ movptr(rdx, Address(rbx, methodOopDesc::constants_offset()));
    7.15 +  __ movptr(rdx, Address(rbx, methodOopDesc::const_offset()));
    7.16 +  __ movptr(rdx, Address(rdx, constMethodOopDesc::constants_offset()));
    7.17    __ movptr(rdx, Address(rdx, constantPoolOopDesc::cache_offset_in_bytes()));
    7.18    __ movptr(STATE(_constants), rdx);                    // state->_constants = constants()
    7.19  
    7.20 @@ -516,7 +517,8 @@
    7.21      __ testl(rax, JVM_ACC_STATIC);
    7.22      __ movptr(rax, Address(locals, 0));                   // get receiver (assume this is frequent case)
    7.23      __ jcc(Assembler::zero, done);
    7.24 -    __ movptr(rax, Address(rbx, methodOopDesc::constants_offset()));
    7.25 +    __ movptr(rax, Address(rbx, methodOopDesc::const_offset()));
    7.26 +    __ movptr(rax, Address(rax, constMethodOopDesc::constants_offset()));
    7.27      __ movptr(rax, Address(rax, constantPoolOopDesc::pool_holder_offset_in_bytes()));
    7.28      __ movptr(rax, Address(rax, mirror_offset));
    7.29      __ bind(done);
    7.30 @@ -769,7 +771,8 @@
    7.31      __ testl(rax, JVM_ACC_STATIC);
    7.32      __ movptr(rax, Address(rdi, 0));                                    // get receiver (assume this is frequent case)
    7.33      __ jcc(Assembler::zero, done);
    7.34 -    __ movptr(rax, Address(rbx, methodOopDesc::constants_offset()));
    7.35 +    __ movptr(rax, Address(rbx, methodOopDesc::const_offset()));
    7.36 +    __ movptr(rax, Address(rax, constMethodOopDesc::constants_offset()));
    7.37      __ movptr(rax, Address(rax, constantPoolOopDesc::pool_holder_offset_in_bytes()));
    7.38      __ movptr(rax, Address(rax, mirror_offset));
    7.39      __ bind(done);
    7.40 @@ -821,9 +824,9 @@
    7.41      __ testptr(rax, rax);
    7.42      __ jcc(Assembler::zero, slow_path);
    7.43  
    7.44 -    __ movptr(rdi, Address(rbx, methodOopDesc::constants_offset()));
    7.45      // read first instruction word and extract bytecode @ 1 and index @ 2
    7.46      __ movptr(rdx, Address(rbx, methodOopDesc::const_offset()));
    7.47 +    __ movptr(rdi, Address(rdx, constMethodOopDesc::constants_offset()));
    7.48      __ movl(rdx, Address(rdx, constMethodOopDesc::codes_offset()));
    7.49      // Shift codes right to get the index on the right.
    7.50      // The bytecode fetched looks like <index><0xb4><0x2a>
    7.51 @@ -1185,7 +1188,8 @@
    7.52      __ testl(t, JVM_ACC_STATIC);
    7.53      __ jcc(Assembler::zero, L);
    7.54      // get mirror
    7.55 -    __ movptr(t, Address(method, methodOopDesc:: constants_offset()));
    7.56 +    __ movptr(t, Address(method, methodOopDesc:: const_offset()));
    7.57 +    __ movptr(t, Address(t, constMethodOopDesc::constants_offset()));
    7.58      __ movptr(t, Address(t, constantPoolOopDesc::pool_holder_offset_in_bytes()));
    7.59      __ movptr(t, Address(t, mirror_offset));
    7.60      // copy mirror into activation object
     8.1 --- a/src/cpu/x86/vm/interp_masm_x86_32.hpp	Fri Jun 01 15:30:44 2012 -0700
     8.2 +++ b/src/cpu/x86/vm/interp_masm_x86_32.hpp	Wed Jun 06 14:33:43 2012 -0400
     8.3 @@ -1,5 +1,5 @@
     8.4  /*
     8.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     8.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     8.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     8.8   *
     8.9   * This code is free software; you can redistribute it and/or modify it
    8.10 @@ -77,7 +77,8 @@
    8.11  
    8.12    // Helpers for runtime call arguments/results
    8.13    void get_method(Register reg)                            { movptr(reg, Address(rbp, frame::interpreter_frame_method_offset * wordSize)); }
    8.14 -  void get_constant_pool(Register reg)                     { get_method(reg); movptr(reg, Address(reg, methodOopDesc::constants_offset())); }
    8.15 +  void get_const(Register reg)                             { get_method(reg); movptr(reg, Address(reg, methodOopDesc::const_offset())); }
    8.16 +  void get_constant_pool(Register reg)                     { get_const(reg); movptr(reg, Address(reg, constMethodOopDesc::constants_offset())); }
    8.17    void get_constant_pool_cache(Register reg)               { get_constant_pool(reg); movptr(reg, Address(reg, constantPoolOopDesc::cache_offset_in_bytes())); }
    8.18    void get_cpool_and_tags(Register cpool, Register tags)   { get_constant_pool(cpool); movptr(tags, Address(cpool, constantPoolOopDesc::tags_offset_in_bytes()));
    8.19    }
     9.1 --- a/src/cpu/x86/vm/interp_masm_x86_64.hpp	Fri Jun 01 15:30:44 2012 -0700
     9.2 +++ b/src/cpu/x86/vm/interp_masm_x86_64.hpp	Wed Jun 06 14:33:43 2012 -0400
     9.3 @@ -1,5 +1,5 @@
     9.4  /*
     9.5 - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
     9.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
     9.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     9.8   *
     9.9   * This code is free software; you can redistribute it and/or modify it
    9.10 @@ -84,9 +84,14 @@
    9.11      movptr(reg, Address(rbp, frame::interpreter_frame_method_offset * wordSize));
    9.12    }
    9.13  
    9.14 +  void get_const(Register reg) {
    9.15 +    get_method(reg);
    9.16 +    movptr(reg, Address(reg, methodOopDesc::const_offset()));
    9.17 +  }
    9.18 +
    9.19    void get_constant_pool(Register reg) {
    9.20 -    get_method(reg);
    9.21 -    movptr(reg, Address(reg, methodOopDesc::constants_offset()));
    9.22 +    get_const(reg);
    9.23 +    movptr(reg, Address(reg, constMethodOopDesc::constants_offset()));
    9.24    }
    9.25  
    9.26    void get_constant_pool_cache(Register reg) {
    10.1 --- a/src/cpu/x86/vm/templateInterpreter_x86_32.cpp	Fri Jun 01 15:30:44 2012 -0700
    10.2 +++ b/src/cpu/x86/vm/templateInterpreter_x86_32.cpp	Wed Jun 06 14:33:43 2012 -0400
    10.3 @@ -1,5 +1,5 @@
    10.4  /*
    10.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
    10.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    10.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    10.8   *
    10.9   * This code is free software; you can redistribute it and/or modify it
   10.10 @@ -566,7 +566,8 @@
   10.11      __ testl(rax, JVM_ACC_STATIC);
   10.12      __ movptr(rax, Address(rdi, Interpreter::local_offset_in_bytes(0)));  // get receiver (assume this is frequent case)
   10.13      __ jcc(Assembler::zero, done);
   10.14 -    __ movptr(rax, Address(rbx, methodOopDesc::constants_offset()));
   10.15 +    __ movptr(rax, Address(rbx, methodOopDesc::const_offset()));
   10.16 +    __ movptr(rax, Address(rax, constMethodOopDesc::constants_offset()));
   10.17      __ movptr(rax, Address(rax, constantPoolOopDesc::pool_holder_offset_in_bytes()));
   10.18      __ movptr(rax, Address(rax, mirror_offset));
   10.19      __ bind(done);
   10.20 @@ -606,7 +607,8 @@
   10.21      __ push(0);
   10.22    }
   10.23  
   10.24 -  __ movptr(rdx, Address(rbx, methodOopDesc::constants_offset()));
   10.25 +  __ movptr(rdx, Address(rbx, methodOopDesc::const_offset()));
   10.26 +  __ movptr(rdx, Address(rdx, constMethodOopDesc::constants_offset()));
   10.27    __ movptr(rdx, Address(rdx, constantPoolOopDesc::cache_offset_in_bytes()));
   10.28    __ push(rdx);                                       // set constant pool cache
   10.29    __ push(rdi);                                       // set locals pointer
   10.30 @@ -661,9 +663,9 @@
   10.31      __ testptr(rax, rax);
   10.32      __ jcc(Assembler::zero, slow_path);
   10.33  
   10.34 -    __ movptr(rdi, Address(rbx, methodOopDesc::constants_offset()));
   10.35      // read first instruction word and extract bytecode @ 1 and index @ 2
   10.36      __ movptr(rdx, Address(rbx, methodOopDesc::const_offset()));
   10.37 +    __ movptr(rdi, Address(rdx, constMethodOopDesc::constants_offset()));
   10.38      __ movl(rdx, Address(rdx, constMethodOopDesc::codes_offset()));
   10.39      // Shift codes right to get the index on the right.
   10.40      // The bytecode fetched looks like <index><0xb4><0x2a>
   10.41 @@ -1026,7 +1028,8 @@
   10.42      __ testl(t, JVM_ACC_STATIC);
   10.43      __ jcc(Assembler::zero, L);
   10.44      // get mirror
   10.45 -    __ movptr(t, Address(method, methodOopDesc:: constants_offset()));
   10.46 +    __ movptr(t, Address(method, methodOopDesc:: const_offset()));
   10.47 +    __ movptr(t, Address(t, constMethodOopDesc::constants_offset()));
   10.48      __ movptr(t, Address(t, constantPoolOopDesc::pool_holder_offset_in_bytes()));
   10.49      __ movptr(t, Address(t, mirror_offset));
   10.50      // copy mirror into activation frame
    11.1 --- a/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Fri Jun 01 15:30:44 2012 -0700
    11.2 +++ b/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Wed Jun 06 14:33:43 2012 -0400
    11.3 @@ -1,5 +1,5 @@
    11.4  /*
    11.5 - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
    11.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
    11.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    11.8   *
    11.9   * This code is free software; you can redistribute it and/or modify it
   11.10 @@ -522,7 +522,8 @@
   11.11      // get receiver (assume this is frequent case)
   11.12      __ movptr(rax, Address(r14, Interpreter::local_offset_in_bytes(0)));
   11.13      __ jcc(Assembler::zero, done);
   11.14 -    __ movptr(rax, Address(rbx, methodOopDesc::constants_offset()));
   11.15 +    __ movptr(rax, Address(rbx, methodOopDesc::const_offset()));
   11.16 +    __ movptr(rax, Address(rax, constMethodOopDesc::constants_offset()));
   11.17      __ movptr(rax, Address(rax,
   11.18                             constantPoolOopDesc::pool_holder_offset_in_bytes()));
   11.19      __ movptr(rax, Address(rax, mirror_offset));
   11.20 @@ -579,7 +580,8 @@
   11.21      __ push(0);
   11.22    }
   11.23  
   11.24 -  __ movptr(rdx, Address(rbx, methodOopDesc::constants_offset()));
   11.25 +  __ movptr(rdx, Address(rbx, methodOopDesc::const_offset()));
   11.26 +  __ movptr(rdx, Address(rdx, constMethodOopDesc::constants_offset()));
   11.27    __ movptr(rdx, Address(rdx, constantPoolOopDesc::cache_offset_in_bytes()));
   11.28    __ push(rdx); // set constant pool cache
   11.29    __ push(r14); // set locals pointer
   11.30 @@ -629,9 +631,9 @@
   11.31      __ testptr(rax, rax);
   11.32      __ jcc(Assembler::zero, slow_path);
   11.33  
   11.34 -    __ movptr(rdi, Address(rbx, methodOopDesc::constants_offset()));
   11.35      // read first instruction word and extract bytecode @ 1 and index @ 2
   11.36      __ movptr(rdx, Address(rbx, methodOopDesc::const_offset()));
   11.37 +    __ movptr(rdi, Address(rdx, constMethodOopDesc::constants_offset()));
   11.38      __ movl(rdx, Address(rdx, constMethodOopDesc::codes_offset()));
   11.39      // Shift codes right to get the index on the right.
   11.40      // The bytecode fetched looks like <index><0xb4><0x2a>
   11.41 @@ -1020,7 +1022,8 @@
   11.42      __ testl(t, JVM_ACC_STATIC);
   11.43      __ jcc(Assembler::zero, L);
   11.44      // get mirror
   11.45 -    __ movptr(t, Address(method, methodOopDesc::constants_offset()));
   11.46 +    __ movptr(t, Address(method, methodOopDesc::const_offset()));
   11.47 +    __ movptr(t, Address(t, constMethodOopDesc::constants_offset()));
   11.48      __ movptr(t, Address(t, constantPoolOopDesc::pool_holder_offset_in_bytes()));
   11.49      __ movptr(t, Address(t, mirror_offset));
   11.50      // copy mirror into activation frame
    12.1 --- a/src/os/solaris/dtrace/generateJvmOffsets.cpp	Fri Jun 01 15:30:44 2012 -0700
    12.2 +++ b/src/os/solaris/dtrace/generateJvmOffsets.cpp	Wed Jun 06 14:33:43 2012 -0400
    12.3 @@ -1,5 +1,5 @@
    12.4  /*
    12.5 - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
    12.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
    12.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    12.8   *
    12.9   * This code is free software; you can redistribute it and/or modify it
   12.10 @@ -220,10 +220,10 @@
   12.11    printf("\n");
   12.12  
   12.13    GEN_OFFS(methodOopDesc, _constMethod);
   12.14 -  GEN_OFFS(methodOopDesc, _constants);
   12.15    GEN_OFFS(methodOopDesc, _access_flags);
   12.16    printf("\n");
   12.17  
   12.18 +  GEN_OFFS(constMethodOopDesc, _constants);
   12.19    GEN_OFFS(constMethodOopDesc, _flags);
   12.20    GEN_OFFS(constMethodOopDesc, _code_size);
   12.21    GEN_OFFS(constMethodOopDesc, _name_index);
    13.1 --- a/src/os/solaris/dtrace/jhelper.d	Fri Jun 01 15:30:44 2012 -0700
    13.2 +++ b/src/os/solaris/dtrace/jhelper.d	Wed Jun 06 14:33:43 2012 -0400
    13.3 @@ -1,5 +1,5 @@
    13.4  /*
    13.5 - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
    13.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
    13.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    13.8   *
    13.9   * This code is free software; you can redistribute it and/or modify it
   13.10 @@ -118,7 +118,7 @@
   13.11    copyin_offset(OFFSET_Symbol_body);
   13.12  
   13.13    copyin_offset(OFFSET_methodOopDesc_constMethod);
   13.14 -  copyin_offset(OFFSET_methodOopDesc_constants);
   13.15 +  copyin_offset(OFFSET_constMethodOopDesc_constants);
   13.16    copyin_offset(OFFSET_constMethodOopDesc_name_index);
   13.17    copyin_offset(OFFSET_constMethodOopDesc_signature_index);
   13.18  
   13.19 @@ -359,8 +359,8 @@
   13.20    this->signatureIndex = copyin_uint16(this->constMethod +
   13.21        OFFSET_constMethodOopDesc_signature_index);
   13.22  
   13.23 -  this->constantPool = copyin_ptr(this->methodOopPtr +
   13.24 -      OFFSET_methodOopDesc_constants);
   13.25 +  this->constantPool = copyin_ptr(this->constMethod +
   13.26 +      OFFSET_constMethodOopDesc_constants);
   13.27  
   13.28    this->nameSymbol = copyin_ptr(this->constantPool +
   13.29        this->nameIndex * sizeof (pointer) + SIZE_constantPoolOopDesc);
    14.1 --- a/src/os/solaris/dtrace/libjvm_db.c	Fri Jun 01 15:30:44 2012 -0700
    14.2 +++ b/src/os/solaris/dtrace/libjvm_db.c	Wed Jun 06 14:33:43 2012 -0400
    14.3 @@ -1,5 +1,5 @@
    14.4  /*
    14.5 - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
    14.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
    14.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    14.8   *
    14.9   * This code is free software; you can redistribute it and/or modify it
   14.10 @@ -514,9 +514,9 @@
   14.11    char * signatureString = NULL;
   14.12    int err;
   14.13  
   14.14 -  err = read_pointer(J, methodOopPtr + OFFSET_methodOopDesc_constants, &constantPool);
   14.15 +  err = read_pointer(J, methodOopPtr + OFFSET_methodOopDesc_constMethod, &constMethod);
   14.16    CHECK_FAIL(err);
   14.17 -  err = read_pointer(J, methodOopPtr + OFFSET_methodOopDesc_constMethod, &constMethod);
   14.18 +  err = read_pointer(J->P, constMethod + OFFSET_constMethodOopDesc_constants, &constantPool);
   14.19    CHECK_FAIL(err);
   14.20  
   14.21    /* To get name string */
    15.1 --- a/src/share/vm/oops/constMethodKlass.cpp	Fri Jun 01 15:30:44 2012 -0700
    15.2 +++ b/src/share/vm/oops/constMethodKlass.cpp	Wed Jun 06 14:33:43 2012 -0400
    15.3 @@ -1,5 +1,5 @@
    15.4  /*
    15.5 - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
    15.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
    15.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    15.8   *
    15.9   * This code is free software; you can redistribute it and/or modify it
   15.10 @@ -80,7 +80,7 @@
   15.11    No_Safepoint_Verifier no_safepoint;
   15.12    cm->set_interpreter_kind(Interpreter::invalid);
   15.13    cm->init_fingerprint();
   15.14 -  cm->set_method(NULL);
   15.15 +  cm->set_constants(NULL);
   15.16    cm->set_stackmap_data(NULL);
   15.17    cm->set_exception_table(NULL);
   15.18    cm->set_code_size(byte_code_size);
   15.19 @@ -98,7 +98,7 @@
   15.20  void constMethodKlass::oop_follow_contents(oop obj) {
   15.21    assert (obj->is_constMethod(), "object must be constMethod");
   15.22    constMethodOop cm = constMethodOop(obj);
   15.23 -  MarkSweep::mark_and_push(cm->adr_method());
   15.24 +  MarkSweep::mark_and_push(cm->adr_constants());
   15.25    MarkSweep::mark_and_push(cm->adr_stackmap_data());
   15.26    MarkSweep::mark_and_push(cm->adr_exception_table());
   15.27    // Performance tweak: We skip iterating over the klass pointer since we
   15.28 @@ -110,7 +110,7 @@
   15.29                                             oop obj) {
   15.30    assert (obj->is_constMethod(), "object must be constMethod");
   15.31    constMethodOop cm_oop = constMethodOop(obj);
   15.32 -  PSParallelCompact::mark_and_push(cm, cm_oop->adr_method());
   15.33 +  PSParallelCompact::mark_and_push(cm, cm_oop->adr_constants());
   15.34    PSParallelCompact::mark_and_push(cm, cm_oop->adr_stackmap_data());
   15.35    PSParallelCompact::mark_and_push(cm, cm_oop->adr_exception_table());
   15.36    // Performance tweak: We skip iterating over the klass pointer since we
   15.37 @@ -121,7 +121,7 @@
   15.38  int constMethodKlass::oop_oop_iterate(oop obj, OopClosure* blk) {
   15.39    assert (obj->is_constMethod(), "object must be constMethod");
   15.40    constMethodOop cm = constMethodOop(obj);
   15.41 -  blk->do_oop(cm->adr_method());
   15.42 +  blk->do_oop(cm->adr_constants());
   15.43    blk->do_oop(cm->adr_stackmap_data());
   15.44    blk->do_oop(cm->adr_exception_table());
   15.45    // Get size before changing pointers.
   15.46 @@ -135,7 +135,7 @@
   15.47    assert (obj->is_constMethod(), "object must be constMethod");
   15.48    constMethodOop cm = constMethodOop(obj);
   15.49    oop* adr;
   15.50 -  adr = cm->adr_method();
   15.51 +  adr = cm->adr_constants();
   15.52    if (mr.contains(adr)) blk->do_oop(adr);
   15.53    adr = cm->adr_stackmap_data();
   15.54    if (mr.contains(adr)) blk->do_oop(adr);
   15.55 @@ -153,7 +153,7 @@
   15.56  int constMethodKlass::oop_adjust_pointers(oop obj) {
   15.57    assert(obj->is_constMethod(), "should be constMethod");
   15.58    constMethodOop cm = constMethodOop(obj);
   15.59 -  MarkSweep::adjust_pointer(cm->adr_method());
   15.60 +  MarkSweep::adjust_pointer(cm->adr_constants());
   15.61    MarkSweep::adjust_pointer(cm->adr_stackmap_data());
   15.62    MarkSweep::adjust_pointer(cm->adr_exception_table());
   15.63    // Get size before changing pointers.
   15.64 @@ -188,8 +188,8 @@
   15.65    assert(obj->is_constMethod(), "must be constMethod");
   15.66    Klass::oop_print_on(obj, st);
   15.67    constMethodOop m = constMethodOop(obj);
   15.68 -  st->print(" - method:       " INTPTR_FORMAT " ", (address)m->method());
   15.69 -  m->method()->print_value_on(st); st->cr();
   15.70 +  st->print(" - constants:       " INTPTR_FORMAT " ", (address)m->constants());
   15.71 +  m->constants()->print_value_on(st); st->cr();
   15.72    st->print(" - exceptions:   " INTPTR_FORMAT "\n", (address)m->exception_table());
   15.73    if (m->has_stackmap_table()) {
   15.74      st->print(" - stackmap data:       ");
   15.75 @@ -223,8 +223,8 @@
   15.76    // Verification can occur during oop construction before the method or
   15.77    // other fields have been initialized.
   15.78    if (!obj->partially_loaded()) {
   15.79 -    guarantee(m->method()->is_perm(), "should be in permspace");
   15.80 -    guarantee(m->method()->is_method(), "should be method");
   15.81 +    guarantee(m->constants()->is_perm(), "should be in permspace");
   15.82 +    guarantee(m->constants()->is_constantPool(), "should be constant pool");
   15.83      typeArrayOop stackmap_data = m->stackmap_data();
   15.84      guarantee(stackmap_data == NULL ||
   15.85                stackmap_data->is_perm(),  "should be in permspace");
    16.1 --- a/src/share/vm/oops/constMethodOop.cpp	Fri Jun 01 15:30:44 2012 -0700
    16.2 +++ b/src/share/vm/oops/constMethodOop.cpp	Wed Jun 06 14:33:43 2012 -0400
    16.3 @@ -1,5 +1,5 @@
    16.4  /*
    16.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
    16.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
    16.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    16.8   *
    16.9   * This code is free software; you can redistribute it and/or modify it
   16.10 @@ -53,6 +53,10 @@
   16.11    return align_object_size(header_size() + extra_words);
   16.12  }
   16.13  
   16.14 +methodOop constMethodOopDesc::method() const {
   16.15 +    return instanceKlass::cast(_constants->pool_holder())->method_with_idnum(
   16.16 +                               _method_idnum);
   16.17 +  }
   16.18  
   16.19  // linenumber table - note that length is unknown until decompression,
   16.20  // see class CompressedLineNumberReadStream.
    17.1 --- a/src/share/vm/oops/constMethodOop.hpp	Fri Jun 01 15:30:44 2012 -0700
    17.2 +++ b/src/share/vm/oops/constMethodOop.hpp	Wed Jun 06 14:33:43 2012 -0400
    17.3 @@ -1,5 +1,5 @@
    17.4  /*
    17.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
    17.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
    17.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    17.8   *
    17.9   * This code is free software; you can redistribute it and/or modify it
   17.10 @@ -41,7 +41,7 @@
   17.11  // |------------------------------------------------------|
   17.12  // | fingerprint 1                                        |
   17.13  // | fingerprint 2                                        |
   17.14 -// | method                         (oop)                 |
   17.15 +// | constants                      (oop)                 |
   17.16  // | stackmap_data                  (oop)                 |
   17.17  // | exception_table                (oop)                 |
   17.18  // | constMethod_size                                     |
   17.19 @@ -113,7 +113,7 @@
   17.20    volatile bool     _is_conc_safe; // if true, safe for concurrent GC processing
   17.21  
   17.22  public:
   17.23 -  oop* oop_block_beg() const { return adr_method(); }
   17.24 +  oop* oop_block_beg() const { return adr_constants(); }
   17.25    oop* oop_block_end() const { return adr_exception_table() + 1; }
   17.26  
   17.27  private:
   17.28 @@ -121,8 +121,7 @@
   17.29    // The oop block.  See comment in klass.hpp before making changes.
   17.30    //
   17.31  
   17.32 -  // Backpointer to non-const methodOop (needed for some JVMTI operations)
   17.33 -  methodOop         _method;
   17.34 +  constantPoolOop   _constants;                  // Constant pool
   17.35  
   17.36    // Raw stackmap data for the method
   17.37    typeArrayOop      _stackmap_data;
   17.38 @@ -167,10 +166,13 @@
   17.39    void set_interpreter_kind(int kind)      { _interpreter_kind = kind; }
   17.40    int  interpreter_kind(void) const        { return _interpreter_kind; }
   17.41  
   17.42 -  // backpointer to non-const methodOop
   17.43 -  methodOop method() const                 { return _method; }
   17.44 -  void set_method(methodOop m)             { oop_store_without_check((oop*)&_method, (oop) m); }
   17.45 +  // constant pool
   17.46 +  constantPoolOop constants() const        { return _constants; }
   17.47 +  void set_constants(constantPoolOop c)    {
   17.48 +    oop_store_without_check((oop*)&_constants, (oop)c);
   17.49 +  }
   17.50  
   17.51 +  methodOop method() const;
   17.52  
   17.53    // stackmap table data
   17.54    typeArrayOop stackmap_data() const { return _stackmap_data; }
   17.55 @@ -278,11 +280,13 @@
   17.56                              { return in_ByteSize(sizeof(constMethodOopDesc)); }
   17.57  
   17.58    // interpreter support
   17.59 +  static ByteSize constants_offset()
   17.60 +               { return byte_offset_of(constMethodOopDesc, _constants); }
   17.61    static ByteSize exception_table_offset()
   17.62                 { return byte_offset_of(constMethodOopDesc, _exception_table); }
   17.63  
   17.64    // Garbage collection support
   17.65 -  oop*  adr_method() const             { return (oop*)&_method;          }
   17.66 +  oop*  adr_constants() const          { return (oop*)&_constants; }
   17.67    oop*  adr_stackmap_data() const      { return (oop*)&_stackmap_data;   }
   17.68    oop*  adr_exception_table() const    { return (oop*)&_exception_table; }
   17.69    bool is_conc_safe() { return _is_conc_safe; }
    18.1 --- a/src/share/vm/oops/methodKlass.cpp	Fri Jun 01 15:30:44 2012 -0700
    18.2 +++ b/src/share/vm/oops/methodKlass.cpp	Wed Jun 06 14:33:43 2012 -0400
    18.3 @@ -1,5 +1,5 @@
    18.4  /*
    18.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
    18.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    18.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    18.8   *
    18.9   * This code is free software; you can redistribute it and/or modify it
   18.10 @@ -112,11 +112,6 @@
   18.11  
   18.12    assert(m->is_parsable(), "must be parsable here.");
   18.13    assert(m->size() == size, "wrong size for object");
   18.14 -  // We should not publish an uprasable object's reference
   18.15 -  // into one that is parsable, since that presents problems
   18.16 -  // for the concurrent parallel marking and precleaning phases
   18.17 -  // of concurrent gc (CMS).
   18.18 -  xconst->set_method(m);
   18.19    return m;
   18.20  }
   18.21  
   18.22 @@ -127,7 +122,6 @@
   18.23    // Performance tweak: We skip iterating over the klass pointer since we
   18.24    // know that Universe::methodKlassObj never moves.
   18.25    MarkSweep::mark_and_push(m->adr_constMethod());
   18.26 -  MarkSweep::mark_and_push(m->adr_constants());
   18.27    if (m->method_data() != NULL) {
   18.28      MarkSweep::mark_and_push(m->adr_method_data());
   18.29    }
   18.30 @@ -141,7 +135,6 @@
   18.31    // Performance tweak: We skip iterating over the klass pointer since we
   18.32    // know that Universe::methodKlassObj never moves.
   18.33    PSParallelCompact::mark_and_push(cm, m->adr_constMethod());
   18.34 -  PSParallelCompact::mark_and_push(cm, m->adr_constants());
   18.35  #ifdef COMPILER2
   18.36    if (m->method_data() != NULL) {
   18.37      PSParallelCompact::mark_and_push(cm, m->adr_method_data());
   18.38 @@ -159,7 +152,6 @@
   18.39    // Performance tweak: We skip iterating over the klass pointer since we
   18.40    // know that Universe::methodKlassObj never moves
   18.41    blk->do_oop(m->adr_constMethod());
   18.42 -  blk->do_oop(m->adr_constants());
   18.43    if (m->method_data() != NULL) {
   18.44      blk->do_oop(m->adr_method_data());
   18.45    }
   18.46 @@ -178,8 +170,6 @@
   18.47    oop* adr;
   18.48    adr = m->adr_constMethod();
   18.49    if (mr.contains(adr)) blk->do_oop(adr);
   18.50 -  adr = m->adr_constants();
   18.51 -  if (mr.contains(adr)) blk->do_oop(adr);
   18.52    if (m->method_data() != NULL) {
   18.53      adr = m->adr_method_data();
   18.54      if (mr.contains(adr)) blk->do_oop(adr);
   18.55 @@ -197,7 +187,6 @@
   18.56    // Performance tweak: We skip iterating over the klass pointer since we
   18.57    // know that Universe::methodKlassObj never moves.
   18.58    MarkSweep::adjust_pointer(m->adr_constMethod());
   18.59 -  MarkSweep::adjust_pointer(m->adr_constants());
   18.60    if (m->method_data() != NULL) {
   18.61      MarkSweep::adjust_pointer(m->adr_method_data());
   18.62    }
   18.63 @@ -213,7 +202,6 @@
   18.64    assert(obj->is_method(), "should be method");
   18.65    methodOop m = methodOop(obj);
   18.66    PSParallelCompact::adjust_pointer(m->adr_constMethod());
   18.67 -  PSParallelCompact::adjust_pointer(m->adr_constants());
   18.68  #ifdef COMPILER2
   18.69    if (m->method_data() != NULL) {
   18.70      PSParallelCompact::adjust_pointer(m->adr_method_data());
   18.71 @@ -339,8 +327,6 @@
   18.72    if (!obj->partially_loaded()) {
   18.73      methodOop m = methodOop(obj);
   18.74      guarantee(m->is_perm(),  "should be in permspace");
   18.75 -    guarantee(m->constants()->is_perm(), "should be in permspace");
   18.76 -    guarantee(m->constants()->is_constantPool(), "should be constant pool");
   18.77      guarantee(m->constMethod()->is_constMethod(), "should be constMethodOop");
   18.78      guarantee(m->constMethod()->is_perm(), "should be in permspace");
   18.79      methodDataOop method_data = m->method_data();
    19.1 --- a/src/share/vm/oops/methodOop.cpp	Fri Jun 01 15:30:44 2012 -0700
    19.2 +++ b/src/share/vm/oops/methodOop.cpp	Wed Jun 06 14:33:43 2012 -0400
    19.3 @@ -531,9 +531,9 @@
    19.4  
    19.5  
    19.6  bool methodOopDesc::is_klass_loaded_by_klass_index(int klass_index) const {
    19.7 -  if( _constants->tag_at(klass_index).is_unresolved_klass() ) {
    19.8 +  if( constants()->tag_at(klass_index).is_unresolved_klass() ) {
    19.9      Thread *thread = Thread::current();
   19.10 -    Symbol* klass_name = _constants->klass_name_at(klass_index);
   19.11 +    Symbol* klass_name = constants()->klass_name_at(klass_index);
   19.12      Handle loader(thread, instanceKlass::cast(method_holder())->class_loader());
   19.13      Handle prot  (thread, Klass::cast(method_holder())->protection_domain());
   19.14      return SystemDictionary::find(klass_name, loader, prot, thread) != NULL;
   19.15 @@ -544,7 +544,7 @@
   19.16  
   19.17  
   19.18  bool methodOopDesc::is_klass_loaded(int refinfo_index, bool must_be_resolved) const {
   19.19 -  int klass_index = _constants->klass_ref_index_at(refinfo_index);
   19.20 +  int klass_index = constants()->klass_ref_index_at(refinfo_index);
   19.21    if (must_be_resolved) {
   19.22      // Make sure klass is resolved in constantpool.
   19.23      if (constants()->tag_at(klass_index).is_unresolved_klass()) return false;
   19.24 @@ -886,11 +886,13 @@
   19.25  }
   19.26  
   19.27  jint* methodOopDesc::method_type_offsets_chain() {
   19.28 -  static jint pchase[] = { -1, -1, -1 };
   19.29 +  static jint pchase[] = { -1, -1, -1, -1 };
   19.30    if (pchase[0] == -1) {
   19.31 -    jint step0 = in_bytes(constants_offset());
   19.32 -    jint step1 = (constantPoolOopDesc::header_size() + _imcp_method_type_value) * HeapWordSize;
   19.33 +    jint step0 = in_bytes(const_offset());
   19.34 +    jint step1 = in_bytes(constMethodOopDesc::constants_offset());
   19.35 +    jint step2 = (constantPoolOopDesc::header_size() + _imcp_method_type_value) * HeapWordSize;
   19.36      // do this in reverse to avoid races:
   19.37 +    OrderAccess::release_store(&pchase[2], step2);
   19.38      OrderAccess::release_store(&pchase[1], step1);
   19.39      OrderAccess::release_store(&pchase[0], step0);
   19.40    }
   19.41 @@ -1076,9 +1078,7 @@
   19.42    assert(m->constMethod()->is_parsable(), "Should remain parsable");
   19.43  
   19.44    // Reset correct method/const method, method size, and parameter info
   19.45 -  newcm->set_method(newm());
   19.46    newm->set_constMethod(newcm);
   19.47 -  assert(newcm->method() == newm(), "check");
   19.48    newm->constMethod()->set_code_size(new_code_length);
   19.49    newm->constMethod()->set_constMethod_size(new_const_method_size);
   19.50    newm->set_method_size(new_method_size);
    20.1 --- a/src/share/vm/oops/methodOop.hpp	Fri Jun 01 15:30:44 2012 -0700
    20.2 +++ b/src/share/vm/oops/methodOop.hpp	Wed Jun 06 14:33:43 2012 -0400
    20.3 @@ -64,7 +64,6 @@
    20.4  // | klass                                                |
    20.5  // |------------------------------------------------------|
    20.6  // | constMethodOop                 (oop)                 |
    20.7 -// | constants                      (oop)                 |
    20.8  // |------------------------------------------------------|
    20.9  // | methodData                     (oop)                 |
   20.10  // | interp_invocation_count                              |
   20.11 @@ -110,7 +109,6 @@
   20.12   friend class VMStructs;
   20.13   private:
   20.14    constMethodOop    _constMethod;                // Method read-only data.
   20.15 -  constantPoolOop   _constants;                  // Constant pool
   20.16    methodDataOop     _method_data;
   20.17    int               _interpreter_invocation_count; // Count of times invoked (reused as prev_event_count in tiered)
   20.18    AccessFlags       _access_flags;               // Access flags
   20.19 @@ -170,17 +168,17 @@
   20.20    void set_access_flags(AccessFlags flags)       { _access_flags = flags; }
   20.21  
   20.22    // name
   20.23 -  Symbol* name() const                           { return _constants->symbol_at(name_index()); }
   20.24 +  Symbol* name() const                           { return constants()->symbol_at(name_index()); }
   20.25    int name_index() const                         { return constMethod()->name_index();         }
   20.26    void set_name_index(int index)                 { constMethod()->set_name_index(index);       }
   20.27  
   20.28    // signature
   20.29 -  Symbol* signature() const                      { return _constants->symbol_at(signature_index()); }
   20.30 +  Symbol* signature() const                      { return constants()->symbol_at(signature_index()); }
   20.31    int signature_index() const                    { return constMethod()->signature_index();         }
   20.32    void set_signature_index(int index)            { constMethod()->set_signature_index(index);       }
   20.33  
   20.34    // generics support
   20.35 -  Symbol* generic_signature() const              { int idx = generic_signature_index(); return ((idx != 0) ? _constants->symbol_at(idx) : (Symbol*)NULL); }
   20.36 +  Symbol* generic_signature() const              { int idx = generic_signature_index(); return ((idx != 0) ? constants()->symbol_at(idx) : (Symbol*)NULL); }
   20.37    int generic_signature_index() const            { return constMethod()->generic_signature_index(); }
   20.38    void set_generic_signature_index(int index)    { constMethod()->set_generic_signature_index(index); }
   20.39  
   20.40 @@ -242,8 +240,8 @@
   20.41    }
   20.42  
   20.43    // constant pool for klassOop holding this method
   20.44 -  constantPoolOop constants() const              { return _constants; }
   20.45 -  void set_constants(constantPoolOop c)          { oop_store_without_check((oop*)&_constants, c); }
   20.46 +  constantPoolOop constants() const              { return constMethod()->constants(); }
   20.47 +  void set_constants(constantPoolOop c)          { constMethod()->set_constants(c); }
   20.48  
   20.49    // max stack
   20.50    int  max_stack() const                         { return _max_stack; }
   20.51 @@ -453,7 +451,7 @@
   20.52                         { return constMethod()->compressed_linenumber_table(); }
   20.53  
   20.54    // method holder (the klassOop holding this method)
   20.55 -  klassOop method_holder() const                 { return _constants->pool_holder(); }
   20.56 +  klassOop method_holder() const                 { return constants()->pool_holder(); }
   20.57  
   20.58    void compute_size_of_parameters(Thread *thread); // word size of parameters (receiver if any + arguments)
   20.59    Symbol* klass_name() const;                    // returns the name of the method holder
   20.60 @@ -544,7 +542,6 @@
   20.61  
   20.62    // interpreter support
   20.63    static ByteSize const_offset()                 { return byte_offset_of(methodOopDesc, _constMethod       ); }
   20.64 -  static ByteSize constants_offset()             { return byte_offset_of(methodOopDesc, _constants         ); }
   20.65    static ByteSize access_flags_offset()          { return byte_offset_of(methodOopDesc, _access_flags      ); }
   20.66  #ifdef CC_INTERP
   20.67    static ByteSize result_index_offset()          { return byte_offset_of(methodOopDesc, _result_index ); }
   20.68 @@ -723,7 +720,6 @@
   20.69  
   20.70    // Garbage collection support
   20.71    oop*  adr_constMethod() const                  { return (oop*)&_constMethod;     }
   20.72 -  oop*  adr_constants() const                    { return (oop*)&_constants;       }
   20.73    oop*  adr_method_data() const                  { return (oop*)&_method_data;     }
   20.74  };
   20.75  
    21.1 --- a/src/share/vm/runtime/vmStructs.cpp	Fri Jun 01 15:30:44 2012 -0700
    21.2 +++ b/src/share/vm/runtime/vmStructs.cpp	Wed Jun 06 14:33:43 2012 -0400
    21.3 @@ -358,7 +358,6 @@
    21.4    nonstatic_field(methodDataOopDesc,           _arg_stack,                                    intx)                                  \
    21.5    nonstatic_field(methodDataOopDesc,           _arg_returned,                                 intx)                                  \
    21.6    nonstatic_field(methodOopDesc,               _constMethod,                                  constMethodOop)                        \
    21.7 -  nonstatic_field(methodOopDesc,               _constants,                                    constantPoolOop)                       \
    21.8    nonstatic_field(methodOopDesc,               _method_data,                                  methodDataOop)                         \
    21.9    nonstatic_field(methodOopDesc,               _interpreter_invocation_count,                 int)                                   \
   21.10    nonstatic_field(methodOopDesc,               _access_flags,                                 AccessFlags)                           \
   21.11 @@ -378,7 +377,7 @@
   21.12    volatile_nonstatic_field(methodOopDesc,      _from_compiled_entry,                          address)                               \
   21.13    volatile_nonstatic_field(methodOopDesc,      _from_interpreted_entry,                       address)                               \
   21.14    volatile_nonstatic_field(constMethodOopDesc, _fingerprint,                                  uint64_t)                              \
   21.15 -  nonstatic_field(constMethodOopDesc,          _method,                                       methodOop)                             \
   21.16 +  nonstatic_field(constMethodOopDesc,          _constants,                                    constantPoolOop)                       \
   21.17    nonstatic_field(constMethodOopDesc,          _stackmap_data,                                typeArrayOop)                          \
   21.18    nonstatic_field(constMethodOopDesc,          _exception_table,                              typeArrayOop)                          \
   21.19    nonstatic_field(constMethodOopDesc,          _constMethod_size,                             int)                                   \

mercurial