< prev index next >

src/hotspot/share/runtime/sharedRuntime.hpp

Print this page

496   static void complete_monitor_unlocking_C(oopDesc* obj, BasicLock* lock, JavaThread* current);
497 
498   // Resolving of calls
499   static address resolve_static_call_C     (JavaThread* current);
500   static address resolve_virtual_call_C    (JavaThread* current);
501   static address resolve_opt_virtual_call_C(JavaThread* current);
502 
503   // arraycopy, the non-leaf version.  (See StubRoutines for all the leaf calls.)
504   static void slow_arraycopy_C(oopDesc* src,  jint src_pos,
505                                oopDesc* dest, jint dest_pos,
506                                jint length, JavaThread* thread);
507 
508   // handle ic miss with caller being compiled code
509   // wrong method handling (inline cache misses)
510   static address handle_wrong_method(JavaThread* current);
511   static address handle_wrong_method_abstract(JavaThread* current);
512   static address handle_wrong_method_ic_miss(JavaThread* current);
513 
514   static address handle_unsafe_access(JavaThread* thread, address next_pc);
515 















516 #ifndef PRODUCT
517 
518   // Collect and print inline cache miss statistics
519  private:
520   enum { maxICmiss_count = 100 };
521   static int     _ICmiss_index;                  // length of IC miss histogram
522   static int     _ICmiss_count[maxICmiss_count]; // miss counts
523   static address _ICmiss_at[maxICmiss_count];    // miss addresses
524   static void trace_ic_miss(address at);
525 
526  public:
527   static uint _ic_miss_ctr;                      // total # of IC misses
528   static uint _wrong_method_ctr;
529   static uint _resolve_static_ctr;
530   static uint _resolve_virtual_ctr;
531   static uint _resolve_opt_virtual_ctr;
532   static uint _implicit_null_throws;
533   static uint _implicit_div0_throws;
534 
535   static uint _jbyte_array_copy_ctr;       // Slow-path byte array copy
536   static uint _jshort_array_copy_ctr;      // Slow-path short array copy
537   static uint _jint_array_copy_ctr;        // Slow-path int array copy
538   static uint _jlong_array_copy_ctr;       // Slow-path long array copy
539   static uint _oop_array_copy_ctr;         // Slow-path oop array copy
540   static uint _checkcast_array_copy_ctr;   // Slow-path oop array copy, with cast
541   static uint _unsafe_array_copy_ctr;      // Slow-path includes alignment checks
542   static uint _generic_array_copy_ctr;     // Slow-path includes type decoding
543   static uint _slow_array_copy_ctr;        // Slow-path failed out to a method call
544 
545   static uint _new_instance_ctr;           // 'new' object requires GC
546   static uint _new_array_ctr;              // 'new' array requires GC
547   static uint _multi2_ctr, _multi3_ctr, _multi4_ctr, _multi5_ctr;
548   static uint _find_handler_ctr;           // find exception handler
549   static uint _rethrow_ctr;                // rethrow exception
550   static uint _mon_enter_stub_ctr;         // monitor enter stub
551   static uint _mon_exit_stub_ctr;          // monitor exit stub

553   static uint _mon_exit_ctr;               // monitor exit slow
554   static uint _partial_subtype_ctr;        // SubRoutines::partial_subtype_check
555 
556   // Statistics code
557   // stats for "normal" compiled calls (non-interface)
558   static int64_t _nof_normal_calls;               // total # of calls
559   static int64_t _nof_inlined_calls;              // total # of inlined normal calls
560   static int64_t _nof_static_calls;               // total # of calls to static methods or super methods (invokespecial)
561   static int64_t _nof_inlined_static_calls;       // total # of inlined static calls
562   // stats for compiled interface calls
563   static int64_t _nof_interface_calls;            // total # of compiled calls
564   static int64_t _nof_inlined_interface_calls;    // total # of inlined interface calls
565 
566  public: // for compiler
567   static address nof_normal_calls_addr()                { return (address)&_nof_normal_calls; }
568   static address nof_inlined_calls_addr()               { return (address)&_nof_inlined_calls; }
569   static address nof_static_calls_addr()                { return (address)&_nof_static_calls; }
570   static address nof_inlined_static_calls_addr()        { return (address)&_nof_inlined_static_calls; }
571   static address nof_interface_calls_addr()             { return (address)&_nof_interface_calls; }
572   static address nof_inlined_interface_calls_addr()     { return (address)&_nof_inlined_interface_calls; }
573   static void print_call_statistics(uint64_t comp_total);
574   static void print_ic_miss_histogram();
575 


