comparison src/share/vm/runtime/sharedRuntime.hpp @ 6905:e4d10261499c

Merge
author asaha
date Fri, 07 Sep 2012 18:18:55 -0700
parents 93c71eb28866
children 957c266d8bc5 da91efe96a93
comparison
equal deleted inserted replaced
6904:defeb6dad7d5 6905:e4d10261499c
59 static RuntimeStub* _resolve_opt_virtual_call_blob; 59 static RuntimeStub* _resolve_opt_virtual_call_blob;
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 static RicochetBlob* _ricochet_blob;
65 64
66 static SafepointBlob* _polling_page_safepoint_handler_blob; 65 static SafepointBlob* _polling_page_safepoint_handler_blob;
67 static SafepointBlob* _polling_page_return_handler_blob; 66 static SafepointBlob* _polling_page_return_handler_blob;
68 67
69 #ifdef COMPILER2 68 #ifdef COMPILER2
185 static void throw_IncompatibleClassChangeError(JavaThread* thread); 184 static void throw_IncompatibleClassChangeError(JavaThread* thread);
186 static void throw_ArithmeticException(JavaThread* thread); 185 static void throw_ArithmeticException(JavaThread* thread);
187 static void throw_NullPointerException(JavaThread* thread); 186 static void throw_NullPointerException(JavaThread* thread);
188 static void throw_NullPointerException_at_call(JavaThread* thread); 187 static void throw_NullPointerException_at_call(JavaThread* thread);
189 static void throw_StackOverflowError(JavaThread* thread); 188 static void throw_StackOverflowError(JavaThread* thread);
190 static void throw_WrongMethodTypeException(JavaThread* thread, oopDesc* required, oopDesc* actual);
191 static address continuation_for_implicit_exception(JavaThread* thread, 189 static address continuation_for_implicit_exception(JavaThread* thread,
192 address faulting_pc, 190 address faulting_pc,
193 ImplicitExceptionKind exception_kind); 191 ImplicitExceptionKind exception_kind);
194 192
195 // Shared stub locations 193 // Shared stub locations
221 static address get_resolve_static_call_stub() { 219 static address get_resolve_static_call_stub() {
222 assert(_resolve_static_call_blob != NULL, "oops"); 220 assert(_resolve_static_call_blob != NULL, "oops");
223 return _resolve_static_call_blob->entry_point(); 221 return _resolve_static_call_blob->entry_point();
224 } 222 }
225 223
226 static RicochetBlob* ricochet_blob() {
227 #ifdef X86
228 // Currently only implemented on x86
229 assert(!EnableInvokeDynamic || _ricochet_blob != NULL, "oops");
230 #endif
231 return _ricochet_blob;
232 }
233
234 static void generate_ricochet_blob();
235
236 static SafepointBlob* polling_page_return_handler_blob() { return _polling_page_return_handler_blob; } 224 static SafepointBlob* polling_page_return_handler_blob() { return _polling_page_return_handler_blob; }
237 static SafepointBlob* polling_page_safepoint_handler_blob() { return _polling_page_safepoint_handler_blob; } 225 static SafepointBlob* polling_page_safepoint_handler_blob() { return _polling_page_safepoint_handler_blob; }
238 226
239 // Counters 227 // Counters
240 #ifndef PRODUCT 228 #ifndef PRODUCT
248 // RedefineClasses() tracing support for obsolete method entry 236 // RedefineClasses() tracing support for obsolete method entry
249 static int rc_trace_method_entry(JavaThread* thread, methodOopDesc* m); 237 static int rc_trace_method_entry(JavaThread* thread, methodOopDesc* m);
250 238
251 // To be used as the entry point for unresolved native methods. 239 // To be used as the entry point for unresolved native methods.
252 static address native_method_throw_unsatisfied_link_error_entry(); 240 static address native_method_throw_unsatisfied_link_error_entry();
241 static address native_method_throw_unsupported_operation_exception_entry();
253 242
254 // bytecode tracing is only used by the TraceBytecodes 243 // bytecode tracing is only used by the TraceBytecodes
255 static intptr_t trace_bytecode(JavaThread* thread, intptr_t preserve_this_value, intptr_t tos, intptr_t tos2) PRODUCT_RETURN0; 244 static intptr_t trace_bytecode(JavaThread* thread, intptr_t preserve_this_value, intptr_t tos, intptr_t tos2) PRODUCT_RETURN0;
256 245
257 // Used to back off a spin lock that is under heavy contention 246 // Used to back off a spin lock that is under heavy contention
287 * on top of the stack. 276 * on top of the stack.
288 * The caller (or one of it's callers) must use a ResourceMark 277 * The caller (or one of it's callers) must use a ResourceMark
289 * in order to correctly free the result. 278 * in order to correctly free the result.
290 */ 279 */
291 static char* generate_class_cast_message(JavaThread* thr, const char* name); 280 static char* generate_class_cast_message(JavaThread* thr, const char* name);
292
293 /**
294 * Fill in the message for a WrongMethodTypeException
295 *
296 * @param thr the current thread
297 * @param mtype (optional) expected method type (or argument class)
298 * @param mhandle (optional) actual method handle (or argument)
299 * @return the dynamically allocated exception message
300 *
301 * BCP for the frame on top of the stack must refer to an
302 * 'invokevirtual' op for a method handle, or an 'invokedyamic' op.
303 * The caller (or one of its callers) must use a ResourceMark
304 * in order to correctly free the result.
305 */
306 static char* generate_wrong_method_type_message(JavaThread* thr,
307 oopDesc* mtype = NULL,
308 oopDesc* mhandle = NULL);
309
310 /** Return non-null if the mtype is a klass or Class, not a MethodType. */
311 static oop wrong_method_type_is_for_single_argument(JavaThread* thr,
312 oopDesc* mtype);
313 281
314 /** 282 /**
315 * Fill in the "X cannot be cast to a Y" message for ClassCastException 283 * Fill in the "X cannot be cast to a Y" message for ClassCastException
316 * 284 *
317 * @param name the name of the class of the object attempted to be cast 285 * @param name the name of the class of the object attempted to be cast
451 // Generate a native wrapper for a given method. The method takes arguments 419 // Generate a native wrapper for a given method. The method takes arguments
452 // in the Java compiled code convention, marshals them to the native 420 // in the Java compiled code convention, marshals them to the native
453 // convention (handlizes oops, etc), transitions to native, makes the call, 421 // convention (handlizes oops, etc), transitions to native, makes the call,
454 // returns to java state (possibly blocking), unhandlizes any result and 422 // returns to java state (possibly blocking), unhandlizes any result and
455 // returns. 423 // returns.
424 //
425 // The wrapper may contain special-case code if the given method
426 // is a JNI critical method, or a compiled method handle adapter,
427 // such as _invokeBasic, _linkToVirtual, etc.
456 static nmethod *generate_native_wrapper(MacroAssembler* masm, 428 static nmethod *generate_native_wrapper(MacroAssembler* masm,
457 methodHandle method, 429 methodHandle method,
458 int compile_id, 430 int compile_id,
459 int total_args_passed, 431 int total_args_passed,
460 int max_arg, 432 int max_arg,
645 617
646 // should never be used 618 // should never be used
647 AdapterHandlerEntry(); 619 AdapterHandlerEntry();
648 620
649 public: 621 public:
650 address get_i2c_entry() { return _i2c_entry; } 622 address get_i2c_entry() const { return _i2c_entry; }
651 address get_c2i_entry() { return _c2i_entry; } 623 address get_c2i_entry() const { return _c2i_entry; }
652 address get_c2i_unverified_entry() { return _c2i_unverified_entry; } 624 address get_c2i_unverified_entry() const { return _c2i_unverified_entry; }
653 625
626 address base_address();
654 void relocate(address new_base); 627 void relocate(address new_base);
655 628
656 AdapterFingerPrint* fingerprint() { return _fingerprint; } 629 AdapterFingerPrint* fingerprint() const { return _fingerprint; }
657 630
658 AdapterHandlerEntry* next() { 631 AdapterHandlerEntry* next() {
659 return (AdapterHandlerEntry*)BasicHashtableEntry<mtCode>::next(); 632 return (AdapterHandlerEntry*)BasicHashtableEntry<mtCode>::next();
660 } 633 }
661 634
663 // Used to verify that code generated for shared adapters is equivalent 636 // Used to verify that code generated for shared adapters is equivalent
664 void save_code(unsigned char* code, int length, int total_args_passed, BasicType* sig_bt); 637 void save_code(unsigned char* code, int length, int total_args_passed, BasicType* sig_bt);
665 bool compare_code(unsigned char* code, int length, int total_args_passed, BasicType* sig_bt); 638 bool compare_code(unsigned char* code, int length, int total_args_passed, BasicType* sig_bt);
666 #endif 639 #endif
667 640
668 void print(); 641 //virtual void print_on(outputStream* st) const; DO NOT USE
642 void print_adapter_on(outputStream* st) const;
669 }; 643 };
670 644
671 class AdapterHandlerLibrary: public AllStatic { 645 class AdapterHandlerLibrary: public AllStatic {
672 private: 646 private:
673 static BufferBlob* _buffer; // the temporary code buffer in CodeCache 647 static BufferBlob* _buffer; // the temporary code buffer in CodeCache