Commit 21274fac authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[code] Ignore Code::constant_pool_offset field

.. if --enable-embedded-constant-pool (ppc-only) is not set. In this
case, the field simply doesn't exist, so we shouldn't read from it,
and definitely not write to it.

Tbr: leszeks@chromium.org
Bug: v8:11036
Change-Id: I8b2cf8cdd084f29060377790c882850bd9ec43c5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2504255Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70830}
parent 6742d410
......@@ -527,10 +527,18 @@ bool Code::is_optimized_code() const {
bool Code::is_wasm_code() const { return kind() == CodeKind::WASM_FUNCTION; }
int Code::constant_pool_offset() const {
if (!FLAG_enable_embedded_constant_pool) {
// Redirection needed since the field doesn't exist in this case.
return code_comments_offset();
}
return ReadField<int>(kConstantPoolOffsetOffset);
}
void Code::set_constant_pool_offset(int value) {
if (!FLAG_enable_embedded_constant_pool) {
// Redirection needed since the field doesn't exist in this case.
return;
}
DCHECK_LE(value, MetadataSize());
WriteField<int>(kConstantPoolOffsetOffset, value);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment