2016-08-24 11:09:20 +00:00
|
|
|
// 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 A() {
|
|
|
|
this.x = 0;
|
|
|
|
for (var i = 0; i < max; ) {}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
%EnsureFeedbackVectorForFunction(A);
|
2016-08-24 11:09:20 +00:00
|
|
|
function foo() {
|
|
|
|
for (var i = 0; i < 1; i = 2) %OptimizeOsr();
|
|
|
|
return new A();
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
%PrepareFunctionForOptimization(foo);
|
2016-08-24 11:09:20 +00:00
|
|
|
try { foo(); } catch (e) { }
|