libv8 3.10.8.0 → 3.11.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (215) hide show
  1. data/Rakefile +10 -3
  2. data/ext/libv8/compiler.rb +46 -0
  3. data/ext/libv8/extconf.rb +5 -1
  4. data/ext/libv8/make.rb +13 -0
  5. data/lib/libv8/version.rb +1 -1
  6. data/patches/add-freebsd9-and-freebsd10-to-gyp-GetFlavor.patch +11 -0
  7. data/patches/src_platform-freebsd.cc.patch +10 -0
  8. data/vendor/v8/ChangeLog +124 -0
  9. data/vendor/v8/DEPS +27 -0
  10. data/vendor/v8/Makefile +7 -0
  11. data/vendor/v8/SConstruct +15 -2
  12. data/vendor/v8/build/common.gypi +129 -157
  13. data/vendor/v8/build/gyp_v8 +11 -25
  14. data/vendor/v8/build/standalone.gypi +9 -3
  15. data/vendor/v8/include/v8.h +5 -3
  16. data/vendor/v8/src/SConscript +1 -0
  17. data/vendor/v8/src/api.cc +4 -33
  18. data/vendor/v8/src/api.h +2 -2
  19. data/vendor/v8/src/arm/builtins-arm.cc +5 -4
  20. data/vendor/v8/src/arm/code-stubs-arm.cc +21 -14
  21. data/vendor/v8/src/arm/codegen-arm.cc +2 -2
  22. data/vendor/v8/src/arm/debug-arm.cc +3 -1
  23. data/vendor/v8/src/arm/full-codegen-arm.cc +3 -102
  24. data/vendor/v8/src/arm/ic-arm.cc +30 -33
  25. data/vendor/v8/src/arm/lithium-arm.cc +20 -7
  26. data/vendor/v8/src/arm/lithium-arm.h +10 -4
  27. data/vendor/v8/src/arm/lithium-codegen-arm.cc +106 -60
  28. data/vendor/v8/src/arm/macro-assembler-arm.cc +49 -39
  29. data/vendor/v8/src/arm/macro-assembler-arm.h +5 -4
  30. data/vendor/v8/src/arm/regexp-macro-assembler-arm.cc +115 -55
  31. data/vendor/v8/src/arm/regexp-macro-assembler-arm.h +7 -6
  32. data/vendor/v8/src/arm/simulator-arm.h +6 -6
  33. data/vendor/v8/src/arm/stub-cache-arm.cc +64 -19
  34. data/vendor/v8/src/array.js +7 -3
  35. data/vendor/v8/src/ast.cc +11 -6
  36. data/vendor/v8/src/bootstrapper.cc +9 -11
  37. data/vendor/v8/src/builtins.cc +61 -31
  38. data/vendor/v8/src/code-stubs.cc +23 -9
  39. data/vendor/v8/src/code-stubs.h +1 -0
  40. data/vendor/v8/src/codegen.h +3 -3
  41. data/vendor/v8/src/compiler.cc +1 -1
  42. data/vendor/v8/src/contexts.h +2 -18
  43. data/vendor/v8/src/d8.cc +94 -93
  44. data/vendor/v8/src/d8.h +1 -1
  45. data/vendor/v8/src/debug-agent.cc +3 -3
  46. data/vendor/v8/src/debug.cc +41 -1
  47. data/vendor/v8/src/debug.h +50 -0
  48. data/vendor/v8/src/elements-kind.cc +134 -0
  49. data/vendor/v8/src/elements-kind.h +210 -0
  50. data/vendor/v8/src/elements.cc +356 -190
  51. data/vendor/v8/src/elements.h +36 -28
  52. data/vendor/v8/src/factory.cc +44 -4
  53. data/vendor/v8/src/factory.h +11 -7
  54. data/vendor/v8/src/flag-definitions.h +3 -0
  55. data/vendor/v8/src/frames.h +3 -0
  56. data/vendor/v8/src/full-codegen.cc +2 -1
  57. data/vendor/v8/src/func-name-inferrer.h +2 -0
  58. data/vendor/v8/src/globals.h +3 -0
  59. data/vendor/v8/src/heap-inl.h +16 -4
  60. data/vendor/v8/src/heap.cc +38 -32
  61. data/vendor/v8/src/heap.h +3 -17
  62. data/vendor/v8/src/hydrogen-instructions.cc +28 -5
  63. data/vendor/v8/src/hydrogen-instructions.h +142 -44
  64. data/vendor/v8/src/hydrogen.cc +160 -55
  65. data/vendor/v8/src/hydrogen.h +2 -0
  66. data/vendor/v8/src/ia32/assembler-ia32.h +3 -0
  67. data/vendor/v8/src/ia32/builtins-ia32.cc +5 -4
  68. data/vendor/v8/src/ia32/code-stubs-ia32.cc +22 -16
  69. data/vendor/v8/src/ia32/codegen-ia32.cc +2 -2
  70. data/vendor/v8/src/ia32/debug-ia32.cc +29 -2
  71. data/vendor/v8/src/ia32/full-codegen-ia32.cc +8 -101
  72. data/vendor/v8/src/ia32/ic-ia32.cc +23 -19
  73. data/vendor/v8/src/ia32/lithium-codegen-ia32.cc +126 -80
  74. data/vendor/v8/src/ia32/lithium-codegen-ia32.h +2 -1
  75. data/vendor/v8/src/ia32/lithium-ia32.cc +15 -9
  76. data/vendor/v8/src/ia32/lithium-ia32.h +14 -6
  77. data/vendor/v8/src/ia32/macro-assembler-ia32.cc +50 -40
  78. data/vendor/v8/src/ia32/macro-assembler-ia32.h +5 -4
  79. data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.cc +113 -43
  80. data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.h +9 -4
  81. data/vendor/v8/src/ia32/simulator-ia32.h +4 -4
  82. data/vendor/v8/src/ia32/stub-cache-ia32.cc +52 -14
  83. data/vendor/v8/src/ic.cc +77 -20
  84. data/vendor/v8/src/ic.h +18 -2
  85. data/vendor/v8/src/incremental-marking-inl.h +21 -5
  86. data/vendor/v8/src/incremental-marking.cc +35 -8
  87. data/vendor/v8/src/incremental-marking.h +12 -3
  88. data/vendor/v8/src/isolate.cc +12 -2
  89. data/vendor/v8/src/isolate.h +1 -1
  90. data/vendor/v8/src/jsregexp.cc +66 -26
  91. data/vendor/v8/src/jsregexp.h +60 -31
  92. data/vendor/v8/src/list-inl.h +8 -0
  93. data/vendor/v8/src/list.h +3 -0
  94. data/vendor/v8/src/lithium.cc +5 -2
  95. data/vendor/v8/src/liveedit.cc +57 -5
  96. data/vendor/v8/src/mark-compact-inl.h +17 -11
  97. data/vendor/v8/src/mark-compact.cc +100 -143
  98. data/vendor/v8/src/mark-compact.h +44 -20
  99. data/vendor/v8/src/messages.js +131 -99
  100. data/vendor/v8/src/mips/builtins-mips.cc +5 -4
  101. data/vendor/v8/src/mips/code-stubs-mips.cc +23 -15
  102. data/vendor/v8/src/mips/codegen-mips.cc +2 -2
  103. data/vendor/v8/src/mips/debug-mips.cc +3 -1
  104. data/vendor/v8/src/mips/full-codegen-mips.cc +4 -102
  105. data/vendor/v8/src/mips/ic-mips.cc +34 -36
  106. data/vendor/v8/src/mips/lithium-codegen-mips.cc +116 -68
  107. data/vendor/v8/src/mips/lithium-mips.cc +20 -7
  108. data/vendor/v8/src/mips/lithium-mips.h +11 -4
  109. data/vendor/v8/src/mips/macro-assembler-mips.cc +50 -39
  110. data/vendor/v8/src/mips/macro-assembler-mips.h +5 -4
  111. data/vendor/v8/src/mips/regexp-macro-assembler-mips.cc +110 -50
  112. data/vendor/v8/src/mips/regexp-macro-assembler-mips.h +6 -5
  113. data/vendor/v8/src/mips/simulator-mips.h +5 -5
  114. data/vendor/v8/src/mips/stub-cache-mips.cc +66 -20
  115. data/vendor/v8/src/mksnapshot.cc +5 -1
  116. data/vendor/v8/src/objects-debug.cc +103 -6
  117. data/vendor/v8/src/objects-inl.h +215 -116
  118. data/vendor/v8/src/objects-printer.cc +13 -8
  119. data/vendor/v8/src/objects.cc +608 -331
  120. data/vendor/v8/src/objects.h +129 -94
  121. data/vendor/v8/src/parser.cc +16 -4
  122. data/vendor/v8/src/platform-freebsd.cc +1 -0
  123. data/vendor/v8/src/platform-linux.cc +9 -30
  124. data/vendor/v8/src/platform-posix.cc +28 -7
  125. data/vendor/v8/src/platform-win32.cc +15 -3
  126. data/vendor/v8/src/platform.h +2 -1
  127. data/vendor/v8/src/profile-generator-inl.h +25 -2
  128. data/vendor/v8/src/profile-generator.cc +300 -822
  129. data/vendor/v8/src/profile-generator.h +97 -214
  130. data/vendor/v8/src/regexp-macro-assembler-irregexp.cc +2 -1
  131. data/vendor/v8/src/regexp-macro-assembler-irregexp.h +2 -2
  132. data/vendor/v8/src/regexp-macro-assembler-tracer.cc +6 -5
  133. data/vendor/v8/src/regexp-macro-assembler-tracer.h +1 -1
  134. data/vendor/v8/src/regexp-macro-assembler.cc +7 -3
  135. data/vendor/v8/src/regexp-macro-assembler.h +10 -2
  136. data/vendor/v8/src/regexp.js +6 -0
  137. data/vendor/v8/src/runtime.cc +265 -212
  138. data/vendor/v8/src/runtime.h +6 -5
  139. data/vendor/v8/src/scopes.cc +20 -0
  140. data/vendor/v8/src/scopes.h +6 -3
  141. data/vendor/v8/src/spaces.cc +0 -2
  142. data/vendor/v8/src/string-stream.cc +2 -2
  143. data/vendor/v8/src/v8-counters.h +0 -2
  144. data/vendor/v8/src/v8natives.js +2 -2
  145. data/vendor/v8/src/v8utils.h +6 -3
  146. data/vendor/v8/src/version.cc +1 -1
  147. data/vendor/v8/src/x64/assembler-x64.h +2 -1
  148. data/vendor/v8/src/x64/builtins-x64.cc +5 -4
  149. data/vendor/v8/src/x64/code-stubs-x64.cc +25 -16
  150. data/vendor/v8/src/x64/codegen-x64.cc +2 -2
  151. data/vendor/v8/src/x64/debug-x64.cc +14 -1
  152. data/vendor/v8/src/x64/disasm-x64.cc +1 -1
  153. data/vendor/v8/src/x64/full-codegen-x64.cc +10 -106
  154. data/vendor/v8/src/x64/ic-x64.cc +20 -16
  155. data/vendor/v8/src/x64/lithium-codegen-x64.cc +156 -79
  156. data/vendor/v8/src/x64/lithium-codegen-x64.h +2 -1
  157. data/vendor/v8/src/x64/lithium-x64.cc +18 -8
  158. data/vendor/v8/src/x64/lithium-x64.h +7 -2
  159. data/vendor/v8/src/x64/macro-assembler-x64.cc +50 -40
  160. data/vendor/v8/src/x64/macro-assembler-x64.h +5 -4
  161. data/vendor/v8/src/x64/regexp-macro-assembler-x64.cc +122 -51
  162. data/vendor/v8/src/x64/regexp-macro-assembler-x64.h +17 -8
  163. data/vendor/v8/src/x64/simulator-x64.h +4 -4
  164. data/vendor/v8/src/x64/stub-cache-x64.cc +55 -17
  165. data/vendor/v8/test/cctest/cctest.status +1 -0
  166. data/vendor/v8/test/cctest/test-api.cc +24 -0
  167. data/vendor/v8/test/cctest/test-func-name-inference.cc +38 -0
  168. data/vendor/v8/test/cctest/test-heap-profiler.cc +21 -77
  169. data/vendor/v8/test/cctest/test-heap.cc +164 -3
  170. data/vendor/v8/test/cctest/test-list.cc +12 -0
  171. data/vendor/v8/test/cctest/test-mark-compact.cc +5 -5
  172. data/vendor/v8/test/cctest/test-regexp.cc +14 -8
  173. data/vendor/v8/test/cctest/testcfg.py +2 -0
  174. data/vendor/v8/test/mjsunit/accessor-map-sharing.js +176 -0
  175. data/vendor/v8/test/mjsunit/array-construct-transition.js +3 -3
  176. data/vendor/v8/test/mjsunit/array-literal-transitions.js +10 -10
  177. data/vendor/v8/test/mjsunit/big-array-literal.js +3 -0
  178. data/vendor/v8/test/mjsunit/compiler/inline-construct.js +4 -2
  179. data/vendor/v8/test/mjsunit/debug-liveedit-stack-padding.js +88 -0
  180. data/vendor/v8/test/mjsunit/elements-kind.js +4 -4
  181. data/vendor/v8/test/mjsunit/elements-transition-hoisting.js +2 -2
  182. data/vendor/v8/test/mjsunit/elements-transition.js +5 -5
  183. data/vendor/v8/test/mjsunit/error-constructors.js +68 -33
  184. data/vendor/v8/test/mjsunit/harmony/proxies.js +14 -6
  185. data/vendor/v8/test/mjsunit/mjsunit.status +1 -0
  186. data/vendor/v8/test/mjsunit/packed-elements.js +112 -0
  187. data/vendor/v8/test/mjsunit/regexp-capture-3.js +6 -0
  188. data/vendor/v8/test/mjsunit/regexp-global.js +132 -0
  189. data/vendor/v8/test/mjsunit/regexp.js +11 -0
  190. data/vendor/v8/test/mjsunit/regress/regress-117409.js +52 -0
  191. data/vendor/v8/test/mjsunit/regress/regress-126412.js +33 -0
  192. data/vendor/v8/test/mjsunit/regress/regress-128018.js +35 -0
  193. data/vendor/v8/test/mjsunit/regress/regress-128146.js +33 -0
  194. data/vendor/v8/test/mjsunit/regress/regress-1639-2.js +4 -1
  195. data/vendor/v8/test/mjsunit/regress/regress-1639.js +14 -8
  196. data/vendor/v8/test/mjsunit/regress/regress-1849.js +3 -3
  197. data/vendor/v8/test/mjsunit/regress/regress-1878.js +2 -2
  198. data/vendor/v8/test/mjsunit/regress/regress-2071.js +79 -0
  199. data/vendor/v8/test/mjsunit/regress/regress-2153.js +32 -0
  200. data/vendor/v8/test/mjsunit/regress/regress-crbug-122271.js +4 -4
  201. data/vendor/v8/test/mjsunit/regress/regress-crbug-126414.js +32 -0
  202. data/vendor/v8/test/mjsunit/regress/regress-smi-only-concat.js +2 -2
  203. data/vendor/v8/test/mjsunit/regress/regress-transcendental.js +49 -0
  204. data/vendor/v8/test/mjsunit/stack-traces.js +14 -0
  205. data/vendor/v8/test/mjsunit/unbox-double-arrays.js +4 -3
  206. data/vendor/v8/test/test262/testcfg.py +6 -1
  207. data/vendor/v8/tools/check-static-initializers.sh +11 -3
  208. data/vendor/v8/tools/fuzz-harness.sh +92 -0
  209. data/vendor/v8/tools/grokdump.py +658 -67
  210. data/vendor/v8/tools/gyp/v8.gyp +21 -39
  211. data/vendor/v8/tools/js2c.py +3 -3
  212. data/vendor/v8/tools/jsmin.py +2 -2
  213. data/vendor/v8/tools/presubmit.py +2 -1
  214. data/vendor/v8/tools/test-wrapper-gypbuild.py +25 -11
  215. metadata +624 -612
