hotspot/src/share/vm/runtime/deoptimization.cpp
changeset 13728 882756847a04
parent 13391 30245956af37
child 13964 01a2b863cc61
child 13952 e3cf184080bc
--- a/hotspot/src/share/vm/runtime/deoptimization.cpp	Fri Aug 31 16:39:35 2012 -0700
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp	Sat Sep 01 13:25:18 2012 -0400
@@ -34,7 +34,7 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
-#include "oops/methodOop.hpp"
+#include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/jvmtiThreadState.hpp"
 #include "runtime/biasedLocking.hpp"
@@ -748,11 +748,11 @@
     assert(objects->at(i)->is_object(), "invalid debug information");
     ObjectValue* sv = (ObjectValue*) objects->at(i);
 
-    KlassHandle k(((ConstantOopReadValue*) sv->klass())->value()());
+    KlassHandle k(java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()()));
     oop obj = NULL;
 
     if (k->oop_is_instance()) {
-      instanceKlass* ik = instanceKlass::cast(k());
+      InstanceKlass* ik = InstanceKlass::cast(k());
       obj = ik->allocate_instance(CHECK_(false));
     } else if (k->oop_is_typeArray()) {
       typeArrayKlass* ak = typeArrayKlass::cast(k());
@@ -782,7 +782,7 @@
   frame* _fr;
   RegisterMap* _reg_map;
   ObjectValue* _sv;
-  instanceKlass* _ik;
+  InstanceKlass* _ik;
   oop _obj;
 
   int _i;
@@ -914,12 +914,12 @@
 void Deoptimization::reassign_fields(frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects) {
   for (int i = 0; i < objects->length(); i++) {
     ObjectValue* sv = (ObjectValue*) objects->at(i);
-    KlassHandle k(((ConstantOopReadValue*) sv->klass())->value()());
+    KlassHandle k(java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()()));
     Handle obj = sv->value();
     assert(obj.not_null(), "reallocation was missed");
 
     if (k->oop_is_instance()) {
-      instanceKlass* ik = instanceKlass::cast(k());
+      InstanceKlass* ik = InstanceKlass::cast(k());
       FieldReassigner reassign(fr, reg_map, sv, obj());
       ik->do_nonstatic_fields(&reassign);
     } else if (k->oop_is_typeArray()) {
@@ -965,11 +965,11 @@
 
   for (int i = 0; i < objects->length(); i++) {
     ObjectValue* sv = (ObjectValue*) objects->at(i);
-    KlassHandle k(((ConstantOopReadValue*) sv->klass())->value()());
+    KlassHandle k(java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()()));
     Handle obj = sv->value();
 
     tty->print("     object <" INTPTR_FORMAT "> of type ", sv->value()());
-    k->as_klassOop()->print_value();
+    k->print_value();
     tty->print(" allocated (%d bytes)", obj->size() * HeapWordSize);
     tty->cr();
 
@@ -1182,13 +1182,13 @@
 void Deoptimization::load_class_by_index(constantPoolHandle constant_pool, int index, TRAPS) {
   // in case of an unresolved klass entry, load the class.
   if (constant_pool->tag_at(index).is_unresolved_klass()) {
-    klassOop tk = constant_pool->klass_at(index, CHECK);
+    Klass* tk = constant_pool->klass_at(index, CHECK);
     return;
   }
 
   if (!constant_pool->tag_at(index).is_symbol()) return;
 
-  Handle class_loader (THREAD, instanceKlass::cast(constant_pool->pool_holder())->class_loader());
+  Handle class_loader (THREAD, InstanceKlass::cast(constant_pool->pool_holder())->class_loader());
   Symbol*  symbol  = constant_pool->symbol_at(index);
 
   // class name?
@@ -1268,8 +1268,8 @@
     // Ensure that we can record deopt. history:
     bool create_if_missing = ProfileTraps;
 
-    methodDataHandle trap_mdo
-      (THREAD, get_method_data(thread, trap_method, create_if_missing));
+    MethodData* trap_mdo =
+      get_method_data(thread, trap_method, create_if_missing);
 
     // Print a bunch of diagnostics, if requested.
     if (TraceDeoptimization || LogCompilation) {
@@ -1297,7 +1297,7 @@
         if (xtty != NULL)
           xtty->name(class_name);
       }
-      if (xtty != NULL && trap_mdo.not_null()) {
+      if (xtty != NULL && trap_mdo != NULL) {
         // Dump the relevant MDO state.
         // This is the deopt count for the current reason, any previous
         // reasons or recompiles seen at this point.
@@ -1380,7 +1380,7 @@
     //   PerMethodRecompilationCutoff, the method is abandoned.
     //   This should only happen if the method is very large and has
     //   many "lukewarm" deoptimizations.  The code which enforces this
-    //   limit is elsewhere (class nmethod, class methodOopDesc).
+    //   limit is elsewhere (class nmethod, class Method).
     //
     // Note that the per-BCI 'is_recompiled' bit gives the compiler one chance
     // to recompile at each bytecode independently of the per-BCI cutoff.
@@ -1449,15 +1449,15 @@
     // Setting +ProfileTraps fixes the following, on all platforms:
     // 4852688: ProfileInterpreter is off by default for ia64.  The result is
     // infinite heroic-opt-uncommon-trap/deopt/recompile cycles, since the
-    // recompile relies on a methodDataOop to record heroic opt failures.
+    // recompile relies on a MethodData* to record heroic opt failures.
 
     // Whether the interpreter is producing MDO data or not, we also need
     // to use the MDO to detect hot deoptimization points and control
     // aggressive optimization.
     bool inc_recompile_count = false;
     ProfileData* pdata = NULL;
-    if (ProfileTraps && update_trap_state && trap_mdo.not_null()) {
-      assert(trap_mdo() == get_method_data(thread, trap_method, false), "sanity");
+    if (ProfileTraps && update_trap_state && trap_mdo != NULL) {
+      assert(trap_mdo == get_method_data(thread, trap_method, false), "sanity");
       uint this_trap_count = 0;
       bool maybe_prior_trap = false;
       bool maybe_prior_recompile = false;
@@ -1573,15 +1573,15 @@
 }
 JRT_END
 
-methodDataOop
+MethodData*
 Deoptimization::get_method_data(JavaThread* thread, methodHandle m,
                                 bool create_if_missing) {
   Thread* THREAD = thread;
-  methodDataOop mdo = m()->method_data();
+  MethodData* mdo = m()->method_data();
   if (mdo == NULL && create_if_missing && !HAS_PENDING_EXCEPTION) {
     // Build an MDO.  Ignore errors like OutOfMemory;
     // that simply means we won't have an MDO to update.
-    methodOopDesc::build_interpreter_method_data(m, THREAD);
+    Method::build_interpreter_method_data(m, THREAD);
     if (HAS_PENDING_EXCEPTION) {
       assert((PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())), "we expect only an OOM error here");
       CLEAR_PENDING_EXCEPTION;
@@ -1592,7 +1592,7 @@
 }
 
 ProfileData*
-Deoptimization::query_update_method_data(methodDataHandle trap_mdo,
+Deoptimization::query_update_method_data(MethodData* trap_mdo,
                                          int trap_bci,
                                          Deoptimization::DeoptReason reason,
                                          //outputs:
@@ -1652,7 +1652,7 @@
 }
 
 void
-Deoptimization::update_method_data_from_interpreter(methodDataHandle trap_mdo, int trap_bci, int reason) {
+Deoptimization::update_method_data_from_interpreter(MethodData* trap_mdo, int trap_bci, int reason) {
   ResourceMark rm;
   // Ignored outputs:
   uint ignore_this_trap_count;
@@ -1940,7 +1940,7 @@
 }
 
 void
-Deoptimization::update_method_data_from_interpreter(methodDataHandle trap_mdo, int trap_bci, int reason) {
+Deoptimization::update_method_data_from_interpreter(MethodData* trap_mdo, int trap_bci, int reason) {
   // no udpate
 }