576 #endif // PRODUCT
577 
578   static void print_statistics() PRODUCT_RETURN;
579 };
580 
581 
582 // ---------------------------------------------------------------------------
583 // Implementation of AdapterHandlerLibrary
584 //
585 // This library manages argument marshaling adapters and native wrappers.
586 // There are 2 flavors of adapters: I2C and C2I.
587 //
588 // The I2C flavor takes a stock interpreted call setup, marshals the
589 // arguments for a Java-compiled call, and jumps to Rmethod-> code()->
590 // code_begin().  It is broken to call it without an nmethod assigned.
591 // The usual behavior is to lift any register arguments up out of the
592 // stack and possibly re-pack the extra arguments to be contiguous.
593 // I2C adapters will save what the interpreter's stack pointer will be
594 // after arguments are popped, then adjust the interpreter's frame
595 // size to force alignment and possibly to repack the arguments.

680   static void initialize();
681   static AdapterHandlerEntry* create_adapter(AdapterBlob*& new_adapter,
682                                              int total_args_passed,
683                                              BasicType* sig_bt,
684                                              bool allocate_code_blob);
685   static AdapterHandlerEntry* get_simple_adapter(const methodHandle& method);
686  public:
687 
688   static AdapterHandlerEntry* new_entry(AdapterFingerPrint* fingerprint,
689                                         address i2c_entry,
690                                         address c2i_entry,
691                                         address c2i_unverified_entry,
692                                         address c2i_no_clinit_check_entry = nullptr);
693   static void create_native_wrapper(const methodHandle& method);
694   static AdapterHandlerEntry* get_adapter(const methodHandle& method);
695 
696   static void print_handler(const CodeBlob* b) { print_handler_on(tty, b); }
697   static void print_handler_on(outputStream* st, const CodeBlob* b);
698   static bool contains(const CodeBlob* b);
699 #ifndef PRODUCT
700   static void print_statistics();
701 #endif // PRODUCT
702 
703 };
704 
705 #endif // SHARE_RUNTIME_SHAREDRUNTIME_HPP

496   static void complete_monitor_unlocking_C(oopDesc* obj, BasicLock* lock, JavaThread* current);
497 
498   // Resolving of calls
499   static address resolve_static_call_C     (JavaThread* current);
500   static address resolve_virtual_call_C    (JavaThread* current);
501   static address resolve_opt_virtual_call_C(JavaThread* current);
502 
503   // arraycopy, the non-leaf version.  (See StubRoutines for all the leaf calls.)
504   static void slow_arraycopy_C(oopDesc* src,  jint src_pos,
505                                oopDesc* dest, jint dest_pos,
506                                jint length, JavaThread* thread);
507 
508   // handle ic miss with caller being compiled code
509   // wrong method handling (inline cache misses)
510   static address handle_wrong_method(JavaThread* current);
511   static address handle_wrong_method_abstract(JavaThread* current);
512   static address handle_wrong_method_ic_miss(JavaThread* current);
513 
514   static address handle_unsafe_access(JavaThread* thread, address next_pc);
515 
516  private:
517   static PerfTickCounters* _perf_resolve_opt_virtual_total_time;
518   static PerfTickCounters* _perf_resolve_virtual_total_time;
519   static PerfTickCounters* _perf_resolve_static_total_time;
520   static PerfTickCounters* _perf_handle_wrong_method_total_time;
521   static PerfTickCounters* _perf_ic_miss_total_time;
522  public:
523   static uint _ic_miss_ctr;                      // total # of IC misses
524   static uint _wrong_method_ctr;
525   static uint _resolve_static_ctr;
526   static uint _resolve_virtual_ctr;
527   static uint _resolve_opt_virtual_ctr;
528 
529   static void print_counters_on(outputStream* st);
530 
531 #ifndef PRODUCT
532 
533   // Collect and print inline cache miss statistics
534  private:
535   enum { maxICmiss_count = 100 };
536   static int     _ICmiss_index;                  // length of IC miss histogram
537   static int     _ICmiss_count[maxICmiss_count]; // miss counts
538   static address _ICmiss_at[maxICmiss_count];    // miss addresses
539   static void trace_ic_miss(address at);
540 
541  public:





