v8/test/mjsunit/regress/regress-298269.js
Sigurd Schneider 95bc6c7b87 [mjsunit] Use OptimizeOsr to speed up test
Bug: v8:7783
Change-Id: I878e8dd8bcfb7b797515b44bbe4333a7d85e8cc4
Reviewed-on: https://chromium-review.googlesource.com/1101024
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53738}
2018-06-14 15:54:53 +00:00

25 lines
681 B
JavaScript

// Copyright 2013 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 Cb(a, trigger) {
var f, g;
for(f = a.length; f--;) {
g = a.charCodeAt(f);
// This will fail after OSR if Runtime_StringCharCodeAt is modified
// to iterates optimized frames and visit safepoint pointers.
if (g == "C".charCodeAt(0)) %OptimizeOsr();
}
return g;
}
var s1 = "long string to make cons string 1";
var s2 = "long string to make cons string 2";
Cb(s1 + s2);
Cb(s1);
var s3 = "string for triggering osr in Cb";
Cb(s3 + s3);
Cb(s1 + s2);