changeset 463:a1bae6849a0b

meth: jcheck cleanup; tweaks
author jrose
date Sun, 08 Jul 2012 02:23:40 -0700
parents 01bca62ccfe7
children 851ca5831589
files meth-lazy-7023639.jit.patch meth-lazy-7023639.patch
diffstat 2 files changed, 37 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/meth-lazy-7023639.jit.patch	Sun Jul 08 01:25:22 2012 -0700
+++ b/meth-lazy-7023639.jit.patch	Sun Jul 08 02:23:40 2012 -0700
@@ -3749,46 +3749,6 @@
           ( is_virtual && invoke_code != Bytecodes::_invokestatic), "inconsistent bytecode");
  
  #ifndef PRODUCT
-@@ -2854,7 +2862,7 @@
-   assert(false, "Should have found handler");
- }
- 
--void AdapterHandlerEntry::print_on(outputStream* st) {
-+void AdapterHandlerEntry::print_on(outputStream* st) const {
-   st->print_cr("AHE@" INTPTR_FORMAT ": %s i2c: " INTPTR_FORMAT " c2i: " INTPTR_FORMAT " c2iUV: " INTPTR_FORMAT,
-                (intptr_t) this, fingerprint()->as_string(),
-                get_i2c_entry(), get_c2i_entry(), get_c2i_unverified_entry());
-diff --git a/src/share/vm/runtime/sharedRuntime.hpp b/src/share/vm/runtime/sharedRuntime.hpp
---- a/src/share/vm/runtime/sharedRuntime.hpp
-+++ b/src/share/vm/runtime/sharedRuntime.hpp
-@@ -618,14 +618,14 @@
-   AdapterHandlerEntry();
- 
-  public:
--  address get_i2c_entry()            { return _i2c_entry; }
--  address get_c2i_entry()            { return _c2i_entry; }
--  address get_c2i_unverified_entry() { return _c2i_unverified_entry; }
-+  address get_i2c_entry()            const { return _i2c_entry; }
-+  address get_c2i_entry()            const { return _c2i_entry; }
-+  address get_c2i_unverified_entry() const { return _c2i_unverified_entry; }
- 
-   address base_address();
-   void relocate(address new_base);
- 
--  AdapterFingerPrint* fingerprint()  { return _fingerprint; }
-+  AdapterFingerPrint* fingerprint() const { return _fingerprint; }
- 
-   AdapterHandlerEntry* next() {
-     return (AdapterHandlerEntry*)BasicHashtableEntry::next();
-@@ -637,7 +637,7 @@
-   bool compare_code(unsigned char* code, int length, int total_args_passed, BasicType* sig_bt);
- #endif
- 
--  void print_on(outputStream* st);
-+  virtual void print_on(outputStream* st) const;
- };
- 
- class AdapterHandlerLibrary: public AllStatic {
 diff --git a/src/share/vm/runtime/vframeArray.cpp b/src/share/vm/runtime/vframeArray.cpp
 --- a/src/share/vm/runtime/vframeArray.cpp
 +++ b/src/share/vm/runtime/vframeArray.cpp
--- a/meth-lazy-7023639.patch	Sun Jul 08 01:25:22 2012 -0700
+++ b/meth-lazy-7023639.patch	Sun Jul 08 02:23:40 2012 -0700
@@ -1,6 +1,8 @@
 7023639: JSR 292 method handle invocation needs a fast path for compiled code
 6984705: JSR 292 method handle creation should not go through JNI
-remove dead code for JDK 7 chained method handles
+remove assembly code for JDK 7 chained method handles
+Contributed-by: jrose, twisti, mhaupt
+Reviewed-by: jrose, twisti, mhaupt
 
 diff --git a/src/cpu/sparc/vm/assembler_sparc.cpp b/src/cpu/sparc/vm/assembler_sparc.cpp
 --- a/src/cpu/sparc/vm/assembler_sparc.cpp
@@ -8139,7 +8141,7 @@
    // rcx: receiver
    // Check for abstract method error
    // Note: This should be done more efficiently via a throw_abstract_method_error
-@@ -3116,9 +3149,40 @@
+@@ -3116,9 +3149,39 @@
    __ should_not_reach_here();
  }
  
@@ -8161,7 +8163,6 @@
 +                 rbx_method, rax_mtype,  // get f2 methodOop, f1 MethodType
 +                 rcx_recv);
 +  __ verify_oop(rbx_method);
-+                 
 +  __ verify_oop(rcx_recv);
 +  __ null_check(rcx_recv);
 +
@@ -8181,7 +8182,7 @@
  
    if (!EnableInvokeDynamic) {
      // We should not encounter this bytecode if !EnableInvokeDynamic.
-@@ -3131,26 +3195,23 @@
+@@ -3131,26 +3194,23 @@
      return;
    }
  
@@ -8660,7 +8661,7 @@
    // rcx: receiver
    // Check for abstract method error
    // Note: This should be done more efficiently via a throw_abstract_method_error
-@@ -3172,12 +3205,43 @@
+@@ -3172,12 +3205,42 @@
                     InterpreterRuntime::throw_IncompatibleClassChangeError));
    // the call_VM checks for exception, so we should never return here.
    __ should_not_reach_here();
