Mercurial > hg > graal-compiler
comparison src/share/vm/code/nmethod.hpp @ 8151:b8f261ba79c6
Minimize diff to plain HotSpot version.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Thu, 07 Mar 2013 21:00:29 +0100 |
parents | 0b646334c5f7 |
children | c5ff08c22458 |
comparison
equal
deleted
inserted
replaced
8150:b66f831ac5ab | 8151:b8f261ba79c6 |
---|---|
289 ExceptionCache* exception_cache_entry_for_exception(Handle exception); | 289 ExceptionCache* exception_cache_entry_for_exception(Handle exception); |
290 | 290 |
291 // Inform external interfaces that a compiled method has been unloaded | 291 // Inform external interfaces that a compiled method has been unloaded |
292 void post_compiled_method_unload(); | 292 void post_compiled_method_unload(); |
293 | 293 |
294 // Initialize fields to their default values | 294 // Initailize fields to their default values |
295 void init_defaults(); | 295 void init_defaults(); |
296 | 296 |
297 public: | 297 public: |
298 // create nmethod with entry_bci | 298 // create nmethod with entry_bci |
299 static nmethod* new_nmethod(methodHandle method, | 299 static nmethod* new_nmethod(methodHandle method, |
355 bool is_compiled_by_c1() const; | 355 bool is_compiled_by_c1() const; |
356 bool is_compiled_by_graal() const; | 356 bool is_compiled_by_graal() const; |
357 bool is_compiled_by_c2() const; | 357 bool is_compiled_by_c2() const; |
358 bool is_compiled_by_shark() const; | 358 bool is_compiled_by_shark() const; |
359 | 359 |
360 | |
361 #define CHECK_POSITIVE(val) assert(val, "should be positive") | |
362 | |
363 // boundaries for different parts | 360 // boundaries for different parts |
364 address consts_begin () const { return header_begin() + _consts_offset ; } | 361 address consts_begin () const { return header_begin() + _consts_offset ; } |
365 address consts_end () const { return header_begin() + code_offset() ; } | 362 address consts_end () const { return header_begin() + code_offset() ; } |
366 address insts_begin () const { return header_begin() + code_offset() ; } | 363 address insts_begin () const { return header_begin() + code_offset() ; } |
367 address insts_end () const { return header_begin() + _stub_offset ; } | 364 address insts_end () const { return header_begin() + _stub_offset ; } |
368 address stub_begin () const { return header_begin() + _stub_offset ; } | 365 address stub_begin () const { return header_begin() + _stub_offset ; } |
369 address stub_end () const { return header_begin() + _oops_offset ; } | 366 address stub_end () const { return header_begin() + _oops_offset ; } |
370 address exception_begin () const { assert(_exception_offset >= 0, "no exception handler"); return header_begin() + _exception_offset ; } | 367 address exception_begin () const { return header_begin() + _exception_offset ; } |
371 address deopt_handler_begin () const { assert(_deoptimize_offset >= 0, "no deopt handler"); return header_begin() + _deoptimize_offset ; } | 368 address deopt_handler_begin () const { return header_begin() + _deoptimize_offset ; } |
372 address deopt_mh_handler_begin() const { return header_begin() + _deoptimize_mh_offset ; } | 369 address deopt_mh_handler_begin() const { return header_begin() + _deoptimize_mh_offset ; } |
373 address unwind_handler_begin () const { return _unwind_handler_offset != -1 ? (header_begin() + _unwind_handler_offset) : NULL; } | 370 address unwind_handler_begin () const { return _unwind_handler_offset != -1 ? (header_begin() + _unwind_handler_offset) : NULL; } |
374 oop* oops_begin () const { return (oop*) (header_begin() + _oops_offset) ; } | 371 oop* oops_begin () const { return (oop*) (header_begin() + _oops_offset) ; } |
375 oop* oops_end () const { return (oop*) (header_begin() + _metadata_offset) ; } | 372 oop* oops_end () const { return (oop*) (header_begin() + _metadata_offset) ; } |
376 | 373 |
772 _nm = new_nm; | 769 _nm = new_nm; |
773 lock_nmethod(_nm); | 770 lock_nmethod(_nm); |
774 } | 771 } |
775 }; | 772 }; |
776 | 773 |
777 #ifdef GRAAL | |
778 class DebugScopedNMethod : public DebugScopedValue { | |
779 private: | |
780 nmethod* _nm; | |
781 public: | |
782 DebugScopedNMethod(const char* file, int line, nmethod* nm) : DebugScopedValue(file, line), _nm(nm) {} | |
783 void print_on(outputStream* st); | |
784 }; | |
785 #define DS_NMETHOD(nm) DebugScopedNMethod __dsnm__(__FILE__, __LINE__, nm) | |
786 #define DS_NMETHOD1(name, nm) DebugScopedNMethod name(__FILE__, __LINE__, nm) | |
787 #else | |
788 #define DS_NMETHOD(nm) do {} while (0) | |
789 #define DS_NMETHOD1(name, nm) do {} while (0) | |
790 #endif | |
791 | |
792 #endif // SHARE_VM_CODE_NMETHOD_HPP | 774 #endif // SHARE_VM_CODE_NMETHOD_HPP |