1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
907 }
908 JNI_END
909
910 address SharedRuntime::native_method_throw_unsatisfied_link_error_entry() {
911 return CAST_FROM_FN_PTR(address, &throw_unsatisfied_link_error);
912 }
913
914
915 #ifndef PRODUCT
916 JRT_ENTRY(intptr_t, SharedRuntime::trace_bytecode(JavaThread* thread, intptr_t preserve_this_value, intptr_t tos, intptr_t tos2))
917 const frame f = thread->last_frame();
918 assert(f.is_interpreted_frame(), "must be an interpreted frame");
919 #ifndef PRODUCT
920 methodHandle mh(THREAD, f.interpreter_frame_method());
921 BytecodeTracer::trace(mh, f.interpreter_frame_bcp(), tos, tos2);
922 #endif // !PRODUCT
923 return preserve_this_value;
924 JRT_END
925 #endif // !PRODUCT
926
927
928 JRT_ENTRY(void, SharedRuntime::yield_all(JavaThread* thread, int attempts))
929 os::yield_all(attempts);
930 JRT_END
931
932
933 JRT_ENTRY_NO_ASYNC(void, SharedRuntime::register_finalizer(JavaThread* thread, oopDesc* obj))
934 assert(obj->is_oop(), "must be a valid oop");
935 assert(obj->klass()->has_finalizer(), "shouldn't be here otherwise");
936 InstanceKlass::register_finalizer(instanceOop(obj), CHECK);
937 JRT_END
938
939
940 jlong SharedRuntime::get_java_tid(Thread* thread) {
941 if (thread != NULL) {
942 if (thread->is_Java_thread()) {
943 oop obj = ((JavaThread*)thread)->threadObj();
944 return (obj == NULL) ? 0 : java_lang_Thread::thread_id(obj);
945 }
946 }
947 return 0;
948 }
949
950 /**
951 * This function ought to be a void function, but cannot be because
952 * it gets turned into a tail-call on sparc, which runs into dtrace bug
|
1 /*
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
907 }
908 JNI_END
909
910 address SharedRuntime::native_method_throw_unsatisfied_link_error_entry() {
911 return CAST_FROM_FN_PTR(address, &throw_unsatisfied_link_error);
912 }
913
914
915 #ifndef PRODUCT
916 JRT_ENTRY(intptr_t, SharedRuntime::trace_bytecode(JavaThread* thread, intptr_t preserve_this_value, intptr_t tos, intptr_t tos2))
917 const frame f = thread->last_frame();
918 assert(f.is_interpreted_frame(), "must be an interpreted frame");
919 #ifndef PRODUCT
920 methodHandle mh(THREAD, f.interpreter_frame_method());
921 BytecodeTracer::trace(mh, f.interpreter_frame_bcp(), tos, tos2);
922 #endif // !PRODUCT
923 return preserve_this_value;
924 JRT_END
925 #endif // !PRODUCT
926
927 JRT_ENTRY_NO_ASYNC(void, SharedRuntime::register_finalizer(JavaThread* thread, oopDesc* obj))
928 assert(obj->is_oop(), "must be a valid oop");
929 assert(obj->klass()->has_finalizer(), "shouldn't be here otherwise");
930 InstanceKlass::register_finalizer(instanceOop(obj), CHECK);
931 JRT_END
932
933
934 jlong SharedRuntime::get_java_tid(Thread* thread) {
935 if (thread != NULL) {
936 if (thread->is_Java_thread()) {
937 oop obj = ((JavaThread*)thread)->threadObj();
938 return (obj == NULL) ? 0 : java_lang_Thread::thread_id(obj);
939 }
940 }
941 return 0;
942 }
943
944 /**
945 * This function ought to be a void function, but cannot be because
946 * it gets turned into a tail-call on sparc, which runs into dtrace bug
|