changeset 486:65906046e5fd

meth-lazy: update for review comments
author twisti
date Wed, 18 Jul 2012 17:11:47 -0700
parents 9717ee54c9f5
children 88f29874d717
files meth-lazy-7023639.review.patch
diffstat 1 files changed, 73 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/meth-lazy-7023639.review.patch	Tue Jul 17 17:00:57 2012 -0700
+++ b/meth-lazy-7023639.review.patch	Wed Jul 18 17:11:47 2012 -0700
@@ -298,6 +298,40 @@
  
    return stack->sp() + argument_slots;
  }
+diff --git a/src/share/vm/asm/register.hpp b/src/share/vm/asm/register.hpp
+--- a/src/share/vm/asm/register.hpp
++++ b/src/share/vm/asm/register.hpp
+@@ -222,4 +222,30 @@
+   );
+ }
+ 
++
++inline void assert_different_registers(
++  AbstractRegister a,
++  AbstractRegister b,
++  AbstractRegister c,
++  AbstractRegister d,
++  AbstractRegister e,
++  AbstractRegister f,
++  AbstractRegister g,
++  AbstractRegister h,
++  AbstractRegister i
++) {
++  assert(
++    a != b && a != c && a != d && a != e && a != f && a != g && a != h && a != i
++           && b != c && b != d && b != e && b != f && b != g && b != h && b != i
++                     && c != d && c != e && c != f && c != g && c != h && c != i
++                               && d != e && d != f && d != g && d != h && d != i
++                                         && e != f && e != g && e != h && e != i
++                                                   && f != g && f != h && f != i
++                                                             && g != h && g != i
++                                                                       && h != i,
++    err_msg("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d, i=%d",
++            a, b, c, d, e, f, g, h, i)
++  );
++}
++
+ #endif // SHARE_VM_ASM_REGISTER_HPP
 diff --git a/src/share/vm/c1/c1_FrameMap.cpp b/src/share/vm/c1/c1_FrameMap.cpp
 --- a/src/share/vm/c1/c1_FrameMap.cpp
 +++ b/src/share/vm/c1/c1_FrameMap.cpp
@@ -732,6 +766,45 @@
  }
  
  void nmethod::print_code() {
+diff --git a/src/share/vm/interpreter/linkResolver.cpp b/src/share/vm/interpreter/linkResolver.cpp
+--- a/src/share/vm/interpreter/linkResolver.cpp
++++ b/src/share/vm/interpreter/linkResolver.cpp
+@@ -1226,26 +1226,21 @@
+ 
+   // Resolve the bootstrap specifier (BSM + optional arguments).
+   Handle bootstrap_specifier;
+-  for (;;) {
+-    { // Short circuit if CallSite has been bound already:
+-      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() : (oop)NULL);
+-        result.set_handle(method, appendix, CHECK);
+-        return;
+-      }
+-      if (bootstrap_specifier.not_null())
+-        break;
+-    }
+-
+-    // Just one time through this code:
++  // Check if CallSite has been bound already:
++  ConstantPoolCacheEntry* cpce = pool->cache()->secondary_entry_at(index);
++  if (cpce->is_f1_null()) {
+     int pool_index = pool->cache()->main_entry_at(index)->constant_pool_index();
+     oop bsm_info = pool->resolve_bootstrap_specifier_at(pool_index, CHECK);
+     assert(bsm_info != NULL, "");
+     // FIXME: Cache this once per BootstrapMethods entry, not once per CONSTANT_InvokeDynamic.
+     bootstrap_specifier = Handle(THREAD, bsm_info);
+   }
++  if (!cpce->is_f1_null()) {
++    methodHandle method(THREAD, cpce->f2_as_vfinal_method());
++    Handle appendix(THREAD, cpce->has_appendix() ? cpce->f1_appendix() : (oop)NULL);
++    result.set_handle(method, appendix, CHECK);
++    return;
++  }
+ 
+   if (TraceMethodHandles) {
+     tty->print_cr("resolve_invokedynamic #%d %s %s",
 diff --git a/src/share/vm/interpreter/templateInterpreter.cpp b/src/share/vm/interpreter/templateInterpreter.cpp
 --- a/src/share/vm/interpreter/templateInterpreter.cpp
 +++ b/src/share/vm/interpreter/templateInterpreter.cpp