comparison src/share/vm/runtime/sharedRuntime.hpp @ 6948:e522a00b91aa

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 Nov 2012 23:14:12 +0100
parents 957c266d8bc5 137868b7aa6f
children 5fc51c1ecdeb
comparison
equal deleted inserted replaced
6711:ae13cc658b80 6948:e522a00b91aa
60 static RuntimeStub* _resolve_virtual_call_blob; 60 static RuntimeStub* _resolve_virtual_call_blob;
61 static RuntimeStub* _resolve_static_call_blob; 61 static RuntimeStub* _resolve_static_call_blob;
62 62
63 static DeoptimizationBlob* _deopt_blob; 63 static DeoptimizationBlob* _deopt_blob;
64 64
65 static SafepointBlob* _polling_page_vectors_safepoint_handler_blob;
65 static SafepointBlob* _polling_page_safepoint_handler_blob; 66 static SafepointBlob* _polling_page_safepoint_handler_blob;
66 static SafepointBlob* _polling_page_return_handler_blob; 67 static SafepointBlob* _polling_page_return_handler_blob;
67 68
68 #ifdef COMPILER2 69 #ifdef COMPILER2
69 static UncommonTrapBlob* _uncommon_trap_blob; 70 static UncommonTrapBlob* _uncommon_trap_blob;
73 // Counters 74 // Counters
74 static int _nof_megamorphic_calls; // total # of megamorphic calls (through vtable) 75 static int _nof_megamorphic_calls; // total # of megamorphic calls (through vtable)
75 #endif // !PRODUCT 76 #endif // !PRODUCT
76 77
77 private: 78 private:
78 static SafepointBlob* generate_handler_blob(address call_ptr, bool cause_return); 79 enum { POLL_AT_RETURN, POLL_AT_LOOP, POLL_AT_VECTOR_LOOP };
80 static SafepointBlob* generate_handler_blob(address call_ptr, int poll_type);
79 static RuntimeStub* generate_resolve_blob(address destination, const char* name); 81 static RuntimeStub* generate_resolve_blob(address destination, const char* name);
80 82
81 public: 83 public:
82 static void generate_stubs(void); 84 static void generate_stubs(void);
83 85
224 return _resolve_static_call_blob->entry_point(); 226 return _resolve_static_call_blob->entry_point();
225 } 227 }
226 228
227 static SafepointBlob* polling_page_return_handler_blob() { return _polling_page_return_handler_blob; } 229 static SafepointBlob* polling_page_return_handler_blob() { return _polling_page_return_handler_blob; }
228 static SafepointBlob* polling_page_safepoint_handler_blob() { return _polling_page_safepoint_handler_blob; } 230 static SafepointBlob* polling_page_safepoint_handler_blob() { return _polling_page_safepoint_handler_blob; }
231 static SafepointBlob* polling_page_vectors_safepoint_handler_blob() { return _polling_page_vectors_safepoint_handler_blob; }
229 232
230 // Counters 233 // Counters
231 #ifndef PRODUCT 234 #ifndef PRODUCT
232 static address nof_megamorphic_calls_addr() { return (address)&_nof_megamorphic_calls; } 235 static address nof_megamorphic_calls_addr() { return (address)&_nof_megamorphic_calls; }
233 #endif // PRODUCT 236 #endif // PRODUCT
235 // Helper routine for full-speed JVMTI exception throwing support 238 // Helper routine for full-speed JVMTI exception throwing support
236 static void throw_and_post_jvmti_exception(JavaThread *thread, Handle h_exception); 239 static void throw_and_post_jvmti_exception(JavaThread *thread, Handle h_exception);
237 static void throw_and_post_jvmti_exception(JavaThread *thread, Symbol* name, const char *message = NULL); 240 static void throw_and_post_jvmti_exception(JavaThread *thread, Symbol* name, const char *message = NULL);
238 241
239 // RedefineClasses() tracing support for obsolete method entry 242 // RedefineClasses() tracing support for obsolete method entry
240 static int rc_trace_method_entry(JavaThread* thread, methodOopDesc* m); 243 static int rc_trace_method_entry(JavaThread* thread, Method* m);
241 244
242 // To be used as the entry point for unresolved native methods. 245 // To be used as the entry point for unresolved native methods.
243 static address native_method_throw_unsatisfied_link_error_entry(); 246 static address native_method_throw_unsatisfied_link_error_entry();
244 static address native_method_throw_unsupported_operation_exception_entry(); 247 static address native_method_throw_unsupported_operation_exception_entry();
245 248
254 static void register_finalizer(JavaThread* thread, oopDesc* obj); 257 static void register_finalizer(JavaThread* thread, oopDesc* obj);
255 258
256 // dtrace notifications 259 // dtrace notifications
257 static int dtrace_object_alloc(oopDesc* o); 260 static int dtrace_object_alloc(oopDesc* o);
258 static int dtrace_object_alloc_base(Thread* thread, oopDesc* o); 261 static int dtrace_object_alloc_base(Thread* thread, oopDesc* o);
259 static int dtrace_method_entry(JavaThread* thread, methodOopDesc* m); 262 static int dtrace_method_entry(JavaThread* thread, Method* m);
260 static int dtrace_method_exit(JavaThread* thread, methodOopDesc* m); 263 static int dtrace_method_exit(JavaThread* thread, Method* m);
261 264
262 // Utility method for retrieving the Java thread id, returns 0 if the 265 // Utility method for retrieving the Java thread id, returns 0 if the
263 // thread is not a well formed Java thread. 266 // thread is not a well formed Java thread.
264 static jlong get_java_tid(Thread* thread); 267 static jlong get_java_tid(Thread* thread);
265 268
346 // slot in the bottom of the frame. SharedInfo::stack0+1 refers to the memory word 349 // slot in the bottom of the frame. SharedInfo::stack0+1 refers to the memory word
347 // 4-bytes higher. So for sparc because the register window save area is at 350 // 4-bytes higher. So for sparc because the register window save area is at
348 // the bottom of the frame the first 16 words will be skipped and SharedInfo::stack0 351 // the bottom of the frame the first 16 words will be skipped and SharedInfo::stack0
349 // will be just above it. ( 352 // will be just above it. (
350 // return value is the maximum number of VMReg stack slots the convention will use. 353 // return value is the maximum number of VMReg stack slots the convention will use.
351 static int java_calling_convention(const BasicType *sig_bt, VMRegPair *regs, int total_args_passed, int is_outgoing); 354 static int java_calling_convention(const BasicType* sig_bt, VMRegPair* regs, int total_args_passed, int is_outgoing);
355
356 static void check_member_name_argument_is_last_argument(methodHandle method,
357 const BasicType* sig_bt,
358 const VMRegPair* regs) NOT_DEBUG_RETURN;
352 359
353 // Ditto except for calling C 360 // Ditto except for calling C
354 static int c_calling_convention(const BasicType *sig_bt, VMRegPair *regs, int total_args_passed); 361 static int c_calling_convention(const BasicType *sig_bt, VMRegPair *regs, int total_args_passed);
355 362
356 // Generate I2C and C2I adapters. These adapters are simple argument marshalling 363 // Generate I2C and C2I adapters. These adapters are simple argument marshalling
412 // otherwise be preserved. 419 // otherwise be preserved.
413 // On Intel these are not necessary and the value can be zero. 420 // On Intel these are not necessary and the value can be zero.
414 // On Sparc this describes the words reserved for storing a register window 421 // On Sparc this describes the words reserved for storing a register window
415 // when an interrupt occurs. 422 // when an interrupt occurs.
416 static uint out_preserve_stack_slots(); 423 static uint out_preserve_stack_slots();
424
425 // Is vector's size (in bytes) bigger than a size saved by default?
426 // For example, on x86 16 bytes XMM registers are saved by default.
427 static bool is_wide_vector(int size);
417 428
418 // Save and restore a native result 429 // Save and restore a native result
419 static void save_native_result(MacroAssembler *_masm, BasicType ret_type, int frame_slots ); 430 static void save_native_result(MacroAssembler *_masm, BasicType ret_type, int frame_slots );
420 static void restore_native_result(MacroAssembler *_masm, BasicType ret_type, int frame_slots ); 431 static void restore_native_result(MacroAssembler *_masm, BasicType ret_type, int frame_slots );
421 432
426 // returns. 437 // returns.
427 // 438 //
428 // The wrapper may contain special-case code if the given method 439 // The wrapper may contain special-case code if the given method
429 // is a JNI critical method, or a compiled method handle adapter, 440 // is a JNI critical method, or a compiled method handle adapter,
430 // such as _invokeBasic, _linkToVirtual, etc. 441 // such as _invokeBasic, _linkToVirtual, etc.
431 static nmethod *generate_native_wrapper(MacroAssembler* masm, 442 static nmethod* generate_native_wrapper(MacroAssembler* masm,
432 methodHandle method, 443 methodHandle method,
433 int compile_id, 444 int compile_id,
434 int total_args_passed, 445 BasicType* sig_bt,
435 int max_arg, 446 VMRegPair* regs,
436 BasicType *sig_bt,
437 VMRegPair *regs,
438 BasicType ret_type ); 447 BasicType ret_type );
439 448
440 // Block before entering a JNI critical method 449 // Block before entering a JNI critical method
441 static void block_for_jni_critical(JavaThread* thread); 450 static void block_for_jni_critical(JavaThread* thread);
442 451
453 static void get_utf(oopDesc* src, address dst); 462 static void get_utf(oopDesc* src, address dst);
454 #endif // def HAVE_DTRACE_H 463 #endif // def HAVE_DTRACE_H
455 464
456 // A compiled caller has just called the interpreter, but compiled code 465 // A compiled caller has just called the interpreter, but compiled code
457 // exists. Patch the caller so he no longer calls into the interpreter. 466 // exists. Patch the caller so he no longer calls into the interpreter.
458 static void fixup_callers_callsite(methodOopDesc* moop, address ret_pc); 467 static void fixup_callers_callsite(Method* moop, address ret_pc);
459 468
460 // Slow-path Locking and Unlocking 469 // Slow-path Locking and Unlocking
461 static void complete_monitor_locking_C(oopDesc* obj, BasicLock* lock, JavaThread* thread); 470 static void complete_monitor_locking_C(oopDesc* obj, BasicLock* lock, JavaThread* thread);
462 static void complete_monitor_unlocking_C(oopDesc* obj, BasicLock* lock); 471 static void complete_monitor_unlocking_C(oopDesc* obj, BasicLock* lock);
463 472