PPC/s390: Reland "[ptr-compr] New RelocInfo for compressed pointers."
Port ed319e841c
Original Commit Message:
Failure addressed by not exposing the new test to the jitless environment.
(jgruber@ on TBR).
New enum RelocInfo::COMPRESSED_EMBEDDED_OBJECT created to support
compressed pointers in generated code. Enum name EMBEDDED_OBJECT
changed to FULL_EMBEDDED_OBJECT.
RelocInfo::[set_]target_object() abstract away the difference between
FULL_EMBEDDED_OBJECT and COMPRESSED_EMBEDDED_OBJECT.
Compressed embedded objects can only be created at this time on
x64 with pointer compression turned on. Arm64 constant pools don't
support compressed objects at this time.
R=mvstanton@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N
Change-Id: I8bdb5391fd2b2565d2fcaf6c806fcdbe1a1f27b2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1589862
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#61123}
This commit is contained in:
parent
41ef63df21
commit
18c29ab939
@ -160,13 +160,17 @@ Address Assembler::return_address_from_call_start(Address pc) {
|
||||
}
|
||||
|
||||
HeapObject RelocInfo::target_object() {
|
||||
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
|
||||
DCHECK(IsCodeTarget(rmode_) || rmode_ == FULL_EMBEDDED_OBJECT);
|
||||
return HeapObject::cast(
|
||||
Object(Assembler::target_address_at(pc_, constant_pool_)));
|
||||
}
|
||||
|
||||
HeapObject RelocInfo::target_object_no_host(Isolate* isolate) {
|
||||
return target_object();
|
||||
}
|
||||
|
||||
Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
|
||||
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
|
||||
DCHECK(IsCodeTarget(rmode_) || rmode_ == FULL_EMBEDDED_OBJECT);
|
||||
return Handle<HeapObject>(reinterpret_cast<Address*>(
|
||||
Assembler::target_address_at(pc_, constant_pool_)));
|
||||
}
|
||||
@ -213,7 +217,7 @@ Address RelocInfo::target_off_heap_target() {
|
||||
}
|
||||
|
||||
void RelocInfo::WipeOut() {
|
||||
DCHECK(IsEmbeddedObject(rmode_) || IsCodeTarget(rmode_) ||
|
||||
DCHECK(IsFullEmbeddedObject(rmode_) || IsCodeTarget(rmode_) ||
|
||||
IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) ||
|
||||
IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_) ||
|
||||
IsOffHeapTarget(rmode_));
|
||||
|
@ -175,20 +175,20 @@ uint32_t RelocInfo::wasm_call_tag() const {
|
||||
Operand::Operand(Handle<HeapObject> handle) {
|
||||
rm_ = no_reg;
|
||||
value_.immediate = static_cast<intptr_t>(handle.address());
|
||||
rmode_ = RelocInfo::EMBEDDED_OBJECT;
|
||||
rmode_ = RelocInfo::FULL_EMBEDDED_OBJECT;
|
||||
}
|
||||
|
||||
Operand Operand::EmbeddedNumber(double value) {
|
||||
int32_t smi;
|
||||
if (DoubleToSmiInteger(value, &smi)) return Operand(Smi::FromInt(smi));
|
||||
Operand result(0, RelocInfo::EMBEDDED_OBJECT);
|
||||
Operand result(0, RelocInfo::FULL_EMBEDDED_OBJECT);
|
||||
result.is_heap_object_request_ = true;
|
||||
result.value_.heap_object_request = HeapObjectRequest(value);
|
||||
return result;
|
||||
}
|
||||
|
||||
Operand Operand::EmbeddedStringConstant(const StringConstantBase* str) {
|
||||
Operand result(0, RelocInfo::EMBEDDED_OBJECT);
|
||||
Operand result(0, RelocInfo::FULL_EMBEDDED_OBJECT);
|
||||
result.is_heap_object_request_ = true;
|
||||
result.value_.heap_object_request = HeapObjectRequest(str);
|
||||
return result;
|
||||
|
@ -106,7 +106,7 @@ class Operand {
|
||||
bool IsHeapObjectRequest() const {
|
||||
DCHECK_IMPLIES(is_heap_object_request_, IsImmediate());
|
||||
DCHECK_IMPLIES(is_heap_object_request_,
|
||||
rmode_ == RelocInfo::EMBEDDED_OBJECT ||
|
||||
rmode_ == RelocInfo::FULL_EMBEDDED_OBJECT ||
|
||||
rmode_ == RelocInfo::CODE_TARGET);
|
||||
return is_heap_object_request_;
|
||||
}
|
||||
|
@ -140,15 +140,19 @@ Handle<Object> Assembler::code_target_object_handle_at(Address pc) {
|
||||
}
|
||||
|
||||
HeapObject RelocInfo::target_object() {
|
||||
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
|
||||
DCHECK(IsCodeTarget(rmode_) || rmode_ == FULL_EMBEDDED_OBJECT);
|
||||
return HeapObject::cast(
|
||||
Object(Assembler::target_address_at(pc_, constant_pool_)));
|
||||
}
|
||||
|
||||
HeapObject RelocInfo::target_object_no_host(Isolate* isolate) {
|
||||
return target_object();
|
||||
}
|
||||
|
||||
Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
|
||||
DCHECK(IsRelativeCodeTarget(rmode_) || IsCodeTarget(rmode_) ||
|
||||
rmode_ == EMBEDDED_OBJECT);
|
||||
if (rmode_ == EMBEDDED_OBJECT) {
|
||||
rmode_ == FULL_EMBEDDED_OBJECT);
|
||||
if (rmode_ == FULL_EMBEDDED_OBJECT) {
|
||||
return Handle<HeapObject>(reinterpret_cast<Address*>(
|
||||
Assembler::target_address_at(pc_, constant_pool_)));
|
||||
} else {
|
||||
@ -159,7 +163,7 @@ Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
|
||||
void RelocInfo::set_target_object(Heap* heap, HeapObject target,
|
||||
WriteBarrierMode write_barrier_mode,
|
||||
ICacheFlushMode icache_flush_mode) {
|
||||
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
|
||||
DCHECK(IsCodeTarget(rmode_) || rmode_ == FULL_EMBEDDED_OBJECT);
|
||||
Assembler::set_target_address_at(pc_, constant_pool_, target->ptr(),
|
||||
icache_flush_mode);
|
||||
if (write_barrier_mode == UPDATE_WRITE_BARRIER && !host().is_null()) {
|
||||
@ -198,7 +202,7 @@ void RelocInfo::set_target_runtime_entry(Address target,
|
||||
}
|
||||
|
||||
void RelocInfo::WipeOut() {
|
||||
DCHECK(IsEmbeddedObject(rmode_) || IsCodeTarget(rmode_) ||
|
||||
DCHECK(IsFullEmbeddedObject(rmode_) || IsCodeTarget(rmode_) ||
|
||||
IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) ||
|
||||
IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_) ||
|
||||
IsOffHeapTarget(rmode_));
|
||||
|
@ -294,20 +294,20 @@ Operand::Operand(Handle<HeapObject> handle) {
|
||||
AllowHandleDereference using_location;
|
||||
rm_ = no_reg;
|
||||
value_.immediate = static_cast<intptr_t>(handle.address());
|
||||
rmode_ = RelocInfo::EMBEDDED_OBJECT;
|
||||
rmode_ = RelocInfo::FULL_EMBEDDED_OBJECT;
|
||||
}
|
||||
|
||||
Operand Operand::EmbeddedNumber(double value) {
|
||||
int32_t smi;
|
||||
if (DoubleToSmiInteger(value, &smi)) return Operand(Smi::FromInt(smi));
|
||||
Operand result(0, RelocInfo::EMBEDDED_OBJECT);
|
||||
Operand result(0, RelocInfo::FULL_EMBEDDED_OBJECT);
|
||||
result.is_heap_object_request_ = true;
|
||||
result.value_.heap_object_request = HeapObjectRequest(value);
|
||||
return result;
|
||||
}
|
||||
|
||||
Operand Operand::EmbeddedStringConstant(const StringConstantBase* str) {
|
||||
Operand result(0, RelocInfo::EMBEDDED_OBJECT);
|
||||
Operand result(0, RelocInfo::FULL_EMBEDDED_OBJECT);
|
||||
result.is_heap_object_request_ = true;
|
||||
result.value_.heap_object_request = HeapObjectRequest(str);
|
||||
return result;
|
||||
|
@ -138,7 +138,7 @@ class Operand {
|
||||
bool is_heap_object_request() const {
|
||||
DCHECK_IMPLIES(is_heap_object_request_, !rm_.is_valid());
|
||||
DCHECK_IMPLIES(is_heap_object_request_,
|
||||
rmode_ == RelocInfo::EMBEDDED_OBJECT ||
|
||||
rmode_ == RelocInfo::FULL_EMBEDDED_OBJECT ||
|
||||
rmode_ == RelocInfo::CODE_TARGET);
|
||||
return is_heap_object_request_;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user