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 t1() { return this instanceof t1; }
8function t2() { return this instanceof t2; }
9
10var o1 = new (function() { })();
11Object.defineProperty(o1, "t", {get:function() { return this instanceof o1.constructor; }});
12var o2 = new (function() { })();
13Object.defineProperty(o2, "t", {get:function() { return this instanceof o1.constructor; }});
14var o3 = new (function() { })();
15o3.t = true;
16
17function f(o) {
18  return 1 + (o.t ? 1 : 2);
19}
20
21f(o1);
22f(o1);
23f(o2);
24%OptimizeFunctionOnNextCall(f);
25f(o3);
26