therubyracer 0.9.0beta4 → 0.9.0beta5

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

Potentially problematic release.


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

Files changed (771) hide show
  1. data/.gitignore +1 -0
  2. data/Rakefile +0 -11
  3. data/ext/v8/extconf.rb +9 -9
  4. data/ext/v8/v8_external.cpp +40 -10
  5. data/lib/v8/cli.rb +2 -1
  6. data/lib/v8/version.rb +1 -1
  7. data/spec/redjs/.gitignore +1 -0
  8. data/therubyracer.gemspec +2 -3
  9. metadata +33 -779
  10. data/ext/v8/upstream/Makefile +0 -38
  11. data/ext/v8/upstream/detect_cpu.rb +0 -27
  12. data/ext/v8/upstream/fpic-on-linux-amd64.patch +0 -13
  13. data/ext/v8/upstream/scons/CHANGES.txt +0 -5183
  14. data/ext/v8/upstream/scons/LICENSE.txt +0 -20
  15. data/ext/v8/upstream/scons/MANIFEST +0 -202
  16. data/ext/v8/upstream/scons/PKG-INFO +0 -13
  17. data/ext/v8/upstream/scons/README.txt +0 -273
  18. data/ext/v8/upstream/scons/RELEASE.txt +0 -1040
  19. data/ext/v8/upstream/scons/engine/SCons/Action.py +0 -1256
  20. data/ext/v8/upstream/scons/engine/SCons/Builder.py +0 -868
  21. data/ext/v8/upstream/scons/engine/SCons/CacheDir.py +0 -217
  22. data/ext/v8/upstream/scons/engine/SCons/Conftest.py +0 -794
  23. data/ext/v8/upstream/scons/engine/SCons/Debug.py +0 -237
  24. data/ext/v8/upstream/scons/engine/SCons/Defaults.py +0 -485
  25. data/ext/v8/upstream/scons/engine/SCons/Environment.py +0 -2327
  26. data/ext/v8/upstream/scons/engine/SCons/Errors.py +0 -207
  27. data/ext/v8/upstream/scons/engine/SCons/Executor.py +0 -636
  28. data/ext/v8/upstream/scons/engine/SCons/Job.py +0 -435
  29. data/ext/v8/upstream/scons/engine/SCons/Memoize.py +0 -292
  30. data/ext/v8/upstream/scons/engine/SCons/Node/Alias.py +0 -153
  31. data/ext/v8/upstream/scons/engine/SCons/Node/FS.py +0 -3220
  32. data/ext/v8/upstream/scons/engine/SCons/Node/Python.py +0 -128
  33. data/ext/v8/upstream/scons/engine/SCons/Node/__init__.py +0 -1341
  34. data/ext/v8/upstream/scons/engine/SCons/Options/BoolOption.py +0 -50
  35. data/ext/v8/upstream/scons/engine/SCons/Options/EnumOption.py +0 -50
  36. data/ext/v8/upstream/scons/engine/SCons/Options/ListOption.py +0 -50
  37. data/ext/v8/upstream/scons/engine/SCons/Options/PackageOption.py +0 -50
  38. data/ext/v8/upstream/scons/engine/SCons/Options/PathOption.py +0 -76
  39. data/ext/v8/upstream/scons/engine/SCons/Options/__init__.py +0 -74
  40. data/ext/v8/upstream/scons/engine/SCons/PathList.py +0 -232
  41. data/ext/v8/upstream/scons/engine/SCons/Platform/__init__.py +0 -236
  42. data/ext/v8/upstream/scons/engine/SCons/Platform/aix.py +0 -70
  43. data/ext/v8/upstream/scons/engine/SCons/Platform/cygwin.py +0 -55
  44. data/ext/v8/upstream/scons/engine/SCons/Platform/darwin.py +0 -46
  45. data/ext/v8/upstream/scons/engine/SCons/Platform/hpux.py +0 -46
  46. data/ext/v8/upstream/scons/engine/SCons/Platform/irix.py +0 -44
  47. data/ext/v8/upstream/scons/engine/SCons/Platform/os2.py +0 -58
  48. data/ext/v8/upstream/scons/engine/SCons/Platform/posix.py +0 -264
  49. data/ext/v8/upstream/scons/engine/SCons/Platform/sunos.py +0 -50
  50. data/ext/v8/upstream/scons/engine/SCons/Platform/win32.py +0 -386
  51. data/ext/v8/upstream/scons/engine/SCons/SConf.py +0 -1038
  52. data/ext/v8/upstream/scons/engine/SCons/SConsign.py +0 -381
  53. data/ext/v8/upstream/scons/engine/SCons/Scanner/C.py +0 -132
  54. data/ext/v8/upstream/scons/engine/SCons/Scanner/D.py +0 -74
  55. data/ext/v8/upstream/scons/engine/SCons/Scanner/Dir.py +0 -111
  56. data/ext/v8/upstream/scons/engine/SCons/Scanner/Fortran.py +0 -320
  57. data/ext/v8/upstream/scons/engine/SCons/Scanner/IDL.py +0 -48
  58. data/ext/v8/upstream/scons/engine/SCons/Scanner/LaTeX.py +0 -378
  59. data/ext/v8/upstream/scons/engine/SCons/Scanner/Prog.py +0 -103
  60. data/ext/v8/upstream/scons/engine/SCons/Scanner/RC.py +0 -55
  61. data/ext/v8/upstream/scons/engine/SCons/Scanner/__init__.py +0 -415
  62. data/ext/v8/upstream/scons/engine/SCons/Script/Interactive.py +0 -386
  63. data/ext/v8/upstream/scons/engine/SCons/Script/Main.py +0 -1360
  64. data/ext/v8/upstream/scons/engine/SCons/Script/SConsOptions.py +0 -944
  65. data/ext/v8/upstream/scons/engine/SCons/Script/SConscript.py +0 -642
  66. data/ext/v8/upstream/scons/engine/SCons/Script/__init__.py +0 -414
  67. data/ext/v8/upstream/scons/engine/SCons/Sig.py +0 -63
  68. data/ext/v8/upstream/scons/engine/SCons/Subst.py +0 -911
  69. data/ext/v8/upstream/scons/engine/SCons/Taskmaster.py +0 -1030
  70. data/ext/v8/upstream/scons/engine/SCons/Tool/386asm.py +0 -61
  71. data/ext/v8/upstream/scons/engine/SCons/Tool/BitKeeper.py +0 -65
  72. data/ext/v8/upstream/scons/engine/SCons/Tool/CVS.py +0 -73
  73. data/ext/v8/upstream/scons/engine/SCons/Tool/FortranCommon.py +0 -247
  74. data/ext/v8/upstream/scons/engine/SCons/Tool/JavaCommon.py +0 -324
  75. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/__init__.py +0 -56
  76. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/arch.py +0 -61
  77. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/common.py +0 -210
  78. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/netframework.py +0 -84
  79. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/sdk.py +0 -321
  80. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vc.py +0 -367
  81. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vs.py +0 -497
  82. data/ext/v8/upstream/scons/engine/SCons/Tool/Perforce.py +0 -104
  83. data/ext/v8/upstream/scons/engine/SCons/Tool/PharLapCommon.py +0 -138
  84. data/ext/v8/upstream/scons/engine/SCons/Tool/RCS.py +0 -64
  85. data/ext/v8/upstream/scons/engine/SCons/Tool/SCCS.py +0 -64
  86. data/ext/v8/upstream/scons/engine/SCons/Tool/Subversion.py +0 -71
  87. data/ext/v8/upstream/scons/engine/SCons/Tool/__init__.py +0 -675
  88. data/ext/v8/upstream/scons/engine/SCons/Tool/aixc++.py +0 -82
  89. data/ext/v8/upstream/scons/engine/SCons/Tool/aixcc.py +0 -74
  90. data/ext/v8/upstream/scons/engine/SCons/Tool/aixf77.py +0 -80
  91. data/ext/v8/upstream/scons/engine/SCons/Tool/aixlink.py +0 -76
  92. data/ext/v8/upstream/scons/engine/SCons/Tool/applelink.py +0 -71
  93. data/ext/v8/upstream/scons/engine/SCons/Tool/ar.py +0 -63
  94. data/ext/v8/upstream/scons/engine/SCons/Tool/as.py +0 -78
  95. data/ext/v8/upstream/scons/engine/SCons/Tool/bcc32.py +0 -82
  96. data/ext/v8/upstream/scons/engine/SCons/Tool/c++.py +0 -99
  97. data/ext/v8/upstream/scons/engine/SCons/Tool/cc.py +0 -114
  98. data/ext/v8/upstream/scons/engine/SCons/Tool/cvf.py +0 -58
  99. data/ext/v8/upstream/scons/engine/SCons/Tool/default.py +0 -50
  100. data/ext/v8/upstream/scons/engine/SCons/Tool/dmd.py +0 -224
  101. data/ext/v8/upstream/scons/engine/SCons/Tool/dvi.py +0 -64
  102. data/ext/v8/upstream/scons/engine/SCons/Tool/dvipdf.py +0 -125
  103. data/ext/v8/upstream/scons/engine/SCons/Tool/dvips.py +0 -94
  104. data/ext/v8/upstream/scons/engine/SCons/Tool/f77.py +0 -62
  105. data/ext/v8/upstream/scons/engine/SCons/Tool/f90.py +0 -62
  106. data/ext/v8/upstream/scons/engine/SCons/Tool/f95.py +0 -63
  107. data/ext/v8/upstream/scons/engine/SCons/Tool/filesystem.py +0 -98
  108. data/ext/v8/upstream/scons/engine/SCons/Tool/fortran.py +0 -63
  109. data/ext/v8/upstream/scons/engine/SCons/Tool/g++.py +0 -90
  110. data/ext/v8/upstream/scons/engine/SCons/Tool/g77.py +0 -73
  111. data/ext/v8/upstream/scons/engine/SCons/Tool/gas.py +0 -53
  112. data/ext/v8/upstream/scons/engine/SCons/Tool/gcc.py +0 -80
  113. data/ext/v8/upstream/scons/engine/SCons/Tool/gfortran.py +0 -64
  114. data/ext/v8/upstream/scons/engine/SCons/Tool/gnulink.py +0 -63
  115. data/ext/v8/upstream/scons/engine/SCons/Tool/gs.py +0 -81
  116. data/ext/v8/upstream/scons/engine/SCons/Tool/hpc++.py +0 -85
  117. data/ext/v8/upstream/scons/engine/SCons/Tool/hpcc.py +0 -53
  118. data/ext/v8/upstream/scons/engine/SCons/Tool/hplink.py +0 -77
  119. data/ext/v8/upstream/scons/engine/SCons/Tool/icc.py +0 -59
  120. data/ext/v8/upstream/scons/engine/SCons/Tool/icl.py +0 -52
  121. data/ext/v8/upstream/scons/engine/SCons/Tool/ifl.py +0 -72
  122. data/ext/v8/upstream/scons/engine/SCons/Tool/ifort.py +0 -90
  123. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink.py +0 -59
  124. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink32.py +0 -60
  125. data/ext/v8/upstream/scons/engine/SCons/Tool/install.py +0 -229
  126. data/ext/v8/upstream/scons/engine/SCons/Tool/intelc.py +0 -490
  127. data/ext/v8/upstream/scons/engine/SCons/Tool/ipkg.py +0 -71
  128. data/ext/v8/upstream/scons/engine/SCons/Tool/jar.py +0 -110
  129. data/ext/v8/upstream/scons/engine/SCons/Tool/javac.py +0 -234
  130. data/ext/v8/upstream/scons/engine/SCons/Tool/javah.py +0 -138
  131. data/ext/v8/upstream/scons/engine/SCons/Tool/latex.py +0 -79
  132. data/ext/v8/upstream/scons/engine/SCons/Tool/lex.py +0 -99
  133. data/ext/v8/upstream/scons/engine/SCons/Tool/link.py +0 -121
  134. data/ext/v8/upstream/scons/engine/SCons/Tool/linkloc.py +0 -112
  135. data/ext/v8/upstream/scons/engine/SCons/Tool/m4.py +0 -63
  136. data/ext/v8/upstream/scons/engine/SCons/Tool/masm.py +0 -77
  137. data/ext/v8/upstream/scons/engine/SCons/Tool/midl.py +0 -90
  138. data/ext/v8/upstream/scons/engine/SCons/Tool/mingw.py +0 -159
  139. data/ext/v8/upstream/scons/engine/SCons/Tool/mslib.py +0 -64
  140. data/ext/v8/upstream/scons/engine/SCons/Tool/mslink.py +0 -266
  141. data/ext/v8/upstream/scons/engine/SCons/Tool/mssdk.py +0 -50
  142. data/ext/v8/upstream/scons/engine/SCons/Tool/msvc.py +0 -269
  143. data/ext/v8/upstream/scons/engine/SCons/Tool/msvs.py +0 -1439
  144. data/ext/v8/upstream/scons/engine/SCons/Tool/mwcc.py +0 -208
  145. data/ext/v8/upstream/scons/engine/SCons/Tool/mwld.py +0 -107
  146. data/ext/v8/upstream/scons/engine/SCons/Tool/nasm.py +0 -72
  147. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/__init__.py +0 -314
  148. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/ipk.py +0 -185
  149. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/msi.py +0 -526
  150. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/rpm.py +0 -367
  151. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_tarbz2.py +0 -43
  152. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_targz.py +0 -43
  153. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_zip.py +0 -43
  154. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/tarbz2.py +0 -44
  155. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/targz.py +0 -44
  156. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/zip.py +0 -44
  157. data/ext/v8/upstream/scons/engine/SCons/Tool/pdf.py +0 -78
  158. data/ext/v8/upstream/scons/engine/SCons/Tool/pdflatex.py +0 -83
  159. data/ext/v8/upstream/scons/engine/SCons/Tool/pdftex.py +0 -108
  160. data/ext/v8/upstream/scons/engine/SCons/Tool/qt.py +0 -336
  161. data/ext/v8/upstream/scons/engine/SCons/Tool/rmic.py +0 -121
  162. data/ext/v8/upstream/scons/engine/SCons/Tool/rpcgen.py +0 -70
  163. data/ext/v8/upstream/scons/engine/SCons/Tool/rpm.py +0 -132
  164. data/ext/v8/upstream/scons/engine/SCons/Tool/sgiar.py +0 -68
  165. data/ext/v8/upstream/scons/engine/SCons/Tool/sgic++.py +0 -58
  166. data/ext/v8/upstream/scons/engine/SCons/Tool/sgicc.py +0 -53
  167. data/ext/v8/upstream/scons/engine/SCons/Tool/sgilink.py +0 -63
  168. data/ext/v8/upstream/scons/engine/SCons/Tool/sunar.py +0 -67
  169. data/ext/v8/upstream/scons/engine/SCons/Tool/sunc++.py +0 -142
  170. data/ext/v8/upstream/scons/engine/SCons/Tool/suncc.py +0 -58
  171. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf77.py +0 -63
  172. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf90.py +0 -64
  173. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf95.py +0 -64
  174. data/ext/v8/upstream/scons/engine/SCons/Tool/sunlink.py +0 -77
  175. data/ext/v8/upstream/scons/engine/SCons/Tool/swig.py +0 -186
  176. data/ext/v8/upstream/scons/engine/SCons/Tool/tar.py +0 -73
  177. data/ext/v8/upstream/scons/engine/SCons/Tool/tex.py +0 -805
  178. data/ext/v8/upstream/scons/engine/SCons/Tool/textfile.py +0 -175
  179. data/ext/v8/upstream/scons/engine/SCons/Tool/tlib.py +0 -53
  180. data/ext/v8/upstream/scons/engine/SCons/Tool/wix.py +0 -100
  181. data/ext/v8/upstream/scons/engine/SCons/Tool/yacc.py +0 -131
  182. data/ext/v8/upstream/scons/engine/SCons/Tool/zip.py +0 -100
  183. data/ext/v8/upstream/scons/engine/SCons/Util.py +0 -1645
  184. data/ext/v8/upstream/scons/engine/SCons/Variables/BoolVariable.py +0 -91
  185. data/ext/v8/upstream/scons/engine/SCons/Variables/EnumVariable.py +0 -107
  186. data/ext/v8/upstream/scons/engine/SCons/Variables/ListVariable.py +0 -139
  187. data/ext/v8/upstream/scons/engine/SCons/Variables/PackageVariable.py +0 -109
  188. data/ext/v8/upstream/scons/engine/SCons/Variables/PathVariable.py +0 -147
  189. data/ext/v8/upstream/scons/engine/SCons/Variables/__init__.py +0 -317
  190. data/ext/v8/upstream/scons/engine/SCons/Warnings.py +0 -228
  191. data/ext/v8/upstream/scons/engine/SCons/__init__.py +0 -49
  192. data/ext/v8/upstream/scons/engine/SCons/compat/__init__.py +0 -302
  193. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_UserString.py +0 -98
  194. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_hashlib.py +0 -91
  195. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_itertools.py +0 -124
  196. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_optparse.py +0 -1725
  197. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets.py +0 -583
  198. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets15.py +0 -176
  199. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_shlex.py +0 -325
  200. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_subprocess.py +0 -1296
  201. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_textwrap.py +0 -382
  202. data/ext/v8/upstream/scons/engine/SCons/compat/builtins.py +0 -187
  203. data/ext/v8/upstream/scons/engine/SCons/cpp.py +0 -598
  204. data/ext/v8/upstream/scons/engine/SCons/dblite.py +0 -248
  205. data/ext/v8/upstream/scons/engine/SCons/exitfuncs.py +0 -77
  206. data/ext/v8/upstream/scons/os_spawnv_fix.diff +0 -83
  207. data/ext/v8/upstream/scons/scons-time.1 +0 -1017
  208. data/ext/v8/upstream/scons/scons.1 +0 -15179
  209. data/ext/v8/upstream/scons/sconsign.1 +0 -208
  210. data/ext/v8/upstream/scons/script/scons +0 -184
  211. data/ext/v8/upstream/scons/script/scons-time +0 -1529
  212. data/ext/v8/upstream/scons/script/scons.bat +0 -31
  213. data/ext/v8/upstream/scons/script/sconsign +0 -508
  214. data/ext/v8/upstream/scons/setup.cfg +0 -6
  215. data/ext/v8/upstream/scons/setup.py +0 -427
  216. data/ext/v8/upstream/v8/.gitignore +0 -33
  217. data/ext/v8/upstream/v8/AUTHORS +0 -42
  218. data/ext/v8/upstream/v8/ChangeLog +0 -2663
  219. data/ext/v8/upstream/v8/LICENSE +0 -52
  220. data/ext/v8/upstream/v8/LICENSE.strongtalk +0 -29
  221. data/ext/v8/upstream/v8/LICENSE.v8 +0 -26
  222. data/ext/v8/upstream/v8/LICENSE.valgrind +0 -45
  223. data/ext/v8/upstream/v8/SConstruct +0 -1473
  224. data/ext/v8/upstream/v8/build/README.txt +0 -25
  225. data/ext/v8/upstream/v8/build/all.gyp +0 -18
  226. data/ext/v8/upstream/v8/build/armu.gypi +0 -32
  227. data/ext/v8/upstream/v8/build/common.gypi +0 -82
  228. data/ext/v8/upstream/v8/build/gyp_v8 +0 -145
  229. data/ext/v8/upstream/v8/include/v8-debug.h +0 -394
  230. data/ext/v8/upstream/v8/include/v8-preparser.h +0 -116
  231. data/ext/v8/upstream/v8/include/v8-profiler.h +0 -505
  232. data/ext/v8/upstream/v8/include/v8-testing.h +0 -104
  233. data/ext/v8/upstream/v8/include/v8.h +0 -4000
  234. data/ext/v8/upstream/v8/include/v8stdint.h +0 -53
  235. data/ext/v8/upstream/v8/preparser/SConscript +0 -38
  236. data/ext/v8/upstream/v8/preparser/preparser-process.cc +0 -169
  237. data/ext/v8/upstream/v8/src/SConscript +0 -380
  238. data/ext/v8/upstream/v8/src/accessors.cc +0 -766
  239. data/ext/v8/upstream/v8/src/accessors.h +0 -121
  240. data/ext/v8/upstream/v8/src/allocation-inl.h +0 -49
  241. data/ext/v8/upstream/v8/src/allocation.cc +0 -122
  242. data/ext/v8/upstream/v8/src/allocation.h +0 -143
  243. data/ext/v8/upstream/v8/src/api.cc +0 -5678
  244. data/ext/v8/upstream/v8/src/api.h +0 -572
  245. data/ext/v8/upstream/v8/src/apinatives.js +0 -110
  246. data/ext/v8/upstream/v8/src/apiutils.h +0 -73
  247. data/ext/v8/upstream/v8/src/arguments.h +0 -116
  248. data/ext/v8/upstream/v8/src/arm/assembler-arm-inl.h +0 -353
  249. data/ext/v8/upstream/v8/src/arm/assembler-arm.cc +0 -2877
  250. data/ext/v8/upstream/v8/src/arm/assembler-arm.h +0 -1382
  251. data/ext/v8/upstream/v8/src/arm/builtins-arm.cc +0 -1634
  252. data/ext/v8/upstream/v8/src/arm/code-stubs-arm.cc +0 -6917
  253. data/ext/v8/upstream/v8/src/arm/code-stubs-arm.h +0 -623
  254. data/ext/v8/upstream/v8/src/arm/codegen-arm-inl.h +0 -48
  255. data/ext/v8/upstream/v8/src/arm/codegen-arm.cc +0 -7437
  256. data/ext/v8/upstream/v8/src/arm/codegen-arm.h +0 -595
  257. data/ext/v8/upstream/v8/src/arm/constants-arm.cc +0 -152
  258. data/ext/v8/upstream/v8/src/arm/constants-arm.h +0 -778
  259. data/ext/v8/upstream/v8/src/arm/cpu-arm.cc +0 -149
  260. data/ext/v8/upstream/v8/src/arm/debug-arm.cc +0 -317
  261. data/ext/v8/upstream/v8/src/arm/deoptimizer-arm.cc +0 -737
  262. data/ext/v8/upstream/v8/src/arm/disasm-arm.cc +0 -1503
  263. data/ext/v8/upstream/v8/src/arm/frames-arm.cc +0 -45
  264. data/ext/v8/upstream/v8/src/arm/frames-arm.h +0 -168
  265. data/ext/v8/upstream/v8/src/arm/full-codegen-arm.cc +0 -4374
  266. data/ext/v8/upstream/v8/src/arm/ic-arm.cc +0 -1793
  267. data/ext/v8/upstream/v8/src/arm/jump-target-arm.cc +0 -174
  268. data/ext/v8/upstream/v8/src/arm/lithium-arm.cc +0 -2120
  269. data/ext/v8/upstream/v8/src/arm/lithium-arm.h +0 -2179
  270. data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.cc +0 -4132
  271. data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.h +0 -329
  272. data/ext/v8/upstream/v8/src/arm/lithium-gap-resolver-arm.cc +0 -305
  273. data/ext/v8/upstream/v8/src/arm/lithium-gap-resolver-arm.h +0 -84
  274. data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.cc +0 -2939
  275. data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.h +0 -1071
  276. data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.cc +0 -1287
  277. data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.h +0 -253
  278. data/ext/v8/upstream/v8/src/arm/register-allocator-arm-inl.h +0 -100
  279. data/ext/v8/upstream/v8/src/arm/register-allocator-arm.cc +0 -63
  280. data/ext/v8/upstream/v8/src/arm/register-allocator-arm.h +0 -44
  281. data/ext/v8/upstream/v8/src/arm/simulator-arm.cc +0 -3288
  282. data/ext/v8/upstream/v8/src/arm/simulator-arm.h +0 -413
  283. data/ext/v8/upstream/v8/src/arm/stub-cache-arm.cc +0 -4034
  284. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm-inl.h +0 -59
  285. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.cc +0 -843
  286. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.h +0 -523
  287. data/ext/v8/upstream/v8/src/array.js +0 -1249
  288. data/ext/v8/upstream/v8/src/assembler.cc +0 -1067
  289. data/ext/v8/upstream/v8/src/assembler.h +0 -823
  290. data/ext/v8/upstream/v8/src/ast-inl.h +0 -112
  291. data/ext/v8/upstream/v8/src/ast.cc +0 -1078
  292. data/ext/v8/upstream/v8/src/ast.h +0 -2234
  293. data/ext/v8/upstream/v8/src/atomicops.h +0 -167
  294. data/ext/v8/upstream/v8/src/atomicops_internals_arm_gcc.h +0 -145
  295. data/ext/v8/upstream/v8/src/atomicops_internals_mips_gcc.h +0 -169
  296. data/ext/v8/upstream/v8/src/atomicops_internals_x86_gcc.cc +0 -126
  297. data/ext/v8/upstream/v8/src/atomicops_internals_x86_gcc.h +0 -287
  298. data/ext/v8/upstream/v8/src/atomicops_internals_x86_macosx.h +0 -301
  299. data/ext/v8/upstream/v8/src/atomicops_internals_x86_msvc.h +0 -203
  300. data/ext/v8/upstream/v8/src/bignum-dtoa.cc +0 -655
  301. data/ext/v8/upstream/v8/src/bignum-dtoa.h +0 -81
  302. data/ext/v8/upstream/v8/src/bignum.cc +0 -768
  303. data/ext/v8/upstream/v8/src/bignum.h +0 -140
  304. data/ext/v8/upstream/v8/src/bootstrapper.cc +0 -2138
  305. data/ext/v8/upstream/v8/src/bootstrapper.h +0 -185
  306. data/ext/v8/upstream/v8/src/builtins.cc +0 -1708
  307. data/ext/v8/upstream/v8/src/builtins.h +0 -368
  308. data/ext/v8/upstream/v8/src/bytecodes-irregexp.h +0 -105
  309. data/ext/v8/upstream/v8/src/cached-powers.cc +0 -177
  310. data/ext/v8/upstream/v8/src/cached-powers.h +0 -65
  311. data/ext/v8/upstream/v8/src/char-predicates-inl.h +0 -94
  312. data/ext/v8/upstream/v8/src/char-predicates.h +0 -65
  313. data/ext/v8/upstream/v8/src/checks.cc +0 -110
  314. data/ext/v8/upstream/v8/src/checks.h +0 -296
  315. data/ext/v8/upstream/v8/src/circular-queue-inl.h +0 -53
  316. data/ext/v8/upstream/v8/src/circular-queue.cc +0 -122
  317. data/ext/v8/upstream/v8/src/circular-queue.h +0 -103
  318. data/ext/v8/upstream/v8/src/code-stubs.cc +0 -240
  319. data/ext/v8/upstream/v8/src/code-stubs.h +0 -971
  320. data/ext/v8/upstream/v8/src/code.h +0 -68
  321. data/ext/v8/upstream/v8/src/codegen-inl.h +0 -68
  322. data/ext/v8/upstream/v8/src/codegen.cc +0 -505
  323. data/ext/v8/upstream/v8/src/codegen.h +0 -245
  324. data/ext/v8/upstream/v8/src/compilation-cache.cc +0 -540
  325. data/ext/v8/upstream/v8/src/compilation-cache.h +0 -287
  326. data/ext/v8/upstream/v8/src/compiler.cc +0 -792
  327. data/ext/v8/upstream/v8/src/compiler.h +0 -307
  328. data/ext/v8/upstream/v8/src/contexts.cc +0 -327
  329. data/ext/v8/upstream/v8/src/contexts.h +0 -382
  330. data/ext/v8/upstream/v8/src/conversions-inl.h +0 -110
  331. data/ext/v8/upstream/v8/src/conversions.cc +0 -1125
  332. data/ext/v8/upstream/v8/src/conversions.h +0 -122
  333. data/ext/v8/upstream/v8/src/counters.cc +0 -93
  334. data/ext/v8/upstream/v8/src/counters.h +0 -254
  335. data/ext/v8/upstream/v8/src/cpu-profiler-inl.h +0 -101
  336. data/ext/v8/upstream/v8/src/cpu-profiler.cc +0 -606
  337. data/ext/v8/upstream/v8/src/cpu-profiler.h +0 -305
  338. data/ext/v8/upstream/v8/src/cpu.h +0 -67
  339. data/ext/v8/upstream/v8/src/d8-debug.cc +0 -367
  340. data/ext/v8/upstream/v8/src/d8-debug.h +0 -158
  341. data/ext/v8/upstream/v8/src/d8-posix.cc +0 -695
  342. data/ext/v8/upstream/v8/src/d8-readline.cc +0 -128
  343. data/ext/v8/upstream/v8/src/d8-windows.cc +0 -42
  344. data/ext/v8/upstream/v8/src/d8.cc +0 -796
  345. data/ext/v8/upstream/v8/src/d8.gyp +0 -88
  346. data/ext/v8/upstream/v8/src/d8.h +0 -231
  347. data/ext/v8/upstream/v8/src/d8.js +0 -2798
  348. data/ext/v8/upstream/v8/src/data-flow.cc +0 -545
  349. data/ext/v8/upstream/v8/src/data-flow.h +0 -379
  350. data/ext/v8/upstream/v8/src/date.js +0 -1103
  351. data/ext/v8/upstream/v8/src/dateparser-inl.h +0 -125
  352. data/ext/v8/upstream/v8/src/dateparser.cc +0 -178
  353. data/ext/v8/upstream/v8/src/dateparser.h +0 -265
  354. data/ext/v8/upstream/v8/src/debug-agent.cc +0 -447
  355. data/ext/v8/upstream/v8/src/debug-agent.h +0 -129
  356. data/ext/v8/upstream/v8/src/debug-debugger.js +0 -2569
  357. data/ext/v8/upstream/v8/src/debug.cc +0 -3188
  358. data/ext/v8/upstream/v8/src/debug.h +0 -1055
  359. data/ext/v8/upstream/v8/src/deoptimizer.cc +0 -1296
  360. data/ext/v8/upstream/v8/src/deoptimizer.h +0 -629
  361. data/ext/v8/upstream/v8/src/disasm.h +0 -80
  362. data/ext/v8/upstream/v8/src/disassembler.cc +0 -339
  363. data/ext/v8/upstream/v8/src/disassembler.h +0 -56
  364. data/ext/v8/upstream/v8/src/diy-fp.cc +0 -58
  365. data/ext/v8/upstream/v8/src/diy-fp.h +0 -117
  366. data/ext/v8/upstream/v8/src/double.h +0 -238
  367. data/ext/v8/upstream/v8/src/dtoa.cc +0 -103
  368. data/ext/v8/upstream/v8/src/dtoa.h +0 -85
  369. data/ext/v8/upstream/v8/src/execution.cc +0 -791
  370. data/ext/v8/upstream/v8/src/execution.h +0 -291
  371. data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.cc +0 -250
  372. data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.h +0 -89
  373. data/ext/v8/upstream/v8/src/extensions/experimental/experimental.gyp +0 -55
  374. data/ext/v8/upstream/v8/src/extensions/experimental/i18n-extension.cc +0 -284
  375. data/ext/v8/upstream/v8/src/extensions/experimental/i18n-extension.h +0 -64
  376. data/ext/v8/upstream/v8/src/extensions/externalize-string-extension.cc +0 -141
  377. data/ext/v8/upstream/v8/src/extensions/externalize-string-extension.h +0 -50
  378. data/ext/v8/upstream/v8/src/extensions/gc-extension.cc +0 -58
  379. data/ext/v8/upstream/v8/src/extensions/gc-extension.h +0 -49
  380. data/ext/v8/upstream/v8/src/factory.cc +0 -1194
  381. data/ext/v8/upstream/v8/src/factory.h +0 -436
  382. data/ext/v8/upstream/v8/src/fast-dtoa.cc +0 -736
  383. data/ext/v8/upstream/v8/src/fast-dtoa.h +0 -83
  384. data/ext/v8/upstream/v8/src/fixed-dtoa.cc +0 -405
  385. data/ext/v8/upstream/v8/src/fixed-dtoa.h +0 -55
  386. data/ext/v8/upstream/v8/src/flag-definitions.h +0 -556
  387. data/ext/v8/upstream/v8/src/flags.cc +0 -551
  388. data/ext/v8/upstream/v8/src/flags.h +0 -79
  389. data/ext/v8/upstream/v8/src/frame-element.cc +0 -37
  390. data/ext/v8/upstream/v8/src/frame-element.h +0 -269
  391. data/ext/v8/upstream/v8/src/frames-inl.h +0 -236
  392. data/ext/v8/upstream/v8/src/frames.cc +0 -1273
  393. data/ext/v8/upstream/v8/src/frames.h +0 -854
  394. data/ext/v8/upstream/v8/src/full-codegen.cc +0 -1385
  395. data/ext/v8/upstream/v8/src/full-codegen.h +0 -753
  396. data/ext/v8/upstream/v8/src/func-name-inferrer.cc +0 -91
  397. data/ext/v8/upstream/v8/src/func-name-inferrer.h +0 -111
  398. data/ext/v8/upstream/v8/src/gdb-jit.cc +0 -1548
  399. data/ext/v8/upstream/v8/src/gdb-jit.h +0 -138
  400. data/ext/v8/upstream/v8/src/global-handles.cc +0 -596
  401. data/ext/v8/upstream/v8/src/global-handles.h +0 -239
  402. data/ext/v8/upstream/v8/src/globals.h +0 -325
  403. data/ext/v8/upstream/v8/src/handles-inl.h +0 -177
  404. data/ext/v8/upstream/v8/src/handles.cc +0 -965
  405. data/ext/v8/upstream/v8/src/handles.h +0 -372
  406. data/ext/v8/upstream/v8/src/hashmap.cc +0 -230
  407. data/ext/v8/upstream/v8/src/hashmap.h +0 -121
  408. data/ext/v8/upstream/v8/src/heap-inl.h +0 -703
  409. data/ext/v8/upstream/v8/src/heap-profiler.cc +0 -1173
  410. data/ext/v8/upstream/v8/src/heap-profiler.h +0 -396
  411. data/ext/v8/upstream/v8/src/heap.cc +0 -5856
  412. data/ext/v8/upstream/v8/src/heap.h +0 -2264
  413. data/ext/v8/upstream/v8/src/hydrogen-instructions.cc +0 -1639
  414. data/ext/v8/upstream/v8/src/hydrogen-instructions.h +0 -3657
  415. data/ext/v8/upstream/v8/src/hydrogen.cc +0 -6011
  416. data/ext/v8/upstream/v8/src/hydrogen.h +0 -1137
  417. data/ext/v8/upstream/v8/src/ia32/assembler-ia32-inl.h +0 -430
  418. data/ext/v8/upstream/v8/src/ia32/assembler-ia32.cc +0 -2846
  419. data/ext/v8/upstream/v8/src/ia32/assembler-ia32.h +0 -1159
  420. data/ext/v8/upstream/v8/src/ia32/builtins-ia32.cc +0 -1596
  421. data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.cc +0 -6549
  422. data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.h +0 -495
  423. data/ext/v8/upstream/v8/src/ia32/codegen-ia32-inl.h +0 -46
  424. data/ext/v8/upstream/v8/src/ia32/codegen-ia32.cc +0 -10385
  425. data/ext/v8/upstream/v8/src/ia32/codegen-ia32.h +0 -801
  426. data/ext/v8/upstream/v8/src/ia32/cpu-ia32.cc +0 -88
  427. data/ext/v8/upstream/v8/src/ia32/debug-ia32.cc +0 -312
  428. data/ext/v8/upstream/v8/src/ia32/deoptimizer-ia32.cc +0 -774
  429. data/ext/v8/upstream/v8/src/ia32/disasm-ia32.cc +0 -1620
  430. data/ext/v8/upstream/v8/src/ia32/frames-ia32.cc +0 -45
  431. data/ext/v8/upstream/v8/src/ia32/frames-ia32.h +0 -140
  432. data/ext/v8/upstream/v8/src/ia32/full-codegen-ia32.cc +0 -4357
  433. data/ext/v8/upstream/v8/src/ia32/ic-ia32.cc +0 -1779
  434. data/ext/v8/upstream/v8/src/ia32/jump-target-ia32.cc +0 -437
  435. data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.cc +0 -4158
  436. data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.h +0 -318
  437. data/ext/v8/upstream/v8/src/ia32/lithium-gap-resolver-ia32.cc +0 -466
  438. data/ext/v8/upstream/v8/src/ia32/lithium-gap-resolver-ia32.h +0 -110
  439. data/ext/v8/upstream/v8/src/ia32/lithium-ia32.cc +0 -2181
  440. data/ext/v8/upstream/v8/src/ia32/lithium-ia32.h +0 -2235
  441. data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.cc +0 -2056
  442. data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.h +0 -807
  443. data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.cc +0 -1264
  444. data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.h +0 -216
  445. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32-inl.h +0 -82
  446. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32.cc +0 -157
  447. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32.h +0 -43
  448. data/ext/v8/upstream/v8/src/ia32/simulator-ia32.cc +0 -30
  449. data/ext/v8/upstream/v8/src/ia32/simulator-ia32.h +0 -72
  450. data/ext/v8/upstream/v8/src/ia32/stub-cache-ia32.cc +0 -3711
  451. data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.cc +0 -1366
  452. data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.h +0 -650
  453. data/ext/v8/upstream/v8/src/ic-inl.h +0 -130
  454. data/ext/v8/upstream/v8/src/ic.cc +0 -2389
  455. data/ext/v8/upstream/v8/src/ic.h +0 -675
  456. data/ext/v8/upstream/v8/src/inspector.cc +0 -63
  457. data/ext/v8/upstream/v8/src/inspector.h +0 -62
  458. data/ext/v8/upstream/v8/src/interpreter-irregexp.cc +0 -659
  459. data/ext/v8/upstream/v8/src/interpreter-irregexp.h +0 -49
  460. data/ext/v8/upstream/v8/src/isolate.cc +0 -883
  461. data/ext/v8/upstream/v8/src/isolate.h +0 -1306
  462. data/ext/v8/upstream/v8/src/json.js +0 -342
  463. data/ext/v8/upstream/v8/src/jsregexp.cc +0 -5371
  464. data/ext/v8/upstream/v8/src/jsregexp.h +0 -1483
  465. data/ext/v8/upstream/v8/src/jump-target-heavy-inl.h +0 -51
  466. data/ext/v8/upstream/v8/src/jump-target-heavy.cc +0 -427
  467. data/ext/v8/upstream/v8/src/jump-target-heavy.h +0 -238
  468. data/ext/v8/upstream/v8/src/jump-target-inl.h +0 -48
  469. data/ext/v8/upstream/v8/src/jump-target-light-inl.h +0 -56
  470. data/ext/v8/upstream/v8/src/jump-target-light.cc +0 -111
  471. data/ext/v8/upstream/v8/src/jump-target-light.h +0 -193
  472. data/ext/v8/upstream/v8/src/jump-target.cc +0 -91
  473. data/ext/v8/upstream/v8/src/jump-target.h +0 -90
  474. data/ext/v8/upstream/v8/src/list-inl.h +0 -206
  475. data/ext/v8/upstream/v8/src/list.h +0 -164
  476. data/ext/v8/upstream/v8/src/lithium-allocator-inl.h +0 -142
  477. data/ext/v8/upstream/v8/src/lithium-allocator.cc +0 -2105
  478. data/ext/v8/upstream/v8/src/lithium-allocator.h +0 -630
  479. data/ext/v8/upstream/v8/src/lithium.cc +0 -169
  480. data/ext/v8/upstream/v8/src/lithium.h +0 -592
  481. data/ext/v8/upstream/v8/src/liveedit-debugger.js +0 -1082
  482. data/ext/v8/upstream/v8/src/liveedit.cc +0 -1693
  483. data/ext/v8/upstream/v8/src/liveedit.h +0 -179
  484. data/ext/v8/upstream/v8/src/liveobjectlist-inl.h +0 -126
  485. data/ext/v8/upstream/v8/src/liveobjectlist.cc +0 -2589
  486. data/ext/v8/upstream/v8/src/liveobjectlist.h +0 -322
  487. data/ext/v8/upstream/v8/src/log-inl.h +0 -59
  488. data/ext/v8/upstream/v8/src/log-utils.cc +0 -423
  489. data/ext/v8/upstream/v8/src/log-utils.h +0 -229
  490. data/ext/v8/upstream/v8/src/log.cc +0 -1666
  491. data/ext/v8/upstream/v8/src/log.h +0 -446
  492. data/ext/v8/upstream/v8/src/macro-assembler.h +0 -120
  493. data/ext/v8/upstream/v8/src/macros.py +0 -178
  494. data/ext/v8/upstream/v8/src/mark-compact.cc +0 -3092
  495. data/ext/v8/upstream/v8/src/mark-compact.h +0 -506
  496. data/ext/v8/upstream/v8/src/math.js +0 -264
  497. data/ext/v8/upstream/v8/src/messages.cc +0 -166
  498. data/ext/v8/upstream/v8/src/messages.h +0 -114
  499. data/ext/v8/upstream/v8/src/messages.js +0 -1090
  500. data/ext/v8/upstream/v8/src/mips/assembler-mips-inl.h +0 -335
  501. data/ext/v8/upstream/v8/src/mips/assembler-mips.cc +0 -2093
  502. data/ext/v8/upstream/v8/src/mips/assembler-mips.h +0 -1066
  503. data/ext/v8/upstream/v8/src/mips/builtins-mips.cc +0 -148
  504. data/ext/v8/upstream/v8/src/mips/code-stubs-mips.cc +0 -752
  505. data/ext/v8/upstream/v8/src/mips/code-stubs-mips.h +0 -511
  506. data/ext/v8/upstream/v8/src/mips/codegen-mips-inl.h +0 -64
  507. data/ext/v8/upstream/v8/src/mips/codegen-mips.cc +0 -1213
  508. data/ext/v8/upstream/v8/src/mips/codegen-mips.h +0 -633
  509. data/ext/v8/upstream/v8/src/mips/constants-mips.cc +0 -352
  510. data/ext/v8/upstream/v8/src/mips/constants-mips.h +0 -723
  511. data/ext/v8/upstream/v8/src/mips/cpu-mips.cc +0 -90
  512. data/ext/v8/upstream/v8/src/mips/debug-mips.cc +0 -155
  513. data/ext/v8/upstream/v8/src/mips/deoptimizer-mips.cc +0 -91
  514. data/ext/v8/upstream/v8/src/mips/disasm-mips.cc +0 -1023
  515. data/ext/v8/upstream/v8/src/mips/frames-mips.cc +0 -48
  516. data/ext/v8/upstream/v8/src/mips/frames-mips.h +0 -179
  517. data/ext/v8/upstream/v8/src/mips/full-codegen-mips.cc +0 -727
  518. data/ext/v8/upstream/v8/src/mips/ic-mips.cc +0 -244
  519. data/ext/v8/upstream/v8/src/mips/jump-target-mips.cc +0 -80
  520. data/ext/v8/upstream/v8/src/mips/lithium-codegen-mips.h +0 -65
  521. data/ext/v8/upstream/v8/src/mips/lithium-mips.h +0 -304
  522. data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.cc +0 -3327
  523. data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.h +0 -1058
  524. data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.cc +0 -478
  525. data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.h +0 -250
  526. data/ext/v8/upstream/v8/src/mips/register-allocator-mips-inl.h +0 -134
  527. data/ext/v8/upstream/v8/src/mips/register-allocator-mips.cc +0 -63
  528. data/ext/v8/upstream/v8/src/mips/register-allocator-mips.h +0 -47
  529. data/ext/v8/upstream/v8/src/mips/simulator-mips.cc +0 -2438
  530. data/ext/v8/upstream/v8/src/mips/simulator-mips.h +0 -394
  531. data/ext/v8/upstream/v8/src/mips/stub-cache-mips.cc +0 -601
  532. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips-inl.h +0 -58
  533. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.cc +0 -307
  534. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.h +0 -530
  535. data/ext/v8/upstream/v8/src/mirror-debugger.js +0 -2381
  536. data/ext/v8/upstream/v8/src/mksnapshot.cc +0 -256
  537. data/ext/v8/upstream/v8/src/natives.h +0 -63
  538. data/ext/v8/upstream/v8/src/objects-debug.cc +0 -722
  539. data/ext/v8/upstream/v8/src/objects-inl.h +0 -4166
  540. data/ext/v8/upstream/v8/src/objects-printer.cc +0 -801
  541. data/ext/v8/upstream/v8/src/objects-visiting.cc +0 -142
  542. data/ext/v8/upstream/v8/src/objects-visiting.h +0 -422
  543. data/ext/v8/upstream/v8/src/objects.cc +0 -10296
  544. data/ext/v8/upstream/v8/src/objects.h +0 -6662
  545. data/ext/v8/upstream/v8/src/parser.cc +0 -5168
  546. data/ext/v8/upstream/v8/src/parser.h +0 -823
  547. data/ext/v8/upstream/v8/src/platform-cygwin.cc +0 -811
  548. data/ext/v8/upstream/v8/src/platform-freebsd.cc +0 -854
  549. data/ext/v8/upstream/v8/src/platform-linux.cc +0 -1120
  550. data/ext/v8/upstream/v8/src/platform-macos.cc +0 -865
  551. data/ext/v8/upstream/v8/src/platform-nullos.cc +0 -504
  552. data/ext/v8/upstream/v8/src/platform-openbsd.cc +0 -672
  553. data/ext/v8/upstream/v8/src/platform-posix.cc +0 -424
  554. data/ext/v8/upstream/v8/src/platform-solaris.cc +0 -796
  555. data/ext/v8/upstream/v8/src/platform-tls-mac.h +0 -62
  556. data/ext/v8/upstream/v8/src/platform-tls-win32.h +0 -62
  557. data/ext/v8/upstream/v8/src/platform-tls.h +0 -50
  558. data/ext/v8/upstream/v8/src/platform-win32.cc +0 -2072
  559. data/ext/v8/upstream/v8/src/platform.h +0 -693
  560. data/ext/v8/upstream/v8/src/preparse-data.cc +0 -185
  561. data/ext/v8/upstream/v8/src/preparse-data.h +0 -249
  562. data/ext/v8/upstream/v8/src/preparser-api.cc +0 -219
  563. data/ext/v8/upstream/v8/src/preparser.cc +0 -1205
  564. data/ext/v8/upstream/v8/src/preparser.h +0 -278
  565. data/ext/v8/upstream/v8/src/prettyprinter.cc +0 -1530
  566. data/ext/v8/upstream/v8/src/prettyprinter.h +0 -223
  567. data/ext/v8/upstream/v8/src/profile-generator-inl.h +0 -128
  568. data/ext/v8/upstream/v8/src/profile-generator.cc +0 -3095
  569. data/ext/v8/upstream/v8/src/profile-generator.h +0 -1125
  570. data/ext/v8/upstream/v8/src/property.cc +0 -102
  571. data/ext/v8/upstream/v8/src/property.h +0 -348
  572. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp-inl.h +0 -78
  573. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp.cc +0 -470
  574. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp.h +0 -142
  575. data/ext/v8/upstream/v8/src/regexp-macro-assembler-tracer.cc +0 -373
  576. data/ext/v8/upstream/v8/src/regexp-macro-assembler-tracer.h +0 -104
  577. data/ext/v8/upstream/v8/src/regexp-macro-assembler.cc +0 -266
  578. data/ext/v8/upstream/v8/src/regexp-macro-assembler.h +0 -236
  579. data/ext/v8/upstream/v8/src/regexp-stack.cc +0 -111
  580. data/ext/v8/upstream/v8/src/regexp-stack.h +0 -147
  581. data/ext/v8/upstream/v8/src/regexp.js +0 -483
  582. data/ext/v8/upstream/v8/src/register-allocator-inl.h +0 -141
  583. data/ext/v8/upstream/v8/src/register-allocator.cc +0 -98
  584. data/ext/v8/upstream/v8/src/register-allocator.h +0 -310
  585. data/ext/v8/upstream/v8/src/rewriter.cc +0 -1024
  586. data/ext/v8/upstream/v8/src/rewriter.h +0 -59
  587. data/ext/v8/upstream/v8/src/runtime-profiler.cc +0 -478
  588. data/ext/v8/upstream/v8/src/runtime-profiler.h +0 -192
  589. data/ext/v8/upstream/v8/src/runtime.cc +0 -11949
  590. data/ext/v8/upstream/v8/src/runtime.h +0 -643
  591. data/ext/v8/upstream/v8/src/runtime.js +0 -643
  592. data/ext/v8/upstream/v8/src/safepoint-table.cc +0 -256
  593. data/ext/v8/upstream/v8/src/safepoint-table.h +0 -269
  594. data/ext/v8/upstream/v8/src/scanner-base.cc +0 -964
  595. data/ext/v8/upstream/v8/src/scanner-base.h +0 -664
  596. data/ext/v8/upstream/v8/src/scanner.cc +0 -584
  597. data/ext/v8/upstream/v8/src/scanner.h +0 -196
  598. data/ext/v8/upstream/v8/src/scopeinfo.cc +0 -631
  599. data/ext/v8/upstream/v8/src/scopeinfo.h +0 -249
  600. data/ext/v8/upstream/v8/src/scopes.cc +0 -1093
  601. data/ext/v8/upstream/v8/src/scopes.h +0 -508
  602. data/ext/v8/upstream/v8/src/serialize.cc +0 -1574
  603. data/ext/v8/upstream/v8/src/serialize.h +0 -589
  604. data/ext/v8/upstream/v8/src/shell.h +0 -55
  605. data/ext/v8/upstream/v8/src/simulator.h +0 -43
  606. data/ext/v8/upstream/v8/src/small-pointer-list.h +0 -163
  607. data/ext/v8/upstream/v8/src/smart-pointer.h +0 -109
  608. data/ext/v8/upstream/v8/src/snapshot-common.cc +0 -82
  609. data/ext/v8/upstream/v8/src/snapshot-empty.cc +0 -50
  610. data/ext/v8/upstream/v8/src/snapshot.h +0 -73
  611. data/ext/v8/upstream/v8/src/spaces-inl.h +0 -529
  612. data/ext/v8/upstream/v8/src/spaces.cc +0 -3147
  613. data/ext/v8/upstream/v8/src/spaces.h +0 -2368
  614. data/ext/v8/upstream/v8/src/splay-tree-inl.h +0 -310
  615. data/ext/v8/upstream/v8/src/splay-tree.h +0 -203
  616. data/ext/v8/upstream/v8/src/string-search.cc +0 -41
  617. data/ext/v8/upstream/v8/src/string-search.h +0 -568
  618. data/ext/v8/upstream/v8/src/string-stream.cc +0 -592
  619. data/ext/v8/upstream/v8/src/string-stream.h +0 -191
  620. data/ext/v8/upstream/v8/src/string.js +0 -915
  621. data/ext/v8/upstream/v8/src/strtod.cc +0 -440
  622. data/ext/v8/upstream/v8/src/strtod.h +0 -40
  623. data/ext/v8/upstream/v8/src/stub-cache.cc +0 -1940
  624. data/ext/v8/upstream/v8/src/stub-cache.h +0 -866
  625. data/ext/v8/upstream/v8/src/third_party/valgrind/valgrind.h +0 -3925
  626. data/ext/v8/upstream/v8/src/token.cc +0 -63
  627. data/ext/v8/upstream/v8/src/token.h +0 -288
  628. data/ext/v8/upstream/v8/src/top.cc +0 -983
  629. data/ext/v8/upstream/v8/src/type-info.cc +0 -472
  630. data/ext/v8/upstream/v8/src/type-info.h +0 -290
  631. data/ext/v8/upstream/v8/src/unbound-queue-inl.h +0 -95
  632. data/ext/v8/upstream/v8/src/unbound-queue.h +0 -67
  633. data/ext/v8/upstream/v8/src/unicode-inl.h +0 -238
  634. data/ext/v8/upstream/v8/src/unicode.cc +0 -1624
  635. data/ext/v8/upstream/v8/src/unicode.h +0 -280
  636. data/ext/v8/upstream/v8/src/uri.js +0 -402
  637. data/ext/v8/upstream/v8/src/utils.cc +0 -371
  638. data/ext/v8/upstream/v8/src/utils.h +0 -796
  639. data/ext/v8/upstream/v8/src/v8-counters.cc +0 -62
  640. data/ext/v8/upstream/v8/src/v8-counters.h +0 -311
  641. data/ext/v8/upstream/v8/src/v8.cc +0 -215
  642. data/ext/v8/upstream/v8/src/v8.h +0 -130
  643. data/ext/v8/upstream/v8/src/v8checks.h +0 -64
  644. data/ext/v8/upstream/v8/src/v8dll-main.cc +0 -39
  645. data/ext/v8/upstream/v8/src/v8globals.h +0 -486
  646. data/ext/v8/upstream/v8/src/v8memory.h +0 -82
  647. data/ext/v8/upstream/v8/src/v8natives.js +0 -1293
  648. data/ext/v8/upstream/v8/src/v8preparserdll-main.cc +0 -39
  649. data/ext/v8/upstream/v8/src/v8threads.cc +0 -453
  650. data/ext/v8/upstream/v8/src/v8threads.h +0 -164
  651. data/ext/v8/upstream/v8/src/v8utils.h +0 -317
  652. data/ext/v8/upstream/v8/src/variables.cc +0 -132
  653. data/ext/v8/upstream/v8/src/variables.h +0 -212
  654. data/ext/v8/upstream/v8/src/version.cc +0 -116
  655. data/ext/v8/upstream/v8/src/version.h +0 -68
  656. data/ext/v8/upstream/v8/src/virtual-frame-heavy-inl.h +0 -190
  657. data/ext/v8/upstream/v8/src/virtual-frame-heavy.cc +0 -312
  658. data/ext/v8/upstream/v8/src/virtual-frame-inl.h +0 -39
  659. data/ext/v8/upstream/v8/src/virtual-frame-light-inl.h +0 -171
  660. data/ext/v8/upstream/v8/src/virtual-frame-light.cc +0 -52
  661. data/ext/v8/upstream/v8/src/virtual-frame.cc +0 -49
  662. data/ext/v8/upstream/v8/src/virtual-frame.h +0 -59
  663. data/ext/v8/upstream/v8/src/vm-state-inl.h +0 -138
  664. data/ext/v8/upstream/v8/src/vm-state.h +0 -70
  665. data/ext/v8/upstream/v8/src/win32-headers.h +0 -96
  666. data/ext/v8/upstream/v8/src/x64/assembler-x64-inl.h +0 -456
  667. data/ext/v8/upstream/v8/src/x64/assembler-x64.cc +0 -2954
  668. data/ext/v8/upstream/v8/src/x64/assembler-x64.h +0 -1630
  669. data/ext/v8/upstream/v8/src/x64/builtins-x64.cc +0 -1493
  670. data/ext/v8/upstream/v8/src/x64/code-stubs-x64.cc +0 -5132
  671. data/ext/v8/upstream/v8/src/x64/code-stubs-x64.h +0 -477
  672. data/ext/v8/upstream/v8/src/x64/codegen-x64-inl.h +0 -46
  673. data/ext/v8/upstream/v8/src/x64/codegen-x64.cc +0 -8843
  674. data/ext/v8/upstream/v8/src/x64/codegen-x64.h +0 -753
  675. data/ext/v8/upstream/v8/src/x64/cpu-x64.cc +0 -88
  676. data/ext/v8/upstream/v8/src/x64/debug-x64.cc +0 -318
  677. data/ext/v8/upstream/v8/src/x64/deoptimizer-x64.cc +0 -815
  678. data/ext/v8/upstream/v8/src/x64/disasm-x64.cc +0 -1752
  679. data/ext/v8/upstream/v8/src/x64/frames-x64.cc +0 -45
  680. data/ext/v8/upstream/v8/src/x64/frames-x64.h +0 -130
  681. data/ext/v8/upstream/v8/src/x64/full-codegen-x64.cc +0 -4339
  682. data/ext/v8/upstream/v8/src/x64/ic-x64.cc +0 -1752
  683. data/ext/v8/upstream/v8/src/x64/jump-target-x64.cc +0 -437
  684. data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.cc +0 -3970
  685. data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.h +0 -318
  686. data/ext/v8/upstream/v8/src/x64/lithium-gap-resolver-x64.cc +0 -320
  687. data/ext/v8/upstream/v8/src/x64/lithium-gap-resolver-x64.h +0 -74
  688. data/ext/v8/upstream/v8/src/x64/lithium-x64.cc +0 -2115
  689. data/ext/v8/upstream/v8/src/x64/lithium-x64.h +0 -2161
  690. data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.cc +0 -2911
  691. data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.h +0 -1984
  692. data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.cc +0 -1398
  693. data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.h +0 -282
  694. data/ext/v8/upstream/v8/src/x64/register-allocator-x64-inl.h +0 -87
  695. data/ext/v8/upstream/v8/src/x64/register-allocator-x64.cc +0 -95
  696. data/ext/v8/upstream/v8/src/x64/register-allocator-x64.h +0 -43
  697. data/ext/v8/upstream/v8/src/x64/simulator-x64.cc +0 -27
  698. data/ext/v8/upstream/v8/src/x64/simulator-x64.h +0 -71
  699. data/ext/v8/upstream/v8/src/x64/stub-cache-x64.cc +0 -3460
  700. data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.cc +0 -1296
  701. data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.h +0 -597
  702. data/ext/v8/upstream/v8/src/zone-inl.h +0 -129
  703. data/ext/v8/upstream/v8/src/zone.cc +0 -196
  704. data/ext/v8/upstream/v8/src/zone.h +0 -236
  705. data/ext/v8/upstream/v8/tools/codemap.js +0 -265
  706. data/ext/v8/upstream/v8/tools/consarray.js +0 -93
  707. data/ext/v8/upstream/v8/tools/csvparser.js +0 -78
  708. data/ext/v8/upstream/v8/tools/disasm.py +0 -92
  709. data/ext/v8/upstream/v8/tools/freebsd-tick-processor +0 -10
  710. data/ext/v8/upstream/v8/tools/gc-nvp-trace-processor.py +0 -328
  711. data/ext/v8/upstream/v8/tools/generate-ten-powers.scm +0 -286
  712. data/ext/v8/upstream/v8/tools/grokdump.py +0 -840
  713. data/ext/v8/upstream/v8/tools/gyp/v8.gyp +0 -844
  714. data/ext/v8/upstream/v8/tools/js2c.py +0 -380
  715. data/ext/v8/upstream/v8/tools/jsmin.py +0 -280
  716. data/ext/v8/upstream/v8/tools/linux-tick-processor +0 -35
  717. data/ext/v8/upstream/v8/tools/ll_prof.py +0 -919
  718. data/ext/v8/upstream/v8/tools/logreader.js +0 -185
  719. data/ext/v8/upstream/v8/tools/mac-nm +0 -18
  720. data/ext/v8/upstream/v8/tools/mac-tick-processor +0 -6
  721. data/ext/v8/upstream/v8/tools/oom_dump/README +0 -31
  722. data/ext/v8/upstream/v8/tools/oom_dump/SConstruct +0 -42
  723. data/ext/v8/upstream/v8/tools/oom_dump/oom_dump.cc +0 -288
  724. data/ext/v8/upstream/v8/tools/presubmit.py +0 -305
  725. data/ext/v8/upstream/v8/tools/process-heap-prof.py +0 -120
  726. data/ext/v8/upstream/v8/tools/profile.js +0 -751
  727. data/ext/v8/upstream/v8/tools/profile_view.js +0 -219
  728. data/ext/v8/upstream/v8/tools/run-valgrind.py +0 -77
  729. data/ext/v8/upstream/v8/tools/splaytree.js +0 -316
  730. data/ext/v8/upstream/v8/tools/stats-viewer.py +0 -468
  731. data/ext/v8/upstream/v8/tools/test.py +0 -1490
  732. data/ext/v8/upstream/v8/tools/tickprocessor-driver.js +0 -59
  733. data/ext/v8/upstream/v8/tools/tickprocessor.js +0 -877
  734. data/ext/v8/upstream/v8/tools/utils.py +0 -96
  735. data/ext/v8/upstream/v8/tools/visual_studio/README.txt +0 -70
  736. data/ext/v8/upstream/v8/tools/visual_studio/arm.vsprops +0 -14
  737. data/ext/v8/upstream/v8/tools/visual_studio/common.vsprops +0 -34
  738. data/ext/v8/upstream/v8/tools/visual_studio/d8.vcproj +0 -193
  739. data/ext/v8/upstream/v8/tools/visual_studio/d8_arm.vcproj +0 -193
  740. data/ext/v8/upstream/v8/tools/visual_studio/d8_x64.vcproj +0 -209
  741. data/ext/v8/upstream/v8/tools/visual_studio/d8js2c.cmd +0 -6
  742. data/ext/v8/upstream/v8/tools/visual_studio/debug.vsprops +0 -17
  743. data/ext/v8/upstream/v8/tools/visual_studio/ia32.vsprops +0 -17
  744. data/ext/v8/upstream/v8/tools/visual_studio/js2c.cmd +0 -6
  745. data/ext/v8/upstream/v8/tools/visual_studio/release.vsprops +0 -24
  746. data/ext/v8/upstream/v8/tools/visual_studio/v8.sln +0 -101
  747. data/ext/v8/upstream/v8/tools/visual_studio/v8.vcproj +0 -227
  748. data/ext/v8/upstream/v8/tools/visual_studio/v8_arm.sln +0 -74
  749. data/ext/v8/upstream/v8/tools/visual_studio/v8_arm.vcproj +0 -227
  750. data/ext/v8/upstream/v8/tools/visual_studio/v8_base.vcproj +0 -1308
  751. data/ext/v8/upstream/v8/tools/visual_studio/v8_base_arm.vcproj +0 -1238
  752. data/ext/v8/upstream/v8/tools/visual_studio/v8_base_x64.vcproj +0 -1300
  753. data/ext/v8/upstream/v8/tools/visual_studio/v8_cctest.vcproj +0 -265
  754. data/ext/v8/upstream/v8/tools/visual_studio/v8_cctest_arm.vcproj +0 -249
  755. data/ext/v8/upstream/v8/tools/visual_studio/v8_cctest_x64.vcproj +0 -257
  756. data/ext/v8/upstream/v8/tools/visual_studio/v8_mksnapshot.vcproj +0 -145
  757. data/ext/v8/upstream/v8/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -145
  758. data/ext/v8/upstream/v8/tools/visual_studio/v8_process_sample.vcproj +0 -145
  759. data/ext/v8/upstream/v8/tools/visual_studio/v8_process_sample_arm.vcproj +0 -145
  760. data/ext/v8/upstream/v8/tools/visual_studio/v8_process_sample_x64.vcproj +0 -161
  761. data/ext/v8/upstream/v8/tools/visual_studio/v8_shell_sample.vcproj +0 -147
  762. data/ext/v8/upstream/v8/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -147
  763. data/ext/v8/upstream/v8/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -163
  764. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot.vcproj +0 -142
  765. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot_cc.vcproj +0 -92
  766. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -92
  767. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot_x64.vcproj +0 -142
  768. data/ext/v8/upstream/v8/tools/visual_studio/v8_x64.sln +0 -101
  769. data/ext/v8/upstream/v8/tools/visual_studio/v8_x64.vcproj +0 -227
  770. data/ext/v8/upstream/v8/tools/visual_studio/x64.vsprops +0 -18
  771. data/ext/v8/upstream/v8/tools/windows-tick-processor.bat +0 -30
