libv8 3.3.10.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (700) hide show
  1. data/.gitignore +8 -0
  2. data/.gitmodules +3 -0
  3. data/Gemfile +4 -0
  4. data/README.md +44 -0
  5. data/Rakefile +73 -0
  6. data/ext/libv8/extconf.rb +9 -0
  7. data/lib/libv8.rb +15 -0
  8. data/lib/libv8/Makefile +38 -0
  9. data/lib/libv8/detect_cpu.rb +27 -0
  10. data/lib/libv8/fpic-on-linux-amd64.patch +13 -0
  11. data/lib/libv8/scons/CHANGES.txt +5334 -0
  12. data/lib/libv8/scons/LICENSE.txt +20 -0
  13. data/lib/libv8/scons/MANIFEST +199 -0
  14. data/lib/libv8/scons/PKG-INFO +13 -0
  15. data/lib/libv8/scons/README.txt +243 -0
  16. data/lib/libv8/scons/RELEASE.txt +98 -0
  17. data/lib/libv8/scons/engine/SCons/Action.py +1241 -0
  18. data/lib/libv8/scons/engine/SCons/Builder.py +877 -0
  19. data/lib/libv8/scons/engine/SCons/CacheDir.py +216 -0
  20. data/lib/libv8/scons/engine/SCons/Conftest.py +793 -0
  21. data/lib/libv8/scons/engine/SCons/Debug.py +220 -0
  22. data/lib/libv8/scons/engine/SCons/Defaults.py +480 -0
  23. data/lib/libv8/scons/engine/SCons/Environment.py +2318 -0
  24. data/lib/libv8/scons/engine/SCons/Errors.py +205 -0
  25. data/lib/libv8/scons/engine/SCons/Executor.py +633 -0
  26. data/lib/libv8/scons/engine/SCons/Job.py +435 -0
  27. data/lib/libv8/scons/engine/SCons/Memoize.py +244 -0
  28. data/lib/libv8/scons/engine/SCons/Node/Alias.py +152 -0
  29. data/lib/libv8/scons/engine/SCons/Node/FS.py +3142 -0
  30. data/lib/libv8/scons/engine/SCons/Node/Python.py +128 -0
  31. data/lib/libv8/scons/engine/SCons/Node/__init__.py +1328 -0
  32. data/lib/libv8/scons/engine/SCons/Options/BoolOption.py +50 -0
  33. data/lib/libv8/scons/engine/SCons/Options/EnumOption.py +50 -0
  34. data/lib/libv8/scons/engine/SCons/Options/ListOption.py +50 -0
  35. data/lib/libv8/scons/engine/SCons/Options/PackageOption.py +50 -0
  36. data/lib/libv8/scons/engine/SCons/Options/PathOption.py +76 -0
  37. data/lib/libv8/scons/engine/SCons/Options/__init__.py +67 -0
  38. data/lib/libv8/scons/engine/SCons/PathList.py +231 -0
  39. data/lib/libv8/scons/engine/SCons/Platform/__init__.py +241 -0
  40. data/lib/libv8/scons/engine/SCons/Platform/aix.py +69 -0
  41. data/lib/libv8/scons/engine/SCons/Platform/cygwin.py +55 -0
  42. data/lib/libv8/scons/engine/SCons/Platform/darwin.py +46 -0
  43. data/lib/libv8/scons/engine/SCons/Platform/hpux.py +46 -0
  44. data/lib/libv8/scons/engine/SCons/Platform/irix.py +44 -0
  45. data/lib/libv8/scons/engine/SCons/Platform/os2.py +58 -0
  46. data/lib/libv8/scons/engine/SCons/Platform/posix.py +263 -0
  47. data/lib/libv8/scons/engine/SCons/Platform/sunos.py +50 -0
  48. data/lib/libv8/scons/engine/SCons/Platform/win32.py +385 -0
  49. data/lib/libv8/scons/engine/SCons/SConf.py +1030 -0
  50. data/lib/libv8/scons/engine/SCons/SConsign.py +383 -0
  51. data/lib/libv8/scons/engine/SCons/Scanner/C.py +132 -0
  52. data/lib/libv8/scons/engine/SCons/Scanner/D.py +73 -0
  53. data/lib/libv8/scons/engine/SCons/Scanner/Dir.py +109 -0
  54. data/lib/libv8/scons/engine/SCons/Scanner/Fortran.py +316 -0
  55. data/lib/libv8/scons/engine/SCons/Scanner/IDL.py +48 -0
  56. data/lib/libv8/scons/engine/SCons/Scanner/LaTeX.py +384 -0
  57. data/lib/libv8/scons/engine/SCons/Scanner/Prog.py +101 -0
  58. data/lib/libv8/scons/engine/SCons/Scanner/RC.py +55 -0
  59. data/lib/libv8/scons/engine/SCons/Scanner/__init__.py +413 -0
  60. data/lib/libv8/scons/engine/SCons/Script/Interactive.py +384 -0
  61. data/lib/libv8/scons/engine/SCons/Script/Main.py +1334 -0
  62. data/lib/libv8/scons/engine/SCons/Script/SConsOptions.py +939 -0
  63. data/lib/libv8/scons/engine/SCons/Script/SConscript.py +640 -0
  64. data/lib/libv8/scons/engine/SCons/Script/__init__.py +412 -0
  65. data/lib/libv8/scons/engine/SCons/Sig.py +63 -0
  66. data/lib/libv8/scons/engine/SCons/Subst.py +904 -0
  67. data/lib/libv8/scons/engine/SCons/Taskmaster.py +1017 -0
  68. data/lib/libv8/scons/engine/SCons/Tool/386asm.py +61 -0
  69. data/lib/libv8/scons/engine/SCons/Tool/BitKeeper.py +67 -0
  70. data/lib/libv8/scons/engine/SCons/Tool/CVS.py +73 -0
  71. data/lib/libv8/scons/engine/SCons/Tool/FortranCommon.py +246 -0
  72. data/lib/libv8/scons/engine/SCons/Tool/JavaCommon.py +323 -0
  73. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/__init__.py +56 -0
  74. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/arch.py +61 -0
  75. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/common.py +240 -0
  76. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/netframework.py +82 -0
  77. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/sdk.py +391 -0
  78. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vc.py +456 -0
  79. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vs.py +499 -0
  80. data/lib/libv8/scons/engine/SCons/Tool/Perforce.py +103 -0
  81. data/lib/libv8/scons/engine/SCons/Tool/PharLapCommon.py +137 -0
  82. data/lib/libv8/scons/engine/SCons/Tool/RCS.py +64 -0
  83. data/lib/libv8/scons/engine/SCons/Tool/SCCS.py +64 -0
  84. data/lib/libv8/scons/engine/SCons/Tool/Subversion.py +71 -0
  85. data/lib/libv8/scons/engine/SCons/Tool/__init__.py +681 -0
  86. data/lib/libv8/scons/engine/SCons/Tool/aixc++.py +82 -0
  87. data/lib/libv8/scons/engine/SCons/Tool/aixcc.py +74 -0
  88. data/lib/libv8/scons/engine/SCons/Tool/aixf77.py +80 -0
  89. data/lib/libv8/scons/engine/SCons/Tool/aixlink.py +76 -0
  90. data/lib/libv8/scons/engine/SCons/Tool/applelink.py +71 -0
  91. data/lib/libv8/scons/engine/SCons/Tool/ar.py +63 -0
  92. data/lib/libv8/scons/engine/SCons/Tool/as.py +78 -0
  93. data/lib/libv8/scons/engine/SCons/Tool/bcc32.py +81 -0
  94. data/lib/libv8/scons/engine/SCons/Tool/c++.py +99 -0
  95. data/lib/libv8/scons/engine/SCons/Tool/cc.py +102 -0
  96. data/lib/libv8/scons/engine/SCons/Tool/cvf.py +58 -0
  97. data/lib/libv8/scons/engine/SCons/Tool/default.py +50 -0
  98. data/lib/libv8/scons/engine/SCons/Tool/dmd.py +223 -0
  99. data/lib/libv8/scons/engine/SCons/Tool/dvi.py +64 -0
  100. data/lib/libv8/scons/engine/SCons/Tool/dvipdf.py +124 -0
  101. data/lib/libv8/scons/engine/SCons/Tool/dvips.py +94 -0
  102. data/lib/libv8/scons/engine/SCons/Tool/f77.py +62 -0
  103. data/lib/libv8/scons/engine/SCons/Tool/f90.py +62 -0
  104. data/lib/libv8/scons/engine/SCons/Tool/f95.py +63 -0
  105. data/lib/libv8/scons/engine/SCons/Tool/filesystem.py +98 -0
  106. data/lib/libv8/scons/engine/SCons/Tool/fortran.py +62 -0
  107. data/lib/libv8/scons/engine/SCons/Tool/g++.py +90 -0
  108. data/lib/libv8/scons/engine/SCons/Tool/g77.py +73 -0
  109. data/lib/libv8/scons/engine/SCons/Tool/gas.py +53 -0
  110. data/lib/libv8/scons/engine/SCons/Tool/gcc.py +80 -0
  111. data/lib/libv8/scons/engine/SCons/Tool/gfortran.py +64 -0
  112. data/lib/libv8/scons/engine/SCons/Tool/gnulink.py +63 -0
  113. data/lib/libv8/scons/engine/SCons/Tool/gs.py +81 -0
  114. data/lib/libv8/scons/engine/SCons/Tool/hpc++.py +84 -0
  115. data/lib/libv8/scons/engine/SCons/Tool/hpcc.py +53 -0
  116. data/lib/libv8/scons/engine/SCons/Tool/hplink.py +77 -0
  117. data/lib/libv8/scons/engine/SCons/Tool/icc.py +59 -0
  118. data/lib/libv8/scons/engine/SCons/Tool/icl.py +52 -0
  119. data/lib/libv8/scons/engine/SCons/Tool/ifl.py +72 -0
  120. data/lib/libv8/scons/engine/SCons/Tool/ifort.py +88 -0
  121. data/lib/libv8/scons/engine/SCons/Tool/ilink.py +59 -0
  122. data/lib/libv8/scons/engine/SCons/Tool/ilink32.py +60 -0
  123. data/lib/libv8/scons/engine/SCons/Tool/install.py +229 -0
  124. data/lib/libv8/scons/engine/SCons/Tool/intelc.py +482 -0
  125. data/lib/libv8/scons/engine/SCons/Tool/ipkg.py +67 -0
  126. data/lib/libv8/scons/engine/SCons/Tool/jar.py +110 -0
  127. data/lib/libv8/scons/engine/SCons/Tool/javac.py +230 -0
  128. data/lib/libv8/scons/engine/SCons/Tool/javah.py +137 -0
  129. data/lib/libv8/scons/engine/SCons/Tool/latex.py +79 -0
  130. data/lib/libv8/scons/engine/SCons/Tool/lex.py +97 -0
  131. data/lib/libv8/scons/engine/SCons/Tool/link.py +121 -0
  132. data/lib/libv8/scons/engine/SCons/Tool/linkloc.py +112 -0
  133. data/lib/libv8/scons/engine/SCons/Tool/m4.py +63 -0
  134. data/lib/libv8/scons/engine/SCons/Tool/masm.py +77 -0
  135. data/lib/libv8/scons/engine/SCons/Tool/midl.py +88 -0
  136. data/lib/libv8/scons/engine/SCons/Tool/mingw.py +158 -0
  137. data/lib/libv8/scons/engine/SCons/Tool/mslib.py +64 -0
  138. data/lib/libv8/scons/engine/SCons/Tool/mslink.py +266 -0
  139. data/lib/libv8/scons/engine/SCons/Tool/mssdk.py +50 -0
  140. data/lib/libv8/scons/engine/SCons/Tool/msvc.py +268 -0
  141. data/lib/libv8/scons/engine/SCons/Tool/msvs.py +1388 -0
  142. data/lib/libv8/scons/engine/SCons/Tool/mwcc.py +207 -0
  143. data/lib/libv8/scons/engine/SCons/Tool/mwld.py +107 -0
  144. data/lib/libv8/scons/engine/SCons/Tool/nasm.py +72 -0
  145. data/lib/libv8/scons/engine/SCons/Tool/packaging/__init__.py +312 -0
  146. data/lib/libv8/scons/engine/SCons/Tool/packaging/ipk.py +185 -0
  147. data/lib/libv8/scons/engine/SCons/Tool/packaging/msi.py +527 -0
  148. data/lib/libv8/scons/engine/SCons/Tool/packaging/rpm.py +365 -0
  149. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_tarbz2.py +43 -0
  150. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_targz.py +43 -0
  151. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_zip.py +43 -0
  152. data/lib/libv8/scons/engine/SCons/Tool/packaging/tarbz2.py +44 -0
  153. data/lib/libv8/scons/engine/SCons/Tool/packaging/targz.py +44 -0
  154. data/lib/libv8/scons/engine/SCons/Tool/packaging/zip.py +44 -0
  155. data/lib/libv8/scons/engine/SCons/Tool/pdf.py +78 -0
  156. data/lib/libv8/scons/engine/SCons/Tool/pdflatex.py +83 -0
  157. data/lib/libv8/scons/engine/SCons/Tool/pdftex.py +108 -0
  158. data/lib/libv8/scons/engine/SCons/Tool/qt.py +336 -0
  159. data/lib/libv8/scons/engine/SCons/Tool/rmic.py +120 -0
  160. data/lib/libv8/scons/engine/SCons/Tool/rpcgen.py +70 -0
  161. data/lib/libv8/scons/engine/SCons/Tool/rpm.py +132 -0
  162. data/lib/libv8/scons/engine/SCons/Tool/sgiar.py +68 -0
  163. data/lib/libv8/scons/engine/SCons/Tool/sgic++.py +58 -0
  164. data/lib/libv8/scons/engine/SCons/Tool/sgicc.py +53 -0
  165. data/lib/libv8/scons/engine/SCons/Tool/sgilink.py +63 -0
  166. data/lib/libv8/scons/engine/SCons/Tool/sunar.py +67 -0
  167. data/lib/libv8/scons/engine/SCons/Tool/sunc++.py +142 -0
  168. data/lib/libv8/scons/engine/SCons/Tool/suncc.py +58 -0
  169. data/lib/libv8/scons/engine/SCons/Tool/sunf77.py +63 -0
  170. data/lib/libv8/scons/engine/SCons/Tool/sunf90.py +64 -0
  171. data/lib/libv8/scons/engine/SCons/Tool/sunf95.py +64 -0
  172. data/lib/libv8/scons/engine/SCons/Tool/sunlink.py +77 -0
  173. data/lib/libv8/scons/engine/SCons/Tool/swig.py +182 -0
  174. data/lib/libv8/scons/engine/SCons/Tool/tar.py +73 -0
  175. data/lib/libv8/scons/engine/SCons/Tool/tex.py +813 -0
  176. data/lib/libv8/scons/engine/SCons/Tool/textfile.py +175 -0
  177. data/lib/libv8/scons/engine/SCons/Tool/tlib.py +53 -0
  178. data/lib/libv8/scons/engine/SCons/Tool/wix.py +99 -0
  179. data/lib/libv8/scons/engine/SCons/Tool/yacc.py +130 -0
  180. data/lib/libv8/scons/engine/SCons/Tool/zip.py +99 -0
  181. data/lib/libv8/scons/engine/SCons/Util.py +1492 -0
  182. data/lib/libv8/scons/engine/SCons/Variables/BoolVariable.py +89 -0
  183. data/lib/libv8/scons/engine/SCons/Variables/EnumVariable.py +103 -0
  184. data/lib/libv8/scons/engine/SCons/Variables/ListVariable.py +135 -0
  185. data/lib/libv8/scons/engine/SCons/Variables/PackageVariable.py +106 -0
  186. data/lib/libv8/scons/engine/SCons/Variables/PathVariable.py +147 -0
  187. data/lib/libv8/scons/engine/SCons/Variables/__init__.py +312 -0
  188. data/lib/libv8/scons/engine/SCons/Warnings.py +246 -0
  189. data/lib/libv8/scons/engine/SCons/__init__.py +49 -0
  190. data/lib/libv8/scons/engine/SCons/compat/__init__.py +237 -0
  191. data/lib/libv8/scons/engine/SCons/compat/_scons_builtins.py +150 -0
  192. data/lib/libv8/scons/engine/SCons/compat/_scons_collections.py +45 -0
  193. data/lib/libv8/scons/engine/SCons/compat/_scons_dbm.py +45 -0
  194. data/lib/libv8/scons/engine/SCons/compat/_scons_hashlib.py +76 -0
  195. data/lib/libv8/scons/engine/SCons/compat/_scons_io.py +45 -0
  196. data/lib/libv8/scons/engine/SCons/compat/_scons_sets.py +563 -0
  197. data/lib/libv8/scons/engine/SCons/compat/_scons_subprocess.py +1281 -0
  198. data/lib/libv8/scons/engine/SCons/cpp.py +589 -0
  199. data/lib/libv8/scons/engine/SCons/dblite.py +251 -0
  200. data/lib/libv8/scons/engine/SCons/exitfuncs.py +77 -0
  201. data/lib/libv8/scons/os_spawnv_fix.diff +83 -0
  202. data/lib/libv8/scons/scons-time.1 +1017 -0
  203. data/lib/libv8/scons/scons.1 +15219 -0
  204. data/lib/libv8/scons/sconsign.1 +208 -0
  205. data/lib/libv8/scons/script/scons +196 -0
  206. data/lib/libv8/scons/script/scons-time +1544 -0
  207. data/lib/libv8/scons/script/scons.bat +31 -0
  208. data/lib/libv8/scons/script/sconsign +513 -0
  209. data/lib/libv8/scons/setup.cfg +6 -0
  210. data/lib/libv8/scons/setup.py +425 -0
  211. data/lib/libv8/v8/.gitignore +35 -0
  212. data/lib/libv8/v8/AUTHORS +44 -0
  213. data/lib/libv8/v8/ChangeLog +2839 -0
  214. data/lib/libv8/v8/LICENSE +52 -0
  215. data/lib/libv8/v8/LICENSE.strongtalk +29 -0
  216. data/lib/libv8/v8/LICENSE.v8 +26 -0
  217. data/lib/libv8/v8/LICENSE.valgrind +45 -0
  218. data/lib/libv8/v8/SConstruct +1478 -0
  219. data/lib/libv8/v8/build/README.txt +49 -0
  220. data/lib/libv8/v8/build/all.gyp +18 -0
  221. data/lib/libv8/v8/build/armu.gypi +32 -0
  222. data/lib/libv8/v8/build/common.gypi +144 -0
  223. data/lib/libv8/v8/build/gyp_v8 +145 -0
  224. data/lib/libv8/v8/include/v8-debug.h +395 -0
  225. data/lib/libv8/v8/include/v8-preparser.h +117 -0
  226. data/lib/libv8/v8/include/v8-profiler.h +505 -0
  227. data/lib/libv8/v8/include/v8-testing.h +104 -0
  228. data/lib/libv8/v8/include/v8.h +4124 -0
  229. data/lib/libv8/v8/include/v8stdint.h +53 -0
  230. data/lib/libv8/v8/preparser/SConscript +38 -0
  231. data/lib/libv8/v8/preparser/preparser-process.cc +379 -0
  232. data/lib/libv8/v8/src/SConscript +368 -0
  233. data/lib/libv8/v8/src/accessors.cc +767 -0
  234. data/lib/libv8/v8/src/accessors.h +123 -0
  235. data/lib/libv8/v8/src/allocation-inl.h +49 -0
  236. data/lib/libv8/v8/src/allocation.cc +122 -0
  237. data/lib/libv8/v8/src/allocation.h +143 -0
  238. data/lib/libv8/v8/src/api.cc +5845 -0
  239. data/lib/libv8/v8/src/api.h +574 -0
  240. data/lib/libv8/v8/src/apinatives.js +110 -0
  241. data/lib/libv8/v8/src/apiutils.h +73 -0
  242. data/lib/libv8/v8/src/arguments.h +118 -0
  243. data/lib/libv8/v8/src/arm/assembler-arm-inl.h +353 -0
  244. data/lib/libv8/v8/src/arm/assembler-arm.cc +2661 -0
  245. data/lib/libv8/v8/src/arm/assembler-arm.h +1375 -0
  246. data/lib/libv8/v8/src/arm/builtins-arm.cc +1658 -0
  247. data/lib/libv8/v8/src/arm/code-stubs-arm.cc +6398 -0
  248. data/lib/libv8/v8/src/arm/code-stubs-arm.h +673 -0
  249. data/lib/libv8/v8/src/arm/codegen-arm.cc +52 -0
  250. data/lib/libv8/v8/src/arm/codegen-arm.h +91 -0
  251. data/lib/libv8/v8/src/arm/constants-arm.cc +152 -0
  252. data/lib/libv8/v8/src/arm/constants-arm.h +775 -0
  253. data/lib/libv8/v8/src/arm/cpu-arm.cc +120 -0
  254. data/lib/libv8/v8/src/arm/debug-arm.cc +317 -0
  255. data/lib/libv8/v8/src/arm/deoptimizer-arm.cc +754 -0
  256. data/lib/libv8/v8/src/arm/disasm-arm.cc +1506 -0
  257. data/lib/libv8/v8/src/arm/frames-arm.cc +45 -0
  258. data/lib/libv8/v8/src/arm/frames-arm.h +168 -0
  259. data/lib/libv8/v8/src/arm/full-codegen-arm.cc +4375 -0
  260. data/lib/libv8/v8/src/arm/ic-arm.cc +1562 -0
  261. data/lib/libv8/v8/src/arm/lithium-arm.cc +2206 -0
  262. data/lib/libv8/v8/src/arm/lithium-arm.h +2348 -0
  263. data/lib/libv8/v8/src/arm/lithium-codegen-arm.cc +4526 -0
  264. data/lib/libv8/v8/src/arm/lithium-codegen-arm.h +403 -0
  265. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.cc +305 -0
  266. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.h +84 -0
  267. data/lib/libv8/v8/src/arm/macro-assembler-arm.cc +3163 -0
  268. data/lib/libv8/v8/src/arm/macro-assembler-arm.h +1126 -0
  269. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.cc +1287 -0
  270. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.h +253 -0
  271. data/lib/libv8/v8/src/arm/simulator-arm.cc +3424 -0
  272. data/lib/libv8/v8/src/arm/simulator-arm.h +431 -0
  273. data/lib/libv8/v8/src/arm/stub-cache-arm.cc +4243 -0
  274. data/lib/libv8/v8/src/array.js +1366 -0
  275. data/lib/libv8/v8/src/assembler.cc +1207 -0
  276. data/lib/libv8/v8/src/assembler.h +858 -0
  277. data/lib/libv8/v8/src/ast-inl.h +112 -0
  278. data/lib/libv8/v8/src/ast.cc +1146 -0
  279. data/lib/libv8/v8/src/ast.h +2188 -0
  280. data/lib/libv8/v8/src/atomicops.h +167 -0
  281. data/lib/libv8/v8/src/atomicops_internals_arm_gcc.h +145 -0
  282. data/lib/libv8/v8/src/atomicops_internals_mips_gcc.h +169 -0
  283. data/lib/libv8/v8/src/atomicops_internals_x86_gcc.cc +133 -0
  284. data/lib/libv8/v8/src/atomicops_internals_x86_gcc.h +287 -0
  285. data/lib/libv8/v8/src/atomicops_internals_x86_macosx.h +301 -0
  286. data/lib/libv8/v8/src/atomicops_internals_x86_msvc.h +203 -0
  287. data/lib/libv8/v8/src/bignum-dtoa.cc +655 -0
  288. data/lib/libv8/v8/src/bignum-dtoa.h +81 -0
  289. data/lib/libv8/v8/src/bignum.cc +768 -0
  290. data/lib/libv8/v8/src/bignum.h +140 -0
  291. data/lib/libv8/v8/src/bootstrapper.cc +2184 -0
  292. data/lib/libv8/v8/src/bootstrapper.h +188 -0
  293. data/lib/libv8/v8/src/builtins.cc +1707 -0
  294. data/lib/libv8/v8/src/builtins.h +371 -0
  295. data/lib/libv8/v8/src/bytecodes-irregexp.h +105 -0
  296. data/lib/libv8/v8/src/cached-powers.cc +177 -0
  297. data/lib/libv8/v8/src/cached-powers.h +65 -0
  298. data/lib/libv8/v8/src/char-predicates-inl.h +94 -0
  299. data/lib/libv8/v8/src/char-predicates.h +67 -0
  300. data/lib/libv8/v8/src/checks.cc +110 -0
  301. data/lib/libv8/v8/src/checks.h +296 -0
  302. data/lib/libv8/v8/src/circular-queue-inl.h +53 -0
  303. data/lib/libv8/v8/src/circular-queue.cc +122 -0
  304. data/lib/libv8/v8/src/circular-queue.h +103 -0
  305. data/lib/libv8/v8/src/code-stubs.cc +267 -0
  306. data/lib/libv8/v8/src/code-stubs.h +1011 -0
  307. data/lib/libv8/v8/src/code.h +70 -0
  308. data/lib/libv8/v8/src/codegen.cc +231 -0
  309. data/lib/libv8/v8/src/codegen.h +84 -0
  310. data/lib/libv8/v8/src/compilation-cache.cc +540 -0
  311. data/lib/libv8/v8/src/compilation-cache.h +287 -0
  312. data/lib/libv8/v8/src/compiler.cc +786 -0
  313. data/lib/libv8/v8/src/compiler.h +312 -0
  314. data/lib/libv8/v8/src/contexts.cc +347 -0
  315. data/lib/libv8/v8/src/contexts.h +391 -0
  316. data/lib/libv8/v8/src/conversions-inl.h +106 -0
  317. data/lib/libv8/v8/src/conversions.cc +1131 -0
  318. data/lib/libv8/v8/src/conversions.h +135 -0
  319. data/lib/libv8/v8/src/counters.cc +93 -0
  320. data/lib/libv8/v8/src/counters.h +254 -0
  321. data/lib/libv8/v8/src/cpu-profiler-inl.h +101 -0
  322. data/lib/libv8/v8/src/cpu-profiler.cc +609 -0
  323. data/lib/libv8/v8/src/cpu-profiler.h +302 -0
  324. data/lib/libv8/v8/src/cpu.h +69 -0
  325. data/lib/libv8/v8/src/d8-debug.cc +367 -0
  326. data/lib/libv8/v8/src/d8-debug.h +158 -0
  327. data/lib/libv8/v8/src/d8-posix.cc +695 -0
  328. data/lib/libv8/v8/src/d8-readline.cc +130 -0
  329. data/lib/libv8/v8/src/d8-windows.cc +42 -0
  330. data/lib/libv8/v8/src/d8.cc +803 -0
  331. data/lib/libv8/v8/src/d8.gyp +91 -0
  332. data/lib/libv8/v8/src/d8.h +235 -0
  333. data/lib/libv8/v8/src/d8.js +2798 -0
  334. data/lib/libv8/v8/src/data-flow.cc +66 -0
  335. data/lib/libv8/v8/src/data-flow.h +205 -0
  336. data/lib/libv8/v8/src/date.js +1103 -0
  337. data/lib/libv8/v8/src/dateparser-inl.h +127 -0
  338. data/lib/libv8/v8/src/dateparser.cc +178 -0
  339. data/lib/libv8/v8/src/dateparser.h +266 -0
  340. data/lib/libv8/v8/src/debug-agent.cc +447 -0
  341. data/lib/libv8/v8/src/debug-agent.h +129 -0
  342. data/lib/libv8/v8/src/debug-debugger.js +2569 -0
  343. data/lib/libv8/v8/src/debug.cc +3165 -0
  344. data/lib/libv8/v8/src/debug.h +1057 -0
  345. data/lib/libv8/v8/src/deoptimizer.cc +1256 -0
  346. data/lib/libv8/v8/src/deoptimizer.h +602 -0
  347. data/lib/libv8/v8/src/disasm.h +80 -0
  348. data/lib/libv8/v8/src/disassembler.cc +343 -0
  349. data/lib/libv8/v8/src/disassembler.h +58 -0
  350. data/lib/libv8/v8/src/diy-fp.cc +58 -0
  351. data/lib/libv8/v8/src/diy-fp.h +117 -0
  352. data/lib/libv8/v8/src/double.h +238 -0
  353. data/lib/libv8/v8/src/dtoa.cc +103 -0
  354. data/lib/libv8/v8/src/dtoa.h +85 -0
  355. data/lib/libv8/v8/src/execution.cc +849 -0
  356. data/lib/libv8/v8/src/execution.h +297 -0
  357. data/lib/libv8/v8/src/extensions/experimental/break-iterator.cc +250 -0
  358. data/lib/libv8/v8/src/extensions/experimental/break-iterator.h +89 -0
  359. data/lib/libv8/v8/src/extensions/experimental/collator.cc +218 -0
  360. data/lib/libv8/v8/src/extensions/experimental/collator.h +69 -0
  361. data/lib/libv8/v8/src/extensions/experimental/experimental.gyp +94 -0
  362. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.cc +78 -0
  363. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.h +54 -0
  364. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.cc +112 -0
  365. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.h +60 -0
  366. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.cc +43 -0
  367. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.h +49 -0
  368. data/lib/libv8/v8/src/extensions/experimental/i18n.js +180 -0
  369. data/lib/libv8/v8/src/extensions/experimental/language-matcher.cc +251 -0
  370. data/lib/libv8/v8/src/extensions/experimental/language-matcher.h +95 -0
  371. data/lib/libv8/v8/src/extensions/externalize-string-extension.cc +141 -0
  372. data/lib/libv8/v8/src/extensions/externalize-string-extension.h +50 -0
  373. data/lib/libv8/v8/src/extensions/gc-extension.cc +58 -0
  374. data/lib/libv8/v8/src/extensions/gc-extension.h +49 -0
  375. data/lib/libv8/v8/src/factory.cc +1222 -0
  376. data/lib/libv8/v8/src/factory.h +442 -0
  377. data/lib/libv8/v8/src/fast-dtoa.cc +736 -0
  378. data/lib/libv8/v8/src/fast-dtoa.h +83 -0
  379. data/lib/libv8/v8/src/fixed-dtoa.cc +405 -0
  380. data/lib/libv8/v8/src/fixed-dtoa.h +55 -0
  381. data/lib/libv8/v8/src/flag-definitions.h +560 -0
  382. data/lib/libv8/v8/src/flags.cc +551 -0
  383. data/lib/libv8/v8/src/flags.h +79 -0
  384. data/lib/libv8/v8/src/frames-inl.h +247 -0
  385. data/lib/libv8/v8/src/frames.cc +1243 -0
  386. data/lib/libv8/v8/src/frames.h +870 -0
  387. data/lib/libv8/v8/src/full-codegen.cc +1374 -0
  388. data/lib/libv8/v8/src/full-codegen.h +771 -0
  389. data/lib/libv8/v8/src/func-name-inferrer.cc +92 -0
  390. data/lib/libv8/v8/src/func-name-inferrer.h +111 -0
  391. data/lib/libv8/v8/src/gdb-jit.cc +1555 -0
  392. data/lib/libv8/v8/src/gdb-jit.h +143 -0
  393. data/lib/libv8/v8/src/global-handles.cc +665 -0
  394. data/lib/libv8/v8/src/global-handles.h +284 -0
  395. data/lib/libv8/v8/src/globals.h +325 -0
  396. data/lib/libv8/v8/src/handles-inl.h +177 -0
  397. data/lib/libv8/v8/src/handles.cc +987 -0
  398. data/lib/libv8/v8/src/handles.h +382 -0
  399. data/lib/libv8/v8/src/hashmap.cc +230 -0
  400. data/lib/libv8/v8/src/hashmap.h +123 -0
  401. data/lib/libv8/v8/src/heap-inl.h +704 -0
  402. data/lib/libv8/v8/src/heap-profiler.cc +1173 -0
  403. data/lib/libv8/v8/src/heap-profiler.h +397 -0
  404. data/lib/libv8/v8/src/heap.cc +5930 -0
  405. data/lib/libv8/v8/src/heap.h +2268 -0
  406. data/lib/libv8/v8/src/hydrogen-instructions.cc +1769 -0
  407. data/lib/libv8/v8/src/hydrogen-instructions.h +3971 -0
  408. data/lib/libv8/v8/src/hydrogen.cc +6239 -0
  409. data/lib/libv8/v8/src/hydrogen.h +1202 -0
  410. data/lib/libv8/v8/src/ia32/assembler-ia32-inl.h +446 -0
  411. data/lib/libv8/v8/src/ia32/assembler-ia32.cc +2487 -0
  412. data/lib/libv8/v8/src/ia32/assembler-ia32.h +1144 -0
  413. data/lib/libv8/v8/src/ia32/builtins-ia32.cc +1621 -0
  414. data/lib/libv8/v8/src/ia32/code-stubs-ia32.cc +6198 -0
  415. data/lib/libv8/v8/src/ia32/code-stubs-ia32.h +517 -0
  416. data/lib/libv8/v8/src/ia32/codegen-ia32.cc +265 -0
  417. data/lib/libv8/v8/src/ia32/codegen-ia32.h +79 -0
  418. data/lib/libv8/v8/src/ia32/cpu-ia32.cc +88 -0
  419. data/lib/libv8/v8/src/ia32/debug-ia32.cc +312 -0
  420. data/lib/libv8/v8/src/ia32/deoptimizer-ia32.cc +774 -0
  421. data/lib/libv8/v8/src/ia32/disasm-ia32.cc +1628 -0
  422. data/lib/libv8/v8/src/ia32/frames-ia32.cc +45 -0
  423. data/lib/libv8/v8/src/ia32/frames-ia32.h +142 -0
  424. data/lib/libv8/v8/src/ia32/full-codegen-ia32.cc +4338 -0
  425. data/lib/libv8/v8/src/ia32/ic-ia32.cc +1597 -0
  426. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.cc +4461 -0
  427. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.h +375 -0
  428. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.cc +475 -0
  429. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
  430. data/lib/libv8/v8/src/ia32/lithium-ia32.cc +2261 -0
  431. data/lib/libv8/v8/src/ia32/lithium-ia32.h +2396 -0
  432. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.cc +2136 -0
  433. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.h +775 -0
  434. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.cc +1263 -0
  435. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.h +216 -0
  436. data/lib/libv8/v8/src/ia32/simulator-ia32.cc +30 -0
  437. data/lib/libv8/v8/src/ia32/simulator-ia32.h +74 -0
  438. data/lib/libv8/v8/src/ia32/stub-cache-ia32.cc +3847 -0
  439. data/lib/libv8/v8/src/ic-inl.h +130 -0
  440. data/lib/libv8/v8/src/ic.cc +2577 -0
  441. data/lib/libv8/v8/src/ic.h +736 -0
  442. data/lib/libv8/v8/src/inspector.cc +63 -0
  443. data/lib/libv8/v8/src/inspector.h +62 -0
  444. data/lib/libv8/v8/src/interpreter-irregexp.cc +659 -0
  445. data/lib/libv8/v8/src/interpreter-irregexp.h +49 -0
  446. data/lib/libv8/v8/src/isolate-inl.h +50 -0
  447. data/lib/libv8/v8/src/isolate.cc +1869 -0
  448. data/lib/libv8/v8/src/isolate.h +1382 -0
  449. data/lib/libv8/v8/src/json-parser.cc +504 -0
  450. data/lib/libv8/v8/src/json-parser.h +161 -0
  451. data/lib/libv8/v8/src/json.js +342 -0
  452. data/lib/libv8/v8/src/jsregexp.cc +5385 -0
  453. data/lib/libv8/v8/src/jsregexp.h +1492 -0
  454. data/lib/libv8/v8/src/list-inl.h +212 -0
  455. data/lib/libv8/v8/src/list.h +174 -0
  456. data/lib/libv8/v8/src/lithium-allocator-inl.h +142 -0
  457. data/lib/libv8/v8/src/lithium-allocator.cc +2123 -0
  458. data/lib/libv8/v8/src/lithium-allocator.h +630 -0
  459. data/lib/libv8/v8/src/lithium.cc +190 -0
  460. data/lib/libv8/v8/src/lithium.h +597 -0
  461. data/lib/libv8/v8/src/liveedit-debugger.js +1082 -0
  462. data/lib/libv8/v8/src/liveedit.cc +1691 -0
  463. data/lib/libv8/v8/src/liveedit.h +180 -0
  464. data/lib/libv8/v8/src/liveobjectlist-inl.h +126 -0
  465. data/lib/libv8/v8/src/liveobjectlist.cc +2589 -0
  466. data/lib/libv8/v8/src/liveobjectlist.h +322 -0
  467. data/lib/libv8/v8/src/log-inl.h +59 -0
  468. data/lib/libv8/v8/src/log-utils.cc +428 -0
  469. data/lib/libv8/v8/src/log-utils.h +231 -0
  470. data/lib/libv8/v8/src/log.cc +1993 -0
  471. data/lib/libv8/v8/src/log.h +476 -0
  472. data/lib/libv8/v8/src/macro-assembler.h +120 -0
  473. data/lib/libv8/v8/src/macros.py +178 -0
  474. data/lib/libv8/v8/src/mark-compact.cc +3143 -0
  475. data/lib/libv8/v8/src/mark-compact.h +506 -0
  476. data/lib/libv8/v8/src/math.js +264 -0
  477. data/lib/libv8/v8/src/messages.cc +179 -0
  478. data/lib/libv8/v8/src/messages.h +113 -0
  479. data/lib/libv8/v8/src/messages.js +1096 -0
  480. data/lib/libv8/v8/src/mips/assembler-mips-inl.h +312 -0
  481. data/lib/libv8/v8/src/mips/assembler-mips.cc +1960 -0
  482. data/lib/libv8/v8/src/mips/assembler-mips.h +1138 -0
  483. data/lib/libv8/v8/src/mips/builtins-mips.cc +1628 -0
  484. data/lib/libv8/v8/src/mips/code-stubs-mips.cc +6656 -0
  485. data/lib/libv8/v8/src/mips/code-stubs-mips.h +682 -0
  486. data/lib/libv8/v8/src/mips/codegen-mips.cc +52 -0
  487. data/lib/libv8/v8/src/mips/codegen-mips.h +98 -0
  488. data/lib/libv8/v8/src/mips/constants-mips.cc +352 -0
  489. data/lib/libv8/v8/src/mips/constants-mips.h +739 -0
  490. data/lib/libv8/v8/src/mips/cpu-mips.cc +96 -0
  491. data/lib/libv8/v8/src/mips/debug-mips.cc +308 -0
  492. data/lib/libv8/v8/src/mips/deoptimizer-mips.cc +91 -0
  493. data/lib/libv8/v8/src/mips/disasm-mips.cc +1050 -0
  494. data/lib/libv8/v8/src/mips/frames-mips.cc +47 -0
  495. data/lib/libv8/v8/src/mips/frames-mips.h +219 -0
  496. data/lib/libv8/v8/src/mips/full-codegen-mips.cc +4388 -0
  497. data/lib/libv8/v8/src/mips/ic-mips.cc +1580 -0
  498. data/lib/libv8/v8/src/mips/lithium-codegen-mips.h +65 -0
  499. data/lib/libv8/v8/src/mips/lithium-mips.h +307 -0
  500. data/lib/libv8/v8/src/mips/macro-assembler-mips.cc +4056 -0
  501. data/lib/libv8/v8/src/mips/macro-assembler-mips.h +1214 -0
  502. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.cc +1251 -0
  503. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.h +252 -0
  504. data/lib/libv8/v8/src/mips/simulator-mips.cc +2621 -0
  505. data/lib/libv8/v8/src/mips/simulator-mips.h +401 -0
  506. data/lib/libv8/v8/src/mips/stub-cache-mips.cc +4285 -0
  507. data/lib/libv8/v8/src/mirror-debugger.js +2382 -0
  508. data/lib/libv8/v8/src/mksnapshot.cc +328 -0
  509. data/lib/libv8/v8/src/natives.h +64 -0
  510. data/lib/libv8/v8/src/objects-debug.cc +738 -0
  511. data/lib/libv8/v8/src/objects-inl.h +4323 -0
  512. data/lib/libv8/v8/src/objects-printer.cc +829 -0
  513. data/lib/libv8/v8/src/objects-visiting.cc +148 -0
  514. data/lib/libv8/v8/src/objects-visiting.h +424 -0
  515. data/lib/libv8/v8/src/objects.cc +10585 -0
  516. data/lib/libv8/v8/src/objects.h +6838 -0
  517. data/lib/libv8/v8/src/parser.cc +4997 -0
  518. data/lib/libv8/v8/src/parser.h +765 -0
  519. data/lib/libv8/v8/src/platform-cygwin.cc +779 -0
  520. data/lib/libv8/v8/src/platform-freebsd.cc +826 -0
  521. data/lib/libv8/v8/src/platform-linux.cc +1149 -0
  522. data/lib/libv8/v8/src/platform-macos.cc +830 -0
  523. data/lib/libv8/v8/src/platform-nullos.cc +479 -0
  524. data/lib/libv8/v8/src/platform-openbsd.cc +640 -0
  525. data/lib/libv8/v8/src/platform-posix.cc +424 -0
  526. data/lib/libv8/v8/src/platform-solaris.cc +762 -0
  527. data/lib/libv8/v8/src/platform-tls-mac.h +62 -0
  528. data/lib/libv8/v8/src/platform-tls-win32.h +62 -0
  529. data/lib/libv8/v8/src/platform-tls.h +50 -0
  530. data/lib/libv8/v8/src/platform-win32.cc +2021 -0
  531. data/lib/libv8/v8/src/platform.h +667 -0
  532. data/lib/libv8/v8/src/preparse-data-format.h +62 -0
  533. data/lib/libv8/v8/src/preparse-data.cc +183 -0
  534. data/lib/libv8/v8/src/preparse-data.h +225 -0
  535. data/lib/libv8/v8/src/preparser-api.cc +220 -0
  536. data/lib/libv8/v8/src/preparser.cc +1450 -0
  537. data/lib/libv8/v8/src/preparser.h +493 -0
  538. data/lib/libv8/v8/src/prettyprinter.cc +1493 -0
  539. data/lib/libv8/v8/src/prettyprinter.h +223 -0
  540. data/lib/libv8/v8/src/profile-generator-inl.h +128 -0
  541. data/lib/libv8/v8/src/profile-generator.cc +3098 -0
  542. data/lib/libv8/v8/src/profile-generator.h +1126 -0
  543. data/lib/libv8/v8/src/property.cc +105 -0
  544. data/lib/libv8/v8/src/property.h +365 -0
  545. data/lib/libv8/v8/src/proxy.js +83 -0
  546. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp-inl.h +78 -0
  547. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.cc +471 -0
  548. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.h +142 -0
  549. data/lib/libv8/v8/src/regexp-macro-assembler-tracer.cc +373 -0
  550. data/lib/libv8/v8/src/regexp-macro-assembler-tracer.h +104 -0
  551. data/lib/libv8/v8/src/regexp-macro-assembler.cc +267 -0
  552. data/lib/libv8/v8/src/regexp-macro-assembler.h +243 -0
  553. data/lib/libv8/v8/src/regexp-stack.cc +111 -0
  554. data/lib/libv8/v8/src/regexp-stack.h +147 -0
  555. data/lib/libv8/v8/src/regexp.js +483 -0
  556. data/lib/libv8/v8/src/rewriter.cc +360 -0
  557. data/lib/libv8/v8/src/rewriter.h +50 -0
  558. data/lib/libv8/v8/src/runtime-profiler.cc +489 -0
  559. data/lib/libv8/v8/src/runtime-profiler.h +201 -0
  560. data/lib/libv8/v8/src/runtime.cc +12227 -0
  561. data/lib/libv8/v8/src/runtime.h +652 -0
  562. data/lib/libv8/v8/src/runtime.js +649 -0
  563. data/lib/libv8/v8/src/safepoint-table.cc +256 -0
  564. data/lib/libv8/v8/src/safepoint-table.h +270 -0
  565. data/lib/libv8/v8/src/scanner-base.cc +952 -0
  566. data/lib/libv8/v8/src/scanner-base.h +670 -0
  567. data/lib/libv8/v8/src/scanner.cc +345 -0
  568. data/lib/libv8/v8/src/scanner.h +146 -0
  569. data/lib/libv8/v8/src/scopeinfo.cc +646 -0
  570. data/lib/libv8/v8/src/scopeinfo.h +254 -0
  571. data/lib/libv8/v8/src/scopes.cc +1150 -0
  572. data/lib/libv8/v8/src/scopes.h +507 -0
  573. data/lib/libv8/v8/src/serialize.cc +1574 -0
  574. data/lib/libv8/v8/src/serialize.h +589 -0
  575. data/lib/libv8/v8/src/shell.h +55 -0
  576. data/lib/libv8/v8/src/simulator.h +43 -0
  577. data/lib/libv8/v8/src/small-pointer-list.h +163 -0
  578. data/lib/libv8/v8/src/smart-pointer.h +109 -0
  579. data/lib/libv8/v8/src/snapshot-common.cc +83 -0
  580. data/lib/libv8/v8/src/snapshot-empty.cc +54 -0
  581. data/lib/libv8/v8/src/snapshot.h +91 -0
  582. data/lib/libv8/v8/src/spaces-inl.h +529 -0
  583. data/lib/libv8/v8/src/spaces.cc +3145 -0
  584. data/lib/libv8/v8/src/spaces.h +2369 -0
  585. data/lib/libv8/v8/src/splay-tree-inl.h +310 -0
  586. data/lib/libv8/v8/src/splay-tree.h +205 -0
  587. data/lib/libv8/v8/src/string-search.cc +41 -0
  588. data/lib/libv8/v8/src/string-search.h +568 -0
  589. data/lib/libv8/v8/src/string-stream.cc +592 -0
  590. data/lib/libv8/v8/src/string-stream.h +191 -0
  591. data/lib/libv8/v8/src/string.js +994 -0
  592. data/lib/libv8/v8/src/strtod.cc +440 -0
  593. data/lib/libv8/v8/src/strtod.h +40 -0
  594. data/lib/libv8/v8/src/stub-cache.cc +1965 -0
  595. data/lib/libv8/v8/src/stub-cache.h +924 -0
  596. data/lib/libv8/v8/src/third_party/valgrind/valgrind.h +3925 -0
  597. data/lib/libv8/v8/src/token.cc +63 -0
  598. data/lib/libv8/v8/src/token.h +288 -0
  599. data/lib/libv8/v8/src/type-info.cc +507 -0
  600. data/lib/libv8/v8/src/type-info.h +272 -0
  601. data/lib/libv8/v8/src/unbound-queue-inl.h +95 -0
  602. data/lib/libv8/v8/src/unbound-queue.h +69 -0
  603. data/lib/libv8/v8/src/unicode-inl.h +238 -0
  604. data/lib/libv8/v8/src/unicode.cc +1624 -0
  605. data/lib/libv8/v8/src/unicode.h +280 -0
  606. data/lib/libv8/v8/src/uri.js +408 -0
  607. data/lib/libv8/v8/src/utils-inl.h +48 -0
  608. data/lib/libv8/v8/src/utils.cc +371 -0
  609. data/lib/libv8/v8/src/utils.h +800 -0
  610. data/lib/libv8/v8/src/v8-counters.cc +62 -0
  611. data/lib/libv8/v8/src/v8-counters.h +314 -0
  612. data/lib/libv8/v8/src/v8.cc +213 -0
  613. data/lib/libv8/v8/src/v8.h +131 -0
  614. data/lib/libv8/v8/src/v8checks.h +64 -0
  615. data/lib/libv8/v8/src/v8dll-main.cc +44 -0
  616. data/lib/libv8/v8/src/v8globals.h +512 -0
  617. data/lib/libv8/v8/src/v8memory.h +82 -0
  618. data/lib/libv8/v8/src/v8natives.js +1310 -0
  619. data/lib/libv8/v8/src/v8preparserdll-main.cc +39 -0
  620. data/lib/libv8/v8/src/v8threads.cc +464 -0
  621. data/lib/libv8/v8/src/v8threads.h +165 -0
  622. data/lib/libv8/v8/src/v8utils.h +319 -0
  623. data/lib/libv8/v8/src/variables.cc +114 -0
  624. data/lib/libv8/v8/src/variables.h +167 -0
  625. data/lib/libv8/v8/src/version.cc +116 -0
  626. data/lib/libv8/v8/src/version.h +68 -0
  627. data/lib/libv8/v8/src/vm-state-inl.h +138 -0
  628. data/lib/libv8/v8/src/vm-state.h +71 -0
  629. data/lib/libv8/v8/src/win32-headers.h +96 -0
  630. data/lib/libv8/v8/src/x64/assembler-x64-inl.h +462 -0
  631. data/lib/libv8/v8/src/x64/assembler-x64.cc +3027 -0
  632. data/lib/libv8/v8/src/x64/assembler-x64.h +1633 -0
  633. data/lib/libv8/v8/src/x64/builtins-x64.cc +1520 -0
  634. data/lib/libv8/v8/src/x64/code-stubs-x64.cc +5132 -0
  635. data/lib/libv8/v8/src/x64/code-stubs-x64.h +514 -0
  636. data/lib/libv8/v8/src/x64/codegen-x64.cc +146 -0
  637. data/lib/libv8/v8/src/x64/codegen-x64.h +76 -0
  638. data/lib/libv8/v8/src/x64/cpu-x64.cc +88 -0
  639. data/lib/libv8/v8/src/x64/debug-x64.cc +319 -0
  640. data/lib/libv8/v8/src/x64/deoptimizer-x64.cc +815 -0
  641. data/lib/libv8/v8/src/x64/disasm-x64.cc +1832 -0
  642. data/lib/libv8/v8/src/x64/frames-x64.cc +45 -0
  643. data/lib/libv8/v8/src/x64/frames-x64.h +130 -0
  644. data/lib/libv8/v8/src/x64/full-codegen-x64.cc +4318 -0
  645. data/lib/libv8/v8/src/x64/ic-x64.cc +1608 -0
  646. data/lib/libv8/v8/src/x64/lithium-codegen-x64.cc +4267 -0
  647. data/lib/libv8/v8/src/x64/lithium-codegen-x64.h +367 -0
  648. data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.cc +320 -0
  649. data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.h +74 -0
  650. data/lib/libv8/v8/src/x64/lithium-x64.cc +2202 -0
  651. data/lib/libv8/v8/src/x64/lithium-x64.h +2333 -0
  652. data/lib/libv8/v8/src/x64/macro-assembler-x64.cc +3745 -0
  653. data/lib/libv8/v8/src/x64/macro-assembler-x64.h +1290 -0
  654. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.cc +1398 -0
  655. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.h +282 -0
  656. data/lib/libv8/v8/src/x64/simulator-x64.cc +27 -0
  657. data/lib/libv8/v8/src/x64/simulator-x64.h +72 -0
  658. data/lib/libv8/v8/src/x64/stub-cache-x64.cc +3610 -0
  659. data/lib/libv8/v8/src/zone-inl.h +140 -0
  660. data/lib/libv8/v8/src/zone.cc +196 -0
  661. data/lib/libv8/v8/src/zone.h +240 -0
  662. data/lib/libv8/v8/tools/codemap.js +265 -0
  663. data/lib/libv8/v8/tools/consarray.js +93 -0
  664. data/lib/libv8/v8/tools/csvparser.js +78 -0
  665. data/lib/libv8/v8/tools/disasm.py +92 -0
  666. data/lib/libv8/v8/tools/freebsd-tick-processor +10 -0
  667. data/lib/libv8/v8/tools/gc-nvp-trace-processor.py +342 -0
  668. data/lib/libv8/v8/tools/gcmole/README +62 -0
  669. data/lib/libv8/v8/tools/gcmole/gccause.lua +60 -0
  670. data/lib/libv8/v8/tools/gcmole/gcmole.cc +1261 -0
  671. data/lib/libv8/v8/tools/gcmole/gcmole.lua +378 -0
  672. data/lib/libv8/v8/tools/generate-ten-powers.scm +286 -0
  673. data/lib/libv8/v8/tools/grokdump.py +841 -0
  674. data/lib/libv8/v8/tools/gyp/v8.gyp +995 -0
  675. data/lib/libv8/v8/tools/js2c.py +364 -0
  676. data/lib/libv8/v8/tools/jsmin.py +280 -0
  677. data/lib/libv8/v8/tools/linux-tick-processor +35 -0
  678. data/lib/libv8/v8/tools/ll_prof.py +942 -0
  679. data/lib/libv8/v8/tools/logreader.js +185 -0
  680. data/lib/libv8/v8/tools/mac-nm +18 -0
  681. data/lib/libv8/v8/tools/mac-tick-processor +6 -0
  682. data/lib/libv8/v8/tools/oom_dump/README +31 -0
  683. data/lib/libv8/v8/tools/oom_dump/SConstruct +42 -0
  684. data/lib/libv8/v8/tools/oom_dump/oom_dump.cc +288 -0
  685. data/lib/libv8/v8/tools/presubmit.py +305 -0
  686. data/lib/libv8/v8/tools/process-heap-prof.py +120 -0
  687. data/lib/libv8/v8/tools/profile.js +751 -0
  688. data/lib/libv8/v8/tools/profile_view.js +219 -0
  689. data/lib/libv8/v8/tools/run-valgrind.py +77 -0
  690. data/lib/libv8/v8/tools/splaytree.js +316 -0
  691. data/lib/libv8/v8/tools/stats-viewer.py +468 -0
  692. data/lib/libv8/v8/tools/test.py +1510 -0
  693. data/lib/libv8/v8/tools/tickprocessor-driver.js +59 -0
  694. data/lib/libv8/v8/tools/tickprocessor.js +877 -0
  695. data/lib/libv8/v8/tools/utils.py +96 -0
  696. data/lib/libv8/v8/tools/visual_studio/README.txt +12 -0
  697. data/lib/libv8/v8/tools/windows-tick-processor.bat +30 -0
  698. data/lib/libv8/version.rb +4 -0
  699. data/libv8.gemspec +31 -0
  700. metadata +800 -0
