therubyracer 0.9.0beta4 → 0.9.0beta5

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

Potentially problematic release.


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

Files changed (771) hide show
  1. data/.gitignore +1 -0
  2. data/Rakefile +0 -11
  3. data/ext/v8/extconf.rb +9 -9
  4. data/ext/v8/v8_external.cpp +40 -10
  5. data/lib/v8/cli.rb +2 -1
  6. data/lib/v8/version.rb +1 -1
  7. data/spec/redjs/.gitignore +1 -0
  8. data/therubyracer.gemspec +2 -3
  9. metadata +33 -779
  10. data/ext/v8/upstream/Makefile +0 -38
  11. data/ext/v8/upstream/detect_cpu.rb +0 -27
  12. data/ext/v8/upstream/fpic-on-linux-amd64.patch +0 -13
  13. data/ext/v8/upstream/scons/CHANGES.txt +0 -5183
  14. data/ext/v8/upstream/scons/LICENSE.txt +0 -20
  15. data/ext/v8/upstream/scons/MANIFEST +0 -202
  16. data/ext/v8/upstream/scons/PKG-INFO +0 -13
  17. data/ext/v8/upstream/scons/README.txt +0 -273
  18. data/ext/v8/upstream/scons/RELEASE.txt +0 -1040
  19. data/ext/v8/upstream/scons/engine/SCons/Action.py +0 -1256
  20. data/ext/v8/upstream/scons/engine/SCons/Builder.py +0 -868
  21. data/ext/v8/upstream/scons/engine/SCons/CacheDir.py +0 -217
  22. data/ext/v8/upstream/scons/engine/SCons/Conftest.py +0 -794
  23. data/ext/v8/upstream/scons/engine/SCons/Debug.py +0 -237
  24. data/ext/v8/upstream/scons/engine/SCons/Defaults.py +0 -485
  25. data/ext/v8/upstream/scons/engine/SCons/Environment.py +0 -2327
  26. data/ext/v8/upstream/scons/engine/SCons/Errors.py +0 -207
  27. data/ext/v8/upstream/scons/engine/SCons/Executor.py +0 -636
  28. data/ext/v8/upstream/scons/engine/SCons/Job.py +0 -435
  29. data/ext/v8/upstream/scons/engine/SCons/Memoize.py +0 -292
  30. data/ext/v8/upstream/scons/engine/SCons/Node/Alias.py +0 -153
  31. data/ext/v8/upstream/scons/engine/SCons/Node/FS.py +0 -3220
  32. data/ext/v8/upstream/scons/engine/SCons/Node/Python.py +0 -128
  33. data/ext/v8/upstream/scons/engine/SCons/Node/__init__.py +0 -1341
  34. data/ext/v8/upstream/scons/engine/SCons/Options/BoolOption.py +0 -50
  35. data/ext/v8/upstream/scons/engine/SCons/Options/EnumOption.py +0 -50
  36. data/ext/v8/upstream/scons/engine/SCons/Options/ListOption.py +0 -50
  37. data/ext/v8/upstream/scons/engine/SCons/Options/PackageOption.py +0 -50
  38. data/ext/v8/upstream/scons/engine/SCons/Options/PathOption.py +0 -76
  39. data/ext/v8/upstream/scons/engine/SCons/Options/__init__.py +0 -74
  40. data/ext/v8/upstream/scons/engine/SCons/PathList.py +0 -232
  41. data/ext/v8/upstream/scons/engine/SCons/Platform/__init__.py +0 -236
  42. data/ext/v8/upstream/scons/engine/SCons/Platform/aix.py +0 -70
  43. data/ext/v8/upstream/scons/engine/SCons/Platform/cygwin.py +0 -55
  44. data/ext/v8/upstream/scons/engine/SCons/Platform/darwin.py +0 -46
  45. data/ext/v8/upstream/scons/engine/SCons/Platform/hpux.py +0 -46
  46. data/ext/v8/upstream/scons/engine/SCons/Platform/irix.py +0 -44
  47. data/ext/v8/upstream/scons/engine/SCons/Platform/os2.py +0 -58
  48. data/ext/v8/upstream/scons/engine/SCons/Platform/posix.py +0 -264
  49. data/ext/v8/upstream/scons/engine/SCons/Platform/sunos.py +0 -50
  50. data/ext/v8/upstream/scons/engine/SCons/Platform/win32.py +0 -386
  51. data/ext/v8/upstream/scons/engine/SCons/SConf.py +0 -1038
  52. data/ext/v8/upstream/scons/engine/SCons/SConsign.py +0 -381
  53. data/ext/v8/upstream/scons/engine/SCons/Scanner/C.py +0 -132
  54. data/ext/v8/upstream/scons/engine/SCons/Scanner/D.py +0 -74
  55. data/ext/v8/upstream/scons/engine/SCons/Scanner/Dir.py +0 -111
  56. data/ext/v8/upstream/scons/engine/SCons/Scanner/Fortran.py +0 -320
  57. data/ext/v8/upstream/scons/engine/SCons/Scanner/IDL.py +0 -48
  58. data/ext/v8/upstream/scons/engine/SCons/Scanner/LaTeX.py +0 -378
  59. data/ext/v8/upstream/scons/engine/SCons/Scanner/Prog.py +0 -103
  60. data/ext/v8/upstream/scons/engine/SCons/Scanner/RC.py +0 -55
  61. data/ext/v8/upstream/scons/engine/SCons/Scanner/__init__.py +0 -415
  62. data/ext/v8/upstream/scons/engine/SCons/Script/Interactive.py +0 -386
  63. data/ext/v8/upstream/scons/engine/SCons/Script/Main.py +0 -1360
  64. data/ext/v8/upstream/scons/engine/SCons/Script/SConsOptions.py +0 -944
  65. data/ext/v8/upstream/scons/engine/SCons/Script/SConscript.py +0 -642
  66. data/ext/v8/upstream/scons/engine/SCons/Script/__init__.py +0 -414
  67. data/ext/v8/upstream/scons/engine/SCons/Sig.py +0 -63
  68. data/ext/v8/upstream/scons/engine/SCons/Subst.py +0 -911
  69. data/ext/v8/upstream/scons/engine/SCons/Taskmaster.py +0 -1030
  70. data/ext/v8/upstream/scons/engine/SCons/Tool/386asm.py +0 -61
  71. data/ext/v8/upstream/scons/engine/SCons/Tool/BitKeeper.py +0 -65
  72. data/ext/v8/upstream/scons/engine/SCons/Tool/CVS.py +0 -73
  73. data/ext/v8/upstream/scons/engine/SCons/Tool/FortranCommon.py +0 -247
  74. data/ext/v8/upstream/scons/engine/SCons/Tool/JavaCommon.py +0 -324
  75. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/__init__.py +0 -56
  76. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/arch.py +0 -61
  77. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/common.py +0 -210
  78. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/netframework.py +0 -84
  79. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/sdk.py +0 -321
  80. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vc.py +0 -367
  81. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vs.py +0 -497
  82. data/ext/v8/upstream/scons/engine/SCons/Tool/Perforce.py +0 -104
  83. data/ext/v8/upstream/scons/engine/SCons/Tool/PharLapCommon.py +0 -138
  84. data/ext/v8/upstream/scons/engine/SCons/Tool/RCS.py +0 -64
  85. data/ext/v8/upstream/scons/engine/SCons/Tool/SCCS.py +0 -64
  86. data/ext/v8/upstream/scons/engine/SCons/Tool/Subversion.py +0 -71
  87. data/ext/v8/upstream/scons/engine/SCons/Tool/__init__.py +0 -675
  88. data/ext/v8/upstream/scons/engine/SCons/Tool/aixc++.py +0 -82
  89. data/ext/v8/upstream/scons/engine/SCons/Tool/aixcc.py +0 -74
  90. data/ext/v8/upstream/scons/engine/SCons/Tool/aixf77.py +0 -80
  91. data/ext/v8/upstream/scons/engine/SCons/Tool/aixlink.py +0 -76
  92. data/ext/v8/upstream/scons/engine/SCons/Tool/applelink.py +0 -71
  93. data/ext/v8/upstream/scons/engine/SCons/Tool/ar.py +0 -63
  94. data/ext/v8/upstream/scons/engine/SCons/Tool/as.py +0 -78
  95. data/ext/v8/upstream/scons/engine/SCons/Tool/bcc32.py +0 -82
  96. data/ext/v8/upstream/scons/engine/SCons/Tool/c++.py +0 -99
  97. data/ext/v8/upstream/scons/engine/SCons/Tool/cc.py +0 -114
  98. data/ext/v8/upstream/scons/engine/SCons/Tool/cvf.py +0 -58
  99. data/ext/v8/upstream/scons/engine/SCons/Tool/default.py +0 -50
  100. data/ext/v8/upstream/scons/engine/SCons/Tool/dmd.py +0 -224
  101. data/ext/v8/upstream/scons/engine/SCons/Tool/dvi.py +0 -64
  102. data/ext/v8/upstream/scons/engine/SCons/Tool/dvipdf.py +0 -125
  103. data/ext/v8/upstream/scons/engine/SCons/Tool/dvips.py +0 -94
  104. data/ext/v8/upstream/scons/engine/SCons/Tool/f77.py +0 -62
  105. data/ext/v8/upstream/scons/engine/SCons/Tool/f90.py +0 -62
  106. data/ext/v8/upstream/scons/engine/SCons/Tool/f95.py +0 -63
  107. data/ext/v8/upstream/scons/engine/SCons/Tool/filesystem.py +0 -98
  108. data/ext/v8/upstream/scons/engine/SCons/Tool/fortran.py +0 -63
  109. data/ext/v8/upstream/scons/engine/SCons/Tool/g++.py +0 -90
  110. data/ext/v8/upstream/scons/engine/SCons/Tool/g77.py +0 -73
  111. data/ext/v8/upstream/scons/engine/SCons/Tool/gas.py +0 -53
  112. data/ext/v8/upstream/scons/engine/SCons/Tool/gcc.py +0 -80
  113. data/ext/v8/upstream/scons/engine/SCons/Tool/gfortran.py +0 -64
  114. data/ext/v8/upstream/scons/engine/SCons/Tool/gnulink.py +0 -63
  115. data/ext/v8/upstream/scons/engine/SCons/Tool/gs.py +0 -81
  116. data/ext/v8/upstream/scons/engine/SCons/Tool/hpc++.py +0 -85
  117. data/ext/v8/upstream/scons/engine/SCons/Tool/hpcc.py +0 -53
  118. data/ext/v8/upstream/scons/engine/SCons/Tool/hplink.py +0 -77
  119. data/ext/v8/upstream/scons/engine/SCons/Tool/icc.py +0 -59
  120. data/ext/v8/upstream/scons/engine/SCons/Tool/icl.py +0 -52
  121. data/ext/v8/upstream/scons/engine/SCons/Tool/ifl.py +0 -72
  122. data/ext/v8/upstream/scons/engine/SCons/Tool/ifort.py +0 -90
  123. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink.py +0 -59
  124. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink32.py +0 -60
  125. data/ext/v8/upstream/scons/engine/SCons/Tool/install.py +0 -229
  126. data/ext/v8/upstream/scons/engine/SCons/Tool/intelc.py +0 -490
  127. data/ext/v8/upstream/scons/engine/SCons/Tool/ipkg.py +0 -71
  128. data/ext/v8/upstream/scons/engine/SCons/Tool/jar.py +0 -110
  129. data/ext/v8/upstream/scons/engine/SCons/Tool/javac.py +0 -234
  130. data/ext/v8/upstream/scons/engine/SCons/Tool/javah.py +0 -138
  131. data/ext/v8/upstream/scons/engine/SCons/Tool/latex.py +0 -79
  132. data/ext/v8/upstream/scons/engine/SCons/Tool/lex.py +0 -99
  133. data/ext/v8/upstream/scons/engine/SCons/Tool/link.py +0 -121
  134. data/ext/v8/upstream/scons/engine/SCons/Tool/linkloc.py +0 -112
  135. data/ext/v8/upstream/scons/engine/SCons/Tool/m4.py +0 -63
  136. data/ext/v8/upstream/scons/engine/SCons/Tool/masm.py +0 -77
  137. data/ext/v8/upstream/scons/engine/SCons/Tool/midl.py +0 -90
  138. data/ext/v8/upstream/scons/engine/SCons/Tool/mingw.py +0 -159
  139. data/ext/v8/upstream/scons/engine/SCons/Tool/mslib.py +0 -64
  140. data/ext/v8/upstream/scons/engine/SCons/Tool/mslink.py +0 -266
  141. data/ext/v8/upstream/scons/engine/SCons/Tool/mssdk.py +0 -50
  142. data/ext/v8/upstream/scons/engine/SCons/Tool/msvc.py +0 -269
  143. data/ext/v8/upstream/scons/engine/SCons/Tool/msvs.py +0 -1439
  144. data/ext/v8/upstream/scons/engine/SCons/Tool/mwcc.py +0 -208
  145. data/ext/v8/upstream/scons/engine/SCons/Tool/mwld.py +0 -107
  146. data/ext/v8/upstream/scons/engine/SCons/Tool/nasm.py +0 -72
  147. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/__init__.py +0 -314
  148. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/ipk.py +0 -185
  149. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/msi.py +0 -526
  150. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/rpm.py +0 -367
  151. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_tarbz2.py +0 -43
  152. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_targz.py +0 -43
  153. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_zip.py +0 -43
  154. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/tarbz2.py +0 -44
  155. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/targz.py +0 -44
  156. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/zip.py +0 -44
  157. data/ext/v8/upstream/scons/engine/SCons/Tool/pdf.py +0 -78
  158. data/ext/v8/upstream/scons/engine/SCons/Tool/pdflatex.py +0 -83
  159. data/ext/v8/upstream/scons/engine/SCons/Tool/pdftex.py +0 -108
  160. data/ext/v8/upstream/scons/engine/SCons/Tool/qt.py +0 -336
  161. data/ext/v8/upstream/scons/engine/SCons/Tool/rmic.py +0 -121
  162. data/ext/v8/upstream/scons/engine/SCons/Tool/rpcgen.py +0 -70
  163. data/ext/v8/upstream/scons/engine/SCons/Tool/rpm.py +0 -132
  164. data/ext/v8/upstream/scons/engine/SCons/Tool/sgiar.py +0 -68
  165. data/ext/v8/upstream/scons/engine/SCons/Tool/sgic++.py +0 -58
  166. data/ext/v8/upstream/scons/engine/SCons/Tool/sgicc.py +0 -53
  167. data/ext/v8/upstream/scons/engine/SCons/Tool/sgilink.py +0 -63
  168. data/ext/v8/upstream/scons/engine/SCons/Tool/sunar.py +0 -67
  169. data/ext/v8/upstream/scons/engine/SCons/Tool/sunc++.py +0 -142
  170. data/ext/v8/upstream/scons/engine/SCons/Tool/suncc.py +0 -58
  171. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf77.py +0 -63
  172. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf90.py +0 -64
  173. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf95.py +0 -64
  174. data/ext/v8/upstream/scons/engine/SCons/Tool/sunlink.py +0 -77
  175. data/ext/v8/upstream/scons/engine/SCons/Tool/swig.py +0 -186
  176. data/ext/v8/upstream/scons/engine/SCons/Tool/tar.py +0 -73
  177. data/ext/v8/upstream/scons/engine/SCons/Tool/tex.py +0 -805
  178. data/ext/v8/upstream/scons/engine/SCons/Tool/textfile.py +0 -175
  179. data/ext/v8/upstream/scons/engine/SCons/Tool/tlib.py +0 -53
  180. data/ext/v8/upstream/scons/engine/SCons/Tool/wix.py +0 -100
  181. data/ext/v8/upstream/scons/engine/SCons/Tool/yacc.py +0 -131
  182. data/ext/v8/upstream/scons/engine/SCons/Tool/zip.py +0 -100
  183. data/ext/v8/upstream/scons/engine/SCons/Util.py +0 -1645
  184. data/ext/v8/upstream/scons/engine/SCons/Variables/BoolVariable.py +0 -91
  185. data/ext/v8/upstream/scons/engine/SCons/Variables/EnumVariable.py +0 -107
  186. data/ext/v8/upstream/scons/engine/SCons/Variables/ListVariable.py +0 -139
  187. data/ext/v8/upstream/scons/engine/SCons/Variables/PackageVariable.py +0 -109
  188. data/ext/v8/upstream/scons/engine/SCons/Variables/PathVariable.py +0 -147
  189. data/ext/v8/upstream/scons/engine/SCons/Variables/__init__.py +0 -317
  190. data/ext/v8/upstream/scons/engine/SCons/Warnings.py +0 -228
  191. data/ext/v8/upstream/scons/engine/SCons/__init__.py +0 -49
  192. data/ext/v8/upstream/scons/engine/SCons/compat/__init__.py +0 -302
  193. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_UserString.py +0 -98
  194. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_hashlib.py +0 -91
  195. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_itertools.py +0 -124
  196. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_optparse.py +0 -1725
  197. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets.py +0 -583
  198. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets15.py +0 -176
  199. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_shlex.py +0 -325
  200. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_subprocess.py +0 -1296
  201. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_textwrap.py +0 -382
  202. data/ext/v8/upstream/scons/engine/SCons/compat/builtins.py +0 -187
  203. data/ext/v8/upstream/scons/engine/SCons/cpp.py +0 -598
  204. data/ext/v8/upstream/scons/engine/SCons/dblite.py +0 -248
  205. data/ext/v8/upstream/scons/engine/SCons/exitfuncs.py +0 -77
  206. data/ext/v8/upstream/scons/os_spawnv_fix.diff +0 -83
  207. data/ext/v8/upstream/scons/scons-time.1 +0 -1017
  208. data/ext/v8/upstream/scons/scons.1 +0 -15179
  209. data/ext/v8/upstream/scons/sconsign.1 +0 -208
  210. data/ext/v8/upstream/scons/script/scons +0 -184
  211. data/ext/v8/upstream/scons/script/scons-time +0 -1529
  212. data/ext/v8/upstream/scons/script/scons.bat +0 -31
  213. data/ext/v8/upstream/scons/script/sconsign +0 -508
  214. data/ext/v8/upstream/scons/setup.cfg +0 -6
  215. data/ext/v8/upstream/scons/setup.py +0 -427
  216. data/ext/v8/upstream/v8/.gitignore +0 -33
  217. data/ext/v8/upstream/v8/AUTHORS +0 -42
  218. data/ext/v8/upstream/v8/ChangeLog +0 -2663
  219. data/ext/v8/upstream/v8/LICENSE +0 -52
  220. data/ext/v8/upstream/v8/LICENSE.strongtalk +0 -29
  221. data/ext/v8/upstream/v8/LICENSE.v8 +0 -26
  222. data/ext/v8/upstream/v8/LICENSE.valgrind +0 -45
  223. data/ext/v8/upstream/v8/SConstruct +0 -1473
  224. data/ext/v8/upstream/v8/build/README.txt +0 -25
  225. data/ext/v8/upstream/v8/build/all.gyp +0 -18
  226. data/ext/v8/upstream/v8/build/armu.gypi +0 -32
  227. data/ext/v8/upstream/v8/build/common.gypi +0 -82
  228. data/ext/v8/upstream/v8/build/gyp_v8 +0 -145
  229. data/ext/v8/upstream/v8/include/v8-debug.h +0 -394
  230. data/ext/v8/upstream/v8/include/v8-preparser.h +0 -116
  231. data/ext/v8/upstream/v8/include/v8-profiler.h +0 -505
  232. data/ext/v8/upstream/v8/include/v8-testing.h +0 -104
  233. data/ext/v8/upstream/v8/include/v8.h +0 -4000
  234. data/ext/v8/upstream/v8/include/v8stdint.h +0 -53
  235. data/ext/v8/upstream/v8/preparser/SConscript +0 -38
  236. data/ext/v8/upstream/v8/preparser/preparser-process.cc +0 -169
  237. data/ext/v8/upstream/v8/src/SConscript +0 -380
  238. data/ext/v8/upstream/v8/src/accessors.cc +0 -766
  239. data/ext/v8/upstream/v8/src/accessors.h +0 -121
  240. data/ext/v8/upstream/v8/src/allocation-inl.h +0 -49
  241. data/ext/v8/upstream/v8/src/allocation.cc +0 -122
  242. data/ext/v8/upstream/v8/src/allocation.h +0 -143
  243. data/ext/v8/upstream/v8/src/api.cc +0 -5678
  244. data/ext/v8/upstream/v8/src/api.h +0 -572
  245. data/ext/v8/upstream/v8/src/apinatives.js +0 -110
  246. data/ext/v8/upstream/v8/src/apiutils.h +0 -73
  247. data/ext/v8/upstream/v8/src/arguments.h +0 -116
  248. data/ext/v8/upstream/v8/src/arm/assembler-arm-inl.h +0 -353
  249. data/ext/v8/upstream/v8/src/arm/assembler-arm.cc +0 -2877
  250. data/ext/v8/upstream/v8/src/arm/assembler-arm.h +0 -1382
  251. data/ext/v8/upstream/v8/src/arm/builtins-arm.cc +0 -1634
  252. data/ext/v8/upstream/v8/src/arm/code-stubs-arm.cc +0 -6917
  253. data/ext/v8/upstream/v8/src/arm/code-stubs-arm.h +0 -623
  254. data/ext/v8/upstream/v8/src/arm/codegen-arm-inl.h +0 -48
  255. data/ext/v8/upstream/v8/src/arm/codegen-arm.cc +0 -7437
  256. data/ext/v8/upstream/v8/src/arm/codegen-arm.h +0 -595
  257. data/ext/v8/upstream/v8/src/arm/constants-arm.cc +0 -152
  258. data/ext/v8/upstream/v8/src/arm/constants-arm.h +0 -778
  259. data/ext/v8/upstream/v8/src/arm/cpu-arm.cc +0 -149
  260. data/ext/v8/upstream/v8/src/arm/debug-arm.cc +0 -317
  261. data/ext/v8/upstream/v8/src/arm/deoptimizer-arm.cc +0 -737
  262. data/ext/v8/upstream/v8/src/arm/disasm-arm.cc +0 -1503
  263. data/ext/v8/upstream/v8/src/arm/frames-arm.cc +0 -45
  264. data/ext/v8/upstream/v8/src/arm/frames-arm.h +0 -168
  265. data/ext/v8/upstream/v8/src/arm/full-codegen-arm.cc +0 -4374
  266. data/ext/v8/upstream/v8/src/arm/ic-arm.cc +0 -1793
  267. data/ext/v8/upstream/v8/src/arm/jump-target-arm.cc +0 -174
  268. data/ext/v8/upstream/v8/src/arm/lithium-arm.cc +0 -2120
  269. data/ext/v8/upstream/v8/src/arm/lithium-arm.h +0 -2179
  270. data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.cc +0 -4132
  271. data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.h +0 -329
  272. data/ext/v8/upstream/v8/src/arm/lithium-gap-resolver-arm.cc +0 -305
  273. data/ext/v8/upstream/v8/src/arm/lithium-gap-resolver-arm.h +0 -84
  274. data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.cc +0 -2939
  275. data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.h +0 -1071
  276. data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.cc +0 -1287
  277. data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.h +0 -253
  278. data/ext/v8/upstream/v8/src/arm/register-allocator-arm-inl.h +0 -100
  279. data/ext/v8/upstream/v8/src/arm/register-allocator-arm.cc +0 -63
  280. data/ext/v8/upstream/v8/src/arm/register-allocator-arm.h +0 -44
  281. data/ext/v8/upstream/v8/src/arm/simulator-arm.cc +0 -3288
  282. data/ext/v8/upstream/v8/src/arm/simulator-arm.h +0 -413
  283. data/ext/v8/upstream/v8/src/arm/stub-cache-arm.cc +0 -4034
  284. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm-inl.h +0 -59
  285. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.cc +0 -843
  286. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.h +0 -523
  287. data/ext/v8/upstream/v8/src/array.js +0 -1249
  288. data/ext/v8/upstream/v8/src/assembler.cc +0 -1067
  289. data/ext/v8/upstream/v8/src/assembler.h +0 -823
  290. data/ext/v8/upstream/v8/src/ast-inl.h +0 -112
  291. data/ext/v8/upstream/v8/src/ast.cc +0 -1078
  292. data/ext/v8/upstream/v8/src/ast.h +0 -2234
  293. data/ext/v8/upstream/v8/src/atomicops.h +0 -167
  294. data/ext/v8/upstream/v8/src/atomicops_internals_arm_gcc.h +0 -145
  295. data/ext/v8/upstream/v8/src/atomicops_internals_mips_gcc.h +0 -169
  296. data/ext/v8/upstream/v8/src/atomicops_internals_x86_gcc.cc +0 -126
  297. data/ext/v8/upstream/v8/src/atomicops_internals_x86_gcc.h +0 -287
  298. data/ext/v8/upstream/v8/src/atomicops_internals_x86_macosx.h +0 -301
  299. data/ext/v8/upstream/v8/src/atomicops_internals_x86_msvc.h +0 -203
  300. data/ext/v8/upstream/v8/src/bignum-dtoa.cc +0 -655
  301. data/ext/v8/upstream/v8/src/bignum-dtoa.h +0 -81
  302. data/ext/v8/upstream/v8/src/bignum.cc +0 -768
  303. data/ext/v8/upstream/v8/src/bignum.h +0 -140
  304. data/ext/v8/upstream/v8/src/bootstrapper.cc +0 -2138
  305. data/ext/v8/upstream/v8/src/bootstrapper.h +0 -185
  306. data/ext/v8/upstream/v8/src/builtins.cc +0 -1708
  307. data/ext/v8/upstream/v8/src/builtins.h +0 -368
  308. data/ext/v8/upstream/v8/src/bytecodes-irregexp.h +0 -105
  309. data/ext/v8/upstream/v8/src/cached-powers.cc +0 -177
  310. data/ext/v8/upstream/v8/src/cached-powers.h +0 -65
  311. data/ext/v8/upstream/v8/src/char-predicates-inl.h +0 -94
  312. data/ext/v8/upstream/v8/src/char-predicates.h +0 -65
  313. data/ext/v8/upstream/v8/src/checks.cc +0 -110
  314. data/ext/v8/upstream/v8/src/checks.h +0 -296
  315. data/ext/v8/upstream/v8/src/circular-queue-inl.h +0 -53
  316. data/ext/v8/upstream/v8/src/circular-queue.cc +0 -122
  317. data/ext/v8/upstream/v8/src/circular-queue.h +0 -103
  318. data/ext/v8/upstream/v8/src/code-stubs.cc +0 -240
  319. data/ext/v8/upstream/v8/src/code-stubs.h +0 -971
  320. data/ext/v8/upstream/v8/src/code.h +0 -68
  321. data/ext/v8/upstream/v8/src/codegen-inl.h +0 -68
  322. data/ext/v8/upstream/v8/src/codegen.cc +0 -505
  323. data/ext/v8/upstream/v8/src/codegen.h +0 -245
  324. data/ext/v8/upstream/v8/src/compilation-cache.cc +0 -540
  325. data/ext/v8/upstream/v8/src/compilation-cache.h +0 -287
  326. data/ext/v8/upstream/v8/src/compiler.cc +0 -792
  327. data/ext/v8/upstream/v8/src/compiler.h +0 -307
  328. data/ext/v8/upstream/v8/src/contexts.cc +0 -327
  329. data/ext/v8/upstream/v8/src/contexts.h +0 -382
  330. data/ext/v8/upstream/v8/src/conversions-inl.h +0 -110
  331. data/ext/v8/upstream/v8/src/conversions.cc +0 -1125
  332. data/ext/v8/upstream/v8/src/conversions.h +0 -122
  333. data/ext/v8/upstream/v8/src/counters.cc +0 -93
  334. data/ext/v8/upstream/v8/src/counters.h +0 -254
  335. data/ext/v8/upstream/v8/src/cpu-profiler-inl.h +0 -101
  336. data/ext/v8/upstream/v8/src/cpu-profiler.cc +0 -606
  337. data/ext/v8/upstream/v8/src/cpu-profiler.h +0 -305
  338. data/ext/v8/upstream/v8/src/cpu.h +0 -67
  339. data/ext/v8/upstream/v8/src/d8-debug.cc +0 -367
  340. data/ext/v8/upstream/v8/src/d8-debug.h +0 -158
  341. data/ext/v8/upstream/v8/src/d8-posix.cc +0 -695
  342. data/ext/v8/upstream/v8/src/d8-readline.cc +0 -128
  343. data/ext/v8/upstream/v8/src/d8-windows.cc +0 -42
  344. data/ext/v8/upstream/v8/src/d8.cc +0 -796
  345. data/ext/v8/upstream/v8/src/d8.gyp +0 -88
  346. data/ext/v8/upstream/v8/src/d8.h +0 -231
  347. data/ext/v8/upstream/v8/src/d8.js +0 -2798
  348. data/ext/v8/upstream/v8/src/data-flow.cc +0 -545
  349. data/ext/v8/upstream/v8/src/data-flow.h +0 -379
  350. data/ext/v8/upstream/v8/src/date.js +0 -1103
  351. data/ext/v8/upstream/v8/src/dateparser-inl.h +0 -125
  352. data/ext/v8/upstream/v8/src/dateparser.cc +0 -178
  353. data/ext/v8/upstream/v8/src/dateparser.h +0 -265
  354. data/ext/v8/upstream/v8/src/debug-agent.cc +0 -447
  355. data/ext/v8/upstream/v8/src/debug-agent.h +0 -129
  356. data/ext/v8/upstream/v8/src/debug-debugger.js +0 -2569
  357. data/ext/v8/upstream/v8/src/debug.cc +0 -3188
  358. data/ext/v8/upstream/v8/src/debug.h +0 -1055
  359. data/ext/v8/upstream/v8/src/deoptimizer.cc +0 -1296
  360. data/ext/v8/upstream/v8/src/deoptimizer.h +0 -629
  361. data/ext/v8/upstream/v8/src/disasm.h +0 -80
  362. data/ext/v8/upstream/v8/src/disassembler.cc +0 -339
  363. data/ext/v8/upstream/v8/src/disassembler.h +0 -56
  364. data/ext/v8/upstream/v8/src/diy-fp.cc +0 -58
  365. data/ext/v8/upstream/v8/src/diy-fp.h +0 -117
  366. data/ext/v8/upstream/v8/src/double.h +0 -238
  367. data/ext/v8/upstream/v8/src/dtoa.cc +0 -103
  368. data/ext/v8/upstream/v8/src/dtoa.h +0 -85
  369. data/ext/v8/upstream/v8/src/execution.cc +0 -791
  370. data/ext/v8/upstream/v8/src/execution.h +0 -291
  371. data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.cc +0 -250
  372. data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.h +0 -89
  373. data/ext/v8/upstream/v8/src/extensions/experimental/experimental.gyp +0 -55
  374. data/ext/v8/upstream/v8/src/extensions/experimental/i18n-extension.cc +0 -284
  375. data/ext/v8/upstream/v8/src/extensions/experimental/i18n-extension.h +0 -64
  376. data/ext/v8/upstream/v8/src/extensions/externalize-string-extension.cc +0 -141
  377. data/ext/v8/upstream/v8/src/extensions/externalize-string-extension.h +0 -50
  378. data/ext/v8/upstream/v8/src/extensions/gc-extension.cc +0 -58
  379. data/ext/v8/upstream/v8/src/extensions/gc-extension.h +0 -49
  380. data/ext/v8/upstream/v8/src/factory.cc +0 -1194
  381. data/ext/v8/upstream/v8/src/factory.h +0 -436
  382. data/ext/v8/upstream/v8/src/fast-dtoa.cc +0 -736
  383. data/ext/v8/upstream/v8/src/fast-dtoa.h +0 -83
  384. data/ext/v8/upstream/v8/src/fixed-dtoa.cc +0 -405
  385. data/ext/v8/upstream/v8/src/fixed-dtoa.h +0 -55
  386. data/ext/v8/upstream/v8/src/flag-definitions.h +0 -556
  387. data/ext/v8/upstream/v8/src/flags.cc +0 -551
  388. data/ext/v8/upstream/v8/src/flags.h +0 -79
  389. data/ext/v8/upstream/v8/src/frame-element.cc +0 -37
  390. data/ext/v8/upstream/v8/src/frame-element.h +0 -269
  391. data/ext/v8/upstream/v8/src/frames-inl.h +0 -236
  392. data/ext/v8/upstream/v8/src/frames.cc +0 -1273
  393. data/ext/v8/upstream/v8/src/frames.h +0 -854
  394. data/ext/v8/upstream/v8/src/full-codegen.cc +0 -1385
  395. data/ext/v8/upstream/v8/src/full-codegen.h +0 -753
  396. data/ext/v8/upstream/v8/src/func-name-inferrer.cc +0 -91
  397. data/ext/v8/upstream/v8/src/func-name-inferrer.h +0 -111
  398. data/ext/v8/upstream/v8/src/gdb-jit.cc +0 -1548
  399. data/ext/v8/upstream/v8/src/gdb-jit.h +0 -138
  400. data/ext/v8/upstream/v8/src/global-handles.cc +0 -596
  401. data/ext/v8/upstream/v8/src/global-handles.h +0 -239
  402. data/ext/v8/upstream/v8/src/globals.h +0 -325
  403. data/ext/v8/upstream/v8/src/handles-inl.h +0 -177
  404. data/ext/v8/upstream/v8/src/handles.cc +0 -965
  405. data/ext/v8/upstream/v8/src/handles.h +0 -372
  406. data/ext/v8/upstream/v8/src/hashmap.cc +0 -230
  407. data/ext/v8/upstream/v8/src/hashmap.h +0 -121
  408. data/ext/v8/upstream/v8/src/heap-inl.h +0 -703
  409. data/ext/v8/upstream/v8/src/heap-profiler.cc +0 -1173
  410. data/ext/v8/upstream/v8/src/heap-profiler.h +0 -396
  411. data/ext/v8/upstream/v8/src/heap.cc +0 -5856
  412. data/ext/v8/upstream/v8/src/heap.h +0 -2264
  413. data/ext/v8/upstream/v8/src/hydrogen-instructions.cc +0 -1639
  414. data/ext/v8/upstream/v8/src/hydrogen-instructions.h +0 -3657
  415. data/ext/v8/upstream/v8/src/hydrogen.cc +0 -6011
  416. data/ext/v8/upstream/v8/src/hydrogen.h +0 -1137
  417. data/ext/v8/upstream/v8/src/ia32/assembler-ia32-inl.h +0 -430
  418. data/ext/v8/upstream/v8/src/ia32/assembler-ia32.cc +0 -2846
  419. data/ext/v8/upstream/v8/src/ia32/assembler-ia32.h +0 -1159
  420. data/ext/v8/upstream/v8/src/ia32/builtins-ia32.cc +0 -1596
  421. data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.cc +0 -6549
  422. data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.h +0 -495
  423. data/ext/v8/upstream/v8/src/ia32/codegen-ia32-inl.h +0 -46
  424. data/ext/v8/upstream/v8/src/ia32/codegen-ia32.cc +0 -10385
  425. data/ext/v8/upstream/v8/src/ia32/codegen-ia32.h +0 -801
  426. data/ext/v8/upstream/v8/src/ia32/cpu-ia32.cc +0 -88
  427. data/ext/v8/upstream/v8/src/ia32/debug-ia32.cc +0 -312
  428. data/ext/v8/upstream/v8/src/ia32/deoptimizer-ia32.cc +0 -774
  429. data/ext/v8/upstream/v8/src/ia32/disasm-ia32.cc +0 -1620
  430. data/ext/v8/upstream/v8/src/ia32/frames-ia32.cc +0 -45
  431. data/ext/v8/upstream/v8/src/ia32/frames-ia32.h +0 -140
  432. data/ext/v8/upstream/v8/src/ia32/full-codegen-ia32.cc +0 -4357
  433. data/ext/v8/upstream/v8/src/ia32/ic-ia32.cc +0 -1779
  434. data/ext/v8/upstream/v8/src/ia32/jump-target-ia32.cc +0 -437
  435. data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.cc +0 -4158
  436. data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.h +0 -318
  437. data/ext/v8/upstream/v8/src/ia32/lithium-gap-resolver-ia32.cc +0 -466
  438. data/ext/v8/upstream/v8/src/ia32/lithium-gap-resolver-ia32.h +0 -110
  439. data/ext/v8/upstream/v8/src/ia32/lithium-ia32.cc +0 -2181
  440. data/ext/v8/upstream/v8/src/ia32/lithium-ia32.h +0 -2235
  441. data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.cc +0 -2056
  442. data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.h +0 -807
  443. data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.cc +0 -1264
  444. data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.h +0 -216
  445. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32-inl.h +0 -82
  446. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32.cc +0 -157
  447. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32.h +0 -43
  448. data/ext/v8/upstream/v8/src/ia32/simulator-ia32.cc +0 -30
  449. data/ext/v8/upstream/v8/src/ia32/simulator-ia32.h +0 -72
  450. data/ext/v8/upstream/v8/src/ia32/stub-cache-ia32.cc +0 -3711
  451. data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.cc +0 -1366
  452. data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.h +0 -650
  453. data/ext/v8/upstream/v8/src/ic-inl.h +0 -130
  454. data/ext/v8/upstream/v8/src/ic.cc +0 -2389
  455. data/ext/v8/upstream/v8/src/ic.h +0 -675
  456. data/ext/v8/upstream/v8/src/inspector.cc +0 -63
  457. data/ext/v8/upstream/v8/src/inspector.h +0 -62
  458. data/ext/v8/upstream/v8/src/interpreter-irregexp.cc +0 -659
  459. data/ext/v8/upstream/v8/src/interpreter-irregexp.h +0 -49
  460. data/ext/v8/upstream/v8/src/isolate.cc +0 -883
  461. data/ext/v8/upstream/v8/src/isolate.h +0 -1306
  462. data/ext/v8/upstream/v8/src/json.js +0 -342
  463. data/ext/v8/upstream/v8/src/jsregexp.cc +0 -5371
  464. data/ext/v8/upstream/v8/src/jsregexp.h +0 -1483
  465. data/ext/v8/upstream/v8/src/jump-target-heavy-inl.h +0 -51
  466. data/ext/v8/upstream/v8/src/jump-target-heavy.cc +0 -427
  467. data/ext/v8/upstream/v8/src/jump-target-heavy.h +0 -238
  468. data/ext/v8/upstream/v8/src/jump-target-inl.h +0 -48
  469. data/ext/v8/upstream/v8/src/jump-target-light-inl.h +0 -56
  470. data/ext/v8/upstream/v8/src/jump-target-light.cc +0 -111
  471. data/ext/v8/upstream/v8/src/jump-target-light.h +0 -193
  472. data/ext/v8/upstream/v8/src/jump-target.cc +0 -91
  473. data/ext/v8/upstream/v8/src/jump-target.h +0 -90
  474. data/ext/v8/upstream/v8/src/list-inl.h +0 -206
  475. data/ext/v8/upstream/v8/src/list.h +0 -164
  476. data/ext/v8/upstream/v8/src/lithium-allocator-inl.h +0 -142
  477. data/ext/v8/upstream/v8/src/lithium-allocator.cc +0 -2105
  478. data/ext/v8/upstream/v8/src/lithium-allocator.h +0 -630
  479. data/ext/v8/upstream/v8/src/lithium.cc +0 -169
  480. data/ext/v8/upstream/v8/src/lithium.h +0 -592
  481. data/ext/v8/upstream/v8/src/liveedit-debugger.js +0 -1082
  482. data/ext/v8/upstream/v8/src/liveedit.cc +0 -1693
  483. data/ext/v8/upstream/v8/src/liveedit.h +0 -179
  484. data/ext/v8/upstream/v8/src/liveobjectlist-inl.h +0 -126
  485. data/ext/v8/upstream/v8/src/liveobjectlist.cc +0 -2589
  486. data/ext/v8/upstream/v8/src/liveobjectlist.h +0 -322
  487. data/ext/v8/upstream/v8/src/log-inl.h +0 -59
  488. data/ext/v8/upstream/v8/src/log-utils.cc +0 -423
  489. data/ext/v8/upstream/v8/src/log-utils.h +0 -229
  490. data/ext/v8/upstream/v8/src/log.cc +0 -1666
  491. data/ext/v8/upstream/v8/src/log.h +0 -446
  492. data/ext/v8/upstream/v8/src/macro-assembler.h +0 -120
  493. data/ext/v8/upstream/v8/src/macros.py +0 -178
  494. data/ext/v8/upstream/v8/src/mark-compact.cc +0 -3092
  495. data/ext/v8/upstream/v8/src/mark-compact.h +0 -506
  496. data/ext/v8/upstream/v8/src/math.js +0 -264
  497. data/ext/v8/upstream/v8/src/messages.cc +0 -166
  498. data/ext/v8/upstream/v8/src/messages.h +0 -114
  499. data/ext/v8/upstream/v8/src/messages.js +0 -1090
  500. data/ext/v8/upstream/v8/src/mips/assembler-mips-inl.h +0 -335
  501. data/ext/v8/upstream/v8/src/mips/assembler-mips.cc +0 -2093
  502. data/ext/v8/upstream/v8/src/mips/assembler-mips.h +0 -1066
  503. data/ext/v8/upstream/v8/src/mips/builtins-mips.cc +0 -148
  504. data/ext/v8/upstream/v8/src/mips/code-stubs-mips.cc +0 -752
  505. data/ext/v8/upstream/v8/src/mips/code-stubs-mips.h +0 -511
  506. data/ext/v8/upstream/v8/src/mips/codegen-mips-inl.h +0 -64
  507. data/ext/v8/upstream/v8/src/mips/codegen-mips.cc +0 -1213
  508. data/ext/v8/upstream/v8/src/mips/codegen-mips.h +0 -633
  509. data/ext/v8/upstream/v8/src/mips/constants-mips.cc +0 -352
  510. data/ext/v8/upstream/v8/src/mips/constants-mips.h +0 -723
  511. data/ext/v8/upstream/v8/src/mips/cpu-mips.cc +0 -90
  512. data/ext/v8/upstream/v8/src/mips/debug-mips.cc +0 -155
  513. data/ext/v8/upstream/v8/src/mips/deoptimizer-mips.cc +0 -91
  514. data/ext/v8/upstream/v8/src/mips/disasm-mips.cc +0 -1023
  515. data/ext/v8/upstream/v8/src/mips/frames-mips.cc +0 -48
  516. data/ext/v8/upstream/v8/src/mips/frames-mips.h +0 -179
  517. data/ext/v8/upstream/v8/src/mips/full-codegen-mips.cc +0 -727
  518. data/ext/v8/upstream/v8/src/mips/ic-mips.cc +0 -244
  519. data/ext/v8/upstream/v8/src/mips/jump-target-mips.cc +0 -80
  520. data/ext/v8/upstream/v8/src/mips/lithium-codegen-mips.h +0 -65
  521. data/ext/v8/upstream/v8/src/mips/lithium-mips.h +0 -304
  522. data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.cc +0 -3327
  523. data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.h +0 -1058
  524. data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.cc +0 -478
  525. data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.h +0 -250
  526. data/ext/v8/upstream/v8/src/mips/register-allocator-mips-inl.h +0 -134
  527. data/ext/v8/upstream/v8/src/mips/register-allocator-mips.cc +0 -63
  528. data/ext/v8/upstream/v8/src/mips/register-allocator-mips.h +0 -47
  529. data/ext/v8/upstream/v8/src/mips/simulator-mips.cc +0 -2438
  530. data/ext/v8/upstream/v8/src/mips/simulator-mips.h +0 -394
  531. data/ext/v8/upstream/v8/src/mips/stub-cache-mips.cc +0 -601
  532. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips-inl.h +0 -58
  533. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.cc +0 -307
  534. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.h +0 -530
  535. data/ext/v8/upstream/v8/src/mirror-debugger.js +0 -2381
  536. data/ext/v8/upstream/v8/src/mksnapshot.cc +0 -256
  537. data/ext/v8/upstream/v8/src/natives.h +0 -63
  538. data/ext/v8/upstream/v8/src/objects-debug.cc +0 -722
  539. data/ext/v8/upstream/v8/src/objects-inl.h +0 -4166
  540. data/ext/v8/upstream/v8/src/objects-printer.cc +0 -801
  541. data/ext/v8/upstream/v8/src/objects-visiting.cc +0 -142
  542. data/ext/v8/upstream/v8/src/objects-visiting.h +0 -422
  543. data/ext/v8/upstream/v8/src/objects.cc +0 -10296
  544. data/ext/v8/upstream/v8/src/objects.h +0 -6662
  545. data/ext/v8/upstream/v8/src/parser.cc +0 -5168
  546. data/ext/v8/upstream/v8/src/parser.h +0 -823
  547. data/ext/v8/upstream/v8/src/platform-cygwin.cc +0 -811
  548. data/ext/v8/upstream/v8/src/platform-freebsd.cc +0 -854
  549. data/ext/v8/upstream/v8/src/platform-linux.cc +0 -1120
  550. data/ext/v8/upstream/v8/src/platform-macos.cc +0 -865
  551. data/ext/v8/upstream/v8/src/platform-nullos.cc +0 -504
  552. data/ext/v8/upstream/v8/src/platform-openbsd.cc +0 -672
  553. data/ext/v8/upstream/v8/src/platform-posix.cc +0 -424
  554. data/ext/v8/upstream/v8/src/platform-solaris.cc +0 -796
  555. data/ext/v8/upstream/v8/src/platform-tls-mac.h +0 -62
  556. data/ext/v8/upstream/v8/src/platform-tls-win32.h +0 -62
  557. data/ext/v8/upstream/v8/src/platform-tls.h +0 -50
  558. data/ext/v8/upstream/v8/src/platform-win32.cc +0 -2072
  559. data/ext/v8/upstream/v8/src/platform.h +0 -693
  560. data/ext/v8/upstream/v8/src/preparse-data.cc +0 -185
  561. data/ext/v8/upstream/v8/src/preparse-data.h +0 -249
  562. data/ext/v8/upstream/v8/src/preparser-api.cc +0 -219
  563. data/ext/v8/upstream/v8/src/preparser.cc +0 -1205
  564. data/ext/v8/upstream/v8/src/preparser.h +0 -278
  565. data/ext/v8/upstream/v8/src/prettyprinter.cc +0 -1530
  566. data/ext/v8/upstream/v8/src/prettyprinter.h +0 -223
  567. data/ext/v8/upstream/v8/src/profile-generator-inl.h +0 -128
  568. data/ext/v8/upstream/v8/src/profile-generator.cc +0 -3095
  569. data/ext/v8/upstream/v8/src/profile-generator.h +0 -1125
  570. data/ext/v8/upstream/v8/src/property.cc +0 -102
  571. data/ext/v8/upstream/v8/src/property.h +0 -348
  572. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp-inl.h +0 -78
  573. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp.cc +0 -470
  574. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp.h +0 -142
  575. data/ext/v8/upstream/v8/src/regexp-macro-assembler-tracer.cc +0 -373
  576. data/ext/v8/upstream/v8/src/regexp-macro-assembler-tracer.h +0 -104
  577. data/ext/v8/upstream/v8/src/regexp-macro-assembler.cc +0 -266
  578. data/ext/v8/upstream/v8/src/regexp-macro-assembler.h +0 -236
  579. data/ext/v8/upstream/v8/src/regexp-stack.cc +0 -111
  580. data/ext/v8/upstream/v8/src/regexp-stack.h +0 -147
  581. data/ext/v8/upstream/v8/src/regexp.js +0 -483
  582. data/ext/v8/upstream/v8/src/register-allocator-inl.h +0 -141
  583. data/ext/v8/upstream/v8/src/register-allocator.cc +0 -98
  584. data/ext/v8/upstream/v8/src/register-allocator.h +0 -310
  585. data/ext/v8/upstream/v8/src/rewriter.cc +0 -1024
  586. data/ext/v8/upstream/v8/src/rewriter.h +0 -59
  587. data/ext/v8/upstream/v8/src/runtime-profiler.cc +0 -478
  588. data/ext/v8/upstream/v8/src/runtime-profiler.h +0 -192
  589. data/ext/v8/upstream/v8/src/runtime.cc +0 -11949
  590. data/ext/v8/upstream/v8/src/runtime.h +0 -643
  591. data/ext/v8/upstream/v8/src/runtime.js +0 -643
  592. data/ext/v8/upstream/v8/src/safepoint-table.cc +0 -256
  593. data/ext/v8/upstream/v8/src/safepoint-table.h +0 -269
  594. data/ext/v8/upstream/v8/src/scanner-base.cc +0 -964
  595. data/ext/v8/upstream/v8/src/scanner-base.h +0 -664
  596. data/ext/v8/upstream/v8/src/scanner.cc +0 -584
  597. data/ext/v8/upstream/v8/src/scanner.h +0 -196
  598. data/ext/v8/upstream/v8/src/scopeinfo.cc +0 -631
  599. data/ext/v8/upstream/v8/src/scopeinfo.h +0 -249
  600. data/ext/v8/upstream/v8/src/scopes.cc +0 -1093
  601. data/ext/v8/upstream/v8/src/scopes.h +0 -508
  602. data/ext/v8/upstream/v8/src/serialize.cc +0 -1574
  603. data/ext/v8/upstream/v8/src/serialize.h +0 -589
  604. data/ext/v8/upstream/v8/src/shell.h +0 -55
  605. data/ext/v8/upstream/v8/src/simulator.h +0 -43
  606. data/ext/v8/upstream/v8/src/small-pointer-list.h +0 -163
  607. data/ext/v8/upstream/v8/src/smart-pointer.h +0 -109
  608. data/ext/v8/upstream/v8/src/snapshot-common.cc +0 -82
  609. data/ext/v8/upstream/v8/src/snapshot-empty.cc +0 -50
  610. data/ext/v8/upstream/v8/src/snapshot.h +0 -73
  611. data/ext/v8/upstream/v8/src/spaces-inl.h +0 -529
  612. data/ext/v8/upstream/v8/src/spaces.cc +0 -3147
  613. data/ext/v8/upstream/v8/src/spaces.h +0 -2368
  614. data/ext/v8/upstream/v8/src/splay-tree-inl.h +0 -310
  615. data/ext/v8/upstream/v8/src/splay-tree.h +0 -203
  616. data/ext/v8/upstream/v8/src/string-search.cc +0 -41
  617. data/ext/v8/upstream/v8/src/string-search.h +0 -568
  618. data/ext/v8/upstream/v8/src/string-stream.cc +0 -592
  619. data/ext/v8/upstream/v8/src/string-stream.h +0 -191
  620. data/ext/v8/upstream/v8/src/string.js +0 -915
  621. data/ext/v8/upstream/v8/src/strtod.cc +0 -440
  622. data/ext/v8/upstream/v8/src/strtod.h +0 -40
  623. data/ext/v8/upstream/v8/src/stub-cache.cc +0 -1940
  624. data/ext/v8/upstream/v8/src/stub-cache.h +0 -866
  625. data/ext/v8/upstream/v8/src/third_party/valgrind/valgrind.h +0 -3925
  626. data/ext/v8/upstream/v8/src/token.cc +0 -63
  627. data/ext/v8/upstream/v8/src/token.h +0 -288
  628. data/ext/v8/upstream/v8/src/top.cc +0 -983
  629. data/ext/v8/upstream/v8/src/type-info.cc +0 -472
  630. data/ext/v8/upstream/v8/src/type-info.h +0 -290
  631. data/ext/v8/upstream/v8/src/unbound-queue-inl.h +0 -95
  632. data/ext/v8/upstream/v8/src/unbound-queue.h +0 -67
  633. data/ext/v8/upstream/v8/src/unicode-inl.h +0 -238
  634. data/ext/v8/upstream/v8/src/unicode.cc +0 -1624
  635. data/ext/v8/upstream/v8/src/unicode.h +0 -280
  636. data/ext/v8/upstream/v8/src/uri.js +0 -402
  637. data/ext/v8/upstream/v8/src/utils.cc +0 -371
  638. data/ext/v8/upstream/v8/src/utils.h +0 -796
  639. data/ext/v8/upstream/v8/src/v8-counters.cc +0 -62
  640. data/ext/v8/upstream/v8/src/v8-counters.h +0 -311
  641. data/ext/v8/upstream/v8/src/v8.cc +0 -215
  642. data/ext/v8/upstream/v8/src/v8.h +0 -130
  643. data/ext/v8/upstream/v8/src/v8checks.h +0 -64
  644. data/ext/v8/upstream/v8/src/v8dll-main.cc +0 -39
  645. data/ext/v8/upstream/v8/src/v8globals.h +0 -486
  646. data/ext/v8/upstream/v8/src/v8memory.h +0 -82
  647. data/ext/v8/upstream/v8/src/v8natives.js +0 -1293
  648. data/ext/v8/upstream/v8/src/v8preparserdll-main.cc +0 -39
  649. data/ext/v8/upstream/v8/src/v8threads.cc +0 -453
  650. data/ext/v8/upstream/v8/src/v8threads.h +0 -164
  651. data/ext/v8/upstream/v8/src/v8utils.h +0 -317
  652. data/ext/v8/upstream/v8/src/variables.cc +0 -132
  653. data/ext/v8/upstream/v8/src/variables.h +0 -212
  654. data/ext/v8/upstream/v8/src/version.cc +0 -116
  655. data/ext/v8/upstream/v8/src/version.h +0 -68
  656. data/ext/v8/upstream/v8/src/virtual-frame-heavy-inl.h +0 -190
  657. data/ext/v8/upstream/v8/src/virtual-frame-heavy.cc +0 -312
  658. data/ext/v8/upstream/v8/src/virtual-frame-inl.h +0 -39
  659. data/ext/v8/upstream/v8/src/virtual-frame-light-inl.h +0 -171
  660. data/ext/v8/upstream/v8/src/virtual-frame-light.cc +0 -52
  661. data/ext/v8/upstream/v8/src/virtual-frame.cc +0 -49
  662. data/ext/v8/upstream/v8/src/virtual-frame.h +0 -59
  663. data/ext/v8/upstream/v8/src/vm-state-inl.h +0 -138
  664. data/ext/v8/upstream/v8/src/vm-state.h +0 -70
  665. data/ext/v8/upstream/v8/src/win32-headers.h +0 -96
  666. data/ext/v8/upstream/v8/src/x64/assembler-x64-inl.h +0 -456
  667. data/ext/v8/upstream/v8/src/x64/assembler-x64.cc +0 -2954
  668. data/ext/v8/upstream/v8/src/x64/assembler-x64.h +0 -1630
  669. data/ext/v8/upstream/v8/src/x64/builtins-x64.cc +0 -1493
  670. data/ext/v8/upstream/v8/src/x64/code-stubs-x64.cc +0 -5132
  671. data/ext/v8/upstream/v8/src/x64/code-stubs-x64.h +0 -477
  672. data/ext/v8/upstream/v8/src/x64/codegen-x64-inl.h +0 -46
  673. data/ext/v8/upstream/v8/src/x64/codegen-x64.cc +0 -8843
  674. data/ext/v8/upstream/v8/src/x64/codegen-x64.h +0 -753
  675. data/ext/v8/upstream/v8/src/x64/cpu-x64.cc +0 -88
  676. data/ext/v8/upstream/v8/src/x64/debug-x64.cc +0 -318
  677. data/ext/v8/upstream/v8/src/x64/deoptimizer-x64.cc +0 -815
  678. data/ext/v8/upstream/v8/src/x64/disasm-x64.cc +0 -1752
  679. data/ext/v8/upstream/v8/src/x64/frames-x64.cc +0 -45
  680. data/ext/v8/upstream/v8/src/x64/frames-x64.h +0 -130
  681. data/ext/v8/upstream/v8/src/x64/full-codegen-x64.cc +0 -4339
  682. data/ext/v8/upstream/v8/src/x64/ic-x64.cc +0 -1752
  683. data/ext/v8/upstream/v8/src/x64/jump-target-x64.cc +0 -437
  684. data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.cc +0 -3970
  685. data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.h +0 -318
  686. data/ext/v8/upstream/v8/src/x64/lithium-gap-resolver-x64.cc +0 -320
  687. data/ext/v8/upstream/v8/src/x64/lithium-gap-resolver-x64.h +0 -74
  688. data/ext/v8/upstream/v8/src/x64/lithium-x64.cc +0 -2115
  689. data/ext/v8/upstream/v8/src/x64/lithium-x64.h +0 -2161
  690. data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.cc +0 -2911
  691. data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.h +0 -1984
  692. data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.cc +0 -1398
  693. data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.h +0 -282
  694. data/ext/v8/upstream/v8/src/x64/register-allocator-x64-inl.h +0 -87
  695. data/ext/v8/upstream/v8/src/x64/register-allocator-x64.cc +0 -95
  696. data/ext/v8/upstream/v8/src/x64/register-allocator-x64.h +0 -43
  697. data/ext/v8/upstream/v8/src/x64/simulator-x64.cc +0 -27
  698. data/ext/v8/upstream/v8/src/x64/simulator-x64.h +0 -71
  699. data/ext/v8/upstream/v8/src/x64/stub-cache-x64.cc +0 -3460
  700. data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.cc +0 -1296
  701. data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.h +0 -597
  702. data/ext/v8/upstream/v8/src/zone-inl.h +0 -129
  703. data/ext/v8/upstream/v8/src/zone.cc +0 -196
  704. data/ext/v8/upstream/v8/src/zone.h +0 -236
  705. data/ext/v8/upstream/v8/tools/codemap.js +0 -265
  706. data/ext/v8/upstream/v8/tools/consarray.js +0 -93
  707. data/ext/v8/upstream/v8/tools/csvparser.js +0 -78
  708. data/ext/v8/upstream/v8/tools/disasm.py +0 -92
  709. data/ext/v8/upstream/v8/tools/freebsd-tick-processor +0 -10
  710. data/ext/v8/upstream/v8/tools/gc-nvp-trace-processor.py +0 -328
  711. data/ext/v8/upstream/v8/tools/generate-ten-powers.scm +0 -286
  712. data/ext/v8/upstream/v8/tools/grokdump.py +0 -840
  713. data/ext/v8/upstream/v8/tools/gyp/v8.gyp +0 -844
  714. data/ext/v8/upstream/v8/tools/js2c.py +0 -380
  715. data/ext/v8/upstream/v8/tools/jsmin.py +0 -280
  716. data/ext/v8/upstream/v8/tools/linux-tick-processor +0 -35
  717. data/ext/v8/upstream/v8/tools/ll_prof.py +0 -919
  718. data/ext/v8/upstream/v8/tools/logreader.js +0 -185
  719. data/ext/v8/upstream/v8/tools/mac-nm +0 -18
  720. data/ext/v8/upstream/v8/tools/mac-tick-processor +0 -6
  721. data/ext/v8/upstream/v8/tools/oom_dump/README +0 -31
  722. data/ext/v8/upstream/v8/tools/oom_dump/SConstruct +0 -42
  723. data/ext/v8/upstream/v8/tools/oom_dump/oom_dump.cc +0 -288
  724. data/ext/v8/upstream/v8/tools/presubmit.py +0 -305
  725. data/ext/v8/upstream/v8/tools/process-heap-prof.py +0 -120
  726. data/ext/v8/upstream/v8/tools/profile.js +0 -751
  727. data/ext/v8/upstream/v8/tools/profile_view.js +0 -219
  728. data/ext/v8/upstream/v8/tools/run-valgrind.py +0 -77
  729. data/ext/v8/upstream/v8/tools/splaytree.js +0 -316
  730. data/ext/v8/upstream/v8/tools/stats-viewer.py +0 -468
  731. data/ext/v8/upstream/v8/tools/test.py +0 -1490
  732. data/ext/v8/upstream/v8/tools/tickprocessor-driver.js +0 -59
  733. data/ext/v8/upstream/v8/tools/tickprocessor.js +0 -877
  734. data/ext/v8/upstream/v8/tools/utils.py +0 -96
  735. data/ext/v8/upstream/v8/tools/visual_studio/README.txt +0 -70
  736. data/ext/v8/upstream/v8/tools/visual_studio/arm.vsprops +0 -14
  737. data/ext/v8/upstream/v8/tools/visual_studio/common.vsprops +0 -34
  738. data/ext/v8/upstream/v8/tools/visual_studio/d8.vcproj +0 -193
  739. data/ext/v8/upstream/v8/tools/visual_studio/d8_arm.vcproj +0 -193
  740. data/ext/v8/upstream/v8/tools/visual_studio/d8_x64.vcproj +0 -209
  741. data/ext/v8/upstream/v8/tools/visual_studio/d8js2c.cmd +0 -6
  742. data/ext/v8/upstream/v8/tools/visual_studio/debug.vsprops +0 -17
  743. data/ext/v8/upstream/v8/tools/visual_studio/ia32.vsprops +0 -17
  744. data/ext/v8/upstream/v8/tools/visual_studio/js2c.cmd +0 -6
  745. data/ext/v8/upstream/v8/tools/visual_studio/release.vsprops +0 -24
  746. data/ext/v8/upstream/v8/tools/visual_studio/v8.sln +0 -101
  747. data/ext/v8/upstream/v8/tools/visual_studio/v8.vcproj +0 -227
  748. data/ext/v8/upstream/v8/tools/visual_studio/v8_arm.sln +0 -74
  749. data/ext/v8/upstream/v8/tools/visual_studio/v8_arm.vcproj +0 -227
  750. data/ext/v8/upstream/v8/tools/visual_studio/v8_base.vcproj +0 -1308
  751. data/ext/v8/upstream/v8/tools/visual_studio/v8_base_arm.vcproj +0 -1238
  752. data/ext/v8/upstream/v8/tools/visual_studio/v8_base_x64.vcproj +0 -1300
  753. data/ext/v8/upstream/v8/tools/visual_studio/v8_cctest.vcproj +0 -265
  754. data/ext/v8/upstream/v8/tools/visual_studio/v8_cctest_arm.vcproj +0 -249
  755. data/ext/v8/upstream/v8/tools/visual_studio/v8_cctest_x64.vcproj +0 -257
  756. data/ext/v8/upstream/v8/tools/visual_studio/v8_mksnapshot.vcproj +0 -145
  757. data/ext/v8/upstream/v8/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -145
  758. data/ext/v8/upstream/v8/tools/visual_studio/v8_process_sample.vcproj +0 -145
  759. data/ext/v8/upstream/v8/tools/visual_studio/v8_process_sample_arm.vcproj +0 -145
  760. data/ext/v8/upstream/v8/tools/visual_studio/v8_process_sample_x64.vcproj +0 -161
  761. data/ext/v8/upstream/v8/tools/visual_studio/v8_shell_sample.vcproj +0 -147
  762. data/ext/v8/upstream/v8/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -147
  763. data/ext/v8/upstream/v8/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -163
  764. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot.vcproj +0 -142
  765. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot_cc.vcproj +0 -92
  766. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -92
  767. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot_x64.vcproj +0 -142
  768. data/ext/v8/upstream/v8/tools/visual_studio/v8_x64.sln +0 -101
  769. data/ext/v8/upstream/v8/tools/visual_studio/v8_x64.vcproj +0 -227
  770. data/ext/v8/upstream/v8/tools/visual_studio/x64.vsprops +0 -18
  771. data/ext/v8/upstream/v8/tools/windows-tick-processor.bat +0 -30
