coffeecake 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1336) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/README.markdown +28 -0
  4. data/Rakefile +2 -0
  5. data/bin/ck +16 -0
  6. data/coffeecake.gemspec +21 -0
  7. data/lib/coffeecake.rb +4 -0
  8. data/lib/coffeecake/generators.rb +12 -0
  9. data/lib/coffeecake/generators/new_generator.rb +55 -0
  10. data/lib/coffeecake/templates/.gitkeep +0 -0
  11. data/lib/coffeecake/templates/README.markdown +56 -0
  12. data/lib/coffeecake/templates/SpecHelper.tt +0 -0
  13. data/lib/coffeecake/templates/docs_readme +5 -0
  14. data/lib/coffeecake/templates/jasmine.tt +18 -0
  15. data/lib/coffeecake/templates/lib.tt +3 -0
  16. data/lib/coffeecake/templates/spec.tt +3 -0
  17. data/lib/coffeecake/version.rb +3 -0
  18. data/lib/thor_register_patch.rb +16 -0
  19. data/node_modules/.bin/cake +7 -0
  20. data/node_modules/.bin/coffee +7 -0
  21. data/node_modules/.bin/docco +8 -0
  22. data/node_modules/.bin/jasmine +26 -0
  23. data/node_modules/.bin/jasmine-node +7 -0
  24. data/node_modules/.bin/uglifycss +127 -0
  25. data/node_modules/.bin/uglifyjs +317 -0
  26. data/node_modules/coffee-script/.npmignore +11 -0
  27. data/node_modules/coffee-script/LICENSE +22 -0
  28. data/node_modules/coffee-script/README +51 -0
  29. data/node_modules/coffee-script/Rakefile +78 -0
  30. data/node_modules/coffee-script/bin/cake +7 -0
  31. data/node_modules/coffee-script/bin/coffee +7 -0
  32. data/node_modules/coffee-script/extras/jsl.conf +44 -0
  33. data/node_modules/coffee-script/lib/coffee-script/browser.js +74 -0
  34. data/node_modules/coffee-script/lib/coffee-script/cake.js +89 -0
  35. data/node_modules/coffee-script/lib/coffee-script/coffee-script.js +148 -0
  36. data/node_modules/coffee-script/lib/coffee-script/command.js +310 -0
  37. data/node_modules/coffee-script/lib/coffee-script/grammar.js +588 -0
  38. data/node_modules/coffee-script/lib/coffee-script/helpers.js +72 -0
  39. data/node_modules/coffee-script/lib/coffee-script/index.js +10 -0
  40. data/node_modules/coffee-script/lib/coffee-script/lexer.js +687 -0
  41. data/node_modules/coffee-script/lib/coffee-script/nodes.js +2481 -0
  42. data/node_modules/coffee-script/lib/coffee-script/optparse.js +122 -0
  43. data/node_modules/coffee-script/lib/coffee-script/parser.js +670 -0
  44. data/node_modules/coffee-script/lib/coffee-script/repl.js +149 -0
  45. data/node_modules/coffee-script/lib/coffee-script/rewriter.js +288 -0
  46. data/node_modules/coffee-script/lib/coffee-script/scope.js +124 -0
  47. data/node_modules/coffee-script/npm-install-45965.sh +282 -0
  48. data/node_modules/coffee-script/package.json +31 -0
  49. data/node_modules/docco/.gitignore +3 -0
  50. data/node_modules/docco/Cakefile +27 -0
  51. data/node_modules/docco/README +13 -0
  52. data/node_modules/docco/bin/docco +8 -0
  53. data/node_modules/docco/index.html +143 -0
  54. data/node_modules/docco/lib/docco.js +155 -0
  55. data/node_modules/docco/package.json +21 -0
  56. data/node_modules/docco/resources/docco.css +186 -0
  57. data/node_modules/docco/resources/docco.jst +58 -0
  58. data/node_modules/docco/src/docco.coffee +204 -0
  59. data/node_modules/docco/vendor/showdown.js +1298 -0
  60. data/node_modules/jasmine-jquery/.gitignore +3 -0
  61. data/node_modules/jasmine-jquery/MIT.LICENSE +20 -0
  62. data/node_modules/jasmine-jquery/README.markdown +174 -0
  63. data/node_modules/jasmine-jquery/SpecRunner.html +24 -0
  64. data/node_modules/jasmine-jquery/index.js +15 -0
  65. data/node_modules/jasmine-jquery/lib/jasmine-jquery.js +288 -0
  66. data/node_modules/jasmine-jquery/package.json +19 -0
  67. data/node_modules/jasmine-jquery/spec/fixtures/real_non_mocked_fixture.html +1 -0
  68. data/node_modules/jasmine-jquery/spec/suites/jasmine-jquery-spec.js +691 -0
  69. data/node_modules/jasmine-node/.gitignore +10 -0
  70. data/node_modules/jasmine-node/LICENSE +22 -0
  71. data/node_modules/jasmine-node/README.md +35 -0
  72. data/node_modules/jasmine-node/bin/jasmine-node +7 -0
  73. data/node_modules/jasmine-node/lib/jasmine-node/cli.js +110 -0
  74. data/node_modules/jasmine-node/lib/jasmine-node/index.js +171 -0
  75. data/node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js +2479 -0
  76. data/node_modules/jasmine-node/lib/jasmine-node/reporter.js +177 -0
  77. data/node_modules/jasmine-node/package.json +22 -0
  78. data/node_modules/jasmine-node/spec/CoffeeSpec.coffee +4 -0
  79. data/node_modules/jasmine-node/spec/SampleSpecs.js +15 -0
  80. data/node_modules/jasmine-node/spec/TestSpec.js +5 -0
  81. data/node_modules/jasmine-node/spec/helper_spec.js +7 -0
  82. data/node_modules/jasmine-node/spec/include/include_spec.js +7 -0
  83. data/node_modules/jasmine-node/spec/include/lib/test.js +3 -0
  84. data/node_modules/jasmine-node/spec/nested.js/NestedSpec.js +5 -0
  85. data/node_modules/jasmine-node/spec/nested/NestedSpec.js +5 -0
  86. data/node_modules/jasmine-node/spec/nested/uber-nested/UberNestedSpec.js +11 -0
  87. data/node_modules/jasmine-node/spec/sample_helper.js +19 -0
  88. data/node_modules/jasmine-node/specs.sh +2 -0
  89. data/node_modules/jasmine-reporters/.gitignore +1 -0
  90. data/node_modules/jasmine-reporters/.gitmodules +3 -0
  91. data/node_modules/jasmine-reporters/LICENSE +21 -0
  92. data/node_modules/jasmine-reporters/README.markdown +52 -0
  93. data/node_modules/jasmine-reporters/ext/env.rhino.1.2.js +13989 -0
  94. data/node_modules/jasmine-reporters/ext/jasmine-html.js +182 -0
  95. data/node_modules/jasmine-reporters/ext/jasmine.css +166 -0
  96. data/node_modules/jasmine-reporters/ext/jasmine.js +2421 -0
  97. data/node_modules/jasmine-reporters/ext/jline.jar +0 -0
  98. data/node_modules/jasmine-reporters/ext/js.jar +0 -0
  99. data/node_modules/jasmine-reporters/ext/phantomjs/.gitignore +10 -0
  100. data/node_modules/jasmine-reporters/ext/phantomjs/ChangeLog +57 -0
  101. data/node_modules/jasmine-reporters/ext/phantomjs/LICENSE.BSD +22 -0
  102. data/node_modules/jasmine-reporters/ext/phantomjs/README.md +28 -0
  103. data/node_modules/jasmine-reporters/ext/phantomjs/examples/arguments.coffee +6 -0
  104. data/node_modules/jasmine-reporters/ext/phantomjs/examples/arguments.js +8 -0
  105. data/node_modules/jasmine-reporters/ext/phantomjs/examples/colorwheel.coffee +45 -0
  106. data/node_modules/jasmine-reporters/ext/phantomjs/examples/colorwheel.js +52 -0
  107. data/node_modules/jasmine-reporters/ext/phantomjs/examples/countdown.coffee +8 -0
  108. data/node_modules/jasmine-reporters/ext/phantomjs/examples/countdown.js +8 -0
  109. data/node_modules/jasmine-reporters/ext/phantomjs/examples/cycle_multiple_urls.js +64 -0
  110. data/node_modules/jasmine-reporters/ext/phantomjs/examples/direction.coffee +28 -0
  111. data/node_modules/jasmine-reporters/ext/phantomjs/examples/direction.js +34 -0
  112. data/node_modules/jasmine-reporters/ext/phantomjs/examples/extract-text.coffee +81 -0
  113. data/node_modules/jasmine-reporters/ext/phantomjs/examples/extract-text.js +121 -0
  114. data/node_modules/jasmine-reporters/ext/phantomjs/examples/fibo.coffee +8 -0
  115. data/node_modules/jasmine-reporters/ext/phantomjs/examples/fibo.js +9 -0
  116. data/node_modules/jasmine-reporters/ext/phantomjs/examples/follow.coffee +36 -0
  117. data/node_modules/jasmine-reporters/ext/phantomjs/examples/follow.js +37 -0
  118. data/node_modules/jasmine-reporters/ext/phantomjs/examples/hello.coffee +2 -0
  119. data/node_modules/jasmine-reporters/ext/phantomjs/examples/hello.js +2 -0
  120. data/node_modules/jasmine-reporters/ext/phantomjs/examples/ipgeocode.coffee +13 -0
  121. data/node_modules/jasmine-reporters/ext/phantomjs/examples/ipgeocode.js +14 -0
  122. data/node_modules/jasmine-reporters/ext/phantomjs/examples/loadspeed.coffee +17 -0
  123. data/node_modules/jasmine-reporters/ext/phantomjs/examples/loadspeed.js +20 -0
  124. data/node_modules/jasmine-reporters/ext/phantomjs/examples/movies.coffee +13 -0
  125. data/node_modules/jasmine-reporters/ext/phantomjs/examples/movies.js +14 -0
  126. data/node_modules/jasmine-reporters/ext/phantomjs/examples/pizza.coffee +10 -0
  127. data/node_modules/jasmine-reporters/ext/phantomjs/examples/pizza.js +12 -0
  128. data/node_modules/jasmine-reporters/ext/phantomjs/examples/rasterize.coffee +21 -0
  129. data/node_modules/jasmine-reporters/ext/phantomjs/examples/rasterize.js +22 -0
  130. data/node_modules/jasmine-reporters/ext/phantomjs/examples/run-jasmine.js +26 -0
  131. data/node_modules/jasmine-reporters/ext/phantomjs/examples/run-qunit.js +24 -0
  132. data/node_modules/jasmine-reporters/ext/phantomjs/examples/seasonfood.coffee +17 -0
  133. data/node_modules/jasmine-reporters/ext/phantomjs/examples/seasonfood.js +19 -0
  134. data/node_modules/jasmine-reporters/ext/phantomjs/examples/technews.coffee +13 -0
  135. data/node_modules/jasmine-reporters/ext/phantomjs/examples/technews.js +14 -0
  136. data/node_modules/jasmine-reporters/ext/phantomjs/examples/tweets.coffee +8 -0
  137. data/node_modules/jasmine-reporters/ext/phantomjs/examples/tweets.js +12 -0
  138. data/node_modules/jasmine-reporters/ext/phantomjs/examples/useragent.coffee +7 -0
  139. data/node_modules/jasmine-reporters/ext/phantomjs/examples/useragent.js +8 -0
  140. data/node_modules/jasmine-reporters/ext/phantomjs/examples/version.coffee +5 -0
  141. data/node_modules/jasmine-reporters/ext/phantomjs/examples/version.js +5 -0
  142. data/node_modules/jasmine-reporters/ext/phantomjs/examples/waitfor.coffee +40 -0
  143. data/node_modules/jasmine-reporters/ext/phantomjs/examples/waitfor.js +43 -0
  144. data/node_modules/jasmine-reporters/ext/phantomjs/examples/weather.coffee +35 -0
  145. data/node_modules/jasmine-reporters/ext/phantomjs/examples/weather.js +42 -0
  146. data/node_modules/jasmine-reporters/ext/phantomjs/phantomjs.pro +3 -0
  147. data/node_modules/jasmine-reporters/ext/phantomjs/python/INSTALL +20 -0
  148. data/node_modules/jasmine-reporters/ext/phantomjs/python/LICENSE +674 -0
  149. data/node_modules/jasmine-reporters/ext/phantomjs/python/README +56 -0
  150. data/node_modules/jasmine-reporters/ext/phantomjs/python/csconverter.py +41 -0
  151. data/node_modules/jasmine-reporters/ext/phantomjs/python/networkaccessmanager.py +84 -0
  152. data/node_modules/jasmine-reporters/ext/phantomjs/python/phantom.py +384 -0
  153. data/node_modules/jasmine-reporters/ext/phantomjs/python/plugincontroller.py +98 -0
  154. data/node_modules/jasmine-reporters/ext/phantomjs/python/plugins/__init__.py +1 -0
  155. data/node_modules/jasmine-reporters/ext/phantomjs/python/pyphantomjs.py +154 -0
  156. data/node_modules/jasmine-reporters/ext/phantomjs/python/resources.py +4160 -0
  157. data/node_modules/jasmine-reporters/ext/phantomjs/python/resources.qrc +6 -0
  158. data/node_modules/jasmine-reporters/ext/phantomjs/python/resources/coffee-script.js +8 -0
  159. data/node_modules/jasmine-reporters/ext/phantomjs/python/resources/pyphantomjs-icon.ico +0 -0
  160. data/node_modules/jasmine-reporters/ext/phantomjs/python/resources/pyphantomjs-icon.png +0 -0
  161. data/node_modules/jasmine-reporters/ext/phantomjs/python/tools/build_resources.sh +14 -0
  162. data/node_modules/jasmine-reporters/ext/phantomjs/python/tools/setup.py +52 -0
  163. data/node_modules/jasmine-reporters/ext/phantomjs/python/utils.py +126 -0
  164. data/node_modules/jasmine-reporters/ext/phantomjs/python/webpage.py +67 -0
  165. data/node_modules/jasmine-reporters/ext/phantomjs/src/coffee-script.js +8 -0
  166. data/node_modules/jasmine-reporters/ext/phantomjs/src/consts.h +39 -0
  167. data/node_modules/jasmine-reporters/ext/phantomjs/src/csconverter.cpp +61 -0
  168. data/node_modules/jasmine-reporters/ext/phantomjs/src/csconverter.h +47 -0
  169. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/config.h +1 -0
  170. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/egif_lib.c +1111 -0
  171. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gif.pri +20 -0
  172. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gif_err.c +120 -0
  173. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gif_hash.c +160 -0
  174. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gif_hash.h +59 -0
  175. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gif_lib.h +336 -0
  176. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gif_lib_private.h +59 -0
  177. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gifalloc.c +443 -0
  178. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gifwriter.cpp +126 -0
  179. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gifwriter.h +38 -0
  180. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/quantize.c +330 -0
  181. data/node_modules/jasmine-reporters/ext/phantomjs/src/main.cpp +64 -0
  182. data/node_modules/jasmine-reporters/ext/phantomjs/src/networkaccessmanager.cpp +119 -0
  183. data/node_modules/jasmine-reporters/ext/phantomjs/src/networkaccessmanager.h +53 -0
  184. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantom.cpp +494 -0
  185. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantom.h +117 -0
  186. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantomjs-icon.png +0 -0
  187. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantomjs.pro +32 -0
  188. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantomjs.qrc +7 -0
  189. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantomjs_os2.ico +0 -0
  190. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantomjs_os2.rc +1 -0
  191. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantomjs_win.ico +0 -0
  192. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantomjs_win.rc +1 -0
  193. data/node_modules/jasmine-reporters/ext/phantomjs/src/usage.txt +11 -0
  194. data/node_modules/jasmine-reporters/ext/phantomjs/src/utils.cpp +74 -0
  195. data/node_modules/jasmine-reporters/ext/phantomjs/src/utils.h +50 -0
  196. data/node_modules/jasmine-reporters/ext/phantomjs/src/webpage.cpp +87 -0
  197. data/node_modules/jasmine-reporters/ext/phantomjs/src/webpage.h +61 -0
  198. data/node_modules/jasmine-reporters/package.json +15 -0
  199. data/node_modules/jasmine-reporters/src/jasmine.console_reporter.js +132 -0
  200. data/node_modules/jasmine-reporters/src/jasmine.junit_reporter.js +199 -0
  201. data/node_modules/jasmine-reporters/src/load_reporters.js +2 -0
  202. data/node_modules/jasmine-reporters/test/JUnitXmlReporterSpec.js +214 -0
  203. data/node_modules/jasmine-reporters/test/console_reporter.html +36 -0
  204. data/node_modules/jasmine-reporters/test/envjs.bootstrap.js +14 -0
  205. data/node_modules/jasmine-reporters/test/envjs.runner.sh +7 -0
  206. data/node_modules/jasmine-reporters/test/junit_xml_reporter.html +23 -0
  207. data/node_modules/jasmine-reporters/test/phantomjs-testrunner.js +39 -0
  208. data/node_modules/jasmine-reporters/test/phantomjs.runner.sh +30 -0
  209. data/node_modules/jasmine-reporters/test/pyphantomjs-plugins/saveToFile/__init__.py +1 -0
  210. data/node_modules/jasmine-reporters/test/pyphantomjs-plugins/saveToFile/saveToFile.py +46 -0
  211. data/node_modules/jasmine-runner/README.md +42 -0
  212. data/node_modules/jasmine-runner/TODO.md +16 -0
  213. data/node_modules/jasmine-runner/bin/jasmine +26 -0
  214. data/node_modules/jasmine-runner/lib/ServerRoutes.js +70 -0
  215. data/node_modules/jasmine-runner/lib/TestRunner.js +29 -0
  216. data/node_modules/jasmine-runner/lib/browser.js +14 -0
  217. data/node_modules/jasmine-runner/lib/config.js +21 -0
  218. data/node_modules/jasmine-runner/lib/jasmine-runner.js +83 -0
  219. data/node_modules/jasmine-runner/lib/monitor.js +34 -0
  220. data/node_modules/jasmine-runner/lib/notify.js +48 -0
  221. data/node_modules/jasmine-runner/lib/public/control-frame.js +57 -0
  222. data/node_modules/jasmine-runner/lib/public/jasmine-html.js +188 -0
  223. data/node_modules/jasmine-runner/lib/public/jasmine.css +166 -0
  224. data/node_modules/jasmine-runner/lib/public/jasmine.js +2421 -0
  225. data/node_modules/jasmine-runner/lib/public/jquery-1.4.3.js +166 -0
  226. data/node_modules/jasmine-runner/lib/public/json2.js +482 -0
  227. data/node_modules/jasmine-runner/lib/public/run.js +6 -0
  228. data/node_modules/jasmine-runner/lib/reporters.js +31 -0
  229. data/node_modules/jasmine-runner/lib/server-worker.js +18 -0
  230. data/node_modules/jasmine-runner/lib/server.js +27 -0
  231. data/node_modules/jasmine-runner/lib/template/jasmine.json +18 -0
  232. data/node_modules/jasmine-runner/lib/template/public/javascript/Player.js +22 -0
  233. data/node_modules/jasmine-runner/lib/template/public/javascript/Song.js +7 -0
  234. data/node_modules/jasmine-runner/lib/template/spec/PlayerSpec.coffee +45 -0
  235. data/node_modules/jasmine-runner/lib/template/spec/PlayerSpec.js +58 -0
  236. data/node_modules/jasmine-runner/lib/template/spec/SpecHelper.js +9 -0
  237. data/node_modules/jasmine-runner/lib/testserver.js +26 -0
  238. data/node_modules/jasmine-runner/lib/views/control-frame.jade +7 -0
  239. data/node_modules/jasmine-runner/lib/views/index.jade +18 -0
  240. data/node_modules/jasmine-runner/node_modules/.bin/cake +7 -0
  241. data/node_modules/jasmine-runner/node_modules/.bin/coffee +7 -0
  242. data/node_modules/jasmine-runner/node_modules/.bin/express +451 -0
  243. data/node_modules/jasmine-runner/node_modules/.bin/jade +92 -0
  244. data/node_modules/jasmine-runner/node_modules/.bin/vows +421 -0
  245. data/node_modules/jasmine-runner/node_modules/coffee-script/.npmignore +11 -0
  246. data/node_modules/jasmine-runner/node_modules/coffee-script/LICENSE +22 -0
  247. data/node_modules/jasmine-runner/node_modules/coffee-script/README +47 -0
  248. data/node_modules/jasmine-runner/node_modules/coffee-script/Rakefile +78 -0
  249. data/node_modules/jasmine-runner/node_modules/coffee-script/bin/cake +7 -0
  250. data/node_modules/jasmine-runner/node_modules/coffee-script/bin/coffee +7 -0
  251. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/browser.js +52 -0
  252. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/cake.js +76 -0
  253. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/coffee-script.js +82 -0
  254. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/command.js +269 -0
  255. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/grammar.js +586 -0
  256. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/helpers.js +66 -0
  257. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/index.js +8 -0
  258. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/lexer.js +638 -0
  259. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/nodes.js +2181 -0
  260. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/optparse.js +111 -0
  261. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/parser.js +656 -0
  262. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/repl.js +47 -0
  263. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/rewriter.js +353 -0
  264. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/scope.js +120 -0
  265. data/node_modules/jasmine-runner/node_modules/coffee-script/package.json +22 -0
  266. data/node_modules/jasmine-runner/node_modules/colors/MIT-LICENSE.txt +20 -0
  267. data/node_modules/jasmine-runner/node_modules/colors/ReadMe.md +30 -0
  268. data/node_modules/jasmine-runner/node_modules/colors/colors.js +75 -0
  269. data/node_modules/jasmine-runner/node_modules/colors/example.js +6 -0
  270. data/node_modules/jasmine-runner/node_modules/colors/package.json +14 -0
  271. data/node_modules/jasmine-runner/node_modules/express/.npmignore +7 -0
  272. data/node_modules/jasmine-runner/node_modules/express/History.md +630 -0
  273. data/node_modules/jasmine-runner/node_modules/express/LICENSE +22 -0
  274. data/node_modules/jasmine-runner/node_modules/express/Makefile +39 -0
  275. data/node_modules/jasmine-runner/node_modules/express/Readme.md +102 -0
  276. data/node_modules/jasmine-runner/node_modules/express/bin/express +451 -0
  277. data/node_modules/jasmine-runner/node_modules/express/index.js +2 -0
  278. data/node_modules/jasmine-runner/node_modules/express/lib/express.js +78 -0
  279. data/node_modules/jasmine-runner/node_modules/express/lib/http.js +503 -0
  280. data/node_modules/jasmine-runner/node_modules/express/lib/https.js +52 -0
  281. data/node_modules/jasmine-runner/node_modules/express/lib/request.js +289 -0
  282. data/node_modules/jasmine-runner/node_modules/express/lib/response.js +423 -0
  283. data/node_modules/jasmine-runner/node_modules/express/lib/router/index.js +329 -0
  284. data/node_modules/jasmine-runner/node_modules/express/lib/router/methods.js +70 -0
  285. data/node_modules/jasmine-runner/node_modules/express/lib/router/route.js +71 -0
  286. data/node_modules/jasmine-runner/node_modules/express/lib/utils.js +122 -0
  287. data/node_modules/jasmine-runner/node_modules/express/lib/view.js +413 -0
  288. data/node_modules/jasmine-runner/node_modules/express/lib/view/partial.js +40 -0
  289. data/node_modules/jasmine-runner/node_modules/express/lib/view/view.js +206 -0
  290. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/.npmignore +11 -0
  291. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/LICENSE +24 -0
  292. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/index.js +2 -0
  293. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/cache.js +81 -0
  294. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/connect.js +106 -0
  295. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/http.js +215 -0
  296. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/https.js +47 -0
  297. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/index.js +46 -0
  298. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/basicAuth.js +93 -0
  299. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js +92 -0
  300. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/compiler.js +163 -0
  301. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js +46 -0
  302. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/csrf.js +105 -0
  303. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/directory.js +222 -0
  304. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/errorHandler.js +100 -0
  305. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/favicon.js +76 -0
  306. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/limit.js +82 -0
  307. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/logger.js +299 -0
  308. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js +38 -0
  309. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/profiler.js +100 -0
  310. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/query.js +40 -0
  311. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/responseTime.js +34 -0
  312. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/router.js +379 -0
  313. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/session.js +346 -0
  314. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/session/cookie.js +126 -0
  315. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/session/memory.js +131 -0
  316. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/session/session.js +137 -0
  317. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/session/store.js +87 -0
  318. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/static.js +225 -0
  319. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/staticCache.js +175 -0
  320. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/vhost.js +44 -0
  321. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/patch.js +79 -0
  322. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/directory.html +75 -0
  323. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/error.html +13 -0
  324. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/favicon.ico +0 -0
  325. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page.png +0 -0
  326. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_add.png +0 -0
  327. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_attach.png +0 -0
  328. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_code.png +0 -0
  329. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_copy.png +0 -0
  330. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_delete.png +0 -0
  331. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_edit.png +0 -0
  332. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_error.png +0 -0
  333. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_excel.png +0 -0
  334. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_find.png +0 -0
  335. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_gear.png +0 -0
  336. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_go.png +0 -0
  337. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_green.png +0 -0
  338. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_key.png +0 -0
  339. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png +0 -0
  340. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_link.png +0 -0
  341. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png +0 -0
  342. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_paste.png +0 -0
  343. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_red.png +0 -0
  344. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png +0 -0
  345. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_save.png +0 -0
  346. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white.png +0 -0
  347. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png +0 -0
  348. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png +0 -0
  349. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_add.png +0 -0
  350. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_c.png +0 -0
  351. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_camera.png +0 -0
  352. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_cd.png +0 -0
  353. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png +0 -0
  354. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png +0 -0
  355. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png +0 -0
  356. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_compressed.png +0 -0
  357. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png +0 -0
  358. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_cplusplus.png +0 -0
  359. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_csharp.png +0 -0
  360. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_cup.png +0 -0
  361. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_database.png +0 -0
  362. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_delete.png +0 -0
  363. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_dvd.png +0 -0
  364. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png +0 -0
  365. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_error.png +0 -0
  366. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png +0 -0
  367. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png +0 -0
  368. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_flash.png +0 -0
  369. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png +0 -0
  370. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png +0 -0
  371. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png +0 -0
  372. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_go.png +0 -0
  373. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_h.png +0 -0
  374. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_horizontal.png +0 -0
  375. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png +0 -0
  376. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_lightning.png +0 -0
  377. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png +0 -0
  378. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png +0 -0
  379. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_medal.png +0 -0
  380. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png +0 -0
  381. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png +0 -0
  382. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_paintbrush.png +0 -0
  383. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_paste.png +0 -0
  384. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_php.png +0 -0
  385. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png +0 -0
  386. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png +0 -0
  387. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_put.png +0 -0
  388. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png +0 -0
  389. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png +0 -0
  390. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png +0 -0
  391. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png +0 -0
  392. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_text.png +0 -0
  393. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_text_width.png +0 -0
  394. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_tux.png +0 -0
  395. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_vector.png +0 -0
  396. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_visualstudio.png +0 -0
  397. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png +0 -0
  398. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png +0 -0
  399. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png +0 -0
  400. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png +0 -0
  401. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png +0 -0
  402. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_word.png +0 -0
  403. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_world.png +0 -0
  404. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/style.css +141 -0
  405. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/utils.js +451 -0
  406. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/package.json +24 -0
  407. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/test.js +11 -0
  408. data/node_modules/jasmine-runner/node_modules/express/node_modules/mime/LICENSE +19 -0
  409. data/node_modules/jasmine-runner/node_modules/express/node_modules/mime/README.md +50 -0
  410. data/node_modules/jasmine-runner/node_modules/express/node_modules/mime/mime.js +92 -0
  411. data/node_modules/jasmine-runner/node_modules/express/node_modules/mime/package.json +22 -0
  412. data/node_modules/jasmine-runner/node_modules/express/node_modules/mime/test.js +79 -0
  413. data/node_modules/jasmine-runner/node_modules/express/node_modules/mime/types/mime.types +1479 -0
  414. data/node_modules/jasmine-runner/node_modules/express/node_modules/mime/types/node.types +43 -0
  415. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/.gitignore +1 -0
  416. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/.gitmodules +6 -0
  417. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/History.md +57 -0
  418. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/Makefile +7 -0
  419. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/Readme.md +49 -0
  420. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/benchmark.js +17 -0
  421. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/examples.js +48 -0
  422. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/index.js +2 -0
  423. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/lib/querystring.js +236 -0
  424. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/package.json +16 -0
  425. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/test/parse.test.js +156 -0
  426. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/test/stringify.test.js +95 -0
  427. data/node_modules/jasmine-runner/node_modules/express/package.json +22 -0
  428. data/node_modules/jasmine-runner/node_modules/growl/History.md +10 -0
  429. data/node_modules/jasmine-runner/node_modules/growl/Readme.md +74 -0
  430. data/node_modules/jasmine-runner/node_modules/growl/lib/growl.js +80 -0
  431. data/node_modules/jasmine-runner/node_modules/growl/package.json +6 -0
  432. data/node_modules/jasmine-runner/node_modules/growl/seed.yml +4 -0
  433. data/node_modules/jasmine-runner/node_modules/growl/test.js +17 -0
  434. data/node_modules/jasmine-runner/node_modules/jade/.gitignore +3 -0
  435. data/node_modules/jasmine-runner/node_modules/jade/.gitmodules +21 -0
  436. data/node_modules/jasmine-runner/node_modules/jade/.npmignore +4 -0
  437. data/node_modules/jasmine-runner/node_modules/jade/CNAME +1 -0
  438. data/node_modules/jasmine-runner/node_modules/jade/History.md +163 -0
  439. data/node_modules/jasmine-runner/node_modules/jade/LICENSE +22 -0
  440. data/node_modules/jasmine-runner/node_modules/jade/Makefile +25 -0
  441. data/node_modules/jasmine-runner/node_modules/jade/Readme.md +408 -0
  442. data/node_modules/jasmine-runner/node_modules/jade/api.html +850 -0
  443. data/node_modules/jasmine-runner/node_modules/jade/bin/jade +92 -0
  444. data/node_modules/jasmine-runner/node_modules/jade/index.js +2 -0
  445. data/node_modules/jasmine-runner/node_modules/jade/lib/compiler.js +273 -0
  446. data/node_modules/jasmine-runner/node_modules/jade/lib/doctypes.js +18 -0
  447. data/node_modules/jasmine-runner/node_modules/jade/lib/filters.js +70 -0
  448. data/node_modules/jasmine-runner/node_modules/jade/lib/index.js +314 -0
  449. data/node_modules/jasmine-runner/node_modules/jade/lib/jade.js +314 -0
  450. data/node_modules/jasmine-runner/node_modules/jade/lib/lexer.js +359 -0
  451. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/block.js +29 -0
  452. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/code.js +35 -0
  453. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/comment.js +32 -0
  454. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/doctype.js +29 -0
  455. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/each.js +35 -0
  456. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/filter.js +33 -0
  457. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/index.js +16 -0
  458. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/node.js +20 -0
  459. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/tag.js +80 -0
  460. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/text.js +29 -0
  461. data/node_modules/jasmine-runner/node_modules/jade/lib/parser.js +358 -0
  462. data/node_modules/jasmine-runner/node_modules/jade/lib/self-closing.js +17 -0
  463. data/node_modules/jasmine-runner/node_modules/jade/lib/utils.js +49 -0
  464. data/node_modules/jasmine-runner/node_modules/jade/package.json +9 -0
  465. data/node_modules/jasmine-runner/node_modules/libnotify/.gitignore +2 -0
  466. data/node_modules/jasmine-runner/node_modules/libnotify/README.md +59 -0
  467. data/node_modules/jasmine-runner/node_modules/libnotify/lib/libnotify.js +72 -0
  468. data/node_modules/jasmine-runner/node_modules/libnotify/package.json +11 -0
  469. data/node_modules/jasmine-runner/node_modules/libnotify/seed.yml +5 -0
  470. data/node_modules/jasmine-runner/node_modules/libnotify/test.js +5 -0
  471. data/node_modules/jasmine-runner/node_modules/socket.io/.gitignore +8 -0
  472. data/node_modules/jasmine-runner/node_modules/socket.io/Makefile +10 -0
  473. data/node_modules/jasmine-runner/node_modules/socket.io/README.md +218 -0
  474. data/node_modules/jasmine-runner/node_modules/socket.io/example/chat.html +61 -0
  475. data/node_modules/jasmine-runner/node_modules/socket.io/example/json.js +18 -0
  476. data/node_modules/jasmine-runner/node_modules/socket.io/example/server.js +58 -0
  477. data/node_modules/jasmine-runner/node_modules/socket.io/index.js +1 -0
  478. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/client.js +191 -0
  479. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/index.js +4 -0
  480. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/listener.js +166 -0
  481. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/transports/flashsocket.js +44 -0
  482. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/transports/htmlfile.js +45 -0
  483. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/transports/jsonp-polling.js +32 -0
  484. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/transports/websocket.js +137 -0
  485. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/transports/xhr-multipart.js +63 -0
  486. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/transports/xhr-polling.js +75 -0
  487. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/utils.js +52 -0
  488. data/node_modules/jasmine-runner/node_modules/socket.io/package.json +17 -0
  489. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/.gitignore +3 -0
  490. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/.gitmodules +3 -0
  491. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/History.md +97 -0
  492. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/Makefile +53 -0
  493. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/Readme.md +39 -0
  494. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/bin/expresso +837 -0
  495. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/COPYING +339 -0
  496. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/Makefile.am +81 -0
  497. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/Makefile.in +884 -0
  498. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/Readme.md +8 -0
  499. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/aclocal.m4 +872 -0
  500. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/config.guess +1526 -0
  501. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/config.h.in +92 -0
  502. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/config.rpath +666 -0
  503. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/config.sub +1658 -0
  504. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/configure +7971 -0
  505. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/configure.ac +88 -0
  506. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/depcomp +589 -0
  507. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/encoding.c +315 -0
  508. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/encoding.h +33 -0
  509. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/generate-resources.c +58 -0
  510. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/global.h +29 -0
  511. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/highlight.c +478 -0
  512. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/highlight.h +37 -0
  513. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/http-connection.c +192 -0
  514. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/http-exchange.c +494 -0
  515. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/http-host.c +95 -0
  516. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/http-message.c +900 -0
  517. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/http-server.c +236 -0
  518. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/http-server.h +208 -0
  519. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/http-url.c +156 -0
  520. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/install-sh +519 -0
  521. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/instrument-js.cpp +1873 -0
  522. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/instrument-js.h +81 -0
  523. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/instrument.c +226 -0
  524. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/instrument.h +31 -0
  525. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/GNUmakefile +15 -0
  526. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/Makefile.ref +483 -0
  527. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/README.html +54 -0
  528. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/SpiderMonkey.rsp +11 -0
  529. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/aclocal.m4 +9 -0
  530. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/bench.sh +5 -0
  531. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/builtins.tbl +98 -0
  532. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config.mk +206 -0
  533. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/Makefile.in +106 -0
  534. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/Moz/Milestone.pm +232 -0
  535. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/autoconf.mk.in +349 -0
  536. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/check-sync-dirs.py +108 -0
  537. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/check-sync-exceptions +6 -0
  538. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/config.mk +884 -0
  539. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/fastcwd.pl +66 -0
  540. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/gcc_hidden.h +2 -0
  541. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/insure.mk +53 -0
  542. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/make-system-wrappers.pl +59 -0
  543. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/milestone.pl +112 -0
  544. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/milestone.txt +13 -0
  545. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/Makefile.in +84 -0
  546. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/cppsetup.c +233 -0
  547. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/def.h +184 -0
  548. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/ifparser.c +549 -0
  549. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/ifparser.h +83 -0
  550. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/imakemdep.h +733 -0
  551. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/include.c +337 -0
  552. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/main.c +860 -0
  553. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/mkdepend.man +382 -0
  554. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/parse.c +686 -0
  555. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/pr.c +124 -0
  556. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/nfspwd.pl +50 -0
  557. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/nsinstall.c +481 -0
  558. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/nsinstall.py +139 -0
  559. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/pathsub.c +247 -0
  560. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/pathsub.h +74 -0
  561. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/preprocessor.pl +671 -0
  562. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/revdepth-nt.pl +48 -0
  563. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/revdepth.pl +51 -0
  564. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/rules.mk +2269 -0
  565. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/system-headers +1038 -0
  566. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/version.mk +85 -0
  567. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/version_win.pl +423 -0
  568. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/dtoa.c +3321 -0
  569. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/editline/Makefile.ref +143 -0
  570. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/editline/README +83 -0
  571. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/editline/editline.3 +175 -0
  572. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/editline/editline.c +1368 -0
  573. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/editline/editline.h +135 -0
  574. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/editline/sysunix.c +182 -0
  575. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/editline/unix.h +82 -0
  576. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/javascript-trace.d +73 -0
  577. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jitstats.tbl +52 -0
  578. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/js-config.h.in +55 -0
  579. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/js-config.in +111 -0
  580. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/js.cpp +4050 -0
  581. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/js.mdp +0 -0
  582. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/js.msg +309 -0
  583. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/js3240.rc +79 -0
  584. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsOS240.def +654 -0
  585. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsapi.cpp +6060 -0
  586. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsapi.h +2699 -0
  587. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsarena.cpp +450 -0
  588. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsarena.h +318 -0
  589. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsarray.cpp +3426 -0
  590. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsarray.h +191 -0
  591. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsatom.cpp +1064 -0
  592. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsatom.h +458 -0
  593. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsbit.h +253 -0
  594. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsbool.cpp +182 -0
  595. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsbool.h +75 -0
  596. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsbuiltins.cpp +497 -0
  597. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsbuiltins.h +374 -0
  598. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsclist.h +139 -0
  599. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jscntxt.cpp +1394 -0
  600. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jscntxt.h +1247 -0
  601. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jscompat.h +57 -0
  602. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsconfig.mk +181 -0
  603. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jscpucfg.cpp +388 -0
  604. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jscpucfg.h +212 -0
  605. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdate.cpp +2475 -0
  606. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdate.h +124 -0
  607. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdbgapi.cpp +1954 -0
  608. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdbgapi.h +500 -0
  609. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdhash.cpp +876 -0
  610. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdhash.h +588 -0
  611. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdtoa.cpp +572 -0
  612. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdtoa.h +131 -0
  613. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdtracef.c +318 -0
  614. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdtracef.h +81 -0
  615. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsemit.cpp +6857 -0
  616. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsemit.h +777 -0
  617. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsexn.cpp +1376 -0
  618. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsexn.h +96 -0
  619. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsfile.cpp +2736 -0
  620. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsfile.h +56 -0
  621. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsfile.msg +90 -0
  622. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsfun.cpp +2706 -0
  623. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsfun.h +296 -0
  624. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsgc.cpp +3763 -0
  625. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsgc.h +427 -0
  626. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jshash.cpp +476 -0
  627. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jshash.h +151 -0
  628. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsify.pl +483 -0
  629. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsinterp.cpp +7225 -0
  630. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsinterp.h +591 -0
  631. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsinvoke.cpp +42 -0
  632. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsiter.cpp +1050 -0
  633. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsiter.h +140 -0
  634. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jskeyword.tbl +124 -0
  635. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jskwgen.cpp +460 -0
  636. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jslibmath.h +69 -0
  637. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jslock.cpp +1417 -0
  638. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jslock.h +311 -0
  639. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jslocko.asm +60 -0
  640. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jslog2.cpp +94 -0
  641. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jslong.cpp +264 -0
  642. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jslong.h +412 -0
  643. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsmath.cpp +721 -0
  644. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsmath.h +63 -0
  645. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsnum.cpp +1338 -0
  646. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsnum.h +287 -0
  647. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsobj.cpp +5563 -0
  648. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsobj.h +735 -0
  649. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/json.cpp +954 -0
  650. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/json.h +107 -0
  651. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsopcode.cpp +5304 -0
  652. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsopcode.h +404 -0
  653. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsopcode.tbl +557 -0
  654. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsoplengen.cpp +121 -0
  655. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsotypes.h +202 -0
  656. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsparse.cpp +6822 -0
  657. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsparse.h +508 -0
  658. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsprf.cpp +1262 -0
  659. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsprf.h +150 -0
  660. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsproto.tbl +129 -0
  661. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsprvtd.h +263 -0
  662. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jspubtd.h +727 -0
  663. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsregexp.cpp +4772 -0
  664. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsregexp.h +192 -0
  665. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsreops.tbl +145 -0
  666. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsscan.cpp +2017 -0
  667. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsscan.h +389 -0
  668. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsscope.cpp +1955 -0
  669. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsscope.h +419 -0
  670. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsscript.cpp +1891 -0
  671. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsscript.h +330 -0
  672. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsshell.msg +51 -0
  673. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsstaticcheck.h +57 -0
  674. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsstddef.h +87 -0
  675. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsstr.cpp +5347 -0
  676. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsstr.h +662 -0
  677. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jstracer.cpp +8276 -0
  678. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jstracer.h +552 -0
  679. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jstypes.h +490 -0
  680. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsutil.cpp +345 -0
  681. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsutil.h +168 -0
  682. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsversion.h +243 -0
  683. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsxdrapi.cpp +800 -0
  684. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsxdrapi.h +220 -0
  685. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsxml.cpp +8343 -0
  686. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsxml.h +298 -0
  687. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/lock_SunOS.s +119 -0
  688. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/plify_jsdhash.sed +35 -0
  689. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/prmjtime.cpp +846 -0
  690. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/prmjtime.h +103 -0
  691. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/AIX4.1.mk +65 -0
  692. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/AIX4.2.mk +64 -0
  693. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/AIX4.3.mk +65 -0
  694. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Cygwin.mk +14 -0
  695. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Darwin.mk +85 -0
  696. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Darwin1.3.mk +81 -0
  697. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Darwin1.4.mk +41 -0
  698. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Darwin5.2.mk +81 -0
  699. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Darwin5.3.mk +81 -0
  700. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Darwin64.mk +72 -0
  701. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/HP-UXB.10.10.mk +77 -0
  702. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/HP-UXB.10.20.mk +77 -0
  703. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/HP-UXB.11.00.mk +80 -0
  704. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/IRIX.mk +87 -0
  705. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/IRIX5.3.mk +44 -0
  706. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/IRIX6.1.mk +44 -0
  707. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/IRIX6.2.mk +44 -0
  708. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/IRIX6.3.mk +44 -0
  709. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/IRIX6.5.mk +44 -0
  710. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Linux_All.mk +105 -0
  711. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/MSYS.mk +7 -0
  712. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Mac_OS10.0.mk +82 -0
  713. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/OSF1V4.0.mk +72 -0
  714. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/OSF1V5.0.mk +69 -0
  715. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS4.1.4.mk +101 -0
  716. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.10.mk +50 -0
  717. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.3.mk +91 -0
  718. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.4.mk +92 -0
  719. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.5.1.mk +44 -0
  720. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.5.mk +87 -0
  721. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.6.mk +89 -0
  722. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.7.mk +44 -0
  723. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.8.mk +44 -0
  724. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.9.mk +44 -0
  725. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/WINNT4.0.mk +118 -0
  726. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/WINNT5.0.mk +118 -0
  727. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/WINNT5.1.mk +118 -0
  728. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/WINNT5.2.mk +118 -0
  729. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/WINNT6.0.mk +118 -0
  730. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/dgux.mk +64 -0
  731. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/resource.h +15 -0
  732. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/rules.mk +206 -0
  733. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/time.sh +13 -0
  734. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/win32.order +384 -0
  735. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-help.txt +12 -0
  736. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-highlight.css +38 -0
  737. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-ie.css +89 -0
  738. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-overlay.js +211 -0
  739. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-server-help.txt +17 -0
  740. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-server.1 +79 -0
  741. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-server.c +1307 -0
  742. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-throbber.gif +0 -0
  743. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.1 +52 -0
  744. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.c +142 -0
  745. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.css +328 -0
  746. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.html +125 -0
  747. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.js +1024 -0
  748. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.jsm +22 -0
  749. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.manifest +2 -0
  750. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.xul +36 -0
  751. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/m4/iconv.m4 +180 -0
  752. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/m4/lib-ld.m4 +110 -0
  753. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/m4/lib-link.m4 +709 -0
  754. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/m4/lib-prefix.m4 +185 -0
  755. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/make-bin-dist.sh.in +24 -0
  756. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/make-dist.sh.in +43 -0
  757. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/missing +367 -0
  758. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/report.js +76 -0
  759. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/resource-manager.c +59 -0
  760. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/resource-manager.h +46 -0
  761. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/stream.c +129 -0
  762. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/stream.h +57 -0
  763. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/Makefile.am +130 -0
  764. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/Makefile.in +846 -0
  765. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/asprintf.c +42 -0
  766. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/asprintf.sh +19 -0
  767. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/charset.sh +110 -0
  768. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/chunked.sh +74 -0
  769. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/common.sh +7 -0
  770. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/destination-is-existing-directory.expected.err +2 -0
  771. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/destination-is-file.expected.err +2 -0
  772. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/encoding-requires-argument.expected.err +2 -0
  773. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/encodings.c +223 -0
  774. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/encodings.sh +19 -0
  775. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/exclude-requires-argument.expected.err +2 -0
  776. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/fatal.sh +110 -0
  777. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/gethostbyname.c +53 -0
  778. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/gethostbyname.sh +25 -0
  779. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/help.sh +35 -0
  780. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-client-bad-body.c +98 -0
  781. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-client-bad-url.c +77 -0
  782. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-client-close-after-request.c +57 -0
  783. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-server-bad-body.c +97 -0
  784. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-server-bad-headers.c +97 -0
  785. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-server-charset.c +144 -0
  786. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-server-chunked.c +196 -0
  787. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-server-close-immediately.c +60 -0
  788. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/invalid-option.expected.err +2 -0
  789. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/invalid-option.sh +29 -0
  790. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-ignore.expected/ignore.js +106 -0
  791. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-ignore.sh +28 -0
  792. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-ignore/ignore.js +44 -0
  793. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-invalid.expected.err +2 -0
  794. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-invalid/javascript-invalid.js +1 -0
  795. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-setter.expected.err +1 -0
  796. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-setter/javascript-setter.js +3 -0
  797. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-utf-8.expected/javascript-utf-8.js +15 -0
  798. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-utf-8.sh +43 -0
  799. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-utf-8/javascript-utf-8.js +2 -0
  800. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-xml.expected.err +1 -0
  801. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-xml/javascript-xml.js +8 -0
  802. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-array-comprehension.js +32 -0
  803. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-assign.js +51 -0
  804. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-colon.js +24 -0
  805. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-comma.js +12 -0
  806. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-cr.js +12 -0
  807. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-crlf.js +12 -0
  808. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-debugger.js +21 -0
  809. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-dec.js +15 -0
  810. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-delete.js +12 -0
  811. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-destructuring.js +96 -0
  812. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-do.js +28 -0
  813. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-dot.js +30 -0
  814. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-empty.js +9 -0
  815. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-for.js +51 -0
  816. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-foreach.js +16 -0
  817. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-function.js +79 -0
  818. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-generator-expression.js +45 -0
  819. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-generator.js +32 -0
  820. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-getter-setter.js +31 -0
  821. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-hook.js +15 -0
  822. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-if.js +71 -0
  823. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-in.js +19 -0
  824. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-inc.js +15 -0
  825. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-iso-8859-1.js +15 -0
  826. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-lambda.js +14 -0
  827. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-let.js +148 -0
  828. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-lf.js +12 -0
  829. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-new.js +22 -0
  830. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-number.js +57 -0
  831. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-object.js +15 -0
  832. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-op.js +108 -0
  833. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-primary.js +21 -0
  834. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-rb.js +24 -0
  835. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-rc.js +15 -0
  836. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-rp.js +12 -0
  837. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-special-characters.js +30 -0
  838. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-string.js +36 -0
  839. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-switch.js +55 -0
  840. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-throw.js +21 -0
  841. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-try.js +66 -0
  842. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-unaryop.js +27 -0
  843. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-var.js +15 -0
  844. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-while.js +79 -0
  845. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-with.js +30 -0
  846. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.sh +53 -0
  847. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-array-comprehension.js +14 -0
  848. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-assign.js +14 -0
  849. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-colon.js +7 -0
  850. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-comma.js +1 -0
  851. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-cr.js +1 -0
  852. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-crlf.js +4 -0
  853. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-debugger.js +6 -0
  854. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-dec.js +2 -0
  855. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-delete.js +1 -0
  856. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-destructuring.js +42 -0
  857. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-do.js +10 -0
  858. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-dot.js +8 -0
  859. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-empty.js +0 -0
  860. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-for.js +22 -0
  861. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-foreach.js +8 -0
  862. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-function.js +38 -0
  863. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-generator-expression.js +18 -0
  864. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-generator.js +11 -0
  865. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-getter-setter.js +19 -0
  866. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-hook.js +2 -0
  867. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-if.js +30 -0
  868. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-in.js +4 -0
  869. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-inc.js +2 -0
  870. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-iso-8859-1.js +2 -0
  871. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-lambda.js +3 -0
  872. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-let.js +79 -0
  873. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-lf.js +4 -0
  874. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-new.js +4 -0
  875. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-number.js +19 -0
  876. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-object.js +2 -0
  877. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-op.js +55 -0
  878. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-primary.js +4 -0
  879. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-rb.js +5 -0
  880. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-rc.js +7 -0
  881. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-rp.js +1 -0
  882. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-special-characters.js +11 -0
  883. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-string.js +11 -0
  884. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-switch.js +21 -0
  885. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-throw.js +6 -0
  886. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-try.js +32 -0
  887. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-unaryop.js +6 -0
  888. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-var.js +2 -0
  889. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-while.js +35 -0
  890. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-with.js +9 -0
  891. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/json-cmp.js +65 -0
  892. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/json.c +48 -0
  893. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/json.sh +19 -0
  894. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/mkdirs.c +42 -0
  895. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/mkdirs.sh +19 -0
  896. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/netcat.pl +35 -0
  897. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/no-arguments.expected.err +2 -0
  898. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/no-arguments.sh +29 -0
  899. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/no-instrument-requires-argument.expected.err +2 -0
  900. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy-bad-request-body.sh +58 -0
  901. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy-bad-response-body-javascript.sh +53 -0
  902. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy-bad-response-body.expected.err +1 -0
  903. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy-bad-response-body.sh +54 -0
  904. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy-bad-response-headers.sh +53 -0
  905. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy-no-server.sh +49 -0
  906. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy-url.sh +67 -0
  907. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy.sh +143 -0
  908. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive-crlf.sh +59 -0
  909. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive-dir-list.c +93 -0
  910. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive-dir-list.sh +19 -0
  911. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive-exclude.sh +41 -0
  912. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive-fatal.sh +40 -0
  913. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive-no-instrument.sh +41 -0
  914. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/1/1.css +3 -0
  915. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/1/1.html +12 -0
  916. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/1/1.js +12 -0
  917. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/1/2/2.css +3 -0
  918. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/1/2/2.html +11 -0
  919. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/1/2/2.js +12 -0
  920. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/image.png +0 -0
  921. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/index.html +12 -0
  922. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/script.js +19 -0
  923. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/style.css +3 -0
  924. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/unix.txt +3 -0
  925. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/windows.txt +3 -0
  926. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/x +1 -0
  927. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.sh +55 -0
  928. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/1/1.css +3 -0
  929. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/1/1.html +12 -0
  930. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/1/1.js +1 -0
  931. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/1/2/2.css +3 -0
  932. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/1/2/2.html +11 -0
  933. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/1/2/2.js +1 -0
  934. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/image.png +0 -0
  935. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/index.html +12 -0
  936. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/script.js +6 -0
  937. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/style.css +3 -0
  938. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/unix.txt +3 -0
  939. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/windows.txt +3 -0
  940. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/x +1 -0
  941. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/same-directory.expected.err +1 -0
  942. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/same-directory.sh +30 -0
  943. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-bad-requests.sh +104 -0
  944. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-close-after-request.sh +47 -0
  945. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-content-types.sh +68 -0
  946. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-directory-listing.expected +4 -0
  947. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-directory-listing.sh +57 -0
  948. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-directory-redirect.sh +50 -0
  949. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-encoded-url.sh +57 -0
  950. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-error.sh +61 -0
  951. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-help.sh +26 -0
  952. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-ip-address.sh +68 -0
  953. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-shutdown-bad-method.sh +49 -0
  954. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-shutdown.expected.err +1 -0
  955. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-shutdown.sh +42 -0
  956. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-special-file.sh +62 -0
  957. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-unreadable-directory.sh +61 -0
  958. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-unreadable-file.sh +62 -0
  959. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-verbose.expected.err +4 -0
  960. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-verbose.sh +54 -0
  961. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-version.sh +25 -0
  962. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server.pl +61 -0
  963. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server.sh +216 -0
  964. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/source-does-not-exist.expected.err +2 -0
  965. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/source-is-file.expected.err +2 -0
  966. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-bad-json.sh +50 -0
  967. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-bad-request-body.sh +48 -0
  968. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-bad-response-headers.sh +56 -0
  969. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-bad-source-urls.expected.err +3 -0
  970. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-bad-source-urls.expected.json +14 -0
  971. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-escaped-characters.expected.json +6 -0
  972. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-escaped-characters.js +11 -0
  973. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-escaped-characters.json +3 -0
  974. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-escaped-characters.sh +52 -0
  975. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-server-bad-body.sh +59 -0
  976. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-server-closes-immediately.sh +58 -0
  977. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-source-not-found.expected.err +1 -0
  978. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-source-not-found.expected.json +6 -0
  979. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-source-not-found.json +3 -0
  980. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-source-not-found.sh +50 -0
  981. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-source-urls.expected.err +3 -0
  982. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-source-urls.expected.json +14 -0
  983. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-unreachable-source-urls.expected.err +3 -0
  984. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-unreachable-source-urls.expected.json +14 -0
  985. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-unreadable-json.sh +66 -0
  986. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-unwritable-json.sh +58 -0
  987. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store.expected.json +14 -0
  988. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store.json +5 -0
  989. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store.sh +137 -0
  990. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/streams.c +107 -0
  991. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/streams.sh +19 -0
  992. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/too-many-arguments.expected.err +2 -0
  993. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/valgrind.sh +7 -0
  994. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/version.sh +29 -0
  995. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/util.c +570 -0
  996. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/util.h +133 -0
  997. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/docs/api.html +1048 -0
  998. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/docs/index.html +373 -0
  999. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/docs/index.md +290 -0
  1000. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/docs/layout/foot.html +3 -0
  1001. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/docs/layout/head.html +42 -0
  1002. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/lib/bar.js +4 -0
  1003. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/lib/foo.js +16 -0
  1004. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/package.json +12 -0
  1005. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/test/assert.test.js +84 -0
  1006. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/test/async.test.js +6 -0
  1007. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/test/bar.test.js +12 -0
  1008. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/test/foo.test.js +13 -0
  1009. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/test/http.test.js +82 -0
  1010. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/test/serial/async.test.js +38 -0
  1011. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/test/serial/http.test.js +47 -0
  1012. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/LICENSE +27 -0
  1013. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/Makefile +8 -0
  1014. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/README.md +41 -0
  1015. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/examples/client-unix.js +12 -0
  1016. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/examples/client.js +10 -0
  1017. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/examples/server-unix.js +13 -0
  1018. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/lib/websocket.js +562 -0
  1019. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/package.json +22 -0
  1020. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/test/test-basic.js +63 -0
  1021. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/test/test-readonly-attrs.js +44 -0
  1022. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/test/test-ready-state.js +23 -0
  1023. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/test/test-unix-send-fd.js +63 -0
  1024. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/test/test-unix-sockets.js +46 -0
  1025. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/.gitignore +1 -0
  1026. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/.gitmodules +3 -0
  1027. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/Makefile +2 -0
  1028. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/README.md +213 -0
  1029. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/io.js +24 -0
  1030. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/socket.js +157 -0
  1031. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transport.js +141 -0
  1032. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transports/flashsocket.js +53 -0
  1033. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transports/htmlfile.js +73 -0
  1034. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transports/jsonp-polling.js +116 -0
  1035. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transports/websocket.js +60 -0
  1036. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transports/xhr-multipart.js +36 -0
  1037. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transports/xhr-polling.js +68 -0
  1038. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transports/xhr.js +131 -0
  1039. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/util.js +60 -0
  1040. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/.gitignore +1 -0
  1041. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/FABridge.js +604 -0
  1042. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/README.txt +109 -0
  1043. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/WebSocketMain.swf +0 -0
  1044. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/WebSocketMainInsecure.zip +0 -0
  1045. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/WebSocket.as +461 -0
  1046. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/WebSocketMain.as +94 -0
  1047. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/WebSocketMainInsecure.as +19 -0
  1048. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/WebSocketStateEvent.as +32 -0
  1049. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/bridge/FABridge.as +943 -0
  1050. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/build.sh +10 -0
  1051. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/adobe/net/proxies/RFC2817Socket.as +204 -0
  1052. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/gsolo/encryption/MD5.as +375 -0
  1053. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/Crypto.as +287 -0
  1054. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/MozillaRootCertificates.as +3235 -0
  1055. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/X509Certificate.as +218 -0
  1056. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/X509CertificateCollection.as +57 -0
  1057. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/HMAC.as +82 -0
  1058. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/IHMAC.as +27 -0
  1059. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/IHash.as +21 -0
  1060. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MAC.as +137 -0
  1061. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MD2.as +124 -0
  1062. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MD5.as +204 -0
  1063. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA1.as +106 -0
  1064. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA224.as +28 -0
  1065. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA256.as +115 -0
  1066. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHABase.as +71 -0
  1067. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/ARC4.as +90 -0
  1068. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/IPRNG.as +20 -0
  1069. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/Random.as +119 -0
  1070. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/TLSPRF.as +142 -0
  1071. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/rsa/RSAKey.as +339 -0
  1072. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/AESKey.as +2797 -0
  1073. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/BlowFishKey.as +375 -0
  1074. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CBCMode.as +55 -0
  1075. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CFB8Mode.as +61 -0
  1076. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CFBMode.as +64 -0
  1077. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CTRMode.as +58 -0
  1078. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/DESKey.as +365 -0
  1079. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ECBMode.as +86 -0
  1080. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ICipher.as +21 -0
  1081. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IMode.as +15 -0
  1082. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IPad.as +32 -0
  1083. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IStreamCipher.as +21 -0
  1084. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ISymmetricKey.as +35 -0
  1085. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IVMode.as +110 -0
  1086. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/NullPad.as +34 -0
  1087. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/OFBMode.as +52 -0
  1088. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/PKCS5.as +44 -0
  1089. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/SSLPad.as +44 -0
  1090. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/SimpleIVMode.as +60 -0
  1091. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/TLSPad.as +42 -0
  1092. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/TripleDESKey.as +88 -0
  1093. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/XTeaKey.as +94 -0
  1094. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/aeskey.pl +29 -0
  1095. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/dump.txt +2304 -0
  1096. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/AESKeyTest.as +1220 -0
  1097. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ARC4Test.as +58 -0
  1098. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/BigIntegerTest.as +39 -0
  1099. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/BlowFishKeyTest.as +148 -0
  1100. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CBCModeTest.as +160 -0
  1101. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CFB8ModeTest.as +71 -0
  1102. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CFBModeTest.as +98 -0
  1103. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CTRModeTest.as +109 -0
  1104. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/DESKeyTest.as +112 -0
  1105. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ECBModeTest.as +151 -0
  1106. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/HMACTest.as +184 -0
  1107. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ITestHarness.as +20 -0
  1108. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/MD2Test.as +56 -0
  1109. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/MD5Test.as +58 -0
  1110. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/OFBModeTest.as +101 -0
  1111. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/RSAKeyTest.as +92 -0
  1112. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA1Test.as +198 -0
  1113. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA224Test.as +58 -0
  1114. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA256Test.as +60 -0
  1115. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TLSPRFTest.as +51 -0
  1116. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TestCase.as +42 -0
  1117. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TripleDESKeyTest.as +59 -0
  1118. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/XTeaKeyTest.as +66 -0
  1119. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/BulkCiphers.as +102 -0
  1120. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/CipherSuites.as +117 -0
  1121. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/IConnectionState.as +14 -0
  1122. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/ISecurityParameters.as +29 -0
  1123. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/KeyExchanges.as +24 -0
  1124. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/MACs.as +38 -0
  1125. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLConnectionState.as +171 -0
  1126. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLEvent.as +26 -0
  1127. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLSecurityParameters.as +340 -0
  1128. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSConfig.as +70 -0
  1129. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSConnectionState.as +151 -0
  1130. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSEngine.as +895 -0
  1131. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSError.as +39 -0
  1132. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSEvent.as +27 -0
  1133. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSecurityParameters.as +197 -0
  1134. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSocket.as +370 -0
  1135. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSocketEvent.as +26 -0
  1136. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSTest.as +180 -0
  1137. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/BarrettReduction.as +90 -0
  1138. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/BigInteger.as +1543 -0
  1139. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/ClassicReduction.as +35 -0
  1140. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/IReduction.as +11 -0
  1141. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/MontgomeryReduction.as +85 -0
  1142. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/NullReduction.as +34 -0
  1143. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/bi_internal.as +11 -0
  1144. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/ArrayUtil.as +25 -0
  1145. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/Base64.as +189 -0
  1146. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/Hex.as +66 -0
  1147. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/Memory.as +28 -0
  1148. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/ByteString.as +43 -0
  1149. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/DER.as +210 -0
  1150. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/IAsn1Type.as +21 -0
  1151. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/Integer.as +44 -0
  1152. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/OID.as +35 -0
  1153. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/ObjectIdentifier.as +112 -0
  1154. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/PEM.as +118 -0
  1155. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/PrintableString.as +49 -0
  1156. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/Sequence.as +90 -0
  1157. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/Set.as +27 -0
  1158. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/Type.as +94 -0
  1159. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/UTCTime.as +60 -0
  1160. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/sample.html +76 -0
  1161. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/swfobject.js +4 -0
  1162. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/web_socket.js +388 -0
  1163. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/socket.io.js +1918 -0
  1164. data/node_modules/jasmine-runner/node_modules/socket.io/tests/index.js +17 -0
  1165. data/node_modules/jasmine-runner/node_modules/socket.io/tests/listener.js +152 -0
  1166. data/node_modules/jasmine-runner/node_modules/socket.io/tests/transports.flashsocket.js +48 -0
  1167. data/node_modules/jasmine-runner/node_modules/socket.io/tests/transports.htmlfile.js +214 -0
  1168. data/node_modules/jasmine-runner/node_modules/socket.io/tests/transports.jsonp-polling.js +148 -0
  1169. data/node_modules/jasmine-runner/node_modules/socket.io/tests/transports.websocket.js +245 -0
  1170. data/node_modules/jasmine-runner/node_modules/socket.io/tests/transports.xhr-multipart.js +215 -0
  1171. data/node_modules/jasmine-runner/node_modules/socket.io/tests/transports.xhr-polling.js +138 -0
  1172. data/node_modules/jasmine-runner/node_modules/socket.io/tests/utils.js +25 -0
  1173. data/node_modules/jasmine-runner/node_modules/vows/LICENSE +20 -0
  1174. data/node_modules/jasmine-runner/node_modules/vows/Makefile +7 -0
  1175. data/node_modules/jasmine-runner/node_modules/vows/README.md +39 -0
  1176. data/node_modules/jasmine-runner/node_modules/vows/bin/vows +421 -0
  1177. data/node_modules/jasmine-runner/node_modules/vows/lib/assert/error.js +27 -0
  1178. data/node_modules/jasmine-runner/node_modules/vows/lib/assert/macros.js +180 -0
  1179. data/node_modules/jasmine-runner/node_modules/vows/lib/vows.js +195 -0
  1180. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/console.js +93 -0
  1181. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/context.js +55 -0
  1182. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/extras.js +28 -0
  1183. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/reporters/dot-matrix.js +69 -0
  1184. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/reporters/json.js +10 -0
  1185. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/reporters/silent.js +8 -0
  1186. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/reporters/spec.js +74 -0
  1187. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/reporters/watch.js +38 -0
  1188. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/reporters/xunit.js +90 -0
  1189. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/suite.js +321 -0
  1190. data/node_modules/jasmine-runner/node_modules/vows/package.json +14 -0
  1191. data/node_modules/jasmine-runner/node_modules/vows/test/assert-test.js +101 -0
  1192. data/node_modules/jasmine-runner/node_modules/vows/test/vows-test.js +373 -0
  1193. data/node_modules/jasmine-runner/node_modules/webworker/.gitignore +2 -0
  1194. data/node_modules/jasmine-runner/node_modules/webworker/LICENSE +27 -0
  1195. data/node_modules/jasmine-runner/node_modules/webworker/Makefile +15 -0
  1196. data/node_modules/jasmine-runner/node_modules/webworker/README.md +74 -0
  1197. data/node_modules/jasmine-runner/node_modules/webworker/docs/design.md +103 -0
  1198. data/node_modules/jasmine-runner/node_modules/webworker/examples/prefork/README.md +1 -0
  1199. data/node_modules/jasmine-runner/node_modules/webworker/examples/prefork/master.js +12 -0
  1200. data/node_modules/jasmine-runner/node_modules/webworker/examples/prefork/worker.js +20 -0
  1201. data/node_modules/jasmine-runner/node_modules/webworker/lib/webworker-child.js +173 -0
  1202. data/node_modules/jasmine-runner/node_modules/webworker/lib/webworker-util.js +185 -0
  1203. data/node_modules/jasmine-runner/node_modules/webworker/lib/webworker.js +304 -0
  1204. data/node_modules/jasmine-runner/node_modules/webworker/lib/ws.js +118 -0
  1205. data/node_modules/jasmine-runner/node_modules/webworker/lib/ws/connection.js +408 -0
  1206. data/node_modules/jasmine-runner/node_modules/webworker/lib/ws/manager.js +98 -0
  1207. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/LICENSE +27 -0
  1208. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/Makefile +8 -0
  1209. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/README.md +41 -0
  1210. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/examples/client-unix.js +12 -0
  1211. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/examples/client.js +10 -0
  1212. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/examples/server-unix.js +13 -0
  1213. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/lib/websocket.js +516 -0
  1214. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/package.json +22 -0
  1215. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/test/test-basic.js +63 -0
  1216. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/test/test-readonly-attrs.js +44 -0
  1217. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/test/test-ready-state.js +23 -0
  1218. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/test/test-unix-send-fd.js +63 -0
  1219. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/test/test-unix-sockets.js +46 -0
  1220. data/node_modules/jasmine-runner/node_modules/webworker/package.json +25 -0
  1221. data/node_modules/jasmine-runner/node_modules/webworker/test/test-error.js +24 -0
  1222. data/node_modules/jasmine-runner/node_modules/webworker/test/test-fd.js +32 -0
  1223. data/node_modules/jasmine-runner/node_modules/webworker/test/test-simple.js +36 -0
  1224. data/node_modules/jasmine-runner/node_modules/webworker/test/workers/error.js +6 -0
  1225. data/node_modules/jasmine-runner/node_modules/webworker/test/workers/fd.js +17 -0
  1226. data/node_modules/jasmine-runner/node_modules/webworker/test/workers/simple.js +15 -0
  1227. data/node_modules/jasmine-runner/package.json +22 -0
  1228. data/node_modules/jasmine-runner/spec/ConsoleLoggerSpec.js +1 -0
  1229. data/node_modules/jasmine-runner/spec/ServerSpec.js +42 -0
  1230. data/node_modules/jasmine-runner/spec/TestRunner.js +72 -0
  1231. data/node_modules/jasmine-runner/spec/file.worker +8 -0
  1232. data/node_modules/jasmine-runner/spec/temp/spec/foo.spec.js +0 -0
  1233. data/node_modules/jasmine-runner/spec/temp/src/foo.hs +1 -0
  1234. data/node_modules/uglify-js/.gitignore +4 -0
  1235. data/node_modules/uglify-js/README.html +1026 -0
  1236. data/node_modules/uglify-js/README.org +571 -0
  1237. data/node_modules/uglify-js/bin/uglifyjs +317 -0
  1238. data/node_modules/uglify-js/docstyle.css +75 -0
  1239. data/node_modules/uglify-js/lib/object-ast.js +75 -0
  1240. data/node_modules/uglify-js/lib/parse-js.js +1339 -0
  1241. data/node_modules/uglify-js/lib/process.js +2001 -0
  1242. data/node_modules/uglify-js/lib/squeeze-more.js +51 -0
  1243. data/node_modules/uglify-js/package.json +24 -0
  1244. data/node_modules/uglify-js/package.json~ +24 -0
  1245. data/node_modules/uglify-js/test/beautify.js +28 -0
  1246. data/node_modules/uglify-js/test/testparser.js +403 -0
  1247. data/node_modules/uglify-js/test/unit/compress/expected/array1.js +1 -0
  1248. data/node_modules/uglify-js/test/unit/compress/expected/array2.js +1 -0
  1249. data/node_modules/uglify-js/test/unit/compress/expected/array3.js +1 -0
  1250. data/node_modules/uglify-js/test/unit/compress/expected/array4.js +1 -0
  1251. data/node_modules/uglify-js/test/unit/compress/expected/assignment.js +1 -0
  1252. data/node_modules/uglify-js/test/unit/compress/expected/concatstring.js +1 -0
  1253. data/node_modules/uglify-js/test/unit/compress/expected/const.js +1 -0
  1254. data/node_modules/uglify-js/test/unit/compress/expected/empty-blocks.js +1 -0
  1255. data/node_modules/uglify-js/test/unit/compress/expected/forstatement.js +1 -0
  1256. data/node_modules/uglify-js/test/unit/compress/expected/if.js +1 -0
  1257. data/node_modules/uglify-js/test/unit/compress/expected/ifreturn.js +1 -0
  1258. data/node_modules/uglify-js/test/unit/compress/expected/ifreturn2.js +1 -0
  1259. data/node_modules/uglify-js/test/unit/compress/expected/issue10.js +1 -0
  1260. data/node_modules/uglify-js/test/unit/compress/expected/issue11.js +1 -0
  1261. data/node_modules/uglify-js/test/unit/compress/expected/issue13.js +1 -0
  1262. data/node_modules/uglify-js/test/unit/compress/expected/issue14.js +1 -0
  1263. data/node_modules/uglify-js/test/unit/compress/expected/issue16.js +1 -0
  1264. data/node_modules/uglify-js/test/unit/compress/expected/issue17.js +1 -0
  1265. data/node_modules/uglify-js/test/unit/compress/expected/issue20.js +1 -0
  1266. data/node_modules/uglify-js/test/unit/compress/expected/issue21.js +1 -0
  1267. data/node_modules/uglify-js/test/unit/compress/expected/issue25.js +1 -0
  1268. data/node_modules/uglify-js/test/unit/compress/expected/issue27.js +1 -0
  1269. data/node_modules/uglify-js/test/unit/compress/expected/issue28.js +1 -0
  1270. data/node_modules/uglify-js/test/unit/compress/expected/issue29.js +1 -0
  1271. data/node_modules/uglify-js/test/unit/compress/expected/issue30.js +1 -0
  1272. data/node_modules/uglify-js/test/unit/compress/expected/issue34.js +1 -0
  1273. data/node_modules/uglify-js/test/unit/compress/expected/issue4.js +1 -0
  1274. data/node_modules/uglify-js/test/unit/compress/expected/issue48.js +1 -0
  1275. data/node_modules/uglify-js/test/unit/compress/expected/issue50.js +1 -0
  1276. data/node_modules/uglify-js/test/unit/compress/expected/issue53.js +1 -0
  1277. data/node_modules/uglify-js/test/unit/compress/expected/issue54.1.js +1 -0
  1278. data/node_modules/uglify-js/test/unit/compress/expected/issue68.js +1 -0
  1279. data/node_modules/uglify-js/test/unit/compress/expected/issue69.js +1 -0
  1280. data/node_modules/uglify-js/test/unit/compress/expected/issue9.js +1 -0
  1281. data/node_modules/uglify-js/test/unit/compress/expected/mangle.js +1 -0
  1282. data/node_modules/uglify-js/test/unit/compress/expected/null_string.js +1 -0
  1283. data/node_modules/uglify-js/test/unit/compress/expected/strict-equals.js +1 -0
  1284. data/node_modules/uglify-js/test/unit/compress/expected/var.js +1 -0
  1285. data/node_modules/uglify-js/test/unit/compress/expected/whitespace.js +1 -0
  1286. data/node_modules/uglify-js/test/unit/compress/expected/with.js +1 -0
  1287. data/node_modules/uglify-js/test/unit/compress/test/array1.js +3 -0
  1288. data/node_modules/uglify-js/test/unit/compress/test/array2.js +4 -0
  1289. data/node_modules/uglify-js/test/unit/compress/test/array3.js +4 -0
  1290. data/node_modules/uglify-js/test/unit/compress/test/array4.js +6 -0
  1291. data/node_modules/uglify-js/test/unit/compress/test/assignment.js +20 -0
  1292. data/node_modules/uglify-js/test/unit/compress/test/concatstring.js +3 -0
  1293. data/node_modules/uglify-js/test/unit/compress/test/const.js +5 -0
  1294. data/node_modules/uglify-js/test/unit/compress/test/empty-blocks.js +4 -0
  1295. data/node_modules/uglify-js/test/unit/compress/test/forstatement.js +10 -0
  1296. data/node_modules/uglify-js/test/unit/compress/test/if.js +6 -0
  1297. data/node_modules/uglify-js/test/unit/compress/test/ifreturn.js +9 -0
  1298. data/node_modules/uglify-js/test/unit/compress/test/ifreturn2.js +16 -0
  1299. data/node_modules/uglify-js/test/unit/compress/test/issue10.js +1 -0
  1300. data/node_modules/uglify-js/test/unit/compress/test/issue11.js +3 -0
  1301. data/node_modules/uglify-js/test/unit/compress/test/issue13.js +1 -0
  1302. data/node_modules/uglify-js/test/unit/compress/test/issue14.js +1 -0
  1303. data/node_modules/uglify-js/test/unit/compress/test/issue16.js +1 -0
  1304. data/node_modules/uglify-js/test/unit/compress/test/issue17.js +4 -0
  1305. data/node_modules/uglify-js/test/unit/compress/test/issue20.js +1 -0
  1306. data/node_modules/uglify-js/test/unit/compress/test/issue21.js +6 -0
  1307. data/node_modules/uglify-js/test/unit/compress/test/issue25.js +7 -0
  1308. data/node_modules/uglify-js/test/unit/compress/test/issue27.js +1 -0
  1309. data/node_modules/uglify-js/test/unit/compress/test/issue28.js +3 -0
  1310. data/node_modules/uglify-js/test/unit/compress/test/issue29.js +1 -0
  1311. data/node_modules/uglify-js/test/unit/compress/test/issue30.js +3 -0
  1312. data/node_modules/uglify-js/test/unit/compress/test/issue34.js +3 -0
  1313. data/node_modules/uglify-js/test/unit/compress/test/issue4.js +3 -0
  1314. data/node_modules/uglify-js/test/unit/compress/test/issue48.js +1 -0
  1315. data/node_modules/uglify-js/test/unit/compress/test/issue50.js +9 -0
  1316. data/node_modules/uglify-js/test/unit/compress/test/issue53.js +1 -0
  1317. data/node_modules/uglify-js/test/unit/compress/test/issue54.1.js +3 -0
  1318. data/node_modules/uglify-js/test/unit/compress/test/issue68.js +5 -0
  1319. data/node_modules/uglify-js/test/unit/compress/test/issue69.js +1 -0
  1320. data/node_modules/uglify-js/test/unit/compress/test/issue9.js +4 -0
  1321. data/node_modules/uglify-js/test/unit/compress/test/mangle.js +5 -0
  1322. data/node_modules/uglify-js/test/unit/compress/test/null_string.js +1 -0
  1323. data/node_modules/uglify-js/test/unit/compress/test/strict-equals.js +3 -0
  1324. data/node_modules/uglify-js/test/unit/compress/test/var.js +3 -0
  1325. data/node_modules/uglify-js/test/unit/compress/test/whitespace.js +21 -0
  1326. data/node_modules/uglify-js/test/unit/compress/test/with.js +2 -0
  1327. data/node_modules/uglify-js/test/unit/scripts.js +55 -0
  1328. data/node_modules/uglify-js/uglify-js.js +17 -0
  1329. data/node_modules/uglifycss/README.md +21 -0
  1330. data/node_modules/uglifycss/index.js +26 -0
  1331. data/node_modules/uglifycss/package.json +15 -0
  1332. data/node_modules/uglifycss/test.js +43 -0
  1333. data/node_modules/uglifycss/tests.yui.js +42 -0
  1334. data/node_modules/uglifycss/uglifycss +127 -0
  1335. data/node_modules/uglifycss/uglifycss-lib.js +461 -0
  1336. metadata +1383 -0
