Commit bee8c168 authored by Jaroslav Sevcik's avatar Jaroslav Sevcik Committed by Commit Bot

[deoptimizer] Use empty fixed array when materializing empty arguments elements.

Bug: chromium:793863
Change-Id: I68860924c3252184f63dbea8561e5c4fe6bfa4ca
Reviewed-on: https://chromium-review.googlesource.com/822071Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50028}
parent 256bb274
......@@ -2837,6 +2837,11 @@ void TranslatedState::CreateArgumentsElementsTranslatedValues(
PrintF(trace_file, "arguments elements object #%d (type = %d, length = %d)",
object_index, static_cast<uint8_t>(type), length);
}
if (length == 0) {
frame.Add(TranslatedValue::NewTagged(
this, isolate_->heap()->empty_fixed_array()));
return;
}
object_positions_.push_back({frame_index, value_index});
frame.Add(TranslatedValue::NewDeferredObject(
this, length + FixedArray::kHeaderSize / kPointerSize, object_index));
......
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
function f(a) {
return arguments[0];
}
%OptimizeFunctionOnNextCall(f);
assertEquals(undefined, f());
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