therubyracer 0.5.0-x86-linux → 0.11.0beta5-x86-linux

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 (721) hide show
  1. data/.gitignore +23 -11
  2. data/.travis.yml +10 -0
  3. data/Changelog.md +242 -0
  4. data/Gemfile +16 -0
  5. data/README.md +185 -0
  6. data/Rakefile +42 -51
  7. data/benchmarks.rb +217 -0
  8. data/ext/v8/accessor.cc +181 -0
  9. data/ext/v8/array.cc +26 -0
  10. data/ext/v8/backref.cc +56 -0
  11. data/ext/v8/build.rb +52 -0
  12. data/ext/v8/constants.cc +34 -0
  13. data/ext/v8/constraints.cc +52 -0
  14. data/ext/v8/context.cc +130 -0
  15. data/ext/v8/date.cc +18 -0
  16. data/ext/v8/exception.cc +38 -0
  17. data/ext/v8/extconf.rb +16 -29
  18. data/ext/v8/external.cc +43 -0
  19. data/ext/v8/function.cc +58 -0
  20. data/ext/v8/gc.cc +43 -0
  21. data/ext/v8/handles.cc +34 -0
  22. data/ext/v8/heap.cc +31 -0
  23. data/ext/v8/init.cc +39 -0
  24. data/ext/v8/init.so +0 -0
  25. data/ext/v8/invocation.cc +86 -0
  26. data/ext/v8/locker.cc +77 -0
  27. data/ext/v8/message.cc +51 -0
  28. data/ext/v8/object.cc +334 -0
  29. data/ext/v8/primitive.cc +8 -0
  30. data/ext/v8/rr.cc +83 -0
  31. data/ext/v8/rr.h +883 -0
  32. data/ext/v8/script.cc +80 -0
  33. data/ext/v8/signature.cc +18 -0
  34. data/ext/v8/stack.cc +75 -0
  35. data/ext/v8/string.cc +47 -0
  36. data/ext/v8/template.cc +175 -0
  37. data/ext/v8/trycatch.cc +86 -0
  38. data/ext/v8/v8.cc +87 -0
  39. data/ext/v8/value.cc +239 -0
  40. data/lib/v8.rb +30 -9
  41. data/lib/v8/access.rb +5 -0
  42. data/lib/v8/access/indices.rb +40 -0
  43. data/lib/v8/access/invocation.rb +47 -0
  44. data/lib/v8/access/names.rb +65 -0
  45. data/lib/v8/array.rb +26 -0
  46. data/lib/v8/context.rb +217 -75
  47. data/lib/v8/conversion.rb +35 -0
  48. data/lib/v8/conversion/array.rb +11 -0
  49. data/lib/v8/conversion/class.rb +120 -0
  50. data/lib/v8/conversion/code.rb +38 -0
  51. data/lib/v8/conversion/fundamental.rb +11 -0
  52. data/lib/v8/conversion/hash.rb +11 -0
  53. data/lib/v8/conversion/indentity.rb +31 -0
  54. data/lib/v8/conversion/method.rb +26 -0
  55. data/lib/v8/conversion/object.rb +28 -0
  56. data/lib/v8/conversion/primitive.rb +7 -0
  57. data/lib/v8/conversion/proc.rb +5 -0
  58. data/lib/v8/conversion/reference.rb +16 -0
  59. data/lib/v8/conversion/string.rb +12 -0
  60. data/lib/v8/conversion/symbol.rb +7 -0
  61. data/lib/v8/conversion/time.rb +13 -0
  62. data/lib/v8/error.rb +25 -0
  63. data/lib/v8/error/protect.rb +20 -0
  64. data/lib/v8/error/try.rb +15 -0
  65. data/lib/v8/function.rb +28 -0
  66. data/lib/v8/object.rb +69 -28
  67. data/lib/v8/util/weakcell.rb +29 -0
  68. data/lib/v8/version.rb +3 -0
  69. data/spec/c/array_spec.rb +17 -0
  70. data/spec/c/constants_spec.rb +20 -0
  71. data/spec/c/exception_spec.rb +26 -0
  72. data/spec/c/external_spec.rb +9 -0
  73. data/spec/c/function_spec.rb +46 -0
  74. data/spec/c/handles_spec.rb +35 -0
  75. data/spec/c/locker_spec.rb +38 -0
  76. data/spec/c/object_spec.rb +46 -0
  77. data/spec/c/script_spec.rb +28 -0
  78. data/spec/c/string_spec.rb +16 -0
  79. data/spec/c/template_spec.rb +30 -0
  80. data/spec/c/trycatch_spec.rb +51 -0
  81. data/spec/mem/blunt_spec.rb +42 -0
  82. data/spec/redjs_spec.rb +10 -0
  83. data/spec/spec_helper.rb +43 -12
  84. data/spec/threading_spec.rb +52 -0
  85. data/spec/v8/context_spec.rb +19 -0
  86. data/spec/v8/conversion_spec.rb +9 -0
  87. data/spec/v8/error_spec.rb +21 -0
  88. data/spec/v8/function_spec.rb +9 -0
  89. data/spec/v8/object_spec.rb +15 -0
  90. data/thefrontside.png +0 -0
  91. data/therubyracer.gemspec +15 -676
  92. metadata +146 -680
  93. data/.gitmodules +0 -3
  94. data/Doxyfile +0 -1514
  95. data/History.txt +0 -51
  96. data/README.rdoc +0 -158
  97. data/docs/data_conversion.txt +0 -18
  98. data/ext/v8/callbacks.cpp +0 -160
  99. data/ext/v8/callbacks.h +0 -14
  100. data/ext/v8/convert_ruby.cpp +0 -8
  101. data/ext/v8/convert_ruby.h +0 -99
  102. data/ext/v8/convert_string.cpp +0 -10
  103. data/ext/v8/convert_string.h +0 -73
  104. data/ext/v8/convert_v8.cpp +0 -9
  105. data/ext/v8/convert_v8.h +0 -121
  106. data/ext/v8/converters.cpp +0 -83
  107. data/ext/v8/converters.h +0 -23
  108. data/ext/v8/upstream/2.0.6/.gitignore +0 -26
  109. data/ext/v8/upstream/2.0.6/AUTHORS +0 -23
  110. data/ext/v8/upstream/2.0.6/ChangeLog +0 -1479
  111. data/ext/v8/upstream/2.0.6/LICENSE +0 -55
  112. data/ext/v8/upstream/2.0.6/SConstruct +0 -1028
  113. data/ext/v8/upstream/2.0.6/include/v8-debug.h +0 -275
  114. data/ext/v8/upstream/2.0.6/include/v8.h +0 -3236
  115. data/ext/v8/upstream/2.0.6/src/SConscript +0 -283
  116. data/ext/v8/upstream/2.0.6/src/accessors.cc +0 -695
  117. data/ext/v8/upstream/2.0.6/src/accessors.h +0 -114
  118. data/ext/v8/upstream/2.0.6/src/allocation.cc +0 -198
  119. data/ext/v8/upstream/2.0.6/src/allocation.h +0 -169
  120. data/ext/v8/upstream/2.0.6/src/api.cc +0 -3831
  121. data/ext/v8/upstream/2.0.6/src/api.h +0 -479
  122. data/ext/v8/upstream/2.0.6/src/apinatives.js +0 -110
  123. data/ext/v8/upstream/2.0.6/src/apiutils.h +0 -69
  124. data/ext/v8/upstream/2.0.6/src/arguments.h +0 -97
  125. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm-inl.h +0 -277
  126. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.cc +0 -1821
  127. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.h +0 -1027
  128. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2-inl.h +0 -267
  129. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.cc +0 -1821
  130. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.h +0 -1027
  131. data/ext/v8/upstream/2.0.6/src/arm/builtins-arm.cc +0 -1271
  132. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm-inl.h +0 -74
  133. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.cc +0 -6682
  134. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.h +0 -535
  135. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.cc +0 -112
  136. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.h +0 -347
  137. data/ext/v8/upstream/2.0.6/src/arm/cpu-arm.cc +0 -132
  138. data/ext/v8/upstream/2.0.6/src/arm/debug-arm.cc +0 -213
  139. data/ext/v8/upstream/2.0.6/src/arm/disasm-arm.cc +0 -1166
  140. data/ext/v8/upstream/2.0.6/src/arm/fast-codegen-arm.cc +0 -1698
  141. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.cc +0 -123
  142. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.h +0 -162
  143. data/ext/v8/upstream/2.0.6/src/arm/ic-arm.cc +0 -849
  144. data/ext/v8/upstream/2.0.6/src/arm/jump-target-arm.cc +0 -238
  145. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.cc +0 -1259
  146. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.h +0 -423
  147. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.cc +0 -1266
  148. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.h +0 -282
  149. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm-inl.h +0 -103
  150. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.cc +0 -59
  151. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.h +0 -43
  152. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.cc +0 -2264
  153. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.h +0 -306
  154. data/ext/v8/upstream/2.0.6/src/arm/stub-cache-arm.cc +0 -1516
  155. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.cc +0 -412
  156. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.h +0 -532
  157. data/ext/v8/upstream/2.0.6/src/array.js +0 -1154
  158. data/ext/v8/upstream/2.0.6/src/assembler.cc +0 -772
  159. data/ext/v8/upstream/2.0.6/src/assembler.h +0 -525
  160. data/ext/v8/upstream/2.0.6/src/ast.cc +0 -512
  161. data/ext/v8/upstream/2.0.6/src/ast.h +0 -1820
  162. data/ext/v8/upstream/2.0.6/src/bootstrapper.cc +0 -1680
  163. data/ext/v8/upstream/2.0.6/src/bootstrapper.h +0 -103
  164. data/ext/v8/upstream/2.0.6/src/builtins.cc +0 -851
  165. data/ext/v8/upstream/2.0.6/src/builtins.h +0 -245
  166. data/ext/v8/upstream/2.0.6/src/bytecodes-irregexp.h +0 -104
  167. data/ext/v8/upstream/2.0.6/src/char-predicates-inl.h +0 -86
  168. data/ext/v8/upstream/2.0.6/src/char-predicates.h +0 -65
  169. data/ext/v8/upstream/2.0.6/src/checks.cc +0 -100
  170. data/ext/v8/upstream/2.0.6/src/checks.h +0 -284
  171. data/ext/v8/upstream/2.0.6/src/code-stubs.cc +0 -164
  172. data/ext/v8/upstream/2.0.6/src/code-stubs.h +0 -164
  173. data/ext/v8/upstream/2.0.6/src/code.h +0 -68
  174. data/ext/v8/upstream/2.0.6/src/codegen-inl.h +0 -88
  175. data/ext/v8/upstream/2.0.6/src/codegen.cc +0 -504
  176. data/ext/v8/upstream/2.0.6/src/codegen.h +0 -522
  177. data/ext/v8/upstream/2.0.6/src/compilation-cache.cc +0 -490
  178. data/ext/v8/upstream/2.0.6/src/compilation-cache.h +0 -98
  179. data/ext/v8/upstream/2.0.6/src/compiler.cc +0 -1132
  180. data/ext/v8/upstream/2.0.6/src/compiler.h +0 -107
  181. data/ext/v8/upstream/2.0.6/src/contexts.cc +0 -256
  182. data/ext/v8/upstream/2.0.6/src/contexts.h +0 -345
  183. data/ext/v8/upstream/2.0.6/src/conversions-inl.h +0 -95
  184. data/ext/v8/upstream/2.0.6/src/conversions.cc +0 -709
  185. data/ext/v8/upstream/2.0.6/src/conversions.h +0 -118
  186. data/ext/v8/upstream/2.0.6/src/counters.cc +0 -78
  187. data/ext/v8/upstream/2.0.6/src/counters.h +0 -239
  188. data/ext/v8/upstream/2.0.6/src/cpu.h +0 -65
  189. data/ext/v8/upstream/2.0.6/src/d8-debug.cc +0 -345
  190. data/ext/v8/upstream/2.0.6/src/d8-debug.h +0 -155
  191. data/ext/v8/upstream/2.0.6/src/d8-posix.cc +0 -675
  192. data/ext/v8/upstream/2.0.6/src/d8-readline.cc +0 -128
  193. data/ext/v8/upstream/2.0.6/src/d8-windows.cc +0 -42
  194. data/ext/v8/upstream/2.0.6/src/d8.cc +0 -776
  195. data/ext/v8/upstream/2.0.6/src/d8.h +0 -225
  196. data/ext/v8/upstream/2.0.6/src/d8.js +0 -1625
  197. data/ext/v8/upstream/2.0.6/src/date-delay.js +0 -1138
  198. data/ext/v8/upstream/2.0.6/src/dateparser-inl.h +0 -114
  199. data/ext/v8/upstream/2.0.6/src/dateparser.cc +0 -186
  200. data/ext/v8/upstream/2.0.6/src/dateparser.h +0 -240
  201. data/ext/v8/upstream/2.0.6/src/debug-agent.cc +0 -425
  202. data/ext/v8/upstream/2.0.6/src/debug-agent.h +0 -129
  203. data/ext/v8/upstream/2.0.6/src/debug-delay.js +0 -2073
  204. data/ext/v8/upstream/2.0.6/src/debug.cc +0 -2751
  205. data/ext/v8/upstream/2.0.6/src/debug.h +0 -866
  206. data/ext/v8/upstream/2.0.6/src/disasm.h +0 -77
  207. data/ext/v8/upstream/2.0.6/src/disassembler.cc +0 -318
  208. data/ext/v8/upstream/2.0.6/src/disassembler.h +0 -56
  209. data/ext/v8/upstream/2.0.6/src/dtoa-config.c +0 -91
  210. data/ext/v8/upstream/2.0.6/src/execution.cc +0 -701
  211. data/ext/v8/upstream/2.0.6/src/execution.h +0 -312
  212. data/ext/v8/upstream/2.0.6/src/factory.cc +0 -957
  213. data/ext/v8/upstream/2.0.6/src/factory.h +0 -393
  214. data/ext/v8/upstream/2.0.6/src/fast-codegen.cc +0 -725
  215. data/ext/v8/upstream/2.0.6/src/fast-codegen.h +0 -371
  216. data/ext/v8/upstream/2.0.6/src/flag-definitions.h +0 -426
  217. data/ext/v8/upstream/2.0.6/src/flags.cc +0 -555
  218. data/ext/v8/upstream/2.0.6/src/flags.h +0 -81
  219. data/ext/v8/upstream/2.0.6/src/frame-element.cc +0 -45
  220. data/ext/v8/upstream/2.0.6/src/frame-element.h +0 -235
  221. data/ext/v8/upstream/2.0.6/src/frames-inl.h +0 -215
  222. data/ext/v8/upstream/2.0.6/src/frames.cc +0 -749
  223. data/ext/v8/upstream/2.0.6/src/frames.h +0 -659
  224. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.cc +0 -76
  225. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.h +0 -135
  226. data/ext/v8/upstream/2.0.6/src/global-handles.cc +0 -516
  227. data/ext/v8/upstream/2.0.6/src/global-handles.h +0 -180
  228. data/ext/v8/upstream/2.0.6/src/globals.h +0 -608
  229. data/ext/v8/upstream/2.0.6/src/handles-inl.h +0 -76
  230. data/ext/v8/upstream/2.0.6/src/handles.cc +0 -811
  231. data/ext/v8/upstream/2.0.6/src/handles.h +0 -367
  232. data/ext/v8/upstream/2.0.6/src/hashmap.cc +0 -226
  233. data/ext/v8/upstream/2.0.6/src/hashmap.h +0 -120
  234. data/ext/v8/upstream/2.0.6/src/heap-inl.h +0 -407
  235. data/ext/v8/upstream/2.0.6/src/heap-profiler.cc +0 -695
  236. data/ext/v8/upstream/2.0.6/src/heap-profiler.h +0 -277
  237. data/ext/v8/upstream/2.0.6/src/heap.cc +0 -4204
  238. data/ext/v8/upstream/2.0.6/src/heap.h +0 -1704
  239. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32-inl.h +0 -325
  240. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.cc +0 -2375
  241. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.h +0 -914
  242. data/ext/v8/upstream/2.0.6/src/ia32/builtins-ia32.cc +0 -1222
  243. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32-inl.h +0 -46
  244. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.cc +0 -9770
  245. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.h +0 -834
  246. data/ext/v8/upstream/2.0.6/src/ia32/cpu-ia32.cc +0 -79
  247. data/ext/v8/upstream/2.0.6/src/ia32/debug-ia32.cc +0 -208
  248. data/ext/v8/upstream/2.0.6/src/ia32/disasm-ia32.cc +0 -1357
  249. data/ext/v8/upstream/2.0.6/src/ia32/fast-codegen-ia32.cc +0 -1813
  250. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.cc +0 -111
  251. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.h +0 -135
  252. data/ext/v8/upstream/2.0.6/src/ia32/ic-ia32.cc +0 -1490
  253. data/ext/v8/upstream/2.0.6/src/ia32/jump-target-ia32.cc +0 -432
  254. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.cc +0 -1517
  255. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.h +0 -528
  256. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.cc +0 -1219
  257. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.h +0 -230
  258. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32-inl.h +0 -82
  259. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.cc +0 -99
  260. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.h +0 -43
  261. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.cc +0 -30
  262. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.h +0 -62
  263. data/ext/v8/upstream/2.0.6/src/ia32/stub-cache-ia32.cc +0 -1961
  264. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.cc +0 -1105
  265. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.h +0 -580
  266. data/ext/v8/upstream/2.0.6/src/ic-inl.h +0 -93
  267. data/ext/v8/upstream/2.0.6/src/ic.cc +0 -1426
  268. data/ext/v8/upstream/2.0.6/src/ic.h +0 -443
  269. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.cc +0 -646
  270. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.h +0 -48
  271. data/ext/v8/upstream/2.0.6/src/json-delay.js +0 -254
  272. data/ext/v8/upstream/2.0.6/src/jsregexp.cc +0 -5234
  273. data/ext/v8/upstream/2.0.6/src/jsregexp.h +0 -1439
  274. data/ext/v8/upstream/2.0.6/src/jump-target-inl.h +0 -49
  275. data/ext/v8/upstream/2.0.6/src/jump-target.cc +0 -383
  276. data/ext/v8/upstream/2.0.6/src/jump-target.h +0 -280
  277. data/ext/v8/upstream/2.0.6/src/list-inl.h +0 -166
  278. data/ext/v8/upstream/2.0.6/src/list.h +0 -158
  279. data/ext/v8/upstream/2.0.6/src/log-inl.h +0 -126
  280. data/ext/v8/upstream/2.0.6/src/log-utils.cc +0 -503
  281. data/ext/v8/upstream/2.0.6/src/log-utils.h +0 -292
  282. data/ext/v8/upstream/2.0.6/src/log.cc +0 -1457
  283. data/ext/v8/upstream/2.0.6/src/log.h +0 -371
  284. data/ext/v8/upstream/2.0.6/src/macro-assembler.h +0 -93
  285. data/ext/v8/upstream/2.0.6/src/macros.py +0 -137
  286. data/ext/v8/upstream/2.0.6/src/mark-compact.cc +0 -2007
  287. data/ext/v8/upstream/2.0.6/src/mark-compact.h +0 -442
  288. data/ext/v8/upstream/2.0.6/src/math.js +0 -263
  289. data/ext/v8/upstream/2.0.6/src/memory.h +0 -74
  290. data/ext/v8/upstream/2.0.6/src/messages.cc +0 -177
  291. data/ext/v8/upstream/2.0.6/src/messages.h +0 -112
  292. data/ext/v8/upstream/2.0.6/src/messages.js +0 -937
  293. data/ext/v8/upstream/2.0.6/src/mirror-delay.js +0 -2332
  294. data/ext/v8/upstream/2.0.6/src/mksnapshot.cc +0 -169
  295. data/ext/v8/upstream/2.0.6/src/natives.h +0 -63
  296. data/ext/v8/upstream/2.0.6/src/objects-debug.cc +0 -1317
  297. data/ext/v8/upstream/2.0.6/src/objects-inl.h +0 -3044
  298. data/ext/v8/upstream/2.0.6/src/objects.cc +0 -8306
  299. data/ext/v8/upstream/2.0.6/src/objects.h +0 -4960
  300. data/ext/v8/upstream/2.0.6/src/oprofile-agent.cc +0 -116
  301. data/ext/v8/upstream/2.0.6/src/oprofile-agent.h +0 -69
  302. data/ext/v8/upstream/2.0.6/src/parser.cc +0 -4810
  303. data/ext/v8/upstream/2.0.6/src/parser.h +0 -195
  304. data/ext/v8/upstream/2.0.6/src/platform-freebsd.cc +0 -645
  305. data/ext/v8/upstream/2.0.6/src/platform-linux.cc +0 -808
  306. data/ext/v8/upstream/2.0.6/src/platform-macos.cc +0 -643
  307. data/ext/v8/upstream/2.0.6/src/platform-nullos.cc +0 -454
  308. data/ext/v8/upstream/2.0.6/src/platform-openbsd.cc +0 -597
  309. data/ext/v8/upstream/2.0.6/src/platform-posix.cc +0 -380
  310. data/ext/v8/upstream/2.0.6/src/platform-win32.cc +0 -1908
  311. data/ext/v8/upstream/2.0.6/src/platform.h +0 -556
  312. data/ext/v8/upstream/2.0.6/src/prettyprinter.cc +0 -1511
  313. data/ext/v8/upstream/2.0.6/src/prettyprinter.h +0 -219
  314. data/ext/v8/upstream/2.0.6/src/property.cc +0 -96
  315. data/ext/v8/upstream/2.0.6/src/property.h +0 -327
  316. data/ext/v8/upstream/2.0.6/src/regexp-delay.js +0 -406
  317. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp-inl.h +0 -78
  318. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.cc +0 -464
  319. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.h +0 -141
  320. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.cc +0 -356
  321. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.h +0 -103
  322. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.cc +0 -240
  323. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.h +0 -220
  324. data/ext/v8/upstream/2.0.6/src/regexp-stack.cc +0 -103
  325. data/ext/v8/upstream/2.0.6/src/regexp-stack.h +0 -123
  326. data/ext/v8/upstream/2.0.6/src/register-allocator-inl.h +0 -74
  327. data/ext/v8/upstream/2.0.6/src/register-allocator.cc +0 -100
  328. data/ext/v8/upstream/2.0.6/src/register-allocator.h +0 -295
  329. data/ext/v8/upstream/2.0.6/src/rewriter.cc +0 -855
  330. data/ext/v8/upstream/2.0.6/src/rewriter.h +0 -54
  331. data/ext/v8/upstream/2.0.6/src/runtime.cc +0 -8163
  332. data/ext/v8/upstream/2.0.6/src/runtime.h +0 -432
  333. data/ext/v8/upstream/2.0.6/src/runtime.js +0 -626
  334. data/ext/v8/upstream/2.0.6/src/scanner.cc +0 -1098
  335. data/ext/v8/upstream/2.0.6/src/scanner.h +0 -425
  336. data/ext/v8/upstream/2.0.6/src/scopeinfo.cc +0 -649
  337. data/ext/v8/upstream/2.0.6/src/scopeinfo.h +0 -236
  338. data/ext/v8/upstream/2.0.6/src/scopes.cc +0 -963
  339. data/ext/v8/upstream/2.0.6/src/scopes.h +0 -401
  340. data/ext/v8/upstream/2.0.6/src/serialize.cc +0 -1260
  341. data/ext/v8/upstream/2.0.6/src/serialize.h +0 -404
  342. data/ext/v8/upstream/2.0.6/src/shell.h +0 -55
  343. data/ext/v8/upstream/2.0.6/src/simulator.h +0 -41
  344. data/ext/v8/upstream/2.0.6/src/smart-pointer.h +0 -109
  345. data/ext/v8/upstream/2.0.6/src/snapshot-common.cc +0 -97
  346. data/ext/v8/upstream/2.0.6/src/snapshot-empty.cc +0 -40
  347. data/ext/v8/upstream/2.0.6/src/snapshot.h +0 -59
  348. data/ext/v8/upstream/2.0.6/src/spaces-inl.h +0 -372
  349. data/ext/v8/upstream/2.0.6/src/spaces.cc +0 -2864
  350. data/ext/v8/upstream/2.0.6/src/spaces.h +0 -2072
  351. data/ext/v8/upstream/2.0.6/src/string-stream.cc +0 -584
  352. data/ext/v8/upstream/2.0.6/src/string-stream.h +0 -189
  353. data/ext/v8/upstream/2.0.6/src/string.js +0 -901
  354. data/ext/v8/upstream/2.0.6/src/stub-cache.cc +0 -1108
  355. data/ext/v8/upstream/2.0.6/src/stub-cache.h +0 -578
  356. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/COPYING +0 -15
  357. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/dtoa.c +0 -3330
  358. data/ext/v8/upstream/2.0.6/src/third_party/valgrind/valgrind.h +0 -3925
  359. data/ext/v8/upstream/2.0.6/src/token.cc +0 -56
  360. data/ext/v8/upstream/2.0.6/src/token.h +0 -270
  361. data/ext/v8/upstream/2.0.6/src/top.cc +0 -991
  362. data/ext/v8/upstream/2.0.6/src/top.h +0 -459
  363. data/ext/v8/upstream/2.0.6/src/unicode-inl.h +0 -238
  364. data/ext/v8/upstream/2.0.6/src/unicode.cc +0 -749
  365. data/ext/v8/upstream/2.0.6/src/unicode.h +0 -279
  366. data/ext/v8/upstream/2.0.6/src/uri.js +0 -415
  367. data/ext/v8/upstream/2.0.6/src/usage-analyzer.cc +0 -426
  368. data/ext/v8/upstream/2.0.6/src/usage-analyzer.h +0 -40
  369. data/ext/v8/upstream/2.0.6/src/utils.cc +0 -322
  370. data/ext/v8/upstream/2.0.6/src/utils.h +0 -592
  371. data/ext/v8/upstream/2.0.6/src/v8-counters.cc +0 -55
  372. data/ext/v8/upstream/2.0.6/src/v8-counters.h +0 -198
  373. data/ext/v8/upstream/2.0.6/src/v8.cc +0 -193
  374. data/ext/v8/upstream/2.0.6/src/v8.h +0 -119
  375. data/ext/v8/upstream/2.0.6/src/v8natives.js +0 -846
  376. data/ext/v8/upstream/2.0.6/src/v8threads.cc +0 -450
  377. data/ext/v8/upstream/2.0.6/src/v8threads.h +0 -144
  378. data/ext/v8/upstream/2.0.6/src/variables.cc +0 -163
  379. data/ext/v8/upstream/2.0.6/src/variables.h +0 -235
  380. data/ext/v8/upstream/2.0.6/src/version.cc +0 -88
  381. data/ext/v8/upstream/2.0.6/src/version.h +0 -64
  382. data/ext/v8/upstream/2.0.6/src/virtual-frame.cc +0 -381
  383. data/ext/v8/upstream/2.0.6/src/virtual-frame.h +0 -44
  384. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64-inl.h +0 -352
  385. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.cc +0 -2539
  386. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.h +0 -1399
  387. data/ext/v8/upstream/2.0.6/src/x64/builtins-x64.cc +0 -1255
  388. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64-inl.h +0 -46
  389. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.cc +0 -8223
  390. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.h +0 -785
  391. data/ext/v8/upstream/2.0.6/src/x64/cpu-x64.cc +0 -79
  392. data/ext/v8/upstream/2.0.6/src/x64/debug-x64.cc +0 -202
  393. data/ext/v8/upstream/2.0.6/src/x64/disasm-x64.cc +0 -1596
  394. data/ext/v8/upstream/2.0.6/src/x64/fast-codegen-x64.cc +0 -1820
  395. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.cc +0 -109
  396. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.h +0 -121
  397. data/ext/v8/upstream/2.0.6/src/x64/ic-x64.cc +0 -1392
  398. data/ext/v8/upstream/2.0.6/src/x64/jump-target-x64.cc +0 -432
  399. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.cc +0 -2409
  400. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.h +0 -765
  401. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.cc +0 -1337
  402. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.h +0 -295
  403. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64-inl.h +0 -86
  404. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.cc +0 -84
  405. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.h +0 -43
  406. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.cc +0 -27
  407. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.h +0 -63
  408. data/ext/v8/upstream/2.0.6/src/x64/stub-cache-x64.cc +0 -1884
  409. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.cc +0 -1089
  410. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.h +0 -560
  411. data/ext/v8/upstream/2.0.6/src/zone-inl.h +0 -297
  412. data/ext/v8/upstream/2.0.6/src/zone.cc +0 -193
  413. data/ext/v8/upstream/2.0.6/src/zone.h +0 -305
  414. data/ext/v8/upstream/2.0.6/tools/codemap.js +0 -258
  415. data/ext/v8/upstream/2.0.6/tools/consarray.js +0 -93
  416. data/ext/v8/upstream/2.0.6/tools/csvparser.js +0 -98
  417. data/ext/v8/upstream/2.0.6/tools/gyp/v8.gyp +0 -620
  418. data/ext/v8/upstream/2.0.6/tools/js2c.py +0 -376
  419. data/ext/v8/upstream/2.0.6/tools/jsmin.py +0 -280
  420. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor +0 -24
  421. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor.py +0 -78
  422. data/ext/v8/upstream/2.0.6/tools/logreader.js +0 -320
  423. data/ext/v8/upstream/2.0.6/tools/mac-nm +0 -18
  424. data/ext/v8/upstream/2.0.6/tools/mac-tick-processor +0 -6
  425. data/ext/v8/upstream/2.0.6/tools/oprofile/annotate +0 -7
  426. data/ext/v8/upstream/2.0.6/tools/oprofile/common +0 -19
  427. data/ext/v8/upstream/2.0.6/tools/oprofile/dump +0 -7
  428. data/ext/v8/upstream/2.0.6/tools/oprofile/report +0 -7
  429. data/ext/v8/upstream/2.0.6/tools/oprofile/reset +0 -7
  430. data/ext/v8/upstream/2.0.6/tools/oprofile/run +0 -14
  431. data/ext/v8/upstream/2.0.6/tools/oprofile/shutdown +0 -7
  432. data/ext/v8/upstream/2.0.6/tools/oprofile/start +0 -7
  433. data/ext/v8/upstream/2.0.6/tools/presubmit.py +0 -299
  434. data/ext/v8/upstream/2.0.6/tools/process-heap-prof.py +0 -120
  435. data/ext/v8/upstream/2.0.6/tools/profile.js +0 -621
  436. data/ext/v8/upstream/2.0.6/tools/profile_view.js +0 -224
  437. data/ext/v8/upstream/2.0.6/tools/run-valgrind.py +0 -77
  438. data/ext/v8/upstream/2.0.6/tools/splaytree.js +0 -322
  439. data/ext/v8/upstream/2.0.6/tools/splaytree.py +0 -226
  440. data/ext/v8/upstream/2.0.6/tools/stats-viewer.py +0 -456
  441. data/ext/v8/upstream/2.0.6/tools/test.py +0 -1370
  442. data/ext/v8/upstream/2.0.6/tools/tickprocessor-driver.js +0 -53
  443. data/ext/v8/upstream/2.0.6/tools/tickprocessor.js +0 -731
  444. data/ext/v8/upstream/2.0.6/tools/tickprocessor.py +0 -535
  445. data/ext/v8/upstream/2.0.6/tools/utils.py +0 -82
  446. data/ext/v8/upstream/2.0.6/tools/visual_studio/README.txt +0 -71
  447. data/ext/v8/upstream/2.0.6/tools/visual_studio/arm.vsprops +0 -14
  448. data/ext/v8/upstream/2.0.6/tools/visual_studio/common.vsprops +0 -35
  449. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8.vcproj +0 -199
  450. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_arm.vcproj +0 -199
  451. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_x64.vcproj +0 -201
  452. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8js2c.cmd +0 -6
  453. data/ext/v8/upstream/2.0.6/tools/visual_studio/debug.vsprops +0 -17
  454. data/ext/v8/upstream/2.0.6/tools/visual_studio/ia32.vsprops +0 -13
  455. data/ext/v8/upstream/2.0.6/tools/visual_studio/js2c.cmd +0 -6
  456. data/ext/v8/upstream/2.0.6/tools/visual_studio/release.vsprops +0 -24
  457. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.sln +0 -101
  458. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.vcproj +0 -223
  459. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.sln +0 -74
  460. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.vcproj +0 -223
  461. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base.vcproj +0 -971
  462. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_arm.vcproj +0 -983
  463. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_x64.vcproj +0 -959
  464. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest.vcproj +0 -255
  465. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_arm.vcproj +0 -243
  466. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_x64.vcproj +0 -257
  467. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot.vcproj +0 -151
  468. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -151
  469. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample.vcproj +0 -151
  470. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_arm.vcproj +0 -151
  471. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_x64.vcproj +0 -151
  472. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample.vcproj +0 -151
  473. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -151
  474. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -153
  475. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot.vcproj +0 -142
  476. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc.vcproj +0 -92
  477. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -92
  478. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_x64.vcproj +0 -142
  479. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.sln +0 -101
  480. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.vcproj +0 -223
  481. data/ext/v8/upstream/2.0.6/tools/visual_studio/x64.vsprops +0 -13
  482. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.bat +0 -5
  483. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.py +0 -137
  484. data/ext/v8/upstream/Makefile +0 -32
  485. data/ext/v8/upstream/fpic-on-linux-amd64.patch +0 -13
  486. data/ext/v8/upstream/no-strict-aliasing.patch +0 -13
  487. data/ext/v8/upstream/scons/CHANGES.txt +0 -5183
  488. data/ext/v8/upstream/scons/LICENSE.txt +0 -20
  489. data/ext/v8/upstream/scons/MANIFEST +0 -202
  490. data/ext/v8/upstream/scons/PKG-INFO +0 -13
  491. data/ext/v8/upstream/scons/README.txt +0 -273
  492. data/ext/v8/upstream/scons/RELEASE.txt +0 -1040
  493. data/ext/v8/upstream/scons/engine/SCons/Action.py +0 -1256
  494. data/ext/v8/upstream/scons/engine/SCons/Builder.py +0 -868
  495. data/ext/v8/upstream/scons/engine/SCons/CacheDir.py +0 -217
  496. data/ext/v8/upstream/scons/engine/SCons/Conftest.py +0 -794
  497. data/ext/v8/upstream/scons/engine/SCons/Debug.py +0 -237
  498. data/ext/v8/upstream/scons/engine/SCons/Defaults.py +0 -485
  499. data/ext/v8/upstream/scons/engine/SCons/Environment.py +0 -2327
  500. data/ext/v8/upstream/scons/engine/SCons/Errors.py +0 -207
  501. data/ext/v8/upstream/scons/engine/SCons/Executor.py +0 -636
  502. data/ext/v8/upstream/scons/engine/SCons/Job.py +0 -435
  503. data/ext/v8/upstream/scons/engine/SCons/Memoize.py +0 -292
  504. data/ext/v8/upstream/scons/engine/SCons/Node/Alias.py +0 -153
  505. data/ext/v8/upstream/scons/engine/SCons/Node/FS.py +0 -3220
  506. data/ext/v8/upstream/scons/engine/SCons/Node/Python.py +0 -128
  507. data/ext/v8/upstream/scons/engine/SCons/Node/__init__.py +0 -1341
  508. data/ext/v8/upstream/scons/engine/SCons/Options/BoolOption.py +0 -50
  509. data/ext/v8/upstream/scons/engine/SCons/Options/EnumOption.py +0 -50
  510. data/ext/v8/upstream/scons/engine/SCons/Options/ListOption.py +0 -50
  511. data/ext/v8/upstream/scons/engine/SCons/Options/PackageOption.py +0 -50
  512. data/ext/v8/upstream/scons/engine/SCons/Options/PathOption.py +0 -76
  513. data/ext/v8/upstream/scons/engine/SCons/Options/__init__.py +0 -74
  514. data/ext/v8/upstream/scons/engine/SCons/PathList.py +0 -232
  515. data/ext/v8/upstream/scons/engine/SCons/Platform/__init__.py +0 -236
  516. data/ext/v8/upstream/scons/engine/SCons/Platform/aix.py +0 -70
  517. data/ext/v8/upstream/scons/engine/SCons/Platform/cygwin.py +0 -55
  518. data/ext/v8/upstream/scons/engine/SCons/Platform/darwin.py +0 -46
  519. data/ext/v8/upstream/scons/engine/SCons/Platform/hpux.py +0 -46
  520. data/ext/v8/upstream/scons/engine/SCons/Platform/irix.py +0 -44
  521. data/ext/v8/upstream/scons/engine/SCons/Platform/os2.py +0 -58
  522. data/ext/v8/upstream/scons/engine/SCons/Platform/posix.py +0 -264
  523. data/ext/v8/upstream/scons/engine/SCons/Platform/sunos.py +0 -50
  524. data/ext/v8/upstream/scons/engine/SCons/Platform/win32.py +0 -386
  525. data/ext/v8/upstream/scons/engine/SCons/SConf.py +0 -1038
  526. data/ext/v8/upstream/scons/engine/SCons/SConsign.py +0 -381
  527. data/ext/v8/upstream/scons/engine/SCons/Scanner/C.py +0 -132
  528. data/ext/v8/upstream/scons/engine/SCons/Scanner/D.py +0 -74
  529. data/ext/v8/upstream/scons/engine/SCons/Scanner/Dir.py +0 -111
  530. data/ext/v8/upstream/scons/engine/SCons/Scanner/Fortran.py +0 -320
  531. data/ext/v8/upstream/scons/engine/SCons/Scanner/IDL.py +0 -48
  532. data/ext/v8/upstream/scons/engine/SCons/Scanner/LaTeX.py +0 -378
  533. data/ext/v8/upstream/scons/engine/SCons/Scanner/Prog.py +0 -103
  534. data/ext/v8/upstream/scons/engine/SCons/Scanner/RC.py +0 -55
  535. data/ext/v8/upstream/scons/engine/SCons/Scanner/__init__.py +0 -415
  536. data/ext/v8/upstream/scons/engine/SCons/Script/Interactive.py +0 -386
  537. data/ext/v8/upstream/scons/engine/SCons/Script/Main.py +0 -1360
  538. data/ext/v8/upstream/scons/engine/SCons/Script/SConsOptions.py +0 -944
  539. data/ext/v8/upstream/scons/engine/SCons/Script/SConscript.py +0 -642
  540. data/ext/v8/upstream/scons/engine/SCons/Script/__init__.py +0 -414
  541. data/ext/v8/upstream/scons/engine/SCons/Sig.py +0 -63
  542. data/ext/v8/upstream/scons/engine/SCons/Subst.py +0 -911
  543. data/ext/v8/upstream/scons/engine/SCons/Taskmaster.py +0 -1030
  544. data/ext/v8/upstream/scons/engine/SCons/Tool/386asm.py +0 -61
  545. data/ext/v8/upstream/scons/engine/SCons/Tool/BitKeeper.py +0 -65
  546. data/ext/v8/upstream/scons/engine/SCons/Tool/CVS.py +0 -73
  547. data/ext/v8/upstream/scons/engine/SCons/Tool/FortranCommon.py +0 -247
  548. data/ext/v8/upstream/scons/engine/SCons/Tool/JavaCommon.py +0 -324
  549. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/__init__.py +0 -56
  550. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/arch.py +0 -61
  551. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/common.py +0 -210
  552. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/netframework.py +0 -84
  553. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/sdk.py +0 -321
  554. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vc.py +0 -367
  555. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vs.py +0 -497
  556. data/ext/v8/upstream/scons/engine/SCons/Tool/Perforce.py +0 -104
  557. data/ext/v8/upstream/scons/engine/SCons/Tool/PharLapCommon.py +0 -138
  558. data/ext/v8/upstream/scons/engine/SCons/Tool/RCS.py +0 -64
  559. data/ext/v8/upstream/scons/engine/SCons/Tool/SCCS.py +0 -64
  560. data/ext/v8/upstream/scons/engine/SCons/Tool/Subversion.py +0 -71
  561. data/ext/v8/upstream/scons/engine/SCons/Tool/__init__.py +0 -675
  562. data/ext/v8/upstream/scons/engine/SCons/Tool/aixc++.py +0 -82
  563. data/ext/v8/upstream/scons/engine/SCons/Tool/aixcc.py +0 -74
  564. data/ext/v8/upstream/scons/engine/SCons/Tool/aixf77.py +0 -80
  565. data/ext/v8/upstream/scons/engine/SCons/Tool/aixlink.py +0 -76
  566. data/ext/v8/upstream/scons/engine/SCons/Tool/applelink.py +0 -71
  567. data/ext/v8/upstream/scons/engine/SCons/Tool/ar.py +0 -63
  568. data/ext/v8/upstream/scons/engine/SCons/Tool/as.py +0 -78
  569. data/ext/v8/upstream/scons/engine/SCons/Tool/bcc32.py +0 -82
  570. data/ext/v8/upstream/scons/engine/SCons/Tool/c++.py +0 -99
  571. data/ext/v8/upstream/scons/engine/SCons/Tool/cc.py +0 -114
  572. data/ext/v8/upstream/scons/engine/SCons/Tool/cvf.py +0 -58
  573. data/ext/v8/upstream/scons/engine/SCons/Tool/default.py +0 -50
  574. data/ext/v8/upstream/scons/engine/SCons/Tool/dmd.py +0 -224
  575. data/ext/v8/upstream/scons/engine/SCons/Tool/dvi.py +0 -64
  576. data/ext/v8/upstream/scons/engine/SCons/Tool/dvipdf.py +0 -125
  577. data/ext/v8/upstream/scons/engine/SCons/Tool/dvips.py +0 -94
  578. data/ext/v8/upstream/scons/engine/SCons/Tool/f77.py +0 -62
  579. data/ext/v8/upstream/scons/engine/SCons/Tool/f90.py +0 -62
  580. data/ext/v8/upstream/scons/engine/SCons/Tool/f95.py +0 -63
  581. data/ext/v8/upstream/scons/engine/SCons/Tool/filesystem.py +0 -98
  582. data/ext/v8/upstream/scons/engine/SCons/Tool/fortran.py +0 -63
  583. data/ext/v8/upstream/scons/engine/SCons/Tool/g++.py +0 -90
  584. data/ext/v8/upstream/scons/engine/SCons/Tool/g77.py +0 -73
  585. data/ext/v8/upstream/scons/engine/SCons/Tool/gas.py +0 -53
  586. data/ext/v8/upstream/scons/engine/SCons/Tool/gcc.py +0 -80
  587. data/ext/v8/upstream/scons/engine/SCons/Tool/gfortran.py +0 -64
  588. data/ext/v8/upstream/scons/engine/SCons/Tool/gnulink.py +0 -63
  589. data/ext/v8/upstream/scons/engine/SCons/Tool/gs.py +0 -81
  590. data/ext/v8/upstream/scons/engine/SCons/Tool/hpc++.py +0 -85
  591. data/ext/v8/upstream/scons/engine/SCons/Tool/hpcc.py +0 -53
  592. data/ext/v8/upstream/scons/engine/SCons/Tool/hplink.py +0 -77
  593. data/ext/v8/upstream/scons/engine/SCons/Tool/icc.py +0 -59
  594. data/ext/v8/upstream/scons/engine/SCons/Tool/icl.py +0 -52
  595. data/ext/v8/upstream/scons/engine/SCons/Tool/ifl.py +0 -72
  596. data/ext/v8/upstream/scons/engine/SCons/Tool/ifort.py +0 -90
  597. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink.py +0 -59
  598. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink32.py +0 -60
  599. data/ext/v8/upstream/scons/engine/SCons/Tool/install.py +0 -229
  600. data/ext/v8/upstream/scons/engine/SCons/Tool/intelc.py +0 -490
  601. data/ext/v8/upstream/scons/engine/SCons/Tool/ipkg.py +0 -71
  602. data/ext/v8/upstream/scons/engine/SCons/Tool/jar.py +0 -110
  603. data/ext/v8/upstream/scons/engine/SCons/Tool/javac.py +0 -234
  604. data/ext/v8/upstream/scons/engine/SCons/Tool/javah.py +0 -138
  605. data/ext/v8/upstream/scons/engine/SCons/Tool/latex.py +0 -79
  606. data/ext/v8/upstream/scons/engine/SCons/Tool/lex.py +0 -99
  607. data/ext/v8/upstream/scons/engine/SCons/Tool/link.py +0 -121
  608. data/ext/v8/upstream/scons/engine/SCons/Tool/linkloc.py +0 -112
  609. data/ext/v8/upstream/scons/engine/SCons/Tool/m4.py +0 -63
  610. data/ext/v8/upstream/scons/engine/SCons/Tool/masm.py +0 -77
  611. data/ext/v8/upstream/scons/engine/SCons/Tool/midl.py +0 -90
  612. data/ext/v8/upstream/scons/engine/SCons/Tool/mingw.py +0 -159
  613. data/ext/v8/upstream/scons/engine/SCons/Tool/mslib.py +0 -64
  614. data/ext/v8/upstream/scons/engine/SCons/Tool/mslink.py +0 -266
  615. data/ext/v8/upstream/scons/engine/SCons/Tool/mssdk.py +0 -50
  616. data/ext/v8/upstream/scons/engine/SCons/Tool/msvc.py +0 -269
  617. data/ext/v8/upstream/scons/engine/SCons/Tool/msvs.py +0 -1439
  618. data/ext/v8/upstream/scons/engine/SCons/Tool/mwcc.py +0 -208
  619. data/ext/v8/upstream/scons/engine/SCons/Tool/mwld.py +0 -107
  620. data/ext/v8/upstream/scons/engine/SCons/Tool/nasm.py +0 -72
  621. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/__init__.py +0 -314
  622. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/ipk.py +0 -185
  623. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/msi.py +0 -526
  624. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/rpm.py +0 -367
  625. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_tarbz2.py +0 -43
  626. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_targz.py +0 -43
  627. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_zip.py +0 -43
  628. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/tarbz2.py +0 -44
  629. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/targz.py +0 -44
  630. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/zip.py +0 -44
  631. data/ext/v8/upstream/scons/engine/SCons/Tool/pdf.py +0 -78
  632. data/ext/v8/upstream/scons/engine/SCons/Tool/pdflatex.py +0 -83
  633. data/ext/v8/upstream/scons/engine/SCons/Tool/pdftex.py +0 -108
  634. data/ext/v8/upstream/scons/engine/SCons/Tool/qt.py +0 -336
  635. data/ext/v8/upstream/scons/engine/SCons/Tool/rmic.py +0 -121
  636. data/ext/v8/upstream/scons/engine/SCons/Tool/rpcgen.py +0 -70
  637. data/ext/v8/upstream/scons/engine/SCons/Tool/rpm.py +0 -132
  638. data/ext/v8/upstream/scons/engine/SCons/Tool/sgiar.py +0 -68
  639. data/ext/v8/upstream/scons/engine/SCons/Tool/sgic++.py +0 -58
  640. data/ext/v8/upstream/scons/engine/SCons/Tool/sgicc.py +0 -53
  641. data/ext/v8/upstream/scons/engine/SCons/Tool/sgilink.py +0 -63
  642. data/ext/v8/upstream/scons/engine/SCons/Tool/sunar.py +0 -67
  643. data/ext/v8/upstream/scons/engine/SCons/Tool/sunc++.py +0 -142
  644. data/ext/v8/upstream/scons/engine/SCons/Tool/suncc.py +0 -58
  645. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf77.py +0 -63
  646. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf90.py +0 -64
  647. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf95.py +0 -64
  648. data/ext/v8/upstream/scons/engine/SCons/Tool/sunlink.py +0 -77
  649. data/ext/v8/upstream/scons/engine/SCons/Tool/swig.py +0 -186
  650. data/ext/v8/upstream/scons/engine/SCons/Tool/tar.py +0 -73
  651. data/ext/v8/upstream/scons/engine/SCons/Tool/tex.py +0 -805
  652. data/ext/v8/upstream/scons/engine/SCons/Tool/textfile.py +0 -175
  653. data/ext/v8/upstream/scons/engine/SCons/Tool/tlib.py +0 -53
  654. data/ext/v8/upstream/scons/engine/SCons/Tool/wix.py +0 -100
  655. data/ext/v8/upstream/scons/engine/SCons/Tool/yacc.py +0 -131
  656. data/ext/v8/upstream/scons/engine/SCons/Tool/zip.py +0 -100
  657. data/ext/v8/upstream/scons/engine/SCons/Util.py +0 -1645
  658. data/ext/v8/upstream/scons/engine/SCons/Variables/BoolVariable.py +0 -91
  659. data/ext/v8/upstream/scons/engine/SCons/Variables/EnumVariable.py +0 -107
  660. data/ext/v8/upstream/scons/engine/SCons/Variables/ListVariable.py +0 -139
  661. data/ext/v8/upstream/scons/engine/SCons/Variables/PackageVariable.py +0 -109
  662. data/ext/v8/upstream/scons/engine/SCons/Variables/PathVariable.py +0 -147
  663. data/ext/v8/upstream/scons/engine/SCons/Variables/__init__.py +0 -317
  664. data/ext/v8/upstream/scons/engine/SCons/Warnings.py +0 -228
  665. data/ext/v8/upstream/scons/engine/SCons/__init__.py +0 -49
  666. data/ext/v8/upstream/scons/engine/SCons/compat/__init__.py +0 -302
  667. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_UserString.py +0 -98
  668. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_hashlib.py +0 -91
  669. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_itertools.py +0 -124
  670. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_optparse.py +0 -1725
  671. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets.py +0 -583
  672. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets15.py +0 -176
  673. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_shlex.py +0 -325
  674. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_subprocess.py +0 -1296
  675. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_textwrap.py +0 -382
  676. data/ext/v8/upstream/scons/engine/SCons/compat/builtins.py +0 -187
  677. data/ext/v8/upstream/scons/engine/SCons/cpp.py +0 -598
  678. data/ext/v8/upstream/scons/engine/SCons/dblite.py +0 -248
  679. data/ext/v8/upstream/scons/engine/SCons/exitfuncs.py +0 -77
  680. data/ext/v8/upstream/scons/os_spawnv_fix.diff +0 -83
  681. data/ext/v8/upstream/scons/scons-time.1 +0 -1017
  682. data/ext/v8/upstream/scons/scons.1 +0 -15179
  683. data/ext/v8/upstream/scons/sconsign.1 +0 -208
  684. data/ext/v8/upstream/scons/script/scons +0 -184
  685. data/ext/v8/upstream/scons/script/scons-time +0 -1529
  686. data/ext/v8/upstream/scons/script/scons.bat +0 -31
  687. data/ext/v8/upstream/scons/script/sconsign +0 -508
  688. data/ext/v8/upstream/scons/setup.cfg +0 -6
  689. data/ext/v8/upstream/scons/setup.py +0 -427
  690. data/ext/v8/v8.cpp +0 -89
  691. data/ext/v8/v8_cxt.cpp +0 -92
  692. data/ext/v8/v8_cxt.h +0 -20
  693. data/ext/v8/v8_func.cpp +0 -10
  694. data/ext/v8/v8_func.h +0 -11
  695. data/ext/v8/v8_msg.cpp +0 -54
  696. data/ext/v8/v8_msg.h +0 -18
  697. data/ext/v8/v8_obj.cpp +0 -52
  698. data/ext/v8/v8_obj.h +0 -13
  699. data/ext/v8/v8_ref.cpp +0 -26
  700. data/ext/v8/v8_ref.h +0 -31
  701. data/ext/v8/v8_script.cpp +0 -20
  702. data/ext/v8/v8_script.h +0 -8
  703. data/ext/v8/v8_standalone.cpp +0 -69
  704. data/ext/v8/v8_standalone.h +0 -31
  705. data/ext/v8/v8_str.cpp +0 -17
  706. data/ext/v8/v8_str.h +0 -9
  707. data/ext/v8/v8_template.cpp +0 -53
  708. data/ext/v8/v8_template.h +0 -13
  709. data/lib/v8/to.rb +0 -33
  710. data/lib/v8/v8.so +0 -0
  711. data/script/console +0 -10
  712. data/script/destroy +0 -14
  713. data/script/generate +0 -14
  714. data/spec/ext/cxt_spec.rb +0 -25
  715. data/spec/ext/obj_spec.rb +0 -13
  716. data/spec/redjs/jsapi_spec.rb +0 -405
  717. data/spec/redjs/tap.rb +0 -8
  718. data/spec/redjs_helper.rb +0 -3
  719. data/spec/spec.opts +0 -1
  720. data/spec/v8/to_spec.rb +0 -15
  721. data/tasks/rspec.rake +0 -21
