-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8362515: RISC-V: cleanup NativeFarCall #26370
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,41 +111,52 @@ NativeCall* nativeCall_before(address return_address); | |
// The NativeCall is an abstraction for accessing/manipulating native | ||
// call instructions (used to manipulate inline caches, primitive & | ||
// DSO calls, etc.). | ||
// NativeCall is reloc call on RISC-V. See MacroAssembler::reloc_call. | ||
class NativeCall: private NativeInstruction { | ||
// private: when common code is using byte_size() | ||
private: | ||
enum { | ||
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. I see the enum of NativeFarCall was named as 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. Thank you having a look. Seems not, there is no name for this enum in orignal code . And in this file some enums have names, some not, but seems either way is fine, although I think the names are all redundant here. |
||
// Use byte_size() as it can be changed in runtime | ||
// Since instruction_size exists on NativeInstruction we need | ||
// to overload and hide it. | ||
instruction_size = 3 * Assembler::instruction_size // auipc + ld + jalr | ||
instruction_size = 3 * NativeInstruction::instruction_size // auipc + ld + jalr | ||
}; | ||
public: | ||
|
||
static int byte_size() { | ||
return 3 * NativeInstruction::instruction_size; // auipc + ld + jalr | ||
return NativeCall::instruction_size; // auipc + ld + jalr | ||
} | ||
|
||
// Creation | ||
friend NativeCall* nativeCall_at(address addr); | ||
friend NativeCall* nativeCall_before(address return_address); | ||
|
||
address instruction_address() const; | ||
address next_instruction_address() const; | ||
address return_address() const; | ||
address instruction_address() const { return addr_at(0); } | ||
address next_instruction_address() const { return addr_at(NativeCall::instruction_size); } | ||
address return_address() const { return addr_at(NativeCall::instruction_size); } | ||
address destination() const; | ||
address reloc_destination(); | ||
|
||
void verify_alignment() {} // do nothing on riscv | ||
void verify(); | ||
void print(); | ||
|
||
void set_destination(address dest); | ||
void set_destination(address dest) { Unimplemented(); } | ||
// patch stub to target address of the reloc call | ||
bool set_destination_mt_safe(address dest); | ||
// patch reloc call to stub address | ||
bool reloc_set_destination(address dest); | ||
|
||
static bool is_at(address addr); | ||
static bool is_call_before(address return_address); | ||
|
||
private: | ||
// return stub address, without checking stub address in locs | ||
address stub_address(); | ||
// set target address at stub | ||
static void set_stub_address_destination_at(address dest, address value); | ||
// return target address at stub | ||
static address stub_address_destination_at(address src); | ||
}; | ||
|
||
// An interface for accessing/manipulating native mov reg, imm instructions. | ||
|
Uh oh!
There was an error while loading. Please reload this page.