[deoptimizer] Reverse arguments in DoComputeArgumentsAdaptorFrame

Change-Id: I31e205b696627913584016bb9197e1e719ca0237
Bug: chromium:1120905, v8:10201
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2375191
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69565}
This commit is contained in:
Victor Gomes 2020-08-26 09:04:46 +02:00 committed by Commit Bot
parent 496b625220
commit d721dc8f14
2 changed files with 54 additions and 3 deletions

View File

@ -1209,9 +1209,7 @@ void Deoptimizer::DoComputeArgumentsAdaptorFrame(
} }
// Compute the incoming parameter translation. // Compute the incoming parameter translation.
for (int i = 0; i < parameters_count; ++i, ++value_iterator) { frame_writer.PushStackJSArguments(value_iterator, parameters_count);
frame_writer.PushTranslatedValue(value_iterator, "stack parameter");
}
DCHECK_EQ(output_frame->GetLastArgumentSlotOffset(), DCHECK_EQ(output_frame->GetLastArgumentSlotOffset(),
frame_writer.top_offset()); frame_writer.top_offset());

View File

@ -0,0 +1,53 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax
function O() {}
O.prototype.f = f;
O.prototype.g = g;
function f() {
return g.arguments;
}
function g(x) {
return this.f(2 - x, "any");
}
var o = new O();
function foo(x) {
return o.g(x, "z");
}
for (var i = 0; i < 35; i++) foo();
var result = (
%PrepareFunctionForOptimization(foo),foo(), foo(),
%OptimizeFunctionOnNextCall(foo), foo()
);
assertEquals(result[1], "z");