@@ -0,0 +1,296 @@
1
+ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2
+ *
3
+ * ***** BEGIN LICENSE BLOCK *****
4
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5
+ *
6
+ * The contents of this file are subject to the Mozilla Public License Version
7
+ * 1.1 (the "License"); you may not use this file except in compliance with
8
+ * the License. You may obtain a copy of the License at
9
+ * http://www.mozilla.org/MPL/
10
+ *
11
+ * Software distributed under the License is distributed on an "AS IS" basis,
12
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13
+ * for the specific language governing rights and limitations under the
14
+ * License.
15
+ *
16
+ * The Original Code is Mozilla Communicator client code, released
17
+ * March 31, 1998.
18
+ *
19
+ * The Initial Developer of the Original Code is
20
+ * Netscape Communications Corporation.
21
+ * Portions created by the Initial Developer are Copyright (C) 1998
22
+ * the Initial Developer. All Rights Reserved.
23
+ *
24
+ * Contributor(s):
25
+ *
26
+ * Alternatively, the contents of this file may be used under the terms of
27
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
28
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29
+ * in which case the provisions of the GPL or the LGPL are applicable instead
30
+ * of those above. If you wish to allow use of your version of this file only
31
+ * under the terms of either the GPL or the LGPL, and not to allow others to
32
+ * use your version of this file under the terms of the MPL, indicate your
33
+ * decision by deleting the provisions above and replace them with the notice
34
+ * and other provisions required by the GPL or the LGPL. If you do not delete
35
+ * the provisions above, a recipient may use your version of this file under
36
+ * the terms of any one of the MPL, the GPL or the LGPL.
37
+ *
38
+ * ***** END LICENSE BLOCK ***** */
39
+
40
+ #ifndef jsfun_h___
41
+ #define jsfun_h___
42
+ /*
43
+ * JS function definitions.
44
+ */
45
+ #include "jsprvtd.h"
46
+ #include "jspubtd.h"
47
+ #include "jsobj.h"
48
+
49
+ JS_BEGIN_EXTERN_C
50
+
51
+ typedef struct JSLocalNameMap JSLocalNameMap;
52
+
53
+ /*
54
+ * Depending on the number of arguments and variables in the function their
55
+ * names and attributes are stored either as a single atom or as an array of
56
+ * tagged atoms (when there are few locals) or as a hash-based map (when there
57
+ * are many locals). In the first 2 cases the lowest bit of the atom is used
58
+ * as a tag to distinguish const from var. See jsfun.c for details.
59
+ */
60
+ typedef union JSLocalNames {
61
+ jsuword taggedAtom;
62
+ jsuword *array;
63
+ JSLocalNameMap *map;
64
+ } JSLocalNames;
65
+
66
+ struct JSFunction {
67
+ JSObject object; /* GC'ed object header */
68
+ uint16 nargs; /* maximum number of specified arguments,
69
+ reflected as f.length/f.arity */
70
+ uint16 flags; /* flags, see JSFUN_* below and in jsapi.h */
71
+ union {
72
+ struct {
73
+ uint16 extra; /* number of arg slots for local GC roots */
74
+ uint16 spare; /* reserved for future use */
75
+ JSNative native; /* native method pointer or null */
76
+ union {
77
+ JSClass *clasp; /* class of objects constructed
78
+ by this function */
79
+ JSTraceableNative *trcinfo; /* tracer metadata; can be first
80
+ element of array */
81
+ } u;
82
+ } n;
83
+ struct {
84
+ uint16 nvars; /* number of local variables */
85
+ uint16 nupvars; /* number of upvars (computable from script
86
+ but here for faster access) */
87
+ JSScript *script; /* interpreted bytecode descriptor or null */
88
+ JSLocalNames names; /* argument and variable names */
89
+ } i;
90
+ } u;
91
+ JSAtom *atom; /* name for diagnostics and decompiling */
92
+ };
93
+
94
+ #define JSFUN_TRACEABLE 0x2000 /* can trace across calls to this native
95
+ function; use FUN_TRCINFO if set,
96
+ FUN_CLASP if unset */
97
+ #define JSFUN_EXPR_CLOSURE 0x4000 /* expression closure: function(x)x*x */
98
+ #define JSFUN_INTERPRETED 0x8000 /* use u.i if set, u.n if unset */
99
+
100
+ #define JSFUN_SCRIPT_OR_FAST_NATIVE (JSFUN_INTERPRETED | JSFUN_FAST_NATIVE)
101
+
102
+ #define FUN_OBJECT(fun) (&(fun)->object)
103
+ #define FUN_INTERPRETED(fun) ((fun)->flags & JSFUN_INTERPRETED)
104
+ #define FUN_SLOW_NATIVE(fun) (!((fun)->flags & JSFUN_SCRIPT_OR_FAST_NATIVE))
105
+ #define FUN_SCRIPT(fun) (FUN_INTERPRETED(fun) ? (fun)->u.i.script : NULL)
106
+ #define FUN_NATIVE(fun) (FUN_SLOW_NATIVE(fun) ? (fun)->u.n.native : NULL)
107
+ #define FUN_FAST_NATIVE(fun) (((fun)->flags & JSFUN_FAST_NATIVE) \
108
+ ? (JSFastNative) (fun)->u.n.native \
109
+ : NULL)
110
+ #define FUN_MINARGS(fun) (((fun)->flags & JSFUN_FAST_NATIVE) \
111
+ ? 0 \
112
+ : (fun)->nargs)
113
+ #define FUN_CLASP(fun) (JS_ASSERT(!FUN_INTERPRETED(fun)), \
114
+ JS_ASSERT(!((fun)->flags & JSFUN_TRACEABLE)), \
115
+ fun->u.n.u.clasp)
116
+ #define FUN_TRCINFO(fun) (JS_ASSERT(!FUN_INTERPRETED(fun)), \
117
+ JS_ASSERT((fun)->flags & JSFUN_TRACEABLE), \
118
+ fun->u.n.u.trcinfo)
119
+
120
+ /*
121
+ * Traceable native. This expands to a JSFunctionSpec initializer (like JS_FN
122
+ * in jsapi.h). fastcall is a JSFastNative; trcinfo is a JSTraceableNative *.
123
+ */
124
+ #ifdef JS_TRACER
125
+ /* MSVC demands the intermediate (void *) cast here. */
126
+ # define JS_TN(name,fastcall,nargs,flags,trcinfo) \
127
+ {name, (JSNative)(void *)(trcinfo), nargs, \
128
+ (flags) | JSFUN_FAST_NATIVE | JSFUN_STUB_GSOPS | JSFUN_TRACEABLE, 0}
129
+ #else
130
+ # define JS_TN(name,fastcall,nargs,flags,trcinfo) \
131
+ JS_FN(name, fastcall, nargs, flags)
132
+ #endif
133
+
134
+ extern JSClass js_ArgumentsClass;
135
+ extern JS_FRIEND_DATA(JSClass) js_CallClass;
136
+
137
+ /* JS_FRIEND_DATA so that VALUE_IS_FUNCTION is callable from the shell. */
138
+ extern JS_FRIEND_DATA(JSClass) js_FunctionClass;
139
+
140
+ #define HAS_FUNCTION_CLASS(obj) (STOBJ_GET_CLASS(obj) == &js_FunctionClass)
141
+
142
+ /*
143
+ * NB: jsapi.h and jsobj.h must be included before any call to this macro.
144
+ */
145
+ #define VALUE_IS_FUNCTION(cx, v) \
146
+ (!JSVAL_IS_PRIMITIVE(v) && HAS_FUNCTION_CLASS(JSVAL_TO_OBJECT(v)))
147
+
148
+ /*
149
+ * Macro to access the private slot of the function object after the slot is
150
+ * initialized.
151
+ */
152
+ #define GET_FUNCTION_PRIVATE(cx, funobj) \
153
+ (JS_ASSERT(HAS_FUNCTION_CLASS(funobj)), \
154
+ (JSFunction *) OBJ_GET_PRIVATE(cx, funobj))
155
+
156
+ extern JSObject *
157
+ js_InitFunctionClass(JSContext *cx, JSObject *obj);
158
+
159
+ extern JSObject *
160
+ js_InitArgumentsClass(JSContext *cx, JSObject *obj);
161
+
162
+ extern JSObject *
163
+ js_InitCallClass(JSContext *cx, JSObject *obj);
164
+
165
+ extern JSFunction *
166
+ js_NewFunction(JSContext *cx, JSObject *funobj, JSNative native, uintN nargs,
167
+ uintN flags, JSObject *parent, JSAtom *atom);
168
+
169
+ extern void
170
+ js_TraceFunction(JSTracer *trc, JSFunction *fun);
171
+
172
+ extern void
173
+ js_FinalizeFunction(JSContext *cx, JSFunction *fun);
174
+
175
+ extern JSObject *
176
+ js_CloneFunctionObject(JSContext *cx, JSFunction *fun, JSObject *parent);
177
+
178
+ extern JSBool
179
+ js_LinkFunctionObject(JSContext *cx, JSFunction *fun, JSObject *object);
180
+
181
+ extern JSFunction *
182
+ js_DefineFunction(JSContext *cx, JSObject *obj, JSAtom *atom, JSNative native,
183
+ uintN nargs, uintN flags);
184
+
185
+ /*
186
+ * Flags for js_ValueToFunction and js_ReportIsNotFunction. We depend on the
187
+ * fact that JSINVOKE_CONSTRUCT (aka JSFRAME_CONSTRUCTING) is 1, and test that
188
+ * with #if/#error in jsfun.c.
189
+ */
190
+ #define JSV2F_CONSTRUCT JSINVOKE_CONSTRUCT
191
+ #define JSV2F_ITERATOR JSINVOKE_ITERATOR
192
+ #define JSV2F_SEARCH_STACK 0x10000
193
+
194
+ extern JSFunction *
195
+ js_ValueToFunction(JSContext *cx, jsval *vp, uintN flags);
196
+
197
+ extern JSObject *
198
+ js_ValueToFunctionObject(JSContext *cx, jsval *vp, uintN flags);
199
+
200
+ extern JSObject *
201
+ js_ValueToCallableObject(JSContext *cx, jsval *vp, uintN flags);
202
+
203
+ extern void
204
+ js_ReportIsNotFunction(JSContext *cx, jsval *vp, uintN flags);
205
+
206
+ extern JSObject *
207
+ js_GetCallObject(JSContext *cx, JSStackFrame *fp, JSObject *parent);
208
+
209
+ extern JS_FRIEND_API(JSBool)
210
+ js_PutCallObject(JSContext *cx, JSStackFrame *fp);
211
+
212
+ extern JSBool
213
+ js_GetCallArg(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
214
+
215
+ extern JSBool
216
+ js_GetCallVar(JSContext *cx, JSObject *obj, jsval id, jsval *vp);
217
+
218
+ extern JSBool
219
+ js_GetArgsValue(JSContext *cx, JSStackFrame *fp, jsval *vp);
220
+
221
+ extern JSBool
222
+ js_GetArgsProperty(JSContext *cx, JSStackFrame *fp, jsid id, jsval *vp);
223
+
224
+ extern JSObject *
225
+ js_GetArgsObject(JSContext *cx, JSStackFrame *fp);
226
+
227
+ extern JS_FRIEND_API(JSBool)
228
+ js_PutArgsObject(JSContext *cx, JSStackFrame *fp);
229
+
230
+ extern JSBool
231
+ js_XDRFunction(JSXDRState *xdr, JSObject **objp);
232
+
233
+ typedef enum JSLocalKind {
234
+ JSLOCAL_NONE,
235
+ JSLOCAL_ARG,
236
+ JSLOCAL_VAR,
237
+ JSLOCAL_CONST,
238
+ JSLOCAL_UPVAR
239
+ } JSLocalKind;
240
+
241
+ #define JS_UPVAR_LOCAL_NAME_START(fun) ((fun)->nargs + (fun)->u.i.nvars)
242
+ #define JS_GET_LOCAL_NAME_COUNT(fun) (JS_UPVAR_LOCAL_NAME_START(fun) + \
243
+ (fun)->u.i.nupvars)
244
+
245
+ extern JSBool
246
+ js_AddLocal(JSContext *cx, JSFunction *fun, JSAtom *atom, JSLocalKind kind);
247
+
248
+ /*
249
+ * Look up an argument or variable name returning its kind when found or
250
+ * JSLOCAL_NONE when no such name exists. When indexp is not null and the name
251
+ * exists, *indexp will receive the index of the corresponding argument or
252
+ * variable.
253
+ */
254
+ extern JSLocalKind
255
+ js_LookupLocal(JSContext *cx, JSFunction *fun, JSAtom *atom, uintN *indexp);
256
+
257
+ /*
258
+ * Functions to work with local names as an array of words.
259
+ *
260
+ * js_GetLocalNameArray returns the array, or null if we are out of memory.
261
+ * This function must not be called when JS_GET_LOCAL_NAME_COUNT(fun) is zero.
262
+ *
263
+ * The supplied pool is used to allocate the returned array, so the caller is
264
+ * obligated to mark and release to free it.
265
+ *
266
+ * The elements of the array with index less than fun->nargs correspond to the
267
+ * names of function formal parameters. An index >= fun->nargs addresses a var
268
+ * binding. Use JS_LOCAL_NAME_TO_ATOM to convert array's element to an atom
269
+ * pointer. This pointer can be null when the element is for a formal parameter
270
+ * corresponding to a destructuring pattern.
271
+ *
272
+ * If nameWord does not name a formal parameter, use JS_LOCAL_NAME_IS_CONST to
273
+ * check if nameWord corresponds to the const declaration.
274
+ */
275
+ extern jsuword *
276
+ js_GetLocalNameArray(JSContext *cx, JSFunction *fun, struct JSArenaPool *pool);
277
+
278
+ #define JS_LOCAL_NAME_TO_ATOM(nameWord) \
279
+ ((JSAtom *) ((nameWord) & ~(jsuword) 1))
280
+
281
+ #define JS_LOCAL_NAME_IS_CONST(nameWord) \
282
+ ((((nameWord) & (jsuword) 1)) != 0)
283
+
284
+ extern void
285
+ js_FreezeLocalNames(JSContext *cx, JSFunction *fun);
286
+
287
+ extern JSBool
288
+ js_fun_apply(JSContext *cx, uintN argc, jsval *vp);
289
+
290
+ extern JSBool
291
+ js_fun_call(JSContext *cx, uintN argc, jsval *vp);
292
+
293
+
294
+ JS_END_EXTERN_C
295
+
296
+ #endif /* jsfun_h___ */
@@ -0,0 +1,3763 @@
1
+ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2
+ * vim: set ts=8 sw=4 et tw=78:
3
+ *
4
+ * ***** BEGIN LICENSE BLOCK *****
5
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6
+ *
7
+ * The contents of this file are subject to the Mozilla Public License Version
8
+ * 1.1 (the "License"); you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ * http://www.mozilla.org/MPL/
11
+ *
12
+ * Software distributed under the License is distributed on an "AS IS" basis,
13
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14
+ * for the specific language governing rights and limitations under the
15
+ * License.
16
+ *
17
+ * The Original Code is Mozilla Communicator client code, released
18
+ * March 31, 1998.
19
+ *
20
+ * The Initial Developer of the Original Code is
21
+ * Netscape Communications Corporation.
22
+ * Portions created by the Initial Developer are Copyright (C) 1998
23
+ * the Initial Developer. All Rights Reserved.
24
+ *
25
+ * Contributor(s):
26
+ *
27
+ * Alternatively, the contents of this file may be used under the terms of
28
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
29
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30
+ * in which case the provisions of the GPL or the LGPL are applicable instead
31
+ * of those above. If you wish to allow use of your version of this file only
32
+ * under the terms of either the GPL or the LGPL, and not to allow others to
33
+ * use your version of this file under the terms of the MPL, indicate your
34
+ * decision by deleting the provisions above and replace them with the notice
35
+ * and other provisions required by the GPL or the LGPL. If you do not delete
36
+ * the provisions above, a recipient may use your version of this file under
37
+ * the terms of any one of the MPL, the GPL or the LGPL.
38
+ *
39
+ * ***** END LICENSE BLOCK ***** */
40
+
41
+ /*
42
+ * JS Mark-and-Sweep Garbage Collector.
43
+ *
44
+ * This GC allocates fixed-sized things with sizes up to GC_NBYTES_MAX (see
45
+ * jsgc.h). It allocates from a special GC arena pool with each arena allocated
46
+ * using malloc. It uses an ideally parallel array of flag bytes to hold the
47
+ * mark bit, finalizer type index, etc.
48
+ *
49
+ * XXX swizzle page to freelist for better locality of reference
50
+ */
51
+ #include "jsstddef.h"
52
+ #include <stdlib.h> /* for free */
53
+ #include <math.h>
54
+ #include <string.h> /* for memset used when DEBUG */
55
+ #include "jstypes.h"
56
+ #include "jsutil.h" /* Added by JSIFY */
57
+ #include "jshash.h" /* Added by JSIFY */
58
+ #include "jsbit.h"
59
+ #include "jsclist.h"
60
+ #include "jsprf.h"
61
+ #include "jsapi.h"
62
+ #include "jsatom.h"
63
+ #include "jscntxt.h"
64
+ #include "jsversion.h"
65
+ #include "jsdbgapi.h"
66
+ #include "jsexn.h"
67
+ #include "jsfun.h"
68
+ #include "jsgc.h"
69
+ #include "jsinterp.h"
70
+ #include "jsiter.h"
71
+ #include "jslock.h"
72
+ #include "jsnum.h"
73
+ #include "jsobj.h"
74
+ #include "jsparse.h"
75
+ #include "jsscope.h"
76
+ #include "jsscript.h"
77
+ #include "jsstr.h"
78
+ #include "jstracer.h"
79
+
80
+ #if JS_HAS_XML_SUPPORT
81
+ #include "jsxml.h"
82
+ #endif
83
+
84
+ /*
85
+ * Check if posix_memalign is available.
86
+ */
87
+ #if _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || MOZ_MEMORY
88
+ # define HAS_POSIX_MEMALIGN 1
89
+ #else
90
+ # define HAS_POSIX_MEMALIGN 0
91
+ #endif
92
+
93
+ /*
94
+ * jemalloc provides posix_memalign.
95
+ */
96
+ #ifdef MOZ_MEMORY
97
+ extern "C" {
98
+ #include "../../memory/jemalloc/jemalloc.h"
99
+ }
100
+ #endif
101
+
102
+ /*
103
+ * Include the headers for mmap unless we have posix_memalign and do not
104
+ * insist on mmap.
105
+ */
106
+ #if JS_GC_USE_MMAP || (!defined JS_GC_USE_MMAP && !HAS_POSIX_MEMALIGN)
107
+ # if defined(XP_WIN)
108
+ # ifndef JS_GC_USE_MMAP
109
+ # define JS_GC_USE_MMAP 1
110
+ # endif
111
+ # include <windows.h>
112
+ # else
113
+ # if defined(XP_UNIX) || defined(XP_BEOS)
114
+ # include <unistd.h>
115
+ # endif
116
+ # if _POSIX_MAPPED_FILES > 0
117
+ # ifndef JS_GC_USE_MMAP
118
+ # define JS_GC_USE_MMAP 1
119
+ # endif
120
+ # include <sys/mman.h>
121
+
122
+ /* On Mac OS X MAP_ANONYMOUS is not defined. */
123
+ # if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
124
+ # define MAP_ANONYMOUS MAP_ANON
125
+ # endif
126
+ # else
127
+ # if JS_GC_USE_MMAP
128
+ # error "JS_GC_USE_MMAP is set when mmap is not available"
129
+ # endif
130
+ # endif
131
+ # endif
132
+ #endif
133
+
134
+ /*
135
+ * A GC arena contains a fixed number of flag bits for each thing in its heap,
136
+ * and supports O(1) lookup of a flag given its thing's address.
137
+ *
138
+ * To implement this, we allocate things of the same size from a GC arena
139
+ * containing GC_ARENA_SIZE bytes aligned on GC_ARENA_SIZE boundary. The
140
+ * following picture shows arena's layout:
141
+ *
142
+ * +------------------------------+--------------------+---------------+
143
+ * | allocation area for GC thing | flags of GC things | JSGCArenaInfo |
144
+ * +------------------------------+--------------------+---------------+
145
+ *
146
+ * To find the flag bits for the thing we calculate the thing index counting
147
+ * from arena's start using:
148
+ *
149
+ * thingIndex = (thingAddress & GC_ARENA_MASK) / thingSize
150
+ *
151
+ * The details of flag's lookup depend on thing's kind. For all GC things
152
+ * except doubles we use one byte of flags where the 4 bits determine thing's
153
+ * type and the rest is used to implement GC marking, finalization and
154
+ * locking. We calculate the address of flag's byte using:
155
+ *
156
+ * flagByteAddress =
157
+ * (thingAddress | GC_ARENA_MASK) - sizeof(JSGCArenaInfo) - thingIndex
158
+ *
159
+ * where
160
+ *
161
+ * (thingAddress | GC_ARENA_MASK) - sizeof(JSGCArenaInfo)
162
+ *
163
+ * is the last byte of flags' area.
164
+ *
165
+ * This implies that the things are allocated from the start of their area and
166
+ * flags are allocated from the end. This arrangement avoids a relatively
167
+ * expensive calculation of the location of the boundary separating things and
168
+ * flags. The boundary's offset from the start of the arena is given by:
169
+ *
170
+ * thingsPerArena * thingSize
171
+ *
172
+ * where thingsPerArena is the number of things that the arena can hold:
173
+ *
174
+ * (GC_ARENA_SIZE - sizeof(JSGCArenaInfo)) / (thingSize + 1).
175
+ *
176
+ * To allocate doubles we use a specialized arena. It can contain only numbers
177
+ * so we do not need the type bits. Moreover, since the doubles do not require
178
+ * a finalizer and very few of them are locked via js_LockGCThing API, we use
179
+ * just one bit of flags per double to denote if it was marked during the
180
+ * marking phase of the GC. The locking is implemented via a hash table. Thus
181
+ * for doubles the flag area becomes a bitmap.
182
+ *
183
+ * JS_GC_USE_MMAP macro governs the choice of the aligned arena allocator.
184
+ * When it is true, a platform-dependent function like mmap is used to get
185
+ * memory aligned on CPU page boundaries. If the macro is false or undefined,
186
+ * posix_memalign is used when available. Otherwise the code uses malloc to
187
+ * over-allocate a chunk with js_gcArenasPerChunk aligned arenas. The
188
+ * approximate space overhead of this is 1/js_gcArenasPerChunk. For details,
189
+ * see NewGCChunk/DestroyGCChunk below.
190
+ *
191
+ * The code also allocates arenas in chunks when JS_GC_USE_MMAP is 1 to
192
+ * minimize the overhead of mmap/munmap. In this case js_gcArenasPerChunk can
193
+ * not be a compile-time constant as the system page size is not known until
194
+ * runtime.
195
+ */
196
+ #if JS_GC_USE_MMAP
197
+ static uint32 js_gcArenasPerChunk = 0;
198
+ static JSBool js_gcUseMmap = JS_FALSE;
199
+ #elif HAS_POSIX_MEMALIGN
200
+ # define js_gcArenasPerChunk 1
201
+ #else
202
+ # define js_gcArenasPerChunk 7
203
+ #endif
204
+
205
+ #if defined(js_gcArenasPerChunk) && js_gcArenasPerChunk == 1
206
+ # define CHUNKED_ARENA_ALLOCATION 0
207
+ #else
208
+ # define CHUNKED_ARENA_ALLOCATION 1
209
+ #endif
210
+
211
+ #define GC_ARENA_SHIFT 12
212
+ #define GC_ARENA_MASK ((jsuword) JS_BITMASK(GC_ARENA_SHIFT))
213
+ #define GC_ARENA_SIZE JS_BIT(GC_ARENA_SHIFT)
214
+
215
+ /*
216
+ * JS_GC_ARENA_PAD defines the number of bytes to pad JSGCArenaInfo structure.
217
+ * It is used to improve allocation efficiency when using posix_memalign. If
218
+ * malloc's implementation uses internal headers, then calling
219
+ *
220
+ * posix_memalign(&p, GC_ARENA_SIZE, GC_ARENA_SIZE * js_gcArenasPerChunk)
221
+ *
222
+ * in a sequence leaves holes between allocations of the size GC_ARENA_SIZE
223
+ * due to the need to fit headers. JS_GC_ARENA_PAD mitigates that so the code
224
+ * calls
225
+ *
226
+ * posix_memalign(&p, GC_ARENA_SIZE,
227
+ * GC_ARENA_SIZE * js_gcArenasPerChunk - JS_GC_ARENA_PAD)
228
+ *
229
+ * When JS_GC_ARENA_PAD is equal or greater than the number of words in the
230
+ * system header, the system can pack all allocations together without holes.
231
+ *
232
+ * With JS_GC_USE_MEMALIGN we want at least 2 word pad unless posix_memalign
233
+ * comes from jemalloc that does not use any headers/trailers.
234
+ */
235
+ #ifndef JS_GC_ARENA_PAD
236
+ # if HAS_POSIX_MEMALIGN && !MOZ_MEMORY
237
+ # define JS_GC_ARENA_PAD (2 * JS_BYTES_PER_WORD)
238
+ # else
239
+ # define JS_GC_ARENA_PAD 0
240
+ # endif
241
+ #endif
242
+
243
+ struct JSGCArenaInfo {
244
+ /*
245
+ * Allocation list for the arena or NULL if the arena holds double values.
246
+ */
247
+ JSGCArenaList *list;
248
+
249
+ /*
250
+ * Pointer to the previous arena in a linked list. The arena can either
251
+ * belong to one of JSContext.gcArenaList lists or, when it does not have
252
+ * any allocated GC things, to the list of free arenas in the chunk with
253
+ * head stored in JSGCChunkInfo.lastFreeArena.
254
+ */
255
+ JSGCArenaInfo *prev;
256
+
257
+ #if !CHUNKED_ARENA_ALLOCATION
258
+ jsuword prevUntracedPage;
259
+ #else
260
+ /*
261
+ * A link field for the list of arenas with marked but not yet traced
262
+ * things. The field is encoded as arena's page to share the space with
263
+ * firstArena and arenaIndex fields.
264
+ */
265
+ jsuword prevUntracedPage : JS_BITS_PER_WORD - GC_ARENA_SHIFT;
266
+
267
+ /*
268
+ * When firstArena is false, the index of arena in the chunk. When
269
+ * firstArena is true, the index of a free arena holding JSGCChunkInfo or
270
+ * NO_FREE_ARENAS if there are no free arenas in the chunk.
271
+ *
272
+ * GET_ARENA_INDEX and GET_CHUNK_INFO_INDEX are convenience macros to
273
+ * access either of indexes.
274
+ */
275
+ jsuword arenaIndex : GC_ARENA_SHIFT - 1;
276
+
277
+ /* Flag indicating if the arena is the first in the chunk. */
278
+ jsuword firstArena : 1;
279
+ #endif
280
+
281
+ union {
282
+ jsuword untracedThings; /* bitset for fast search of marked
283
+ but not yet traced things */
284
+ JSBool hasMarkedDoubles; /* the arena has marked doubles */
285
+ } u;
286
+
287
+ #if JS_GC_ARENA_PAD != 0
288
+ uint8 pad[JS_GC_ARENA_PAD];
289
+ #endif
290
+ };
291
+
292
+ /*
293
+ * Verify that the bit fields are indeed shared and JSGCArenaInfo is as small
294
+ * as possible. The code does not rely on this check so if on a particular
295
+ * platform this does not compile, then, as a workaround, comment the assert
296
+ * out and submit a bug report.
297
+ */
298
+ JS_STATIC_ASSERT(offsetof(JSGCArenaInfo, u) == 3 * sizeof(jsuword));
299
+
300
+ /*
301
+ * Macros to convert between JSGCArenaInfo, the start address of the arena and
302
+ * arena's page defined as (start address) >> GC_ARENA_SHIFT.
303
+ */
304
+ #define ARENA_INFO_OFFSET (GC_ARENA_SIZE - (uint32) sizeof(JSGCArenaInfo))
305
+
306
+ #define IS_ARENA_INFO_ADDRESS(arena) \
307
+ (((jsuword) (arena) & GC_ARENA_MASK) == ARENA_INFO_OFFSET)
308
+
309
+ #define ARENA_START_TO_INFO(arenaStart) \
310
+ (JS_ASSERT(((arenaStart) & (jsuword) GC_ARENA_MASK) == 0), \
311
+ (JSGCArenaInfo *) ((arenaStart) + (jsuword) ARENA_INFO_OFFSET))
312
+
313
+ #define ARENA_INFO_TO_START(arena) \
314
+ (JS_ASSERT(IS_ARENA_INFO_ADDRESS(arena)), \
315
+ (jsuword) (arena) & ~(jsuword) GC_ARENA_MASK)
316
+
317
+ #define ARENA_PAGE_TO_INFO(arenaPage) \
318
+ (JS_ASSERT(arenaPage != 0), \
319
+ JS_ASSERT(!((jsuword)(arenaPage) >> (JS_BITS_PER_WORD-GC_ARENA_SHIFT))), \
320
+ ARENA_START_TO_INFO((arenaPage) << GC_ARENA_SHIFT))
321
+
322
+ #define ARENA_INFO_TO_PAGE(arena) \
323
+ (JS_ASSERT(IS_ARENA_INFO_ADDRESS(arena)), \
324
+ ((jsuword) (arena) >> GC_ARENA_SHIFT))
325
+
326
+ #define GET_ARENA_INFO(chunk, index) \
327
+ (JS_ASSERT((index) < js_gcArenasPerChunk), \
328
+ ARENA_START_TO_INFO(chunk + ((index) << GC_ARENA_SHIFT)))
329
+
330
+ #if CHUNKED_ARENA_ALLOCATION
331
+ /*
332
+ * Definitions for allocating arenas in chunks.
333
+ *
334
+ * All chunks that have at least one free arena are put on the doubly-linked
335
+ * list with the head stored in JSRuntime.gcChunkList. JSGCChunkInfo contains
336
+ * the head of the chunk's free arena list together with the link fields for
337
+ * gcChunkList.
338
+ *
339
+ * Structure stored in one of chunk's free arenas. GET_CHUNK_INFO_INDEX gives
340
+ * the index of this arena. When all arenas in the chunk are used, it is
341
+ * removed from the list and the index is set to NO_FREE_ARENAS indicating
342
+ * that the chunk is not on gcChunkList and has no JSGCChunkInfo available.
343
+ */
344
+
345
+ struct JSGCChunkInfo {
346
+ JSGCChunkInfo **prevp;
347
+ JSGCChunkInfo *next;
348
+ JSGCArenaInfo *lastFreeArena;
349
+ uint32 numFreeArenas;
350
+ };
351
+
352
+ #define NO_FREE_ARENAS JS_BITMASK(GC_ARENA_SHIFT - 1)
353
+
354
+ #ifdef js_gcArenasPerChunk
355
+ JS_STATIC_ASSERT(1 <= js_gcArenasPerChunk &&
356
+ js_gcArenasPerChunk <= NO_FREE_ARENAS);
357
+ #endif
358
+
359
+ #define GET_ARENA_CHUNK(arena, index) \
360
+ (JS_ASSERT(GET_ARENA_INDEX(arena) == index), \
361
+ ARENA_INFO_TO_START(arena) - ((index) << GC_ARENA_SHIFT))
362
+
363
+ #define GET_ARENA_INDEX(arena) \
364
+ ((arena)->firstArena ? 0 : (uint32) (arena)->arenaIndex)
365
+
366
+ #define GET_CHUNK_INFO_INDEX(chunk) \
367
+ ((uint32) ARENA_START_TO_INFO(chunk)->arenaIndex)
368
+
369
+ #define SET_CHUNK_INFO_INDEX(chunk, index) \
370
+ (JS_ASSERT((index) < js_gcArenasPerChunk || (index) == NO_FREE_ARENAS), \
371
+ (void) (ARENA_START_TO_INFO(chunk)->arenaIndex = (jsuword) (index)))
372
+
373
+ #define GET_CHUNK_INFO(chunk, infoIndex) \
374
+ (JS_ASSERT(GET_CHUNK_INFO_INDEX(chunk) == (infoIndex)), \
375
+ JS_ASSERT((uint32) (infoIndex) < js_gcArenasPerChunk), \
376
+ (JSGCChunkInfo *) ((chunk) + ((infoIndex) << GC_ARENA_SHIFT)))
377
+
378
+ #define CHUNK_INFO_TO_INDEX(ci) \
379
+ GET_ARENA_INDEX(ARENA_START_TO_INFO((jsuword)ci))
380
+
381
+ #endif
382
+
383
+ /*
384
+ * Macros for GC-thing operations.
385
+ */
386
+ #define THINGS_PER_ARENA(thingSize) \
387
+ ((GC_ARENA_SIZE - (uint32) sizeof(JSGCArenaInfo)) / ((thingSize) + 1U))
388
+
389
+ #define THING_TO_ARENA(thing) \
390
+ ((JSGCArenaInfo *)(((jsuword) (thing) | GC_ARENA_MASK) + \
391
+ 1 - sizeof(JSGCArenaInfo)))
392
+
393
+ #define THING_TO_INDEX(thing, thingSize) \
394
+ ((uint32) ((jsuword) (thing) & GC_ARENA_MASK) / (uint32) (thingSize))
395
+
396
+ #define THING_FLAGS_END(arena) ((uint8 *)(arena))
397
+
398
+ #define THING_FLAGP(arena, thingIndex) \
399
+ (JS_ASSERT((jsuword) (thingIndex) \
400
+ < (jsuword) THINGS_PER_ARENA((arena)->list->thingSize)), \
401
+ (uint8 *)(arena) - 1 - (thingIndex))
402
+
403
+ #define THING_TO_FLAGP(thing, thingSize) \
404
+ THING_FLAGP(THING_TO_ARENA(thing), THING_TO_INDEX(thing, thingSize))
405
+
406
+ #define FLAGP_TO_ARENA(flagp) THING_TO_ARENA(flagp)
407
+
408
+ #define FLAGP_TO_INDEX(flagp) \
409
+ (JS_ASSERT(((jsuword) (flagp) & GC_ARENA_MASK) < ARENA_INFO_OFFSET), \
410
+ (ARENA_INFO_OFFSET - 1 - (uint32) ((jsuword) (flagp) & GC_ARENA_MASK)))
411
+
412
+ #define FLAGP_TO_THING(flagp, thingSize) \
413
+ (JS_ASSERT(((jsuword) (flagp) & GC_ARENA_MASK) >= \
414
+ (ARENA_INFO_OFFSET - THINGS_PER_ARENA(thingSize))), \
415
+ (JSGCThing *)(((jsuword) (flagp) & ~GC_ARENA_MASK) + \
416
+ (thingSize) * FLAGP_TO_INDEX(flagp)))
417
+
418
+ /*
419
+ * Macros for the specialized arena for doubles.
420
+ *
421
+ * DOUBLES_PER_ARENA defines the maximum number of doubles that the arena can
422
+ * hold. We find it as the following. Let n be the number of doubles in the
423
+ * arena. Together with the bitmap of flags and JSGCArenaInfo they should fit
424
+ * the arena. Hence DOUBLES_PER_ARENA or n_max is the maximum value of n for
425
+ * which the following holds:
426
+ *
427
+ * n*s + ceil(n/B) <= M (1)
428
+ *
429
+ * where "/" denotes normal real division,
430
+ * ceil(r) gives the least integer not smaller than the number r,
431
+ * s is the number of words in jsdouble,
432
+ * B is number of bits per word or B == JS_BITS_PER_WORD
433
+ * M is the number of words in the arena before JSGCArenaInfo or
434
+ * M == (GC_ARENA_SIZE - sizeof(JSGCArenaInfo)) / sizeof(jsuword).
435
+ * M == ARENA_INFO_OFFSET / sizeof(jsuword)
436
+ *
437
+ * We rewrite the inequality as
438
+ *
439
+ * n*B*s/B + ceil(n/B) <= M,
440
+ * ceil(n*B*s/B + n/B) <= M,
441
+ * ceil(n*(B*s + 1)/B) <= M (2)
442
+ *
443
+ * We define a helper function e(n, s, B),
444
+ *
445
+ * e(n, s, B) := ceil(n*(B*s + 1)/B) - n*(B*s + 1)/B, 0 <= e(n, s, B) < 1.
446
+ *
447
+ * It gives:
448
+ *
449
+ * n*(B*s + 1)/B + e(n, s, B) <= M,
450
+ * n + e*B/(B*s + 1) <= M*B/(B*s + 1)
451
+ *
452
+ * We apply the floor function to both sides of the last equation, where
453
+ * floor(r) gives the biggest integer not greater than r. As a consequence we
454
+ * have:
455
+ *
456
+ * floor(n + e*B/(B*s + 1)) <= floor(M*B/(B*s + 1)),
457
+ * n + floor(e*B/(B*s + 1)) <= floor(M*B/(B*s + 1)),
458
+ * n <= floor(M*B/(B*s + 1)), (3)
459
+ *
460
+ * where floor(e*B/(B*s + 1)) is zero as e*B/(B*s + 1) < B/(B*s + 1) < 1.
461
+ * Thus any n that satisfies the original constraint (1) or its equivalent (2),
462
+ * must also satisfy (3). That is, we got an upper estimate for the maximum
463
+ * value of n. Lets show that this upper estimate,
464
+ *
465
+ * floor(M*B/(B*s + 1)), (4)
466
+ *
467
+ * also satisfies (1) and, as such, gives the required maximum value.
468
+ * Substituting it into (2) gives:
469
+ *
470
+ * ceil(floor(M*B/(B*s + 1))*(B*s + 1)/B) == ceil(floor(M/X)*X)
471
+ *
472
+ * where X == (B*s + 1)/B > 1. But then floor(M/X)*X <= M/X*X == M and
473
+ *
474
+ * ceil(floor(M/X)*X) <= ceil(M) == M.
475
+ *
476
+ * Thus the value of (4) gives the maximum n satisfying (1).
477
+ *
478
+ * For the final result we observe that in (4)
479
+ *
480
+ * M*B == ARENA_INFO_OFFSET / sizeof(jsuword) * JS_BITS_PER_WORD
481
+ * == ARENA_INFO_OFFSET * JS_BITS_PER_BYTE
482
+ *
483
+ * and
484
+ *
485
+ * B*s == JS_BITS_PER_WORD * sizeof(jsdouble) / sizeof(jsuword)
486
+ * == JS_BITS_PER_DOUBLE.
487
+ */
488
+ #define DOUBLES_PER_ARENA \
489
+ ((ARENA_INFO_OFFSET * JS_BITS_PER_BYTE) / (JS_BITS_PER_DOUBLE + 1))
490
+
491
+ /*
492
+ * Check that ARENA_INFO_OFFSET and sizeof(jsdouble) divides sizeof(jsuword).
493
+ */
494
+ JS_STATIC_ASSERT(ARENA_INFO_OFFSET % sizeof(jsuword) == 0);
495
+ JS_STATIC_ASSERT(sizeof(jsdouble) % sizeof(jsuword) == 0);
496
+ JS_STATIC_ASSERT(sizeof(jsbitmap) == sizeof(jsuword));
497
+
498
+ #define DOUBLES_ARENA_BITMAP_WORDS \
499
+ (JS_HOWMANY(DOUBLES_PER_ARENA, JS_BITS_PER_WORD))
500
+
501
+ /* Check that DOUBLES_PER_ARENA indeed maximises (1). */
502
+ JS_STATIC_ASSERT(DOUBLES_PER_ARENA * sizeof(jsdouble) +
503
+ DOUBLES_ARENA_BITMAP_WORDS * sizeof(jsuword) <=
504
+ ARENA_INFO_OFFSET);
505
+
506
+ JS_STATIC_ASSERT((DOUBLES_PER_ARENA + 1) * sizeof(jsdouble) +
507
+ sizeof(jsuword) *
508
+ JS_HOWMANY((DOUBLES_PER_ARENA + 1), JS_BITS_PER_WORD) >
509
+ ARENA_INFO_OFFSET);
510
+
511
+ /*
512
+ * When DOUBLES_PER_ARENA % BITS_PER_DOUBLE_FLAG_UNIT != 0, some bits in the
513
+ * last byte of the occupation bitmap are unused.
514
+ */
515
+ #define UNUSED_DOUBLE_BITMAP_BITS \
516
+ (DOUBLES_ARENA_BITMAP_WORDS * JS_BITS_PER_WORD - DOUBLES_PER_ARENA)
517
+
518
+ JS_STATIC_ASSERT(UNUSED_DOUBLE_BITMAP_BITS < JS_BITS_PER_WORD);
519
+
520
+ #define DOUBLES_ARENA_BITMAP_OFFSET \
521
+ (ARENA_INFO_OFFSET - DOUBLES_ARENA_BITMAP_WORDS * sizeof(jsuword))
522
+
523
+ #define CHECK_DOUBLE_ARENA_INFO(arenaInfo) \
524
+ (JS_ASSERT(IS_ARENA_INFO_ADDRESS(arenaInfo)), \
525
+ JS_ASSERT(!(arenaInfo)->list)) \
526
+
527
+ /*
528
+ * Get the start of the bitmap area containing double mark flags in the arena.
529
+ * To access the flag the code uses
530
+ *
531
+ * JS_TEST_BIT(bitmapStart, index)
532
+ *
533
+ * That is, compared with the case of arenas with non-double things, we count
534
+ * flags from the start of the bitmap area, not from the end.
535
+ */
536
+ #define DOUBLE_ARENA_BITMAP(arenaInfo) \
537
+ (CHECK_DOUBLE_ARENA_INFO(arenaInfo), \
538
+ (jsbitmap *) arenaInfo - DOUBLES_ARENA_BITMAP_WORDS)
539
+
540
+ #define DOUBLE_THING_TO_INDEX(thing) \
541
+ (CHECK_DOUBLE_ARENA_INFO(THING_TO_ARENA(thing)), \
542
+ JS_ASSERT(((jsuword) (thing) & GC_ARENA_MASK) < \
543
+ DOUBLES_ARENA_BITMAP_OFFSET), \
544
+ ((uint32) (((jsuword) (thing) & GC_ARENA_MASK) / sizeof(jsdouble))))
545
+
546
+ static void
547
+ ClearDoubleArenaFlags(JSGCArenaInfo *a)
548
+ {
549
+ jsbitmap *bitmap, mask;
550
+ uintN nused;
551
+
552
+ /*
553
+ * When some high bits in the last byte of the double occupation bitmap
554
+ * are unused, we must set them. Otherwise RefillDoubleFreeList will
555
+ * assume that they corresponds to some free cells and tries to allocate
556
+ * them.
557
+ *
558
+ * Note that the code works correctly with UNUSED_DOUBLE_BITMAP_BITS == 0.
559
+ */
560
+ bitmap = DOUBLE_ARENA_BITMAP(a);
561
+ memset(bitmap, 0, (DOUBLES_ARENA_BITMAP_WORDS - 1) * sizeof *bitmap);
562
+ mask = ((jsbitmap) 1 << UNUSED_DOUBLE_BITMAP_BITS) - 1;
563
+ nused = JS_BITS_PER_WORD - UNUSED_DOUBLE_BITMAP_BITS;
564
+ bitmap[DOUBLES_ARENA_BITMAP_WORDS - 1] = mask << nused;
565
+ }
566
+
567
+ static JS_ALWAYS_INLINE JSBool
568
+ IsMarkedDouble(JSGCArenaInfo *a, uint32 index)
569
+ {
570
+ jsbitmap *bitmap;
571
+
572
+ JS_ASSERT(a->u.hasMarkedDoubles);
573
+ bitmap = DOUBLE_ARENA_BITMAP(a);
574
+ return JS_TEST_BIT(bitmap, index);
575
+ }
576
+
577
+ /*
578
+ * JSRuntime.gcDoubleArenaList.nextDoubleFlags points either to:
579
+ *
580
+ * 1. The next byte in the bitmap area for doubles to check for unmarked
581
+ * (or free) doubles.
582
+ * 2. Or to the end of the bitmap area when all GC cells of the arena are
583
+ * allocated.
584
+ * 3. Or to a special sentinel value indicating that there are no arenas
585
+ * to check for unmarked doubles.
586
+ *
587
+ * We set the sentinel to ARENA_INFO_OFFSET so the single check
588
+ *
589
+ * ((jsuword) nextDoubleFlags & GC_ARENA_MASK) == ARENA_INFO_OFFSET
590
+ *
591
+ * will cover both the second and the third cases.
592
+ */
593
+ #define DOUBLE_BITMAP_SENTINEL ((jsbitmap *) ARENA_INFO_OFFSET)
594
+
595
+ #ifdef JS_THREADSAFE
596
+ /*
597
+ * The maximum number of things to put on the local free list by taking
598
+ * several things from the global free list or from the tail of the last
599
+ * allocated arena to amortize the cost of rt->gcLock.
600
+ *
601
+ * We use number 8 based on benchmarks from bug 312238.
602
+ */
603
+ #define MAX_THREAD_LOCAL_THINGS 8
604
+
605
+ #endif
606
+
607
+ JS_STATIC_ASSERT(sizeof(JSStackHeader) >= 2 * sizeof(jsval));
608
+
609
+ JS_STATIC_ASSERT(sizeof(JSGCThing) >= sizeof(JSString));
610
+ JS_STATIC_ASSERT(sizeof(JSGCThing) >= sizeof(jsdouble));
611
+
612
+ /* We want to use all the available GC thing space for object's slots. */
613
+ JS_STATIC_ASSERT(sizeof(JSObject) % sizeof(JSGCThing) == 0);
614
+
615
+ /*
616
+ * Ensure that JSObject is allocated from a different GC-list rather than
617
+ * jsdouble and JSString so we can easily finalize JSObject before these 2
618
+ * types of GC things. See comments in js_GC.
619
+ */
620
+ JS_STATIC_ASSERT(GC_FREELIST_INDEX(sizeof(JSString)) !=
621
+ GC_FREELIST_INDEX(sizeof(JSObject)));
622
+ JS_STATIC_ASSERT(GC_FREELIST_INDEX(sizeof(jsdouble)) !=
623
+ GC_FREELIST_INDEX(sizeof(JSObject)));
624
+
625
+ /*
626
+ * JSPtrTable capacity growth descriptor. The table grows by powers of two
627
+ * starting from capacity JSPtrTableInfo.minCapacity, but switching to linear
628
+ * growth when capacity reaches JSPtrTableInfo.linearGrowthThreshold.
629
+ */
630
+ typedef struct JSPtrTableInfo {
631
+ uint16 minCapacity;
632
+ uint16 linearGrowthThreshold;
633
+ } JSPtrTableInfo;
634
+
635
+ #define GC_ITERATOR_TABLE_MIN 4
636
+ #define GC_ITERATOR_TABLE_LINEAR 1024
637
+
638
+ static const JSPtrTableInfo iteratorTableInfo = {
639
+ GC_ITERATOR_TABLE_MIN,
640
+ GC_ITERATOR_TABLE_LINEAR
641
+ };
642
+
643
+ /* Calculate table capacity based on the current value of JSPtrTable.count. */
644
+ static size_t
645
+ PtrTableCapacity(size_t count, const JSPtrTableInfo *info)
646
+ {
647
+ size_t linear, log, capacity;
648
+
649
+ linear = info->linearGrowthThreshold;
650
+ JS_ASSERT(info->minCapacity <= linear);
651
+
652
+ if (count == 0) {
653
+ capacity = 0;
654
+ } else if (count < linear) {
655
+ log = JS_CEILING_LOG2W(count);
656
+ JS_ASSERT(log != JS_BITS_PER_WORD);
657
+ capacity = (size_t)1 << log;
658
+ if (capacity < info->minCapacity)
659
+ capacity = info->minCapacity;
660
+ } else {
661
+ capacity = JS_ROUNDUP(count, linear);
662
+ }
663
+
664
+ JS_ASSERT(capacity >= count);
665
+ return capacity;
666
+ }
667
+
668
+ static void
669
+ FreePtrTable(JSPtrTable *table, const JSPtrTableInfo *info)
670
+ {
671
+ if (table->array) {
672
+ JS_ASSERT(table->count > 0);
673
+ free(table->array);
674
+ table->array = NULL;
675
+ table->count = 0;
676
+ }
677
+ JS_ASSERT(table->count == 0);
678
+ }
679
+
680
+ static JSBool
681
+ AddToPtrTable(JSContext *cx, JSPtrTable *table, const JSPtrTableInfo *info,
682
+ void *ptr)
683
+ {
684
+ size_t count, capacity;
685
+ void **array;
686
+
687
+ count = table->count;
688
+ capacity = PtrTableCapacity(count, info);
689
+
690
+ if (count == capacity) {
691
+ if (capacity < info->minCapacity) {
692
+ JS_ASSERT(capacity == 0);
693
+ JS_ASSERT(!table->array);
694
+ capacity = info->minCapacity;
695
+ } else {
696
+ /*
697
+ * Simplify the overflow detection assuming pointer is bigger
698
+ * than byte.
699
+ */
700
+ JS_STATIC_ASSERT(2 <= sizeof table->array[0]);
701
+ capacity = (capacity < info->linearGrowthThreshold)
702
+ ? 2 * capacity
703
+ : capacity + info->linearGrowthThreshold;
704
+ if (capacity > (size_t)-1 / sizeof table->array[0])
705
+ goto bad;
706
+ }
707
+ array = (void **) realloc(table->array,
708
+ capacity * sizeof table->array[0]);
709
+ if (!array)
710
+ goto bad;
711
+ #ifdef DEBUG
712
+ memset(array + count, JS_FREE_PATTERN,
713
+ (capacity - count) * sizeof table->array[0]);
714
+ #endif
715
+ table->array = array;
716
+ }
717
+
718
+ table->array[count] = ptr;
719
+ table->count = count + 1;
720
+
721
+ return JS_TRUE;
722
+
723
+ bad:
724
+ JS_ReportOutOfMemory(cx);
725
+ return JS_FALSE;
726
+ }
727
+
728
+ static void
729
+ ShrinkPtrTable(JSPtrTable *table, const JSPtrTableInfo *info,
730
+ size_t newCount)
731
+ {
732
+ size_t oldCapacity, capacity;
733
+ void **array;
734
+
735
+ JS_ASSERT(newCount <= table->count);
736
+ if (newCount == table->count)
737
+ return;
738
+
739
+ oldCapacity = PtrTableCapacity(table->count, info);
740
+ table->count = newCount;
741
+ capacity = PtrTableCapacity(newCount, info);
742
+
743
+ if (oldCapacity != capacity) {
744
+ array = table->array;
745
+ JS_ASSERT(array);
746
+ if (capacity == 0) {
747
+ free(array);
748
+ table->array = NULL;
749
+ return;
750
+ }
751
+ array = (void **) realloc(array, capacity * sizeof array[0]);
752
+ if (array)
753
+ table->array = array;
754
+ }
755
+ #ifdef DEBUG
756
+ memset(table->array + newCount, JS_FREE_PATTERN,
757
+ (capacity - newCount) * sizeof table->array[0]);
758
+ #endif
759
+ }
760
+
761
+ #ifdef JS_GCMETER
762
+ # define METER(x) ((void) (x))
763
+ # define METER_IF(condition, x) ((void) ((condition) && (x)))
764
+ #else
765
+ # define METER(x) ((void) 0)
766
+ # define METER_IF(condition, x) ((void) 0)
767
+ #endif
768
+
769
+ #define METER_UPDATE_MAX(maxLval, rval) \
770
+ METER_IF((maxLval) < (rval), (maxLval) = (rval))
771
+
772
+ #if JS_GC_USE_MMAP || !HAS_POSIX_MEMALIGN
773
+
774
+ /*
775
+ * For chunks allocated via over-sized malloc, get a pointer to store the gap
776
+ * between the malloc's result and the first arena in the chunk.
777
+ */
778
+ static uint32 *
779
+ GetMallocedChunkGapPtr(jsuword chunk)
780
+ {
781
+ JS_ASSERT((chunk & GC_ARENA_MASK) == 0);
782
+
783
+ /* Use the memory after the chunk, see NewGCChunk for details. */
784
+ return (uint32 *) (chunk + (js_gcArenasPerChunk << GC_ARENA_SHIFT));
785
+ }
786
+
787
+ #endif
788
+
789
+ static jsuword
790
+ NewGCChunk(void)
791
+ {
792
+ void *p;
793
+
794
+ #if JS_GC_USE_MMAP
795
+ if (js_gcUseMmap) {
796
+ # if defined(XP_WIN)
797
+ p = VirtualAlloc(NULL, js_gcArenasPerChunk << GC_ARENA_SHIFT,
798
+ MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
799
+ return (jsuword) p;
800
+ # else
801
+ p = mmap(NULL, js_gcArenasPerChunk << GC_ARENA_SHIFT,
802
+ PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
803
+ return (p == MAP_FAILED) ? 0 : (jsuword) p;
804
+ # endif
805
+ }
806
+ #endif
807
+
808
+ #if HAS_POSIX_MEMALIGN
809
+ if (0 != posix_memalign(&p, GC_ARENA_SIZE,
810
+ GC_ARENA_SIZE * js_gcArenasPerChunk -
811
+ JS_GC_ARENA_PAD)) {
812
+ return 0;
813
+ }
814
+ return (jsuword) p;
815
+ #else
816
+ /*
817
+ * Implement chunk allocation using oversized malloc if mmap and
818
+ * posix_memalign are not available.
819
+ *
820
+ * Since malloc allocates pointers aligned on the word boundary, to get
821
+ * js_gcArenasPerChunk aligned arenas, we need to malloc only
822
+ *
823
+ * ((js_gcArenasPerChunk + 1) << GC_ARENA_SHIFT) - sizeof(size_t)
824
+ *
825
+ * bytes. But since we stores the gap between the malloced pointer and the
826
+ * first arena in the chunk after the chunk, we need to ask for
827
+ *
828
+ * ((js_gcArenasPerChunk + 1) << GC_ARENA_SHIFT)
829
+ *
830
+ * bytes to ensure that we always have room to store the gap.
831
+ */
832
+ p = malloc((js_gcArenasPerChunk + 1) << GC_ARENA_SHIFT);
833
+ if (!p)
834
+ return 0;
835
+
836
+ {
837
+ jsuword chunk;
838
+
839
+ chunk = ((jsuword) p + GC_ARENA_MASK) & ~GC_ARENA_MASK;
840
+ *GetMallocedChunkGapPtr(chunk) = (uint32) (chunk - (jsuword) p);
841
+ return chunk;
842
+ }
843
+ #endif
844
+ }
845
+
846
+ static void
847
+ DestroyGCChunk(jsuword chunk)
848
+ {
849
+ JS_ASSERT((chunk & GC_ARENA_MASK) == 0);
850
+ #if JS_GC_USE_MMAP
851
+ if (js_gcUseMmap) {
852
+ # if defined(XP_WIN)
853
+ VirtualFree((void *) chunk, 0, MEM_RELEASE);
854
+ # elif defined(SOLARIS)
855
+ munmap((char *) chunk, js_gcArenasPerChunk << GC_ARENA_SHIFT);
856
+ # else
857
+ munmap((void *) chunk, js_gcArenasPerChunk << GC_ARENA_SHIFT);
858
+ # endif
859
+ return;
860
+ }
861
+ #endif
862
+
863
+ #if HAS_POSIX_MEMALIGN
864
+ free((void *) chunk);
865
+ #else
866
+ /* See comments in NewGCChunk. */
867
+ JS_ASSERT(*GetMallocedChunkGapPtr(chunk) < GC_ARENA_SIZE);
868
+ free((void *) (chunk - *GetMallocedChunkGapPtr(chunk)));
869
+ #endif
870
+ }
871
+
872
+ #if CHUNKED_ARENA_ALLOCATION
873
+
874
+ static void
875
+ AddChunkToList(JSRuntime *rt, JSGCChunkInfo *ci)
876
+ {
877
+ ci->prevp = &rt->gcChunkList;
878
+ ci->next = rt->gcChunkList;
879
+ if (rt->gcChunkList) {
880
+ JS_ASSERT(rt->gcChunkList->prevp == &rt->gcChunkList);
881
+ rt->gcChunkList->prevp = &ci->next;
882
+ }
883
+ rt->gcChunkList = ci;
884
+ }
885
+
886
+ static void
887
+ RemoveChunkFromList(JSRuntime *rt, JSGCChunkInfo *ci)
888
+ {
889
+ *ci->prevp = ci->next;
890
+ if (ci->next) {
891
+ JS_ASSERT(ci->next->prevp == &ci->next);
892
+ ci->next->prevp = ci->prevp;
893
+ }
894
+ }
895
+
896
+ #endif
897
+
898
+ static JSGCArenaInfo *
899
+ NewGCArena(JSRuntime *rt)
900
+ {
901
+ jsuword chunk;
902
+ JSGCArenaInfo *a;
903
+
904
+ if (rt->gcBytes >= rt->gcMaxBytes)
905
+ return NULL;
906
+
907
+ #if CHUNKED_ARENA_ALLOCATION
908
+ if (js_gcArenasPerChunk == 1) {
909
+ #endif
910
+ chunk = NewGCChunk();
911
+ if (chunk == 0)
912
+ return NULL;
913
+ a = ARENA_START_TO_INFO(chunk);
914
+ #if CHUNKED_ARENA_ALLOCATION
915
+ } else {
916
+ JSGCChunkInfo *ci;
917
+ uint32 i;
918
+ JSGCArenaInfo *aprev;
919
+
920
+ ci = rt->gcChunkList;
921
+ if (!ci) {
922
+ chunk = NewGCChunk();
923
+ if (chunk == 0)
924
+ return NULL;
925
+ JS_ASSERT((chunk & GC_ARENA_MASK) == 0);
926
+ a = GET_ARENA_INFO(chunk, 0);
927
+ a->firstArena = JS_TRUE;
928
+ a->arenaIndex = 0;
929
+ aprev = NULL;
930
+ i = 0;
931
+ do {
932
+ a->prev = aprev;
933
+ aprev = a;
934
+ ++i;
935
+ a = GET_ARENA_INFO(chunk, i);
936
+ a->firstArena = JS_FALSE;
937
+ a->arenaIndex = i;
938
+ } while (i != js_gcArenasPerChunk - 1);
939
+ ci = GET_CHUNK_INFO(chunk, 0);
940
+ ci->lastFreeArena = aprev;
941
+ ci->numFreeArenas = js_gcArenasPerChunk - 1;
942
+ AddChunkToList(rt, ci);
943
+ } else {
944
+ JS_ASSERT(ci->prevp == &rt->gcChunkList);
945
+ a = ci->lastFreeArena;
946
+ aprev = a->prev;
947
+ if (!aprev) {
948
+ JS_ASSERT(ci->numFreeArenas == 1);
949
+ JS_ASSERT(ARENA_INFO_TO_START(a) == (jsuword) ci);
950
+ RemoveChunkFromList(rt, ci);
951
+ chunk = GET_ARENA_CHUNK(a, GET_ARENA_INDEX(a));
952
+ SET_CHUNK_INFO_INDEX(chunk, NO_FREE_ARENAS);
953
+ } else {
954
+ JS_ASSERT(ci->numFreeArenas >= 2);
955
+ JS_ASSERT(ARENA_INFO_TO_START(a) != (jsuword) ci);
956
+ ci->lastFreeArena = aprev;
957
+ ci->numFreeArenas--;
958
+ }
959
+ }
960
+ }
961
+ #endif
962
+
963
+ rt->gcBytes += GC_ARENA_SIZE;
964
+ a->prevUntracedPage = 0;
965
+ memset(&a->u, 0, sizeof(a->u));
966
+
967
+ return a;
968
+ }
969
+
970
+ static void
971
+ DestroyGCArenas(JSRuntime *rt, JSGCArenaInfo *last)
972
+ {
973
+ JSGCArenaInfo *a;
974
+
975
+ while (last) {
976
+ a = last;
977
+ last = last->prev;
978
+
979
+ METER(rt->gcStats.afree++);
980
+ JS_ASSERT(rt->gcBytes >= GC_ARENA_SIZE);
981
+ rt->gcBytes -= GC_ARENA_SIZE;
982
+
983
+ #if CHUNKED_ARENA_ALLOCATION
984
+ if (js_gcArenasPerChunk == 1) {
985
+ #endif
986
+ DestroyGCChunk(ARENA_INFO_TO_START(a));
987
+ #if CHUNKED_ARENA_ALLOCATION
988
+ } else {
989
+ uint32 arenaIndex;
990
+ jsuword chunk;
991
+ uint32 chunkInfoIndex;
992
+ JSGCChunkInfo *ci;
993
+ # ifdef DEBUG
994
+ jsuword firstArena;
995
+
996
+ firstArena = a->firstArena;
997
+ arenaIndex = a->arenaIndex;
998
+ memset((void *) ARENA_INFO_TO_START(a), JS_FREE_PATTERN,
999
+ GC_ARENA_SIZE - JS_GC_ARENA_PAD);
1000
+ a->firstArena = firstArena;
1001
+ a->arenaIndex = arenaIndex;
1002
+ # endif
1003
+ arenaIndex = GET_ARENA_INDEX(a);
1004
+ chunk = GET_ARENA_CHUNK(a, arenaIndex);
1005
+ chunkInfoIndex = GET_CHUNK_INFO_INDEX(chunk);
1006
+ if (chunkInfoIndex == NO_FREE_ARENAS) {
1007
+ chunkInfoIndex = arenaIndex;
1008
+ SET_CHUNK_INFO_INDEX(chunk, arenaIndex);
1009
+ ci = GET_CHUNK_INFO(chunk, chunkInfoIndex);
1010
+ a->prev = NULL;
1011
+ ci->lastFreeArena = a;
1012
+ ci->numFreeArenas = 1;
1013
+ AddChunkToList(rt, ci);
1014
+ } else {
1015
+ JS_ASSERT(chunkInfoIndex != arenaIndex);
1016
+ ci = GET_CHUNK_INFO(chunk, chunkInfoIndex);
1017
+ JS_ASSERT(ci->numFreeArenas != 0);
1018
+ JS_ASSERT(ci->lastFreeArena);
1019
+ JS_ASSERT(a != ci->lastFreeArena);
1020
+ if (ci->numFreeArenas == js_gcArenasPerChunk - 1) {
1021
+ RemoveChunkFromList(rt, ci);
1022
+ DestroyGCChunk(chunk);
1023
+ } else {
1024
+ ++ci->numFreeArenas;
1025
+ a->prev = ci->lastFreeArena;
1026
+ ci->lastFreeArena = a;
1027
+ }
1028
+ }
1029
+ }
1030
+ # endif
1031
+ }
1032
+ }
1033
+
1034
+ static void
1035
+ InitGCArenaLists(JSRuntime *rt)
1036
+ {
1037
+ uintN i, thingSize;
1038
+ JSGCArenaList *arenaList;
1039
+
1040
+ for (i = 0; i < GC_NUM_FREELISTS; i++) {
1041
+ arenaList = &rt->gcArenaList[i];
1042
+ thingSize = GC_FREELIST_NBYTES(i);
1043
+ JS_ASSERT((size_t)(uint16)thingSize == thingSize);
1044
+ arenaList->last = NULL;
1045
+ arenaList->lastCount = (uint16) THINGS_PER_ARENA(thingSize);
1046
+ arenaList->thingSize = (uint16) thingSize;
1047
+ arenaList->freeList = NULL;
1048
+ }
1049
+ rt->gcDoubleArenaList.first = NULL;
1050
+ rt->gcDoubleArenaList.nextDoubleFlags = DOUBLE_BITMAP_SENTINEL;
1051
+ }
1052
+
1053
+ static void
1054
+ FinishGCArenaLists(JSRuntime *rt)
1055
+ {
1056
+ uintN i;
1057
+ JSGCArenaList *arenaList;
1058
+
1059
+ for (i = 0; i < GC_NUM_FREELISTS; i++) {
1060
+ arenaList = &rt->gcArenaList[i];
1061
+ DestroyGCArenas(rt, arenaList->last);
1062
+ arenaList->last = NULL;
1063
+ arenaList->lastCount = THINGS_PER_ARENA(arenaList->thingSize);
1064
+ arenaList->freeList = NULL;
1065
+ }
1066
+ DestroyGCArenas(rt, rt->gcDoubleArenaList.first);
1067
+ rt->gcDoubleArenaList.first = NULL;
1068
+ rt->gcDoubleArenaList.nextDoubleFlags = DOUBLE_BITMAP_SENTINEL;
1069
+
1070
+ rt->gcBytes = 0;
1071
+ JS_ASSERT(rt->gcChunkList == 0);
1072
+ }
1073
+
1074
+ /*
1075
+ * This function must not be called when thing is jsdouble.
1076
+ */
1077
+ static uint8 *
1078
+ GetGCThingFlags(void *thing)
1079
+ {
1080
+ JSGCArenaInfo *a;
1081
+ uint32 index;
1082
+
1083
+ a = THING_TO_ARENA(thing);
1084
+ index = THING_TO_INDEX(thing, a->list->thingSize);
1085
+ return THING_FLAGP(a, index);
1086
+ }
1087
+
1088
+ /*
1089
+ * This function returns null when thing is jsdouble.
1090
+ */
1091
+ static uint8 *
1092
+ GetGCThingFlagsOrNull(void *thing)
1093
+ {
1094
+ JSGCArenaInfo *a;
1095
+ uint32 index;
1096
+
1097
+ a = THING_TO_ARENA(thing);
1098
+ if (!a->list)
1099
+ return NULL;
1100
+ index = THING_TO_INDEX(thing, a->list->thingSize);
1101
+ return THING_FLAGP(a, index);
1102
+ }
1103
+
1104
+ intN
1105
+ js_GetExternalStringGCType(JSString *str)
1106
+ {
1107
+ uintN type;
1108
+
1109
+ type = (uintN) *GetGCThingFlags(str) & GCF_TYPEMASK;
1110
+ JS_ASSERT(type == GCX_STRING || type >= GCX_EXTERNAL_STRING);
1111
+ return (type == GCX_STRING) ? -1 : (intN) (type - GCX_EXTERNAL_STRING);
1112
+ }
1113
+
1114
+ static uint32
1115
+ MapGCFlagsToTraceKind(uintN flags)
1116
+ {
1117
+ uint32 type;
1118
+
1119
+ type = flags & GCF_TYPEMASK;
1120
+ JS_ASSERT(type != GCX_DOUBLE);
1121
+ JS_ASSERT(type < GCX_NTYPES);
1122
+ return (type < GCX_EXTERNAL_STRING) ? type : JSTRACE_STRING;
1123
+ }
1124
+
1125
+ JS_FRIEND_API(uint32)
1126
+ js_GetGCThingTraceKind(void *thing)
1127
+ {
1128
+ JSGCArenaInfo *a;
1129
+ uint32 index;
1130
+
1131
+ a = THING_TO_ARENA(thing);
1132
+ if (!a->list)
1133
+ return JSTRACE_DOUBLE;
1134
+
1135
+ index = THING_TO_INDEX(thing, a->list->thingSize);
1136
+ return MapGCFlagsToTraceKind(*THING_FLAGP(a, index));
1137
+ }
1138
+
1139
+ JSRuntime*
1140
+ js_GetGCStringRuntime(JSString *str)
1141
+ {
1142
+ JSGCArenaList *list;
1143
+
1144
+ list = THING_TO_ARENA(str)->list;
1145
+
1146
+ JS_ASSERT(list->thingSize == sizeof(JSGCThing));
1147
+ JS_ASSERT(GC_FREELIST_INDEX(sizeof(JSGCThing)) == 0);
1148
+
1149
+ return (JSRuntime *)((uint8 *)list - offsetof(JSRuntime, gcArenaList));
1150
+ }
1151
+
1152
+ JSBool
1153
+ js_IsAboutToBeFinalized(JSContext *cx, void *thing)
1154
+ {
1155
+ JSGCArenaInfo *a;
1156
+ uint32 index, flags;
1157
+
1158
+ a = THING_TO_ARENA(thing);
1159
+ if (!a->list) {
1160
+ /*
1161
+ * Check if arena has no marked doubles. In that case the bitmap with
1162
+ * the mark flags contains all garbage as it is initialized only when
1163
+ * marking the first double in the arena.
1164
+ */
1165
+ if (!a->u.hasMarkedDoubles)
1166
+ return JS_TRUE;
1167
+ index = DOUBLE_THING_TO_INDEX(thing);
1168
+ return !IsMarkedDouble(a, index);
1169
+ }
1170
+ index = THING_TO_INDEX(thing, a->list->thingSize);
1171
+ flags = *THING_FLAGP(a, index);
1172
+ return !(flags & (GCF_MARK | GCF_LOCK | GCF_FINAL));
1173
+ }
1174
+
1175
+ /* This is compatible with JSDHashEntryStub. */
1176
+ typedef struct JSGCRootHashEntry {
1177
+ JSDHashEntryHdr hdr;
1178
+ void *root;
1179
+ const char *name;
1180
+ } JSGCRootHashEntry;
1181
+
1182
+ /* Initial size of the gcRootsHash table (SWAG, small enough to amortize). */
1183
+ #define GC_ROOTS_SIZE 256
1184
+
1185
+ #if CHUNKED_ARENA_ALLOCATION
1186
+
1187
+ /*
1188
+ * For a CPU with extremely large pages using them for GC things wastes
1189
+ * too much memory.
1190
+ */
1191
+ # define GC_ARENAS_PER_CPU_PAGE_LIMIT JS_BIT(18 - GC_ARENA_SHIFT)
1192
+
1193
+ JS_STATIC_ASSERT(GC_ARENAS_PER_CPU_PAGE_LIMIT <= NO_FREE_ARENAS);
1194
+
1195
+ #endif
1196
+
1197
+ JSBool
1198
+ js_InitGC(JSRuntime *rt, uint32 maxbytes)
1199
+ {
1200
+ #if JS_GC_USE_MMAP
1201
+ if (js_gcArenasPerChunk == 0) {
1202
+ size_t cpuPageSize, arenasPerPage;
1203
+ # if defined(XP_WIN)
1204
+ SYSTEM_INFO si;
1205
+
1206
+ GetSystemInfo(&si);
1207
+ cpuPageSize = si.dwPageSize;
1208
+
1209
+ # elif defined(XP_UNIX) || defined(XP_BEOS)
1210
+ cpuPageSize = (size_t) sysconf(_SC_PAGESIZE);
1211
+ # else
1212
+ # error "Not implemented"
1213
+ # endif
1214
+ /* cpuPageSize is a power of 2. */
1215
+ JS_ASSERT((cpuPageSize & (cpuPageSize - 1)) == 0);
1216
+ arenasPerPage = cpuPageSize >> GC_ARENA_SHIFT;
1217
+ #ifdef DEBUG
1218
+ if (arenasPerPage == 0) {
1219
+ fprintf(stderr,
1220
+ "JS engine warning: the size of the CPU page, %u bytes, is too low to use\n"
1221
+ "paged allocation for the garbage collector. Please report this.\n",
1222
+ (unsigned) cpuPageSize);
1223
+ }
1224
+ #endif
1225
+ if (arenasPerPage - 1 <= (size_t) (GC_ARENAS_PER_CPU_PAGE_LIMIT - 1)) {
1226
+ /*
1227
+ * Use at least 4 GC arenas per paged allocation chunk to minimize
1228
+ * the overhead of mmap/VirtualAlloc.
1229
+ */
1230
+ js_gcUseMmap = JS_TRUE;
1231
+ js_gcArenasPerChunk = JS_MAX((uint32) arenasPerPage, 4);
1232
+ } else {
1233
+ js_gcUseMmap = JS_FALSE;
1234
+ js_gcArenasPerChunk = 7;
1235
+ }
1236
+ }
1237
+ JS_ASSERT(1 <= js_gcArenasPerChunk &&
1238
+ js_gcArenasPerChunk <= NO_FREE_ARENAS);
1239
+ #endif
1240
+
1241
+ InitGCArenaLists(rt);
1242
+ if (!JS_DHashTableInit(&rt->gcRootsHash, JS_DHashGetStubOps(), NULL,
1243
+ sizeof(JSGCRootHashEntry), GC_ROOTS_SIZE)) {
1244
+ rt->gcRootsHash.ops = NULL;
1245
+ return JS_FALSE;
1246
+ }
1247
+ rt->gcLocksHash = NULL; /* create lazily */
1248
+
1249
+ /*
1250
+ * Separate gcMaxMallocBytes from gcMaxBytes but initialize to maxbytes
1251
+ * for default backward API compatibility.
1252
+ */
1253
+ rt->gcMaxBytes = rt->gcMaxMallocBytes = maxbytes;
1254
+ rt->gcEmptyArenaPoolLifespan = 30000;
1255
+
1256
+ METER(memset(&rt->gcStats, 0, sizeof rt->gcStats));
1257
+ return JS_TRUE;
1258
+ }
1259
+
1260
+ #ifdef JS_GCMETER
1261
+
1262
+ static void
1263
+ UpdateArenaStats(JSGCArenaStats *st, uint32 nlivearenas, uint32 nkilledArenas,
1264
+ uint32 nthings)
1265
+ {
1266
+ size_t narenas;
1267
+
1268
+ narenas = nlivearenas + nkilledArenas;
1269
+ JS_ASSERT(narenas >= st->livearenas);
1270
+
1271
+ st->newarenas = narenas - st->livearenas;
1272
+ st->narenas = narenas;
1273
+ st->livearenas = nlivearenas;
1274
+ if (st->maxarenas < narenas)
1275
+ st->maxarenas = narenas;
1276
+ st->totalarenas += narenas;
1277
+
1278
+ st->nthings = nthings;
1279
+ if (st->maxthings < nthings)
1280
+ st->maxthings = nthings;
1281
+ st->totalthings += nthings;
1282
+ }
1283
+
1284
+ JS_FRIEND_API(void)
1285
+ js_DumpGCStats(JSRuntime *rt, FILE *fp)
1286
+ {
1287
+ int i;
1288
+ size_t sumArenas, sumTotalArenas;
1289
+ size_t sumThings, sumMaxThings;
1290
+ size_t sumThingSize, sumTotalThingSize;
1291
+ size_t sumArenaCapacity, sumTotalArenaCapacity;
1292
+ JSGCArenaStats *st;
1293
+ size_t thingSize, thingsPerArena;
1294
+ size_t sumAlloc, sumLocalAlloc, sumFail, sumRetry;
1295
+
1296
+ fprintf(fp, "\nGC allocation statistics:\n");
1297
+
1298
+ #define UL(x) ((unsigned long)(x))
1299
+ #define ULSTAT(x) UL(rt->gcStats.x)
1300
+ #define PERCENT(x,y) (100.0 * (double) (x) / (double) (y))
1301
+
1302
+ sumArenas = 0;
1303
+ sumTotalArenas = 0;
1304
+ sumThings = 0;
1305
+ sumMaxThings = 0;
1306
+ sumThingSize = 0;
1307
+ sumTotalThingSize = 0;
1308
+ sumArenaCapacity = 0;
1309
+ sumTotalArenaCapacity = 0;
1310
+ sumAlloc = 0;
1311
+ sumLocalAlloc = 0;
1312
+ sumFail = 0;
1313
+ sumRetry = 0;
1314
+ for (i = -1; i < (int) GC_NUM_FREELISTS; i++) {
1315
+ if (i == -1) {
1316
+ thingSize = sizeof(jsdouble);
1317
+ thingsPerArena = DOUBLES_PER_ARENA;
1318
+ st = &rt->gcStats.doubleArenaStats;
1319
+ fprintf(fp,
1320
+ "Arena list for double values (%lu doubles per arena):",
1321
+ UL(thingsPerArena));
1322
+ } else {
1323
+ thingSize = rt->gcArenaList[i].thingSize;
1324
+ thingsPerArena = THINGS_PER_ARENA(thingSize);
1325
+ st = &rt->gcStats.arenaStats[i];
1326
+ fprintf(fp,
1327
+ "Arena list %d (thing size %lu, %lu things per arena):",
1328
+ i, UL(GC_FREELIST_NBYTES(i)), UL(thingsPerArena));
1329
+ }
1330
+ if (st->maxarenas == 0) {
1331
+ fputs(" NEVER USED\n", fp);
1332
+ continue;
1333
+ }
1334
+ putc('\n', fp);
1335
+ fprintf(fp, " arenas before GC: %lu\n", UL(st->narenas));
1336
+ fprintf(fp, " new arenas before GC: %lu (%.1f%%)\n",
1337
+ UL(st->newarenas), PERCENT(st->newarenas, st->narenas));
1338
+ fprintf(fp, " arenas after GC: %lu (%.1f%%)\n",
1339
+ UL(st->livearenas), PERCENT(st->livearenas, st->narenas));
1340
+ fprintf(fp, " max arenas: %lu\n", UL(st->maxarenas));
1341
+ fprintf(fp, " things: %lu\n", UL(st->nthings));
1342
+ fprintf(fp, " GC cell utilization: %.1f%%\n",
1343
+ PERCENT(st->nthings, thingsPerArena * st->narenas));
1344
+ fprintf(fp, " average cell utilization: %.1f%%\n",
1345
+ PERCENT(st->totalthings, thingsPerArena * st->totalarenas));
1346
+ fprintf(fp, " max things: %lu\n", UL(st->maxthings));
1347
+ fprintf(fp, " alloc attempts: %lu\n", UL(st->alloc));
1348
+ fprintf(fp, " alloc without locks: %1u (%.1f%%)\n",
1349
+ UL(st->localalloc), PERCENT(st->localalloc, st->alloc));
1350
+ sumArenas += st->narenas;
1351
+ sumTotalArenas += st->totalarenas;
1352
+ sumThings += st->nthings;
1353
+ sumMaxThings += st->maxthings;
1354
+ sumThingSize += thingSize * st->nthings;
1355
+ sumTotalThingSize += thingSize * st->totalthings;
1356
+ sumArenaCapacity += thingSize * thingsPerArena * st->narenas;
1357
+ sumTotalArenaCapacity += thingSize * thingsPerArena * st->totalarenas;
1358
+ sumAlloc += st->alloc;
1359
+ sumLocalAlloc += st->localalloc;
1360
+ sumFail += st->fail;
1361
+ sumRetry += st->retry;
1362
+ }
1363
+ fprintf(fp, "TOTAL STATS:\n");
1364
+ fprintf(fp, " bytes allocated: %lu\n", UL(rt->gcBytes));
1365
+ fprintf(fp, " total GC arenas: %lu\n", UL(sumArenas));
1366
+ fprintf(fp, " total GC things: %lu\n", UL(sumThings));
1367
+ fprintf(fp, " max total GC things: %lu\n", UL(sumMaxThings));
1368
+ fprintf(fp, " GC cell utilization: %.1f%%\n",
1369
+ PERCENT(sumThingSize, sumArenaCapacity));
1370
+ fprintf(fp, " average cell utilization: %.1f%%\n",
1371
+ PERCENT(sumTotalThingSize, sumTotalArenaCapacity));
1372
+ fprintf(fp, "allocation retries after GC: %lu\n", UL(sumRetry));
1373
+ fprintf(fp, " alloc attempts: %lu\n", UL(sumAlloc));
1374
+ fprintf(fp, " alloc without locks: %1u (%.1f%%)\n",
1375
+ UL(sumLocalAlloc), PERCENT(sumLocalAlloc, sumAlloc));
1376
+ fprintf(fp, " allocation failures: %lu\n", UL(sumFail));
1377
+ fprintf(fp, " things born locked: %lu\n", ULSTAT(lockborn));
1378
+ fprintf(fp, " valid lock calls: %lu\n", ULSTAT(lock));
1379
+ fprintf(fp, " valid unlock calls: %lu\n", ULSTAT(unlock));
1380
+ fprintf(fp, " mark recursion depth: %lu\n", ULSTAT(depth));
1381
+ fprintf(fp, " maximum mark recursion: %lu\n", ULSTAT(maxdepth));
1382
+ fprintf(fp, " mark C recursion depth: %lu\n", ULSTAT(cdepth));
1383
+ fprintf(fp, " maximum mark C recursion: %lu\n", ULSTAT(maxcdepth));
1384
+ fprintf(fp, " delayed tracing calls: %lu\n", ULSTAT(untraced));
1385
+ #ifdef DEBUG
1386
+ fprintf(fp, " max trace later count: %lu\n", ULSTAT(maxuntraced));
1387
+ #endif
1388
+ fprintf(fp, " maximum GC nesting level: %lu\n", ULSTAT(maxlevel));
1389
+ fprintf(fp, "potentially useful GC calls: %lu\n", ULSTAT(poke));
1390
+ fprintf(fp, " thing arenas freed so far: %lu\n", ULSTAT(afree));
1391
+ fprintf(fp, " stack segments scanned: %lu\n", ULSTAT(stackseg));
1392
+ fprintf(fp, "stack segment slots scanned: %lu\n", ULSTAT(segslots));
1393
+ fprintf(fp, "reachable closeable objects: %lu\n", ULSTAT(nclose));
1394
+ fprintf(fp, " max reachable closeable: %lu\n", ULSTAT(maxnclose));
1395
+ fprintf(fp, " scheduled close hooks: %lu\n", ULSTAT(closelater));
1396
+ fprintf(fp, " max scheduled close hooks: %lu\n", ULSTAT(maxcloselater));
1397
+
1398
+ #undef UL
1399
+ #undef ULSTAT
1400
+ #undef PERCENT
1401
+
1402
+ #ifdef JS_ARENAMETER
1403
+ JS_DumpArenaStats(fp);
1404
+ #endif
1405
+ }
1406
+ #endif
1407
+
1408
+ #ifdef DEBUG
1409
+ static void
1410
+ CheckLeakedRoots(JSRuntime *rt);
1411
+ #endif
1412
+
1413
+ #ifdef JS_THREADSAFE
1414
+ static void
1415
+ TrimGCFreeListsPool(JSRuntime *rt, uintN keepCount);
1416
+ #endif
1417
+
1418
+ void
1419
+ js_FinishGC(JSRuntime *rt)
1420
+ {
1421
+ #ifdef JS_ARENAMETER
1422
+ JS_DumpArenaStats(stdout);
1423
+ #endif
1424
+ #ifdef JS_GCMETER
1425
+ js_DumpGCStats(rt, stdout);
1426
+ #endif
1427
+
1428
+ FreePtrTable(&rt->gcIteratorTable, &iteratorTableInfo);
1429
+ #ifdef JS_THREADSAFE
1430
+ TrimGCFreeListsPool(rt, 0);
1431
+ JS_ASSERT(!rt->gcFreeListsPool);
1432
+ #endif
1433
+ FinishGCArenaLists(rt);
1434
+
1435
+ if (rt->gcRootsHash.ops) {
1436
+ #ifdef DEBUG
1437
+ CheckLeakedRoots(rt);
1438
+ #endif
1439
+ JS_DHashTableFinish(&rt->gcRootsHash);
1440
+ rt->gcRootsHash.ops = NULL;
1441
+ }
1442
+ if (rt->gcLocksHash) {
1443
+ JS_DHashTableDestroy(rt->gcLocksHash);
1444
+ rt->gcLocksHash = NULL;
1445
+ }
1446
+ }
1447
+
1448
+ JSBool
1449
+ js_AddRoot(JSContext *cx, void *rp, const char *name)
1450
+ {
1451
+ JSBool ok = js_AddRootRT(cx->runtime, rp, name);
1452
+ if (!ok)
1453
+ JS_ReportOutOfMemory(cx);
1454
+ return ok;
1455
+ }
1456
+
1457
+ JSBool
1458
+ js_AddRootRT(JSRuntime *rt, void *rp, const char *name)
1459
+ {
1460
+ JSBool ok;
1461
+ JSGCRootHashEntry *rhe;
1462
+
1463
+ /*
1464
+ * Due to the long-standing, but now removed, use of rt->gcLock across the
1465
+ * bulk of js_GC, API users have come to depend on JS_AddRoot etc. locking
1466
+ * properly with a racing GC, without calling JS_AddRoot from a request.
1467
+ * We have to preserve API compatibility here, now that we avoid holding
1468
+ * rt->gcLock across the mark phase (including the root hashtable mark).
1469
+ *
1470
+ * If the GC is running and we're called on another thread, wait for this
1471
+ * GC activation to finish. We can safely wait here (in the case where we
1472
+ * are called within a request on another thread's context) without fear
1473
+ * of deadlock because the GC doesn't set rt->gcRunning until after it has
1474
+ * waited for all active requests to end.
1475
+ */
1476
+ JS_LOCK_GC(rt);
1477
+ #ifdef JS_THREADSAFE
1478
+ JS_ASSERT(!rt->gcRunning || rt->gcLevel > 0);
1479
+ if (rt->gcRunning && rt->gcThread->id != js_CurrentThreadId()) {
1480
+ do {
1481
+ JS_AWAIT_GC_DONE(rt);
1482
+ } while (rt->gcLevel > 0);
1483
+ }
1484
+ #endif
1485
+ rhe = (JSGCRootHashEntry *)
1486
+ JS_DHashTableOperate(&rt->gcRootsHash, rp, JS_DHASH_ADD);
1487
+ if (rhe) {
1488
+ rhe->root = rp;
1489
+ rhe->name = name;
1490
+ ok = JS_TRUE;
1491
+ } else {
1492
+ ok = JS_FALSE;
1493
+ }
1494
+ JS_UNLOCK_GC(rt);
1495
+ return ok;
1496
+ }
1497
+
1498
+ JSBool
1499
+ js_RemoveRoot(JSRuntime *rt, void *rp)
1500
+ {
1501
+ /*
1502
+ * Due to the JS_RemoveRootRT API, we may be called outside of a request.
1503
+ * Same synchronization drill as above in js_AddRoot.
1504
+ */
1505
+ JS_LOCK_GC(rt);
1506
+ #ifdef JS_THREADSAFE
1507
+ JS_ASSERT(!rt->gcRunning || rt->gcLevel > 0);
1508
+ if (rt->gcRunning && rt->gcThread->id != js_CurrentThreadId()) {
1509
+ do {
1510
+ JS_AWAIT_GC_DONE(rt);
1511
+ } while (rt->gcLevel > 0);
1512
+ }
1513
+ #endif
1514
+ (void) JS_DHashTableOperate(&rt->gcRootsHash, rp, JS_DHASH_REMOVE);
1515
+ rt->gcPoke = JS_TRUE;
1516
+ JS_UNLOCK_GC(rt);
1517
+ return JS_TRUE;
1518
+ }
1519
+
1520
+ #ifdef DEBUG
1521
+
1522
+ static JSDHashOperator
1523
+ js_root_printer(JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 i, void *arg)
1524
+ {
1525
+ uint32 *leakedroots = (uint32 *)arg;
1526
+ JSGCRootHashEntry *rhe = (JSGCRootHashEntry *)hdr;
1527
+
1528
+ (*leakedroots)++;
1529
+ fprintf(stderr,
1530
+ "JS engine warning: leaking GC root \'%s\' at %p\n",
1531
+ rhe->name ? (char *)rhe->name : "", rhe->root);
1532
+
1533
+ return JS_DHASH_NEXT;
1534
+ }
1535
+
1536
+ static void
1537
+ CheckLeakedRoots(JSRuntime *rt)
1538
+ {
1539
+ uint32 leakedroots = 0;
1540
+
1541
+ /* Warn (but don't assert) debug builds of any remaining roots. */
1542
+ JS_DHashTableEnumerate(&rt->gcRootsHash, js_root_printer,
1543
+ &leakedroots);
1544
+ if (leakedroots > 0) {
1545
+ if (leakedroots == 1) {
1546
+ fprintf(stderr,
1547
+ "JS engine warning: 1 GC root remains after destroying the JSRuntime at %p.\n"
1548
+ " This root may point to freed memory. Objects reachable\n"
1549
+ " through it have not been finalized.\n",
1550
+ (void *) rt);
1551
+ } else {
1552
+ fprintf(stderr,
1553
+ "JS engine warning: %lu GC roots remain after destroying the JSRuntime at %p.\n"
1554
+ " These roots may point to freed memory. Objects reachable\n"
1555
+ " through them have not been finalized.\n",
1556
+ (unsigned long) leakedroots, (void *) rt);
1557
+ }
1558
+ }
1559
+ }
1560
+
1561
+ typedef struct NamedRootDumpArgs {
1562
+ void (*dump)(const char *name, void *rp, void *data);
1563
+ void *data;
1564
+ } NamedRootDumpArgs;
1565
+
1566
+ static JSDHashOperator
1567
+ js_named_root_dumper(JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 number,
1568
+ void *arg)
1569
+ {
1570
+ NamedRootDumpArgs *args = (NamedRootDumpArgs *) arg;
1571
+ JSGCRootHashEntry *rhe = (JSGCRootHashEntry *)hdr;
1572
+
1573
+ if (rhe->name)
1574
+ args->dump(rhe->name, rhe->root, args->data);
1575
+ return JS_DHASH_NEXT;
1576
+ }
1577
+
1578
+ JS_BEGIN_EXTERN_C
1579
+ void
1580
+ js_DumpNamedRoots(JSRuntime *rt,
1581
+ void (*dump)(const char *name, void *rp, void *data),
1582
+ void *data)
1583
+ {
1584
+ NamedRootDumpArgs args;
1585
+
1586
+ args.dump = dump;
1587
+ args.data = data;
1588
+ JS_DHashTableEnumerate(&rt->gcRootsHash, js_named_root_dumper, &args);
1589
+ }
1590
+ JS_END_EXTERN_C
1591
+
1592
+ #endif /* DEBUG */
1593
+
1594
+ typedef struct GCRootMapArgs {
1595
+ JSGCRootMapFun map;
1596
+ void *data;
1597
+ } GCRootMapArgs;
1598
+
1599
+ static JSDHashOperator
1600
+ js_gcroot_mapper(JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 number,
1601
+ void *arg)
1602
+ {
1603
+ GCRootMapArgs *args = (GCRootMapArgs *) arg;
1604
+ JSGCRootHashEntry *rhe = (JSGCRootHashEntry *)hdr;
1605
+ intN mapflags;
1606
+ int op;
1607
+
1608
+ mapflags = args->map(rhe->root, rhe->name, args->data);
1609
+
1610
+ #if JS_MAP_GCROOT_NEXT == JS_DHASH_NEXT && \
1611
+ JS_MAP_GCROOT_STOP == JS_DHASH_STOP && \
1612
+ JS_MAP_GCROOT_REMOVE == JS_DHASH_REMOVE
1613
+ op = (JSDHashOperator)mapflags;
1614
+ #else
1615
+ op = JS_DHASH_NEXT;
1616
+ if (mapflags & JS_MAP_GCROOT_STOP)
1617
+ op |= JS_DHASH_STOP;
1618
+ if (mapflags & JS_MAP_GCROOT_REMOVE)
1619
+ op |= JS_DHASH_REMOVE;
1620
+ #endif
1621
+
1622
+ return (JSDHashOperator) op;
1623
+ }
1624
+
1625
+ uint32
1626
+ js_MapGCRoots(JSRuntime *rt, JSGCRootMapFun map, void *data)
1627
+ {
1628
+ GCRootMapArgs args;
1629
+ uint32 rv;
1630
+
1631
+ args.map = map;
1632
+ args.data = data;
1633
+ JS_LOCK_GC(rt);
1634
+ rv = JS_DHashTableEnumerate(&rt->gcRootsHash, js_gcroot_mapper, &args);
1635
+ JS_UNLOCK_GC(rt);
1636
+ return rv;
1637
+ }
1638
+
1639
+ JSBool
1640
+ js_RegisterCloseableIterator(JSContext *cx, JSObject *obj)
1641
+ {
1642
+ JSRuntime *rt;
1643
+ JSBool ok;
1644
+
1645
+ rt = cx->runtime;
1646
+ JS_ASSERT(!rt->gcRunning);
1647
+
1648
+ JS_LOCK_GC(rt);
1649
+ ok = AddToPtrTable(cx, &rt->gcIteratorTable, &iteratorTableInfo, obj);
1650
+ JS_UNLOCK_GC(rt);
1651
+ return ok;
1652
+ }
1653
+
1654
+ static void
1655
+ CloseNativeIterators(JSContext *cx)
1656
+ {
1657
+ JSRuntime *rt;
1658
+ size_t count, newCount, i;
1659
+ void **array;
1660
+ JSObject *obj;
1661
+
1662
+ rt = cx->runtime;
1663
+ count = rt->gcIteratorTable.count;
1664
+ array = rt->gcIteratorTable.array;
1665
+
1666
+ newCount = 0;
1667
+ for (i = 0; i != count; ++i) {
1668
+ obj = (JSObject *)array[i];
1669
+ if (js_IsAboutToBeFinalized(cx, obj))
1670
+ js_CloseNativeIterator(cx, obj);
1671
+ else
1672
+ array[newCount++] = obj;
1673
+ }
1674
+ ShrinkPtrTable(&rt->gcIteratorTable, &iteratorTableInfo, newCount);
1675
+ }
1676
+
1677
+ #if defined(DEBUG_brendan) || defined(DEBUG_timeless)
1678
+ #define DEBUG_gchist
1679
+ #endif
1680
+
1681
+ #ifdef DEBUG_gchist
1682
+ #define NGCHIST 64
1683
+
1684
+ static struct GCHist {
1685
+ JSBool lastDitch;
1686
+ JSGCThing *freeList;
1687
+ } gchist[NGCHIST];
1688
+
1689
+ unsigned gchpos = 0;
1690
+ #endif
1691
+
1692
+ #ifdef JS_THREADSAFE
1693
+
1694
+ const JSGCFreeListSet js_GCEmptyFreeListSet = {
1695
+ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, NULL
1696
+ };
1697
+
1698
+ static void
1699
+ TrimGCFreeListsPool(JSRuntime *rt, uintN keepCount)
1700
+ {
1701
+ JSGCFreeListSet **cursor, *freeLists, *link;
1702
+
1703
+ cursor = &rt->gcFreeListsPool;
1704
+ while (keepCount != 0) {
1705
+ --keepCount;
1706
+ freeLists = *cursor;
1707
+ if (!freeLists)
1708
+ return;
1709
+ memset(freeLists->array, 0, sizeof freeLists->array);
1710
+ cursor = &freeLists->link;
1711
+ }
1712
+ freeLists = *cursor;
1713
+ if (freeLists) {
1714
+ *cursor = NULL;
1715
+ do {
1716
+ link = freeLists->link;
1717
+ free(freeLists);
1718
+ } while ((freeLists = link) != NULL);
1719
+ }
1720
+ }
1721
+
1722
+ void
1723
+ js_RevokeGCLocalFreeLists(JSContext *cx)
1724
+ {
1725
+ JS_ASSERT(!cx->gcLocalFreeLists->link);
1726
+ if (cx->gcLocalFreeLists != &js_GCEmptyFreeListSet) {
1727
+ cx->gcLocalFreeLists->link = cx->runtime->gcFreeListsPool;
1728
+ cx->runtime->gcFreeListsPool = cx->gcLocalFreeLists;
1729
+ cx->gcLocalFreeLists = (JSGCFreeListSet *) &js_GCEmptyFreeListSet;
1730
+ }
1731
+ }
1732
+
1733
+ static JSGCFreeListSet *
1734
+ EnsureLocalFreeList(JSContext *cx)
1735
+ {
1736
+ JSGCFreeListSet *freeLists;
1737
+
1738
+ freeLists = cx->gcLocalFreeLists;
1739
+ if (freeLists != &js_GCEmptyFreeListSet) {
1740
+ JS_ASSERT(freeLists);
1741
+ return freeLists;
1742
+ }
1743
+
1744
+ freeLists = cx->runtime->gcFreeListsPool;
1745
+ if (freeLists) {
1746
+ cx->runtime->gcFreeListsPool = freeLists->link;
1747
+ freeLists->link = NULL;
1748
+ } else {
1749
+ /* JS_malloc is not used as the caller reports out-of-memory itself. */
1750
+ freeLists = (JSGCFreeListSet *) calloc(1, sizeof *freeLists);
1751
+ if (!freeLists)
1752
+ return NULL;
1753
+ }
1754
+ cx->gcLocalFreeLists = freeLists;
1755
+ return freeLists;
1756
+ }
1757
+
1758
+ #endif
1759
+
1760
+ void *
1761
+ js_NewGCThing(JSContext *cx, uintN flags, size_t nbytes)
1762
+ {
1763
+ JSRuntime *rt;
1764
+ uintN flindex;
1765
+ JSBool doGC;
1766
+ JSGCThing *thing;
1767
+ uint8 *flagp;
1768
+ JSGCArenaList *arenaList;
1769
+ JSGCArenaInfo *a;
1770
+ uintN thingsLimit;
1771
+ JSLocalRootStack *lrs;
1772
+ #ifdef JS_GCMETER
1773
+ JSGCArenaStats *astats;
1774
+ #endif
1775
+ #ifdef JS_THREADSAFE
1776
+ JSBool gcLocked;
1777
+ uintN localMallocBytes;
1778
+ JSGCFreeListSet *freeLists;
1779
+ JSGCThing **lastptr;
1780
+ JSGCThing *tmpthing;
1781
+ uint8 *tmpflagp;
1782
+ uintN maxFreeThings; /* max to take from the global free list */
1783
+ #endif
1784
+
1785
+ JS_ASSERT((flags & GCF_TYPEMASK) != GCX_DOUBLE);
1786
+ rt = cx->runtime;
1787
+ nbytes = JS_ROUNDUP(nbytes, sizeof(JSGCThing));
1788
+ flindex = GC_FREELIST_INDEX(nbytes);
1789
+
1790
+ /* Updates of metering counters here may not be thread-safe. */
1791
+ METER(astats = &cx->runtime->gcStats.arenaStats[flindex]);
1792
+ METER(astats->alloc++);
1793
+
1794
+ #ifdef JS_THREADSAFE
1795
+ gcLocked = JS_FALSE;
1796
+ JS_ASSERT(cx->thread);
1797
+ freeLists = cx->gcLocalFreeLists;
1798
+ thing = freeLists->array[flindex];
1799
+ localMallocBytes = cx->thread->gcMallocBytes;
1800
+ if (thing && rt->gcMaxMallocBytes - rt->gcMallocBytes > localMallocBytes) {
1801
+ flagp = thing->flagp;
1802
+ freeLists->array[flindex] = thing->next;
1803
+ METER(astats->localalloc++);
1804
+ goto success;
1805
+ }
1806
+
1807
+ JS_LOCK_GC(rt);
1808
+ gcLocked = JS_TRUE;
1809
+
1810
+ /* Transfer thread-local counter to global one. */
1811
+ if (localMallocBytes != 0) {
1812
+ cx->thread->gcMallocBytes = 0;
1813
+ if (rt->gcMaxMallocBytes - rt->gcMallocBytes < localMallocBytes)
1814
+ rt->gcMallocBytes = rt->gcMaxMallocBytes;
1815
+ else
1816
+ rt->gcMallocBytes += localMallocBytes;
1817
+ }
1818
+ #endif
1819
+ JS_ASSERT(!rt->gcRunning);
1820
+ if (rt->gcRunning) {
1821
+ METER(rt->gcStats.finalfail++);
1822
+ JS_UNLOCK_GC(rt);
1823
+ return NULL;
1824
+ }
1825
+
1826
+ doGC = (rt->gcMallocBytes >= rt->gcMaxMallocBytes && rt->gcPoke);
1827
+ #ifdef JS_GC_ZEAL
1828
+ doGC = doGC || rt->gcZeal >= 2 || (rt->gcZeal >= 1 && rt->gcPoke);
1829
+ #endif
1830
+
1831
+ arenaList = &rt->gcArenaList[flindex];
1832
+ for (;;) {
1833
+ if (doGC && !JS_ON_TRACE(cx)) {
1834
+ /*
1835
+ * Keep rt->gcLock across the call into js_GC so we don't starve
1836
+ * and lose to racing threads who deplete the heap just after
1837
+ * js_GC has replenished it (or has synchronized with a racing
1838
+ * GC that collected a bunch of garbage). This unfair scheduling
1839
+ * can happen on certain operating systems. For the gory details,
1840
+ * see bug 162779 at https://bugzilla.mozilla.org/.
1841
+ */
1842
+ js_GC(cx, GC_LAST_DITCH);
1843
+ METER(astats->retry++);
1844
+ }
1845
+
1846
+ /* Try to get thing from the free list. */
1847
+ thing = arenaList->freeList;
1848
+ if (thing) {
1849
+ arenaList->freeList = thing->next;
1850
+ flagp = thing->flagp;
1851
+ JS_ASSERT(*flagp & GCF_FINAL);
1852
+
1853
+ #ifdef JS_THREADSAFE
1854
+ /*
1855
+ * Refill the local free list by taking several things from the
1856
+ * global free list unless we are still at rt->gcMaxMallocBytes
1857
+ * barrier or the free list is already populated. The former
1858
+ * happens when GC is canceled due to !gcCallback(cx, JSGC_BEGIN)
1859
+ * or no gcPoke. The latter is caused via allocating new things
1860
+ * in gcCallback(cx, JSGC_END).
1861
+ */
1862
+ if (rt->gcMallocBytes >= rt->gcMaxMallocBytes)
1863
+ break;
1864
+
1865
+ freeLists = EnsureLocalFreeList(cx);
1866
+ if (!freeLists)
1867
+ goto fail;
1868
+ if (freeLists->array[flindex])
1869
+ break;
1870
+
1871
+ tmpthing = arenaList->freeList;
1872
+ if (tmpthing) {
1873
+ maxFreeThings = MAX_THREAD_LOCAL_THINGS;
1874
+ do {
1875
+ if (!tmpthing->next)
1876
+ break;
1877
+ tmpthing = tmpthing->next;
1878
+ } while (--maxFreeThings != 0);
1879
+
1880
+ freeLists->array[flindex] = arenaList->freeList;
1881
+ arenaList->freeList = tmpthing->next;
1882
+ tmpthing->next = NULL;
1883
+ }
1884
+ #endif
1885
+ break;
1886
+ }
1887
+
1888
+ /*
1889
+ * Try to allocate things from the last arena. If it is fully used,
1890
+ * check if we can allocate a new one and, if we cannot, consider
1891
+ * doing a "last ditch" GC unless already tried.
1892
+ */
1893
+ thingsLimit = THINGS_PER_ARENA(nbytes);
1894
+ if (arenaList->lastCount != thingsLimit) {
1895
+ JS_ASSERT(arenaList->lastCount < thingsLimit);
1896
+ a = arenaList->last;
1897
+ } else {
1898
+ a = NewGCArena(rt);
1899
+ if (!a) {
1900
+ if (doGC || JS_ON_TRACE(cx))
1901
+ goto fail;
1902
+ doGC = JS_TRUE;
1903
+ continue;
1904
+ }
1905
+ a->list = arenaList;
1906
+ a->prev = arenaList->last;
1907
+ a->prevUntracedPage = 0;
1908
+ a->u.untracedThings = 0;
1909
+ arenaList->last = a;
1910
+ arenaList->lastCount = 0;
1911
+ }
1912
+
1913
+ flagp = THING_FLAGP(a, arenaList->lastCount);
1914
+ thing = FLAGP_TO_THING(flagp, nbytes);
1915
+ arenaList->lastCount++;
1916
+
1917
+ #ifdef JS_THREADSAFE
1918
+ /*
1919
+ * Refill the local free list by taking free things from the last
1920
+ * arena. Prefer to order free things by ascending address in the
1921
+ * (unscientific) hope of better cache locality.
1922
+ */
1923
+ if (rt->gcMallocBytes >= rt->gcMaxMallocBytes)
1924
+ break;
1925
+
1926
+ freeLists = EnsureLocalFreeList(cx);
1927
+ if (!freeLists)
1928
+ goto fail;
1929
+ if (freeLists->array[flindex])
1930
+ break;
1931
+ lastptr = &freeLists->array[flindex];
1932
+ maxFreeThings = thingsLimit - arenaList->lastCount;
1933
+ if (maxFreeThings > MAX_THREAD_LOCAL_THINGS)
1934
+ maxFreeThings = MAX_THREAD_LOCAL_THINGS;
1935
+ while (maxFreeThings != 0) {
1936
+ --maxFreeThings;
1937
+
1938
+ tmpflagp = THING_FLAGP(a, arenaList->lastCount);
1939
+ tmpthing = FLAGP_TO_THING(tmpflagp, nbytes);
1940
+ arenaList->lastCount++;
1941
+ tmpthing->flagp = tmpflagp;
1942
+ *tmpflagp = GCF_FINAL; /* signifying that thing is free */
1943
+
1944
+ *lastptr = tmpthing;
1945
+ lastptr = &tmpthing->next;
1946
+ }
1947
+ *lastptr = NULL;
1948
+ #endif
1949
+ break;
1950
+ }
1951
+
1952
+ /* We successfully allocated the thing. */
1953
+ #ifdef JS_THREADSAFE
1954
+ success:
1955
+ #endif
1956
+ lrs = cx->localRootStack;
1957
+ if (lrs) {
1958
+ /*
1959
+ * If we're in a local root scope, don't set newborn[type] at all, to
1960
+ * avoid entraining garbage from it for an unbounded amount of time
1961
+ * on this context. A caller will leave the local root scope and pop
1962
+ * this reference, allowing thing to be GC'd if it has no other refs.
1963
+ * See JS_EnterLocalRootScope and related APIs.
1964
+ */
1965
+ if (js_PushLocalRoot(cx, lrs, (jsval) thing) < 0) {
1966
+ /*
1967
+ * When we fail for a thing allocated through the tail of the last
1968
+ * arena, thing's flag byte is not initialized. So to prevent GC
1969
+ * accessing the uninitialized flags during the finalization, we
1970
+ * always mark the thing as final. See bug 337407.
1971
+ */
1972
+ *flagp = GCF_FINAL;
1973
+ goto fail;
1974
+ }
1975
+ } else {
1976
+ /*
1977
+ * No local root scope, so we're stuck with the old, fragile model of
1978
+ * depending on a pigeon-hole newborn per type per context.
1979
+ */
1980
+ cx->weakRoots.newborn[flags & GCF_TYPEMASK] = thing;
1981
+ }
1982
+
1983
+ /* We can't fail now, so update flags. */
1984
+ *flagp = (uint8)flags;
1985
+
1986
+ #ifdef DEBUG_gchist
1987
+ gchist[gchpos].lastDitch = doGC;
1988
+ gchist[gchpos].freeList = rt->gcArenaList[flindex].freeList;
1989
+ if (++gchpos == NGCHIST)
1990
+ gchpos = 0;
1991
+ #endif
1992
+
1993
+ /* This is not thread-safe for thread-local allocations. */
1994
+ METER_IF(flags & GCF_LOCK, rt->gcStats.lockborn++);
1995
+
1996
+ #ifdef JS_THREADSAFE
1997
+ if (gcLocked)
1998
+ JS_UNLOCK_GC(rt);
1999
+ #endif
2000
+ JS_COUNT_OPERATION(cx, JSOW_ALLOCATION);
2001
+ return thing;
2002
+
2003
+ fail:
2004
+ #ifdef JS_THREADSAFE
2005
+ if (gcLocked)
2006
+ JS_UNLOCK_GC(rt);
2007
+ #endif
2008
+ METER(astats->fail++);
2009
+ if (!JS_ON_TRACE(cx))
2010
+ JS_ReportOutOfMemory(cx);
2011
+ return NULL;
2012
+ }
2013
+
2014
+ static JSGCDoubleCell *
2015
+ RefillDoubleFreeList(JSContext *cx)
2016
+ {
2017
+ JSRuntime *rt;
2018
+ jsbitmap *doubleFlags, usedBits;
2019
+ JSBool didGC = JS_FALSE;
2020
+ JSGCArenaInfo *a;
2021
+ uintN bit, index;
2022
+ JSGCDoubleCell *cell, *list, *lastcell;
2023
+
2024
+ JS_ASSERT(!cx->doubleFreeList);
2025
+
2026
+ rt = cx->runtime;
2027
+ JS_LOCK_GC(rt);
2028
+
2029
+ JS_ASSERT(!rt->gcRunning);
2030
+ if (rt->gcRunning) {
2031
+ METER(rt->gcStats.finalfail++);
2032
+ JS_UNLOCK_GC(rt);
2033
+ return NULL;
2034
+ }
2035
+
2036
+ if (rt->gcMallocBytes >= rt->gcMaxMallocBytes && rt->gcPoke
2037
+ #ifdef JS_GC_ZEAL
2038
+ && (rt->gcZeal >= 2 || (rt->gcZeal >= 1 && rt->gcPoke))
2039
+ #endif
2040
+ ) {
2041
+ goto do_gc;
2042
+ }
2043
+
2044
+ /*
2045
+ * Loop until we find a flag bitmap byte with unset bits indicating free
2046
+ * double cells, then set all bits as used and put the cells to the free
2047
+ * list for the current context.
2048
+ */
2049
+ doubleFlags = rt->gcDoubleArenaList.nextDoubleFlags;
2050
+ for (;;) {
2051
+ if (((jsuword) doubleFlags & GC_ARENA_MASK) ==
2052
+ ARENA_INFO_OFFSET) {
2053
+ if (doubleFlags == DOUBLE_BITMAP_SENTINEL ||
2054
+ !((JSGCArenaInfo *) doubleFlags)->prev) {
2055
+ a = NewGCArena(rt);
2056
+ if (!a) {
2057
+ do_gc:
2058
+ if (didGC || JS_ON_TRACE(cx)) {
2059
+ METER(rt->gcStats.doubleArenaStats.fail++);
2060
+ JS_UNLOCK_GC(rt);
2061
+ if (!JS_ON_TRACE(cx))
2062
+ JS_ReportOutOfMemory(cx);
2063
+ return NULL;
2064
+ }
2065
+ js_GC(cx, GC_LAST_DITCH);
2066
+ METER(rt->gcStats.doubleArenaStats.retry++);
2067
+ doubleFlags = rt->gcDoubleArenaList.nextDoubleFlags;
2068
+ didGC = JS_TRUE;
2069
+ continue;
2070
+ }
2071
+ a->list = NULL;
2072
+ a->prev = NULL;
2073
+ if (doubleFlags == DOUBLE_BITMAP_SENTINEL) {
2074
+ JS_ASSERT(!rt->gcDoubleArenaList.first);
2075
+ rt->gcDoubleArenaList.first = a;
2076
+ } else {
2077
+ JS_ASSERT(rt->gcDoubleArenaList.first);
2078
+ ((JSGCArenaInfo *) doubleFlags)->prev = a;
2079
+ }
2080
+ ClearDoubleArenaFlags(a);
2081
+ doubleFlags = DOUBLE_ARENA_BITMAP(a);
2082
+ break;
2083
+ }
2084
+ doubleFlags =
2085
+ DOUBLE_ARENA_BITMAP(((JSGCArenaInfo *) doubleFlags)->prev);
2086
+ }
2087
+
2088
+ /*
2089
+ * When doubleFlags points the last bitmap's word in the arena, its
2090
+ * high bits corresponds to non-existing cells. ClearDoubleArenaFlags
2091
+ * sets such bits to 1. Thus even for this last word its bit is unset
2092
+ * iff the corresponding cell exists and free.
2093
+ */
2094
+ if (*doubleFlags != (jsbitmap) -1)
2095
+ break;
2096
+ ++doubleFlags;
2097
+ }
2098
+
2099
+ rt->gcDoubleArenaList.nextDoubleFlags = doubleFlags + 1;
2100
+ usedBits = *doubleFlags;
2101
+ JS_ASSERT(usedBits != (jsbitmap) -1);
2102
+ *doubleFlags = (jsbitmap) -1;
2103
+ JS_UNLOCK_GC(rt);
2104
+
2105
+ /*
2106
+ * Find the index corresponding to the first bit in *doubleFlags. The last
2107
+ * bit will have "index + JS_BITS_PER_WORD - 1".
2108
+ */
2109
+ index = ((uintN) ((jsuword) doubleFlags & GC_ARENA_MASK) -
2110
+ DOUBLES_ARENA_BITMAP_OFFSET) * JS_BITS_PER_BYTE;
2111
+ cell = (JSGCDoubleCell *) ((jsuword) doubleFlags & ~GC_ARENA_MASK) + index;
2112
+
2113
+ if (usedBits == 0) {
2114
+ /* The common case when all doubles from *doubleFlags are free. */
2115
+ JS_ASSERT(index + JS_BITS_PER_WORD <= DOUBLES_PER_ARENA);
2116
+ list = cell;
2117
+ for (lastcell = cell + JS_BITS_PER_WORD - 1; cell != lastcell; ++cell)
2118
+ cell->link = cell + 1;
2119
+ lastcell->link = NULL;
2120
+ } else {
2121
+ /*
2122
+ * Assemble the free list from free cells from *doubleFlags starting
2123
+ * from the tail. In the loop
2124
+ *
2125
+ * index + bit >= DOUBLES_PER_ARENA
2126
+ *
2127
+ * when bit is one of the unused bits. We do not check for such bits
2128
+ * explicitly as they must be set and the "if" check filters them out.
2129
+ */
2130
+ JS_ASSERT(index + JS_BITS_PER_WORD <=
2131
+ DOUBLES_PER_ARENA + UNUSED_DOUBLE_BITMAP_BITS);
2132
+ bit = JS_BITS_PER_WORD;
2133
+ cell += bit;
2134
+ list = NULL;
2135
+ do {
2136
+ --bit;
2137
+ --cell;
2138
+ if (!(((jsbitmap) 1 << bit) & usedBits)) {
2139
+ JS_ASSERT(index + bit < DOUBLES_PER_ARENA);
2140
+ JS_ASSERT_IF(index + bit == DOUBLES_PER_ARENA - 1, !list);
2141
+ cell->link = list;
2142
+ list = cell;
2143
+ }
2144
+ } while (bit != 0);
2145
+ }
2146
+ JS_ASSERT(list);
2147
+ JS_COUNT_OPERATION(cx, JSOW_ALLOCATION * JS_BITS_PER_WORD);
2148
+
2149
+ /*
2150
+ * We delegate assigning cx->doubleFreeList to js_NewDoubleInRootedValue as
2151
+ * it immediately consumes the head of the list.
2152
+ */
2153
+ return list;
2154
+ }
2155
+
2156
+ JSBool
2157
+ js_NewDoubleInRootedValue(JSContext *cx, jsdouble d, jsval *vp)
2158
+ {
2159
+ #ifdef JS_GCMETER
2160
+ JSGCArenaStats *astats;
2161
+ #endif
2162
+ JSGCDoubleCell *cell;
2163
+
2164
+ /* Updates of metering counters here are not thread-safe. */
2165
+ METER(astats = &cx->runtime->gcStats.doubleArenaStats);
2166
+ METER(astats->alloc++);
2167
+ cell = cx->doubleFreeList;
2168
+ if (!cell) {
2169
+ cell = RefillDoubleFreeList(cx);
2170
+ if (!cell) {
2171
+ METER(astats->fail++);
2172
+ return JS_FALSE;
2173
+ }
2174
+ } else {
2175
+ METER(astats->localalloc++);
2176
+ }
2177
+ cx->doubleFreeList = cell->link;
2178
+ cell->number = d;
2179
+ *vp = DOUBLE_TO_JSVAL(&cell->number);
2180
+ return JS_TRUE;
2181
+ }
2182
+
2183
+ jsdouble *
2184
+ js_NewWeaklyRootedDouble(JSContext *cx, jsdouble d)
2185
+ {
2186
+ jsval v;
2187
+ jsdouble *dp;
2188
+
2189
+ if (!js_NewDoubleInRootedValue(cx, d, &v))
2190
+ return NULL;
2191
+
2192
+ JS_ASSERT(JSVAL_IS_DOUBLE(v));
2193
+ dp = JSVAL_TO_DOUBLE(v);
2194
+ if (cx->localRootStack) {
2195
+ if (js_PushLocalRoot(cx, cx->localRootStack, v) < 0)
2196
+ return NULL;
2197
+ } else {
2198
+ cx->weakRoots.newborn[GCX_DOUBLE] = dp;
2199
+ }
2200
+ return dp;
2201
+ }
2202
+
2203
+ JSBool
2204
+ js_AddAsGCBytes(JSContext *cx, size_t sz)
2205
+ {
2206
+ JSRuntime *rt;
2207
+
2208
+ rt = cx->runtime;
2209
+ if (rt->gcBytes >= rt->gcMaxBytes ||
2210
+ sz > (size_t) (rt->gcMaxBytes - rt->gcBytes)
2211
+ #ifdef JS_GC_ZEAL
2212
+ || rt->gcZeal >= 2 || (rt->gcZeal >= 1 && rt->gcPoke)
2213
+ #endif
2214
+ ) {
2215
+ if (JS_ON_TRACE(cx)) {
2216
+ JS_UNLOCK_GC(rt);
2217
+ return JS_FALSE;
2218
+ }
2219
+ js_GC(cx, GC_LAST_DITCH);
2220
+ if (rt->gcBytes >= rt->gcMaxBytes ||
2221
+ sz > (size_t) (rt->gcMaxBytes - rt->gcBytes)) {
2222
+ JS_UNLOCK_GC(rt);
2223
+ JS_ReportOutOfMemory(cx);
2224
+ return JS_FALSE;
2225
+ }
2226
+ }
2227
+ rt->gcBytes += (uint32) sz;
2228
+ return JS_TRUE;
2229
+ }
2230
+
2231
+ void
2232
+ js_RemoveAsGCBytes(JSRuntime *rt, size_t sz)
2233
+ {
2234
+ JS_ASSERT((size_t) rt->gcBytes >= sz);
2235
+ rt->gcBytes -= (uint32) sz;
2236
+ }
2237
+
2238
+ /*
2239
+ * Shallow GC-things can be locked just by setting the GCF_LOCK bit, because
2240
+ * they have no descendants to mark during the GC. Currently the optimization
2241
+ * is only used for non-dependant strings.
2242
+ */
2243
+ #define GC_THING_IS_SHALLOW(flagp, thing) \
2244
+ ((flagp) && \
2245
+ ((*(flagp) & GCF_TYPEMASK) >= GCX_EXTERNAL_STRING || \
2246
+ ((*(flagp) & GCF_TYPEMASK) == GCX_STRING && \
2247
+ !JSSTRING_IS_DEPENDENT((JSString *) (thing)))))
2248
+
2249
+ /* This is compatible with JSDHashEntryStub. */
2250
+ typedef struct JSGCLockHashEntry {
2251
+ JSDHashEntryHdr hdr;
2252
+ const void *thing;
2253
+ uint32 count;
2254
+ } JSGCLockHashEntry;
2255
+
2256
+ JSBool
2257
+ js_LockGCThingRT(JSRuntime *rt, void *thing)
2258
+ {
2259
+ JSBool shallow, ok;
2260
+ uint8 *flagp;
2261
+ JSGCLockHashEntry *lhe;
2262
+
2263
+ if (!thing)
2264
+ return JS_TRUE;
2265
+
2266
+ flagp = GetGCThingFlagsOrNull(thing);
2267
+ JS_LOCK_GC(rt);
2268
+ shallow = GC_THING_IS_SHALLOW(flagp, thing);
2269
+
2270
+ /*
2271
+ * Avoid adding a rt->gcLocksHash entry for shallow things until someone
2272
+ * nests a lock.
2273
+ */
2274
+ if (shallow && !(*flagp & GCF_LOCK)) {
2275
+ *flagp |= GCF_LOCK;
2276
+ METER(rt->gcStats.lock++);
2277
+ ok = JS_TRUE;
2278
+ goto out;
2279
+ }
2280
+
2281
+ if (!rt->gcLocksHash) {
2282
+ rt->gcLocksHash = JS_NewDHashTable(JS_DHashGetStubOps(), NULL,
2283
+ sizeof(JSGCLockHashEntry),
2284
+ GC_ROOTS_SIZE);
2285
+ if (!rt->gcLocksHash) {
2286
+ ok = JS_FALSE;
2287
+ goto out;
2288
+ }
2289
+ }
2290
+
2291
+ lhe = (JSGCLockHashEntry *)
2292
+ JS_DHashTableOperate(rt->gcLocksHash, thing, JS_DHASH_ADD);
2293
+ if (!lhe) {
2294
+ ok = JS_FALSE;
2295
+ goto out;
2296
+ }
2297
+ if (!lhe->thing) {
2298
+ lhe->thing = thing;
2299
+ lhe->count = 1;
2300
+ } else {
2301
+ JS_ASSERT(lhe->count >= 1);
2302
+ lhe->count++;
2303
+ }
2304
+
2305
+ METER(rt->gcStats.lock++);
2306
+ ok = JS_TRUE;
2307
+ out:
2308
+ JS_UNLOCK_GC(rt);
2309
+ return ok;
2310
+ }
2311
+
2312
+ JSBool
2313
+ js_UnlockGCThingRT(JSRuntime *rt, void *thing)
2314
+ {
2315
+ uint8 *flagp;
2316
+ JSBool shallow;
2317
+ JSGCLockHashEntry *lhe;
2318
+
2319
+ if (!thing)
2320
+ return JS_TRUE;
2321
+
2322
+ flagp = GetGCThingFlagsOrNull(thing);
2323
+ JS_LOCK_GC(rt);
2324
+ shallow = GC_THING_IS_SHALLOW(flagp, thing);
2325
+
2326
+ if (shallow && !(*flagp & GCF_LOCK))
2327
+ goto out;
2328
+ if (!rt->gcLocksHash ||
2329
+ (lhe = (JSGCLockHashEntry *)
2330
+ JS_DHashTableOperate(rt->gcLocksHash, thing,
2331
+ JS_DHASH_LOOKUP),
2332
+ JS_DHASH_ENTRY_IS_FREE(&lhe->hdr))) {
2333
+ /* Shallow entry is not in the hash -> clear its lock bit. */
2334
+ if (shallow)
2335
+ *flagp &= ~GCF_LOCK;
2336
+ else
2337
+ goto out;
2338
+ } else {
2339
+ if (--lhe->count != 0)
2340
+ goto out;
2341
+ JS_DHashTableOperate(rt->gcLocksHash, thing, JS_DHASH_REMOVE);
2342
+ }
2343
+
2344
+ rt->gcPoke = JS_TRUE;
2345
+ METER(rt->gcStats.unlock++);
2346
+ out:
2347
+ JS_UNLOCK_GC(rt);
2348
+ return JS_TRUE;
2349
+ }
2350
+
2351
+ JS_PUBLIC_API(void)
2352
+ JS_TraceChildren(JSTracer *trc, void *thing, uint32 kind)
2353
+ {
2354
+ JSObject *obj;
2355
+ size_t nslots, i;
2356
+ jsval v;
2357
+ JSString *str;
2358
+
2359
+ switch (kind) {
2360
+ case JSTRACE_OBJECT:
2361
+ /* If obj has no map, it must be a newborn. */
2362
+ obj = (JSObject *) thing;
2363
+ if (!obj->map)
2364
+ break;
2365
+ if (obj->map->ops->trace) {
2366
+ obj->map->ops->trace(trc, obj);
2367
+ } else {
2368
+ nslots = STOBJ_NSLOTS(obj);
2369
+ for (i = 0; i != nslots; ++i) {
2370
+ v = STOBJ_GET_SLOT(obj, i);
2371
+ if (JSVAL_IS_TRACEABLE(v)) {
2372
+ JS_SET_TRACING_INDEX(trc, "slot", i);
2373
+ JS_CallTracer(trc, JSVAL_TO_TRACEABLE(v),
2374
+ JSVAL_TRACE_KIND(v));
2375
+ }
2376
+ }
2377
+ }
2378
+ break;
2379
+
2380
+ case JSTRACE_STRING:
2381
+ str = (JSString *)thing;
2382
+ if (JSSTRING_IS_DEPENDENT(str))
2383
+ JS_CALL_STRING_TRACER(trc, JSSTRDEP_BASE(str), "base");
2384
+ break;
2385
+
2386
+ #if JS_HAS_XML_SUPPORT
2387
+ case JSTRACE_XML:
2388
+ js_TraceXML(trc, (JSXML *)thing);
2389
+ break;
2390
+ #endif
2391
+ }
2392
+ }
2393
+
2394
+ /*
2395
+ * Number of things covered by a single bit of JSGCArenaInfo.u.untracedThings.
2396
+ */
2397
+ #define THINGS_PER_UNTRACED_BIT(thingSize) \
2398
+ JS_HOWMANY(THINGS_PER_ARENA(thingSize), JS_BITS_PER_WORD)
2399
+
2400
+ static void
2401
+ DelayTracingChildren(JSRuntime *rt, uint8 *flagp)
2402
+ {
2403
+ JSGCArenaInfo *a;
2404
+ uint32 untracedBitIndex;
2405
+ jsuword bit;
2406
+
2407
+ /*
2408
+ * Things with children to be traced later are marked with
2409
+ * GCF_MARK | GCF_FINAL flags.
2410
+ */
2411
+ JS_ASSERT((*flagp & (GCF_MARK | GCF_FINAL)) == GCF_MARK);
2412
+ *flagp |= GCF_FINAL;
2413
+
2414
+ METER(rt->gcStats.untraced++);
2415
+ #ifdef DEBUG
2416
+ ++rt->gcTraceLaterCount;
2417
+ METER_UPDATE_MAX(rt->gcStats.maxuntraced, rt->gcTraceLaterCount);
2418
+ #endif
2419
+
2420
+ a = FLAGP_TO_ARENA(flagp);
2421
+ untracedBitIndex = FLAGP_TO_INDEX(flagp) /
2422
+ THINGS_PER_UNTRACED_BIT(a->list->thingSize);
2423
+ JS_ASSERT(untracedBitIndex < JS_BITS_PER_WORD);
2424
+ bit = (jsuword)1 << untracedBitIndex;
2425
+ if (a->u.untracedThings != 0) {
2426
+ JS_ASSERT(rt->gcUntracedArenaStackTop);
2427
+ if (a->u.untracedThings & bit) {
2428
+ /* bit already covers things with children to trace later. */
2429
+ return;
2430
+ }
2431
+ a->u.untracedThings |= bit;
2432
+ } else {
2433
+ /*
2434
+ * The thing is the first thing with not yet traced children in the
2435
+ * whole arena, so push the arena on the stack of arenas with things
2436
+ * to be traced later unless the arena has already been pushed. We
2437
+ * detect that through checking prevUntracedPage as the field is 0
2438
+ * only for not yet pushed arenas. To ensure that
2439
+ * prevUntracedPage != 0
2440
+ * even when the stack contains one element, we make prevUntracedPage
2441
+ * for the arena at the bottom to point to itself.
2442
+ *
2443
+ * See comments in TraceDelayedChildren.
2444
+ */
2445
+ a->u.untracedThings = bit;
2446
+ if (a->prevUntracedPage == 0) {
2447
+ if (!rt->gcUntracedArenaStackTop) {
2448
+ /* Stack was empty, mark the arena as the bottom element. */
2449
+ a->prevUntracedPage = ARENA_INFO_TO_PAGE(a);
2450
+ } else {
2451
+ JS_ASSERT(rt->gcUntracedArenaStackTop->prevUntracedPage != 0);
2452
+ a->prevUntracedPage =
2453
+ ARENA_INFO_TO_PAGE(rt->gcUntracedArenaStackTop);
2454
+ }
2455
+ rt->gcUntracedArenaStackTop = a;
2456
+ }
2457
+ }
2458
+ JS_ASSERT(rt->gcUntracedArenaStackTop);
2459
+ }
2460
+
2461
+ static void
2462
+ TraceDelayedChildren(JSTracer *trc)
2463
+ {
2464
+ JSRuntime *rt;
2465
+ JSGCArenaInfo *a, *aprev;
2466
+ uint32 thingSize;
2467
+ uint32 thingsPerUntracedBit;
2468
+ uint32 untracedBitIndex, thingIndex, indexLimit, endIndex;
2469
+ JSGCThing *thing;
2470
+ uint8 *flagp;
2471
+
2472
+ rt = trc->context->runtime;
2473
+ a = rt->gcUntracedArenaStackTop;
2474
+ if (!a) {
2475
+ JS_ASSERT(rt->gcTraceLaterCount == 0);
2476
+ return;
2477
+ }
2478
+
2479
+ for (;;) {
2480
+ /*
2481
+ * The following assert verifies that the current arena belongs to the
2482
+ * untraced stack, since DelayTracingChildren ensures that even for
2483
+ * stack's bottom prevUntracedPage != 0 but rather points to itself.
2484
+ */
2485
+ JS_ASSERT(a->prevUntracedPage != 0);
2486
+ JS_ASSERT(rt->gcUntracedArenaStackTop->prevUntracedPage != 0);
2487
+ thingSize = a->list->thingSize;
2488
+ indexLimit = (a == a->list->last)
2489
+ ? a->list->lastCount
2490
+ : THINGS_PER_ARENA(thingSize);
2491
+ thingsPerUntracedBit = THINGS_PER_UNTRACED_BIT(thingSize);
2492
+
2493
+ /*
2494
+ * We cannot use do-while loop here as a->u.untracedThings can be zero
2495
+ * before the loop as a leftover from the previous iterations. See
2496
+ * comments after the loop.
2497
+ */
2498
+ while (a->u.untracedThings != 0) {
2499
+ untracedBitIndex = JS_FLOOR_LOG2W(a->u.untracedThings);
2500
+ a->u.untracedThings &= ~((jsuword)1 << untracedBitIndex);
2501
+ thingIndex = untracedBitIndex * thingsPerUntracedBit;
2502
+ endIndex = thingIndex + thingsPerUntracedBit;
2503
+
2504
+ /*
2505
+ * endIndex can go beyond the last allocated thing as the real
2506
+ * limit can be "inside" the bit.
2507
+ */
2508
+ if (endIndex > indexLimit)
2509
+ endIndex = indexLimit;
2510
+ JS_ASSERT(thingIndex < indexLimit);
2511
+
2512
+ do {
2513
+ /*
2514
+ * Skip free or already traced things that share the bit
2515
+ * with untraced ones.
2516
+ */
2517
+ flagp = THING_FLAGP(a, thingIndex);
2518
+ if ((*flagp & (GCF_MARK|GCF_FINAL)) != (GCF_MARK|GCF_FINAL))
2519
+ continue;
2520
+ *flagp &= ~GCF_FINAL;
2521
+ #ifdef DEBUG
2522
+ JS_ASSERT(rt->gcTraceLaterCount != 0);
2523
+ --rt->gcTraceLaterCount;
2524
+ #endif
2525
+ thing = FLAGP_TO_THING(flagp, thingSize);
2526
+ JS_TraceChildren(trc, thing, MapGCFlagsToTraceKind(*flagp));
2527
+ } while (++thingIndex != endIndex);
2528
+ }
2529
+
2530
+ /*
2531
+ * We finished tracing of all things in the the arena but we can only
2532
+ * pop it from the stack if the arena is the stack's top.
2533
+ *
2534
+ * When JS_TraceChildren from the above calls JS_CallTracer that in
2535
+ * turn on low C stack calls DelayTracingChildren and the latter
2536
+ * pushes new arenas to the untraced stack, we have to skip popping
2537
+ * of this arena until it becomes the top of the stack again.
2538
+ */
2539
+ if (a == rt->gcUntracedArenaStackTop) {
2540
+ aprev = ARENA_PAGE_TO_INFO(a->prevUntracedPage);
2541
+ a->prevUntracedPage = 0;
2542
+ if (a == aprev) {
2543
+ /*
2544
+ * prevUntracedPage points to itself and we reached the
2545
+ * bottom of the stack.
2546
+ */
2547
+ break;
2548
+ }
2549
+ rt->gcUntracedArenaStackTop = a = aprev;
2550
+ } else {
2551
+ a = rt->gcUntracedArenaStackTop;
2552
+ }
2553
+ }
2554
+ JS_ASSERT(rt->gcUntracedArenaStackTop);
2555
+ JS_ASSERT(rt->gcUntracedArenaStackTop->prevUntracedPage == 0);
2556
+ rt->gcUntracedArenaStackTop = NULL;
2557
+ JS_ASSERT(rt->gcTraceLaterCount == 0);
2558
+ }
2559
+
2560
+ JS_PUBLIC_API(void)
2561
+ JS_CallTracer(JSTracer *trc, void *thing, uint32 kind)
2562
+ {
2563
+ JSContext *cx;
2564
+ JSRuntime *rt;
2565
+ JSGCArenaInfo *a;
2566
+ uintN index;
2567
+ uint8 *flagp;
2568
+
2569
+ JS_ASSERT(thing);
2570
+ JS_ASSERT(JS_IS_VALID_TRACE_KIND(kind));
2571
+ JS_ASSERT(trc->debugPrinter || trc->debugPrintArg);
2572
+
2573
+ if (!IS_GC_MARKING_TRACER(trc)) {
2574
+ trc->callback(trc, thing, kind);
2575
+ goto out;
2576
+ }
2577
+
2578
+ cx = trc->context;
2579
+ rt = cx->runtime;
2580
+ JS_ASSERT(rt->gcMarkingTracer == trc);
2581
+ JS_ASSERT(rt->gcLevel > 0);
2582
+
2583
+ /*
2584
+ * Optimize for string and double as their size is known and their tracing
2585
+ * is not recursive.
2586
+ */
2587
+ switch (kind) {
2588
+ case JSTRACE_DOUBLE:
2589
+ a = THING_TO_ARENA(thing);
2590
+ JS_ASSERT(!a->list);
2591
+ if (!a->u.hasMarkedDoubles) {
2592
+ ClearDoubleArenaFlags(a);
2593
+ a->u.hasMarkedDoubles = JS_TRUE;
2594
+ }
2595
+ index = DOUBLE_THING_TO_INDEX(thing);
2596
+ JS_SET_BIT(DOUBLE_ARENA_BITMAP(a), index);
2597
+ goto out;
2598
+
2599
+ case JSTRACE_STRING:
2600
+ for (;;) {
2601
+ flagp = THING_TO_FLAGP(thing, sizeof(JSGCThing));
2602
+ JS_ASSERT((*flagp & GCF_FINAL) == 0);
2603
+ JS_ASSERT(kind == MapGCFlagsToTraceKind(*flagp));
2604
+ if (!JSSTRING_IS_DEPENDENT((JSString *) thing)) {
2605
+ *flagp |= GCF_MARK;
2606
+ goto out;
2607
+ }
2608
+ if (*flagp & GCF_MARK)
2609
+ goto out;
2610
+ *flagp |= GCF_MARK;
2611
+ thing = JSSTRDEP_BASE((JSString *) thing);
2612
+ }
2613
+ /* NOTREACHED */
2614
+ }
2615
+
2616
+ flagp = GetGCThingFlags(thing);
2617
+ JS_ASSERT(kind == MapGCFlagsToTraceKind(*flagp));
2618
+ if (*flagp & GCF_MARK)
2619
+ goto out;
2620
+
2621
+ /*
2622
+ * We check for non-final flag only if mark is unset as
2623
+ * DelayTracingChildren uses the flag. See comments in the function.
2624
+ */
2625
+ JS_ASSERT(*flagp != GCF_FINAL);
2626
+ *flagp |= GCF_MARK;
2627
+ if (!cx->insideGCMarkCallback) {
2628
+ /*
2629
+ * With JS_GC_ASSUME_LOW_C_STACK defined the mark phase of GC always
2630
+ * uses the non-recursive code that otherwise would be called only on
2631
+ * a low C stack condition.
2632
+ */
2633
+ #ifdef JS_GC_ASSUME_LOW_C_STACK
2634
+ # define RECURSION_TOO_DEEP() JS_TRUE
2635
+ #else
2636
+ int stackDummy;
2637
+ # define RECURSION_TOO_DEEP() (!JS_CHECK_STACK_SIZE(cx, stackDummy))
2638
+ #endif
2639
+ if (RECURSION_TOO_DEEP())
2640
+ DelayTracingChildren(rt, flagp);
2641
+ else
2642
+ JS_TraceChildren(trc, thing, kind);
2643
+ } else {
2644
+ /*
2645
+ * For API compatibility we allow for the callback to assume that
2646
+ * after it calls JS_MarkGCThing for the last time, the callback can
2647
+ * start to finalize its own objects that are only referenced by
2648
+ * unmarked GC things.
2649
+ *
2650
+ * Since we do not know which call from inside the callback is the
2651
+ * last, we ensure that children of all marked things are traced and
2652
+ * call TraceDelayedChildren(trc) after tracing the thing.
2653
+ *
2654
+ * As TraceDelayedChildren unconditionally invokes JS_TraceChildren
2655
+ * for the things with untraced children, calling DelayTracingChildren
2656
+ * is useless here. Hence we always trace thing's children even with a
2657
+ * low native stack.
2658
+ */
2659
+ cx->insideGCMarkCallback = JS_FALSE;
2660
+ JS_TraceChildren(trc, thing, kind);
2661
+ TraceDelayedChildren(trc);
2662
+ cx->insideGCMarkCallback = JS_TRUE;
2663
+ }
2664
+
2665
+ out:
2666
+ #ifdef DEBUG
2667
+ trc->debugPrinter = NULL;
2668
+ trc->debugPrintArg = NULL;
2669
+ #endif
2670
+ return; /* to avoid out: right_curl when DEBUG is not defined */
2671
+ }
2672
+
2673
+ void
2674
+ js_CallValueTracerIfGCThing(JSTracer *trc, jsval v)
2675
+ {
2676
+ void *thing;
2677
+ uint32 kind;
2678
+
2679
+ if (JSVAL_IS_DOUBLE(v) || JSVAL_IS_STRING(v)) {
2680
+ thing = JSVAL_TO_TRACEABLE(v);
2681
+ kind = JSVAL_TRACE_KIND(v);
2682
+ JS_ASSERT(kind == js_GetGCThingTraceKind(JSVAL_TO_GCTHING(v)));
2683
+ } else if (JSVAL_IS_OBJECT(v) && v != JSVAL_NULL) {
2684
+ /* v can be an arbitrary GC thing reinterpreted as an object. */
2685
+ thing = JSVAL_TO_OBJECT(v);
2686
+ kind = js_GetGCThingTraceKind(thing);
2687
+ } else {
2688
+ return;
2689
+ }
2690
+ JS_CallTracer(trc, thing, kind);
2691
+ }
2692
+
2693
+ static JSDHashOperator
2694
+ gc_root_traversal(JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 num,
2695
+ void *arg)
2696
+ {
2697
+ JSGCRootHashEntry *rhe = (JSGCRootHashEntry *)hdr;
2698
+ JSTracer *trc = (JSTracer *)arg;
2699
+ jsval *rp = (jsval *)rhe->root;
2700
+ jsval v = *rp;
2701
+
2702
+ /* Ignore null object and scalar values. */
2703
+ if (!JSVAL_IS_NULL(v) && JSVAL_IS_GCTHING(v)) {
2704
+ #ifdef DEBUG
2705
+ JSBool root_points_to_gcArenaList = JS_FALSE;
2706
+ jsuword thing = (jsuword) JSVAL_TO_GCTHING(v);
2707
+ JSRuntime *rt;
2708
+ uintN i;
2709
+ JSGCArenaList *arenaList;
2710
+ uint32 thingSize;
2711
+ JSGCArenaInfo *a;
2712
+ size_t limit;
2713
+
2714
+ rt = trc->context->runtime;
2715
+ for (i = 0; i < GC_NUM_FREELISTS; i++) {
2716
+ arenaList = &rt->gcArenaList[i];
2717
+ thingSize = arenaList->thingSize;
2718
+ limit = (size_t) arenaList->lastCount * thingSize;
2719
+ for (a = arenaList->last; a; a = a->prev) {
2720
+ if (thing - ARENA_INFO_TO_START(a) < limit) {
2721
+ root_points_to_gcArenaList = JS_TRUE;
2722
+ break;
2723
+ }
2724
+ limit = (size_t) THINGS_PER_ARENA(thingSize) * thingSize;
2725
+ }
2726
+ }
2727
+ if (!root_points_to_gcArenaList) {
2728
+ for (a = rt->gcDoubleArenaList.first; a; a = a->prev) {
2729
+ if (thing - ARENA_INFO_TO_START(a) <
2730
+ DOUBLES_PER_ARENA * sizeof(jsdouble)) {
2731
+ root_points_to_gcArenaList = JS_TRUE;
2732
+ break;
2733
+ }
2734
+ }
2735
+ }
2736
+ if (!root_points_to_gcArenaList && rhe->name) {
2737
+ fprintf(stderr,
2738
+ "JS API usage error: the address passed to JS_AddNamedRoot currently holds an\n"
2739
+ "invalid jsval. This is usually caused by a missing call to JS_RemoveRoot.\n"
2740
+ "The root's name is \"%s\".\n",
2741
+ rhe->name);
2742
+ }
2743
+ JS_ASSERT(root_points_to_gcArenaList);
2744
+ #endif
2745
+ JS_SET_TRACING_NAME(trc, rhe->name ? rhe->name : "root");
2746
+ js_CallValueTracerIfGCThing(trc, v);
2747
+ }
2748
+
2749
+ return JS_DHASH_NEXT;
2750
+ }
2751
+
2752
+ static JSDHashOperator
2753
+ gc_lock_traversal(JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 num,
2754
+ void *arg)
2755
+ {
2756
+ JSGCLockHashEntry *lhe = (JSGCLockHashEntry *)hdr;
2757
+ void *thing = (void *)lhe->thing;
2758
+ JSTracer *trc = (JSTracer *)arg;
2759
+ uint32 traceKind;
2760
+
2761
+ JS_ASSERT(lhe->count >= 1);
2762
+ traceKind = js_GetGCThingTraceKind(thing);
2763
+ JS_CALL_TRACER(trc, thing, traceKind, "locked object");
2764
+ return JS_DHASH_NEXT;
2765
+ }
2766
+
2767
+ #define TRACE_JSVALS(trc, len, vec, name) \
2768
+ JS_BEGIN_MACRO \
2769
+ jsval _v, *_vp, *_end; \
2770
+ \
2771
+ for (_vp = vec, _end = _vp + len; _vp < _end; _vp++) { \
2772
+ _v = *_vp; \
2773
+ if (JSVAL_IS_TRACEABLE(_v)) { \
2774
+ JS_SET_TRACING_INDEX(trc, name, _vp - (vec)); \
2775
+ JS_CallTracer(trc, JSVAL_TO_TRACEABLE(_v), \
2776
+ JSVAL_TRACE_KIND(_v)); \
2777
+ } \
2778
+ } \
2779
+ JS_END_MACRO
2780
+
2781
+ void
2782
+ js_TraceStackFrame(JSTracer *trc, JSStackFrame *fp)
2783
+ {
2784
+ uintN nslots, minargs, skip;
2785
+
2786
+ if (fp->callobj)
2787
+ JS_CALL_OBJECT_TRACER(trc, fp->callobj, "call");
2788
+ if (fp->argsobj)
2789
+ JS_CALL_OBJECT_TRACER(trc, fp->argsobj, "arguments");
2790
+ if (fp->varobj)
2791
+ JS_CALL_OBJECT_TRACER(trc, fp->varobj, "variables");
2792
+ if (fp->script) {
2793
+ js_TraceScript(trc, fp->script);
2794
+ if (fp->regs) {
2795
+ /*
2796
+ * Don't mark what has not been pushed yet, or what has been
2797
+ * popped already.
2798
+ */
2799
+ nslots = (uintN) (fp->regs->sp - fp->slots);
2800
+ TRACE_JSVALS(trc, nslots, fp->slots, "slot");
2801
+ }
2802
+ } else {
2803
+ JS_ASSERT(!fp->slots);
2804
+ JS_ASSERT(!fp->regs);
2805
+ }
2806
+
2807
+ /* Allow for primitive this parameter due to JSFUN_THISP_* flags. */
2808
+ JS_ASSERT(JSVAL_IS_OBJECT((jsval)fp->thisp) ||
2809
+ (fp->fun && JSFUN_THISP_FLAGS(fp->fun->flags)));
2810
+ JS_CALL_VALUE_TRACER(trc, (jsval)fp->thisp, "this");
2811
+
2812
+ if (fp->callee)
2813
+ JS_CALL_OBJECT_TRACER(trc, fp->callee, "callee");
2814
+
2815
+ if (fp->argv) {
2816
+ nslots = fp->argc;
2817
+ skip = 0;
2818
+ if (fp->fun) {
2819
+ minargs = FUN_MINARGS(fp->fun);
2820
+ if (minargs > nslots)
2821
+ nslots = minargs;
2822
+ if (!FUN_INTERPRETED(fp->fun)) {
2823
+ JS_ASSERT(!(fp->fun->flags & JSFUN_FAST_NATIVE));
2824
+ nslots += fp->fun->u.n.extra;
2825
+ }
2826
+ if (fp->fun->flags & JSFRAME_ROOTED_ARGV)
2827
+ skip = 2 + fp->argc;
2828
+ }
2829
+ TRACE_JSVALS(trc, 2 + nslots - skip, fp->argv - 2 + skip, "operand");
2830
+ }
2831
+
2832
+ JS_CALL_VALUE_TRACER(trc, fp->rval, "rval");
2833
+ if (fp->scopeChain)
2834
+ JS_CALL_OBJECT_TRACER(trc, fp->scopeChain, "scope chain");
2835
+ if (fp->sharpArray)
2836
+ JS_CALL_OBJECT_TRACER(trc, fp->sharpArray, "sharp array");
2837
+
2838
+ if (fp->xmlNamespace)
2839
+ JS_CALL_OBJECT_TRACER(trc, fp->xmlNamespace, "xmlNamespace");
2840
+ }
2841
+
2842
+ static void
2843
+ TraceWeakRoots(JSTracer *trc, JSWeakRoots *wr)
2844
+ {
2845
+ uint32 i;
2846
+ void *thing;
2847
+
2848
+ #ifdef DEBUG
2849
+ static const char *weakRootNames[JSTRACE_LIMIT] = {
2850
+ "newborn object",
2851
+ "newborn double",
2852
+ "newborn string",
2853
+ "newborn xml"
2854
+ };
2855
+ #endif
2856
+
2857
+ for (i = 0; i != JSTRACE_LIMIT; i++) {
2858
+ thing = wr->newborn[i];
2859
+ if (thing)
2860
+ JS_CALL_TRACER(trc, thing, i, weakRootNames[i]);
2861
+ }
2862
+ JS_ASSERT(i == GCX_EXTERNAL_STRING);
2863
+ for (; i != GCX_NTYPES; ++i) {
2864
+ thing = wr->newborn[i];
2865
+ if (thing) {
2866
+ JS_SET_TRACING_INDEX(trc, "newborn external string",
2867
+ i - GCX_EXTERNAL_STRING);
2868
+ JS_CallTracer(trc, thing, JSTRACE_STRING);
2869
+ }
2870
+ }
2871
+
2872
+ JS_CALL_VALUE_TRACER(trc, wr->lastAtom, "lastAtom");
2873
+ JS_SET_TRACING_NAME(trc, "lastInternalResult");
2874
+ js_CallValueTracerIfGCThing(trc, wr->lastInternalResult);
2875
+ }
2876
+
2877
+ JS_FRIEND_API(void)
2878
+ js_TraceContext(JSTracer *trc, JSContext *acx)
2879
+ {
2880
+ JSStackFrame *fp, *nextChain;
2881
+ JSStackHeader *sh;
2882
+ JSTempValueRooter *tvr;
2883
+
2884
+ if (IS_GC_MARKING_TRACER(trc)) {
2885
+
2886
+ #define FREE_OLD_ARENAS(pool) \
2887
+ JS_BEGIN_MACRO \
2888
+ int64 _age; \
2889
+ JSArena * _a = (pool).current; \
2890
+ if (_a == (pool).first.next && \
2891
+ _a->avail == _a->base + sizeof(int64)) { \
2892
+ _age = JS_Now() - *(int64 *) _a->base; \
2893
+ if (_age > (int64) acx->runtime->gcEmptyArenaPoolLifespan * \
2894
+ 1000) \
2895
+ JS_FreeArenaPool(&(pool)); \
2896
+ } \
2897
+ JS_END_MACRO
2898
+
2899
+ #ifdef JS_THREADSAFE
2900
+ js_RevokeGCLocalFreeLists(acx);
2901
+ #endif
2902
+
2903
+ /*
2904
+ * Release the stackPool's arenas if the stackPool has existed for
2905
+ * longer than the limit specified by gcEmptyArenaPoolLifespan.
2906
+ */
2907
+ FREE_OLD_ARENAS(acx->stackPool);
2908
+
2909
+ /*
2910
+ * Release the regexpPool's arenas based on the same criterion as for
2911
+ * the stackPool.
2912
+ */
2913
+ FREE_OLD_ARENAS(acx->regexpPool);
2914
+
2915
+ /*
2916
+ * Clear the double free list to release all the pre-allocated doubles.
2917
+ */
2918
+ acx->doubleFreeList = NULL;
2919
+ }
2920
+
2921
+ /*
2922
+ * Iterate frame chain and dormant chains.
2923
+ *
2924
+ * (NB: see comment on this whole "dormant" thing in js_Execute.)
2925
+ */
2926
+ fp = acx->fp;
2927
+ nextChain = acx->dormantFrameChain;
2928
+ if (!fp)
2929
+ goto next_chain;
2930
+
2931
+ /* The top frame must not be dormant. */
2932
+ JS_ASSERT(!fp->dormantNext);
2933
+ for (;;) {
2934
+ do {
2935
+ js_TraceStackFrame(trc, fp);
2936
+ } while ((fp = fp->down) != NULL);
2937
+
2938
+ next_chain:
2939
+ if (!nextChain)
2940
+ break;
2941
+ fp = nextChain;
2942
+ nextChain = nextChain->dormantNext;
2943
+ }
2944
+
2945
+ /* Mark other roots-by-definition in acx. */
2946
+ if (acx->globalObject)
2947
+ JS_CALL_OBJECT_TRACER(trc, acx->globalObject, "global object");
2948
+ TraceWeakRoots(trc, &acx->weakRoots);
2949
+ if (acx->throwing) {
2950
+ JS_CALL_VALUE_TRACER(trc, acx->exception, "exception");
2951
+ } else {
2952
+ /* Avoid keeping GC-ed junk stored in JSContext.exception. */
2953
+ acx->exception = JSVAL_NULL;
2954
+ }
2955
+ #if JS_HAS_LVALUE_RETURN
2956
+ if (acx->rval2set)
2957
+ JS_CALL_VALUE_TRACER(trc, acx->rval2, "rval2");
2958
+ #endif
2959
+
2960
+ for (sh = acx->stackHeaders; sh; sh = sh->down) {
2961
+ METER(trc->context->runtime->gcStats.stackseg++);
2962
+ METER(trc->context->runtime->gcStats.segslots += sh->nslots);
2963
+ TRACE_JSVALS(trc, sh->nslots, JS_STACK_SEGMENT(sh), "stack");
2964
+ }
2965
+
2966
+ if (acx->localRootStack)
2967
+ js_TraceLocalRoots(trc, acx->localRootStack);
2968
+
2969
+ for (tvr = acx->tempValueRooters; tvr; tvr = tvr->down) {
2970
+ switch (tvr->count) {
2971
+ case JSTVU_SINGLE:
2972
+ JS_SET_TRACING_NAME(trc, "tvr->u.value");
2973
+ js_CallValueTracerIfGCThing(trc, tvr->u.value);
2974
+ break;
2975
+ case JSTVU_TRACE:
2976
+ tvr->u.trace(trc, tvr);
2977
+ break;
2978
+ case JSTVU_SPROP:
2979
+ TRACE_SCOPE_PROPERTY(trc, tvr->u.sprop);
2980
+ break;
2981
+ case JSTVU_WEAK_ROOTS:
2982
+ TraceWeakRoots(trc, tvr->u.weakRoots);
2983
+ break;
2984
+ case JSTVU_PARSE_CONTEXT:
2985
+ js_TraceParseContext(trc, tvr->u.parseContext);
2986
+ break;
2987
+ case JSTVU_SCRIPT:
2988
+ js_TraceScript(trc, tvr->u.script);
2989
+ break;
2990
+ default:
2991
+ JS_ASSERT(tvr->count >= 0);
2992
+ TRACE_JSVALS(trc, tvr->count, tvr->u.array, "tvr->u.array");
2993
+ }
2994
+ }
2995
+
2996
+ if (acx->sharpObjectMap.depth > 0)
2997
+ js_TraceSharpMap(trc, &acx->sharpObjectMap);
2998
+ }
2999
+
3000
+ void
3001
+ js_TraceTraceMonitor(JSTracer *trc, JSTraceMonitor *tm)
3002
+ {
3003
+ if (IS_GC_MARKING_TRACER(trc)) {
3004
+ tm->recoveryDoublePoolPtr = tm->recoveryDoublePool;
3005
+ /* Make sure the global shape changes and will force a flush
3006
+ of the code cache. */
3007
+ tm->globalShape = -1;
3008
+ }
3009
+ }
3010
+
3011
+ void
3012
+ js_TraceRuntime(JSTracer *trc, JSBool allAtoms)
3013
+ {
3014
+ JSRuntime *rt = trc->context->runtime;
3015
+ JSContext *iter, *acx;
3016
+
3017
+ JS_DHashTableEnumerate(&rt->gcRootsHash, gc_root_traversal, trc);
3018
+ if (rt->gcLocksHash)
3019
+ JS_DHashTableEnumerate(rt->gcLocksHash, gc_lock_traversal, trc);
3020
+ js_TraceAtomState(trc, allAtoms);
3021
+ js_TraceNativeEnumerators(trc);
3022
+ js_TraceRuntimeNumberState(trc);
3023
+
3024
+ iter = NULL;
3025
+ while ((acx = js_ContextIterator(rt, JS_TRUE, &iter)) != NULL)
3026
+ js_TraceContext(trc, acx);
3027
+
3028
+ if (rt->gcExtraRootsTraceOp)
3029
+ rt->gcExtraRootsTraceOp(trc, rt->gcExtraRootsData);
3030
+
3031
+ #ifdef JS_THREADSAFE
3032
+ /* Trace the loop table(s) which can contain pointers to code objects. */
3033
+ while ((acx = js_ContextIterator(rt, JS_FALSE, &iter)) != NULL) {
3034
+ if (!acx->thread)
3035
+ continue;
3036
+ js_TraceTraceMonitor(trc, &acx->thread->traceMonitor);
3037
+ }
3038
+ #else
3039
+ js_TraceTraceMonitor(trc, &rt->traceMonitor);
3040
+ #endif
3041
+ }
3042
+
3043
+ static void
3044
+ ProcessSetSlotRequest(JSContext *cx, JSSetSlotRequest *ssr)
3045
+ {
3046
+ JSObject *obj, *pobj;
3047
+ uint32 slot;
3048
+
3049
+ obj = ssr->obj;
3050
+ pobj = ssr->pobj;
3051
+ slot = ssr->slot;
3052
+
3053
+ while (pobj) {
3054
+ pobj = js_GetWrappedObject(cx, pobj);
3055
+ if (pobj == obj) {
3056
+ ssr->errnum = JSMSG_CYCLIC_VALUE;
3057
+ return;
3058
+ }
3059
+ pobj = JSVAL_TO_OBJECT(STOBJ_GET_SLOT(pobj, slot));
3060
+ }
3061
+
3062
+ pobj = ssr->pobj;
3063
+
3064
+ if (slot == JSSLOT_PROTO && OBJ_IS_NATIVE(obj)) {
3065
+ JSScope *scope, *newscope;
3066
+ JSObject *oldproto;
3067
+
3068
+ /* Check to see whether obj shares its prototype's scope. */
3069
+ scope = OBJ_SCOPE(obj);
3070
+ oldproto = STOBJ_GET_PROTO(obj);
3071
+ if (oldproto && OBJ_SCOPE(oldproto) == scope) {
3072
+ /* Either obj needs a new empty scope, or it should share pobj's. */
3073
+ if (!pobj ||
3074
+ !OBJ_IS_NATIVE(pobj) ||
3075
+ OBJ_GET_CLASS(cx, pobj) != STOBJ_GET_CLASS(oldproto)) {
3076
+ /*
3077
+ * With no proto and no scope of its own, obj is truly empty.
3078
+ *
3079
+ * If pobj is not native, obj needs its own empty scope -- it
3080
+ * should not continue to share oldproto's scope once oldproto
3081
+ * is not on obj's prototype chain. That would put properties
3082
+ * from oldproto's scope ahead of properties defined by pobj,
3083
+ * in lookup order.
3084
+ *
3085
+ * If pobj's class differs from oldproto's, we may need a new
3086
+ * scope to handle differences in private and reserved slots,
3087
+ * so we suboptimally but safely make one.
3088
+ */
3089
+ if (!js_GetMutableScope(cx, obj)) {
3090
+ ssr->errnum = JSMSG_OUT_OF_MEMORY;
3091
+ return;
3092
+ }
3093
+ } else if (OBJ_SCOPE(pobj) != scope) {
3094
+ newscope = (JSScope *) js_HoldObjectMap(cx, pobj->map);
3095
+ obj->map = &newscope->map;
3096
+ js_DropObjectMap(cx, &scope->map, obj);
3097
+ JS_TRANSFER_SCOPE_LOCK(cx, scope, newscope);
3098
+ }
3099
+ }
3100
+
3101
+ /*
3102
+ * Regenerate property cache shape ids for all of the scopes along the
3103
+ * old prototype chain, in case any property cache entries were filled
3104
+ * by looking up starting from obj.
3105
+ */
3106
+ while (oldproto && OBJ_IS_NATIVE(oldproto)) {
3107
+ scope = OBJ_SCOPE(oldproto);
3108
+ SCOPE_MAKE_UNIQUE_SHAPE(cx, scope);
3109
+ oldproto = STOBJ_GET_PROTO(scope->object);
3110
+ }
3111
+ }
3112
+
3113
+ /* Finally, do the deed. */
3114
+ STOBJ_SET_SLOT(obj, slot, OBJECT_TO_JSVAL(pobj));
3115
+ }
3116
+
3117
+ static void
3118
+ DestroyScriptsToGC(JSContext *cx, JSScript **listp)
3119
+ {
3120
+ JSScript *script;
3121
+
3122
+ while ((script = *listp) != NULL) {
3123
+ *listp = script->u.nextToGC;
3124
+ script->u.nextToGC = NULL;
3125
+ js_DestroyScript(cx, script);
3126
+ }
3127
+ }
3128
+
3129
+ /*
3130
+ * The gckind flag bit GC_LOCK_HELD indicates a call from js_NewGCThing with
3131
+ * rt->gcLock already held, so the lock should be kept on return.
3132
+ */
3133
+ void
3134
+ js_GC(JSContext *cx, JSGCInvocationKind gckind)
3135
+ {
3136
+ JSRuntime *rt;
3137
+ JSBool keepAtoms;
3138
+ JSGCCallback callback;
3139
+ uintN i, type;
3140
+ JSTracer trc;
3141
+ uint32 thingSize, indexLimit;
3142
+ JSGCArenaInfo *a, **ap, *emptyArenas;
3143
+ uint8 flags, *flagp;
3144
+ JSGCThing *thing, *freeList;
3145
+ JSGCArenaList *arenaList;
3146
+ JSBool allClear;
3147
+ #ifdef JS_THREADSAFE
3148
+ uint32 requestDebit;
3149
+ JSContext *acx, *iter;
3150
+ #endif
3151
+ #ifdef JS_GCMETER
3152
+ uint32 nlivearenas, nkilledarenas, nthings;
3153
+ #endif
3154
+
3155
+ JS_ASSERT_IF(gckind == GC_LAST_DITCH, !JS_ON_TRACE(cx));
3156
+ rt = cx->runtime;
3157
+ #ifdef JS_THREADSAFE
3158
+ /* Avoid deadlock. */
3159
+ JS_ASSERT(!JS_IS_RUNTIME_LOCKED(rt));
3160
+ #endif
3161
+
3162
+ if (gckind & GC_KEEP_ATOMS) {
3163
+ /*
3164
+ * The set slot request and last ditch GC kinds preserve all atoms and
3165
+ * weak roots.
3166
+ */
3167
+ keepAtoms = JS_TRUE;
3168
+ } else {
3169
+ /* Keep atoms when a suspended compile is running on another context. */
3170
+ keepAtoms = (rt->gcKeepAtoms != 0);
3171
+ JS_CLEAR_WEAK_ROOTS(&cx->weakRoots);
3172
+ }
3173
+
3174
+ /*
3175
+ * Don't collect garbage if the runtime isn't up, and cx is not the last
3176
+ * context in the runtime. The last context must force a GC, and nothing
3177
+ * should suppress that final collection or there may be shutdown leaks,
3178
+ * or runtime bloat until the next context is created.
3179
+ */
3180
+ if (rt->state != JSRTS_UP && gckind != GC_LAST_CONTEXT)
3181
+ return;
3182
+
3183
+ restart_at_beginning:
3184
+ /*
3185
+ * Let the API user decide to defer a GC if it wants to (unless this
3186
+ * is the last context). Invoke the callback regardless. Sample the
3187
+ * callback in case we are freely racing with a JS_SetGCCallback{,RT} on
3188
+ * another thread.
3189
+ */
3190
+ if (gckind != GC_SET_SLOT_REQUEST && (callback = rt->gcCallback)) {
3191
+ JSBool ok;
3192
+
3193
+ if (gckind & GC_LOCK_HELD)
3194
+ JS_UNLOCK_GC(rt);
3195
+ ok = callback(cx, JSGC_BEGIN);
3196
+ if (gckind & GC_LOCK_HELD)
3197
+ JS_LOCK_GC(rt);
3198
+ if (!ok && gckind != GC_LAST_CONTEXT) {
3199
+ /*
3200
+ * It's possible that we've looped back to this code from the 'goto
3201
+ * restart_at_beginning' below in the GC_SET_SLOT_REQUEST code and
3202
+ * that rt->gcLevel is now 0. Don't return without notifying!
3203
+ */
3204
+ if (rt->gcLevel == 0 && (gckind & GC_LOCK_HELD))
3205
+ JS_NOTIFY_GC_DONE(rt);
3206
+ return;
3207
+ }
3208
+ }
3209
+
3210
+ /* Lock out other GC allocator and collector invocations. */
3211
+ if (!(gckind & GC_LOCK_HELD))
3212
+ JS_LOCK_GC(rt);
3213
+
3214
+ METER(rt->gcStats.poke++);
3215
+ rt->gcPoke = JS_FALSE;
3216
+
3217
+ #ifdef JS_THREADSAFE
3218
+ JS_ASSERT(cx->thread->id == js_CurrentThreadId());
3219
+
3220
+ /* Bump gcLevel and return rather than nest on this thread. */
3221
+ if (rt->gcThread == cx->thread) {
3222
+ JS_ASSERT(rt->gcLevel > 0);
3223
+ rt->gcLevel++;
3224
+ METER_UPDATE_MAX(rt->gcStats.maxlevel, rt->gcLevel);
3225
+ if (!(gckind & GC_LOCK_HELD))
3226
+ JS_UNLOCK_GC(rt);
3227
+ return;
3228
+ }
3229
+
3230
+ /*
3231
+ * If we're in one or more requests (possibly on more than one context)
3232
+ * running on the current thread, indicate, temporarily, that all these
3233
+ * requests are inactive. If cx->thread is NULL, then cx is not using
3234
+ * the request model, and does not contribute to rt->requestCount.
3235
+ */
3236
+ requestDebit = 0;
3237
+ if (cx->thread) {
3238
+ JSCList *head, *link;
3239
+
3240
+ /*
3241
+ * Check all contexts on cx->thread->contextList for active requests,
3242
+ * counting each such context against requestDebit.
3243
+ */
3244
+ head = &cx->thread->contextList;
3245
+ for (link = head->next; link != head; link = link->next) {
3246
+ acx = CX_FROM_THREAD_LINKS(link);
3247
+ JS_ASSERT(acx->thread == cx->thread);
3248
+ if (acx->requestDepth)
3249
+ requestDebit++;
3250
+ }
3251
+ } else {
3252
+ /*
3253
+ * We assert, but check anyway, in case someone is misusing the API.
3254
+ * Avoiding the loop over all of rt's contexts is a win in the event
3255
+ * that the GC runs only on request-less contexts with null threads,
3256
+ * in a special thread such as might be used by the UI/DOM/Layout
3257
+ * "mozilla" or "main" thread in Mozilla-the-browser.
3258
+ */
3259
+ JS_ASSERT(cx->requestDepth == 0);
3260
+ if (cx->requestDepth)
3261
+ requestDebit = 1;
3262
+ }
3263
+ if (requestDebit) {
3264
+ JS_ASSERT(requestDebit <= rt->requestCount);
3265
+ rt->requestCount -= requestDebit;
3266
+ if (rt->requestCount == 0)
3267
+ JS_NOTIFY_REQUEST_DONE(rt);
3268
+ }
3269
+
3270
+ /* If another thread is already in GC, don't attempt GC; wait instead. */
3271
+ if (rt->gcLevel > 0) {
3272
+ /* Bump gcLevel to restart the current GC, so it finds new garbage. */
3273
+ rt->gcLevel++;
3274
+ METER_UPDATE_MAX(rt->gcStats.maxlevel, rt->gcLevel);
3275
+
3276
+ /* Wait for the other thread to finish, then resume our request. */
3277
+ while (rt->gcLevel > 0)
3278
+ JS_AWAIT_GC_DONE(rt);
3279
+ if (requestDebit)
3280
+ rt->requestCount += requestDebit;
3281
+ if (!(gckind & GC_LOCK_HELD))
3282
+ JS_UNLOCK_GC(rt);
3283
+ return;
3284
+ }
3285
+
3286
+ /* No other thread is in GC, so indicate that we're now in GC. */
3287
+ rt->gcLevel = 1;
3288
+ rt->gcThread = cx->thread;
3289
+
3290
+ /* Wait for all other requests to finish. */
3291
+ while (rt->requestCount > 0)
3292
+ JS_AWAIT_REQUEST_DONE(rt);
3293
+
3294
+ #else /* !JS_THREADSAFE */
3295
+
3296
+ /* Bump gcLevel and return rather than nest; the outer gc will restart. */
3297
+ rt->gcLevel++;
3298
+ METER_UPDATE_MAX(rt->gcStats.maxlevel, rt->gcLevel);
3299
+ if (rt->gcLevel > 1)
3300
+ return;
3301
+
3302
+ #endif /* !JS_THREADSAFE */
3303
+
3304
+ /*
3305
+ * Set rt->gcRunning here within the GC lock, and after waiting for any
3306
+ * active requests to end, so that new requests that try to JS_AddRoot,
3307
+ * JS_RemoveRoot, or JS_RemoveRootRT block in JS_BeginRequest waiting for
3308
+ * rt->gcLevel to drop to zero, while request-less calls to the *Root*
3309
+ * APIs block in js_AddRoot or js_RemoveRoot (see above in this file),
3310
+ * waiting for GC to finish.
3311
+ */
3312
+ rt->gcRunning = JS_TRUE;
3313
+
3314
+ if (gckind == GC_SET_SLOT_REQUEST) {
3315
+ JSSetSlotRequest *ssr;
3316
+
3317
+ while ((ssr = rt->setSlotRequests) != NULL) {
3318
+ rt->setSlotRequests = ssr->next;
3319
+ JS_UNLOCK_GC(rt);
3320
+ ssr->next = NULL;
3321
+ ProcessSetSlotRequest(cx, ssr);
3322
+ JS_LOCK_GC(rt);
3323
+ }
3324
+
3325
+ /*
3326
+ * We assume here that killing links to parent and prototype objects
3327
+ * does not create garbage (such objects typically are long-lived and
3328
+ * widely shared, e.g. global objects, Function.prototype, etc.). We
3329
+ * collect garbage only if a racing thread attempted GC and is waiting
3330
+ * for us to finish (gcLevel > 1) or if someone already poked us.
3331
+ */
3332
+ if (rt->gcLevel == 1 && !rt->gcPoke)
3333
+ goto done_running;
3334
+
3335
+ rt->gcLevel = 0;
3336
+ rt->gcPoke = JS_FALSE;
3337
+ rt->gcRunning = JS_FALSE;
3338
+ #ifdef JS_THREADSAFE
3339
+ rt->gcThread = NULL;
3340
+ rt->requestCount += requestDebit;
3341
+ #endif
3342
+ gckind = GC_LOCK_HELD;
3343
+ goto restart_at_beginning;
3344
+ }
3345
+
3346
+ JS_UNLOCK_GC(rt);
3347
+
3348
+ #ifdef JS_TRACER
3349
+ if (JS_ON_TRACE(cx))
3350
+ goto out;
3351
+ #endif
3352
+
3353
+ /* Reset malloc counter. */
3354
+ rt->gcMallocBytes = 0;
3355
+
3356
+ #ifdef JS_DUMP_SCOPE_METERS
3357
+ { extern void js_DumpScopeMeters(JSRuntime *rt);
3358
+ js_DumpScopeMeters(rt);
3359
+ }
3360
+ #endif
3361
+
3362
+ /* Clear property and JIT oracle caches (only for cx->thread if JS_THREADSAFE). */
3363
+ js_FlushPropertyCache(cx);
3364
+ #ifdef JS_TRACER
3365
+ js_FlushJITOracle(cx);
3366
+ #endif
3367
+
3368
+ /* Destroy eval'ed scripts. */
3369
+ DestroyScriptsToGC(cx, &JS_SCRIPTS_TO_GC(cx));
3370
+
3371
+ #ifdef JS_THREADSAFE
3372
+ /*
3373
+ * Clear thread-based caches. To avoid redundant clearing we unroll the
3374
+ * current thread's step.
3375
+ *
3376
+ * In case a JSScript wrapped within an object was finalized, we null
3377
+ * acx->thread->gsnCache.script and finish the cache's hashtable. Note
3378
+ * that js_DestroyScript, called from script_finalize, will have already
3379
+ * cleared cx->thread->gsnCache above during finalization, so we don't
3380
+ * have to here.
3381
+ */
3382
+ iter = NULL;
3383
+ while ((acx = js_ContextIterator(rt, JS_FALSE, &iter)) != NULL) {
3384
+ if (!acx->thread || acx->thread == cx->thread)
3385
+ continue;
3386
+ GSN_CACHE_CLEAR(&acx->thread->gsnCache);
3387
+ js_FlushPropertyCache(acx);
3388
+ #ifdef JS_TRACER
3389
+ js_FlushJITOracle(acx);
3390
+ #endif
3391
+ DestroyScriptsToGC(cx, &acx->thread->scriptsToGC);
3392
+ }
3393
+ #else
3394
+ /* The thread-unsafe case just has to clear the runtime's GSN cache. */
3395
+ GSN_CACHE_CLEAR(&rt->gsnCache);
3396
+ #endif
3397
+
3398
+ restart:
3399
+ rt->gcNumber++;
3400
+ JS_ASSERT(!rt->gcUntracedArenaStackTop);
3401
+ JS_ASSERT(rt->gcTraceLaterCount == 0);
3402
+
3403
+ /* Reset the property cache's type id generator so we can compress ids. */
3404
+ rt->shapeGen = 0;
3405
+
3406
+ /*
3407
+ * Mark phase.
3408
+ */
3409
+ JS_TRACER_INIT(&trc, cx, NULL);
3410
+ rt->gcMarkingTracer = &trc;
3411
+ JS_ASSERT(IS_GC_MARKING_TRACER(&trc));
3412
+
3413
+ for (a = rt->gcDoubleArenaList.first; a; a = a->prev)
3414
+ a->u.hasMarkedDoubles = JS_FALSE;
3415
+
3416
+ js_TraceRuntime(&trc, keepAtoms);
3417
+ js_MarkScriptFilenames(rt, keepAtoms);
3418
+
3419
+ /*
3420
+ * Mark children of things that caused too deep recursion during the above
3421
+ * tracing.
3422
+ */
3423
+ TraceDelayedChildren(&trc);
3424
+
3425
+ JS_ASSERT(!cx->insideGCMarkCallback);
3426
+ if (rt->gcCallback) {
3427
+ cx->insideGCMarkCallback = JS_TRUE;
3428
+ (void) rt->gcCallback(cx, JSGC_MARK_END);
3429
+ JS_ASSERT(cx->insideGCMarkCallback);
3430
+ cx->insideGCMarkCallback = JS_FALSE;
3431
+ }
3432
+ JS_ASSERT(rt->gcTraceLaterCount == 0);
3433
+
3434
+ rt->gcMarkingTracer = NULL;
3435
+
3436
+ /*
3437
+ * Sweep phase.
3438
+ *
3439
+ * Finalize as we sweep, outside of rt->gcLock but with rt->gcRunning set
3440
+ * so that any attempt to allocate a GC-thing from a finalizer will fail,
3441
+ * rather than nest badly and leave the unmarked newborn to be swept.
3442
+ *
3443
+ * We first sweep atom state so we can use js_IsAboutToBeFinalized on
3444
+ * JSString or jsdouble held in a hashtable to check if the hashtable
3445
+ * entry can be freed. Note that even after the entry is freed, JSObject
3446
+ * finalizers can continue to access the corresponding jsdouble* and
3447
+ * JSString* assuming that they are unique. This works since the
3448
+ * atomization API must not be called during GC.
3449
+ */
3450
+ js_SweepAtomState(cx);
3451
+
3452
+ /* Finalize iterator states before the objects they iterate over. */
3453
+ CloseNativeIterators(cx);
3454
+
3455
+ /* Finalize watch points associated with unreachable objects. */
3456
+ js_SweepWatchPoints(cx);
3457
+
3458
+ #ifdef DEBUG
3459
+ /* Save the pre-sweep count of scope-mapped properties. */
3460
+ rt->liveScopePropsPreSweep = rt->liveScopeProps;
3461
+ #endif
3462
+
3463
+ /*
3464
+ * Here we need to ensure that JSObject instances are finalized before GC-
3465
+ * allocated JSString and jsdouble instances so object's finalizer can
3466
+ * access them even if they will be freed. For that we simply finalize the
3467
+ * list containing JSObject first since the static assert at the beginning
3468
+ * of the file guarantees that JSString and jsdouble instances are
3469
+ * allocated from a different list.
3470
+ */
3471
+ emptyArenas = NULL;
3472
+ for (i = 0; i < GC_NUM_FREELISTS; i++) {
3473
+ arenaList = &rt->gcArenaList[i == 0
3474
+ ? GC_FREELIST_INDEX(sizeof(JSObject))
3475
+ : i == GC_FREELIST_INDEX(sizeof(JSObject))
3476
+ ? 0
3477
+ : i];
3478
+ ap = &arenaList->last;
3479
+ if (!(a = *ap))
3480
+ continue;
3481
+
3482
+ JS_ASSERT(arenaList->lastCount > 0);
3483
+ arenaList->freeList = NULL;
3484
+ freeList = NULL;
3485
+ thingSize = arenaList->thingSize;
3486
+ indexLimit = THINGS_PER_ARENA(thingSize);
3487
+ flagp = THING_FLAGP(a, arenaList->lastCount - 1);
3488
+ METER((nlivearenas = 0, nkilledarenas = 0, nthings = 0));
3489
+ for (;;) {
3490
+ JS_ASSERT(a->prevUntracedPage == 0);
3491
+ JS_ASSERT(a->u.untracedThings == 0);
3492
+ allClear = JS_TRUE;
3493
+ do {
3494
+ flags = *flagp;
3495
+ if (flags & (GCF_MARK | GCF_LOCK)) {
3496
+ *flagp &= ~GCF_MARK;
3497
+ allClear = JS_FALSE;
3498
+ METER(nthings++);
3499
+ } else {
3500
+ thing = FLAGP_TO_THING(flagp, thingSize);
3501
+ if (!(flags & GCF_FINAL)) {
3502
+ /*
3503
+ * Call the finalizer with GCF_FINAL ORed into flags.
3504
+ */
3505
+ *flagp = (uint8)(flags | GCF_FINAL);
3506
+ type = flags & GCF_TYPEMASK;
3507
+ switch (type) {
3508
+ case GCX_OBJECT:
3509
+ js_FinalizeObject(cx, (JSObject *) thing);
3510
+ break;
3511
+ case GCX_DOUBLE:
3512
+ /* Do nothing. */
3513
+ break;
3514
+ #if JS_HAS_XML_SUPPORT
3515
+ case GCX_XML:
3516
+ js_FinalizeXML(cx, (JSXML *) thing);
3517
+ break;
3518
+ #endif
3519
+ default:
3520
+ JS_ASSERT(type == GCX_STRING ||
3521
+ type - GCX_EXTERNAL_STRING <
3522
+ GCX_NTYPES - GCX_EXTERNAL_STRING);
3523
+ js_FinalizeStringRT(rt, (JSString *) thing,
3524
+ (intN) (type -
3525
+ GCX_EXTERNAL_STRING),
3526
+ cx);
3527
+ break;
3528
+ }
3529
+ #ifdef DEBUG
3530
+ memset(thing, JS_FREE_PATTERN, thingSize);
3531
+ #endif
3532
+ }
3533
+ thing->flagp = flagp;
3534
+ thing->next = freeList;
3535
+ freeList = thing;
3536
+ }
3537
+ } while (++flagp != THING_FLAGS_END(a));
3538
+
3539
+ if (allClear) {
3540
+ /*
3541
+ * Forget just assembled free list head for the arena and
3542
+ * add the arena itself to the destroy list.
3543
+ */
3544
+ freeList = arenaList->freeList;
3545
+ if (a == arenaList->last)
3546
+ arenaList->lastCount = (uint16) indexLimit;
3547
+ *ap = a->prev;
3548
+ a->prev = emptyArenas;
3549
+ emptyArenas = a;
3550
+ METER(nkilledarenas++);
3551
+ } else {
3552
+ arenaList->freeList = freeList;
3553
+ ap = &a->prev;
3554
+ METER(nlivearenas++);
3555
+ }
3556
+ if (!(a = *ap))
3557
+ break;
3558
+ flagp = THING_FLAGP(a, indexLimit - 1);
3559
+ }
3560
+
3561
+ /*
3562
+ * We use arenaList - &rt->gcArenaList[0], not i, as the stat index
3563
+ * due to the enumeration reorder at the beginning of the loop.
3564
+ */
3565
+ METER(UpdateArenaStats(&rt->gcStats.arenaStats[arenaList -
3566
+ &rt->gcArenaList[0]],
3567
+ nlivearenas, nkilledarenas, nthings));
3568
+ }
3569
+
3570
+ #ifdef JS_THREADSAFE
3571
+ /*
3572
+ * Release all but two free list sets to avoid allocating a new set in
3573
+ * js_NewGCThing.
3574
+ */
3575
+ TrimGCFreeListsPool(rt, 2);
3576
+ #endif
3577
+
3578
+ ap = &rt->gcDoubleArenaList.first;
3579
+ METER((nlivearenas = 0, nkilledarenas = 0, nthings = 0));
3580
+ while ((a = *ap) != NULL) {
3581
+ if (!a->u.hasMarkedDoubles) {
3582
+ /* No marked double values in the arena. */
3583
+ *ap = a->prev;
3584
+ a->prev = emptyArenas;
3585
+ emptyArenas = a;
3586
+ METER(nkilledarenas++);
3587
+ } else {
3588
+ ap = &a->prev;
3589
+ #ifdef JS_GCMETER
3590
+ for (i = 0; i != DOUBLES_PER_ARENA; ++i) {
3591
+ if (IsMarkedDouble(a, index))
3592
+ METER(nthings++);
3593
+ }
3594
+ METER(nlivearenas++);
3595
+ #endif
3596
+ }
3597
+ }
3598
+ METER(UpdateArenaStats(&rt->gcStats.doubleArenaStats,
3599
+ nlivearenas, nkilledarenas, nthings));
3600
+ rt->gcDoubleArenaList.nextDoubleFlags =
3601
+ rt->gcDoubleArenaList.first
3602
+ ? DOUBLE_ARENA_BITMAP(rt->gcDoubleArenaList.first)
3603
+ : DOUBLE_BITMAP_SENTINEL;
3604
+
3605
+ /*
3606
+ * Sweep the runtime's property tree after finalizing objects, in case any
3607
+ * had watchpoints referencing tree nodes.
3608
+ */
3609
+ js_SweepScopeProperties(cx);
3610
+
3611
+ /*
3612
+ * Sweep script filenames after sweeping functions in the generic loop
3613
+ * above. In this way when a scripted function's finalizer destroys the
3614
+ * script and calls rt->destroyScriptHook, the hook can still access the
3615
+ * script's filename. See bug 323267.
3616
+ */
3617
+ js_SweepScriptFilenames(rt);
3618
+
3619
+ /*
3620
+ * Destroy arenas after we finished the sweeping sofinalizers can safely
3621
+ * use js_IsAboutToBeFinalized().
3622
+ */
3623
+ DestroyGCArenas(rt, emptyArenas);
3624
+
3625
+ if (rt->gcCallback)
3626
+ (void) rt->gcCallback(cx, JSGC_FINALIZE_END);
3627
+ #ifdef DEBUG_srcnotesize
3628
+ { extern void DumpSrcNoteSizeHist();
3629
+ DumpSrcNoteSizeHist();
3630
+ printf("GC HEAP SIZE %lu\n", (unsigned long)rt->gcBytes);
3631
+ }
3632
+ #endif
3633
+
3634
+ #ifdef JS_SCOPE_DEPTH_METER
3635
+ { static FILE *fp;
3636
+ if (!fp)
3637
+ fp = fopen("/tmp/scopedepth.stats", "w");
3638
+
3639
+ if (fp) {
3640
+ JS_DumpBasicStats(&rt->protoLookupDepthStats, "proto-lookup depth", fp);
3641
+ JS_DumpBasicStats(&rt->scopeSearchDepthStats, "scope-search depth", fp);
3642
+ JS_DumpBasicStats(&rt->hostenvScopeDepthStats, "hostenv scope depth", fp);
3643
+ JS_DumpBasicStats(&rt->lexicalScopeDepthStats, "lexical scope depth", fp);
3644
+
3645
+ putc('\n', fp);
3646
+ fflush(fp);
3647
+ }
3648
+ }
3649
+ #endif /* JS_SCOPE_DEPTH_METER */
3650
+
3651
+ #ifdef JS_DUMP_LOOP_STATS
3652
+ { static FILE *lsfp;
3653
+ if (!lsfp)
3654
+ lsfp = fopen("/tmp/loopstats", "w");
3655
+ if (lsfp) {
3656
+ JS_DumpBasicStats(&rt->loopStats, "loops", lsfp);
3657
+ fflush(lsfp);
3658
+ }
3659
+ }
3660
+ #endif /* JS_DUMP_LOOP_STATS */
3661
+
3662
+ #ifdef JS_TRACER
3663
+ out:
3664
+ #endif
3665
+ JS_LOCK_GC(rt);
3666
+
3667
+ /*
3668
+ * We want to restart GC if js_GC was called recursively or if any of the
3669
+ * finalizers called js_RemoveRoot or js_UnlockGCThingRT.
3670
+ */
3671
+ if (rt->gcLevel > 1 || rt->gcPoke) {
3672
+ rt->gcLevel = 1;
3673
+ rt->gcPoke = JS_FALSE;
3674
+ JS_UNLOCK_GC(rt);
3675
+ goto restart;
3676
+ }
3677
+
3678
+ if (rt->shapeGen >= SHAPE_OVERFLOW_BIT - 1) {
3679
+ /*
3680
+ * FIXME bug 440834: The shape id space has overflowed. Currently we
3681
+ * cope badly with this. Every call to js_GenerateShape does GC, and
3682
+ * we never re-enable the property cache.
3683
+ */
3684
+ js_DisablePropertyCache(cx);
3685
+ #ifdef JS_THREADSAFE
3686
+ iter = NULL;
3687
+ while ((acx = js_ContextIterator(rt, JS_FALSE, &iter)) != NULL) {
3688
+ if (!acx->thread || acx->thread == cx->thread)
3689
+ continue;
3690
+ js_DisablePropertyCache(acx);
3691
+ }
3692
+ #endif
3693
+ }
3694
+
3695
+ rt->gcLastBytes = rt->gcBytes;
3696
+ done_running:
3697
+ rt->gcLevel = 0;
3698
+ rt->gcRunning = JS_FALSE;
3699
+
3700
+ #ifdef JS_THREADSAFE
3701
+ /* If we were invoked during a request, pay back the temporary debit. */
3702
+ if (requestDebit)
3703
+ rt->requestCount += requestDebit;
3704
+ rt->gcThread = NULL;
3705
+ JS_NOTIFY_GC_DONE(rt);
3706
+
3707
+ /*
3708
+ * Unlock unless we have GC_LOCK_HELD which requires locked GC on return.
3709
+ */
3710
+ if (!(gckind & GC_LOCK_HELD))
3711
+ JS_UNLOCK_GC(rt);
3712
+ #endif
3713
+
3714
+ /*
3715
+ * Execute JSGC_END callback outside the lock. Again, sample the callback
3716
+ * pointer in case it changes, since we are outside of the GC vs. requests
3717
+ * interlock mechanism here.
3718
+ */
3719
+ if (gckind != GC_SET_SLOT_REQUEST && (callback = rt->gcCallback)) {
3720
+ JSWeakRoots savedWeakRoots;
3721
+ JSTempValueRooter tvr;
3722
+
3723
+ if (gckind & GC_KEEP_ATOMS) {
3724
+ /*
3725
+ * We allow JSGC_END implementation to force a full GC or allocate
3726
+ * new GC things. Thus we must protect the weak roots from garbage
3727
+ * collection and overwrites.
3728
+ */
3729
+ savedWeakRoots = cx->weakRoots;
3730
+ JS_PUSH_TEMP_ROOT_WEAK_COPY(cx, &savedWeakRoots, &tvr);
3731
+ JS_KEEP_ATOMS(rt);
3732
+ JS_UNLOCK_GC(rt);
3733
+ }
3734
+
3735
+ (void) callback(cx, JSGC_END);
3736
+
3737
+ if (gckind & GC_KEEP_ATOMS) {
3738
+ JS_LOCK_GC(rt);
3739
+ JS_UNKEEP_ATOMS(rt);
3740
+ JS_POP_TEMP_ROOT(cx, &tvr);
3741
+ } else if (gckind == GC_LAST_CONTEXT && rt->gcPoke) {
3742
+ /*
3743
+ * On shutdown iterate until JSGC_END callback stops creating
3744
+ * garbage.
3745
+ */
3746
+ goto restart_at_beginning;
3747
+ }
3748
+ }
3749
+ }
3750
+
3751
+ void
3752
+ js_UpdateMallocCounter(JSContext *cx, size_t nbytes)
3753
+ {
3754
+ uint32 *pbytes, bytes;
3755
+
3756
+ #ifdef JS_THREADSAFE
3757
+ pbytes = &cx->thread->gcMallocBytes;
3758
+ #else
3759
+ pbytes = &cx->runtime->gcMallocBytes;
3760
+ #endif
3761
+ bytes = *pbytes;
3762
+ *pbytes = ((uint32)-1 - bytes <= nbytes) ? (uint32)-1 : bytes + nbytes;
3763
+ }