@@ -59,53 +59,6 @@ inline bool match_F_SN(jshort flags) {
59
59
return (flags & (req | neg)) == req;
60
60
}
61
61
62
- inline bool match_F_RNY (jshort flags) {
63
- const int req = JVM_ACC_NATIVE | JVM_ACC_SYNCHRONIZED;
64
- const int neg = JVM_ACC_STATIC;
65
- return (flags & (req | neg)) == req;
66
- }
67
-
68
- static vmIntrinsics::ID wrapper_intrinsic (BasicType type, bool unboxing) {
69
- #define TYPE2 (type, unboxing ) ((int )(type)*2 + ((unboxing) ? 1 : 0 ))
70
- switch (TYPE2 (type, unboxing)) {
71
- #define BASIC_TYPE_CASE (type, box, unbox ) \
72
- case TYPE2 (type, false ): return vmIntrinsics::box; \
73
- case TYPE2 (type, true ): return vmIntrinsics::unbox
74
- BASIC_TYPE_CASE (T_BOOLEAN, _Boolean_valueOf, _booleanValue);
75
- BASIC_TYPE_CASE (T_BYTE, _Byte_valueOf, _byteValue);
76
- BASIC_TYPE_CASE (T_CHAR, _Character_valueOf, _charValue);
77
- BASIC_TYPE_CASE (T_SHORT, _Short_valueOf, _shortValue);
78
- BASIC_TYPE_CASE (T_INT, _Integer_valueOf, _intValue);
79
- BASIC_TYPE_CASE (T_LONG, _Long_valueOf, _longValue);
80
- BASIC_TYPE_CASE (T_FLOAT, _Float_valueOf, _floatValue);
81
- BASIC_TYPE_CASE (T_DOUBLE, _Double_valueOf, _doubleValue);
82
- #undef BASIC_TYPE_CASE
83
- }
84
- #undef TYPE2
85
- return vmIntrinsics::_none;
86
- }
87
-
88
- vmIntrinsics::ID vmIntrinsics::for_boxing (BasicType type) {
89
- return wrapper_intrinsic (type, false );
90
- }
91
- vmIntrinsics::ID vmIntrinsics::for_unboxing (BasicType type) {
92
- return wrapper_intrinsic (type, true );
93
- }
94
-
95
- vmIntrinsics::ID vmIntrinsics::for_raw_conversion (BasicType src, BasicType dest) {
96
- #define SRC_DEST (s,d ) (((int )(s) << 4 ) + (int )(d))
97
- switch (SRC_DEST (src, dest)) {
98
- case SRC_DEST (T_INT, T_FLOAT): return vmIntrinsics::_intBitsToFloat;
99
- case SRC_DEST (T_FLOAT, T_INT): return vmIntrinsics::_floatToRawIntBits;
100
-
101
- case SRC_DEST (T_LONG, T_DOUBLE): return vmIntrinsics::_longBitsToDouble;
102
- case SRC_DEST (T_DOUBLE, T_LONG): return vmIntrinsics::_doubleToRawLongBits;
103
- }
104
- #undef SRC_DEST
105
-
106
- return vmIntrinsics::_none;
107
- }
108
-
109
62
bool vmIntrinsics::preserves_state (vmIntrinsics::ID id) {
110
63
assert (id != vmIntrinsics::_none, " must be a VM intrinsic" );
111
64
switch (id) {
@@ -731,7 +684,6 @@ const char* vmIntrinsics::short_name_as_C_string(vmIntrinsics::ID id, char* buf,
731
684
case F_RN: fname = " native " ; break ;
732
685
case F_SN: fname = " native static " ; break ;
733
686
case F_S: fname = " static " ; break ;
734
- case F_RNY:fname = " native synchronized " ; break ;
735
687
default : break ;
736
688
}
737
689
const char * kptr = strrchr (kname, JVM_SIGNATURE_SLASH);
@@ -749,6 +701,7 @@ const char* vmIntrinsics::short_name_as_C_string(vmIntrinsics::ID id, char* buf,
749
701
750
702
#define ID4 (x, y, z, f ) ((ID3(x, y, z) << vmIntrinsics::log2_FLAG_LIMIT) | (jlong) (f))
751
703
704
+ #ifdef ASSERT
752
705
static const jlong intrinsic_info_array[vmIntrinsics::ID_LIMIT+1 ] = {
753
706
#define VM_INTRINSIC_INFO (ignore_id, klass, name, sig, fcode ) \
754
707
ID4 (SID_ENUM (klass), SID_ENUM (name), SID_ENUM (sig), vmIntrinsics::fcode),
@@ -790,66 +743,4 @@ vmIntrinsics::Flags vmIntrinsics::flags_for(vmIntrinsics::ID id) {
790
743
assert (((ID4 (1021 ,1022 ,1023 ,15 ) >> shift) & mask) == 15 , " " );
791
744
return Flags ( (info >> shift) & mask );
792
745
}
793
-
794
-
795
- #ifndef PRODUCT
796
- // verify_method performs an extra check on a matched intrinsic method
797
-
798
- static bool match_method (Method* m, Symbol* n, Symbol* s) {
799
- return (m->name () == n &&
800
- m->signature () == s);
801
- }
802
-
803
- static vmIntrinsics::ID match_method_with_klass (Method* m, Symbol* mk) {
804
- #define VM_INTRINSIC_MATCH (id, klassname, namepart, sigpart, flags ) \
805
- { Symbol* k = vmSymbols::klassname (); \
806
- if (mk == k) { \
807
- Symbol* n = vmSymbols::namepart (); \
808
- Symbol* s = vmSymbols::sigpart (); \
809
- if (match_method (m, n, s)) \
810
- return vmIntrinsics::id; \
811
- } }
812
- VM_INTRINSICS_DO (VM_INTRINSIC_MATCH,
813
- VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE);
814
- return vmIntrinsics::_none;
815
- #undef VM_INTRINSIC_MATCH
816
- }
817
-
818
- void vmIntrinsics::verify_method (ID actual_id, Method* m) {
819
- Symbol* mk = m->method_holder ()->name ();
820
- ID declared_id = match_method_with_klass (m, mk);
821
-
822
- if (declared_id == actual_id) return ; // success
823
-
824
- if (declared_id == _none && actual_id != _none && mk == vmSymbols::java_lang_StrictMath ()) {
825
- // Here are a few special cases in StrictMath not declared in vmSymbols.hpp.
826
- switch (actual_id) {
827
- case _min:
828
- case _max:
829
- case _dsqrt:
830
- declared_id = match_method_with_klass (m, vmSymbols::java_lang_Math ());
831
- if (declared_id == actual_id) return ; // acceptable alias
832
- break ;
833
- default :
834
- break ;
835
- }
836
- }
837
-
838
- const char * declared_name = name_at (declared_id);
839
- const char * actual_name = name_at (actual_id);
840
- m = NULL ;
841
- ttyLocker ttyl;
842
- if (xtty != NULL ) {
843
- xtty->begin_elem (" intrinsic_misdeclared actual='%s' declared='%s'" ,
844
- actual_name, declared_name);
845
- xtty->method (m);
846
- xtty->end_elem (" %s" , " " );
847
- }
848
- if (PrintMiscellaneous && (WizardMode || Verbose)) {
849
- tty->print_cr (" *** misidentified method; %s(%d) should be %s(%d):" ,
850
- declared_name, declared_id, actual_name, actual_id);
851
- m->print_short_name (tty);
852
- tty->cr ();
853
- }
854
- }
855
- #endif // PRODUCT
746
+ #endif // ASSERT
0 commit comments