author | sundar |
Thu, 09 Jan 2014 19:23:34 +0530 | |
changeset 22379 | 5181d08e3440 |
parent 20943 | 183832541ef7 |
child 24778 | 2ff5d7041566 |
permissions | -rw-r--r-- |
20943
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
1 |
/* |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
2 |
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
4 |
* |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
8 |
* |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
13 |
* accompanied this code). |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
14 |
* |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
18 |
* |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
21 |
* questions. |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
22 |
*/ |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
23 |
|
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
24 |
/** |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
25 |
* JDK-8026016: too many relinks dominate avatar.js http benchmark |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
26 |
* |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
27 |
* @test |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
28 |
* @run |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
29 |
*/ |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
30 |
|
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
31 |
function accessMegamorphic() { |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
32 |
for (var i = 0; i < 26; i++) { |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
33 |
var o = {}; |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
34 |
o[String.fromCharCode(i + 97)] = 1; |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
35 |
o._; |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
36 |
} |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
37 |
} |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
38 |
|
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
39 |
function invokeMegamorphic() { |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
40 |
for (var i = 0; i < 26; i++) { |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
41 |
var o = {}; |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
42 |
o[String.fromCharCode(i + 97)] = 1; |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
43 |
try { |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
44 |
o._(i); |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
45 |
} catch (e) { |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
46 |
print(e); |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
47 |
} |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
48 |
} |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
49 |
} |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
50 |
|
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
51 |
Object.prototype.__noSuchProperty__ = function() { |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
52 |
print("no such property", Array.prototype.slice.call(arguments)); |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
53 |
}; |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
54 |
|
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
55 |
invokeMegamorphic(); |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
56 |
accessMegamorphic(); |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
57 |
|
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
58 |
Object.prototype.__noSuchMethod__ = function() { |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
59 |
print("no such method", Array.prototype.slice.call(arguments)); |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
60 |
}; |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
61 |
|
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
62 |
invokeMegamorphic(); |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
63 |
accessMegamorphic(); |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
64 |
|
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
65 |
Object.prototype.__noSuchMethod__ = "nofunction"; |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
66 |
|
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
67 |
invokeMegamorphic(); |
183832541ef7
8026016: too many relinks dominate avatar.js http benchmark
hannesw
parents:
diff
changeset
|
68 |
accessMegamorphic(); |