src/share/vm/runtime/frame.cpp

changeset 4037
da91efe96a93
parent 3969
1d7922586cf6
child 4298
d0aa87f04bd5
child 4318
cd3d6a6b95d9
     1.1 --- a/src/share/vm/runtime/frame.cpp	Fri Aug 31 16:39:35 2012 -0700
     1.2 +++ b/src/share/vm/runtime/frame.cpp	Sat Sep 01 13:25:18 2012 -0400
     1.3 @@ -29,8 +29,8 @@
     1.4  #include "memory/resourceArea.hpp"
     1.5  #include "memory/universe.inline.hpp"
     1.6  #include "oops/markOop.hpp"
     1.7 -#include "oops/methodDataOop.hpp"
     1.8 -#include "oops/methodOop.hpp"
     1.9 +#include "oops/methodData.hpp"
    1.10 +#include "oops/method.hpp"
    1.11  #include "oops/oop.inline.hpp"
    1.12  #include "oops/oop.inline2.hpp"
    1.13  #include "prims/methodHandles.hpp"
    1.14 @@ -383,15 +383,15 @@
    1.15    *interpreter_frame_locals_addr() = locs;
    1.16  }
    1.17  
    1.18 -methodOop frame::interpreter_frame_method() const {
    1.19 +Method* frame::interpreter_frame_method() const {
    1.20    assert(is_interpreted_frame(), "interpreted frame expected");
    1.21 -  methodOop m = *interpreter_frame_method_addr();
    1.22 -  assert(m->is_perm(), "bad methodOop in interpreter frame");
    1.23 -  assert(m->is_method(), "not a methodOop");
    1.24 +  Method* m = *interpreter_frame_method_addr();
    1.25 +  assert(m->is_metadata(), "bad Method* in interpreter frame");
    1.26 +  assert(m->is_method(), "not a Method*");
    1.27    return m;
    1.28  }
    1.29  
    1.30 -void frame::interpreter_frame_set_method(methodOop method) {
    1.31 +void frame::interpreter_frame_set_method(Method* method) {
    1.32    assert(is_interpreted_frame(), "interpreted frame expected");
    1.33    *interpreter_frame_method_addr() = method;
    1.34  }
    1.35 @@ -410,7 +410,7 @@
    1.36          if (!is_now_bci) {
    1.37            // The bcx was just converted from bci to bcp.
    1.38            // Convert the mdx in parallel.
    1.39 -          methodDataOop mdo = interpreter_frame_method()->method_data();
    1.40 +          MethodData* mdo = interpreter_frame_method()->method_data();
    1.41            assert(mdo != NULL, "");
    1.42            int mdi = mdx - 1; // We distinguish valid mdi from zero by adding one.
    1.43            address mdp = mdo->di_to_dp(mdi);
    1.44 @@ -420,7 +420,7 @@
    1.45          if (is_now_bci) {
    1.46            // The bcx was just converted from bcp to bci.
    1.47            // Convert the mdx in parallel.
    1.48 -          methodDataOop mdo = interpreter_frame_method()->method_data();
    1.49 +          MethodData* mdo = interpreter_frame_method()->method_data();
    1.50            assert(mdo != NULL, "");
    1.51            int mdi = mdo->dp_to_di((address)mdx);
    1.52            interpreter_frame_set_mdx((intptr_t)mdi + 1); // distinguish valid from 0.
    1.53 @@ -691,7 +691,7 @@
    1.54  void frame::print_on_error(outputStream* st, char* buf, int buflen, bool verbose) const {
    1.55    if (_cb != NULL) {
    1.56      if (Interpreter::contains(pc())) {
    1.57 -      methodOop m = this->interpreter_frame_method();
    1.58 +      Method* m = this->interpreter_frame_method();
    1.59        if (m != NULL) {
    1.60          m->name_and_sig_as_C_string(buf, buflen);
    1.61          st->print("j  %s", buf);
    1.62 @@ -709,7 +709,7 @@
    1.63      } else if (_cb->is_buffer_blob()) {
    1.64        st->print("v  ~BufferBlob::%s", ((BufferBlob *)_cb)->name());
    1.65      } else if (_cb->is_nmethod()) {
    1.66 -      methodOop m = ((nmethod *)_cb)->method();
    1.67 +      Method* m = ((nmethod *)_cb)->method();
    1.68        if (m != NULL) {
    1.69          m->name_and_sig_as_C_string(buf, buflen);
    1.70          st->print("J  %s", buf);
    1.71 @@ -736,8 +736,8 @@
    1.72  /*
    1.73    The interpreter_frame_expression_stack_at method in the case of SPARC needs the
    1.74    max_stack value of the method in order to compute the expression stack address.
    1.75 -  It uses the methodOop in order to get the max_stack value but during GC this
    1.76 -  methodOop value saved on the frame is changed by reverse_and_push and hence cannot
    1.77 +  It uses the Method* in order to get the max_stack value but during GC this
    1.78 +  Method* value saved on the frame is changed by reverse_and_push and hence cannot
    1.79    be used. So we save the max_stack value in the FrameClosure object and pass it
    1.80    down to the interpreter_frame_expression_stack_at method
    1.81  */
    1.82 @@ -886,9 +886,12 @@
    1.83    methodHandle m (thread, interpreter_frame_method());
    1.84    jint      bci = interpreter_frame_bci();
    1.85  
    1.86 -  assert(Universe::heap()->is_in(m()), "must be valid oop");
    1.87 +  assert(!Universe::heap()->is_in(m()),
    1.88 +          "must be valid oop");
    1.89    assert(m->is_method(), "checking frame value");
    1.90 -  assert((m->is_native() && bci == 0)  || (!m->is_native() && bci >= 0 && bci < m->code_size()), "invalid bci value");
    1.91 +  assert((m->is_native() && bci == 0)  ||
    1.92 +         (!m->is_native() && bci >= 0 && bci < m->code_size()),
    1.93 +         "invalid bci value");
    1.94  
    1.95    // Handle the monitor elements in the activation
    1.96    for (
    1.97 @@ -903,23 +906,10 @@
    1.98    }
    1.99  
   1.100    // process fixed part
   1.101 -  f->do_oop((oop*)interpreter_frame_method_addr());
   1.102 -  f->do_oop((oop*)interpreter_frame_cache_addr());
   1.103 -
   1.104 -  // Hmm what about the mdp?
   1.105 -#ifdef CC_INTERP
   1.106 -  // Interpreter frame in the midst of a call have a methodOop within the
   1.107 -  // object.
   1.108 -  interpreterState istate = get_interpreterState();
   1.109 -  if (istate->msg() == BytecodeInterpreter::call_method) {
   1.110 -    f->do_oop((oop*)&istate->_result._to_call._callee);
   1.111 -  }
   1.112 -
   1.113 -#endif /* CC_INTERP */
   1.114 -
   1.115  #if !defined(PPC) || defined(ZERO)
   1.116    if (m->is_native()) {
   1.117  #ifdef CC_INTERP
   1.118 +    interpreterState istate = get_interpreterState();
   1.119      f->do_oop((oop*)&istate->_oop_temp);
   1.120  #else
   1.121      f->do_oop((oop*)( fp() + interpreter_frame_oop_temp_offset ));
   1.122 @@ -1148,9 +1138,19 @@
   1.123  }
   1.124  
   1.125  
   1.126 +// call f() on the interpreted Method*s in the stack.
   1.127 +// Have to walk the entire code cache for the compiled frames Yuck.
   1.128 +void frame::metadata_do(void f(Metadata*)) {
   1.129 +  if (_cb != NULL && Interpreter::contains(pc())) {
   1.130 +    Method* m = this->interpreter_frame_method();
   1.131 +    assert(m != NULL, "huh?");
   1.132 +    f(m);
   1.133 +  }
   1.134 +}
   1.135 +
   1.136  void frame::gc_prologue() {
   1.137    if (is_interpreted_frame()) {
   1.138 -    // set bcx to bci to become methodOop position independent during GC
   1.139 +    // set bcx to bci to become Method* position independent during GC
   1.140      interpreter_frame_set_bcx(interpreter_frame_bci());
   1.141    }
   1.142  }
   1.143 @@ -1225,7 +1225,7 @@
   1.144  void frame::zap_dead_interpreted_locals(JavaThread *thread, const RegisterMap* map) {
   1.145    // get current interpreter 'pc'
   1.146    assert(is_interpreted_frame(), "Not an interpreted frame");
   1.147 -  methodOop m   = interpreter_frame_method();
   1.148 +  Method* m   = interpreter_frame_method();
   1.149    int       bci = interpreter_frame_bci();
   1.150  
   1.151    int max_locals = m->is_native() ? m->size_of_parameters() : m->max_locals();
   1.152 @@ -1269,7 +1269,7 @@
   1.153  void frame::verify(const RegisterMap* map) {
   1.154    // for now make sure receiver type is correct
   1.155    if (is_interpreted_frame()) {
   1.156 -    methodOop method = interpreter_frame_method();
   1.157 +    Method* method = interpreter_frame_method();
   1.158      guarantee(method->is_method(), "method is wrong in frame::verify");
   1.159      if (!method->is_static()) {
   1.160        // fetch the receiver
   1.161 @@ -1334,7 +1334,7 @@
   1.162    }
   1.163  
   1.164    if (is_interpreted_frame()) {
   1.165 -    methodOop m = interpreter_frame_method();
   1.166 +    Method* m = interpreter_frame_method();
   1.167      int bci = interpreter_frame_bci();
   1.168  
   1.169      // Label the method and current bci

mercurial