therubyracer 0.4.7-x86-darwin-10

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of therubyracer might be problematic. Click here for more details.

Files changed (1194) hide show
  1. data/Doxyfile +1514 -0
  2. data/History.txt +39 -0
  3. data/Manifest.txt +1192 -0
  4. data/README.rdoc +157 -0
  5. data/Rakefile +49 -0
  6. data/docs/data_conversion.txt +18 -0
  7. data/ext/v8/Makefile +169 -0
  8. data/ext/v8/callbacks.cpp +160 -0
  9. data/ext/v8/callbacks.h +14 -0
  10. data/ext/v8/convert_ruby.cpp +8 -0
  11. data/ext/v8/convert_ruby.h +99 -0
  12. data/ext/v8/convert_string.cpp +10 -0
  13. data/ext/v8/convert_string.h +73 -0
  14. data/ext/v8/convert_v8.cpp +9 -0
  15. data/ext/v8/convert_v8.h +121 -0
  16. data/ext/v8/converters.cpp +83 -0
  17. data/ext/v8/converters.h +23 -0
  18. data/ext/v8/extconf.rb +44 -0
  19. data/ext/v8/upstream/2.0.6/.sconsign.dblite +0 -0
  20. data/ext/v8/upstream/2.0.6/AUTHORS +23 -0
  21. data/ext/v8/upstream/2.0.6/ChangeLog +1479 -0
  22. data/ext/v8/upstream/2.0.6/LICENSE +55 -0
  23. data/ext/v8/upstream/2.0.6/SConstruct +1028 -0
  24. data/ext/v8/upstream/2.0.6/benchmarks/README.txt +63 -0
  25. data/ext/v8/upstream/2.0.6/benchmarks/base.js +264 -0
  26. data/ext/v8/upstream/2.0.6/benchmarks/crypto.js +1698 -0
  27. data/ext/v8/upstream/2.0.6/benchmarks/deltablue.js +880 -0
  28. data/ext/v8/upstream/2.0.6/benchmarks/earley-boyer.js +4684 -0
  29. data/ext/v8/upstream/2.0.6/benchmarks/raytrace.js +935 -0
  30. data/ext/v8/upstream/2.0.6/benchmarks/regexp.js +1614 -0
  31. data/ext/v8/upstream/2.0.6/benchmarks/revisions.html +86 -0
  32. data/ext/v8/upstream/2.0.6/benchmarks/richards.js +539 -0
  33. data/ext/v8/upstream/2.0.6/benchmarks/run.html +141 -0
  34. data/ext/v8/upstream/2.0.6/benchmarks/run.js +61 -0
  35. data/ext/v8/upstream/2.0.6/benchmarks/splay.js +378 -0
  36. data/ext/v8/upstream/2.0.6/benchmarks/style.css +77 -0
  37. data/ext/v8/upstream/2.0.6/benchmarks/v8-logo.png +0 -0
  38. data/ext/v8/upstream/2.0.6/include/v8-debug.h +275 -0
  39. data/ext/v8/upstream/2.0.6/include/v8.h +3236 -0
  40. data/ext/v8/upstream/2.0.6/samples/SConscript +38 -0
  41. data/ext/v8/upstream/2.0.6/samples/count-hosts.js +42 -0
  42. data/ext/v8/upstream/2.0.6/samples/process.cc +622 -0
  43. data/ext/v8/upstream/2.0.6/samples/shell.cc +303 -0
  44. data/ext/v8/upstream/2.0.6/src/SConscript +283 -0
  45. data/ext/v8/upstream/2.0.6/src/accessors.cc +695 -0
  46. data/ext/v8/upstream/2.0.6/src/accessors.h +114 -0
  47. data/ext/v8/upstream/2.0.6/src/allocation.cc +198 -0
  48. data/ext/v8/upstream/2.0.6/src/allocation.h +169 -0
  49. data/ext/v8/upstream/2.0.6/src/api.cc +3831 -0
  50. data/ext/v8/upstream/2.0.6/src/api.h +479 -0
  51. data/ext/v8/upstream/2.0.6/src/apinatives.js +110 -0
  52. data/ext/v8/upstream/2.0.6/src/apiutils.h +69 -0
  53. data/ext/v8/upstream/2.0.6/src/arguments.h +97 -0
  54. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm-inl.h +277 -0
  55. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.cc +1821 -0
  56. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.h +1027 -0
  57. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2-inl.h +267 -0
  58. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.cc +1821 -0
  59. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.h +1027 -0
  60. data/ext/v8/upstream/2.0.6/src/arm/builtins-arm.cc +1271 -0
  61. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm-inl.h +74 -0
  62. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.cc +6682 -0
  63. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.h +535 -0
  64. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.cc +112 -0
  65. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.h +347 -0
  66. data/ext/v8/upstream/2.0.6/src/arm/cpu-arm.cc +132 -0
  67. data/ext/v8/upstream/2.0.6/src/arm/debug-arm.cc +213 -0
  68. data/ext/v8/upstream/2.0.6/src/arm/disasm-arm.cc +1166 -0
  69. data/ext/v8/upstream/2.0.6/src/arm/fast-codegen-arm.cc +1698 -0
  70. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.cc +123 -0
  71. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.h +162 -0
  72. data/ext/v8/upstream/2.0.6/src/arm/ic-arm.cc +849 -0
  73. data/ext/v8/upstream/2.0.6/src/arm/jump-target-arm.cc +238 -0
  74. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.cc +1259 -0
  75. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.h +423 -0
  76. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.cc +1266 -0
  77. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.h +282 -0
  78. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm-inl.h +103 -0
  79. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.cc +59 -0
  80. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.h +43 -0
  81. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.cc +2264 -0
  82. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.h +306 -0
  83. data/ext/v8/upstream/2.0.6/src/arm/stub-cache-arm.cc +1516 -0
  84. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.cc +412 -0
  85. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.h +532 -0
  86. data/ext/v8/upstream/2.0.6/src/array.js +1154 -0
  87. data/ext/v8/upstream/2.0.6/src/assembler.cc +772 -0
  88. data/ext/v8/upstream/2.0.6/src/assembler.h +525 -0
  89. data/ext/v8/upstream/2.0.6/src/ast.cc +512 -0
  90. data/ext/v8/upstream/2.0.6/src/ast.h +1820 -0
  91. data/ext/v8/upstream/2.0.6/src/bootstrapper.cc +1680 -0
  92. data/ext/v8/upstream/2.0.6/src/bootstrapper.h +103 -0
  93. data/ext/v8/upstream/2.0.6/src/builtins.cc +851 -0
  94. data/ext/v8/upstream/2.0.6/src/builtins.h +245 -0
  95. data/ext/v8/upstream/2.0.6/src/bytecodes-irregexp.h +104 -0
  96. data/ext/v8/upstream/2.0.6/src/char-predicates-inl.h +86 -0
  97. data/ext/v8/upstream/2.0.6/src/char-predicates.h +65 -0
  98. data/ext/v8/upstream/2.0.6/src/checks.cc +100 -0
  99. data/ext/v8/upstream/2.0.6/src/checks.h +284 -0
  100. data/ext/v8/upstream/2.0.6/src/code-stubs.cc +164 -0
  101. data/ext/v8/upstream/2.0.6/src/code-stubs.h +164 -0
  102. data/ext/v8/upstream/2.0.6/src/code.h +68 -0
  103. data/ext/v8/upstream/2.0.6/src/codegen-inl.h +88 -0
  104. data/ext/v8/upstream/2.0.6/src/codegen.cc +504 -0
  105. data/ext/v8/upstream/2.0.6/src/codegen.h +522 -0
  106. data/ext/v8/upstream/2.0.6/src/compilation-cache.cc +490 -0
  107. data/ext/v8/upstream/2.0.6/src/compilation-cache.h +98 -0
  108. data/ext/v8/upstream/2.0.6/src/compiler.cc +1132 -0
  109. data/ext/v8/upstream/2.0.6/src/compiler.h +107 -0
  110. data/ext/v8/upstream/2.0.6/src/contexts.cc +256 -0
  111. data/ext/v8/upstream/2.0.6/src/contexts.h +345 -0
  112. data/ext/v8/upstream/2.0.6/src/conversions-inl.h +95 -0
  113. data/ext/v8/upstream/2.0.6/src/conversions.cc +709 -0
  114. data/ext/v8/upstream/2.0.6/src/conversions.h +118 -0
  115. data/ext/v8/upstream/2.0.6/src/counters.cc +78 -0
  116. data/ext/v8/upstream/2.0.6/src/counters.h +239 -0
  117. data/ext/v8/upstream/2.0.6/src/cpu.h +65 -0
  118. data/ext/v8/upstream/2.0.6/src/d8-debug.cc +345 -0
  119. data/ext/v8/upstream/2.0.6/src/d8-debug.h +155 -0
  120. data/ext/v8/upstream/2.0.6/src/d8-posix.cc +675 -0
  121. data/ext/v8/upstream/2.0.6/src/d8-readline.cc +128 -0
  122. data/ext/v8/upstream/2.0.6/src/d8-windows.cc +42 -0
  123. data/ext/v8/upstream/2.0.6/src/d8.cc +776 -0
  124. data/ext/v8/upstream/2.0.6/src/d8.h +225 -0
  125. data/ext/v8/upstream/2.0.6/src/d8.js +1625 -0
  126. data/ext/v8/upstream/2.0.6/src/date-delay.js +1138 -0
  127. data/ext/v8/upstream/2.0.6/src/dateparser-inl.h +114 -0
  128. data/ext/v8/upstream/2.0.6/src/dateparser.cc +186 -0
  129. data/ext/v8/upstream/2.0.6/src/dateparser.h +240 -0
  130. data/ext/v8/upstream/2.0.6/src/debug-agent.cc +425 -0
  131. data/ext/v8/upstream/2.0.6/src/debug-agent.h +129 -0
  132. data/ext/v8/upstream/2.0.6/src/debug-delay.js +2073 -0
  133. data/ext/v8/upstream/2.0.6/src/debug.cc +2751 -0
  134. data/ext/v8/upstream/2.0.6/src/debug.h +866 -0
  135. data/ext/v8/upstream/2.0.6/src/disasm.h +77 -0
  136. data/ext/v8/upstream/2.0.6/src/disassembler.cc +318 -0
  137. data/ext/v8/upstream/2.0.6/src/disassembler.h +56 -0
  138. data/ext/v8/upstream/2.0.6/src/dtoa-config.c +91 -0
  139. data/ext/v8/upstream/2.0.6/src/execution.cc +701 -0
  140. data/ext/v8/upstream/2.0.6/src/execution.h +312 -0
  141. data/ext/v8/upstream/2.0.6/src/factory.cc +957 -0
  142. data/ext/v8/upstream/2.0.6/src/factory.h +393 -0
  143. data/ext/v8/upstream/2.0.6/src/fast-codegen.cc +725 -0
  144. data/ext/v8/upstream/2.0.6/src/fast-codegen.h +371 -0
  145. data/ext/v8/upstream/2.0.6/src/flag-definitions.h +426 -0
  146. data/ext/v8/upstream/2.0.6/src/flags.cc +555 -0
  147. data/ext/v8/upstream/2.0.6/src/flags.h +81 -0
  148. data/ext/v8/upstream/2.0.6/src/frame-element.cc +45 -0
  149. data/ext/v8/upstream/2.0.6/src/frame-element.h +235 -0
  150. data/ext/v8/upstream/2.0.6/src/frames-inl.h +215 -0
  151. data/ext/v8/upstream/2.0.6/src/frames.cc +749 -0
  152. data/ext/v8/upstream/2.0.6/src/frames.h +659 -0
  153. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.cc +76 -0
  154. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.h +135 -0
  155. data/ext/v8/upstream/2.0.6/src/global-handles.cc +516 -0
  156. data/ext/v8/upstream/2.0.6/src/global-handles.h +180 -0
  157. data/ext/v8/upstream/2.0.6/src/globals.h +608 -0
  158. data/ext/v8/upstream/2.0.6/src/handles-inl.h +76 -0
  159. data/ext/v8/upstream/2.0.6/src/handles.cc +811 -0
  160. data/ext/v8/upstream/2.0.6/src/handles.h +367 -0
  161. data/ext/v8/upstream/2.0.6/src/hashmap.cc +226 -0
  162. data/ext/v8/upstream/2.0.6/src/hashmap.h +120 -0
  163. data/ext/v8/upstream/2.0.6/src/heap-inl.h +407 -0
  164. data/ext/v8/upstream/2.0.6/src/heap-profiler.cc +695 -0
  165. data/ext/v8/upstream/2.0.6/src/heap-profiler.h +277 -0
  166. data/ext/v8/upstream/2.0.6/src/heap.cc +4204 -0
  167. data/ext/v8/upstream/2.0.6/src/heap.h +1704 -0
  168. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32-inl.h +325 -0
  169. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.cc +2375 -0
  170. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.h +914 -0
  171. data/ext/v8/upstream/2.0.6/src/ia32/builtins-ia32.cc +1222 -0
  172. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32-inl.h +46 -0
  173. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.cc +9770 -0
  174. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.h +834 -0
  175. data/ext/v8/upstream/2.0.6/src/ia32/cpu-ia32.cc +79 -0
  176. data/ext/v8/upstream/2.0.6/src/ia32/debug-ia32.cc +208 -0
  177. data/ext/v8/upstream/2.0.6/src/ia32/disasm-ia32.cc +1357 -0
  178. data/ext/v8/upstream/2.0.6/src/ia32/fast-codegen-ia32.cc +1813 -0
  179. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.cc +111 -0
  180. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.h +135 -0
  181. data/ext/v8/upstream/2.0.6/src/ia32/ic-ia32.cc +1490 -0
  182. data/ext/v8/upstream/2.0.6/src/ia32/jump-target-ia32.cc +432 -0
  183. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.cc +1517 -0
  184. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.h +528 -0
  185. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.cc +1219 -0
  186. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.h +230 -0
  187. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32-inl.h +82 -0
  188. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.cc +99 -0
  189. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.h +43 -0
  190. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.cc +30 -0
  191. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.h +62 -0
  192. data/ext/v8/upstream/2.0.6/src/ia32/stub-cache-ia32.cc +1961 -0
  193. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.cc +1105 -0
  194. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.h +580 -0
  195. data/ext/v8/upstream/2.0.6/src/ic-inl.h +93 -0
  196. data/ext/v8/upstream/2.0.6/src/ic.cc +1426 -0
  197. data/ext/v8/upstream/2.0.6/src/ic.h +443 -0
  198. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.cc +646 -0
  199. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.h +48 -0
  200. data/ext/v8/upstream/2.0.6/src/json-delay.js +254 -0
  201. data/ext/v8/upstream/2.0.6/src/jsregexp.cc +5234 -0
  202. data/ext/v8/upstream/2.0.6/src/jsregexp.h +1439 -0
  203. data/ext/v8/upstream/2.0.6/src/jump-target-inl.h +49 -0
  204. data/ext/v8/upstream/2.0.6/src/jump-target.cc +383 -0
  205. data/ext/v8/upstream/2.0.6/src/jump-target.h +280 -0
  206. data/ext/v8/upstream/2.0.6/src/list-inl.h +166 -0
  207. data/ext/v8/upstream/2.0.6/src/list.h +158 -0
  208. data/ext/v8/upstream/2.0.6/src/log-inl.h +126 -0
  209. data/ext/v8/upstream/2.0.6/src/log-utils.cc +503 -0
  210. data/ext/v8/upstream/2.0.6/src/log-utils.h +292 -0
  211. data/ext/v8/upstream/2.0.6/src/log.cc +1457 -0
  212. data/ext/v8/upstream/2.0.6/src/log.h +371 -0
  213. data/ext/v8/upstream/2.0.6/src/macro-assembler.h +93 -0
  214. data/ext/v8/upstream/2.0.6/src/macros.py +137 -0
  215. data/ext/v8/upstream/2.0.6/src/mark-compact.cc +2007 -0
  216. data/ext/v8/upstream/2.0.6/src/mark-compact.h +442 -0
  217. data/ext/v8/upstream/2.0.6/src/math.js +263 -0
  218. data/ext/v8/upstream/2.0.6/src/memory.h +74 -0
  219. data/ext/v8/upstream/2.0.6/src/messages.cc +177 -0
  220. data/ext/v8/upstream/2.0.6/src/messages.h +112 -0
  221. data/ext/v8/upstream/2.0.6/src/messages.js +937 -0
  222. data/ext/v8/upstream/2.0.6/src/mirror-delay.js +2332 -0
  223. data/ext/v8/upstream/2.0.6/src/mksnapshot.cc +169 -0
  224. data/ext/v8/upstream/2.0.6/src/natives.h +63 -0
  225. data/ext/v8/upstream/2.0.6/src/objects-debug.cc +1317 -0
  226. data/ext/v8/upstream/2.0.6/src/objects-inl.h +3044 -0
  227. data/ext/v8/upstream/2.0.6/src/objects.cc +8306 -0
  228. data/ext/v8/upstream/2.0.6/src/objects.h +4960 -0
  229. data/ext/v8/upstream/2.0.6/src/oprofile-agent.cc +116 -0
  230. data/ext/v8/upstream/2.0.6/src/oprofile-agent.h +69 -0
  231. data/ext/v8/upstream/2.0.6/src/parser.cc +4810 -0
  232. data/ext/v8/upstream/2.0.6/src/parser.h +195 -0
  233. data/ext/v8/upstream/2.0.6/src/platform-freebsd.cc +645 -0
  234. data/ext/v8/upstream/2.0.6/src/platform-linux.cc +808 -0
  235. data/ext/v8/upstream/2.0.6/src/platform-macos.cc +643 -0
  236. data/ext/v8/upstream/2.0.6/src/platform-nullos.cc +454 -0
  237. data/ext/v8/upstream/2.0.6/src/platform-openbsd.cc +597 -0
  238. data/ext/v8/upstream/2.0.6/src/platform-posix.cc +380 -0
  239. data/ext/v8/upstream/2.0.6/src/platform-win32.cc +1908 -0
  240. data/ext/v8/upstream/2.0.6/src/platform.h +556 -0
  241. data/ext/v8/upstream/2.0.6/src/prettyprinter.cc +1511 -0
  242. data/ext/v8/upstream/2.0.6/src/prettyprinter.h +219 -0
  243. data/ext/v8/upstream/2.0.6/src/property.cc +96 -0
  244. data/ext/v8/upstream/2.0.6/src/property.h +327 -0
  245. data/ext/v8/upstream/2.0.6/src/regexp-delay.js +406 -0
  246. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp-inl.h +78 -0
  247. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.cc +464 -0
  248. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.h +141 -0
  249. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.cc +356 -0
  250. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.h +103 -0
  251. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.cc +240 -0
  252. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.h +220 -0
  253. data/ext/v8/upstream/2.0.6/src/regexp-stack.cc +103 -0
  254. data/ext/v8/upstream/2.0.6/src/regexp-stack.h +123 -0
  255. data/ext/v8/upstream/2.0.6/src/register-allocator-inl.h +74 -0
  256. data/ext/v8/upstream/2.0.6/src/register-allocator.cc +100 -0
  257. data/ext/v8/upstream/2.0.6/src/register-allocator.h +295 -0
  258. data/ext/v8/upstream/2.0.6/src/rewriter.cc +855 -0
  259. data/ext/v8/upstream/2.0.6/src/rewriter.h +54 -0
  260. data/ext/v8/upstream/2.0.6/src/runtime.cc +8163 -0
  261. data/ext/v8/upstream/2.0.6/src/runtime.h +432 -0
  262. data/ext/v8/upstream/2.0.6/src/runtime.js +626 -0
  263. data/ext/v8/upstream/2.0.6/src/scanner.cc +1098 -0
  264. data/ext/v8/upstream/2.0.6/src/scanner.h +425 -0
  265. data/ext/v8/upstream/2.0.6/src/scopeinfo.cc +649 -0
  266. data/ext/v8/upstream/2.0.6/src/scopeinfo.h +236 -0
  267. data/ext/v8/upstream/2.0.6/src/scopes.cc +963 -0
  268. data/ext/v8/upstream/2.0.6/src/scopes.h +401 -0
  269. data/ext/v8/upstream/2.0.6/src/serialize.cc +1260 -0
  270. data/ext/v8/upstream/2.0.6/src/serialize.h +404 -0
  271. data/ext/v8/upstream/2.0.6/src/shell.h +55 -0
  272. data/ext/v8/upstream/2.0.6/src/simulator.h +41 -0
  273. data/ext/v8/upstream/2.0.6/src/smart-pointer.h +109 -0
  274. data/ext/v8/upstream/2.0.6/src/snapshot-common.cc +97 -0
  275. data/ext/v8/upstream/2.0.6/src/snapshot-empty.cc +40 -0
  276. data/ext/v8/upstream/2.0.6/src/snapshot.h +59 -0
  277. data/ext/v8/upstream/2.0.6/src/spaces-inl.h +372 -0
  278. data/ext/v8/upstream/2.0.6/src/spaces.cc +2864 -0
  279. data/ext/v8/upstream/2.0.6/src/spaces.h +2072 -0
  280. data/ext/v8/upstream/2.0.6/src/string-stream.cc +584 -0
  281. data/ext/v8/upstream/2.0.6/src/string-stream.h +189 -0
  282. data/ext/v8/upstream/2.0.6/src/string.js +901 -0
  283. data/ext/v8/upstream/2.0.6/src/stub-cache.cc +1108 -0
  284. data/ext/v8/upstream/2.0.6/src/stub-cache.h +578 -0
  285. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/COPYING +15 -0
  286. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/dtoa.c +3330 -0
  287. data/ext/v8/upstream/2.0.6/src/third_party/valgrind/valgrind.h +3925 -0
  288. data/ext/v8/upstream/2.0.6/src/token.cc +56 -0
  289. data/ext/v8/upstream/2.0.6/src/token.h +270 -0
  290. data/ext/v8/upstream/2.0.6/src/top.cc +991 -0
  291. data/ext/v8/upstream/2.0.6/src/top.h +459 -0
  292. data/ext/v8/upstream/2.0.6/src/unicode-inl.h +238 -0
  293. data/ext/v8/upstream/2.0.6/src/unicode.cc +749 -0
  294. data/ext/v8/upstream/2.0.6/src/unicode.h +279 -0
  295. data/ext/v8/upstream/2.0.6/src/uri.js +415 -0
  296. data/ext/v8/upstream/2.0.6/src/usage-analyzer.cc +426 -0
  297. data/ext/v8/upstream/2.0.6/src/usage-analyzer.h +40 -0
  298. data/ext/v8/upstream/2.0.6/src/utils.cc +322 -0
  299. data/ext/v8/upstream/2.0.6/src/utils.h +592 -0
  300. data/ext/v8/upstream/2.0.6/src/v8-counters.cc +55 -0
  301. data/ext/v8/upstream/2.0.6/src/v8-counters.h +198 -0
  302. data/ext/v8/upstream/2.0.6/src/v8.cc +193 -0
  303. data/ext/v8/upstream/2.0.6/src/v8.h +119 -0
  304. data/ext/v8/upstream/2.0.6/src/v8natives.js +846 -0
  305. data/ext/v8/upstream/2.0.6/src/v8threads.cc +450 -0
  306. data/ext/v8/upstream/2.0.6/src/v8threads.h +144 -0
  307. data/ext/v8/upstream/2.0.6/src/variables.cc +163 -0
  308. data/ext/v8/upstream/2.0.6/src/variables.h +235 -0
  309. data/ext/v8/upstream/2.0.6/src/version.cc +88 -0
  310. data/ext/v8/upstream/2.0.6/src/version.h +64 -0
  311. data/ext/v8/upstream/2.0.6/src/virtual-frame.cc +381 -0
  312. data/ext/v8/upstream/2.0.6/src/virtual-frame.h +44 -0
  313. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64-inl.h +352 -0
  314. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.cc +2539 -0
  315. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.h +1399 -0
  316. data/ext/v8/upstream/2.0.6/src/x64/builtins-x64.cc +1255 -0
  317. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64-inl.h +46 -0
  318. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.cc +8223 -0
  319. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.h +785 -0
  320. data/ext/v8/upstream/2.0.6/src/x64/cpu-x64.cc +79 -0
  321. data/ext/v8/upstream/2.0.6/src/x64/debug-x64.cc +202 -0
  322. data/ext/v8/upstream/2.0.6/src/x64/disasm-x64.cc +1596 -0
  323. data/ext/v8/upstream/2.0.6/src/x64/fast-codegen-x64.cc +1820 -0
  324. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.cc +109 -0
  325. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.h +121 -0
  326. data/ext/v8/upstream/2.0.6/src/x64/ic-x64.cc +1392 -0
  327. data/ext/v8/upstream/2.0.6/src/x64/jump-target-x64.cc +432 -0
  328. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.cc +2409 -0
  329. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.h +765 -0
  330. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.cc +1337 -0
  331. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.h +295 -0
  332. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64-inl.h +86 -0
  333. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.cc +84 -0
  334. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.h +43 -0
  335. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.cc +27 -0
  336. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.h +63 -0
  337. data/ext/v8/upstream/2.0.6/src/x64/stub-cache-x64.cc +1884 -0
  338. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.cc +1089 -0
  339. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.h +560 -0
  340. data/ext/v8/upstream/2.0.6/src/zone-inl.h +297 -0
  341. data/ext/v8/upstream/2.0.6/src/zone.cc +193 -0
  342. data/ext/v8/upstream/2.0.6/src/zone.h +305 -0
  343. data/ext/v8/upstream/2.0.6/test/cctest/SConscript +95 -0
  344. data/ext/v8/upstream/2.0.6/test/cctest/cctest.cc +126 -0
  345. data/ext/v8/upstream/2.0.6/test/cctest/cctest.h +211 -0
  346. data/ext/v8/upstream/2.0.6/test/cctest/cctest.status +54 -0
  347. data/ext/v8/upstream/2.0.6/test/cctest/test-accessors.cc +450 -0
  348. data/ext/v8/upstream/2.0.6/test/cctest/test-alloc.cc +215 -0
  349. data/ext/v8/upstream/2.0.6/test/cctest/test-api.cc +8699 -0
  350. data/ext/v8/upstream/2.0.6/test/cctest/test-assembler-arm.cc +227 -0
  351. data/ext/v8/upstream/2.0.6/test/cctest/test-assembler-ia32.cc +395 -0
  352. data/ext/v8/upstream/2.0.6/test/cctest/test-assembler-x64.cc +292 -0
  353. data/ext/v8/upstream/2.0.6/test/cctest/test-ast.cc +97 -0
  354. data/ext/v8/upstream/2.0.6/test/cctest/test-compiler.cc +318 -0
  355. data/ext/v8/upstream/2.0.6/test/cctest/test-conversions.cc +130 -0
  356. data/ext/v8/upstream/2.0.6/test/cctest/test-debug.cc +5788 -0
  357. data/ext/v8/upstream/2.0.6/test/cctest/test-decls.cc +593 -0
  358. data/ext/v8/upstream/2.0.6/test/cctest/test-disasm-arm.cc +281 -0
  359. data/ext/v8/upstream/2.0.6/test/cctest/test-disasm-ia32.cc +418 -0
  360. data/ext/v8/upstream/2.0.6/test/cctest/test-flags.cc +234 -0
  361. data/ext/v8/upstream/2.0.6/test/cctest/test-func-name-inference.cc +267 -0
  362. data/ext/v8/upstream/2.0.6/test/cctest/test-hashmap.cc +176 -0
  363. data/ext/v8/upstream/2.0.6/test/cctest/test-heap-profiler.cc +396 -0
  364. data/ext/v8/upstream/2.0.6/test/cctest/test-heap.cc +796 -0
  365. data/ext/v8/upstream/2.0.6/test/cctest/test-list.cc +101 -0
  366. data/ext/v8/upstream/2.0.6/test/cctest/test-lock.cc +63 -0
  367. data/ext/v8/upstream/2.0.6/test/cctest/test-log-stack-tracer.cc +372 -0
  368. data/ext/v8/upstream/2.0.6/test/cctest/test-log-utils.cc +310 -0
  369. data/ext/v8/upstream/2.0.6/test/cctest/test-log.cc +1081 -0
  370. data/ext/v8/upstream/2.0.6/test/cctest/test-macro-assembler-x64.cc +2104 -0
  371. data/ext/v8/upstream/2.0.6/test/cctest/test-mark-compact.cc +341 -0
  372. data/ext/v8/upstream/2.0.6/test/cctest/test-parsing.cc +129 -0
  373. data/ext/v8/upstream/2.0.6/test/cctest/test-platform-linux.cc +80 -0
  374. data/ext/v8/upstream/2.0.6/test/cctest/test-platform-macos.cc +10 -0
  375. data/ext/v8/upstream/2.0.6/test/cctest/test-platform-nullos.cc +80 -0
  376. data/ext/v8/upstream/2.0.6/test/cctest/test-platform-win32.cc +26 -0
  377. data/ext/v8/upstream/2.0.6/test/cctest/test-regexp.cc +1815 -0
  378. data/ext/v8/upstream/2.0.6/test/cctest/test-serialize.cc +438 -0
  379. data/ext/v8/upstream/2.0.6/test/cctest/test-sockets.cc +162 -0
  380. data/ext/v8/upstream/2.0.6/test/cctest/test-spaces.cc +248 -0
  381. data/ext/v8/upstream/2.0.6/test/cctest/test-strings.cc +432 -0
  382. data/ext/v8/upstream/2.0.6/test/cctest/test-thread-termination.cc +290 -0
  383. data/ext/v8/upstream/2.0.6/test/cctest/test-threads.cc +52 -0
  384. data/ext/v8/upstream/2.0.6/test/cctest/test-utils.cc +186 -0
  385. data/ext/v8/upstream/2.0.6/test/cctest/test-version.cc +89 -0
  386. data/ext/v8/upstream/2.0.6/test/cctest/testcfg.py +108 -0
  387. data/ext/v8/upstream/2.0.6/test/es5conform/README +14 -0
  388. data/ext/v8/upstream/2.0.6/test/es5conform/es5conform.status +226 -0
  389. data/ext/v8/upstream/2.0.6/test/es5conform/harness-adapt.js +74 -0
  390. data/ext/v8/upstream/2.0.6/test/es5conform/testcfg.py +108 -0
  391. data/ext/v8/upstream/2.0.6/test/message/message.status +31 -0
  392. data/ext/v8/upstream/2.0.6/test/message/overwritten-builtins.js +31 -0
  393. data/ext/v8/upstream/2.0.6/test/message/overwritten-builtins.out +30 -0
  394. data/ext/v8/upstream/2.0.6/test/message/regress/regress-73.js +33 -0
  395. data/ext/v8/upstream/2.0.6/test/message/regress/regress-73.out +30 -0
  396. data/ext/v8/upstream/2.0.6/test/message/regress/regress-75.js +32 -0
  397. data/ext/v8/upstream/2.0.6/test/message/regress/regress-75.out +30 -0
  398. data/ext/v8/upstream/2.0.6/test/message/simple-throw.js +28 -0
  399. data/ext/v8/upstream/2.0.6/test/message/simple-throw.out +30 -0
  400. data/ext/v8/upstream/2.0.6/test/message/testcfg.py +135 -0
  401. data/ext/v8/upstream/2.0.6/test/message/try-catch-finally-no-message.js +51 -0
  402. data/ext/v8/upstream/2.0.6/test/message/try-catch-finally-no-message.out +26 -0
  403. data/ext/v8/upstream/2.0.6/test/message/try-catch-finally-return-in-finally.js +39 -0
  404. data/ext/v8/upstream/2.0.6/test/message/try-catch-finally-return-in-finally.out +28 -0
  405. data/ext/v8/upstream/2.0.6/test/message/try-catch-finally-throw-in-catch-and-finally.js +34 -0
  406. data/ext/v8/upstream/2.0.6/test/message/try-catch-finally-throw-in-catch-and-finally.out +30 -0
  407. data/ext/v8/upstream/2.0.6/test/message/try-catch-finally-throw-in-catch.js +34 -0
  408. data/ext/v8/upstream/2.0.6/test/message/try-catch-finally-throw-in-catch.out +30 -0
  409. data/ext/v8/upstream/2.0.6/test/message/try-catch-finally-throw-in-finally.js +34 -0
  410. data/ext/v8/upstream/2.0.6/test/message/try-catch-finally-throw-in-finally.out +30 -0
  411. data/ext/v8/upstream/2.0.6/test/message/try-finally-return-in-finally.js +37 -0
  412. data/ext/v8/upstream/2.0.6/test/message/try-finally-return-in-finally.out +28 -0
  413. data/ext/v8/upstream/2.0.6/test/message/try-finally-throw-in-finally.js +32 -0
  414. data/ext/v8/upstream/2.0.6/test/message/try-finally-throw-in-finally.out +30 -0
  415. data/ext/v8/upstream/2.0.6/test/message/try-finally-throw-in-try-and-finally.js +32 -0
  416. data/ext/v8/upstream/2.0.6/test/message/try-finally-throw-in-try-and-finally.out +30 -0
  417. data/ext/v8/upstream/2.0.6/test/message/try-finally-throw-in-try.js +32 -0
  418. data/ext/v8/upstream/2.0.6/test/message/try-finally-throw-in-try.out +30 -0
  419. data/ext/v8/upstream/2.0.6/test/mjsunit/api-call-after-bypassed-exception.js +39 -0
  420. data/ext/v8/upstream/2.0.6/test/mjsunit/apply.js +196 -0
  421. data/ext/v8/upstream/2.0.6/test/mjsunit/arguments-apply.js +134 -0
  422. data/ext/v8/upstream/2.0.6/test/mjsunit/arguments-call-apply.js +41 -0
  423. data/ext/v8/upstream/2.0.6/test/mjsunit/arguments-enum.js +52 -0
  424. data/ext/v8/upstream/2.0.6/test/mjsunit/arguments-indirect.js +47 -0
  425. data/ext/v8/upstream/2.0.6/test/mjsunit/arguments-lazy.js +47 -0
  426. data/ext/v8/upstream/2.0.6/test/mjsunit/arguments-opt.js +130 -0
  427. data/ext/v8/upstream/2.0.6/test/mjsunit/arguments-read-and-assignment.js +164 -0
  428. data/ext/v8/upstream/2.0.6/test/mjsunit/arguments.js +97 -0
  429. data/ext/v8/upstream/2.0.6/test/mjsunit/array-concat.js +120 -0
  430. data/ext/v8/upstream/2.0.6/test/mjsunit/array-constructor.js +119 -0
  431. data/ext/v8/upstream/2.0.6/test/mjsunit/array-functions-prototype.js +159 -0
  432. data/ext/v8/upstream/2.0.6/test/mjsunit/array-indexing.js +66 -0
  433. data/ext/v8/upstream/2.0.6/test/mjsunit/array-iteration.js +228 -0
  434. data/ext/v8/upstream/2.0.6/test/mjsunit/array-join.js +45 -0
  435. data/ext/v8/upstream/2.0.6/test/mjsunit/array-length-number-conversion.js +53 -0
  436. data/ext/v8/upstream/2.0.6/test/mjsunit/array-length.js +111 -0
  437. data/ext/v8/upstream/2.0.6/test/mjsunit/array-reduce.js +514 -0
  438. data/ext/v8/upstream/2.0.6/test/mjsunit/array-sort.js +362 -0
  439. data/ext/v8/upstream/2.0.6/test/mjsunit/array-splice.js +314 -0
  440. data/ext/v8/upstream/2.0.6/test/mjsunit/ascii-regexp-subject.js +49 -0
  441. data/ext/v8/upstream/2.0.6/test/mjsunit/big-array-literal.js +111 -0
  442. data/ext/v8/upstream/2.0.6/test/mjsunit/big-object-literal.js +114 -0
  443. data/ext/v8/upstream/2.0.6/test/mjsunit/binary-operation-overwrite.js +36 -0
  444. data/ext/v8/upstream/2.0.6/test/mjsunit/bit-not.js +75 -0
  445. data/ext/v8/upstream/2.0.6/test/mjsunit/bitwise-operations-undefined.js +49 -0
  446. data/ext/v8/upstream/2.0.6/test/mjsunit/body-not-visible.js +39 -0
  447. data/ext/v8/upstream/2.0.6/test/mjsunit/bugs/bug-1344252.js +79 -0
  448. data/ext/v8/upstream/2.0.6/test/mjsunit/bugs/bug-222.js +42 -0
  449. data/ext/v8/upstream/2.0.6/test/mjsunit/bugs/bug-223.js +39 -0
  450. data/ext/v8/upstream/2.0.6/test/mjsunit/bugs/bug-900066.js +38 -0
  451. data/ext/v8/upstream/2.0.6/test/mjsunit/bugs/bug-941049.js +100 -0
  452. data/ext/v8/upstream/2.0.6/test/mjsunit/call-non-function-call.js +38 -0
  453. data/ext/v8/upstream/2.0.6/test/mjsunit/call-non-function.js +63 -0
  454. data/ext/v8/upstream/2.0.6/test/mjsunit/call.js +87 -0
  455. data/ext/v8/upstream/2.0.6/test/mjsunit/char-escape.js +53 -0
  456. data/ext/v8/upstream/2.0.6/test/mjsunit/class-of-builtins.js +50 -0
  457. data/ext/v8/upstream/2.0.6/test/mjsunit/closure.js +37 -0
  458. data/ext/v8/upstream/2.0.6/test/mjsunit/codegen-coverage.js +91 -0
  459. data/ext/v8/upstream/2.0.6/test/mjsunit/compare-character.js +50 -0
  460. data/ext/v8/upstream/2.0.6/test/mjsunit/compare-nan.js +66 -0
  461. data/ext/v8/upstream/2.0.6/test/mjsunit/compiler/countoperation.js +111 -0
  462. data/ext/v8/upstream/2.0.6/test/mjsunit/compiler/function-call.js +52 -0
  463. data/ext/v8/upstream/2.0.6/test/mjsunit/compiler/globals.js +65 -0
  464. data/ext/v8/upstream/2.0.6/test/mjsunit/compiler/jsnatives.js +33 -0
  465. data/ext/v8/upstream/2.0.6/test/mjsunit/compiler/literals-assignment.js +104 -0
  466. data/ext/v8/upstream/2.0.6/test/mjsunit/compiler/literals.js +52 -0
  467. data/ext/v8/upstream/2.0.6/test/mjsunit/compiler/loops.js +35 -0
  468. data/ext/v8/upstream/2.0.6/test/mjsunit/compiler/objectliterals.js +57 -0
  469. data/ext/v8/upstream/2.0.6/test/mjsunit/compiler/property-simple.js +39 -0
  470. data/ext/v8/upstream/2.0.6/test/mjsunit/compiler/short-circuit.js +102 -0
  471. data/ext/v8/upstream/2.0.6/test/mjsunit/compiler/thisfunction.js +35 -0
  472. data/ext/v8/upstream/2.0.6/test/mjsunit/const-declaration.js +172 -0
  473. data/ext/v8/upstream/2.0.6/test/mjsunit/const-eval-init.js +111 -0
  474. data/ext/v8/upstream/2.0.6/test/mjsunit/const-redecl.js +220 -0
  475. data/ext/v8/upstream/2.0.6/test/mjsunit/const.js +70 -0
  476. data/ext/v8/upstream/2.0.6/test/mjsunit/constant-folding.js +232 -0
  477. data/ext/v8/upstream/2.0.6/test/mjsunit/context-variable-assignments.js +37 -0
  478. data/ext/v8/upstream/2.0.6/test/mjsunit/cyclic-array-to-string.js +65 -0
  479. data/ext/v8/upstream/2.0.6/test/mjsunit/cyrillic.js +199 -0
  480. data/ext/v8/upstream/2.0.6/test/mjsunit/d8-os.js +180 -0
  481. data/ext/v8/upstream/2.0.6/test/mjsunit/date-parse.js +268 -0
  482. data/ext/v8/upstream/2.0.6/test/mjsunit/date.js +149 -0
  483. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-backtrace-text.js +122 -0
  484. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-backtrace.js +272 -0
  485. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-breakpoints.js +120 -0
  486. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-changebreakpoint.js +108 -0
  487. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-clearbreakpoint.js +101 -0
  488. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-clearbreakpointgroup.js +117 -0
  489. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-compile-event.js +126 -0
  490. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-conditional-breakpoints.js +171 -0
  491. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-constructed-by.js +60 -0
  492. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-constructor.js +78 -0
  493. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-continue.js +114 -0
  494. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-enable-disable-breakpoints.js +90 -0
  495. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-evaluate-arguments.js +93 -0
  496. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-evaluate-bool-constructor.js +80 -0
  497. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-evaluate-locals.js +132 -0
  498. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-evaluate-recursive.js +167 -0
  499. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-evaluate-with.js +77 -0
  500. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-evaluate.js +118 -0
  501. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-event-listener.js +73 -0
  502. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-handle.js +252 -0
  503. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-ignore-breakpoints.js +89 -0
  504. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-mirror-cache.js +85 -0
  505. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-multiple-breakpoints.js +105 -0
  506. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-referenced-by.js +112 -0
  507. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-references.js +118 -0
  508. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-scopes.js +761 -0
  509. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-script-breakpoints.js +112 -0
  510. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-script.js +92 -0
  511. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-scripts-request.js +108 -0
  512. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-setbreakpoint.js +165 -0
  513. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-sourceinfo.js +352 -0
  514. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-sourceslice.js +74 -0
  515. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-step-stub-callfunction.js +87 -0
  516. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-step.js +82 -0
  517. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-stepin-accessor.js +248 -0
  518. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-stepin-builtin.js +78 -0
  519. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-stepin-call-function-stub.js +115 -0
  520. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-stepin-constructor.js +78 -0
  521. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-stepin-function-call.js +149 -0
  522. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-stepnext-do-while.js +79 -0
  523. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-stepout-recursive-function.js +106 -0
  524. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-stepout-to-builtin.js +84 -0
  525. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-suspend.js +96 -0
  526. data/ext/v8/upstream/2.0.6/test/mjsunit/debug-version.js +90 -0
  527. data/ext/v8/upstream/2.0.6/test/mjsunit/declare-locally.js +43 -0
  528. data/ext/v8/upstream/2.0.6/test/mjsunit/deep-recursion.js +66 -0
  529. data/ext/v8/upstream/2.0.6/test/mjsunit/delay-syntax-error.js +41 -0
  530. data/ext/v8/upstream/2.0.6/test/mjsunit/delete-global-properties.js +37 -0
  531. data/ext/v8/upstream/2.0.6/test/mjsunit/delete-in-eval.js +32 -0
  532. data/ext/v8/upstream/2.0.6/test/mjsunit/delete-in-with.js +34 -0
  533. data/ext/v8/upstream/2.0.6/test/mjsunit/delete-vars-from-eval.js +40 -0
  534. data/ext/v8/upstream/2.0.6/test/mjsunit/delete.js +163 -0
  535. data/ext/v8/upstream/2.0.6/test/mjsunit/div-mod.js +157 -0
  536. data/ext/v8/upstream/2.0.6/test/mjsunit/do-not-strip-fc.js +31 -0
  537. data/ext/v8/upstream/2.0.6/test/mjsunit/dont-enum-array-holes.js +35 -0
  538. data/ext/v8/upstream/2.0.6/test/mjsunit/dont-reinit-global-var.js +47 -0
  539. data/ext/v8/upstream/2.0.6/test/mjsunit/double-equals.js +114 -0
  540. data/ext/v8/upstream/2.0.6/test/mjsunit/dtoa.js +32 -0
  541. data/ext/v8/upstream/2.0.6/test/mjsunit/enumeration-order.js +109 -0
  542. data/ext/v8/upstream/2.0.6/test/mjsunit/error-constructors.js +32 -0
  543. data/ext/v8/upstream/2.0.6/test/mjsunit/escape.js +118 -0
  544. data/ext/v8/upstream/2.0.6/test/mjsunit/eval-enclosing-function-name.js +76 -0
  545. data/ext/v8/upstream/2.0.6/test/mjsunit/eval-typeof-non-existing.js +35 -0
  546. data/ext/v8/upstream/2.0.6/test/mjsunit/eval.js +157 -0
  547. data/ext/v8/upstream/2.0.6/test/mjsunit/execScript-case-insensitive.js +34 -0
  548. data/ext/v8/upstream/2.0.6/test/mjsunit/extra-arguments.js +54 -0
  549. data/ext/v8/upstream/2.0.6/test/mjsunit/extra-commas.js +46 -0
  550. data/ext/v8/upstream/2.0.6/test/mjsunit/for-in-null-or-undefined.js +33 -0
  551. data/ext/v8/upstream/2.0.6/test/mjsunit/for-in-special-cases.js +64 -0
  552. data/ext/v8/upstream/2.0.6/test/mjsunit/for-in.js +86 -0
  553. data/ext/v8/upstream/2.0.6/test/mjsunit/fun-as-prototype.js +36 -0
  554. data/ext/v8/upstream/2.0.6/test/mjsunit/fun-name.js +34 -0
  555. data/ext/v8/upstream/2.0.6/test/mjsunit/function-arguments-null.js +30 -0
  556. data/ext/v8/upstream/2.0.6/test/mjsunit/function-caller.js +48 -0
  557. data/ext/v8/upstream/2.0.6/test/mjsunit/function-names.js +133 -0
  558. data/ext/v8/upstream/2.0.6/test/mjsunit/function-property.js +29 -0
  559. data/ext/v8/upstream/2.0.6/test/mjsunit/function-prototype.js +98 -0
  560. data/ext/v8/upstream/2.0.6/test/mjsunit/function-source.js +49 -0
  561. data/ext/v8/upstream/2.0.6/test/mjsunit/function.js +83 -0
  562. data/ext/v8/upstream/2.0.6/test/mjsunit/fuzz-accessors.js +85 -0
  563. data/ext/v8/upstream/2.0.6/test/mjsunit/fuzz-natives.js +159 -0
  564. data/ext/v8/upstream/2.0.6/test/mjsunit/get-own-property-descriptor.js +51 -0
  565. data/ext/v8/upstream/2.0.6/test/mjsunit/get-prototype-of.js +68 -0
  566. data/ext/v8/upstream/2.0.6/test/mjsunit/getter-in-prototype.js +50 -0
  567. data/ext/v8/upstream/2.0.6/test/mjsunit/getter-in-value-prototype.js +35 -0
  568. data/ext/v8/upstream/2.0.6/test/mjsunit/global-const-var-conflicts.js +57 -0
  569. data/ext/v8/upstream/2.0.6/test/mjsunit/global-deleted-property-ic.js +45 -0
  570. data/ext/v8/upstream/2.0.6/test/mjsunit/global-deleted-property-keyed.js +38 -0
  571. data/ext/v8/upstream/2.0.6/test/mjsunit/global-ic.js +48 -0
  572. data/ext/v8/upstream/2.0.6/test/mjsunit/global-load-from-eval-in-with.js +59 -0
  573. data/ext/v8/upstream/2.0.6/test/mjsunit/global-load-from-eval.js +85 -0
  574. data/ext/v8/upstream/2.0.6/test/mjsunit/global-load-from-nested-eval.js +66 -0
  575. data/ext/v8/upstream/2.0.6/test/mjsunit/global-vars-eval.js +34 -0
  576. data/ext/v8/upstream/2.0.6/test/mjsunit/global-vars-with.js +43 -0
  577. data/ext/v8/upstream/2.0.6/test/mjsunit/greedy.js +60 -0
  578. data/ext/v8/upstream/2.0.6/test/mjsunit/has-own-property.js +38 -0
  579. data/ext/v8/upstream/2.0.6/test/mjsunit/html-comments.js +57 -0
  580. data/ext/v8/upstream/2.0.6/test/mjsunit/html-string-funcs.js +47 -0
  581. data/ext/v8/upstream/2.0.6/test/mjsunit/if-in-undefined.js +36 -0
  582. data/ext/v8/upstream/2.0.6/test/mjsunit/in.js +159 -0
  583. data/ext/v8/upstream/2.0.6/test/mjsunit/indexed-accessors.js +120 -0
  584. data/ext/v8/upstream/2.0.6/test/mjsunit/instanceof.js +93 -0
  585. data/ext/v8/upstream/2.0.6/test/mjsunit/integer-to-string.js +35 -0
  586. data/ext/v8/upstream/2.0.6/test/mjsunit/invalid-lhs.js +65 -0
  587. data/ext/v8/upstream/2.0.6/test/mjsunit/invalid-source-element.js +31 -0
  588. data/ext/v8/upstream/2.0.6/test/mjsunit/json.js +207 -0
  589. data/ext/v8/upstream/2.0.6/test/mjsunit/keyed-ic.js +236 -0
  590. data/ext/v8/upstream/2.0.6/test/mjsunit/keyed-storage-extend.js +55 -0
  591. data/ext/v8/upstream/2.0.6/test/mjsunit/large-object-allocation.js +300 -0
  592. data/ext/v8/upstream/2.0.6/test/mjsunit/large-object-literal.js +56 -0
  593. data/ext/v8/upstream/2.0.6/test/mjsunit/lazy-load.js +34 -0
  594. data/ext/v8/upstream/2.0.6/test/mjsunit/leakcheck.js +53 -0
  595. data/ext/v8/upstream/2.0.6/test/mjsunit/length.js +78 -0
  596. data/ext/v8/upstream/2.0.6/test/mjsunit/local-load-from-eval.js +39 -0
  597. data/ext/v8/upstream/2.0.6/test/mjsunit/math-min-max.js +105 -0
  598. data/ext/v8/upstream/2.0.6/test/mjsunit/megamorphic-callbacks.js +70 -0
  599. data/ext/v8/upstream/2.0.6/test/mjsunit/mirror-array.js +138 -0
  600. data/ext/v8/upstream/2.0.6/test/mjsunit/mirror-boolean.js +59 -0
  601. data/ext/v8/upstream/2.0.6/test/mjsunit/mirror-date.js +77 -0
  602. data/ext/v8/upstream/2.0.6/test/mjsunit/mirror-error.js +94 -0
  603. data/ext/v8/upstream/2.0.6/test/mjsunit/mirror-function.js +90 -0
  604. data/ext/v8/upstream/2.0.6/test/mjsunit/mirror-null.js +50 -0
  605. data/ext/v8/upstream/2.0.6/test/mjsunit/mirror-number.js +77 -0
  606. data/ext/v8/upstream/2.0.6/test/mjsunit/mirror-object.js +227 -0
  607. data/ext/v8/upstream/2.0.6/test/mjsunit/mirror-regexp.js +110 -0
  608. data/ext/v8/upstream/2.0.6/test/mjsunit/mirror-script.js +100 -0
  609. data/ext/v8/upstream/2.0.6/test/mjsunit/mirror-string.js +89 -0
  610. data/ext/v8/upstream/2.0.6/test/mjsunit/mirror-undefined.js +50 -0
  611. data/ext/v8/upstream/2.0.6/test/mjsunit/mirror-unresolved-function.js +81 -0
  612. data/ext/v8/upstream/2.0.6/test/mjsunit/mjsunit.js +203 -0
  613. data/ext/v8/upstream/2.0.6/test/mjsunit/mjsunit.status +66 -0
  614. data/ext/v8/upstream/2.0.6/test/mjsunit/mul-exhaustive.js +4511 -0
  615. data/ext/v8/upstream/2.0.6/test/mjsunit/multiple-return.js +62 -0
  616. data/ext/v8/upstream/2.0.6/test/mjsunit/negate-zero.js +42 -0
  617. data/ext/v8/upstream/2.0.6/test/mjsunit/negate.js +59 -0
  618. data/ext/v8/upstream/2.0.6/test/mjsunit/new.js +56 -0
  619. data/ext/v8/upstream/2.0.6/test/mjsunit/newline-in-string.js +46 -0
  620. data/ext/v8/upstream/2.0.6/test/mjsunit/no-branch-elimination.js +36 -0
  621. data/ext/v8/upstream/2.0.6/test/mjsunit/no-octal-constants-above-256.js +32 -0
  622. data/ext/v8/upstream/2.0.6/test/mjsunit/no-semicolon.js +45 -0
  623. data/ext/v8/upstream/2.0.6/test/mjsunit/non-ascii-replace.js +30 -0
  624. data/ext/v8/upstream/2.0.6/test/mjsunit/nul-characters.js +38 -0
  625. data/ext/v8/upstream/2.0.6/test/mjsunit/number-limits.js +47 -0
  626. data/ext/v8/upstream/2.0.6/test/mjsunit/number-string-index-call.js +32 -0
  627. data/ext/v8/upstream/2.0.6/test/mjsunit/number-tostring-small.js +395 -0
  628. data/ext/v8/upstream/2.0.6/test/mjsunit/number-tostring.js +338 -0
  629. data/ext/v8/upstream/2.0.6/test/mjsunit/obj-construct.js +46 -0
  630. data/ext/v8/upstream/2.0.6/test/mjsunit/object-create.js +250 -0
  631. data/ext/v8/upstream/2.0.6/test/mjsunit/object-literal-gc.js +66 -0
  632. data/ext/v8/upstream/2.0.6/test/mjsunit/object-literal.js +105 -0
  633. data/ext/v8/upstream/2.0.6/test/mjsunit/override-read-only-property.js +64 -0
  634. data/ext/v8/upstream/2.0.6/test/mjsunit/parse-int-float.js +85 -0
  635. data/ext/v8/upstream/2.0.6/test/mjsunit/property-load-across-eval.js +85 -0
  636. data/ext/v8/upstream/2.0.6/test/mjsunit/property-object-key.js +36 -0
  637. data/ext/v8/upstream/2.0.6/test/mjsunit/proto.js +33 -0
  638. data/ext/v8/upstream/2.0.6/test/mjsunit/prototype.js +93 -0
  639. data/ext/v8/upstream/2.0.6/test/mjsunit/receiver-in-with-calls.js +47 -0
  640. data/ext/v8/upstream/2.0.6/test/mjsunit/regexp-UC16.js +47 -0
  641. data/ext/v8/upstream/2.0.6/test/mjsunit/regexp-call-as-function.js +36 -0
  642. data/ext/v8/upstream/2.0.6/test/mjsunit/regexp-capture.js +57 -0
  643. data/ext/v8/upstream/2.0.6/test/mjsunit/regexp-captures.js +31 -0
  644. data/ext/v8/upstream/2.0.6/test/mjsunit/regexp-indexof.js +77 -0
  645. data/ext/v8/upstream/2.0.6/test/mjsunit/regexp-lookahead.js +166 -0
  646. data/ext/v8/upstream/2.0.6/test/mjsunit/regexp-loop-capture.js +29 -0
  647. data/ext/v8/upstream/2.0.6/test/mjsunit/regexp-multiline-stack-trace.js +116 -0
  648. data/ext/v8/upstream/2.0.6/test/mjsunit/regexp-multiline.js +112 -0
  649. data/ext/v8/upstream/2.0.6/test/mjsunit/regexp-standalones.js +78 -0
  650. data/ext/v8/upstream/2.0.6/test/mjsunit/regexp-static.js +167 -0
  651. data/ext/v8/upstream/2.0.6/test/mjsunit/regexp-string-methods.js +51 -0
  652. data/ext/v8/upstream/2.0.6/test/mjsunit/regexp.js +390 -0
  653. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1030466.js +45 -0
  654. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1036894.js +38 -0
  655. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1039610.js +29 -0
  656. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1050043.js +51 -0
  657. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1062422.js +30 -0
  658. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1066899.js +37 -0
  659. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1081309.js +110 -0
  660. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1102760.js +35 -0
  661. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1110164.js +46 -0
  662. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1112051.js +33 -0
  663. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1114040.js +58 -0
  664. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1134697.js +31 -0
  665. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-114.js +43 -0
  666. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-116.js +40 -0
  667. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1170187.js +80 -0
  668. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1173979.js +48 -0
  669. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1175390.js +30 -0
  670. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1177518.js +39 -0
  671. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1177809.js +31 -0
  672. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1178598.js +90 -0
  673. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1182832.js +38 -0
  674. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1187524.js +34 -0
  675. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1199401.js +75 -0
  676. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1199637.js +78 -0
  677. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1200351.js +2032 -0
  678. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1201933.js +40 -0
  679. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1203459.js +29 -0
  680. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1207276.js +36 -0
  681. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1213516.js +40 -0
  682. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1213575.js +41 -0
  683. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1215653.js +365 -0
  684. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-124.js +57 -0
  685. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1254366.js +38 -0
  686. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1327557.js +36 -0
  687. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1341167.js +33 -0
  688. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1346700.js +29 -0
  689. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-137.js +46 -0
  690. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1439135.js +40 -0
  691. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-149.js +28 -0
  692. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1493017.js +52 -0
  693. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-155924.js +46 -0
  694. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-171.js +41 -0
  695. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-176.js +50 -0
  696. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-186.js +72 -0
  697. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-187.js +30 -0
  698. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-189.js +36 -0
  699. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-191.js +42 -0
  700. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-1919169.js +40 -0
  701. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-192.js +38 -0
  702. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-193.js +44 -0
  703. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-20070207.js +42 -0
  704. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-201.js +37 -0
  705. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-219.js +176 -0
  706. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-220.js +31 -0
  707. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-221.js +34 -0
  708. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-2249423.js +40 -0
  709. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-225.js +32 -0
  710. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-227.js +33 -0
  711. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-231.js +92 -0
  712. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-233.js +39 -0
  713. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-244.js +67 -0
  714. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-246.js +31 -0
  715. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-253.js +31 -0
  716. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-254.js +58 -0
  717. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-259.js +33 -0
  718. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-260.js +33 -0
  719. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-263.js +38 -0
  720. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-265.js +64 -0
  721. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-267.js +35 -0
  722. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-269.js +49 -0
  723. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-279.js +62 -0
  724. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-284.js +50 -0
  725. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-286.js +36 -0
  726. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-294.js +43 -0
  727. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-312.js +31 -0
  728. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-317.js +31 -0
  729. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-318.js +35 -0
  730. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-326.js +40 -0
  731. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-334.js +90 -0
  732. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-341.js +36 -0
  733. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-345.js +51 -0
  734. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-349.js +32 -0
  735. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-35.js +33 -0
  736. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-351.js +31 -0
  737. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-386.js +47 -0
  738. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-392.js +34 -0
  739. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-394.js +47 -0
  740. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-396.js +39 -0
  741. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-397.js +34 -0
  742. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-399.js +32 -0
  743. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-406.js +69 -0
  744. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-416.js +38 -0
  745. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-475.js +28 -0
  746. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-483.js +35 -0
  747. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-485.js +64 -0
  748. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-486.js +30 -0
  749. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-490.js +48 -0
  750. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-491.js +47 -0
  751. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-492.js +52 -0
  752. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-496.js +39 -0
  753. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-502.js +38 -0
  754. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-503.js +63 -0
  755. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-515.js +40 -0
  756. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-524.js +32 -0
  757. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-526.js +32 -0
  758. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-540.js +47 -0
  759. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-545.js +47 -0
  760. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-57.js +32 -0
  761. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-580.js +55 -0
  762. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-588599.js +31 -0
  763. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-6-9-regexp.js +30 -0
  764. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-662254.js +40 -0
  765. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-666721.js +53 -0
  766. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-667061.js +90 -0
  767. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-670147.js +34 -0
  768. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-674753.js +87 -0
  769. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-676025.js +31 -0
  770. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-678525.js +59 -0
  771. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-682649.js +30 -0
  772. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-69.js +43 -0
  773. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-734862.js +37 -0
  774. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-737588.js +34 -0
  775. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-74.js +41 -0
  776. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-780423.js +39 -0
  777. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-799761.js +92 -0
  778. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-806473.js +60 -0
  779. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-842017.js +60 -0
  780. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-86.js +46 -0
  781. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-87.js +58 -0
  782. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-874178.js +32 -0
  783. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-875031.js +37 -0
  784. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-877615.js +37 -0
  785. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-892742.js +50 -0
  786. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-900055.js +42 -0
  787. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-900966.js +38 -0
  788. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-91.js +38 -0
  789. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-925537.js +42 -0
  790. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-937896.js +50 -0
  791. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-990205.js +35 -0
  792. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-992733.js +35 -0
  793. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-996542.js +40 -0
  794. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-998565.js +51 -0
  795. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-crbug-18639.js +34 -0
  796. data/ext/v8/upstream/2.0.6/test/mjsunit/regress/regress-r3391.js +77 -0
  797. data/ext/v8/upstream/2.0.6/test/mjsunit/scanner.js +30 -0
  798. data/ext/v8/upstream/2.0.6/test/mjsunit/short-circuit-boolean.js +46 -0
  799. data/ext/v8/upstream/2.0.6/test/mjsunit/simple-constructor.js +140 -0
  800. data/ext/v8/upstream/2.0.6/test/mjsunit/sin-cos.js +45 -0
  801. data/ext/v8/upstream/2.0.6/test/mjsunit/smi-negative-zero.js +100 -0
  802. data/ext/v8/upstream/2.0.6/test/mjsunit/smi-ops.js +671 -0
  803. data/ext/v8/upstream/2.0.6/test/mjsunit/sparse-array-reverse.js +131 -0
  804. data/ext/v8/upstream/2.0.6/test/mjsunit/sparse-array.js +41 -0
  805. data/ext/v8/upstream/2.0.6/test/mjsunit/stack-traces.js +204 -0
  806. data/ext/v8/upstream/2.0.6/test/mjsunit/str-to-num.js +158 -0
  807. data/ext/v8/upstream/2.0.6/test/mjsunit/stress-array-push.js +34 -0
  808. data/ext/v8/upstream/2.0.6/test/mjsunit/strict-equals.js +90 -0
  809. data/ext/v8/upstream/2.0.6/test/mjsunit/string-add.js +195 -0
  810. data/ext/v8/upstream/2.0.6/test/mjsunit/string-case.js +28 -0
  811. data/ext/v8/upstream/2.0.6/test/mjsunit/string-charat.js +53 -0
  812. data/ext/v8/upstream/2.0.6/test/mjsunit/string-charcodeat.js +192 -0
  813. data/ext/v8/upstream/2.0.6/test/mjsunit/string-compare-alignment.js +47 -0
  814. data/ext/v8/upstream/2.0.6/test/mjsunit/string-flatten.js +37 -0
  815. data/ext/v8/upstream/2.0.6/test/mjsunit/string-index.js +154 -0
  816. data/ext/v8/upstream/2.0.6/test/mjsunit/string-indexof-1.js +99 -0
  817. data/ext/v8/upstream/2.0.6/test/mjsunit/string-indexof-2.js +68 -0
  818. data/ext/v8/upstream/2.0.6/test/mjsunit/string-lastindexof.js +88 -0
  819. data/ext/v8/upstream/2.0.6/test/mjsunit/string-localecompare.js +40 -0
  820. data/ext/v8/upstream/2.0.6/test/mjsunit/string-match.js +149 -0
  821. data/ext/v8/upstream/2.0.6/test/mjsunit/string-replace-gc.js +57 -0
  822. data/ext/v8/upstream/2.0.6/test/mjsunit/string-replace.js +182 -0
  823. data/ext/v8/upstream/2.0.6/test/mjsunit/string-search.js +30 -0
  824. data/ext/v8/upstream/2.0.6/test/mjsunit/string-split.js +126 -0
  825. data/ext/v8/upstream/2.0.6/test/mjsunit/substr.js +65 -0
  826. data/ext/v8/upstream/2.0.6/test/mjsunit/switch.js +289 -0
  827. data/ext/v8/upstream/2.0.6/test/mjsunit/testcfg.py +137 -0
  828. data/ext/v8/upstream/2.0.6/test/mjsunit/third_party/array-isarray.js +48 -0
  829. data/ext/v8/upstream/2.0.6/test/mjsunit/third_party/array-splice-webkit.js +62 -0
  830. data/ext/v8/upstream/2.0.6/test/mjsunit/third_party/object-keys.js +68 -0
  831. data/ext/v8/upstream/2.0.6/test/mjsunit/third_party/regexp-pcre.js +6603 -0
  832. data/ext/v8/upstream/2.0.6/test/mjsunit/third_party/string-trim.js +107 -0
  833. data/ext/v8/upstream/2.0.6/test/mjsunit/this-in-callbacks.js +47 -0
  834. data/ext/v8/upstream/2.0.6/test/mjsunit/this.js +46 -0
  835. data/ext/v8/upstream/2.0.6/test/mjsunit/throw-and-catch-function.js +50 -0
  836. data/ext/v8/upstream/2.0.6/test/mjsunit/throw-exception-for-null-access.js +37 -0
  837. data/ext/v8/upstream/2.0.6/test/mjsunit/to-precision.js +82 -0
  838. data/ext/v8/upstream/2.0.6/test/mjsunit/to_number_order.js +129 -0
  839. data/ext/v8/upstream/2.0.6/test/mjsunit/tobool.js +36 -0
  840. data/ext/v8/upstream/2.0.6/test/mjsunit/toint32.js +129 -0
  841. data/ext/v8/upstream/2.0.6/test/mjsunit/tools/codemap.js +180 -0
  842. data/ext/v8/upstream/2.0.6/test/mjsunit/tools/consarray.js +60 -0
  843. data/ext/v8/upstream/2.0.6/test/mjsunit/tools/csvparser.js +79 -0
  844. data/ext/v8/upstream/2.0.6/test/mjsunit/tools/logreader.js +98 -0
  845. data/ext/v8/upstream/2.0.6/test/mjsunit/tools/profile.js +348 -0
  846. data/ext/v8/upstream/2.0.6/test/mjsunit/tools/profile_view.js +95 -0
  847. data/ext/v8/upstream/2.0.6/test/mjsunit/tools/splaytree.js +166 -0
  848. data/ext/v8/upstream/2.0.6/test/mjsunit/tools/tickprocessor-test.default +55 -0
  849. data/ext/v8/upstream/2.0.6/test/mjsunit/tools/tickprocessor-test.gc-state +21 -0
  850. data/ext/v8/upstream/2.0.6/test/mjsunit/tools/tickprocessor-test.ignore-unknown +51 -0
  851. data/ext/v8/upstream/2.0.6/test/mjsunit/tools/tickprocessor-test.separate-ic +61 -0
  852. data/ext/v8/upstream/2.0.6/test/mjsunit/tools/tickprocessor.js +409 -0
  853. data/ext/v8/upstream/2.0.6/test/mjsunit/top-level-assignments.js +107 -0
  854. data/ext/v8/upstream/2.0.6/test/mjsunit/touint32.js +72 -0
  855. data/ext/v8/upstream/2.0.6/test/mjsunit/transcendentals.js +49 -0
  856. data/ext/v8/upstream/2.0.6/test/mjsunit/try-catch-extension-object.js +58 -0
  857. data/ext/v8/upstream/2.0.6/test/mjsunit/try-catch-scopes.js +42 -0
  858. data/ext/v8/upstream/2.0.6/test/mjsunit/try-finally-nested.js +46 -0
  859. data/ext/v8/upstream/2.0.6/test/mjsunit/try.js +394 -0
  860. data/ext/v8/upstream/2.0.6/test/mjsunit/typeof.js +40 -0
  861. data/ext/v8/upstream/2.0.6/test/mjsunit/undeletable-functions.js +181 -0
  862. data/ext/v8/upstream/2.0.6/test/mjsunit/unicode-case-overoptimization.js +35 -0
  863. data/ext/v8/upstream/2.0.6/test/mjsunit/unicode-string-to-number.js +46 -0
  864. data/ext/v8/upstream/2.0.6/test/mjsunit/unicode-test.js +9169 -0
  865. data/ext/v8/upstream/2.0.6/test/mjsunit/unusual-constructor.js +38 -0
  866. data/ext/v8/upstream/2.0.6/test/mjsunit/uri.js +78 -0
  867. data/ext/v8/upstream/2.0.6/test/mjsunit/value-callic-prototype-change.js +94 -0
  868. data/ext/v8/upstream/2.0.6/test/mjsunit/var.js +37 -0
  869. data/ext/v8/upstream/2.0.6/test/mjsunit/with-function-expression.js +36 -0
  870. data/ext/v8/upstream/2.0.6/test/mjsunit/with-leave.js +61 -0
  871. data/ext/v8/upstream/2.0.6/test/mjsunit/with-parameter-access.js +47 -0
  872. data/ext/v8/upstream/2.0.6/test/mjsunit/with-prototype.js +44 -0
  873. data/ext/v8/upstream/2.0.6/test/mjsunit/with-value.js +38 -0
  874. data/ext/v8/upstream/2.0.6/test/mozilla/mozilla-shell-emulation.js +37 -0
  875. data/ext/v8/upstream/2.0.6/test/mozilla/mozilla.status +815 -0
  876. data/ext/v8/upstream/2.0.6/test/mozilla/testcfg.py +138 -0
  877. data/ext/v8/upstream/2.0.6/test/sputnik/README +6 -0
  878. data/ext/v8/upstream/2.0.6/test/sputnik/sputnik.status +318 -0
  879. data/ext/v8/upstream/2.0.6/test/sputnik/testcfg.py +112 -0
  880. data/ext/v8/upstream/2.0.6/tools/codemap.js +258 -0
  881. data/ext/v8/upstream/2.0.6/tools/consarray.js +93 -0
  882. data/ext/v8/upstream/2.0.6/tools/csvparser.js +98 -0
  883. data/ext/v8/upstream/2.0.6/tools/gyp/v8.gyp +620 -0
  884. data/ext/v8/upstream/2.0.6/tools/js2c.py +376 -0
  885. data/ext/v8/upstream/2.0.6/tools/js2c.pyc +0 -0
  886. data/ext/v8/upstream/2.0.6/tools/jsmin.py +280 -0
  887. data/ext/v8/upstream/2.0.6/tools/jsmin.pyc +0 -0
  888. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor +24 -0
  889. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor.py +78 -0
  890. data/ext/v8/upstream/2.0.6/tools/logreader.js +320 -0
  891. data/ext/v8/upstream/2.0.6/tools/mac-nm +18 -0
  892. data/ext/v8/upstream/2.0.6/tools/mac-tick-processor +6 -0
  893. data/ext/v8/upstream/2.0.6/tools/oprofile/annotate +7 -0
  894. data/ext/v8/upstream/2.0.6/tools/oprofile/common +19 -0
  895. data/ext/v8/upstream/2.0.6/tools/oprofile/dump +7 -0
  896. data/ext/v8/upstream/2.0.6/tools/oprofile/report +7 -0
  897. data/ext/v8/upstream/2.0.6/tools/oprofile/reset +7 -0
  898. data/ext/v8/upstream/2.0.6/tools/oprofile/run +14 -0
  899. data/ext/v8/upstream/2.0.6/tools/oprofile/shutdown +7 -0
  900. data/ext/v8/upstream/2.0.6/tools/oprofile/start +7 -0
  901. data/ext/v8/upstream/2.0.6/tools/presubmit.py +299 -0
  902. data/ext/v8/upstream/2.0.6/tools/process-heap-prof.py +120 -0
  903. data/ext/v8/upstream/2.0.6/tools/profile.js +621 -0
  904. data/ext/v8/upstream/2.0.6/tools/profile_view.js +224 -0
  905. data/ext/v8/upstream/2.0.6/tools/run-valgrind.py +77 -0
  906. data/ext/v8/upstream/2.0.6/tools/splaytree.js +322 -0
  907. data/ext/v8/upstream/2.0.6/tools/splaytree.py +226 -0
  908. data/ext/v8/upstream/2.0.6/tools/stats-viewer.py +456 -0
  909. data/ext/v8/upstream/2.0.6/tools/test.py +1370 -0
  910. data/ext/v8/upstream/2.0.6/tools/tickprocessor-driver.js +53 -0
  911. data/ext/v8/upstream/2.0.6/tools/tickprocessor.js +731 -0
  912. data/ext/v8/upstream/2.0.6/tools/tickprocessor.py +535 -0
  913. data/ext/v8/upstream/2.0.6/tools/utils.py +82 -0
  914. data/ext/v8/upstream/2.0.6/tools/utils.pyc +0 -0
  915. data/ext/v8/upstream/2.0.6/tools/visual_studio/README.txt +71 -0
  916. data/ext/v8/upstream/2.0.6/tools/visual_studio/arm.vsprops +14 -0
  917. data/ext/v8/upstream/2.0.6/tools/visual_studio/common.vsprops +35 -0
  918. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8.vcproj +199 -0
  919. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_arm.vcproj +199 -0
  920. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_x64.vcproj +201 -0
  921. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8js2c.cmd +6 -0
  922. data/ext/v8/upstream/2.0.6/tools/visual_studio/debug.vsprops +17 -0
  923. data/ext/v8/upstream/2.0.6/tools/visual_studio/ia32.vsprops +13 -0
  924. data/ext/v8/upstream/2.0.6/tools/visual_studio/js2c.cmd +6 -0
  925. data/ext/v8/upstream/2.0.6/tools/visual_studio/release.vsprops +24 -0
  926. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.sln +101 -0
  927. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.vcproj +223 -0
  928. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.sln +74 -0
  929. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.vcproj +223 -0
  930. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base.vcproj +971 -0
  931. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_arm.vcproj +983 -0
  932. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_x64.vcproj +959 -0
  933. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest.vcproj +255 -0
  934. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_arm.vcproj +243 -0
  935. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_x64.vcproj +257 -0
  936. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot.vcproj +151 -0
  937. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot_x64.vcproj +151 -0
  938. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample.vcproj +151 -0
  939. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_arm.vcproj +151 -0
  940. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_x64.vcproj +151 -0
  941. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample.vcproj +151 -0
  942. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_arm.vcproj +151 -0
  943. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_x64.vcproj +153 -0
  944. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot.vcproj +142 -0
  945. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc.vcproj +92 -0
  946. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc_x64.vcproj +92 -0
  947. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_x64.vcproj +142 -0
  948. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.sln +101 -0
  949. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.vcproj +223 -0
  950. data/ext/v8/upstream/2.0.6/tools/visual_studio/x64.vsprops +13 -0
  951. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.bat +5 -0
  952. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.py +137 -0
  953. data/ext/v8/upstream/scons/CHANGES.txt +5183 -0
  954. data/ext/v8/upstream/scons/LICENSE.txt +20 -0
  955. data/ext/v8/upstream/scons/MANIFEST +202 -0
  956. data/ext/v8/upstream/scons/PKG-INFO +13 -0
  957. data/ext/v8/upstream/scons/README.txt +273 -0
  958. data/ext/v8/upstream/scons/RELEASE.txt +1040 -0
  959. data/ext/v8/upstream/scons/engine/SCons/Action.py +1256 -0
  960. data/ext/v8/upstream/scons/engine/SCons/Builder.py +868 -0
  961. data/ext/v8/upstream/scons/engine/SCons/CacheDir.py +217 -0
  962. data/ext/v8/upstream/scons/engine/SCons/Conftest.py +794 -0
  963. data/ext/v8/upstream/scons/engine/SCons/Debug.py +237 -0
  964. data/ext/v8/upstream/scons/engine/SCons/Defaults.py +485 -0
  965. data/ext/v8/upstream/scons/engine/SCons/Environment.py +2327 -0
  966. data/ext/v8/upstream/scons/engine/SCons/Errors.py +207 -0
  967. data/ext/v8/upstream/scons/engine/SCons/Executor.py +636 -0
  968. data/ext/v8/upstream/scons/engine/SCons/Job.py +435 -0
  969. data/ext/v8/upstream/scons/engine/SCons/Memoize.py +292 -0
  970. data/ext/v8/upstream/scons/engine/SCons/Node/Alias.py +153 -0
  971. data/ext/v8/upstream/scons/engine/SCons/Node/FS.py +3220 -0
  972. data/ext/v8/upstream/scons/engine/SCons/Node/Python.py +128 -0
  973. data/ext/v8/upstream/scons/engine/SCons/Node/__init__.py +1341 -0
  974. data/ext/v8/upstream/scons/engine/SCons/Options/BoolOption.py +50 -0
  975. data/ext/v8/upstream/scons/engine/SCons/Options/EnumOption.py +50 -0
  976. data/ext/v8/upstream/scons/engine/SCons/Options/ListOption.py +50 -0
  977. data/ext/v8/upstream/scons/engine/SCons/Options/PackageOption.py +50 -0
  978. data/ext/v8/upstream/scons/engine/SCons/Options/PathOption.py +76 -0
  979. data/ext/v8/upstream/scons/engine/SCons/Options/__init__.py +74 -0
  980. data/ext/v8/upstream/scons/engine/SCons/PathList.py +232 -0
  981. data/ext/v8/upstream/scons/engine/SCons/Platform/__init__.py +236 -0
  982. data/ext/v8/upstream/scons/engine/SCons/Platform/aix.py +70 -0
  983. data/ext/v8/upstream/scons/engine/SCons/Platform/cygwin.py +55 -0
  984. data/ext/v8/upstream/scons/engine/SCons/Platform/darwin.py +46 -0
  985. data/ext/v8/upstream/scons/engine/SCons/Platform/hpux.py +46 -0
  986. data/ext/v8/upstream/scons/engine/SCons/Platform/irix.py +44 -0
  987. data/ext/v8/upstream/scons/engine/SCons/Platform/os2.py +58 -0
  988. data/ext/v8/upstream/scons/engine/SCons/Platform/posix.py +264 -0
  989. data/ext/v8/upstream/scons/engine/SCons/Platform/sunos.py +50 -0
  990. data/ext/v8/upstream/scons/engine/SCons/Platform/win32.py +386 -0
  991. data/ext/v8/upstream/scons/engine/SCons/SConf.py +1038 -0
  992. data/ext/v8/upstream/scons/engine/SCons/SConsign.py +381 -0
  993. data/ext/v8/upstream/scons/engine/SCons/Scanner/C.py +132 -0
  994. data/ext/v8/upstream/scons/engine/SCons/Scanner/D.py +74 -0
  995. data/ext/v8/upstream/scons/engine/SCons/Scanner/Dir.py +111 -0
  996. data/ext/v8/upstream/scons/engine/SCons/Scanner/Fortran.py +320 -0
  997. data/ext/v8/upstream/scons/engine/SCons/Scanner/IDL.py +48 -0
  998. data/ext/v8/upstream/scons/engine/SCons/Scanner/LaTeX.py +378 -0
  999. data/ext/v8/upstream/scons/engine/SCons/Scanner/Prog.py +103 -0
  1000. data/ext/v8/upstream/scons/engine/SCons/Scanner/RC.py +55 -0
  1001. data/ext/v8/upstream/scons/engine/SCons/Scanner/__init__.py +415 -0
  1002. data/ext/v8/upstream/scons/engine/SCons/Script/Interactive.py +386 -0
  1003. data/ext/v8/upstream/scons/engine/SCons/Script/Main.py +1360 -0
  1004. data/ext/v8/upstream/scons/engine/SCons/Script/SConsOptions.py +944 -0
  1005. data/ext/v8/upstream/scons/engine/SCons/Script/SConscript.py +642 -0
  1006. data/ext/v8/upstream/scons/engine/SCons/Script/__init__.py +414 -0
  1007. data/ext/v8/upstream/scons/engine/SCons/Sig.py +63 -0
  1008. data/ext/v8/upstream/scons/engine/SCons/Subst.py +911 -0
  1009. data/ext/v8/upstream/scons/engine/SCons/Taskmaster.py +1030 -0
  1010. data/ext/v8/upstream/scons/engine/SCons/Tool/386asm.py +61 -0
  1011. data/ext/v8/upstream/scons/engine/SCons/Tool/BitKeeper.py +65 -0
  1012. data/ext/v8/upstream/scons/engine/SCons/Tool/CVS.py +73 -0
  1013. data/ext/v8/upstream/scons/engine/SCons/Tool/FortranCommon.py +247 -0
  1014. data/ext/v8/upstream/scons/engine/SCons/Tool/JavaCommon.py +324 -0
  1015. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/__init__.py +56 -0
  1016. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/arch.py +61 -0
  1017. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/common.py +210 -0
  1018. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/netframework.py +84 -0
  1019. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/sdk.py +321 -0
  1020. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vc.py +367 -0
  1021. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vs.py +497 -0
  1022. data/ext/v8/upstream/scons/engine/SCons/Tool/Perforce.py +104 -0
  1023. data/ext/v8/upstream/scons/engine/SCons/Tool/PharLapCommon.py +138 -0
  1024. data/ext/v8/upstream/scons/engine/SCons/Tool/RCS.py +64 -0
  1025. data/ext/v8/upstream/scons/engine/SCons/Tool/SCCS.py +64 -0
  1026. data/ext/v8/upstream/scons/engine/SCons/Tool/Subversion.py +71 -0
  1027. data/ext/v8/upstream/scons/engine/SCons/Tool/__init__.py +675 -0
  1028. data/ext/v8/upstream/scons/engine/SCons/Tool/aixc++.py +82 -0
  1029. data/ext/v8/upstream/scons/engine/SCons/Tool/aixcc.py +74 -0
  1030. data/ext/v8/upstream/scons/engine/SCons/Tool/aixf77.py +80 -0
  1031. data/ext/v8/upstream/scons/engine/SCons/Tool/aixlink.py +76 -0
  1032. data/ext/v8/upstream/scons/engine/SCons/Tool/applelink.py +71 -0
  1033. data/ext/v8/upstream/scons/engine/SCons/Tool/ar.py +63 -0
  1034. data/ext/v8/upstream/scons/engine/SCons/Tool/as.py +78 -0
  1035. data/ext/v8/upstream/scons/engine/SCons/Tool/bcc32.py +82 -0
  1036. data/ext/v8/upstream/scons/engine/SCons/Tool/c++.py +99 -0
  1037. data/ext/v8/upstream/scons/engine/SCons/Tool/cc.py +114 -0
  1038. data/ext/v8/upstream/scons/engine/SCons/Tool/cvf.py +58 -0
  1039. data/ext/v8/upstream/scons/engine/SCons/Tool/default.py +50 -0
  1040. data/ext/v8/upstream/scons/engine/SCons/Tool/dmd.py +224 -0
  1041. data/ext/v8/upstream/scons/engine/SCons/Tool/dvi.py +64 -0
  1042. data/ext/v8/upstream/scons/engine/SCons/Tool/dvipdf.py +125 -0
  1043. data/ext/v8/upstream/scons/engine/SCons/Tool/dvips.py +94 -0
  1044. data/ext/v8/upstream/scons/engine/SCons/Tool/f77.py +62 -0
  1045. data/ext/v8/upstream/scons/engine/SCons/Tool/f90.py +62 -0
  1046. data/ext/v8/upstream/scons/engine/SCons/Tool/f95.py +63 -0
  1047. data/ext/v8/upstream/scons/engine/SCons/Tool/filesystem.py +98 -0
  1048. data/ext/v8/upstream/scons/engine/SCons/Tool/fortran.py +63 -0
  1049. data/ext/v8/upstream/scons/engine/SCons/Tool/g++.py +90 -0
  1050. data/ext/v8/upstream/scons/engine/SCons/Tool/g77.py +73 -0
  1051. data/ext/v8/upstream/scons/engine/SCons/Tool/gas.py +53 -0
  1052. data/ext/v8/upstream/scons/engine/SCons/Tool/gcc.py +80 -0
  1053. data/ext/v8/upstream/scons/engine/SCons/Tool/gfortran.py +64 -0
  1054. data/ext/v8/upstream/scons/engine/SCons/Tool/gnulink.py +63 -0
  1055. data/ext/v8/upstream/scons/engine/SCons/Tool/gs.py +81 -0
  1056. data/ext/v8/upstream/scons/engine/SCons/Tool/hpc++.py +85 -0
  1057. data/ext/v8/upstream/scons/engine/SCons/Tool/hpcc.py +53 -0
  1058. data/ext/v8/upstream/scons/engine/SCons/Tool/hplink.py +77 -0
  1059. data/ext/v8/upstream/scons/engine/SCons/Tool/icc.py +59 -0
  1060. data/ext/v8/upstream/scons/engine/SCons/Tool/icl.py +52 -0
  1061. data/ext/v8/upstream/scons/engine/SCons/Tool/ifl.py +72 -0
  1062. data/ext/v8/upstream/scons/engine/SCons/Tool/ifort.py +90 -0
  1063. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink.py +59 -0
  1064. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink32.py +60 -0
  1065. data/ext/v8/upstream/scons/engine/SCons/Tool/install.py +229 -0
  1066. data/ext/v8/upstream/scons/engine/SCons/Tool/intelc.py +490 -0
  1067. data/ext/v8/upstream/scons/engine/SCons/Tool/ipkg.py +71 -0
  1068. data/ext/v8/upstream/scons/engine/SCons/Tool/jar.py +110 -0
  1069. data/ext/v8/upstream/scons/engine/SCons/Tool/javac.py +234 -0
  1070. data/ext/v8/upstream/scons/engine/SCons/Tool/javah.py +138 -0
  1071. data/ext/v8/upstream/scons/engine/SCons/Tool/latex.py +79 -0
  1072. data/ext/v8/upstream/scons/engine/SCons/Tool/lex.py +99 -0
  1073. data/ext/v8/upstream/scons/engine/SCons/Tool/link.py +121 -0
  1074. data/ext/v8/upstream/scons/engine/SCons/Tool/linkloc.py +112 -0
  1075. data/ext/v8/upstream/scons/engine/SCons/Tool/m4.py +63 -0
  1076. data/ext/v8/upstream/scons/engine/SCons/Tool/masm.py +77 -0
  1077. data/ext/v8/upstream/scons/engine/SCons/Tool/midl.py +90 -0
  1078. data/ext/v8/upstream/scons/engine/SCons/Tool/mingw.py +159 -0
  1079. data/ext/v8/upstream/scons/engine/SCons/Tool/mslib.py +64 -0
  1080. data/ext/v8/upstream/scons/engine/SCons/Tool/mslink.py +266 -0
  1081. data/ext/v8/upstream/scons/engine/SCons/Tool/mssdk.py +50 -0
  1082. data/ext/v8/upstream/scons/engine/SCons/Tool/msvc.py +269 -0
  1083. data/ext/v8/upstream/scons/engine/SCons/Tool/msvs.py +1439 -0
  1084. data/ext/v8/upstream/scons/engine/SCons/Tool/mwcc.py +208 -0
  1085. data/ext/v8/upstream/scons/engine/SCons/Tool/mwld.py +107 -0
  1086. data/ext/v8/upstream/scons/engine/SCons/Tool/nasm.py +72 -0
  1087. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/__init__.py +314 -0
  1088. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/ipk.py +185 -0
  1089. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/msi.py +526 -0
  1090. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/rpm.py +367 -0
  1091. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_tarbz2.py +43 -0
  1092. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_targz.py +43 -0
  1093. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_zip.py +43 -0
  1094. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/tarbz2.py +44 -0
  1095. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/targz.py +44 -0
  1096. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/zip.py +44 -0
  1097. data/ext/v8/upstream/scons/engine/SCons/Tool/pdf.py +78 -0
  1098. data/ext/v8/upstream/scons/engine/SCons/Tool/pdflatex.py +83 -0
  1099. data/ext/v8/upstream/scons/engine/SCons/Tool/pdftex.py +108 -0
  1100. data/ext/v8/upstream/scons/engine/SCons/Tool/qt.py +336 -0
  1101. data/ext/v8/upstream/scons/engine/SCons/Tool/rmic.py +121 -0
  1102. data/ext/v8/upstream/scons/engine/SCons/Tool/rpcgen.py +70 -0
  1103. data/ext/v8/upstream/scons/engine/SCons/Tool/rpm.py +132 -0
  1104. data/ext/v8/upstream/scons/engine/SCons/Tool/sgiar.py +68 -0
  1105. data/ext/v8/upstream/scons/engine/SCons/Tool/sgic++.py +58 -0
  1106. data/ext/v8/upstream/scons/engine/SCons/Tool/sgicc.py +53 -0
  1107. data/ext/v8/upstream/scons/engine/SCons/Tool/sgilink.py +63 -0
  1108. data/ext/v8/upstream/scons/engine/SCons/Tool/sunar.py +67 -0
  1109. data/ext/v8/upstream/scons/engine/SCons/Tool/sunc++.py +142 -0
  1110. data/ext/v8/upstream/scons/engine/SCons/Tool/suncc.py +58 -0
  1111. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf77.py +63 -0
  1112. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf90.py +64 -0
  1113. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf95.py +64 -0
  1114. data/ext/v8/upstream/scons/engine/SCons/Tool/sunlink.py +77 -0
  1115. data/ext/v8/upstream/scons/engine/SCons/Tool/swig.py +186 -0
  1116. data/ext/v8/upstream/scons/engine/SCons/Tool/tar.py +73 -0
  1117. data/ext/v8/upstream/scons/engine/SCons/Tool/tex.py +805 -0
  1118. data/ext/v8/upstream/scons/engine/SCons/Tool/textfile.py +175 -0
  1119. data/ext/v8/upstream/scons/engine/SCons/Tool/tlib.py +53 -0
  1120. data/ext/v8/upstream/scons/engine/SCons/Tool/wix.py +100 -0
  1121. data/ext/v8/upstream/scons/engine/SCons/Tool/yacc.py +131 -0
  1122. data/ext/v8/upstream/scons/engine/SCons/Tool/zip.py +100 -0
  1123. data/ext/v8/upstream/scons/engine/SCons/Util.py +1645 -0
  1124. data/ext/v8/upstream/scons/engine/SCons/Variables/BoolVariable.py +91 -0
  1125. data/ext/v8/upstream/scons/engine/SCons/Variables/EnumVariable.py +107 -0
  1126. data/ext/v8/upstream/scons/engine/SCons/Variables/ListVariable.py +139 -0
  1127. data/ext/v8/upstream/scons/engine/SCons/Variables/PackageVariable.py +109 -0
  1128. data/ext/v8/upstream/scons/engine/SCons/Variables/PathVariable.py +147 -0
  1129. data/ext/v8/upstream/scons/engine/SCons/Variables/__init__.py +317 -0
  1130. data/ext/v8/upstream/scons/engine/SCons/Warnings.py +228 -0
  1131. data/ext/v8/upstream/scons/engine/SCons/__init__.py +49 -0
  1132. data/ext/v8/upstream/scons/engine/SCons/compat/__init__.py +302 -0
  1133. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_UserString.py +98 -0
  1134. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_hashlib.py +91 -0
  1135. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_itertools.py +124 -0
  1136. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_optparse.py +1725 -0
  1137. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets.py +583 -0
  1138. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets15.py +176 -0
  1139. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_shlex.py +325 -0
  1140. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_subprocess.py +1296 -0
  1141. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_textwrap.py +382 -0
  1142. data/ext/v8/upstream/scons/engine/SCons/compat/builtins.py +187 -0
  1143. data/ext/v8/upstream/scons/engine/SCons/cpp.py +598 -0
  1144. data/ext/v8/upstream/scons/engine/SCons/dblite.py +248 -0
  1145. data/ext/v8/upstream/scons/engine/SCons/exitfuncs.py +77 -0
  1146. data/ext/v8/upstream/scons/os_spawnv_fix.diff +83 -0
  1147. data/ext/v8/upstream/scons/scons-time.1 +1017 -0
  1148. data/ext/v8/upstream/scons/scons.1 +15179 -0
  1149. data/ext/v8/upstream/scons/sconsign.1 +208 -0
  1150. data/ext/v8/upstream/scons/script/scons +184 -0
  1151. data/ext/v8/upstream/scons/script/scons-time +1529 -0
  1152. data/ext/v8/upstream/scons/script/scons.bat +31 -0
  1153. data/ext/v8/upstream/scons/script/sconsign +508 -0
  1154. data/ext/v8/upstream/scons/setup.cfg +6 -0
  1155. data/ext/v8/upstream/scons/setup.py +427 -0
  1156. data/ext/v8/v8.cpp +81 -0
  1157. data/ext/v8/v8_cxt.cpp +92 -0
  1158. data/ext/v8/v8_cxt.h +20 -0
  1159. data/ext/v8/v8_func.cpp +10 -0
  1160. data/ext/v8/v8_func.h +11 -0
  1161. data/ext/v8/v8_msg.cpp +17 -0
  1162. data/ext/v8/v8_msg.h +10 -0
  1163. data/ext/v8/v8_obj.cpp +52 -0
  1164. data/ext/v8/v8_obj.h +13 -0
  1165. data/ext/v8/v8_ref.cpp +26 -0
  1166. data/ext/v8/v8_ref.h +31 -0
  1167. data/ext/v8/v8_script.cpp +20 -0
  1168. data/ext/v8/v8_script.h +8 -0
  1169. data/ext/v8/v8_standalone.cpp +69 -0
  1170. data/ext/v8/v8_standalone.h +31 -0
  1171. data/ext/v8/v8_str.cpp +17 -0
  1172. data/ext/v8/v8_str.h +9 -0
  1173. data/ext/v8/v8_template.cpp +53 -0
  1174. data/ext/v8/v8_template.h +13 -0
  1175. data/lib/v8.rb +10 -0
  1176. data/lib/v8/context.rb +87 -0
  1177. data/lib/v8/object.rb +38 -0
  1178. data/lib/v8/to.rb +33 -0
  1179. data/lib/v8/v8.bundle +0 -0
  1180. data/script/console +10 -0
  1181. data/script/destroy +14 -0
  1182. data/script/generate +14 -0
  1183. data/spec/ext/cxt_spec.rb +25 -0
  1184. data/spec/ext/obj_spec.rb +13 -0
  1185. data/spec/redjs/README.txt +8 -0
  1186. data/spec/redjs/jsapi_spec.rb +394 -0
  1187. data/spec/redjs/tap.rb +8 -0
  1188. data/spec/redjs_helper.rb +3 -0
  1189. data/spec/spec.opts +1 -0
  1190. data/spec/spec_helper.rb +14 -0
  1191. data/spec/v8/to_spec.rb +15 -0
  1192. data/tasks/rspec.rake +21 -0
  1193. data/therubyracer.gemspec +34 -0
  1194. metadata +1269 -0
