[deoptimizer] Fix interpreter stack when V8_REVERSE_JSARGS

Change-Id: I14632106886f78286034a2624f77cab9dac14b41
Bug: v8:10201
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2219927
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68179}
This commit is contained in:
Victor Gomes 2020-06-03 15:40:26 +02:00 committed by Commit Bot
parent d16da853b3
commit 855392752a

View File

@ -916,9 +916,19 @@ void Deoptimizer::DoComputeInterpretedFrame(TranslatedFrame* translated_frame,
frame_writer.PushRawObject(roots.the_hole_value(), "padding\n");
}
#ifdef V8_REVERSE_JSARGS
std::vector<TranslatedFrame::iterator> parameters;
for (int i = 0; i < parameters_count; ++i, ++value_iterator) {
parameters.push_back(value_iterator);
}
for (auto& parameter : base::Reversed(parameters)) {
frame_writer.PushTranslatedValue(parameter, "stack parameter");
}
#else
for (int i = 0; i < parameters_count; ++i, ++value_iterator) {
frame_writer.PushTranslatedValue(value_iterator, "stack parameter");
}
#endif
DCHECK_EQ(output_frame->GetLastArgumentSlotOffset(),
frame_writer.top_offset());