b3b7011867
The CheckNonEmptyString lowering was the wrong way around and would deoptimize if it doesn't see the empty string. This leads to the creation of invalid ConsStrings and also to unnecessary deopt loops with proper code. Bug: chromium:947949, v8:8834, v8:8931, v8:8939, v8:8951 Change-Id: Ib2cc4e92cc9ec7e0284d94f74d14f67f8c878dec Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545908 Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Auto-Submit: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#60542}
12 lines
332 B
JavaScript
12 lines
332 B
JavaScript
// Copyright 2019 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 --verify-heap
|
|
|
|
function foo(s) { return s + '0123456789012'; }
|
|
foo('a');
|
|
foo('\u1000');
|
|
%OptimizeFunctionOnNextCall(foo);
|
|
foo('');
|