Commit 8ed4e172 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[ptr-compr] Don't use Code::cast for off-heap code objects

because attempt to decompress the off-heap map slot will fail.

Bug: v8:7703
Change-Id: Iad3884fb95ccb17b2992d190acb5914062a0e8f4
Reviewed-on: https://chromium-review.googlesource.com/c/1365286Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58076}
parent 8a321c5d
......@@ -309,7 +309,9 @@ Code Serializer::CopyCode(Code code) {
code_buffer_.insert(code_buffer_.end(),
reinterpret_cast<byte*>(code->address()),
reinterpret_cast<byte*>(code->address() + size));
return Code::cast(HeapObject::FromAddress(
// When pointer compression is enabled the checked cast will try to
// decompress map field of off-heap Code object.
return Code::unchecked_cast(HeapObject::FromAddress(
reinterpret_cast<Address>(&code_buffer_.front())));
}
......
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