@@ -8686,7 +8687,6 @@
 +                 rbx_method, rax_mtype,  // get f2 methodOop, f1 MethodType
 +                 rcx_recv);
 +  __ verify_oop(rbx_method);
-+                 
 +  __ verify_oop(rcx_recv);
 +  __ null_check(rcx_recv);
 +
@@ -8706,7 +8706,7 @@
  
    if (!EnableInvokeDynamic) {
      // We should not encounter this bytecode if !EnableInvokeDynamic.
-@@ -3190,26 +3254,23 @@
+@@ -3190,26 +3253,23 @@
      return;
    }
  
@@ -9597,6 +9597,15 @@
 diff --git a/src/share/vm/classfile/classFileParser.cpp b/src/share/vm/classfile/classFileParser.cpp
 --- a/src/share/vm/classfile/classFileParser.cpp
 +++ b/src/share/vm/classfile/classFileParser.cpp
+@@ -1653,7 +1653,7 @@
+ // Skip an annotation.  Return >=limit if there is any problem.
+ int ClassFileParser::skip_annotation(u1* buffer, int limit, int index) {
+   // annotation := atype:u2 do(nmem:u2) {member:u2 value}
+-  // value := switch (tag:u1) { ... } 
++  // value := switch (tag:u1) { ... }
+   index += 2;  // skip atype
+   if ((index += 2) >= limit)  return limit;  // read nmem
+   int nmem = Bytes::get_Java_u2(buffer+index-2);
 @@ -1778,6 +1778,9 @@
    case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_ForceInline_signature):
      if (_location != _in_class)  break;
@@ -9772,7 +9781,7 @@
  
  void java_lang_invoke_MemberName::set_vmtarget(oop mname, oop ref) {
    assert(is_instance(mname), "wrong type");
-+#ifdef ASSERT  
++#ifdef ASSERT
 +  // check the type of the vmtarget
 +  if (ref != NULL) {
 +    switch (flags(mname) & (MN_IS_METHOD |
@@ -11692,9 +11701,9 @@
 +                                                              &appendix,
 +                                                              CHECK);
 +  }
- 
++
 +  if (!pool->cache()->secondary_entry_at(site_index)->is_f1_null())  return;
-+                                                   
+ 
    // In the secondary entry, the f1 field is the call site, and the f2 (index)
    // field is some data about the invoke site.  Currently, it is just the BCI.
    // Later, it might be changed to help manage inlining dependencies.
@@ -17246,7 +17255,7 @@
 +  return init_field_MemberName(mname_oop, field_holder(),
 +                               info.access_flags(),
 +                               type, name,
-+                               field_offset, false /*is_setter*/);  
++                               field_offset, false /*is_setter*/);
 +#endif
  }
  
@@ -21647,7 +21656,7 @@
    assert(false, "Should have found handler");
  }
  
-+void AdapterHandlerEntry::print_on(outputStream* st) {
++void AdapterHandlerEntry::print_on(outputStream* st) const {
 +  st->print_cr("AHE@" INTPTR_FORMAT ": %s i2c: " INTPTR_FORMAT " c2i: " INTPTR_FORMAT " c2iUV: " INTPTR_FORMAT,
 +               (intptr_t) this, fingerprint()->as_string(),
 +               get_i2c_entry(), get_c2i_entry(), get_c2i_unverified_entry());
@@ -21732,20 +21741,31 @@
    static nmethod *generate_native_wrapper(MacroAssembler* masm,
                                            methodHandle method,
                                            int compile_id,
-@@ -651,6 +622,7 @@
-   address get_c2i_entry()            { return _c2i_entry; }
-   address get_c2i_unverified_entry() { return _c2i_unverified_entry; }
+@@ -647,13 +618,14 @@
+   AdapterHandlerEntry();
+ 
+  public:
+-  address get_i2c_entry()            { return _i2c_entry; }
+-  address get_c2i_entry()            { return _c2i_entry; }
+-  address get_c2i_unverified_entry() { return _c2i_unverified_entry; }
++  address get_i2c_entry()            const { return _i2c_entry; }
++  address get_c2i_entry()            const { return _c2i_entry; }
++  address get_c2i_unverified_entry() const { return _c2i_unverified_entry; }
  
 +  address base_address();
    void relocate(address new_base);
  
-   AdapterFingerPrint* fingerprint()  { return _fingerprint; }
+-  AdapterFingerPrint* fingerprint()  { return _fingerprint; }
++  AdapterFingerPrint* fingerprint() const { return _fingerprint; }
+ 
+   AdapterHandlerEntry* next() {
+     return (AdapterHandlerEntry*)BasicHashtableEntry::next();
 @@ -665,7 +637,7 @@
    bool compare_code(unsigned char* code, int length, int total_args_passed, BasicType* sig_bt);
  #endif
  
 -  void print();
-+  void print_on(outputStream* st);
++  virtual void print_on(outputStream* st) const;
  };
  
  class AdapterHandlerLibrary: public AllStatic {