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,2333 @@
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_X64_LITHIUM_X64_H_
29
+ #define V8_X64_LITHIUM_X64_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(CheckMap) \
73
+ V(CheckNonSmi) \
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
+
206
+ virtual ~LInstruction() { }
207
+
208
+ virtual void CompileToNative(LCodeGen* generator) = 0;
209
+ virtual const char* Mnemonic() const = 0;
210
+ virtual void PrintTo(StringStream* stream);
211
+ virtual void PrintDataTo(StringStream* stream) = 0;
212
+ virtual void PrintOutputOperandTo(StringStream* stream) = 0;
213
+
214
+ enum Opcode {
215
+ // Declare a unique enum value for each instruction.
216
+ #define DECLARE_OPCODE(type) k##type,
217
+ LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE)
218
+ kNumberOfInstructions
219
+ #undef DECLARE_OPCODE
220
+ };
221
+
222
+ virtual Opcode opcode() const = 0;
223
+
224
+ // Declare non-virtual type testers for all leaf IR classes.
225
+ #define DECLARE_PREDICATE(type) \
226
+ bool Is##type() const { return opcode() == k##type; }
227
+ LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE)
228
+ #undef DECLARE_PREDICATE
229
+
230
+ // Declare virtual predicates for instructions that don't have
231
+ // an opcode.
232
+ virtual bool IsGap() const { return false; }
233
+
234
+ virtual bool IsControl() const { return false; }
235
+ virtual void SetBranchTargets(int true_block_id, int false_block_id) { }
236
+
237
+ void set_environment(LEnvironment* env) { environment_ = env; }
238
+ LEnvironment* environment() const { return environment_; }
239
+ bool HasEnvironment() const { return environment_ != NULL; }
240
+
241
+ void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
242
+ LPointerMap* pointer_map() const { return pointer_map_.get(); }
243
+ bool HasPointerMap() const { return pointer_map_.is_set(); }
244
+
245
+ void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
246
+ HValue* hydrogen_value() const { return hydrogen_value_; }
247
+
248
+ void set_deoptimization_environment(LEnvironment* env) {
249
+ deoptimization_environment_.set(env);
250
+ }
251
+ LEnvironment* deoptimization_environment() const {
252
+ return deoptimization_environment_.get();
253
+ }
254
+ bool HasDeoptimizationEnvironment() const {
255
+ return deoptimization_environment_.is_set();
256
+ }
257
+
258
+ void MarkAsCall() { is_call_ = true; }
259
+ void MarkAsSaveDoubles() { is_save_doubles_ = true; }
260
+
261
+ // Interface to the register allocator and iterators.
262
+ bool IsMarkedAsCall() const { return is_call_; }
263
+ bool IsMarkedAsSaveDoubles() const { return is_save_doubles_; }
264
+
265
+ virtual bool HasResult() const = 0;
266
+ virtual LOperand* result() = 0;
267
+
268
+ virtual int InputCount() = 0;
269
+ virtual LOperand* InputAt(int i) = 0;
270
+ virtual int TempCount() = 0;
271
+ virtual LOperand* TempAt(int i) = 0;
272
+
273
+ LOperand* FirstInput() { return InputAt(0); }
274
+ LOperand* Output() { return HasResult() ? result() : NULL; }
275
+
276
+ #ifdef DEBUG
277
+ void VerifyCall();
278
+ #endif
279
+
280
+ private:
281
+ LEnvironment* environment_;
282
+ SetOncePointer<LPointerMap> pointer_map_;
283
+ HValue* hydrogen_value_;
284
+ SetOncePointer<LEnvironment> deoptimization_environment_;
285
+ bool is_call_;
286
+ bool is_save_doubles_;
287
+ };
288
+
289
+
290
+ template<typename ElementType, int NumElements>
291
+ class OperandContainer {
292
+ public:
293
+ OperandContainer() {
294
+ for (int i = 0; i < NumElements; i++) elems_[i] = NULL;
295
+ }
296
+ int length() { return NumElements; }
297
+ ElementType& operator[](int i) {
298
+ ASSERT(i < length());
299
+ return elems_[i];
300
+ }
301
+ void PrintOperandsTo(StringStream* stream);
302
+
303
+ private:
304
+ ElementType elems_[NumElements];
305
+ };
306
+
307
+
308
+ template<typename ElementType>
309
+ class OperandContainer<ElementType, 0> {
310
+ public:
311
+ int length() { return 0; }
312
+ void PrintOperandsTo(StringStream* stream) { }
313
+ ElementType& operator[](int i) {
314
+ UNREACHABLE();
315
+ static ElementType t = 0;
316
+ return t;
317
+ }
318
+ };
319
+
320
+
321
+ // R = number of result operands (0 or 1).
322
+ // I = number of input operands.
323
+ // T = number of temporary operands.
324
+ template<int R, int I, int T>
325
+ class LTemplateInstruction: public LInstruction {
326
+ public:
327
+ // Allow 0 or 1 output operands.
328
+ STATIC_ASSERT(R == 0 || R == 1);
329
+ virtual bool HasResult() const { return R != 0; }
330
+ void set_result(LOperand* operand) { results_[0] = operand; }
331
+ LOperand* result() { return results_[0]; }
332
+
333
+ int InputCount() { return I; }
334
+ LOperand* InputAt(int i) { return inputs_[i]; }
335
+
336
+ int TempCount() { return T; }
337
+ LOperand* TempAt(int i) { return temps_[i]; }
338
+
339
+ virtual void PrintDataTo(StringStream* stream);
340
+ virtual void PrintOutputOperandTo(StringStream* stream);
341
+
342
+ protected:
343
+ OperandContainer<LOperand*, R> results_;
344
+ OperandContainer<LOperand*, I> inputs_;
345
+ OperandContainer<LOperand*, T> temps_;
346
+ };
347
+
348
+
349
+ class LGap: public LTemplateInstruction<0, 0, 0> {
350
+ public:
351
+ explicit LGap(HBasicBlock* block)
352
+ : block_(block) {
353
+ parallel_moves_[BEFORE] = NULL;
354
+ parallel_moves_[START] = NULL;
355
+ parallel_moves_[END] = NULL;
356
+ parallel_moves_[AFTER] = NULL;
357
+ }
358
+
359
+ // Can't use the DECLARE-macro here because of sub-classes.
360
+ virtual bool IsGap() const { return true; }
361
+ virtual void PrintDataTo(StringStream* stream);
362
+ static LGap* cast(LInstruction* instr) {
363
+ ASSERT(instr->IsGap());
364
+ return reinterpret_cast<LGap*>(instr);
365
+ }
366
+
367
+ bool IsRedundant() const;
368
+
369
+ HBasicBlock* block() const { return block_; }
370
+
371
+ enum InnerPosition {
372
+ BEFORE,
373
+ START,
374
+ END,
375
+ AFTER,
376
+ FIRST_INNER_POSITION = BEFORE,
377
+ LAST_INNER_POSITION = AFTER
378
+ };
379
+
380
+ LParallelMove* GetOrCreateParallelMove(InnerPosition pos) {
381
+ if (parallel_moves_[pos] == NULL) parallel_moves_[pos] = new LParallelMove;
382
+ return parallel_moves_[pos];
383
+ }
384
+
385
+ LParallelMove* GetParallelMove(InnerPosition pos) {
386
+ return parallel_moves_[pos];
387
+ }
388
+
389
+ private:
390
+ LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
391
+ HBasicBlock* block_;
392
+ };
393
+
394
+
395
+ class LInstructionGap: public LGap {
396
+ public:
397
+ explicit LInstructionGap(HBasicBlock* block) : LGap(block) { }
398
+
399
+ DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap")
400
+ };
401
+
402
+
403
+ class LGoto: public LTemplateInstruction<0, 0, 0> {
404
+ public:
405
+ LGoto(int block_id, bool include_stack_check = false)
406
+ : block_id_(block_id), include_stack_check_(include_stack_check) { }
407
+
408
+ DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
409
+ virtual void PrintDataTo(StringStream* stream);
410
+ virtual bool IsControl() const { return true; }
411
+
412
+ int block_id() const { return block_id_; }
413
+ bool include_stack_check() const { return include_stack_check_; }
414
+
415
+ private:
416
+ int block_id_;
417
+ bool include_stack_check_;
418
+ };
419
+
420
+
421
+ class LLazyBailout: public LTemplateInstruction<0, 0, 0> {
422
+ public:
423
+ LLazyBailout() : gap_instructions_size_(0) { }
424
+
425
+ DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout")
426
+
427
+ void set_gap_instructions_size(int gap_instructions_size) {
428
+ gap_instructions_size_ = gap_instructions_size;
429
+ }
430
+ int gap_instructions_size() { return gap_instructions_size_; }
431
+
432
+ private:
433
+ int gap_instructions_size_;
434
+ };
435
+
436
+
437
+ class LDeoptimize: public LTemplateInstruction<0, 0, 0> {
438
+ public:
439
+ DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
440
+ };
441
+
442
+
443
+ class LLabel: public LGap {
444
+ public:
445
+ explicit LLabel(HBasicBlock* block)
446
+ : LGap(block), replacement_(NULL) { }
447
+
448
+ DECLARE_CONCRETE_INSTRUCTION(Label, "label")
449
+
450
+ virtual void PrintDataTo(StringStream* stream);
451
+
452
+ int block_id() const { return block()->block_id(); }
453
+ bool is_loop_header() const { return block()->IsLoopHeader(); }
454
+ Label* label() { return &label_; }
455
+ LLabel* replacement() const { return replacement_; }
456
+ void set_replacement(LLabel* label) { replacement_ = label; }
457
+ bool HasReplacement() const { return replacement_ != NULL; }
458
+
459
+ private:
460
+ Label label_;
461
+ LLabel* replacement_;
462
+ };
463
+
464
+
465
+ class LParameter: public LTemplateInstruction<1, 0, 0> {
466
+ public:
467
+ DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
468
+ };
469
+
470
+
471
+ class LCallStub: public LTemplateInstruction<1, 0, 0> {
472
+ public:
473
+ DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
474
+ DECLARE_HYDROGEN_ACCESSOR(CallStub)
475
+
476
+ TranscendentalCache::Type transcendental_type() {
477
+ return hydrogen()->transcendental_type();
478
+ }
479
+ };
480
+
481
+
482
+ class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> {
483
+ public:
484
+ DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
485
+ };
486
+
487
+
488
+ template<int I, int T>
489
+ class LControlInstruction: public LTemplateInstruction<0, I, T> {
490
+ public:
491
+ virtual bool IsControl() const { return true; }
492
+
493
+ int true_block_id() const { return true_block_id_; }
494
+ int false_block_id() const { return false_block_id_; }
495
+ void SetBranchTargets(int true_block_id, int false_block_id) {
496
+ true_block_id_ = true_block_id;
497
+ false_block_id_ = false_block_id;
498
+ }
499
+
500
+ private:
501
+ int true_block_id_;
502
+ int false_block_id_;
503
+ };
504
+
505
+
506
+ class LApplyArguments: public LTemplateInstruction<1, 4, 0> {
507
+ public:
508
+ LApplyArguments(LOperand* function,
509
+ LOperand* receiver,
510
+ LOperand* length,
511
+ LOperand* elements) {
512
+ inputs_[0] = function;
513
+ inputs_[1] = receiver;
514
+ inputs_[2] = length;
515
+ inputs_[3] = elements;
516
+ }
517
+
518
+ DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
519
+
520
+ LOperand* function() { return inputs_[0]; }
521
+ LOperand* receiver() { return inputs_[1]; }
522
+ LOperand* length() { return inputs_[2]; }
523
+ LOperand* elements() { return inputs_[3]; }
524
+ };
525
+
526
+
527
+ class LAccessArgumentsAt: public LTemplateInstruction<1, 3, 0> {
528
+ public:
529
+ LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) {
530
+ inputs_[0] = arguments;
531
+ inputs_[1] = length;
532
+ inputs_[2] = index;
533
+ }
534
+
535
+ DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
536
+
537
+ LOperand* arguments() { return inputs_[0]; }
538
+ LOperand* length() { return inputs_[1]; }
539
+ LOperand* index() { return inputs_[2]; }
540
+
541
+ virtual void PrintDataTo(StringStream* stream);
542
+ };
543
+
544
+
545
+ class LArgumentsLength: public LTemplateInstruction<1, 1, 0> {
546
+ public:
547
+ explicit LArgumentsLength(LOperand* elements) {
548
+ inputs_[0] = elements;
549
+ }
550
+
551
+ DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
552
+ };
553
+
554
+
555
+ class LArgumentsElements: public LTemplateInstruction<1, 0, 0> {
556
+ public:
557
+ LArgumentsElements() { }
558
+
559
+ DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
560
+ };
561
+
562
+
563
+ class LModI: public LTemplateInstruction<1, 2, 1> {
564
+ public:
565
+ LModI(LOperand* left, LOperand* right, LOperand* temp) {
566
+ inputs_[0] = left;
567
+ inputs_[1] = right;
568
+ temps_[0] = temp;
569
+ }
570
+
571
+ DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
572
+ DECLARE_HYDROGEN_ACCESSOR(Mod)
573
+ };
574
+
575
+
576
+ class LDivI: public LTemplateInstruction<1, 2, 1> {
577
+ public:
578
+ LDivI(LOperand* left, LOperand* right, LOperand* temp) {
579
+ inputs_[0] = left;
580
+ inputs_[1] = right;
581
+ temps_[0] = temp;
582
+ }
583
+
584
+ DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
585
+ DECLARE_HYDROGEN_ACCESSOR(Div)
586
+ };
587
+
588
+
589
+ class LMulI: public LTemplateInstruction<1, 2, 0> {
590
+ public:
591
+ LMulI(LOperand* left, LOperand* right) {
592
+ inputs_[0] = left;
593
+ inputs_[1] = right;
594
+ }
595
+
596
+ DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
597
+ DECLARE_HYDROGEN_ACCESSOR(Mul)
598
+ };
599
+
600
+
601
+ class LCmpID: public LTemplateInstruction<1, 2, 0> {
602
+ public:
603
+ LCmpID(LOperand* left, LOperand* right) {
604
+ inputs_[0] = left;
605
+ inputs_[1] = right;
606
+ }
607
+
608
+ DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id")
609
+ DECLARE_HYDROGEN_ACCESSOR(Compare)
610
+
611
+ Token::Value op() const { return hydrogen()->token(); }
612
+ bool is_double() const {
613
+ return hydrogen()->GetInputRepresentation().IsDouble();
614
+ }
615
+ };
616
+
617
+
618
+ class LCmpIDAndBranch: public LControlInstruction<2, 0> {
619
+ public:
620
+ LCmpIDAndBranch(LOperand* left, LOperand* right) {
621
+ inputs_[0] = left;
622
+ inputs_[1] = right;
623
+ }
624
+
625
+ DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
626
+ DECLARE_HYDROGEN_ACCESSOR(Compare)
627
+
628
+ Token::Value op() const { return hydrogen()->token(); }
629
+ bool is_double() const {
630
+ return hydrogen()->GetInputRepresentation().IsDouble();
631
+ }
632
+
633
+ virtual void PrintDataTo(StringStream* stream);
634
+ };
635
+
636
+
637
+ class LUnaryMathOperation: public LTemplateInstruction<1, 1, 0> {
638
+ public:
639
+ explicit LUnaryMathOperation(LOperand* value) {
640
+ inputs_[0] = value;
641
+ }
642
+
643
+ DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation")
644
+ DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
645
+
646
+ virtual void PrintDataTo(StringStream* stream);
647
+ BuiltinFunctionId op() const { return hydrogen()->op(); }
648
+ };
649
+
650
+
651
+ class LCmpJSObjectEq: public LTemplateInstruction<1, 2, 0> {
652
+ public:
653
+ LCmpJSObjectEq(LOperand* left, LOperand* right) {
654
+ inputs_[0] = left;
655
+ inputs_[1] = right;
656
+ }
657
+
658
+ DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq")
659
+ };
660
+
661
+
662
+ class LCmpJSObjectEqAndBranch: public LControlInstruction<2, 0> {
663
+ public:
664
+ LCmpJSObjectEqAndBranch(LOperand* left, LOperand* right) {
665
+ inputs_[0] = left;
666
+ inputs_[1] = right;
667
+ }
668
+
669
+ DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch,
670
+ "cmp-jsobject-eq-and-branch")
671
+ };
672
+
673
+
674
+ class LCmpSymbolEq: public LTemplateInstruction<1, 2, 0> {
675
+ public:
676
+ LCmpSymbolEq(LOperand* left, LOperand* right) {
677
+ inputs_[0] = left;
678
+ inputs_[1] = right;
679
+ }
680
+
681
+ DECLARE_CONCRETE_INSTRUCTION(CmpSymbolEq, "cmp-symbol-eq")
682
+ };
683
+
684
+
685
+ class LCmpSymbolEqAndBranch: public LControlInstruction<2, 0> {
686
+ public:
687
+ LCmpSymbolEqAndBranch(LOperand* left, LOperand* right) {
688
+ inputs_[0] = left;
689
+ inputs_[1] = right;
690
+ }
691
+
692
+ DECLARE_CONCRETE_INSTRUCTION(CmpSymbolEqAndBranch, "cmp-symbol-eq-and-branch")
693
+ };
694
+
695
+
696
+ class LIsNull: public LTemplateInstruction<1, 1, 0> {
697
+ public:
698
+ explicit LIsNull(LOperand* value) {
699
+ inputs_[0] = value;
700
+ }
701
+
702
+ DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null")
703
+ DECLARE_HYDROGEN_ACCESSOR(IsNull)
704
+
705
+ bool is_strict() const { return hydrogen()->is_strict(); }
706
+ };
707
+
708
+
709
+ class LIsNullAndBranch: public LControlInstruction<1, 1> {
710
+ public:
711
+ LIsNullAndBranch(LOperand* value, LOperand* temp) {
712
+ inputs_[0] = value;
713
+ temps_[0] = temp;
714
+ }
715
+
716
+ DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch")
717
+ DECLARE_HYDROGEN_ACCESSOR(IsNull)
718
+
719
+ bool is_strict() const { return hydrogen()->is_strict(); }
720
+
721
+ virtual void PrintDataTo(StringStream* stream);
722
+ };
723
+
724
+
725
+ class LIsObject: public LTemplateInstruction<1, 1, 0> {
726
+ public:
727
+ explicit LIsObject(LOperand* value) {
728
+ inputs_[0] = value;
729
+ }
730
+
731
+ DECLARE_CONCRETE_INSTRUCTION(IsObject, "is-object")
732
+ };
733
+
734
+
735
+ class LIsObjectAndBranch: public LControlInstruction<1, 0> {
736
+ public:
737
+ explicit LIsObjectAndBranch(LOperand* value) {
738
+ inputs_[0] = value;
739
+ }
740
+
741
+ DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
742
+
743
+ virtual void PrintDataTo(StringStream* stream);
744
+ };
745
+
746
+
747
+ class LIsSmi: public LTemplateInstruction<1, 1, 0> {
748
+ public:
749
+ explicit LIsSmi(LOperand* value) {
750
+ inputs_[0] = value;
751
+ }
752
+
753
+ DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi")
754
+ DECLARE_HYDROGEN_ACCESSOR(IsSmi)
755
+ };
756
+
757
+
758
+ class LIsSmiAndBranch: public LControlInstruction<1, 0> {
759
+ public:
760
+ explicit LIsSmiAndBranch(LOperand* value) {
761
+ inputs_[0] = value;
762
+ }
763
+
764
+ DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
765
+
766
+ virtual void PrintDataTo(StringStream* stream);
767
+ };
768
+
769
+
770
+ class LIsUndetectable: public LTemplateInstruction<1, 1, 0> {
771
+ public:
772
+ explicit LIsUndetectable(LOperand* value) {
773
+ inputs_[0] = value;
774
+ }
775
+
776
+ DECLARE_CONCRETE_INSTRUCTION(IsUndetectable, "is-undetectable")
777
+ DECLARE_HYDROGEN_ACCESSOR(IsUndetectable)
778
+ };
779
+
780
+
781
+ class LIsUndetectableAndBranch: public LControlInstruction<1, 1> {
782
+ public:
783
+ explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
784
+ inputs_[0] = value;
785
+ temps_[0] = temp;
786
+ }
787
+
788
+ DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
789
+ "is-undetectable-and-branch")
790
+
791
+ virtual void PrintDataTo(StringStream* stream);
792
+ };
793
+
794
+
795
+ class LHasInstanceType: public LTemplateInstruction<1, 1, 0> {
796
+ public:
797
+ explicit LHasInstanceType(LOperand* value) {
798
+ inputs_[0] = value;
799
+ }
800
+
801
+ DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type")
802
+ DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
803
+ };
804
+
805
+
806
+ class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> {
807
+ public:
808
+ explicit LHasInstanceTypeAndBranch(LOperand* value) {
809
+ inputs_[0] = value;
810
+ }
811
+
812
+ DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
813
+ "has-instance-type-and-branch")
814
+ DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
815
+
816
+ virtual void PrintDataTo(StringStream* stream);
817
+ };
818
+
819
+
820
+ class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
821
+ public:
822
+ explicit LGetCachedArrayIndex(LOperand* value) {
823
+ inputs_[0] = value;
824
+ }
825
+
826
+ DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
827
+ DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
828
+ };
829
+
830
+
831
+ class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
832
+ public:
833
+ explicit LHasCachedArrayIndex(LOperand* value) {
834
+ inputs_[0] = value;
835
+ }
836
+
837
+ DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index")
838
+ DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex)
839
+ };
840
+
841
+
842
+ class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> {
843
+ public:
844
+ explicit LHasCachedArrayIndexAndBranch(LOperand* value) {
845
+ inputs_[0] = value;
846
+ }
847
+
848
+ DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
849
+ "has-cached-array-index-and-branch")
850
+ virtual void PrintDataTo(StringStream* stream);
851
+ };
852
+
853
+
854
+ class LClassOfTest: public LTemplateInstruction<1, 1, 1> {
855
+ public:
856
+ LClassOfTest(LOperand* value, LOperand* temp) {
857
+ inputs_[0] = value;
858
+ temps_[0] = temp;
859
+ }
860
+
861
+ DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test")
862
+ DECLARE_HYDROGEN_ACCESSOR(ClassOfTest)
863
+
864
+ virtual void PrintDataTo(StringStream* stream);
865
+ };
866
+
867
+
868
+ class LClassOfTestAndBranch: public LControlInstruction<1, 1> {
869
+ public:
870
+ LClassOfTestAndBranch(LOperand* value, LOperand* temp) {
871
+ inputs_[0] = value;
872
+ temps_[0] = temp;
873
+ }
874
+
875
+ DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
876
+ "class-of-test-and-branch")
877
+ DECLARE_HYDROGEN_ACCESSOR(ClassOfTest)
878
+
879
+ virtual void PrintDataTo(StringStream* stream);
880
+ };
881
+
882
+
883
+ class LCmpT: public LTemplateInstruction<1, 2, 0> {
884
+ public:
885
+ LCmpT(LOperand* left, LOperand* right) {
886
+ inputs_[0] = left;
887
+ inputs_[1] = right;
888
+ }
889
+
890
+ DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
891
+ DECLARE_HYDROGEN_ACCESSOR(Compare)
892
+
893
+ Token::Value op() const { return hydrogen()->token(); }
894
+ };
895
+
896
+
897
+ class LCmpTAndBranch: public LControlInstruction<2, 0> {
898
+ public:
899
+ LCmpTAndBranch(LOperand* left, LOperand* right) {
900
+ inputs_[0] = left;
901
+ inputs_[1] = right;
902
+ }
903
+
904
+ DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch")
905
+ DECLARE_HYDROGEN_ACCESSOR(Compare)
906
+
907
+ Token::Value op() const { return hydrogen()->token(); }
908
+ };
909
+
910
+
911
+ class LIn: public LTemplateInstruction<1, 2, 0> {
912
+ public:
913
+ LIn(LOperand* key, LOperand* object) {
914
+ inputs_[0] = key;
915
+ inputs_[1] = object;
916
+ }
917
+
918
+ LOperand* key() { return inputs_[0]; }
919
+ LOperand* object() { return inputs_[1]; }
920
+
921
+ DECLARE_CONCRETE_INSTRUCTION(In, "in")
922
+ };
923
+
924
+
925
+ class LInstanceOf: public LTemplateInstruction<1, 2, 0> {
926
+ public:
927
+ LInstanceOf(LOperand* left, LOperand* right) {
928
+ inputs_[0] = left;
929
+ inputs_[1] = right;
930
+ }
931
+
932
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
933
+ };
934
+
935
+
936
+ class LInstanceOfAndBranch: public LControlInstruction<2, 0> {
937
+ public:
938
+ LInstanceOfAndBranch(LOperand* left, LOperand* right) {
939
+ inputs_[0] = left;
940
+ inputs_[1] = right;
941
+ }
942
+
943
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch")
944
+ };
945
+
946
+
947
+ class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> {
948
+ public:
949
+ LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) {
950
+ inputs_[0] = value;
951
+ temps_[0] = temp;
952
+ }
953
+
954
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
955
+ "instance-of-known-global")
956
+ DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
957
+
958
+ Handle<JSFunction> function() const { return hydrogen()->function(); }
959
+ };
960
+
961
+
962
+ class LBoundsCheck: public LTemplateInstruction<0, 2, 0> {
963
+ public:
964
+ LBoundsCheck(LOperand* index, LOperand* length) {
965
+ inputs_[0] = index;
966
+ inputs_[1] = length;
967
+ }
968
+
969
+ LOperand* index() { return inputs_[0]; }
970
+ LOperand* length() { return inputs_[1]; }
971
+
972
+ DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
973
+ };
974
+
975
+
976
+ class LBitI: public LTemplateInstruction<1, 2, 0> {
977
+ public:
978
+ LBitI(Token::Value op, LOperand* left, LOperand* right)
979
+ : op_(op) {
980
+ inputs_[0] = left;
981
+ inputs_[1] = right;
982
+ }
983
+
984
+ Token::Value op() const { return op_; }
985
+
986
+ DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
987
+
988
+ private:
989
+ Token::Value op_;
990
+ };
991
+
992
+
993
+ class LShiftI: public LTemplateInstruction<1, 2, 0> {
994
+ public:
995
+ LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
996
+ : op_(op), can_deopt_(can_deopt) {
997
+ inputs_[0] = left;
998
+ inputs_[1] = right;
999
+ }
1000
+
1001
+ Token::Value op() const { return op_; }
1002
+
1003
+ bool can_deopt() const { return can_deopt_; }
1004
+
1005
+ DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
1006
+
1007
+ private:
1008
+ Token::Value op_;
1009
+ bool can_deopt_;
1010
+ };
1011
+
1012
+
1013
+ class LSubI: public LTemplateInstruction<1, 2, 0> {
1014
+ public:
1015
+ LSubI(LOperand* left, LOperand* right) {
1016
+ inputs_[0] = left;
1017
+ inputs_[1] = right;
1018
+ }
1019
+
1020
+ DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
1021
+ DECLARE_HYDROGEN_ACCESSOR(Sub)
1022
+ };
1023
+
1024
+
1025
+ class LConstantI: public LTemplateInstruction<1, 0, 0> {
1026
+ public:
1027
+ DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
1028
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
1029
+
1030
+ int32_t value() const { return hydrogen()->Integer32Value(); }
1031
+ };
1032
+
1033
+
1034
+ class LConstantD: public LTemplateInstruction<1, 0, 1> {
1035
+ public:
1036
+ explicit LConstantD(LOperand* temp) {
1037
+ temps_[0] = temp;
1038
+ }
1039
+ DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
1040
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
1041
+
1042
+ double value() const { return hydrogen()->DoubleValue(); }
1043
+ };
1044
+
1045
+
1046
+ class LConstantT: public LTemplateInstruction<1, 0, 0> {
1047
+ public:
1048
+ DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
1049
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
1050
+
1051
+ Handle<Object> value() const { return hydrogen()->handle(); }
1052
+ };
1053
+
1054
+
1055
+ class LBranch: public LControlInstruction<1, 0> {
1056
+ public:
1057
+ explicit LBranch(LOperand* value) {
1058
+ inputs_[0] = value;
1059
+ }
1060
+
1061
+ DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
1062
+ DECLARE_HYDROGEN_ACCESSOR(Value)
1063
+
1064
+ virtual void PrintDataTo(StringStream* stream);
1065
+ };
1066
+
1067
+
1068
+ class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 0> {
1069
+ public:
1070
+ explicit LCmpMapAndBranch(LOperand* value) {
1071
+ inputs_[0] = value;
1072
+ }
1073
+
1074
+ DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1075
+ DECLARE_HYDROGEN_ACCESSOR(CompareMap)
1076
+
1077
+ virtual bool IsControl() const { return true; }
1078
+
1079
+ Handle<Map> map() const { return hydrogen()->map(); }
1080
+ int true_block_id() const {
1081
+ return hydrogen()->FirstSuccessor()->block_id();
1082
+ }
1083
+ int false_block_id() const {
1084
+ return hydrogen()->SecondSuccessor()->block_id();
1085
+ }
1086
+ };
1087
+
1088
+
1089
+ class LJSArrayLength: public LTemplateInstruction<1, 1, 0> {
1090
+ public:
1091
+ explicit LJSArrayLength(LOperand* value) {
1092
+ inputs_[0] = value;
1093
+ }
1094
+
1095
+ DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length")
1096
+ DECLARE_HYDROGEN_ACCESSOR(JSArrayLength)
1097
+ };
1098
+
1099
+
1100
+ class LExternalArrayLength: public LTemplateInstruction<1, 1, 0> {
1101
+ public:
1102
+ explicit LExternalArrayLength(LOperand* value) {
1103
+ inputs_[0] = value;
1104
+ }
1105
+
1106
+ DECLARE_CONCRETE_INSTRUCTION(ExternalArrayLength, "external-array-length")
1107
+ DECLARE_HYDROGEN_ACCESSOR(ExternalArrayLength)
1108
+ };
1109
+
1110
+
1111
+ class LFixedArrayLength: public LTemplateInstruction<1, 1, 0> {
1112
+ public:
1113
+ explicit LFixedArrayLength(LOperand* value) {
1114
+ inputs_[0] = value;
1115
+ }
1116
+
1117
+ DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length")
1118
+ DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength)
1119
+ };
1120
+
1121
+
1122
+ class LValueOf: public LTemplateInstruction<1, 1, 0> {
1123
+ public:
1124
+ explicit LValueOf(LOperand* value) {
1125
+ inputs_[0] = value;
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
+ explicit 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, 1> {
1415
+ public:
1416
+ LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) {
1417
+ inputs_[0] = context;
1418
+ inputs_[1] = value;
1419
+ temps_[0] = temp;
1420
+ }
1421
+
1422
+ DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
1423
+ DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
1424
+
1425
+ LOperand* context() { return InputAt(0); }
1426
+ LOperand* value() { return InputAt(1); }
1427
+ int slot_index() { return hydrogen()->slot_index(); }
1428
+ int needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
1429
+
1430
+ virtual void PrintDataTo(StringStream* stream);
1431
+ };
1432
+
1433
+
1434
+ class LPushArgument: public LTemplateInstruction<0, 1, 0> {
1435
+ public:
1436
+ explicit LPushArgument(LOperand* value) {
1437
+ inputs_[0] = value;
1438
+ }
1439
+
1440
+ DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
1441
+ };
1442
+
1443
+
1444
+ class LContext: public LTemplateInstruction<1, 0, 0> {
1445
+ public:
1446
+ DECLARE_CONCRETE_INSTRUCTION(Context, "context")
1447
+ };
1448
+
1449
+
1450
+ class LOuterContext: public LTemplateInstruction<1, 1, 0> {
1451
+ public:
1452
+ explicit LOuterContext(LOperand* context) {
1453
+ inputs_[0] = context;
1454
+ }
1455
+
1456
+ DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
1457
+
1458
+ LOperand* context() { return InputAt(0); }
1459
+ };
1460
+
1461
+
1462
+ class LGlobalObject: public LTemplateInstruction<1, 0, 0> {
1463
+ public:
1464
+ DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
1465
+ };
1466
+
1467
+
1468
+ class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> {
1469
+ public:
1470
+ explicit LGlobalReceiver(LOperand* global_object) {
1471
+ inputs_[0] = global_object;
1472
+ }
1473
+
1474
+ DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
1475
+
1476
+ LOperand* global() { return InputAt(0); }
1477
+ };
1478
+
1479
+
1480
+ class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> {
1481
+ public:
1482
+ DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function")
1483
+ DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction)
1484
+
1485
+ virtual void PrintDataTo(StringStream* stream);
1486
+
1487
+ Handle<JSFunction> function() { return hydrogen()->function(); }
1488
+ int arity() const { return hydrogen()->argument_count() - 1; }
1489
+ };
1490
+
1491
+
1492
+ class LInvokeFunction: public LTemplateInstruction<1, 1, 0> {
1493
+ public:
1494
+ explicit LInvokeFunction(LOperand* function) {
1495
+ inputs_[0] = function;
1496
+ }
1497
+
1498
+ DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1499
+ DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1500
+
1501
+ LOperand* function() { return inputs_[0]; }
1502
+
1503
+ virtual void PrintDataTo(StringStream* stream);
1504
+
1505
+ int arity() const { return hydrogen()->argument_count() - 1; }
1506
+ };
1507
+
1508
+
1509
+ class LCallKeyed: public LTemplateInstruction<1, 1, 0> {
1510
+ public:
1511
+ explicit LCallKeyed(LOperand* key) {
1512
+ inputs_[0] = key;
1513
+ }
1514
+
1515
+ DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
1516
+ DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
1517
+
1518
+ LOperand* key() { return inputs_[0]; }
1519
+
1520
+ virtual void PrintDataTo(StringStream* stream);
1521
+
1522
+ int arity() const { return hydrogen()->argument_count() - 1; }
1523
+ };
1524
+
1525
+
1526
+ class LCallNamed: public LTemplateInstruction<1, 0, 0> {
1527
+ public:
1528
+ DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
1529
+ DECLARE_HYDROGEN_ACCESSOR(CallNamed)
1530
+
1531
+ virtual void PrintDataTo(StringStream* stream);
1532
+
1533
+ Handle<String> name() const { return hydrogen()->name(); }
1534
+ int arity() const { return hydrogen()->argument_count() - 1; }
1535
+ };
1536
+
1537
+
1538
+ class LCallFunction: public LTemplateInstruction<1, 0, 0> {
1539
+ public:
1540
+ LCallFunction() {}
1541
+
1542
+ DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
1543
+ DECLARE_HYDROGEN_ACCESSOR(CallFunction)
1544
+
1545
+ int arity() const { return hydrogen()->argument_count() - 2; }
1546
+ };
1547
+
1548
+
1549
+ class LCallGlobal: public LTemplateInstruction<1, 0, 0> {
1550
+ public:
1551
+ DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
1552
+ DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
1553
+
1554
+ virtual void PrintDataTo(StringStream* stream);
1555
+
1556
+ Handle<String> name() const {return hydrogen()->name(); }
1557
+ int arity() const { return hydrogen()->argument_count() - 1; }
1558
+ };
1559
+
1560
+
1561
+ class LCallKnownGlobal: public LTemplateInstruction<1, 0, 0> {
1562
+ public:
1563
+ DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
1564
+ DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal)
1565
+
1566
+ virtual void PrintDataTo(StringStream* stream);
1567
+
1568
+ Handle<JSFunction> target() const { return hydrogen()->target(); }
1569
+ int arity() const { return hydrogen()->argument_count() - 1; }
1570
+ };
1571
+
1572
+
1573
+ class LCallNew: public LTemplateInstruction<1, 1, 0> {
1574
+ public:
1575
+ explicit LCallNew(LOperand* constructor) {
1576
+ inputs_[0] = constructor;
1577
+ }
1578
+
1579
+ DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
1580
+ DECLARE_HYDROGEN_ACCESSOR(CallNew)
1581
+
1582
+ virtual void PrintDataTo(StringStream* stream);
1583
+
1584
+ int arity() const { return hydrogen()->argument_count() - 1; }
1585
+ };
1586
+
1587
+
1588
+ class LCallRuntime: public LTemplateInstruction<1, 0, 0> {
1589
+ public:
1590
+ DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
1591
+ DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
1592
+
1593
+ const Runtime::Function* function() const { return hydrogen()->function(); }
1594
+ int arity() const { return hydrogen()->argument_count(); }
1595
+ };
1596
+
1597
+
1598
+ class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> {
1599
+ public:
1600
+ explicit LInteger32ToDouble(LOperand* value) {
1601
+ inputs_[0] = value;
1602
+ }
1603
+
1604
+ DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
1605
+ };
1606
+
1607
+
1608
+ class LNumberTagI: public LTemplateInstruction<1, 1, 0> {
1609
+ public:
1610
+ explicit LNumberTagI(LOperand* value) {
1611
+ inputs_[0] = value;
1612
+ }
1613
+
1614
+ DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
1615
+ };
1616
+
1617
+
1618
+ class LNumberTagD: public LTemplateInstruction<1, 1, 1> {
1619
+ public:
1620
+ explicit LNumberTagD(LOperand* value, LOperand* temp) {
1621
+ inputs_[0] = value;
1622
+ temps_[0] = temp;
1623
+ }
1624
+
1625
+ DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
1626
+ };
1627
+
1628
+
1629
+ // Sometimes truncating conversion from a tagged value to an int32.
1630
+ class LDoubleToI: public LTemplateInstruction<1, 1, 0> {
1631
+ public:
1632
+ explicit LDoubleToI(LOperand* value) {
1633
+ inputs_[0] = value;
1634
+ }
1635
+
1636
+ DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
1637
+ DECLARE_HYDROGEN_ACCESSOR(Change)
1638
+
1639
+ bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1640
+ };
1641
+
1642
+
1643
+ // Truncating conversion from a tagged value to an int32.
1644
+ class LTaggedToI: public LTemplateInstruction<1, 1, 1> {
1645
+ public:
1646
+ LTaggedToI(LOperand* value, LOperand* temp) {
1647
+ inputs_[0] = value;
1648
+ temps_[0] = temp;
1649
+ }
1650
+
1651
+ DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
1652
+ DECLARE_HYDROGEN_ACCESSOR(Change)
1653
+
1654
+ bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1655
+ };
1656
+
1657
+
1658
+ class LSmiTag: public LTemplateInstruction<1, 1, 0> {
1659
+ public:
1660
+ explicit LSmiTag(LOperand* value) {
1661
+ inputs_[0] = value;
1662
+ }
1663
+
1664
+ DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
1665
+ };
1666
+
1667
+
1668
+ class LNumberUntagD: public LTemplateInstruction<1, 1, 0> {
1669
+ public:
1670
+ explicit LNumberUntagD(LOperand* value) {
1671
+ inputs_[0] = value;
1672
+ }
1673
+
1674
+ DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
1675
+ };
1676
+
1677
+
1678
+ class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
1679
+ public:
1680
+ LSmiUntag(LOperand* value, bool needs_check)
1681
+ : needs_check_(needs_check) {
1682
+ inputs_[0] = value;
1683
+ }
1684
+
1685
+ DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
1686
+
1687
+ bool needs_check() const { return needs_check_; }
1688
+
1689
+ private:
1690
+ bool needs_check_;
1691
+ };
1692
+
1693
+
1694
+ class LStoreNamedField: public LTemplateInstruction<0, 2, 1> {
1695
+ public:
1696
+ LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) {
1697
+ inputs_[0] = object;
1698
+ inputs_[1] = value;
1699
+ temps_[0] = temp;
1700
+ }
1701
+
1702
+ DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
1703
+ DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
1704
+
1705
+ virtual void PrintDataTo(StringStream* stream);
1706
+
1707
+ LOperand* object() { return inputs_[0]; }
1708
+ LOperand* value() { return inputs_[1]; }
1709
+
1710
+ Handle<Object> name() const { return hydrogen()->name(); }
1711
+ bool is_in_object() { return hydrogen()->is_in_object(); }
1712
+ int offset() { return hydrogen()->offset(); }
1713
+ bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
1714
+ Handle<Map> transition() const { return hydrogen()->transition(); }
1715
+ };
1716
+
1717
+
1718
+ class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> {
1719
+ public:
1720
+ LStoreNamedGeneric(LOperand* object, LOperand* value) {
1721
+ inputs_[0] = object;
1722
+ inputs_[1] = value;
1723
+ }
1724
+
1725
+ DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
1726
+ DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
1727
+
1728
+ virtual void PrintDataTo(StringStream* stream);
1729
+
1730
+ LOperand* object() { return inputs_[0]; }
1731
+ LOperand* value() { return inputs_[1]; }
1732
+ Handle<Object> name() const { return hydrogen()->name(); }
1733
+ bool strict_mode() { return hydrogen()->strict_mode(); }
1734
+ };
1735
+
1736
+
1737
+ class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> {
1738
+ public:
1739
+ LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) {
1740
+ inputs_[0] = obj;
1741
+ inputs_[1] = key;
1742
+ inputs_[2] = val;
1743
+ }
1744
+
1745
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
1746
+ "store-keyed-fast-element")
1747
+ DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
1748
+
1749
+ virtual void PrintDataTo(StringStream* stream);
1750
+
1751
+ LOperand* object() { return inputs_[0]; }
1752
+ LOperand* key() { return inputs_[1]; }
1753
+ LOperand* value() { return inputs_[2]; }
1754
+ };
1755
+
1756
+
1757
+ class LStoreKeyedSpecializedArrayElement: public LTemplateInstruction<0, 3, 0> {
1758
+ public:
1759
+ LStoreKeyedSpecializedArrayElement(LOperand* external_pointer,
1760
+ LOperand* key,
1761
+ LOperand* val) {
1762
+ inputs_[0] = external_pointer;
1763
+ inputs_[1] = key;
1764
+ inputs_[2] = val;
1765
+ }
1766
+
1767
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement,
1768
+ "store-keyed-specialized-array-element")
1769
+ DECLARE_HYDROGEN_ACCESSOR(StoreKeyedSpecializedArrayElement)
1770
+
1771
+ LOperand* external_pointer() { return inputs_[0]; }
1772
+ LOperand* key() { return inputs_[1]; }
1773
+ LOperand* value() { return inputs_[2]; }
1774
+ ExternalArrayType array_type() const {
1775
+ return hydrogen()->array_type();
1776
+ }
1777
+ };
1778
+
1779
+
1780
+ class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> {
1781
+ public:
1782
+ LStoreKeyedGeneric(LOperand* object, LOperand* key, LOperand* value) {
1783
+ inputs_[0] = object;
1784
+ inputs_[1] = key;
1785
+ inputs_[2] = value;
1786
+ }
1787
+
1788
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
1789
+ DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
1790
+
1791
+ virtual void PrintDataTo(StringStream* stream);
1792
+
1793
+ LOperand* object() { return inputs_[0]; }
1794
+ LOperand* key() { return inputs_[1]; }
1795
+ LOperand* value() { return inputs_[2]; }
1796
+ bool strict_mode() { return hydrogen()->strict_mode(); }
1797
+ };
1798
+
1799
+
1800
+ class LStringAdd: public LTemplateInstruction<1, 2, 0> {
1801
+ public:
1802
+ LStringAdd(LOperand* left, LOperand* right) {
1803
+ inputs_[0] = left;
1804
+ inputs_[1] = right;
1805
+ }
1806
+
1807
+ DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
1808
+ DECLARE_HYDROGEN_ACCESSOR(StringAdd)
1809
+
1810
+ LOperand* left() { return inputs_[0]; }
1811
+ LOperand* right() { return inputs_[1]; }
1812
+ };
1813
+
1814
+
1815
+ class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> {
1816
+ public:
1817
+ LStringCharCodeAt(LOperand* string, LOperand* index) {
1818
+ inputs_[0] = string;
1819
+ inputs_[1] = index;
1820
+ }
1821
+
1822
+ DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
1823
+ DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
1824
+
1825
+ LOperand* string() { return inputs_[0]; }
1826
+ LOperand* index() { return inputs_[1]; }
1827
+ };
1828
+
1829
+
1830
+ class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> {
1831
+ public:
1832
+ explicit LStringCharFromCode(LOperand* char_code) {
1833
+ inputs_[0] = char_code;
1834
+ }
1835
+
1836
+ DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
1837
+ DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
1838
+
1839
+ LOperand* char_code() { return inputs_[0]; }
1840
+ };
1841
+
1842
+
1843
+ class LStringLength: public LTemplateInstruction<1, 1, 0> {
1844
+ public:
1845
+ explicit LStringLength(LOperand* string) {
1846
+ inputs_[0] = string;
1847
+ }
1848
+
1849
+ DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length")
1850
+ DECLARE_HYDROGEN_ACCESSOR(StringLength)
1851
+
1852
+ LOperand* string() { return inputs_[0]; }
1853
+ };
1854
+
1855
+
1856
+ class LCheckFunction: public LTemplateInstruction<0, 1, 0> {
1857
+ public:
1858
+ explicit LCheckFunction(LOperand* value) {
1859
+ inputs_[0] = value;
1860
+ }
1861
+
1862
+ DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function")
1863
+ DECLARE_HYDROGEN_ACCESSOR(CheckFunction)
1864
+ };
1865
+
1866
+
1867
+ class LCheckInstanceType: public LTemplateInstruction<0, 1, 0> {
1868
+ public:
1869
+ explicit LCheckInstanceType(LOperand* value) {
1870
+ inputs_[0] = value;
1871
+ }
1872
+
1873
+ DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
1874
+ DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
1875
+ };
1876
+
1877
+
1878
+ class LCheckMap: public LTemplateInstruction<0, 1, 0> {
1879
+ public:
1880
+ explicit LCheckMap(LOperand* value) {
1881
+ inputs_[0] = value;
1882
+ }
1883
+
1884
+ DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map")
1885
+ DECLARE_HYDROGEN_ACCESSOR(CheckMap)
1886
+ };
1887
+
1888
+
1889
+ class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 1> {
1890
+ public:
1891
+ explicit LCheckPrototypeMaps(LOperand* temp) {
1892
+ temps_[0] = temp;
1893
+ }
1894
+
1895
+ DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps")
1896
+ DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps)
1897
+
1898
+ Handle<JSObject> prototype() const { return hydrogen()->prototype(); }
1899
+ Handle<JSObject> holder() const { return hydrogen()->holder(); }
1900
+ };
1901
+
1902
+
1903
+ class LCheckSmi: public LTemplateInstruction<0, 1, 0> {
1904
+ public:
1905
+ explicit LCheckSmi(LOperand* value) {
1906
+ inputs_[0] = value;
1907
+ }
1908
+
1909
+ DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
1910
+ };
1911
+
1912
+
1913
+ class LClampDToUint8: public LTemplateInstruction<1, 1, 1> {
1914
+ public:
1915
+ LClampDToUint8(LOperand* value, LOperand* temp) {
1916
+ inputs_[0] = value;
1917
+ temps_[0] = temp;
1918
+ }
1919
+
1920
+ LOperand* unclamped() { return inputs_[0]; }
1921
+
1922
+ DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
1923
+ };
1924
+
1925
+
1926
+ class LClampIToUint8: public LTemplateInstruction<1, 1, 0> {
1927
+ public:
1928
+ explicit LClampIToUint8(LOperand* value) {
1929
+ inputs_[0] = value;
1930
+ }
1931
+
1932
+ LOperand* unclamped() { return inputs_[0]; }
1933
+
1934
+ DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
1935
+ };
1936
+
1937
+
1938
+ class LClampTToUint8: public LTemplateInstruction<1, 1, 2> {
1939
+ public:
1940
+ LClampTToUint8(LOperand* value,
1941
+ LOperand* temp,
1942
+ LOperand* temp2) {
1943
+ inputs_[0] = value;
1944
+ temps_[0] = temp;
1945
+ temps_[1] = temp2;
1946
+ }
1947
+
1948
+ LOperand* unclamped() { return inputs_[0]; }
1949
+
1950
+ DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
1951
+ };
1952
+
1953
+
1954
+ class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> {
1955
+ public:
1956
+ explicit LCheckNonSmi(LOperand* value) {
1957
+ inputs_[0] = value;
1958
+ }
1959
+
1960
+ DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
1961
+ };
1962
+
1963
+
1964
+ class LArrayLiteral: public LTemplateInstruction<1, 0, 0> {
1965
+ public:
1966
+ DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array-literal")
1967
+ DECLARE_HYDROGEN_ACCESSOR(ArrayLiteral)
1968
+ };
1969
+
1970
+
1971
+ class LObjectLiteral: public LTemplateInstruction<1, 0, 0> {
1972
+ public:
1973
+ DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal")
1974
+ DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral)
1975
+ };
1976
+
1977
+
1978
+ class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> {
1979
+ public:
1980
+ DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
1981
+ DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
1982
+ };
1983
+
1984
+
1985
+ class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> {
1986
+ public:
1987
+ DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
1988
+ DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
1989
+
1990
+ Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); }
1991
+ };
1992
+
1993
+
1994
+ class LToFastProperties: public LTemplateInstruction<1, 1, 0> {
1995
+ public:
1996
+ explicit LToFastProperties(LOperand* value) {
1997
+ inputs_[0] = value;
1998
+ }
1999
+
2000
+ DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties")
2001
+ DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
2002
+ };
2003
+
2004
+
2005
+ class LTypeof: public LTemplateInstruction<1, 1, 0> {
2006
+ public:
2007
+ explicit LTypeof(LOperand* value) {
2008
+ inputs_[0] = value;
2009
+ }
2010
+
2011
+ DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
2012
+ };
2013
+
2014
+
2015
+ class LTypeofIs: public LTemplateInstruction<1, 1, 0> {
2016
+ public:
2017
+ explicit LTypeofIs(LOperand* value) {
2018
+ inputs_[0] = value;
2019
+ }
2020
+
2021
+ DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is")
2022
+ DECLARE_HYDROGEN_ACCESSOR(TypeofIs)
2023
+
2024
+ Handle<String> type_literal() { return hydrogen()->type_literal(); }
2025
+
2026
+ virtual void PrintDataTo(StringStream* stream);
2027
+ };
2028
+
2029
+
2030
+ class LTypeofIsAndBranch: public LControlInstruction<1, 0> {
2031
+ public:
2032
+ explicit LTypeofIsAndBranch(LOperand* value) {
2033
+ inputs_[0] = value;
2034
+ }
2035
+
2036
+ DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
2037
+ DECLARE_HYDROGEN_ACCESSOR(TypeofIs)
2038
+
2039
+ Handle<String> type_literal() { return hydrogen()->type_literal(); }
2040
+
2041
+ virtual void PrintDataTo(StringStream* stream);
2042
+ };
2043
+
2044
+
2045
+ class LIsConstructCall: public LTemplateInstruction<1, 0, 0> {
2046
+ public:
2047
+ DECLARE_CONCRETE_INSTRUCTION(IsConstructCall, "is-construct-call")
2048
+ DECLARE_HYDROGEN_ACCESSOR(IsConstructCall)
2049
+ };
2050
+
2051
+
2052
+ class LIsConstructCallAndBranch: public LControlInstruction<0, 1> {
2053
+ public:
2054
+ explicit LIsConstructCallAndBranch(LOperand* temp) {
2055
+ temps_[0] = temp;
2056
+ }
2057
+
2058
+ DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
2059
+ "is-construct-call-and-branch")
2060
+ };
2061
+
2062
+
2063
+ class LDeleteProperty: public LTemplateInstruction<1, 2, 0> {
2064
+ public:
2065
+ LDeleteProperty(LOperand* obj, LOperand* key) {
2066
+ inputs_[0] = obj;
2067
+ inputs_[1] = key;
2068
+ }
2069
+
2070
+ DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
2071
+
2072
+ LOperand* object() { return inputs_[0]; }
2073
+ LOperand* key() { return inputs_[1]; }
2074
+ };
2075
+
2076
+
2077
+ class LOsrEntry: public LTemplateInstruction<0, 0, 0> {
2078
+ public:
2079
+ LOsrEntry();
2080
+
2081
+ DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
2082
+
2083
+ LOperand** SpilledRegisterArray() { return register_spills_; }
2084
+ LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; }
2085
+
2086
+ void MarkSpilledRegister(int allocation_index, LOperand* spill_operand);
2087
+ void MarkSpilledDoubleRegister(int allocation_index,
2088
+ LOperand* spill_operand);
2089
+
2090
+ private:
2091
+ // Arrays of spill slot operands for registers with an assigned spill
2092
+ // slot, i.e., that must also be restored to the spill slot on OSR entry.
2093
+ // NULL if the register has no assigned spill slot. Indexed by allocation
2094
+ // index.
2095
+ LOperand* register_spills_[Register::kNumAllocatableRegisters];
2096
+ LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters];
2097
+ };
2098
+
2099
+
2100
+ class LStackCheck: public LTemplateInstruction<0, 0, 0> {
2101
+ public:
2102
+ DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
2103
+ };
2104
+
2105
+
2106
+ class LChunkBuilder;
2107
+ class LChunk: public ZoneObject {
2108
+ public:
2109
+ explicit LChunk(CompilationInfo* info, HGraph* graph)
2110
+ : spill_slot_count_(0),
2111
+ info_(info),
2112
+ graph_(graph),
2113
+ instructions_(32),
2114
+ pointer_maps_(8),
2115
+ inlined_closures_(1) { }
2116
+
2117
+ void AddInstruction(LInstruction* instruction, HBasicBlock* block);
2118
+ LConstantOperand* DefineConstantOperand(HConstant* constant);
2119
+ Handle<Object> LookupLiteral(LConstantOperand* operand) const;
2120
+ Representation LookupLiteralRepresentation(LConstantOperand* operand) const;
2121
+
2122
+ int GetNextSpillIndex(bool is_double);
2123
+ LOperand* GetNextSpillSlot(bool is_double);
2124
+
2125
+ int ParameterAt(int index);
2126
+ int GetParameterStackSlot(int index) const;
2127
+ int spill_slot_count() const { return spill_slot_count_; }
2128
+ CompilationInfo* info() const { return info_; }
2129
+ HGraph* graph() const { return graph_; }
2130
+ const ZoneList<LInstruction*>* instructions() const { return &instructions_; }
2131
+ void AddGapMove(int index, LOperand* from, LOperand* to);
2132
+ LGap* GetGapAt(int index) const;
2133
+ bool IsGapAt(int index) const;
2134
+ int NearestGapPos(int index) const;
2135
+ void MarkEmptyBlocks();
2136
+ const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; }
2137
+ LLabel* GetLabel(int block_id) const {
2138
+ HBasicBlock* block = graph_->blocks()->at(block_id);
2139
+ int first_instruction = block->first_instruction_index();
2140
+ return LLabel::cast(instructions_[first_instruction]);
2141
+ }
2142
+ int LookupDestination(int block_id) const {
2143
+ LLabel* cur = GetLabel(block_id);
2144
+ while (cur->replacement() != NULL) {
2145
+ cur = cur->replacement();
2146
+ }
2147
+ return cur->block_id();
2148
+ }
2149
+ Label* GetAssemblyLabel(int block_id) const {
2150
+ LLabel* label = GetLabel(block_id);
2151
+ ASSERT(!label->HasReplacement());
2152
+ return label->label();
2153
+ }
2154
+
2155
+ const ZoneList<Handle<JSFunction> >* inlined_closures() const {
2156
+ return &inlined_closures_;
2157
+ }
2158
+
2159
+ void AddInlinedClosure(Handle<JSFunction> closure) {
2160
+ inlined_closures_.Add(closure);
2161
+ }
2162
+
2163
+ private:
2164
+ int spill_slot_count_;
2165
+ CompilationInfo* info_;
2166
+ HGraph* const graph_;
2167
+ ZoneList<LInstruction*> instructions_;
2168
+ ZoneList<LPointerMap*> pointer_maps_;
2169
+ ZoneList<Handle<JSFunction> > inlined_closures_;
2170
+ };
2171
+
2172
+
2173
+ class LChunkBuilder BASE_EMBEDDED {
2174
+ public:
2175
+ LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
2176
+ : chunk_(NULL),
2177
+ info_(info),
2178
+ graph_(graph),
2179
+ status_(UNUSED),
2180
+ current_instruction_(NULL),
2181
+ current_block_(NULL),
2182
+ next_block_(NULL),
2183
+ argument_count_(0),
2184
+ allocator_(allocator),
2185
+ position_(RelocInfo::kNoPosition),
2186
+ instruction_pending_deoptimization_environment_(NULL),
2187
+ pending_deoptimization_ast_id_(AstNode::kNoNumber) { }
2188
+
2189
+ // Build the sequence for the graph.
2190
+ LChunk* Build();
2191
+
2192
+ // Declare methods that deal with the individual node types.
2193
+ #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2194
+ HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
2195
+ #undef DECLARE_DO
2196
+
2197
+ private:
2198
+ enum Status {
2199
+ UNUSED,
2200
+ BUILDING,
2201
+ DONE,
2202
+ ABORTED
2203
+ };
2204
+
2205
+ LChunk* chunk() const { return chunk_; }
2206
+ CompilationInfo* info() const { return info_; }
2207
+ HGraph* graph() const { return graph_; }
2208
+
2209
+ bool is_unused() const { return status_ == UNUSED; }
2210
+ bool is_building() const { return status_ == BUILDING; }
2211
+ bool is_done() const { return status_ == DONE; }
2212
+ bool is_aborted() const { return status_ == ABORTED; }
2213
+
2214
+ void Abort(const char* format, ...);
2215
+
2216
+ // Methods for getting operands for Use / Define / Temp.
2217
+ LRegister* ToOperand(Register reg);
2218
+ LUnallocated* ToUnallocated(Register reg);
2219
+ LUnallocated* ToUnallocated(XMMRegister reg);
2220
+
2221
+ // Methods for setting up define-use relationships.
2222
+ MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand);
2223
+ MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register);
2224
+ MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value,
2225
+ XMMRegister fixed_register);
2226
+
2227
+ // A value that is guaranteed to be allocated to a register.
2228
+ // Operand created by UseRegister is guaranteed to be live until the end of
2229
+ // instruction. This means that register allocator will not reuse it's
2230
+ // register for any other operand inside instruction.
2231
+ // Operand created by UseRegisterAtStart is guaranteed to be live only at
2232
+ // instruction start. Register allocator is free to assign the same register
2233
+ // to some other operand used inside instruction (i.e. temporary or
2234
+ // output).
2235
+ MUST_USE_RESULT LOperand* UseRegister(HValue* value);
2236
+ MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value);
2237
+
2238
+ // An input operand in a register that may be trashed.
2239
+ MUST_USE_RESULT LOperand* UseTempRegister(HValue* value);
2240
+
2241
+ // An input operand in a register or stack slot.
2242
+ MUST_USE_RESULT LOperand* Use(HValue* value);
2243
+ MUST_USE_RESULT LOperand* UseAtStart(HValue* value);
2244
+
2245
+ // An input operand in a register, stack slot or a constant operand.
2246
+ MUST_USE_RESULT LOperand* UseOrConstant(HValue* value);
2247
+ MUST_USE_RESULT LOperand* UseOrConstantAtStart(HValue* value);
2248
+
2249
+ // An input operand in a register or a constant operand.
2250
+ MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value);
2251
+ MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value);
2252
+
2253
+ // An input operand in register, stack slot or a constant operand.
2254
+ // Will not be moved to a register even if one is freely available.
2255
+ MUST_USE_RESULT LOperand* UseAny(HValue* value);
2256
+
2257
+ // Temporary operand that must be in a register.
2258
+ MUST_USE_RESULT LUnallocated* TempRegister();
2259
+ MUST_USE_RESULT LOperand* FixedTemp(Register reg);
2260
+ MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg);
2261
+
2262
+ // Methods for setting up define-use relationships.
2263
+ // Return the same instruction that they are passed.
2264
+ template<int I, int T>
2265
+ LInstruction* Define(LTemplateInstruction<1, I, T>* instr,
2266
+ LUnallocated* result);
2267
+ template<int I, int T>
2268
+ LInstruction* Define(LTemplateInstruction<1, I, T>* instr);
2269
+ template<int I, int T>
2270
+ LInstruction* DefineAsRegister(LTemplateInstruction<1, I, T>* instr);
2271
+ template<int I, int T>
2272
+ LInstruction* DefineAsSpilled(LTemplateInstruction<1, I, T>* instr,
2273
+ int index);
2274
+ template<int I, int T>
2275
+ LInstruction* DefineSameAsFirst(LTemplateInstruction<1, I, T>* instr);
2276
+ template<int I, int T>
2277
+ LInstruction* DefineFixed(LTemplateInstruction<1, I, T>* instr,
2278
+ Register reg);
2279
+ template<int I, int T>
2280
+ LInstruction* DefineFixedDouble(LTemplateInstruction<1, I, T>* instr,
2281
+ XMMRegister reg);
2282
+ LInstruction* AssignEnvironment(LInstruction* instr);
2283
+ LInstruction* AssignPointerMap(LInstruction* instr);
2284
+
2285
+ enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
2286
+
2287
+ // By default we assume that instruction sequences generated for calls
2288
+ // cannot deoptimize eagerly and we do not attach environment to this
2289
+ // instruction.
2290
+ LInstruction* MarkAsCall(
2291
+ LInstruction* instr,
2292
+ HInstruction* hinstr,
2293
+ CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
2294
+ LInstruction* MarkAsSaveDoubles(LInstruction* instr);
2295
+
2296
+ LInstruction* SetInstructionPendingDeoptimizationEnvironment(
2297
+ LInstruction* instr, int ast_id);
2298
+ void ClearInstructionPendingDeoptimizationEnvironment();
2299
+
2300
+ LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env);
2301
+
2302
+ void VisitInstruction(HInstruction* current);
2303
+
2304
+ void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
2305
+ LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr);
2306
+ LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
2307
+ LInstruction* DoArithmeticD(Token::Value op,
2308
+ HArithmeticBinaryOperation* instr);
2309
+ LInstruction* DoArithmeticT(Token::Value op,
2310
+ HArithmeticBinaryOperation* instr);
2311
+
2312
+ LChunk* chunk_;
2313
+ CompilationInfo* info_;
2314
+ HGraph* const graph_;
2315
+ Status status_;
2316
+ HInstruction* current_instruction_;
2317
+ HBasicBlock* current_block_;
2318
+ HBasicBlock* next_block_;
2319
+ int argument_count_;
2320
+ LAllocator* allocator_;
2321
+ int position_;
2322
+ LInstruction* instruction_pending_deoptimization_environment_;
2323
+ int pending_deoptimization_ast_id_;
2324
+
2325
+ DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2326
+ };
2327
+
2328
+ #undef DECLARE_HYDROGEN_ACCESSOR
2329
+ #undef DECLARE_CONCRETE_INSTRUCTION
2330
+
2331
+ } } // namespace v8::int
2332
+
2333
+ #endif // V8_X64_LITHIUM_X64_H_