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( ...@@ -560,10 +560,12 @@ Handle<Object> JsonParser<Char>::BuildJsonObject(
: reinterpret_cast<Address>( : reinterpret_cast<Address>(
mutable_double_buffer->GetDataStartAddress()); mutable_double_buffer->GetDataStartAddress());
Address filler_address = mutable_double_address; Address filler_address = mutable_double_address;
if (IsAligned(mutable_double_address, kDoubleAlignment)) { if (kTaggedSize != kDoubleSize) {
mutable_double_address += kTaggedSize; if (IsAligned(mutable_double_address, kDoubleAlignment)) {
} else { mutable_double_address += kTaggedSize;
filler_address += HeapNumber::kSize; } else {
filler_address += HeapNumber::kSize;
}
} }
for (int j = 0; j < i; j++) { for (int j = 0; j < i; j++) {
const JsonProperty& property = property_stack[start + j]; const JsonProperty& property = property_stack[start + j];
...@@ -619,9 +621,13 @@ Handle<Object> JsonParser<Char>::BuildJsonObject( ...@@ -619,9 +621,13 @@ Handle<Object> JsonParser<Char>::BuildJsonObject(
#ifdef DEBUG #ifdef DEBUG
Address end = Address end =
reinterpret_cast<Address>(mutable_double_buffer->GetDataEndAddress()); reinterpret_cast<Address>(mutable_double_buffer->GetDataEndAddress());
DCHECK_EQ(Min(filler_address, mutable_double_address), end); if (kTaggedSize != kDoubleSize) {
DCHECK_GE(filler_address, end); DCHECK_EQ(Min(filler_address, mutable_double_address), end);
DCHECK_GE(mutable_double_address, end); DCHECK_GE(filler_address, end);
DCHECK_GE(mutable_double_address, end);
} else {
DCHECK_EQ(mutable_double_address, end);
}
#endif #endif
mutable_double_buffer->set_length(0); 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