947142734a
The optimized code for String.charCodeAt(BigInt.asUintN(64, 10n)) did not throw a TypeError due to how lowering of CheckBounds triggers RepresentationChanger. Bug: chromium:1038573 Change-Id: Ie0f9ca95de5af5fd3701841ab169e11ccc77216c Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1986003 Auto-Submit: Nico Hartmann <nicohartmann@chromium.org> Reviewed-by: Maya Lekova <mslekova@chromium.org> Reviewed-by: Michael Stanton <mvstanton@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Nico Hartmann <nicohartmann@chromium.org> Cr-Commit-Position: refs/heads/master@{#65632}
31 lines
715 B
JavaScript
31 lines
715 B
JavaScript
// Copyright 2020 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(){
|
|
function f(x) {
|
|
return "abcd".charCodeAt(BigInt.asUintN(64, 10n));
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(f);
|
|
try { f(1); } catch(e) {}
|
|
try { f(1); } catch(e) {}
|
|
%OptimizeFunctionOnNextCall(f);
|
|
assertThrows(f, TypeError);
|
|
})();
|
|
|
|
|
|
(function(){
|
|
function f(x) {
|
|
return "abcd".charCodeAt(BigInt.asUintN(2, 10n));
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(f);
|
|
try { f(1); } catch(e) {}
|
|
try { f(1); } catch(e) {}
|
|
%OptimizeFunctionOnNextCall(f);
|
|
assertThrows(f, TypeError);
|
|
})();
|