@@ -0,0 +1,63 @@
1
+ V8 Benchmark Suite
2
+ ==================
3
+
4
+ This is the V8 benchmark suite: A collection of pure JavaScript
5
+ benchmarks that we have used to tune V8. The licenses for the
6
+ individual benchmarks are included in the JavaScript files.
7
+
8
+ In addition to the benchmarks, the suite consists of the benchmark
9
+ framework (base.js), which must be loaded before any of the individual
10
+ benchmark files, and two benchmark runners: An HTML version (run.html)
11
+ and a standalone JavaScript version (run.js).
12
+
13
+
14
+ Changes From Version 1 To Version 2
15
+ ===================================
16
+
17
+ For version 2 the crypto benchmark was fixed. Previously, the
18
+ decryption stage was given plaintext as input, which resulted in an
19
+ error. Now, the decryption stage is given the output of the
20
+ encryption stage as input. The result is checked against the original
21
+ plaintext. For this to give the correct results the crypto objects
22
+ are reset for each iteration of the benchmark. In addition, the size
23
+ of the plain text has been increased a little and the use of
24
+ Math.random() and new Date() to build an RNG pool has been removed.
25
+
26
+ Other benchmarks were fixed to do elementary verification of the
27
+ results of their calculations. This is to avoid accidentally
28
+ obtaining scores that are the result of an incorrect JavaScript engine
29
+ optimization.
30
+
31
+
32
+ Changes From Version 2 To Version 3
33
+ ===================================
34
+
35
+ Version 3 adds a new benchmark, RegExp. The RegExp benchmark is
36
+ generated by loading 50 of the most popular pages on the web and
37
+ logging all regexp operations performed. Each operation is given a
38
+ weight that is calculated from an estimate of the popularity of the
39
+ pages where it occurs and the number of times it is executed while
40
+ loading each page. Finally the literal letters in the data are
41
+ encoded using ROT13 in a way that does not affect how the regexps
42
+ match their input.
43
+
44
+
45
+ Changes from Version 3 to Version 4
46
+ ===================================
47
+
48
+ The Splay benchmark is a newcomer in version 4. It manipulates a
49
+ splay tree by adding and removing data nodes, thus exercising the
50
+ memory management subsystem of the JavaScript engine.
51
+
52
+ Furthermore, all the unused parts of the Prototype library were
53
+ removed from the RayTrace benchmark. This does not affect the running
54
+ of the benchmark.
55
+
56
+
57
+ Changes from Version 4 to Version 5
58
+ ===================================
59
+
60
+ Removed duplicate line in random seed code, and changed the name of
61
+ the Object.prototype.inherits function in the DeltaBlue benchmark to
62
+ inheritsFrom to avoid name clashes when running in Chromium with
63
+ extensions enabled.
@@ -0,0 +1,264 @@
1
+ // Copyright 2008 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
+
29
+ // Simple framework for running the benchmark suites and
30
+ // computing a score based on the timing measurements.
31
+
32
+
33
+ // A benchmark has a name (string) and a function that will be run to
34
+ // do the performance measurement. The optional setup and tearDown
35
+ // arguments are functions that will be invoked before and after
36
+ // running the benchmark, but the running time of these functions will
37
+ // not be accounted for in the benchmark score.
38
+ function Benchmark(name, run, setup, tearDown) {
39
+ this.name = name;
40
+ this.run = run;
41
+ this.Setup = setup ? setup : function() { };
42
+ this.TearDown = tearDown ? tearDown : function() { };
43
+ }
44
+
45
+
46
+ // Benchmark results hold the benchmark and the measured time used to
47
+ // run the benchmark. The benchmark score is computed later once a
48
+ // full benchmark suite has run to completion.
49
+ function BenchmarkResult(benchmark, time) {
50
+ this.benchmark = benchmark;
51
+ this.time = time;
52
+ }
53
+
54
+
55
+ // Automatically convert results to numbers. Used by the geometric
56
+ // mean computation.
57
+ BenchmarkResult.prototype.valueOf = function() {
58
+ return this.time;
59
+ }
60
+
61
+
62
+ // Suites of benchmarks consist of a name and the set of benchmarks in
63
+ // addition to the reference timing that the final score will be based
64
+ // on. This way, all scores are relative to a reference run and higher
65
+ // scores implies better performance.
66
+ function BenchmarkSuite(name, reference, benchmarks) {
67
+ this.name = name;
68
+ this.reference = reference;
69
+ this.benchmarks = benchmarks;
70
+ BenchmarkSuite.suites.push(this);
71
+ }
72
+
73
+
74
+ // Keep track of all declared benchmark suites.
75
+ BenchmarkSuite.suites = [];
76
+
77
+
78
+ // Scores are not comparable across versions. Bump the version if
79
+ // you're making changes that will affect that scores, e.g. if you add
80
+ // a new benchmark or change an existing one.
81
+ BenchmarkSuite.version = '5';
82
+
83
+
84
+ // To make the benchmark results predictable, we replace Math.random
85
+ // with a 100% deterministic alternative.
86
+ Math.random = (function() {
87
+ var seed = 49734321;
88
+ return function() {
89
+ // Robert Jenkins' 32 bit integer hash function.
90
+ seed = ((seed + 0x7ed55d16) + (seed << 12)) & 0xffffffff;
91
+ seed = ((seed ^ 0xc761c23c) ^ (seed >>> 19)) & 0xffffffff;
92
+ seed = ((seed + 0x165667b1) + (seed << 5)) & 0xffffffff;
93
+ seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff;
94
+ seed = ((seed + 0xfd7046c5) + (seed << 3)) & 0xffffffff;
95
+ seed = ((seed ^ 0xb55a4f09) ^ (seed >>> 16)) & 0xffffffff;
96
+ return (seed & 0xfffffff) / 0x10000000;
97
+ };
98
+ })();
99
+
100
+
101
+ // Runs all registered benchmark suites and optionally yields between
102
+ // each individual benchmark to avoid running for too long in the
103
+ // context of browsers. Once done, the final score is reported to the
104
+ // runner.
105
+ BenchmarkSuite.RunSuites = function(runner) {
106
+ var continuation = null;
107
+ var suites = BenchmarkSuite.suites;
108
+ var length = suites.length;
109
+ BenchmarkSuite.scores = [];
110
+ var index = 0;
111
+ function RunStep() {
112
+ while (continuation || index < length) {
113
+ if (continuation) {
114
+ continuation = continuation();
115
+ } else {
116
+ var suite = suites[index++];
117
+ if (runner.NotifyStart) runner.NotifyStart(suite.name);
118
+ continuation = suite.RunStep(runner);
119
+ }
120
+ if (continuation && typeof window != 'undefined' && window.setTimeout) {
121
+ window.setTimeout(RunStep, 25);
122
+ return;
123
+ }
124
+ }
125
+ if (runner.NotifyScore) {
126
+ var score = BenchmarkSuite.GeometricMean(BenchmarkSuite.scores);
127
+ var formatted = BenchmarkSuite.FormatScore(100 * score);
128
+ runner.NotifyScore(formatted);
129
+ }
130
+ }
131
+ RunStep();
132
+ }
133
+
134
+
135
+ // Counts the total number of registered benchmarks. Useful for
136
+ // showing progress as a percentage.
137
+ BenchmarkSuite.CountBenchmarks = function() {
138
+ var result = 0;
139
+ var suites = BenchmarkSuite.suites;
140
+ for (var i = 0; i < suites.length; i++) {
141
+ result += suites[i].benchmarks.length;
142
+ }
143
+ return result;
144
+ }
145
+
146
+
147
+ // Computes the geometric mean of a set of numbers.
148
+ BenchmarkSuite.GeometricMean = function(numbers) {
149
+ var log = 0;
150
+ for (var i = 0; i < numbers.length; i++) {
151
+ log += Math.log(numbers[i]);
152
+ }
153
+ return Math.pow(Math.E, log / numbers.length);
154
+ }
155
+
156
+
157
+ // Converts a score value to a string with at least three significant
158
+ // digits.
159
+ BenchmarkSuite.FormatScore = function(value) {
160
+ if (value > 100) {
161
+ return value.toFixed(0);
162
+ } else {
163
+ return value.toPrecision(3);
164
+ }
165
+ }
166
+
167
+ // Notifies the runner that we're done running a single benchmark in
168
+ // the benchmark suite. This can be useful to report progress.
169
+ BenchmarkSuite.prototype.NotifyStep = function(result) {
170
+ this.results.push(result);
171
+ if (this.runner.NotifyStep) this.runner.NotifyStep(result.benchmark.name);
172
+ }
173
+
174
+
175
+ // Notifies the runner that we're done with running a suite and that
176
+ // we have a result which can be reported to the user if needed.
177
+ BenchmarkSuite.prototype.NotifyResult = function() {
178
+ var mean = BenchmarkSuite.GeometricMean(this.results);
179
+ var score = this.reference / mean;
180
+ BenchmarkSuite.scores.push(score);
181
+ if (this.runner.NotifyResult) {
182
+ var formatted = BenchmarkSuite.FormatScore(100 * score);
183
+ this.runner.NotifyResult(this.name, formatted);
184
+ }
185
+ }
186
+
187
+
188
+ // Notifies the runner that running a benchmark resulted in an error.
189
+ BenchmarkSuite.prototype.NotifyError = function(error) {
190
+ if (this.runner.NotifyError) {
191
+ this.runner.NotifyError(this.name, error);
192
+ }
193
+ if (this.runner.NotifyStep) {
194
+ this.runner.NotifyStep(this.name);
195
+ }
196
+ }
197
+
198
+
199
+ // Runs a single benchmark for at least a second and computes the
200
+ // average time it takes to run a single iteration.
201
+ BenchmarkSuite.prototype.RunSingleBenchmark = function(benchmark) {
202
+ var elapsed = 0;
203
+ var start = new Date();
204
+ for (var n = 0; elapsed < 1000; n++) {
205
+ benchmark.run();
206
+ elapsed = new Date() - start;
207
+ }
208
+ var usec = (elapsed * 1000) / n;
209
+ this.NotifyStep(new BenchmarkResult(benchmark, usec));
210
+ }
211
+
212
+
213
+ // This function starts running a suite, but stops between each
214
+ // individual benchmark in the suite and returns a continuation
215
+ // function which can be invoked to run the next benchmark. Once the
216
+ // last benchmark has been executed, null is returned.
217
+ BenchmarkSuite.prototype.RunStep = function(runner) {
218
+ this.results = [];
219
+ this.runner = runner;
220
+ var length = this.benchmarks.length;
221
+ var index = 0;
222
+ var suite = this;
223
+
224
+ // Run the setup, the actual benchmark, and the tear down in three
225
+ // separate steps to allow the framework to yield between any of the
226
+ // steps.
227
+
228
+ function RunNextSetup() {
229
+ if (index < length) {
230
+ try {
231
+ suite.benchmarks[index].Setup();
232
+ } catch (e) {
233
+ suite.NotifyError(e);
234
+ return null;
235
+ }
236
+ return RunNextBenchmark;
237
+ }
238
+ suite.NotifyResult();
239
+ return null;
240
+ }
241
+
242
+ function RunNextBenchmark() {
243
+ try {
244
+ suite.RunSingleBenchmark(suite.benchmarks[index]);
245
+ } catch (e) {
246
+ suite.NotifyError(e);
247
+ return null;
248
+ }
249
+ return RunNextTearDown;
250
+ }
251
+
252
+ function RunNextTearDown() {
253
+ try {
254
+ suite.benchmarks[index++].TearDown();
255
+ } catch (e) {
256
+ suite.NotifyError(e);
257
+ return null;
258
+ }
259
+ return RunNextSetup;
260
+ }
261
+
262
+ // Start out running the setup.
263
+ return RunNextSetup();
264
+ }
@@ -0,0 +1,1698 @@
1
+ /*
2
+ * Copyright (c) 2003-2005 Tom Wu
3
+ * All Rights Reserved.
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining
6
+ * a copy of this software and associated documentation files (the
7
+ * "Software"), to deal in the Software without restriction, including
8
+ * without limitation the rights to use, copy, modify, merge, publish,
9
+ * distribute, sublicense, and/or sell copies of the Software, and to
10
+ * permit persons to whom the Software is furnished to do so, subject to
11
+ * the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be
14
+ * included in all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
17
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19
+ *
20
+ * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
21
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
22
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
23
+ * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
24
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25
+ *
26
+ * In addition, the following condition applies:
27
+ *
28
+ * All redistributions must retain an intact copy of this copyright notice
29
+ * and disclaimer.
30
+ */
31
+
32
+
33
+ // The code has been adapted for use as a benchmark by Google.
34
+ var Crypto = new BenchmarkSuite('Crypto', 203037, [
35
+ new Benchmark("Encrypt", encrypt),
36
+ new Benchmark("Decrypt", decrypt)
37
+ ]);
38
+
39
+
40
+ // Basic JavaScript BN library - subset useful for RSA encryption.
41
+
42
+ // Bits per digit
43
+ var dbits;
44
+ var BI_DB;
45
+ var BI_DM;
46
+ var BI_DV;
47
+
48
+ var BI_FP;
49
+ var BI_FV;
50
+ var BI_F1;
51
+ var BI_F2;
52
+
53
+ // JavaScript engine analysis
54
+ var canary = 0xdeadbeefcafe;
55
+ var j_lm = ((canary&0xffffff)==0xefcafe);
56
+
57
+ // (public) Constructor
58
+ function BigInteger(a,b,c) {
59
+ this.array = new Array();
60
+ if(a != null)
61
+ if("number" == typeof a) this.fromNumber(a,b,c);
62
+ else if(b == null && "string" != typeof a) this.fromString(a,256);
63
+ else this.fromString(a,b);
64
+ }
65
+
66
+ // return new, unset BigInteger
67
+ function nbi() { return new BigInteger(null); }
68
+
69
+ // am: Compute w_j += (x*this_i), propagate carries,
70
+ // c is initial carry, returns final carry.
71
+ // c < 3*dvalue, x < 2*dvalue, this_i < dvalue
72
+ // We need to select the fastest one that works in this environment.
73
+
74
+ // am1: use a single mult and divide to get the high bits,
75
+ // max digit bits should be 26 because
76
+ // max internal value = 2*dvalue^2-2*dvalue (< 2^53)
77
+ function am1(i,x,w,j,c,n) {
78
+ var this_array = this.array;
79
+ var w_array = w.array;
80
+ while(--n >= 0) {
81
+ var v = x*this_array[i++]+w_array[j]+c;
82
+ c = Math.floor(v/0x4000000);
83
+ w_array[j++] = v&0x3ffffff;
84
+ }
85
+ return c;
86
+ }
87
+
88
+ // am2 avoids a big mult-and-extract completely.
89
+ // Max digit bits should be <= 30 because we do bitwise ops
90
+ // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
91
+ function am2(i,x,w,j,c,n) {
92
+ var this_array = this.array;
93
+ var w_array = w.array;
94
+ var xl = x&0x7fff, xh = x>>15;
95
+ while(--n >= 0) {
96
+ var l = this_array[i]&0x7fff;
97
+ var h = this_array[i++]>>15;
98
+ var m = xh*l+h*xl;
99
+ l = xl*l+((m&0x7fff)<<15)+w_array[j]+(c&0x3fffffff);
100
+ c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
101
+ w_array[j++] = l&0x3fffffff;
102
+ }
103
+ return c;
104
+ }
105
+
106
+ // Alternately, set max digit bits to 28 since some
107
+ // browsers slow down when dealing with 32-bit numbers.
108
+ function am3(i,x,w,j,c,n) {
109
+ var this_array = this.array;
110
+ var w_array = w.array;
111
+
112
+ var xl = x&0x3fff, xh = x>>14;
113
+ while(--n >= 0) {
114
+ var l = this_array[i]&0x3fff;
115
+ var h = this_array[i++]>>14;
116
+ var m = xh*l+h*xl;
117
+ l = xl*l+((m&0x3fff)<<14)+w_array[j]+c;
118
+ c = (l>>28)+(m>>14)+xh*h;
119
+ w_array[j++] = l&0xfffffff;
120
+ }
121
+ return c;
122
+ }
123
+
124
+ // This is tailored to VMs with 2-bit tagging. It makes sure
125
+ // that all the computations stay within the 29 bits available.
126
+ function am4(i,x,w,j,c,n) {
127
+ var this_array = this.array;
128
+ var w_array = w.array;
129
+
130
+ var xl = x&0x1fff, xh = x>>13;
131
+ while(--n >= 0) {
132
+ var l = this_array[i]&0x1fff;
133
+ var h = this_array[i++]>>13;
134
+ var m = xh*l+h*xl;
135
+ l = xl*l+((m&0x1fff)<<13)+w_array[j]+c;
136
+ c = (l>>26)+(m>>13)+xh*h;
137
+ w_array[j++] = l&0x3ffffff;
138
+ }
139
+ return c;
140
+ }
141
+
142
+ // am3/28 is best for SM, Rhino, but am4/26 is best for v8.
143
+ // Kestrel (Opera 9.5) gets its best result with am4/26.
144
+ // IE7 does 9% better with am3/28 than with am4/26.
145
+ // Firefox (SM) gets 10% faster with am3/28 than with am4/26.
146
+
147
+ setupEngine = function(fn, bits) {
148
+ BigInteger.prototype.am = fn;
149
+ dbits = bits;
150
+
151
+ BI_DB = dbits;
152
+ BI_DM = ((1<<dbits)-1);
153
+ BI_DV = (1<<dbits);
154
+
155
+ BI_FP = 52;
156
+ BI_FV = Math.pow(2,BI_FP);
157
+ BI_F1 = BI_FP-dbits;
158
+ BI_F2 = 2*dbits-BI_FP;
159
+ }
160
+
161
+
162
+ // Digit conversions
163
+ var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
164
+ var BI_RC = new Array();
165
+ var rr,vv;
166
+ rr = "0".charCodeAt(0);
167
+ for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
168
+ rr = "a".charCodeAt(0);
169
+ for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
170
+ rr = "A".charCodeAt(0);
171
+ for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
172
+
173
+ function int2char(n) { return BI_RM.charAt(n); }
174
+ function intAt(s,i) {
175
+ var c = BI_RC[s.charCodeAt(i)];
176
+ return (c==null)?-1:c;
177
+ }
178
+
179
+ // (protected) copy this to r
180
+ function bnpCopyTo(r) {
181
+ var this_array = this.array;
182
+ var r_array = r.array;
183
+
184
+ for(var i = this.t-1; i >= 0; --i) r_array[i] = this_array[i];
185
+ r.t = this.t;
186
+ r.s = this.s;
187
+ }
188
+
189
+ // (protected) set from integer value x, -DV <= x < DV
190
+ function bnpFromInt(x) {
191
+ var this_array = this.array;
192
+ this.t = 1;
193
+ this.s = (x<0)?-1:0;
194
+ if(x > 0) this_array[0] = x;
195
+ else if(x < -1) this_array[0] = x+DV;
196
+ else this.t = 0;
197
+ }
198
+
199
+ // return bigint initialized to value
200
+ function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
201
+
202
+ // (protected) set from string and radix
203
+ function bnpFromString(s,b) {
204
+ var this_array = this.array;
205
+ var k;
206
+ if(b == 16) k = 4;
207
+ else if(b == 8) k = 3;
208
+ else if(b == 256) k = 8; // byte array
209
+ else if(b == 2) k = 1;
210
+ else if(b == 32) k = 5;
211
+ else if(b == 4) k = 2;
212
+ else { this.fromRadix(s,b); return; }
213
+ this.t = 0;
214
+ this.s = 0;
215
+ var i = s.length, mi = false, sh = 0;
216
+ while(--i >= 0) {
217
+ var x = (k==8)?s[i]&0xff:intAt(s,i);
218
+ if(x < 0) {
219
+ if(s.charAt(i) == "-") mi = true;
220
+ continue;
221
+ }
222
+ mi = false;
223
+ if(sh == 0)
224
+ this_array[this.t++] = x;
225
+ else if(sh+k > BI_DB) {
226
+ this_array[this.t-1] |= (x&((1<<(BI_DB-sh))-1))<<sh;
227
+ this_array[this.t++] = (x>>(BI_DB-sh));
228
+ }
229
+ else
230
+ this_array[this.t-1] |= x<<sh;
231
+ sh += k;
232
+ if(sh >= BI_DB) sh -= BI_DB;
233
+ }
234
+ if(k == 8 && (s[0]&0x80) != 0) {
235
+ this.s = -1;
236
+ if(sh > 0) this_array[this.t-1] |= ((1<<(BI_DB-sh))-1)<<sh;
237
+ }
238
+ this.clamp();
239
+ if(mi) BigInteger.ZERO.subTo(this,this);
240
+ }
241
+
242
+ // (protected) clamp off excess high words
243
+ function bnpClamp() {
244
+ var this_array = this.array;
245
+ var c = this.s&BI_DM;
246
+ while(this.t > 0 && this_array[this.t-1] == c) --this.t;
247
+ }
248
+
249
+ // (public) return string representation in given radix
250
+ function bnToString(b) {
251
+ var this_array = this.array;
252
+ if(this.s < 0) return "-"+this.negate().toString(b);
253
+ var k;
254
+ if(b == 16) k = 4;
255
+ else if(b == 8) k = 3;
256
+ else if(b == 2) k = 1;
257
+ else if(b == 32) k = 5;
258
+ else if(b == 4) k = 2;
259
+ else return this.toRadix(b);
260
+ var km = (1<<k)-1, d, m = false, r = "", i = this.t;
261
+ var p = BI_DB-(i*BI_DB)%k;
262
+ if(i-- > 0) {
263
+ if(p < BI_DB && (d = this_array[i]>>p) > 0) { m = true; r = int2char(d); }
264
+ while(i >= 0) {
265
+ if(p < k) {
266
+ d = (this_array[i]&((1<<p)-1))<<(k-p);
267
+ d |= this_array[--i]>>(p+=BI_DB-k);
268
+ }
269
+ else {
270
+ d = (this_array[i]>>(p-=k))&km;
271
+ if(p <= 0) { p += BI_DB; --i; }
272
+ }
273
+ if(d > 0) m = true;
274
+ if(m) r += int2char(d);
275
+ }
276
+ }
277
+ return m?r:"0";
278
+ }
279
+
280
+ // (public) -this
281
+ function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
282
+
283
+ // (public) |this|
284
+ function bnAbs() { return (this.s<0)?this.negate():this; }
285
+
286
+ // (public) return + if this > a, - if this < a, 0 if equal
287
+ function bnCompareTo(a) {
288
+ var this_array = this.array;
289
+ var a_array = a.array;
290
+
291
+ var r = this.s-a.s;
292
+ if(r != 0) return r;
293
+ var i = this.t;
294
+ r = i-a.t;
295
+ if(r != 0) return r;
296
+ while(--i >= 0) if((r=this_array[i]-a_array[i]) != 0) return r;
297
+ return 0;
298
+ }
299
+
300
+ // returns bit length of the integer x
301
+ function nbits(x) {
302
+ var r = 1, t;
303
+ if((t=x>>>16) != 0) { x = t; r += 16; }
304
+ if((t=x>>8) != 0) { x = t; r += 8; }
305
+ if((t=x>>4) != 0) { x = t; r += 4; }
306
+ if((t=x>>2) != 0) { x = t; r += 2; }
307
+ if((t=x>>1) != 0) { x = t; r += 1; }
308
+ return r;
309
+ }
310
+
311
+ // (public) return the number of bits in "this"
312
+ function bnBitLength() {
313
+ var this_array = this.array;
314
+ if(this.t <= 0) return 0;
315
+ return BI_DB*(this.t-1)+nbits(this_array[this.t-1]^(this.s&BI_DM));
316
+ }
317
+
318
+ // (protected) r = this << n*DB
319
+ function bnpDLShiftTo(n,r) {
320
+ var this_array = this.array;
321
+ var r_array = r.array;
322
+ var i;
323
+ for(i = this.t-1; i >= 0; --i) r_array[i+n] = this_array[i];
324
+ for(i = n-1; i >= 0; --i) r_array[i] = 0;
325
+ r.t = this.t+n;
326
+ r.s = this.s;
327
+ }
328
+
329
+ // (protected) r = this >> n*DB
330
+ function bnpDRShiftTo(n,r) {
331
+ var this_array = this.array;
332
+ var r_array = r.array;
333
+ for(var i = n; i < this.t; ++i) r_array[i-n] = this_array[i];
334
+ r.t = Math.max(this.t-n,0);
335
+ r.s = this.s;
336
+ }
337
+
338
+ // (protected) r = this << n
339
+ function bnpLShiftTo(n,r) {
340
+ var this_array = this.array;
341
+ var r_array = r.array;
342
+ var bs = n%BI_DB;
343
+ var cbs = BI_DB-bs;
344
+ var bm = (1<<cbs)-1;
345
+ var ds = Math.floor(n/BI_DB), c = (this.s<<bs)&BI_DM, i;
346
+ for(i = this.t-1; i >= 0; --i) {
347
+ r_array[i+ds+1] = (this_array[i]>>cbs)|c;
348
+ c = (this_array[i]&bm)<<bs;
349
+ }
350
+ for(i = ds-1; i >= 0; --i) r_array[i] = 0;
351
+ r_array[ds] = c;
352
+ r.t = this.t+ds+1;
353
+ r.s = this.s;
354
+ r.clamp();
355
+ }
356
+
357
+ // (protected) r = this >> n
358
+ function bnpRShiftTo(n,r) {
359
+ var this_array = this.array;
360
+ var r_array = r.array;
361
+ r.s = this.s;
362
+ var ds = Math.floor(n/BI_DB);
363
+ if(ds >= this.t) { r.t = 0; return; }
364
+ var bs = n%BI_DB;
365
+ var cbs = BI_DB-bs;
366
+ var bm = (1<<bs)-1;
367
+ r_array[0] = this_array[ds]>>bs;
368
+ for(var i = ds+1; i < this.t; ++i) {
369
+ r_array[i-ds-1] |= (this_array[i]&bm)<<cbs;
370
+ r_array[i-ds] = this_array[i]>>bs;
371
+ }
372
+ if(bs > 0) r_array[this.t-ds-1] |= (this.s&bm)<<cbs;
373
+ r.t = this.t-ds;
374
+ r.clamp();
375
+ }
376
+
377
+ // (protected) r = this - a
378
+ function bnpSubTo(a,r) {
379
+ var this_array = this.array;
380
+ var r_array = r.array;
381
+ var a_array = a.array;
382
+ var i = 0, c = 0, m = Math.min(a.t,this.t);
383
+ while(i < m) {
384
+ c += this_array[i]-a_array[i];
385
+ r_array[i++] = c&BI_DM;
386
+ c >>= BI_DB;
387
+ }
388
+ if(a.t < this.t) {
389
+ c -= a.s;
390
+ while(i < this.t) {
391
+ c += this_array[i];
392
+ r_array[i++] = c&BI_DM;
393
+ c >>= BI_DB;
394
+ }
395
+ c += this.s;
396
+ }
397
+ else {
398
+ c += this.s;
399
+ while(i < a.t) {
400
+ c -= a_array[i];
401
+ r_array[i++] = c&BI_DM;
402
+ c >>= BI_DB;
403
+ }
404
+ c -= a.s;
405
+ }
406
+ r.s = (c<0)?-1:0;
407
+ if(c < -1) r_array[i++] = BI_DV+c;
408
+ else if(c > 0) r_array[i++] = c;
409
+ r.t = i;
410
+ r.clamp();
411
+ }
412
+
413
+ // (protected) r = this * a, r != this,a (HAC 14.12)
414
+ // "this" should be the larger one if appropriate.
415
+ function bnpMultiplyTo(a,r) {
416
+ var this_array = this.array;
417
+ var r_array = r.array;
418
+ var x = this.abs(), y = a.abs();
419
+ var y_array = y.array;
420
+
421
+ var i = x.t;
422
+ r.t = i+y.t;
423
+ while(--i >= 0) r_array[i] = 0;
424
+ for(i = 0; i < y.t; ++i) r_array[i+x.t] = x.am(0,y_array[i],r,i,0,x.t);
425
+ r.s = 0;
426
+ r.clamp();
427
+ if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
428
+ }
429
+
430
+ // (protected) r = this^2, r != this (HAC 14.16)
431
+ function bnpSquareTo(r) {
432
+ var x = this.abs();
433
+ var x_array = x.array;
434
+ var r_array = r.array;
435
+
436
+ var i = r.t = 2*x.t;
437
+ while(--i >= 0) r_array[i] = 0;
438
+ for(i = 0; i < x.t-1; ++i) {
439
+ var c = x.am(i,x_array[i],r,2*i,0,1);
440
+ if((r_array[i+x.t]+=x.am(i+1,2*x_array[i],r,2*i+1,c,x.t-i-1)) >= BI_DV) {
441
+ r_array[i+x.t] -= BI_DV;
442
+ r_array[i+x.t+1] = 1;
443
+ }
444
+ }
445
+ if(r.t > 0) r_array[r.t-1] += x.am(i,x_array[i],r,2*i,0,1);
446
+ r.s = 0;
447
+ r.clamp();
448
+ }
449
+
450
+ // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
451
+ // r != q, this != m. q or r may be null.
452
+ function bnpDivRemTo(m,q,r) {
453
+ var pm = m.abs();
454
+ if(pm.t <= 0) return;
455
+ var pt = this.abs();
456
+ if(pt.t < pm.t) {
457
+ if(q != null) q.fromInt(0);
458
+ if(r != null) this.copyTo(r);
459
+ return;
460
+ }
461
+ if(r == null) r = nbi();
462
+ var y = nbi(), ts = this.s, ms = m.s;
463
+ var pm_array = pm.array;
464
+ var nsh = BI_DB-nbits(pm_array[pm.t-1]); // normalize modulus
465
+ if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
466
+ else { pm.copyTo(y); pt.copyTo(r); }
467
+ var ys = y.t;
468
+
469
+ var y_array = y.array;
470
+ var y0 = y_array[ys-1];
471
+ if(y0 == 0) return;
472
+ var yt = y0*(1<<BI_F1)+((ys>1)?y_array[ys-2]>>BI_F2:0);
473
+ var d1 = BI_FV/yt, d2 = (1<<BI_F1)/yt, e = 1<<BI_F2;
474
+ var i = r.t, j = i-ys, t = (q==null)?nbi():q;
475
+ y.dlShiftTo(j,t);
476
+
477
+ var r_array = r.array;
478
+ if(r.compareTo(t) >= 0) {
479
+ r_array[r.t++] = 1;
480
+ r.subTo(t,r);
481
+ }
482
+ BigInteger.ONE.dlShiftTo(ys,t);
483
+ t.subTo(y,y); // "negative" y so we can replace sub with am later
484
+ while(y.t < ys) y_array[y.t++] = 0;
485
+ while(--j >= 0) {
486
+ // Estimate quotient digit
487
+ var qd = (r_array[--i]==y0)?BI_DM:Math.floor(r_array[i]*d1+(r_array[i-1]+e)*d2);
488
+ if((r_array[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
489
+ y.dlShiftTo(j,t);
490
+ r.subTo(t,r);
491
+ while(r_array[i] < --qd) r.subTo(t,r);
492
+ }
493
+ }
494
+ if(q != null) {
495
+ r.drShiftTo(ys,q);
496
+ if(ts != ms) BigInteger.ZERO.subTo(q,q);
497
+ }
498
+ r.t = ys;
499
+ r.clamp();
500
+ if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
501
+ if(ts < 0) BigInteger.ZERO.subTo(r,r);
502
+ }
503
+
504
+ // (public) this mod a
505
+ function bnMod(a) {
506
+ var r = nbi();
507
+ this.abs().divRemTo(a,null,r);
508
+ if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
509
+ return r;
510
+ }
511
+
512
+ // Modular reduction using "classic" algorithm
513
+ function Classic(m) { this.m = m; }
514
+ function cConvert(x) {
515
+ if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
516
+ else return x;
517
+ }
518
+ function cRevert(x) { return x; }
519
+ function cReduce(x) { x.divRemTo(this.m,null,x); }
520
+ function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
521
+ function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
522
+
523
+ Classic.prototype.convert = cConvert;
524
+ Classic.prototype.revert = cRevert;
525
+ Classic.prototype.reduce = cReduce;
526
+ Classic.prototype.mulTo = cMulTo;
527
+ Classic.prototype.sqrTo = cSqrTo;
528
+
529
+ // (protected) return "-1/this % 2^DB"; useful for Mont. reduction
530
+ // justification:
531
+ // xy == 1 (mod m)
532
+ // xy = 1+km
533
+ // xy(2-xy) = (1+km)(1-km)
534
+ // x[y(2-xy)] = 1-k^2m^2
535
+ // x[y(2-xy)] == 1 (mod m^2)
536
+ // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
537
+ // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
538
+ // JS multiply "overflows" differently from C/C++, so care is needed here.
539
+ function bnpInvDigit() {
540
+ var this_array = this.array;
541
+ if(this.t < 1) return 0;
542
+ var x = this_array[0];
543
+ if((x&1) == 0) return 0;
544
+ var y = x&3; // y == 1/x mod 2^2
545
+ y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
546
+ y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
547
+ y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
548
+ // last step - calculate inverse mod DV directly;
549
+ // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
550
+ y = (y*(2-x*y%BI_DV))%BI_DV; // y == 1/x mod 2^dbits
551
+ // we really want the negative inverse, and -DV < y < DV
552
+ return (y>0)?BI_DV-y:-y;
553
+ }
554
+
555
+ // Montgomery reduction
556
+ function Montgomery(m) {
557
+ this.m = m;
558
+ this.mp = m.invDigit();
559
+ this.mpl = this.mp&0x7fff;
560
+ this.mph = this.mp>>15;
561
+ this.um = (1<<(BI_DB-15))-1;
562
+ this.mt2 = 2*m.t;
563
+ }
564
+
565
+ // xR mod m
566
+ function montConvert(x) {
567
+ var r = nbi();
568
+ x.abs().dlShiftTo(this.m.t,r);
569
+ r.divRemTo(this.m,null,r);
570
+ if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
571
+ return r;
572
+ }
573
+
574
+ // x/R mod m
575
+ function montRevert(x) {
576
+ var r = nbi();
577
+ x.copyTo(r);
578
+ this.reduce(r);
579
+ return r;
580
+ }
581
+
582
+ // x = x/R mod m (HAC 14.32)
583
+ function montReduce(x) {
584
+ var x_array = x.array;
585
+ while(x.t <= this.mt2) // pad x so am has enough room later
586
+ x_array[x.t++] = 0;
587
+ for(var i = 0; i < this.m.t; ++i) {
588
+ // faster way of calculating u0 = x[i]*mp mod DV
589
+ var j = x_array[i]&0x7fff;
590
+ var u0 = (j*this.mpl+(((j*this.mph+(x_array[i]>>15)*this.mpl)&this.um)<<15))&BI_DM;
591
+ // use am to combine the multiply-shift-add into one call
592
+ j = i+this.m.t;
593
+ x_array[j] += this.m.am(0,u0,x,i,0,this.m.t);
594
+ // propagate carry
595
+ while(x_array[j] >= BI_DV) { x_array[j] -= BI_DV; x_array[++j]++; }
596
+ }
597
+ x.clamp();
598
+ x.drShiftTo(this.m.t,x);
599
+ if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
600
+ }
601
+
602
+ // r = "x^2/R mod m"; x != r
603
+ function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
604
+
605
+ // r = "xy/R mod m"; x,y != r
606
+ function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
607
+
608
+ Montgomery.prototype.convert = montConvert;
609
+ Montgomery.prototype.revert = montRevert;
610
+ Montgomery.prototype.reduce = montReduce;
611
+ Montgomery.prototype.mulTo = montMulTo;
612
+ Montgomery.prototype.sqrTo = montSqrTo;
613
+
614
+ // (protected) true iff this is even
615
+ function bnpIsEven() {
616
+ var this_array = this.array;
617
+ return ((this.t>0)?(this_array[0]&1):this.s) == 0;
618
+ }
619
+
620
+ // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
621
+ function bnpExp(e,z) {
622
+ if(e > 0xffffffff || e < 1) return BigInteger.ONE;
623
+ var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
624
+ g.copyTo(r);
625
+ while(--i >= 0) {
626
+ z.sqrTo(r,r2);
627
+ if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
628
+ else { var t = r; r = r2; r2 = t; }
629
+ }
630
+ return z.revert(r);
631
+ }
632
+
633
+ // (public) this^e % m, 0 <= e < 2^32
634
+ function bnModPowInt(e,m) {
635
+ var z;
636
+ if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
637
+ return this.exp(e,z);
638
+ }
639
+
640
+ // protected
641
+ BigInteger.prototype.copyTo = bnpCopyTo;
642
+ BigInteger.prototype.fromInt = bnpFromInt;
643
+ BigInteger.prototype.fromString = bnpFromString;
644
+ BigInteger.prototype.clamp = bnpClamp;
645
+ BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
646
+ BigInteger.prototype.drShiftTo = bnpDRShiftTo;
647
+ BigInteger.prototype.lShiftTo = bnpLShiftTo;
648
+ BigInteger.prototype.rShiftTo = bnpRShiftTo;
649
+ BigInteger.prototype.subTo = bnpSubTo;
650
+ BigInteger.prototype.multiplyTo = bnpMultiplyTo;
651
+ BigInteger.prototype.squareTo = bnpSquareTo;
652
+ BigInteger.prototype.divRemTo = bnpDivRemTo;
653
+ BigInteger.prototype.invDigit = bnpInvDigit;
654
+ BigInteger.prototype.isEven = bnpIsEven;
655
+ BigInteger.prototype.exp = bnpExp;
656
+
657
+ // public
658
+ BigInteger.prototype.toString = bnToString;
659
+ BigInteger.prototype.negate = bnNegate;
660
+ BigInteger.prototype.abs = bnAbs;
661
+ BigInteger.prototype.compareTo = bnCompareTo;
662
+ BigInteger.prototype.bitLength = bnBitLength;
663
+ BigInteger.prototype.mod = bnMod;
664
+ BigInteger.prototype.modPowInt = bnModPowInt;
665
+
666
+ // "constants"
667
+ BigInteger.ZERO = nbv(0);
668
+ BigInteger.ONE = nbv(1);
669
+ // Copyright (c) 2005 Tom Wu
670
+ // All Rights Reserved.
671
+ // See "LICENSE" for details.
672
+
673
+ // Extended JavaScript BN functions, required for RSA private ops.
674
+
675
+ // (public)
676
+ function bnClone() { var r = nbi(); this.copyTo(r); return r; }
677
+
678
+ // (public) return value as integer
679
+ function bnIntValue() {
680
+ var this_array = this.array;
681
+ if(this.s < 0) {
682
+ if(this.t == 1) return this_array[0]-BI_DV;
683
+ else if(this.t == 0) return -1;
684
+ }
685
+ else if(this.t == 1) return this_array[0];
686
+ else if(this.t == 0) return 0;
687
+ // assumes 16 < DB < 32
688
+ return ((this_array[1]&((1<<(32-BI_DB))-1))<<BI_DB)|this_array[0];
689
+ }
690
+
691
+ // (public) return value as byte
692
+ function bnByteValue() {
693
+ var this_array = this.array;
694
+ return (this.t==0)?this.s:(this_array[0]<<24)>>24;
695
+ }
696
+
697
+ // (public) return value as short (assumes DB>=16)
698
+ function bnShortValue() {
699
+ var this_array = this.array;
700
+ return (this.t==0)?this.s:(this_array[0]<<16)>>16;
701
+ }
702
+
703
+ // (protected) return x s.t. r^x < DV
704
+ function bnpChunkSize(r) { return Math.floor(Math.LN2*BI_DB/Math.log(r)); }
705
+
706
+ // (public) 0 if this == 0, 1 if this > 0
707
+ function bnSigNum() {
708
+ var this_array = this.array;
709
+ if(this.s < 0) return -1;
710
+ else if(this.t <= 0 || (this.t == 1 && this_array[0] <= 0)) return 0;
711
+ else return 1;
712
+ }
713
+
714
+ // (protected) convert to radix string
715
+ function bnpToRadix(b) {
716
+ if(b == null) b = 10;
717
+ if(this.signum() == 0 || b < 2 || b > 36) return "0";
718
+ var cs = this.chunkSize(b);
719
+ var a = Math.pow(b,cs);
720
+ var d = nbv(a), y = nbi(), z = nbi(), r = "";
721
+ this.divRemTo(d,y,z);
722
+ while(y.signum() > 0) {
723
+ r = (a+z.intValue()).toString(b).substr(1) + r;
724
+ y.divRemTo(d,y,z);
725
+ }
726
+ return z.intValue().toString(b) + r;
727
+ }
728
+
729
+ // (protected) convert from radix string
730
+ function bnpFromRadix(s,b) {
731
+ this.fromInt(0);
732
+ if(b == null) b = 10;
733
+ var cs = this.chunkSize(b);
734
+ var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
735
+ for(var i = 0; i < s.length; ++i) {
736
+ var x = intAt(s,i);
737
+ if(x < 0) {
738
+ if(s.charAt(i) == "-" && this.signum() == 0) mi = true;
739
+ continue;
740
+ }
741
+ w = b*w+x;
742
+ if(++j >= cs) {
743
+ this.dMultiply(d);
744
+ this.dAddOffset(w,0);
745
+ j = 0;
746
+ w = 0;
747
+ }
748
+ }
749
+ if(j > 0) {
750
+ this.dMultiply(Math.pow(b,j));
751
+ this.dAddOffset(w,0);
752
+ }
753
+ if(mi) BigInteger.ZERO.subTo(this,this);
754
+ }
755
+
756
+ // (protected) alternate constructor
757
+ function bnpFromNumber(a,b,c) {
758
+ if("number" == typeof b) {
759
+ // new BigInteger(int,int,RNG)
760
+ if(a < 2) this.fromInt(1);
761
+ else {
762
+ this.fromNumber(a,c);
763
+ if(!this.testBit(a-1)) // force MSB set
764
+ this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
765
+ if(this.isEven()) this.dAddOffset(1,0); // force odd
766
+ while(!this.isProbablePrime(b)) {
767
+ this.dAddOffset(2,0);
768
+ if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);
769
+ }
770
+ }
771
+ }
772
+ else {
773
+ // new BigInteger(int,RNG)
774
+ var x = new Array(), t = a&7;
775
+ x.length = (a>>3)+1;
776
+ b.nextBytes(x);
777
+ if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;
778
+ this.fromString(x,256);
779
+ }
780
+ }
781
+
782
+ // (public) convert to bigendian byte array
783
+ function bnToByteArray() {
784
+ var this_array = this.array;
785
+ var i = this.t, r = new Array();
786
+ r[0] = this.s;
787
+ var p = BI_DB-(i*BI_DB)%8, d, k = 0;
788
+ if(i-- > 0) {
789
+ if(p < BI_DB && (d = this_array[i]>>p) != (this.s&BI_DM)>>p)
790
+ r[k++] = d|(this.s<<(BI_DB-p));
791
+ while(i >= 0) {
792
+ if(p < 8) {
793
+ d = (this_array[i]&((1<<p)-1))<<(8-p);
794
+ d |= this_array[--i]>>(p+=BI_DB-8);
795
+ }
796
+ else {
797
+ d = (this_array[i]>>(p-=8))&0xff;
798
+ if(p <= 0) { p += BI_DB; --i; }
799
+ }
800
+ if((d&0x80) != 0) d |= -256;
801
+ if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;
802
+ if(k > 0 || d != this.s) r[k++] = d;
803
+ }
804
+ }
805
+ return r;
806
+ }
807
+
808
+ function bnEquals(a) { return(this.compareTo(a)==0); }
809
+ function bnMin(a) { return(this.compareTo(a)<0)?this:a; }
810
+ function bnMax(a) { return(this.compareTo(a)>0)?this:a; }
811
+
812
+ // (protected) r = this op a (bitwise)
813
+ function bnpBitwiseTo(a,op,r) {
814
+ var this_array = this.array;
815
+ var a_array = a.array;
816
+ var r_array = r.array;
817
+ var i, f, m = Math.min(a.t,this.t);
818
+ for(i = 0; i < m; ++i) r_array[i] = op(this_array[i],a_array[i]);
819
+ if(a.t < this.t) {
820
+ f = a.s&BI_DM;
821
+ for(i = m; i < this.t; ++i) r_array[i] = op(this_array[i],f);
822
+ r.t = this.t;
823
+ }
824
+ else {
825
+ f = this.s&BI_DM;
826
+ for(i = m; i < a.t; ++i) r_array[i] = op(f,a_array[i]);
827
+ r.t = a.t;
828
+ }
829
+ r.s = op(this.s,a.s);
830
+ r.clamp();
831
+ }
832
+
833
+ // (public) this & a
834
+ function op_and(x,y) { return x&y; }
835
+ function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }
836
+
837
+ // (public) this | a
838
+ function op_or(x,y) { return x|y; }
839
+ function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }
840
+
841
+ // (public) this ^ a
842
+ function op_xor(x,y) { return x^y; }
843
+ function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }
844
+
845
+ // (public) this & ~a
846
+ function op_andnot(x,y) { return x&~y; }
847
+ function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }
848
+
849
+ // (public) ~this
850
+ function bnNot() {
851
+ var this_array = this.array;
852
+ var r = nbi();
853
+ var r_array = r.array;
854
+
855
+ for(var i = 0; i < this.t; ++i) r_array[i] = BI_DM&~this_array[i];
856
+ r.t = this.t;
857
+ r.s = ~this.s;
858
+ return r;
859
+ }
860
+
861
+ // (public) this << n
862
+ function bnShiftLeft(n) {
863
+ var r = nbi();
864
+ if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);
865
+ return r;
866
+ }
867
+
868
+ // (public) this >> n
869
+ function bnShiftRight(n) {
870
+ var r = nbi();
871
+ if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);
872
+ return r;
873
+ }
874
+
875
+ // return index of lowest 1-bit in x, x < 2^31
876
+ function lbit(x) {
877
+ if(x == 0) return -1;
878
+ var r = 0;
879
+ if((x&0xffff) == 0) { x >>= 16; r += 16; }
880
+ if((x&0xff) == 0) { x >>= 8; r += 8; }
881
+ if((x&0xf) == 0) { x >>= 4; r += 4; }
882
+ if((x&3) == 0) { x >>= 2; r += 2; }
883
+ if((x&1) == 0) ++r;
884
+ return r;
885
+ }
886
+
887
+ // (public) returns index of lowest 1-bit (or -1 if none)
888
+ function bnGetLowestSetBit() {
889
+ var this_array = this.array;
890
+ for(var i = 0; i < this.t; ++i)
891
+ if(this_array[i] != 0) return i*BI_DB+lbit(this_array[i]);
892
+ if(this.s < 0) return this.t*BI_DB;
893
+ return -1;
894
+ }
895
+
896
+ // return number of 1 bits in x
897
+ function cbit(x) {
898
+ var r = 0;
899
+ while(x != 0) { x &= x-1; ++r; }
900
+ return r;
901
+ }
902
+
903
+ // (public) return number of set bits
904
+ function bnBitCount() {
905
+ var r = 0, x = this.s&BI_DM;
906
+ for(var i = 0; i < this.t; ++i) r += cbit(this_array[i]^x);
907
+ return r;
908
+ }
909
+
910
+ // (public) true iff nth bit is set
911
+ function bnTestBit(n) {
912
+ var this_array = this.array;
913
+ var j = Math.floor(n/BI_DB);
914
+ if(j >= this.t) return(this.s!=0);
915
+ return((this_array[j]&(1<<(n%BI_DB)))!=0);
916
+ }
917
+
918
+ // (protected) this op (1<<n)
919
+ function bnpChangeBit(n,op) {
920
+ var r = BigInteger.ONE.shiftLeft(n);
921
+ this.bitwiseTo(r,op,r);
922
+ return r;
923
+ }
924
+
925
+ // (public) this | (1<<n)
926
+ function bnSetBit(n) { return this.changeBit(n,op_or); }
927
+
928
+ // (public) this & ~(1<<n)
929
+ function bnClearBit(n) { return this.changeBit(n,op_andnot); }
930
+
931
+ // (public) this ^ (1<<n)
932
+ function bnFlipBit(n) { return this.changeBit(n,op_xor); }
933
+
934
+ // (protected) r = this + a
935
+ function bnpAddTo(a,r) {
936
+ var this_array = this.array;
937
+ var a_array = a.array;
938
+ var r_array = r.array;
939
+ var i = 0, c = 0, m = Math.min(a.t,this.t);
940
+ while(i < m) {
941
+ c += this_array[i]+a_array[i];
942
+ r_array[i++] = c&BI_DM;
943
+ c >>= BI_DB;
944
+ }
945
+ if(a.t < this.t) {
946
+ c += a.s;
947
+ while(i < this.t) {
948
+ c += this_array[i];
949
+ r_array[i++] = c&BI_DM;
950
+ c >>= BI_DB;
951
+ }
952
+ c += this.s;
953
+ }
954
+ else {
955
+ c += this.s;
956
+ while(i < a.t) {
957
+ c += a_array[i];
958
+ r_array[i++] = c&BI_DM;
959
+ c >>= BI_DB;
960
+ }
961
+ c += a.s;
962
+ }
963
+ r.s = (c<0)?-1:0;
964
+ if(c > 0) r_array[i++] = c;
965
+ else if(c < -1) r_array[i++] = BI_DV+c;
966
+ r.t = i;
967
+ r.clamp();
968
+ }
969
+
970
+ // (public) this + a
971
+ function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }
972
+
973
+ // (public) this - a
974
+ function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }
975
+
976
+ // (public) this * a
977
+ function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }
978
+
979
+ // (public) this / a
980
+ function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }
981
+
982
+ // (public) this % a
983
+ function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }
984
+
985
+ // (public) [this/a,this%a]
986
+ function bnDivideAndRemainder(a) {
987
+ var q = nbi(), r = nbi();
988
+ this.divRemTo(a,q,r);
989
+ return new Array(q,r);
990
+ }
991
+
992
+ // (protected) this *= n, this >= 0, 1 < n < DV
993
+ function bnpDMultiply(n) {
994
+ var this_array = this.array;
995
+ this_array[this.t] = this.am(0,n-1,this,0,0,this.t);
996
+ ++this.t;
997
+ this.clamp();
998
+ }
999
+
1000
+ // (protected) this += n << w words, this >= 0
1001
+ function bnpDAddOffset(n,w) {
1002
+ var this_array = this.array;
1003
+ while(this.t <= w) this_array[this.t++] = 0;
1004
+ this_array[w] += n;
1005
+ while(this_array[w] >= BI_DV) {
1006
+ this_array[w] -= BI_DV;
1007
+ if(++w >= this.t) this_array[this.t++] = 0;
1008
+ ++this_array[w];
1009
+ }
1010
+ }
1011
+
1012
+ // A "null" reducer
1013
+ function NullExp() {}
1014
+ function nNop(x) { return x; }
1015
+ function nMulTo(x,y,r) { x.multiplyTo(y,r); }
1016
+ function nSqrTo(x,r) { x.squareTo(r); }
1017
+
1018
+ NullExp.prototype.convert = nNop;
1019
+ NullExp.prototype.revert = nNop;
1020
+ NullExp.prototype.mulTo = nMulTo;
1021
+ NullExp.prototype.sqrTo = nSqrTo;
1022
+
1023
+ // (public) this^e
1024
+ function bnPow(e) { return this.exp(e,new NullExp()); }
1025
+
1026
+ // (protected) r = lower n words of "this * a", a.t <= n
1027
+ // "this" should be the larger one if appropriate.
1028
+ function bnpMultiplyLowerTo(a,n,r) {
1029
+ var r_array = r.array;
1030
+ var a_array = a.array;
1031
+ var i = Math.min(this.t+a.t,n);
1032
+ r.s = 0; // assumes a,this >= 0
1033
+ r.t = i;
1034
+ while(i > 0) r_array[--i] = 0;
1035
+ var j;
1036
+ for(j = r.t-this.t; i < j; ++i) r_array[i+this.t] = this.am(0,a_array[i],r,i,0,this.t);
1037
+ for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a_array[i],r,i,0,n-i);
1038
+ r.clamp();
1039
+ }
1040
+
1041
+ // (protected) r = "this * a" without lower n words, n > 0
1042
+ // "this" should be the larger one if appropriate.
1043
+ function bnpMultiplyUpperTo(a,n,r) {
1044
+ var r_array = r.array;
1045
+ var a_array = a.array;
1046
+ --n;
1047
+ var i = r.t = this.t+a.t-n;
1048
+ r.s = 0; // assumes a,this >= 0
1049
+ while(--i >= 0) r_array[i] = 0;
1050
+ for(i = Math.max(n-this.t,0); i < a.t; ++i)
1051
+ r_array[this.t+i-n] = this.am(n-i,a_array[i],r,0,0,this.t+i-n);
1052
+ r.clamp();
1053
+ r.drShiftTo(1,r);
1054
+ }
1055
+
1056
+ // Barrett modular reduction
1057
+ function Barrett(m) {
1058
+ // setup Barrett
1059
+ this.r2 = nbi();
1060
+ this.q3 = nbi();
1061
+ BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
1062
+ this.mu = this.r2.divide(m);
1063
+ this.m = m;
1064
+ }
1065
+
1066
+ function barrettConvert(x) {
1067
+ if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
1068
+ else if(x.compareTo(this.m) < 0) return x;
1069
+ else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }
1070
+ }
1071
+
1072
+ function barrettRevert(x) { return x; }
1073
+
1074
+ // x = x mod m (HAC 14.42)
1075
+ function barrettReduce(x) {
1076
+ x.drShiftTo(this.m.t-1,this.r2);
1077
+ if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }
1078
+ this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);
1079
+ this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);
1080
+ while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);
1081
+ x.subTo(this.r2,x);
1082
+ while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
1083
+ }
1084
+
1085
+ // r = x^2 mod m; x != r
1086
+ function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
1087
+
1088
+ // r = x*y mod m; x,y != r
1089
+ function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
1090
+
1091
+ Barrett.prototype.convert = barrettConvert;
1092
+ Barrett.prototype.revert = barrettRevert;
1093
+ Barrett.prototype.reduce = barrettReduce;
1094
+ Barrett.prototype.mulTo = barrettMulTo;
1095
+ Barrett.prototype.sqrTo = barrettSqrTo;
1096
+
1097
+ // (public) this^e % m (HAC 14.85)
1098
+ function bnModPow(e,m) {
1099
+ var e_array = e.array;
1100
+ var i = e.bitLength(), k, r = nbv(1), z;
1101
+ if(i <= 0) return r;
1102
+ else if(i < 18) k = 1;
1103
+ else if(i < 48) k = 3;
1104
+ else if(i < 144) k = 4;
1105
+ else if(i < 768) k = 5;
1106
+ else k = 6;
1107
+ if(i < 8)
1108
+ z = new Classic(m);
1109
+ else if(m.isEven())
1110
+ z = new Barrett(m);
1111
+ else
1112
+ z = new Montgomery(m);
1113
+
1114
+ // precomputation
1115
+ var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;
1116
+ g[1] = z.convert(this);
1117
+ if(k > 1) {
1118
+ var g2 = nbi();
1119
+ z.sqrTo(g[1],g2);
1120
+ while(n <= km) {
1121
+ g[n] = nbi();
1122
+ z.mulTo(g2,g[n-2],g[n]);
1123
+ n += 2;
1124
+ }
1125
+ }
1126
+
1127
+ var j = e.t-1, w, is1 = true, r2 = nbi(), t;
1128
+ i = nbits(e_array[j])-1;
1129
+ while(j >= 0) {
1130
+ if(i >= k1) w = (e_array[j]>>(i-k1))&km;
1131
+ else {
1132
+ w = (e_array[j]&((1<<(i+1))-1))<<(k1-i);
1133
+ if(j > 0) w |= e_array[j-1]>>(BI_DB+i-k1);
1134
+ }
1135
+
1136
+ n = k;
1137
+ while((w&1) == 0) { w >>= 1; --n; }
1138
+ if((i -= n) < 0) { i += BI_DB; --j; }
1139
+ if(is1) { // ret == 1, don't bother squaring or multiplying it
1140
+ g[w].copyTo(r);
1141
+ is1 = false;
1142
+ }
1143
+ else {
1144
+ while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }
1145
+ if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }
1146
+ z.mulTo(r2,g[w],r);
1147
+ }
1148
+
1149
+ while(j >= 0 && (e_array[j]&(1<<i)) == 0) {
1150
+ z.sqrTo(r,r2); t = r; r = r2; r2 = t;
1151
+ if(--i < 0) { i = BI_DB-1; --j; }
1152
+ }
1153
+ }
1154
+ return z.revert(r);
1155
+ }
1156
+
1157
+ // (public) gcd(this,a) (HAC 14.54)
1158
+ function bnGCD(a) {
1159
+ var x = (this.s<0)?this.negate():this.clone();
1160
+ var y = (a.s<0)?a.negate():a.clone();
1161
+ if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }
1162
+ var i = x.getLowestSetBit(), g = y.getLowestSetBit();
1163
+ if(g < 0) return x;
1164
+ if(i < g) g = i;
1165
+ if(g > 0) {
1166
+ x.rShiftTo(g,x);
1167
+ y.rShiftTo(g,y);
1168
+ }
1169
+ while(x.signum() > 0) {
1170
+ if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);
1171
+ if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);
1172
+ if(x.compareTo(y) >= 0) {
1173
+ x.subTo(y,x);
1174
+ x.rShiftTo(1,x);
1175
+ }
1176
+ else {
1177
+ y.subTo(x,y);
1178
+ y.rShiftTo(1,y);
1179
+ }
1180
+ }
1181
+ if(g > 0) y.lShiftTo(g,y);
1182
+ return y;
1183
+ }
1184
+
1185
+ // (protected) this % n, n < 2^26
1186
+ function bnpModInt(n) {
1187
+ var this_array = this.array;
1188
+ if(n <= 0) return 0;
1189
+ var d = BI_DV%n, r = (this.s<0)?n-1:0;
1190
+ if(this.t > 0)
1191
+ if(d == 0) r = this_array[0]%n;
1192
+ else for(var i = this.t-1; i >= 0; --i) r = (d*r+this_array[i])%n;
1193
+ return r;
1194
+ }
1195
+
1196
+ // (public) 1/this % m (HAC 14.61)
1197
+ function bnModInverse(m) {
1198
+ var ac = m.isEven();
1199
+ if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
1200
+ var u = m.clone(), v = this.clone();
1201
+ var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
1202
+ while(u.signum() != 0) {
1203
+ while(u.isEven()) {
1204
+ u.rShiftTo(1,u);
1205
+ if(ac) {
1206
+ if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
1207
+ a.rShiftTo(1,a);
1208
+ }
1209
+ else if(!b.isEven()) b.subTo(m,b);
1210
+ b.rShiftTo(1,b);
1211
+ }
1212
+ while(v.isEven()) {
1213
+ v.rShiftTo(1,v);
1214
+ if(ac) {
1215
+ if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
1216
+ c.rShiftTo(1,c);
1217
+ }
1218
+ else if(!d.isEven()) d.subTo(m,d);
1219
+ d.rShiftTo(1,d);
1220
+ }
1221
+ if(u.compareTo(v) >= 0) {
1222
+ u.subTo(v,u);
1223
+ if(ac) a.subTo(c,a);
1224
+ b.subTo(d,b);
1225
+ }
1226
+ else {
1227
+ v.subTo(u,v);
1228
+ if(ac) c.subTo(a,c);
1229
+ d.subTo(b,d);
1230
+ }
1231
+ }
1232
+ if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
1233
+ if(d.compareTo(m) >= 0) return d.subtract(m);
1234
+ if(d.signum() < 0) d.addTo(m,d); else return d;
1235
+ if(d.signum() < 0) return d.add(m); else return d;
1236
+ }
1237
+
1238
+ var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509];
1239
+ var lplim = (1<<26)/lowprimes[lowprimes.length-1];
1240
+
1241
+ // (public) test primality with certainty >= 1-.5^t
1242
+ function bnIsProbablePrime(t) {
1243
+ var i, x = this.abs();
1244
+ var x_array = x.array;
1245
+ if(x.t == 1 && x_array[0] <= lowprimes[lowprimes.length-1]) {
1246
+ for(i = 0; i < lowprimes.length; ++i)
1247
+ if(x_array[0] == lowprimes[i]) return true;
1248
+ return false;
1249
+ }
1250
+ if(x.isEven()) return false;
1251
+ i = 1;
1252
+ while(i < lowprimes.length) {
1253
+ var m = lowprimes[i], j = i+1;
1254
+ while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];
1255
+ m = x.modInt(m);
1256
+ while(i < j) if(m%lowprimes[i++] == 0) return false;
1257
+ }
1258
+ return x.millerRabin(t);
1259
+ }
1260
+
1261
+ // (protected) true if probably prime (HAC 4.24, Miller-Rabin)
1262
+ function bnpMillerRabin(t) {
1263
+ var n1 = this.subtract(BigInteger.ONE);
1264
+ var k = n1.getLowestSetBit();
1265
+ if(k <= 0) return false;
1266
+ var r = n1.shiftRight(k);
1267
+ t = (t+1)>>1;
1268
+ if(t > lowprimes.length) t = lowprimes.length;
1269
+ var a = nbi();
1270
+ for(var i = 0; i < t; ++i) {
1271
+ a.fromInt(lowprimes[i]);
1272
+ var y = a.modPow(r,this);
1273
+ if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
1274
+ var j = 1;
1275
+ while(j++ < k && y.compareTo(n1) != 0) {
1276
+ y = y.modPowInt(2,this);
1277
+ if(y.compareTo(BigInteger.ONE) == 0) return false;
1278
+ }
1279
+ if(y.compareTo(n1) != 0) return false;
1280
+ }
1281
+ }
1282
+ return true;
1283
+ }
1284
+
1285
+ // protected
1286
+ BigInteger.prototype.chunkSize = bnpChunkSize;
1287
+ BigInteger.prototype.toRadix = bnpToRadix;
1288
+ BigInteger.prototype.fromRadix = bnpFromRadix;
1289
+ BigInteger.prototype.fromNumber = bnpFromNumber;
1290
+ BigInteger.prototype.bitwiseTo = bnpBitwiseTo;
1291
+ BigInteger.prototype.changeBit = bnpChangeBit;
1292
+ BigInteger.prototype.addTo = bnpAddTo;
1293
+ BigInteger.prototype.dMultiply = bnpDMultiply;
1294
+ BigInteger.prototype.dAddOffset = bnpDAddOffset;
1295
+ BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;
1296
+ BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;
1297
+ BigInteger.prototype.modInt = bnpModInt;
1298
+ BigInteger.prototype.millerRabin = bnpMillerRabin;
1299
+
1300
+ // public
1301
+ BigInteger.prototype.clone = bnClone;
1302
+ BigInteger.prototype.intValue = bnIntValue;
1303
+ BigInteger.prototype.byteValue = bnByteValue;
1304
+ BigInteger.prototype.shortValue = bnShortValue;
1305
+ BigInteger.prototype.signum = bnSigNum;
1306
+ BigInteger.prototype.toByteArray = bnToByteArray;
1307
+ BigInteger.prototype.equals = bnEquals;
1308
+ BigInteger.prototype.min = bnMin;
1309
+ BigInteger.prototype.max = bnMax;
1310
+ BigInteger.prototype.and = bnAnd;
1311
+ BigInteger.prototype.or = bnOr;
1312
+ BigInteger.prototype.xor = bnXor;
1313
+ BigInteger.prototype.andNot = bnAndNot;
1314
+ BigInteger.prototype.not = bnNot;
1315
+ BigInteger.prototype.shiftLeft = bnShiftLeft;
1316
+ BigInteger.prototype.shiftRight = bnShiftRight;
1317
+ BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;
1318
+ BigInteger.prototype.bitCount = bnBitCount;
1319
+ BigInteger.prototype.testBit = bnTestBit;
1320
+ BigInteger.prototype.setBit = bnSetBit;
1321
+ BigInteger.prototype.clearBit = bnClearBit;
1322
+ BigInteger.prototype.flipBit = bnFlipBit;
1323
+ BigInteger.prototype.add = bnAdd;
1324
+ BigInteger.prototype.subtract = bnSubtract;
1325
+ BigInteger.prototype.multiply = bnMultiply;
1326
+ BigInteger.prototype.divide = bnDivide;
1327
+ BigInteger.prototype.remainder = bnRemainder;
1328
+ BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;
1329
+ BigInteger.prototype.modPow = bnModPow;
1330
+ BigInteger.prototype.modInverse = bnModInverse;
1331
+ BigInteger.prototype.pow = bnPow;
1332
+ BigInteger.prototype.gcd = bnGCD;
1333
+ BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
1334
+
1335
+ // BigInteger interfaces not implemented in jsbn:
1336
+
1337
+ // BigInteger(int signum, byte[] magnitude)
1338
+ // double doubleValue()
1339
+ // float floatValue()
1340
+ // int hashCode()
1341
+ // long longValue()
1342
+ // static BigInteger valueOf(long val)
1343
+ // prng4.js - uses Arcfour as a PRNG
1344
+
1345
+ function Arcfour() {
1346
+ this.i = 0;
1347
+ this.j = 0;
1348
+ this.S = new Array();
1349
+ }
1350
+
1351
+ // Initialize arcfour context from key, an array of ints, each from [0..255]
1352
+ function ARC4init(key) {
1353
+ var i, j, t;
1354
+ for(i = 0; i < 256; ++i)
1355
+ this.S[i] = i;
1356
+ j = 0;
1357
+ for(i = 0; i < 256; ++i) {
1358
+ j = (j + this.S[i] + key[i % key.length]) & 255;
1359
+ t = this.S[i];
1360
+ this.S[i] = this.S[j];
1361
+ this.S[j] = t;
1362
+ }
1363
+ this.i = 0;
1364
+ this.j = 0;
1365
+ }
1366
+
1367
+ function ARC4next() {
1368
+ var t;
1369
+ this.i = (this.i + 1) & 255;
1370
+ this.j = (this.j + this.S[this.i]) & 255;
1371
+ t = this.S[this.i];
1372
+ this.S[this.i] = this.S[this.j];
1373
+ this.S[this.j] = t;
1374
+ return this.S[(t + this.S[this.i]) & 255];
1375
+ }
1376
+
1377
+ Arcfour.prototype.init = ARC4init;
1378
+ Arcfour.prototype.next = ARC4next;
1379
+
1380
+ // Plug in your RNG constructor here
1381
+ function prng_newstate() {
1382
+ return new Arcfour();
1383
+ }
1384
+
1385
+ // Pool size must be a multiple of 4 and greater than 32.
1386
+ // An array of bytes the size of the pool will be passed to init()
1387
+ var rng_psize = 256;
1388
+ // Random number generator - requires a PRNG backend, e.g. prng4.js
1389
+
1390
+ // For best results, put code like
1391
+ // <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>
1392
+ // in your main HTML document.
1393
+
1394
+ var rng_state;
1395
+ var rng_pool;
1396
+ var rng_pptr;
1397
+
1398
+ // Mix in a 32-bit integer into the pool
1399
+ function rng_seed_int(x) {
1400
+ rng_pool[rng_pptr++] ^= x & 255;
1401
+ rng_pool[rng_pptr++] ^= (x >> 8) & 255;
1402
+ rng_pool[rng_pptr++] ^= (x >> 16) & 255;
1403
+ rng_pool[rng_pptr++] ^= (x >> 24) & 255;
1404
+ if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;
1405
+ }
1406
+
1407
+ // Mix in the current time (w/milliseconds) into the pool
1408
+ function rng_seed_time() {
1409
+ // Use pre-computed date to avoid making the benchmark
1410
+ // results dependent on the current date.
1411
+ rng_seed_int(1122926989487);
1412
+ }
1413
+
1414
+ // Initialize the pool with junk if needed.
1415
+ if(rng_pool == null) {
1416
+ rng_pool = new Array();
1417
+ rng_pptr = 0;
1418
+ var t;
1419
+ while(rng_pptr < rng_psize) { // extract some randomness from Math.random()
1420
+ t = Math.floor(65536 * Math.random());
1421
+ rng_pool[rng_pptr++] = t >>> 8;
1422
+ rng_pool[rng_pptr++] = t & 255;
1423
+ }
1424
+ rng_pptr = 0;
1425
+ rng_seed_time();
1426
+ //rng_seed_int(window.screenX);
1427
+ //rng_seed_int(window.screenY);
1428
+ }
1429
+
1430
+ function rng_get_byte() {
1431
+ if(rng_state == null) {
1432
+ rng_seed_time();
1433
+ rng_state = prng_newstate();
1434
+ rng_state.init(rng_pool);
1435
+ for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
1436
+ rng_pool[rng_pptr] = 0;
1437
+ rng_pptr = 0;
1438
+ //rng_pool = null;
1439
+ }
1440
+ // TODO: allow reseeding after first request
1441
+ return rng_state.next();
1442
+ }
1443
+
1444
+ function rng_get_bytes(ba) {
1445
+ var i;
1446
+ for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
1447
+ }
1448
+
1449
+ function SecureRandom() {}
1450
+
1451
+ SecureRandom.prototype.nextBytes = rng_get_bytes;
1452
+ // Depends on jsbn.js and rng.js
1453
+
1454
+ // convert a (hex) string to a bignum object
1455
+ function parseBigInt(str,r) {
1456
+ return new BigInteger(str,r);
1457
+ }
1458
+
1459
+ function linebrk(s,n) {
1460
+ var ret = "";
1461
+ var i = 0;
1462
+ while(i + n < s.length) {
1463
+ ret += s.substring(i,i+n) + "\n";
1464
+ i += n;
1465
+ }
1466
+ return ret + s.substring(i,s.length);
1467
+ }
1468
+
1469
+ function byte2Hex(b) {
1470
+ if(b < 0x10)
1471
+ return "0" + b.toString(16);
1472
+ else
1473
+ return b.toString(16);
1474
+ }
1475
+
1476
+ // PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint
1477
+ function pkcs1pad2(s,n) {
1478
+ if(n < s.length + 11) {
1479
+ alert("Message too long for RSA");
1480
+ return null;
1481
+ }
1482
+ var ba = new Array();
1483
+ var i = s.length - 1;
1484
+ while(i >= 0 && n > 0) ba[--n] = s.charCodeAt(i--);
1485
+ ba[--n] = 0;
1486
+ var rng = new SecureRandom();
1487
+ var x = new Array();
1488
+ while(n > 2) { // random non-zero pad
1489
+ x[0] = 0;
1490
+ while(x[0] == 0) rng.nextBytes(x);
1491
+ ba[--n] = x[0];
1492
+ }
1493
+ ba[--n] = 2;
1494
+ ba[--n] = 0;
1495
+ return new BigInteger(ba);
1496
+ }
1497
+
1498
+ // "empty" RSA key constructor
1499
+ function RSAKey() {
1500
+ this.n = null;
1501
+ this.e = 0;
1502
+ this.d = null;
1503
+ this.p = null;
1504
+ this.q = null;
1505
+ this.dmp1 = null;
1506
+ this.dmq1 = null;
1507
+ this.coeff = null;
1508
+ }
1509
+
1510
+ // Set the public key fields N and e from hex strings
1511
+ function RSASetPublic(N,E) {
1512
+ if(N != null && E != null && N.length > 0 && E.length > 0) {
1513
+ this.n = parseBigInt(N,16);
1514
+ this.e = parseInt(E,16);
1515
+ }
1516
+ else
1517
+ alert("Invalid RSA public key");
1518
+ }
1519
+
1520
+ // Perform raw public operation on "x": return x^e (mod n)
1521
+ function RSADoPublic(x) {
1522
+ return x.modPowInt(this.e, this.n);
1523
+ }
1524
+
1525
+ // Return the PKCS#1 RSA encryption of "text" as an even-length hex string
1526
+ function RSAEncrypt(text) {
1527
+ var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3);
1528
+ if(m == null) return null;
1529
+ var c = this.doPublic(m);
1530
+ if(c == null) return null;
1531
+ var h = c.toString(16);
1532
+ if((h.length & 1) == 0) return h; else return "0" + h;
1533
+ }
1534
+
1535
+ // Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string
1536
+ //function RSAEncryptB64(text) {
1537
+ // var h = this.encrypt(text);
1538
+ // if(h) return hex2b64(h); else return null;
1539
+ //}
1540
+
1541
+ // protected
1542
+ RSAKey.prototype.doPublic = RSADoPublic;
1543
+
1544
+ // public
1545
+ RSAKey.prototype.setPublic = RSASetPublic;
1546
+ RSAKey.prototype.encrypt = RSAEncrypt;
1547
+ //RSAKey.prototype.encrypt_b64 = RSAEncryptB64;
1548
+ // Depends on rsa.js and jsbn2.js
1549
+
1550
+ // Undo PKCS#1 (type 2, random) padding and, if valid, return the plaintext
1551
+ function pkcs1unpad2(d,n) {
1552
+ var b = d.toByteArray();
1553
+ var i = 0;
1554
+ while(i < b.length && b[i] == 0) ++i;
1555
+ if(b.length-i != n-1 || b[i] != 2)
1556
+ return null;
1557
+ ++i;
1558
+ while(b[i] != 0)
1559
+ if(++i >= b.length) return null;
1560
+ var ret = "";
1561
+ while(++i < b.length)
1562
+ ret += String.fromCharCode(b[i]);
1563
+ return ret;
1564
+ }
1565
+
1566
+ // Set the private key fields N, e, and d from hex strings
1567
+ function RSASetPrivate(N,E,D) {
1568
+ if(N != null && E != null && N.length > 0 && E.length > 0) {
1569
+ this.n = parseBigInt(N,16);
1570
+ this.e = parseInt(E,16);
1571
+ this.d = parseBigInt(D,16);
1572
+ }
1573
+ else
1574
+ alert("Invalid RSA private key");
1575
+ }
1576
+
1577
+ // Set the private key fields N, e, d and CRT params from hex strings
1578
+ function RSASetPrivateEx(N,E,D,P,Q,DP,DQ,C) {
1579
+ if(N != null && E != null && N.length > 0 && E.length > 0) {
1580
+ this.n = parseBigInt(N,16);
1581
+ this.e = parseInt(E,16);
1582
+ this.d = parseBigInt(D,16);
1583
+ this.p = parseBigInt(P,16);
1584
+ this.q = parseBigInt(Q,16);
1585
+ this.dmp1 = parseBigInt(DP,16);
1586
+ this.dmq1 = parseBigInt(DQ,16);
1587
+ this.coeff = parseBigInt(C,16);
1588
+ }
1589
+ else
1590
+ alert("Invalid RSA private key");
1591
+ }
1592
+
1593
+ // Generate a new random private key B bits long, using public expt E
1594
+ function RSAGenerate(B,E) {
1595
+ var rng = new SecureRandom();
1596
+ var qs = B>>1;
1597
+ this.e = parseInt(E,16);
1598
+ var ee = new BigInteger(E,16);
1599
+ for(;;) {
1600
+ for(;;) {
1601
+ this.p = new BigInteger(B-qs,1,rng);
1602
+ if(this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.p.isProbablePrime(10)) break;
1603
+ }
1604
+ for(;;) {
1605
+ this.q = new BigInteger(qs,1,rng);
1606
+ if(this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.q.isProbablePrime(10)) break;
1607
+ }
1608
+ if(this.p.compareTo(this.q) <= 0) {
1609
+ var t = this.p;
1610
+ this.p = this.q;
1611
+ this.q = t;
1612
+ }
1613
+ var p1 = this.p.subtract(BigInteger.ONE);
1614
+ var q1 = this.q.subtract(BigInteger.ONE);
1615
+ var phi = p1.multiply(q1);
1616
+ if(phi.gcd(ee).compareTo(BigInteger.ONE) == 0) {
1617
+ this.n = this.p.multiply(this.q);
1618
+ this.d = ee.modInverse(phi);
1619
+ this.dmp1 = this.d.mod(p1);
1620
+ this.dmq1 = this.d.mod(q1);
1621
+ this.coeff = this.q.modInverse(this.p);
1622
+ break;
1623
+ }
1624
+ }
1625
+ }
1626
+
1627
+ // Perform raw private operation on "x": return x^d (mod n)
1628
+ function RSADoPrivate(x) {
1629
+ if(this.p == null || this.q == null)
1630
+ return x.modPow(this.d, this.n);
1631
+
1632
+ // TODO: re-calculate any missing CRT params
1633
+ var xp = x.mod(this.p).modPow(this.dmp1, this.p);
1634
+ var xq = x.mod(this.q).modPow(this.dmq1, this.q);
1635
+
1636
+ while(xp.compareTo(xq) < 0)
1637
+ xp = xp.add(this.p);
1638
+ return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);
1639
+ }
1640
+
1641
+ // Return the PKCS#1 RSA decryption of "ctext".
1642
+ // "ctext" is an even-length hex string and the output is a plain string.
1643
+ function RSADecrypt(ctext) {
1644
+ var c = parseBigInt(ctext, 16);
1645
+ var m = this.doPrivate(c);
1646
+ if(m == null) return null;
1647
+ return pkcs1unpad2(m, (this.n.bitLength()+7)>>3);
1648
+ }
1649
+
1650
+ // Return the PKCS#1 RSA decryption of "ctext".
1651
+ // "ctext" is a Base64-encoded string and the output is a plain string.
1652
+ //function RSAB64Decrypt(ctext) {
1653
+ // var h = b64tohex(ctext);
1654
+ // if(h) return this.decrypt(h); else return null;
1655
+ //}
1656
+
1657
+ // protected
1658
+ RSAKey.prototype.doPrivate = RSADoPrivate;
1659
+
1660
+ // public
1661
+ RSAKey.prototype.setPrivate = RSASetPrivate;
1662
+ RSAKey.prototype.setPrivateEx = RSASetPrivateEx;
1663
+ RSAKey.prototype.generate = RSAGenerate;
1664
+ RSAKey.prototype.decrypt = RSADecrypt;
1665
+ //RSAKey.prototype.b64_decrypt = RSAB64Decrypt;
1666
+
1667
+
1668
+ nValue="a5261939975948bb7a58dffe5ff54e65f0498f9175f5a09288810b8975871e99af3b5dd94057b0fc07535f5f97444504fa35169d461d0d30cf0192e307727c065168c788771c561a9400fb49175e9e6aa4e23fe11af69e9412dd23b0cb6684c4c2429bce139e848ab26d0829073351f4acd36074eafd036a5eb83359d2a698d3";
1669
+ eValue="10001";
1670
+ dValue="8e9912f6d3645894e8d38cb58c0db81ff516cf4c7e5a14c7f1eddb1459d2cded4d8d293fc97aee6aefb861859c8b6a3d1dfe710463e1f9ddc72048c09751971c4a580aa51eb523357a3cc48d31cfad1d4a165066ed92d4748fb6571211da5cb14bc11b6e2df7c1a559e6d5ac1cd5c94703a22891464fba23d0d965086277a161";
1671
+ pValue="d090ce58a92c75233a6486cb0a9209bf3583b64f540c76f5294bb97d285eed33aec220bde14b2417951178ac152ceab6da7090905b478195498b352048f15e7d";
1672
+ qValue="cab575dc652bb66df15a0359609d51d1db184750c00c6698b90ef3465c99655103edbf0d54c56aec0ce3c4d22592338092a126a0cc49f65a4a30d222b411e58f";
1673
+ dmp1Value="1a24bca8e273df2f0e47c199bbf678604e7df7215480c77c8db39f49b000ce2cf7500038acfff5433b7d582a01f1826e6f4d42e1c57f5e1fef7b12aabc59fd25";
1674
+ dmq1Value="3d06982efbbe47339e1f6d36b1216b8a741d410b0c662f54f7118b27b9a4ec9d914337eb39841d8666f3034408cf94f5b62f11c402fc994fe15a05493150d9fd";
1675
+ coeffValue="3a3e731acd8960b7ff9eb81a7ff93bd1cfa74cbd56987db58b4594fb09c09084db1734c8143f98b602b981aaa9243ca28deb69b5b280ee8dcee0fd2625e53250";
1676
+
1677
+ setupEngine(am3, 28);
1678
+
1679
+ var TEXT = "The quick brown fox jumped over the extremely lazy frog! " +
1680
+ "Now is the time for all good men to come to the party.";
1681
+ var encrypted;
1682
+
1683
+ function encrypt() {
1684
+ var RSA = new RSAKey();
1685
+ RSA.setPublic(nValue, eValue);
1686
+ RSA.setPrivateEx(nValue, eValue, dValue, pValue, qValue, dmp1Value, dmq1Value, coeffValue);
1687
+ encrypted = RSA.encrypt(TEXT);
1688
+ }
1689
+
1690
+ function decrypt() {
1691
+ var RSA = new RSAKey();
1692
+ RSA.setPublic(nValue, eValue);
1693
+ RSA.setPrivateEx(nValue, eValue, dValue, pValue, qValue, dmp1Value, dmq1Value, coeffValue);
1694
+ var decrypted = RSA.decrypt(encrypted);
1695
+ if (decrypted != TEXT) {
1696
+ throw new Error("Crypto operation failed");
1697
+ }
1698
+ }