@@ -1,2569 +0,0 @@
1
- // Copyright 2006-2008 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- // Default number of frames to include in the response to backtrace request.
29
- const kDefaultBacktraceLength = 10;
30
-
31
- const Debug = {};
32
-
33
- // Regular expression to skip "crud" at the beginning of a source line which is
34
- // not really code. Currently the regular expression matches whitespace and
35
- // comments.
36
- const sourceLineBeginningSkip = /^(?:\s*(?:\/\*.*?\*\/)*)*/;
37
-
38
- // Debug events which can occour in the V8 JavaScript engine. These originate
39
- // from the API include file debug.h.
40
- Debug.DebugEvent = { Break: 1,
41
- Exception: 2,
42
- NewFunction: 3,
43
- BeforeCompile: 4,
44
- AfterCompile: 5,
45
- ScriptCollected: 6 };
46
-
47
- // Types of exceptions that can be broken upon.
48
- Debug.ExceptionBreak = { Caught : 0,
49
- Uncaught: 1 };
50
-
51
- // The different types of steps.
52
- Debug.StepAction = { StepOut: 0,
53
- StepNext: 1,
54
- StepIn: 2,
55
- StepMin: 3,
56
- StepInMin: 4 };
57
-
58
- // The different types of scripts matching enum ScriptType in objects.h.
59
- Debug.ScriptType = { Native: 0,
60
- Extension: 1,
61
- Normal: 2 };
62
-
63
- // The different types of script compilations matching enum
64
- // Script::CompilationType in objects.h.
65
- Debug.ScriptCompilationType = { Host: 0,
66
- Eval: 1,
67
- JSON: 2 };
68
-
69
- // The different script break point types.
70
- Debug.ScriptBreakPointType = { ScriptId: 0,
71
- ScriptName: 1 };
72
-
73
- function ScriptTypeFlag(type) {
74
- return (1 << type);
75
- }
76
-
77
- // Globals.
78
- var next_response_seq = 0;
79
- var next_break_point_number = 1;
80
- var break_points = [];
81
- var script_break_points = [];
82
- var debugger_flags = {
83
- breakPointsActive: {
84
- value: true,
85
- getValue: function() { return this.value; },
86
- setValue: function(value) {
87
- this.value = !!value;
88
- %SetDisableBreak(!this.value);
89
- }
90
- },
91
- breakOnCaughtException: {
92
- getValue: function() { return Debug.isBreakOnException(); },
93
- setValue: function(value) {
94
- if (value) {
95
- Debug.setBreakOnException();
96
- } else {
97
- Debug.clearBreakOnException();
98
- }
99
- }
100
- },
101
- breakOnUncaughtException: {
102
- getValue: function() { return Debug.isBreakOnUncaughtException(); },
103
- setValue: function(value) {
104
- if (value) {
105
- Debug.setBreakOnUncaughtException();
106
- } else {
107
- Debug.clearBreakOnUncaughtException();
108
- }
109
- }
110
- },
111
- };
112
- var lol_is_enabled = %HasLOLEnabled();
113
-
114
-
115
- // Create a new break point object and add it to the list of break points.
116
- function MakeBreakPoint(source_position, opt_script_break_point) {
117
- var break_point = new BreakPoint(source_position, opt_script_break_point);
118
- break_points.push(break_point);
119
- return break_point;
120
- }
121
-
122
-
123
- // Object representing a break point.
124
- // NOTE: This object does not have a reference to the function having break
125
- // point as this would cause function not to be garbage collected when it is
126
- // not used any more. We do not want break points to keep functions alive.
127
- function BreakPoint(source_position, opt_script_break_point) {
128
- this.source_position_ = source_position;
129
- if (opt_script_break_point) {
130
- this.script_break_point_ = opt_script_break_point;
131
- } else {
132
- this.number_ = next_break_point_number++;
133
- }
134
- this.hit_count_ = 0;
135
- this.active_ = true;
136
- this.condition_ = null;
137
- this.ignoreCount_ = 0;
138
- }
139
-
140
-
141
- BreakPoint.prototype.number = function() {
142
- return this.number_;
143
- };
144
-
145
-
146
- BreakPoint.prototype.func = function() {
147
- return this.func_;
148
- };
149
-
150
-
151
- BreakPoint.prototype.source_position = function() {
152
- return this.source_position_;
153
- };
154
-
155
-
156
- BreakPoint.prototype.hit_count = function() {
157
- return this.hit_count_;
158
- };
159
-
160
-
161
- BreakPoint.prototype.active = function() {
162
- if (this.script_break_point()) {
163
- return this.script_break_point().active();
164
- }
165
- return this.active_;
166
- };
167
-
168
-
169
- BreakPoint.prototype.condition = function() {
170
- if (this.script_break_point() && this.script_break_point().condition()) {
171
- return this.script_break_point().condition();
172
- }
173
- return this.condition_;
174
- };
175
-
176
-
177
- BreakPoint.prototype.ignoreCount = function() {
178
- return this.ignoreCount_;
179
- };
180
-
181
-
182
- BreakPoint.prototype.script_break_point = function() {
183
- return this.script_break_point_;
184
- };
185
-
186
-
187
- BreakPoint.prototype.enable = function() {
188
- this.active_ = true;
189
- };
190
-
191
-
192
- BreakPoint.prototype.disable = function() {
193
- this.active_ = false;
194
- };
195
-
196
-
197
- BreakPoint.prototype.setCondition = function(condition) {
198
- this.condition_ = condition;
199
- };
200
-
201
-
202
- BreakPoint.prototype.setIgnoreCount = function(ignoreCount) {
203
- this.ignoreCount_ = ignoreCount;
204
- };
205
-
206
-
207
- BreakPoint.prototype.isTriggered = function(exec_state) {
208
- // Break point not active - not triggered.
209
- if (!this.active()) return false;
210
-
211
- // Check for conditional break point.
212
- if (this.condition()) {
213
- // If break point has condition try to evaluate it in the top frame.
214
- try {
215
- var mirror = exec_state.frame(0).evaluate(this.condition());
216
- // If no sensible mirror or non true value break point not triggered.
217
- if (!(mirror instanceof ValueMirror) || !%ToBoolean(mirror.value_)) {
218
- return false;
219
- }
220
- } catch (e) {
221
- // Exception evaluating condition counts as not triggered.
222
- return false;
223
- }
224
- }
225
-
226
- // Update the hit count.
227
- this.hit_count_++;
228
- if (this.script_break_point_) {
229
- this.script_break_point_.hit_count_++;
230
- }
231
-
232
- // If the break point has an ignore count it is not triggered.
233
- if (this.ignoreCount_ > 0) {
234
- this.ignoreCount_--;
235
- return false;
236
- }
237
-
238
- // Break point triggered.
239
- return true;
240
- };
241
-
242
-
243
- // Function called from the runtime when a break point is hit. Returns true if
244
- // the break point is triggered and supposed to break execution.
245
- function IsBreakPointTriggered(break_id, break_point) {
246
- return break_point.isTriggered(MakeExecutionState(break_id));
247
- }
248
-
249
-
250
- // Object representing a script break point. The script is referenced by its
251
- // script name or script id and the break point is represented as line and
252
- // column.
253
- function ScriptBreakPoint(type, script_id_or_name, opt_line, opt_column,
254
- opt_groupId) {
255
- this.type_ = type;
256
- if (type == Debug.ScriptBreakPointType.ScriptId) {
257
- this.script_id_ = script_id_or_name;
258
- } else { // type == Debug.ScriptBreakPointType.ScriptName
259
- this.script_name_ = script_id_or_name;
260
- }
261
- this.line_ = opt_line || 0;
262
- this.column_ = opt_column;
263
- this.groupId_ = opt_groupId;
264
- this.hit_count_ = 0;
265
- this.active_ = true;
266
- this.condition_ = null;
267
- this.ignoreCount_ = 0;
268
- this.break_points_ = [];
269
- }
270
-
271
-
272
- //Creates a clone of script breakpoint that is linked to another script.
273
- ScriptBreakPoint.prototype.cloneForOtherScript = function (other_script) {
274
- var copy = new ScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId,
275
- other_script.id, this.line_, this.column_, this.groupId_);
276
- copy.number_ = next_break_point_number++;
277
- script_break_points.push(copy);
278
-
279
- copy.hit_count_ = this.hit_count_;
280
- copy.active_ = this.active_;
281
- copy.condition_ = this.condition_;
282
- copy.ignoreCount_ = this.ignoreCount_;
283
- return copy;
284
- }
285
-
286
-
287
- ScriptBreakPoint.prototype.number = function() {
288
- return this.number_;
289
- };
290
-
291
-
292
- ScriptBreakPoint.prototype.groupId = function() {
293
- return this.groupId_;
294
- };
295
-
296
-
297
- ScriptBreakPoint.prototype.type = function() {
298
- return this.type_;
299
- };
300
-
301
-
302
- ScriptBreakPoint.prototype.script_id = function() {
303
- return this.script_id_;
304
- };
305
-
306
-
307
- ScriptBreakPoint.prototype.script_name = function() {
308
- return this.script_name_;
309
- };
310
-
311
-
312
- ScriptBreakPoint.prototype.line = function() {
313
- return this.line_;
314
- };
315
-
316
-
317
- ScriptBreakPoint.prototype.column = function() {
318
- return this.column_;
319
- };
320
-
321
-
322
- ScriptBreakPoint.prototype.actual_locations = function() {
323
- var locations = [];
324
- for (var i = 0; i < this.break_points_.length; i++) {
325
- locations.push(this.break_points_[i].actual_location);
326
- }
327
- return locations;
328
- }
329
-
330
-
331
- ScriptBreakPoint.prototype.update_positions = function(line, column) {
332
- this.line_ = line;
333
- this.column_ = column;
334
- }
335
-
336
-
337
- ScriptBreakPoint.prototype.hit_count = function() {
338
- return this.hit_count_;
339
- };
340
-
341
-
342
- ScriptBreakPoint.prototype.active = function() {
343
- return this.active_;
344
- };
345
-
346
-
347
- ScriptBreakPoint.prototype.condition = function() {
348
- return this.condition_;
349
- };
350
-
351
-
352
- ScriptBreakPoint.prototype.ignoreCount = function() {
353
- return this.ignoreCount_;
354
- };
355
-
356
-
357
- ScriptBreakPoint.prototype.enable = function() {
358
- this.active_ = true;
359
- };
360
-
361
-
362
- ScriptBreakPoint.prototype.disable = function() {
363
- this.active_ = false;
364
- };
365
-
366
-
367
- ScriptBreakPoint.prototype.setCondition = function(condition) {
368
- this.condition_ = condition;
369
- };
370
-
371
-
372
- ScriptBreakPoint.prototype.setIgnoreCount = function(ignoreCount) {
373
- this.ignoreCount_ = ignoreCount;
374
-
375
- // Set ignore count on all break points created from this script break point.
376
- for (var i = 0; i < this.break_points_.length; i++) {
377
- this.break_points_[i].setIgnoreCount(ignoreCount);
378
- }
379
- };
380
-
381
-
382
- // Check whether a script matches this script break point. Currently this is
383
- // only based on script name.
384
- ScriptBreakPoint.prototype.matchesScript = function(script) {
385
- if (this.type_ == Debug.ScriptBreakPointType.ScriptId) {
386
- return this.script_id_ == script.id;
387
- } else { // this.type_ == Debug.ScriptBreakPointType.ScriptName
388
- return this.script_name_ == script.nameOrSourceURL() &&
389
- script.line_offset <= this.line_ &&
390
- this.line_ < script.line_offset + script.lineCount();
391
- }
392
- };
393
-
394
-
395
- // Set the script break point in a script.
396
- ScriptBreakPoint.prototype.set = function (script) {
397
- var column = this.column();
398
- var line = this.line();
399
- // If the column is undefined the break is on the line. To help locate the
400
- // first piece of breakable code on the line try to find the column on the
401
- // line which contains some source.
402
- if (IS_UNDEFINED(column)) {
403
- var source_line = script.sourceLine(this.line());
404
-
405
- // Allocate array for caching the columns where the actual source starts.
406
- if (!script.sourceColumnStart_) {
407
- script.sourceColumnStart_ = new Array(script.lineCount());
408
- }
409
-
410
- // Fill cache if needed and get column where the actual source starts.
411
- if (IS_UNDEFINED(script.sourceColumnStart_[line])) {
412
- script.sourceColumnStart_[line] =
413
- source_line.match(sourceLineBeginningSkip)[0].length;
414
- }
415
- column = script.sourceColumnStart_[line];
416
- }
417
-
418
- // Convert the line and column into an absolute position within the script.
419
- var position = Debug.findScriptSourcePosition(script, this.line(), column);
420
-
421
- // If the position is not found in the script (the script might be shorter
422
- // than it used to be) just ignore it.
423
- if (position === null) return;
424
-
425
- // Create a break point object and set the break point.
426
- break_point = MakeBreakPoint(position, this);
427
- break_point.setIgnoreCount(this.ignoreCount());
428
- var actual_position = %SetScriptBreakPoint(script, position, break_point);
429
- if (IS_UNDEFINED(actual_position)) {
430
- actual_position = position;
431
- }
432
- var actual_location = script.locationFromPosition(actual_position, true);
433
- break_point.actual_location = { line: actual_location.line,
434
- column: actual_location.column };
435
- this.break_points_.push(break_point);
436
- return break_point;
437
- };
438
-
439
-
440
- // Clear all the break points created from this script break point
441
- ScriptBreakPoint.prototype.clear = function () {
442
- var remaining_break_points = [];
443
- for (var i = 0; i < break_points.length; i++) {
444
- if (break_points[i].script_break_point() &&
445
- break_points[i].script_break_point() === this) {
446
- %ClearBreakPoint(break_points[i]);
447
- } else {
448
- remaining_break_points.push(break_points[i]);
449
- }
450
- }
451
- break_points = remaining_break_points;
452
- this.break_points_ = [];
453
- };
454
-
455
-
456
- // Function called from runtime when a new script is compiled to set any script
457
- // break points set in this script.
458
- function UpdateScriptBreakPoints(script) {
459
- for (var i = 0; i < script_break_points.length; i++) {
460
- if (script_break_points[i].type() == Debug.ScriptBreakPointType.ScriptName &&
461
- script_break_points[i].matchesScript(script)) {
462
- script_break_points[i].set(script);
463
- }
464
- }
465
- }
466
-
467
-
468
- function GetScriptBreakPoints(script) {
469
- var result = [];
470
- for (var i = 0; i < script_break_points.length; i++) {
471
- if (script_break_points[i].matchesScript(script)) {
472
- result.push(script_break_points[i]);
473
- }
474
- }
475
- return result;
476
- }
477
-
478
-
479
- Debug.setListener = function(listener, opt_data) {
480
- if (!IS_FUNCTION(listener) && !IS_UNDEFINED(listener) && !IS_NULL(listener)) {
481
- throw new Error('Parameters have wrong types.');
482
- }
483
- %SetDebugEventListener(listener, opt_data);
484
- };
485
-
486
-
487
- Debug.breakExecution = function(f) {
488
- %Break();
489
- };
490
-
491
- Debug.breakLocations = function(f) {
492
- if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.');
493
- return %GetBreakLocations(f);
494
- };
495
-
496
- // Returns a Script object. If the parameter is a function the return value
497
- // is the script in which the function is defined. If the parameter is a string
498
- // the return value is the script for which the script name has that string
499
- // value. If it is a regexp and there is a unique script whose name matches
500
- // we return that, otherwise undefined.
501
- Debug.findScript = function(func_or_script_name) {
502
- if (IS_FUNCTION(func_or_script_name)) {
503
- return %FunctionGetScript(func_or_script_name);
504
- } else if (IS_REGEXP(func_or_script_name)) {
505
- var scripts = Debug.scripts();
506
- var last_result = null;
507
- var result_count = 0;
508
- for (var i in scripts) {
509
- var script = scripts[i];
510
- if (func_or_script_name.test(script.name)) {
511
- last_result = script;
512
- result_count++;
513
- }
514
- }
515
- // Return the unique script matching the regexp. If there are more
516
- // than one we don't return a value since there is no good way to
517
- // decide which one to return. Returning a "random" one, say the
518
- // first, would introduce nondeterminism (or something close to it)
519
- // because the order is the heap iteration order.
520
- if (result_count == 1) {
521
- return last_result;
522
- } else {
523
- return undefined;
524
- }
525
- } else {
526
- return %GetScript(func_or_script_name);
527
- }
528
- };
529
-
530
- // Returns the script source. If the parameter is a function the return value
531
- // is the script source for the script in which the function is defined. If the
532
- // parameter is a string the return value is the script for which the script
533
- // name has that string value.
534
- Debug.scriptSource = function(func_or_script_name) {
535
- return this.findScript(func_or_script_name).source;
536
- };
537
-
538
- Debug.source = function(f) {
539
- if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.');
540
- return %FunctionGetSourceCode(f);
541
- };
542
-
543
- Debug.disassemble = function(f) {
544
- if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.');
545
- return %DebugDisassembleFunction(f);
546
- };
547
-
548
- Debug.disassembleConstructor = function(f) {
549
- if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.');
550
- return %DebugDisassembleConstructor(f);
551
- };
552
-
553
- Debug.ExecuteInDebugContext = function(f, without_debugger) {
554
- if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.');
555
- return %ExecuteInDebugContext(f, !!without_debugger);
556
- };
557
-
558
- Debug.sourcePosition = function(f) {
559
- if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.');
560
- return %FunctionGetScriptSourcePosition(f);
561
- };
562
-
563
-
564
- Debug.findFunctionSourceLocation = function(func, opt_line, opt_column) {
565
- var script = %FunctionGetScript(func);
566
- var script_offset = %FunctionGetScriptSourcePosition(func);
567
- return script.locationFromLine(opt_line, opt_column, script_offset);
568
- }
569
-
570
-
571
- // Returns the character position in a script based on a line number and an
572
- // optional position within that line.
573
- Debug.findScriptSourcePosition = function(script, opt_line, opt_column) {
574
- var location = script.locationFromLine(opt_line, opt_column);
575
- return location ? location.position : null;
576
- }
577
-
578
-
579
- Debug.findBreakPoint = function(break_point_number, remove) {
580
- var break_point;
581
- for (var i = 0; i < break_points.length; i++) {
582
- if (break_points[i].number() == break_point_number) {
583
- break_point = break_points[i];
584
- // Remove the break point from the list if requested.
585
- if (remove) {
586
- break_points.splice(i, 1);
587
- }
588
- break;
589
- }
590
- }
591
- if (break_point) {
592
- return break_point;
593
- } else {
594
- return this.findScriptBreakPoint(break_point_number, remove);
595
- }
596
- };
597
-
598
- Debug.findBreakPointActualLocations = function(break_point_number) {
599
- for (var i = 0; i < script_break_points.length; i++) {
600
- if (script_break_points[i].number() == break_point_number) {
601
- return script_break_points[i].actual_locations();
602
- }
603
- }
604
- for (var i = 0; i < break_points.length; i++) {
605
- if (break_points[i].number() == break_point_number) {
606
- return [break_points[i].actual_location];
607
- }
608
- }
609
- return [];
610
- }
611
-
612
- Debug.setBreakPoint = function(func, opt_line, opt_column, opt_condition) {
613
- if (!IS_FUNCTION(func)) throw new Error('Parameters have wrong types.');
614
- // Break points in API functions are not supported.
615
- if (%FunctionIsAPIFunction(func)) {
616
- throw new Error('Cannot set break point in native code.');
617
- }
618
- // Find source position relative to start of the function
619
- var break_position =
620
- this.findFunctionSourceLocation(func, opt_line, opt_column).position;
621
- var source_position = break_position - this.sourcePosition(func);
622
- // Find the script for the function.
623
- var script = %FunctionGetScript(func);
624
- // Break in builtin JavaScript code is not supported.
625
- if (script.type == Debug.ScriptType.Native) {
626
- throw new Error('Cannot set break point in native code.');
627
- }
628
- // If the script for the function has a name convert this to a script break
629
- // point.
630
- if (script && script.id) {
631
- // Adjust the source position to be script relative.
632
- source_position += %FunctionGetScriptSourcePosition(func);
633
- // Find line and column for the position in the script and set a script
634
- // break point from that.
635
- var location = script.locationFromPosition(source_position, false);
636
- return this.setScriptBreakPointById(script.id,
637
- location.line, location.column,
638
- opt_condition);
639
- } else {
640
- // Set a break point directly on the function.
641
- var break_point = MakeBreakPoint(source_position);
642
- var actual_position =
643
- %SetFunctionBreakPoint(func, source_position, break_point);
644
- actual_position += this.sourcePosition(func);
645
- var actual_location = script.locationFromPosition(actual_position, true);
646
- break_point.actual_location = { line: actual_location.line,
647
- column: actual_location.column };
648
- break_point.setCondition(opt_condition);
649
- return break_point.number();
650
- }
651
- };
652
-
653
-
654
- Debug.setBreakPointByScriptIdAndPosition = function(script_id, position,
655
- condition, enabled)
656
- {
657
- break_point = MakeBreakPoint(position);
658
- break_point.setCondition(condition);
659
- if (!enabled)
660
- break_point.disable();
661
- var scripts = this.scripts();
662
- for (var i = 0; i < scripts.length; i++) {
663
- if (script_id == scripts[i].id) {
664
- break_point.actual_position = %SetScriptBreakPoint(scripts[i], position,
665
- break_point);
666
- break;
667
- }
668
- }
669
- return break_point;
670
- };
671
-
672
-
673
- Debug.enableBreakPoint = function(break_point_number) {
674
- var break_point = this.findBreakPoint(break_point_number, false);
675
- // Only enable if the breakpoint hasn't been deleted:
676
- if (break_point) {
677
- break_point.enable();
678
- }
679
- };
680
-
681
-
682
- Debug.disableBreakPoint = function(break_point_number) {
683
- var break_point = this.findBreakPoint(break_point_number, false);
684
- // Only enable if the breakpoint hasn't been deleted:
685
- if (break_point) {
686
- break_point.disable();
687
- }
688
- };
689
-
690
-
691
- Debug.changeBreakPointCondition = function(break_point_number, condition) {
692
- var break_point = this.findBreakPoint(break_point_number, false);
693
- break_point.setCondition(condition);
694
- };
695
-
696
-
697
- Debug.changeBreakPointIgnoreCount = function(break_point_number, ignoreCount) {
698
- if (ignoreCount < 0) {
699
- throw new Error('Invalid argument');
700
- }
701
- var break_point = this.findBreakPoint(break_point_number, false);
702
- break_point.setIgnoreCount(ignoreCount);
703
- };
704
-
705
-
706
- Debug.clearBreakPoint = function(break_point_number) {
707
- var break_point = this.findBreakPoint(break_point_number, true);
708
- if (break_point) {
709
- return %ClearBreakPoint(break_point);
710
- } else {
711
- break_point = this.findScriptBreakPoint(break_point_number, true);
712
- if (!break_point) {
713
- throw new Error('Invalid breakpoint');
714
- }
715
- }
716
- };
717
-
718
-
719
- Debug.clearAllBreakPoints = function() {
720
- for (var i = 0; i < break_points.length; i++) {
721
- break_point = break_points[i];
722
- %ClearBreakPoint(break_point);
723
- }
724
- break_points = [];
725
- };
726
-
727
-
728
- Debug.disableAllBreakPoints = function() {
729
- // Disable all user defined breakpoints:
730
- for (var i = 1; i < next_break_point_number; i++) {
731
- Debug.disableBreakPoint(i);
732
- }
733
- // Disable all exception breakpoints:
734
- %ChangeBreakOnException(Debug.ExceptionBreak.Caught, false);
735
- %ChangeBreakOnException(Debug.ExceptionBreak.Uncaught, false);
736
- };
737
-
738
-
739
- Debug.findScriptBreakPoint = function(break_point_number, remove) {
740
- var script_break_point;
741
- for (var i = 0; i < script_break_points.length; i++) {
742
- if (script_break_points[i].number() == break_point_number) {
743
- script_break_point = script_break_points[i];
744
- // Remove the break point from the list if requested.
745
- if (remove) {
746
- script_break_point.clear();
747
- script_break_points.splice(i,1);
748
- }
749
- break;
750
- }
751
- }
752
- return script_break_point;
753
- }
754
-
755
-
756
- // Sets a breakpoint in a script identified through id or name at the
757
- // specified source line and column within that line.
758
- Debug.setScriptBreakPoint = function(type, script_id_or_name,
759
- opt_line, opt_column, opt_condition,
760
- opt_groupId) {
761
- // Create script break point object.
762
- var script_break_point =
763
- new ScriptBreakPoint(type, script_id_or_name, opt_line, opt_column,
764
- opt_groupId);
765
-
766
- // Assign number to the new script break point and add it.
767
- script_break_point.number_ = next_break_point_number++;
768
- script_break_point.setCondition(opt_condition);
769
- script_break_points.push(script_break_point);
770
-
771
- // Run through all scripts to see if this script break point matches any
772
- // loaded scripts.
773
- var scripts = this.scripts();
774
- for (var i = 0; i < scripts.length; i++) {
775
- if (script_break_point.matchesScript(scripts[i])) {
776
- script_break_point.set(scripts[i]);
777
- }
778
- }
779
-
780
- return script_break_point.number();
781
- }
782
-
783
-
784
- Debug.setScriptBreakPointById = function(script_id,
785
- opt_line, opt_column,
786
- opt_condition, opt_groupId) {
787
- return this.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId,
788
- script_id, opt_line, opt_column,
789
- opt_condition, opt_groupId);
790
- }
791
-
792
-
793
- Debug.setScriptBreakPointByName = function(script_name,
794
- opt_line, opt_column,
795
- opt_condition, opt_groupId) {
796
- return this.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptName,
797
- script_name, opt_line, opt_column,
798
- opt_condition, opt_groupId);
799
- }
800
-
801
-
802
- Debug.enableScriptBreakPoint = function(break_point_number) {
803
- var script_break_point = this.findScriptBreakPoint(break_point_number, false);
804
- script_break_point.enable();
805
- };
806
-
807
-
808
- Debug.disableScriptBreakPoint = function(break_point_number) {
809
- var script_break_point = this.findScriptBreakPoint(break_point_number, false);
810
- script_break_point.disable();
811
- };
812
-
813
-
814
- Debug.changeScriptBreakPointCondition = function(break_point_number, condition) {
815
- var script_break_point = this.findScriptBreakPoint(break_point_number, false);
816
- script_break_point.setCondition(condition);
817
- };
818
-
819
-
820
- Debug.changeScriptBreakPointIgnoreCount = function(break_point_number, ignoreCount) {
821
- if (ignoreCount < 0) {
822
- throw new Error('Invalid argument');
823
- }
824
- var script_break_point = this.findScriptBreakPoint(break_point_number, false);
825
- script_break_point.setIgnoreCount(ignoreCount);
826
- };
827
-
828
-
829
- Debug.scriptBreakPoints = function() {
830
- return script_break_points;
831
- }
832
-
833
-
834
- Debug.clearStepping = function() {
835
- %ClearStepping();
836
- }
837
-
838
- Debug.setBreakOnException = function() {
839
- return %ChangeBreakOnException(Debug.ExceptionBreak.Caught, true);
840
- };
841
-
842
- Debug.clearBreakOnException = function() {
843
- return %ChangeBreakOnException(Debug.ExceptionBreak.Caught, false);
844
- };
845
-
846
- Debug.isBreakOnException = function() {
847
- return !!%IsBreakOnException(Debug.ExceptionBreak.Caught);
848
- };
849
-
850
- Debug.setBreakOnUncaughtException = function() {
851
- return %ChangeBreakOnException(Debug.ExceptionBreak.Uncaught, true);
852
- };
853
-
854
- Debug.clearBreakOnUncaughtException = function() {
855
- return %ChangeBreakOnException(Debug.ExceptionBreak.Uncaught, false);
856
- };
857
-
858
- Debug.isBreakOnUncaughtException = function() {
859
- return !!%IsBreakOnException(Debug.ExceptionBreak.Uncaught);
860
- };
861
-
862
- Debug.showBreakPoints = function(f, full) {
863
- if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.');
864
- var source = full ? this.scriptSource(f) : this.source(f);
865
- var offset = full ? this.sourcePosition(f) : 0;
866
- var locations = this.breakLocations(f);
867
- if (!locations) return source;
868
- locations.sort(function(x, y) { return x - y; });
869
- var result = "";
870
- var prev_pos = 0;
871
- var pos;
872
- for (var i = 0; i < locations.length; i++) {
873
- pos = locations[i] - offset;
874
- result += source.slice(prev_pos, pos);
875
- result += "[B" + i + "]";
876
- prev_pos = pos;
877
- }
878
- pos = source.length;
879
- result += source.substring(prev_pos, pos);
880
- return result;
881
- };
882
-
883
-
884
- // Get all the scripts currently loaded. Locating all the scripts is based on
885
- // scanning the heap.
886
- Debug.scripts = function() {
887
- // Collect all scripts in the heap.
888
- return %DebugGetLoadedScripts();
889
- };
890
-
891
-
892
- Debug.debuggerFlags = function() {
893
- return debugger_flags;
894
- };
895
-
896
- Debug.MakeMirror = MakeMirror;
897
-
898
- function MakeExecutionState(break_id) {
899
- return new ExecutionState(break_id);
900
- }
901
-
902
- function ExecutionState(break_id) {
903
- this.break_id = break_id;
904
- this.selected_frame = 0;
905
- }
906
-
907
- ExecutionState.prototype.prepareStep = function(opt_action, opt_count) {
908
- var action = Debug.StepAction.StepIn;
909
- if (!IS_UNDEFINED(opt_action)) action = %ToNumber(opt_action);
910
- var count = opt_count ? %ToNumber(opt_count) : 1;
911
-
912
- return %PrepareStep(this.break_id, action, count);
913
- }
914
-
915
- ExecutionState.prototype.evaluateGlobal = function(source, disable_break,
916
- opt_additional_context) {
917
- return MakeMirror(%DebugEvaluateGlobal(this.break_id, source,
918
- Boolean(disable_break),
919
- opt_additional_context));
920
- };
921
-
922
- ExecutionState.prototype.frameCount = function() {
923
- return %GetFrameCount(this.break_id);
924
- };
925
-
926
- ExecutionState.prototype.threadCount = function() {
927
- return %GetThreadCount(this.break_id);
928
- };
929
-
930
- ExecutionState.prototype.frame = function(opt_index) {
931
- // If no index supplied return the selected frame.
932
- if (opt_index == null) opt_index = this.selected_frame;
933
- if (opt_index < 0 || opt_index >= this.frameCount())
934
- throw new Error('Illegal frame index.');
935
- return new FrameMirror(this.break_id, opt_index);
936
- };
937
-
938
- ExecutionState.prototype.setSelectedFrame = function(index) {
939
- var i = %ToNumber(index);
940
- if (i < 0 || i >= this.frameCount()) throw new Error('Illegal frame index.');
941
- this.selected_frame = i;
942
- };
943
-
944
- ExecutionState.prototype.selectedFrame = function() {
945
- return this.selected_frame;
946
- };
947
-
948
- ExecutionState.prototype.debugCommandProcessor = function(opt_is_running) {
949
- return new DebugCommandProcessor(this, opt_is_running);
950
- };
951
-
952
-
953
- function MakeBreakEvent(exec_state, break_points_hit) {
954
- return new BreakEvent(exec_state, break_points_hit);
955
- }
956
-
957
-
958
- function BreakEvent(exec_state, break_points_hit) {
959
- this.exec_state_ = exec_state;
960
- this.break_points_hit_ = break_points_hit;
961
- }
962
-
963
-
964
- BreakEvent.prototype.executionState = function() {
965
- return this.exec_state_;
966
- };
967
-
968
-
969
- BreakEvent.prototype.eventType = function() {
970
- return Debug.DebugEvent.Break;
971
- };
972
-
973
-
974
- BreakEvent.prototype.func = function() {
975
- return this.exec_state_.frame(0).func();
976
- };
977
-
978
-
979
- BreakEvent.prototype.sourceLine = function() {
980
- return this.exec_state_.frame(0).sourceLine();
981
- };
982
-
983
-
984
- BreakEvent.prototype.sourceColumn = function() {
985
- return this.exec_state_.frame(0).sourceColumn();
986
- };
987
-
988
-
989
- BreakEvent.prototype.sourceLineText = function() {
990
- return this.exec_state_.frame(0).sourceLineText();
991
- };
992
-
993
-
994
- BreakEvent.prototype.breakPointsHit = function() {
995
- return this.break_points_hit_;
996
- };
997
-
998
-
999
- BreakEvent.prototype.toJSONProtocol = function() {
1000
- var o = { seq: next_response_seq++,
1001
- type: "event",
1002
- event: "break",
1003
- body: { invocationText: this.exec_state_.frame(0).invocationText(),
1004
- }
1005
- };
1006
-
1007
- // Add script related information to the event if available.
1008
- var script = this.func().script();
1009
- if (script) {
1010
- o.body.sourceLine = this.sourceLine(),
1011
- o.body.sourceColumn = this.sourceColumn(),
1012
- o.body.sourceLineText = this.sourceLineText(),
1013
- o.body.script = MakeScriptObject_(script, false);
1014
- }
1015
-
1016
- // Add an Array of break points hit if any.
1017
- if (this.breakPointsHit()) {
1018
- o.body.breakpoints = [];
1019
- for (var i = 0; i < this.breakPointsHit().length; i++) {
1020
- // Find the break point number. For break points originating from a
1021
- // script break point supply the script break point number.
1022
- var breakpoint = this.breakPointsHit()[i];
1023
- var script_break_point = breakpoint.script_break_point();
1024
- var number;
1025
- if (script_break_point) {
1026
- number = script_break_point.number();
1027
- } else {
1028
- number = breakpoint.number();
1029
- }
1030
- o.body.breakpoints.push(number);
1031
- }
1032
- }
1033
- return JSON.stringify(ObjectToProtocolObject_(o));
1034
- };
1035
-
1036
-
1037
- function MakeExceptionEvent(exec_state, exception, uncaught) {
1038
- return new ExceptionEvent(exec_state, exception, uncaught);
1039
- }
1040
-
1041
-
1042
- function ExceptionEvent(exec_state, exception, uncaught) {
1043
- this.exec_state_ = exec_state;
1044
- this.exception_ = exception;
1045
- this.uncaught_ = uncaught;
1046
- }
1047
-
1048
-
1049
- ExceptionEvent.prototype.executionState = function() {
1050
- return this.exec_state_;
1051
- };
1052
-
1053
-
1054
- ExceptionEvent.prototype.eventType = function() {
1055
- return Debug.DebugEvent.Exception;
1056
- };
1057
-
1058
-
1059
- ExceptionEvent.prototype.exception = function() {
1060
- return this.exception_;
1061
- }
1062
-
1063
-
1064
- ExceptionEvent.prototype.uncaught = function() {
1065
- return this.uncaught_;
1066
- }
1067
-
1068
-
1069
- ExceptionEvent.prototype.func = function() {
1070
- return this.exec_state_.frame(0).func();
1071
- };
1072
-
1073
-
1074
- ExceptionEvent.prototype.sourceLine = function() {
1075
- return this.exec_state_.frame(0).sourceLine();
1076
- };
1077
-
1078
-
1079
- ExceptionEvent.prototype.sourceColumn = function() {
1080
- return this.exec_state_.frame(0).sourceColumn();
1081
- };
1082
-
1083
-
1084
- ExceptionEvent.prototype.sourceLineText = function() {
1085
- return this.exec_state_.frame(0).sourceLineText();
1086
- };
1087
-
1088
-
1089
- ExceptionEvent.prototype.toJSONProtocol = function() {
1090
- var o = new ProtocolMessage();
1091
- o.event = "exception";
1092
- o.body = { uncaught: this.uncaught_,
1093
- exception: MakeMirror(this.exception_)
1094
- };
1095
-
1096
- // Exceptions might happen whithout any JavaScript frames.
1097
- if (this.exec_state_.frameCount() > 0) {
1098
- o.body.sourceLine = this.sourceLine();
1099
- o.body.sourceColumn = this.sourceColumn();
1100
- o.body.sourceLineText = this.sourceLineText();
1101
-
1102
- // Add script information to the event if available.
1103
- var script = this.func().script();
1104
- if (script) {
1105
- o.body.script = MakeScriptObject_(script, false);
1106
- }
1107
- } else {
1108
- o.body.sourceLine = -1;
1109
- }
1110
-
1111
- return o.toJSONProtocol();
1112
- };
1113
-
1114
-
1115
- function MakeCompileEvent(exec_state, script, before) {
1116
- return new CompileEvent(exec_state, script, before);
1117
- }
1118
-
1119
-
1120
- function CompileEvent(exec_state, script, before) {
1121
- this.exec_state_ = exec_state;
1122
- this.script_ = MakeMirror(script);
1123
- this.before_ = before;
1124
- }
1125
-
1126
-
1127
- CompileEvent.prototype.executionState = function() {
1128
- return this.exec_state_;
1129
- };
1130
-
1131
-
1132
- CompileEvent.prototype.eventType = function() {
1133
- if (this.before_) {
1134
- return Debug.DebugEvent.BeforeCompile;
1135
- } else {
1136
- return Debug.DebugEvent.AfterCompile;
1137
- }
1138
- };
1139
-
1140
-
1141
- CompileEvent.prototype.script = function() {
1142
- return this.script_;
1143
- };
1144
-
1145
-
1146
- CompileEvent.prototype.toJSONProtocol = function() {
1147
- var o = new ProtocolMessage();
1148
- o.running = true;
1149
- if (this.before_) {
1150
- o.event = "beforeCompile";
1151
- } else {
1152
- o.event = "afterCompile";
1153
- }
1154
- o.body = {};
1155
- o.body.script = this.script_;
1156
-
1157
- return o.toJSONProtocol();
1158
- }
1159
-
1160
-
1161
- function MakeNewFunctionEvent(func) {
1162
- return new NewFunctionEvent(func);
1163
- }
1164
-
1165
-
1166
- function NewFunctionEvent(func) {
1167
- this.func = func;
1168
- }
1169
-
1170
-
1171
- NewFunctionEvent.prototype.eventType = function() {
1172
- return Debug.DebugEvent.NewFunction;
1173
- };
1174
-
1175
-
1176
- NewFunctionEvent.prototype.name = function() {
1177
- return this.func.name;
1178
- };
1179
-
1180
-
1181
- NewFunctionEvent.prototype.setBreakPoint = function(p) {
1182
- Debug.setBreakPoint(this.func, p || 0);
1183
- };
1184
-
1185
-
1186
- function MakeScriptCollectedEvent(exec_state, id) {
1187
- return new ScriptCollectedEvent(exec_state, id);
1188
- }
1189
-
1190
-
1191
- function ScriptCollectedEvent(exec_state, id) {
1192
- this.exec_state_ = exec_state;
1193
- this.id_ = id;
1194
- }
1195
-
1196
-
1197
- ScriptCollectedEvent.prototype.id = function() {
1198
- return this.id_;
1199
- };
1200
-
1201
-
1202
- ScriptCollectedEvent.prototype.executionState = function() {
1203
- return this.exec_state_;
1204
- };
1205
-
1206
-
1207
- ScriptCollectedEvent.prototype.toJSONProtocol = function() {
1208
- var o = new ProtocolMessage();
1209
- o.running = true;
1210
- o.event = "scriptCollected";
1211
- o.body = {};
1212
- o.body.script = { id: this.id() };
1213
- return o.toJSONProtocol();
1214
- }
1215
-
1216
-
1217
- function MakeScriptObject_(script, include_source) {
1218
- var o = { id: script.id(),
1219
- name: script.name(),
1220
- lineOffset: script.lineOffset(),
1221
- columnOffset: script.columnOffset(),
1222
- lineCount: script.lineCount(),
1223
- };
1224
- if (!IS_UNDEFINED(script.data())) {
1225
- o.data = script.data();
1226
- }
1227
- if (include_source) {
1228
- o.source = script.source();
1229
- }
1230
- return o;
1231
- };
1232
-
1233
-
1234
- function DebugCommandProcessor(exec_state, opt_is_running) {
1235
- this.exec_state_ = exec_state;
1236
- this.running_ = opt_is_running || false;
1237
- };
1238
-
1239
-
1240
- DebugCommandProcessor.prototype.processDebugRequest = function (request) {
1241
- return this.processDebugJSONRequest(request);
1242
- }
1243
-
1244
-
1245
- function ProtocolMessage(request) {
1246
- // Update sequence number.
1247
- this.seq = next_response_seq++;
1248
-
1249
- if (request) {
1250
- // If message is based on a request this is a response. Fill the initial
1251
- // response from the request.
1252
- this.type = 'response';
1253
- this.request_seq = request.seq;
1254
- this.command = request.command;
1255
- } else {
1256
- // If message is not based on a request it is a dabugger generated event.
1257
- this.type = 'event';
1258
- }
1259
- this.success = true;
1260
- // Handler may set this field to control debugger state.
1261
- this.running = undefined;
1262
- }
1263
-
1264
-
1265
- ProtocolMessage.prototype.setOption = function(name, value) {
1266
- if (!this.options_) {
1267
- this.options_ = {};
1268
- }
1269
- this.options_[name] = value;
1270
- }
1271
-
1272
-
1273
- ProtocolMessage.prototype.failed = function(message) {
1274
- this.success = false;
1275
- this.message = message;
1276
- }
1277
-
1278
-
1279
- ProtocolMessage.prototype.toJSONProtocol = function() {
1280
- // Encode the protocol header.
1281
- var json = {};
1282
- json.seq= this.seq;
1283
- if (this.request_seq) {
1284
- json.request_seq = this.request_seq;
1285
- }
1286
- json.type = this.type;
1287
- if (this.event) {
1288
- json.event = this.event;
1289
- }
1290
- if (this.command) {
1291
- json.command = this.command;
1292
- }
1293
- if (this.success) {
1294
- json.success = this.success;
1295
- } else {
1296
- json.success = false;
1297
- }
1298
- if (this.body) {
1299
- // Encode the body part.
1300
- var bodyJson;
1301
- var serializer = MakeMirrorSerializer(true, this.options_);
1302
- if (this.body instanceof Mirror) {
1303
- bodyJson = serializer.serializeValue(this.body);
1304
- } else if (this.body instanceof Array) {
1305
- bodyJson = [];
1306
- for (var i = 0; i < this.body.length; i++) {
1307
- if (this.body[i] instanceof Mirror) {
1308
- bodyJson.push(serializer.serializeValue(this.body[i]));
1309
- } else {
1310
- bodyJson.push(ObjectToProtocolObject_(this.body[i], serializer));
1311
- }
1312
- }
1313
- } else {
1314
- bodyJson = ObjectToProtocolObject_(this.body, serializer);
1315
- }
1316
- json.body = bodyJson;
1317
- json.refs = serializer.serializeReferencedObjects();
1318
- }
1319
- if (this.message) {
1320
- json.message = this.message;
1321
- }
1322
- json.running = this.running;
1323
- return JSON.stringify(json);
1324
- }
1325
-
1326
-
1327
- DebugCommandProcessor.prototype.createResponse = function(request) {
1328
- return new ProtocolMessage(request);
1329
- };
1330
-
1331
-
1332
- DebugCommandProcessor.prototype.processDebugJSONRequest = function(json_request) {
1333
- var request; // Current request.
1334
- var response; // Generated response.
1335
- try {
1336
- try {
1337
- // Convert the JSON string to an object.
1338
- request = %CompileString('(' + json_request + ')')();
1339
-
1340
- // Create an initial response.
1341
- response = this.createResponse(request);
1342
-
1343
- if (!request.type) {
1344
- throw new Error('Type not specified');
1345
- }
1346
-
1347
- if (request.type != 'request') {
1348
- throw new Error("Illegal type '" + request.type + "' in request");
1349
- }
1350
-
1351
- if (!request.command) {
1352
- throw new Error('Command not specified');
1353
- }
1354
-
1355
- if (request.arguments) {
1356
- var args = request.arguments;
1357
- // TODO(yurys): remove request.arguments.compactFormat check once
1358
- // ChromeDevTools are switched to 'inlineRefs'
1359
- if (args.inlineRefs || args.compactFormat) {
1360
- response.setOption('inlineRefs', true);
1361
- }
1362
- if (!IS_UNDEFINED(args.maxStringLength)) {
1363
- response.setOption('maxStringLength', args.maxStringLength);
1364
- }
1365
- }
1366
-
1367
- if (request.command == 'continue') {
1368
- this.continueRequest_(request, response);
1369
- } else if (request.command == 'break') {
1370
- this.breakRequest_(request, response);
1371
- } else if (request.command == 'setbreakpoint') {
1372
- this.setBreakPointRequest_(request, response);
1373
- } else if (request.command == 'changebreakpoint') {
1374
- this.changeBreakPointRequest_(request, response);
1375
- } else if (request.command == 'clearbreakpoint') {
1376
- this.clearBreakPointRequest_(request, response);
1377
- } else if (request.command == 'clearbreakpointgroup') {
1378
- this.clearBreakPointGroupRequest_(request, response);
1379
- } else if (request.command == 'disconnect') {
1380
- this.disconnectRequest_(request, response);
1381
- } else if (request.command == 'setexceptionbreak') {
1382
- this.setExceptionBreakRequest_(request, response);
1383
- } else if (request.command == 'listbreakpoints') {
1384
- this.listBreakpointsRequest_(request, response);
1385
- } else if (request.command == 'backtrace') {
1386
- this.backtraceRequest_(request, response);
1387
- } else if (request.command == 'frame') {
1388
- this.frameRequest_(request, response);
1389
- } else if (request.command == 'scopes') {
1390
- this.scopesRequest_(request, response);
1391
- } else if (request.command == 'scope') {
1392
- this.scopeRequest_(request, response);
1393
- } else if (request.command == 'evaluate') {
1394
- this.evaluateRequest_(request, response);
1395
- } else if (lol_is_enabled && request.command == 'getobj') {
1396
- this.getobjRequest_(request, response);
1397
- } else if (request.command == 'lookup') {
1398
- this.lookupRequest_(request, response);
1399
- } else if (request.command == 'references') {
1400
- this.referencesRequest_(request, response);
1401
- } else if (request.command == 'source') {
1402
- this.sourceRequest_(request, response);
1403
- } else if (request.command == 'scripts') {
1404
- this.scriptsRequest_(request, response);
1405
- } else if (request.command == 'threads') {
1406
- this.threadsRequest_(request, response);
1407
- } else if (request.command == 'suspend') {
1408
- this.suspendRequest_(request, response);
1409
- } else if (request.command == 'version') {
1410
- this.versionRequest_(request, response);
1411
- } else if (request.command == 'profile') {
1412
- this.profileRequest_(request, response);
1413
- } else if (request.command == 'changelive') {
1414
- this.changeLiveRequest_(request, response);
1415
- } else if (request.command == 'flags') {
1416
- this.debuggerFlagsRequest_(request, response);
1417
- } else if (request.command == 'v8flags') {
1418
- this.v8FlagsRequest_(request, response);
1419
-
1420
- // GC tools:
1421
- } else if (request.command == 'gc') {
1422
- this.gcRequest_(request, response);
1423
-
1424
- // LiveObjectList tools:
1425
- } else if (lol_is_enabled && request.command == 'lol-capture') {
1426
- this.lolCaptureRequest_(request, response);
1427
- } else if (lol_is_enabled && request.command == 'lol-delete') {
1428
- this.lolDeleteRequest_(request, response);
1429
- } else if (lol_is_enabled && request.command == 'lol-diff') {
1430
- this.lolDiffRequest_(request, response);
1431
- } else if (lol_is_enabled && request.command == 'lol-getid') {
1432
- this.lolGetIdRequest_(request, response);
1433
- } else if (lol_is_enabled && request.command == 'lol-info') {
1434
- this.lolInfoRequest_(request, response);
1435
- } else if (lol_is_enabled && request.command == 'lol-reset') {
1436
- this.lolResetRequest_(request, response);
1437
- } else if (lol_is_enabled && request.command == 'lol-retainers') {
1438
- this.lolRetainersRequest_(request, response);
1439
- } else if (lol_is_enabled && request.command == 'lol-path') {
1440
- this.lolPathRequest_(request, response);
1441
- } else if (lol_is_enabled && request.command == 'lol-print') {
1442
- this.lolPrintRequest_(request, response);
1443
- } else if (lol_is_enabled && request.command == 'lol-stats') {
1444
- this.lolStatsRequest_(request, response);
1445
-
1446
- } else {
1447
- throw new Error('Unknown command "' + request.command + '" in request');
1448
- }
1449
- } catch (e) {
1450
- // If there is no response object created one (without command).
1451
- if (!response) {
1452
- response = this.createResponse();
1453
- }
1454
- response.success = false;
1455
- response.message = %ToString(e);
1456
- }
1457
-
1458
- // Return the response as a JSON encoded string.
1459
- try {
1460
- if (!IS_UNDEFINED(response.running)) {
1461
- // Response controls running state.
1462
- this.running_ = response.running;
1463
- }
1464
- response.running = this.running_;
1465
- return response.toJSONProtocol();
1466
- } catch (e) {
1467
- // Failed to generate response - return generic error.
1468
- return '{"seq":' + response.seq + ',' +
1469
- '"request_seq":' + request.seq + ',' +
1470
- '"type":"response",' +
1471
- '"success":false,' +
1472
- '"message":"Internal error: ' + %ToString(e) + '"}';
1473
- }
1474
- } catch (e) {
1475
- // Failed in one of the catch blocks above - most generic error.
1476
- return '{"seq":0,"type":"response","success":false,"message":"Internal error"}';
1477
- }
1478
- };
1479
-
1480
-
1481
- DebugCommandProcessor.prototype.continueRequest_ = function(request, response) {
1482
- // Check for arguments for continue.
1483
- if (request.arguments) {
1484
- var count = 1;
1485
- var action = Debug.StepAction.StepIn;
1486
-
1487
- // Pull out arguments.
1488
- var stepaction = request.arguments.stepaction;
1489
- var stepcount = request.arguments.stepcount;
1490
-
1491
- // Get the stepcount argument if any.
1492
- if (stepcount) {
1493
- count = %ToNumber(stepcount);
1494
- if (count < 0) {
1495
- throw new Error('Invalid stepcount argument "' + stepcount + '".');
1496
- }
1497
- }
1498
-
1499
- // Get the stepaction argument.
1500
- if (stepaction) {
1501
- if (stepaction == 'in') {
1502
- action = Debug.StepAction.StepIn;
1503
- } else if (stepaction == 'min') {
1504
- action = Debug.StepAction.StepMin;
1505
- } else if (stepaction == 'next') {
1506
- action = Debug.StepAction.StepNext;
1507
- } else if (stepaction == 'out') {
1508
- action = Debug.StepAction.StepOut;
1509
- } else {
1510
- throw new Error('Invalid stepaction argument "' + stepaction + '".');
1511
- }
1512
- }
1513
-
1514
- // Setup the VM for stepping.
1515
- this.exec_state_.prepareStep(action, count);
1516
- }
1517
-
1518
- // VM should be running after executing this request.
1519
- response.running = true;
1520
- };
1521
-
1522
-
1523
- DebugCommandProcessor.prototype.breakRequest_ = function(request, response) {
1524
- // Ignore as break command does not do anything when broken.
1525
- };
1526
-
1527
-
1528
- DebugCommandProcessor.prototype.setBreakPointRequest_ =
1529
- function(request, response) {
1530
- // Check for legal request.
1531
- if (!request.arguments) {
1532
- response.failed('Missing arguments');
1533
- return;
1534
- }
1535
-
1536
- // Pull out arguments.
1537
- var type = request.arguments.type;
1538
- var target = request.arguments.target;
1539
- var line = request.arguments.line;
1540
- var column = request.arguments.column;
1541
- var enabled = IS_UNDEFINED(request.arguments.enabled) ?
1542
- true : request.arguments.enabled;
1543
- var condition = request.arguments.condition;
1544
- var ignoreCount = request.arguments.ignoreCount;
1545
- var groupId = request.arguments.groupId;
1546
-
1547
- // Check for legal arguments.
1548
- if (!type || IS_UNDEFINED(target)) {
1549
- response.failed('Missing argument "type" or "target"');
1550
- return;
1551
- }
1552
- if (type != 'function' && type != 'handle' &&
1553
- type != 'script' && type != 'scriptId') {
1554
- response.failed('Illegal type "' + type + '"');
1555
- return;
1556
- }
1557
-
1558
- // Either function or script break point.
1559
- var break_point_number;
1560
- if (type == 'function') {
1561
- // Handle function break point.
1562
- if (!IS_STRING(target)) {
1563
- response.failed('Argument "target" is not a string value');
1564
- return;
1565
- }
1566
- var f;
1567
- try {
1568
- // Find the function through a global evaluate.
1569
- f = this.exec_state_.evaluateGlobal(target).value();
1570
- } catch (e) {
1571
- response.failed('Error: "' + %ToString(e) +
1572
- '" evaluating "' + target + '"');
1573
- return;
1574
- }
1575
- if (!IS_FUNCTION(f)) {
1576
- response.failed('"' + target + '" does not evaluate to a function');
1577
- return;
1578
- }
1579
-
1580
- // Set function break point.
1581
- break_point_number = Debug.setBreakPoint(f, line, column, condition);
1582
- } else if (type == 'handle') {
1583
- // Find the object pointed by the specified handle.
1584
- var handle = parseInt(target, 10);
1585
- var mirror = LookupMirror(handle);
1586
- if (!mirror) {
1587
- return response.failed('Object #' + handle + '# not found');
1588
- }
1589
- if (!mirror.isFunction()) {
1590
- return response.failed('Object #' + handle + '# is not a function');
1591
- }
1592
-
1593
- // Set function break point.
1594
- break_point_number = Debug.setBreakPoint(mirror.value(),
1595
- line, column, condition);
1596
- } else if (type == 'script') {
1597
- // set script break point.
1598
- break_point_number =
1599
- Debug.setScriptBreakPointByName(target, line, column, condition,
1600
- groupId);
1601
- } else { // type == 'scriptId.
1602
- break_point_number =
1603
- Debug.setScriptBreakPointById(target, line, column, condition, groupId);
1604
- }
1605
-
1606
- // Set additional break point properties.
1607
- var break_point = Debug.findBreakPoint(break_point_number);
1608
- if (ignoreCount) {
1609
- Debug.changeBreakPointIgnoreCount(break_point_number, ignoreCount);
1610
- }
1611
- if (!enabled) {
1612
- Debug.disableBreakPoint(break_point_number);
1613
- }
1614
-
1615
- // Add the break point number to the response.
1616
- response.body = { type: type,
1617
- breakpoint: break_point_number }
1618
-
1619
- // Add break point information to the response.
1620
- if (break_point instanceof ScriptBreakPoint) {
1621
- if (break_point.type() == Debug.ScriptBreakPointType.ScriptId) {
1622
- response.body.type = 'scriptId';
1623
- response.body.script_id = break_point.script_id();
1624
- } else {
1625
- response.body.type = 'scriptName';
1626
- response.body.script_name = break_point.script_name();
1627
- }
1628
- response.body.line = break_point.line();
1629
- response.body.column = break_point.column();
1630
- response.body.actual_locations = break_point.actual_locations();
1631
- } else {
1632
- response.body.type = 'function';
1633
- response.body.actual_locations = [break_point.actual_location];
1634
- }
1635
- };
1636
-
1637
-
1638
- DebugCommandProcessor.prototype.changeBreakPointRequest_ = function(request, response) {
1639
- // Check for legal request.
1640
- if (!request.arguments) {
1641
- response.failed('Missing arguments');
1642
- return;
1643
- }
1644
-
1645
- // Pull out arguments.
1646
- var break_point = %ToNumber(request.arguments.breakpoint);
1647
- var enabled = request.arguments.enabled;
1648
- var condition = request.arguments.condition;
1649
- var ignoreCount = request.arguments.ignoreCount;
1650
-
1651
- // Check for legal arguments.
1652
- if (!break_point) {
1653
- response.failed('Missing argument "breakpoint"');
1654
- return;
1655
- }
1656
-
1657
- // Change enabled state if supplied.
1658
- if (!IS_UNDEFINED(enabled)) {
1659
- if (enabled) {
1660
- Debug.enableBreakPoint(break_point);
1661
- } else {
1662
- Debug.disableBreakPoint(break_point);
1663
- }
1664
- }
1665
-
1666
- // Change condition if supplied
1667
- if (!IS_UNDEFINED(condition)) {
1668
- Debug.changeBreakPointCondition(break_point, condition);
1669
- }
1670
-
1671
- // Change ignore count if supplied
1672
- if (!IS_UNDEFINED(ignoreCount)) {
1673
- Debug.changeBreakPointIgnoreCount(break_point, ignoreCount);
1674
- }
1675
- }
1676
-
1677
-
1678
- DebugCommandProcessor.prototype.clearBreakPointGroupRequest_ = function(request, response) {
1679
- // Check for legal request.
1680
- if (!request.arguments) {
1681
- response.failed('Missing arguments');
1682
- return;
1683
- }
1684
-
1685
- // Pull out arguments.
1686
- var group_id = request.arguments.groupId;
1687
-
1688
- // Check for legal arguments.
1689
- if (!group_id) {
1690
- response.failed('Missing argument "groupId"');
1691
- return;
1692
- }
1693
-
1694
- var cleared_break_points = [];
1695
- var new_script_break_points = [];
1696
- for (var i = 0; i < script_break_points.length; i++) {
1697
- var next_break_point = script_break_points[i];
1698
- if (next_break_point.groupId() == group_id) {
1699
- cleared_break_points.push(next_break_point.number());
1700
- next_break_point.clear();
1701
- } else {
1702
- new_script_break_points.push(next_break_point);
1703
- }
1704
- }
1705
- script_break_points = new_script_break_points;
1706
-
1707
- // Add the cleared break point numbers to the response.
1708
- response.body = { breakpoints: cleared_break_points };
1709
- }
1710
-
1711
-
1712
- DebugCommandProcessor.prototype.clearBreakPointRequest_ = function(request, response) {
1713
- // Check for legal request.
1714
- if (!request.arguments) {
1715
- response.failed('Missing arguments');
1716
- return;
1717
- }
1718
-
1719
- // Pull out arguments.
1720
- var break_point = %ToNumber(request.arguments.breakpoint);
1721
-
1722
- // Check for legal arguments.
1723
- if (!break_point) {
1724
- response.failed('Missing argument "breakpoint"');
1725
- return;
1726
- }
1727
-
1728
- // Clear break point.
1729
- Debug.clearBreakPoint(break_point);
1730
-
1731
- // Add the cleared break point number to the response.
1732
- response.body = { breakpoint: break_point }
1733
- }
1734
-
1735
-
1736
- DebugCommandProcessor.prototype.listBreakpointsRequest_ = function(request, response) {
1737
- var array = [];
1738
- for (var i = 0; i < script_break_points.length; i++) {
1739
- var break_point = script_break_points[i];
1740
-
1741
- var description = {
1742
- number: break_point.number(),
1743
- line: break_point.line(),
1744
- column: break_point.column(),
1745
- groupId: break_point.groupId(),
1746
- hit_count: break_point.hit_count(),
1747
- active: break_point.active(),
1748
- condition: break_point.condition(),
1749
- ignoreCount: break_point.ignoreCount(),
1750
- actual_locations: break_point.actual_locations()
1751
- }
1752
-
1753
- if (break_point.type() == Debug.ScriptBreakPointType.ScriptId) {
1754
- description.type = 'scriptId';
1755
- description.script_id = break_point.script_id();
1756
- } else {
1757
- description.type = 'scriptName';
1758
- description.script_name = break_point.script_name();
1759
- }
1760
- array.push(description);
1761
- }
1762
-
1763
- response.body = {
1764
- breakpoints: array,
1765
- breakOnExceptions: Debug.isBreakOnException(),
1766
- breakOnUncaughtExceptions: Debug.isBreakOnUncaughtException()
1767
- }
1768
- }
1769
-
1770
-
1771
- DebugCommandProcessor.prototype.disconnectRequest_ =
1772
- function(request, response) {
1773
- Debug.disableAllBreakPoints();
1774
- this.continueRequest_(request, response);
1775
- }
1776
-
1777
-
1778
- DebugCommandProcessor.prototype.setExceptionBreakRequest_ =
1779
- function(request, response) {
1780
- // Check for legal request.
1781
- if (!request.arguments) {
1782
- response.failed('Missing arguments');
1783
- return;
1784
- }
1785
-
1786
- // Pull out and check the 'type' argument:
1787
- var type = request.arguments.type;
1788
- if (!type) {
1789
- response.failed('Missing argument "type"');
1790
- return;
1791
- }
1792
-
1793
- // Initialize the default value of enable:
1794
- var enabled;
1795
- if (type == 'all') {
1796
- enabled = !Debug.isBreakOnException();
1797
- } else if (type == 'uncaught') {
1798
- enabled = !Debug.isBreakOnUncaughtException();
1799
- }
1800
-
1801
- // Pull out and check the 'enabled' argument if present:
1802
- if (!IS_UNDEFINED(request.arguments.enabled)) {
1803
- enabled = request.arguments.enabled;
1804
- if ((enabled != true) && (enabled != false)) {
1805
- response.failed('Illegal value for "enabled":"' + enabled + '"');
1806
- }
1807
- }
1808
-
1809
- // Now set the exception break state:
1810
- if (type == 'all') {
1811
- %ChangeBreakOnException(Debug.ExceptionBreak.Caught, enabled);
1812
- } else if (type == 'uncaught') {
1813
- %ChangeBreakOnException(Debug.ExceptionBreak.Uncaught, enabled);
1814
- } else {
1815
- response.failed('Unknown "type":"' + type + '"');
1816
- }
1817
-
1818
- // Add the cleared break point number to the response.
1819
- response.body = { 'type': type, 'enabled': enabled };
1820
- }
1821
-
1822
-
1823
- DebugCommandProcessor.prototype.backtraceRequest_ = function(request, response) {
1824
- // Get the number of frames.
1825
- var total_frames = this.exec_state_.frameCount();
1826
-
1827
- // Create simple response if there are no frames.
1828
- if (total_frames == 0) {
1829
- response.body = {
1830
- totalFrames: total_frames
1831
- }
1832
- return;
1833
- }
1834
-
1835
- // Default frame range to include in backtrace.
1836
- var from_index = 0
1837
- var to_index = kDefaultBacktraceLength;
1838
-
1839
- // Get the range from the arguments.
1840
- if (request.arguments) {
1841
- if (request.arguments.fromFrame) {
1842
- from_index = request.arguments.fromFrame;
1843
- }
1844
- if (request.arguments.toFrame) {
1845
- to_index = request.arguments.toFrame;
1846
- }
1847
- if (request.arguments.bottom) {
1848
- var tmp_index = total_frames - from_index;
1849
- from_index = total_frames - to_index
1850
- to_index = tmp_index;
1851
- }
1852
- if (from_index < 0 || to_index < 0) {
1853
- return response.failed('Invalid frame number');
1854
- }
1855
- }
1856
-
1857
- // Adjust the index.
1858
- to_index = Math.min(total_frames, to_index);
1859
-
1860
- if (to_index <= from_index) {
1861
- var error = 'Invalid frame range';
1862
- return response.failed(error);
1863
- }
1864
-
1865
- // Create the response body.
1866
- var frames = [];
1867
- for (var i = from_index; i < to_index; i++) {
1868
- frames.push(this.exec_state_.frame(i));
1869
- }
1870
- response.body = {
1871
- fromFrame: from_index,
1872
- toFrame: to_index,
1873
- totalFrames: total_frames,
1874
- frames: frames
1875
- }
1876
- };
1877
-
1878
-
1879
- DebugCommandProcessor.prototype.frameRequest_ = function(request, response) {
1880
- // No frames no source.
1881
- if (this.exec_state_.frameCount() == 0) {
1882
- return response.failed('No frames');
1883
- }
1884
-
1885
- // With no arguments just keep the selected frame.
1886
- if (request.arguments) {
1887
- var index = request.arguments.number;
1888
- if (index < 0 || this.exec_state_.frameCount() <= index) {
1889
- return response.failed('Invalid frame number');
1890
- }
1891
-
1892
- this.exec_state_.setSelectedFrame(request.arguments.number);
1893
- }
1894
- response.body = this.exec_state_.frame();
1895
- };
1896
-
1897
-
1898
- DebugCommandProcessor.prototype.frameForScopeRequest_ = function(request) {
1899
- // Get the frame for which the scope or scopes are requested. With no frameNumber
1900
- // argument use the currently selected frame.
1901
- if (request.arguments && !IS_UNDEFINED(request.arguments.frameNumber)) {
1902
- frame_index = request.arguments.frameNumber;
1903
- if (frame_index < 0 || this.exec_state_.frameCount() <= frame_index) {
1904
- return response.failed('Invalid frame number');
1905
- }
1906
- return this.exec_state_.frame(frame_index);
1907
- } else {
1908
- return this.exec_state_.frame();
1909
- }
1910
- }
1911
-
1912
-
1913
- DebugCommandProcessor.prototype.scopesRequest_ = function(request, response) {
1914
- // No frames no scopes.
1915
- if (this.exec_state_.frameCount() == 0) {
1916
- return response.failed('No scopes');
1917
- }
1918
-
1919
- // Get the frame for which the scopes are requested.
1920
- var frame = this.frameForScopeRequest_(request);
1921
-
1922
- // Fill all scopes for this frame.
1923
- var total_scopes = frame.scopeCount();
1924
- var scopes = [];
1925
- for (var i = 0; i < total_scopes; i++) {
1926
- scopes.push(frame.scope(i));
1927
- }
1928
- response.body = {
1929
- fromScope: 0,
1930
- toScope: total_scopes,
1931
- totalScopes: total_scopes,
1932
- scopes: scopes
1933
- }
1934
- };
1935
-
1936
-
1937
- DebugCommandProcessor.prototype.scopeRequest_ = function(request, response) {
1938
- // No frames no scopes.
1939
- if (this.exec_state_.frameCount() == 0) {
1940
- return response.failed('No scopes');
1941
- }
1942
-
1943
- // Get the frame for which the scope is requested.
1944
- var frame = this.frameForScopeRequest_(request);
1945
-
1946
- // With no scope argument just return top scope.
1947
- var scope_index = 0;
1948
- if (request.arguments && !IS_UNDEFINED(request.arguments.number)) {
1949
- scope_index = %ToNumber(request.arguments.number);
1950
- if (scope_index < 0 || frame.scopeCount() <= scope_index) {
1951
- return response.failed('Invalid scope number');
1952
- }
1953
- }
1954
-
1955
- response.body = frame.scope(scope_index);
1956
- };
1957
-
1958
-
1959
- DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) {
1960
- if (!request.arguments) {
1961
- return response.failed('Missing arguments');
1962
- }
1963
-
1964
- // Pull out arguments.
1965
- var expression = request.arguments.expression;
1966
- var frame = request.arguments.frame;
1967
- var global = request.arguments.global;
1968
- var disable_break = request.arguments.disable_break;
1969
- var additional_context = request.arguments.additional_context;
1970
-
1971
- // The expression argument could be an integer so we convert it to a
1972
- // string.
1973
- try {
1974
- expression = String(expression);
1975
- } catch(e) {
1976
- return response.failed('Failed to convert expression argument to string');
1977
- }
1978
-
1979
- // Check for legal arguments.
1980
- if (!IS_UNDEFINED(frame) && global) {
1981
- return response.failed('Arguments "frame" and "global" are exclusive');
1982
- }
1983
-
1984
- var additional_context_object;
1985
- if (additional_context) {
1986
- additional_context_object = {};
1987
- for (var i = 0; i < additional_context.length; i++) {
1988
- var mapping = additional_context[i];
1989
- if (!IS_STRING(mapping.name) || !IS_NUMBER(mapping.handle)) {
1990
- return response.failed("Context element #" + i +
1991
- " must contain name:string and handle:number");
1992
- }
1993
- var context_value_mirror = LookupMirror(mapping.handle);
1994
- if (!context_value_mirror) {
1995
- return response.failed("Context object '" + mapping.name +
1996
- "' #" + mapping.handle + "# not found");
1997
- }
1998
- additional_context_object[mapping.name] = context_value_mirror.value();
1999
- }
2000
- }
2001
-
2002
- // Global evaluate.
2003
- if (global) {
2004
- // Evaluate in the global context.
2005
- response.body = this.exec_state_.evaluateGlobal(
2006
- expression, Boolean(disable_break), additional_context_object);
2007
- return;
2008
- }
2009
-
2010
- // Default value for disable_break is true.
2011
- if (IS_UNDEFINED(disable_break)) {
2012
- disable_break = true;
2013
- }
2014
-
2015
- // No frames no evaluate in frame.
2016
- if (this.exec_state_.frameCount() == 0) {
2017
- return response.failed('No frames');
2018
- }
2019
-
2020
- // Check whether a frame was specified.
2021
- if (!IS_UNDEFINED(frame)) {
2022
- var frame_number = %ToNumber(frame);
2023
- if (frame_number < 0 || frame_number >= this.exec_state_.frameCount()) {
2024
- return response.failed('Invalid frame "' + frame + '"');
2025
- }
2026
- // Evaluate in the specified frame.
2027
- response.body = this.exec_state_.frame(frame_number).evaluate(
2028
- expression, Boolean(disable_break), additional_context_object);
2029
- return;
2030
- } else {
2031
- // Evaluate in the selected frame.
2032
- response.body = this.exec_state_.frame().evaluate(
2033
- expression, Boolean(disable_break), additional_context_object);
2034
- return;
2035
- }
2036
- };
2037
-
2038
-
2039
- DebugCommandProcessor.prototype.getobjRequest_ = function(request, response) {
2040
- if (!request.arguments) {
2041
- return response.failed('Missing arguments');
2042
- }
2043
-
2044
- // Pull out arguments.
2045
- var obj_id = request.arguments.obj_id;
2046
-
2047
- // Check for legal arguments.
2048
- if (IS_UNDEFINED(obj_id)) {
2049
- return response.failed('Argument "obj_id" missing');
2050
- }
2051
-
2052
- // Dump the object.
2053
- response.body = MakeMirror(%GetLOLObj(obj_id));
2054
- };
2055
-
2056
-
2057
- DebugCommandProcessor.prototype.lookupRequest_ = function(request, response) {
2058
- if (!request.arguments) {
2059
- return response.failed('Missing arguments');
2060
- }
2061
-
2062
- // Pull out arguments.
2063
- var handles = request.arguments.handles;
2064
-
2065
- // Check for legal arguments.
2066
- if (IS_UNDEFINED(handles)) {
2067
- return response.failed('Argument "handles" missing');
2068
- }
2069
-
2070
- // Set 'includeSource' option for script lookup.
2071
- if (!IS_UNDEFINED(request.arguments.includeSource)) {
2072
- includeSource = %ToBoolean(request.arguments.includeSource);
2073
- response.setOption('includeSource', includeSource);
2074
- }
2075
-
2076
- // Lookup handles.
2077
- var mirrors = {};
2078
- for (var i = 0; i < handles.length; i++) {
2079
- var handle = handles[i];
2080
- var mirror = LookupMirror(handle);
2081
- if (!mirror) {
2082
- return response.failed('Object #' + handle + '# not found');
2083
- }
2084
- mirrors[handle] = mirror;
2085
- }
2086
- response.body = mirrors;
2087
- };
2088
-
2089
-
2090
- DebugCommandProcessor.prototype.referencesRequest_ =
2091
- function(request, response) {
2092
- if (!request.arguments) {
2093
- return response.failed('Missing arguments');
2094
- }
2095
-
2096
- // Pull out arguments.
2097
- var type = request.arguments.type;
2098
- var handle = request.arguments.handle;
2099
-
2100
- // Check for legal arguments.
2101
- if (IS_UNDEFINED(type)) {
2102
- return response.failed('Argument "type" missing');
2103
- }
2104
- if (IS_UNDEFINED(handle)) {
2105
- return response.failed('Argument "handle" missing');
2106
- }
2107
- if (type != 'referencedBy' && type != 'constructedBy') {
2108
- return response.failed('Invalid type "' + type + '"');
2109
- }
2110
-
2111
- // Lookup handle and return objects with references the object.
2112
- var mirror = LookupMirror(handle);
2113
- if (mirror) {
2114
- if (type == 'referencedBy') {
2115
- response.body = mirror.referencedBy();
2116
- } else {
2117
- response.body = mirror.constructedBy();
2118
- }
2119
- } else {
2120
- return response.failed('Object #' + handle + '# not found');
2121
- }
2122
- };
2123
-
2124
-
2125
- DebugCommandProcessor.prototype.sourceRequest_ = function(request, response) {
2126
- // No frames no source.
2127
- if (this.exec_state_.frameCount() == 0) {
2128
- return response.failed('No source');
2129
- }
2130
-
2131
- var from_line;
2132
- var to_line;
2133
- var frame = this.exec_state_.frame();
2134
- if (request.arguments) {
2135
- // Pull out arguments.
2136
- from_line = request.arguments.fromLine;
2137
- to_line = request.arguments.toLine;
2138
-
2139
- if (!IS_UNDEFINED(request.arguments.frame)) {
2140
- var frame_number = %ToNumber(request.arguments.frame);
2141
- if (frame_number < 0 || frame_number >= this.exec_state_.frameCount()) {
2142
- return response.failed('Invalid frame "' + frame + '"');
2143
- }
2144
- frame = this.exec_state_.frame(frame_number);
2145
- }
2146
- }
2147
-
2148
- // Get the script selected.
2149
- var script = frame.func().script();
2150
- if (!script) {
2151
- return response.failed('No source');
2152
- }
2153
-
2154
- // Get the source slice and fill it into the response.
2155
- var slice = script.sourceSlice(from_line, to_line);
2156
- if (!slice) {
2157
- return response.failed('Invalid line interval');
2158
- }
2159
- response.body = {};
2160
- response.body.source = slice.sourceText();
2161
- response.body.fromLine = slice.from_line;
2162
- response.body.toLine = slice.to_line;
2163
- response.body.fromPosition = slice.from_position;
2164
- response.body.toPosition = slice.to_position;
2165
- response.body.totalLines = script.lineCount();
2166
- };
2167
-
2168
-
2169
- DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) {
2170
- var types = ScriptTypeFlag(Debug.ScriptType.Normal);
2171
- var includeSource = false;
2172
- var idsToInclude = null;
2173
- if (request.arguments) {
2174
- // Pull out arguments.
2175
- if (!IS_UNDEFINED(request.arguments.types)) {
2176
- types = %ToNumber(request.arguments.types);
2177
- if (isNaN(types) || types < 0) {
2178
- return response.failed('Invalid types "' + request.arguments.types + '"');
2179
- }
2180
- }
2181
-
2182
- if (!IS_UNDEFINED(request.arguments.includeSource)) {
2183
- includeSource = %ToBoolean(request.arguments.includeSource);
2184
- response.setOption('includeSource', includeSource);
2185
- }
2186
-
2187
- if (IS_ARRAY(request.arguments.ids)) {
2188
- idsToInclude = {};
2189
- var ids = request.arguments.ids;
2190
- for (var i = 0; i < ids.length; i++) {
2191
- idsToInclude[ids[i]] = true;
2192
- }
2193
- }
2194
-
2195
- var filterStr = null;
2196
- var filterNum = null;
2197
- if (!IS_UNDEFINED(request.arguments.filter)) {
2198
- var num = %ToNumber(request.arguments.filter);
2199
- if (!isNaN(num)) {
2200
- filterNum = num;
2201
- }
2202
- filterStr = request.arguments.filter;
2203
- }
2204
- }
2205
-
2206
- // Collect all scripts in the heap.
2207
- var scripts = %DebugGetLoadedScripts();
2208
-
2209
- response.body = [];
2210
-
2211
- for (var i = 0; i < scripts.length; i++) {
2212
- if (idsToInclude && !idsToInclude[scripts[i].id]) {
2213
- continue;
2214
- }
2215
- if (filterStr || filterNum) {
2216
- var script = scripts[i];
2217
- var found = false;
2218
- if (filterNum && !found) {
2219
- if (script.id && script.id === filterNum) {
2220
- found = true;
2221
- }
2222
- }
2223
- if (filterStr && !found) {
2224
- if (script.name && script.name.indexOf(filterStr) >= 0) {
2225
- found = true;
2226
- }
2227
- }
2228
- if (!found) continue;
2229
- }
2230
- if (types & ScriptTypeFlag(scripts[i].type)) {
2231
- response.body.push(MakeMirror(scripts[i]));
2232
- }
2233
- }
2234
- };
2235
-
2236
-
2237
- DebugCommandProcessor.prototype.threadsRequest_ = function(request, response) {
2238
- // Get the number of threads.
2239
- var total_threads = this.exec_state_.threadCount();
2240
-
2241
- // Get information for all threads.
2242
- var threads = [];
2243
- for (var i = 0; i < total_threads; i++) {
2244
- var details = %GetThreadDetails(this.exec_state_.break_id, i);
2245
- var thread_info = { current: details[0],
2246
- id: details[1]
2247
- }
2248
- threads.push(thread_info);
2249
- }
2250
-
2251
- // Create the response body.
2252
- response.body = {
2253
- totalThreads: total_threads,
2254
- threads: threads
2255
- }
2256
- };
2257
-
2258
-
2259
- DebugCommandProcessor.prototype.suspendRequest_ = function(request, response) {
2260
- response.running = false;
2261
- };
2262
-
2263
-
2264
- DebugCommandProcessor.prototype.versionRequest_ = function(request, response) {
2265
- response.body = {
2266
- V8Version: %GetV8Version()
2267
- }
2268
- };
2269
-
2270
-
2271
- DebugCommandProcessor.prototype.profileRequest_ = function(request, response) {
2272
- if (!request.arguments) {
2273
- return response.failed('Missing arguments');
2274
- }
2275
- var modules = parseInt(request.arguments.modules);
2276
- if (isNaN(modules)) {
2277
- return response.failed('Modules is not an integer');
2278
- }
2279
- var tag = parseInt(request.arguments.tag);
2280
- if (isNaN(tag)) {
2281
- tag = 0;
2282
- }
2283
- if (request.arguments.command == 'resume') {
2284
- %ProfilerResume(modules, tag);
2285
- } else if (request.arguments.command == 'pause') {
2286
- %ProfilerPause(modules, tag);
2287
- } else {
2288
- return response.failed('Unknown command');
2289
- }
2290
- response.body = {};
2291
- };
2292
-
2293
-
2294
- DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response) {
2295
- if (!Debug.LiveEdit) {
2296
- return response.failed('LiveEdit feature is not supported');
2297
- }
2298
- if (!request.arguments) {
2299
- return response.failed('Missing arguments');
2300
- }
2301
- var script_id = request.arguments.script_id;
2302
- var preview_only = !!request.arguments.preview_only;
2303
-
2304
- var scripts = %DebugGetLoadedScripts();
2305
-
2306
- var the_script = null;
2307
- for (var i = 0; i < scripts.length; i++) {
2308
- if (scripts[i].id == script_id) {
2309
- the_script = scripts[i];
2310
- }
2311
- }
2312
- if (!the_script) {
2313
- response.failed('Script not found');
2314
- return;
2315
- }
2316
-
2317
- var change_log = new Array();
2318
-
2319
- if (!IS_STRING(request.arguments.new_source)) {
2320
- throw "new_source argument expected";
2321
- }
2322
-
2323
- var new_source = request.arguments.new_source;
2324
-
2325
- var result_description = Debug.LiveEdit.SetScriptSource(the_script,
2326
- new_source, preview_only, change_log);
2327
- response.body = {change_log: change_log, result: result_description};
2328
-
2329
- if (!preview_only && !this.running_ && result_description.stack_modified) {
2330
- response.body.stepin_recommended = true;
2331
- }
2332
- };
2333
-
2334
-
2335
- DebugCommandProcessor.prototype.debuggerFlagsRequest_ = function(request,
2336
- response) {
2337
- // Check for legal request.
2338
- if (!request.arguments) {
2339
- response.failed('Missing arguments');
2340
- return;
2341
- }
2342
-
2343
- // Pull out arguments.
2344
- var flags = request.arguments.flags;
2345
-
2346
- response.body = { flags: [] };
2347
- if (!IS_UNDEFINED(flags)) {
2348
- for (var i = 0; i < flags.length; i++) {
2349
- var name = flags[i].name;
2350
- var debugger_flag = debugger_flags[name];
2351
- if (!debugger_flag) {
2352
- continue;
2353
- }
2354
- if ('value' in flags[i]) {
2355
- debugger_flag.setValue(flags[i].value);
2356
- }
2357
- response.body.flags.push({ name: name, value: debugger_flag.getValue() });
2358
- }
2359
- } else {
2360
- for (var name in debugger_flags) {
2361
- var value = debugger_flags[name].getValue();
2362
- response.body.flags.push({ name: name, value: value });
2363
- }
2364
- }
2365
- }
2366
-
2367
-
2368
- DebugCommandProcessor.prototype.v8FlagsRequest_ = function(request, response) {
2369
- var flags = request.arguments.flags;
2370
- if (!flags) flags = '';
2371
- %SetFlags(flags);
2372
- };
2373
-
2374
-
2375
- DebugCommandProcessor.prototype.gcRequest_ = function(request, response) {
2376
- var type = request.arguments.type;
2377
- if (!type) type = 'all';
2378
-
2379
- var before = %GetHeapUsage();
2380
- %CollectGarbage(type);
2381
- var after = %GetHeapUsage();
2382
-
2383
- response.body = { "before": before, "after": after };
2384
- };
2385
-
2386
-
2387
- DebugCommandProcessor.prototype.lolCaptureRequest_ =
2388
- function(request, response) {
2389
- response.body = %CaptureLOL();
2390
- };
2391
-
2392
-
2393
- DebugCommandProcessor.prototype.lolDeleteRequest_ =
2394
- function(request, response) {
2395
- var id = request.arguments.id;
2396
- var result = %DeleteLOL(id);
2397
- if (result) {
2398
- response.body = { id: id };
2399
- } else {
2400
- response.failed('Failed to delete: live object list ' + id + ' not found.');
2401
- }
2402
- };
2403
-
2404
-
2405
- DebugCommandProcessor.prototype.lolDiffRequest_ = function(request, response) {
2406
- var id1 = request.arguments.id1;
2407
- var id2 = request.arguments.id2;
2408
- var verbose = request.arguments.verbose;
2409
- var filter = request.arguments.filter;
2410
- if (verbose === true) {
2411
- var start = request.arguments.start;
2412
- var count = request.arguments.count;
2413
- response.body = %DumpLOL(id1, id2, start, count, filter);
2414
- } else {
2415
- response.body = %SummarizeLOL(id1, id2, filter);
2416
- }
2417
- };
2418
-
2419
-
2420
- DebugCommandProcessor.prototype.lolGetIdRequest_ = function(request, response) {
2421
- var address = request.arguments.address;
2422
- response.body = {};
2423
- response.body.id = %GetLOLObjId(address);
2424
- };
2425
-
2426
-
2427
- DebugCommandProcessor.prototype.lolInfoRequest_ = function(request, response) {
2428
- var start = request.arguments.start;
2429
- var count = request.arguments.count;
2430
- response.body = %InfoLOL(start, count);
2431
- };
2432
-
2433
-
2434
- DebugCommandProcessor.prototype.lolResetRequest_ = function(request, response) {
2435
- %ResetLOL();
2436
- };
2437
-
2438
-
2439
- DebugCommandProcessor.prototype.lolRetainersRequest_ =
2440
- function(request, response) {
2441
- var id = request.arguments.id;
2442
- var verbose = request.arguments.verbose;
2443
- var start = request.arguments.start;
2444
- var count = request.arguments.count;
2445
- var filter = request.arguments.filter;
2446
-
2447
- response.body = %GetLOLObjRetainers(id, Mirror.prototype, verbose,
2448
- start, count, filter);
2449
- };
2450
-
2451
-
2452
- DebugCommandProcessor.prototype.lolPathRequest_ = function(request, response) {
2453
- var id1 = request.arguments.id1;
2454
- var id2 = request.arguments.id2;
2455
- response.body = {};
2456
- response.body.path = %GetLOLPath(id1, id2, Mirror.prototype);
2457
- };
2458
-
2459
-
2460
- DebugCommandProcessor.prototype.lolPrintRequest_ = function(request, response) {
2461
- var id = request.arguments.id;
2462
- response.body = {};
2463
- response.body.dump = %PrintLOLObj(id);
2464
- };
2465
-
2466
-
2467
- // Check whether the previously processed command caused the VM to become
2468
- // running.
2469
- DebugCommandProcessor.prototype.isRunning = function() {
2470
- return this.running_;
2471
- }
2472
-
2473
-
2474
- DebugCommandProcessor.prototype.systemBreak = function(cmd, args) {
2475
- return %SystemBreak();
2476
- };
2477
-
2478
-
2479
- function NumberToHex8Str(n) {
2480
- var r = "";
2481
- for (var i = 0; i < 8; ++i) {
2482
- var c = hexCharArray[n & 0x0F]; // hexCharArray is defined in uri.js
2483
- r = c + r;
2484
- n = n >>> 4;
2485
- }
2486
- return r;
2487
- };
2488
-
2489
-
2490
- /**
2491
- * Convert an Object to its debugger protocol representation. The representation
2492
- * may be serilized to a JSON object using JSON.stringify().
2493
- * This implementation simply runs through all string property names, converts
2494
- * each property value to a protocol value and adds the property to the result
2495
- * object. For type "object" the function will be called recursively. Note that
2496
- * circular structures will cause infinite recursion.
2497
- * @param {Object} object The object to format as protocol object.
2498
- * @param {MirrorSerializer} mirror_serializer The serializer to use if any
2499
- * mirror objects are encountered.
2500
- * @return {Object} Protocol object value.
2501
- */
2502
- function ObjectToProtocolObject_(object, mirror_serializer) {
2503
- var content = {};
2504
- for (var key in object) {
2505
- // Only consider string keys.
2506
- if (typeof key == 'string') {
2507
- // Format the value based on its type.
2508
- var property_value_json = ValueToProtocolValue_(object[key],
2509
- mirror_serializer);
2510
- // Add the property if relevant.
2511
- if (!IS_UNDEFINED(property_value_json)) {
2512
- content[key] = property_value_json;
2513
- }
2514
- }
2515
- }
2516
-
2517
- return content;
2518
- }
2519
-
2520
-
2521
- /**
2522
- * Convert an array to its debugger protocol representation. It will convert
2523
- * each array element to a protocol value.
2524
- * @param {Array} array The array to format as protocol array.
2525
- * @param {MirrorSerializer} mirror_serializer The serializer to use if any
2526
- * mirror objects are encountered.
2527
- * @return {Array} Protocol array value.
2528
- */
2529
- function ArrayToProtocolArray_(array, mirror_serializer) {
2530
- var json = [];
2531
- for (var i = 0; i < array.length; i++) {
2532
- json.push(ValueToProtocolValue_(array[i], mirror_serializer));
2533
- }
2534
- return json;
2535
- }
2536
-
2537
-
2538
- /**
2539
- * Convert a value to its debugger protocol representation.
2540
- * @param {*} value The value to format as protocol value.
2541
- * @param {MirrorSerializer} mirror_serializer The serializer to use if any
2542
- * mirror objects are encountered.
2543
- * @return {*} Protocol value.
2544
- */
2545
- function ValueToProtocolValue_(value, mirror_serializer) {
2546
- // Format the value based on its type.
2547
- var json;
2548
- switch (typeof value) {
2549
- case 'object':
2550
- if (value instanceof Mirror) {
2551
- json = mirror_serializer.serializeValue(value);
2552
- } else if (IS_ARRAY(value)){
2553
- json = ArrayToProtocolArray_(value, mirror_serializer);
2554
- } else {
2555
- json = ObjectToProtocolObject_(value, mirror_serializer);
2556
- }
2557
- break;
2558
-
2559
- case 'boolean':
2560
- case 'string':
2561
- case 'number':
2562
- json = value;
2563
- break
2564
-
2565
- default:
2566
- json = null;
2567
- }
2568
- return json;
2569
- }