-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8343789: Move mutable nmethod data out of CodeCache #21276
Draft
bulasevich
wants to merge
5
commits into
openjdk:master
Choose a base branch
from
bulasevich:mutable_data
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+154
−90
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d72804e
8343789: Move mutable nmethod data out of CodeCache
bulasevich 52dd527
fix stat printout
bulasevich c401e77
update: mutable data for all CodeBlobs with relocations
bulasevich 0c70bd2
update jvm.hotspot.code.CodeBlob class
bulasevich 88e3106
remove _code_end_offset
bulasevich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,8 +108,6 @@ class CodeBlob { | |
int _relocation_size; // size of relocation (could be bigger than 64Kb) | ||
int _content_offset; // offset to where content region begins (this includes consts, insts, stubs) | ||
int _code_offset; // offset to where instructions region begins (this includes insts, stubs) | ||
|
||
int _data_offset; // offset to where data region begins | ||
int _frame_size; // size of stack frame in words (NOT slots. On x64 these are 64bit words) | ||
|
||
S390_ONLY(int _ctable_offset;) | ||
|
@@ -124,13 +122,17 @@ class CodeBlob { | |
|
||
bool _caller_must_gc_arguments; | ||
|
||
address _mutable_data; | ||
int _mutable_data_size; | ||
|
||
Comment on lines
+125
to
+127
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add special CodeBlob subclass for nmethod to avoid increase of size for all blobs and stubs? |
||
#ifndef PRODUCT | ||
AsmRemarks _asm_remarks; | ||
DbgStrings _dbg_strings; | ||
#endif | ||
|
||
CodeBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size, uint16_t header_size, | ||
int16_t frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments); | ||
int16_t frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments, | ||
int mutable_data_size = 0); | ||
|
||
// Simple CodeBlob used for simple BufferBlob. | ||
CodeBlob(const char* name, CodeBlobKind kind, int size, uint16_t header_size); | ||
|
@@ -170,23 +172,27 @@ class CodeBlob { | |
UpcallStub* as_upcall_stub() const { assert(is_upcall_stub(), "must be upcall stub"); return (UpcallStub*) this; } | ||
RuntimeStub* as_runtime_stub() const { assert(is_runtime_stub(), "must be runtime blob"); return (RuntimeStub*) this; } | ||
|
||
address mutable_data_begin() const { return _mutable_data; } | ||
address mutable_data_end() const { return _mutable_data + _mutable_data_size; } | ||
int mutable_data_size() const { return _mutable_data_size; } | ||
|
||
// Boundaries | ||
address header_begin() const { return (address) this; } | ||
address header_end() const { return ((address) this) + _header_size; } | ||
relocInfo* relocation_begin() const { return (relocInfo*) header_end(); } | ||
relocInfo* relocation_end() const { return (relocInfo*)(header_end() + _relocation_size); } | ||
relocInfo* relocation_begin() const { return (relocInfo*)_mutable_data; } | ||
relocInfo* relocation_end() const { return (relocInfo*)((address)relocation_begin() + _relocation_size); } | ||
address content_begin() const { return (address) header_begin() + _content_offset; } | ||
address content_end() const { return (address) header_begin() + _data_offset; } | ||
address content_end() const { return (address) header_begin() + _size; } | ||
address code_begin() const { return (address) header_begin() + _code_offset; } | ||
// code_end == content_end is true for all types of blobs for now, it is also checked in the constructor | ||
address code_end() const { return (address) header_begin() + _data_offset; } | ||
address data_begin() const { return (address) header_begin() + _data_offset; } | ||
address data_end() const { return (address) header_begin() + _size; } | ||
address code_end() const { return (address) header_begin() + _size; } | ||
address blob_end() const { return (address) header_begin() + _size; } | ||
|
||
// [relocations, oops, metatada, jvmci_data] stays in _mutable_data | ||
address mdata_begin() const { return mutable_data_begin(); } | ||
address mdata_end() const { return mutable_data_end(); } | ||
// Offsets | ||
int content_offset() const { return _content_offset; } | ||
int code_offset() const { return _code_offset; } | ||
int data_offset() const { return _data_offset; } | ||
|
||
// This field holds the beginning of the const section in the old code buffer. | ||
// It is needed to fix relocations of pc-relative loads when resizing the | ||
|
@@ -204,11 +210,10 @@ class CodeBlob { | |
// Only used from CodeCache::free_unused_tail() after the Interpreter blob was trimmed | ||
void adjust_size(size_t used) { | ||
_size = (int)used; | ||
_data_offset = (int)used; | ||
} | ||
|
||
// Containment | ||
bool blob_contains(address addr) const { return header_begin() <= addr && addr < data_end(); } | ||
bool blob_contains(address addr) const { return header_begin() <= addr && addr < blob_end(); } | ||
bool code_contains(address addr) const { return code_begin() <= addr && addr < code_end(); } | ||
bool contains(address addr) const { return content_begin() <= addr && addr < content_end(); } | ||
bool is_frame_complete_at(address addr) const { return _frame_complete_offset != CodeOffsets::frame_never_safe && | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.