RFR: 8288477: nmethod header size reduction

Boris Ulasevich bulasevich at openjdk.org
Fri Jul 8 13:19:44 UTC 2022


On Thu, 7 Jul 2022 15:05:14 GMT, Rémi Forax <forax at openjdk.org> wrote:

> It's also a good idea to have 64 bytes in between volatiles so they are not in the same cache-line

Actually, there is not much space in nmethod. Can you suggest a better layout?:


    /* offset | size */ type = class nmethod : public CompiledMethod {
    /*  200   |    8 */    uint64_t _gc_epoch;
>   /*  208   |    8 */    volatile int64_t _stack_traversal_mark;
    /*  216   |    8 */    nmethod *_osr_link;
>   /*  224   |    8 */    nmethod::oops_do_mark_link * volatile _oops_do_mark_link;
    /*  232   |    8 */    address _entry_point;
    /*  240   |    8 */    address _verified_entry_point;
    /*  248   |    8 */    address _osr_entry_point;
    /*  256   |    4 */    int _entry_bci;
    /*  260   |    4 */    int _exception_offset;
    /*  264   |    4 */    int _unwind_handler_offset;
    /*  268   |    4 */    int _consts_offset;
    /*  272   |    4 */    int _stub_offset;
    /*  276   |    4 */    int _oops_offset;
    /*  280   |    4 */    int _metadata_offset;
    /*  284   |    4 */    int _scopes_data_offset;
    /*  288   |    4 */    int _scopes_pcs_offset;
    /*  292   |    4 */    int _dependencies_offset;
    /*  296   |    4 */    int _handler_table_offset;
    /*  300   |    4 */    int _nul_chk_table_offset;
    /*  304   |    4 */    int _speculations_offset;
    /*  308   |    4 */    int _jvmci_data_offset;
    /*  312   |    4 */    int _nmethod_end_offset;
    /*  316   |    4 */    int _orig_pc_offset;
    /*  320   |    4 */    int _compile_id;
    /*  324   |    4 */    RTMState _rtm_state;
>   /*  328   |    4 */    volatile jint _lock_count;
    /*  332   |    4 */    int _hotness_counter;
    /*  336   |    4 */    ByteSize _native_receiver_sp_offset;
    /*  340   |    4 */    ByteSize _native_basic_lock_sp_offset;
    /*  344   |    1 */    CompLevel _comp_level;
>   /*  345   |    1 */    volatile uint8_t _is_unloading_state;
    /*  346   |    1 */    bool _has_flushed_dependencies;
    /*  347   |    1 */    bool _unload_reported;
    /*  348   |    1 */    bool _load_reported;
>   /*  349   |    1 */    volatile signed char _state;
    /*  350   |    1 */    bool _oops_are_stale;

-------------

PR: https://git.openjdk.org/jdk/pull/9165


More information about the hotspot-dev mailing list