Commit cd89e291 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[json] Fix DCHECKs in json-parser

... which fail when double fields unboxing is disabled.

Bug: v8:9799
Change-Id: I77f11046d5a50c37c113aa8d9c5b8ca1148a746b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1835549Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64087}
parent e5ef9eb5
......@@ -560,10 +560,12 @@ Handle<Object> JsonParser<Char>::BuildJsonObject(
: reinterpret_cast<Address>(
mutable_double_buffer->GetDataStartAddress());
Address filler_address = mutable_double_address;
if (IsAligned(mutable_double_address, kDoubleAlignment)) {
mutable_double_address += kTaggedSize;
} else {
filler_address += HeapNumber::kSize;
if (kTaggedSize != kDoubleSize) {
if (IsAligned(mutable_double_address, kDoubleAlignment)) {
mutable_double_address += kTaggedSize;
} else {
filler_address += HeapNumber::kSize;
}
}
for (int j = 0; j < i; j++) {
const JsonProperty& property = property_stack[start + j];
......@@ -619,9 +621,13 @@ Handle<Object> JsonParser<Char>::BuildJsonObject(
#ifdef DEBUG
Address end =
reinterpret_cast<Address>(mutable_double_buffer->GetDataEndAddress());
DCHECK_EQ(Min(filler_address, mutable_double_address), end);
DCHECK_GE(filler_address, end);
DCHECK_GE(mutable_double_address, end);
if (kTaggedSize != kDoubleSize) {
DCHECK_EQ(Min(filler_address, mutable_double_address), end);
DCHECK_GE(filler_address, end);
DCHECK_GE(mutable_double_address, end);
} else {
DCHECK_EQ(mutable_double_address, end);
}
#endif
mutable_double_buffer->set_length(0);
}
......
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