OLD | NEW |
---|---|
(Empty) | |
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: --expose-gc --allow-natives-syntax --verify-heap --stress-compaction | |
6 | |
7 %SetAllocationTimeout(1000000, 1000000); | |
Hannes Payer (out of office)
2014/04/08 14:19:27
The test looks super fragile, but there is probabl
Jarin
2014/04/08 21:04:16
Indeed, I am not sure how to make it better (it to
| |
8 | |
9 function classOf(object) { | |
10 var string = Object.prototype.toString.call(object); | |
11 return string.substring(8, string.length - 1); | |
12 } | |
13 | |
14 function PrettyPrint() { } | |
15 | |
16 function fail() { } | |
17 | |
18 function deepEquals(a, b) { | |
19 if (a === b) return true; | |
20 var objectClass = classOf(a); | |
21 var objectClassB = classOf(b); | |
22 if (objectClass !== objectClassB) return false; | |
23 } | |
24 | |
25 function assertEquals(expected, found, name_opt) { | |
26 deepEquals(found, expected); | |
27 fail(PrettyPrint()); | |
28 } | |
29 | |
30 function assertTrue(value, name_opt) { assertEquals(true, value, name_opt); } | |
31 | |
32 var __v_3 = {}; | |
33 | |
34 assertEquals(true, true); | |
35 | |
36 Object.prototype.__defineGetter__(0, function() { } ); | |
37 var __v_9 = { }; | |
38 | |
39 function __f_11(obj) { | |
40 if (%HasFastObjectElements(obj)) return __v_9.dummy2; | |
41 assertTrue(true); | |
42 } | |
43 | |
44 function __f_10(expected, obj) { | |
45 assertEquals(true, __f_11(obj)); | |
46 } | |
47 | |
48 var __sequence = undefined + 1; | |
49 | |
50 function __f_12() { | |
51 this.__sequence = this.__sequence + 1; | |
52 return eval("/* " + this.__sequence + " */ [-5, 3, 9];"); | |
53 } | |
54 | |
55 function __f_15() { | |
56 var __v_8 = __f_12(); | |
57 __v_8[0] = 0; | |
58 __f_10(__v_9.dummy1, __v_3); | |
59 return __v_8; | |
60 } | |
61 | |
62 function __f_9() { | |
63 var __v_8 = __f_15(); | |
64 __v_8[0] = 1.5; | |
65 __f_10("", __v_8); | |
66 return __v_8; | |
67 } | |
68 | |
69 function __f_8(array, value, kind) { | |
70 array[1] = value; | |
71 __f_10("", array); | |
72 assertEquals(true, array[1]); | |
73 } | |
74 | |
75 gc(); | |
76 %SetAllocationTimeout(100000, 150); | |
77 | |
78 function __f_14() { | |
79 __f_8(__f_15(), 1.5); | |
80 __f_8(__f_9(), "x"); | |
81 } | |
82 | |
83 __f_14(); | |
OLD | NEW |