@@ -1,1138 +0,0 @@
1
- // Copyright 2006-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
- // This file relies on the fact that the following declarations have been made
30
- // in v8natives.js:
31
- // const $isFinite = GlobalIsFinite;
32
-
33
- // -------------------------------------------------------------------
34
-
35
- // This file contains date support implemented in JavaScript.
36
-
37
-
38
- // Keep reference to original values of some global properties. This
39
- // has the added benefit that the code in this file is isolated from
40
- // changes to these properties.
41
- const $Date = global.Date;
42
-
43
- // Helper function to throw error.
44
- function ThrowDateTypeError() {
45
- throw new $TypeError('this is not a Date object.');
46
- }
47
-
48
- // ECMA 262 - 5.2
49
- function Modulo(value, remainder) {
50
- var mod = value % remainder;
51
- // Guard against returning -0.
52
- if (mod == 0) return 0;
53
- return mod >= 0 ? mod : mod + remainder;
54
- }
55
-
56
-
57
- function TimeWithinDay(time) {
58
- return Modulo(time, msPerDay);
59
- }
60
-
61
-
62
- // ECMA 262 - 15.9.1.3
63
- function DaysInYear(year) {
64
- if (year % 4 != 0) return 365;
65
- if ((year % 100 == 0) && (year % 400 != 0)) return 365;
66
- return 366;
67
- }
68
-
69
-
70
- function DayFromYear(year) {
71
- return 365 * (year-1970)
72
- + FLOOR((year-1969)/4)
73
- - FLOOR((year-1901)/100)
74
- + FLOOR((year-1601)/400);
75
- }
76
-
77
-
78
- function TimeFromYear(year) {
79
- return msPerDay * DayFromYear(year);
80
- }
81
-
82
-
83
- function InLeapYear(time) {
84
- return DaysInYear(YEAR_FROM_TIME(time)) == 366 ? 1 : 0;
85
- }
86
-
87
-
88
- function DayWithinYear(time) {
89
- return DAY(time) - DayFromYear(YEAR_FROM_TIME(time));
90
- }
91
-
92
-
93
- // ECMA 262 - 15.9.1.9
94
- function EquivalentYear(year) {
95
- // Returns an equivalent year in the range [2008-2035] matching
96
- // - leap year.
97
- // - week day of first day.
98
- var time = TimeFromYear(year);
99
- var recent_year = (InLeapYear(time) == 0 ? 1967 : 1956) +
100
- (WeekDay(time) * 12) % 28;
101
- // Find the year in the range 2008..2037 that is equivalent mod 28.
102
- // Add 3*28 to give a positive argument to the modulus operator.
103
- return 2008 + (recent_year + 3*28 - 2008) % 28;
104
- }
105
-
106
-
107
- function EquivalentTime(t) {
108
- // The issue here is that some library calls don't work right for dates
109
- // that cannot be represented using a non-negative signed 32 bit integer
110
- // (measured in whole seconds based on the 1970 epoch).
111
- // We solve this by mapping the time to a year with same leap-year-ness
112
- // and same starting day for the year. The ECMAscript specification says
113
- // we must do this, but for compatibility with other browsers, we use
114
- // the actual year if it is in the range 1970..2037
115
- if (t >= 0 && t <= 2.1e12) return t;
116
- var day = MakeDay(EquivalentYear(YEAR_FROM_TIME(t)), MONTH_FROM_TIME(t), DATE_FROM_TIME(t));
117
- return TimeClip(MakeDate(day, TimeWithinDay(t)));
118
- }
119
-
120
-
121
- // Because computing the DST offset is a pretty expensive operation
122
- // we keep a cache of last computed offset along with a time interval
123
- // where we know the cache is valid.
124
- var DST_offset_cache = {
125
- // Cached DST offset.
126
- offset: 0,
127
- // Time interval where the cached offset is valid.
128
- start: 0, end: -1,
129
- // Size of next interval expansion.
130
- increment: 0
131
- };
132
-
133
-
134
- // NOTE: The implementation relies on the fact that no time zones have
135
- // more than one daylight savings offset change per month.
136
- // If this function is called with NaN it returns NaN.
137
- function DaylightSavingsOffset(t) {
138
- // Load the cache object from the builtins object.
139
- var cache = DST_offset_cache;
140
-
141
- // Cache the start and the end in local variables for fast access.
142
- var start = cache.start;
143
- var end = cache.end;
144
-
145
- if (start <= t) {
146
- // If the time fits in the cached interval, return the cached offset.
147
- if (t <= end) return cache.offset;
148
-
149
- // Compute a possible new interval end.
150
- var new_end = end + cache.increment;
151
-
152
- if (t <= new_end) {
153
- var end_offset = %DateDaylightSavingsOffset(EquivalentTime(new_end));
154
- if (cache.offset == end_offset) {
155
- // If the offset at the end of the new interval still matches
156
- // the offset in the cache, we grow the cached time interval
157
- // and return the offset.
158
- cache.end = new_end;
159
- cache.increment = msPerMonth;
160
- return end_offset;
161
- } else {
162
- var offset = %DateDaylightSavingsOffset(EquivalentTime(t));
163
- if (offset == end_offset) {
164
- // The offset at the given time is equal to the offset at the
165
- // new end of the interval, so that means that we've just skipped
166
- // the point in time where the DST offset change occurred. Updated
167
- // the interval to reflect this and reset the increment.
168
- cache.start = t;
169
- cache.end = new_end;
170
- cache.increment = msPerMonth;
171
- } else {
172
- // The interval contains a DST offset change and the given time is
173
- // before it. Adjust the increment to avoid a linear search for
174
- // the offset change point and change the end of the interval.
175
- cache.increment /= 3;
176
- cache.end = t;
177
- }
178
- // Update the offset in the cache and return it.
179
- cache.offset = offset;
180
- return offset;
181
- }
182
- }
183
- }
184
-
185
- // Compute the DST offset for the time and shrink the cache interval
186
- // to only contain the time. This allows fast repeated DST offset
187
- // computations for the same time.
188
- var offset = %DateDaylightSavingsOffset(EquivalentTime(t));
189
- cache.offset = offset;
190
- cache.start = cache.end = t;
191
- cache.increment = msPerMonth;
192
- return offset;
193
- }
194
-
195
-
196
- var timezone_cache_time = $NaN;
197
- var timezone_cache_timezone;
198
-
199
- function LocalTimezone(t) {
200
- if (NUMBER_IS_NAN(t)) return "";
201
- if (t == timezone_cache_time) {
202
- return timezone_cache_timezone;
203
- }
204
- var timezone = %DateLocalTimezone(EquivalentTime(t));
205
- timezone_cache_time = t;
206
- timezone_cache_timezone = timezone;
207
- return timezone;
208
- }
209
-
210
-
211
- function WeekDay(time) {
212
- return Modulo(DAY(time) + 4, 7);
213
- }
214
-
215
- var local_time_offset = %DateLocalTimeOffset();
216
-
217
- function LocalTime(time) {
218
- if (NUMBER_IS_NAN(time)) return time;
219
- return time + local_time_offset + DaylightSavingsOffset(time);
220
- }
221
-
222
- function LocalTimeNoCheck(time) {
223
- // Inline the DST offset cache checks for speed.
224
- var cache = DST_offset_cache;
225
- if (cache.start <= time && time <= cache.end) {
226
- var dst_offset = cache.offset;
227
- } else {
228
- var dst_offset = DaylightSavingsOffset(time);
229
- }
230
- return time + local_time_offset + dst_offset;
231
- }
232
-
233
-
234
- function UTC(time) {
235
- if (NUMBER_IS_NAN(time)) return time;
236
- var tmp = time - local_time_offset;
237
- return tmp - DaylightSavingsOffset(tmp);
238
- }
239
-
240
-
241
- // ECMA 262 - 15.9.1.11
242
- function MakeTime(hour, min, sec, ms) {
243
- if (!$isFinite(hour)) return $NaN;
244
- if (!$isFinite(min)) return $NaN;
245
- if (!$isFinite(sec)) return $NaN;
246
- if (!$isFinite(ms)) return $NaN;
247
- return TO_INTEGER(hour) * msPerHour
248
- + TO_INTEGER(min) * msPerMinute
249
- + TO_INTEGER(sec) * msPerSecond
250
- + TO_INTEGER(ms);
251
- }
252
-
253
-
254
- // ECMA 262 - 15.9.1.12
255
- function TimeInYear(year) {
256
- return DaysInYear(year) * msPerDay;
257
- }
258
-
259
-
260
- // Compute modified Julian day from year, month, date.
261
- function ToJulianDay(year, month, date) {
262
- var jy = (month > 1) ? year : year - 1;
263
- var jm = (month > 1) ? month + 2 : month + 14;
264
- var ja = FLOOR(jy / 100);
265
- return FLOOR(FLOOR(365.25*jy) + FLOOR(30.6001*jm) + date + 1720995) + 2 - ja + FLOOR(0.25*ja);
266
- }
267
-
268
- var four_year_cycle_table = CalculateDateTable();
269
-
270
-
271
- function CalculateDateTable() {
272
- var month_lengths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
273
- var four_year_cycle_table = new $Array(1461);
274
-
275
- var cumulative = 0;
276
- var position = 0;
277
- var leap_position = 0;
278
- for (var month = 0; month < 12; month++) {
279
- var month_bits = month << kMonthShift;
280
- var length = month_lengths[month];
281
- for (var day = 1; day <= length; day++) {
282
- four_year_cycle_table[leap_position] =
283
- month_bits + day;
284
- four_year_cycle_table[366 + position] =
285
- (1 << kYearShift) + month_bits + day;
286
- four_year_cycle_table[731 + position] =
287
- (2 << kYearShift) + month_bits + day;
288
- four_year_cycle_table[1096 + position] =
289
- (3 << kYearShift) + month_bits + day;
290
- leap_position++;
291
- position++;
292
- }
293
- if (month == 1) {
294
- four_year_cycle_table[leap_position++] = month_bits + 29;
295
- }
296
- }
297
- return four_year_cycle_table;
298
- }
299
-
300
-
301
- // Constructor for creating objects holding year, month, and date.
302
- // Introduced to ensure the two return points in FromJulianDay match same map.
303
- function DayTriplet(year, month, date) {
304
- this.year = year;
305
- this.month = month;
306
- this.date = date;
307
- }
308
-
309
- var julian_day_cache_triplet;
310
- var julian_day_cache_day = $NaN;
311
-
312
- // Compute year, month, and day from modified Julian day.
313
- // The missing days in 1582 are ignored for JavaScript compatibility.
314
- function FromJulianDay(julian) {
315
- if (julian_day_cache_day == julian) {
316
- return julian_day_cache_triplet;
317
- }
318
- var result;
319
- // Avoid floating point and non-Smi maths in common case. This is also a period of
320
- // time where leap years are very regular. The range is not too large to avoid overflow
321
- // when doing the multiply-to-divide trick.
322
- if (julian > kDayZeroInJulianDay &&
323
- (julian - kDayZeroInJulianDay) < 40177) { // 1970 - 2080
324
- var jsimple = (julian - kDayZeroInJulianDay) + 731; // Day 0 is 1st January 1968
325
- var y = 1968;
326
- // Divide by 1461 by multiplying with 22967 and shifting down by 25!
327
- var after_1968 = (jsimple * 22967) >> 25;
328
- y += after_1968 << 2;
329
- jsimple -= 1461 * after_1968;
330
- var four_year_cycle = four_year_cycle_table[jsimple];
331
- result = new DayTriplet(y + (four_year_cycle >> kYearShift),
332
- (four_year_cycle & kMonthMask) >> kMonthShift,
333
- four_year_cycle & kDayMask);
334
- } else {
335
- var jalpha = FLOOR((julian - 1867216.25) / 36524.25);
336
- var jb = julian + 1 + jalpha - FLOOR(0.25 * jalpha) + 1524;
337
- var jc = FLOOR(6680.0 + ((jb-2439870) - 122.1)/365.25);
338
- var jd = FLOOR(365 * jc + (0.25 * jc));
339
- var je = FLOOR((jb - jd)/30.6001);
340
- var m = je - 1;
341
- if (m > 12) m -= 13;
342
- var y = jc - 4715;
343
- if (m > 2) { --y; --m; }
344
- var d = jb - jd - FLOOR(30.6001 * je);
345
- result = new DayTriplet(y, m, d);
346
- }
347
- julian_day_cache_day = julian;
348
- julian_day_cache_triplet = result;
349
- return result;
350
- }
351
-
352
-
353
- // Compute number of days given a year, month, date.
354
- // Note that month and date can lie outside the normal range.
355
- // For example:
356
- // MakeDay(2007, -4, 20) --> MakeDay(2006, 8, 20)
357
- // MakeDay(2007, -33, 1) --> MakeDay(2004, 3, 1)
358
- // MakeDay(2007, 14, -50) --> MakeDay(2007, 8, 11)
359
- function MakeDay(year, month, date) {
360
- if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) return $NaN;
361
-
362
- // Conversion to integers.
363
- year = TO_INTEGER(year);
364
- month = TO_INTEGER(month);
365
- date = TO_INTEGER(date);
366
-
367
- // Overflow months into year.
368
- year = year + FLOOR(month/12);
369
- month = month % 12;
370
- if (month < 0) {
371
- month += 12;
372
- }
373
-
374
- // Return days relative to Jan 1 1970.
375
- return ToJulianDay(year, month, date) - kDayZeroInJulianDay;
376
- }
377
-
378
-
379
- // ECMA 262 - 15.9.1.13
380
- function MakeDate(day, time) {
381
- if (!$isFinite(day)) return $NaN;
382
- if (!$isFinite(time)) return $NaN;
383
- return day * msPerDay + time;
384
- }
385
-
386
-
387
- // ECMA 262 - 15.9.1.14
388
- function TimeClip(time) {
389
- if (!$isFinite(time)) return $NaN;
390
- if ($abs(time) > 8.64E15) return $NaN;
391
- return TO_INTEGER(time);
392
- }
393
-
394
-
395
- // The Date cache is used to limit the cost of parsing the same Date
396
- // strings over and over again.
397
- var Date_cache = {
398
- // Cached time value.
399
- time: $NaN,
400
- // Cached year when interpreting the time as a local time. Only
401
- // valid when the time matches cached time.
402
- year: $NaN,
403
- // String input for which the cached time is valid.
404
- string: null
405
- };
406
-
407
-
408
- %SetCode($Date, function(year, month, date, hours, minutes, seconds, ms) {
409
- if (!%_IsConstructCall()) {
410
- // ECMA 262 - 15.9.2
411
- return (new $Date()).toString();
412
- }
413
-
414
- // ECMA 262 - 15.9.3
415
- var argc = %_ArgumentsLength();
416
- var value;
417
- if (argc == 0) {
418
- value = %DateCurrentTime();
419
-
420
- } else if (argc == 1) {
421
- if (IS_NUMBER(year)) {
422
- value = TimeClip(year);
423
-
424
- } else if (IS_STRING(year)) {
425
- // Probe the Date cache. If we already have a time value for the
426
- // given time, we re-use that instead of parsing the string again.
427
- var cache = Date_cache;
428
- if (cache.string === year) {
429
- value = cache.time;
430
- } else {
431
- value = DateParse(year);
432
- if (!NUMBER_IS_NAN(value)) {
433
- cache.time = value;
434
- cache.year = YEAR_FROM_TIME(LocalTimeNoCheck(value));
435
- cache.string = year;
436
- }
437
- }
438
-
439
- } else {
440
- // According to ECMA 262, no hint should be given for this
441
- // conversion. However, ToPrimitive defaults to STRING_HINT for
442
- // Date objects which will lose precision when the Date
443
- // constructor is called with another Date object as its
444
- // argument. We therefore use NUMBER_HINT for the conversion,
445
- // which is the default for everything else than Date objects.
446
- // This makes us behave like KJS and SpiderMonkey.
447
- var time = ToPrimitive(year, NUMBER_HINT);
448
- value = IS_STRING(time) ? DateParse(time) : TimeClip(ToNumber(time));
449
- }
450
-
451
- } else {
452
- year = ToNumber(year);
453
- month = ToNumber(month);
454
- date = argc > 2 ? ToNumber(date) : 1;
455
- hours = argc > 3 ? ToNumber(hours) : 0;
456
- minutes = argc > 4 ? ToNumber(minutes) : 0;
457
- seconds = argc > 5 ? ToNumber(seconds) : 0;
458
- ms = argc > 6 ? ToNumber(ms) : 0;
459
- year = (!NUMBER_IS_NAN(year) && 0 <= TO_INTEGER(year) && TO_INTEGER(year) <= 99)
460
- ? 1900 + TO_INTEGER(year) : year;
461
- var day = MakeDay(year, month, date);
462
- var time = MakeTime(hours, minutes, seconds, ms);
463
- value = TimeClip(UTC(MakeDate(day, time)));
464
- }
465
- %_SetValueOf(this, value);
466
- });
467
-
468
-
469
- // Helper functions.
470
- function GetTimeFrom(aDate) {
471
- return DATE_VALUE(aDate);
472
- }
473
-
474
- function GetMillisecondsFrom(aDate) {
475
- var t = DATE_VALUE(aDate);
476
- if (NUMBER_IS_NAN(t)) return t;
477
- return MS_FROM_TIME(LocalTimeNoCheck(t));
478
- }
479
-
480
-
481
- function GetUTCMillisecondsFrom(aDate) {
482
- var t = DATE_VALUE(aDate);
483
- if (NUMBER_IS_NAN(t)) return t;
484
- return MS_FROM_TIME(t);
485
- }
486
-
487
-
488
- function GetSecondsFrom(aDate) {
489
- var t = DATE_VALUE(aDate);
490
- if (NUMBER_IS_NAN(t)) return t;
491
- return SEC_FROM_TIME(LocalTimeNoCheck(t));
492
- }
493
-
494
-
495
- function GetUTCSecondsFrom(aDate) {
496
- var t = DATE_VALUE(aDate);
497
- if (NUMBER_IS_NAN(t)) return t;
498
- return SEC_FROM_TIME(t);
499
- }
500
-
501
-
502
- function GetMinutesFrom(aDate) {
503
- var t = DATE_VALUE(aDate);
504
- if (NUMBER_IS_NAN(t)) return t;
505
- return MIN_FROM_TIME(LocalTimeNoCheck(t));
506
- }
507
-
508
-
509
- function GetUTCMinutesFrom(aDate) {
510
- var t = DATE_VALUE(aDate);
511
- if (NUMBER_IS_NAN(t)) return t;
512
- return MIN_FROM_TIME(t);
513
- }
514
-
515
-
516
- function GetHoursFrom(aDate) {
517
- var t = DATE_VALUE(aDate);
518
- if (NUMBER_IS_NAN(t)) return t;
519
- return HOUR_FROM_TIME(LocalTimeNoCheck(t));
520
- }
521
-
522
-
523
- function GetUTCHoursFrom(aDate) {
524
- var t = DATE_VALUE(aDate);
525
- if (NUMBER_IS_NAN(t)) return t;
526
- return HOUR_FROM_TIME(t);
527
- }
528
-
529
-
530
- function GetFullYearFrom(aDate) {
531
- var t = DATE_VALUE(aDate);
532
- if (NUMBER_IS_NAN(t)) return t;
533
- var cache = Date_cache;
534
- if (cache.time === t) return cache.year;
535
- return YEAR_FROM_TIME(LocalTimeNoCheck(t));
536
- }
537
-
538
-
539
- function GetUTCFullYearFrom(aDate) {
540
- var t = DATE_VALUE(aDate);
541
- if (NUMBER_IS_NAN(t)) return t;
542
- return YEAR_FROM_TIME(t);
543
- }
544
-
545
-
546
- function GetMonthFrom(aDate) {
547
- var t = DATE_VALUE(aDate);
548
- if (NUMBER_IS_NAN(t)) return t;
549
- return MONTH_FROM_TIME(LocalTimeNoCheck(t));
550
- }
551
-
552
-
553
- function GetUTCMonthFrom(aDate) {
554
- var t = DATE_VALUE(aDate);
555
- if (NUMBER_IS_NAN(t)) return t;
556
- return MONTH_FROM_TIME(t);
557
- }
558
-
559
-
560
- function GetDateFrom(aDate) {
561
- var t = DATE_VALUE(aDate);
562
- if (NUMBER_IS_NAN(t)) return t;
563
- return DATE_FROM_TIME(LocalTimeNoCheck(t));
564
- }
565
-
566
-
567
- function GetUTCDateFrom(aDate) {
568
- var t = DATE_VALUE(aDate);
569
- if (NUMBER_IS_NAN(t)) return t;
570
- return DATE_FROM_TIME(t);
571
- }
572
-
573
-
574
- %FunctionSetPrototype($Date, new $Date($NaN));
575
-
576
-
577
- var WeekDays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
578
- var Months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
579
-
580
-
581
- function TwoDigitString(value) {
582
- return value < 10 ? "0" + value : "" + value;
583
- }
584
-
585
-
586
- function DateString(time) {
587
- var YMD = FromJulianDay(DAY(time) + kDayZeroInJulianDay);
588
- return WeekDays[WeekDay(time)] + ' '
589
- + Months[YMD.month] + ' '
590
- + TwoDigitString(YMD.date) + ' '
591
- + YMD.year;
592
- }
593
-
594
-
595
- var LongWeekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
596
- var LongMonths = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
597
-
598
-
599
- function LongDateString(time) {
600
- var YMD = FromJulianDay(DAY(time) + kDayZeroInJulianDay);
601
- return LongWeekDays[WeekDay(time)] + ', '
602
- + LongMonths[YMD.month] + ' '
603
- + TwoDigitString(YMD.date) + ', '
604
- + YMD.year;
605
- }
606
-
607
-
608
- function TimeString(time) {
609
- return TwoDigitString(HOUR_FROM_TIME(time)) + ':'
610
- + TwoDigitString(MIN_FROM_TIME(time)) + ':'
611
- + TwoDigitString(SEC_FROM_TIME(time));
612
- }
613
-
614
-
615
- function LocalTimezoneString(time) {
616
- var timezoneOffset =
617
- (local_time_offset + DaylightSavingsOffset(time)) / msPerMinute;
618
- var sign = (timezoneOffset >= 0) ? 1 : -1;
619
- var hours = FLOOR((sign * timezoneOffset)/60);
620
- var min = FLOOR((sign * timezoneOffset)%60);
621
- var gmt = ' GMT' + ((sign == 1) ? '+' : '-') +
622
- TwoDigitString(hours) + TwoDigitString(min);
623
- return gmt + ' (' + LocalTimezone(time) + ')';
624
- }
625
-
626
-
627
- function DatePrintString(time) {
628
- return DateString(time) + ' ' + TimeString(time);
629
- }
630
-
631
- // -------------------------------------------------------------------
632
-
633
- // Reused output buffer. Used when parsing date strings.
634
- var parse_buffer = $Array(7);
635
-
636
- // ECMA 262 - 15.9.4.2
637
- function DateParse(string) {
638
- var arr = %DateParseString(ToString(string), parse_buffer);
639
- if (IS_NULL(arr)) return $NaN;
640
-
641
- var day = MakeDay(arr[0], arr[1], arr[2]);
642
- var time = MakeTime(arr[3], arr[4], arr[5], 0);
643
- var date = MakeDate(day, time);
644
-
645
- if (IS_NULL(arr[6])) {
646
- return TimeClip(UTC(date));
647
- } else {
648
- return TimeClip(date - arr[6] * 1000);
649
- }
650
- }
651
-
652
-
653
- // ECMA 262 - 15.9.4.3
654
- function DateUTC(year, month, date, hours, minutes, seconds, ms) {
655
- year = ToNumber(year);
656
- month = ToNumber(month);
657
- var argc = %_ArgumentsLength();
658
- date = argc > 2 ? ToNumber(date) : 1;
659
- hours = argc > 3 ? ToNumber(hours) : 0;
660
- minutes = argc > 4 ? ToNumber(minutes) : 0;
661
- seconds = argc > 5 ? ToNumber(seconds) : 0;
662
- ms = argc > 6 ? ToNumber(ms) : 0;
663
- year = (!NUMBER_IS_NAN(year) && 0 <= TO_INTEGER(year) && TO_INTEGER(year) <= 99)
664
- ? 1900 + TO_INTEGER(year) : year;
665
- var day = MakeDay(year, month, date);
666
- var time = MakeTime(hours, minutes, seconds, ms);
667
- return %_SetValueOf(this, TimeClip(MakeDate(day, time)));
668
- }
669
-
670
-
671
- // Mozilla-specific extension. Returns the number of milliseconds
672
- // elapsed since 1 January 1970 00:00:00 UTC.
673
- function DateNow() {
674
- return %DateCurrentTime();
675
- }
676
-
677
-
678
- // ECMA 262 - 15.9.5.2
679
- function DateToString() {
680
- var t = DATE_VALUE(this);
681
- if (NUMBER_IS_NAN(t)) return kInvalidDate;
682
- return DatePrintString(LocalTimeNoCheck(t)) + LocalTimezoneString(t);
683
- }
684
-
685
-
686
- // ECMA 262 - 15.9.5.3
687
- function DateToDateString() {
688
- var t = DATE_VALUE(this);
689
- if (NUMBER_IS_NAN(t)) return kInvalidDate;
690
- return DateString(LocalTimeNoCheck(t));
691
- }
692
-
693
-
694
- // ECMA 262 - 15.9.5.4
695
- function DateToTimeString() {
696
- var t = DATE_VALUE(this);
697
- if (NUMBER_IS_NAN(t)) return kInvalidDate;
698
- var lt = LocalTimeNoCheck(t);
699
- return TimeString(lt) + LocalTimezoneString(lt);
700
- }
701
-
702
-
703
- // ECMA 262 - 15.9.5.5
704
- function DateToLocaleString() {
705
- return DateToString.call(this);
706
- }
707
-
708
-
709
- // ECMA 262 - 15.9.5.6
710
- function DateToLocaleDateString() {
711
- var t = DATE_VALUE(this);
712
- if (NUMBER_IS_NAN(t)) return kInvalidDate;
713
- return LongDateString(LocalTimeNoCheck(t));
714
- }
715
-
716
-
717
- // ECMA 262 - 15.9.5.7
718
- function DateToLocaleTimeString() {
719
- var t = DATE_VALUE(this);
720
- if (NUMBER_IS_NAN(t)) return kInvalidDate;
721
- var lt = LocalTimeNoCheck(t);
722
- return TimeString(lt);
723
- }
724
-
725
-
726
- // ECMA 262 - 15.9.5.8
727
- function DateValueOf() {
728
- return DATE_VALUE(this);
729
- }
730
-
731
-
732
- // ECMA 262 - 15.9.5.9
733
- function DateGetTime() {
734
- return DATE_VALUE(this);
735
- }
736
-
737
-
738
- // ECMA 262 - 15.9.5.10
739
- function DateGetFullYear() {
740
- return GetFullYearFrom(this)
741
- }
742
-
743
-
744
- // ECMA 262 - 15.9.5.11
745
- function DateGetUTCFullYear() {
746
- return GetUTCFullYearFrom(this)
747
- }
748
-
749
-
750
- // ECMA 262 - 15.9.5.12
751
- function DateGetMonth() {
752
- return GetMonthFrom(this);
753
- }
754
-
755
-
756
- // ECMA 262 - 15.9.5.13
757
- function DateGetUTCMonth() {
758
- return GetUTCMonthFrom(this);
759
- }
760
-
761
-
762
- // ECMA 262 - 15.9.5.14
763
- function DateGetDate() {
764
- return GetDateFrom(this);
765
- }
766
-
767
-
768
- // ECMA 262 - 15.9.5.15
769
- function DateGetUTCDate() {
770
- return GetUTCDateFrom(this);
771
- }
772
-
773
-
774
- // ECMA 262 - 15.9.5.16
775
- function DateGetDay() {
776
- var t = %_ValueOf(this);
777
- if (NUMBER_IS_NAN(t)) return t;
778
- return WeekDay(LocalTimeNoCheck(t));
779
- }
780
-
781
-
782
- // ECMA 262 - 15.9.5.17
783
- function DateGetUTCDay() {
784
- var t = %_ValueOf(this);
785
- if (NUMBER_IS_NAN(t)) return t;
786
- return WeekDay(t);
787
- }
788
-
789
-
790
- // ECMA 262 - 15.9.5.18
791
- function DateGetHours() {
792
- return GetHoursFrom(this);
793
- }
794
-
795
-
796
- // ECMA 262 - 15.9.5.19
797
- function DateGetUTCHours() {
798
- return GetUTCHoursFrom(this);
799
- }
800
-
801
-
802
- // ECMA 262 - 15.9.5.20
803
- function DateGetMinutes() {
804
- return GetMinutesFrom(this);
805
- }
806
-
807
-
808
- // ECMA 262 - 15.9.5.21
809
- function DateGetUTCMinutes() {
810
- return GetUTCMinutesFrom(this);
811
- }
812
-
813
-
814
- // ECMA 262 - 15.9.5.22
815
- function DateGetSeconds() {
816
- return GetSecondsFrom(this);
817
- }
818
-
819
-
820
- // ECMA 262 - 15.9.5.23
821
- function DateGetUTCSeconds() {
822
- return GetUTCSecondsFrom(this);
823
- }
824
-
825
-
826
- // ECMA 262 - 15.9.5.24
827
- function DateGetMilliseconds() {
828
- return GetMillisecondsFrom(this);
829
- }
830
-
831
-
832
- // ECMA 262 - 15.9.5.25
833
- function DateGetUTCMilliseconds() {
834
- return GetUTCMillisecondsFrom(this);
835
- }
836
-
837
-
838
- // ECMA 262 - 15.9.5.26
839
- function DateGetTimezoneOffset() {
840
- var t = DATE_VALUE(this);
841
- if (NUMBER_IS_NAN(t)) return t;
842
- return (t - LocalTimeNoCheck(t)) / msPerMinute;
843
- }
844
-
845
-
846
- // ECMA 262 - 15.9.5.27
847
- function DateSetTime(ms) {
848
- if (!IS_DATE(this)) ThrowDateTypeError();
849
- return %_SetValueOf(this, TimeClip(ToNumber(ms)));
850
- }
851
-
852
-
853
- // ECMA 262 - 15.9.5.28
854
- function DateSetMilliseconds(ms) {
855
- var t = LocalTime(DATE_VALUE(this));
856
- ms = ToNumber(ms);
857
- var time = MakeTime(HOUR_FROM_TIME(t), MIN_FROM_TIME(t), SEC_FROM_TIME(t), ms);
858
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(DAY(t), time))));
859
- }
860
-
861
-
862
- // ECMA 262 - 15.9.5.29
863
- function DateSetUTCMilliseconds(ms) {
864
- var t = DATE_VALUE(this);
865
- ms = ToNumber(ms);
866
- var time = MakeTime(HOUR_FROM_TIME(t), MIN_FROM_TIME(t), SEC_FROM_TIME(t), ms);
867
- return %_SetValueOf(this, TimeClip(MakeDate(DAY(t), time)));
868
- }
869
-
870
-
871
- // ECMA 262 - 15.9.5.30
872
- function DateSetSeconds(sec, ms) {
873
- var t = LocalTime(DATE_VALUE(this));
874
- sec = ToNumber(sec);
875
- ms = %_ArgumentsLength() < 2 ? GetMillisecondsFrom(this) : ToNumber(ms);
876
- var time = MakeTime(HOUR_FROM_TIME(t), MIN_FROM_TIME(t), sec, ms);
877
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(DAY(t), time))));
878
- }
879
-
880
-
881
- // ECMA 262 - 15.9.5.31
882
- function DateSetUTCSeconds(sec, ms) {
883
- var t = DATE_VALUE(this);
884
- sec = ToNumber(sec);
885
- ms = %_ArgumentsLength() < 2 ? GetUTCMillisecondsFrom(this) : ToNumber(ms);
886
- var time = MakeTime(HOUR_FROM_TIME(t), MIN_FROM_TIME(t), sec, ms);
887
- return %_SetValueOf(this, TimeClip(MakeDate(DAY(t), time)));
888
- }
889
-
890
-
891
- // ECMA 262 - 15.9.5.33
892
- function DateSetMinutes(min, sec, ms) {
893
- var t = LocalTime(DATE_VALUE(this));
894
- min = ToNumber(min);
895
- var argc = %_ArgumentsLength();
896
- sec = argc < 2 ? GetSecondsFrom(this) : ToNumber(sec);
897
- ms = argc < 3 ? GetMillisecondsFrom(this) : ToNumber(ms);
898
- var time = MakeTime(HOUR_FROM_TIME(t), min, sec, ms);
899
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(DAY(t), time))));
900
- }
901
-
902
-
903
- // ECMA 262 - 15.9.5.34
904
- function DateSetUTCMinutes(min, sec, ms) {
905
- var t = DATE_VALUE(this);
906
- min = ToNumber(min);
907
- var argc = %_ArgumentsLength();
908
- sec = argc < 2 ? GetUTCSecondsFrom(this) : ToNumber(sec);
909
- ms = argc < 3 ? GetUTCMillisecondsFrom(this) : ToNumber(ms);
910
- var time = MakeTime(HOUR_FROM_TIME(t), min, sec, ms);
911
- return %_SetValueOf(this, TimeClip(MakeDate(DAY(t), time)));
912
- }
913
-
914
-
915
- // ECMA 262 - 15.9.5.35
916
- function DateSetHours(hour, min, sec, ms) {
917
- var t = LocalTime(DATE_VALUE(this));
918
- hour = ToNumber(hour);
919
- var argc = %_ArgumentsLength();
920
- min = argc < 2 ? GetMinutesFrom(this) : ToNumber(min);
921
- sec = argc < 3 ? GetSecondsFrom(this) : ToNumber(sec);
922
- ms = argc < 4 ? GetMillisecondsFrom(this) : ToNumber(ms);
923
- var time = MakeTime(hour, min, sec, ms);
924
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(DAY(t), time))));
925
- }
926
-
927
-
928
- // ECMA 262 - 15.9.5.34
929
- function DateSetUTCHours(hour, min, sec, ms) {
930
- var t = DATE_VALUE(this);
931
- hour = ToNumber(hour);
932
- var argc = %_ArgumentsLength();
933
- min = argc < 2 ? GetUTCMinutesFrom(this) : ToNumber(min);
934
- sec = argc < 3 ? GetUTCSecondsFrom(this) : ToNumber(sec);
935
- ms = argc < 4 ? GetUTCMillisecondsFrom(this) : ToNumber(ms);
936
- var time = MakeTime(hour, min, sec, ms);
937
- return %_SetValueOf(this, TimeClip(MakeDate(DAY(t), time)));
938
- }
939
-
940
-
941
- // ECMA 262 - 15.9.5.36
942
- function DateSetDate(date) {
943
- var t = LocalTime(DATE_VALUE(this));
944
- date = ToNumber(date);
945
- var day = MakeDay(YEAR_FROM_TIME(t), MONTH_FROM_TIME(t), date);
946
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
947
- }
948
-
949
-
950
- // ECMA 262 - 15.9.5.37
951
- function DateSetUTCDate(date) {
952
- var t = DATE_VALUE(this);
953
- date = ToNumber(date);
954
- var day = MakeDay(YEAR_FROM_TIME(t), MONTH_FROM_TIME(t), date);
955
- return %_SetValueOf(this, TimeClip(MakeDate(day, TimeWithinDay(t))));
956
- }
957
-
958
-
959
- // ECMA 262 - 15.9.5.38
960
- function DateSetMonth(month, date) {
961
- var t = LocalTime(DATE_VALUE(this));
962
- month = ToNumber(month);
963
- date = %_ArgumentsLength() < 2 ? GetDateFrom(this) : ToNumber(date);
964
- var day = MakeDay(YEAR_FROM_TIME(t), month, date);
965
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
966
- }
967
-
968
-
969
- // ECMA 262 - 15.9.5.39
970
- function DateSetUTCMonth(month, date) {
971
- var t = DATE_VALUE(this);
972
- month = ToNumber(month);
973
- date = %_ArgumentsLength() < 2 ? GetUTCDateFrom(this) : ToNumber(date);
974
- var day = MakeDay(YEAR_FROM_TIME(t), month, date);
975
- return %_SetValueOf(this, TimeClip(MakeDate(day, TimeWithinDay(t))));
976
- }
977
-
978
-
979
- // ECMA 262 - 15.9.5.40
980
- function DateSetFullYear(year, month, date) {
981
- var t = DATE_VALUE(this);
982
- t = NUMBER_IS_NAN(t) ? 0 : LocalTimeNoCheck(t);
983
- year = ToNumber(year);
984
- var argc = %_ArgumentsLength();
985
- month = argc < 2 ? MONTH_FROM_TIME(t) : ToNumber(month);
986
- date = argc < 3 ? DATE_FROM_TIME(t) : ToNumber(date);
987
- var day = MakeDay(year, month, date);
988
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
989
- }
990
-
991
-
992
- // ECMA 262 - 15.9.5.41
993
- function DateSetUTCFullYear(year, month, date) {
994
- var t = DATE_VALUE(this);
995
- if (NUMBER_IS_NAN(t)) t = 0;
996
- var argc = %_ArgumentsLength();
997
- year = ToNumber(year);
998
- month = argc < 2 ? MONTH_FROM_TIME(t) : ToNumber(month);
999
- date = argc < 3 ? DATE_FROM_TIME(t) : ToNumber(date);
1000
- var day = MakeDay(year, month, date);
1001
- return %_SetValueOf(this, TimeClip(MakeDate(day, TimeWithinDay(t))));
1002
- }
1003
-
1004
-
1005
- // ECMA 262 - 15.9.5.42
1006
- function DateToUTCString() {
1007
- var t = DATE_VALUE(this);
1008
- if (NUMBER_IS_NAN(t)) return kInvalidDate;
1009
- // Return UTC string of the form: Sat, 31 Jan 1970 23:00:00 GMT
1010
- return WeekDays[WeekDay(t)] + ', '
1011
- + TwoDigitString(DATE_FROM_TIME(t)) + ' '
1012
- + Months[MONTH_FROM_TIME(t)] + ' '
1013
- + YEAR_FROM_TIME(t) + ' '
1014
- + TimeString(t) + ' GMT';
1015
- }
1016
-
1017
-
1018
- // ECMA 262 - B.2.4
1019
- function DateGetYear() {
1020
- var t = DATE_VALUE(this);
1021
- if (NUMBER_IS_NAN(t)) return $NaN;
1022
- return YEAR_FROM_TIME(LocalTimeNoCheck(t)) - 1900;
1023
- }
1024
-
1025
-
1026
- // ECMA 262 - B.2.5
1027
- function DateSetYear(year) {
1028
- var t = LocalTime(DATE_VALUE(this));
1029
- if (NUMBER_IS_NAN(t)) t = 0;
1030
- year = ToNumber(year);
1031
- if (NUMBER_IS_NAN(year)) return %_SetValueOf(this, $NaN);
1032
- year = (0 <= TO_INTEGER(year) && TO_INTEGER(year) <= 99)
1033
- ? 1900 + TO_INTEGER(year) : year;
1034
- var day = MakeDay(year, MONTH_FROM_TIME(t), DATE_FROM_TIME(t));
1035
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
1036
- }
1037
-
1038
-
1039
- // ECMA 262 - B.2.6
1040
- //
1041
- // Notice that this does not follow ECMA 262 completely. ECMA 262
1042
- // says that toGMTString should be the same Function object as
1043
- // toUTCString. JSC does not do this, so for compatibility we do not
1044
- // do that either. Instead, we create a new function whose name
1045
- // property will return toGMTString.
1046
- function DateToGMTString() {
1047
- return DateToUTCString.call(this);
1048
- }
1049
-
1050
-
1051
- function PadInt(n, digits) {
1052
- if (digits == 1) return n;
1053
- return n < MathPow(10, digits - 1) ? '0' + PadInt(n, digits - 1) : n;
1054
- }
1055
-
1056
-
1057
- function DateToISOString() {
1058
- var t = DATE_VALUE(this);
1059
- if (NUMBER_IS_NAN(t)) return kInvalidDate;
1060
- return this.getUTCFullYear() + '-' + PadInt(this.getUTCMonth() + 1, 2) +
1061
- '-' + PadInt(this.getUTCDate(), 2) + 'T' + PadInt(this.getUTCHours(), 2) +
1062
- ':' + PadInt(this.getUTCMinutes(), 2) + ':' + PadInt(this.getUTCSeconds(), 2) +
1063
- '.' + PadInt(this.getUTCMilliseconds(), 3) +
1064
- 'Z';
1065
- }
1066
-
1067
-
1068
- function DateToJSON(key) {
1069
- return CheckJSONPrimitive(this.toISOString());
1070
- }
1071
-
1072
-
1073
- // -------------------------------------------------------------------
1074
-
1075
- function SetupDate() {
1076
- // Setup non-enumerable properties of the Date object itself.
1077
- InstallFunctions($Date, DONT_ENUM, $Array(
1078
- "UTC", DateUTC,
1079
- "parse", DateParse,
1080
- "now", DateNow
1081
- ));
1082
-
1083
- // Setup non-enumerable constructor property of the Date prototype object.
1084
- %SetProperty($Date.prototype, "constructor", $Date, DONT_ENUM);
1085
-
1086
- // Setup non-enumerable functions of the Date prototype object and
1087
- // set their names.
1088
- InstallFunctionsOnHiddenPrototype($Date.prototype, DONT_ENUM, $Array(
1089
- "toString", DateToString,
1090
- "toDateString", DateToDateString,
1091
- "toTimeString", DateToTimeString,
1092
- "toLocaleString", DateToLocaleString,
1093
- "toLocaleDateString", DateToLocaleDateString,
1094
- "toLocaleTimeString", DateToLocaleTimeString,
1095
- "valueOf", DateValueOf,
1096
- "getTime", DateGetTime,
1097
- "getFullYear", DateGetFullYear,
1098
- "getUTCFullYear", DateGetUTCFullYear,
1099
- "getMonth", DateGetMonth,
1100
- "getUTCMonth", DateGetUTCMonth,
1101
- "getDate", DateGetDate,
1102
- "getUTCDate", DateGetUTCDate,
1103
- "getDay", DateGetDay,
1104
- "getUTCDay", DateGetUTCDay,
1105
- "getHours", DateGetHours,
1106
- "getUTCHours", DateGetUTCHours,
1107
- "getMinutes", DateGetMinutes,
1108
- "getUTCMinutes", DateGetUTCMinutes,
1109
- "getSeconds", DateGetSeconds,
1110
- "getUTCSeconds", DateGetUTCSeconds,
1111
- "getMilliseconds", DateGetMilliseconds,
1112
- "getUTCMilliseconds", DateGetUTCMilliseconds,
1113
- "getTimezoneOffset", DateGetTimezoneOffset,
1114
- "setTime", DateSetTime,
1115
- "setMilliseconds", DateSetMilliseconds,
1116
- "setUTCMilliseconds", DateSetUTCMilliseconds,
1117
- "setSeconds", DateSetSeconds,
1118
- "setUTCSeconds", DateSetUTCSeconds,
1119
- "setMinutes", DateSetMinutes,
1120
- "setUTCMinutes", DateSetUTCMinutes,
1121
- "setHours", DateSetHours,
1122
- "setUTCHours", DateSetUTCHours,
1123
- "setDate", DateSetDate,
1124
- "setUTCDate", DateSetUTCDate,
1125
- "setMonth", DateSetMonth,
1126
- "setUTCMonth", DateSetUTCMonth,
1127
- "setFullYear", DateSetFullYear,
1128
- "setUTCFullYear", DateSetUTCFullYear,
1129
- "toGMTString", DateToGMTString,
1130
- "toUTCString", DateToUTCString,
1131
- "getYear", DateGetYear,
1132
- "setYear", DateSetYear,
1133
- "toISOString", DateToISOString,
1134
- "toJSON", DateToJSON
1135
- ));
1136
- }
1137
-
1138
- SetupDate();