comparison src/share/vm/code/nmethod.hpp @ 21559:be896a1983c0

recast all Graal native code as JVMCI code (JBS:GRAAL-53)
author Doug Simon <doug.simon@oracle.com>
date Thu, 28 May 2015 15:36:48 +0200
parents 1621af5cb444
children 7ca4c8c37ca9
comparison
equal deleted inserted replaced
21558:d563baeca9df 21559:be896a1983c0
124 // Shared fields for all nmethod's 124 // Shared fields for all nmethod's
125 Method* _method; 125 Method* _method;
126 int _entry_bci; // != InvocationEntryBci if this nmethod is an on-stack replacement method 126 int _entry_bci; // != InvocationEntryBci if this nmethod is an on-stack replacement method
127 jmethodID _jmethod_id; // Cache of method()->jmethod_id() 127 jmethodID _jmethod_id; // Cache of method()->jmethod_id()
128 128
129 #ifdef GRAAL 129 #ifdef JVMCI
130 // Needed to keep nmethods alive that are not the default nmethod for the associated Method. 130 // Needed to keep nmethods alive that are not the default nmethod for the associated Method.
131 oop _graal_installed_code; 131 oop _jvmci_installed_code;
132 oop _speculation_log; 132 oop _speculation_log;
133 #endif 133 #endif
134 134
135 // To support simple linked-list chaining of nmethods: 135 // To support simple linked-list chaining of nmethods:
136 nmethod* _osr_link; // from InstanceKlass::osr_nmethods_head 136 nmethod* _osr_link; // from InstanceKlass::osr_nmethods_head
297 OopMapSet* oop_maps, 297 OopMapSet* oop_maps,
298 ExceptionHandlerTable* handler_table, 298 ExceptionHandlerTable* handler_table,
299 ImplicitExceptionTable* nul_chk_table, 299 ImplicitExceptionTable* nul_chk_table,
300 AbstractCompiler* compiler, 300 AbstractCompiler* compiler,
301 int comp_level 301 int comp_level
302 #ifdef GRAAL 302 #ifdef JVMCI
303 , Handle installed_code, 303 , Handle installed_code,
304 Handle speculation_log 304 Handle speculation_log
305 #endif 305 #endif
306 ); 306 );
307 307
338 OopMapSet* oop_maps, 338 OopMapSet* oop_maps,
339 ExceptionHandlerTable* handler_table, 339 ExceptionHandlerTable* handler_table,
340 ImplicitExceptionTable* nul_chk_table, 340 ImplicitExceptionTable* nul_chk_table,
341 AbstractCompiler* compiler, 341 AbstractCompiler* compiler,
342 int comp_level 342 int comp_level
343 #ifdef GRAAL 343 #ifdef JVMCI
344 , Handle installed_code = Handle(), 344 , Handle installed_code = Handle(),
345 Handle speculation_log = Handle() 345 Handle speculation_log = Handle()
346 #endif 346 #endif
347 ); 347 );
348 348
381 bool is_java_method() const { return !method()->is_native(); } 381 bool is_java_method() const { return !method()->is_native(); }
382 bool is_native_method() const { return method()->is_native(); } 382 bool is_native_method() const { return method()->is_native(); }
383 bool is_osr_method() const { return _entry_bci != InvocationEntryBci; } 383 bool is_osr_method() const { return _entry_bci != InvocationEntryBci; }
384 384
385 bool is_compiled_by_c1() const; 385 bool is_compiled_by_c1() const;
386 bool is_compiled_by_graal() const; 386 bool is_compiled_by_jvmci() const;
387 bool is_compiled_by_c2() const; 387 bool is_compiled_by_c2() const;
388 bool is_compiled_by_shark() const; 388 bool is_compiled_by_shark() const;
389 389
390 // boundaries for different parts 390 // boundaries for different parts
391 address consts_begin () const { return header_begin() + _consts_offset ; } 391 address consts_begin () const { return header_begin() + _consts_offset ; }
624 bool can_not_entrant_be_converted(); 624 bool can_not_entrant_be_converted();
625 625
626 // Evolution support. We make old (discarded) compiled methods point to new Method*s. 626 // Evolution support. We make old (discarded) compiled methods point to new Method*s.
627 void set_method(Method* method) { _method = method; } 627 void set_method(Method* method) { _method = method; }
628 628
629 #ifdef GRAAL 629 #ifdef JVMCI
630 oop graal_installed_code() { return _graal_installed_code ; } 630 oop jvmci_installed_code() { return _jvmci_installed_code ; }
631 char* graal_installed_code_name(char* buf, size_t buflen); 631 char* jvmci_installed_code_name(char* buf, size_t buflen);
632 void set_graal_installed_code(oop installed_code) { _graal_installed_code = installed_code; } 632 void set_jvmci_installed_code(oop installed_code) { _jvmci_installed_code = installed_code; }
633 oop speculation_log() { return _speculation_log ; } 633 oop speculation_log() { return _speculation_log ; }
634 void set_speculation_log(oop speculation_log) { _speculation_log = speculation_log; } 634 void set_speculation_log(oop speculation_log) { _speculation_log = speculation_log; }
635 #endif 635 #endif
636 636
637 // GC support 637 // GC support
693 693
694 // Deopt 694 // Deopt
695 // Return true is the PC is one would expect if the frame is being deopted. 695 // Return true is the PC is one would expect if the frame is being deopted.
696 bool is_deopt_pc (address pc) { return is_deopt_entry(pc) || is_deopt_mh_entry(pc); } 696 bool is_deopt_pc (address pc) { return is_deopt_entry(pc) || is_deopt_mh_entry(pc); }
697 697
698 // (thomaswue) When using graal, the address might be off by 5 (because this is the size of the call instruction. 698 // (thomaswue) When using jvmci, the address might be off by 5 (because this is the size of the call instruction.
699 // (thomaswue) TODO: Replace this by a more general mechanism. 699 // (thomaswue) TODO: Replace this by a more general mechanism.
700 // (sanzinger) SPARC has another offset, looked for some variable existing in HotSpot which describes this offset, but i have not 700 // (sanzinger) SPARC has another offset, looked for some variable existing in HotSpot which describes this offset, but i have not
701 // found anything. 701 // found anything.
702 bool is_deopt_entry (address pc) { 702 bool is_deopt_entry (address pc) {
703 return pc == deopt_handler_begin() 703 return pc == deopt_handler_begin()
704 #ifdef GRAAL 704 #ifdef JVMCI
705 || pc == deopt_handler_begin() + 705 || pc == deopt_handler_begin() +
706 #ifdef TARGET_ARCH_sparc 706 #ifdef TARGET_ARCH_sparc
707 8 707 8
708 #endif // sparc 708 #endif // sparc
709 #ifdef TARGET_ARCH_x86 709 #ifdef TARGET_ARCH_x86
710 5 710 5
711 #endif // x86 711 #endif // x86
712 #endif // GRAAL 712 #endif // JVMCI
713 ; 713 ;
714 } 714 }
715 bool is_deopt_mh_entry(address pc) { return pc == deopt_mh_handler_begin(); } 715 bool is_deopt_mh_entry(address pc) { return pc == deopt_mh_handler_begin(); }
716 // Accessor/mutator for the original pc of a frame before a frame was deopted. 716 // Accessor/mutator for the original pc of a frame before a frame was deopted.
717 address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); } 717 address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); }