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,1375 @@
1
+ // Copyright (c) 1994-2006 Sun Microsystems Inc.
2
+ // All Rights Reserved.
3
+ //
4
+ // Redistribution and use in source and binary forms, with or without
5
+ // modification, are permitted provided that the following conditions
6
+ // are met:
7
+ //
8
+ // - Redistributions of source code must retain the above copyright notice,
9
+ // this list of conditions and the following disclaimer.
10
+ //
11
+ // - Redistribution in binary form must reproduce the above copyright
12
+ // notice, this list of conditions and the following disclaimer in the
13
+ // documentation and/or other materials provided with the
14
+ // distribution.
15
+ //
16
+ // - Neither the name of Sun Microsystems or the names of contributors may
17
+ // be used to endorse or promote products derived from this software without
18
+ // specific prior written permission.
19
+ //
20
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23
+ // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
+ // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25
+ // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26
+ // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27
+ // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28
+ // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29
+ // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
31
+ // OF THE POSSIBILITY OF SUCH DAMAGE.
32
+
33
+ // The original source code covered by the above license above has been
34
+ // modified significantly by Google Inc.
35
+ // Copyright 2011 the V8 project authors. All rights reserved.
36
+
37
+ // A light-weight ARM Assembler
38
+ // Generates user mode instructions for the ARM architecture up to version 5
39
+
40
+ #ifndef V8_ARM_ASSEMBLER_ARM_H_
41
+ #define V8_ARM_ASSEMBLER_ARM_H_
42
+ #include <stdio.h>
43
+ #include "assembler.h"
44
+ #include "constants-arm.h"
45
+ #include "serialize.h"
46
+
47
+ namespace v8 {
48
+ namespace internal {
49
+
50
+ // CPU Registers.
51
+ //
52
+ // 1) We would prefer to use an enum, but enum values are assignment-
53
+ // compatible with int, which has caused code-generation bugs.
54
+ //
55
+ // 2) We would prefer to use a class instead of a struct but we don't like
56
+ // the register initialization to depend on the particular initialization
57
+ // order (which appears to be different on OS X, Linux, and Windows for the
58
+ // installed versions of C++ we tried). Using a struct permits C-style
59
+ // "initialization". Also, the Register objects cannot be const as this
60
+ // forces initialization stubs in MSVC, making us dependent on initialization
61
+ // order.
62
+ //
63
+ // 3) By not using an enum, we are possibly preventing the compiler from
64
+ // doing certain constant folds, which may significantly reduce the
65
+ // code generated for some assembly instructions (because they boil down
66
+ // to a few constants). If this is a problem, we could change the code
67
+ // such that we use an enum in optimized mode, and the struct in debug
68
+ // mode. This way we get the compile-time error checking in debug mode
69
+ // and best performance in optimized code.
70
+
71
+ // Core register
72
+ struct Register {
73
+ static const int kNumRegisters = 16;
74
+ static const int kNumAllocatableRegisters = 8;
75
+ static const int kSizeInBytes = 4;
76
+
77
+ static int ToAllocationIndex(Register reg) {
78
+ ASSERT(reg.code() < kNumAllocatableRegisters);
79
+ return reg.code();
80
+ }
81
+
82
+ static Register FromAllocationIndex(int index) {
83
+ ASSERT(index >= 0 && index < kNumAllocatableRegisters);
84
+ return from_code(index);
85
+ }
86
+
87
+ static const char* AllocationIndexToString(int index) {
88
+ ASSERT(index >= 0 && index < kNumAllocatableRegisters);
89
+ const char* const names[] = {
90
+ "r0",
91
+ "r1",
92
+ "r2",
93
+ "r3",
94
+ "r4",
95
+ "r5",
96
+ "r6",
97
+ "r7",
98
+ };
99
+ return names[index];
100
+ }
101
+
102
+ static Register from_code(int code) {
103
+ Register r = { code };
104
+ return r;
105
+ }
106
+
107
+ bool is_valid() const { return 0 <= code_ && code_ < kNumRegisters; }
108
+ bool is(Register reg) const { return code_ == reg.code_; }
109
+ int code() const {
110
+ ASSERT(is_valid());
111
+ return code_;
112
+ }
113
+ int bit() const {
114
+ ASSERT(is_valid());
115
+ return 1 << code_;
116
+ }
117
+
118
+ void set_code(int code) {
119
+ code_ = code;
120
+ ASSERT(is_valid());
121
+ }
122
+
123
+ // Unfortunately we can't make this private in a struct.
124
+ int code_;
125
+ };
126
+
127
+ const Register no_reg = { -1 };
128
+
129
+ const Register r0 = { 0 };
130
+ const Register r1 = { 1 };
131
+ const Register r2 = { 2 };
132
+ const Register r3 = { 3 };
133
+ const Register r4 = { 4 };
134
+ const Register r5 = { 5 };
135
+ const Register r6 = { 6 };
136
+ const Register r7 = { 7 };
137
+ const Register r8 = { 8 }; // Used as context register.
138
+ const Register r9 = { 9 }; // Used as lithium codegen scratch register.
139
+ const Register r10 = { 10 }; // Used as roots register.
140
+ const Register fp = { 11 };
141
+ const Register ip = { 12 };
142
+ const Register sp = { 13 };
143
+ const Register lr = { 14 };
144
+ const Register pc = { 15 };
145
+
146
+ // Single word VFP register.
147
+ struct SwVfpRegister {
148
+ bool is_valid() const { return 0 <= code_ && code_ < 32; }
149
+ bool is(SwVfpRegister reg) const { return code_ == reg.code_; }
150
+ int code() const {
151
+ ASSERT(is_valid());
152
+ return code_;
153
+ }
154
+ int bit() const {
155
+ ASSERT(is_valid());
156
+ return 1 << code_;
157
+ }
158
+ void split_code(int* vm, int* m) const {
159
+ ASSERT(is_valid());
160
+ *m = code_ & 0x1;
161
+ *vm = code_ >> 1;
162
+ }
163
+
164
+ int code_;
165
+ };
166
+
167
+
168
+ // Double word VFP register.
169
+ struct DwVfpRegister {
170
+ // d0 has been excluded from allocation. This is following ia32
171
+ // where xmm0 is excluded. This should be revisited.
172
+ // Currently d0 is used as a scratch register.
173
+ // d1 has also been excluded from allocation to be used as a scratch
174
+ // register as well.
175
+ static const int kNumRegisters = 16;
176
+ static const int kNumAllocatableRegisters = 15;
177
+
178
+ static int ToAllocationIndex(DwVfpRegister reg) {
179
+ ASSERT(reg.code() != 0);
180
+ return reg.code() - 1;
181
+ }
182
+
183
+ static DwVfpRegister FromAllocationIndex(int index) {
184
+ ASSERT(index >= 0 && index < kNumAllocatableRegisters);
185
+ return from_code(index + 1);
186
+ }
187
+
188
+ static const char* AllocationIndexToString(int index) {
189
+ ASSERT(index >= 0 && index < kNumAllocatableRegisters);
190
+ const char* const names[] = {
191
+ "d1",
192
+ "d2",
193
+ "d3",
194
+ "d4",
195
+ "d5",
196
+ "d6",
197
+ "d7",
198
+ "d8",
199
+ "d9",
200
+ "d10",
201
+ "d11",
202
+ "d12",
203
+ "d13",
204
+ "d14",
205
+ "d15"
206
+ };
207
+ return names[index];
208
+ }
209
+
210
+ static DwVfpRegister from_code(int code) {
211
+ DwVfpRegister r = { code };
212
+ return r;
213
+ }
214
+
215
+ // Supporting d0 to d15, can be later extended to d31.
216
+ bool is_valid() const { return 0 <= code_ && code_ < 16; }
217
+ bool is(DwVfpRegister reg) const { return code_ == reg.code_; }
218
+ SwVfpRegister low() const {
219
+ SwVfpRegister reg;
220
+ reg.code_ = code_ * 2;
221
+
222
+ ASSERT(reg.is_valid());
223
+ return reg;
224
+ }
225
+ SwVfpRegister high() const {
226
+ SwVfpRegister reg;
227
+ reg.code_ = (code_ * 2) + 1;
228
+
229
+ ASSERT(reg.is_valid());
230
+ return reg;
231
+ }
232
+ int code() const {
233
+ ASSERT(is_valid());
234
+ return code_;
235
+ }
236
+ int bit() const {
237
+ ASSERT(is_valid());
238
+ return 1 << code_;
239
+ }
240
+ void split_code(int* vm, int* m) const {
241
+ ASSERT(is_valid());
242
+ *m = (code_ & 0x10) >> 4;
243
+ *vm = code_ & 0x0F;
244
+ }
245
+
246
+ int code_;
247
+ };
248
+
249
+
250
+ typedef DwVfpRegister DoubleRegister;
251
+
252
+
253
+ // Support for the VFP registers s0 to s31 (d0 to d15).
254
+ // Note that "s(N):s(N+1)" is the same as "d(N/2)".
255
+ const SwVfpRegister s0 = { 0 };
256
+ const SwVfpRegister s1 = { 1 };
257
+ const SwVfpRegister s2 = { 2 };
258
+ const SwVfpRegister s3 = { 3 };
259
+ const SwVfpRegister s4 = { 4 };
260
+ const SwVfpRegister s5 = { 5 };
261
+ const SwVfpRegister s6 = { 6 };
262
+ const SwVfpRegister s7 = { 7 };
263
+ const SwVfpRegister s8 = { 8 };
264
+ const SwVfpRegister s9 = { 9 };
265
+ const SwVfpRegister s10 = { 10 };
266
+ const SwVfpRegister s11 = { 11 };
267
+ const SwVfpRegister s12 = { 12 };
268
+ const SwVfpRegister s13 = { 13 };
269
+ const SwVfpRegister s14 = { 14 };
270
+ const SwVfpRegister s15 = { 15 };
271
+ const SwVfpRegister s16 = { 16 };
272
+ const SwVfpRegister s17 = { 17 };
273
+ const SwVfpRegister s18 = { 18 };
274
+ const SwVfpRegister s19 = { 19 };
275
+ const SwVfpRegister s20 = { 20 };
276
+ const SwVfpRegister s21 = { 21 };
277
+ const SwVfpRegister s22 = { 22 };
278
+ const SwVfpRegister s23 = { 23 };
279
+ const SwVfpRegister s24 = { 24 };
280
+ const SwVfpRegister s25 = { 25 };
281
+ const SwVfpRegister s26 = { 26 };
282
+ const SwVfpRegister s27 = { 27 };
283
+ const SwVfpRegister s28 = { 28 };
284
+ const SwVfpRegister s29 = { 29 };
285
+ const SwVfpRegister s30 = { 30 };
286
+ const SwVfpRegister s31 = { 31 };
287
+
288
+ const DwVfpRegister no_dreg = { -1 };
289
+ const DwVfpRegister d0 = { 0 };
290
+ const DwVfpRegister d1 = { 1 };
291
+ const DwVfpRegister d2 = { 2 };
292
+ const DwVfpRegister d3 = { 3 };
293
+ const DwVfpRegister d4 = { 4 };
294
+ const DwVfpRegister d5 = { 5 };
295
+ const DwVfpRegister d6 = { 6 };
296
+ const DwVfpRegister d7 = { 7 };
297
+ const DwVfpRegister d8 = { 8 };
298
+ const DwVfpRegister d9 = { 9 };
299
+ const DwVfpRegister d10 = { 10 };
300
+ const DwVfpRegister d11 = { 11 };
301
+ const DwVfpRegister d12 = { 12 };
302
+ const DwVfpRegister d13 = { 13 };
303
+ const DwVfpRegister d14 = { 14 };
304
+ const DwVfpRegister d15 = { 15 };
305
+
306
+
307
+ // Coprocessor register
308
+ struct CRegister {
309
+ bool is_valid() const { return 0 <= code_ && code_ < 16; }
310
+ bool is(CRegister creg) const { return code_ == creg.code_; }
311
+ int code() const {
312
+ ASSERT(is_valid());
313
+ return code_;
314
+ }
315
+ int bit() const {
316
+ ASSERT(is_valid());
317
+ return 1 << code_;
318
+ }
319
+
320
+ // Unfortunately we can't make this private in a struct.
321
+ int code_;
322
+ };
323
+
324
+
325
+ const CRegister no_creg = { -1 };
326
+
327
+ const CRegister cr0 = { 0 };
328
+ const CRegister cr1 = { 1 };
329
+ const CRegister cr2 = { 2 };
330
+ const CRegister cr3 = { 3 };
331
+ const CRegister cr4 = { 4 };
332
+ const CRegister cr5 = { 5 };
333
+ const CRegister cr6 = { 6 };
334
+ const CRegister cr7 = { 7 };
335
+ const CRegister cr8 = { 8 };
336
+ const CRegister cr9 = { 9 };
337
+ const CRegister cr10 = { 10 };
338
+ const CRegister cr11 = { 11 };
339
+ const CRegister cr12 = { 12 };
340
+ const CRegister cr13 = { 13 };
341
+ const CRegister cr14 = { 14 };
342
+ const CRegister cr15 = { 15 };
343
+
344
+
345
+ // Coprocessor number
346
+ enum Coprocessor {
347
+ p0 = 0,
348
+ p1 = 1,
349
+ p2 = 2,
350
+ p3 = 3,
351
+ p4 = 4,
352
+ p5 = 5,
353
+ p6 = 6,
354
+ p7 = 7,
355
+ p8 = 8,
356
+ p9 = 9,
357
+ p10 = 10,
358
+ p11 = 11,
359
+ p12 = 12,
360
+ p13 = 13,
361
+ p14 = 14,
362
+ p15 = 15
363
+ };
364
+
365
+
366
+ // -----------------------------------------------------------------------------
367
+ // Machine instruction Operands
368
+
369
+ // Class Operand represents a shifter operand in data processing instructions
370
+ class Operand BASE_EMBEDDED {
371
+ public:
372
+ // immediate
373
+ INLINE(explicit Operand(int32_t immediate,
374
+ RelocInfo::Mode rmode = RelocInfo::NONE));
375
+ INLINE(explicit Operand(const ExternalReference& f));
376
+ INLINE(explicit Operand(const char* s));
377
+ explicit Operand(Handle<Object> handle);
378
+ INLINE(explicit Operand(Smi* value));
379
+
380
+ // rm
381
+ INLINE(explicit Operand(Register rm));
382
+
383
+ // rm <shift_op> shift_imm
384
+ explicit Operand(Register rm, ShiftOp shift_op, int shift_imm);
385
+
386
+ // rm <shift_op> rs
387
+ explicit Operand(Register rm, ShiftOp shift_op, Register rs);
388
+
389
+ // Return true if this is a register operand.
390
+ INLINE(bool is_reg() const);
391
+
392
+ // Return true if this operand fits in one instruction so that no
393
+ // 2-instruction solution with a load into the ip register is necessary. If
394
+ // the instruction this operand is used for is a MOV or MVN instruction the
395
+ // actual instruction to use is required for this calculation. For other
396
+ // instructions instr is ignored.
397
+ bool is_single_instruction(Instr instr = 0) const;
398
+ bool must_use_constant_pool() const;
399
+
400
+ inline int32_t immediate() const {
401
+ ASSERT(!rm_.is_valid());
402
+ return imm32_;
403
+ }
404
+
405
+ Register rm() const { return rm_; }
406
+ Register rs() const { return rs_; }
407
+ ShiftOp shift_op() const { return shift_op_; }
408
+
409
+ private:
410
+ Register rm_;
411
+ Register rs_;
412
+ ShiftOp shift_op_;
413
+ int shift_imm_; // valid if rm_ != no_reg && rs_ == no_reg
414
+ int32_t imm32_; // valid if rm_ == no_reg
415
+ RelocInfo::Mode rmode_;
416
+
417
+ friend class Assembler;
418
+ };
419
+
420
+
421
+ // Class MemOperand represents a memory operand in load and store instructions
422
+ class MemOperand BASE_EMBEDDED {
423
+ public:
424
+ // [rn +/- offset] Offset/NegOffset
425
+ // [rn +/- offset]! PreIndex/NegPreIndex
426
+ // [rn], +/- offset PostIndex/NegPostIndex
427
+ // offset is any signed 32-bit value; offset is first loaded to register ip if
428
+ // it does not fit the addressing mode (12-bit unsigned and sign bit)
429
+ explicit MemOperand(Register rn, int32_t offset = 0, AddrMode am = Offset);
430
+
431
+ // [rn +/- rm] Offset/NegOffset
432
+ // [rn +/- rm]! PreIndex/NegPreIndex
433
+ // [rn], +/- rm PostIndex/NegPostIndex
434
+ explicit MemOperand(Register rn, Register rm, AddrMode am = Offset);
435
+
436
+ // [rn +/- rm <shift_op> shift_imm] Offset/NegOffset
437
+ // [rn +/- rm <shift_op> shift_imm]! PreIndex/NegPreIndex
438
+ // [rn], +/- rm <shift_op> shift_imm PostIndex/NegPostIndex
439
+ explicit MemOperand(Register rn, Register rm,
440
+ ShiftOp shift_op, int shift_imm, AddrMode am = Offset);
441
+
442
+ void set_offset(int32_t offset) {
443
+ ASSERT(rm_.is(no_reg));
444
+ offset_ = offset;
445
+ }
446
+
447
+ uint32_t offset() const {
448
+ ASSERT(rm_.is(no_reg));
449
+ return offset_;
450
+ }
451
+
452
+ Register rn() const { return rn_; }
453
+ Register rm() const { return rm_; }
454
+
455
+ bool OffsetIsUint12Encodable() const {
456
+ return offset_ >= 0 ? is_uint12(offset_) : is_uint12(-offset_);
457
+ }
458
+
459
+ private:
460
+ Register rn_; // base
461
+ Register rm_; // register offset
462
+ int32_t offset_; // valid if rm_ == no_reg
463
+ ShiftOp shift_op_;
464
+ int shift_imm_; // valid if rm_ != no_reg && rs_ == no_reg
465
+ AddrMode am_; // bits P, U, and W
466
+
467
+ friend class Assembler;
468
+ };
469
+
470
+ // CpuFeatures keeps track of which features are supported by the target CPU.
471
+ // Supported features must be enabled by a Scope before use.
472
+ class CpuFeatures : public AllStatic {
473
+ public:
474
+ // Detect features of the target CPU. Set safe defaults if the serializer
475
+ // is enabled (snapshots must be portable).
476
+ static void Probe();
477
+
478
+ // Check whether a feature is supported by the target CPU.
479
+ static bool IsSupported(CpuFeature f) {
480
+ ASSERT(initialized_);
481
+ if (f == VFP3 && !FLAG_enable_vfp3) return false;
482
+ return (supported_ & (1u << f)) != 0;
483
+ }
484
+
485
+ #ifdef DEBUG
486
+ // Check whether a feature is currently enabled.
487
+ static bool IsEnabled(CpuFeature f) {
488
+ ASSERT(initialized_);
489
+ Isolate* isolate = Isolate::UncheckedCurrent();
490
+ if (isolate == NULL) {
491
+ // When no isolate is available, work as if we're running in
492
+ // release mode.
493
+ return IsSupported(f);
494
+ }
495
+ unsigned enabled = static_cast<unsigned>(isolate->enabled_cpu_features());
496
+ return (enabled & (1u << f)) != 0;
497
+ }
498
+ #endif
499
+
500
+ // Enable a specified feature within a scope.
501
+ class Scope BASE_EMBEDDED {
502
+ #ifdef DEBUG
503
+ public:
504
+ explicit Scope(CpuFeature f) {
505
+ unsigned mask = 1u << f;
506
+ ASSERT(CpuFeatures::IsSupported(f));
507
+ ASSERT(!Serializer::enabled() ||
508
+ (CpuFeatures::found_by_runtime_probing_ & mask) == 0);
509
+ isolate_ = Isolate::UncheckedCurrent();
510
+ old_enabled_ = 0;
511
+ if (isolate_ != NULL) {
512
+ old_enabled_ = static_cast<unsigned>(isolate_->enabled_cpu_features());
513
+ isolate_->set_enabled_cpu_features(old_enabled_ | mask);
514
+ }
515
+ }
516
+ ~Scope() {
517
+ ASSERT_EQ(Isolate::UncheckedCurrent(), isolate_);
518
+ if (isolate_ != NULL) {
519
+ isolate_->set_enabled_cpu_features(old_enabled_);
520
+ }
521
+ }
522
+ private:
523
+ Isolate* isolate_;
524
+ unsigned old_enabled_;
525
+ #else
526
+ public:
527
+ explicit Scope(CpuFeature f) {}
528
+ #endif
529
+ };
530
+
531
+ class TryForceFeatureScope BASE_EMBEDDED {
532
+ public:
533
+ explicit TryForceFeatureScope(CpuFeature f)
534
+ : old_supported_(CpuFeatures::supported_) {
535
+ if (CanForce()) {
536
+ CpuFeatures::supported_ |= (1u << f);
537
+ }
538
+ }
539
+
540
+ ~TryForceFeatureScope() {
541
+ if (CanForce()) {
542
+ CpuFeatures::supported_ = old_supported_;
543
+ }
544
+ }
545
+
546
+ private:
547
+ static bool CanForce() {
548
+ // It's only safe to temporarily force support of CPU features
549
+ // when there's only a single isolate, which is guaranteed when
550
+ // the serializer is enabled.
551
+ return Serializer::enabled();
552
+ }
553
+
554
+ const unsigned old_supported_;
555
+ };
556
+
557
+ private:
558
+ #ifdef DEBUG
559
+ static bool initialized_;
560
+ #endif
561
+ static unsigned supported_;
562
+ static unsigned found_by_runtime_probing_;
563
+
564
+ DISALLOW_COPY_AND_ASSIGN(CpuFeatures);
565
+ };
566
+
567
+
568
+ extern const Instr kMovLrPc;
569
+ extern const Instr kLdrPCMask;
570
+ extern const Instr kLdrPCPattern;
571
+ extern const Instr kBlxRegMask;
572
+ extern const Instr kBlxRegPattern;
573
+
574
+ extern const Instr kMovMvnMask;
575
+ extern const Instr kMovMvnPattern;
576
+ extern const Instr kMovMvnFlip;
577
+
578
+ extern const Instr kMovLeaveCCMask;
579
+ extern const Instr kMovLeaveCCPattern;
580
+ extern const Instr kMovwMask;
581
+ extern const Instr kMovwPattern;
582
+ extern const Instr kMovwLeaveCCFlip;
583
+
584
+ extern const Instr kCmpCmnMask;
585
+ extern const Instr kCmpCmnPattern;
586
+ extern const Instr kCmpCmnFlip;
587
+ extern const Instr kAddSubFlip;
588
+ extern const Instr kAndBicFlip;
589
+
590
+
591
+
592
+ class Assembler : public AssemblerBase {
593
+ public:
594
+ // Create an assembler. Instructions and relocation information are emitted
595
+ // into a buffer, with the instructions starting from the beginning and the
596
+ // relocation information starting from the end of the buffer. See CodeDesc
597
+ // for a detailed comment on the layout (globals.h).
598
+ //
599
+ // If the provided buffer is NULL, the assembler allocates and grows its own
600
+ // buffer, and buffer_size determines the initial buffer size. The buffer is
601
+ // owned by the assembler and deallocated upon destruction of the assembler.
602
+ //
603
+ // If the provided buffer is not NULL, the assembler uses the provided buffer
604
+ // for code generation and assumes its size to be buffer_size. If the buffer
605
+ // is too small, a fatal error occurs. No deallocation of the buffer is done
606
+ // upon destruction of the assembler.
607
+ Assembler(Isolate* isolate, void* buffer, int buffer_size);
608
+ ~Assembler();
609
+
610
+ // Overrides the default provided by FLAG_debug_code.
611
+ void set_emit_debug_code(bool value) { emit_debug_code_ = value; }
612
+
613
+ // GetCode emits any pending (non-emitted) code and fills the descriptor
614
+ // desc. GetCode() is idempotent; it returns the same result if no other
615
+ // Assembler functions are invoked in between GetCode() calls.
616
+ void GetCode(CodeDesc* desc);
617
+
618
+ // Label operations & relative jumps (PPUM Appendix D)
619
+ //
620
+ // Takes a branch opcode (cc) and a label (L) and generates
621
+ // either a backward branch or a forward branch and links it
622
+ // to the label fixup chain. Usage:
623
+ //
624
+ // Label L; // unbound label
625
+ // j(cc, &L); // forward branch to unbound label
626
+ // bind(&L); // bind label to the current pc
627
+ // j(cc, &L); // backward branch to bound label
628
+ // bind(&L); // illegal: a label may be bound only once
629
+ //
630
+ // Note: The same Label can be used for forward and backward branches
631
+ // but it may be bound only once.
632
+
633
+ void bind(Label* L); // binds an unbound label L to the current code position
634
+
635
+ // Returns the branch offset to the given label from the current code position
636
+ // Links the label to the current position if it is still unbound
637
+ // Manages the jump elimination optimization if the second parameter is true.
638
+ int branch_offset(Label* L, bool jump_elimination_allowed);
639
+
640
+ // Puts a labels target address at the given position.
641
+ // The high 8 bits are set to zero.
642
+ void label_at_put(Label* L, int at_offset);
643
+
644
+ // Return the address in the constant pool of the code target address used by
645
+ // the branch/call instruction at pc.
646
+ INLINE(static Address target_address_address_at(Address pc));
647
+
648
+ // Read/Modify the code target address in the branch/call instruction at pc.
649
+ INLINE(static Address target_address_at(Address pc));
650
+ INLINE(static void set_target_address_at(Address pc, Address target));
651
+
652
+ // This sets the branch destination (which is in the constant pool on ARM).
653
+ // This is for calls and branches within generated code.
654
+ inline static void set_target_at(Address constant_pool_entry, Address target);
655
+
656
+ // This sets the branch destination (which is in the constant pool on ARM).
657
+ // This is for calls and branches to runtime code.
658
+ inline static void set_external_target_at(Address constant_pool_entry,
659
+ Address target) {
660
+ set_target_at(constant_pool_entry, target);
661
+ }
662
+
663
+ // Here we are patching the address in the constant pool, not the actual call
664
+ // instruction. The address in the constant pool is the same size as a
665
+ // pointer.
666
+ static const int kCallTargetSize = kPointerSize;
667
+ static const int kExternalTargetSize = kPointerSize;
668
+
669
+ // Size of an instruction.
670
+ static const int kInstrSize = sizeof(Instr);
671
+
672
+ // Distance between the instruction referring to the address of the call
673
+ // target and the return address.
674
+ #ifdef USE_BLX
675
+ // Call sequence is:
676
+ // ldr ip, [pc, #...] @ call address
677
+ // blx ip
678
+ // @ return address
679
+ static const int kCallTargetAddressOffset = 2 * kInstrSize;
680
+ #else
681
+ // Call sequence is:
682
+ // mov lr, pc
683
+ // ldr pc, [pc, #...] @ call address
684
+ // @ return address
685
+ static const int kCallTargetAddressOffset = kInstrSize;
686
+ #endif
687
+
688
+ // Distance between start of patched return sequence and the emitted address
689
+ // to jump to.
690
+ #ifdef USE_BLX
691
+ // Patched return sequence is:
692
+ // ldr ip, [pc, #0] @ emited address and start
693
+ // blx ip
694
+ static const int kPatchReturnSequenceAddressOffset = 0 * kInstrSize;
695
+ #else
696
+ // Patched return sequence is:
697
+ // mov lr, pc @ start of sequence
698
+ // ldr pc, [pc, #-4] @ emited address
699
+ static const int kPatchReturnSequenceAddressOffset = kInstrSize;
700
+ #endif
701
+
702
+ // Distance between start of patched debug break slot and the emitted address
703
+ // to jump to.
704
+ #ifdef USE_BLX
705
+ // Patched debug break slot code is:
706
+ // ldr ip, [pc, #0] @ emited address and start
707
+ // blx ip
708
+ static const int kPatchDebugBreakSlotAddressOffset = 0 * kInstrSize;
709
+ #else
710
+ // Patched debug break slot code is:
711
+ // mov lr, pc @ start of sequence
712
+ // ldr pc, [pc, #-4] @ emited address
713
+ static const int kPatchDebugBreakSlotAddressOffset = kInstrSize;
714
+ #endif
715
+
716
+ // Difference between address of current opcode and value read from pc
717
+ // register.
718
+ static const int kPcLoadDelta = 8;
719
+
720
+ static const int kJSReturnSequenceInstructions = 4;
721
+ static const int kDebugBreakSlotInstructions = 3;
722
+ static const int kDebugBreakSlotLength =
723
+ kDebugBreakSlotInstructions * kInstrSize;
724
+
725
+ // ---------------------------------------------------------------------------
726
+ // Code generation
727
+
728
+ // Insert the smallest number of nop instructions
729
+ // possible to align the pc offset to a multiple
730
+ // of m. m must be a power of 2 (>= 4).
731
+ void Align(int m);
732
+ // Aligns code to something that's optimal for a jump target for the platform.
733
+ void CodeTargetAlign();
734
+
735
+ // Branch instructions
736
+ void b(int branch_offset, Condition cond = al);
737
+ void bl(int branch_offset, Condition cond = al);
738
+ void blx(int branch_offset); // v5 and above
739
+ void blx(Register target, Condition cond = al); // v5 and above
740
+ void bx(Register target, Condition cond = al); // v5 and above, plus v4t
741
+
742
+ // Convenience branch instructions using labels
743
+ void b(Label* L, Condition cond = al) {
744
+ b(branch_offset(L, cond == al), cond);
745
+ }
746
+ void b(Condition cond, Label* L) { b(branch_offset(L, cond == al), cond); }
747
+ void bl(Label* L, Condition cond = al) { bl(branch_offset(L, false), cond); }
748
+ void bl(Condition cond, Label* L) { bl(branch_offset(L, false), cond); }
749
+ void blx(Label* L) { blx(branch_offset(L, false)); } // v5 and above
750
+
751
+ // Data-processing instructions
752
+
753
+ void and_(Register dst, Register src1, const Operand& src2,
754
+ SBit s = LeaveCC, Condition cond = al);
755
+
756
+ void eor(Register dst, Register src1, const Operand& src2,
757
+ SBit s = LeaveCC, Condition cond = al);
758
+
759
+ void sub(Register dst, Register src1, const Operand& src2,
760
+ SBit s = LeaveCC, Condition cond = al);
761
+ void sub(Register dst, Register src1, Register src2,
762
+ SBit s = LeaveCC, Condition cond = al) {
763
+ sub(dst, src1, Operand(src2), s, cond);
764
+ }
765
+
766
+ void rsb(Register dst, Register src1, const Operand& src2,
767
+ SBit s = LeaveCC, Condition cond = al);
768
+
769
+ void add(Register dst, Register src1, const Operand& src2,
770
+ SBit s = LeaveCC, Condition cond = al);
771
+ void add(Register dst, Register src1, Register src2,
772
+ SBit s = LeaveCC, Condition cond = al) {
773
+ add(dst, src1, Operand(src2), s, cond);
774
+ }
775
+
776
+ void adc(Register dst, Register src1, const Operand& src2,
777
+ SBit s = LeaveCC, Condition cond = al);
778
+
779
+ void sbc(Register dst, Register src1, const Operand& src2,
780
+ SBit s = LeaveCC, Condition cond = al);
781
+
782
+ void rsc(Register dst, Register src1, const Operand& src2,
783
+ SBit s = LeaveCC, Condition cond = al);
784
+
785
+ void tst(Register src1, const Operand& src2, Condition cond = al);
786
+ void tst(Register src1, Register src2, Condition cond = al) {
787
+ tst(src1, Operand(src2), cond);
788
+ }
789
+
790
+ void teq(Register src1, const Operand& src2, Condition cond = al);
791
+
792
+ void cmp(Register src1, const Operand& src2, Condition cond = al);
793
+ void cmp(Register src1, Register src2, Condition cond = al) {
794
+ cmp(src1, Operand(src2), cond);
795
+ }
796
+ void cmp_raw_immediate(Register src1, int raw_immediate, Condition cond = al);
797
+
798
+ void cmn(Register src1, const Operand& src2, Condition cond = al);
799
+
800
+ void orr(Register dst, Register src1, const Operand& src2,
801
+ SBit s = LeaveCC, Condition cond = al);
802
+ void orr(Register dst, Register src1, Register src2,
803
+ SBit s = LeaveCC, Condition cond = al) {
804
+ orr(dst, src1, Operand(src2), s, cond);
805
+ }
806
+
807
+ void mov(Register dst, const Operand& src,
808
+ SBit s = LeaveCC, Condition cond = al);
809
+ void mov(Register dst, Register src, SBit s = LeaveCC, Condition cond = al) {
810
+ mov(dst, Operand(src), s, cond);
811
+ }
812
+
813
+ // ARMv7 instructions for loading a 32 bit immediate in two instructions.
814
+ // This may actually emit a different mov instruction, but on an ARMv7 it
815
+ // is guaranteed to only emit one instruction.
816
+ void movw(Register reg, uint32_t immediate, Condition cond = al);
817
+ // The constant for movt should be in the range 0-0xffff.
818
+ void movt(Register reg, uint32_t immediate, Condition cond = al);
819
+
820
+ void bic(Register dst, Register src1, const Operand& src2,
821
+ SBit s = LeaveCC, Condition cond = al);
822
+
823
+ void mvn(Register dst, const Operand& src,
824
+ SBit s = LeaveCC, Condition cond = al);
825
+
826
+ // Multiply instructions
827
+
828
+ void mla(Register dst, Register src1, Register src2, Register srcA,
829
+ SBit s = LeaveCC, Condition cond = al);
830
+
831
+ void mul(Register dst, Register src1, Register src2,
832
+ SBit s = LeaveCC, Condition cond = al);
833
+
834
+ void smlal(Register dstL, Register dstH, Register src1, Register src2,
835
+ SBit s = LeaveCC, Condition cond = al);
836
+
837
+ void smull(Register dstL, Register dstH, Register src1, Register src2,
838
+ SBit s = LeaveCC, Condition cond = al);
839
+
840
+ void umlal(Register dstL, Register dstH, Register src1, Register src2,
841
+ SBit s = LeaveCC, Condition cond = al);
842
+
843
+ void umull(Register dstL, Register dstH, Register src1, Register src2,
844
+ SBit s = LeaveCC, Condition cond = al);
845
+
846
+ // Miscellaneous arithmetic instructions
847
+
848
+ void clz(Register dst, Register src, Condition cond = al); // v5 and above
849
+
850
+ // Saturating instructions. v6 and above.
851
+
852
+ // Unsigned saturate.
853
+ //
854
+ // Saturate an optionally shifted signed value to an unsigned range.
855
+ //
856
+ // usat dst, #satpos, src
857
+ // usat dst, #satpos, src, lsl #sh
858
+ // usat dst, #satpos, src, asr #sh
859
+ //
860
+ // Register dst will contain:
861
+ //
862
+ // 0, if s < 0
863
+ // (1 << satpos) - 1, if s > ((1 << satpos) - 1)
864
+ // s, otherwise
865
+ //
866
+ // where s is the contents of src after shifting (if used.)
867
+ void usat(Register dst, int satpos, const Operand& src, Condition cond = al);
868
+
869
+ // Bitfield manipulation instructions. v7 and above.
870
+
871
+ void ubfx(Register dst, Register src, int lsb, int width,
872
+ Condition cond = al);
873
+
874
+ void sbfx(Register dst, Register src, int lsb, int width,
875
+ Condition cond = al);
876
+
877
+ void bfc(Register dst, int lsb, int width, Condition cond = al);
878
+
879
+ void bfi(Register dst, Register src, int lsb, int width,
880
+ Condition cond = al);
881
+
882
+ // Status register access instructions
883
+
884
+ void mrs(Register dst, SRegister s, Condition cond = al);
885
+ void msr(SRegisterFieldMask fields, const Operand& src, Condition cond = al);
886
+
887
+ // Load/Store instructions
888
+ void ldr(Register dst, const MemOperand& src, Condition cond = al);
889
+ void str(Register src, const MemOperand& dst, Condition cond = al);
890
+ void ldrb(Register dst, const MemOperand& src, Condition cond = al);
891
+ void strb(Register src, const MemOperand& dst, Condition cond = al);
892
+ void ldrh(Register dst, const MemOperand& src, Condition cond = al);
893
+ void strh(Register src, const MemOperand& dst, Condition cond = al);
894
+ void ldrsb(Register dst, const MemOperand& src, Condition cond = al);
895
+ void ldrsh(Register dst, const MemOperand& src, Condition cond = al);
896
+ void ldrd(Register dst1,
897
+ Register dst2,
898
+ const MemOperand& src, Condition cond = al);
899
+ void strd(Register src1,
900
+ Register src2,
901
+ const MemOperand& dst, Condition cond = al);
902
+
903
+ // Load/Store multiple instructions
904
+ void ldm(BlockAddrMode am, Register base, RegList dst, Condition cond = al);
905
+ void stm(BlockAddrMode am, Register base, RegList src, Condition cond = al);
906
+
907
+ // Exception-generating instructions and debugging support
908
+ void stop(const char* msg,
909
+ Condition cond = al,
910
+ int32_t code = kDefaultStopCode);
911
+
912
+ void bkpt(uint32_t imm16); // v5 and above
913
+ void svc(uint32_t imm24, Condition cond = al);
914
+
915
+ // Coprocessor instructions
916
+
917
+ void cdp(Coprocessor coproc, int opcode_1,
918
+ CRegister crd, CRegister crn, CRegister crm,
919
+ int opcode_2, Condition cond = al);
920
+
921
+ void cdp2(Coprocessor coproc, int opcode_1,
922
+ CRegister crd, CRegister crn, CRegister crm,
923
+ int opcode_2); // v5 and above
924
+
925
+ void mcr(Coprocessor coproc, int opcode_1,
926
+ Register rd, CRegister crn, CRegister crm,
927
+ int opcode_2 = 0, Condition cond = al);
928
+
929
+ void mcr2(Coprocessor coproc, int opcode_1,
930
+ Register rd, CRegister crn, CRegister crm,
931
+ int opcode_2 = 0); // v5 and above
932
+
933
+ void mrc(Coprocessor coproc, int opcode_1,
934
+ Register rd, CRegister crn, CRegister crm,
935
+ int opcode_2 = 0, Condition cond = al);
936
+
937
+ void mrc2(Coprocessor coproc, int opcode_1,
938
+ Register rd, CRegister crn, CRegister crm,
939
+ int opcode_2 = 0); // v5 and above
940
+
941
+ void ldc(Coprocessor coproc, CRegister crd, const MemOperand& src,
942
+ LFlag l = Short, Condition cond = al);
943
+ void ldc(Coprocessor coproc, CRegister crd, Register base, int option,
944
+ LFlag l = Short, Condition cond = al);
945
+
946
+ void ldc2(Coprocessor coproc, CRegister crd, const MemOperand& src,
947
+ LFlag l = Short); // v5 and above
948
+ void ldc2(Coprocessor coproc, CRegister crd, Register base, int option,
949
+ LFlag l = Short); // v5 and above
950
+
951
+ // Support for VFP.
952
+ // All these APIs support S0 to S31 and D0 to D15.
953
+ // Currently these APIs do not support extended D registers, i.e, D16 to D31.
954
+ // However, some simple modifications can allow
955
+ // these APIs to support D16 to D31.
956
+
957
+ void vldr(const DwVfpRegister dst,
958
+ const Register base,
959
+ int offset,
960
+ const Condition cond = al);
961
+ void vldr(const DwVfpRegister dst,
962
+ const MemOperand& src,
963
+ const Condition cond = al);
964
+
965
+ void vldr(const SwVfpRegister dst,
966
+ const Register base,
967
+ int offset,
968
+ const Condition cond = al);
969
+ void vldr(const SwVfpRegister dst,
970
+ const MemOperand& src,
971
+ const Condition cond = al);
972
+
973
+ void vstr(const DwVfpRegister src,
974
+ const Register base,
975
+ int offset,
976
+ const Condition cond = al);
977
+ void vstr(const DwVfpRegister src,
978
+ const MemOperand& dst,
979
+ const Condition cond = al);
980
+
981
+ void vstr(const SwVfpRegister src,
982
+ const Register base,
983
+ int offset,
984
+ const Condition cond = al);
985
+ void vstr(const SwVfpRegister src,
986
+ const MemOperand& dst,
987
+ const Condition cond = al);
988
+
989
+ void vldm(BlockAddrMode am,
990
+ Register base,
991
+ DwVfpRegister first,
992
+ DwVfpRegister last,
993
+ Condition cond = al);
994
+
995
+ void vstm(BlockAddrMode am,
996
+ Register base,
997
+ DwVfpRegister first,
998
+ DwVfpRegister last,
999
+ Condition cond = al);
1000
+
1001
+ void vldm(BlockAddrMode am,
1002
+ Register base,
1003
+ SwVfpRegister first,
1004
+ SwVfpRegister last,
1005
+ Condition cond = al);
1006
+
1007
+ void vstm(BlockAddrMode am,
1008
+ Register base,
1009
+ SwVfpRegister first,
1010
+ SwVfpRegister last,
1011
+ Condition cond = al);
1012
+
1013
+ void vmov(const DwVfpRegister dst,
1014
+ double imm,
1015
+ const Condition cond = al);
1016
+ void vmov(const SwVfpRegister dst,
1017
+ const SwVfpRegister src,
1018
+ const Condition cond = al);
1019
+ void vmov(const DwVfpRegister dst,
1020
+ const DwVfpRegister src,
1021
+ const Condition cond = al);
1022
+ void vmov(const DwVfpRegister dst,
1023
+ const Register src1,
1024
+ const Register src2,
1025
+ const Condition cond = al);
1026
+ void vmov(const Register dst1,
1027
+ const Register dst2,
1028
+ const DwVfpRegister src,
1029
+ const Condition cond = al);
1030
+ void vmov(const SwVfpRegister dst,
1031
+ const Register src,
1032
+ const Condition cond = al);
1033
+ void vmov(const Register dst,
1034
+ const SwVfpRegister src,
1035
+ const Condition cond = al);
1036
+ void vcvt_f64_s32(const DwVfpRegister dst,
1037
+ const SwVfpRegister src,
1038
+ VFPConversionMode mode = kDefaultRoundToZero,
1039
+ const Condition cond = al);
1040
+ void vcvt_f32_s32(const SwVfpRegister dst,
1041
+ const SwVfpRegister src,
1042
+ VFPConversionMode mode = kDefaultRoundToZero,
1043
+ const Condition cond = al);
1044
+ void vcvt_f64_u32(const DwVfpRegister dst,
1045
+ const SwVfpRegister src,
1046
+ VFPConversionMode mode = kDefaultRoundToZero,
1047
+ const Condition cond = al);
1048
+ void vcvt_s32_f64(const SwVfpRegister dst,
1049
+ const DwVfpRegister src,
1050
+ VFPConversionMode mode = kDefaultRoundToZero,
1051
+ const Condition cond = al);
1052
+ void vcvt_u32_f64(const SwVfpRegister dst,
1053
+ const DwVfpRegister src,
1054
+ VFPConversionMode mode = kDefaultRoundToZero,
1055
+ const Condition cond = al);
1056
+ void vcvt_f64_f32(const DwVfpRegister dst,
1057
+ const SwVfpRegister src,
1058
+ VFPConversionMode mode = kDefaultRoundToZero,
1059
+ const Condition cond = al);
1060
+ void vcvt_f32_f64(const SwVfpRegister dst,
1061
+ const DwVfpRegister src,
1062
+ VFPConversionMode mode = kDefaultRoundToZero,
1063
+ const Condition cond = al);
1064
+
1065
+ void vneg(const DwVfpRegister dst,
1066
+ const DwVfpRegister src,
1067
+ const Condition cond = al);
1068
+ void vabs(const DwVfpRegister dst,
1069
+ const DwVfpRegister src,
1070
+ const Condition cond = al);
1071
+ void vadd(const DwVfpRegister dst,
1072
+ const DwVfpRegister src1,
1073
+ const DwVfpRegister src2,
1074
+ const Condition cond = al);
1075
+ void vsub(const DwVfpRegister dst,
1076
+ const DwVfpRegister src1,
1077
+ const DwVfpRegister src2,
1078
+ const Condition cond = al);
1079
+ void vmul(const DwVfpRegister dst,
1080
+ const DwVfpRegister src1,
1081
+ const DwVfpRegister src2,
1082
+ const Condition cond = al);
1083
+ void vdiv(const DwVfpRegister dst,
1084
+ const DwVfpRegister src1,
1085
+ const DwVfpRegister src2,
1086
+ const Condition cond = al);
1087
+ void vcmp(const DwVfpRegister src1,
1088
+ const DwVfpRegister src2,
1089
+ const Condition cond = al);
1090
+ void vcmp(const DwVfpRegister src1,
1091
+ const double src2,
1092
+ const Condition cond = al);
1093
+ void vmrs(const Register dst,
1094
+ const Condition cond = al);
1095
+ void vmsr(const Register dst,
1096
+ const Condition cond = al);
1097
+ void vsqrt(const DwVfpRegister dst,
1098
+ const DwVfpRegister src,
1099
+ const Condition cond = al);
1100
+
1101
+ // Pseudo instructions
1102
+
1103
+ // Different nop operations are used by the code generator to detect certain
1104
+ // states of the generated code.
1105
+ enum NopMarkerTypes {
1106
+ NON_MARKING_NOP = 0,
1107
+ DEBUG_BREAK_NOP,
1108
+ // IC markers.
1109
+ PROPERTY_ACCESS_INLINED,
1110
+ PROPERTY_ACCESS_INLINED_CONTEXT,
1111
+ PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE,
1112
+ // Helper values.
1113
+ LAST_CODE_MARKER,
1114
+ FIRST_IC_MARKER = PROPERTY_ACCESS_INLINED
1115
+ };
1116
+
1117
+ void nop(int type = 0); // 0 is the default non-marking type.
1118
+
1119
+ void push(Register src, Condition cond = al) {
1120
+ str(src, MemOperand(sp, 4, NegPreIndex), cond);
1121
+ }
1122
+
1123
+ void pop(Register dst, Condition cond = al) {
1124
+ ldr(dst, MemOperand(sp, 4, PostIndex), cond);
1125
+ }
1126
+
1127
+ void pop() {
1128
+ add(sp, sp, Operand(kPointerSize));
1129
+ }
1130
+
1131
+ // Jump unconditionally to given label.
1132
+ void jmp(Label* L) { b(L, al); }
1133
+
1134
+ // Check the code size generated from label to here.
1135
+ int InstructionsGeneratedSince(Label* l) {
1136
+ return (pc_offset() - l->pos()) / kInstrSize;
1137
+ }
1138
+
1139
+ // Check whether an immediate fits an addressing mode 1 instruction.
1140
+ bool ImmediateFitsAddrMode1Instruction(int32_t imm32);
1141
+
1142
+ // Class for scoping postponing the constant pool generation.
1143
+ class BlockConstPoolScope {
1144
+ public:
1145
+ explicit BlockConstPoolScope(Assembler* assem) : assem_(assem) {
1146
+ assem_->StartBlockConstPool();
1147
+ }
1148
+ ~BlockConstPoolScope() {
1149
+ assem_->EndBlockConstPool();
1150
+ }
1151
+
1152
+ private:
1153
+ Assembler* assem_;
1154
+
1155
+ DISALLOW_IMPLICIT_CONSTRUCTORS(BlockConstPoolScope);
1156
+ };
1157
+
1158
+ // Postpone the generation of the constant pool for the specified number of
1159
+ // instructions.
1160
+ void BlockConstPoolFor(int instructions);
1161
+
1162
+ // Debugging
1163
+
1164
+ // Mark address of the ExitJSFrame code.
1165
+ void RecordJSReturn();
1166
+
1167
+ // Mark address of a debug break slot.
1168
+ void RecordDebugBreakSlot();
1169
+
1170
+ // Record the AST id of the CallIC being compiled, so that it can be placed
1171
+ // in the relocation information.
1172
+ void RecordAstId(unsigned ast_id) { ast_id_for_reloc_info_ = ast_id; }
1173
+
1174
+ // Record a comment relocation entry that can be used by a disassembler.
1175
+ // Use --code-comments to enable.
1176
+ void RecordComment(const char* msg);
1177
+
1178
+ // Writes a single byte or word of data in the code stream. Used
1179
+ // for inline tables, e.g., jump-tables. The constant pool should be
1180
+ // emitted before any use of db and dd to ensure that constant pools
1181
+ // are not emitted as part of the tables generated.
1182
+ void db(uint8_t data);
1183
+ void dd(uint32_t data);
1184
+
1185
+ int pc_offset() const { return pc_ - buffer_; }
1186
+
1187
+ PositionsRecorder* positions_recorder() { return &positions_recorder_; }
1188
+
1189
+ // Read/patch instructions
1190
+ static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); }
1191
+ static void instr_at_put(byte* pc, Instr instr) {
1192
+ *reinterpret_cast<Instr*>(pc) = instr;
1193
+ }
1194
+ static Condition GetCondition(Instr instr);
1195
+ static bool IsBranch(Instr instr);
1196
+ static int GetBranchOffset(Instr instr);
1197
+ static bool IsLdrRegisterImmediate(Instr instr);
1198
+ static int GetLdrRegisterImmediateOffset(Instr instr);
1199
+ static Instr SetLdrRegisterImmediateOffset(Instr instr, int offset);
1200
+ static bool IsStrRegisterImmediate(Instr instr);
1201
+ static Instr SetStrRegisterImmediateOffset(Instr instr, int offset);
1202
+ static bool IsAddRegisterImmediate(Instr instr);
1203
+ static Instr SetAddRegisterImmediateOffset(Instr instr, int offset);
1204
+ static Register GetRd(Instr instr);
1205
+ static Register GetRn(Instr instr);
1206
+ static Register GetRm(Instr instr);
1207
+ static bool IsPush(Instr instr);
1208
+ static bool IsPop(Instr instr);
1209
+ static bool IsStrRegFpOffset(Instr instr);
1210
+ static bool IsLdrRegFpOffset(Instr instr);
1211
+ static bool IsStrRegFpNegOffset(Instr instr);
1212
+ static bool IsLdrRegFpNegOffset(Instr instr);
1213
+ static bool IsLdrPcImmediateOffset(Instr instr);
1214
+ static bool IsTstImmediate(Instr instr);
1215
+ static bool IsCmpRegister(Instr instr);
1216
+ static bool IsCmpImmediate(Instr instr);
1217
+ static Register GetCmpImmediateRegister(Instr instr);
1218
+ static int GetCmpImmediateRawImmediate(Instr instr);
1219
+ static bool IsNop(Instr instr, int type = NON_MARKING_NOP);
1220
+
1221
+ // Buffer size and constant pool distance are checked together at regular
1222
+ // intervals of kBufferCheckInterval emitted bytes
1223
+ static const int kBufferCheckInterval = 1*KB/2;
1224
+ // Constants in pools are accessed via pc relative addressing, which can
1225
+ // reach +/-4KB thereby defining a maximum distance between the instruction
1226
+ // and the accessed constant. We satisfy this constraint by limiting the
1227
+ // distance between pools.
1228
+ static const int kMaxDistBetweenPools = 4*KB - 2*kBufferCheckInterval;
1229
+ static const int kMaxNumPRInfo = kMaxDistBetweenPools/kInstrSize;
1230
+
1231
+ // Check if is time to emit a constant pool for pending reloc info entries
1232
+ void CheckConstPool(bool force_emit, bool require_jump);
1233
+
1234
+ protected:
1235
+ // Relocation for a type-recording IC has the AST id added to it. This
1236
+ // member variable is a way to pass the information from the call site to
1237
+ // the relocation info.
1238
+ unsigned ast_id_for_reloc_info_;
1239
+
1240
+ bool emit_debug_code() const { return emit_debug_code_; }
1241
+
1242
+ int buffer_space() const { return reloc_info_writer.pos() - pc_; }
1243
+
1244
+ // Read/patch instructions
1245
+ Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); }
1246
+ void instr_at_put(int pos, Instr instr) {
1247
+ *reinterpret_cast<Instr*>(buffer_ + pos) = instr;
1248
+ }
1249
+
1250
+ // Decode branch instruction at pos and return branch target pos
1251
+ int target_at(int pos);
1252
+
1253
+ // Patch branch instruction at pos to branch to given branch target pos
1254
+ void target_at_put(int pos, int target_pos);
1255
+
1256
+ // Block the emission of the constant pool before pc_offset
1257
+ void BlockConstPoolBefore(int pc_offset) {
1258
+ if (no_const_pool_before_ < pc_offset) no_const_pool_before_ = pc_offset;
1259
+ }
1260
+
1261
+ void StartBlockConstPool() {
1262
+ const_pool_blocked_nesting_++;
1263
+ }
1264
+ void EndBlockConstPool() {
1265
+ const_pool_blocked_nesting_--;
1266
+ }
1267
+ bool is_const_pool_blocked() const { return const_pool_blocked_nesting_ > 0; }
1268
+
1269
+ private:
1270
+ // Code buffer:
1271
+ // The buffer into which code and relocation info are generated.
1272
+ byte* buffer_;
1273
+ int buffer_size_;
1274
+ // True if the assembler owns the buffer, false if buffer is external.
1275
+ bool own_buffer_;
1276
+
1277
+ int next_buffer_check_; // pc offset of next buffer check
1278
+
1279
+ // Code generation
1280
+ // The relocation writer's position is at least kGap bytes below the end of
1281
+ // the generated instructions. This is so that multi-instruction sequences do
1282
+ // not have to check for overflow. The same is true for writes of large
1283
+ // relocation info entries.
1284
+ static const int kGap = 32;
1285
+ byte* pc_; // the program counter; moves forward
1286
+
1287
+ // Constant pool generation
1288
+ // Pools are emitted in the instruction stream, preferably after unconditional
1289
+ // jumps or after returns from functions (in dead code locations).
1290
+ // If a long code sequence does not contain unconditional jumps, it is
1291
+ // necessary to emit the constant pool before the pool gets too far from the
1292
+ // location it is accessed from. In this case, we emit a jump over the emitted
1293
+ // constant pool.
1294
+ // Constants in the pool may be addresses of functions that gets relocated;
1295
+ // if so, a relocation info entry is associated to the constant pool entry.
1296
+
1297
+ // Repeated checking whether the constant pool should be emitted is rather
1298
+ // expensive. By default we only check again once a number of instructions
1299
+ // has been generated. That also means that the sizing of the buffers is not
1300
+ // an exact science, and that we rely on some slop to not overrun buffers.
1301
+ static const int kCheckConstIntervalInst = 32;
1302
+ static const int kCheckConstInterval = kCheckConstIntervalInst * kInstrSize;
1303
+
1304
+
1305
+ // Pools are emitted after function return and in dead code at (more or less)
1306
+ // regular intervals of kDistBetweenPools bytes
1307
+ static const int kDistBetweenPools = 1*KB;
1308
+
1309
+ // Emission of the constant pool may be blocked in some code sequences.
1310
+ int const_pool_blocked_nesting_; // Block emission if this is not zero.
1311
+ int no_const_pool_before_; // Block emission before this pc offset.
1312
+
1313
+ // Keep track of the last emitted pool to guarantee a maximal distance
1314
+ int last_const_pool_end_; // pc offset following the last constant pool
1315
+
1316
+ // Relocation info generation
1317
+ // Each relocation is encoded as a variable size value
1318
+ static const int kMaxRelocSize = RelocInfoWriter::kMaxSize;
1319
+ RelocInfoWriter reloc_info_writer;
1320
+ // Relocation info records are also used during code generation as temporary
1321
+ // containers for constants and code target addresses until they are emitted
1322
+ // to the constant pool. These pending relocation info records are temporarily
1323
+ // stored in a separate buffer until a constant pool is emitted.
1324
+ // If every instruction in a long sequence is accessing the pool, we need one
1325
+ // pending relocation entry per instruction.
1326
+ RelocInfo prinfo_[kMaxNumPRInfo]; // the buffer of pending relocation info
1327
+ int num_prinfo_; // number of pending reloc info entries in the buffer
1328
+
1329
+ // The bound position, before this we cannot do instruction elimination.
1330
+ int last_bound_pos_;
1331
+
1332
+ // Code emission
1333
+ inline void CheckBuffer();
1334
+ void GrowBuffer();
1335
+ inline void emit(Instr x);
1336
+
1337
+ // Instruction generation
1338
+ void addrmod1(Instr instr, Register rn, Register rd, const Operand& x);
1339
+ void addrmod2(Instr instr, Register rd, const MemOperand& x);
1340
+ void addrmod3(Instr instr, Register rd, const MemOperand& x);
1341
+ void addrmod4(Instr instr, Register rn, RegList rl);
1342
+ void addrmod5(Instr instr, CRegister crd, const MemOperand& x);
1343
+
1344
+ // Labels
1345
+ void print(Label* L);
1346
+ void bind_to(Label* L, int pos);
1347
+ void link_to(Label* L, Label* appendix);
1348
+ void next(Label* L);
1349
+
1350
+ // Record reloc info for current pc_
1351
+ void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
1352
+
1353
+ friend class RegExpMacroAssemblerARM;
1354
+ friend class RelocInfo;
1355
+ friend class CodePatcher;
1356
+ friend class BlockConstPoolScope;
1357
+
1358
+ PositionsRecorder positions_recorder_;
1359
+ bool emit_debug_code_;
1360
+ friend class PositionsRecorder;
1361
+ friend class EnsureSpace;
1362
+ };
1363
+
1364
+
1365
+ class EnsureSpace BASE_EMBEDDED {
1366
+ public:
1367
+ explicit EnsureSpace(Assembler* assembler) {
1368
+ assembler->CheckBuffer();
1369
+ }
1370
+ };
1371
+
1372
+
1373
+ } } // namespace v8::internal
1374
+
1375
+ #endif // V8_ARM_ASSEMBLER_ARM_H_