@@ -0,0 +1,2348 @@
1
+ // Copyright 2011 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
+ #ifndef V8_ARM_LITHIUM_ARM_H_
29
+ #define V8_ARM_LITHIUM_ARM_H_
30
+
31
+ #include "hydrogen.h"
32
+ #include "lithium-allocator.h"
33
+ #include "lithium.h"
34
+ #include "safepoint-table.h"
35
+
36
+ namespace v8 {
37
+ namespace internal {
38
+
39
+ // Forward declarations.
40
+ class LCodeGen;
41
+
42
+ #define LITHIUM_ALL_INSTRUCTION_LIST(V) \
43
+ V(ControlInstruction) \
44
+ V(Call) \
45
+ LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
46
+
47
+
48
+ #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \
49
+ V(AccessArgumentsAt) \
50
+ V(AddI) \
51
+ V(ApplyArguments) \
52
+ V(ArgumentsElements) \
53
+ V(ArgumentsLength) \
54
+ V(ArithmeticD) \
55
+ V(ArithmeticT) \
56
+ V(ArrayLiteral) \
57
+ V(BitI) \
58
+ V(BitNotI) \
59
+ V(BoundsCheck) \
60
+ V(Branch) \
61
+ V(CallConstantFunction) \
62
+ V(CallFunction) \
63
+ V(CallGlobal) \
64
+ V(CallKeyed) \
65
+ V(CallKnownGlobal) \
66
+ V(CallNamed) \
67
+ V(CallNew) \
68
+ V(CallRuntime) \
69
+ V(CallStub) \
70
+ V(CheckFunction) \
71
+ V(CheckInstanceType) \
72
+ V(CheckNonSmi) \
73
+ V(CheckMap) \
74
+ V(CheckPrototypeMaps) \
75
+ V(CheckSmi) \
76
+ V(ClampDToUint8) \
77
+ V(ClampIToUint8) \
78
+ V(ClampTToUint8) \
79
+ V(ClassOfTest) \
80
+ V(ClassOfTestAndBranch) \
81
+ V(CmpID) \
82
+ V(CmpIDAndBranch) \
83
+ V(CmpJSObjectEq) \
84
+ V(CmpJSObjectEqAndBranch) \
85
+ V(CmpMapAndBranch) \
86
+ V(CmpSymbolEq) \
87
+ V(CmpSymbolEqAndBranch) \
88
+ V(CmpT) \
89
+ V(CmpTAndBranch) \
90
+ V(ConstantD) \
91
+ V(ConstantI) \
92
+ V(ConstantT) \
93
+ V(Context) \
94
+ V(DeleteProperty) \
95
+ V(Deoptimize) \
96
+ V(DivI) \
97
+ V(DoubleToI) \
98
+ V(ExternalArrayLength) \
99
+ V(FixedArrayLength) \
100
+ V(FunctionLiteral) \
101
+ V(GetCachedArrayIndex) \
102
+ V(GlobalObject) \
103
+ V(GlobalReceiver) \
104
+ V(Goto) \
105
+ V(HasCachedArrayIndex) \
106
+ V(HasCachedArrayIndexAndBranch) \
107
+ V(HasInstanceType) \
108
+ V(HasInstanceTypeAndBranch) \
109
+ V(In) \
110
+ V(InstanceOf) \
111
+ V(InstanceOfAndBranch) \
112
+ V(InstanceOfKnownGlobal) \
113
+ V(InstructionGap) \
114
+ V(Integer32ToDouble) \
115
+ V(InvokeFunction) \
116
+ V(IsConstructCall) \
117
+ V(IsConstructCallAndBranch) \
118
+ V(IsNull) \
119
+ V(IsNullAndBranch) \
120
+ V(IsObject) \
121
+ V(IsObjectAndBranch) \
122
+ V(IsSmi) \
123
+ V(IsSmiAndBranch) \
124
+ V(IsUndetectable) \
125
+ V(IsUndetectableAndBranch) \
126
+ V(JSArrayLength) \
127
+ V(Label) \
128
+ V(LazyBailout) \
129
+ V(LoadContextSlot) \
130
+ V(LoadElements) \
131
+ V(LoadExternalArrayPointer) \
132
+ V(LoadFunctionPrototype) \
133
+ V(LoadGlobalCell) \
134
+ V(LoadGlobalGeneric) \
135
+ V(LoadKeyedFastElement) \
136
+ V(LoadKeyedGeneric) \
137
+ V(LoadKeyedSpecializedArrayElement) \
138
+ V(LoadNamedField) \
139
+ V(LoadNamedFieldPolymorphic) \
140
+ V(LoadNamedGeneric) \
141
+ V(ModI) \
142
+ V(MulI) \
143
+ V(NumberTagD) \
144
+ V(NumberTagI) \
145
+ V(NumberUntagD) \
146
+ V(ObjectLiteral) \
147
+ V(OsrEntry) \
148
+ V(OuterContext) \
149
+ V(Parameter) \
150
+ V(Power) \
151
+ V(PushArgument) \
152
+ V(RegExpLiteral) \
153
+ V(Return) \
154
+ V(ShiftI) \
155
+ V(SmiTag) \
156
+ V(SmiUntag) \
157
+ V(StackCheck) \
158
+ V(StoreContextSlot) \
159
+ V(StoreGlobalCell) \
160
+ V(StoreGlobalGeneric) \
161
+ V(StoreKeyedFastElement) \
162
+ V(StoreKeyedGeneric) \
163
+ V(StoreKeyedSpecializedArrayElement) \
164
+ V(StoreNamedField) \
165
+ V(StoreNamedGeneric) \
166
+ V(StringAdd) \
167
+ V(StringCharCodeAt) \
168
+ V(StringCharFromCode) \
169
+ V(StringLength) \
170
+ V(SubI) \
171
+ V(TaggedToI) \
172
+ V(Throw) \
173
+ V(ToFastProperties) \
174
+ V(Typeof) \
175
+ V(TypeofIs) \
176
+ V(TypeofIsAndBranch) \
177
+ V(UnaryMathOperation) \
178
+ V(UnknownOSRValue) \
179
+ V(ValueOf)
180
+
181
+
182
+ #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
183
+ virtual Opcode opcode() const { return LInstruction::k##type; } \
184
+ virtual void CompileToNative(LCodeGen* generator); \
185
+ virtual const char* Mnemonic() const { return mnemonic; } \
186
+ static L##type* cast(LInstruction* instr) { \
187
+ ASSERT(instr->Is##type()); \
188
+ return reinterpret_cast<L##type*>(instr); \
189
+ }
190
+
191
+
192
+ #define DECLARE_HYDROGEN_ACCESSOR(type) \
193
+ H##type* hydrogen() const { \
194
+ return H##type::cast(hydrogen_value()); \
195
+ }
196
+
197
+
198
+ class LInstruction: public ZoneObject {
199
+ public:
200
+ LInstruction()
201
+ : environment_(NULL),
202
+ hydrogen_value_(NULL),
203
+ is_call_(false),
204
+ is_save_doubles_(false) { }
205
+ virtual ~LInstruction() { }
206
+
207
+ virtual void CompileToNative(LCodeGen* generator) = 0;
208
+ virtual const char* Mnemonic() const = 0;
209
+ virtual void PrintTo(StringStream* stream);
210
+ virtual void PrintDataTo(StringStream* stream) = 0;
211
+ virtual void PrintOutputOperandTo(StringStream* stream) = 0;
212
+
213
+ enum Opcode {
214
+ // Declare a unique enum value for each instruction.
215
+ #define DECLARE_OPCODE(type) k##type,
216
+ LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE)
217
+ kNumberOfInstructions
218
+ #undef DECLARE_OPCODE
219
+ };
220
+
221
+ virtual Opcode opcode() const = 0;
222
+
223
+ // Declare non-virtual type testers for all leaf IR classes.
224
+ #define DECLARE_PREDICATE(type) \
225
+ bool Is##type() const { return opcode() == k##type; }
226
+ LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE)
227
+ #undef DECLARE_PREDICATE
228
+
229
+ // Declare virtual predicates for instructions that don't have
230
+ // an opcode.
231
+ virtual bool IsGap() const { return false; }
232
+
233
+ virtual bool IsControl() const { return false; }
234
+ virtual void SetBranchTargets(int true_block_id, int false_block_id) { }
235
+
236
+ void set_environment(LEnvironment* env) { environment_ = env; }
237
+ LEnvironment* environment() const { return environment_; }
238
+ bool HasEnvironment() const { return environment_ != NULL; }
239
+
240
+ void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
241
+ LPointerMap* pointer_map() const { return pointer_map_.get(); }
242
+ bool HasPointerMap() const { return pointer_map_.is_set(); }
243
+
244
+ void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
245
+ HValue* hydrogen_value() const { return hydrogen_value_; }
246
+
247
+ void set_deoptimization_environment(LEnvironment* env) {
248
+ deoptimization_environment_.set(env);
249
+ }
250
+ LEnvironment* deoptimization_environment() const {
251
+ return deoptimization_environment_.get();
252
+ }
253
+ bool HasDeoptimizationEnvironment() const {
254
+ return deoptimization_environment_.is_set();
255
+ }
256
+
257
+ void MarkAsCall() { is_call_ = true; }
258
+ void MarkAsSaveDoubles() { is_save_doubles_ = true; }
259
+
260
+ // Interface to the register allocator and iterators.
261
+ bool IsMarkedAsCall() const { return is_call_; }
262
+ bool IsMarkedAsSaveDoubles() const { return is_save_doubles_; }
263
+
264
+ virtual bool HasResult() const = 0;
265
+ virtual LOperand* result() = 0;
266
+
267
+ virtual int InputCount() = 0;
268
+ virtual LOperand* InputAt(int i) = 0;
269
+ virtual int TempCount() = 0;
270
+ virtual LOperand* TempAt(int i) = 0;
271
+
272
+ LOperand* FirstInput() { return InputAt(0); }
273
+ LOperand* Output() { return HasResult() ? result() : NULL; }
274
+
275
+ #ifdef DEBUG
276
+ void VerifyCall();
277
+ #endif
278
+
279
+ private:
280
+ LEnvironment* environment_;
281
+ SetOncePointer<LPointerMap> pointer_map_;
282
+ HValue* hydrogen_value_;
283
+ SetOncePointer<LEnvironment> deoptimization_environment_;
284
+ bool is_call_;
285
+ bool is_save_doubles_;
286
+ };
287
+
288
+
289
+ template<typename ElementType, int NumElements>
290
+ class OperandContainer {
291
+ public:
292
+ OperandContainer() {
293
+ for (int i = 0; i < NumElements; i++) elems_[i] = NULL;
294
+ }
295
+ int length() { return NumElements; }
296
+ ElementType& operator[](int i) {
297
+ ASSERT(i < length());
298
+ return elems_[i];
299
+ }
300
+ void PrintOperandsTo(StringStream* stream);
301
+
302
+ private:
303
+ ElementType elems_[NumElements];
304
+ };
305
+
306
+
307
+ template<typename ElementType>
308
+ class OperandContainer<ElementType, 0> {
309
+ public:
310
+ int length() { return 0; }
311
+ void PrintOperandsTo(StringStream* stream) { }
312
+ ElementType& operator[](int i) {
313
+ UNREACHABLE();
314
+ static ElementType t = 0;
315
+ return t;
316
+ }
317
+ };
318
+
319
+
320
+ // R = number of result operands (0 or 1).
321
+ // I = number of input operands.
322
+ // T = number of temporary operands.
323
+ template<int R, int I, int T>
324
+ class LTemplateInstruction: public LInstruction {
325
+ public:
326
+ // Allow 0 or 1 output operands.
327
+ STATIC_ASSERT(R == 0 || R == 1);
328
+ virtual bool HasResult() const { return R != 0; }
329
+ void set_result(LOperand* operand) { results_[0] = operand; }
330
+ LOperand* result() { return results_[0]; }
331
+
332
+ int InputCount() { return I; }
333
+ LOperand* InputAt(int i) { return inputs_[i]; }
334
+
335
+ int TempCount() { return T; }
336
+ LOperand* TempAt(int i) { return temps_[i]; }
337
+
338
+ virtual void PrintDataTo(StringStream* stream);
339
+ virtual void PrintOutputOperandTo(StringStream* stream);
340
+
341
+ protected:
342
+ OperandContainer<LOperand*, R> results_;
343
+ OperandContainer<LOperand*, I> inputs_;
344
+ OperandContainer<LOperand*, T> temps_;
345
+ };
346
+
347
+
348
+ class LGap: public LTemplateInstruction<0, 0, 0> {
349
+ public:
350
+ explicit LGap(HBasicBlock* block)
351
+ : block_(block) {
352
+ parallel_moves_[BEFORE] = NULL;
353
+ parallel_moves_[START] = NULL;
354
+ parallel_moves_[END] = NULL;
355
+ parallel_moves_[AFTER] = NULL;
356
+ }
357
+
358
+ // Can't use the DECLARE-macro here because of sub-classes.
359
+ virtual bool IsGap() const { return true; }
360
+ virtual void PrintDataTo(StringStream* stream);
361
+ static LGap* cast(LInstruction* instr) {
362
+ ASSERT(instr->IsGap());
363
+ return reinterpret_cast<LGap*>(instr);
364
+ }
365
+
366
+ bool IsRedundant() const;
367
+
368
+ HBasicBlock* block() const { return block_; }
369
+
370
+ enum InnerPosition {
371
+ BEFORE,
372
+ START,
373
+ END,
374
+ AFTER,
375
+ FIRST_INNER_POSITION = BEFORE,
376
+ LAST_INNER_POSITION = AFTER
377
+ };
378
+
379
+ LParallelMove* GetOrCreateParallelMove(InnerPosition pos) {
380
+ if (parallel_moves_[pos] == NULL) parallel_moves_[pos] = new LParallelMove;
381
+ return parallel_moves_[pos];
382
+ }
383
+
384
+ LParallelMove* GetParallelMove(InnerPosition pos) {
385
+ return parallel_moves_[pos];
386
+ }
387
+
388
+ private:
389
+ LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
390
+ HBasicBlock* block_;
391
+ };
392
+
393
+
394
+ class LInstructionGap: public LGap {
395
+ public:
396
+ explicit LInstructionGap(HBasicBlock* block) : LGap(block) { }
397
+
398
+ DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap")
399
+ };
400
+
401
+
402
+ class LGoto: public LTemplateInstruction<0, 0, 0> {
403
+ public:
404
+ LGoto(int block_id, bool include_stack_check = false)
405
+ : block_id_(block_id), include_stack_check_(include_stack_check) { }
406
+
407
+ DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
408
+ virtual void PrintDataTo(StringStream* stream);
409
+ virtual bool IsControl() const { return true; }
410
+
411
+ int block_id() const { return block_id_; }
412
+ bool include_stack_check() const { return include_stack_check_; }
413
+
414
+ private:
415
+ int block_id_;
416
+ bool include_stack_check_;
417
+ };
418
+
419
+
420
+ class LLazyBailout: public LTemplateInstruction<0, 0, 0> {
421
+ public:
422
+ LLazyBailout() : gap_instructions_size_(0) { }
423
+
424
+ DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout")
425
+
426
+ void set_gap_instructions_size(int gap_instructions_size) {
427
+ gap_instructions_size_ = gap_instructions_size;
428
+ }
429
+ int gap_instructions_size() { return gap_instructions_size_; }
430
+
431
+ private:
432
+ int gap_instructions_size_;
433
+ };
434
+
435
+
436
+ class LDeoptimize: public LTemplateInstruction<0, 0, 0> {
437
+ public:
438
+ DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
439
+ };
440
+
441
+
442
+ class LLabel: public LGap {
443
+ public:
444
+ explicit LLabel(HBasicBlock* block)
445
+ : LGap(block), replacement_(NULL) { }
446
+
447
+ DECLARE_CONCRETE_INSTRUCTION(Label, "label")
448
+
449
+ virtual void PrintDataTo(StringStream* stream);
450
+
451
+ int block_id() const { return block()->block_id(); }
452
+ bool is_loop_header() const { return block()->IsLoopHeader(); }
453
+ Label* label() { return &label_; }
454
+ LLabel* replacement() const { return replacement_; }
455
+ void set_replacement(LLabel* label) { replacement_ = label; }
456
+ bool HasReplacement() const { return replacement_ != NULL; }
457
+
458
+ private:
459
+ Label label_;
460
+ LLabel* replacement_;
461
+ };
462
+
463
+
464
+ class LParameter: public LTemplateInstruction<1, 0, 0> {
465
+ public:
466
+ DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
467
+ };
468
+
469
+
470
+ class LCallStub: public LTemplateInstruction<1, 0, 0> {
471
+ public:
472
+ DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
473
+ DECLARE_HYDROGEN_ACCESSOR(CallStub)
474
+
475
+ TranscendentalCache::Type transcendental_type() {
476
+ return hydrogen()->transcendental_type();
477
+ }
478
+ };
479
+
480
+
481
+ class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> {
482
+ public:
483
+ DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
484
+ };
485
+
486
+
487
+ template<int I, int T>
488
+ class LControlInstruction: public LTemplateInstruction<0, I, T> {
489
+ public:
490
+ virtual bool IsControl() const { return true; }
491
+
492
+ int true_block_id() const { return true_block_id_; }
493
+ int false_block_id() const { return false_block_id_; }
494
+ void SetBranchTargets(int true_block_id, int false_block_id) {
495
+ true_block_id_ = true_block_id;
496
+ false_block_id_ = false_block_id;
497
+ }
498
+
499
+ private:
500
+ int true_block_id_;
501
+ int false_block_id_;
502
+ };
503
+
504
+
505
+ class LApplyArguments: public LTemplateInstruction<1, 4, 0> {
506
+ public:
507
+ LApplyArguments(LOperand* function,
508
+ LOperand* receiver,
509
+ LOperand* length,
510
+ LOperand* elements) {
511
+ inputs_[0] = function;
512
+ inputs_[1] = receiver;
513
+ inputs_[2] = length;
514
+ inputs_[3] = elements;
515
+ }
516
+
517
+ DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
518
+
519
+ LOperand* function() { return inputs_[0]; }
520
+ LOperand* receiver() { return inputs_[1]; }
521
+ LOperand* length() { return inputs_[2]; }
522
+ LOperand* elements() { return inputs_[3]; }
523
+ };
524
+
525
+
526
+ class LAccessArgumentsAt: public LTemplateInstruction<1, 3, 0> {
527
+ public:
528
+ LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) {
529
+ inputs_[0] = arguments;
530
+ inputs_[1] = length;
531
+ inputs_[2] = index;
532
+ }
533
+
534
+ DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
535
+
536
+ LOperand* arguments() { return inputs_[0]; }
537
+ LOperand* length() { return inputs_[1]; }
538
+ LOperand* index() { return inputs_[2]; }
539
+
540
+ virtual void PrintDataTo(StringStream* stream);
541
+ };
542
+
543
+
544
+ class LArgumentsLength: public LTemplateInstruction<1, 1, 0> {
545
+ public:
546
+ explicit LArgumentsLength(LOperand* elements) {
547
+ inputs_[0] = elements;
548
+ }
549
+
550
+ DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
551
+ };
552
+
553
+
554
+ class LArgumentsElements: public LTemplateInstruction<1, 0, 0> {
555
+ public:
556
+ LArgumentsElements() { }
557
+
558
+ DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
559
+ };
560
+
561
+
562
+ class LModI: public LTemplateInstruction<1, 2, 3> {
563
+ public:
564
+ // Used when the right hand is a constant power of 2.
565
+ LModI(LOperand* left,
566
+ LOperand* right) {
567
+ inputs_[0] = left;
568
+ inputs_[1] = right;
569
+ temps_[0] = NULL;
570
+ temps_[1] = NULL;
571
+ temps_[2] = NULL;
572
+ }
573
+
574
+ // Used for the standard case.
575
+ LModI(LOperand* left,
576
+ LOperand* right,
577
+ LOperand* temp1,
578
+ LOperand* temp2,
579
+ LOperand* temp3) {
580
+ inputs_[0] = left;
581
+ inputs_[1] = right;
582
+ temps_[0] = temp1;
583
+ temps_[1] = temp2;
584
+ temps_[2] = temp3;
585
+ }
586
+
587
+ DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
588
+ DECLARE_HYDROGEN_ACCESSOR(Mod)
589
+ };
590
+
591
+
592
+ class LDivI: public LTemplateInstruction<1, 2, 0> {
593
+ public:
594
+ LDivI(LOperand* left, LOperand* right) {
595
+ inputs_[0] = left;
596
+ inputs_[1] = right;
597
+ }
598
+
599
+ DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
600
+ DECLARE_HYDROGEN_ACCESSOR(Div)
601
+ };
602
+
603
+
604
+ class LMulI: public LTemplateInstruction<1, 2, 1> {
605
+ public:
606
+ LMulI(LOperand* left, LOperand* right, LOperand* temp) {
607
+ inputs_[0] = left;
608
+ inputs_[1] = right;
609
+ temps_[0] = temp;
610
+ }
611
+
612
+ DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
613
+ DECLARE_HYDROGEN_ACCESSOR(Mul)
614
+ };
615
+
616
+
617
+ class LCmpID: public LTemplateInstruction<1, 2, 0> {
618
+ public:
619
+ LCmpID(LOperand* left, LOperand* right) {
620
+ inputs_[0] = left;
621
+ inputs_[1] = right;
622
+ }
623
+
624
+ DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id")
625
+ DECLARE_HYDROGEN_ACCESSOR(Compare)
626
+
627
+ Token::Value op() const { return hydrogen()->token(); }
628
+ bool is_double() const {
629
+ return hydrogen()->GetInputRepresentation().IsDouble();
630
+ }
631
+ };
632
+
633
+
634
+ class LCmpIDAndBranch: public LControlInstruction<2, 0> {
635
+ public:
636
+ LCmpIDAndBranch(LOperand* left, LOperand* right) {
637
+ inputs_[0] = left;
638
+ inputs_[1] = right;
639
+ }
640
+
641
+ DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
642
+ DECLARE_HYDROGEN_ACCESSOR(Compare)
643
+
644
+ Token::Value op() const { return hydrogen()->token(); }
645
+ bool is_double() const {
646
+ return hydrogen()->GetInputRepresentation().IsDouble();
647
+ }
648
+
649
+ virtual void PrintDataTo(StringStream* stream);
650
+ };
651
+
652
+
653
+ class LUnaryMathOperation: public LTemplateInstruction<1, 1, 1> {
654
+ public:
655
+ LUnaryMathOperation(LOperand* value, LOperand* temp) {
656
+ inputs_[0] = value;
657
+ temps_[0] = temp;
658
+ }
659
+
660
+ DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation")
661
+ DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
662
+
663
+ virtual void PrintDataTo(StringStream* stream);
664
+ BuiltinFunctionId op() const { return hydrogen()->op(); }
665
+ };
666
+
667
+
668
+ class LCmpJSObjectEq: public LTemplateInstruction<1, 2, 0> {
669
+ public:
670
+ LCmpJSObjectEq(LOperand* left, LOperand* right) {
671
+ inputs_[0] = left;
672
+ inputs_[1] = right;
673
+ }
674
+
675
+ DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq")
676
+ };
677
+
678
+
679
+ class LCmpJSObjectEqAndBranch: public LControlInstruction<2, 0> {
680
+ public:
681
+ LCmpJSObjectEqAndBranch(LOperand* left, LOperand* right) {
682
+ inputs_[0] = left;
683
+ inputs_[1] = right;
684
+ }
685
+
686
+ DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch,
687
+ "cmp-jsobject-eq-and-branch")
688
+ };
689
+
690
+
691
+ class LCmpSymbolEq: public LTemplateInstruction<1, 2, 0> {
692
+ public:
693
+ LCmpSymbolEq(LOperand* left, LOperand* right) {
694
+ inputs_[0] = left;
695
+ inputs_[1] = right;
696
+ }
697
+
698
+ DECLARE_CONCRETE_INSTRUCTION(CmpSymbolEq, "cmp-symbol-eq")
699
+ };
700
+
701
+
702
+ class LCmpSymbolEqAndBranch: public LControlInstruction<2, 0> {
703
+ public:
704
+ LCmpSymbolEqAndBranch(LOperand* left, LOperand* right) {
705
+ inputs_[0] = left;
706
+ inputs_[1] = right;
707
+ }
708
+
709
+ DECLARE_CONCRETE_INSTRUCTION(CmpSymbolEqAndBranch, "cmp-symbol-eq-and-branch")
710
+ };
711
+
712
+
713
+ class LIsNull: public LTemplateInstruction<1, 1, 0> {
714
+ public:
715
+ explicit LIsNull(LOperand* value) {
716
+ inputs_[0] = value;
717
+ }
718
+
719
+ DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null")
720
+ DECLARE_HYDROGEN_ACCESSOR(IsNull)
721
+
722
+ bool is_strict() const { return hydrogen()->is_strict(); }
723
+ };
724
+
725
+ class LIsNullAndBranch: public LControlInstruction<1, 0> {
726
+ public:
727
+ explicit LIsNullAndBranch(LOperand* value) {
728
+ inputs_[0] = value;
729
+ }
730
+
731
+ DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch")
732
+ DECLARE_HYDROGEN_ACCESSOR(IsNull)
733
+
734
+ bool is_strict() const { return hydrogen()->is_strict(); }
735
+
736
+ virtual void PrintDataTo(StringStream* stream);
737
+ };
738
+
739
+
740
+ class LIsObject: public LTemplateInstruction<1, 1, 1> {
741
+ public:
742
+ explicit LIsObject(LOperand* value) {
743
+ inputs_[0] = value;
744
+ }
745
+
746
+ DECLARE_CONCRETE_INSTRUCTION(IsObject, "is-object")
747
+ };
748
+
749
+
750
+ class LIsObjectAndBranch: public LControlInstruction<1, 2> {
751
+ public:
752
+ LIsObjectAndBranch(LOperand* value, LOperand* temp) {
753
+ inputs_[0] = value;
754
+ temps_[0] = temp;
755
+ }
756
+
757
+ DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
758
+
759
+ virtual void PrintDataTo(StringStream* stream);
760
+ };
761
+
762
+
763
+ class LIsSmi: public LTemplateInstruction<1, 1, 0> {
764
+ public:
765
+ explicit LIsSmi(LOperand* value) {
766
+ inputs_[0] = value;
767
+ }
768
+
769
+ DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi")
770
+ DECLARE_HYDROGEN_ACCESSOR(IsSmi)
771
+ };
772
+
773
+
774
+ class LIsSmiAndBranch: public LControlInstruction<1, 0> {
775
+ public:
776
+ explicit LIsSmiAndBranch(LOperand* value) {
777
+ inputs_[0] = value;
778
+ }
779
+
780
+ DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
781
+
782
+ virtual void PrintDataTo(StringStream* stream);
783
+ };
784
+
785
+
786
+ class LIsUndetectable: public LTemplateInstruction<1, 1, 0> {
787
+ public:
788
+ explicit LIsUndetectable(LOperand* value) {
789
+ inputs_[0] = value;
790
+ }
791
+
792
+ DECLARE_CONCRETE_INSTRUCTION(IsUndetectable, "is-undetectable")
793
+ DECLARE_HYDROGEN_ACCESSOR(IsUndetectable)
794
+ };
795
+
796
+
797
+ class LIsUndetectableAndBranch: public LControlInstruction<1, 1> {
798
+ public:
799
+ explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
800
+ inputs_[0] = value;
801
+ temps_[0] = temp;
802
+ }
803
+
804
+ DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
805
+ "is-undetectable-and-branch")
806
+
807
+ virtual void PrintDataTo(StringStream* stream);
808
+ };
809
+
810
+
811
+ class LHasInstanceType: public LTemplateInstruction<1, 1, 0> {
812
+ public:
813
+ explicit LHasInstanceType(LOperand* value) {
814
+ inputs_[0] = value;
815
+ }
816
+
817
+ DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type")
818
+ DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
819
+ };
820
+
821
+
822
+ class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> {
823
+ public:
824
+ explicit LHasInstanceTypeAndBranch(LOperand* value) {
825
+ inputs_[0] = value;
826
+ }
827
+
828
+ DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
829
+ "has-instance-type-and-branch")
830
+ DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
831
+
832
+ virtual void PrintDataTo(StringStream* stream);
833
+ };
834
+
835
+
836
+ class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
837
+ public:
838
+ explicit LGetCachedArrayIndex(LOperand* value) {
839
+ inputs_[0] = value;
840
+ }
841
+
842
+ DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
843
+ DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
844
+ };
845
+
846
+
847
+ class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
848
+ public:
849
+ explicit LHasCachedArrayIndex(LOperand* value) {
850
+ inputs_[0] = value;
851
+ }
852
+
853
+ DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index")
854
+ DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex)
855
+ };
856
+
857
+
858
+ class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> {
859
+ public:
860
+ explicit LHasCachedArrayIndexAndBranch(LOperand* value) {
861
+ inputs_[0] = value;
862
+ }
863
+
864
+ DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
865
+ "has-cached-array-index-and-branch")
866
+ virtual void PrintDataTo(StringStream* stream);
867
+ };
868
+
869
+
870
+ class LClassOfTest: public LTemplateInstruction<1, 1, 0> {
871
+ public:
872
+ explicit LClassOfTest(LOperand* value) {
873
+ inputs_[0] = value;
874
+ }
875
+
876
+ DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test")
877
+ DECLARE_HYDROGEN_ACCESSOR(ClassOfTest)
878
+
879
+ virtual void PrintDataTo(StringStream* stream);
880
+ };
881
+
882
+
883
+ class LClassOfTestAndBranch: public LControlInstruction<1, 1> {
884
+ public:
885
+ LClassOfTestAndBranch(LOperand* value, LOperand* temp) {
886
+ inputs_[0] = value;
887
+ temps_[0] = temp;
888
+ }
889
+
890
+ DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
891
+ "class-of-test-and-branch")
892
+ DECLARE_HYDROGEN_ACCESSOR(ClassOfTest)
893
+
894
+ virtual void PrintDataTo(StringStream* stream);
895
+ };
896
+
897
+
898
+ class LCmpT: public LTemplateInstruction<1, 2, 0> {
899
+ public:
900
+ LCmpT(LOperand* left, LOperand* right) {
901
+ inputs_[0] = left;
902
+ inputs_[1] = right;
903
+ }
904
+
905
+ DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
906
+ DECLARE_HYDROGEN_ACCESSOR(Compare)
907
+
908
+ Token::Value op() const { return hydrogen()->token(); }
909
+ };
910
+
911
+
912
+ class LCmpTAndBranch: public LControlInstruction<2, 0> {
913
+ public:
914
+ LCmpTAndBranch(LOperand* left, LOperand* right) {
915
+ inputs_[0] = left;
916
+ inputs_[1] = right;
917
+ }
918
+
919
+ DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch")
920
+ DECLARE_HYDROGEN_ACCESSOR(Compare)
921
+
922
+ Token::Value op() const { return hydrogen()->token(); }
923
+ };
924
+
925
+
926
+ class LInstanceOf: public LTemplateInstruction<1, 2, 0> {
927
+ public:
928
+ LInstanceOf(LOperand* left, LOperand* right) {
929
+ inputs_[0] = left;
930
+ inputs_[1] = right;
931
+ }
932
+
933
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
934
+ };
935
+
936
+
937
+ class LInstanceOfAndBranch: public LControlInstruction<2, 0> {
938
+ public:
939
+ LInstanceOfAndBranch(LOperand* left, LOperand* right) {
940
+ inputs_[0] = left;
941
+ inputs_[1] = right;
942
+ }
943
+
944
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch")
945
+ };
946
+
947
+
948
+ class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> {
949
+ public:
950
+ LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) {
951
+ inputs_[0] = value;
952
+ temps_[0] = temp;
953
+ }
954
+
955
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
956
+ "instance-of-known-global")
957
+ DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
958
+
959
+ Handle<JSFunction> function() const { return hydrogen()->function(); }
960
+ };
961
+
962
+
963
+ class LBoundsCheck: public LTemplateInstruction<0, 2, 0> {
964
+ public:
965
+ LBoundsCheck(LOperand* index, LOperand* length) {
966
+ inputs_[0] = index;
967
+ inputs_[1] = length;
968
+ }
969
+
970
+ LOperand* index() { return inputs_[0]; }
971
+ LOperand* length() { return inputs_[1]; }
972
+
973
+ DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
974
+ };
975
+
976
+
977
+ class LBitI: public LTemplateInstruction<1, 2, 0> {
978
+ public:
979
+ LBitI(Token::Value op, LOperand* left, LOperand* right)
980
+ : op_(op) {
981
+ inputs_[0] = left;
982
+ inputs_[1] = right;
983
+ }
984
+
985
+ Token::Value op() const { return op_; }
986
+
987
+ DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
988
+
989
+ private:
990
+ Token::Value op_;
991
+ };
992
+
993
+
994
+ class LShiftI: public LTemplateInstruction<1, 2, 0> {
995
+ public:
996
+ LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
997
+ : op_(op), can_deopt_(can_deopt) {
998
+ inputs_[0] = left;
999
+ inputs_[1] = right;
1000
+ }
1001
+
1002
+ Token::Value op() const { return op_; }
1003
+
1004
+ bool can_deopt() const { return can_deopt_; }
1005
+
1006
+ DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
1007
+
1008
+ private:
1009
+ Token::Value op_;
1010
+ bool can_deopt_;
1011
+ };
1012
+
1013
+
1014
+ class LSubI: public LTemplateInstruction<1, 2, 0> {
1015
+ public:
1016
+ LSubI(LOperand* left, LOperand* right) {
1017
+ inputs_[0] = left;
1018
+ inputs_[1] = right;
1019
+ }
1020
+
1021
+ DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
1022
+ DECLARE_HYDROGEN_ACCESSOR(Sub)
1023
+ };
1024
+
1025
+
1026
+ class LConstantI: public LTemplateInstruction<1, 0, 0> {
1027
+ public:
1028
+ DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
1029
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
1030
+
1031
+ int32_t value() const { return hydrogen()->Integer32Value(); }
1032
+ };
1033
+
1034
+
1035
+ class LConstantD: public LTemplateInstruction<1, 0, 0> {
1036
+ public:
1037
+ DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
1038
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
1039
+
1040
+ double value() const { return hydrogen()->DoubleValue(); }
1041
+ };
1042
+
1043
+
1044
+ class LConstantT: public LTemplateInstruction<1, 0, 0> {
1045
+ public:
1046
+ DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
1047
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
1048
+
1049
+ Handle<Object> value() const { return hydrogen()->handle(); }
1050
+ };
1051
+
1052
+
1053
+ class LBranch: public LControlInstruction<1, 0> {
1054
+ public:
1055
+ explicit LBranch(LOperand* value) {
1056
+ inputs_[0] = value;
1057
+ }
1058
+
1059
+ DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
1060
+ DECLARE_HYDROGEN_ACCESSOR(Value)
1061
+
1062
+ virtual void PrintDataTo(StringStream* stream);
1063
+ };
1064
+
1065
+
1066
+ class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 1> {
1067
+ public:
1068
+ LCmpMapAndBranch(LOperand* value, LOperand* temp) {
1069
+ inputs_[0] = value;
1070
+ temps_[0] = temp;
1071
+ }
1072
+
1073
+ DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1074
+ DECLARE_HYDROGEN_ACCESSOR(CompareMap)
1075
+
1076
+ virtual bool IsControl() const { return true; }
1077
+
1078
+ Handle<Map> map() const { return hydrogen()->map(); }
1079
+ int true_block_id() const {
1080
+ return hydrogen()->FirstSuccessor()->block_id();
1081
+ }
1082
+ int false_block_id() const {
1083
+ return hydrogen()->SecondSuccessor()->block_id();
1084
+ }
1085
+ };
1086
+
1087
+
1088
+ class LJSArrayLength: public LTemplateInstruction<1, 1, 0> {
1089
+ public:
1090
+ explicit LJSArrayLength(LOperand* value) {
1091
+ inputs_[0] = value;
1092
+ }
1093
+
1094
+ DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length")
1095
+ DECLARE_HYDROGEN_ACCESSOR(JSArrayLength)
1096
+ };
1097
+
1098
+
1099
+ class LExternalArrayLength: public LTemplateInstruction<1, 1, 0> {
1100
+ public:
1101
+ explicit LExternalArrayLength(LOperand* value) {
1102
+ inputs_[0] = value;
1103
+ }
1104
+
1105
+ DECLARE_CONCRETE_INSTRUCTION(ExternalArrayLength, "external-array-length")
1106
+ DECLARE_HYDROGEN_ACCESSOR(ExternalArrayLength)
1107
+ };
1108
+
1109
+
1110
+ class LFixedArrayLength: public LTemplateInstruction<1, 1, 0> {
1111
+ public:
1112
+ explicit LFixedArrayLength(LOperand* value) {
1113
+ inputs_[0] = value;
1114
+ }
1115
+
1116
+ DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length")
1117
+ DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength)
1118
+ };
1119
+
1120
+
1121
+ class LValueOf: public LTemplateInstruction<1, 1, 1> {
1122
+ public:
1123
+ LValueOf(LOperand* value, LOperand* temp) {
1124
+ inputs_[0] = value;
1125
+ temps_[0] = temp;
1126
+ }
1127
+
1128
+ DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
1129
+ DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1130
+ };
1131
+
1132
+
1133
+ class LThrow: public LTemplateInstruction<0, 1, 0> {
1134
+ public:
1135
+ explicit LThrow(LOperand* value) {
1136
+ inputs_[0] = value;
1137
+ }
1138
+
1139
+ DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
1140
+ };
1141
+
1142
+
1143
+ class LBitNotI: public LTemplateInstruction<1, 1, 0> {
1144
+ public:
1145
+ explicit LBitNotI(LOperand* value) {
1146
+ inputs_[0] = value;
1147
+ }
1148
+
1149
+ DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i")
1150
+ };
1151
+
1152
+
1153
+ class LAddI: public LTemplateInstruction<1, 2, 0> {
1154
+ public:
1155
+ LAddI(LOperand* left, LOperand* right) {
1156
+ inputs_[0] = left;
1157
+ inputs_[1] = right;
1158
+ }
1159
+
1160
+ DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
1161
+ DECLARE_HYDROGEN_ACCESSOR(Add)
1162
+ };
1163
+
1164
+
1165
+ class LPower: public LTemplateInstruction<1, 2, 0> {
1166
+ public:
1167
+ LPower(LOperand* left, LOperand* right) {
1168
+ inputs_[0] = left;
1169
+ inputs_[1] = right;
1170
+ }
1171
+
1172
+ DECLARE_CONCRETE_INSTRUCTION(Power, "power")
1173
+ DECLARE_HYDROGEN_ACCESSOR(Power)
1174
+ };
1175
+
1176
+
1177
+ class LArithmeticD: public LTemplateInstruction<1, 2, 0> {
1178
+ public:
1179
+ LArithmeticD(Token::Value op, LOperand* left, LOperand* right)
1180
+ : op_(op) {
1181
+ inputs_[0] = left;
1182
+ inputs_[1] = right;
1183
+ }
1184
+
1185
+ Token::Value op() const { return op_; }
1186
+
1187
+ virtual Opcode opcode() const { return LInstruction::kArithmeticD; }
1188
+ virtual void CompileToNative(LCodeGen* generator);
1189
+ virtual const char* Mnemonic() const;
1190
+
1191
+ private:
1192
+ Token::Value op_;
1193
+ };
1194
+
1195
+
1196
+ class LArithmeticT: public LTemplateInstruction<1, 2, 0> {
1197
+ public:
1198
+ LArithmeticT(Token::Value op, LOperand* left, LOperand* right)
1199
+ : op_(op) {
1200
+ inputs_[0] = left;
1201
+ inputs_[1] = right;
1202
+ }
1203
+
1204
+ virtual Opcode opcode() const { return LInstruction::kArithmeticT; }
1205
+ virtual void CompileToNative(LCodeGen* generator);
1206
+ virtual const char* Mnemonic() const;
1207
+
1208
+ Token::Value op() const { return op_; }
1209
+
1210
+ private:
1211
+ Token::Value op_;
1212
+ };
1213
+
1214
+
1215
+ class LReturn: public LTemplateInstruction<0, 1, 0> {
1216
+ public:
1217
+ explicit LReturn(LOperand* value) {
1218
+ inputs_[0] = value;
1219
+ }
1220
+
1221
+ DECLARE_CONCRETE_INSTRUCTION(Return, "return")
1222
+ };
1223
+
1224
+
1225
+ class LLoadNamedField: public LTemplateInstruction<1, 1, 0> {
1226
+ public:
1227
+ explicit LLoadNamedField(LOperand* object) {
1228
+ inputs_[0] = object;
1229
+ }
1230
+
1231
+ DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
1232
+ DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
1233
+ };
1234
+
1235
+
1236
+ class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 1, 0> {
1237
+ public:
1238
+ explicit LLoadNamedFieldPolymorphic(LOperand* object) {
1239
+ inputs_[0] = object;
1240
+ }
1241
+
1242
+ DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field-polymorphic")
1243
+ DECLARE_HYDROGEN_ACCESSOR(LoadNamedFieldPolymorphic)
1244
+
1245
+ LOperand* object() { return inputs_[0]; }
1246
+ };
1247
+
1248
+
1249
+ class LLoadNamedGeneric: public LTemplateInstruction<1, 1, 0> {
1250
+ public:
1251
+ explicit LLoadNamedGeneric(LOperand* object) {
1252
+ inputs_[0] = object;
1253
+ }
1254
+
1255
+ DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
1256
+ DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
1257
+
1258
+ LOperand* object() { return inputs_[0]; }
1259
+ Handle<Object> name() const { return hydrogen()->name(); }
1260
+ };
1261
+
1262
+
1263
+ class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 0> {
1264
+ public:
1265
+ explicit LLoadFunctionPrototype(LOperand* function) {
1266
+ inputs_[0] = function;
1267
+ }
1268
+
1269
+ DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
1270
+ DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
1271
+
1272
+ LOperand* function() { return inputs_[0]; }
1273
+ };
1274
+
1275
+
1276
+ class LLoadElements: public LTemplateInstruction<1, 1, 0> {
1277
+ public:
1278
+ explicit LLoadElements(LOperand* object) {
1279
+ inputs_[0] = object;
1280
+ }
1281
+
1282
+ DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
1283
+ };
1284
+
1285
+
1286
+ class LLoadExternalArrayPointer: public LTemplateInstruction<1, 1, 0> {
1287
+ public:
1288
+ explicit LLoadExternalArrayPointer(LOperand* object) {
1289
+ inputs_[0] = object;
1290
+ }
1291
+
1292
+ DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer,
1293
+ "load-external-array-pointer")
1294
+ };
1295
+
1296
+
1297
+ class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> {
1298
+ public:
1299
+ LLoadKeyedFastElement(LOperand* elements, LOperand* key) {
1300
+ inputs_[0] = elements;
1301
+ inputs_[1] = key;
1302
+ }
1303
+
1304
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element")
1305
+ DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement)
1306
+
1307
+ LOperand* elements() { return inputs_[0]; }
1308
+ LOperand* key() { return inputs_[1]; }
1309
+ };
1310
+
1311
+
1312
+ class LLoadKeyedSpecializedArrayElement: public LTemplateInstruction<1, 2, 0> {
1313
+ public:
1314
+ LLoadKeyedSpecializedArrayElement(LOperand* external_pointer,
1315
+ LOperand* key) {
1316
+ inputs_[0] = external_pointer;
1317
+ inputs_[1] = key;
1318
+ }
1319
+
1320
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement,
1321
+ "load-keyed-specialized-array-element")
1322
+ DECLARE_HYDROGEN_ACCESSOR(LoadKeyedSpecializedArrayElement)
1323
+
1324
+ LOperand* external_pointer() { return inputs_[0]; }
1325
+ LOperand* key() { return inputs_[1]; }
1326
+ ExternalArrayType array_type() const {
1327
+ return hydrogen()->array_type();
1328
+ }
1329
+ };
1330
+
1331
+
1332
+ class LLoadKeyedGeneric: public LTemplateInstruction<1, 2, 0> {
1333
+ public:
1334
+ LLoadKeyedGeneric(LOperand* obj, LOperand* key) {
1335
+ inputs_[0] = obj;
1336
+ inputs_[1] = key;
1337
+ }
1338
+
1339
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
1340
+
1341
+ LOperand* object() { return inputs_[0]; }
1342
+ LOperand* key() { return inputs_[1]; }
1343
+ };
1344
+
1345
+
1346
+ class LLoadGlobalCell: public LTemplateInstruction<1, 0, 0> {
1347
+ public:
1348
+ DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell")
1349
+ DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell)
1350
+ };
1351
+
1352
+
1353
+ class LLoadGlobalGeneric: public LTemplateInstruction<1, 1, 0> {
1354
+ public:
1355
+ explicit LLoadGlobalGeneric(LOperand* global_object) {
1356
+ inputs_[0] = global_object;
1357
+ }
1358
+
1359
+ DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
1360
+ DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
1361
+
1362
+ LOperand* global_object() { return inputs_[0]; }
1363
+ Handle<Object> name() const { return hydrogen()->name(); }
1364
+ bool for_typeof() const { return hydrogen()->for_typeof(); }
1365
+ };
1366
+
1367
+
1368
+ class LStoreGlobalCell: public LTemplateInstruction<0, 1, 1> {
1369
+ public:
1370
+ LStoreGlobalCell(LOperand* value, LOperand* temp) {
1371
+ inputs_[0] = value;
1372
+ temps_[0] = temp;
1373
+ }
1374
+
1375
+ DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell")
1376
+ DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell)
1377
+ };
1378
+
1379
+
1380
+ class LStoreGlobalGeneric: public LTemplateInstruction<0, 2, 0> {
1381
+ public:
1382
+ explicit LStoreGlobalGeneric(LOperand* global_object,
1383
+ LOperand* value) {
1384
+ inputs_[0] = global_object;
1385
+ inputs_[1] = value;
1386
+ }
1387
+
1388
+ DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic")
1389
+ DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric)
1390
+
1391
+ LOperand* global_object() { return InputAt(0); }
1392
+ Handle<Object> name() const { return hydrogen()->name(); }
1393
+ LOperand* value() { return InputAt(1); }
1394
+ bool strict_mode() { return hydrogen()->strict_mode(); }
1395
+ };
1396
+
1397
+
1398
+ class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> {
1399
+ public:
1400
+ explicit LLoadContextSlot(LOperand* context) {
1401
+ inputs_[0] = context;
1402
+ }
1403
+
1404
+ DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
1405
+ DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
1406
+
1407
+ LOperand* context() { return InputAt(0); }
1408
+ int slot_index() { return hydrogen()->slot_index(); }
1409
+
1410
+ virtual void PrintDataTo(StringStream* stream);
1411
+ };
1412
+
1413
+
1414
+ class LStoreContextSlot: public LTemplateInstruction<0, 2, 0> {
1415
+ public:
1416
+ LStoreContextSlot(LOperand* context, LOperand* value) {
1417
+ inputs_[0] = context;
1418
+ inputs_[1] = value;
1419
+ }
1420
+
1421
+ DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
1422
+ DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
1423
+
1424
+ LOperand* context() { return InputAt(0); }
1425
+ LOperand* value() { return InputAt(1); }
1426
+ int slot_index() { return hydrogen()->slot_index(); }
1427
+ int needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
1428
+
1429
+ virtual void PrintDataTo(StringStream* stream);
1430
+ };
1431
+
1432
+
1433
+ class LPushArgument: public LTemplateInstruction<0, 1, 0> {
1434
+ public:
1435
+ explicit LPushArgument(LOperand* value) {
1436
+ inputs_[0] = value;
1437
+ }
1438
+
1439
+ DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
1440
+ };
1441
+
1442
+
1443
+ class LContext: public LTemplateInstruction<1, 0, 0> {
1444
+ public:
1445
+ DECLARE_CONCRETE_INSTRUCTION(Context, "context")
1446
+ };
1447
+
1448
+
1449
+ class LOuterContext: public LTemplateInstruction<1, 1, 0> {
1450
+ public:
1451
+ explicit LOuterContext(LOperand* context) {
1452
+ inputs_[0] = context;
1453
+ }
1454
+
1455
+ DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
1456
+
1457
+ LOperand* context() { return InputAt(0); }
1458
+ };
1459
+
1460
+
1461
+ class LGlobalObject: public LTemplateInstruction<1, 1, 0> {
1462
+ public:
1463
+ explicit LGlobalObject(LOperand* context) {
1464
+ inputs_[0] = context;
1465
+ }
1466
+
1467
+ DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
1468
+
1469
+ LOperand* context() { return InputAt(0); }
1470
+ };
1471
+
1472
+
1473
+ class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> {
1474
+ public:
1475
+ explicit LGlobalReceiver(LOperand* global_object) {
1476
+ inputs_[0] = global_object;
1477
+ }
1478
+
1479
+ DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
1480
+
1481
+ LOperand* global() { return InputAt(0); }
1482
+ };
1483
+
1484
+
1485
+ class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> {
1486
+ public:
1487
+ DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function")
1488
+ DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction)
1489
+
1490
+ virtual void PrintDataTo(StringStream* stream);
1491
+
1492
+ Handle<JSFunction> function() { return hydrogen()->function(); }
1493
+ int arity() const { return hydrogen()->argument_count() - 1; }
1494
+ };
1495
+
1496
+
1497
+ class LInvokeFunction: public LTemplateInstruction<1, 1, 0> {
1498
+ public:
1499
+ explicit LInvokeFunction(LOperand* function) {
1500
+ inputs_[0] = function;
1501
+ }
1502
+
1503
+ DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1504
+ DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1505
+
1506
+ LOperand* function() { return inputs_[0]; }
1507
+
1508
+ virtual void PrintDataTo(StringStream* stream);
1509
+
1510
+ int arity() const { return hydrogen()->argument_count() - 1; }
1511
+ };
1512
+
1513
+
1514
+ class LCallKeyed: public LTemplateInstruction<1, 1, 0> {
1515
+ public:
1516
+ explicit LCallKeyed(LOperand* key) {
1517
+ inputs_[0] = key;
1518
+ }
1519
+
1520
+ DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
1521
+ DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
1522
+
1523
+ virtual void PrintDataTo(StringStream* stream);
1524
+
1525
+ int arity() const { return hydrogen()->argument_count() - 1; }
1526
+ };
1527
+
1528
+
1529
+
1530
+ class LCallNamed: public LTemplateInstruction<1, 0, 0> {
1531
+ public:
1532
+ DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
1533
+ DECLARE_HYDROGEN_ACCESSOR(CallNamed)
1534
+
1535
+ virtual void PrintDataTo(StringStream* stream);
1536
+
1537
+ Handle<String> name() const { return hydrogen()->name(); }
1538
+ int arity() const { return hydrogen()->argument_count() - 1; }
1539
+ };
1540
+
1541
+
1542
+ class LCallFunction: public LTemplateInstruction<1, 0, 0> {
1543
+ public:
1544
+ DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
1545
+ DECLARE_HYDROGEN_ACCESSOR(CallFunction)
1546
+
1547
+ int arity() const { return hydrogen()->argument_count() - 2; }
1548
+ };
1549
+
1550
+
1551
+ class LCallGlobal: public LTemplateInstruction<1, 0, 0> {
1552
+ public:
1553
+ DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
1554
+ DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
1555
+
1556
+ virtual void PrintDataTo(StringStream* stream);
1557
+
1558
+ Handle<String> name() const {return hydrogen()->name(); }
1559
+ int arity() const { return hydrogen()->argument_count() - 1; }
1560
+ };
1561
+
1562
+
1563
+ class LCallKnownGlobal: public LTemplateInstruction<1, 0, 0> {
1564
+ public:
1565
+ DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
1566
+ DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal)
1567
+
1568
+ virtual void PrintDataTo(StringStream* stream);
1569
+
1570
+ Handle<JSFunction> target() const { return hydrogen()->target(); }
1571
+ int arity() const { return hydrogen()->argument_count() - 1; }
1572
+ };
1573
+
1574
+
1575
+ class LCallNew: public LTemplateInstruction<1, 1, 0> {
1576
+ public:
1577
+ explicit LCallNew(LOperand* constructor) {
1578
+ inputs_[0] = constructor;
1579
+ }
1580
+
1581
+ DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
1582
+ DECLARE_HYDROGEN_ACCESSOR(CallNew)
1583
+
1584
+ virtual void PrintDataTo(StringStream* stream);
1585
+
1586
+ int arity() const { return hydrogen()->argument_count() - 1; }
1587
+ };
1588
+
1589
+
1590
+ class LCallRuntime: public LTemplateInstruction<1, 0, 0> {
1591
+ public:
1592
+ DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
1593
+ DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
1594
+
1595
+ const Runtime::Function* function() const { return hydrogen()->function(); }
1596
+ int arity() const { return hydrogen()->argument_count(); }
1597
+ };
1598
+
1599
+
1600
+ class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> {
1601
+ public:
1602
+ explicit LInteger32ToDouble(LOperand* value) {
1603
+ inputs_[0] = value;
1604
+ }
1605
+
1606
+ DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
1607
+ };
1608
+
1609
+
1610
+ class LNumberTagI: public LTemplateInstruction<1, 1, 0> {
1611
+ public:
1612
+ explicit LNumberTagI(LOperand* value) {
1613
+ inputs_[0] = value;
1614
+ }
1615
+
1616
+ DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
1617
+ };
1618
+
1619
+
1620
+ class LNumberTagD: public LTemplateInstruction<1, 1, 2> {
1621
+ public:
1622
+ LNumberTagD(LOperand* value, LOperand* temp1, LOperand* temp2) {
1623
+ inputs_[0] = value;
1624
+ temps_[0] = temp1;
1625
+ temps_[1] = temp2;
1626
+ }
1627
+
1628
+ DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
1629
+ };
1630
+
1631
+
1632
+ // Sometimes truncating conversion from a tagged value to an int32.
1633
+ class LDoubleToI: public LTemplateInstruction<1, 1, 2> {
1634
+ public:
1635
+ LDoubleToI(LOperand* value, LOperand* temp1, LOperand* temp2) {
1636
+ inputs_[0] = value;
1637
+ temps_[0] = temp1;
1638
+ temps_[1] = temp2;
1639
+ }
1640
+
1641
+ DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
1642
+ DECLARE_HYDROGEN_ACCESSOR(Change)
1643
+
1644
+ bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1645
+ };
1646
+
1647
+
1648
+ // Truncating conversion from a tagged value to an int32.
1649
+ class LTaggedToI: public LTemplateInstruction<1, 1, 3> {
1650
+ public:
1651
+ LTaggedToI(LOperand* value,
1652
+ LOperand* temp1,
1653
+ LOperand* temp2,
1654
+ LOperand* temp3) {
1655
+ inputs_[0] = value;
1656
+ temps_[0] = temp1;
1657
+ temps_[1] = temp2;
1658
+ temps_[2] = temp3;
1659
+ }
1660
+
1661
+ DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
1662
+ DECLARE_HYDROGEN_ACCESSOR(Change)
1663
+
1664
+ bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1665
+ };
1666
+
1667
+
1668
+ class LSmiTag: public LTemplateInstruction<1, 1, 0> {
1669
+ public:
1670
+ explicit LSmiTag(LOperand* value) {
1671
+ inputs_[0] = value;
1672
+ }
1673
+
1674
+ DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
1675
+ };
1676
+
1677
+
1678
+ class LNumberUntagD: public LTemplateInstruction<1, 1, 0> {
1679
+ public:
1680
+ explicit LNumberUntagD(LOperand* value) {
1681
+ inputs_[0] = value;
1682
+ }
1683
+
1684
+ DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
1685
+ };
1686
+
1687
+
1688
+ class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
1689
+ public:
1690
+ LSmiUntag(LOperand* value, bool needs_check)
1691
+ : needs_check_(needs_check) {
1692
+ inputs_[0] = value;
1693
+ }
1694
+
1695
+ DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
1696
+
1697
+ bool needs_check() const { return needs_check_; }
1698
+
1699
+ private:
1700
+ bool needs_check_;
1701
+ };
1702
+
1703
+
1704
+ class LStoreNamedField: public LTemplateInstruction<0, 2, 0> {
1705
+ public:
1706
+ LStoreNamedField(LOperand* obj, LOperand* val) {
1707
+ inputs_[0] = obj;
1708
+ inputs_[1] = val;
1709
+ }
1710
+
1711
+ DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
1712
+ DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
1713
+
1714
+ virtual void PrintDataTo(StringStream* stream);
1715
+
1716
+ LOperand* object() { return inputs_[0]; }
1717
+ LOperand* value() { return inputs_[1]; }
1718
+
1719
+ Handle<Object> name() const { return hydrogen()->name(); }
1720
+ bool is_in_object() { return hydrogen()->is_in_object(); }
1721
+ int offset() { return hydrogen()->offset(); }
1722
+ bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
1723
+ Handle<Map> transition() const { return hydrogen()->transition(); }
1724
+ };
1725
+
1726
+
1727
+ class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> {
1728
+ public:
1729
+ LStoreNamedGeneric(LOperand* obj, LOperand* val) {
1730
+ inputs_[0] = obj;
1731
+ inputs_[1] = val;
1732
+ }
1733
+
1734
+ DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
1735
+ DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
1736
+
1737
+ virtual void PrintDataTo(StringStream* stream);
1738
+
1739
+ LOperand* object() { return inputs_[0]; }
1740
+ LOperand* value() { return inputs_[1]; }
1741
+ Handle<Object> name() const { return hydrogen()->name(); }
1742
+ bool strict_mode() { return hydrogen()->strict_mode(); }
1743
+ };
1744
+
1745
+
1746
+ class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> {
1747
+ public:
1748
+ LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) {
1749
+ inputs_[0] = obj;
1750
+ inputs_[1] = key;
1751
+ inputs_[2] = val;
1752
+ }
1753
+
1754
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
1755
+ "store-keyed-fast-element")
1756
+ DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
1757
+
1758
+ virtual void PrintDataTo(StringStream* stream);
1759
+
1760
+ LOperand* object() { return inputs_[0]; }
1761
+ LOperand* key() { return inputs_[1]; }
1762
+ LOperand* value() { return inputs_[2]; }
1763
+ };
1764
+
1765
+
1766
+ class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> {
1767
+ public:
1768
+ LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* val) {
1769
+ inputs_[0] = obj;
1770
+ inputs_[1] = key;
1771
+ inputs_[2] = val;
1772
+ }
1773
+
1774
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
1775
+ DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
1776
+
1777
+ virtual void PrintDataTo(StringStream* stream);
1778
+
1779
+ LOperand* object() { return inputs_[0]; }
1780
+ LOperand* key() { return inputs_[1]; }
1781
+ LOperand* value() { return inputs_[2]; }
1782
+ bool strict_mode() { return hydrogen()->strict_mode(); }
1783
+ };
1784
+
1785
+ class LStoreKeyedSpecializedArrayElement: public LTemplateInstruction<0, 3, 0> {
1786
+ public:
1787
+ LStoreKeyedSpecializedArrayElement(LOperand* external_pointer,
1788
+ LOperand* key,
1789
+ LOperand* val) {
1790
+ inputs_[0] = external_pointer;
1791
+ inputs_[1] = key;
1792
+ inputs_[2] = val;
1793
+ }
1794
+
1795
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement,
1796
+ "store-keyed-specialized-array-element")
1797
+ DECLARE_HYDROGEN_ACCESSOR(StoreKeyedSpecializedArrayElement)
1798
+
1799
+ LOperand* external_pointer() { return inputs_[0]; }
1800
+ LOperand* key() { return inputs_[1]; }
1801
+ LOperand* value() { return inputs_[2]; }
1802
+ ExternalArrayType array_type() const {
1803
+ return hydrogen()->array_type();
1804
+ }
1805
+ };
1806
+
1807
+
1808
+ class LStringAdd: public LTemplateInstruction<1, 2, 0> {
1809
+ public:
1810
+ LStringAdd(LOperand* left, LOperand* right) {
1811
+ inputs_[0] = left;
1812
+ inputs_[1] = right;
1813
+ }
1814
+
1815
+ DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
1816
+ DECLARE_HYDROGEN_ACCESSOR(StringAdd)
1817
+
1818
+ LOperand* left() { return inputs_[0]; }
1819
+ LOperand* right() { return inputs_[1]; }
1820
+ };
1821
+
1822
+
1823
+
1824
+ class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> {
1825
+ public:
1826
+ LStringCharCodeAt(LOperand* string, LOperand* index) {
1827
+ inputs_[0] = string;
1828
+ inputs_[1] = index;
1829
+ }
1830
+
1831
+ DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
1832
+ DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
1833
+
1834
+ LOperand* string() { return inputs_[0]; }
1835
+ LOperand* index() { return inputs_[1]; }
1836
+ };
1837
+
1838
+
1839
+ class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> {
1840
+ public:
1841
+ explicit LStringCharFromCode(LOperand* char_code) {
1842
+ inputs_[0] = char_code;
1843
+ }
1844
+
1845
+ DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
1846
+ DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
1847
+
1848
+ LOperand* char_code() { return inputs_[0]; }
1849
+ };
1850
+
1851
+
1852
+ class LStringLength: public LTemplateInstruction<1, 1, 0> {
1853
+ public:
1854
+ explicit LStringLength(LOperand* string) {
1855
+ inputs_[0] = string;
1856
+ }
1857
+
1858
+ DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length")
1859
+ DECLARE_HYDROGEN_ACCESSOR(StringLength)
1860
+
1861
+ LOperand* string() { return inputs_[0]; }
1862
+ };
1863
+
1864
+
1865
+ class LCheckFunction: public LTemplateInstruction<0, 1, 0> {
1866
+ public:
1867
+ explicit LCheckFunction(LOperand* value) {
1868
+ inputs_[0] = value;
1869
+ }
1870
+
1871
+ DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function")
1872
+ DECLARE_HYDROGEN_ACCESSOR(CheckFunction)
1873
+ };
1874
+
1875
+
1876
+ class LCheckInstanceType: public LTemplateInstruction<0, 1, 0> {
1877
+ public:
1878
+ explicit LCheckInstanceType(LOperand* value) {
1879
+ inputs_[0] = value;
1880
+ }
1881
+
1882
+ DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
1883
+ DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
1884
+ };
1885
+
1886
+
1887
+ class LCheckMap: public LTemplateInstruction<0, 1, 0> {
1888
+ public:
1889
+ explicit LCheckMap(LOperand* value) {
1890
+ inputs_[0] = value;
1891
+ }
1892
+
1893
+ DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map")
1894
+ DECLARE_HYDROGEN_ACCESSOR(CheckMap)
1895
+ };
1896
+
1897
+
1898
+ class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 2> {
1899
+ public:
1900
+ LCheckPrototypeMaps(LOperand* temp1, LOperand* temp2) {
1901
+ temps_[0] = temp1;
1902
+ temps_[1] = temp2;
1903
+ }
1904
+
1905
+ DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps")
1906
+ DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps)
1907
+
1908
+ Handle<JSObject> prototype() const { return hydrogen()->prototype(); }
1909
+ Handle<JSObject> holder() const { return hydrogen()->holder(); }
1910
+ };
1911
+
1912
+
1913
+ class LCheckSmi: public LTemplateInstruction<0, 1, 0> {
1914
+ public:
1915
+ explicit LCheckSmi(LOperand* value) {
1916
+ inputs_[0] = value;
1917
+ }
1918
+
1919
+ DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
1920
+ };
1921
+
1922
+
1923
+ class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> {
1924
+ public:
1925
+ explicit LCheckNonSmi(LOperand* value) {
1926
+ inputs_[0] = value;
1927
+ }
1928
+
1929
+ DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
1930
+ };
1931
+
1932
+
1933
+ class LClampDToUint8: public LTemplateInstruction<1, 1, 1> {
1934
+ public:
1935
+ LClampDToUint8(LOperand* value, LOperand* temp) {
1936
+ inputs_[0] = value;
1937
+ temps_[0] = temp;
1938
+ }
1939
+
1940
+ LOperand* unclamped() { return inputs_[0]; }
1941
+
1942
+ DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
1943
+ };
1944
+
1945
+
1946
+ class LClampIToUint8: public LTemplateInstruction<1, 1, 0> {
1947
+ public:
1948
+ explicit LClampIToUint8(LOperand* value) {
1949
+ inputs_[0] = value;
1950
+ }
1951
+
1952
+ LOperand* unclamped() { return inputs_[0]; }
1953
+
1954
+ DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
1955
+ };
1956
+
1957
+
1958
+ class LClampTToUint8: public LTemplateInstruction<1, 1, 1> {
1959
+ public:
1960
+ LClampTToUint8(LOperand* value, LOperand* temp) {
1961
+ inputs_[0] = value;
1962
+ temps_[0] = temp;
1963
+ }
1964
+
1965
+ LOperand* unclamped() { return inputs_[0]; }
1966
+
1967
+ DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
1968
+ };
1969
+
1970
+
1971
+ class LArrayLiteral: public LTemplateInstruction<1, 0, 0> {
1972
+ public:
1973
+ DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array-literal")
1974
+ DECLARE_HYDROGEN_ACCESSOR(ArrayLiteral)
1975
+ };
1976
+
1977
+
1978
+ class LObjectLiteral: public LTemplateInstruction<1, 0, 0> {
1979
+ public:
1980
+ DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal")
1981
+ DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral)
1982
+ };
1983
+
1984
+
1985
+ class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> {
1986
+ public:
1987
+ DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
1988
+ DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
1989
+ };
1990
+
1991
+
1992
+ class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> {
1993
+ public:
1994
+ DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
1995
+ DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
1996
+
1997
+ Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); }
1998
+ };
1999
+
2000
+
2001
+ class LToFastProperties: public LTemplateInstruction<1, 1, 0> {
2002
+ public:
2003
+ explicit LToFastProperties(LOperand* value) {
2004
+ inputs_[0] = value;
2005
+ }
2006
+
2007
+ DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties")
2008
+ DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
2009
+ };
2010
+
2011
+
2012
+ class LTypeof: public LTemplateInstruction<1, 1, 0> {
2013
+ public:
2014
+ explicit LTypeof(LOperand* value) {
2015
+ inputs_[0] = value;
2016
+ }
2017
+
2018
+ DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
2019
+ };
2020
+
2021
+
2022
+ class LTypeofIs: public LTemplateInstruction<1, 1, 0> {
2023
+ public:
2024
+ explicit LTypeofIs(LOperand* value) {
2025
+ inputs_[0] = value;
2026
+ }
2027
+
2028
+ DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is")
2029
+ DECLARE_HYDROGEN_ACCESSOR(TypeofIs)
2030
+
2031
+ Handle<String> type_literal() { return hydrogen()->type_literal(); }
2032
+
2033
+ virtual void PrintDataTo(StringStream* stream);
2034
+ };
2035
+
2036
+
2037
+ class LTypeofIsAndBranch: public LControlInstruction<1, 0> {
2038
+ public:
2039
+ explicit LTypeofIsAndBranch(LOperand* value) {
2040
+ inputs_[0] = value;
2041
+ }
2042
+
2043
+ DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
2044
+ DECLARE_HYDROGEN_ACCESSOR(TypeofIs)
2045
+
2046
+ Handle<String> type_literal() { return hydrogen()->type_literal(); }
2047
+
2048
+ virtual void PrintDataTo(StringStream* stream);
2049
+ };
2050
+
2051
+
2052
+ class LIsConstructCall: public LTemplateInstruction<1, 0, 0> {
2053
+ public:
2054
+ DECLARE_CONCRETE_INSTRUCTION(IsConstructCall, "is-construct-call")
2055
+ DECLARE_HYDROGEN_ACCESSOR(IsConstructCall)
2056
+ };
2057
+
2058
+
2059
+ class LIsConstructCallAndBranch: public LControlInstruction<0, 1> {
2060
+ public:
2061
+ explicit LIsConstructCallAndBranch(LOperand* temp) {
2062
+ temps_[0] = temp;
2063
+ }
2064
+
2065
+ DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
2066
+ "is-construct-call-and-branch")
2067
+ };
2068
+
2069
+
2070
+ class LDeleteProperty: public LTemplateInstruction<1, 2, 0> {
2071
+ public:
2072
+ LDeleteProperty(LOperand* obj, LOperand* key) {
2073
+ inputs_[0] = obj;
2074
+ inputs_[1] = key;
2075
+ }
2076
+
2077
+ DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
2078
+
2079
+ LOperand* object() { return inputs_[0]; }
2080
+ LOperand* key() { return inputs_[1]; }
2081
+ };
2082
+
2083
+
2084
+ class LOsrEntry: public LTemplateInstruction<0, 0, 0> {
2085
+ public:
2086
+ LOsrEntry();
2087
+
2088
+ DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
2089
+
2090
+ LOperand** SpilledRegisterArray() { return register_spills_; }
2091
+ LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; }
2092
+
2093
+ void MarkSpilledRegister(int allocation_index, LOperand* spill_operand);
2094
+ void MarkSpilledDoubleRegister(int allocation_index,
2095
+ LOperand* spill_operand);
2096
+
2097
+ private:
2098
+ // Arrays of spill slot operands for registers with an assigned spill
2099
+ // slot, i.e., that must also be restored to the spill slot on OSR entry.
2100
+ // NULL if the register has no assigned spill slot. Indexed by allocation
2101
+ // index.
2102
+ LOperand* register_spills_[Register::kNumAllocatableRegisters];
2103
+ LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters];
2104
+ };
2105
+
2106
+
2107
+ class LStackCheck: public LTemplateInstruction<0, 0, 0> {
2108
+ public:
2109
+ DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
2110
+ };
2111
+
2112
+
2113
+ class LIn: public LTemplateInstruction<1, 2, 0> {
2114
+ public:
2115
+ LIn(LOperand* key, LOperand* object) {
2116
+ inputs_[0] = key;
2117
+ inputs_[1] = object;
2118
+ }
2119
+
2120
+ LOperand* key() { return inputs_[0]; }
2121
+ LOperand* object() { return inputs_[1]; }
2122
+
2123
+ DECLARE_CONCRETE_INSTRUCTION(In, "in")
2124
+ };
2125
+
2126
+
2127
+ class LChunkBuilder;
2128
+ class LChunk: public ZoneObject {
2129
+ public:
2130
+ explicit LChunk(CompilationInfo* info, HGraph* graph);
2131
+
2132
+ void AddInstruction(LInstruction* instruction, HBasicBlock* block);
2133
+ LConstantOperand* DefineConstantOperand(HConstant* constant);
2134
+ Handle<Object> LookupLiteral(LConstantOperand* operand) const;
2135
+ Representation LookupLiteralRepresentation(LConstantOperand* operand) const;
2136
+
2137
+ int GetNextSpillIndex(bool is_double);
2138
+ LOperand* GetNextSpillSlot(bool is_double);
2139
+
2140
+ int ParameterAt(int index);
2141
+ int GetParameterStackSlot(int index) const;
2142
+ int spill_slot_count() const { return spill_slot_count_; }
2143
+ CompilationInfo* info() const { return info_; }
2144
+ HGraph* graph() const { return graph_; }
2145
+ const ZoneList<LInstruction*>* instructions() const { return &instructions_; }
2146
+ void AddGapMove(int index, LOperand* from, LOperand* to);
2147
+ LGap* GetGapAt(int index) const;
2148
+ bool IsGapAt(int index) const;
2149
+ int NearestGapPos(int index) const;
2150
+ void MarkEmptyBlocks();
2151
+ const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; }
2152
+ LLabel* GetLabel(int block_id) const {
2153
+ HBasicBlock* block = graph_->blocks()->at(block_id);
2154
+ int first_instruction = block->first_instruction_index();
2155
+ return LLabel::cast(instructions_[first_instruction]);
2156
+ }
2157
+ int LookupDestination(int block_id) const {
2158
+ LLabel* cur = GetLabel(block_id);
2159
+ while (cur->replacement() != NULL) {
2160
+ cur = cur->replacement();
2161
+ }
2162
+ return cur->block_id();
2163
+ }
2164
+ Label* GetAssemblyLabel(int block_id) const {
2165
+ LLabel* label = GetLabel(block_id);
2166
+ ASSERT(!label->HasReplacement());
2167
+ return label->label();
2168
+ }
2169
+
2170
+ const ZoneList<Handle<JSFunction> >* inlined_closures() const {
2171
+ return &inlined_closures_;
2172
+ }
2173
+
2174
+ void AddInlinedClosure(Handle<JSFunction> closure) {
2175
+ inlined_closures_.Add(closure);
2176
+ }
2177
+
2178
+ private:
2179
+ int spill_slot_count_;
2180
+ CompilationInfo* info_;
2181
+ HGraph* const graph_;
2182
+ ZoneList<LInstruction*> instructions_;
2183
+ ZoneList<LPointerMap*> pointer_maps_;
2184
+ ZoneList<Handle<JSFunction> > inlined_closures_;
2185
+ };
2186
+
2187
+
2188
+ class LChunkBuilder BASE_EMBEDDED {
2189
+ public:
2190
+ LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
2191
+ : chunk_(NULL),
2192
+ info_(info),
2193
+ graph_(graph),
2194
+ status_(UNUSED),
2195
+ current_instruction_(NULL),
2196
+ current_block_(NULL),
2197
+ next_block_(NULL),
2198
+ argument_count_(0),
2199
+ allocator_(allocator),
2200
+ position_(RelocInfo::kNoPosition),
2201
+ instruction_pending_deoptimization_environment_(NULL),
2202
+ pending_deoptimization_ast_id_(AstNode::kNoNumber) { }
2203
+
2204
+ // Build the sequence for the graph.
2205
+ LChunk* Build();
2206
+
2207
+ // Declare methods that deal with the individual node types.
2208
+ #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2209
+ HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
2210
+ #undef DECLARE_DO
2211
+
2212
+ private:
2213
+ enum Status {
2214
+ UNUSED,
2215
+ BUILDING,
2216
+ DONE,
2217
+ ABORTED
2218
+ };
2219
+
2220
+ LChunk* chunk() const { return chunk_; }
2221
+ CompilationInfo* info() const { return info_; }
2222
+ HGraph* graph() const { return graph_; }
2223
+
2224
+ bool is_unused() const { return status_ == UNUSED; }
2225
+ bool is_building() const { return status_ == BUILDING; }
2226
+ bool is_done() const { return status_ == DONE; }
2227
+ bool is_aborted() const { return status_ == ABORTED; }
2228
+
2229
+ void Abort(const char* format, ...);
2230
+
2231
+ // Methods for getting operands for Use / Define / Temp.
2232
+ LRegister* ToOperand(Register reg);
2233
+ LUnallocated* ToUnallocated(Register reg);
2234
+ LUnallocated* ToUnallocated(DoubleRegister reg);
2235
+
2236
+ // Methods for setting up define-use relationships.
2237
+ MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand);
2238
+ MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register);
2239
+ MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value,
2240
+ DoubleRegister fixed_register);
2241
+
2242
+ // A value that is guaranteed to be allocated to a register.
2243
+ // Operand created by UseRegister is guaranteed to be live until the end of
2244
+ // instruction. This means that register allocator will not reuse it's
2245
+ // register for any other operand inside instruction.
2246
+ // Operand created by UseRegisterAtStart is guaranteed to be live only at
2247
+ // instruction start. Register allocator is free to assign the same register
2248
+ // to some other operand used inside instruction (i.e. temporary or
2249
+ // output).
2250
+ MUST_USE_RESULT LOperand* UseRegister(HValue* value);
2251
+ MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value);
2252
+
2253
+ // An input operand in a register that may be trashed.
2254
+ MUST_USE_RESULT LOperand* UseTempRegister(HValue* value);
2255
+
2256
+ // An input operand in a register or stack slot.
2257
+ MUST_USE_RESULT LOperand* Use(HValue* value);
2258
+ MUST_USE_RESULT LOperand* UseAtStart(HValue* value);
2259
+
2260
+ // An input operand in a register, stack slot or a constant operand.
2261
+ MUST_USE_RESULT LOperand* UseOrConstant(HValue* value);
2262
+ MUST_USE_RESULT LOperand* UseOrConstantAtStart(HValue* value);
2263
+
2264
+ // An input operand in a register or a constant operand.
2265
+ MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value);
2266
+ MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value);
2267
+
2268
+ // An input operand in register, stack slot or a constant operand.
2269
+ // Will not be moved to a register even if one is freely available.
2270
+ MUST_USE_RESULT LOperand* UseAny(HValue* value);
2271
+
2272
+ // Temporary operand that must be in a register.
2273
+ MUST_USE_RESULT LUnallocated* TempRegister();
2274
+ MUST_USE_RESULT LOperand* FixedTemp(Register reg);
2275
+ MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg);
2276
+
2277
+ // Methods for setting up define-use relationships.
2278
+ // Return the same instruction that they are passed.
2279
+ template<int I, int T>
2280
+ LInstruction* Define(LTemplateInstruction<1, I, T>* instr,
2281
+ LUnallocated* result);
2282
+ template<int I, int T>
2283
+ LInstruction* Define(LTemplateInstruction<1, I, T>* instr);
2284
+ template<int I, int T>
2285
+ LInstruction* DefineAsRegister(LTemplateInstruction<1, I, T>* instr);
2286
+ template<int I, int T>
2287
+ LInstruction* DefineAsSpilled(LTemplateInstruction<1, I, T>* instr,
2288
+ int index);
2289
+ template<int I, int T>
2290
+ LInstruction* DefineSameAsFirst(LTemplateInstruction<1, I, T>* instr);
2291
+ template<int I, int T>
2292
+ LInstruction* DefineFixed(LTemplateInstruction<1, I, T>* instr,
2293
+ Register reg);
2294
+ template<int I, int T>
2295
+ LInstruction* DefineFixedDouble(LTemplateInstruction<1, I, T>* instr,
2296
+ DoubleRegister reg);
2297
+ LInstruction* AssignEnvironment(LInstruction* instr);
2298
+ LInstruction* AssignPointerMap(LInstruction* instr);
2299
+
2300
+ enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
2301
+
2302
+ // By default we assume that instruction sequences generated for calls
2303
+ // cannot deoptimize eagerly and we do not attach environment to this
2304
+ // instruction.
2305
+ LInstruction* MarkAsCall(
2306
+ LInstruction* instr,
2307
+ HInstruction* hinstr,
2308
+ CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
2309
+ LInstruction* MarkAsSaveDoubles(LInstruction* instr);
2310
+
2311
+ LInstruction* SetInstructionPendingDeoptimizationEnvironment(
2312
+ LInstruction* instr, int ast_id);
2313
+ void ClearInstructionPendingDeoptimizationEnvironment();
2314
+
2315
+ LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env);
2316
+
2317
+ void VisitInstruction(HInstruction* current);
2318
+
2319
+ void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
2320
+ LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr);
2321
+ LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
2322
+ LInstruction* DoArithmeticD(Token::Value op,
2323
+ HArithmeticBinaryOperation* instr);
2324
+ LInstruction* DoArithmeticT(Token::Value op,
2325
+ HArithmeticBinaryOperation* instr);
2326
+
2327
+ LChunk* chunk_;
2328
+ CompilationInfo* info_;
2329
+ HGraph* const graph_;
2330
+ Status status_;
2331
+ HInstruction* current_instruction_;
2332
+ HBasicBlock* current_block_;
2333
+ HBasicBlock* next_block_;
2334
+ int argument_count_;
2335
+ LAllocator* allocator_;
2336
+ int position_;
2337
+ LInstruction* instruction_pending_deoptimization_environment_;
2338
+ int pending_deoptimization_ast_id_;
2339
+
2340
+ DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2341
+ };
2342
+
2343
+ #undef DECLARE_HYDROGEN_ACCESSOR
2344
+ #undef DECLARE_CONCRETE_INSTRUCTION
2345
+
2346
+ } } // namespace v8::internal
2347
+
2348
+ #endif // V8_ARM_LITHIUM_ARM_H_