@@ -1,2056 +0,0 @@
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
- #include "v8.h"
29
-
30
- #if defined(V8_TARGET_ARCH_IA32)
31
-
32
- #include "bootstrapper.h"
33
- #include "codegen-inl.h"
34
- #include "debug.h"
35
- #include "runtime.h"
36
- #include "serialize.h"
37
-
38
- namespace v8 {
39
- namespace internal {
40
-
41
- // -------------------------------------------------------------------------
42
- // MacroAssembler implementation.
43
-
44
- MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size)
45
- : Assembler(arg_isolate, buffer, size),
46
- generating_stub_(false),
47
- allow_stub_calls_(true) {
48
- if (isolate() != NULL) {
49
- code_object_ = Handle<Object>(isolate()->heap()->undefined_value(),
50
- isolate());
51
- }
52
- }
53
-
54
-
55
- void MacroAssembler::RecordWriteHelper(Register object,
56
- Register addr,
57
- Register scratch) {
58
- if (emit_debug_code()) {
59
- // Check that the object is not in new space.
60
- Label not_in_new_space;
61
- InNewSpace(object, scratch, not_equal, &not_in_new_space);
62
- Abort("new-space object passed to RecordWriteHelper");
63
- bind(&not_in_new_space);
64
- }
65
-
66
- // Compute the page start address from the heap object pointer, and reuse
67
- // the 'object' register for it.
68
- and_(object, ~Page::kPageAlignmentMask);
69
-
70
- // Compute number of region covering addr. See Page::GetRegionNumberForAddress
71
- // method for more details.
72
- and_(addr, Page::kPageAlignmentMask);
73
- shr(addr, Page::kRegionSizeLog2);
74
-
75
- // Set dirty mark for region.
76
- bts(Operand(object, Page::kDirtyFlagOffset), addr);
77
- }
78
-
79
-
80
- void MacroAssembler::RecordWrite(Register object,
81
- int offset,
82
- Register value,
83
- Register scratch) {
84
- // First, check if a write barrier is even needed. The tests below
85
- // catch stores of Smis and stores into young gen.
86
- NearLabel done;
87
-
88
- // Skip barrier if writing a smi.
89
- ASSERT_EQ(0, kSmiTag);
90
- test(value, Immediate(kSmiTagMask));
91
- j(zero, &done);
92
-
93
- InNewSpace(object, value, equal, &done);
94
-
95
- // The offset is relative to a tagged or untagged HeapObject pointer,
96
- // so either offset or offset + kHeapObjectTag must be a
97
- // multiple of kPointerSize.
98
- ASSERT(IsAligned(offset, kPointerSize) ||
99
- IsAligned(offset + kHeapObjectTag, kPointerSize));
100
-
101
- Register dst = scratch;
102
- if (offset != 0) {
103
- lea(dst, Operand(object, offset));
104
- } else {
105
- // Array access: calculate the destination address in the same manner as
106
- // KeyedStoreIC::GenerateGeneric. Multiply a smi by 2 to get an offset
107
- // into an array of words.
108
- ASSERT_EQ(1, kSmiTagSize);
109
- ASSERT_EQ(0, kSmiTag);
110
- lea(dst, Operand(object, dst, times_half_pointer_size,
111
- FixedArray::kHeaderSize - kHeapObjectTag));
112
- }
113
- RecordWriteHelper(object, dst, value);
114
-
115
- bind(&done);
116
-
117
- // Clobber all input registers when running with the debug-code flag
118
- // turned on to provoke errors.
119
- if (emit_debug_code()) {
120
- mov(object, Immediate(BitCast<int32_t>(kZapValue)));
121
- mov(value, Immediate(BitCast<int32_t>(kZapValue)));
122
- mov(scratch, Immediate(BitCast<int32_t>(kZapValue)));
123
- }
124
- }
125
-
126
-
127
- void MacroAssembler::RecordWrite(Register object,
128
- Register address,
129
- Register value) {
130
- // First, check if a write barrier is even needed. The tests below
131
- // catch stores of Smis and stores into young gen.
132
- Label done;
133
-
134
- // Skip barrier if writing a smi.
135
- ASSERT_EQ(0, kSmiTag);
136
- test(value, Immediate(kSmiTagMask));
137
- j(zero, &done);
138
-
139
- InNewSpace(object, value, equal, &done);
140
-
141
- RecordWriteHelper(object, address, value);
142
-
143
- bind(&done);
144
-
145
- // Clobber all input registers when running with the debug-code flag
146
- // turned on to provoke errors.
147
- if (emit_debug_code()) {
148
- mov(object, Immediate(BitCast<int32_t>(kZapValue)));
149
- mov(address, Immediate(BitCast<int32_t>(kZapValue)));
150
- mov(value, Immediate(BitCast<int32_t>(kZapValue)));
151
- }
152
- }
153
-
154
-
155
- #ifdef ENABLE_DEBUGGER_SUPPORT
156
- void MacroAssembler::DebugBreak() {
157
- Set(eax, Immediate(0));
158
- mov(ebx, Immediate(ExternalReference(Runtime::kDebugBreak, isolate())));
159
- CEntryStub ces(1);
160
- call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
161
- }
162
- #endif
163
-
164
-
165
- void MacroAssembler::Set(Register dst, const Immediate& x) {
166
- if (x.is_zero()) {
167
- xor_(dst, Operand(dst)); // shorter than mov
168
- } else {
169
- mov(dst, x);
170
- }
171
- }
172
-
173
-
174
- void MacroAssembler::Set(const Operand& dst, const Immediate& x) {
175
- mov(dst, x);
176
- }
177
-
178
-
179
- void MacroAssembler::CmpObjectType(Register heap_object,
180
- InstanceType type,
181
- Register map) {
182
- mov(map, FieldOperand(heap_object, HeapObject::kMapOffset));
183
- CmpInstanceType(map, type);
184
- }
185
-
186
-
187
- void MacroAssembler::CmpInstanceType(Register map, InstanceType type) {
188
- cmpb(FieldOperand(map, Map::kInstanceTypeOffset),
189
- static_cast<int8_t>(type));
190
- }
191
-
192
-
193
- void MacroAssembler::CheckMap(Register obj,
194
- Handle<Map> map,
195
- Label* fail,
196
- bool is_heap_object) {
197
- if (!is_heap_object) {
198
- test(obj, Immediate(kSmiTagMask));
199
- j(zero, fail);
200
- }
201
- cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map));
202
- j(not_equal, fail);
203
- }
204
-
205
-
206
- Condition MacroAssembler::IsObjectStringType(Register heap_object,
207
- Register map,
208
- Register instance_type) {
209
- mov(map, FieldOperand(heap_object, HeapObject::kMapOffset));
210
- movzx_b(instance_type, FieldOperand(map, Map::kInstanceTypeOffset));
211
- ASSERT(kNotStringTag != 0);
212
- test(instance_type, Immediate(kIsNotStringMask));
213
- return zero;
214
- }
215
-
216
-
217
- void MacroAssembler::IsObjectJSObjectType(Register heap_object,
218
- Register map,
219
- Register scratch,
220
- Label* fail) {
221
- mov(map, FieldOperand(heap_object, HeapObject::kMapOffset));
222
- IsInstanceJSObjectType(map, scratch, fail);
223
- }
224
-
225
-
226
- void MacroAssembler::IsInstanceJSObjectType(Register map,
227
- Register scratch,
228
- Label* fail) {
229
- movzx_b(scratch, FieldOperand(map, Map::kInstanceTypeOffset));
230
- sub(Operand(scratch), Immediate(FIRST_JS_OBJECT_TYPE));
231
- cmp(scratch, LAST_JS_OBJECT_TYPE - FIRST_JS_OBJECT_TYPE);
232
- j(above, fail);
233
- }
234
-
235
-
236
- void MacroAssembler::FCmp() {
237
- if (CpuFeatures::IsSupported(CMOV)) {
238
- fucomip();
239
- ffree(0);
240
- fincstp();
241
- } else {
242
- fucompp();
243
- push(eax);
244
- fnstsw_ax();
245
- sahf();
246
- pop(eax);
247
- }
248
- }
249
-
250
-
251
- void MacroAssembler::AbortIfNotNumber(Register object) {
252
- Label ok;
253
- test(object, Immediate(kSmiTagMask));
254
- j(zero, &ok);
255
- cmp(FieldOperand(object, HeapObject::kMapOffset),
256
- isolate()->factory()->heap_number_map());
257
- Assert(equal, "Operand not a number");
258
- bind(&ok);
259
- }
260
-
261
-
262
- void MacroAssembler::AbortIfNotSmi(Register object) {
263
- test(object, Immediate(kSmiTagMask));
264
- Assert(equal, "Operand is not a smi");
265
- }
266
-
267
-
268
- void MacroAssembler::AbortIfNotString(Register object) {
269
- test(object, Immediate(kSmiTagMask));
270
- Assert(not_equal, "Operand is not a string");
271
- push(object);
272
- mov(object, FieldOperand(object, HeapObject::kMapOffset));
273
- CmpInstanceType(object, FIRST_NONSTRING_TYPE);
274
- pop(object);
275
- Assert(below, "Operand is not a string");
276
- }
277
-
278
-
279
- void MacroAssembler::AbortIfSmi(Register object) {
280
- test(object, Immediate(kSmiTagMask));
281
- Assert(not_equal, "Operand is a smi");
282
- }
283
-
284
-
285
- void MacroAssembler::EnterFrame(StackFrame::Type type) {
286
- push(ebp);
287
- mov(ebp, Operand(esp));
288
- push(esi);
289
- push(Immediate(Smi::FromInt(type)));
290
- push(Immediate(CodeObject()));
291
- if (emit_debug_code()) {
292
- cmp(Operand(esp, 0), Immediate(isolate()->factory()->undefined_value()));
293
- Check(not_equal, "code object not properly patched");
294
- }
295
- }
296
-
297
-
298
- void MacroAssembler::LeaveFrame(StackFrame::Type type) {
299
- if (emit_debug_code()) {
300
- cmp(Operand(ebp, StandardFrameConstants::kMarkerOffset),
301
- Immediate(Smi::FromInt(type)));
302
- Check(equal, "stack frame types must match");
303
- }
304
- leave();
305
- }
306
-
307
-
308
- void MacroAssembler::EnterExitFramePrologue() {
309
- // Setup the frame structure on the stack.
310
- ASSERT(ExitFrameConstants::kCallerSPDisplacement == +2 * kPointerSize);
311
- ASSERT(ExitFrameConstants::kCallerPCOffset == +1 * kPointerSize);
312
- ASSERT(ExitFrameConstants::kCallerFPOffset == 0 * kPointerSize);
313
- push(ebp);
314
- mov(ebp, Operand(esp));
315
-
316
- // Reserve room for entry stack pointer and push the code object.
317
- ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize);
318
- push(Immediate(0)); // Saved entry sp, patched before call.
319
- push(Immediate(CodeObject())); // Accessed from ExitFrame::code_slot.
320
-
321
- // Save the frame pointer and the context in top.
322
- ExternalReference c_entry_fp_address(Isolate::k_c_entry_fp_address,
323
- isolate());
324
- ExternalReference context_address(Isolate::k_context_address,
325
- isolate());
326
- mov(Operand::StaticVariable(c_entry_fp_address), ebp);
327
- mov(Operand::StaticVariable(context_address), esi);
328
- }
329
-
330
-
331
- void MacroAssembler::EnterExitFrameEpilogue(int argc, bool save_doubles) {
332
- // Optionally save all XMM registers.
333
- if (save_doubles) {
334
- CpuFeatures::Scope scope(SSE2);
335
- int space = XMMRegister::kNumRegisters * kDoubleSize + argc * kPointerSize;
336
- sub(Operand(esp), Immediate(space));
337
- const int offset = -2 * kPointerSize;
338
- for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
339
- XMMRegister reg = XMMRegister::from_code(i);
340
- movdbl(Operand(ebp, offset - ((i + 1) * kDoubleSize)), reg);
341
- }
342
- } else {
343
- sub(Operand(esp), Immediate(argc * kPointerSize));
344
- }
345
-
346
- // Get the required frame alignment for the OS.
347
- const int kFrameAlignment = OS::ActivationFrameAlignment();
348
- if (kFrameAlignment > 0) {
349
- ASSERT(IsPowerOf2(kFrameAlignment));
350
- and_(esp, -kFrameAlignment);
351
- }
352
-
353
- // Patch the saved entry sp.
354
- mov(Operand(ebp, ExitFrameConstants::kSPOffset), esp);
355
- }
356
-
357
-
358
- void MacroAssembler::EnterExitFrame(bool save_doubles) {
359
- EnterExitFramePrologue();
360
-
361
- // Setup argc and argv in callee-saved registers.
362
- int offset = StandardFrameConstants::kCallerSPOffset - kPointerSize;
363
- mov(edi, Operand(eax));
364
- lea(esi, Operand(ebp, eax, times_4, offset));
365
-
366
- // Reserve space for argc, argv and isolate.
367
- EnterExitFrameEpilogue(3, save_doubles);
368
- }
369
-
370
-
371
- void MacroAssembler::EnterApiExitFrame(int argc) {
372
- EnterExitFramePrologue();
373
- EnterExitFrameEpilogue(argc, false);
374
- }
375
-
376
-
377
- void MacroAssembler::LeaveExitFrame(bool save_doubles) {
378
- // Optionally restore all XMM registers.
379
- if (save_doubles) {
380
- CpuFeatures::Scope scope(SSE2);
381
- const int offset = -2 * kPointerSize;
382
- for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
383
- XMMRegister reg = XMMRegister::from_code(i);
384
- movdbl(reg, Operand(ebp, offset - ((i + 1) * kDoubleSize)));
385
- }
386
- }
387
-
388
- // Get the return address from the stack and restore the frame pointer.
389
- mov(ecx, Operand(ebp, 1 * kPointerSize));
390
- mov(ebp, Operand(ebp, 0 * kPointerSize));
391
-
392
- // Pop the arguments and the receiver from the caller stack.
393
- lea(esp, Operand(esi, 1 * kPointerSize));
394
-
395
- // Push the return address to get ready to return.
396
- push(ecx);
397
-
398
- LeaveExitFrameEpilogue();
399
- }
400
-
401
- void MacroAssembler::LeaveExitFrameEpilogue() {
402
- // Restore current context from top and clear it in debug mode.
403
- ExternalReference context_address(Isolate::k_context_address, isolate());
404
- mov(esi, Operand::StaticVariable(context_address));
405
- #ifdef DEBUG
406
- mov(Operand::StaticVariable(context_address), Immediate(0));
407
- #endif
408
-
409
- // Clear the top frame.
410
- ExternalReference c_entry_fp_address(Isolate::k_c_entry_fp_address,
411
- isolate());
412
- mov(Operand::StaticVariable(c_entry_fp_address), Immediate(0));
413
- }
414
-
415
-
416
- void MacroAssembler::LeaveApiExitFrame() {
417
- mov(esp, Operand(ebp));
418
- pop(ebp);
419
-
420
- LeaveExitFrameEpilogue();
421
- }
422
-
423
-
424
- void MacroAssembler::PushTryHandler(CodeLocation try_location,
425
- HandlerType type) {
426
- // Adjust this code if not the case.
427
- ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
428
- // The pc (return address) is already on TOS.
429
- if (try_location == IN_JAVASCRIPT) {
430
- if (type == TRY_CATCH_HANDLER) {
431
- push(Immediate(StackHandler::TRY_CATCH));
432
- } else {
433
- push(Immediate(StackHandler::TRY_FINALLY));
434
- }
435
- push(ebp);
436
- } else {
437
- ASSERT(try_location == IN_JS_ENTRY);
438
- // The frame pointer does not point to a JS frame so we save NULL
439
- // for ebp. We expect the code throwing an exception to check ebp
440
- // before dereferencing it to restore the context.
441
- push(Immediate(StackHandler::ENTRY));
442
- push(Immediate(0)); // NULL frame pointer.
443
- }
444
- // Save the current handler as the next handler.
445
- push(Operand::StaticVariable(ExternalReference(Isolate::k_handler_address,
446
- isolate())));
447
- // Link this handler as the new current one.
448
- mov(Operand::StaticVariable(ExternalReference(Isolate::k_handler_address,
449
- isolate())),
450
- esp);
451
- }
452
-
453
-
454
- void MacroAssembler::PopTryHandler() {
455
- ASSERT_EQ(0, StackHandlerConstants::kNextOffset);
456
- pop(Operand::StaticVariable(ExternalReference(Isolate::k_handler_address,
457
- isolate())));
458
- add(Operand(esp), Immediate(StackHandlerConstants::kSize - kPointerSize));
459
- }
460
-
461
-
462
- void MacroAssembler::Throw(Register value) {
463
- // Adjust this code if not the case.
464
- STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
465
-
466
- // eax must hold the exception.
467
- if (!value.is(eax)) {
468
- mov(eax, value);
469
- }
470
-
471
- // Drop the sp to the top of the handler.
472
- ExternalReference handler_address(Isolate::k_handler_address,
473
- isolate());
474
- mov(esp, Operand::StaticVariable(handler_address));
475
-
476
- // Restore next handler and frame pointer, discard handler state.
477
- STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
478
- pop(Operand::StaticVariable(handler_address));
479
- STATIC_ASSERT(StackHandlerConstants::kFPOffset == 1 * kPointerSize);
480
- pop(ebp);
481
- pop(edx); // Remove state.
482
-
483
- // Before returning we restore the context from the frame pointer if
484
- // not NULL. The frame pointer is NULL in the exception handler of
485
- // a JS entry frame.
486
- Set(esi, Immediate(0)); // Tentatively set context pointer to NULL.
487
- NearLabel skip;
488
- cmp(ebp, 0);
489
- j(equal, &skip, not_taken);
490
- mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
491
- bind(&skip);
492
-
493
- STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize);
494
- ret(0);
495
- }
496
-
497
-
498
- void MacroAssembler::ThrowUncatchable(UncatchableExceptionType type,
499
- Register value) {
500
- // Adjust this code if not the case.
501
- STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
502
-
503
- // eax must hold the exception.
504
- if (!value.is(eax)) {
505
- mov(eax, value);
506
- }
507
-
508
- // Drop sp to the top stack handler.
509
- ExternalReference handler_address(Isolate::k_handler_address,
510
- isolate());
511
- mov(esp, Operand::StaticVariable(handler_address));
512
-
513
- // Unwind the handlers until the ENTRY handler is found.
514
- NearLabel loop, done;
515
- bind(&loop);
516
- // Load the type of the current stack handler.
517
- const int kStateOffset = StackHandlerConstants::kStateOffset;
518
- cmp(Operand(esp, kStateOffset), Immediate(StackHandler::ENTRY));
519
- j(equal, &done);
520
- // Fetch the next handler in the list.
521
- const int kNextOffset = StackHandlerConstants::kNextOffset;
522
- mov(esp, Operand(esp, kNextOffset));
523
- jmp(&loop);
524
- bind(&done);
525
-
526
- // Set the top handler address to next handler past the current ENTRY handler.
527
- STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
528
- pop(Operand::StaticVariable(handler_address));
529
-
530
- if (type == OUT_OF_MEMORY) {
531
- // Set external caught exception to false.
532
- ExternalReference external_caught(
533
- Isolate::k_external_caught_exception_address,
534
- isolate());
535
- mov(eax, false);
536
- mov(Operand::StaticVariable(external_caught), eax);
537
-
538
- // Set pending exception and eax to out of memory exception.
539
- ExternalReference pending_exception(Isolate::k_pending_exception_address,
540
- isolate());
541
- mov(eax, reinterpret_cast<int32_t>(Failure::OutOfMemoryException()));
542
- mov(Operand::StaticVariable(pending_exception), eax);
543
- }
544
-
545
- // Clear the context pointer.
546
- Set(esi, Immediate(0));
547
-
548
- // Restore fp from handler and discard handler state.
549
- STATIC_ASSERT(StackHandlerConstants::kFPOffset == 1 * kPointerSize);
550
- pop(ebp);
551
- pop(edx); // State.
552
-
553
- STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize);
554
- ret(0);
555
- }
556
-
557
-
558
- void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
559
- Register scratch,
560
- Label* miss) {
561
- Label same_contexts;
562
-
563
- ASSERT(!holder_reg.is(scratch));
564
-
565
- // Load current lexical context from the stack frame.
566
- mov(scratch, Operand(ebp, StandardFrameConstants::kContextOffset));
567
-
568
- // When generating debug code, make sure the lexical context is set.
569
- if (emit_debug_code()) {
570
- cmp(Operand(scratch), Immediate(0));
571
- Check(not_equal, "we should not have an empty lexical context");
572
- }
573
- // Load the global context of the current context.
574
- int offset = Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
575
- mov(scratch, FieldOperand(scratch, offset));
576
- mov(scratch, FieldOperand(scratch, GlobalObject::kGlobalContextOffset));
577
-
578
- // Check the context is a global context.
579
- if (emit_debug_code()) {
580
- push(scratch);
581
- // Read the first word and compare to global_context_map.
582
- mov(scratch, FieldOperand(scratch, HeapObject::kMapOffset));
583
- cmp(scratch, isolate()->factory()->global_context_map());
584
- Check(equal, "JSGlobalObject::global_context should be a global context.");
585
- pop(scratch);
586
- }
587
-
588
- // Check if both contexts are the same.
589
- cmp(scratch, FieldOperand(holder_reg, JSGlobalProxy::kContextOffset));
590
- j(equal, &same_contexts, taken);
591
-
592
- // Compare security tokens, save holder_reg on the stack so we can use it
593
- // as a temporary register.
594
- //
595
- // TODO(119): avoid push(holder_reg)/pop(holder_reg)
596
- push(holder_reg);
597
- // Check that the security token in the calling global object is
598
- // compatible with the security token in the receiving global
599
- // object.
600
- mov(holder_reg, FieldOperand(holder_reg, JSGlobalProxy::kContextOffset));
601
-
602
- // Check the context is a global context.
603
- if (emit_debug_code()) {
604
- cmp(holder_reg, isolate()->factory()->null_value());
605
- Check(not_equal, "JSGlobalProxy::context() should not be null.");
606
-
607
- push(holder_reg);
608
- // Read the first word and compare to global_context_map(),
609
- mov(holder_reg, FieldOperand(holder_reg, HeapObject::kMapOffset));
610
- cmp(holder_reg, isolate()->factory()->global_context_map());
611
- Check(equal, "JSGlobalObject::global_context should be a global context.");
612
- pop(holder_reg);
613
- }
614
-
615
- int token_offset = Context::kHeaderSize +
616
- Context::SECURITY_TOKEN_INDEX * kPointerSize;
617
- mov(scratch, FieldOperand(scratch, token_offset));
618
- cmp(scratch, FieldOperand(holder_reg, token_offset));
619
- pop(holder_reg);
620
- j(not_equal, miss, not_taken);
621
-
622
- bind(&same_contexts);
623
- }
624
-
625
-
626
- void MacroAssembler::LoadAllocationTopHelper(Register result,
627
- Register scratch,
628
- AllocationFlags flags) {
629
- ExternalReference new_space_allocation_top =
630
- ExternalReference::new_space_allocation_top_address(isolate());
631
-
632
- // Just return if allocation top is already known.
633
- if ((flags & RESULT_CONTAINS_TOP) != 0) {
634
- // No use of scratch if allocation top is provided.
635
- ASSERT(scratch.is(no_reg));
636
- #ifdef DEBUG
637
- // Assert that result actually contains top on entry.
638
- cmp(result, Operand::StaticVariable(new_space_allocation_top));
639
- Check(equal, "Unexpected allocation top");
640
- #endif
641
- return;
642
- }
643
-
644
- // Move address of new object to result. Use scratch register if available.
645
- if (scratch.is(no_reg)) {
646
- mov(result, Operand::StaticVariable(new_space_allocation_top));
647
- } else {
648
- mov(Operand(scratch), Immediate(new_space_allocation_top));
649
- mov(result, Operand(scratch, 0));
650
- }
651
- }
652
-
653
-
654
- void MacroAssembler::UpdateAllocationTopHelper(Register result_end,
655
- Register scratch) {
656
- if (emit_debug_code()) {
657
- test(result_end, Immediate(kObjectAlignmentMask));
658
- Check(zero, "Unaligned allocation in new space");
659
- }
660
-
661
- ExternalReference new_space_allocation_top =
662
- ExternalReference::new_space_allocation_top_address(isolate());
663
-
664
- // Update new top. Use scratch if available.
665
- if (scratch.is(no_reg)) {
666
- mov(Operand::StaticVariable(new_space_allocation_top), result_end);
667
- } else {
668
- mov(Operand(scratch, 0), result_end);
669
- }
670
- }
671
-
672
-
673
- void MacroAssembler::AllocateInNewSpace(int object_size,
674
- Register result,
675
- Register result_end,
676
- Register scratch,
677
- Label* gc_required,
678
- AllocationFlags flags) {
679
- if (!FLAG_inline_new) {
680
- if (emit_debug_code()) {
681
- // Trash the registers to simulate an allocation failure.
682
- mov(result, Immediate(0x7091));
683
- if (result_end.is_valid()) {
684
- mov(result_end, Immediate(0x7191));
685
- }
686
- if (scratch.is_valid()) {
687
- mov(scratch, Immediate(0x7291));
688
- }
689
- }
690
- jmp(gc_required);
691
- return;
692
- }
693
- ASSERT(!result.is(result_end));
694
-
695
- // Load address of new object into result.
696
- LoadAllocationTopHelper(result, scratch, flags);
697
-
698
- Register top_reg = result_end.is_valid() ? result_end : result;
699
-
700
- // Calculate new top and bail out if new space is exhausted.
701
- ExternalReference new_space_allocation_limit =
702
- ExternalReference::new_space_allocation_limit_address(isolate());
703
-
704
- if (!top_reg.is(result)) {
705
- mov(top_reg, result);
706
- }
707
- add(Operand(top_reg), Immediate(object_size));
708
- j(carry, gc_required, not_taken);
709
- cmp(top_reg, Operand::StaticVariable(new_space_allocation_limit));
710
- j(above, gc_required, not_taken);
711
-
712
- // Update allocation top.
713
- UpdateAllocationTopHelper(top_reg, scratch);
714
-
715
- // Tag result if requested.
716
- if (top_reg.is(result)) {
717
- if ((flags & TAG_OBJECT) != 0) {
718
- sub(Operand(result), Immediate(object_size - kHeapObjectTag));
719
- } else {
720
- sub(Operand(result), Immediate(object_size));
721
- }
722
- } else if ((flags & TAG_OBJECT) != 0) {
723
- add(Operand(result), Immediate(kHeapObjectTag));
724
- }
725
- }
726
-
727
-
728
- void MacroAssembler::AllocateInNewSpace(int header_size,
729
- ScaleFactor element_size,
730
- Register element_count,
731
- Register result,
732
- Register result_end,
733
- Register scratch,
734
- Label* gc_required,
735
- AllocationFlags flags) {
736
- if (!FLAG_inline_new) {
737
- if (emit_debug_code()) {
738
- // Trash the registers to simulate an allocation failure.
739
- mov(result, Immediate(0x7091));
740
- mov(result_end, Immediate(0x7191));
741
- if (scratch.is_valid()) {
742
- mov(scratch, Immediate(0x7291));
743
- }
744
- // Register element_count is not modified by the function.
745
- }
746
- jmp(gc_required);
747
- return;
748
- }
749
- ASSERT(!result.is(result_end));
750
-
751
- // Load address of new object into result.
752
- LoadAllocationTopHelper(result, scratch, flags);
753
-
754
- // Calculate new top and bail out if new space is exhausted.
755
- ExternalReference new_space_allocation_limit =
756
- ExternalReference::new_space_allocation_limit_address(isolate());
757
-
758
- // We assume that element_count*element_size + header_size does not
759
- // overflow.
760
- lea(result_end, Operand(element_count, element_size, header_size));
761
- add(result_end, Operand(result));
762
- j(carry, gc_required);
763
- cmp(result_end, Operand::StaticVariable(new_space_allocation_limit));
764
- j(above, gc_required);
765
-
766
- // Tag result if requested.
767
- if ((flags & TAG_OBJECT) != 0) {
768
- lea(result, Operand(result, kHeapObjectTag));
769
- }
770
-
771
- // Update allocation top.
772
- UpdateAllocationTopHelper(result_end, scratch);
773
- }
774
-
775
-
776
- void MacroAssembler::AllocateInNewSpace(Register object_size,
777
- Register result,
778
- Register result_end,
779
- Register scratch,
780
- Label* gc_required,
781
- AllocationFlags flags) {
782
- if (!FLAG_inline_new) {
783
- if (emit_debug_code()) {
784
- // Trash the registers to simulate an allocation failure.
785
- mov(result, Immediate(0x7091));
786
- mov(result_end, Immediate(0x7191));
787
- if (scratch.is_valid()) {
788
- mov(scratch, Immediate(0x7291));
789
- }
790
- // object_size is left unchanged by this function.
791
- }
792
- jmp(gc_required);
793
- return;
794
- }
795
- ASSERT(!result.is(result_end));
796
-
797
- // Load address of new object into result.
798
- LoadAllocationTopHelper(result, scratch, flags);
799
-
800
- // Calculate new top and bail out if new space is exhausted.
801
- ExternalReference new_space_allocation_limit =
802
- ExternalReference::new_space_allocation_limit_address(isolate());
803
- if (!object_size.is(result_end)) {
804
- mov(result_end, object_size);
805
- }
806
- add(result_end, Operand(result));
807
- j(carry, gc_required, not_taken);
808
- cmp(result_end, Operand::StaticVariable(new_space_allocation_limit));
809
- j(above, gc_required, not_taken);
810
-
811
- // Tag result if requested.
812
- if ((flags & TAG_OBJECT) != 0) {
813
- lea(result, Operand(result, kHeapObjectTag));
814
- }
815
-
816
- // Update allocation top.
817
- UpdateAllocationTopHelper(result_end, scratch);
818
- }
819
-
820
-
821
- void MacroAssembler::UndoAllocationInNewSpace(Register object) {
822
- ExternalReference new_space_allocation_top =
823
- ExternalReference::new_space_allocation_top_address(isolate());
824
-
825
- // Make sure the object has no tag before resetting top.
826
- and_(Operand(object), Immediate(~kHeapObjectTagMask));
827
- #ifdef DEBUG
828
- cmp(object, Operand::StaticVariable(new_space_allocation_top));
829
- Check(below, "Undo allocation of non allocated memory");
830
- #endif
831
- mov(Operand::StaticVariable(new_space_allocation_top), object);
832
- }
833
-
834
-
835
- void MacroAssembler::AllocateHeapNumber(Register result,
836
- Register scratch1,
837
- Register scratch2,
838
- Label* gc_required) {
839
- // Allocate heap number in new space.
840
- AllocateInNewSpace(HeapNumber::kSize,
841
- result,
842
- scratch1,
843
- scratch2,
844
- gc_required,
845
- TAG_OBJECT);
846
-
847
- // Set the map.
848
- mov(FieldOperand(result, HeapObject::kMapOffset),
849
- Immediate(isolate()->factory()->heap_number_map()));
850
- }
851
-
852
-
853
- void MacroAssembler::AllocateTwoByteString(Register result,
854
- Register length,
855
- Register scratch1,
856
- Register scratch2,
857
- Register scratch3,
858
- Label* gc_required) {
859
- // Calculate the number of bytes needed for the characters in the string while
860
- // observing object alignment.
861
- ASSERT((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
862
- ASSERT(kShortSize == 2);
863
- // scratch1 = length * 2 + kObjectAlignmentMask.
864
- lea(scratch1, Operand(length, length, times_1, kObjectAlignmentMask));
865
- and_(Operand(scratch1), Immediate(~kObjectAlignmentMask));
866
-
867
- // Allocate two byte string in new space.
868
- AllocateInNewSpace(SeqTwoByteString::kHeaderSize,
869
- times_1,
870
- scratch1,
871
- result,
872
- scratch2,
873
- scratch3,
874
- gc_required,
875
- TAG_OBJECT);
876
-
877
- // Set the map, length and hash field.
878
- mov(FieldOperand(result, HeapObject::kMapOffset),
879
- Immediate(isolate()->factory()->string_map()));
880
- mov(scratch1, length);
881
- SmiTag(scratch1);
882
- mov(FieldOperand(result, String::kLengthOffset), scratch1);
883
- mov(FieldOperand(result, String::kHashFieldOffset),
884
- Immediate(String::kEmptyHashField));
885
- }
886
-
887
-
888
- void MacroAssembler::AllocateAsciiString(Register result,
889
- Register length,
890
- Register scratch1,
891
- Register scratch2,
892
- Register scratch3,
893
- Label* gc_required) {
894
- // Calculate the number of bytes needed for the characters in the string while
895
- // observing object alignment.
896
- ASSERT((SeqAsciiString::kHeaderSize & kObjectAlignmentMask) == 0);
897
- mov(scratch1, length);
898
- ASSERT(kCharSize == 1);
899
- add(Operand(scratch1), Immediate(kObjectAlignmentMask));
900
- and_(Operand(scratch1), Immediate(~kObjectAlignmentMask));
901
-
902
- // Allocate ascii string in new space.
903
- AllocateInNewSpace(SeqAsciiString::kHeaderSize,
904
- times_1,
905
- scratch1,
906
- result,
907
- scratch2,
908
- scratch3,
909
- gc_required,
910
- TAG_OBJECT);
911
-
912
- // Set the map, length and hash field.
913
- mov(FieldOperand(result, HeapObject::kMapOffset),
914
- Immediate(isolate()->factory()->ascii_string_map()));
915
- mov(scratch1, length);
916
- SmiTag(scratch1);
917
- mov(FieldOperand(result, String::kLengthOffset), scratch1);
918
- mov(FieldOperand(result, String::kHashFieldOffset),
919
- Immediate(String::kEmptyHashField));
920
- }
921
-
922
-
923
- void MacroAssembler::AllocateAsciiString(Register result,
924
- int length,
925
- Register scratch1,
926
- Register scratch2,
927
- Label* gc_required) {
928
- ASSERT(length > 0);
929
-
930
- // Allocate ascii string in new space.
931
- AllocateInNewSpace(SeqAsciiString::SizeFor(length),
932
- result,
933
- scratch1,
934
- scratch2,
935
- gc_required,
936
- TAG_OBJECT);
937
-
938
- // Set the map, length and hash field.
939
- mov(FieldOperand(result, HeapObject::kMapOffset),
940
- Immediate(isolate()->factory()->ascii_string_map()));
941
- mov(FieldOperand(result, String::kLengthOffset),
942
- Immediate(Smi::FromInt(length)));
943
- mov(FieldOperand(result, String::kHashFieldOffset),
944
- Immediate(String::kEmptyHashField));
945
- }
946
-
947
-
948
- void MacroAssembler::AllocateConsString(Register result,
949
- Register scratch1,
950
- Register scratch2,
951
- Label* gc_required) {
952
- // Allocate heap number in new space.
953
- AllocateInNewSpace(ConsString::kSize,
954
- result,
955
- scratch1,
956
- scratch2,
957
- gc_required,
958
- TAG_OBJECT);
959
-
960
- // Set the map. The other fields are left uninitialized.
961
- mov(FieldOperand(result, HeapObject::kMapOffset),
962
- Immediate(isolate()->factory()->cons_string_map()));
963
- }
964
-
965
-
966
- void MacroAssembler::AllocateAsciiConsString(Register result,
967
- Register scratch1,
968
- Register scratch2,
969
- Label* gc_required) {
970
- // Allocate heap number in new space.
971
- AllocateInNewSpace(ConsString::kSize,
972
- result,
973
- scratch1,
974
- scratch2,
975
- gc_required,
976
- TAG_OBJECT);
977
-
978
- // Set the map. The other fields are left uninitialized.
979
- mov(FieldOperand(result, HeapObject::kMapOffset),
980
- Immediate(isolate()->factory()->cons_ascii_string_map()));
981
- }
982
-
983
-
984
- // Copy memory, byte-by-byte, from source to destination. Not optimized for
985
- // long or aligned copies. The contents of scratch and length are destroyed.
986
- // Source and destination are incremented by length.
987
- // Many variants of movsb, loop unrolling, word moves, and indexed operands
988
- // have been tried here already, and this is fastest.
989
- // A simpler loop is faster on small copies, but 30% slower on large ones.
990
- // The cld() instruction must have been emitted, to set the direction flag(),
991
- // before calling this function.
992
- void MacroAssembler::CopyBytes(Register source,
993
- Register destination,
994
- Register length,
995
- Register scratch) {
996
- Label loop, done, short_string, short_loop;
997
- // Experimentation shows that the short string loop is faster if length < 10.
998
- cmp(Operand(length), Immediate(10));
999
- j(less_equal, &short_string);
1000
-
1001
- ASSERT(source.is(esi));
1002
- ASSERT(destination.is(edi));
1003
- ASSERT(length.is(ecx));
1004
-
1005
- // Because source is 4-byte aligned in our uses of this function,
1006
- // we keep source aligned for the rep_movs call by copying the odd bytes
1007
- // at the end of the ranges.
1008
- mov(scratch, Operand(source, length, times_1, -4));
1009
- mov(Operand(destination, length, times_1, -4), scratch);
1010
- mov(scratch, ecx);
1011
- shr(ecx, 2);
1012
- rep_movs();
1013
- and_(Operand(scratch), Immediate(0x3));
1014
- add(destination, Operand(scratch));
1015
- jmp(&done);
1016
-
1017
- bind(&short_string);
1018
- test(length, Operand(length));
1019
- j(zero, &done);
1020
-
1021
- bind(&short_loop);
1022
- mov_b(scratch, Operand(source, 0));
1023
- mov_b(Operand(destination, 0), scratch);
1024
- inc(source);
1025
- inc(destination);
1026
- dec(length);
1027
- j(not_zero, &short_loop);
1028
-
1029
- bind(&done);
1030
- }
1031
-
1032
-
1033
- void MacroAssembler::NegativeZeroTest(CodeGenerator* cgen,
1034
- Register result,
1035
- Register op,
1036
- JumpTarget* then_target) {
1037
- JumpTarget ok;
1038
- test(result, Operand(result));
1039
- ok.Branch(not_zero, taken);
1040
- test(op, Operand(op));
1041
- then_target->Branch(sign, not_taken);
1042
- ok.Bind();
1043
- }
1044
-
1045
-
1046
- void MacroAssembler::NegativeZeroTest(Register result,
1047
- Register op,
1048
- Label* then_label) {
1049
- Label ok;
1050
- test(result, Operand(result));
1051
- j(not_zero, &ok, taken);
1052
- test(op, Operand(op));
1053
- j(sign, then_label, not_taken);
1054
- bind(&ok);
1055
- }
1056
-
1057
-
1058
- void MacroAssembler::NegativeZeroTest(Register result,
1059
- Register op1,
1060
- Register op2,
1061
- Register scratch,
1062
- Label* then_label) {
1063
- Label ok;
1064
- test(result, Operand(result));
1065
- j(not_zero, &ok, taken);
1066
- mov(scratch, Operand(op1));
1067
- or_(scratch, Operand(op2));
1068
- j(sign, then_label, not_taken);
1069
- bind(&ok);
1070
- }
1071
-
1072
-
1073
- void MacroAssembler::TryGetFunctionPrototype(Register function,
1074
- Register result,
1075
- Register scratch,
1076
- Label* miss) {
1077
- // Check that the receiver isn't a smi.
1078
- test(function, Immediate(kSmiTagMask));
1079
- j(zero, miss, not_taken);
1080
-
1081
- // Check that the function really is a function.
1082
- CmpObjectType(function, JS_FUNCTION_TYPE, result);
1083
- j(not_equal, miss, not_taken);
1084
-
1085
- // Make sure that the function has an instance prototype.
1086
- Label non_instance;
1087
- movzx_b(scratch, FieldOperand(result, Map::kBitFieldOffset));
1088
- test(scratch, Immediate(1 << Map::kHasNonInstancePrototype));
1089
- j(not_zero, &non_instance, not_taken);
1090
-
1091
- // Get the prototype or initial map from the function.
1092
- mov(result,
1093
- FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
1094
-
1095
- // If the prototype or initial map is the hole, don't return it and
1096
- // simply miss the cache instead. This will allow us to allocate a
1097
- // prototype object on-demand in the runtime system.
1098
- cmp(Operand(result), Immediate(isolate()->factory()->the_hole_value()));
1099
- j(equal, miss, not_taken);
1100
-
1101
- // If the function does not have an initial map, we're done.
1102
- Label done;
1103
- CmpObjectType(result, MAP_TYPE, scratch);
1104
- j(not_equal, &done);
1105
-
1106
- // Get the prototype from the initial map.
1107
- mov(result, FieldOperand(result, Map::kPrototypeOffset));
1108
- jmp(&done);
1109
-
1110
- // Non-instance prototype: Fetch prototype from constructor field
1111
- // in initial map.
1112
- bind(&non_instance);
1113
- mov(result, FieldOperand(result, Map::kConstructorOffset));
1114
-
1115
- // All done.
1116
- bind(&done);
1117
- }
1118
-
1119
-
1120
- void MacroAssembler::CallStub(CodeStub* stub) {
1121
- ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs.
1122
- call(stub->GetCode(), RelocInfo::CODE_TARGET);
1123
- }
1124
-
1125
-
1126
- MaybeObject* MacroAssembler::TryCallStub(CodeStub* stub) {
1127
- ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs.
1128
- Object* result;
1129
- { MaybeObject* maybe_result = stub->TryGetCode();
1130
- if (!maybe_result->ToObject(&result)) return maybe_result;
1131
- }
1132
- call(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET);
1133
- return result;
1134
- }
1135
-
1136
-
1137
- void MacroAssembler::TailCallStub(CodeStub* stub) {
1138
- ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs.
1139
- jmp(stub->GetCode(), RelocInfo::CODE_TARGET);
1140
- }
1141
-
1142
-
1143
- MaybeObject* MacroAssembler::TryTailCallStub(CodeStub* stub) {
1144
- ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs.
1145
- Object* result;
1146
- { MaybeObject* maybe_result = stub->TryGetCode();
1147
- if (!maybe_result->ToObject(&result)) return maybe_result;
1148
- }
1149
- jmp(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET);
1150
- return result;
1151
- }
1152
-
1153
-
1154
- void MacroAssembler::StubReturn(int argc) {
1155
- ASSERT(argc >= 1 && generating_stub());
1156
- ret((argc - 1) * kPointerSize);
1157
- }
1158
-
1159
-
1160
- void MacroAssembler::IllegalOperation(int num_arguments) {
1161
- if (num_arguments > 0) {
1162
- add(Operand(esp), Immediate(num_arguments * kPointerSize));
1163
- }
1164
- mov(eax, Immediate(isolate()->factory()->undefined_value()));
1165
- }
1166
-
1167
-
1168
- void MacroAssembler::IndexFromHash(Register hash, Register index) {
1169
- // The assert checks that the constants for the maximum number of digits
1170
- // for an array index cached in the hash field and the number of bits
1171
- // reserved for it does not conflict.
1172
- ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) <
1173
- (1 << String::kArrayIndexValueBits));
1174
- // We want the smi-tagged index in key. kArrayIndexValueMask has zeros in
1175
- // the low kHashShift bits.
1176
- and_(hash, String::kArrayIndexValueMask);
1177
- STATIC_ASSERT(String::kHashShift >= kSmiTagSize && kSmiTag == 0);
1178
- if (String::kHashShift > kSmiTagSize) {
1179
- shr(hash, String::kHashShift - kSmiTagSize);
1180
- }
1181
- if (!index.is(hash)) {
1182
- mov(index, hash);
1183
- }
1184
- }
1185
-
1186
-
1187
- void MacroAssembler::CallRuntime(Runtime::FunctionId id, int num_arguments) {
1188
- CallRuntime(Runtime::FunctionForId(id), num_arguments);
1189
- }
1190
-
1191
-
1192
- void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) {
1193
- const Runtime::Function* function = Runtime::FunctionForId(id);
1194
- Set(eax, Immediate(function->nargs));
1195
- mov(ebx, Immediate(ExternalReference(function, isolate())));
1196
- CEntryStub ces(1);
1197
- ces.SaveDoubles();
1198
- CallStub(&ces);
1199
- }
1200
-
1201
-
1202
- MaybeObject* MacroAssembler::TryCallRuntime(Runtime::FunctionId id,
1203
- int num_arguments) {
1204
- return TryCallRuntime(Runtime::FunctionForId(id), num_arguments);
1205
- }
1206
-
1207
-
1208
- void MacroAssembler::CallRuntime(const Runtime::Function* f,
1209
- int num_arguments) {
1210
- // If the expected number of arguments of the runtime function is
1211
- // constant, we check that the actual number of arguments match the
1212
- // expectation.
1213
- if (f->nargs >= 0 && f->nargs != num_arguments) {
1214
- IllegalOperation(num_arguments);
1215
- return;
1216
- }
1217
-
1218
- // TODO(1236192): Most runtime routines don't need the number of
1219
- // arguments passed in because it is constant. At some point we
1220
- // should remove this need and make the runtime routine entry code
1221
- // smarter.
1222
- Set(eax, Immediate(num_arguments));
1223
- mov(ebx, Immediate(ExternalReference(f, isolate())));
1224
- CEntryStub ces(1);
1225
- CallStub(&ces);
1226
- }
1227
-
1228
-
1229
- MaybeObject* MacroAssembler::TryCallRuntime(const Runtime::Function* f,
1230
- int num_arguments) {
1231
- if (f->nargs >= 0 && f->nargs != num_arguments) {
1232
- IllegalOperation(num_arguments);
1233
- // Since we did not call the stub, there was no allocation failure.
1234
- // Return some non-failure object.
1235
- return isolate()->heap()->undefined_value();
1236
- }
1237
-
1238
- // TODO(1236192): Most runtime routines don't need the number of
1239
- // arguments passed in because it is constant. At some point we
1240
- // should remove this need and make the runtime routine entry code
1241
- // smarter.
1242
- Set(eax, Immediate(num_arguments));
1243
- mov(ebx, Immediate(ExternalReference(f, isolate())));
1244
- CEntryStub ces(1);
1245
- return TryCallStub(&ces);
1246
- }
1247
-
1248
-
1249
- void MacroAssembler::CallExternalReference(ExternalReference ref,
1250
- int num_arguments) {
1251
- mov(eax, Immediate(num_arguments));
1252
- mov(ebx, Immediate(ref));
1253
-
1254
- CEntryStub stub(1);
1255
- CallStub(&stub);
1256
- }
1257
-
1258
-
1259
- void MacroAssembler::TailCallExternalReference(const ExternalReference& ext,
1260
- int num_arguments,
1261
- int result_size) {
1262
- // TODO(1236192): Most runtime routines don't need the number of
1263
- // arguments passed in because it is constant. At some point we
1264
- // should remove this need and make the runtime routine entry code
1265
- // smarter.
1266
- Set(eax, Immediate(num_arguments));
1267
- JumpToExternalReference(ext);
1268
- }
1269
-
1270
-
1271
- MaybeObject* MacroAssembler::TryTailCallExternalReference(
1272
- const ExternalReference& ext, int num_arguments, int result_size) {
1273
- // TODO(1236192): Most runtime routines don't need the number of
1274
- // arguments passed in because it is constant. At some point we
1275
- // should remove this need and make the runtime routine entry code
1276
- // smarter.
1277
- Set(eax, Immediate(num_arguments));
1278
- return TryJumpToExternalReference(ext);
1279
- }
1280
-
1281
-
1282
- void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
1283
- int num_arguments,
1284
- int result_size) {
1285
- TailCallExternalReference(ExternalReference(fid, isolate()),
1286
- num_arguments,
1287
- result_size);
1288
- }
1289
-
1290
-
1291
- MaybeObject* MacroAssembler::TryTailCallRuntime(Runtime::FunctionId fid,
1292
- int num_arguments,
1293
- int result_size) {
1294
- return TryTailCallExternalReference(
1295
- ExternalReference(fid, isolate()), num_arguments, result_size);
1296
- }
1297
-
1298
-
1299
- // If true, a Handle<T> returned by value from a function with cdecl calling
1300
- // convention will be returned directly as a value of location_ field in a
1301
- // register eax.
1302
- // If false, it is returned as a pointer to a preallocated by caller memory
1303
- // region. Pointer to this region should be passed to a function as an
1304
- // implicit first argument.
1305
- #if defined(USING_BSD_ABI) || defined(__MINGW32__) || defined(__CYGWIN__)
1306
- static const bool kReturnHandlesDirectly = true;
1307
- #else
1308
- static const bool kReturnHandlesDirectly = false;
1309
- #endif
1310
-
1311
-
1312
- Operand ApiParameterOperand(int index) {
1313
- return Operand(
1314
- esp, (index + (kReturnHandlesDirectly ? 0 : 1)) * kPointerSize);
1315
- }
1316
-
1317
-
1318
- void MacroAssembler::PrepareCallApiFunction(int argc, Register scratch) {
1319
- if (kReturnHandlesDirectly) {
1320
- EnterApiExitFrame(argc);
1321
- // When handles are returned directly we don't have to allocate extra
1322
- // space for and pass an out parameter.
1323
- } else {
1324
- // We allocate two additional slots: return value and pointer to it.
1325
- EnterApiExitFrame(argc + 2);
1326
-
1327
- // The argument slots are filled as follows:
1328
- //
1329
- // n + 1: output cell
1330
- // n: arg n
1331
- // ...
1332
- // 1: arg1
1333
- // 0: pointer to the output cell
1334
- //
1335
- // Note that this is one more "argument" than the function expects
1336
- // so the out cell will have to be popped explicitly after returning
1337
- // from the function. The out cell contains Handle.
1338
-
1339
- // pointer to out cell.
1340
- lea(scratch, Operand(esp, (argc + 1) * kPointerSize));
1341
- mov(Operand(esp, 0 * kPointerSize), scratch); // output.
1342
- if (emit_debug_code()) {
1343
- mov(Operand(esp, (argc + 1) * kPointerSize), Immediate(0)); // out cell.
1344
- }
1345
- }
1346
- }
1347
-
1348
-
1349
- MaybeObject* MacroAssembler::TryCallApiFunctionAndReturn(ApiFunction* function,
1350
- int stack_space) {
1351
- ExternalReference next_address =
1352
- ExternalReference::handle_scope_next_address();
1353
- ExternalReference limit_address =
1354
- ExternalReference::handle_scope_limit_address();
1355
- ExternalReference level_address =
1356
- ExternalReference::handle_scope_level_address();
1357
-
1358
- // Allocate HandleScope in callee-save registers.
1359
- mov(ebx, Operand::StaticVariable(next_address));
1360
- mov(edi, Operand::StaticVariable(limit_address));
1361
- add(Operand::StaticVariable(level_address), Immediate(1));
1362
-
1363
- // Call the api function!
1364
- call(function->address(), RelocInfo::RUNTIME_ENTRY);
1365
-
1366
- if (!kReturnHandlesDirectly) {
1367
- // The returned value is a pointer to the handle holding the result.
1368
- // Dereference this to get to the location.
1369
- mov(eax, Operand(eax, 0));
1370
- }
1371
-
1372
- Label empty_handle;
1373
- Label prologue;
1374
- Label promote_scheduled_exception;
1375
- Label delete_allocated_handles;
1376
- Label leave_exit_frame;
1377
-
1378
- // Check if the result handle holds 0.
1379
- test(eax, Operand(eax));
1380
- j(zero, &empty_handle, not_taken);
1381
- // It was non-zero. Dereference to get the result value.
1382
- mov(eax, Operand(eax, 0));
1383
- bind(&prologue);
1384
- // No more valid handles (the result handle was the last one). Restore
1385
- // previous handle scope.
1386
- mov(Operand::StaticVariable(next_address), ebx);
1387
- sub(Operand::StaticVariable(level_address), Immediate(1));
1388
- Assert(above_equal, "Invalid HandleScope level");
1389
- cmp(edi, Operand::StaticVariable(limit_address));
1390
- j(not_equal, &delete_allocated_handles, not_taken);
1391
- bind(&leave_exit_frame);
1392
-
1393
- // Check if the function scheduled an exception.
1394
- ExternalReference scheduled_exception_address =
1395
- ExternalReference::scheduled_exception_address(isolate());
1396
- cmp(Operand::StaticVariable(scheduled_exception_address),
1397
- Immediate(isolate()->factory()->the_hole_value()));
1398
- j(not_equal, &promote_scheduled_exception, not_taken);
1399
- LeaveApiExitFrame();
1400
- ret(stack_space * kPointerSize);
1401
- bind(&promote_scheduled_exception);
1402
- MaybeObject* result =
1403
- TryTailCallRuntime(Runtime::kPromoteScheduledException, 0, 1);
1404
- if (result->IsFailure()) {
1405
- return result;
1406
- }
1407
- bind(&empty_handle);
1408
- // It was zero; the result is undefined.
1409
- mov(eax, isolate()->factory()->undefined_value());
1410
- jmp(&prologue);
1411
-
1412
- // HandleScope limit has changed. Delete allocated extensions.
1413
- ExternalReference delete_extensions =
1414
- ExternalReference::delete_handle_scope_extensions(isolate());
1415
- bind(&delete_allocated_handles);
1416
- mov(Operand::StaticVariable(limit_address), edi);
1417
- mov(edi, eax);
1418
- mov(Operand(esp, 0), Immediate(ExternalReference::isolate_address()));
1419
- mov(eax, Immediate(delete_extensions));
1420
- call(Operand(eax));
1421
- mov(eax, edi);
1422
- jmp(&leave_exit_frame);
1423
-
1424
- return result;
1425
- }
1426
-
1427
-
1428
- void MacroAssembler::JumpToExternalReference(const ExternalReference& ext) {
1429
- // Set the entry point and jump to the C entry runtime stub.
1430
- mov(ebx, Immediate(ext));
1431
- CEntryStub ces(1);
1432
- jmp(ces.GetCode(), RelocInfo::CODE_TARGET);
1433
- }
1434
-
1435
-
1436
- MaybeObject* MacroAssembler::TryJumpToExternalReference(
1437
- const ExternalReference& ext) {
1438
- // Set the entry point and jump to the C entry runtime stub.
1439
- mov(ebx, Immediate(ext));
1440
- CEntryStub ces(1);
1441
- return TryTailCallStub(&ces);
1442
- }
1443
-
1444
-
1445
- void MacroAssembler::InvokePrologue(const ParameterCount& expected,
1446
- const ParameterCount& actual,
1447
- Handle<Code> code_constant,
1448
- const Operand& code_operand,
1449
- NearLabel* done,
1450
- InvokeFlag flag,
1451
- PostCallGenerator* post_call_generator) {
1452
- bool definitely_matches = false;
1453
- Label invoke;
1454
- if (expected.is_immediate()) {
1455
- ASSERT(actual.is_immediate());
1456
- if (expected.immediate() == actual.immediate()) {
1457
- definitely_matches = true;
1458
- } else {
1459
- mov(eax, actual.immediate());
1460
- const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel;
1461
- if (expected.immediate() == sentinel) {
1462
- // Don't worry about adapting arguments for builtins that
1463
- // don't want that done. Skip adaption code by making it look
1464
- // like we have a match between expected and actual number of
1465
- // arguments.
1466
- definitely_matches = true;
1467
- } else {
1468
- mov(ebx, expected.immediate());
1469
- }
1470
- }
1471
- } else {
1472
- if (actual.is_immediate()) {
1473
- // Expected is in register, actual is immediate. This is the
1474
- // case when we invoke function values without going through the
1475
- // IC mechanism.
1476
- cmp(expected.reg(), actual.immediate());
1477
- j(equal, &invoke);
1478
- ASSERT(expected.reg().is(ebx));
1479
- mov(eax, actual.immediate());
1480
- } else if (!expected.reg().is(actual.reg())) {
1481
- // Both expected and actual are in (different) registers. This
1482
- // is the case when we invoke functions using call and apply.
1483
- cmp(expected.reg(), Operand(actual.reg()));
1484
- j(equal, &invoke);
1485
- ASSERT(actual.reg().is(eax));
1486
- ASSERT(expected.reg().is(ebx));
1487
- }
1488
- }
1489
-
1490
- if (!definitely_matches) {
1491
- Handle<Code> adaptor =
1492
- isolate()->builtins()->ArgumentsAdaptorTrampoline();
1493
- if (!code_constant.is_null()) {
1494
- mov(edx, Immediate(code_constant));
1495
- add(Operand(edx), Immediate(Code::kHeaderSize - kHeapObjectTag));
1496
- } else if (!code_operand.is_reg(edx)) {
1497
- mov(edx, code_operand);
1498
- }
1499
-
1500
- if (flag == CALL_FUNCTION) {
1501
- call(adaptor, RelocInfo::CODE_TARGET);
1502
- if (post_call_generator != NULL) post_call_generator->Generate();
1503
- jmp(done);
1504
- } else {
1505
- jmp(adaptor, RelocInfo::CODE_TARGET);
1506
- }
1507
- bind(&invoke);
1508
- }
1509
- }
1510
-
1511
-
1512
- void MacroAssembler::InvokeCode(const Operand& code,
1513
- const ParameterCount& expected,
1514
- const ParameterCount& actual,
1515
- InvokeFlag flag,
1516
- PostCallGenerator* post_call_generator) {
1517
- NearLabel done;
1518
- InvokePrologue(expected, actual, Handle<Code>::null(), code,
1519
- &done, flag, post_call_generator);
1520
- if (flag == CALL_FUNCTION) {
1521
- call(code);
1522
- if (post_call_generator != NULL) post_call_generator->Generate();
1523
- } else {
1524
- ASSERT(flag == JUMP_FUNCTION);
1525
- jmp(code);
1526
- }
1527
- bind(&done);
1528
- }
1529
-
1530
-
1531
- void MacroAssembler::InvokeCode(Handle<Code> code,
1532
- const ParameterCount& expected,
1533
- const ParameterCount& actual,
1534
- RelocInfo::Mode rmode,
1535
- InvokeFlag flag,
1536
- PostCallGenerator* post_call_generator) {
1537
- NearLabel done;
1538
- Operand dummy(eax);
1539
- InvokePrologue(expected, actual, code, dummy, &done,
1540
- flag, post_call_generator);
1541
- if (flag == CALL_FUNCTION) {
1542
- call(code, rmode);
1543
- if (post_call_generator != NULL) post_call_generator->Generate();
1544
- } else {
1545
- ASSERT(flag == JUMP_FUNCTION);
1546
- jmp(code, rmode);
1547
- }
1548
- bind(&done);
1549
- }
1550
-
1551
-
1552
- void MacroAssembler::InvokeFunction(Register fun,
1553
- const ParameterCount& actual,
1554
- InvokeFlag flag,
1555
- PostCallGenerator* post_call_generator) {
1556
- ASSERT(fun.is(edi));
1557
- mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
1558
- mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
1559
- mov(ebx, FieldOperand(edx, SharedFunctionInfo::kFormalParameterCountOffset));
1560
- SmiUntag(ebx);
1561
-
1562
- ParameterCount expected(ebx);
1563
- InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
1564
- expected, actual, flag, post_call_generator);
1565
- }
1566
-
1567
-
1568
- void MacroAssembler::InvokeFunction(JSFunction* function,
1569
- const ParameterCount& actual,
1570
- InvokeFlag flag,
1571
- PostCallGenerator* post_call_generator) {
1572
- ASSERT(function->is_compiled());
1573
- // Get the function and setup the context.
1574
- mov(edi, Immediate(Handle<JSFunction>(function)));
1575
- mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
1576
-
1577
- ParameterCount expected(function->shared()->formal_parameter_count());
1578
- if (V8::UseCrankshaft()) {
1579
- // TODO(kasperl): For now, we always call indirectly through the
1580
- // code field in the function to allow recompilation to take effect
1581
- // without changing any of the call sites.
1582
- InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
1583
- expected, actual, flag, post_call_generator);
1584
- } else {
1585
- Handle<Code> code(function->code());
1586
- InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET,
1587
- flag, post_call_generator);
1588
- }
1589
- }
1590
-
1591
-
1592
- void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
1593
- InvokeFlag flag,
1594
- PostCallGenerator* post_call_generator) {
1595
- // Calls are not allowed in some stubs.
1596
- ASSERT(flag == JUMP_FUNCTION || allow_stub_calls());
1597
-
1598
- // Rely on the assertion to check that the number of provided
1599
- // arguments match the expected number of arguments. Fake a
1600
- // parameter count to avoid emitting code to do the check.
1601
- ParameterCount expected(0);
1602
- GetBuiltinFunction(edi, id);
1603
- InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
1604
- expected, expected, flag, post_call_generator);
1605
- }
1606
-
1607
- void MacroAssembler::GetBuiltinFunction(Register target,
1608
- Builtins::JavaScript id) {
1609
- // Load the JavaScript builtin function from the builtins object.
1610
- mov(target, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)));
1611
- mov(target, FieldOperand(target, GlobalObject::kBuiltinsOffset));
1612
- mov(target, FieldOperand(target,
1613
- JSBuiltinsObject::OffsetOfFunctionWithId(id)));
1614
- }
1615
-
1616
- void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) {
1617
- ASSERT(!target.is(edi));
1618
- // Load the JavaScript builtin function from the builtins object.
1619
- GetBuiltinFunction(edi, id);
1620
- // Load the code entry point from the function into the target register.
1621
- mov(target, FieldOperand(edi, JSFunction::kCodeEntryOffset));
1622
- }
1623
-
1624
-
1625
- void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
1626
- if (context_chain_length > 0) {
1627
- // Move up the chain of contexts to the context containing the slot.
1628
- mov(dst, Operand(esi, Context::SlotOffset(Context::CLOSURE_INDEX)));
1629
- // Load the function context (which is the incoming, outer context).
1630
- mov(dst, FieldOperand(dst, JSFunction::kContextOffset));
1631
- for (int i = 1; i < context_chain_length; i++) {
1632
- mov(dst, Operand(dst, Context::SlotOffset(Context::CLOSURE_INDEX)));
1633
- mov(dst, FieldOperand(dst, JSFunction::kContextOffset));
1634
- }
1635
- } else {
1636
- // Slot is in the current function context. Move it into the
1637
- // destination register in case we store into it (the write barrier
1638
- // cannot be allowed to destroy the context in esi).
1639
- mov(dst, esi);
1640
- }
1641
-
1642
- // We should not have found a 'with' context by walking the context chain
1643
- // (i.e., the static scope chain and runtime context chain do not agree).
1644
- // A variable occurring in such a scope should have slot type LOOKUP and
1645
- // not CONTEXT.
1646
- if (emit_debug_code()) {
1647
- cmp(dst, Operand(dst, Context::SlotOffset(Context::FCONTEXT_INDEX)));
1648
- Check(equal, "Yo dawg, I heard you liked function contexts "
1649
- "so I put function contexts in all your contexts");
1650
- }
1651
- }
1652
-
1653
-
1654
- void MacroAssembler::LoadGlobalFunction(int index, Register function) {
1655
- // Load the global or builtins object from the current context.
1656
- mov(function, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)));
1657
- // Load the global context from the global or builtins object.
1658
- mov(function, FieldOperand(function, GlobalObject::kGlobalContextOffset));
1659
- // Load the function from the global context.
1660
- mov(function, Operand(function, Context::SlotOffset(index)));
1661
- }
1662
-
1663
-
1664
- void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
1665
- Register map) {
1666
- // Load the initial map. The global functions all have initial maps.
1667
- mov(map, FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
1668
- if (emit_debug_code()) {
1669
- Label ok, fail;
1670
- CheckMap(map, isolate()->factory()->meta_map(), &fail, false);
1671
- jmp(&ok);
1672
- bind(&fail);
1673
- Abort("Global functions must have initial map");
1674
- bind(&ok);
1675
- }
1676
- }
1677
-
1678
-
1679
- // Store the value in register src in the safepoint register stack
1680
- // slot for register dst.
1681
- void MacroAssembler::StoreToSafepointRegisterSlot(Register dst, Register src) {
1682
- mov(SafepointRegisterSlot(dst), src);
1683
- }
1684
-
1685
-
1686
- void MacroAssembler::StoreToSafepointRegisterSlot(Register dst, Immediate src) {
1687
- mov(SafepointRegisterSlot(dst), src);
1688
- }
1689
-
1690
-
1691
- void MacroAssembler::LoadFromSafepointRegisterSlot(Register dst, Register src) {
1692
- mov(dst, SafepointRegisterSlot(src));
1693
- }
1694
-
1695
-
1696
- Operand MacroAssembler::SafepointRegisterSlot(Register reg) {
1697
- return Operand(esp, SafepointRegisterStackIndex(reg.code()) * kPointerSize);
1698
- }
1699
-
1700
-
1701
- int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
1702
- // The registers are pushed starting with the lowest encoding,
1703
- // which means that lowest encodings are furthest away from
1704
- // the stack pointer.
1705
- ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters);
1706
- return kNumSafepointRegisters - reg_code - 1;
1707
- }
1708
-
1709
-
1710
- void MacroAssembler::Ret() {
1711
- ret(0);
1712
- }
1713
-
1714
-
1715
- void MacroAssembler::Ret(int bytes_dropped, Register scratch) {
1716
- if (is_uint16(bytes_dropped)) {
1717
- ret(bytes_dropped);
1718
- } else {
1719
- pop(scratch);
1720
- add(Operand(esp), Immediate(bytes_dropped));
1721
- push(scratch);
1722
- ret(0);
1723
- }
1724
- }
1725
-
1726
-
1727
-
1728
-
1729
- void MacroAssembler::Drop(int stack_elements) {
1730
- if (stack_elements > 0) {
1731
- add(Operand(esp), Immediate(stack_elements * kPointerSize));
1732
- }
1733
- }
1734
-
1735
-
1736
- void MacroAssembler::Move(Register dst, Register src) {
1737
- if (!dst.is(src)) {
1738
- mov(dst, src);
1739
- }
1740
- }
1741
-
1742
-
1743
- void MacroAssembler::Move(Register dst, Handle<Object> value) {
1744
- mov(dst, value);
1745
- }
1746
-
1747
-
1748
- void MacroAssembler::SetCounter(StatsCounter* counter, int value) {
1749
- if (FLAG_native_code_counters && counter->Enabled()) {
1750
- mov(Operand::StaticVariable(ExternalReference(counter)), Immediate(value));
1751
- }
1752
- }
1753
-
1754
-
1755
- void MacroAssembler::IncrementCounter(StatsCounter* counter, int value) {
1756
- ASSERT(value > 0);
1757
- if (FLAG_native_code_counters && counter->Enabled()) {
1758
- Operand operand = Operand::StaticVariable(ExternalReference(counter));
1759
- if (value == 1) {
1760
- inc(operand);
1761
- } else {
1762
- add(operand, Immediate(value));
1763
- }
1764
- }
1765
- }
1766
-
1767
-
1768
- void MacroAssembler::DecrementCounter(StatsCounter* counter, int value) {
1769
- ASSERT(value > 0);
1770
- if (FLAG_native_code_counters && counter->Enabled()) {
1771
- Operand operand = Operand::StaticVariable(ExternalReference(counter));
1772
- if (value == 1) {
1773
- dec(operand);
1774
- } else {
1775
- sub(operand, Immediate(value));
1776
- }
1777
- }
1778
- }
1779
-
1780
-
1781
- void MacroAssembler::IncrementCounter(Condition cc,
1782
- StatsCounter* counter,
1783
- int value) {
1784
- ASSERT(value > 0);
1785
- if (FLAG_native_code_counters && counter->Enabled()) {
1786
- Label skip;
1787
- j(NegateCondition(cc), &skip);
1788
- pushfd();
1789
- IncrementCounter(counter, value);
1790
- popfd();
1791
- bind(&skip);
1792
- }
1793
- }
1794
-
1795
-
1796
- void MacroAssembler::DecrementCounter(Condition cc,
1797
- StatsCounter* counter,
1798
- int value) {
1799
- ASSERT(value > 0);
1800
- if (FLAG_native_code_counters && counter->Enabled()) {
1801
- Label skip;
1802
- j(NegateCondition(cc), &skip);
1803
- pushfd();
1804
- DecrementCounter(counter, value);
1805
- popfd();
1806
- bind(&skip);
1807
- }
1808
- }
1809
-
1810
-
1811
- void MacroAssembler::Assert(Condition cc, const char* msg) {
1812
- if (emit_debug_code()) Check(cc, msg);
1813
- }
1814
-
1815
-
1816
- void MacroAssembler::AssertFastElements(Register elements) {
1817
- if (emit_debug_code()) {
1818
- Factory* factory = isolate()->factory();
1819
- Label ok;
1820
- cmp(FieldOperand(elements, HeapObject::kMapOffset),
1821
- Immediate(factory->fixed_array_map()));
1822
- j(equal, &ok);
1823
- cmp(FieldOperand(elements, HeapObject::kMapOffset),
1824
- Immediate(factory->fixed_cow_array_map()));
1825
- j(equal, &ok);
1826
- Abort("JSObject with fast elements map has slow elements");
1827
- bind(&ok);
1828
- }
1829
- }
1830
-
1831
-
1832
- void MacroAssembler::Check(Condition cc, const char* msg) {
1833
- Label L;
1834
- j(cc, &L, taken);
1835
- Abort(msg);
1836
- // will not return here
1837
- bind(&L);
1838
- }
1839
-
1840
-
1841
- void MacroAssembler::CheckStackAlignment() {
1842
- int frame_alignment = OS::ActivationFrameAlignment();
1843
- int frame_alignment_mask = frame_alignment - 1;
1844
- if (frame_alignment > kPointerSize) {
1845
- ASSERT(IsPowerOf2(frame_alignment));
1846
- Label alignment_as_expected;
1847
- test(esp, Immediate(frame_alignment_mask));
1848
- j(zero, &alignment_as_expected);
1849
- // Abort if stack is not aligned.
1850
- int3();
1851
- bind(&alignment_as_expected);
1852
- }
1853
- }
1854
-
1855
-
1856
- void MacroAssembler::Abort(const char* msg) {
1857
- // We want to pass the msg string like a smi to avoid GC
1858
- // problems, however msg is not guaranteed to be aligned
1859
- // properly. Instead, we pass an aligned pointer that is
1860
- // a proper v8 smi, but also pass the alignment difference
1861
- // from the real pointer as a smi.
1862
- intptr_t p1 = reinterpret_cast<intptr_t>(msg);
1863
- intptr_t p0 = (p1 & ~kSmiTagMask) + kSmiTag;
1864
- ASSERT(reinterpret_cast<Object*>(p0)->IsSmi());
1865
- #ifdef DEBUG
1866
- if (msg != NULL) {
1867
- RecordComment("Abort message: ");
1868
- RecordComment(msg);
1869
- }
1870
- #endif
1871
- // Disable stub call restrictions to always allow calls to abort.
1872
- AllowStubCallsScope allow_scope(this, true);
1873
-
1874
- push(eax);
1875
- push(Immediate(p0));
1876
- push(Immediate(reinterpret_cast<intptr_t>(Smi::FromInt(p1 - p0))));
1877
- CallRuntime(Runtime::kAbort, 2);
1878
- // will not return here
1879
- int3();
1880
- }
1881
-
1882
-
1883
- void MacroAssembler::JumpIfNotNumber(Register reg,
1884
- TypeInfo info,
1885
- Label* on_not_number) {
1886
- if (emit_debug_code()) AbortIfSmi(reg);
1887
- if (!info.IsNumber()) {
1888
- cmp(FieldOperand(reg, HeapObject::kMapOffset),
1889
- isolate()->factory()->heap_number_map());
1890
- j(not_equal, on_not_number);
1891
- }
1892
- }
1893
-
1894
-
1895
- void MacroAssembler::ConvertToInt32(Register dst,
1896
- Register source,
1897
- Register scratch,
1898
- TypeInfo info,
1899
- Label* on_not_int32) {
1900
- if (emit_debug_code()) {
1901
- AbortIfSmi(source);
1902
- AbortIfNotNumber(source);
1903
- }
1904
- if (info.IsInteger32()) {
1905
- cvttsd2si(dst, FieldOperand(source, HeapNumber::kValueOffset));
1906
- } else {
1907
- Label done;
1908
- bool push_pop = (scratch.is(no_reg) && dst.is(source));
1909
- ASSERT(!scratch.is(source));
1910
- if (push_pop) {
1911
- push(dst);
1912
- scratch = dst;
1913
- }
1914
- if (scratch.is(no_reg)) scratch = dst;
1915
- cvttsd2si(scratch, FieldOperand(source, HeapNumber::kValueOffset));
1916
- cmp(scratch, 0x80000000u);
1917
- if (push_pop) {
1918
- j(not_equal, &done);
1919
- pop(dst);
1920
- jmp(on_not_int32);
1921
- } else {
1922
- j(equal, on_not_int32);
1923
- }
1924
-
1925
- bind(&done);
1926
- if (push_pop) {
1927
- add(Operand(esp), Immediate(kPointerSize)); // Pop.
1928
- }
1929
- if (!scratch.is(dst)) {
1930
- mov(dst, scratch);
1931
- }
1932
- }
1933
- }
1934
-
1935
-
1936
- void MacroAssembler::LoadPowerOf2(XMMRegister dst,
1937
- Register scratch,
1938
- int power) {
1939
- ASSERT(is_uintn(power + HeapNumber::kExponentBias,
1940
- HeapNumber::kExponentBits));
1941
- mov(scratch, Immediate(power + HeapNumber::kExponentBias));
1942
- movd(dst, Operand(scratch));
1943
- psllq(dst, HeapNumber::kMantissaBits);
1944
- }
1945
-
1946
-
1947
- void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(
1948
- Register instance_type,
1949
- Register scratch,
1950
- Label* failure) {
1951
- if (!scratch.is(instance_type)) {
1952
- mov(scratch, instance_type);
1953
- }
1954
- and_(scratch,
1955
- kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask);
1956
- cmp(scratch, kStringTag | kSeqStringTag | kAsciiStringTag);
1957
- j(not_equal, failure);
1958
- }
1959
-
1960
-
1961
- void MacroAssembler::JumpIfNotBothSequentialAsciiStrings(Register object1,
1962
- Register object2,
1963
- Register scratch1,
1964
- Register scratch2,
1965
- Label* failure) {
1966
- // Check that both objects are not smis.
1967
- ASSERT_EQ(0, kSmiTag);
1968
- mov(scratch1, Operand(object1));
1969
- and_(scratch1, Operand(object2));
1970
- test(scratch1, Immediate(kSmiTagMask));
1971
- j(zero, failure);
1972
-
1973
- // Load instance type for both strings.
1974
- mov(scratch1, FieldOperand(object1, HeapObject::kMapOffset));
1975
- mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset));
1976
- movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset));
1977
- movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset));
1978
-
1979
- // Check that both are flat ascii strings.
1980
- const int kFlatAsciiStringMask =
1981
- kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
1982
- const int kFlatAsciiStringTag = ASCII_STRING_TYPE;
1983
- // Interleave bits from both instance types and compare them in one check.
1984
- ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3));
1985
- and_(scratch1, kFlatAsciiStringMask);
1986
- and_(scratch2, kFlatAsciiStringMask);
1987
- lea(scratch1, Operand(scratch1, scratch2, times_8, 0));
1988
- cmp(scratch1, kFlatAsciiStringTag | (kFlatAsciiStringTag << 3));
1989
- j(not_equal, failure);
1990
- }
1991
-
1992
-
1993
- void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) {
1994
- int frame_alignment = OS::ActivationFrameAlignment();
1995
- if (frame_alignment != 0) {
1996
- // Make stack end at alignment and make room for num_arguments words
1997
- // and the original value of esp.
1998
- mov(scratch, esp);
1999
- sub(Operand(esp), Immediate((num_arguments + 1) * kPointerSize));
2000
- ASSERT(IsPowerOf2(frame_alignment));
2001
- and_(esp, -frame_alignment);
2002
- mov(Operand(esp, num_arguments * kPointerSize), scratch);
2003
- } else {
2004
- sub(Operand(esp), Immediate(num_arguments * kPointerSize));
2005
- }
2006
- }
2007
-
2008
-
2009
- void MacroAssembler::CallCFunction(ExternalReference function,
2010
- int num_arguments) {
2011
- // Trashing eax is ok as it will be the return value.
2012
- mov(Operand(eax), Immediate(function));
2013
- CallCFunction(eax, num_arguments);
2014
- }
2015
-
2016
-
2017
- void MacroAssembler::CallCFunction(Register function,
2018
- int num_arguments) {
2019
- // Check stack alignment.
2020
- if (emit_debug_code()) {
2021
- CheckStackAlignment();
2022
- }
2023
-
2024
- call(Operand(function));
2025
- if (OS::ActivationFrameAlignment() != 0) {
2026
- mov(esp, Operand(esp, num_arguments * kPointerSize));
2027
- } else {
2028
- add(Operand(esp), Immediate(num_arguments * kPointerSize));
2029
- }
2030
- }
2031
-
2032
-
2033
- CodePatcher::CodePatcher(byte* address, int size)
2034
- : address_(address),
2035
- size_(size),
2036
- masm_(Isolate::Current(), address, size + Assembler::kGap) {
2037
- // Create a new macro assembler pointing to the address of the code to patch.
2038
- // The size is adjusted with kGap on order for the assembler to generate size
2039
- // bytes of instructions without failing with buffer size constraints.
2040
- ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2041
- }
2042
-
2043
-
2044
- CodePatcher::~CodePatcher() {
2045
- // Indicate that code has changed.
2046
- CPU::FlushICache(address_, size_);
2047
-
2048
- // Check that the code was patched as expected.
2049
- ASSERT(masm_.pc_ == address_ + size_);
2050
- ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2051
- }
2052
-
2053
-
2054
- } } // namespace v8::internal
2055
-
2056
- #endif // V8_TARGET_ARCH_IA32