542   static uint _implicit_null_throws;
543   static uint _implicit_div0_throws;
544 
545   static uint _jbyte_array_copy_ctr;       // Slow-path byte array copy
546   static uint _jshort_array_copy_ctr;      // Slow-path short array copy
547   static uint _jint_array_copy_ctr;        // Slow-path int array copy
548   static uint _jlong_array_copy_ctr;       // Slow-path long array copy
549   static uint _oop_array_copy_ctr;         // Slow-path oop array copy
550   static uint _checkcast_array_copy_ctr;   // Slow-path oop array copy, with cast
551   static uint _unsafe_array_copy_ctr;      // Slow-path includes alignment checks
552   static uint _generic_array_copy_ctr;     // Slow-path includes type decoding
553   static uint _slow_array_copy_ctr;        // Slow-path failed out to a method call
554 
555   static uint _new_instance_ctr;           // 'new' object requires GC
556   static uint _new_array_ctr;              // 'new' array requires GC
557   static uint _multi2_ctr, _multi3_ctr, _multi4_ctr, _multi5_ctr;
558   static uint _find_handler_ctr;           // find exception handler
559   static uint _rethrow_ctr;                // rethrow exception
560   static uint _mon_enter_stub_ctr;         // monitor enter stub
561   static uint _mon_exit_stub_ctr;          // monitor exit stub

563   static uint _mon_exit_ctr;               // monitor exit slow
564   static uint _partial_subtype_ctr;        // SubRoutines::partial_subtype_check
565 
566   // Statistics code
567   // stats for "normal" compiled calls (non-interface)
568   static int64_t _nof_normal_calls;               // total # of calls
569   static int64_t _nof_inlined_calls;              // total # of inlined normal calls
570   static int64_t _nof_static_calls;               // total # of calls to static methods or super methods (invokespecial)
571   static int64_t _nof_inlined_static_calls;       // total # of inlined static calls
572   // stats for compiled interface calls
573   static int64_t _nof_interface_calls;            // total # of compiled calls
574   static int64_t _nof_inlined_interface_calls;    // total # of inlined interface calls
575 
576  public: // for compiler
577   static address nof_normal_calls_addr()                { return (address)&_nof_normal_calls; }
578   static address nof_inlined_calls_addr()               { return (address)&_nof_inlined_calls; }
579   static address nof_static_calls_addr()                { return (address)&_nof_static_calls; }
580   static address nof_inlined_static_calls_addr()        { return (address)&_nof_inlined_static_calls; }
581   static address nof_interface_calls_addr()             { return (address)&_nof_interface_calls; }
582   static address nof_inlined_interface_calls_addr()     { return (address)&_nof_inlined_interface_calls; }


583 
584   static void print_call_statistics_on(outputStream* st);
585   static void print_ic_miss_histogram_on(outputStream* st);
586 #endif // PRODUCT
587 
588   static void print_statistics() PRODUCT_RETURN;
589 };
590 
591 
592 // ---------------------------------------------------------------------------
593 // Implementation of AdapterHandlerLibrary
594 //
595 // This library manages argument marshaling adapters and native wrappers.
596 // There are 2 flavors of adapters: I2C and C2I.
597 //
598 // The I2C flavor takes a stock interpreted call setup, marshals the
599 // arguments for a Java-compiled call, and jumps to Rmethod-> code()->
600 // code_begin().  It is broken to call it without an nmethod assigned.
601 // The usual behavior is to lift any register arguments up out of the
602 // stack and possibly re-pack the extra arguments to be contiguous.
603 // I2C adapters will save what the interpreter's stack pointer will be
604 // after arguments are popped, then adjust the interpreter's frame
605 // size to force alignment and possibly to repack the arguments.

690   static void initialize();
691   static AdapterHandlerEntry* create_adapter(AdapterBlob*& new_adapter,
692                                              int total_args_passed,
693                                              BasicType* sig_bt,
694                                              bool allocate_code_blob);
695   static AdapterHandlerEntry* get_simple_adapter(const methodHandle& method);
696  public:
697 
698   static AdapterHandlerEntry* new_entry(AdapterFingerPrint* fingerprint,
699                                         address i2c_entry,
700                                         address c2i_entry,
701                                         address c2i_unverified_entry,
702                                         address c2i_no_clinit_check_entry = nullptr);
703   static void create_native_wrapper(const methodHandle& method);
704   static AdapterHandlerEntry* get_adapter(const methodHandle& method);
705 
706   static void print_handler(const CodeBlob* b) { print_handler_on(tty, b); }
707   static void print_handler_on(outputStream* st, const CodeBlob* b);
708   static bool contains(const CodeBlob* b);
709 #ifndef PRODUCT
710   static void print_statistics_on(outputStream* st);
711 #endif // PRODUCT
712 
713 };
714 
715 #endif // SHARE_RUNTIME_SHAREDRUNTIME_HPP
< prev index next >