blob: 361911800b2b133c790f3c7a9ea118f90779b36b [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001// Copyright 2015 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 Foo(x) {
8 this.x = x;
9}
10
11var f = new Foo(1);
12var g = new Foo(2);
13
14function add(a, b) {
15 return a.x + b.x;
16}
17
18assertEquals(3, add(f, g));
19assertEquals(3, add(g, f));
20%OptimizeFunctionOnNextCall(add);
21assertEquals(3, add(f, g));
22assertEquals(3, add(g, f));