# HG changeset patch # User eosterlund # Date 1542876944 -3600 # Node ID 9cb53c505acda214904f6d1b4378181487199a19 # Parent 8b26bd8b18329951f782aecaed12a06674f9ee30 8214056: Allow the GC to attach context information to CompiledMethod Reviewed-by: shade, kvn, adinn diff -r 8b26bd8b1832 -r 9cb53c505acd src/hotspot/share/code/compiledMethod.cpp --- a/src/hotspot/share/code/compiledMethod.cpp Thu Nov 22 09:46:24 2018 +0100 +++ b/src/hotspot/share/code/compiledMethod.cpp Thu Nov 22 09:55:44 2018 +0100 @@ -44,7 +44,8 @@ bool caller_must_gc_arguments) : CodeBlob(name, type, layout, frame_complete_offset, frame_size, oop_maps, caller_must_gc_arguments), _mark_for_deoptimization_status(not_marked), - _method(method) + _method(method), + _gc_data(NULL) { init_defaults(); } @@ -55,7 +56,8 @@ : CodeBlob(name, type, CodeBlobLayout((address) this, size, header_size, cb), cb, frame_complete_offset, frame_size, oop_maps, caller_must_gc_arguments), _mark_for_deoptimization_status(not_marked), - _method(method) + _method(method), + _gc_data(NULL) { init_defaults(); } diff -r 8b26bd8b1832 -r 9cb53c505acd src/hotspot/share/code/compiledMethod.hpp --- a/src/hotspot/share/code/compiledMethod.hpp Thu Nov 22 09:46:24 2018 +0100 +++ b/src/hotspot/share/code/compiledMethod.hpp Thu Nov 22 09:55:44 2018 +0100 @@ -169,6 +169,8 @@ PcDescContainer _pc_desc_container; ExceptionCache * volatile _exception_cache; + void* _gc_data; + virtual void flush() = 0; protected: CompiledMethod(Method* method, const char* name, CompilerType type, const CodeBlobLayout& layout, int frame_complete_offset, int frame_size, ImmutableOopMapSet* oop_maps, bool caller_must_gc_arguments); @@ -177,6 +179,11 @@ public: virtual bool is_compiled() const { return true; } + template + T* gc_data() const { return reinterpret_cast(_gc_data); } + template + void set_gc_data(T* gc_data) { _gc_data = reinterpret_cast(gc_data); } + bool has_unsafe_access() const { return _has_unsafe_access; } void set_has_unsafe_access(bool z) { _has_unsafe_access = z; }