Commit e6c4e6d1 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[deoptimizer] Store frame height as proper Smi

For BuiltinContinuationFrames we stored the frame-height as a plain
value, which did not cause problems because height (in bytes) always
looks like a Smi to the GC. This CL introduces proper Smi encoding.

Bug: v8:7584
Change-Id: I5e3c41c2e576926bbb2bad7dbe0f277cc017b495
Reviewed-on: https://chromium-review.googlesource.com/1000782Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52476}
parent 4fe70280
......@@ -1713,7 +1713,7 @@ void Deoptimizer::DoComputeBuiltinContinuation(
// The delta from the SP to the FP; used to reconstruct SP in
// Isolate::UnwindAndFindHandler.
output_frame_offset -= kPointerSize;
value = static_cast<intptr_t>(output_frame_size_above_fp);
value = reinterpret_cast<intptr_t>(Smi::FromInt(output_frame_size_above_fp));
output_frame->SetFrameSlot(output_frame_offset, value);
DebugPrintOutputSlot(value, frame_index, output_frame_offset,
"frame height at deoptimization\n");
......
......@@ -1223,7 +1223,7 @@ int JavaScriptBuiltinContinuationFrame::ComputeParametersCount() const {
intptr_t JavaScriptBuiltinContinuationFrame::GetSPToFPDelta() const {
Address height_slot =
fp() + BuiltinContinuationFrameConstants::kFrameSPtoFPDeltaAtDeoptimize;
intptr_t height = *reinterpret_cast<intptr_t*>(height_slot);
intptr_t height = Smi::ToInt(*reinterpret_cast<Smi**>(height_slot));
return height;
}
......
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