2015-08-04 17:48:42 +00:00
|
|
|
// Copyright 2015 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.
|
|
|
|
|
2016-12-05 18:28:14 +00:00
|
|
|
// Flags: --allow-natives-syntax
|
2015-08-04 17:48:42 +00:00
|
|
|
|
2017-05-09 21:45:33 +00:00
|
|
|
// The following triggers a GC in Context::AddToOSROptimizedCodeCache.
|
2015-08-04 17:48:42 +00:00
|
|
|
// Flags: --gc-interval=1234 --gc-global
|
|
|
|
|
|
|
|
function makeFun() {
|
|
|
|
function fun(osr_fuse) {
|
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == osr_fuse) %OptimizeOsr();
|
|
|
|
}
|
|
|
|
for (var i = 3; i < 6; ++i) {
|
|
|
|
if (i == osr_fuse) %OptimizeOsr();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return fun;
|
|
|
|
}
|
|
|
|
|
|
|
|
makeFun()(7); // Warm up.
|
|
|
|
makeFun()(4); // Optimize once.
|
|
|
|
makeFun()(1); // Optimize again.
|