src/share/vm/runtime/deoptimization.cpp

changeset 4037
da91efe96a93
parent 3969
1d7922586cf6
child 4142
d8ce2825b193
child 4154
c3e799c37717
     1.1 --- a/src/share/vm/runtime/deoptimization.cpp	Fri Aug 31 16:39:35 2012 -0700
     1.2 +++ b/src/share/vm/runtime/deoptimization.cpp	Sat Sep 01 13:25:18 2012 -0400
     1.3 @@ -34,7 +34,7 @@
     1.4  #include "memory/allocation.inline.hpp"
     1.5  #include "memory/oopFactory.hpp"
     1.6  #include "memory/resourceArea.hpp"
     1.7 -#include "oops/methodOop.hpp"
     1.8 +#include "oops/method.hpp"
     1.9  #include "oops/oop.inline.hpp"
    1.10  #include "prims/jvmtiThreadState.hpp"
    1.11  #include "runtime/biasedLocking.hpp"
    1.12 @@ -748,11 +748,11 @@
    1.13      assert(objects->at(i)->is_object(), "invalid debug information");
    1.14      ObjectValue* sv = (ObjectValue*) objects->at(i);
    1.15  
    1.16 -    KlassHandle k(((ConstantOopReadValue*) sv->klass())->value()());
    1.17 +    KlassHandle k(java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()()));
    1.18      oop obj = NULL;
    1.19  
    1.20      if (k->oop_is_instance()) {
    1.21 -      instanceKlass* ik = instanceKlass::cast(k());
    1.22 +      InstanceKlass* ik = InstanceKlass::cast(k());
    1.23        obj = ik->allocate_instance(CHECK_(false));
    1.24      } else if (k->oop_is_typeArray()) {
    1.25        typeArrayKlass* ak = typeArrayKlass::cast(k());
    1.26 @@ -782,7 +782,7 @@
    1.27    frame* _fr;
    1.28    RegisterMap* _reg_map;
    1.29    ObjectValue* _sv;
    1.30 -  instanceKlass* _ik;
    1.31 +  InstanceKlass* _ik;
    1.32    oop _obj;
    1.33  
    1.34    int _i;
    1.35 @@ -914,12 +914,12 @@
    1.36  void Deoptimization::reassign_fields(frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects) {
    1.37    for (int i = 0; i < objects->length(); i++) {
    1.38      ObjectValue* sv = (ObjectValue*) objects->at(i);
    1.39 -    KlassHandle k(((ConstantOopReadValue*) sv->klass())->value()());
    1.40 +    KlassHandle k(java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()()));
    1.41      Handle obj = sv->value();
    1.42      assert(obj.not_null(), "reallocation was missed");
    1.43  
    1.44      if (k->oop_is_instance()) {
    1.45 -      instanceKlass* ik = instanceKlass::cast(k());
    1.46 +      InstanceKlass* ik = InstanceKlass::cast(k());
    1.47        FieldReassigner reassign(fr, reg_map, sv, obj());
    1.48        ik->do_nonstatic_fields(&reassign);
    1.49      } else if (k->oop_is_typeArray()) {
    1.50 @@ -965,11 +965,11 @@
    1.51  
    1.52    for (int i = 0; i < objects->length(); i++) {
    1.53      ObjectValue* sv = (ObjectValue*) objects->at(i);
    1.54 -    KlassHandle k(((ConstantOopReadValue*) sv->klass())->value()());
    1.55 +    KlassHandle k(java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()()));
    1.56      Handle obj = sv->value();
    1.57  
    1.58      tty->print("     object <" INTPTR_FORMAT "> of type ", sv->value()());
    1.59 -    k->as_klassOop()->print_value();
    1.60 +    k->print_value();
    1.61      tty->print(" allocated (%d bytes)", obj->size() * HeapWordSize);
    1.62      tty->cr();
    1.63  
    1.64 @@ -1182,13 +1182,13 @@
    1.65  void Deoptimization::load_class_by_index(constantPoolHandle constant_pool, int index, TRAPS) {
    1.66    // in case of an unresolved klass entry, load the class.
    1.67    if (constant_pool->tag_at(index).is_unresolved_klass()) {
    1.68 -    klassOop tk = constant_pool->klass_at(index, CHECK);
    1.69 +    Klass* tk = constant_pool->klass_at(index, CHECK);
    1.70      return;
    1.71    }
    1.72  
    1.73    if (!constant_pool->tag_at(index).is_symbol()) return;
    1.74  
    1.75 -  Handle class_loader (THREAD, instanceKlass::cast(constant_pool->pool_holder())->class_loader());
    1.76 +  Handle class_loader (THREAD, InstanceKlass::cast(constant_pool->pool_holder())->class_loader());
    1.77    Symbol*  symbol  = constant_pool->symbol_at(index);
    1.78  
    1.79    // class name?
    1.80 @@ -1268,8 +1268,8 @@
    1.81      // Ensure that we can record deopt. history:
    1.82      bool create_if_missing = ProfileTraps;
    1.83  
    1.84 -    methodDataHandle trap_mdo
    1.85 -      (THREAD, get_method_data(thread, trap_method, create_if_missing));
    1.86 +    MethodData* trap_mdo =
    1.87 +      get_method_data(thread, trap_method, create_if_missing);
    1.88  
    1.89      // Print a bunch of diagnostics, if requested.
    1.90      if (TraceDeoptimization || LogCompilation) {
    1.91 @@ -1297,7 +1297,7 @@
    1.92          if (xtty != NULL)
    1.93            xtty->name(class_name);
    1.94        }
    1.95 -      if (xtty != NULL && trap_mdo.not_null()) {
    1.96 +      if (xtty != NULL && trap_mdo != NULL) {
    1.97          // Dump the relevant MDO state.
    1.98          // This is the deopt count for the current reason, any previous
    1.99          // reasons or recompiles seen at this point.
   1.100 @@ -1380,7 +1380,7 @@
   1.101      //   PerMethodRecompilationCutoff, the method is abandoned.
   1.102      //   This should only happen if the method is very large and has
   1.103      //   many "lukewarm" deoptimizations.  The code which enforces this
   1.104 -    //   limit is elsewhere (class nmethod, class methodOopDesc).
   1.105 +    //   limit is elsewhere (class nmethod, class Method).
   1.106      //
   1.107      // Note that the per-BCI 'is_recompiled' bit gives the compiler one chance
   1.108      // to recompile at each bytecode independently of the per-BCI cutoff.
   1.109 @@ -1449,15 +1449,15 @@
   1.110      // Setting +ProfileTraps fixes the following, on all platforms:
   1.111      // 4852688: ProfileInterpreter is off by default for ia64.  The result is
   1.112      // infinite heroic-opt-uncommon-trap/deopt/recompile cycles, since the
   1.113 -    // recompile relies on a methodDataOop to record heroic opt failures.
   1.114 +    // recompile relies on a MethodData* to record heroic opt failures.
   1.115  
   1.116      // Whether the interpreter is producing MDO data or not, we also need
   1.117      // to use the MDO to detect hot deoptimization points and control
   1.118      // aggressive optimization.
   1.119      bool inc_recompile_count = false;
   1.120      ProfileData* pdata = NULL;
   1.121 -    if (ProfileTraps && update_trap_state && trap_mdo.not_null()) {
   1.122 -      assert(trap_mdo() == get_method_data(thread, trap_method, false), "sanity");
   1.123 +    if (ProfileTraps && update_trap_state && trap_mdo != NULL) {
   1.124 +      assert(trap_mdo == get_method_data(thread, trap_method, false), "sanity");
   1.125        uint this_trap_count = 0;
   1.126        bool maybe_prior_trap = false;
   1.127        bool maybe_prior_recompile = false;
   1.128 @@ -1573,15 +1573,15 @@
   1.129  }
   1.130  JRT_END
   1.131  
   1.132 -methodDataOop
   1.133 +MethodData*
   1.134  Deoptimization::get_method_data(JavaThread* thread, methodHandle m,
   1.135                                  bool create_if_missing) {
   1.136    Thread* THREAD = thread;
   1.137 -  methodDataOop mdo = m()->method_data();
   1.138 +  MethodData* mdo = m()->method_data();
   1.139    if (mdo == NULL && create_if_missing && !HAS_PENDING_EXCEPTION) {
   1.140      // Build an MDO.  Ignore errors like OutOfMemory;
   1.141      // that simply means we won't have an MDO to update.
   1.142 -    methodOopDesc::build_interpreter_method_data(m, THREAD);
   1.143 +    Method::build_interpreter_method_data(m, THREAD);
   1.144      if (HAS_PENDING_EXCEPTION) {
   1.145        assert((PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())), "we expect only an OOM error here");
   1.146        CLEAR_PENDING_EXCEPTION;
   1.147 @@ -1592,7 +1592,7 @@
   1.148  }
   1.149  
   1.150  ProfileData*
   1.151 -Deoptimization::query_update_method_data(methodDataHandle trap_mdo,
   1.152 +Deoptimization::query_update_method_data(MethodData* trap_mdo,
   1.153                                           int trap_bci,
   1.154                                           Deoptimization::DeoptReason reason,
   1.155                                           //outputs:
   1.156 @@ -1652,7 +1652,7 @@
   1.157  }
   1.158  
   1.159  void
   1.160 -Deoptimization::update_method_data_from_interpreter(methodDataHandle trap_mdo, int trap_bci, int reason) {
   1.161 +Deoptimization::update_method_data_from_interpreter(MethodData* trap_mdo, int trap_bci, int reason) {
   1.162    ResourceMark rm;
   1.163    // Ignored outputs:
   1.164    uint ignore_this_trap_count;
   1.165 @@ -1940,7 +1940,7 @@
   1.166  }
   1.167  
   1.168  void
   1.169 -Deoptimization::update_method_data_from_interpreter(methodDataHandle trap_mdo, int trap_bci, int reason) {
   1.170 +Deoptimization::update_method_data_from_interpreter(MethodData* trap_mdo, int trap_bci, int reason) {
   1.171    // no udpate
   1.172  }
   1.173  

mercurial