Mercurial > hg > truffle
comparison src/share/vm/classfile/classFileParser.cpp @ 2357:8033953d67ff
7012648: move JSR 292 to package java.lang.invoke and adjust names
Summary: package and class renaming only; delete unused methods and classes
Reviewed-by: twisti
author | jrose |
---|---|
date | Fri, 11 Mar 2011 22:34:57 -0800 |
parents | 72dee110246f |
children | c7f3d0b4570f |
comparison
equal
deleted
inserted
replaced
2356:72dee110246f | 2357:8033953d67ff |
---|---|
2804 } | 2804 } |
2805 | 2805 |
2806 | 2806 |
2807 // Force MethodHandle.vmentry to be an unmanaged pointer. | 2807 // Force MethodHandle.vmentry to be an unmanaged pointer. |
2808 // There is no way for a classfile to express this, so we must help it. | 2808 // There is no way for a classfile to express this, so we must help it. |
2809 void ClassFileParser::java_dyn_MethodHandle_fix_pre(constantPoolHandle cp, | 2809 void ClassFileParser::java_lang_invoke_MethodHandle_fix_pre(constantPoolHandle cp, |
2810 typeArrayHandle fields, | 2810 typeArrayHandle fields, |
2811 FieldAllocationCount *fac_ptr, | 2811 FieldAllocationCount *fac_ptr, |
2812 TRAPS) { | 2812 TRAPS) { |
2813 // Add fake fields for java.dyn.MethodHandle instances | 2813 // Add fake fields for java.lang.invoke.MethodHandle instances |
2814 // | 2814 // |
2815 // This is not particularly nice, but since there is no way to express | 2815 // This is not particularly nice, but since there is no way to express |
2816 // a native wordSize field in Java, we must do it at this level. | 2816 // a native wordSize field in Java, we must do it at this level. |
2817 | 2817 |
2818 if (!EnableMethodHandles) return; | 2818 if (!EnableMethodHandles) return; |
2828 } | 2828 } |
2829 | 2829 |
2830 if (AllowTransitionalJSR292 && word_sig_index == 0) return; | 2830 if (AllowTransitionalJSR292 && word_sig_index == 0) return; |
2831 if (word_sig_index == 0) | 2831 if (word_sig_index == 0) |
2832 THROW_MSG(vmSymbols::java_lang_VirtualMachineError(), | 2832 THROW_MSG(vmSymbols::java_lang_VirtualMachineError(), |
2833 "missing I or J signature (for vmentry) in java.dyn.MethodHandle"); | 2833 "missing I or J signature (for vmentry) in java.lang.invoke.MethodHandle"); |
2834 | 2834 |
2835 // Find vmentry field and change the signature. | 2835 // Find vmentry field and change the signature. |
2836 bool found_vmentry = false; | 2836 bool found_vmentry = false; |
2837 for (int i = 0; i < fields->length(); i += instanceKlass::next_offset) { | 2837 for (int i = 0; i < fields->length(); i += instanceKlass::next_offset) { |
2838 int name_index = fields->ushort_at(i + instanceKlass::name_index_offset); | 2838 int name_index = fields->ushort_at(i + instanceKlass::name_index_offset); |
2868 } | 2868 } |
2869 | 2869 |
2870 if (AllowTransitionalJSR292 && !found_vmentry) return; | 2870 if (AllowTransitionalJSR292 && !found_vmentry) return; |
2871 if (!found_vmentry) | 2871 if (!found_vmentry) |
2872 THROW_MSG(vmSymbols::java_lang_VirtualMachineError(), | 2872 THROW_MSG(vmSymbols::java_lang_VirtualMachineError(), |
2873 "missing vmentry byte field in java.dyn.MethodHandle"); | 2873 "missing vmentry byte field in java.lang.invoke.MethodHandle"); |
2874 } | 2874 } |
2875 | 2875 |
2876 | 2876 |
2877 instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name, | 2877 instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name, |
2878 Handle class_loader, | 2878 Handle class_loader, |
3233 // Add fake fields for java.lang.Class instances (also see below) | 3233 // Add fake fields for java.lang.Class instances (also see below) |
3234 if (class_name == vmSymbols::java_lang_Class() && class_loader.is_null()) { | 3234 if (class_name == vmSymbols::java_lang_Class() && class_loader.is_null()) { |
3235 java_lang_Class_fix_pre(&methods, &fac, CHECK_(nullHandle)); | 3235 java_lang_Class_fix_pre(&methods, &fac, CHECK_(nullHandle)); |
3236 } | 3236 } |
3237 | 3237 |
3238 // adjust the vmentry field declaration in java.dyn.MethodHandle | 3238 // adjust the vmentry field declaration in java.lang.invoke.MethodHandle |
3239 if (EnableMethodHandles && class_name == vmSymbols::java_dyn_MethodHandle() && class_loader.is_null()) { | 3239 if (EnableMethodHandles && class_name == vmSymbols::java_lang_invoke_MethodHandle() && class_loader.is_null()) { |
3240 java_dyn_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle)); | 3240 java_lang_invoke_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle)); |
3241 } | |
3242 if (AllowTransitionalJSR292 && | |
3243 EnableMethodHandles && class_name == vmSymbols::java_dyn_MethodHandle() && class_loader.is_null()) { | |
3244 java_lang_invoke_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle)); | |
3241 } | 3245 } |
3242 if (AllowTransitionalJSR292 && | 3246 if (AllowTransitionalJSR292 && |
3243 EnableMethodHandles && class_name == vmSymbols::sun_dyn_MethodHandleImpl() && class_loader.is_null()) { | 3247 EnableMethodHandles && class_name == vmSymbols::sun_dyn_MethodHandleImpl() && class_loader.is_null()) { |
3244 // allow vmentry field in MethodHandleImpl also | 3248 // allow vmentry field in MethodHandleImpl also |
3245 java_dyn_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle)); | 3249 java_lang_invoke_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle)); |
3246 } | 3250 } |
3247 | 3251 |
3248 // Add a fake "discovered" field if it is not present | 3252 // Add a fake "discovered" field if it is not present |
3249 // for compatibility with earlier jdk's. | 3253 // for compatibility with earlier jdk's. |
3250 if (class_name == vmSymbols::java_lang_ref_Reference() | 3254 if (class_name == vmSymbols::java_lang_ref_Reference() |