blob: ab1b339f7d6f676a664e094bbad2d25af00fd7ea [file] [log] [blame]
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001// Copyright 2014 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4// Flags: --allow-natives-syntax --nostress-opt
5// Flags: --nouse-osr
6
7function foo(obj) {
8 var counter = 1;
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00009 for (var i = 0; i < obj.length; i++) %OptimizeOsr();
Ben Murdochb8a8cc12014-11-26 15:28:44 +000010 counter += obj;
11 return counter;
12}
13
14function bar() {
15 var a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
16 for (var i = 0; i < 100; i++ ) {
17 foo(a);
18 }
19}
20
21try {
22 bar();
23} catch (e) {
24}