@@ -1,4 +1,4 @@
1
- // Copyright 2011 the V8 project authors. All rights reserved.
1
+ // Copyright 2012 the V8 project authors. All rights reserved.
2
2
  // Redistribution and use in source and binary forms, with or without
3
3
  // modification, are permitted provided that the following conditions are
4
4
  // met:
@@ -29,6 +29,7 @@
29
29
  // Get the Debug object exposed from the debug context global object.
30
30
  Debug = debug.Debug
31
31
  var breaks = 0;
32
+ var exception = false;
32
33
 
33
34
  function sendCommand(state, cmd) {
34
35
  // Get the debug command processor in paused state.
@@ -47,15 +48,18 @@ function listener(event, exec_state, event_data, data) {
47
48
  "should not break on unexpected lines")
48
49
  assertEquals('BREAK ' + breaks, line.substr(-7));
49
50
  breaks++;
50
- sendCommand(exec_state, {
51
- seq: 0,
52
- type: "request",
53
- command: "continue",
54
- arguments: { stepaction: "next" }
55
- });
51
+ if (breaks < 4) {
52
+ sendCommand(exec_state, {
53
+ seq: 0,
54
+ type: "request",
55
+ command: "continue",
56
+ arguments: { stepaction: "next" }
57
+ });
58
+ }
56
59
  }
