libv8 3.3.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (700) hide show
  1. data/.gitignore +8 -0
  2. data/.gitmodules +3 -0
  3. data/Gemfile +4 -0
  4. data/README.md +44 -0
  5. data/Rakefile +73 -0
  6. data/ext/libv8/extconf.rb +9 -0
  7. data/lib/libv8.rb +15 -0
  8. data/lib/libv8/Makefile +38 -0
  9. data/lib/libv8/detect_cpu.rb +27 -0
  10. data/lib/libv8/fpic-on-linux-amd64.patch +13 -0
  11. data/lib/libv8/scons/CHANGES.txt +5334 -0
  12. data/lib/libv8/scons/LICENSE.txt +20 -0
  13. data/lib/libv8/scons/MANIFEST +199 -0
  14. data/lib/libv8/scons/PKG-INFO +13 -0
  15. data/lib/libv8/scons/README.txt +243 -0
  16. data/lib/libv8/scons/RELEASE.txt +98 -0
  17. data/lib/libv8/scons/engine/SCons/Action.py +1241 -0
  18. data/lib/libv8/scons/engine/SCons/Builder.py +877 -0
  19. data/lib/libv8/scons/engine/SCons/CacheDir.py +216 -0
  20. data/lib/libv8/scons/engine/SCons/Conftest.py +793 -0
  21. data/lib/libv8/scons/engine/SCons/Debug.py +220 -0
  22. data/lib/libv8/scons/engine/SCons/Defaults.py +480 -0
  23. data/lib/libv8/scons/engine/SCons/Environment.py +2318 -0
  24. data/lib/libv8/scons/engine/SCons/Errors.py +205 -0
  25. data/lib/libv8/scons/engine/SCons/Executor.py +633 -0
  26. data/lib/libv8/scons/engine/SCons/Job.py +435 -0
  27. data/lib/libv8/scons/engine/SCons/Memoize.py +244 -0
  28. data/lib/libv8/scons/engine/SCons/Node/Alias.py +152 -0
  29. data/lib/libv8/scons/engine/SCons/Node/FS.py +3142 -0
  30. data/lib/libv8/scons/engine/SCons/Node/Python.py +128 -0
  31. data/lib/libv8/scons/engine/SCons/Node/__init__.py +1328 -0
  32. data/lib/libv8/scons/engine/SCons/Options/BoolOption.py +50 -0
  33. data/lib/libv8/scons/engine/SCons/Options/EnumOption.py +50 -0
  34. data/lib/libv8/scons/engine/SCons/Options/ListOption.py +50 -0
  35. data/lib/libv8/scons/engine/SCons/Options/PackageOption.py +50 -0
  36. data/lib/libv8/scons/engine/SCons/Options/PathOption.py +76 -0
  37. data/lib/libv8/scons/engine/SCons/Options/__init__.py +67 -0
  38. data/lib/libv8/scons/engine/SCons/PathList.py +231 -0
  39. data/lib/libv8/scons/engine/SCons/Platform/__init__.py +241 -0
  40. data/lib/libv8/scons/engine/SCons/Platform/aix.py +69 -0
  41. data/lib/libv8/scons/engine/SCons/Platform/cygwin.py +55 -0
  42. data/lib/libv8/scons/engine/SCons/Platform/darwin.py +46 -0
  43. data/lib/libv8/scons/engine/SCons/Platform/hpux.py +46 -0
  44. data/lib/libv8/scons/engine/SCons/Platform/irix.py +44 -0
  45. data/lib/libv8/scons/engine/SCons/Platform/os2.py +58 -0
  46. data/lib/libv8/scons/engine/SCons/Platform/posix.py +263 -0
  47. data/lib/libv8/scons/engine/SCons/Platform/sunos.py +50 -0
  48. data/lib/libv8/scons/engine/SCons/Platform/win32.py +385 -0
  49. data/lib/libv8/scons/engine/SCons/SConf.py +1030 -0
  50. data/lib/libv8/scons/engine/SCons/SConsign.py +383 -0
  51. data/lib/libv8/scons/engine/SCons/Scanner/C.py +132 -0
  52. data/lib/libv8/scons/engine/SCons/Scanner/D.py +73 -0
  53. data/lib/libv8/scons/engine/SCons/Scanner/Dir.py +109 -0
  54. data/lib/libv8/scons/engine/SCons/Scanner/Fortran.py +316 -0
  55. data/lib/libv8/scons/engine/SCons/Scanner/IDL.py +48 -0
  56. data/lib/libv8/scons/engine/SCons/Scanner/LaTeX.py +384 -0
  57. data/lib/libv8/scons/engine/SCons/Scanner/Prog.py +101 -0
  58. data/lib/libv8/scons/engine/SCons/Scanner/RC.py +55 -0
  59. data/lib/libv8/scons/engine/SCons/Scanner/__init__.py +413 -0
  60. data/lib/libv8/scons/engine/SCons/Script/Interactive.py +384 -0
  61. data/lib/libv8/scons/engine/SCons/Script/Main.py +1334 -0
  62. data/lib/libv8/scons/engine/SCons/Script/SConsOptions.py +939 -0
  63. data/lib/libv8/scons/engine/SCons/Script/SConscript.py +640 -0
  64. data/lib/libv8/scons/engine/SCons/Script/__init__.py +412 -0
  65. data/lib/libv8/scons/engine/SCons/Sig.py +63 -0
  66. data/lib/libv8/scons/engine/SCons/Subst.py +904 -0
  67. data/lib/libv8/scons/engine/SCons/Taskmaster.py +1017 -0
  68. data/lib/libv8/scons/engine/SCons/Tool/386asm.py +61 -0
  69. data/lib/libv8/scons/engine/SCons/Tool/BitKeeper.py +67 -0
  70. data/lib/libv8/scons/engine/SCons/Tool/CVS.py +73 -0
  71. data/lib/libv8/scons/engine/SCons/Tool/FortranCommon.py +246 -0
  72. data/lib/libv8/scons/engine/SCons/Tool/JavaCommon.py +323 -0
  73. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/__init__.py +56 -0
  74. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/arch.py +61 -0
  75. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/common.py +240 -0
  76. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/netframework.py +82 -0
  77. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/sdk.py +391 -0
  78. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vc.py +456 -0
  79. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vs.py +499 -0
  80. data/lib/libv8/scons/engine/SCons/Tool/Perforce.py +103 -0
  81. data/lib/libv8/scons/engine/SCons/Tool/PharLapCommon.py +137 -0
  82. data/lib/libv8/scons/engine/SCons/Tool/RCS.py +64 -0
  83. data/lib/libv8/scons/engine/SCons/Tool/SCCS.py +64 -0
  84. data/lib/libv8/scons/engine/SCons/Tool/Subversion.py +71 -0
  85. data/lib/libv8/scons/engine/SCons/Tool/__init__.py +681 -0
  86. data/lib/libv8/scons/engine/SCons/Tool/aixc++.py +82 -0
  87. data/lib/libv8/scons/engine/SCons/Tool/aixcc.py +74 -0
  88. data/lib/libv8/scons/engine/SCons/Tool/aixf77.py +80 -0
  89. data/lib/libv8/scons/engine/SCons/Tool/aixlink.py +76 -0
  90. data/lib/libv8/scons/engine/SCons/Tool/applelink.py +71 -0
  91. data/lib/libv8/scons/engine/SCons/Tool/ar.py +63 -0
  92. data/lib/libv8/scons/engine/SCons/Tool/as.py +78 -0
  93. data/lib/libv8/scons/engine/SCons/Tool/bcc32.py +81 -0
  94. data/lib/libv8/scons/engine/SCons/Tool/c++.py +99 -0
  95. data/lib/libv8/scons/engine/SCons/Tool/cc.py +102 -0
  96. data/lib/libv8/scons/engine/SCons/Tool/cvf.py +58 -0
  97. data/lib/libv8/scons/engine/SCons/Tool/default.py +50 -0
  98. data/lib/libv8/scons/engine/SCons/Tool/dmd.py +223 -0
  99. data/lib/libv8/scons/engine/SCons/Tool/dvi.py +64 -0
  100. data/lib/libv8/scons/engine/SCons/Tool/dvipdf.py +124 -0
  101. data/lib/libv8/scons/engine/SCons/Tool/dvips.py +94 -0
  102. data/lib/libv8/scons/engine/SCons/Tool/f77.py +62 -0
  103. data/lib/libv8/scons/engine/SCons/Tool/f90.py +62 -0
  104. data/lib/libv8/scons/engine/SCons/Tool/f95.py +63 -0
  105. data/lib/libv8/scons/engine/SCons/Tool/filesystem.py +98 -0
  106. data/lib/libv8/scons/engine/SCons/Tool/fortran.py +62 -0
  107. data/lib/libv8/scons/engine/SCons/Tool/g++.py +90 -0
  108. data/lib/libv8/scons/engine/SCons/Tool/g77.py +73 -0
  109. data/lib/libv8/scons/engine/SCons/Tool/gas.py +53 -0
  110. data/lib/libv8/scons/engine/SCons/Tool/gcc.py +80 -0
  111. data/lib/libv8/scons/engine/SCons/Tool/gfortran.py +64 -0
  112. data/lib/libv8/scons/engine/SCons/Tool/gnulink.py +63 -0
  113. data/lib/libv8/scons/engine/SCons/Tool/gs.py +81 -0
  114. data/lib/libv8/scons/engine/SCons/Tool/hpc++.py +84 -0
  115. data/lib/libv8/scons/engine/SCons/Tool/hpcc.py +53 -0
  116. data/lib/libv8/scons/engine/SCons/Tool/hplink.py +77 -0
  117. data/lib/libv8/scons/engine/SCons/Tool/icc.py +59 -0
  118. data/lib/libv8/scons/engine/SCons/Tool/icl.py +52 -0
  119. data/lib/libv8/scons/engine/SCons/Tool/ifl.py +72 -0
  120. data/lib/libv8/scons/engine/SCons/Tool/ifort.py +88 -0
  121. data/lib/libv8/scons/engine/SCons/Tool/ilink.py +59 -0
  122. data/lib/libv8/scons/engine/SCons/Tool/ilink32.py +60 -0
  123. data/lib/libv8/scons/engine/SCons/Tool/install.py +229 -0
  124. data/lib/libv8/scons/engine/SCons/Tool/intelc.py +482 -0
  125. data/lib/libv8/scons/engine/SCons/Tool/ipkg.py +67 -0
  126. data/lib/libv8/scons/engine/SCons/Tool/jar.py +110 -0
  127. data/lib/libv8/scons/engine/SCons/Tool/javac.py +230 -0
  128. data/lib/libv8/scons/engine/SCons/Tool/javah.py +137 -0
  129. data/lib/libv8/scons/engine/SCons/Tool/latex.py +79 -0
  130. data/lib/libv8/scons/engine/SCons/Tool/lex.py +97 -0
  131. data/lib/libv8/scons/engine/SCons/Tool/link.py +121 -0
  132. data/lib/libv8/scons/engine/SCons/Tool/linkloc.py +112 -0
  133. data/lib/libv8/scons/engine/SCons/Tool/m4.py +63 -0
  134. data/lib/libv8/scons/engine/SCons/Tool/masm.py +77 -0
  135. data/lib/libv8/scons/engine/SCons/Tool/midl.py +88 -0
  136. data/lib/libv8/scons/engine/SCons/Tool/mingw.py +158 -0
  137. data/lib/libv8/scons/engine/SCons/Tool/mslib.py +64 -0
  138. data/lib/libv8/scons/engine/SCons/Tool/mslink.py +266 -0
  139. data/lib/libv8/scons/engine/SCons/Tool/mssdk.py +50 -0
  140. data/lib/libv8/scons/engine/SCons/Tool/msvc.py +268 -0
  141. data/lib/libv8/scons/engine/SCons/Tool/msvs.py +1388 -0
  142. data/lib/libv8/scons/engine/SCons/Tool/mwcc.py +207 -0
  143. data/lib/libv8/scons/engine/SCons/Tool/mwld.py +107 -0
  144. data/lib/libv8/scons/engine/SCons/Tool/nasm.py +72 -0
  145. data/lib/libv8/scons/engine/SCons/Tool/packaging/__init__.py +312 -0
  146. data/lib/libv8/scons/engine/SCons/Tool/packaging/ipk.py +185 -0
  147. data/lib/libv8/scons/engine/SCons/Tool/packaging/msi.py +527 -0
  148. data/lib/libv8/scons/engine/SCons/Tool/packaging/rpm.py +365 -0
  149. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_tarbz2.py +43 -0
  150. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_targz.py +43 -0
  151. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_zip.py +43 -0
  152. data/lib/libv8/scons/engine/SCons/Tool/packaging/tarbz2.py +44 -0
  153. data/lib/libv8/scons/engine/SCons/Tool/packaging/targz.py +44 -0
  154. data/lib/libv8/scons/engine/SCons/Tool/packaging/zip.py +44 -0
  155. data/lib/libv8/scons/engine/SCons/Tool/pdf.py +78 -0
  156. data/lib/libv8/scons/engine/SCons/Tool/pdflatex.py +83 -0
  157. data/lib/libv8/scons/engine/SCons/Tool/pdftex.py +108 -0
  158. data/lib/libv8/scons/engine/SCons/Tool/qt.py +336 -0
  159. data/lib/libv8/scons/engine/SCons/Tool/rmic.py +120 -0
  160. data/lib/libv8/scons/engine/SCons/Tool/rpcgen.py +70 -0
  161. data/lib/libv8/scons/engine/SCons/Tool/rpm.py +132 -0
  162. data/lib/libv8/scons/engine/SCons/Tool/sgiar.py +68 -0
  163. data/lib/libv8/scons/engine/SCons/Tool/sgic++.py +58 -0
  164. data/lib/libv8/scons/engine/SCons/Tool/sgicc.py +53 -0
  165. data/lib/libv8/scons/engine/SCons/Tool/sgilink.py +63 -0
  166. data/lib/libv8/scons/engine/SCons/Tool/sunar.py +67 -0
  167. data/lib/libv8/scons/engine/SCons/Tool/sunc++.py +142 -0
  168. data/lib/libv8/scons/engine/SCons/Tool/suncc.py +58 -0
  169. data/lib/libv8/scons/engine/SCons/Tool/sunf77.py +63 -0
  170. data/lib/libv8/scons/engine/SCons/Tool/sunf90.py +64 -0
  171. data/lib/libv8/scons/engine/SCons/Tool/sunf95.py +64 -0
  172. data/lib/libv8/scons/engine/SCons/Tool/sunlink.py +77 -0
  173. data/lib/libv8/scons/engine/SCons/Tool/swig.py +182 -0
  174. data/lib/libv8/scons/engine/SCons/Tool/tar.py +73 -0
  175. data/lib/libv8/scons/engine/SCons/Tool/tex.py +813 -0
  176. data/lib/libv8/scons/engine/SCons/Tool/textfile.py +175 -0
  177. data/lib/libv8/scons/engine/SCons/Tool/tlib.py +53 -0
  178. data/lib/libv8/scons/engine/SCons/Tool/wix.py +99 -0
  179. data/lib/libv8/scons/engine/SCons/Tool/yacc.py +130 -0
  180. data/lib/libv8/scons/engine/SCons/Tool/zip.py +99 -0
  181. data/lib/libv8/scons/engine/SCons/Util.py +1492 -0
  182. data/lib/libv8/scons/engine/SCons/Variables/BoolVariable.py +89 -0
  183. data/lib/libv8/scons/engine/SCons/Variables/EnumVariable.py +103 -0
  184. data/lib/libv8/scons/engine/SCons/Variables/ListVariable.py +135 -0
  185. data/lib/libv8/scons/engine/SCons/Variables/PackageVariable.py +106 -0
  186. data/lib/libv8/scons/engine/SCons/Variables/PathVariable.py +147 -0
  187. data/lib/libv8/scons/engine/SCons/Variables/__init__.py +312 -0
  188. data/lib/libv8/scons/engine/SCons/Warnings.py +246 -0
  189. data/lib/libv8/scons/engine/SCons/__init__.py +49 -0
  190. data/lib/libv8/scons/engine/SCons/compat/__init__.py +237 -0
  191. data/lib/libv8/scons/engine/SCons/compat/_scons_builtins.py +150 -0
  192. data/lib/libv8/scons/engine/SCons/compat/_scons_collections.py +45 -0
  193. data/lib/libv8/scons/engine/SCons/compat/_scons_dbm.py +45 -0
  194. data/lib/libv8/scons/engine/SCons/compat/_scons_hashlib.py +76 -0
  195. data/lib/libv8/scons/engine/SCons/compat/_scons_io.py +45 -0
  196. data/lib/libv8/scons/engine/SCons/compat/_scons_sets.py +563 -0
  197. data/lib/libv8/scons/engine/SCons/compat/_scons_subprocess.py +1281 -0
  198. data/lib/libv8/scons/engine/SCons/cpp.py +589 -0
  199. data/lib/libv8/scons/engine/SCons/dblite.py +251 -0
  200. data/lib/libv8/scons/engine/SCons/exitfuncs.py +77 -0
  201. data/lib/libv8/scons/os_spawnv_fix.diff +83 -0
  202. data/lib/libv8/scons/scons-time.1 +1017 -0
  203. data/lib/libv8/scons/scons.1 +15219 -0
  204. data/lib/libv8/scons/sconsign.1 +208 -0
  205. data/lib/libv8/scons/script/scons +196 -0
  206. data/lib/libv8/scons/script/scons-time +1544 -0
  207. data/lib/libv8/scons/script/scons.bat +31 -0
  208. data/lib/libv8/scons/script/sconsign +513 -0
  209. data/lib/libv8/scons/setup.cfg +6 -0
  210. data/lib/libv8/scons/setup.py +425 -0
  211. data/lib/libv8/v8/.gitignore +35 -0
  212. data/lib/libv8/v8/AUTHORS +44 -0
  213. data/lib/libv8/v8/ChangeLog +2839 -0
  214. data/lib/libv8/v8/LICENSE +52 -0
  215. data/lib/libv8/v8/LICENSE.strongtalk +29 -0
  216. data/lib/libv8/v8/LICENSE.v8 +26 -0
  217. data/lib/libv8/v8/LICENSE.valgrind +45 -0
  218. data/lib/libv8/v8/SConstruct +1478 -0
  219. data/lib/libv8/v8/build/README.txt +49 -0
  220. data/lib/libv8/v8/build/all.gyp +18 -0
  221. data/lib/libv8/v8/build/armu.gypi +32 -0
  222. data/lib/libv8/v8/build/common.gypi +144 -0
  223. data/lib/libv8/v8/build/gyp_v8 +145 -0
  224. data/lib/libv8/v8/include/v8-debug.h +395 -0
  225. data/lib/libv8/v8/include/v8-preparser.h +117 -0
  226. data/lib/libv8/v8/include/v8-profiler.h +505 -0
  227. data/lib/libv8/v8/include/v8-testing.h +104 -0
  228. data/lib/libv8/v8/include/v8.h +4124 -0
  229. data/lib/libv8/v8/include/v8stdint.h +53 -0
  230. data/lib/libv8/v8/preparser/SConscript +38 -0
  231. data/lib/libv8/v8/preparser/preparser-process.cc +379 -0
  232. data/lib/libv8/v8/src/SConscript +368 -0
  233. data/lib/libv8/v8/src/accessors.cc +767 -0
  234. data/lib/libv8/v8/src/accessors.h +123 -0
  235. data/lib/libv8/v8/src/allocation-inl.h +49 -0
  236. data/lib/libv8/v8/src/allocation.cc +122 -0
  237. data/lib/libv8/v8/src/allocation.h +143 -0
  238. data/lib/libv8/v8/src/api.cc +5845 -0
  239. data/lib/libv8/v8/src/api.h +574 -0
  240. data/lib/libv8/v8/src/apinatives.js +110 -0
  241. data/lib/libv8/v8/src/apiutils.h +73 -0
  242. data/lib/libv8/v8/src/arguments.h +118 -0
  243. data/lib/libv8/v8/src/arm/assembler-arm-inl.h +353 -0
  244. data/lib/libv8/v8/src/arm/assembler-arm.cc +2661 -0
  245. data/lib/libv8/v8/src/arm/assembler-arm.h +1375 -0
  246. data/lib/libv8/v8/src/arm/builtins-arm.cc +1658 -0
  247. data/lib/libv8/v8/src/arm/code-stubs-arm.cc +6398 -0
  248. data/lib/libv8/v8/src/arm/code-stubs-arm.h +673 -0
  249. data/lib/libv8/v8/src/arm/codegen-arm.cc +52 -0
  250. data/lib/libv8/v8/src/arm/codegen-arm.h +91 -0
  251. data/lib/libv8/v8/src/arm/constants-arm.cc +152 -0
  252. data/lib/libv8/v8/src/arm/constants-arm.h +775 -0
  253. data/lib/libv8/v8/src/arm/cpu-arm.cc +120 -0
  254. data/lib/libv8/v8/src/arm/debug-arm.cc +317 -0
  255. data/lib/libv8/v8/src/arm/deoptimizer-arm.cc +754 -0
  256. data/lib/libv8/v8/src/arm/disasm-arm.cc +1506 -0
  257. data/lib/libv8/v8/src/arm/frames-arm.cc +45 -0
  258. data/lib/libv8/v8/src/arm/frames-arm.h +168 -0
  259. data/lib/libv8/v8/src/arm/full-codegen-arm.cc +4375 -0
  260. data/lib/libv8/v8/src/arm/ic-arm.cc +1562 -0
  261. data/lib/libv8/v8/src/arm/lithium-arm.cc +2206 -0
  262. data/lib/libv8/v8/src/arm/lithium-arm.h +2348 -0
  263. data/lib/libv8/v8/src/arm/lithium-codegen-arm.cc +4526 -0
  264. data/lib/libv8/v8/src/arm/lithium-codegen-arm.h +403 -0
  265. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.cc +305 -0
  266. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.h +84 -0
  267. data/lib/libv8/v8/src/arm/macro-assembler-arm.cc +3163 -0
  268. data/lib/libv8/v8/src/arm/macro-assembler-arm.h +1126 -0
  269. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.cc +1287 -0
  270. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.h +253 -0
  271. data/lib/libv8/v8/src/arm/simulator-arm.cc +3424 -0
  272. data/lib/libv8/v8/src/arm/simulator-arm.h +431 -0
  273. data/lib/libv8/v8/src/arm/stub-cache-arm.cc +4243 -0
  274. data/lib/libv8/v8/src/array.js +1366 -0
  275. data/lib/libv8/v8/src/assembler.cc +1207 -0
  276. data/lib/libv8/v8/src/assembler.h +858 -0
  277. data/lib/libv8/v8/src/ast-inl.h +112 -0
  278. data/lib/libv8/v8/src/ast.cc +1146 -0
  279. data/lib/libv8/v8/src/ast.h +2188 -0
  280. data/lib/libv8/v8/src/atomicops.h +167 -0
  281. data/lib/libv8/v8/src/atomicops_internals_arm_gcc.h +145 -0
  282. data/lib/libv8/v8/src/atomicops_internals_mips_gcc.h +169 -0
  283. data/lib/libv8/v8/src/atomicops_internals_x86_gcc.cc +133 -0
  284. data/lib/libv8/v8/src/atomicops_internals_x86_gcc.h +287 -0
  285. data/lib/libv8/v8/src/atomicops_internals_x86_macosx.h +301 -0
  286. data/lib/libv8/v8/src/atomicops_internals_x86_msvc.h +203 -0
  287. data/lib/libv8/v8/src/bignum-dtoa.cc +655 -0
  288. data/lib/libv8/v8/src/bignum-dtoa.h +81 -0
  289. data/lib/libv8/v8/src/bignum.cc +768 -0
  290. data/lib/libv8/v8/src/bignum.h +140 -0
  291. data/lib/libv8/v8/src/bootstrapper.cc +2184 -0
  292. data/lib/libv8/v8/src/bootstrapper.h +188 -0
  293. data/lib/libv8/v8/src/builtins.cc +1707 -0
  294. data/lib/libv8/v8/src/builtins.h +371 -0
  295. data/lib/libv8/v8/src/bytecodes-irregexp.h +105 -0
  296. data/lib/libv8/v8/src/cached-powers.cc +177 -0
  297. data/lib/libv8/v8/src/cached-powers.h +65 -0
  298. data/lib/libv8/v8/src/char-predicates-inl.h +94 -0
  299. data/lib/libv8/v8/src/char-predicates.h +67 -0
  300. data/lib/libv8/v8/src/checks.cc +110 -0
  301. data/lib/libv8/v8/src/checks.h +296 -0
  302. data/lib/libv8/v8/src/circular-queue-inl.h +53 -0
  303. data/lib/libv8/v8/src/circular-queue.cc +122 -0
  304. data/lib/libv8/v8/src/circular-queue.h +103 -0
  305. data/lib/libv8/v8/src/code-stubs.cc +267 -0
  306. data/lib/libv8/v8/src/code-stubs.h +1011 -0
  307. data/lib/libv8/v8/src/code.h +70 -0
  308. data/lib/libv8/v8/src/codegen.cc +231 -0
  309. data/lib/libv8/v8/src/codegen.h +84 -0
  310. data/lib/libv8/v8/src/compilation-cache.cc +540 -0
  311. data/lib/libv8/v8/src/compilation-cache.h +287 -0
  312. data/lib/libv8/v8/src/compiler.cc +786 -0
  313. data/lib/libv8/v8/src/compiler.h +312 -0
  314. data/lib/libv8/v8/src/contexts.cc +347 -0
  315. data/lib/libv8/v8/src/contexts.h +391 -0
  316. data/lib/libv8/v8/src/conversions-inl.h +106 -0
  317. data/lib/libv8/v8/src/conversions.cc +1131 -0
  318. data/lib/libv8/v8/src/conversions.h +135 -0
  319. data/lib/libv8/v8/src/counters.cc +93 -0
  320. data/lib/libv8/v8/src/counters.h +254 -0
  321. data/lib/libv8/v8/src/cpu-profiler-inl.h +101 -0
  322. data/lib/libv8/v8/src/cpu-profiler.cc +609 -0
  323. data/lib/libv8/v8/src/cpu-profiler.h +302 -0
  324. data/lib/libv8/v8/src/cpu.h +69 -0
  325. data/lib/libv8/v8/src/d8-debug.cc +367 -0
  326. data/lib/libv8/v8/src/d8-debug.h +158 -0
  327. data/lib/libv8/v8/src/d8-posix.cc +695 -0
  328. data/lib/libv8/v8/src/d8-readline.cc +130 -0
  329. data/lib/libv8/v8/src/d8-windows.cc +42 -0
  330. data/lib/libv8/v8/src/d8.cc +803 -0
  331. data/lib/libv8/v8/src/d8.gyp +91 -0
  332. data/lib/libv8/v8/src/d8.h +235 -0
  333. data/lib/libv8/v8/src/d8.js +2798 -0
  334. data/lib/libv8/v8/src/data-flow.cc +66 -0
  335. data/lib/libv8/v8/src/data-flow.h +205 -0
  336. data/lib/libv8/v8/src/date.js +1103 -0
  337. data/lib/libv8/v8/src/dateparser-inl.h +127 -0
  338. data/lib/libv8/v8/src/dateparser.cc +178 -0
  339. data/lib/libv8/v8/src/dateparser.h +266 -0
  340. data/lib/libv8/v8/src/debug-agent.cc +447 -0
  341. data/lib/libv8/v8/src/debug-agent.h +129 -0
  342. data/lib/libv8/v8/src/debug-debugger.js +2569 -0
  343. data/lib/libv8/v8/src/debug.cc +3165 -0
  344. data/lib/libv8/v8/src/debug.h +1057 -0
  345. data/lib/libv8/v8/src/deoptimizer.cc +1256 -0
  346. data/lib/libv8/v8/src/deoptimizer.h +602 -0
  347. data/lib/libv8/v8/src/disasm.h +80 -0
  348. data/lib/libv8/v8/src/disassembler.cc +343 -0
  349. data/lib/libv8/v8/src/disassembler.h +58 -0
  350. data/lib/libv8/v8/src/diy-fp.cc +58 -0
  351. data/lib/libv8/v8/src/diy-fp.h +117 -0
  352. data/lib/libv8/v8/src/double.h +238 -0
  353. data/lib/libv8/v8/src/dtoa.cc +103 -0
  354. data/lib/libv8/v8/src/dtoa.h +85 -0
  355. data/lib/libv8/v8/src/execution.cc +849 -0
  356. data/lib/libv8/v8/src/execution.h +297 -0
  357. data/lib/libv8/v8/src/extensions/experimental/break-iterator.cc +250 -0
  358. data/lib/libv8/v8/src/extensions/experimental/break-iterator.h +89 -0
  359. data/lib/libv8/v8/src/extensions/experimental/collator.cc +218 -0
  360. data/lib/libv8/v8/src/extensions/experimental/collator.h +69 -0
  361. data/lib/libv8/v8/src/extensions/experimental/experimental.gyp +94 -0
  362. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.cc +78 -0
  363. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.h +54 -0
  364. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.cc +112 -0
  365. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.h +60 -0
  366. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.cc +43 -0
  367. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.h +49 -0
  368. data/lib/libv8/v8/src/extensions/experimental/i18n.js +180 -0
  369. data/lib/libv8/v8/src/extensions/experimental/language-matcher.cc +251 -0
  370. data/lib/libv8/v8/src/extensions/experimental/language-matcher.h +95 -0
  371. data/lib/libv8/v8/src/extensions/externalize-string-extension.cc +141 -0
  372. data/lib/libv8/v8/src/extensions/externalize-string-extension.h +50 -0
  373. data/lib/libv8/v8/src/extensions/gc-extension.cc +58 -0
  374. data/lib/libv8/v8/src/extensions/gc-extension.h +49 -0
  375. data/lib/libv8/v8/src/factory.cc +1222 -0
  376. data/lib/libv8/v8/src/factory.h +442 -0
  377. data/lib/libv8/v8/src/fast-dtoa.cc +736 -0
  378. data/lib/libv8/v8/src/fast-dtoa.h +83 -0
  379. data/lib/libv8/v8/src/fixed-dtoa.cc +405 -0
  380. data/lib/libv8/v8/src/fixed-dtoa.h +55 -0
  381. data/lib/libv8/v8/src/flag-definitions.h +560 -0
  382. data/lib/libv8/v8/src/flags.cc +551 -0
  383. data/lib/libv8/v8/src/flags.h +79 -0
  384. data/lib/libv8/v8/src/frames-inl.h +247 -0
  385. data/lib/libv8/v8/src/frames.cc +1243 -0
  386. data/lib/libv8/v8/src/frames.h +870 -0
  387. data/lib/libv8/v8/src/full-codegen.cc +1374 -0
  388. data/lib/libv8/v8/src/full-codegen.h +771 -0
  389. data/lib/libv8/v8/src/func-name-inferrer.cc +92 -0
  390. data/lib/libv8/v8/src/func-name-inferrer.h +111 -0
  391. data/lib/libv8/v8/src/gdb-jit.cc +1555 -0
  392. data/lib/libv8/v8/src/gdb-jit.h +143 -0
  393. data/lib/libv8/v8/src/global-handles.cc +665 -0
  394. data/lib/libv8/v8/src/global-handles.h +284 -0
  395. data/lib/libv8/v8/src/globals.h +325 -0
  396. data/lib/libv8/v8/src/handles-inl.h +177 -0
  397. data/lib/libv8/v8/src/handles.cc +987 -0
  398. data/lib/libv8/v8/src/handles.h +382 -0
  399. data/lib/libv8/v8/src/hashmap.cc +230 -0
  400. data/lib/libv8/v8/src/hashmap.h +123 -0
  401. data/lib/libv8/v8/src/heap-inl.h +704 -0
  402. data/lib/libv8/v8/src/heap-profiler.cc +1173 -0
  403. data/lib/libv8/v8/src/heap-profiler.h +397 -0
  404. data/lib/libv8/v8/src/heap.cc +5930 -0
  405. data/lib/libv8/v8/src/heap.h +2268 -0
  406. data/lib/libv8/v8/src/hydrogen-instructions.cc +1769 -0
  407. data/lib/libv8/v8/src/hydrogen-instructions.h +3971 -0
  408. data/lib/libv8/v8/src/hydrogen.cc +6239 -0
  409. data/lib/libv8/v8/src/hydrogen.h +1202 -0
  410. data/lib/libv8/v8/src/ia32/assembler-ia32-inl.h +446 -0
  411. data/lib/libv8/v8/src/ia32/assembler-ia32.cc +2487 -0
  412. data/lib/libv8/v8/src/ia32/assembler-ia32.h +1144 -0
  413. data/lib/libv8/v8/src/ia32/builtins-ia32.cc +1621 -0
  414. data/lib/libv8/v8/src/ia32/code-stubs-ia32.cc +6198 -0
  415. data/lib/libv8/v8/src/ia32/code-stubs-ia32.h +517 -0
  416. data/lib/libv8/v8/src/ia32/codegen-ia32.cc +265 -0
  417. data/lib/libv8/v8/src/ia32/codegen-ia32.h +79 -0
  418. data/lib/libv8/v8/src/ia32/cpu-ia32.cc +88 -0
  419. data/lib/libv8/v8/src/ia32/debug-ia32.cc +312 -0
  420. data/lib/libv8/v8/src/ia32/deoptimizer-ia32.cc +774 -0
  421. data/lib/libv8/v8/src/ia32/disasm-ia32.cc +1628 -0
  422. data/lib/libv8/v8/src/ia32/frames-ia32.cc +45 -0
  423. data/lib/libv8/v8/src/ia32/frames-ia32.h +142 -0
  424. data/lib/libv8/v8/src/ia32/full-codegen-ia32.cc +4338 -0
  425. data/lib/libv8/v8/src/ia32/ic-ia32.cc +1597 -0
  426. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.cc +4461 -0
  427. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.h +375 -0
  428. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.cc +475 -0
  429. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
  430. data/lib/libv8/v8/src/ia32/lithium-ia32.cc +2261 -0
  431. data/lib/libv8/v8/src/ia32/lithium-ia32.h +2396 -0
  432. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.cc +2136 -0
  433. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.h +775 -0
  434. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.cc +1263 -0
  435. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.h +216 -0
  436. data/lib/libv8/v8/src/ia32/simulator-ia32.cc +30 -0
  437. data/lib/libv8/v8/src/ia32/simulator-ia32.h +74 -0
  438. data/lib/libv8/v8/src/ia32/stub-cache-ia32.cc +3847 -0
  439. data/lib/libv8/v8/src/ic-inl.h +130 -0
  440. data/lib/libv8/v8/src/ic.cc +2577 -0
  441. data/lib/libv8/v8/src/ic.h +736 -0
  442. data/lib/libv8/v8/src/inspector.cc +63 -0
  443. data/lib/libv8/v8/src/inspector.h +62 -0
  444. data/lib/libv8/v8/src/interpreter-irregexp.cc +659 -0
  445. data/lib/libv8/v8/src/interpreter-irregexp.h +49 -0
  446. data/lib/libv8/v8/src/isolate-inl.h +50 -0
  447. data/lib/libv8/v8/src/isolate.cc +1869 -0
  448. data/lib/libv8/v8/src/isolate.h +1382 -0
  449. data/lib/libv8/v8/src/json-parser.cc +504 -0
  450. data/lib/libv8/v8/src/json-parser.h +161 -0
  451. data/lib/libv8/v8/src/json.js +342 -0
  452. data/lib/libv8/v8/src/jsregexp.cc +5385 -0
  453. data/lib/libv8/v8/src/jsregexp.h +1492 -0
  454. data/lib/libv8/v8/src/list-inl.h +212 -0
  455. data/lib/libv8/v8/src/list.h +174 -0
  456. data/lib/libv8/v8/src/lithium-allocator-inl.h +142 -0
  457. data/lib/libv8/v8/src/lithium-allocator.cc +2123 -0
  458. data/lib/libv8/v8/src/lithium-allocator.h +630 -0
  459. data/lib/libv8/v8/src/lithium.cc +190 -0
  460. data/lib/libv8/v8/src/lithium.h +597 -0
  461. data/lib/libv8/v8/src/liveedit-debugger.js +1082 -0
  462. data/lib/libv8/v8/src/liveedit.cc +1691 -0
  463. data/lib/libv8/v8/src/liveedit.h +180 -0
  464. data/lib/libv8/v8/src/liveobjectlist-inl.h +126 -0
  465. data/lib/libv8/v8/src/liveobjectlist.cc +2589 -0
  466. data/lib/libv8/v8/src/liveobjectlist.h +322 -0
  467. data/lib/libv8/v8/src/log-inl.h +59 -0
  468. data/lib/libv8/v8/src/log-utils.cc +428 -0
  469. data/lib/libv8/v8/src/log-utils.h +231 -0
  470. data/lib/libv8/v8/src/log.cc +1993 -0
  471. data/lib/libv8/v8/src/log.h +476 -0
  472. data/lib/libv8/v8/src/macro-assembler.h +120 -0
  473. data/lib/libv8/v8/src/macros.py +178 -0
  474. data/lib/libv8/v8/src/mark-compact.cc +3143 -0
  475. data/lib/libv8/v8/src/mark-compact.h +506 -0
  476. data/lib/libv8/v8/src/math.js +264 -0
  477. data/lib/libv8/v8/src/messages.cc +179 -0
  478. data/lib/libv8/v8/src/messages.h +113 -0
  479. data/lib/libv8/v8/src/messages.js +1096 -0
  480. data/lib/libv8/v8/src/mips/assembler-mips-inl.h +312 -0
  481. data/lib/libv8/v8/src/mips/assembler-mips.cc +1960 -0
  482. data/lib/libv8/v8/src/mips/assembler-mips.h +1138 -0
  483. data/lib/libv8/v8/src/mips/builtins-mips.cc +1628 -0
  484. data/lib/libv8/v8/src/mips/code-stubs-mips.cc +6656 -0
  485. data/lib/libv8/v8/src/mips/code-stubs-mips.h +682 -0
  486. data/lib/libv8/v8/src/mips/codegen-mips.cc +52 -0
  487. data/lib/libv8/v8/src/mips/codegen-mips.h +98 -0
  488. data/lib/libv8/v8/src/mips/constants-mips.cc +352 -0
  489. data/lib/libv8/v8/src/mips/constants-mips.h +739 -0
  490. data/lib/libv8/v8/src/mips/cpu-mips.cc +96 -0
  491. data/lib/libv8/v8/src/mips/debug-mips.cc +308 -0
  492. data/lib/libv8/v8/src/mips/deoptimizer-mips.cc +91 -0
  493. data/lib/libv8/v8/src/mips/disasm-mips.cc +1050 -0
  494. data/lib/libv8/v8/src/mips/frames-mips.cc +47 -0
  495. data/lib/libv8/v8/src/mips/frames-mips.h +219 -0
  496. data/lib/libv8/v8/src/mips/full-codegen-mips.cc +4388 -0
  497. data/lib/libv8/v8/src/mips/ic-mips.cc +1580 -0
  498. data/lib/libv8/v8/src/mips/lithium-codegen-mips.h +65 -0
  499. data/lib/libv8/v8/src/mips/lithium-mips.h +307 -0
  500. data/lib/libv8/v8/src/mips/macro-assembler-mips.cc +4056 -0
  501. data/lib/libv8/v8/src/mips/macro-assembler-mips.h +1214 -0
  502. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.cc +1251 -0
  503. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.h +252 -0
  504. data/lib/libv8/v8/src/mips/simulator-mips.cc +2621 -0
  505. data/lib/libv8/v8/src/mips/simulator-mips.h +401 -0
  506. data/lib/libv8/v8/src/mips/stub-cache-mips.cc +4285 -0
  507. data/lib/libv8/v8/src/mirror-debugger.js +2382 -0
  508. data/lib/libv8/v8/src/mksnapshot.cc +328 -0
  509. data/lib/libv8/v8/src/natives.h +64 -0
  510. data/lib/libv8/v8/src/objects-debug.cc +738 -0
  511. data/lib/libv8/v8/src/objects-inl.h +4323 -0
  512. data/lib/libv8/v8/src/objects-printer.cc +829 -0
  513. data/lib/libv8/v8/src/objects-visiting.cc +148 -0
  514. data/lib/libv8/v8/src/objects-visiting.h +424 -0
  515. data/lib/libv8/v8/src/objects.cc +10585 -0
  516. data/lib/libv8/v8/src/objects.h +6838 -0
  517. data/lib/libv8/v8/src/parser.cc +4997 -0
  518. data/lib/libv8/v8/src/parser.h +765 -0
  519. data/lib/libv8/v8/src/platform-cygwin.cc +779 -0
  520. data/lib/libv8/v8/src/platform-freebsd.cc +826 -0
  521. data/lib/libv8/v8/src/platform-linux.cc +1149 -0
  522. data/lib/libv8/v8/src/platform-macos.cc +830 -0
  523. data/lib/libv8/v8/src/platform-nullos.cc +479 -0
  524. data/lib/libv8/v8/src/platform-openbsd.cc +640 -0
  525. data/lib/libv8/v8/src/platform-posix.cc +424 -0
  526. data/lib/libv8/v8/src/platform-solaris.cc +762 -0
  527. data/lib/libv8/v8/src/platform-tls-mac.h +62 -0
  528. data/lib/libv8/v8/src/platform-tls-win32.h +62 -0
  529. data/lib/libv8/v8/src/platform-tls.h +50 -0
  530. data/lib/libv8/v8/src/platform-win32.cc +2021 -0
  531. data/lib/libv8/v8/src/platform.h +667 -0
  532. data/lib/libv8/v8/src/preparse-data-format.h +62 -0
  533. data/lib/libv8/v8/src/preparse-data.cc +183 -0
  534. data/lib/libv8/v8/src/preparse-data.h +225 -0
  535. data/lib/libv8/v8/src/preparser-api.cc +220 -0
  536. data/lib/libv8/v8/src/preparser.cc +1450 -0
  537. data/lib/libv8/v8/src/preparser.h +493 -0
  538. data/lib/libv8/v8/src/prettyprinter.cc +1493 -0
  539. data/lib/libv8/v8/src/prettyprinter.h +223 -0
  540. data/lib/libv8/v8/src/profile-generator-inl.h +128 -0
  541. data/lib/libv8/v8/src/profile-generator.cc +3098 -0
  542. data/lib/libv8/v8/src/profile-generator.h +1126 -0
  543. data/lib/libv8/v8/src/property.cc +105 -0
  544. data/lib/libv8/v8/src/property.h +365 -0
  545. data/lib/libv8/v8/src/proxy.js +83 -0
  546. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp-inl.h +78 -0
  547. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.cc +471 -0
  548. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.h +142 -0
  549. data/lib/libv8/v8/src/regexp-macro-assembler-tracer.cc +373 -0
  550. data/lib/libv8/v8/src/regexp-macro-assembler-tracer.h +104 -0
  551. data/lib/libv8/v8/src/regexp-macro-assembler.cc +267 -0
  552. data/lib/libv8/v8/src/regexp-macro-assembler.h +243 -0
  553. data/lib/libv8/v8/src/regexp-stack.cc +111 -0
  554. data/lib/libv8/v8/src/regexp-stack.h +147 -0
  555. data/lib/libv8/v8/src/regexp.js +483 -0
  556. data/lib/libv8/v8/src/rewriter.cc +360 -0
  557. data/lib/libv8/v8/src/rewriter.h +50 -0
  558. data/lib/libv8/v8/src/runtime-profiler.cc +489 -0
  559. data/lib/libv8/v8/src/runtime-profiler.h +201 -0
  560. data/lib/libv8/v8/src/runtime.cc +12227 -0
  561. data/lib/libv8/v8/src/runtime.h +652 -0
  562. data/lib/libv8/v8/src/runtime.js +649 -0
  563. data/lib/libv8/v8/src/safepoint-table.cc +256 -0
  564. data/lib/libv8/v8/src/safepoint-table.h +270 -0
  565. data/lib/libv8/v8/src/scanner-base.cc +952 -0
  566. data/lib/libv8/v8/src/scanner-base.h +670 -0
  567. data/lib/libv8/v8/src/scanner.cc +345 -0
  568. data/lib/libv8/v8/src/scanner.h +146 -0
  569. data/lib/libv8/v8/src/scopeinfo.cc +646 -0
  570. data/lib/libv8/v8/src/scopeinfo.h +254 -0
  571. data/lib/libv8/v8/src/scopes.cc +1150 -0
  572. data/lib/libv8/v8/src/scopes.h +507 -0
  573. data/lib/libv8/v8/src/serialize.cc +1574 -0
  574. data/lib/libv8/v8/src/serialize.h +589 -0
  575. data/lib/libv8/v8/src/shell.h +55 -0
  576. data/lib/libv8/v8/src/simulator.h +43 -0
  577. data/lib/libv8/v8/src/small-pointer-list.h +163 -0
  578. data/lib/libv8/v8/src/smart-pointer.h +109 -0
  579. data/lib/libv8/v8/src/snapshot-common.cc +83 -0
  580. data/lib/libv8/v8/src/snapshot-empty.cc +54 -0
  581. data/lib/libv8/v8/src/snapshot.h +91 -0
  582. data/lib/libv8/v8/src/spaces-inl.h +529 -0
  583. data/lib/libv8/v8/src/spaces.cc +3145 -0
  584. data/lib/libv8/v8/src/spaces.h +2369 -0
  585. data/lib/libv8/v8/src/splay-tree-inl.h +310 -0
  586. data/lib/libv8/v8/src/splay-tree.h +205 -0
  587. data/lib/libv8/v8/src/string-search.cc +41 -0
  588. data/lib/libv8/v8/src/string-search.h +568 -0
  589. data/lib/libv8/v8/src/string-stream.cc +592 -0
  590. data/lib/libv8/v8/src/string-stream.h +191 -0
  591. data/lib/libv8/v8/src/string.js +994 -0
  592. data/lib/libv8/v8/src/strtod.cc +440 -0
  593. data/lib/libv8/v8/src/strtod.h +40 -0
  594. data/lib/libv8/v8/src/stub-cache.cc +1965 -0
  595. data/lib/libv8/v8/src/stub-cache.h +924 -0
  596. data/lib/libv8/v8/src/third_party/valgrind/valgrind.h +3925 -0
  597. data/lib/libv8/v8/src/token.cc +63 -0
  598. data/lib/libv8/v8/src/token.h +288 -0
  599. data/lib/libv8/v8/src/type-info.cc +507 -0
  600. data/lib/libv8/v8/src/type-info.h +272 -0
  601. data/lib/libv8/v8/src/unbound-queue-inl.h +95 -0
  602. data/lib/libv8/v8/src/unbound-queue.h +69 -0
  603. data/lib/libv8/v8/src/unicode-inl.h +238 -0
  604. data/lib/libv8/v8/src/unicode.cc +1624 -0
  605. data/lib/libv8/v8/src/unicode.h +280 -0
  606. data/lib/libv8/v8/src/uri.js +408 -0
  607. data/lib/libv8/v8/src/utils-inl.h +48 -0
  608. data/lib/libv8/v8/src/utils.cc +371 -0
  609. data/lib/libv8/v8/src/utils.h +800 -0
  610. data/lib/libv8/v8/src/v8-counters.cc +62 -0
  611. data/lib/libv8/v8/src/v8-counters.h +314 -0
  612. data/lib/libv8/v8/src/v8.cc +213 -0
  613. data/lib/libv8/v8/src/v8.h +131 -0
  614. data/lib/libv8/v8/src/v8checks.h +64 -0
  615. data/lib/libv8/v8/src/v8dll-main.cc +44 -0
  616. data/lib/libv8/v8/src/v8globals.h +512 -0
  617. data/lib/libv8/v8/src/v8memory.h +82 -0
  618. data/lib/libv8/v8/src/v8natives.js +1310 -0
  619. data/lib/libv8/v8/src/v8preparserdll-main.cc +39 -0
  620. data/lib/libv8/v8/src/v8threads.cc +464 -0
  621. data/lib/libv8/v8/src/v8threads.h +165 -0
  622. data/lib/libv8/v8/src/v8utils.h +319 -0
  623. data/lib/libv8/v8/src/variables.cc +114 -0
  624. data/lib/libv8/v8/src/variables.h +167 -0
  625. data/lib/libv8/v8/src/version.cc +116 -0
  626. data/lib/libv8/v8/src/version.h +68 -0
  627. data/lib/libv8/v8/src/vm-state-inl.h +138 -0
  628. data/lib/libv8/v8/src/vm-state.h +71 -0
  629. data/lib/libv8/v8/src/win32-headers.h +96 -0
  630. data/lib/libv8/v8/src/x64/assembler-x64-inl.h +462 -0
  631. data/lib/libv8/v8/src/x64/assembler-x64.cc +3027 -0
  632. data/lib/libv8/v8/src/x64/assembler-x64.h +1633 -0
  633. data/lib/libv8/v8/src/x64/builtins-x64.cc +1520 -0
  634. data/lib/libv8/v8/src/x64/code-stubs-x64.cc +5132 -0
  635. data/lib/libv8/v8/src/x64/code-stubs-x64.h +514 -0
  636. data/lib/libv8/v8/src/x64/codegen-x64.cc +146 -0
  637. data/lib/libv8/v8/src/x64/codegen-x64.h +76 -0
  638. data/lib/libv8/v8/src/x64/cpu-x64.cc +88 -0
  639. data/lib/libv8/v8/src/x64/debug-x64.cc +319 -0
  640. data/lib/libv8/v8/src/x64/deoptimizer-x64.cc +815 -0
  641. data/lib/libv8/v8/src/x64/disasm-x64.cc +1832 -0
  642. data/lib/libv8/v8/src/x64/frames-x64.cc +45 -0
  643. data/lib/libv8/v8/src/x64/frames-x64.h +130 -0
  644. data/lib/libv8/v8/src/x64/full-codegen-x64.cc +4318 -0
  645. data/lib/libv8/v8/src/x64/ic-x64.cc +1608 -0
  646. data/lib/libv8/v8/src/x64/lithium-codegen-x64.cc +4267 -0
  647. data/lib/libv8/v8/src/x64/lithium-codegen-x64.h +367 -0
  648. data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.cc +320 -0
  649. data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.h +74 -0
  650. data/lib/libv8/v8/src/x64/lithium-x64.cc +2202 -0
  651. data/lib/libv8/v8/src/x64/lithium-x64.h +2333 -0
  652. data/lib/libv8/v8/src/x64/macro-assembler-x64.cc +3745 -0
  653. data/lib/libv8/v8/src/x64/macro-assembler-x64.h +1290 -0
  654. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.cc +1398 -0
  655. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.h +282 -0
  656. data/lib/libv8/v8/src/x64/simulator-x64.cc +27 -0
  657. data/lib/libv8/v8/src/x64/simulator-x64.h +72 -0
  658. data/lib/libv8/v8/src/x64/stub-cache-x64.cc +3610 -0
  659. data/lib/libv8/v8/src/zone-inl.h +140 -0
  660. data/lib/libv8/v8/src/zone.cc +196 -0
  661. data/lib/libv8/v8/src/zone.h +240 -0
  662. data/lib/libv8/v8/tools/codemap.js +265 -0
  663. data/lib/libv8/v8/tools/consarray.js +93 -0
  664. data/lib/libv8/v8/tools/csvparser.js +78 -0
  665. data/lib/libv8/v8/tools/disasm.py +92 -0
  666. data/lib/libv8/v8/tools/freebsd-tick-processor +10 -0
  667. data/lib/libv8/v8/tools/gc-nvp-trace-processor.py +342 -0
  668. data/lib/libv8/v8/tools/gcmole/README +62 -0
  669. data/lib/libv8/v8/tools/gcmole/gccause.lua +60 -0
  670. data/lib/libv8/v8/tools/gcmole/gcmole.cc +1261 -0
  671. data/lib/libv8/v8/tools/gcmole/gcmole.lua +378 -0
  672. data/lib/libv8/v8/tools/generate-ten-powers.scm +286 -0
  673. data/lib/libv8/v8/tools/grokdump.py +841 -0
  674. data/lib/libv8/v8/tools/gyp/v8.gyp +995 -0
  675. data/lib/libv8/v8/tools/js2c.py +364 -0
  676. data/lib/libv8/v8/tools/jsmin.py +280 -0
  677. data/lib/libv8/v8/tools/linux-tick-processor +35 -0
  678. data/lib/libv8/v8/tools/ll_prof.py +942 -0
  679. data/lib/libv8/v8/tools/logreader.js +185 -0
  680. data/lib/libv8/v8/tools/mac-nm +18 -0
  681. data/lib/libv8/v8/tools/mac-tick-processor +6 -0
  682. data/lib/libv8/v8/tools/oom_dump/README +31 -0
  683. data/lib/libv8/v8/tools/oom_dump/SConstruct +42 -0
  684. data/lib/libv8/v8/tools/oom_dump/oom_dump.cc +288 -0
  685. data/lib/libv8/v8/tools/presubmit.py +305 -0
  686. data/lib/libv8/v8/tools/process-heap-prof.py +120 -0
  687. data/lib/libv8/v8/tools/profile.js +751 -0
  688. data/lib/libv8/v8/tools/profile_view.js +219 -0
  689. data/lib/libv8/v8/tools/run-valgrind.py +77 -0
  690. data/lib/libv8/v8/tools/splaytree.js +316 -0
  691. data/lib/libv8/v8/tools/stats-viewer.py +468 -0
  692. data/lib/libv8/v8/tools/test.py +1510 -0
  693. data/lib/libv8/v8/tools/tickprocessor-driver.js +59 -0
  694. data/lib/libv8/v8/tools/tickprocessor.js +877 -0
  695. data/lib/libv8/v8/tools/utils.py +96 -0
  696. data/lib/libv8/v8/tools/visual_studio/README.txt +12 -0
  697. data/lib/libv8/v8/tools/windows-tick-processor.bat +30 -0
  698. data/lib/libv8/version.rb +4 -0
  699. data/libv8.gemspec +31 -0
  700. metadata +800 -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 5134 2010/08/16 23:02:40 bdeegan
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 "August 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,196 @@
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 5134 2010/08/16 23:02:40 bdeegan"
28
+
29
+ __version__ = "2.0.1"
30
+
31
+ __build__ = "r5134"
32
+
33
+ __buildsys__ = "cooldog"
34
+
35
+ __date__ = "2010/08/16 23:02:40"
36
+
37
+ __developer__ = "bdeegan"
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 "SCONS_LIB_DIR" in os.environ:
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 = [os.path.join(x, 'lib') for x in prefs]
141
+ temp.extend([os.path.join(x,
142
+ 'lib',
143
+ 'python' + sys.version[:3],
144
+ 'site-packages') for x in prefs])
145
+ prefs = temp
146
+
147
+ # Add the parent directory of the current python's library to the
148
+ # preferences. On SuSE-91/AMD64, for example, this is /usr/lib64,
149
+ # not /usr/lib.
150
+ try:
151
+ libpath = os.__file__
152
+ except AttributeError:
153
+ pass
154
+ else:
155
+ # Split /usr/libfoo/python*/os.py to /usr/libfoo/python*.
156
+ libpath, tail = os.path.split(libpath)
157
+ # Split /usr/libfoo/python* to /usr/libfoo
158
+ libpath, tail = os.path.split(libpath)
159
+ # Check /usr/libfoo/scons*.
160
+ prefs.append(libpath)
161
+
162
+ try:
163
+ import pkg_resources
164
+ except ImportError:
165
+ pass
166
+ else:
167
+ # when running from an egg add the egg's directory
168
+ try:
169
+ d = pkg_resources.get_distribution('scons')
170
+ except pkg_resources.DistributionNotFound:
171
+ pass
172
+ else:
173
+ prefs.append(d.location)
174
+
175
+ # Look first for 'scons-__version__' in all of our preference libs,
176
+ # then for 'scons'.
177
+ libs.extend([os.path.join(x, scons_version) for x in prefs])
178
+ libs.extend([os.path.join(x, 'scons') for x in prefs])
179
+
180
+ sys.path = libs + sys.path
181
+
182
+ ##############################################################################
183
+ # END STANDARD SCons SCRIPT HEADER
184
+ ##############################################################################
185
+
186
+ if __name__ == "__main__":
187
+ import SCons.Script
188
+ # this does all the work, and calls sys.exit
189
+ # with the proper exit status when done.
190
+ SCons.Script.main()
191
+
192
+ # Local Variables:
193
+ # tab-width:4
194
+ # indent-tabs-mode:nil
195
+ # End:
196
+ # vim: set expandtab tabstop=4 shiftwidth=4:
@@ -0,0 +1,1544 @@
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
+ from __future__ import division
33
+ from __future__ import nested_scopes
34
+
35
+ __revision__ = "src/script/scons-time.py 5134 2010/08/16 23:02:40 bdeegan"
36
+
37
+ import getopt
38
+ import glob
39
+ import os
40
+ import re
41
+ import shutil
42
+ import sys
43
+ import tempfile
44
+ import time
45
+
46
+ try:
47
+ sorted
48
+ except NameError:
49
+ # Pre-2.4 Python has no sorted() function.
50
+ #
51
+ # The pre-2.4 Python list.sort() method does not support
52
+ # list.sort(key=) nor list.sort(reverse=) keyword arguments, so
53
+ # we must implement the functionality of those keyword arguments
54
+ # by hand instead of passing them to list.sort().
55
+ def sorted(iterable, cmp=None, key=None, reverse=False):
56
+ if key is not None:
57
+ result = [(key(x), x) for x in iterable]
58
+ else:
59
+ result = iterable[:]
60
+ if cmp is None:
61
+ # Pre-2.3 Python does not support list.sort(None).
62
+ result.sort()
63
+ else:
64
+ result.sort(cmp)
65
+ if key is not None:
66
+ result = [t1 for t0,t1 in result]
67
+ if reverse:
68
+ result.reverse()
69
+ return result
70
+
71
+ if os.environ.get('SCONS_HORRIBLE_REGRESSION_TEST_HACK') is not None:
72
+ # We can't apply the 'callable' fixer until the floor is 2.6, but the
73
+ # '-3' option to Python 2.6 and 2.7 generates almost ten thousand
74
+ # warnings. This hack allows us to run regression tests with the '-3'
75
+ # option by replacing the callable() built-in function with a hack
76
+ # that performs the same function but doesn't generate the warning.
77
+ # Note that this hack is ONLY intended to be used for regression
78
+ # testing, and should NEVER be used for real runs.
79
+ from types import ClassType
80
+ def callable(obj):
81
+ if hasattr(obj, '__call__'): return True
82
+ if isinstance(obj, (ClassType, type)): return True
83
+ return False
84
+
85
+ def make_temp_file(**kw):
86
+ try:
87
+ result = tempfile.mktemp(**kw)
88
+ try:
89
+ result = os.path.realpath(result)
90
+ except AttributeError:
91
+ # Python 2.1 has no os.path.realpath() method.
92
+ pass
93
+ except TypeError:
94
+ try:
95
+ save_template = tempfile.template
96
+ prefix = kw['prefix']
97
+ del kw['prefix']
98
+ tempfile.template = prefix
99
+ result = tempfile.mktemp(**kw)
100
+ finally:
101
+ tempfile.template = save_template
102
+ return result
103
+
104
+ def HACK_for_exec(cmd, *args):
105
+ '''
106
+ For some reason, Python won't allow an exec() within a function
107
+ that also declares an internal function (including lambda functions).
108
+ This function is a hack that calls exec() in a function with no
109
+ internal functions.
110
+ '''
111
+ if not args: exec(cmd)
112
+ elif len(args) == 1: exec cmd in args[0]
113
+ else: exec cmd in args[0], args[1]
114
+
115
+ class Plotter(object):
116
+ def increment_size(self, largest):
117
+ """
118
+ Return the size of each horizontal increment line for a specified
119
+ maximum value. This returns a value that will provide somewhere
120
+ between 5 and 9 horizontal lines on the graph, on some set of
121
+ boundaries that are multiples of 10/100/1000/etc.
122
+ """
123
+ i = largest // 5
124
+ if not i:
125
+ return largest
126
+ multiplier = 1
127
+ while i >= 10:
128
+ i = i // 10
129
+ multiplier = multiplier * 10
130
+ return i * multiplier
131
+
132
+ def max_graph_value(self, largest):
133
+ # Round up to next integer.
134
+ largest = int(largest) + 1
135
+ increment = self.increment_size(largest)
136
+ return ((largest + increment - 1) // increment) * increment
137
+
138
+ class Line(object):
139
+ def __init__(self, points, type, title, label, comment, fmt="%s %s"):
140
+ self.points = points
141
+ self.type = type
142
+ self.title = title
143
+ self.label = label
144
+ self.comment = comment
145
+ self.fmt = fmt
146
+
147
+ def print_label(self, inx, x, y):
148
+ if self.label:
149
+ print 'set label %s "%s" at %s,%s right' % (inx, self.label, x, y)
150
+
151
+ def plot_string(self):
152
+ if self.title:
153
+ title_string = 'title "%s"' % self.title
154
+ else:
155
+ title_string = 'notitle'
156
+ return "'-' %s with lines lt %s" % (title_string, self.type)
157
+
158
+ def print_points(self, fmt=None):
159
+ if fmt is None:
160
+ fmt = self.fmt
161
+ if self.comment:
162
+ print '# %s' % self.comment
163
+ for x, y in self.points:
164
+ # If y is None, it usually represents some kind of break
165
+ # in the line's index number. We might want to represent
166
+ # this some way rather than just drawing the line straight
167
+ # between the two points on either side.
168
+ if not y is None:
169
+ print fmt % (x, y)
170
+ print 'e'
171
+
172
+ def get_x_values(self):
173
+ return [ p[0] for p in self.points ]
174
+
175
+ def get_y_values(self):
176
+ return [ p[1] for p in self.points ]
177
+
178
+ class Gnuplotter(Plotter):
179
+
180
+ def __init__(self, title, key_location):
181
+ self.lines = []
182
+ self.title = title
183
+ self.key_location = key_location
184
+
185
+ def line(self, points, type, title=None, label=None, comment=None, fmt='%s %s'):
186
+ if points:
187
+ line = Line(points, type, title, label, comment, fmt)
188
+ self.lines.append(line)
189
+
190
+ def plot_string(self, line):
191
+ return line.plot_string()
192
+
193
+ def vertical_bar(self, x, type, label, comment):
194
+ if self.get_min_x() <= x and x <= self.get_max_x():
195
+ points = [(x, 0), (x, self.max_graph_value(self.get_max_y()))]
196
+ self.line(points, type, label, comment)
197
+
198
+ def get_all_x_values(self):
199
+ result = []
200
+ for line in self.lines:
201
+ result.extend(line.get_x_values())
202
+ return [r for r in result if not r is None]
203
+
204
+ def get_all_y_values(self):
205
+ result = []
206
+ for line in self.lines:
207
+ result.extend(line.get_y_values())
208
+ return [r for r in result if not r is None]
209
+
210
+ def get_min_x(self):
211
+ try:
212
+ return self.min_x
213
+ except AttributeError:
214
+ try:
215
+ self.min_x = min(self.get_all_x_values())
216
+ except ValueError:
217
+ self.min_x = 0
218
+ return self.min_x
219
+
220
+ def get_max_x(self):
221
+ try:
222
+ return self.max_x
223
+ except AttributeError:
224
+ try:
225
+ self.max_x = max(self.get_all_x_values())
226
+ except ValueError:
227
+ self.max_x = 0
228
+ return self.max_x
229
+
230
+ def get_min_y(self):
231
+ try:
232
+ return self.min_y
233
+ except AttributeError:
234
+ try:
235
+ self.min_y = min(self.get_all_y_values())
236
+ except ValueError:
237
+ self.min_y = 0
238
+ return self.min_y
239
+
240
+ def get_max_y(self):
241
+ try:
242
+ return self.max_y
243
+ except AttributeError:
244
+ try:
245
+ self.max_y = max(self.get_all_y_values())
246
+ except ValueError:
247
+ self.max_y = 0
248
+ return self.max_y
249
+
250
+ def draw(self):
251
+
252
+ if not self.lines:
253
+ return
254
+
255
+ if self.title:
256
+ print 'set title "%s"' % self.title
257
+ print 'set key %s' % self.key_location
258
+
259
+ min_y = self.get_min_y()
260
+ max_y = self.max_graph_value(self.get_max_y())
261
+ incr = (max_y - min_y) / 10.0
262
+ start = min_y + (max_y / 2.0) + (2.0 * incr)
263
+ position = [ start - (i * incr) for i in range(5) ]
264
+
265
+ inx = 1
266
+ for line in self.lines:
267
+ line.print_label(inx, line.points[0][0]-1,
268
+ position[(inx-1) % len(position)])
269
+ inx += 1
270
+
271
+ plot_strings = [ self.plot_string(l) for l in self.lines ]
272
+ print 'plot ' + ', \\\n '.join(plot_strings)
273
+
274
+ for line in self.lines:
275
+ line.print_points()
276
+
277
+
278
+
279
+ def untar(fname):
280
+ import tarfile
281
+ tar = tarfile.open(name=fname, mode='r')
282
+ for tarinfo in tar:
283
+ tar.extract(tarinfo)
284
+ tar.close()
285
+
286
+ def unzip(fname):
287
+ import zipfile
288
+ zf = zipfile.ZipFile(fname, 'r')
289
+ for name in zf.namelist():
290
+ dir = os.path.dirname(name)
291
+ try:
292
+ os.makedirs(dir)
293
+ except:
294
+ pass
295
+ open(name, 'w').write(zf.read(name))
296
+
297
+ def read_tree(dir):
298
+ for dirpath, dirnames, filenames in os.walk(dir):
299
+ for fn in filenames:
300
+ fn = os.path.join(dirpath, fn)
301
+ if os.path.isfile(fn):
302
+ open(fn, 'rb').read()
303
+
304
+ def redirect_to_file(command, log):
305
+ return '%s > %s 2>&1' % (command, log)
306
+
307
+ def tee_to_file(command, log):
308
+ return '%s 2>&1 | tee %s' % (command, log)
309
+
310
+
311
+
312
+ class SConsTimer(object):
313
+ """
314
+ Usage: scons-time SUBCOMMAND [ARGUMENTS]
315
+ Type "scons-time help SUBCOMMAND" for help on a specific subcommand.
316
+
317
+ Available subcommands:
318
+ func Extract test-run data for a function
319
+ help Provides help
320
+ mem Extract --debug=memory data from test runs
321
+ obj Extract --debug=count data from test runs
322
+ time Extract --debug=time data from test runs
323
+ run Runs a test configuration
324
+ """
325
+
326
+ name = 'scons-time'
327
+ name_spaces = ' '*len(name)
328
+
329
+ def makedict(**kw):
330
+ return kw
331
+
332
+ default_settings = makedict(
333
+ aegis = 'aegis',
334
+ aegis_project = None,
335
+ chdir = None,
336
+ config_file = None,
337
+ initial_commands = [],
338
+ key_location = 'bottom left',
339
+ orig_cwd = os.getcwd(),
340
+ outdir = None,
341
+ prefix = '',
342
+ python = '"%s"' % sys.executable,
343
+ redirect = redirect_to_file,
344
+ scons = None,
345
+ scons_flags = '--debug=count --debug=memory --debug=time --debug=memoizer',
346
+ scons_lib_dir = None,
347
+ scons_wrapper = None,
348
+ startup_targets = '--help',
349
+ subdir = None,
350
+ subversion_url = None,
351
+ svn = 'svn',
352
+ svn_co_flag = '-q',
353
+ tar = 'tar',
354
+ targets = '',
355
+ targets0 = None,
356
+ targets1 = None,
357
+ targets2 = None,
358
+ title = None,
359
+ unzip = 'unzip',
360
+ verbose = False,
361
+ vertical_bars = [],
362
+
363
+ unpack_map = {
364
+ '.tar.gz' : (untar, '%(tar)s xzf %%s'),
365
+ '.tgz' : (untar, '%(tar)s xzf %%s'),
366
+ '.tar' : (untar, '%(tar)s xf %%s'),
367
+ '.zip' : (unzip, '%(unzip)s %%s'),
368
+ },
369
+ )
370
+
371
+ run_titles = [
372
+ 'Startup',
373
+ 'Full build',
374
+ 'Up-to-date build',
375
+ ]
376
+
377
+ run_commands = [
378
+ '%(python)s %(scons_wrapper)s %(scons_flags)s --profile=%(prof0)s %(targets0)s',
379
+ '%(python)s %(scons_wrapper)s %(scons_flags)s --profile=%(prof1)s %(targets1)s',
380
+ '%(python)s %(scons_wrapper)s %(scons_flags)s --profile=%(prof2)s %(targets2)s',
381
+ ]
382
+
383
+ stages = [
384
+ 'pre-read',
385
+ 'post-read',
386
+ 'pre-build',
387
+ 'post-build',
388
+ ]
389
+
390
+ stage_strings = {
391
+ 'pre-read' : 'Memory before reading SConscript files:',
392
+ 'post-read' : 'Memory after reading SConscript files:',
393
+ 'pre-build' : 'Memory before building targets:',
394
+ 'post-build' : 'Memory after building targets:',
395
+ }
396
+
397
+ memory_string_all = 'Memory '
398
+
399
+ default_stage = stages[-1]
400
+
401
+ time_strings = {
402
+ 'total' : 'Total build time',
403
+ 'SConscripts' : 'Total SConscript file execution time',
404
+ 'SCons' : 'Total SCons execution time',
405
+ 'commands' : 'Total command execution time',
406
+ }
407
+
408
+ time_string_all = 'Total .* time'
409
+
410
+ #
411
+
412
+ def __init__(self):
413
+ self.__dict__.update(self.default_settings)
414
+
415
+ # Functions for displaying and executing commands.
416
+
417
+ def subst(self, x, dictionary):
418
+ try:
419
+ return x % dictionary
420
+ except TypeError:
421
+ # x isn't a string (it's probably a Python function),
422
+ # so just return it.
423
+ return x
424
+
425
+ def subst_variables(self, command, dictionary):
426
+ """
427
+ Substitutes (via the format operator) the values in the specified
428
+ dictionary into the specified command.
429
+
430
+ The command can be an (action, string) tuple. In all cases, we
431
+ perform substitution on strings and don't worry if something isn't
432
+ a string. (It's probably a Python function to be executed.)
433
+ """
434
+ try:
435
+ command + ''
436
+ except TypeError:
437
+ action = command[0]
438
+ string = command[1]
439
+ args = command[2:]
440
+ else:
441
+ action = command
442
+ string = action
443
+ args = (())
444
+ action = self.subst(action, dictionary)
445
+ string = self.subst(string, dictionary)
446
+ return (action, string, args)
447
+
448
+ def _do_not_display(self, msg, *args):
449
+ pass
450
+
451
+ def display(self, msg, *args):
452
+ """
453
+ Displays the specified message.
454
+
455
+ Each message is prepended with a standard prefix of our name
456
+ plus the time.
457
+ """
458
+ if callable(msg):
459
+ msg = msg(*args)
460
+ else:
461
+ msg = msg % args
462
+ if msg is None:
463
+ return
464
+ fmt = '%s[%s]: %s\n'
465
+ sys.stdout.write(fmt % (self.name, time.strftime('%H:%M:%S'), msg))
466
+
467
+ def _do_not_execute(self, action, *args):
468
+ pass
469
+
470
+ def execute(self, action, *args):
471
+ """
472
+ Executes the specified action.
473
+
474
+ The action is called if it's a callable Python function, and
475
+ otherwise passed to os.system().
476
+ """
477
+ if callable(action):
478
+ action(*args)
479
+ else:
480
+ os.system(action % args)
481
+
482
+ def run_command_list(self, commands, dict):
483
+ """
484
+ Executes a list of commands, substituting values from the
485
+ specified dictionary.
486
+ """
487
+ commands = [ self.subst_variables(c, dict) for c in commands ]
488
+ for action, string, args in commands:
489
+ self.display(string, *args)
490
+ sys.stdout.flush()
491
+ status = self.execute(action, *args)
492
+ if status:
493
+ sys.exit(status)
494
+
495
+ def log_display(self, command, log):
496
+ command = self.subst(command, self.__dict__)
497
+ if log:
498
+ command = self.redirect(command, log)
499
+ return command
500
+
501
+ def log_execute(self, command, log):
502
+ command = self.subst(command, self.__dict__)
503
+ output = os.popen(command).read()
504
+ if self.verbose:
505
+ sys.stdout.write(output)
506
+ open(log, 'wb').write(output)
507
+
508
+ #
509
+
510
+ def archive_splitext(self, path):
511
+ """
512
+ Splits an archive name into a filename base and extension.
513
+
514
+ This is like os.path.splitext() (which it calls) except that it
515
+ also looks for '.tar.gz' and treats it as an atomic extensions.
516
+ """
517
+ if path.endswith('.tar.gz'):
518
+ return path[:-7], path[-7:]
519
+ else:
520
+ return os.path.splitext(path)
521
+
522
+ def args_to_files(self, args, tail=None):
523
+ """
524
+ Takes a list of arguments, expands any glob patterns, and
525
+ returns the last "tail" files from the list.
526
+ """
527
+ files = []
528
+ for a in args:
529
+ files.extend(sorted(glob.glob(a)))
530
+
531
+ if tail:
532
+ files = files[-tail:]
533
+
534
+ return files
535
+
536
+ def ascii_table(self, files, columns,
537
+ line_function, file_function=lambda x: x,
538
+ *args, **kw):
539
+
540
+ header_fmt = ' '.join(['%12s'] * len(columns))
541
+ line_fmt = header_fmt + ' %s'
542
+
543
+ print header_fmt % columns
544
+
545
+ for file in files:
546
+ t = line_function(file, *args, **kw)
547
+ if t is None:
548
+ t = []
549
+ diff = len(columns) - len(t)
550
+ if diff > 0:
551
+ t += [''] * diff
552
+ t.append(file_function(file))
553
+ print line_fmt % tuple(t)
554
+
555
+ def collect_results(self, files, function, *args, **kw):
556
+ results = {}
557
+
558
+ for file in files:
559
+ base = os.path.splitext(file)[0]
560
+ run, index = base.split('-')[-2:]
561
+
562
+ run = int(run)
563
+ index = int(index)
564
+
565
+ value = function(file, *args, **kw)
566
+
567
+ try:
568
+ r = results[index]
569
+ except KeyError:
570
+ r = []
571
+ results[index] = r
572
+ r.append((run, value))
573
+
574
+ return results
575
+
576
+ def doc_to_help(self, obj):
577
+ """
578
+ Translates an object's __doc__ string into help text.
579
+
580
+ This strips a consistent number of spaces from each line in the
581
+ help text, essentially "outdenting" the text to the left-most
582
+ column.
583
+ """
584
+ doc = obj.__doc__
585
+ if doc is None:
586
+ return ''
587
+ return self.outdent(doc)
588
+
589
+ def find_next_run_number(self, dir, prefix):
590
+ """
591
+ Returns the next run number in a directory for the specified prefix.
592
+
593
+ Examines the contents the specified directory for files with the
594
+ specified prefix, extracts the run numbers from each file name,
595
+ and returns the next run number after the largest it finds.
596
+ """
597
+ x = re.compile(re.escape(prefix) + '-([0-9]+).*')
598
+ matches = [x.match(e) for e in os.listdir(dir)]
599
+ matches = [_f for _f in matches if _f]
600
+ if not matches:
601
+ return 0
602
+ run_numbers = [int(m.group(1)) for m in matches]
603
+ return int(max(run_numbers)) + 1
604
+
605
+ def gnuplot_results(self, results, fmt='%s %.3f'):
606
+ """
607
+ Prints out a set of results in Gnuplot format.
608
+ """
609
+ gp = Gnuplotter(self.title, self.key_location)
610
+
611
+ for i in sorted(results.keys()):
612
+ try:
613
+ t = self.run_titles[i]
614
+ except IndexError:
615
+ t = '??? %s ???' % i
616
+ results[i].sort()
617
+ gp.line(results[i], i+1, t, None, t, fmt=fmt)
618
+
619
+ for bar_tuple in self.vertical_bars:
620
+ try:
621
+ x, type, label, comment = bar_tuple
622
+ except ValueError:
623
+ x, type, label = bar_tuple
624
+ comment = label
625
+ gp.vertical_bar(x, type, label, comment)
626
+
627
+ gp.draw()
628
+
629
+ def logfile_name(self, invocation):
630
+ """
631
+ Returns the absolute path of a log file for the specificed
632
+ invocation number.
633
+ """
634
+ name = self.prefix_run + '-%d.log' % invocation
635
+ return os.path.join(self.outdir, name)
636
+
637
+ def outdent(self, s):
638
+ """
639
+ Strip as many spaces from each line as are found at the beginning
640
+ of the first line in the list.
641
+ """
642
+ lines = s.split('\n')
643
+ if lines[0] == '':
644
+ lines = lines[1:]
645
+ spaces = re.match(' *', lines[0]).group(0)
646
+ def strip_initial_spaces(l, s=spaces):
647
+ if l.startswith(spaces):
648
+ l = l[len(spaces):]
649
+ return l
650
+ return '\n'.join([ strip_initial_spaces(l) for l in lines ]) + '\n'
651
+
652
+ def profile_name(self, invocation):
653
+ """
654
+ Returns the absolute path of a profile file for the specified
655
+ invocation number.
656
+ """
657
+ name = self.prefix_run + '-%d.prof' % invocation
658
+ return os.path.join(self.outdir, name)
659
+
660
+ def set_env(self, key, value):
661
+ os.environ[key] = value
662
+
663
+ #
664
+
665
+ def get_debug_times(self, file, time_string=None):
666
+ """
667
+ Fetch times from the --debug=time strings in the specified file.
668
+ """
669
+ if time_string is None:
670
+ search_string = self.time_string_all
671
+ else:
672
+ search_string = time_string
673
+ contents = open(file).read()
674
+ if not contents:
675
+ sys.stderr.write('file %s has no contents!\n' % repr(file))
676
+ return None
677
+ result = re.findall(r'%s: ([\d\.]*)' % search_string, contents)[-4:]
678
+ result = [ float(r) for r in result ]
679
+ if not time_string is None:
680
+ try:
681
+ result = result[0]
682
+ except IndexError:
683
+ sys.stderr.write('file %s has no results!\n' % repr(file))
684
+ return None
685
+ return result
686
+
687
+ def get_function_profile(self, file, function):
688
+ """
689
+ Returns the file, line number, function name, and cumulative time.
690
+ """
691
+ try:
692
+ import pstats
693
+ except ImportError, e:
694
+ sys.stderr.write('%s: func: %s\n' % (self.name, e))
695
+ sys.stderr.write('%s This version of Python is missing the profiler.\n' % self.name_spaces)
696
+ sys.stderr.write('%s Cannot use the "func" subcommand.\n' % self.name_spaces)
697
+ sys.exit(1)
698
+ statistics = pstats.Stats(file).stats
699
+ matches = [ e for e in statistics.items() if e[0][2] == function ]
700
+ r = matches[0]
701
+ return r[0][0], r[0][1], r[0][2], r[1][3]
702
+
703
+ def get_function_time(self, file, function):
704
+ """
705
+ Returns just the cumulative time for the specified function.
706
+ """
707
+ return self.get_function_profile(file, function)[3]
708
+
709
+ def get_memory(self, file, memory_string=None):
710
+ """
711
+ Returns a list of integers of the amount of memory used. The
712
+ default behavior is to return all the stages.
713
+ """
714
+ if memory_string is None:
715
+ search_string = self.memory_string_all
716
+ else:
717
+ search_string = memory_string
718
+ lines = open(file).readlines()
719
+ lines = [ l for l in lines if l.startswith(search_string) ][-4:]
720
+ result = [ int(l.split()[-1]) for l in lines[-4:] ]
721
+ if len(result) == 1:
722
+ result = result[0]
723
+ return result
724
+
725
+ def get_object_counts(self, file, object_name, index=None):
726
+ """
727
+ Returns the counts of the specified object_name.
728
+ """
729
+ object_string = ' ' + object_name + '\n'
730
+ lines = open(file).readlines()
731
+ line = [ l for l in lines if l.endswith(object_string) ][0]
732
+ result = [ int(field) for field in line.split()[:4] ]
733
+ if index is not None:
734
+ result = result[index]
735
+ return result
736
+
737
+ #
738
+
739
+ command_alias = {}
740
+
741
+ def execute_subcommand(self, argv):
742
+ """
743
+ Executes the do_*() function for the specified subcommand (argv[0]).
744
+ """
745
+ if not argv:
746
+ return
747
+ cmdName = self.command_alias.get(argv[0], argv[0])
748
+ try:
749
+ func = getattr(self, 'do_' + cmdName)
750
+ except AttributeError:
751
+ return self.default(argv)
752
+ try:
753
+ return func(argv)
754
+ except TypeError, e:
755
+ sys.stderr.write("%s %s: %s\n" % (self.name, cmdName, e))
756
+ import traceback
757
+ traceback.print_exc(file=sys.stderr)
758
+ sys.stderr.write("Try '%s help %s'\n" % (self.name, cmdName))
759
+
760
+ def default(self, argv):
761
+ """
762
+ The default behavior for an unknown subcommand. Prints an
763
+ error message and exits.
764
+ """
765
+ sys.stderr.write('%s: Unknown subcommand "%s".\n' % (self.name, argv[0]))
766
+ sys.stderr.write('Type "%s help" for usage.\n' % self.name)
767
+ sys.exit(1)
768
+
769
+ #
770
+
771
+ def do_help(self, argv):
772
+ """
773
+ """
774
+ if argv[1:]:
775
+ for arg in argv[1:]:
776
+ try:
777
+ func = getattr(self, 'do_' + arg)
778
+ except AttributeError:
779
+ sys.stderr.write('%s: No help for "%s"\n' % (self.name, arg))
780
+ else:
781
+ try:
782
+ help = getattr(self, 'help_' + arg)
783
+ except AttributeError:
784
+ sys.stdout.write(self.doc_to_help(func))
785
+ sys.stdout.flush()
786
+ else:
787
+ help()
788
+ else:
789
+ doc = self.doc_to_help(self.__class__)
790
+ if doc:
791
+ sys.stdout.write(doc)
792
+ sys.stdout.flush()
793
+ return None
794
+
795
+ #
796
+
797
+ def help_func(self):
798
+ help = """\
799
+ Usage: scons-time func [OPTIONS] FILE [...]
800
+
801
+ -C DIR, --chdir=DIR Change to DIR before looking for files
802
+ -f FILE, --file=FILE Read configuration from specified FILE
803
+ --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT
804
+ --func=NAME, --function=NAME Report time for function NAME
805
+ -h, --help Print this help and exit
806
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
807
+ -t NUMBER, --tail=NUMBER Only report the last NUMBER files
808
+ --title=TITLE Specify the output plot TITLE
809
+ """
810
+ sys.stdout.write(self.outdent(help))
811
+ sys.stdout.flush()
812
+
813
+ def do_func(self, argv):
814
+ """
815
+ """
816
+ format = 'ascii'
817
+ function_name = '_main'
818
+ tail = None
819
+
820
+ short_opts = '?C:f:hp:t:'
821
+
822
+ long_opts = [
823
+ 'chdir=',
824
+ 'file=',
825
+ 'fmt=',
826
+ 'format=',
827
+ 'func=',
828
+ 'function=',
829
+ 'help',
830
+ 'prefix=',
831
+ 'tail=',
832
+ 'title=',
833
+ ]
834
+
835
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
836
+
837
+ for o, a in opts:
838
+ if o in ('-C', '--chdir'):
839
+ self.chdir = a
840
+ elif o in ('-f', '--file'):
841
+ self.config_file = a
842
+ elif o in ('--fmt', '--format'):
843
+ format = a
844
+ elif o in ('--func', '--function'):
845
+ function_name = a
846
+ elif o in ('-?', '-h', '--help'):
847
+ self.do_help(['help', 'func'])
848
+ sys.exit(0)
849
+ elif o in ('--max',):
850
+ max_time = int(a)
851
+ elif o in ('-p', '--prefix'):
852
+ self.prefix = a
853
+ elif o in ('-t', '--tail'):
854
+ tail = int(a)
855
+ elif o in ('--title',):
856
+ self.title = a
857
+
858
+ if self.config_file:
859
+ exec open(self.config_file, 'rU').read() in self.__dict__
860
+
861
+ if self.chdir:
862
+ os.chdir(self.chdir)
863
+
864
+ if not args:
865
+
866
+ pattern = '%s*.prof' % self.prefix
867
+ args = self.args_to_files([pattern], tail)
868
+
869
+ if not args:
870
+ if self.chdir:
871
+ directory = self.chdir
872
+ else:
873
+ directory = os.getcwd()
874
+
875
+ sys.stderr.write('%s: func: No arguments specified.\n' % self.name)
876
+ sys.stderr.write('%s No %s*.prof files found in "%s".\n' % (self.name_spaces, self.prefix, directory))
877
+ sys.stderr.write('%s Type "%s help func" for help.\n' % (self.name_spaces, self.name))
878
+ sys.exit(1)
879
+
880
+ else:
881
+
882
+ args = self.args_to_files(args, tail)
883
+
884
+ cwd_ = os.getcwd() + os.sep
885
+
886
+ if format == 'ascii':
887
+
888
+ for file in args:
889
+ try:
890
+ f, line, func, time = \
891
+ self.get_function_profile(file, function_name)
892
+ except ValueError, e:
893
+ sys.stderr.write("%s: func: %s: %s\n" %
894
+ (self.name, file, e))
895
+ else:
896
+ if f.startswith(cwd_):
897
+ f = f[len(cwd_):]
898
+ print "%.3f %s:%d(%s)" % (time, f, line, func)
899
+
900
+ elif format == 'gnuplot':
901
+
902
+ results = self.collect_results(args, self.get_function_time,
903
+ function_name)
904
+
905
+ self.gnuplot_results(results)
906
+
907
+ else:
908
+
909
+ sys.stderr.write('%s: func: Unknown format "%s".\n' % (self.name, format))
910
+ sys.exit(1)
911
+
912
+ #
913
+
914
+ def help_mem(self):
915
+ help = """\
916
+ Usage: scons-time mem [OPTIONS] FILE [...]
917
+
918
+ -C DIR, --chdir=DIR Change to DIR before looking for files
919
+ -f FILE, --file=FILE Read configuration from specified FILE
920
+ --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT
921
+ -h, --help Print this help and exit
922
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
923
+ --stage=STAGE Plot memory at the specified stage:
924
+ pre-read, post-read, pre-build,
925
+ post-build (default: post-build)
926
+ -t NUMBER, --tail=NUMBER Only report the last NUMBER files
927
+ --title=TITLE Specify the output plot TITLE
928
+ """
929
+ sys.stdout.write(self.outdent(help))
930
+ sys.stdout.flush()
931
+
932
+ def do_mem(self, argv):
933
+
934
+ format = 'ascii'
935
+ logfile_path = lambda x: x
936
+ stage = self.default_stage
937
+ tail = None
938
+
939
+ short_opts = '?C:f:hp:t:'
940
+
941
+ long_opts = [
942
+ 'chdir=',
943
+ 'file=',
944
+ 'fmt=',
945
+ 'format=',
946
+ 'help',
947
+ 'prefix=',
948
+ 'stage=',
949
+ 'tail=',
950
+ 'title=',
951
+ ]
952
+
953
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
954
+
955
+ for o, a in opts:
956
+ if o in ('-C', '--chdir'):
957
+ self.chdir = a
958
+ elif o in ('-f', '--file'):
959
+ self.config_file = a
960
+ elif o in ('--fmt', '--format'):
961
+ format = a
962
+ elif o in ('-?', '-h', '--help'):
963
+ self.do_help(['help', 'mem'])
964
+ sys.exit(0)
965
+ elif o in ('-p', '--prefix'):
966
+ self.prefix = a
967
+ elif o in ('--stage',):
968
+ if not a in self.stages:
969
+ sys.stderr.write('%s: mem: Unrecognized stage "%s".\n' % (self.name, a))
970
+ sys.exit(1)
971
+ stage = a
972
+ elif o in ('-t', '--tail'):
973
+ tail = int(a)
974
+ elif o in ('--title',):
975
+ self.title = a
976
+
977
+ if self.config_file:
978
+ HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
979
+
980
+ if self.chdir:
981
+ os.chdir(self.chdir)
982
+ logfile_path = lambda x: os.path.join(self.chdir, x)
983
+
984
+ if not args:
985
+
986
+ pattern = '%s*.log' % self.prefix
987
+ args = self.args_to_files([pattern], tail)
988
+
989
+ if not args:
990
+ if self.chdir:
991
+ directory = self.chdir
992
+ else:
993
+ directory = os.getcwd()
994
+
995
+ sys.stderr.write('%s: mem: No arguments specified.\n' % self.name)
996
+ sys.stderr.write('%s No %s*.log files found in "%s".\n' % (self.name_spaces, self.prefix, directory))
997
+ sys.stderr.write('%s Type "%s help mem" for help.\n' % (self.name_spaces, self.name))
998
+ sys.exit(1)
999
+
1000
+ else:
1001
+
1002
+ args = self.args_to_files(args, tail)
1003
+
1004
+ cwd_ = os.getcwd() + os.sep
1005
+
1006
+ if format == 'ascii':
1007
+
1008
+ self.ascii_table(args, tuple(self.stages), self.get_memory, logfile_path)
1009
+
1010
+ elif format == 'gnuplot':
1011
+
1012
+ results = self.collect_results(args, self.get_memory,
1013
+ self.stage_strings[stage])
1014
+
1015
+ self.gnuplot_results(results)
1016
+
1017
+ else:
1018
+
1019
+ sys.stderr.write('%s: mem: Unknown format "%s".\n' % (self.name, format))
1020
+ sys.exit(1)
1021
+
1022
+ return 0
1023
+
1024
+ #
1025
+
1026
+ def help_obj(self):
1027
+ help = """\
1028
+ Usage: scons-time obj [OPTIONS] OBJECT FILE [...]
1029
+
1030
+ -C DIR, --chdir=DIR Change to DIR before looking for files
1031
+ -f FILE, --file=FILE Read configuration from specified FILE
1032
+ --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT
1033
+ -h, --help Print this help and exit
1034
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
1035
+ --stage=STAGE Plot memory at the specified stage:
1036
+ pre-read, post-read, pre-build,
1037
+ post-build (default: post-build)
1038
+ -t NUMBER, --tail=NUMBER Only report the last NUMBER files
1039
+ --title=TITLE Specify the output plot TITLE
1040
+ """
1041
+ sys.stdout.write(self.outdent(help))
1042
+ sys.stdout.flush()
1043
+
1044
+ def do_obj(self, argv):
1045
+
1046
+ format = 'ascii'
1047
+ logfile_path = lambda x: x
1048
+ stage = self.default_stage
1049
+ tail = None
1050
+
1051
+ short_opts = '?C:f:hp:t:'
1052
+
1053
+ long_opts = [
1054
+ 'chdir=',
1055
+ 'file=',
1056
+ 'fmt=',
1057
+ 'format=',
1058
+ 'help',
1059
+ 'prefix=',
1060
+ 'stage=',
1061
+ 'tail=',
1062
+ 'title=',
1063
+ ]
1064
+
1065
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
1066
+
1067
+ for o, a in opts:
1068
+ if o in ('-C', '--chdir'):
1069
+ self.chdir = a
1070
+ elif o in ('-f', '--file'):
1071
+ self.config_file = a
1072
+ elif o in ('--fmt', '--format'):
1073
+ format = a
1074
+ elif o in ('-?', '-h', '--help'):
1075
+ self.do_help(['help', 'obj'])
1076
+ sys.exit(0)
1077
+ elif o in ('-p', '--prefix'):
1078
+ self.prefix = a
1079
+ elif o in ('--stage',):
1080
+ if not a in self.stages:
1081
+ sys.stderr.write('%s: obj: Unrecognized stage "%s".\n' % (self.name, a))
1082
+ sys.stderr.write('%s Type "%s help obj" for help.\n' % (self.name_spaces, self.name))
1083
+ sys.exit(1)
1084
+ stage = a
1085
+ elif o in ('-t', '--tail'):
1086
+ tail = int(a)
1087
+ elif o in ('--title',):
1088
+ self.title = a
1089
+
1090
+ if not args:
1091
+ sys.stderr.write('%s: obj: Must specify an object name.\n' % self.name)
1092
+ sys.stderr.write('%s Type "%s help obj" for help.\n' % (self.name_spaces, self.name))
1093
+ sys.exit(1)
1094
+
1095
+ object_name = args.pop(0)
1096
+
1097
+ if self.config_file:
1098
+ HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
1099
+
1100
+ if self.chdir:
1101
+ os.chdir(self.chdir)
1102
+ logfile_path = lambda x: os.path.join(self.chdir, x)
1103
+
1104
+ if not args:
1105
+
1106
+ pattern = '%s*.log' % self.prefix
1107
+ args = self.args_to_files([pattern], tail)
1108
+
1109
+ if not args:
1110
+ if self.chdir:
1111
+ directory = self.chdir
1112
+ else:
1113
+ directory = os.getcwd()
1114
+
1115
+ sys.stderr.write('%s: obj: No arguments specified.\n' % self.name)
1116
+ sys.stderr.write('%s No %s*.log files found in "%s".\n' % (self.name_spaces, self.prefix, directory))
1117
+ sys.stderr.write('%s Type "%s help obj" for help.\n' % (self.name_spaces, self.name))
1118
+ sys.exit(1)
1119
+
1120
+ else:
1121
+
1122
+ args = self.args_to_files(args, tail)
1123
+
1124
+ cwd_ = os.getcwd() + os.sep
1125
+
1126
+ if format == 'ascii':
1127
+
1128
+ self.ascii_table(args, tuple(self.stages), self.get_object_counts, logfile_path, object_name)
1129
+
1130
+ elif format == 'gnuplot':
1131
+
1132
+ stage_index = 0
1133
+ for s in self.stages:
1134
+ if stage == s:
1135
+ break
1136
+ stage_index = stage_index + 1
1137
+
1138
+ results = self.collect_results(args, self.get_object_counts,
1139
+ object_name, stage_index)
1140
+
1141
+ self.gnuplot_results(results)
1142
+
1143
+ else:
1144
+
1145
+ sys.stderr.write('%s: obj: Unknown format "%s".\n' % (self.name, format))
1146
+ sys.exit(1)
1147
+
1148
+ return 0
1149
+
1150
+ #
1151
+
1152
+ def help_run(self):
1153
+ help = """\
1154
+ Usage: scons-time run [OPTIONS] [FILE ...]
1155
+
1156
+ --aegis=PROJECT Use SCons from the Aegis PROJECT
1157
+ --chdir=DIR Name of unpacked directory for chdir
1158
+ -f FILE, --file=FILE Read configuration from specified FILE
1159
+ -h, --help Print this help and exit
1160
+ -n, --no-exec No execute, just print command lines
1161
+ --number=NUMBER Put output in files for run NUMBER
1162
+ --outdir=OUTDIR Put output files in OUTDIR
1163
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
1164
+ --python=PYTHON Time using the specified PYTHON
1165
+ -q, --quiet Don't print command lines
1166
+ --scons=SCONS Time using the specified SCONS
1167
+ --svn=URL, --subversion=URL Use SCons from Subversion URL
1168
+ -v, --verbose Display output of commands
1169
+ """
1170
+ sys.stdout.write(self.outdent(help))
1171
+ sys.stdout.flush()
1172
+
1173
+ def do_run(self, argv):
1174
+ """
1175
+ """
1176
+ run_number_list = [None]
1177
+
1178
+ short_opts = '?f:hnp:qs:v'
1179
+
1180
+ long_opts = [
1181
+ 'aegis=',
1182
+ 'file=',
1183
+ 'help',
1184
+ 'no-exec',
1185
+ 'number=',
1186
+ 'outdir=',
1187
+ 'prefix=',
1188
+ 'python=',
1189
+ 'quiet',
1190
+ 'scons=',
1191
+ 'svn=',
1192
+ 'subdir=',
1193
+ 'subversion=',
1194
+ 'verbose',
1195
+ ]
1196
+
1197
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
1198
+
1199
+ for o, a in opts:
1200
+ if o in ('--aegis',):
1201
+ self.aegis_project = a
1202
+ elif o in ('-f', '--file'):
1203
+ self.config_file = a
1204
+ elif o in ('-?', '-h', '--help'):
1205
+ self.do_help(['help', 'run'])
1206
+ sys.exit(0)
1207
+ elif o in ('-n', '--no-exec'):
1208
+ self.execute = self._do_not_execute
1209
+ elif o in ('--number',):
1210
+ run_number_list = self.split_run_numbers(a)
1211
+ elif o in ('--outdir',):
1212
+ self.outdir = a
1213
+ elif o in ('-p', '--prefix'):
1214
+ self.prefix = a
1215
+ elif o in ('--python',):
1216
+ self.python = a
1217
+ elif o in ('-q', '--quiet'):
1218
+ self.display = self._do_not_display
1219
+ elif o in ('-s', '--subdir'):
1220
+ self.subdir = a
1221
+ elif o in ('--scons',):
1222
+ self.scons = a
1223
+ elif o in ('--svn', '--subversion'):
1224
+ self.subversion_url = a
1225
+ elif o in ('-v', '--verbose'):
1226
+ self.redirect = tee_to_file
1227
+ self.verbose = True
1228
+ self.svn_co_flag = ''
1229
+
1230
+ if not args and not self.config_file:
1231
+ sys.stderr.write('%s: run: No arguments or -f config file specified.\n' % self.name)
1232
+ sys.stderr.write('%s Type "%s help run" for help.\n' % (self.name_spaces, self.name))
1233
+ sys.exit(1)
1234
+
1235
+ if self.config_file:
1236
+ exec open(self.config_file, 'rU').read() in self.__dict__
1237
+
1238
+ if args:
1239
+ self.archive_list = args
1240
+
1241
+ archive_file_name = os.path.split(self.archive_list[0])[1]
1242
+
1243
+ if not self.subdir:
1244
+ self.subdir = self.archive_splitext(archive_file_name)[0]
1245
+
1246
+ if not self.prefix:
1247
+ self.prefix = self.archive_splitext(archive_file_name)[0]
1248
+
1249
+ prepare = None
1250
+ if self.subversion_url:
1251
+ prepare = self.prep_subversion_run
1252
+ elif self.aegis_project:
1253
+ prepare = self.prep_aegis_run
1254
+
1255
+ for run_number in run_number_list:
1256
+ self.individual_run(run_number, self.archive_list, prepare)
1257
+
1258
+ def split_run_numbers(self, s):
1259
+ result = []
1260
+ for n in s.split(','):
1261
+ try:
1262
+ x, y = n.split('-')
1263
+ except ValueError:
1264
+ result.append(int(n))
1265
+ else:
1266
+ result.extend(list(range(int(x), int(y)+1)))
1267
+ return result
1268
+
1269
+ def scons_path(self, dir):
1270
+ return os.path.join(dir, 'src', 'script', 'scons.py')
1271
+
1272
+ def scons_lib_dir_path(self, dir):
1273
+ return os.path.join(dir, 'src', 'engine')
1274
+
1275
+ def prep_aegis_run(self, commands, removals):
1276
+ self.aegis_tmpdir = make_temp_file(prefix = self.name + '-aegis-')
1277
+ removals.append((shutil.rmtree, 'rm -rf %%s', self.aegis_tmpdir))
1278
+
1279
+ self.aegis_parent_project = os.path.splitext(self.aegis_project)[0]
1280
+ self.scons = self.scons_path(self.aegis_tmpdir)
1281
+ self.scons_lib_dir = self.scons_lib_dir_path(self.aegis_tmpdir)
1282
+
1283
+ commands.extend([
1284
+ 'mkdir %(aegis_tmpdir)s',
1285
+ (lambda: os.chdir(self.aegis_tmpdir), 'cd %(aegis_tmpdir)s'),
1286
+ '%(aegis)s -cp -ind -p %(aegis_parent_project)s .',
1287
+ '%(aegis)s -cp -ind -p %(aegis_project)s -delta %(run_number)s .',
1288
+ ])
1289
+
1290
+ def prep_subversion_run(self, commands, removals):
1291
+ self.svn_tmpdir = make_temp_file(prefix = self.name + '-svn-')
1292
+ removals.append((shutil.rmtree, 'rm -rf %%s', self.svn_tmpdir))
1293
+
1294
+ self.scons = self.scons_path(self.svn_tmpdir)
1295
+ self.scons_lib_dir = self.scons_lib_dir_path(self.svn_tmpdir)
1296
+
1297
+ commands.extend([
1298
+ 'mkdir %(svn_tmpdir)s',
1299
+ '%(svn)s co %(svn_co_flag)s -r %(run_number)s %(subversion_url)s %(svn_tmpdir)s',
1300
+ ])
1301
+
1302
+ def individual_run(self, run_number, archive_list, prepare=None):
1303
+ """
1304
+ Performs an individual run of the default SCons invocations.
1305
+ """
1306
+
1307
+ commands = []
1308
+ removals = []
1309
+
1310
+ if prepare:
1311
+ prepare(commands, removals)
1312
+
1313
+ save_scons = self.scons
1314
+ save_scons_wrapper = self.scons_wrapper
1315
+ save_scons_lib_dir = self.scons_lib_dir
1316
+
1317
+ if self.outdir is None:
1318
+ self.outdir = self.orig_cwd
1319
+ elif not os.path.isabs(self.outdir):
1320
+ self.outdir = os.path.join(self.orig_cwd, self.outdir)
1321
+
1322
+ if self.scons is None:
1323
+ self.scons = self.scons_path(self.orig_cwd)
1324
+
1325
+ if self.scons_lib_dir is None:
1326
+ self.scons_lib_dir = self.scons_lib_dir_path(self.orig_cwd)
1327
+
1328
+ if self.scons_wrapper is None:
1329
+ self.scons_wrapper = self.scons
1330
+
1331
+ if not run_number:
1332
+ run_number = self.find_next_run_number(self.outdir, self.prefix)
1333
+
1334
+ self.run_number = str(run_number)
1335
+
1336
+ self.prefix_run = self.prefix + '-%03d' % run_number
1337
+
1338
+ if self.targets0 is None:
1339
+ self.targets0 = self.startup_targets
1340
+ if self.targets1 is None:
1341
+ self.targets1 = self.targets
1342
+ if self.targets2 is None:
1343
+ self.targets2 = self.targets
1344
+
1345
+ self.tmpdir = make_temp_file(prefix = self.name + '-')
1346
+
1347
+ commands.extend([
1348
+ 'mkdir %(tmpdir)s',
1349
+
1350
+ (os.chdir, 'cd %%s', self.tmpdir),
1351
+ ])
1352
+
1353
+ for archive in archive_list:
1354
+ if not os.path.isabs(archive):
1355
+ archive = os.path.join(self.orig_cwd, archive)
1356
+ if os.path.isdir(archive):
1357
+ dest = os.path.split(archive)[1]
1358
+ commands.append((shutil.copytree, 'cp -r %%s %%s', archive, dest))
1359
+ else:
1360
+ suffix = self.archive_splitext(archive)[1]
1361
+ unpack_command = self.unpack_map.get(suffix)
1362
+ if not unpack_command:
1363
+ dest = os.path.split(archive)[1]
1364
+ commands.append((shutil.copyfile, 'cp %%s %%s', archive, dest))
1365
+ else:
1366
+ commands.append(unpack_command + (archive,))
1367
+
1368
+ commands.extend([
1369
+ (os.chdir, 'cd %%s', self.subdir),
1370
+ ])
1371
+
1372
+ commands.extend(self.initial_commands)
1373
+
1374
+ commands.extend([
1375
+ (lambda: read_tree('.'),
1376
+ 'find * -type f | xargs cat > /dev/null'),
1377
+
1378
+ (self.set_env, 'export %%s=%%s',
1379
+ 'SCONS_LIB_DIR', self.scons_lib_dir),
1380
+
1381
+ '%(python)s %(scons_wrapper)s --version',
1382
+ ])
1383
+
1384
+ index = 0
1385
+ for run_command in self.run_commands:
1386
+ setattr(self, 'prof%d' % index, self.profile_name(index))
1387
+ c = (
1388
+ self.log_execute,
1389
+ self.log_display,
1390
+ run_command,
1391
+ self.logfile_name(index),
1392
+ )
1393
+ commands.append(c)
1394
+ index = index + 1
1395
+
1396
+ commands.extend([
1397
+ (os.chdir, 'cd %%s', self.orig_cwd),
1398
+ ])
1399
+
1400
+ if not os.environ.get('PRESERVE'):
1401
+ commands.extend(removals)
1402
+
1403
+ commands.append((shutil.rmtree, 'rm -rf %%s', self.tmpdir))
1404
+
1405
+ self.run_command_list(commands, self.__dict__)
1406
+
1407
+ self.scons = save_scons
1408
+ self.scons_lib_dir = save_scons_lib_dir
1409
+ self.scons_wrapper = save_scons_wrapper
1410
+
1411
+ #
1412
+
1413
+ def help_time(self):
1414
+ help = """\
1415
+ Usage: scons-time time [OPTIONS] FILE [...]
1416
+
1417
+ -C DIR, --chdir=DIR Change to DIR before looking for files
1418
+ -f FILE, --file=FILE Read configuration from specified FILE
1419
+ --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT
1420
+ -h, --help Print this help and exit
1421
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
1422
+ -t NUMBER, --tail=NUMBER Only report the last NUMBER files
1423
+ --which=TIMER Plot timings for TIMER: total,
1424
+ SConscripts, SCons, commands.
1425
+ """
1426
+ sys.stdout.write(self.outdent(help))
1427
+ sys.stdout.flush()
1428
+
1429
+ def do_time(self, argv):
1430
+
1431
+ format = 'ascii'
1432
+ logfile_path = lambda x: x
1433
+ tail = None
1434
+ which = 'total'
1435
+
1436
+ short_opts = '?C:f:hp:t:'
1437
+
1438
+ long_opts = [
1439
+ 'chdir=',
1440
+ 'file=',
1441
+ 'fmt=',
1442
+ 'format=',
1443
+ 'help',
1444
+ 'prefix=',
1445
+ 'tail=',
1446
+ 'title=',
1447
+ 'which=',
1448
+ ]
1449
+
1450
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
1451
+
1452
+ for o, a in opts:
1453
+ if o in ('-C', '--chdir'):
1454
+ self.chdir = a
1455
+ elif o in ('-f', '--file'):
1456
+ self.config_file = a
1457
+ elif o in ('--fmt', '--format'):
1458
+ format = a
1459
+ elif o in ('-?', '-h', '--help'):
1460
+ self.do_help(['help', 'time'])
1461
+ sys.exit(0)
1462
+ elif o in ('-p', '--prefix'):
1463
+ self.prefix = a
1464
+ elif o in ('-t', '--tail'):
1465
+ tail = int(a)
1466
+ elif o in ('--title',):
1467
+ self.title = a
1468
+ elif o in ('--which',):
1469
+ if not a in self.time_strings.keys():
1470
+ sys.stderr.write('%s: time: Unrecognized timer "%s".\n' % (self.name, a))
1471
+ sys.stderr.write('%s Type "%s help time" for help.\n' % (self.name_spaces, self.name))
1472
+ sys.exit(1)
1473
+ which = a
1474
+
1475
+ if self.config_file:
1476
+ HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
1477
+
1478
+ if self.chdir:
1479
+ os.chdir(self.chdir)
1480
+ logfile_path = lambda x: os.path.join(self.chdir, x)
1481
+
1482
+ if not args:
1483
+
1484
+ pattern = '%s*.log' % self.prefix
1485
+ args = self.args_to_files([pattern], tail)
1486
+
1487
+ if not args:
1488
+ if self.chdir:
1489
+ directory = self.chdir
1490
+ else:
1491
+ directory = os.getcwd()
1492
+
1493
+ sys.stderr.write('%s: time: No arguments specified.\n' % self.name)
1494
+ sys.stderr.write('%s No %s*.log files found in "%s".\n' % (self.name_spaces, self.prefix, directory))
1495
+ sys.stderr.write('%s Type "%s help time" for help.\n' % (self.name_spaces, self.name))
1496
+ sys.exit(1)
1497
+
1498
+ else:
1499
+
1500
+ args = self.args_to_files(args, tail)
1501
+
1502
+ cwd_ = os.getcwd() + os.sep
1503
+
1504
+ if format == 'ascii':
1505
+
1506
+ columns = ("Total", "SConscripts", "SCons", "commands")
1507
+ self.ascii_table(args, columns, self.get_debug_times, logfile_path)
1508
+
1509
+ elif format == 'gnuplot':
1510
+
1511
+ results = self.collect_results(args, self.get_debug_times,
1512
+ self.time_strings[which])
1513
+
1514
+ self.gnuplot_results(results, fmt='%s %.6f')
1515
+
1516
+ else:
1517
+
1518
+ sys.stderr.write('%s: time: Unknown format "%s".\n' % (self.name, format))
1519
+ sys.exit(1)
1520
+
1521
+ if __name__ == '__main__':
1522
+ opts, args = getopt.getopt(sys.argv[1:], 'h?V', ['help', 'version'])
1523
+
1524
+ ST = SConsTimer()
1525
+
1526
+ for o, a in opts:
1527
+ if o in ('-?', '-h', '--help'):
1528
+ ST.do_help(['help'])
1529
+ sys.exit(0)
1530
+ elif o in ('-V', '--version'):
1531
+ sys.stdout.write('scons-time version\n')
1532
+ sys.exit(0)
1533
+
1534
+ if not args:
1535
+ sys.stderr.write('Type "%s help" for usage.\n' % ST.name)
1536
+ sys.exit(1)
1537
+
1538
+ ST.execute_subcommand(args)
1539
+
1540
+ # Local Variables:
1541
+ # tab-width:4
1542
+ # indent-tabs-mode:nil
1543
+ # End:
1544
+ # vim: set expandtab tabstop=4 shiftwidth=4: