therubyracer 0.4.9-x86-linux

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

Potentially problematic release.


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

Files changed (637) hide show
  1. data/.gitignore +11 -0
  2. data/.gitmodules +3 -0
  3. data/Doxyfile +1514 -0
  4. data/History.txt +43 -0
  5. data/README.rdoc +157 -0
  6. data/Rakefile +51 -0
  7. data/docs/data_conversion.txt +18 -0
  8. data/ext/v8/callbacks.cpp +160 -0
  9. data/ext/v8/callbacks.h +14 -0
  10. data/ext/v8/convert_ruby.cpp +8 -0
  11. data/ext/v8/convert_ruby.h +99 -0
  12. data/ext/v8/convert_string.cpp +10 -0
  13. data/ext/v8/convert_string.h +73 -0
  14. data/ext/v8/convert_v8.cpp +9 -0
  15. data/ext/v8/convert_v8.h +121 -0
  16. data/ext/v8/converters.cpp +83 -0
  17. data/ext/v8/converters.h +23 -0
  18. data/ext/v8/extconf.rb +36 -0
  19. data/ext/v8/upstream/2.0.6/.gitignore +26 -0
  20. data/ext/v8/upstream/2.0.6/AUTHORS +23 -0
  21. data/ext/v8/upstream/2.0.6/ChangeLog +1479 -0
  22. data/ext/v8/upstream/2.0.6/LICENSE +55 -0
  23. data/ext/v8/upstream/2.0.6/SConstruct +1028 -0
  24. data/ext/v8/upstream/2.0.6/include/v8-debug.h +275 -0
  25. data/ext/v8/upstream/2.0.6/include/v8.h +3236 -0
  26. data/ext/v8/upstream/2.0.6/src/SConscript +283 -0
  27. data/ext/v8/upstream/2.0.6/src/accessors.cc +695 -0
  28. data/ext/v8/upstream/2.0.6/src/accessors.h +114 -0
  29. data/ext/v8/upstream/2.0.6/src/allocation.cc +198 -0
  30. data/ext/v8/upstream/2.0.6/src/allocation.h +169 -0
  31. data/ext/v8/upstream/2.0.6/src/api.cc +3831 -0
  32. data/ext/v8/upstream/2.0.6/src/api.h +479 -0
  33. data/ext/v8/upstream/2.0.6/src/apinatives.js +110 -0
  34. data/ext/v8/upstream/2.0.6/src/apiutils.h +69 -0
  35. data/ext/v8/upstream/2.0.6/src/arguments.h +97 -0
  36. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm-inl.h +277 -0
  37. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.cc +1821 -0
  38. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.h +1027 -0
  39. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2-inl.h +267 -0
  40. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.cc +1821 -0
  41. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.h +1027 -0
  42. data/ext/v8/upstream/2.0.6/src/arm/builtins-arm.cc +1271 -0
  43. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm-inl.h +74 -0
  44. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.cc +6682 -0
  45. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.h +535 -0
  46. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.cc +112 -0
  47. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.h +347 -0
  48. data/ext/v8/upstream/2.0.6/src/arm/cpu-arm.cc +132 -0
  49. data/ext/v8/upstream/2.0.6/src/arm/debug-arm.cc +213 -0
  50. data/ext/v8/upstream/2.0.6/src/arm/disasm-arm.cc +1166 -0
  51. data/ext/v8/upstream/2.0.6/src/arm/fast-codegen-arm.cc +1698 -0
  52. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.cc +123 -0
  53. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.h +162 -0
  54. data/ext/v8/upstream/2.0.6/src/arm/ic-arm.cc +849 -0
  55. data/ext/v8/upstream/2.0.6/src/arm/jump-target-arm.cc +238 -0
  56. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.cc +1259 -0
  57. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.h +423 -0
  58. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.cc +1266 -0
  59. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.h +282 -0
  60. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm-inl.h +103 -0
  61. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.cc +59 -0
  62. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.h +43 -0
  63. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.cc +2264 -0
  64. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.h +306 -0
  65. data/ext/v8/upstream/2.0.6/src/arm/stub-cache-arm.cc +1516 -0
  66. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.cc +412 -0
  67. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.h +532 -0
  68. data/ext/v8/upstream/2.0.6/src/array.js +1154 -0
  69. data/ext/v8/upstream/2.0.6/src/assembler.cc +772 -0
  70. data/ext/v8/upstream/2.0.6/src/assembler.h +525 -0
  71. data/ext/v8/upstream/2.0.6/src/ast.cc +512 -0
  72. data/ext/v8/upstream/2.0.6/src/ast.h +1820 -0
  73. data/ext/v8/upstream/2.0.6/src/bootstrapper.cc +1680 -0
  74. data/ext/v8/upstream/2.0.6/src/bootstrapper.h +103 -0
  75. data/ext/v8/upstream/2.0.6/src/builtins.cc +851 -0
  76. data/ext/v8/upstream/2.0.6/src/builtins.h +245 -0
  77. data/ext/v8/upstream/2.0.6/src/bytecodes-irregexp.h +104 -0
  78. data/ext/v8/upstream/2.0.6/src/char-predicates-inl.h +86 -0
  79. data/ext/v8/upstream/2.0.6/src/char-predicates.h +65 -0
  80. data/ext/v8/upstream/2.0.6/src/checks.cc +100 -0
  81. data/ext/v8/upstream/2.0.6/src/checks.h +284 -0
  82. data/ext/v8/upstream/2.0.6/src/code-stubs.cc +164 -0
  83. data/ext/v8/upstream/2.0.6/src/code-stubs.h +164 -0
  84. data/ext/v8/upstream/2.0.6/src/code.h +68 -0
  85. data/ext/v8/upstream/2.0.6/src/codegen-inl.h +88 -0
  86. data/ext/v8/upstream/2.0.6/src/codegen.cc +504 -0
  87. data/ext/v8/upstream/2.0.6/src/codegen.h +522 -0
  88. data/ext/v8/upstream/2.0.6/src/compilation-cache.cc +490 -0
  89. data/ext/v8/upstream/2.0.6/src/compilation-cache.h +98 -0
  90. data/ext/v8/upstream/2.0.6/src/compiler.cc +1132 -0
  91. data/ext/v8/upstream/2.0.6/src/compiler.h +107 -0
  92. data/ext/v8/upstream/2.0.6/src/contexts.cc +256 -0
  93. data/ext/v8/upstream/2.0.6/src/contexts.h +345 -0
  94. data/ext/v8/upstream/2.0.6/src/conversions-inl.h +95 -0
  95. data/ext/v8/upstream/2.0.6/src/conversions.cc +709 -0
  96. data/ext/v8/upstream/2.0.6/src/conversions.h +118 -0
  97. data/ext/v8/upstream/2.0.6/src/counters.cc +78 -0
  98. data/ext/v8/upstream/2.0.6/src/counters.h +239 -0
  99. data/ext/v8/upstream/2.0.6/src/cpu.h +65 -0
  100. data/ext/v8/upstream/2.0.6/src/d8-debug.cc +345 -0
  101. data/ext/v8/upstream/2.0.6/src/d8-debug.h +155 -0
  102. data/ext/v8/upstream/2.0.6/src/d8-posix.cc +675 -0
  103. data/ext/v8/upstream/2.0.6/src/d8-readline.cc +128 -0
  104. data/ext/v8/upstream/2.0.6/src/d8-windows.cc +42 -0
  105. data/ext/v8/upstream/2.0.6/src/d8.cc +776 -0
  106. data/ext/v8/upstream/2.0.6/src/d8.h +225 -0
  107. data/ext/v8/upstream/2.0.6/src/d8.js +1625 -0
  108. data/ext/v8/upstream/2.0.6/src/date-delay.js +1138 -0
  109. data/ext/v8/upstream/2.0.6/src/dateparser-inl.h +114 -0
  110. data/ext/v8/upstream/2.0.6/src/dateparser.cc +186 -0
  111. data/ext/v8/upstream/2.0.6/src/dateparser.h +240 -0
  112. data/ext/v8/upstream/2.0.6/src/debug-agent.cc +425 -0
  113. data/ext/v8/upstream/2.0.6/src/debug-agent.h +129 -0
  114. data/ext/v8/upstream/2.0.6/src/debug-delay.js +2073 -0
  115. data/ext/v8/upstream/2.0.6/src/debug.cc +2751 -0
  116. data/ext/v8/upstream/2.0.6/src/debug.h +866 -0
  117. data/ext/v8/upstream/2.0.6/src/disasm.h +77 -0
  118. data/ext/v8/upstream/2.0.6/src/disassembler.cc +318 -0
  119. data/ext/v8/upstream/2.0.6/src/disassembler.h +56 -0
  120. data/ext/v8/upstream/2.0.6/src/dtoa-config.c +91 -0
  121. data/ext/v8/upstream/2.0.6/src/execution.cc +701 -0
  122. data/ext/v8/upstream/2.0.6/src/execution.h +312 -0
  123. data/ext/v8/upstream/2.0.6/src/factory.cc +957 -0
  124. data/ext/v8/upstream/2.0.6/src/factory.h +393 -0
  125. data/ext/v8/upstream/2.0.6/src/fast-codegen.cc +725 -0
  126. data/ext/v8/upstream/2.0.6/src/fast-codegen.h +371 -0
  127. data/ext/v8/upstream/2.0.6/src/flag-definitions.h +426 -0
  128. data/ext/v8/upstream/2.0.6/src/flags.cc +555 -0
  129. data/ext/v8/upstream/2.0.6/src/flags.h +81 -0
  130. data/ext/v8/upstream/2.0.6/src/frame-element.cc +45 -0
  131. data/ext/v8/upstream/2.0.6/src/frame-element.h +235 -0
  132. data/ext/v8/upstream/2.0.6/src/frames-inl.h +215 -0
  133. data/ext/v8/upstream/2.0.6/src/frames.cc +749 -0
  134. data/ext/v8/upstream/2.0.6/src/frames.h +659 -0
  135. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.cc +76 -0
  136. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.h +135 -0
  137. data/ext/v8/upstream/2.0.6/src/global-handles.cc +516 -0
  138. data/ext/v8/upstream/2.0.6/src/global-handles.h +180 -0
  139. data/ext/v8/upstream/2.0.6/src/globals.h +608 -0
  140. data/ext/v8/upstream/2.0.6/src/handles-inl.h +76 -0
  141. data/ext/v8/upstream/2.0.6/src/handles.cc +811 -0
  142. data/ext/v8/upstream/2.0.6/src/handles.h +367 -0
  143. data/ext/v8/upstream/2.0.6/src/hashmap.cc +226 -0
  144. data/ext/v8/upstream/2.0.6/src/hashmap.h +120 -0
  145. data/ext/v8/upstream/2.0.6/src/heap-inl.h +407 -0
  146. data/ext/v8/upstream/2.0.6/src/heap-profiler.cc +695 -0
  147. data/ext/v8/upstream/2.0.6/src/heap-profiler.h +277 -0
  148. data/ext/v8/upstream/2.0.6/src/heap.cc +4204 -0
  149. data/ext/v8/upstream/2.0.6/src/heap.h +1704 -0
  150. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32-inl.h +325 -0
  151. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.cc +2375 -0
  152. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.h +914 -0
  153. data/ext/v8/upstream/2.0.6/src/ia32/builtins-ia32.cc +1222 -0
  154. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32-inl.h +46 -0
  155. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.cc +9770 -0
  156. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.h +834 -0
  157. data/ext/v8/upstream/2.0.6/src/ia32/cpu-ia32.cc +79 -0
  158. data/ext/v8/upstream/2.0.6/src/ia32/debug-ia32.cc +208 -0
  159. data/ext/v8/upstream/2.0.6/src/ia32/disasm-ia32.cc +1357 -0
  160. data/ext/v8/upstream/2.0.6/src/ia32/fast-codegen-ia32.cc +1813 -0
  161. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.cc +111 -0
  162. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.h +135 -0
  163. data/ext/v8/upstream/2.0.6/src/ia32/ic-ia32.cc +1490 -0
  164. data/ext/v8/upstream/2.0.6/src/ia32/jump-target-ia32.cc +432 -0
  165. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.cc +1517 -0
  166. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.h +528 -0
  167. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.cc +1219 -0
  168. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.h +230 -0
  169. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32-inl.h +82 -0
  170. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.cc +99 -0
  171. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.h +43 -0
  172. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.cc +30 -0
  173. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.h +62 -0
  174. data/ext/v8/upstream/2.0.6/src/ia32/stub-cache-ia32.cc +1961 -0
  175. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.cc +1105 -0
  176. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.h +580 -0
  177. data/ext/v8/upstream/2.0.6/src/ic-inl.h +93 -0
  178. data/ext/v8/upstream/2.0.6/src/ic.cc +1426 -0
  179. data/ext/v8/upstream/2.0.6/src/ic.h +443 -0
  180. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.cc +646 -0
  181. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.h +48 -0
  182. data/ext/v8/upstream/2.0.6/src/json-delay.js +254 -0
  183. data/ext/v8/upstream/2.0.6/src/jsregexp.cc +5234 -0
  184. data/ext/v8/upstream/2.0.6/src/jsregexp.h +1439 -0
  185. data/ext/v8/upstream/2.0.6/src/jump-target-inl.h +49 -0
  186. data/ext/v8/upstream/2.0.6/src/jump-target.cc +383 -0
  187. data/ext/v8/upstream/2.0.6/src/jump-target.h +280 -0
  188. data/ext/v8/upstream/2.0.6/src/list-inl.h +166 -0
  189. data/ext/v8/upstream/2.0.6/src/list.h +158 -0
  190. data/ext/v8/upstream/2.0.6/src/log-inl.h +126 -0
  191. data/ext/v8/upstream/2.0.6/src/log-utils.cc +503 -0
  192. data/ext/v8/upstream/2.0.6/src/log-utils.h +292 -0
  193. data/ext/v8/upstream/2.0.6/src/log.cc +1457 -0
  194. data/ext/v8/upstream/2.0.6/src/log.h +371 -0
  195. data/ext/v8/upstream/2.0.6/src/macro-assembler.h +93 -0
  196. data/ext/v8/upstream/2.0.6/src/macros.py +137 -0
  197. data/ext/v8/upstream/2.0.6/src/mark-compact.cc +2007 -0
  198. data/ext/v8/upstream/2.0.6/src/mark-compact.h +442 -0
  199. data/ext/v8/upstream/2.0.6/src/math.js +263 -0
  200. data/ext/v8/upstream/2.0.6/src/memory.h +74 -0
  201. data/ext/v8/upstream/2.0.6/src/messages.cc +177 -0
  202. data/ext/v8/upstream/2.0.6/src/messages.h +112 -0
  203. data/ext/v8/upstream/2.0.6/src/messages.js +937 -0
  204. data/ext/v8/upstream/2.0.6/src/mirror-delay.js +2332 -0
  205. data/ext/v8/upstream/2.0.6/src/mksnapshot.cc +169 -0
  206. data/ext/v8/upstream/2.0.6/src/natives.h +63 -0
  207. data/ext/v8/upstream/2.0.6/src/objects-debug.cc +1317 -0
  208. data/ext/v8/upstream/2.0.6/src/objects-inl.h +3044 -0
  209. data/ext/v8/upstream/2.0.6/src/objects.cc +8306 -0
  210. data/ext/v8/upstream/2.0.6/src/objects.h +4960 -0
  211. data/ext/v8/upstream/2.0.6/src/oprofile-agent.cc +116 -0
  212. data/ext/v8/upstream/2.0.6/src/oprofile-agent.h +69 -0
  213. data/ext/v8/upstream/2.0.6/src/parser.cc +4810 -0
  214. data/ext/v8/upstream/2.0.6/src/parser.h +195 -0
  215. data/ext/v8/upstream/2.0.6/src/platform-freebsd.cc +645 -0
  216. data/ext/v8/upstream/2.0.6/src/platform-linux.cc +808 -0
  217. data/ext/v8/upstream/2.0.6/src/platform-macos.cc +643 -0
  218. data/ext/v8/upstream/2.0.6/src/platform-nullos.cc +454 -0
  219. data/ext/v8/upstream/2.0.6/src/platform-openbsd.cc +597 -0
  220. data/ext/v8/upstream/2.0.6/src/platform-posix.cc +380 -0
  221. data/ext/v8/upstream/2.0.6/src/platform-win32.cc +1908 -0
  222. data/ext/v8/upstream/2.0.6/src/platform.h +556 -0
  223. data/ext/v8/upstream/2.0.6/src/prettyprinter.cc +1511 -0
  224. data/ext/v8/upstream/2.0.6/src/prettyprinter.h +219 -0
  225. data/ext/v8/upstream/2.0.6/src/property.cc +96 -0
  226. data/ext/v8/upstream/2.0.6/src/property.h +327 -0
  227. data/ext/v8/upstream/2.0.6/src/regexp-delay.js +406 -0
  228. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp-inl.h +78 -0
  229. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.cc +464 -0
  230. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.h +141 -0
  231. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.cc +356 -0
  232. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.h +103 -0
  233. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.cc +240 -0
  234. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.h +220 -0
  235. data/ext/v8/upstream/2.0.6/src/regexp-stack.cc +103 -0
  236. data/ext/v8/upstream/2.0.6/src/regexp-stack.h +123 -0
  237. data/ext/v8/upstream/2.0.6/src/register-allocator-inl.h +74 -0
  238. data/ext/v8/upstream/2.0.6/src/register-allocator.cc +100 -0
  239. data/ext/v8/upstream/2.0.6/src/register-allocator.h +295 -0
  240. data/ext/v8/upstream/2.0.6/src/rewriter.cc +855 -0
  241. data/ext/v8/upstream/2.0.6/src/rewriter.h +54 -0
  242. data/ext/v8/upstream/2.0.6/src/runtime.cc +8163 -0
  243. data/ext/v8/upstream/2.0.6/src/runtime.h +432 -0
  244. data/ext/v8/upstream/2.0.6/src/runtime.js +626 -0
  245. data/ext/v8/upstream/2.0.6/src/scanner.cc +1098 -0
  246. data/ext/v8/upstream/2.0.6/src/scanner.h +425 -0
  247. data/ext/v8/upstream/2.0.6/src/scopeinfo.cc +649 -0
  248. data/ext/v8/upstream/2.0.6/src/scopeinfo.h +236 -0
  249. data/ext/v8/upstream/2.0.6/src/scopes.cc +963 -0
  250. data/ext/v8/upstream/2.0.6/src/scopes.h +401 -0
  251. data/ext/v8/upstream/2.0.6/src/serialize.cc +1260 -0
  252. data/ext/v8/upstream/2.0.6/src/serialize.h +404 -0
  253. data/ext/v8/upstream/2.0.6/src/shell.h +55 -0
  254. data/ext/v8/upstream/2.0.6/src/simulator.h +41 -0
  255. data/ext/v8/upstream/2.0.6/src/smart-pointer.h +109 -0
  256. data/ext/v8/upstream/2.0.6/src/snapshot-common.cc +97 -0
  257. data/ext/v8/upstream/2.0.6/src/snapshot-empty.cc +40 -0
  258. data/ext/v8/upstream/2.0.6/src/snapshot.h +59 -0
  259. data/ext/v8/upstream/2.0.6/src/spaces-inl.h +372 -0
  260. data/ext/v8/upstream/2.0.6/src/spaces.cc +2864 -0
  261. data/ext/v8/upstream/2.0.6/src/spaces.h +2072 -0
  262. data/ext/v8/upstream/2.0.6/src/string-stream.cc +584 -0
  263. data/ext/v8/upstream/2.0.6/src/string-stream.h +189 -0
  264. data/ext/v8/upstream/2.0.6/src/string.js +901 -0
  265. data/ext/v8/upstream/2.0.6/src/stub-cache.cc +1108 -0
  266. data/ext/v8/upstream/2.0.6/src/stub-cache.h +578 -0
  267. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/COPYING +15 -0
  268. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/dtoa.c +3330 -0
  269. data/ext/v8/upstream/2.0.6/src/third_party/valgrind/valgrind.h +3925 -0
  270. data/ext/v8/upstream/2.0.6/src/token.cc +56 -0
  271. data/ext/v8/upstream/2.0.6/src/token.h +270 -0
  272. data/ext/v8/upstream/2.0.6/src/top.cc +991 -0
  273. data/ext/v8/upstream/2.0.6/src/top.h +459 -0
  274. data/ext/v8/upstream/2.0.6/src/unicode-inl.h +238 -0
  275. data/ext/v8/upstream/2.0.6/src/unicode.cc +749 -0
  276. data/ext/v8/upstream/2.0.6/src/unicode.h +279 -0
  277. data/ext/v8/upstream/2.0.6/src/uri.js +415 -0
  278. data/ext/v8/upstream/2.0.6/src/usage-analyzer.cc +426 -0
  279. data/ext/v8/upstream/2.0.6/src/usage-analyzer.h +40 -0
  280. data/ext/v8/upstream/2.0.6/src/utils.cc +322 -0
  281. data/ext/v8/upstream/2.0.6/src/utils.h +592 -0
  282. data/ext/v8/upstream/2.0.6/src/v8-counters.cc +55 -0
  283. data/ext/v8/upstream/2.0.6/src/v8-counters.h +198 -0
  284. data/ext/v8/upstream/2.0.6/src/v8.cc +193 -0
  285. data/ext/v8/upstream/2.0.6/src/v8.h +119 -0
  286. data/ext/v8/upstream/2.0.6/src/v8natives.js +846 -0
  287. data/ext/v8/upstream/2.0.6/src/v8threads.cc +450 -0
  288. data/ext/v8/upstream/2.0.6/src/v8threads.h +144 -0
  289. data/ext/v8/upstream/2.0.6/src/variables.cc +163 -0
  290. data/ext/v8/upstream/2.0.6/src/variables.h +235 -0
  291. data/ext/v8/upstream/2.0.6/src/version.cc +88 -0
  292. data/ext/v8/upstream/2.0.6/src/version.h +64 -0
  293. data/ext/v8/upstream/2.0.6/src/virtual-frame.cc +381 -0
  294. data/ext/v8/upstream/2.0.6/src/virtual-frame.h +44 -0
  295. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64-inl.h +352 -0
  296. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.cc +2539 -0
  297. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.h +1399 -0
  298. data/ext/v8/upstream/2.0.6/src/x64/builtins-x64.cc +1255 -0
  299. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64-inl.h +46 -0
  300. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.cc +8223 -0
  301. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.h +785 -0
  302. data/ext/v8/upstream/2.0.6/src/x64/cpu-x64.cc +79 -0
  303. data/ext/v8/upstream/2.0.6/src/x64/debug-x64.cc +202 -0
  304. data/ext/v8/upstream/2.0.6/src/x64/disasm-x64.cc +1596 -0
  305. data/ext/v8/upstream/2.0.6/src/x64/fast-codegen-x64.cc +1820 -0
  306. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.cc +109 -0
  307. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.h +121 -0
  308. data/ext/v8/upstream/2.0.6/src/x64/ic-x64.cc +1392 -0
  309. data/ext/v8/upstream/2.0.6/src/x64/jump-target-x64.cc +432 -0
  310. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.cc +2409 -0
  311. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.h +765 -0
  312. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.cc +1337 -0
  313. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.h +295 -0
  314. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64-inl.h +86 -0
  315. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.cc +84 -0
  316. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.h +43 -0
  317. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.cc +27 -0
  318. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.h +63 -0
  319. data/ext/v8/upstream/2.0.6/src/x64/stub-cache-x64.cc +1884 -0
  320. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.cc +1089 -0
  321. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.h +560 -0
  322. data/ext/v8/upstream/2.0.6/src/zone-inl.h +297 -0
  323. data/ext/v8/upstream/2.0.6/src/zone.cc +193 -0
  324. data/ext/v8/upstream/2.0.6/src/zone.h +305 -0
  325. data/ext/v8/upstream/2.0.6/tools/codemap.js +258 -0
  326. data/ext/v8/upstream/2.0.6/tools/consarray.js +93 -0
  327. data/ext/v8/upstream/2.0.6/tools/csvparser.js +98 -0
  328. data/ext/v8/upstream/2.0.6/tools/gyp/v8.gyp +620 -0
  329. data/ext/v8/upstream/2.0.6/tools/js2c.py +376 -0
  330. data/ext/v8/upstream/2.0.6/tools/jsmin.py +280 -0
  331. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor +24 -0
  332. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor.py +78 -0
  333. data/ext/v8/upstream/2.0.6/tools/logreader.js +320 -0
  334. data/ext/v8/upstream/2.0.6/tools/mac-nm +18 -0
  335. data/ext/v8/upstream/2.0.6/tools/mac-tick-processor +6 -0
  336. data/ext/v8/upstream/2.0.6/tools/oprofile/annotate +7 -0
  337. data/ext/v8/upstream/2.0.6/tools/oprofile/common +19 -0
  338. data/ext/v8/upstream/2.0.6/tools/oprofile/dump +7 -0
  339. data/ext/v8/upstream/2.0.6/tools/oprofile/report +7 -0
  340. data/ext/v8/upstream/2.0.6/tools/oprofile/reset +7 -0
  341. data/ext/v8/upstream/2.0.6/tools/oprofile/run +14 -0
  342. data/ext/v8/upstream/2.0.6/tools/oprofile/shutdown +7 -0
  343. data/ext/v8/upstream/2.0.6/tools/oprofile/start +7 -0
  344. data/ext/v8/upstream/2.0.6/tools/presubmit.py +299 -0
  345. data/ext/v8/upstream/2.0.6/tools/process-heap-prof.py +120 -0
  346. data/ext/v8/upstream/2.0.6/tools/profile.js +621 -0
  347. data/ext/v8/upstream/2.0.6/tools/profile_view.js +224 -0
  348. data/ext/v8/upstream/2.0.6/tools/run-valgrind.py +77 -0
  349. data/ext/v8/upstream/2.0.6/tools/splaytree.js +322 -0
  350. data/ext/v8/upstream/2.0.6/tools/splaytree.py +226 -0
  351. data/ext/v8/upstream/2.0.6/tools/stats-viewer.py +456 -0
  352. data/ext/v8/upstream/2.0.6/tools/test.py +1370 -0
  353. data/ext/v8/upstream/2.0.6/tools/tickprocessor-driver.js +53 -0
  354. data/ext/v8/upstream/2.0.6/tools/tickprocessor.js +731 -0
  355. data/ext/v8/upstream/2.0.6/tools/tickprocessor.py +535 -0
  356. data/ext/v8/upstream/2.0.6/tools/utils.py +82 -0
  357. data/ext/v8/upstream/2.0.6/tools/visual_studio/README.txt +71 -0
  358. data/ext/v8/upstream/2.0.6/tools/visual_studio/arm.vsprops +14 -0
  359. data/ext/v8/upstream/2.0.6/tools/visual_studio/common.vsprops +35 -0
  360. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8.vcproj +199 -0
  361. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_arm.vcproj +199 -0
  362. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_x64.vcproj +201 -0
  363. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8js2c.cmd +6 -0
  364. data/ext/v8/upstream/2.0.6/tools/visual_studio/debug.vsprops +17 -0
  365. data/ext/v8/upstream/2.0.6/tools/visual_studio/ia32.vsprops +13 -0
  366. data/ext/v8/upstream/2.0.6/tools/visual_studio/js2c.cmd +6 -0
  367. data/ext/v8/upstream/2.0.6/tools/visual_studio/release.vsprops +24 -0
  368. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.sln +101 -0
  369. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.vcproj +223 -0
  370. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.sln +74 -0
  371. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.vcproj +223 -0
  372. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base.vcproj +971 -0
  373. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_arm.vcproj +983 -0
  374. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_x64.vcproj +959 -0
  375. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest.vcproj +255 -0
  376. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_arm.vcproj +243 -0
  377. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_x64.vcproj +257 -0
  378. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot.vcproj +151 -0
  379. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot_x64.vcproj +151 -0
  380. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample.vcproj +151 -0
  381. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_arm.vcproj +151 -0
  382. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_x64.vcproj +151 -0
  383. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample.vcproj +151 -0
  384. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_arm.vcproj +151 -0
  385. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_x64.vcproj +153 -0
  386. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot.vcproj +142 -0
  387. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc.vcproj +92 -0
  388. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc_x64.vcproj +92 -0
  389. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_x64.vcproj +142 -0
  390. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.sln +101 -0
  391. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.vcproj +223 -0
  392. data/ext/v8/upstream/2.0.6/tools/visual_studio/x64.vsprops +13 -0
  393. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.bat +5 -0
  394. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.py +137 -0
  395. data/ext/v8/upstream/Makefile +31 -0
  396. data/ext/v8/upstream/no-strict-aliasing.patch +13 -0
  397. data/ext/v8/upstream/scons/CHANGES.txt +5183 -0
  398. data/ext/v8/upstream/scons/LICENSE.txt +20 -0
  399. data/ext/v8/upstream/scons/MANIFEST +202 -0
  400. data/ext/v8/upstream/scons/PKG-INFO +13 -0
  401. data/ext/v8/upstream/scons/README.txt +273 -0
  402. data/ext/v8/upstream/scons/RELEASE.txt +1040 -0
  403. data/ext/v8/upstream/scons/engine/SCons/Action.py +1256 -0
  404. data/ext/v8/upstream/scons/engine/SCons/Builder.py +868 -0
  405. data/ext/v8/upstream/scons/engine/SCons/CacheDir.py +217 -0
  406. data/ext/v8/upstream/scons/engine/SCons/Conftest.py +794 -0
  407. data/ext/v8/upstream/scons/engine/SCons/Debug.py +237 -0
  408. data/ext/v8/upstream/scons/engine/SCons/Defaults.py +485 -0
  409. data/ext/v8/upstream/scons/engine/SCons/Environment.py +2327 -0
  410. data/ext/v8/upstream/scons/engine/SCons/Errors.py +207 -0
  411. data/ext/v8/upstream/scons/engine/SCons/Executor.py +636 -0
  412. data/ext/v8/upstream/scons/engine/SCons/Job.py +435 -0
  413. data/ext/v8/upstream/scons/engine/SCons/Memoize.py +292 -0
  414. data/ext/v8/upstream/scons/engine/SCons/Node/Alias.py +153 -0
  415. data/ext/v8/upstream/scons/engine/SCons/Node/FS.py +3220 -0
  416. data/ext/v8/upstream/scons/engine/SCons/Node/Python.py +128 -0
  417. data/ext/v8/upstream/scons/engine/SCons/Node/__init__.py +1341 -0
  418. data/ext/v8/upstream/scons/engine/SCons/Options/BoolOption.py +50 -0
  419. data/ext/v8/upstream/scons/engine/SCons/Options/EnumOption.py +50 -0
  420. data/ext/v8/upstream/scons/engine/SCons/Options/ListOption.py +50 -0
  421. data/ext/v8/upstream/scons/engine/SCons/Options/PackageOption.py +50 -0
  422. data/ext/v8/upstream/scons/engine/SCons/Options/PathOption.py +76 -0
  423. data/ext/v8/upstream/scons/engine/SCons/Options/__init__.py +74 -0
  424. data/ext/v8/upstream/scons/engine/SCons/PathList.py +232 -0
  425. data/ext/v8/upstream/scons/engine/SCons/Platform/__init__.py +236 -0
  426. data/ext/v8/upstream/scons/engine/SCons/Platform/aix.py +70 -0
  427. data/ext/v8/upstream/scons/engine/SCons/Platform/cygwin.py +55 -0
  428. data/ext/v8/upstream/scons/engine/SCons/Platform/darwin.py +46 -0
  429. data/ext/v8/upstream/scons/engine/SCons/Platform/hpux.py +46 -0
  430. data/ext/v8/upstream/scons/engine/SCons/Platform/irix.py +44 -0
  431. data/ext/v8/upstream/scons/engine/SCons/Platform/os2.py +58 -0
  432. data/ext/v8/upstream/scons/engine/SCons/Platform/posix.py +264 -0
  433. data/ext/v8/upstream/scons/engine/SCons/Platform/sunos.py +50 -0
  434. data/ext/v8/upstream/scons/engine/SCons/Platform/win32.py +386 -0
  435. data/ext/v8/upstream/scons/engine/SCons/SConf.py +1038 -0
  436. data/ext/v8/upstream/scons/engine/SCons/SConsign.py +381 -0
  437. data/ext/v8/upstream/scons/engine/SCons/Scanner/C.py +132 -0
  438. data/ext/v8/upstream/scons/engine/SCons/Scanner/D.py +74 -0
  439. data/ext/v8/upstream/scons/engine/SCons/Scanner/Dir.py +111 -0
  440. data/ext/v8/upstream/scons/engine/SCons/Scanner/Fortran.py +320 -0
  441. data/ext/v8/upstream/scons/engine/SCons/Scanner/IDL.py +48 -0
  442. data/ext/v8/upstream/scons/engine/SCons/Scanner/LaTeX.py +378 -0
  443. data/ext/v8/upstream/scons/engine/SCons/Scanner/Prog.py +103 -0
  444. data/ext/v8/upstream/scons/engine/SCons/Scanner/RC.py +55 -0
  445. data/ext/v8/upstream/scons/engine/SCons/Scanner/__init__.py +415 -0
  446. data/ext/v8/upstream/scons/engine/SCons/Script/Interactive.py +386 -0
  447. data/ext/v8/upstream/scons/engine/SCons/Script/Main.py +1360 -0
  448. data/ext/v8/upstream/scons/engine/SCons/Script/SConsOptions.py +944 -0
  449. data/ext/v8/upstream/scons/engine/SCons/Script/SConscript.py +642 -0
  450. data/ext/v8/upstream/scons/engine/SCons/Script/__init__.py +414 -0
  451. data/ext/v8/upstream/scons/engine/SCons/Sig.py +63 -0
  452. data/ext/v8/upstream/scons/engine/SCons/Subst.py +911 -0
  453. data/ext/v8/upstream/scons/engine/SCons/Taskmaster.py +1030 -0
  454. data/ext/v8/upstream/scons/engine/SCons/Tool/386asm.py +61 -0
  455. data/ext/v8/upstream/scons/engine/SCons/Tool/BitKeeper.py +65 -0
  456. data/ext/v8/upstream/scons/engine/SCons/Tool/CVS.py +73 -0
  457. data/ext/v8/upstream/scons/engine/SCons/Tool/FortranCommon.py +247 -0
  458. data/ext/v8/upstream/scons/engine/SCons/Tool/JavaCommon.py +324 -0
  459. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/__init__.py +56 -0
  460. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/arch.py +61 -0
  461. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/common.py +210 -0
  462. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/netframework.py +84 -0
  463. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/sdk.py +321 -0
  464. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vc.py +367 -0
  465. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vs.py +497 -0
  466. data/ext/v8/upstream/scons/engine/SCons/Tool/Perforce.py +104 -0
  467. data/ext/v8/upstream/scons/engine/SCons/Tool/PharLapCommon.py +138 -0
  468. data/ext/v8/upstream/scons/engine/SCons/Tool/RCS.py +64 -0
  469. data/ext/v8/upstream/scons/engine/SCons/Tool/SCCS.py +64 -0
  470. data/ext/v8/upstream/scons/engine/SCons/Tool/Subversion.py +71 -0
  471. data/ext/v8/upstream/scons/engine/SCons/Tool/__init__.py +675 -0
  472. data/ext/v8/upstream/scons/engine/SCons/Tool/aixc++.py +82 -0
  473. data/ext/v8/upstream/scons/engine/SCons/Tool/aixcc.py +74 -0
  474. data/ext/v8/upstream/scons/engine/SCons/Tool/aixf77.py +80 -0
  475. data/ext/v8/upstream/scons/engine/SCons/Tool/aixlink.py +76 -0
  476. data/ext/v8/upstream/scons/engine/SCons/Tool/applelink.py +71 -0
  477. data/ext/v8/upstream/scons/engine/SCons/Tool/ar.py +63 -0
  478. data/ext/v8/upstream/scons/engine/SCons/Tool/as.py +78 -0
  479. data/ext/v8/upstream/scons/engine/SCons/Tool/bcc32.py +82 -0
  480. data/ext/v8/upstream/scons/engine/SCons/Tool/c++.py +99 -0
  481. data/ext/v8/upstream/scons/engine/SCons/Tool/cc.py +114 -0
  482. data/ext/v8/upstream/scons/engine/SCons/Tool/cvf.py +58 -0
  483. data/ext/v8/upstream/scons/engine/SCons/Tool/default.py +50 -0
  484. data/ext/v8/upstream/scons/engine/SCons/Tool/dmd.py +224 -0
  485. data/ext/v8/upstream/scons/engine/SCons/Tool/dvi.py +64 -0
  486. data/ext/v8/upstream/scons/engine/SCons/Tool/dvipdf.py +125 -0
  487. data/ext/v8/upstream/scons/engine/SCons/Tool/dvips.py +94 -0
  488. data/ext/v8/upstream/scons/engine/SCons/Tool/f77.py +62 -0
  489. data/ext/v8/upstream/scons/engine/SCons/Tool/f90.py +62 -0
  490. data/ext/v8/upstream/scons/engine/SCons/Tool/f95.py +63 -0
  491. data/ext/v8/upstream/scons/engine/SCons/Tool/filesystem.py +98 -0
  492. data/ext/v8/upstream/scons/engine/SCons/Tool/fortran.py +63 -0
  493. data/ext/v8/upstream/scons/engine/SCons/Tool/g++.py +90 -0
  494. data/ext/v8/upstream/scons/engine/SCons/Tool/g77.py +73 -0
  495. data/ext/v8/upstream/scons/engine/SCons/Tool/gas.py +53 -0
  496. data/ext/v8/upstream/scons/engine/SCons/Tool/gcc.py +80 -0
  497. data/ext/v8/upstream/scons/engine/SCons/Tool/gfortran.py +64 -0
  498. data/ext/v8/upstream/scons/engine/SCons/Tool/gnulink.py +63 -0
  499. data/ext/v8/upstream/scons/engine/SCons/Tool/gs.py +81 -0
  500. data/ext/v8/upstream/scons/engine/SCons/Tool/hpc++.py +85 -0
  501. data/ext/v8/upstream/scons/engine/SCons/Tool/hpcc.py +53 -0
  502. data/ext/v8/upstream/scons/engine/SCons/Tool/hplink.py +77 -0
  503. data/ext/v8/upstream/scons/engine/SCons/Tool/icc.py +59 -0
  504. data/ext/v8/upstream/scons/engine/SCons/Tool/icl.py +52 -0
  505. data/ext/v8/upstream/scons/engine/SCons/Tool/ifl.py +72 -0
  506. data/ext/v8/upstream/scons/engine/SCons/Tool/ifort.py +90 -0
  507. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink.py +59 -0
  508. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink32.py +60 -0
  509. data/ext/v8/upstream/scons/engine/SCons/Tool/install.py +229 -0
  510. data/ext/v8/upstream/scons/engine/SCons/Tool/intelc.py +490 -0
  511. data/ext/v8/upstream/scons/engine/SCons/Tool/ipkg.py +71 -0
  512. data/ext/v8/upstream/scons/engine/SCons/Tool/jar.py +110 -0
  513. data/ext/v8/upstream/scons/engine/SCons/Tool/javac.py +234 -0
  514. data/ext/v8/upstream/scons/engine/SCons/Tool/javah.py +138 -0
  515. data/ext/v8/upstream/scons/engine/SCons/Tool/latex.py +79 -0
  516. data/ext/v8/upstream/scons/engine/SCons/Tool/lex.py +99 -0
  517. data/ext/v8/upstream/scons/engine/SCons/Tool/link.py +121 -0
  518. data/ext/v8/upstream/scons/engine/SCons/Tool/linkloc.py +112 -0
  519. data/ext/v8/upstream/scons/engine/SCons/Tool/m4.py +63 -0
  520. data/ext/v8/upstream/scons/engine/SCons/Tool/masm.py +77 -0
  521. data/ext/v8/upstream/scons/engine/SCons/Tool/midl.py +90 -0
  522. data/ext/v8/upstream/scons/engine/SCons/Tool/mingw.py +159 -0
  523. data/ext/v8/upstream/scons/engine/SCons/Tool/mslib.py +64 -0
  524. data/ext/v8/upstream/scons/engine/SCons/Tool/mslink.py +266 -0
  525. data/ext/v8/upstream/scons/engine/SCons/Tool/mssdk.py +50 -0
  526. data/ext/v8/upstream/scons/engine/SCons/Tool/msvc.py +269 -0
  527. data/ext/v8/upstream/scons/engine/SCons/Tool/msvs.py +1439 -0
  528. data/ext/v8/upstream/scons/engine/SCons/Tool/mwcc.py +208 -0
  529. data/ext/v8/upstream/scons/engine/SCons/Tool/mwld.py +107 -0
  530. data/ext/v8/upstream/scons/engine/SCons/Tool/nasm.py +72 -0
  531. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/__init__.py +314 -0
  532. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/ipk.py +185 -0
  533. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/msi.py +526 -0
  534. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/rpm.py +367 -0
  535. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_tarbz2.py +43 -0
  536. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_targz.py +43 -0
  537. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_zip.py +43 -0
  538. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/tarbz2.py +44 -0
  539. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/targz.py +44 -0
  540. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/zip.py +44 -0
  541. data/ext/v8/upstream/scons/engine/SCons/Tool/pdf.py +78 -0
  542. data/ext/v8/upstream/scons/engine/SCons/Tool/pdflatex.py +83 -0
  543. data/ext/v8/upstream/scons/engine/SCons/Tool/pdftex.py +108 -0
  544. data/ext/v8/upstream/scons/engine/SCons/Tool/qt.py +336 -0
  545. data/ext/v8/upstream/scons/engine/SCons/Tool/rmic.py +121 -0
  546. data/ext/v8/upstream/scons/engine/SCons/Tool/rpcgen.py +70 -0
  547. data/ext/v8/upstream/scons/engine/SCons/Tool/rpm.py +132 -0
  548. data/ext/v8/upstream/scons/engine/SCons/Tool/sgiar.py +68 -0
  549. data/ext/v8/upstream/scons/engine/SCons/Tool/sgic++.py +58 -0
  550. data/ext/v8/upstream/scons/engine/SCons/Tool/sgicc.py +53 -0
  551. data/ext/v8/upstream/scons/engine/SCons/Tool/sgilink.py +63 -0
  552. data/ext/v8/upstream/scons/engine/SCons/Tool/sunar.py +67 -0
  553. data/ext/v8/upstream/scons/engine/SCons/Tool/sunc++.py +142 -0
  554. data/ext/v8/upstream/scons/engine/SCons/Tool/suncc.py +58 -0
  555. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf77.py +63 -0
  556. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf90.py +64 -0
  557. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf95.py +64 -0
  558. data/ext/v8/upstream/scons/engine/SCons/Tool/sunlink.py +77 -0
  559. data/ext/v8/upstream/scons/engine/SCons/Tool/swig.py +186 -0
  560. data/ext/v8/upstream/scons/engine/SCons/Tool/tar.py +73 -0
  561. data/ext/v8/upstream/scons/engine/SCons/Tool/tex.py +805 -0
  562. data/ext/v8/upstream/scons/engine/SCons/Tool/textfile.py +175 -0
  563. data/ext/v8/upstream/scons/engine/SCons/Tool/tlib.py +53 -0
  564. data/ext/v8/upstream/scons/engine/SCons/Tool/wix.py +100 -0
  565. data/ext/v8/upstream/scons/engine/SCons/Tool/yacc.py +131 -0
  566. data/ext/v8/upstream/scons/engine/SCons/Tool/zip.py +100 -0
  567. data/ext/v8/upstream/scons/engine/SCons/Util.py +1645 -0
  568. data/ext/v8/upstream/scons/engine/SCons/Variables/BoolVariable.py +91 -0
  569. data/ext/v8/upstream/scons/engine/SCons/Variables/EnumVariable.py +107 -0
  570. data/ext/v8/upstream/scons/engine/SCons/Variables/ListVariable.py +139 -0
  571. data/ext/v8/upstream/scons/engine/SCons/Variables/PackageVariable.py +109 -0
  572. data/ext/v8/upstream/scons/engine/SCons/Variables/PathVariable.py +147 -0
  573. data/ext/v8/upstream/scons/engine/SCons/Variables/__init__.py +317 -0
  574. data/ext/v8/upstream/scons/engine/SCons/Warnings.py +228 -0
  575. data/ext/v8/upstream/scons/engine/SCons/__init__.py +49 -0
  576. data/ext/v8/upstream/scons/engine/SCons/compat/__init__.py +302 -0
  577. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_UserString.py +98 -0
  578. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_hashlib.py +91 -0
  579. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_itertools.py +124 -0
  580. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_optparse.py +1725 -0
  581. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets.py +583 -0
  582. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets15.py +176 -0
  583. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_shlex.py +325 -0
  584. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_subprocess.py +1296 -0
  585. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_textwrap.py +382 -0
  586. data/ext/v8/upstream/scons/engine/SCons/compat/builtins.py +187 -0
  587. data/ext/v8/upstream/scons/engine/SCons/cpp.py +598 -0
  588. data/ext/v8/upstream/scons/engine/SCons/dblite.py +248 -0
  589. data/ext/v8/upstream/scons/engine/SCons/exitfuncs.py +77 -0
  590. data/ext/v8/upstream/scons/os_spawnv_fix.diff +83 -0
  591. data/ext/v8/upstream/scons/scons-time.1 +1017 -0
  592. data/ext/v8/upstream/scons/scons.1 +15179 -0
  593. data/ext/v8/upstream/scons/sconsign.1 +208 -0
  594. data/ext/v8/upstream/scons/script/scons +184 -0
  595. data/ext/v8/upstream/scons/script/scons-time +1529 -0
  596. data/ext/v8/upstream/scons/script/scons.bat +31 -0
  597. data/ext/v8/upstream/scons/script/sconsign +508 -0
  598. data/ext/v8/upstream/scons/setup.cfg +6 -0
  599. data/ext/v8/upstream/scons/setup.py +427 -0
  600. data/ext/v8/v8.cpp +89 -0
  601. data/ext/v8/v8_cxt.cpp +92 -0
  602. data/ext/v8/v8_cxt.h +20 -0
  603. data/ext/v8/v8_func.cpp +10 -0
  604. data/ext/v8/v8_func.h +11 -0
  605. data/ext/v8/v8_msg.cpp +54 -0
  606. data/ext/v8/v8_msg.h +18 -0
  607. data/ext/v8/v8_obj.cpp +52 -0
  608. data/ext/v8/v8_obj.h +13 -0
  609. data/ext/v8/v8_ref.cpp +26 -0
  610. data/ext/v8/v8_ref.h +31 -0
  611. data/ext/v8/v8_script.cpp +20 -0
  612. data/ext/v8/v8_script.h +8 -0
  613. data/ext/v8/v8_standalone.cpp +69 -0
  614. data/ext/v8/v8_standalone.h +31 -0
  615. data/ext/v8/v8_str.cpp +17 -0
  616. data/ext/v8/v8_str.h +9 -0
  617. data/ext/v8/v8_template.cpp +53 -0
  618. data/ext/v8/v8_template.h +13 -0
  619. data/lib/v8.rb +10 -0
  620. data/lib/v8/context.rb +101 -0
  621. data/lib/v8/object.rb +38 -0
  622. data/lib/v8/to.rb +33 -0
  623. data/lib/v8/v8.so +0 -0
  624. data/script/console +10 -0
  625. data/script/destroy +14 -0
  626. data/script/generate +14 -0
  627. data/spec/ext/cxt_spec.rb +25 -0
  628. data/spec/ext/obj_spec.rb +13 -0
  629. data/spec/redjs/jsapi_spec.rb +405 -0
  630. data/spec/redjs/tap.rb +8 -0
  631. data/spec/redjs_helper.rb +3 -0
  632. data/spec/spec.opts +1 -0
  633. data/spec/spec_helper.rb +14 -0
  634. data/spec/v8/to_spec.rb +15 -0
  635. data/tasks/rspec.rake +21 -0
  636. data/therubyracer.gemspec +680 -0
  637. metadata +697 -0
@@ -0,0 +1,208 @@
1
+ .\" Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
2
+ .\"
3
+ .\" Permission is hereby granted, free of charge, to any person obtaining
4
+ .\" a copy of this software and associated documentation files (the
5
+ .\" "Software"), to deal in the Software without restriction, including
6
+ .\" without limitation the rights to use, copy, modify, merge, publish,
7
+ .\" distribute, sublicense, and/or sell copies of the Software, and to
8
+ .\" permit persons to whom the Software is furnished to do so, subject to
9
+ .\" the following conditions:
10
+ .\"
11
+ .\" The above copyright notice and this permission notice shall be included
12
+ .\" in all copies or substantial portions of the Software.
13
+ .\"
14
+ .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
15
+ .\" KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
16
+ .\" WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ .\" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ .\" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ .\" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ .\" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+ .\"
22
+ .\" doc/man/sconsign.1 4629 2010/01/17 22:23:21 scons
23
+ .\"
24
+ .\" ES - Example Start - indents and turns off line fill
25
+ .de ES
26
+ .RS
27
+ .nf
28
+ ..
29
+ .\" EE - Example End - ends indent and turns line fill back on
30
+ .de EE
31
+ .RE
32
+ .fi
33
+ ..
34
+ .TH SCONSIGN 1 "January 2010"
35
+ .SH NAME
36
+ sconsign \- print SCons .sconsign file information
37
+ .SH SYNOPSIS
38
+ .B sconsign
39
+ [
40
+ .IR options ...
41
+ ]
42
+ .IR file
43
+ [ ... ]
44
+ .SH DESCRIPTION
45
+
46
+ The
47
+ .B sconsign
48
+ command
49
+ displays the contents of one or more
50
+ .B .sconsign
51
+ files specified by the user.
52
+
53
+ By default,
54
+ .B sconsign
55
+ dumps the entire contents of the
56
+ specified file(s).
57
+ Each entry is printed in the following format:
58
+
59
+ file: signature timestamp length
60
+ implicit_dependency_1: signature timestamp length
61
+ implicit_dependency_2: signature timestamp length
62
+ action_signature [action string]
63
+
64
+ .B None
65
+ is printed
66
+ in place of any missing timestamp, bsig, or csig
67
+ values for
68
+ any entry
69
+ or any of its dependencies.
70
+ If the entry has no implicit dependencies,
71
+ or no build action,
72
+ the lines are simply omitted.
73
+
74
+ By default,
75
+ .B sconsign
76
+ assumes that any
77
+ .I file
78
+ arguments that end with a
79
+ .B .dbm
80
+ suffix contains
81
+ signature entries for
82
+ more than one directory
83
+ (that is,
84
+ was specified by the
85
+ .B SConsignFile ()
86
+ function).
87
+ Any
88
+ .I file
89
+ argument that does not end in
90
+ .B .dbm
91
+ is assumed to be a traditional
92
+ .B .sconsign
93
+ file containing the signature entries
94
+ for a single directory.
95
+ An explicit format
96
+ may be specified using the
97
+ .B -f
98
+ or
99
+ .B --file=
100
+ options.
101
+
102
+ .SH OPTIONS
103
+
104
+ Various options control what information is printed
105
+ and the format:
106
+
107
+ .TP
108
+ -a, --act, --action
109
+ Prints the build action information
110
+ for all entries or the specified entries.
111
+
112
+ .TP
113
+ -c, --csig
114
+ Prints the content signature (csig) information
115
+ for all entries or the specified entries.
116
+
117
+ .TP
118
+ -d DIRECTORY, --dir=DIRECTORY
119
+ When the signatures are being
120
+ read from a
121
+ .B .dbm
122
+ file, or the
123
+ .B -f dbm
124
+ or
125
+ .B --format=dbm
126
+ options are used,
127
+ prints information about
128
+ only the signatures
129
+ for entries in the specified
130
+ .IR DIRECTORY .
131
+
132
+ .TP
133
+ -e ENTRY, --entry=ENTRY
134
+ Prints information about only the specified
135
+ .IR ENTRY .
136
+ Multiple -e options may be used,
137
+ in which case information about each
138
+ .I ENTRY
139
+ is printed in the order in which the
140
+ options are specified on the command line.
141
+
142
+ .TP
143
+ -f FORMAT, --format=FORMAT
144
+ The file(s) to be printed
145
+ are in the specified
146
+ .IR FORMAT .
147
+ Legal values are
148
+ .B dbm
149
+ (the DBM format used
150
+ when the
151
+ .BR SConsignFile ()
152
+ function is used)
153
+ or
154
+ .B sconsign
155
+ (the default format
156
+ used for an individual
157
+ .B .sconsign
158
+ file in each directory).
159
+
160
+ .TP
161
+ -h, --help
162
+ Prints a help message and exits.
163
+
164
+ .TP
165
+ -i, --implicit
166
+ Prints the list of cached implicit dependencies
167
+ for all entries or the the specified entries.
168
+
169
+ .TP
170
+ --raw
171
+ Prints a pretty-printed representation
172
+ of the raw Python dictionary that holds
173
+ build information about individual entry
174
+ (both the entry itself or its implicit dependencies).
175
+ An entry's build action is still printed in its usual format.
176
+
177
+ .TP
178
+ -r, --readable
179
+ Prints timestamps in a human-readable string,
180
+ enclosed in single quotes.
181
+
182
+ .TP
183
+ -t, --timestamp
184
+ Prints the timestamp information
185
+ for all entries or the specified entries.
186
+
187
+ .TP
188
+ -v, --verbose
189
+ Prints labels identifying each field being printed.
190
+
191
+ .SH ENVIRONMENT
192
+
193
+ .IP SCONS_LIB_DIR
194
+ Specifies the directory that contains the SCons Python module directory
195
+ (e.g. /home/aroach/scons-src-0.01/src/engine).
196
+ on the command line.
197
+
198
+ .SH "SEE ALSO"
199
+ .BR scons ,
200
+ .B scons
201
+ User Manual,
202
+ .B scons
203
+ Design Document,
204
+ .B scons
205
+ source code.
206
+
207
+ .SH AUTHORS
208
+ Steven Knight <knight at baldmt dot com>
@@ -0,0 +1,184 @@
1
+ #! /usr/bin/env python
2
+ #
3
+ # SCons - a Software Constructor
4
+ #
5
+ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining
8
+ # a copy of this software and associated documentation files (the
9
+ # "Software"), to deal in the Software without restriction, including
10
+ # without limitation the rights to use, copy, modify, merge, publish,
11
+ # distribute, sublicense, and/or sell copies of the Software, and to
12
+ # permit persons to whom the Software is furnished to do so, subject to
13
+ # the following conditions:
14
+ #
15
+ # The above copyright notice and this permission notice shall be included
16
+ # in all copies or substantial portions of the Software.
17
+ #
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
19
+ # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20
+ # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+ #
26
+
27
+ __revision__ = "src/script/scons.py 4629 2010/01/17 22:23:21 scons"
28
+
29
+ __version__ = "1.2.0.d20100117"
30
+
31
+ __build__ = "r4629"
32
+
33
+ __buildsys__ = "scons-dev"
34
+
35
+ __date__ = "2010/01/17 22:23:21"
36
+
37
+ __developer__ = "scons"
38
+
39
+ import os
40
+ import os.path
41
+ import sys
42
+
43
+ ##############################################################################
44
+ # BEGIN STANDARD SCons SCRIPT HEADER
45
+ #
46
+ # This is the cut-and-paste logic so that a self-contained script can
47
+ # interoperate correctly with different SCons versions and installation
48
+ # locations for the engine. If you modify anything in this section, you
49
+ # should also change other scripts that use this same header.
50
+ ##############################################################################
51
+
52
+ # Strip the script directory from sys.path() so on case-insensitive
53
+ # (WIN32) systems Python doesn't think that the "scons" script is the
54
+ # "SCons" package. Replace it with our own library directories
55
+ # (version-specific first, in case they installed by hand there,
56
+ # followed by generic) so we pick up the right version of the build
57
+ # engine modules if they're in either directory.
58
+
59
+
60
+ # Check to see if the python version is > 3.0 which is currently unsupported
61
+ # If so exit with error message
62
+ try:
63
+ if sys.version_info >= (3,0,0):
64
+ msg = "scons: *** SCons version %s does not run under Python version %s.\n"
65
+ sys.stderr.write(msg % (__version__, sys.version.split()[0]))
66
+ sys.exit(1)
67
+ except AttributeError:
68
+ # Pre-1.6 Python has no sys.version_info
69
+ # No need to check version as we then know the version is < 3.0.0 and supported
70
+ pass
71
+
72
+ script_dir = sys.path[0]
73
+
74
+ if script_dir in sys.path:
75
+ sys.path.remove(script_dir)
76
+
77
+ libs = []
78
+
79
+ if os.environ.has_key("SCONS_LIB_DIR"):
80
+ libs.append(os.environ["SCONS_LIB_DIR"])
81
+
82
+ local_version = 'scons-local-' + __version__
83
+ local = 'scons-local'
84
+ if script_dir:
85
+ local_version = os.path.join(script_dir, local_version)
86
+ local = os.path.join(script_dir, local)
87
+ libs.append(os.path.abspath(local_version))
88
+ libs.append(os.path.abspath(local))
89
+
90
+ scons_version = 'scons-%s' % __version__
91
+
92
+ prefs = []
93
+
94
+ if sys.platform == 'win32':
95
+ # sys.prefix is (likely) C:\Python*;
96
+ # check only C:\Python*.
97
+ prefs.append(sys.prefix)
98
+ prefs.append(os.path.join(sys.prefix, 'Lib', 'site-packages'))
99
+ else:
100
+ # On other (POSIX) platforms, things are more complicated due to
101
+ # the variety of path names and library locations. Try to be smart
102
+ # about it.
103
+ if script_dir == 'bin':
104
+ # script_dir is `pwd`/bin;
105
+ # check `pwd`/lib/scons*.
106
+ prefs.append(os.getcwd())
107
+ else:
108
+ if script_dir == '.' or script_dir == '':
109
+ script_dir = os.getcwd()
110
+ head, tail = os.path.split(script_dir)
111
+ if tail == "bin":
112
+ # script_dir is /foo/bin;
113
+ # check /foo/lib/scons*.
114
+ prefs.append(head)
115
+
116
+ head, tail = os.path.split(sys.prefix)
117
+ if tail == "usr":
118
+ # sys.prefix is /foo/usr;
119
+ # check /foo/usr/lib/scons* first,
120
+ # then /foo/usr/local/lib/scons*.
121
+ prefs.append(sys.prefix)
122
+ prefs.append(os.path.join(sys.prefix, "local"))
123
+ elif tail == "local":
124
+ h, t = os.path.split(head)
125
+ if t == "usr":
126
+ # sys.prefix is /foo/usr/local;
127
+ # check /foo/usr/local/lib/scons* first,
128
+ # then /foo/usr/lib/scons*.
129
+ prefs.append(sys.prefix)
130
+ prefs.append(head)
131
+ else:
132
+ # sys.prefix is /foo/local;
133
+ # check only /foo/local/lib/scons*.
134
+ prefs.append(sys.prefix)
135
+ else:
136
+ # sys.prefix is /foo (ends in neither /usr or /local);
137
+ # check only /foo/lib/scons*.
138
+ prefs.append(sys.prefix)
139
+
140
+ temp = map(lambda x: os.path.join(x, 'lib'), prefs)
141
+ temp.extend(map(lambda x: os.path.join(x,
142
+ 'lib',
143
+ 'python' + sys.version[:3],
144
+ 'site-packages'),
145
+ prefs))
146
+ prefs = temp
147
+
148
+ # Add the parent directory of the current python's library to the
149
+ # preferences. On SuSE-91/AMD64, for example, this is /usr/lib64,
150
+ # not /usr/lib.
151
+ try:
152
+ libpath = os.__file__
153
+ except AttributeError:
154
+ pass
155
+ else:
156
+ # Split /usr/libfoo/python*/os.py to /usr/libfoo/python*.
157
+ libpath, tail = os.path.split(libpath)
158
+ # Split /usr/libfoo/python* to /usr/libfoo
159
+ libpath, tail = os.path.split(libpath)
160
+ # Check /usr/libfoo/scons*.
161
+ prefs.append(libpath)
162
+
163
+ # Look first for 'scons-__version__' in all of our preference libs,
164
+ # then for 'scons'.
165
+ libs.extend(map(lambda x: os.path.join(x, scons_version), prefs))
166
+ libs.extend(map(lambda x: os.path.join(x, 'scons'), prefs))
167
+
168
+ sys.path = libs + sys.path
169
+
170
+ ##############################################################################
171
+ # END STANDARD SCons SCRIPT HEADER
172
+ ##############################################################################
173
+
174
+ if __name__ == "__main__":
175
+ import SCons.Script
176
+ # this does all the work, and calls sys.exit
177
+ # with the proper exit status when done.
178
+ SCons.Script.main()
179
+
180
+ # Local Variables:
181
+ # tab-width:4
182
+ # indent-tabs-mode:nil
183
+ # End:
184
+ # vim: set expandtab tabstop=4 shiftwidth=4:
@@ -0,0 +1,1529 @@
1
+ #!/usr/bin/env python
2
+ #
3
+ # scons-time - run SCons timings and collect statistics
4
+ #
5
+ # A script for running a configuration through SCons with a standard
6
+ # set of invocations to collect timing and memory statistics and to
7
+ # capture the results in a consistent set of output files for display
8
+ # and analysis.
9
+ #
10
+
11
+ #
12
+ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
13
+ #
14
+ # Permission is hereby granted, free of charge, to any person obtaining
15
+ # a copy of this software and associated documentation files (the
16
+ # "Software"), to deal in the Software without restriction, including
17
+ # without limitation the rights to use, copy, modify, merge, publish,
18
+ # distribute, sublicense, and/or sell copies of the Software, and to
19
+ # permit persons to whom the Software is furnished to do so, subject to
20
+ # the following conditions:
21
+ #
22
+ # The above copyright notice and this permission notice shall be included
23
+ # in all copies or substantial portions of the Software.
24
+ #
25
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
26
+ # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
27
+ # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32
+ #
33
+
34
+ from __future__ import nested_scopes
35
+
36
+ __revision__ = "src/script/scons-time.py 4629 2010/01/17 22:23:21 scons"
37
+
38
+ import getopt
39
+ import glob
40
+ import os
41
+ import os.path
42
+ import re
43
+ import shutil
44
+ import string
45
+ import sys
46
+ import tempfile
47
+ import time
48
+
49
+ try:
50
+ False
51
+ except NameError:
52
+ # Pre-2.2 Python has no False keyword.
53
+ import __builtin__
54
+ __builtin__.False = not 1
55
+
56
+ try:
57
+ True
58
+ except NameError:
59
+ # Pre-2.2 Python has no True keyword.
60
+ import __builtin__
61
+ __builtin__.True = not 0
62
+
63
+ def make_temp_file(**kw):
64
+ try:
65
+ result = tempfile.mktemp(**kw)
66
+ try:
67
+ result = os.path.realpath(result)
68
+ except AttributeError:
69
+ # Python 2.1 has no os.path.realpath() method.
70
+ pass
71
+ except TypeError:
72
+ try:
73
+ save_template = tempfile.template
74
+ prefix = kw['prefix']
75
+ del kw['prefix']
76
+ tempfile.template = prefix
77
+ result = tempfile.mktemp(**kw)
78
+ finally:
79
+ tempfile.template = save_template
80
+ return result
81
+
82
+ def HACK_for_exec(cmd, *args):
83
+ '''
84
+ For some reason, Python won't allow an exec() within a function
85
+ that also declares an internal function (including lambda functions).
86
+ This function is a hack that calls exec() in a function with no
87
+ internal functions.
88
+ '''
89
+ if not args: exec(cmd)
90
+ elif len(args) == 1: exec cmd in args[0]
91
+ else: exec cmd in args[0], args[1]
92
+
93
+ class Plotter:
94
+ def increment_size(self, largest):
95
+ """
96
+ Return the size of each horizontal increment line for a specified
97
+ maximum value. This returns a value that will provide somewhere
98
+ between 5 and 9 horizontal lines on the graph, on some set of
99
+ boundaries that are multiples of 10/100/1000/etc.
100
+ """
101
+ i = largest / 5
102
+ if not i:
103
+ return largest
104
+ multiplier = 1
105
+ while i >= 10:
106
+ i = i / 10
107
+ multiplier = multiplier * 10
108
+ return i * multiplier
109
+
110
+ def max_graph_value(self, largest):
111
+ # Round up to next integer.
112
+ largest = int(largest) + 1
113
+ increment = self.increment_size(largest)
114
+ return ((largest + increment - 1) / increment) * increment
115
+
116
+ class Line:
117
+ def __init__(self, points, type, title, label, comment, fmt="%s %s"):
118
+ self.points = points
119
+ self.type = type
120
+ self.title = title
121
+ self.label = label
122
+ self.comment = comment
123
+ self.fmt = fmt
124
+
125
+ def print_label(self, inx, x, y):
126
+ if self.label:
127
+ print 'set label %s "%s" at %s,%s right' % (inx, self.label, x, y)
128
+
129
+ def plot_string(self):
130
+ if self.title:
131
+ title_string = 'title "%s"' % self.title
132
+ else:
133
+ title_string = 'notitle'
134
+ return "'-' %s with lines lt %s" % (title_string, self.type)
135
+
136
+ def print_points(self, fmt=None):
137
+ if fmt is None:
138
+ fmt = self.fmt
139
+ if self.comment:
140
+ print '# %s' % self.comment
141
+ for x, y in self.points:
142
+ # If y is None, it usually represents some kind of break
143
+ # in the line's index number. We might want to represent
144
+ # this some way rather than just drawing the line straight
145
+ # between the two points on either side.
146
+ if not y is None:
147
+ print fmt % (x, y)
148
+ print 'e'
149
+
150
+ def get_x_values(self):
151
+ return [ p[0] for p in self.points ]
152
+
153
+ def get_y_values(self):
154
+ return [ p[1] for p in self.points ]
155
+
156
+ class Gnuplotter(Plotter):
157
+
158
+ def __init__(self, title, key_location):
159
+ self.lines = []
160
+ self.title = title
161
+ self.key_location = key_location
162
+
163
+ def line(self, points, type, title=None, label=None, comment=None, fmt='%s %s'):
164
+ if points:
165
+ line = Line(points, type, title, label, comment, fmt)
166
+ self.lines.append(line)
167
+
168
+ def plot_string(self, line):
169
+ return line.plot_string()
170
+
171
+ def vertical_bar(self, x, type, label, comment):
172
+ if self.get_min_x() <= x and x <= self.get_max_x():
173
+ points = [(x, 0), (x, self.max_graph_value(self.get_max_y()))]
174
+ self.line(points, type, label, comment)
175
+
176
+ def get_all_x_values(self):
177
+ result = []
178
+ for line in self.lines:
179
+ result.extend(line.get_x_values())
180
+ return filter(lambda r: not r is None, result)
181
+
182
+ def get_all_y_values(self):
183
+ result = []
184
+ for line in self.lines:
185
+ result.extend(line.get_y_values())
186
+ return filter(lambda r: not r is None, result)
187
+
188
+ def get_min_x(self):
189
+ try:
190
+ return self.min_x
191
+ except AttributeError:
192
+ try:
193
+ self.min_x = min(self.get_all_x_values())
194
+ except ValueError:
195
+ self.min_x = 0
196
+ return self.min_x
197
+
198
+ def get_max_x(self):
199
+ try:
200
+ return self.max_x
201
+ except AttributeError:
202
+ try:
203
+ self.max_x = max(self.get_all_x_values())
204
+ except ValueError:
205
+ self.max_x = 0
206
+ return self.max_x
207
+
208
+ def get_min_y(self):
209
+ try:
210
+ return self.min_y
211
+ except AttributeError:
212
+ try:
213
+ self.min_y = min(self.get_all_y_values())
214
+ except ValueError:
215
+ self.min_y = 0
216
+ return self.min_y
217
+
218
+ def get_max_y(self):
219
+ try:
220
+ return self.max_y
221
+ except AttributeError:
222
+ try:
223
+ self.max_y = max(self.get_all_y_values())
224
+ except ValueError:
225
+ self.max_y = 0
226
+ return self.max_y
227
+
228
+ def draw(self):
229
+
230
+ if not self.lines:
231
+ return
232
+
233
+ if self.title:
234
+ print 'set title "%s"' % self.title
235
+ print 'set key %s' % self.key_location
236
+
237
+ min_y = self.get_min_y()
238
+ max_y = self.max_graph_value(self.get_max_y())
239
+ range = max_y - min_y
240
+ incr = range / 10.0
241
+ start = min_y + (max_y / 2.0) + (2.0 * incr)
242
+ position = [ start - (i * incr) for i in xrange(5) ]
243
+
244
+ inx = 1
245
+ for line in self.lines:
246
+ line.print_label(inx, line.points[0][0]-1,
247
+ position[(inx-1) % len(position)])
248
+ inx += 1
249
+
250
+ plot_strings = [ self.plot_string(l) for l in self.lines ]
251
+ print 'plot ' + ', \\\n '.join(plot_strings)
252
+
253
+ for line in self.lines:
254
+ line.print_points()
255
+
256
+
257
+
258
+ def untar(fname):
259
+ import tarfile
260
+ tar = tarfile.open(name=fname, mode='r')
261
+ for tarinfo in tar:
262
+ tar.extract(tarinfo)
263
+ tar.close()
264
+
265
+ def unzip(fname):
266
+ import zipfile
267
+ zf = zipfile.ZipFile(fname, 'r')
268
+ for name in zf.namelist():
269
+ dir = os.path.dirname(name)
270
+ try:
271
+ os.makedirs(dir)
272
+ except:
273
+ pass
274
+ open(name, 'w').write(zf.read(name))
275
+
276
+ def read_tree(dir):
277
+ def read_files(arg, dirname, fnames):
278
+ for fn in fnames:
279
+ fn = os.path.join(dirname, fn)
280
+ if os.path.isfile(fn):
281
+ open(fn, 'rb').read()
282
+ os.path.walk('.', read_files, None)
283
+
284
+ def redirect_to_file(command, log):
285
+ return '%s > %s 2>&1' % (command, log)
286
+
287
+ def tee_to_file(command, log):
288
+ return '%s 2>&1 | tee %s' % (command, log)
289
+
290
+
291
+
292
+ class SConsTimer:
293
+ """
294
+ Usage: scons-time SUBCOMMAND [ARGUMENTS]
295
+ Type "scons-time help SUBCOMMAND" for help on a specific subcommand.
296
+
297
+ Available subcommands:
298
+ func Extract test-run data for a function
299
+ help Provides help
300
+ mem Extract --debug=memory data from test runs
301
+ obj Extract --debug=count data from test runs
302
+ time Extract --debug=time data from test runs
303
+ run Runs a test configuration
304
+ """
305
+
306
+ name = 'scons-time'
307
+ name_spaces = ' '*len(name)
308
+
309
+ def makedict(**kw):
310
+ return kw
311
+
312
+ default_settings = makedict(
313
+ aegis = 'aegis',
314
+ aegis_project = None,
315
+ chdir = None,
316
+ config_file = None,
317
+ initial_commands = [],
318
+ key_location = 'bottom left',
319
+ orig_cwd = os.getcwd(),
320
+ outdir = None,
321
+ prefix = '',
322
+ python = '"%s"' % sys.executable,
323
+ redirect = redirect_to_file,
324
+ scons = None,
325
+ scons_flags = '--debug=count --debug=memory --debug=time --debug=memoizer',
326
+ scons_lib_dir = None,
327
+ scons_wrapper = None,
328
+ startup_targets = '--help',
329
+ subdir = None,
330
+ subversion_url = None,
331
+ svn = 'svn',
332
+ svn_co_flag = '-q',
333
+ tar = 'tar',
334
+ targets = '',
335
+ targets0 = None,
336
+ targets1 = None,
337
+ targets2 = None,
338
+ title = None,
339
+ unzip = 'unzip',
340
+ verbose = False,
341
+ vertical_bars = [],
342
+
343
+ unpack_map = {
344
+ '.tar.gz' : (untar, '%(tar)s xzf %%s'),
345
+ '.tgz' : (untar, '%(tar)s xzf %%s'),
346
+ '.tar' : (untar, '%(tar)s xf %%s'),
347
+ '.zip' : (unzip, '%(unzip)s %%s'),
348
+ },
349
+ )
350
+
351
+ run_titles = [
352
+ 'Startup',
353
+ 'Full build',
354
+ 'Up-to-date build',
355
+ ]
356
+
357
+ run_commands = [
358
+ '%(python)s %(scons_wrapper)s %(scons_flags)s --profile=%(prof0)s %(targets0)s',
359
+ '%(python)s %(scons_wrapper)s %(scons_flags)s --profile=%(prof1)s %(targets1)s',
360
+ '%(python)s %(scons_wrapper)s %(scons_flags)s --profile=%(prof2)s %(targets2)s',
361
+ ]
362
+
363
+ stages = [
364
+ 'pre-read',
365
+ 'post-read',
366
+ 'pre-build',
367
+ 'post-build',
368
+ ]
369
+
370
+ stage_strings = {
371
+ 'pre-read' : 'Memory before reading SConscript files:',
372
+ 'post-read' : 'Memory after reading SConscript files:',
373
+ 'pre-build' : 'Memory before building targets:',
374
+ 'post-build' : 'Memory after building targets:',
375
+ }
376
+
377
+ memory_string_all = 'Memory '
378
+
379
+ default_stage = stages[-1]
380
+
381
+ time_strings = {
382
+ 'total' : 'Total build time',
383
+ 'SConscripts' : 'Total SConscript file execution time',
384
+ 'SCons' : 'Total SCons execution time',
385
+ 'commands' : 'Total command execution time',
386
+ }
387
+
388
+ time_string_all = 'Total .* time'
389
+
390
+ #
391
+
392
+ def __init__(self):
393
+ self.__dict__.update(self.default_settings)
394
+
395
+ # Functions for displaying and executing commands.
396
+
397
+ def subst(self, x, dictionary):
398
+ try:
399
+ return x % dictionary
400
+ except TypeError:
401
+ # x isn't a string (it's probably a Python function),
402
+ # so just return it.
403
+ return x
404
+
405
+ def subst_variables(self, command, dictionary):
406
+ """
407
+ Substitutes (via the format operator) the values in the specified
408
+ dictionary into the specified command.
409
+
410
+ The command can be an (action, string) tuple. In all cases, we
411
+ perform substitution on strings and don't worry if something isn't
412
+ a string. (It's probably a Python function to be executed.)
413
+ """
414
+ try:
415
+ command + ''
416
+ except TypeError:
417
+ action = command[0]
418
+ string = command[1]
419
+ args = command[2:]
420
+ else:
421
+ action = command
422
+ string = action
423
+ args = (())
424
+ action = self.subst(action, dictionary)
425
+ string = self.subst(string, dictionary)
426
+ return (action, string, args)
427
+
428
+ def _do_not_display(self, msg, *args):
429
+ pass
430
+
431
+ def display(self, msg, *args):
432
+ """
433
+ Displays the specified message.
434
+
435
+ Each message is prepended with a standard prefix of our name
436
+ plus the time.
437
+ """
438
+ if callable(msg):
439
+ msg = msg(*args)
440
+ else:
441
+ msg = msg % args
442
+ if msg is None:
443
+ return
444
+ fmt = '%s[%s]: %s\n'
445
+ sys.stdout.write(fmt % (self.name, time.strftime('%H:%M:%S'), msg))
446
+
447
+ def _do_not_execute(self, action, *args):
448
+ pass
449
+
450
+ def execute(self, action, *args):
451
+ """
452
+ Executes the specified action.
453
+
454
+ The action is called if it's a callable Python function, and
455
+ otherwise passed to os.system().
456
+ """
457
+ if callable(action):
458
+ action(*args)
459
+ else:
460
+ os.system(action % args)
461
+
462
+ def run_command_list(self, commands, dict):
463
+ """
464
+ Executes a list of commands, substituting values from the
465
+ specified dictionary.
466
+ """
467
+ commands = [ self.subst_variables(c, dict) for c in commands ]
468
+ for action, string, args in commands:
469
+ self.display(string, *args)
470
+ sys.stdout.flush()
471
+ status = self.execute(action, *args)
472
+ if status:
473
+ sys.exit(status)
474
+
475
+ def log_display(self, command, log):
476
+ command = self.subst(command, self.__dict__)
477
+ if log:
478
+ command = self.redirect(command, log)
479
+ return command
480
+
481
+ def log_execute(self, command, log):
482
+ command = self.subst(command, self.__dict__)
483
+ output = os.popen(command).read()
484
+ if self.verbose:
485
+ sys.stdout.write(output)
486
+ open(log, 'wb').write(output)
487
+
488
+ #
489
+
490
+ def archive_splitext(self, path):
491
+ """
492
+ Splits an archive name into a filename base and extension.
493
+
494
+ This is like os.path.splitext() (which it calls) except that it
495
+ also looks for '.tar.gz' and treats it as an atomic extensions.
496
+ """
497
+ if path.endswith('.tar.gz'):
498
+ return path[:-7], path[-7:]
499
+ else:
500
+ return os.path.splitext(path)
501
+
502
+ def args_to_files(self, args, tail=None):
503
+ """
504
+ Takes a list of arguments, expands any glob patterns, and
505
+ returns the last "tail" files from the list.
506
+ """
507
+ files = []
508
+ for a in args:
509
+ g = glob.glob(a)
510
+ g.sort()
511
+ files.extend(g)
512
+
513
+ if tail:
514
+ files = files[-tail:]
515
+
516
+ return files
517
+
518
+ def ascii_table(self, files, columns,
519
+ line_function, file_function=lambda x: x,
520
+ *args, **kw):
521
+
522
+ header_fmt = ' '.join(['%12s'] * len(columns))
523
+ line_fmt = header_fmt + ' %s'
524
+
525
+ print header_fmt % columns
526
+
527
+ for file in files:
528
+ t = line_function(file, *args, **kw)
529
+ if t is None:
530
+ t = []
531
+ diff = len(columns) - len(t)
532
+ if diff > 0:
533
+ t += [''] * diff
534
+ t.append(file_function(file))
535
+ print line_fmt % tuple(t)
536
+
537
+ def collect_results(self, files, function, *args, **kw):
538
+ results = {}
539
+
540
+ for file in files:
541
+ base = os.path.splitext(file)[0]
542
+ run, index = string.split(base, '-')[-2:]
543
+
544
+ run = int(run)
545
+ index = int(index)
546
+
547
+ value = function(file, *args, **kw)
548
+
549
+ try:
550
+ r = results[index]
551
+ except KeyError:
552
+ r = []
553
+ results[index] = r
554
+ r.append((run, value))
555
+
556
+ return results
557
+
558
+ def doc_to_help(self, obj):
559
+ """
560
+ Translates an object's __doc__ string into help text.
561
+
562
+ This strips a consistent number of spaces from each line in the
563
+ help text, essentially "outdenting" the text to the left-most
564
+ column.
565
+ """
566
+ doc = obj.__doc__
567
+ if doc is None:
568
+ return ''
569
+ return self.outdent(doc)
570
+
571
+ def find_next_run_number(self, dir, prefix):
572
+ """
573
+ Returns the next run number in a directory for the specified prefix.
574
+
575
+ Examines the contents the specified directory for files with the
576
+ specified prefix, extracts the run numbers from each file name,
577
+ and returns the next run number after the largest it finds.
578
+ """
579
+ x = re.compile(re.escape(prefix) + '-([0-9]+).*')
580
+ matches = map(lambda e, x=x: x.match(e), os.listdir(dir))
581
+ matches = filter(None, matches)
582
+ if not matches:
583
+ return 0
584
+ run_numbers = map(lambda m: int(m.group(1)), matches)
585
+ return int(max(run_numbers)) + 1
586
+
587
+ def gnuplot_results(self, results, fmt='%s %.3f'):
588
+ """
589
+ Prints out a set of results in Gnuplot format.
590
+ """
591
+ gp = Gnuplotter(self.title, self.key_location)
592
+
593
+ indices = results.keys()
594
+ indices.sort()
595
+
596
+ for i in indices:
597
+ try:
598
+ t = self.run_titles[i]
599
+ except IndexError:
600
+ t = '??? %s ???' % i
601
+ results[i].sort()
602
+ gp.line(results[i], i+1, t, None, t, fmt=fmt)
603
+
604
+ for bar_tuple in self.vertical_bars:
605
+ try:
606
+ x, type, label, comment = bar_tuple
607
+ except ValueError:
608
+ x, type, label = bar_tuple
609
+ comment = label
610
+ gp.vertical_bar(x, type, label, comment)
611
+
612
+ gp.draw()
613
+
614
+ def logfile_name(self, invocation):
615
+ """
616
+ Returns the absolute path of a log file for the specificed
617
+ invocation number.
618
+ """
619
+ name = self.prefix_run + '-%d.log' % invocation
620
+ return os.path.join(self.outdir, name)
621
+
622
+ def outdent(self, s):
623
+ """
624
+ Strip as many spaces from each line as are found at the beginning
625
+ of the first line in the list.
626
+ """
627
+ lines = s.split('\n')
628
+ if lines[0] == '':
629
+ lines = lines[1:]
630
+ spaces = re.match(' *', lines[0]).group(0)
631
+ def strip_initial_spaces(l, s=spaces):
632
+ if l.startswith(spaces):
633
+ l = l[len(spaces):]
634
+ return l
635
+ return '\n'.join([ strip_initial_spaces(l) for l in lines ]) + '\n'
636
+
637
+ def profile_name(self, invocation):
638
+ """
639
+ Returns the absolute path of a profile file for the specified
640
+ invocation number.
641
+ """
642
+ name = self.prefix_run + '-%d.prof' % invocation
643
+ return os.path.join(self.outdir, name)
644
+
645
+ def set_env(self, key, value):
646
+ os.environ[key] = value
647
+
648
+ #
649
+
650
+ def get_debug_times(self, file, time_string=None):
651
+ """
652
+ Fetch times from the --debug=time strings in the specified file.
653
+ """
654
+ if time_string is None:
655
+ search_string = self.time_string_all
656
+ else:
657
+ search_string = time_string
658
+ contents = open(file).read()
659
+ if not contents:
660
+ sys.stderr.write('file %s has no contents!\n' % repr(file))
661
+ return None
662
+ result = re.findall(r'%s: ([\d\.]*)' % search_string, contents)[-4:]
663
+ result = [ float(r) for r in result ]
664
+ if not time_string is None:
665
+ try:
666
+ result = result[0]
667
+ except IndexError:
668
+ sys.stderr.write('file %s has no results!\n' % repr(file))
669
+ return None
670
+ return result
671
+
672
+ def get_function_profile(self, file, function):
673
+ """
674
+ Returns the file, line number, function name, and cumulative time.
675
+ """
676
+ try:
677
+ import pstats
678
+ except ImportError, e:
679
+ sys.stderr.write('%s: func: %s\n' % (self.name, e))
680
+ sys.stderr.write('%s This version of Python is missing the profiler.\n' % self.name_spaces)
681
+ sys.stderr.write('%s Cannot use the "func" subcommand.\n' % self.name_spaces)
682
+ sys.exit(1)
683
+ statistics = pstats.Stats(file).stats
684
+ matches = [ e for e in statistics.items() if e[0][2] == function ]
685
+ r = matches[0]
686
+ return r[0][0], r[0][1], r[0][2], r[1][3]
687
+
688
+ def get_function_time(self, file, function):
689
+ """
690
+ Returns just the cumulative time for the specified function.
691
+ """
692
+ return self.get_function_profile(file, function)[3]
693
+
694
+ def get_memory(self, file, memory_string=None):
695
+ """
696
+ Returns a list of integers of the amount of memory used. The
697
+ default behavior is to return all the stages.
698
+ """
699
+ if memory_string is None:
700
+ search_string = self.memory_string_all
701
+ else:
702
+ search_string = memory_string
703
+ lines = open(file).readlines()
704
+ lines = [ l for l in lines if l.startswith(search_string) ][-4:]
705
+ result = [ int(l.split()[-1]) for l in lines[-4:] ]
706
+ if len(result) == 1:
707
+ result = result[0]
708
+ return result
709
+
710
+ def get_object_counts(self, file, object_name, index=None):
711
+ """
712
+ Returns the counts of the specified object_name.
713
+ """
714
+ object_string = ' ' + object_name + '\n'
715
+ lines = open(file).readlines()
716
+ line = [ l for l in lines if l.endswith(object_string) ][0]
717
+ result = [ int(field) for field in line.split()[:4] ]
718
+ if index is not None:
719
+ result = result[index]
720
+ return result
721
+
722
+ #
723
+
724
+ command_alias = {}
725
+
726
+ def execute_subcommand(self, argv):
727
+ """
728
+ Executes the do_*() function for the specified subcommand (argv[0]).
729
+ """
730
+ if not argv:
731
+ return
732
+ cmdName = self.command_alias.get(argv[0], argv[0])
733
+ try:
734
+ func = getattr(self, 'do_' + cmdName)
735
+ except AttributeError:
736
+ return self.default(argv)
737
+ try:
738
+ return func(argv)
739
+ except TypeError, e:
740
+ sys.stderr.write("%s %s: %s\n" % (self.name, cmdName, e))
741
+ import traceback
742
+ traceback.print_exc(file=sys.stderr)
743
+ sys.stderr.write("Try '%s help %s'\n" % (self.name, cmdName))
744
+
745
+ def default(self, argv):
746
+ """
747
+ The default behavior for an unknown subcommand. Prints an
748
+ error message and exits.
749
+ """
750
+ sys.stderr.write('%s: Unknown subcommand "%s".\n' % (self.name, argv[0]))
751
+ sys.stderr.write('Type "%s help" for usage.\n' % self.name)
752
+ sys.exit(1)
753
+
754
+ #
755
+
756
+ def do_help(self, argv):
757
+ """
758
+ """
759
+ if argv[1:]:
760
+ for arg in argv[1:]:
761
+ try:
762
+ func = getattr(self, 'do_' + arg)
763
+ except AttributeError:
764
+ sys.stderr.write('%s: No help for "%s"\n' % (self.name, arg))
765
+ else:
766
+ try:
767
+ help = getattr(self, 'help_' + arg)
768
+ except AttributeError:
769
+ sys.stdout.write(self.doc_to_help(func))
770
+ sys.stdout.flush()
771
+ else:
772
+ help()
773
+ else:
774
+ doc = self.doc_to_help(self.__class__)
775
+ if doc:
776
+ sys.stdout.write(doc)
777
+ sys.stdout.flush()
778
+ return None
779
+
780
+ #
781
+
782
+ def help_func(self):
783
+ help = """\
784
+ Usage: scons-time func [OPTIONS] FILE [...]
785
+
786
+ -C DIR, --chdir=DIR Change to DIR before looking for files
787
+ -f FILE, --file=FILE Read configuration from specified FILE
788
+ --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT
789
+ --func=NAME, --function=NAME Report time for function NAME
790
+ -h, --help Print this help and exit
791
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
792
+ -t NUMBER, --tail=NUMBER Only report the last NUMBER files
793
+ --title=TITLE Specify the output plot TITLE
794
+ """
795
+ sys.stdout.write(self.outdent(help))
796
+ sys.stdout.flush()
797
+
798
+ def do_func(self, argv):
799
+ """
800
+ """
801
+ format = 'ascii'
802
+ function_name = '_main'
803
+ tail = None
804
+
805
+ short_opts = '?C:f:hp:t:'
806
+
807
+ long_opts = [
808
+ 'chdir=',
809
+ 'file=',
810
+ 'fmt=',
811
+ 'format=',
812
+ 'func=',
813
+ 'function=',
814
+ 'help',
815
+ 'prefix=',
816
+ 'tail=',
817
+ 'title=',
818
+ ]
819
+
820
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
821
+
822
+ for o, a in opts:
823
+ if o in ('-C', '--chdir'):
824
+ self.chdir = a
825
+ elif o in ('-f', '--file'):
826
+ self.config_file = a
827
+ elif o in ('--fmt', '--format'):
828
+ format = a
829
+ elif o in ('--func', '--function'):
830
+ function_name = a
831
+ elif o in ('-?', '-h', '--help'):
832
+ self.do_help(['help', 'func'])
833
+ sys.exit(0)
834
+ elif o in ('--max',):
835
+ max_time = int(a)
836
+ elif o in ('-p', '--prefix'):
837
+ self.prefix = a
838
+ elif o in ('-t', '--tail'):
839
+ tail = int(a)
840
+ elif o in ('--title',):
841
+ self.title = a
842
+
843
+ if self.config_file:
844
+ exec open(self.config_file, 'rU').read() in self.__dict__
845
+
846
+ if self.chdir:
847
+ os.chdir(self.chdir)
848
+
849
+ if not args:
850
+
851
+ pattern = '%s*.prof' % self.prefix
852
+ args = self.args_to_files([pattern], tail)
853
+
854
+ if not args:
855
+ if self.chdir:
856
+ directory = self.chdir
857
+ else:
858
+ directory = os.getcwd()
859
+
860
+ sys.stderr.write('%s: func: No arguments specified.\n' % self.name)
861
+ sys.stderr.write('%s No %s*.prof files found in "%s".\n' % (self.name_spaces, self.prefix, directory))
862
+ sys.stderr.write('%s Type "%s help func" for help.\n' % (self.name_spaces, self.name))
863
+ sys.exit(1)
864
+
865
+ else:
866
+
867
+ args = self.args_to_files(args, tail)
868
+
869
+ cwd_ = os.getcwd() + os.sep
870
+
871
+ if format == 'ascii':
872
+
873
+ for file in args:
874
+ try:
875
+ f, line, func, time = \
876
+ self.get_function_profile(file, function_name)
877
+ except ValueError, e:
878
+ sys.stderr.write("%s: func: %s: %s\n" %
879
+ (self.name, file, e))
880
+ else:
881
+ if f.startswith(cwd_):
882
+ f = f[len(cwd_):]
883
+ print "%.3f %s:%d(%s)" % (time, f, line, func)
884
+
885
+ elif format == 'gnuplot':
886
+
887
+ results = self.collect_results(args, self.get_function_time,
888
+ function_name)
889
+
890
+ self.gnuplot_results(results)
891
+
892
+ else:
893
+
894
+ sys.stderr.write('%s: func: Unknown format "%s".\n' % (self.name, format))
895
+ sys.exit(1)
896
+
897
+ #
898
+
899
+ def help_mem(self):
900
+ help = """\
901
+ Usage: scons-time mem [OPTIONS] FILE [...]
902
+
903
+ -C DIR, --chdir=DIR Change to DIR before looking for files
904
+ -f FILE, --file=FILE Read configuration from specified FILE
905
+ --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT
906
+ -h, --help Print this help and exit
907
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
908
+ --stage=STAGE Plot memory at the specified stage:
909
+ pre-read, post-read, pre-build,
910
+ post-build (default: post-build)
911
+ -t NUMBER, --tail=NUMBER Only report the last NUMBER files
912
+ --title=TITLE Specify the output plot TITLE
913
+ """
914
+ sys.stdout.write(self.outdent(help))
915
+ sys.stdout.flush()
916
+
917
+ def do_mem(self, argv):
918
+
919
+ format = 'ascii'
920
+ logfile_path = lambda x: x
921
+ stage = self.default_stage
922
+ tail = None
923
+
924
+ short_opts = '?C:f:hp:t:'
925
+
926
+ long_opts = [
927
+ 'chdir=',
928
+ 'file=',
929
+ 'fmt=',
930
+ 'format=',
931
+ 'help',
932
+ 'prefix=',
933
+ 'stage=',
934
+ 'tail=',
935
+ 'title=',
936
+ ]
937
+
938
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
939
+
940
+ for o, a in opts:
941
+ if o in ('-C', '--chdir'):
942
+ self.chdir = a
943
+ elif o in ('-f', '--file'):
944
+ self.config_file = a
945
+ elif o in ('--fmt', '--format'):
946
+ format = a
947
+ elif o in ('-?', '-h', '--help'):
948
+ self.do_help(['help', 'mem'])
949
+ sys.exit(0)
950
+ elif o in ('-p', '--prefix'):
951
+ self.prefix = a
952
+ elif o in ('--stage',):
953
+ if not a in self.stages:
954
+ sys.stderr.write('%s: mem: Unrecognized stage "%s".\n' % (self.name, a))
955
+ sys.exit(1)
956
+ stage = a
957
+ elif o in ('-t', '--tail'):
958
+ tail = int(a)
959
+ elif o in ('--title',):
960
+ self.title = a
961
+
962
+ if self.config_file:
963
+ HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
964
+
965
+ if self.chdir:
966
+ os.chdir(self.chdir)
967
+ logfile_path = lambda x, c=self.chdir: os.path.join(c, x)
968
+
969
+ if not args:
970
+
971
+ pattern = '%s*.log' % self.prefix
972
+ args = self.args_to_files([pattern], tail)
973
+
974
+ if not args:
975
+ if self.chdir:
976
+ directory = self.chdir
977
+ else:
978
+ directory = os.getcwd()
979
+
980
+ sys.stderr.write('%s: mem: No arguments specified.\n' % self.name)
981
+ sys.stderr.write('%s No %s*.log files found in "%s".\n' % (self.name_spaces, self.prefix, directory))
982
+ sys.stderr.write('%s Type "%s help mem" for help.\n' % (self.name_spaces, self.name))
983
+ sys.exit(1)
984
+
985
+ else:
986
+
987
+ args = self.args_to_files(args, tail)
988
+
989
+ cwd_ = os.getcwd() + os.sep
990
+
991
+ if format == 'ascii':
992
+
993
+ self.ascii_table(args, tuple(self.stages), self.get_memory, logfile_path)
994
+
995
+ elif format == 'gnuplot':
996
+
997
+ results = self.collect_results(args, self.get_memory,
998
+ self.stage_strings[stage])
999
+
1000
+ self.gnuplot_results(results)
1001
+
1002
+ else:
1003
+
1004
+ sys.stderr.write('%s: mem: Unknown format "%s".\n' % (self.name, format))
1005
+ sys.exit(1)
1006
+
1007
+ return 0
1008
+
1009
+ #
1010
+
1011
+ def help_obj(self):
1012
+ help = """\
1013
+ Usage: scons-time obj [OPTIONS] OBJECT FILE [...]
1014
+
1015
+ -C DIR, --chdir=DIR Change to DIR before looking for files
1016
+ -f FILE, --file=FILE Read configuration from specified FILE
1017
+ --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT
1018
+ -h, --help Print this help and exit
1019
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
1020
+ --stage=STAGE Plot memory at the specified stage:
1021
+ pre-read, post-read, pre-build,
1022
+ post-build (default: post-build)
1023
+ -t NUMBER, --tail=NUMBER Only report the last NUMBER files
1024
+ --title=TITLE Specify the output plot TITLE
1025
+ """
1026
+ sys.stdout.write(self.outdent(help))
1027
+ sys.stdout.flush()
1028
+
1029
+ def do_obj(self, argv):
1030
+
1031
+ format = 'ascii'
1032
+ logfile_path = lambda x: x
1033
+ stage = self.default_stage
1034
+ tail = None
1035
+
1036
+ short_opts = '?C:f:hp:t:'
1037
+
1038
+ long_opts = [
1039
+ 'chdir=',
1040
+ 'file=',
1041
+ 'fmt=',
1042
+ 'format=',
1043
+ 'help',
1044
+ 'prefix=',
1045
+ 'stage=',
1046
+ 'tail=',
1047
+ 'title=',
1048
+ ]
1049
+
1050
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
1051
+
1052
+ for o, a in opts:
1053
+ if o in ('-C', '--chdir'):
1054
+ self.chdir = a
1055
+ elif o in ('-f', '--file'):
1056
+ self.config_file = a
1057
+ elif o in ('--fmt', '--format'):
1058
+ format = a
1059
+ elif o in ('-?', '-h', '--help'):
1060
+ self.do_help(['help', 'obj'])
1061
+ sys.exit(0)
1062
+ elif o in ('-p', '--prefix'):
1063
+ self.prefix = a
1064
+ elif o in ('--stage',):
1065
+ if not a in self.stages:
1066
+ sys.stderr.write('%s: obj: Unrecognized stage "%s".\n' % (self.name, a))
1067
+ sys.stderr.write('%s Type "%s help obj" for help.\n' % (self.name_spaces, self.name))
1068
+ sys.exit(1)
1069
+ stage = a
1070
+ elif o in ('-t', '--tail'):
1071
+ tail = int(a)
1072
+ elif o in ('--title',):
1073
+ self.title = a
1074
+
1075
+ if not args:
1076
+ sys.stderr.write('%s: obj: Must specify an object name.\n' % self.name)
1077
+ sys.stderr.write('%s Type "%s help obj" for help.\n' % (self.name_spaces, self.name))
1078
+ sys.exit(1)
1079
+
1080
+ object_name = args.pop(0)
1081
+
1082
+ if self.config_file:
1083
+ HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
1084
+
1085
+ if self.chdir:
1086
+ os.chdir(self.chdir)
1087
+ logfile_path = lambda x, c=self.chdir: os.path.join(c, x)
1088
+
1089
+ if not args:
1090
+
1091
+ pattern = '%s*.log' % self.prefix
1092
+ args = self.args_to_files([pattern], tail)
1093
+
1094
+ if not args:
1095
+ if self.chdir:
1096
+ directory = self.chdir
1097
+ else:
1098
+ directory = os.getcwd()
1099
+
1100
+ sys.stderr.write('%s: obj: No arguments specified.\n' % self.name)
1101
+ sys.stderr.write('%s No %s*.log files found in "%s".\n' % (self.name_spaces, self.prefix, directory))
1102
+ sys.stderr.write('%s Type "%s help obj" for help.\n' % (self.name_spaces, self.name))
1103
+ sys.exit(1)
1104
+
1105
+ else:
1106
+
1107
+ args = self.args_to_files(args, tail)
1108
+
1109
+ cwd_ = os.getcwd() + os.sep
1110
+
1111
+ if format == 'ascii':
1112
+
1113
+ self.ascii_table(args, tuple(self.stages), self.get_object_counts, logfile_path, object_name)
1114
+
1115
+ elif format == 'gnuplot':
1116
+
1117
+ stage_index = 0
1118
+ for s in self.stages:
1119
+ if stage == s:
1120
+ break
1121
+ stage_index = stage_index + 1
1122
+
1123
+ results = self.collect_results(args, self.get_object_counts,
1124
+ object_name, stage_index)
1125
+
1126
+ self.gnuplot_results(results)
1127
+
1128
+ else:
1129
+
1130
+ sys.stderr.write('%s: obj: Unknown format "%s".\n' % (self.name, format))
1131
+ sys.exit(1)
1132
+
1133
+ return 0
1134
+
1135
+ #
1136
+
1137
+ def help_run(self):
1138
+ help = """\
1139
+ Usage: scons-time run [OPTIONS] [FILE ...]
1140
+
1141
+ --aegis=PROJECT Use SCons from the Aegis PROJECT
1142
+ --chdir=DIR Name of unpacked directory for chdir
1143
+ -f FILE, --file=FILE Read configuration from specified FILE
1144
+ -h, --help Print this help and exit
1145
+ -n, --no-exec No execute, just print command lines
1146
+ --number=NUMBER Put output in files for run NUMBER
1147
+ --outdir=OUTDIR Put output files in OUTDIR
1148
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
1149
+ --python=PYTHON Time using the specified PYTHON
1150
+ -q, --quiet Don't print command lines
1151
+ --scons=SCONS Time using the specified SCONS
1152
+ --svn=URL, --subversion=URL Use SCons from Subversion URL
1153
+ -v, --verbose Display output of commands
1154
+ """
1155
+ sys.stdout.write(self.outdent(help))
1156
+ sys.stdout.flush()
1157
+
1158
+ def do_run(self, argv):
1159
+ """
1160
+ """
1161
+ run_number_list = [None]
1162
+
1163
+ short_opts = '?f:hnp:qs:v'
1164
+
1165
+ long_opts = [
1166
+ 'aegis=',
1167
+ 'file=',
1168
+ 'help',
1169
+ 'no-exec',
1170
+ 'number=',
1171
+ 'outdir=',
1172
+ 'prefix=',
1173
+ 'python=',
1174
+ 'quiet',
1175
+ 'scons=',
1176
+ 'svn=',
1177
+ 'subdir=',
1178
+ 'subversion=',
1179
+ 'verbose',
1180
+ ]
1181
+
1182
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
1183
+
1184
+ for o, a in opts:
1185
+ if o in ('--aegis',):
1186
+ self.aegis_project = a
1187
+ elif o in ('-f', '--file'):
1188
+ self.config_file = a
1189
+ elif o in ('-?', '-h', '--help'):
1190
+ self.do_help(['help', 'run'])
1191
+ sys.exit(0)
1192
+ elif o in ('-n', '--no-exec'):
1193
+ self.execute = self._do_not_execute
1194
+ elif o in ('--number',):
1195
+ run_number_list = self.split_run_numbers(a)
1196
+ elif o in ('--outdir',):
1197
+ self.outdir = a
1198
+ elif o in ('-p', '--prefix'):
1199
+ self.prefix = a
1200
+ elif o in ('--python',):
1201
+ self.python = a
1202
+ elif o in ('-q', '--quiet'):
1203
+ self.display = self._do_not_display
1204
+ elif o in ('-s', '--subdir'):
1205
+ self.subdir = a
1206
+ elif o in ('--scons',):
1207
+ self.scons = a
1208
+ elif o in ('--svn', '--subversion'):
1209
+ self.subversion_url = a
1210
+ elif o in ('-v', '--verbose'):
1211
+ self.redirect = tee_to_file
1212
+ self.verbose = True
1213
+ self.svn_co_flag = ''
1214
+
1215
+ if not args and not self.config_file:
1216
+ sys.stderr.write('%s: run: No arguments or -f config file specified.\n' % self.name)
1217
+ sys.stderr.write('%s Type "%s help run" for help.\n' % (self.name_spaces, self.name))
1218
+ sys.exit(1)
1219
+
1220
+ if self.config_file:
1221
+ exec open(self.config_file, 'rU').read() in self.__dict__
1222
+
1223
+ if args:
1224
+ self.archive_list = args
1225
+
1226
+ archive_file_name = os.path.split(self.archive_list[0])[1]
1227
+
1228
+ if not self.subdir:
1229
+ self.subdir = self.archive_splitext(archive_file_name)[0]
1230
+
1231
+ if not self.prefix:
1232
+ self.prefix = self.archive_splitext(archive_file_name)[0]
1233
+
1234
+ prepare = None
1235
+ if self.subversion_url:
1236
+ prepare = self.prep_subversion_run
1237
+ elif self.aegis_project:
1238
+ prepare = self.prep_aegis_run
1239
+
1240
+ for run_number in run_number_list:
1241
+ self.individual_run(run_number, self.archive_list, prepare)
1242
+
1243
+ def split_run_numbers(self, s):
1244
+ result = []
1245
+ for n in s.split(','):
1246
+ try:
1247
+ x, y = n.split('-')
1248
+ except ValueError:
1249
+ result.append(int(n))
1250
+ else:
1251
+ result.extend(range(int(x), int(y)+1))
1252
+ return result
1253
+
1254
+ def scons_path(self, dir):
1255
+ return os.path.join(dir, 'src', 'script', 'scons.py')
1256
+
1257
+ def scons_lib_dir_path(self, dir):
1258
+ return os.path.join(dir, 'src', 'engine')
1259
+
1260
+ def prep_aegis_run(self, commands, removals):
1261
+ self.aegis_tmpdir = make_temp_file(prefix = self.name + '-aegis-')
1262
+ removals.append((shutil.rmtree, 'rm -rf %%s', self.aegis_tmpdir))
1263
+
1264
+ self.aegis_parent_project = os.path.splitext(self.aegis_project)[0]
1265
+ self.scons = self.scons_path(self.aegis_tmpdir)
1266
+ self.scons_lib_dir = self.scons_lib_dir_path(self.aegis_tmpdir)
1267
+
1268
+ commands.extend([
1269
+ 'mkdir %(aegis_tmpdir)s',
1270
+ (lambda: os.chdir(self.aegis_tmpdir), 'cd %(aegis_tmpdir)s'),
1271
+ '%(aegis)s -cp -ind -p %(aegis_parent_project)s .',
1272
+ '%(aegis)s -cp -ind -p %(aegis_project)s -delta %(run_number)s .',
1273
+ ])
1274
+
1275
+ def prep_subversion_run(self, commands, removals):
1276
+ self.svn_tmpdir = make_temp_file(prefix = self.name + '-svn-')
1277
+ removals.append((shutil.rmtree, 'rm -rf %%s', self.svn_tmpdir))
1278
+
1279
+ self.scons = self.scons_path(self.svn_tmpdir)
1280
+ self.scons_lib_dir = self.scons_lib_dir_path(self.svn_tmpdir)
1281
+
1282
+ commands.extend([
1283
+ 'mkdir %(svn_tmpdir)s',
1284
+ '%(svn)s co %(svn_co_flag)s -r %(run_number)s %(subversion_url)s %(svn_tmpdir)s',
1285
+ ])
1286
+
1287
+ def individual_run(self, run_number, archive_list, prepare=None):
1288
+ """
1289
+ Performs an individual run of the default SCons invocations.
1290
+ """
1291
+
1292
+ commands = []
1293
+ removals = []
1294
+
1295
+ if prepare:
1296
+ prepare(commands, removals)
1297
+
1298
+ save_scons = self.scons
1299
+ save_scons_wrapper = self.scons_wrapper
1300
+ save_scons_lib_dir = self.scons_lib_dir
1301
+
1302
+ if self.outdir is None:
1303
+ self.outdir = self.orig_cwd
1304
+ elif not os.path.isabs(self.outdir):
1305
+ self.outdir = os.path.join(self.orig_cwd, self.outdir)
1306
+
1307
+ if self.scons is None:
1308
+ self.scons = self.scons_path(self.orig_cwd)
1309
+
1310
+ if self.scons_lib_dir is None:
1311
+ self.scons_lib_dir = self.scons_lib_dir_path(self.orig_cwd)
1312
+
1313
+ if self.scons_wrapper is None:
1314
+ self.scons_wrapper = self.scons
1315
+
1316
+ if not run_number:
1317
+ run_number = self.find_next_run_number(self.outdir, self.prefix)
1318
+
1319
+ self.run_number = str(run_number)
1320
+
1321
+ self.prefix_run = self.prefix + '-%03d' % run_number
1322
+
1323
+ if self.targets0 is None:
1324
+ self.targets0 = self.startup_targets
1325
+ if self.targets1 is None:
1326
+ self.targets1 = self.targets
1327
+ if self.targets2 is None:
1328
+ self.targets2 = self.targets
1329
+
1330
+ self.tmpdir = make_temp_file(prefix = self.name + '-')
1331
+
1332
+ commands.extend([
1333
+ 'mkdir %(tmpdir)s',
1334
+
1335
+ (os.chdir, 'cd %%s', self.tmpdir),
1336
+ ])
1337
+
1338
+ for archive in archive_list:
1339
+ if not os.path.isabs(archive):
1340
+ archive = os.path.join(self.orig_cwd, archive)
1341
+ if os.path.isdir(archive):
1342
+ dest = os.path.split(archive)[1]
1343
+ commands.append((shutil.copytree, 'cp -r %%s %%s', archive, dest))
1344
+ else:
1345
+ suffix = self.archive_splitext(archive)[1]
1346
+ unpack_command = self.unpack_map.get(suffix)
1347
+ if not unpack_command:
1348
+ dest = os.path.split(archive)[1]
1349
+ commands.append((shutil.copyfile, 'cp %%s %%s', archive, dest))
1350
+ else:
1351
+ commands.append(unpack_command + (archive,))
1352
+
1353
+ commands.extend([
1354
+ (os.chdir, 'cd %%s', self.subdir),
1355
+ ])
1356
+
1357
+ commands.extend(self.initial_commands)
1358
+
1359
+ commands.extend([
1360
+ (lambda: read_tree('.'),
1361
+ 'find * -type f | xargs cat > /dev/null'),
1362
+
1363
+ (self.set_env, 'export %%s=%%s',
1364
+ 'SCONS_LIB_DIR', self.scons_lib_dir),
1365
+
1366
+ '%(python)s %(scons_wrapper)s --version',
1367
+ ])
1368
+
1369
+ index = 0
1370
+ for run_command in self.run_commands:
1371
+ setattr(self, 'prof%d' % index, self.profile_name(index))
1372
+ c = (
1373
+ self.log_execute,
1374
+ self.log_display,
1375
+ run_command,
1376
+ self.logfile_name(index),
1377
+ )
1378
+ commands.append(c)
1379
+ index = index + 1
1380
+
1381
+ commands.extend([
1382
+ (os.chdir, 'cd %%s', self.orig_cwd),
1383
+ ])
1384
+
1385
+ if not os.environ.get('PRESERVE'):
1386
+ commands.extend(removals)
1387
+
1388
+ commands.append((shutil.rmtree, 'rm -rf %%s', self.tmpdir))
1389
+
1390
+ self.run_command_list(commands, self.__dict__)
1391
+
1392
+ self.scons = save_scons
1393
+ self.scons_lib_dir = save_scons_lib_dir
1394
+ self.scons_wrapper = save_scons_wrapper
1395
+
1396
+ #
1397
+
1398
+ def help_time(self):
1399
+ help = """\
1400
+ Usage: scons-time time [OPTIONS] FILE [...]
1401
+
1402
+ -C DIR, --chdir=DIR Change to DIR before looking for files
1403
+ -f FILE, --file=FILE Read configuration from specified FILE
1404
+ --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT
1405
+ -h, --help Print this help and exit
1406
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
1407
+ -t NUMBER, --tail=NUMBER Only report the last NUMBER files
1408
+ --which=TIMER Plot timings for TIMER: total,
1409
+ SConscripts, SCons, commands.
1410
+ """
1411
+ sys.stdout.write(self.outdent(help))
1412
+ sys.stdout.flush()
1413
+
1414
+ def do_time(self, argv):
1415
+
1416
+ format = 'ascii'
1417
+ logfile_path = lambda x: x
1418
+ tail = None
1419
+ which = 'total'
1420
+
1421
+ short_opts = '?C:f:hp:t:'
1422
+
1423
+ long_opts = [
1424
+ 'chdir=',
1425
+ 'file=',
1426
+ 'fmt=',
1427
+ 'format=',
1428
+ 'help',
1429
+ 'prefix=',
1430
+ 'tail=',
1431
+ 'title=',
1432
+ 'which=',
1433
+ ]
1434
+
1435
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
1436
+
1437
+ for o, a in opts:
1438
+ if o in ('-C', '--chdir'):
1439
+ self.chdir = a
1440
+ elif o in ('-f', '--file'):
1441
+ self.config_file = a
1442
+ elif o in ('--fmt', '--format'):
1443
+ format = a
1444
+ elif o in ('-?', '-h', '--help'):
1445
+ self.do_help(['help', 'time'])
1446
+ sys.exit(0)
1447
+ elif o in ('-p', '--prefix'):
1448
+ self.prefix = a
1449
+ elif o in ('-t', '--tail'):
1450
+ tail = int(a)
1451
+ elif o in ('--title',):
1452
+ self.title = a
1453
+ elif o in ('--which',):
1454
+ if not a in self.time_strings.keys():
1455
+ sys.stderr.write('%s: time: Unrecognized timer "%s".\n' % (self.name, a))
1456
+ sys.stderr.write('%s Type "%s help time" for help.\n' % (self.name_spaces, self.name))
1457
+ sys.exit(1)
1458
+ which = a
1459
+
1460
+ if self.config_file:
1461
+ HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
1462
+
1463
+ if self.chdir:
1464
+ os.chdir(self.chdir)
1465
+ logfile_path = lambda x, c=self.chdir: os.path.join(c, x)
1466
+
1467
+ if not args:
1468
+
1469
+ pattern = '%s*.log' % self.prefix
1470
+ args = self.args_to_files([pattern], tail)
1471
+
1472
+ if not args:
1473
+ if self.chdir:
1474
+ directory = self.chdir
1475
+ else:
1476
+ directory = os.getcwd()
1477
+
1478
+ sys.stderr.write('%s: time: No arguments specified.\n' % self.name)
1479
+ sys.stderr.write('%s No %s*.log files found in "%s".\n' % (self.name_spaces, self.prefix, directory))
1480
+ sys.stderr.write('%s Type "%s help time" for help.\n' % (self.name_spaces, self.name))
1481
+ sys.exit(1)
1482
+
1483
+ else:
1484
+
1485
+ args = self.args_to_files(args, tail)
1486
+
1487
+ cwd_ = os.getcwd() + os.sep
1488
+
1489
+ if format == 'ascii':
1490
+
1491
+ columns = ("Total", "SConscripts", "SCons", "commands")
1492
+ self.ascii_table(args, columns, self.get_debug_times, logfile_path)
1493
+
1494
+ elif format == 'gnuplot':
1495
+
1496
+ results = self.collect_results(args, self.get_debug_times,
1497
+ self.time_strings[which])
1498
+
1499
+ self.gnuplot_results(results, fmt='%s %.6f')
1500
+
1501
+ else:
1502
+
1503
+ sys.stderr.write('%s: time: Unknown format "%s".\n' % (self.name, format))
1504
+ sys.exit(1)
1505
+
1506
+ if __name__ == '__main__':
1507
+ opts, args = getopt.getopt(sys.argv[1:], 'h?V', ['help', 'version'])
1508
+
1509
+ ST = SConsTimer()
1510
+
1511
+ for o, a in opts:
1512
+ if o in ('-?', '-h', '--help'):
1513
+ ST.do_help(['help'])
1514
+ sys.exit(0)
1515
+ elif o in ('-V', '--version'):
1516
+ sys.stdout.write('scons-time version\n')
1517
+ sys.exit(0)
1518
+
1519
+ if not args:
1520
+ sys.stderr.write('Type "%s help" for usage.\n' % ST.name)
1521
+ sys.exit(1)
1522
+
1523
+ ST.execute_subcommand(args)
1524
+
1525
+ # Local Variables:
1526
+ # tab-width:4
1527
+ # indent-tabs-mode:nil
1528
+ # End:
1529
+ # vim: set expandtab tabstop=4 shiftwidth=4: