8079775: Java 9-fastdebug ia32 Error: Unimplemented with "-XX:CompilationPolicyChoice=1 -XX:-TieredCompilation" options
authoriveresov
Tue, 30 Jun 2015 14:44:53 -0700
changeset 31521 f57b2ce43484
parent 31520 4a6cbcae9f46
child 31523 b445c291bae3
8079775: Java 9-fastdebug ia32 Error: Unimplemented with "-XX:CompilationPolicyChoice=1 -XX:-TieredCompilation" options 8079062: Java 9-fastdebug crash(hit assertion) with "-XX:CompilationPolicyChoice=1 -XX:-TieredCompilation" options Summary: Revive stack walk compilation policy Reviewed-by: kvn
hotspot/src/share/vm/runtime/arguments.cpp
hotspot/src/share/vm/runtime/compilationPolicy.cpp
hotspot/src/share/vm/runtime/rframe.cpp
hotspot/src/share/vm/runtime/rframe.hpp
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Tue Jun 30 12:12:18 2015 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Tue Jun 30 14:44:53 2015 -0700
@@ -3753,8 +3753,12 @@
   if (TieredCompilation) {
     set_tiered_flags();
   } else {
-    // Check if the policy is valid. Policies 0 and 1 are valid for non-tiered setup.
-    if (CompilationPolicyChoice >= 2) {
+    int max_compilation_policy_choice = 1;
+#ifdef COMPILER2
+    max_compilation_policy_choice = 2;
+#endif
+    // Check if the policy is valid.
+    if (CompilationPolicyChoice >= max_compilation_policy_choice) {
       vm_exit_during_initialization(
         "Incompatible compilation policy selected", NULL);
     }
--- a/hotspot/src/share/vm/runtime/compilationPolicy.cpp	Tue Jun 30 12:12:18 2015 -0700
+++ b/hotspot/src/share/vm/runtime/compilationPolicy.cpp	Tue Jun 30 14:44:53 2015 -0700
@@ -512,7 +512,7 @@
     RegisterMap reg_map(thread, false);
     javaVFrame* triggerVF = thread->last_java_vframe(&reg_map);
     // triggerVF is the frame that triggered its counter
-    RFrame* first = new InterpretedRFrame(triggerVF->fr(), thread, m);
+    RFrame* first = new InterpretedRFrame(triggerVF->fr(), thread, m());
 
     if (first->top_method()->code() != NULL) {
       // called obsolete method/nmethod -- no need to recompile
@@ -557,8 +557,8 @@
     if( !next )               // No next frame up the stack?
       break;                  // Then compile with current frame
 
-    methodHandle m = current->top_method();
-    methodHandle next_m = next->top_method();
+    Method* m = current->top_method();
+    Method* next_m = next->top_method();
 
     if (TraceCompilationPolicy && Verbose) {
       tty->print("[caller: ");
@@ -644,7 +644,7 @@
     if (TraceCompilationPolicy && Verbose) {
       tty->print("\n\t     check caller: ");
       next_m->print_short_name(tty);
-      tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", p2i((address)next_m()), next_m->code_size());
+      tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", p2i((address)next_m), next_m->code_size());
     }
 
     current = next;
--- a/hotspot/src/share/vm/runtime/rframe.cpp	Tue Jun 30 12:12:18 2015 -0700
+++ b/hotspot/src/share/vm/runtime/rframe.cpp	Tue Jun 30 14:44:53 2015 -0700
@@ -52,12 +52,12 @@
 : RFrame(fr, thread, callee) {
   RegisterMap map(thread, false);
   _vf     = javaVFrame::cast(vframe::new_vframe(&_fr, &map, thread));
-  _method = methodHandle(thread, _vf->method());
+  _method = _vf->method();
   assert(   _vf->is_interpreted_frame(), "must be interpreted");
   init();
 }
 
-InterpretedRFrame::InterpretedRFrame(frame fr, JavaThread* thread, methodHandle m)
+InterpretedRFrame::InterpretedRFrame(frame fr, JavaThread* thread, Method* m)
 : RFrame(fr, thread, NULL) {
   RegisterMap map(thread, false);
   _vf     = javaVFrame::cast(vframe::new_vframe(&_fr, &map, thread));
@@ -140,8 +140,8 @@
   _nm = compiledVFrame::cast(vf)->code();
   vf = vf->top();
   _vf = javaVFrame::cast(vf);
-  _method = methodHandle(thread(), CodeCache::find_nmethod(_fr.pc())->method());
-  assert(_method(), "should have found a method");
+  _method = CodeCache::find_nmethod(_fr.pc())->method();
+  assert(_method, "should have found a method");
 #ifndef PRODUCT
   _invocations = _method->compiled_invocation_count();
 #endif
--- a/hotspot/src/share/vm/runtime/rframe.hpp	Tue Jun 30 12:12:18 2015 -0700
+++ b/hotspot/src/share/vm/runtime/rframe.hpp	Tue Jun 30 14:44:53 2015 -0700
@@ -60,7 +60,7 @@
   frame fr() const                        { return _fr; }
   JavaThread* thread() const              { return _thread; }
   virtual int cost() const = 0;           // estimated inlining cost (size)
-  virtual methodHandle top_method() const  = 0;
+  virtual Method* top_method() const  = 0;
   virtual javaVFrame* top_vframe() const = 0;
   virtual nmethod* nm() const             { ShouldNotCallThis(); return NULL; }
 
@@ -79,7 +79,7 @@
  protected:
   nmethod*    _nm;
   javaVFrame* _vf;                        // top vframe; may be NULL (for most recent frame)
-  methodHandle _method;                   // top method
+  Method* _method;                        // top method
 
   CompiledRFrame(frame fr, JavaThread* thread, RFrame*const  callee);
   void init();
@@ -88,7 +88,7 @@
  public:
   CompiledRFrame(frame fr, JavaThread* thread); // for nmethod triggering its counter (callee == NULL)
   bool is_compiled() const                 { return true; }
-  methodHandle top_method() const          { return _method; }
+  Method* top_method() const               { return _method; }
   javaVFrame* top_vframe() const           { return _vf; }
   nmethod* nm() const                      { return _nm; }
   int cost() const;
@@ -98,16 +98,16 @@
 class InterpretedRFrame : public RFrame {    // interpreter frame
  protected:
   javaVFrame* _vf;                           // may be NULL (for most recent frame)
-  methodHandle   _method;
+  Method* _method;
 
   InterpretedRFrame(frame fr, JavaThread* thread, RFrame*const  callee);
   void init();
   friend class RFrame;
 
  public:
-  InterpretedRFrame(frame fr, JavaThread* thread, methodHandle m); // constructor for method triggering its invocation counter
+  InterpretedRFrame(frame fr, JavaThread* thread, Method* m); // constructor for method triggering its invocation counter
   bool is_interpreted() const                { return true; }
-  methodHandle top_method() const            { return _method; }
+  Method* top_method() const                 { return _method; }
   javaVFrame* top_vframe() const             { return _vf; }
   int cost() const;
   void print();