comparison src/share/vm/runtime/sharedRuntime.cpp @ 10408:836a62f43af9

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Wed, 19 Jun 2013 10:45:56 +0200
parents f64a3fec4e42 28e5aed7f3a6
children 36bcc10e01c0
comparison
equal deleted inserted replaced
10086:e0fb8a213650 10408:836a62f43af9
935 ShouldNotReachHere(); 935 ShouldNotReachHere();
936 return NULL; 936 return NULL;
937 } 937 }
938 938
939 939
940 JNI_ENTRY(void, throw_unsatisfied_link_error(JNIEnv* env, ...)) 940 /**
941 * Throws an java/lang/UnsatisfiedLinkError. The address of this method is
942 * installed in the native function entry of all native Java methods before
943 * they get linked to their actual native methods.
944 *
945 * \note
946 * This method actually never gets called! The reason is because
947 * the interpreter's native entries call NativeLookup::lookup() which
948 * throws the exception when the lookup fails. The exception is then
949 * caught and forwarded on the return from NativeLookup::lookup() call
950 * before the call to the native function. This might change in the future.
951 */
952 JNI_ENTRY(void*, throw_unsatisfied_link_error(JNIEnv* env, ...))
941 { 953 {
942 THROW(vmSymbols::java_lang_UnsatisfiedLinkError()); 954 // We return a bad value here to make sure that the exception is
943 } 955 // forwarded before we look at the return value.
944 JNI_END 956 THROW_(vmSymbols::java_lang_UnsatisfiedLinkError(), (void*)badJNIHandle);
945
946 JNI_ENTRY(void, throw_unsupported_operation_exception(JNIEnv* env, ...))
947 {
948 THROW(vmSymbols::java_lang_UnsupportedOperationException());
949 } 957 }
950 JNI_END 958 JNI_END
951 959
952 address SharedRuntime::native_method_throw_unsatisfied_link_error_entry() { 960 address SharedRuntime::native_method_throw_unsatisfied_link_error_entry() {
953 return CAST_FROM_FN_PTR(address, &throw_unsatisfied_link_error); 961 return CAST_FROM_FN_PTR(address, &throw_unsatisfied_link_error);
954 }
955
956 address SharedRuntime::native_method_throw_unsupported_operation_exception_entry() {
957 return CAST_FROM_FN_PTR(address, &throw_unsupported_operation_exception);
958 } 962 }
959 963
960 964
961 #ifndef PRODUCT 965 #ifndef PRODUCT
962 JRT_ENTRY(intptr_t, SharedRuntime::trace_bytecode(JavaThread* thread, intptr_t preserve_this_value, intptr_t tos, intptr_t tos2)) 966 JRT_ENTRY(intptr_t, SharedRuntime::trace_bytecode(JavaThread* thread, intptr_t preserve_this_value, intptr_t tos, intptr_t tos2))
1378 // safepoint is possible and have trouble gc'ing the compiled args. 1382 // safepoint is possible and have trouble gc'ing the compiled args.
1379 RegisterMap reg_map(thread, false); 1383 RegisterMap reg_map(thread, false);
1380 frame stub_frame = thread->last_frame(); 1384 frame stub_frame = thread->last_frame();
1381 assert(stub_frame.is_runtime_frame(), "sanity check"); 1385 assert(stub_frame.is_runtime_frame(), "sanity check");
1382 frame caller_frame = stub_frame.sender(&reg_map); 1386 frame caller_frame = stub_frame.sender(&reg_map);
1383
1384 // MethodHandle invokes don't have a CompiledIC and should always
1385 // simply redispatch to the callee_target.
1386 address sender_pc = caller_frame.pc();
1387 CodeBlob* sender_cb = caller_frame.cb();
1388 nmethod* sender_nm = sender_cb->as_nmethod_or_null();
1389 1387
1390 if (caller_frame.is_interpreted_frame() || 1388 if (caller_frame.is_interpreted_frame() ||
1391 caller_frame.is_entry_frame()) { 1389 caller_frame.is_entry_frame()) {
1392 Method* callee = thread->callee_target(); 1390 Method* callee = thread->callee_target();
1393 guarantee(callee != NULL && callee->is_method(), "bad handshake"); 1391 guarantee(callee != NULL && callee->is_method(), "bad handshake");
2791 // Return argument 0 register. In the LP64 build pointers 2789 // Return argument 0 register. In the LP64 build pointers
2792 // take 2 registers, but the VM wants only the 'main' name. 2790 // take 2 registers, but the VM wants only the 'main' name.
2793 return regs.first(); 2791 return regs.first();
2794 } 2792 }
2795 2793
2796 VMRegPair *SharedRuntime::find_callee_arguments(Symbol* sig, bool has_receiver, int* arg_size) { 2794 VMRegPair *SharedRuntime::find_callee_arguments(Symbol* sig, bool has_receiver, bool has_appendix, int* arg_size) {
2797 // This method is returning a data structure allocating as a 2795 // This method is returning a data structure allocating as a
2798 // ResourceObject, so do not put any ResourceMarks in here. 2796 // ResourceObject, so do not put any ResourceMarks in here.
2799 char *s = sig->as_C_string(); 2797 char *s = sig->as_C_string();
2800 int len = (int)strlen(s); 2798 int len = (int)strlen(s);
2801 *s++; len--; // Skip opening paren 2799 *s++; len--; // Skip opening paren
2835 break; 2833 break;
2836 } 2834 }
2837 default : ShouldNotReachHere(); 2835 default : ShouldNotReachHere();
2838 } 2836 }
2839 } 2837 }
2838
2839 if (has_appendix) {
2840 sig_bt[cnt++] = T_OBJECT;
2841 }
2842
2840 assert( cnt < 256, "grow table size" ); 2843 assert( cnt < 256, "grow table size" );
2841 2844
2842 int comp_args_on_stack; 2845 int comp_args_on_stack;
2843 comp_args_on_stack = java_calling_convention(sig_bt, regs, cnt, true); 2846 comp_args_on_stack = java_calling_convention(sig_bt, regs, cnt, true);
2844 2847