57
60
  } catch (e) {
58
61
  print(e);
62
+ exception = true;
59
63
  }
60
64
  }
61
65
 
@@ -82,4 +86,6 @@ function c() {
82
86
  // Set a break point and call to invoke the debug event listener.
83
87
  Debug.setBreakPoint(b, 0, 0);
84
88
  a(b);
85
- // BREAK 3
89
+ a(); // BREAK 3
90
+
91
+ assertFalse(exception);
@@ -1,4 +1,4 @@
1
- // Copyright 2011 the V8 project authors. All rights reserved.
1
+ // Copyright 2012 the V8 project authors. All rights reserved.
2
2
  // Redistribution and use in source and binary forms, with or without
3
3
  // modification, are permitted provided that the following conditions are
4
4
  // met:
@@ -25,7 +25,7 @@
25
25
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
26
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
27
 
28
- // See: http://code.google.com/p/v8/issues/detail?id=1878
28
+ // See: http://code.google.com/p/v8/issues/detail?id=1849
29
29
 
30
30
  // Flags: --allow-natives-syntax
31
31
 
@@ -36,4 +36,4 @@ for (var i = 0; i < count; i++) {
36
36
  arr[i] = 0;
37
37
  }
38
38
  assertFalse(%HasFastDoubleElements(arr));
39
- assertTrue(%HasFastSmiOnlyElements(arr));
39
+ assertTrue(%HasFastSmiElements(arr));
@@ -34,11 +34,11 @@ var a = Array();
34
34
  for (var i = 0; i < 1000; i++) {
35
35
  var ai = natives.InternalArray(10000);
36
36
  assertFalse(%HaveSameMap(ai, a));
37
- assertTrue(%HasFastElements(ai));
37
+ assertTrue(%HasFastObjectElements(ai));
38
38
  }
39
39
 
40
40
  for (var i = 0; i < 1000; i++) {
41
41
  var ai = new natives.InternalArray(10000);
42
42
  assertFalse(%HaveSameMap(ai, a));
43
- assertTrue(%HasFastElements(ai));
43
+ assertTrue(%HasFastObjectElements(ai));
44
44
  }
@@ -0,0 +1,79 @@
1
+ // Copyright 2012 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ a = {};
29
+
30
+ a.b = 42;
31
+
32
+ with(a) {
33
+ a.f = (function f1() {
34
+ function f2() {
35
+ return b;
36
+ };
37
+ return f2;
38
+ })();
39
+ }
40
+
41
+ for(var i = 0; i < 10000; i++) {
42
+ assertEquals(42, a.f());
43
+ }
44
+
45
+ with(a) {
46
+ a.g = (function f1() {
47
+ function f2() {
48
+ function f3() {
49
+ return b;
50
+ }
51
+ return f3;
52
+ };
53
+ return f2();
54
+ })();
55
+ }
56
+
57
+ for(var i = 0; i < 10000; i++) {
58
+ assertEquals(42, a.g());
59
+ }
60
+
61
+ function outer() {
62
+ with(a) {
63
+ a.h = (function f1() {
64
+ function f2() {
65
+ function f3() {
66
+ return b;
67
+ }
68
+ return f3;
69
+ };
70
+ return f2();
71
+ })();
72
+ }
73
+ };
74
+
75
+ outer();
76
+
77
+ for(var i = 0; i < 10000; i++) {
78
+ assertEquals(42, a.h());
79
+ }
@@ -0,0 +1,32 @@
1
+ // Copyright 2012 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ var o = {};
29
+ o.__defineGetter__('foo', function () { return null; });
30
+ var o = {};
31
+ o.foo = 42;
32
+ assertEquals(42, o.foo);
@@ -39,11 +39,11 @@ function foo(array) {
39
39
  array.foo = "bar";
40
40
  }
41
41
 
42
- assertTrue(%HasFastSmiOnlyElements(a));
43
- assertTrue(%HasFastElements(b));
42
+ assertTrue(%HasFastSmiElements(a));
43
+ assertTrue(%HasFastObjectElements(b));
44
44
 
45
45
  foo(a);
46
46
  foo(b);
47
47
 
48
- assertTrue(%HasFastSmiOnlyElements(a));
49
- assertTrue(%HasFastElements(b));
48
+ assertTrue(%HasFastSmiElements(a));
49
+ assertTrue(%HasFastObjectElements(b));
@@ -0,0 +1,32 @@
1
+ // Copyright 2012 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ function foo(bar) {
29
+ return arguments[bar];
30
+ }
31
+ foo(0); // Handled in runtime.
32
+ foo(-536870912); // Triggers bug.
@@ -33,5 +33,5 @@
33
33
  var fast_array = ['a', 'b'];
34
34
  var array = fast_array.concat(fast_array);
35
35
 
36
- assertTrue(%HasFastElements(fast_array));
37
- assertTrue(%HasFastElements(array));
36
+ assertTrue(%HasFastObjectElements(fast_array));
37
+ assertTrue(%HasFastObjectElements(array));
@@ -0,0 +1,49 @@
1
+ // Copyright 2012 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ // Flags: --expose-gc
29
+
30
+ // Test whether the runtime implementation and generated code of
31
+ // sine and tangens return the same results.
32
+
33
+ function test(f, x, name) {
34
+ // Reset transcendental cache.
35
+ gc();
36
+ // Initializing cache leads to a runtime call.
37
+ var runtime_result = f(x);
38
+ // Flush transcendental cache entries and optimize f.
39
+ for (var i = 0; i < 100000; i++) f(i);
40
+ // Calculate using generated code.
41
+ var gencode_result = f(x);
42
+ print(name + " runtime function: " + runtime_result);
43
+ print(name + " generated code : " + gencode_result);
44
+ assertEquals(gencode_result, runtime_result);
45
+ }
46
+
47
+ test(Math.tan, -1.57079632679489660000, "Math.tan");
48
+ test(Math.sin, 6.283185307179586, "Math.sin");
49
+
@@ -111,6 +111,18 @@ function testStrippedCustomError() {
111
111
  throw new CustomError("hep-hey", CustomError);
112
112
  }
113
113
 
114
+ MyObj = function() { FAIL; }
115
+
116
+ MyObjCreator = function() {}
117
+
118
+ MyObjCreator.prototype.Create = function() {
119
+ return new MyObj();
120
+ }
121
+
122
+ function testClassNames() {
123
+ (new MyObjCreator).Create();
124
+ }
125
+
114
126
  // Utility function for testing that the expected strings occur
115
127
  // in the stack trace produced when running the given function.
116
128
  function testTrace(name, fun, expected, unexpected) {
@@ -254,6 +266,8 @@ testTrace("testDefaultCustomError", testDefaultCustomError,
254
266
  ["collectStackTrace"]);
255
267
  testTrace("testStrippedCustomError", testStrippedCustomError, ["hep-hey"],
256
268
  ["new CustomError", "collectStackTrace"]);
269
+ testTrace("testClassNames", testClassNames,
270
+ ["new MyObj", "MyObjCreator.Create"], ["as Create"]);
257
271
  testCallerCensorship();
258
272
  testUnintendedCallerCensorship();
259
273
  testErrorsDuringFormatting();
@@ -1,4 +1,4 @@
1
- // Copyright 2011 the V8 project authors. All rights reserved.
1
+ // Copyright 2012 the V8 project authors. All rights reserved.
2
2
  // Redistribution and use in source and binary forms, with or without
3
3
  // modification, are permitted provided that the following conditions are
4
4
  // met:
@@ -278,7 +278,8 @@ function testOneArrayType(allocator) {
278
278
  expected_array_value(7));
279
279
 
280
280
  %DeoptimizeFunction(test_various_loads6);
281
- gc();
281
+ %ClearFunctionTypeFeedback(test_various_stores);
282
+ %ClearFunctionTypeFeedback(test_various_loads7);
282
283
 
283
284
  // Test stores for non-NaN.
284
285
  var large_array = new allocator(large_array_size);
@@ -376,7 +377,7 @@ delete large_array2[5];
376
377
  // Convert back to fast elements and make sure the contents of the array are
377
378
  // unchanged.
378
379
  large_array2[25] = new Object();
379
- assertTrue(%HasFastElements(large_array2));
380
+ assertTrue(%HasFastObjectElements(large_array2));
380
381
  for (var i= 0; i < approx_dict_to_elements_threshold; i += 500 ) {
381
382
  if (i != 25 && i != 5) {
382
383
  assertEquals(expected_array_value(i), large_array2[i]);
@@ -31,6 +31,7 @@ import os
31
31
  from os.path import join, exists
32
32
  import urllib
33
33
  import hashlib
34
+ import sys
34
35
  import tarfile
35
36
 
36
37
 
@@ -120,7 +121,11 @@ class Test262TestConfiguration(test.TestConfiguration):
120
121
  os.remove(archive_name)
121
122
  raise Exception("Hash mismatch of test data file")
122
123
  archive = tarfile.open(archive_name, 'r:bz2')
123
- archive.extractall(join(self.root))
124
+ if sys.platform in ('win32', 'cygwin'):
125
+ # Magic incantation to allow longer path names on Windows.
126
+ archive.extractall(u'\\\\?\\%s' % self.root)
127
+ else:
128
+ archive.extractall(self.root)
124
129
  os.rename(join(self.root, 'test262-%s' % revision), directory_name)
125
130
 
126
131
  def GetBuildRequirements(self):
@@ -37,14 +37,19 @@
37
37
  expected_static_init_count=3
38
38
 
39
39
  v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../)
40
- d8="${v8_root}/d8"
40
+
41
+ if [ -n "$1" ] ; then
42
+ d8="${v8_root}/$1"
43
+ else
44
+ d8="${v8_root}/d8"
45
+ fi
41
46
 
42
47
  if [ ! -f "$d8" ]; then
43
- echo "Please build the project with SCons."
48
+ echo "d8 binary not found: $d8"
44
49
  exit 1
45
50
  fi
46
51
 
47
- static_inits=$(nm "$d8" | grep _GLOBAL__I | awk '{ print $NF; }')
52
+ static_inits=$(nm "$d8" | grep _GLOBAL_ | grep _I_ | awk '{ print $NF; }')
48
53
 
49
54
  static_init_count=$(echo "$static_inits" | wc -l)
50
55
 
@@ -52,4 +57,7 @@ if [ $static_init_count -gt $expected_static_init_count ]; then
52
57
  echo "Too many static initializers."
53
58
  echo "$static_inits"
54
59
  exit 1
60
+ else
61
+ echo "Static initializer check passed ($static_init_count initializers)."
62
+ exit 0
55
63
  fi
@@ -0,0 +1,92 @@
1
+ #!/bin/bash
2
+ # Copyright 2012 the V8 project authors. All rights reserved.
3
+ # Redistribution and use in source and binary forms, with or without
4
+ # modification, are permitted provided that the following conditions are
5
+ # met:
6
+ #
7
+ # * Redistributions of source code must retain the above copyright
8
+ # notice, this list of conditions and the following disclaimer.
9
+ # * Redistributions in binary form must reproduce the above
10
+ # copyright notice, this list of conditions and the following
11
+ # disclaimer in the documentation and/or other materials provided
12
+ # with the distribution.
13
+ # * Neither the name of Google Inc. nor the names of its
14
+ # contributors may be used to endorse or promote products derived
15
+ # from this software without specific prior written permission.
16
+ #
17
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+
29
+ # A simple harness that downloads and runs 'jsfunfuzz' against d8. This
30
+ # takes a long time because it runs many iterations and is intended for
31
+ # automated usage. The package containing 'jsfunfuzz' can be found as an
32
+ # attachment to this bug:
33
+ # https://bugzilla.mozilla.org/show_bug.cgi?id=jsfunfuzz
34
+
35
+ JSFUNFUZZ_URL="https://bugzilla.mozilla.org/attachment.cgi?id=310631"
36
+ JSFUNFUZZ_MD5="d0e497201c5cd7bffbb1cdc1574f4e32"
37
+
38
+ v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../)
39
+
40
+ if [ -n "$1" ]; then
41
+ d8="${v8_root}/$1"
42
+ else
43
+ d8="${v8_root}/d8"
44
+ fi
45
+
46
+ if [ ! -f "$d8" ]; then
47
+ echo "Failed to find d8 binary: $d8"
48
+ exit 1
49
+ fi
50
+
51
+ jsfunfuzz_file="$v8_root/tools/jsfunfuzz.zip"
52
+ if [ ! -f "$jsfunfuzz_file" ]; then
53
+ echo "Downloading $jsfunfuzz_file ..."
54
+ wget -q -O "$jsfunfuzz_file" $JSFUNFUZZ_URL || exit 1
55
+ fi
56
+
57
+ jsfunfuzz_sum=$(md5sum "$jsfunfuzz_file" | awk '{ print $1 }')
58
+ if [ $jsfunfuzz_sum != $JSFUNFUZZ_MD5 ]; then
59
+ echo "Failed to verify checksum!"
60
+ exit 1
61
+ fi
62
+
63
+ jsfunfuzz_dir="$v8_root/tools/jsfunfuzz"
64
+ if [ ! -d "$jsfunfuzz_dir" ]; then
65
+ echo "Unpacking into $jsfunfuzz_dir ..."
66
+ unzip "$jsfunfuzz_file" -d "$jsfunfuzz_dir" || exit 1
67
+ echo "Patching runner ..."
68
+ cat << EOF | patch -s -p0 -d "$v8_root"
69
+ --- tools/jsfunfuzz/jsfunfuzz/multi_timed_run.py~
70
+ +++ tools/jsfunfuzz/jsfunfuzz/multi_timed_run.py
71
+ @@ -125,7 +125,7 @@
72
+
73
+ def many_timed_runs():
74
+ iteration = 0
75
+ - while True:
76
+ + while iteration < 100:
77
+ iteration += 1
78
+ logfilename = "w%d" % iteration
79
+ one_timed_run(logfilename)
80
+ EOF
81
+ fi
82
+
83
+ flags='--debug-code --expose-gc --verify-gc'
84
+ python -u "$jsfunfuzz_dir/jsfunfuzz/multi_timed_run.py" 300 \
85
+ "$d8" $flags "$jsfunfuzz_dir/jsfunfuzz/jsfunfuzz.js"
86
+ exit_code=$(cat w* | grep " looking good" -c)
87
+ exit_code=$((100-exit_code))
88
+ tar -cjf fuzz-results-$(date +%y%m%d).tar.bz2 err-* w*
89
+ rm -f err-* w*
90
+
91
+ echo "Total failures: $exit_code"
92
+ exit $exit_code