Mercurial > hg > graal-compiler
comparison src/share/vm/oops/constantPool.cpp @ 12292:084b21cd0228
8025088: Missing cases for JVM_CONSTANT_MethodHandleInError cause crash if debugger steps into error-tagged method handle
Summary: Need to refetch each method from InstanceKlass after all safepoints. Removed leaky PreviousVersionInfo code.
Reviewed-by: coleenp, sspitsyn
author | iklam |
---|---|
date | Mon, 23 Sep 2013 08:56:19 -0700 |
parents | a7609ec351d6 |
children | 190899198332 |
comparison
equal
deleted
inserted
replaced
12291:ae2edb3df7fb | 12292:084b21cd0228 |
---|---|
1609 case JVM_CONSTANT_ClassIndex: | 1609 case JVM_CONSTANT_ClassIndex: |
1610 case JVM_CONSTANT_UnresolvedClass: | 1610 case JVM_CONSTANT_UnresolvedClass: |
1611 case JVM_CONSTANT_UnresolvedClassInError: | 1611 case JVM_CONSTANT_UnresolvedClassInError: |
1612 case JVM_CONSTANT_StringIndex: | 1612 case JVM_CONSTANT_StringIndex: |
1613 case JVM_CONSTANT_MethodType: | 1613 case JVM_CONSTANT_MethodType: |
1614 case JVM_CONSTANT_MethodTypeInError: | |
1614 return 3; | 1615 return 3; |
1615 | 1616 |
1616 case JVM_CONSTANT_MethodHandle: | 1617 case JVM_CONSTANT_MethodHandle: |
1618 case JVM_CONSTANT_MethodHandleInError: | |
1617 return 4; //tag, ref_kind, ref_index | 1619 return 4; //tag, ref_kind, ref_index |
1618 | 1620 |
1619 case JVM_CONSTANT_Integer: | 1621 case JVM_CONSTANT_Integer: |
1620 case JVM_CONSTANT_Float: | 1622 case JVM_CONSTANT_Float: |
1621 case JVM_CONSTANT_Fieldref: | 1623 case JVM_CONSTANT_Fieldref: |
1792 break; | 1794 break; |
1793 } | 1795 } |
1794 case JVM_CONSTANT_MethodHandle: | 1796 case JVM_CONSTANT_MethodHandle: |
1795 case JVM_CONSTANT_MethodHandleInError: { | 1797 case JVM_CONSTANT_MethodHandleInError: { |
1796 *bytes = JVM_CONSTANT_MethodHandle; | 1798 *bytes = JVM_CONSTANT_MethodHandle; |
1797 int kind = method_handle_ref_kind_at(idx); | 1799 int kind = method_handle_ref_kind_at_error_ok(idx); |
1798 idx1 = method_handle_index_at(idx); | 1800 idx1 = method_handle_index_at_error_ok(idx); |
1799 *(bytes+1) = (unsigned char) kind; | 1801 *(bytes+1) = (unsigned char) kind; |
1800 Bytes::put_Java_u2((address) (bytes+2), idx1); | 1802 Bytes::put_Java_u2((address) (bytes+2), idx1); |
1801 DBG(printf("JVM_CONSTANT_MethodHandle: %d %hd", kind, idx1)); | 1803 DBG(printf("JVM_CONSTANT_MethodHandle: %d %hd", kind, idx1)); |
1802 break; | 1804 break; |
1803 } | 1805 } |
1804 case JVM_CONSTANT_MethodType: | 1806 case JVM_CONSTANT_MethodType: |
1805 case JVM_CONSTANT_MethodTypeInError: { | 1807 case JVM_CONSTANT_MethodTypeInError: { |
1806 *bytes = JVM_CONSTANT_MethodType; | 1808 *bytes = JVM_CONSTANT_MethodType; |
1807 idx1 = method_type_index_at(idx); | 1809 idx1 = method_type_index_at_error_ok(idx); |
1808 Bytes::put_Java_u2((address) (bytes+1), idx1); | 1810 Bytes::put_Java_u2((address) (bytes+1), idx1); |
1809 DBG(printf("JVM_CONSTANT_MethodType: %hd", idx1)); | 1811 DBG(printf("JVM_CONSTANT_MethodType: %hd", idx1)); |
1810 break; | 1812 break; |
1811 } | 1813 } |
1812 case JVM_CONSTANT_InvokeDynamic: { | 1814 case JVM_CONSTANT_InvokeDynamic: { |
1990 } | 1992 } |
1991 } | 1993 } |
1992 break; | 1994 break; |
1993 case JVM_CONSTANT_MethodHandle : | 1995 case JVM_CONSTANT_MethodHandle : |
1994 case JVM_CONSTANT_MethodHandleInError : | 1996 case JVM_CONSTANT_MethodHandleInError : |
1995 st->print("ref_kind=%d", method_handle_ref_kind_at(index)); | 1997 st->print("ref_kind=%d", method_handle_ref_kind_at_error_ok(index)); |
1996 st->print(" ref_index=%d", method_handle_index_at(index)); | 1998 st->print(" ref_index=%d", method_handle_index_at_error_ok(index)); |
1997 break; | 1999 break; |
1998 case JVM_CONSTANT_MethodType : | 2000 case JVM_CONSTANT_MethodType : |
1999 case JVM_CONSTANT_MethodTypeInError : | 2001 case JVM_CONSTANT_MethodTypeInError : |
2000 st->print("signature_index=%d", method_type_index_at(index)); | 2002 st->print("signature_index=%d", method_type_index_at_error_ok(index)); |
2001 break; | 2003 break; |
2002 case JVM_CONSTANT_InvokeDynamic : | 2004 case JVM_CONSTANT_InvokeDynamic : |
2003 { | 2005 { |
2004 st->print("bootstrap_method_index=%d", invoke_dynamic_bootstrap_method_ref_index_at(index)); | 2006 st->print("bootstrap_method_index=%d", invoke_dynamic_bootstrap_method_ref_index_at(index)); |
2005 st->print(" name_and_type_index=%d", invoke_dynamic_name_and_type_ref_index_at(index)); | 2007 st->print(" name_and_type_index=%d", invoke_dynamic_name_and_type_ref_index_at(index)); |