24
25 #ifndef SHARE_VM_INTERPRETER_INTERPRETERRUNTIME_HPP
26 #define SHARE_VM_INTERPRETER_INTERPRETERRUNTIME_HPP
27
28 #include "interpreter/bytecode.hpp"
29 #include "interpreter/linkResolver.hpp"
30 #include "memory/universe.hpp"
31 #include "oops/methodOop.hpp"
32 #include "runtime/frame.inline.hpp"
33 #include "runtime/signature.hpp"
34 #include "utilities/top.hpp"
35 #ifdef TARGET_OS_FAMILY_linux
36 # include "thread_linux.inline.hpp"
37 #endif
38 #ifdef TARGET_OS_FAMILY_solaris
39 # include "thread_solaris.inline.hpp"
40 #endif
41 #ifdef TARGET_OS_FAMILY_windows
42 # include "thread_windows.inline.hpp"
43 #endif
44
45 // The InterpreterRuntime is called by the interpreter for everything
46 // that cannot/should not be dealt with in assembly and needs C support.
47
48 class InterpreterRuntime: AllStatic {
49 friend class BytecodeClosure; // for method and bcp
50 friend class PrintingClosure; // for method and bcp
51
52 private:
53 // Helper functions to access current interpreter state
54 static frame last_frame(JavaThread *thread) { return thread->last_frame(); }
55 static methodOop method(JavaThread *thread) { return last_frame(thread).interpreter_frame_method(); }
56 static address bcp(JavaThread *thread) { return last_frame(thread).interpreter_frame_bcp(); }
57 static int bci(JavaThread *thread) { return last_frame(thread).interpreter_frame_bci(); }
58 static void set_bcp_and_mdp(address bcp, JavaThread*thread);
59 static Bytecodes::Code code(JavaThread *thread) {
60 // pass method to avoid calling unsafe bcp_to_method (partial fix 4926272)
61 return Bytecodes::code_at(method(thread), bcp(thread));
62 }
63 static bool already_resolved(JavaThread *thread) { return cache_entry(thread)->is_resolved(code(thread)); }
|
24
25 #ifndef SHARE_VM_INTERPRETER_INTERPRETERRUNTIME_HPP
26 #define SHARE_VM_INTERPRETER_INTERPRETERRUNTIME_HPP
27
28 #include "interpreter/bytecode.hpp"
29 #include "interpreter/linkResolver.hpp"
30 #include "memory/universe.hpp"
31 #include "oops/methodOop.hpp"
32 #include "runtime/frame.inline.hpp"
33 #include "runtime/signature.hpp"
34 #include "utilities/top.hpp"
35 #ifdef TARGET_OS_FAMILY_linux
36 # include "thread_linux.inline.hpp"
37 #endif
38 #ifdef TARGET_OS_FAMILY_solaris
39 # include "thread_solaris.inline.hpp"
40 #endif
41 #ifdef TARGET_OS_FAMILY_windows
42 # include "thread_windows.inline.hpp"
43 #endif
44 #ifdef TARGET_OS_FAMILY_bsd
45 # include "thread_bsd.inline.hpp"
46 #endif
47
48 // The InterpreterRuntime is called by the interpreter for everything
49 // that cannot/should not be dealt with in assembly and needs C support.
50
51 class InterpreterRuntime: AllStatic {
52 friend class BytecodeClosure; // for method and bcp
53 friend class PrintingClosure; // for method and bcp
54
55 private:
56 // Helper functions to access current interpreter state
57 static frame last_frame(JavaThread *thread) { return thread->last_frame(); }
58 static methodOop method(JavaThread *thread) { return last_frame(thread).interpreter_frame_method(); }
59 static address bcp(JavaThread *thread) { return last_frame(thread).interpreter_frame_bcp(); }
60 static int bci(JavaThread *thread) { return last_frame(thread).interpreter_frame_bci(); }
61 static void set_bcp_and_mdp(address bcp, JavaThread*thread);
62 static Bytecodes::Code code(JavaThread *thread) {
63 // pass method to avoid calling unsafe bcp_to_method (partial fix 4926272)
64 return Bytecodes::code_at(method(thread), bcp(thread));
65 }
66 static bool already_resolved(JavaThread *thread) { return cache_entry(thread)->is_resolved(code(thread)); }
|