30 #include "memory/allocation.hpp"
31 #include "memory/resourceArea.hpp"
32 #include "utilities/hashtable.hpp"
33 #include "utilities/macros.hpp"
34
35 class AdapterHandlerEntry;
36 class AdapterHandlerTable;
37 class AdapterFingerPrint;
38 class vframeStream;
39
40 // Runtime is the base class for various runtime interfaces
41 // (InterpreterRuntime, CompilerRuntime, etc.). It provides
42 // shared functionality such as exception forwarding (C++ to
43 // Java exceptions), locking/unlocking mechanisms, statistical
44 // information, etc.
45
46 class SharedRuntime: AllStatic {
47 friend class VMStructs;
48
49 private:
50 static methodHandle resolve_sub_helper(JavaThread *thread,
51 bool is_virtual,
52 bool is_optimized, TRAPS);
53
54 // Shared stub locations
55
56 static RuntimeStub* _wrong_method_blob;
57 static RuntimeStub* _wrong_method_abstract_blob;
58 static RuntimeStub* _ic_miss_blob;
59 static RuntimeStub* _resolve_opt_virtual_call_blob;
60 static RuntimeStub* _resolve_virtual_call_blob;
61 static RuntimeStub* _resolve_static_call_blob;
62 static address _resolve_static_call_entry;
63
64 static DeoptimizationBlob* _deopt_blob;
65
66 static SafepointBlob* _polling_page_vectors_safepoint_handler_blob;
67 static SafepointBlob* _polling_page_safepoint_handler_blob;
68 static SafepointBlob* _polling_page_return_handler_blob;
|
30 #include "memory/allocation.hpp"
31 #include "memory/resourceArea.hpp"
32 #include "utilities/hashtable.hpp"
33 #include "utilities/macros.hpp"
34
35 class AdapterHandlerEntry;
36 class AdapterHandlerTable;
37 class AdapterFingerPrint;
38 class vframeStream;
39
40 // Runtime is the base class for various runtime interfaces
41 // (InterpreterRuntime, CompilerRuntime, etc.). It provides
42 // shared functionality such as exception forwarding (C++ to
43 // Java exceptions), locking/unlocking mechanisms, statistical
44 // information, etc.
45
46 class SharedRuntime: AllStatic {
47 friend class VMStructs;
48
49 private:
50 static bool resolve_sub_helper_internal(methodHandle callee_method, const frame& caller_frame,
51 CompiledMethod* caller_nm, bool is_virtual, bool is_optimized,
52 Handle receiver, CallInfo& call_info, Bytecodes::Code invoke_code, TRAPS);
53 static methodHandle resolve_sub_helper(JavaThread *thread,
54 bool is_virtual,
55 bool is_optimized, TRAPS);
56
57 // Shared stub locations
58
59 static RuntimeStub* _wrong_method_blob;
60 static RuntimeStub* _wrong_method_abstract_blob;
61 static RuntimeStub* _ic_miss_blob;
62 static RuntimeStub* _resolve_opt_virtual_call_blob;
63 static RuntimeStub* _resolve_virtual_call_blob;
64 static RuntimeStub* _resolve_static_call_blob;
65 static address _resolve_static_call_entry;
66
67 static DeoptimizationBlob* _deopt_blob;
68
69 static SafepointBlob* _polling_page_vectors_safepoint_handler_blob;
70 static SafepointBlob* _polling_page_safepoint_handler_blob;
71 static SafepointBlob* _polling_page_return_handler_blob;
|
305 // @param target_klass the target klass attempt
306 // @return the dynamically allocated exception message (must be freed
307 // by the caller using a resource mark)
308 //
309 // This version does not require access the frame, so it can be called
310 // from interpreted code
311 // The caller (or one of it's callers) must use a ResourceMark
312 // in order to correctly free the result.
313 //
314 static char* generate_class_cast_message(Klass* caster_klass, Klass* target_klass, Symbol* target_klass_name = NULL);
315
316 // Resolves a call site- may patch in the destination of the call into the
317 // compiled code.
318 static methodHandle resolve_helper(JavaThread *thread,
319 bool is_virtual,
320 bool is_optimized, TRAPS);
321
322 private:
323 // deopt blob
324 static void generate_deopt_blob(void);
325
326 public:
327 static DeoptimizationBlob* deopt_blob(void) { return _deopt_blob; }
328
329 // Resets a call-site in compiled code so it will get resolved again.
330 static methodHandle reresolve_call_site(JavaThread *thread, TRAPS);
331
332 // In the code prolog, if the klass comparison fails, the inline cache
333 // misses and the call site is patched to megamorphic
334 static methodHandle handle_ic_miss_helper(JavaThread* thread, TRAPS);
335
336 // Find the method that called us.
337 static methodHandle find_callee_method(JavaThread* thread, TRAPS);
338
339
340 private:
341 static Handle find_callee_info(JavaThread* thread,
342 Bytecodes::Code& bc,
343 CallInfo& callinfo, TRAPS);
|
308 // @param target_klass the target klass attempt
309 // @return the dynamically allocated exception message (must be freed
310 // by the caller using a resource mark)
311 //
312 // This version does not require access the frame, so it can be called
313 // from interpreted code
314 // The caller (or one of it's callers) must use a ResourceMark
315 // in order to correctly free the result.
316 //
317 static char* generate_class_cast_message(Klass* caster_klass, Klass* target_klass, Symbol* target_klass_name = NULL);
318
319 // Resolves a call site- may patch in the destination of the call into the
320 // compiled code.
321 static methodHandle resolve_helper(JavaThread *thread,
322 bool is_virtual,
323 bool is_optimized, TRAPS);
324
325 private:
326 // deopt blob
327 static void generate_deopt_blob(void);
328
329 static bool handle_ic_miss_helper_internal(Handle receiver, CompiledMethod* caller_nm, const frame& caller_frame,
330 methodHandle callee_method, Bytecodes::Code bc, CallInfo& call_info,
331 bool& needs_ic_stub_refill, TRAPS);
332
333 public:
334 static DeoptimizationBlob* deopt_blob(void) { return _deopt_blob; }
335
336 // Resets a call-site in compiled code so it will get resolved again.
337 static methodHandle reresolve_call_site(JavaThread *thread, TRAPS);
338
339 // In the code prolog, if the klass comparison fails, the inline cache
340 // misses and the call site is patched to megamorphic
341 static methodHandle handle_ic_miss_helper(JavaThread* thread, TRAPS);
342
343 // Find the method that called us.
344 static methodHandle find_callee_method(JavaThread* thread, TRAPS);
345
346
347 private:
348 static Handle find_callee_info(JavaThread* thread,
349 Bytecodes::Code& bc,
350 CallInfo& callinfo, TRAPS);
|