1// 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//
5// Flags: --allow-natives-syntax
6
7function runNearStackLimit(f) {
8  function t() {
9    try { t(); } catch(e) { f(); }
10  };
11  try { t(); } catch(e) {}
12}
13
14function g(x) { return x.bar; }
15function f1() { }
16function f2() { }
17
18var x = Object.defineProperty({}, "bar", { get: f1 });
19g(x);
20g(x);
21var y = Object.defineProperty({}, "bar", { get: f2 });
22g(y);
23%OptimizeFunctionOnNextCall(g);
24runNearStackLimit(function() { g(y); });
25