v8/test/mjsunit/regress/regress-sync-optimized-lists.js
Georg Neis 2257f6b145 [compiler][test] Remove --block-concurrent-recompilation
- Remove flag --block-concurrent-recompilation and its implementation,
  including %UnblockConcurrentCompilation.
- Rewrite tests that used it in terms of the primitives introduced in
  my previous CL:
  https://chromium-review.googlesource.com/c/v8/v8/+/3071400/
- Remove "sync"/"no sync" arguments from %GetOptimizationStatus,
  assertOptimized, etc. These are now always "no sync": they don't
  do any magic.
- Remove "if %IsConcurrentRecompilationSupported then quit" from some
  tests in favor of --concurrent-recompilation in their Flags line.

Bug: v8:12041, v8:7790
Change-Id: I966aae4fec85e6f9e7aeed2ba2c12e9198a3991f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3077149
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76298}
2021-08-16 10:15:53 +00:00

43 lines
894 B
JavaScript

// Copyright 2014 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 Ctor() {
this.a = 1;
}
function get_closure() {
return function add_field(obj, osr) {
obj.c = 3;
var x = 0;
if (osr) %OptimizeOsr();
for (var i = 0; i < 10; i++) {
x = i + 1;
}
return x;
}
}
var f1 = get_closure();
%PrepareFunctionForOptimization(f1);
f1(new Ctor(), false);
f1(new Ctor(), false);
%OptimizeFunctionOnNextCall(f1, "concurrent");
// Kick off concurrent recompilation and OSR.
var o = new Ctor();
%PrepareFunctionForOptimization(f1);
f1(o, true);
// Flush the optimizing compiler's queue.
%NotifyContextDisposed();
// Trigger deopt.
o.c = 2.2;
var f2 = get_closure();
%PrepareFunctionForOptimization(f2);
f2(new Ctor(), true);