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// Flags: --allow-natives-syntax
5
6function genM() {
7  "use strict";
8  return function () {
9    return this.field;
10  };
11}
12
13function genR() {
14  var x = {
15    field: 10
16  }
17  return x;
18}
19
20method = {};
21receiver = {};
22
23method = genM("A");
24receiver = genR("A");
25
26var foo = (function () {
27  return function suspect (name) {
28    "use strict";
29    return method.apply(receiver, arguments);
30  }
31})();
32
33foo("a", "b", "c");
34foo("a", "b", "c");
35foo("a", "b", "c");
36%OptimizeFunctionOnNextCall(foo);
37foo("a", "b", "c");
38