changeset 471:22a0e2e50ec4

meth-lazy: fix for intermittent exceptions of various kinds and crashes
author twisti
date Wed, 11 Jul 2012 15:32:12 -0700
parents 89687e50c4e9
children 34aa8c19bcaa
files meth-lazy-7023639.patch
diffstat 1 files changed, 41 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/meth-lazy-7023639.patch	Wed Jul 11 04:51:47 2012 -0700
+++ b/meth-lazy-7023639.patch	Wed Jul 11 15:32:12 2012 -0700
@@ -14767,7 +14767,7 @@
 +      ConstantPoolCacheEntry* cpce = pool->cache()->secondary_entry_at(index);
 +      if (!cpce->is_f1_null()) {
 +        methodHandle method(THREAD, cpce->f2_as_vfinal_method());
-+        Handle appendix(THREAD, cpce->has_appendix() ? cpce->f1_appendix() : NULL);
++        Handle appendix(THREAD, cpce->has_appendix() ? cpce->f1_appendix() : (oop)NULL);
 +        result.set_handle(method, appendix, CHECK);
 +        return;
 +      }
@@ -16917,20 +16917,21 @@
      return NULL;
    }
  
-@@ -463,6 +435,12 @@
+@@ -463,6 +435,13 @@
      return NULL;
    }
  
-+  // Always inline ForceInline methods.
-+  if (callee_method->force_inline()) {
-+    if (PrintInlining)  print_inlining(callee_method, caller_bci, "force inline by annotation");
-+    return WarmCallInfo::always_hot();
-+  }
++  // XXX this is probably to much
++//  // Always inline ForceInline methods.
++//  if (callee_method->force_inline()) {
++//    if (PrintInlining)  print_inlining(callee_method, caller_bci, "force inline by annotation");
++//    return WarmCallInfo::always_hot();
++//  }
 +
    // Check if inlining policy says no.
    WarmCallInfo wci = *(initial_wci);
    failure_msg = try_to_inline(callee_method, caller_method, caller_bci, profile, &wci);
