blob: f4995488b335a739aabdf9aa9724c135928dc4d0 [file] [log] [blame]
Ben Murdochc5610432016-08-08 18:44:38 +01001// Copyright 2016 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
5function fn1() {
6}
7
8function fn2() {
9}
10
11function fn3() {
12}
13
14function create(id) {
15 // Just some `FunctionTemplate` to hang on
16 var o = new version();
17
18 o.id = id;
19 o[0] = null;
20
21 return o;
22}
23
24function setM1(o) {
25 o.m1 = fn1;
26}
27
28function setM2(o) {
29 o.m2 = fn2;
30}
31
32function setAltM2(o) {
33 // Failing StoreIC happens here
34 o.m2 = fn3;
35}
36
37function setAltM1(o) {
38 o.m1 = null;
39}
40
41function test(o) {
42 o.m2();
43 o.m1();
44}
45
46var p0 = create(0);
47var p1 = create(1);
48var p2 = create(2);
49
50setM1(p0);
51setM1(p1);
52setM1(p2);
53
54setM2(p0);
55setAltM2(p0);
56setAltM1(p0);
57
58setAltM2(p1);
59
60setAltM2(p2);
61test(p2);