-@@ -539,9 +517,10 @@
+@@ -539,9 +518,10 @@
    }
    int max_inline_level_adjust = 0;
    if (caller_jvms->method() != NULL) {
@@ -16943,7 +16944,7 @@
        max_inline_level_adjust += 1;  // don't count method handle calls from java.lang.invoke implem
      }
      if (max_inline_level_adjust != 0 && PrintInlining && (Verbose || WizardMode)) {
-@@ -590,7 +569,7 @@
+@@ -590,7 +570,7 @@
  // Given a jvms, which determines a call chain from the root method,
  // find the corresponding inline tree.
  // Note: This method will be removed or replaced as InlineTree goes away.
@@ -16952,7 +16953,7 @@
    InlineTree* iltp = root;
    uint depth = jvms && jvms->has_method() ? jvms->depth() : 0;
    for (uint d = 1; d <= depth; d++) {
-@@ -599,12 +578,12 @@
+@@ -599,12 +579,12 @@
      assert(jvmsp->method() == iltp->method(), "tree still in sync");
      ciMethod* d_callee = (d == depth) ? callee : jvms->of_depth(d+1)->method();
      InlineTree* sub = iltp->callee_at(jvmsp->bci(), d_callee);
@@ -25601,15 +25602,30 @@
  #endif /* ASSERT */
  
    methodHandle callee_method;
-@@ -1333,7 +1307,6 @@
+@@ -1320,21 +1294,9 @@
+   address   sender_pc = caller_frame.pc();
+   CodeBlob* sender_cb = caller_frame.cb();
+   nmethod*  sender_nm = sender_cb->as_nmethod_or_null();
+-  bool is_mh_invoke_via_adapter = false;  // Direct c2c call or via adapter?
+-  if (sender_nm != NULL && sender_nm->is_method_handle_return(sender_pc)) {
+-    // If the callee_target is set, then we have come here via an i2c
+-    // adapter.
+-    methodOop callee = thread->callee_target();
+-    if (callee != NULL) {
+-      assert(callee->is_method(), "sanity");
+-      is_mh_invoke_via_adapter = true;
+-    }
+-  }
  
    if (caller_frame.is_interpreted_frame() ||
-       caller_frame.is_entry_frame()       ||
+-      caller_frame.is_entry_frame()       ||
 -      caller_frame.is_ricochet_frame()    ||
-       is_mh_invoke_via_adapter) {
+-      is_mh_invoke_via_adapter) {
++      caller_frame.is_entry_frame()) {
      methodOop callee = thread->callee_target();
      guarantee(callee != NULL && callee->is_method(), "bad handshake");
-@@ -1677,12 +1650,6 @@
+     thread->set_vm_result(callee);
+@@ -1677,12 +1639,6 @@
    // Get the return PC for the passed caller PC.
    address return_pc = caller_pc + frame::pc_return_offset;
  
@@ -25622,7 +25638,7 @@
    // There is a benign race here. We could be attempting to patch to a compiled
    // entry point at the same time the callee is being deoptimized. If that is
    // the case then entry_point may in fact point to a c2i and we'd patch the
-@@ -1788,97 +1755,6 @@
+@@ -1788,97 +1744,6 @@
    return generate_class_cast_message(objName, targetKlass->external_name());
  }
  
@@ -25720,7 +25736,7 @@
  char* SharedRuntime::generate_class_cast_message(
      const char* objName, const char* targetKlassName, const char* desc) {
    size_t msglen = strlen(objName) + strlen(desc) + strlen(targetKlassName) + 1;
-@@ -2119,8 +1995,17 @@
+@@ -2119,8 +1984,17 @@
  // that allows sharing of adapters for the same calling convention.
  class AdapterFingerPrint : public CHeapObj {
   private:
@@ -25739,7 +25755,7 @@
      int* _fingerprint;
    } _value;
    int _length; // A negative length indicates the fingerprint is in the compact form,
-@@ -2129,8 +2014,7 @@
+@@ -2129,8 +2003,7 @@
    // Remap BasicTypes that are handled equivalently by the adapters.
    // These are correct for the current system but someday it might be
    // necessary to make this mapping platform dependent.
@@ -25749,7 +25765,7 @@
      switch(in) {
        case T_BOOLEAN:
        case T_BYTE:
-@@ -2141,6 +2025,8 @@
+@@ -2141,6 +2014,8 @@
  
        case T_OBJECT:
        case T_ARRAY:
@@ -25758,7 +25774,7 @@
  #ifdef _LP64
          return T_LONG;
  #else
-@@ -2165,8 +2051,9 @@
+@@ -2165,8 +2040,9 @@
      // The fingerprint is based on the BasicType signature encoded
      // into an array of ints with eight entries per int.
      int* ptr;
@@ -25770,7 +25786,7 @@
        _value._compact[0] = _value._compact[1] = _value._compact[2] = 0;
        // Storing the signature encoded as signed chars hits about 98%
        // of the time.
-@@ -2182,10 +2069,12 @@
+@@ -2182,10 +2058,12 @@
      int sig_index = 0;
      for (int index = 0; index < len; index++) {
        int value = 0;
@@ -25787,7 +25803,7 @@
        }
        ptr[index] = value;
      }
-@@ -2235,6 +2124,7 @@
+@@ -2235,6 +2113,7 @@
        return false;
      }
      if (_length < 0) {
@@ -25795,7 +25811,7 @@
        return _value._compact[0] == other->_value._compact[0] &&
               _value._compact[1] == other->_value._compact[1] &&
               _value._compact[2] == other->_value._compact[2];
-@@ -2531,13 +2421,17 @@
+@@ -2531,13 +2410,17 @@
      entry->relocate(B->content_begin());
  #ifndef PRODUCT
      // debugging suppport
@@ -25818,7 +25834,7 @@
      }
  #endif
  
-@@ -2561,11 +2455,25 @@
+@@ -2561,11 +2444,25 @@
    return entry;
  }
  
@@ -25845,7 +25861,7 @@
  }
  
  
-@@ -2614,7 +2522,9 @@
+@@ -2614,7 +2511,9 @@
    ResourceMark rm;
    nmethod* nm = NULL;
  
@@ -25856,7 +25872,7 @@
  
    {
      // perform the work while holding the lock, but perform any printing outside the lock
-@@ -2939,18 +2849,22 @@
+@@ -2939,18 +2838,22 @@
    AdapterHandlerTableIterator iter(_adapters);
    while (iter.has_next()) {
      AdapterHandlerEntry* a = iter.next();