libv8 3.3.10.4 → 3.5.10.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (538) hide show
  1. data/lib/libv8/scons/CHANGES.txt +24 -231
  2. data/lib/libv8/scons/LICENSE.txt +1 -1
  3. data/lib/libv8/scons/MANIFEST +0 -1
  4. data/lib/libv8/scons/PKG-INFO +1 -1
  5. data/lib/libv8/scons/README.txt +9 -9
  6. data/lib/libv8/scons/RELEASE.txt +75 -77
  7. data/lib/libv8/scons/engine/SCons/Action.py +6 -22
  8. data/lib/libv8/scons/engine/SCons/Builder.py +2 -2
  9. data/lib/libv8/scons/engine/SCons/CacheDir.py +2 -2
  10. data/lib/libv8/scons/engine/SCons/Debug.py +2 -2
  11. data/lib/libv8/scons/engine/SCons/Defaults.py +10 -24
  12. data/lib/libv8/scons/engine/SCons/Environment.py +19 -118
  13. data/lib/libv8/scons/engine/SCons/Errors.py +2 -2
  14. data/lib/libv8/scons/engine/SCons/Executor.py +2 -2
  15. data/lib/libv8/scons/engine/SCons/Job.py +2 -2
  16. data/lib/libv8/scons/engine/SCons/Memoize.py +2 -2
  17. data/lib/libv8/scons/engine/SCons/Node/Alias.py +2 -2
  18. data/lib/libv8/scons/engine/SCons/Node/FS.py +121 -281
  19. data/lib/libv8/scons/engine/SCons/Node/Python.py +2 -2
  20. data/lib/libv8/scons/engine/SCons/Node/__init__.py +5 -6
  21. data/lib/libv8/scons/engine/SCons/Options/BoolOption.py +2 -2
  22. data/lib/libv8/scons/engine/SCons/Options/EnumOption.py +2 -2
  23. data/lib/libv8/scons/engine/SCons/Options/ListOption.py +2 -2
  24. data/lib/libv8/scons/engine/SCons/Options/PackageOption.py +2 -2
  25. data/lib/libv8/scons/engine/SCons/Options/PathOption.py +2 -2
  26. data/lib/libv8/scons/engine/SCons/Options/__init__.py +2 -2
  27. data/lib/libv8/scons/engine/SCons/PathList.py +2 -2
  28. data/lib/libv8/scons/engine/SCons/Platform/__init__.py +2 -2
  29. data/lib/libv8/scons/engine/SCons/Platform/aix.py +2 -2
  30. data/lib/libv8/scons/engine/SCons/Platform/cygwin.py +2 -2
  31. data/lib/libv8/scons/engine/SCons/Platform/darwin.py +3 -27
  32. data/lib/libv8/scons/engine/SCons/Platform/hpux.py +2 -2
  33. data/lib/libv8/scons/engine/SCons/Platform/irix.py +2 -2
  34. data/lib/libv8/scons/engine/SCons/Platform/os2.py +2 -2
  35. data/lib/libv8/scons/engine/SCons/Platform/posix.py +2 -2
  36. data/lib/libv8/scons/engine/SCons/Platform/sunos.py +2 -2
  37. data/lib/libv8/scons/engine/SCons/Platform/win32.py +2 -2
  38. data/lib/libv8/scons/engine/SCons/SConf.py +2 -2
  39. data/lib/libv8/scons/engine/SCons/SConsign.py +3 -9
  40. data/lib/libv8/scons/engine/SCons/Scanner/C.py +2 -2
  41. data/lib/libv8/scons/engine/SCons/Scanner/D.py +2 -2
  42. data/lib/libv8/scons/engine/SCons/Scanner/Dir.py +2 -2
  43. data/lib/libv8/scons/engine/SCons/Scanner/Fortran.py +2 -2
  44. data/lib/libv8/scons/engine/SCons/Scanner/IDL.py +2 -2
  45. data/lib/libv8/scons/engine/SCons/Scanner/LaTeX.py +2 -5
  46. data/lib/libv8/scons/engine/SCons/Scanner/Prog.py +2 -2
  47. data/lib/libv8/scons/engine/SCons/Scanner/RC.py +3 -3
  48. data/lib/libv8/scons/engine/SCons/Scanner/__init__.py +2 -2
  49. data/lib/libv8/scons/engine/SCons/Script/Interactive.py +2 -2
  50. data/lib/libv8/scons/engine/SCons/Script/Main.py +11 -82
  51. data/lib/libv8/scons/engine/SCons/Script/SConsOptions.py +5 -5
  52. data/lib/libv8/scons/engine/SCons/Script/SConscript.py +2 -2
  53. data/lib/libv8/scons/engine/SCons/Script/__init__.py +2 -2
  54. data/lib/libv8/scons/engine/SCons/Sig.py +2 -2
  55. data/lib/libv8/scons/engine/SCons/Subst.py +2 -2
  56. data/lib/libv8/scons/engine/SCons/Taskmaster.py +2 -10
  57. data/lib/libv8/scons/engine/SCons/Tool/386asm.py +2 -2
  58. data/lib/libv8/scons/engine/SCons/Tool/BitKeeper.py +2 -2
  59. data/lib/libv8/scons/engine/SCons/Tool/CVS.py +2 -2
  60. data/lib/libv8/scons/engine/SCons/Tool/FortranCommon.py +2 -19
  61. data/lib/libv8/scons/engine/SCons/Tool/JavaCommon.py +2 -2
  62. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/__init__.py +2 -2
  63. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/arch.py +2 -2
  64. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/common.py +2 -2
  65. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/netframework.py +2 -2
  66. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/sdk.py +2 -2
  67. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vc.py +6 -9
  68. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vs.py +2 -29
  69. data/lib/libv8/scons/engine/SCons/Tool/Perforce.py +2 -2
  70. data/lib/libv8/scons/engine/SCons/Tool/PharLapCommon.py +2 -2
  71. data/lib/libv8/scons/engine/SCons/Tool/RCS.py +2 -2
  72. data/lib/libv8/scons/engine/SCons/Tool/SCCS.py +2 -2
  73. data/lib/libv8/scons/engine/SCons/Tool/Subversion.py +2 -2
  74. data/lib/libv8/scons/engine/SCons/Tool/__init__.py +3 -3
  75. data/lib/libv8/scons/engine/SCons/Tool/aixc++.py +2 -2
  76. data/lib/libv8/scons/engine/SCons/Tool/aixcc.py +2 -2
  77. data/lib/libv8/scons/engine/SCons/Tool/aixf77.py +2 -2
  78. data/lib/libv8/scons/engine/SCons/Tool/aixlink.py +2 -2
  79. data/lib/libv8/scons/engine/SCons/Tool/applelink.py +2 -2
  80. data/lib/libv8/scons/engine/SCons/Tool/ar.py +2 -2
  81. data/lib/libv8/scons/engine/SCons/Tool/as.py +2 -2
  82. data/lib/libv8/scons/engine/SCons/Tool/bcc32.py +2 -2
  83. data/lib/libv8/scons/engine/SCons/Tool/c++.py +2 -2
  84. data/lib/libv8/scons/engine/SCons/Tool/cc.py +2 -2
  85. data/lib/libv8/scons/engine/SCons/Tool/cvf.py +2 -2
  86. data/lib/libv8/scons/engine/SCons/Tool/default.py +2 -2
  87. data/lib/libv8/scons/engine/SCons/Tool/dmd.py +7 -24
  88. data/lib/libv8/scons/engine/SCons/Tool/dvi.py +2 -2
  89. data/lib/libv8/scons/engine/SCons/Tool/dvipdf.py +2 -3
  90. data/lib/libv8/scons/engine/SCons/Tool/dvips.py +2 -3
  91. data/lib/libv8/scons/engine/SCons/Tool/f77.py +2 -2
  92. data/lib/libv8/scons/engine/SCons/Tool/f90.py +2 -2
  93. data/lib/libv8/scons/engine/SCons/Tool/f95.py +2 -2
  94. data/lib/libv8/scons/engine/SCons/Tool/filesystem.py +2 -2
  95. data/lib/libv8/scons/engine/SCons/Tool/fortran.py +2 -2
  96. data/lib/libv8/scons/engine/SCons/Tool/g++.py +2 -2
  97. data/lib/libv8/scons/engine/SCons/Tool/g77.py +2 -2
  98. data/lib/libv8/scons/engine/SCons/Tool/gas.py +2 -2
  99. data/lib/libv8/scons/engine/SCons/Tool/gcc.py +2 -2
  100. data/lib/libv8/scons/engine/SCons/Tool/gfortran.py +3 -3
  101. data/lib/libv8/scons/engine/SCons/Tool/gnulink.py +3 -2
  102. data/lib/libv8/scons/engine/SCons/Tool/gs.py +2 -2
  103. data/lib/libv8/scons/engine/SCons/Tool/hpc++.py +2 -2
  104. data/lib/libv8/scons/engine/SCons/Tool/hpcc.py +2 -2
  105. data/lib/libv8/scons/engine/SCons/Tool/hplink.py +2 -2
  106. data/lib/libv8/scons/engine/SCons/Tool/icc.py +2 -2
  107. data/lib/libv8/scons/engine/SCons/Tool/icl.py +2 -2
  108. data/lib/libv8/scons/engine/SCons/Tool/ifl.py +2 -2
  109. data/lib/libv8/scons/engine/SCons/Tool/ifort.py +2 -2
  110. data/lib/libv8/scons/engine/SCons/Tool/ilink.py +2 -2
  111. data/lib/libv8/scons/engine/SCons/Tool/ilink32.py +2 -2
  112. data/lib/libv8/scons/engine/SCons/Tool/install.py +3 -57
  113. data/lib/libv8/scons/engine/SCons/Tool/intelc.py +25 -65
  114. data/lib/libv8/scons/engine/SCons/Tool/ipkg.py +2 -2
  115. data/lib/libv8/scons/engine/SCons/Tool/jar.py +3 -9
  116. data/lib/libv8/scons/engine/SCons/Tool/javac.py +2 -2
  117. data/lib/libv8/scons/engine/SCons/Tool/javah.py +2 -2
  118. data/lib/libv8/scons/engine/SCons/Tool/latex.py +2 -3
  119. data/lib/libv8/scons/engine/SCons/Tool/lex.py +2 -2
  120. data/lib/libv8/scons/engine/SCons/Tool/link.py +5 -6
  121. data/lib/libv8/scons/engine/SCons/Tool/linkloc.py +2 -2
  122. data/lib/libv8/scons/engine/SCons/Tool/m4.py +2 -2
  123. data/lib/libv8/scons/engine/SCons/Tool/masm.py +2 -2
  124. data/lib/libv8/scons/engine/SCons/Tool/midl.py +2 -2
  125. data/lib/libv8/scons/engine/SCons/Tool/mingw.py +10 -31
  126. data/lib/libv8/scons/engine/SCons/Tool/mslib.py +2 -2
  127. data/lib/libv8/scons/engine/SCons/Tool/mslink.py +9 -61
  128. data/lib/libv8/scons/engine/SCons/Tool/mssdk.py +2 -2
  129. data/lib/libv8/scons/engine/SCons/Tool/msvc.py +11 -21
  130. data/lib/libv8/scons/engine/SCons/Tool/msvs.py +59 -477
  131. data/lib/libv8/scons/engine/SCons/Tool/mwcc.py +2 -2
  132. data/lib/libv8/scons/engine/SCons/Tool/mwld.py +2 -2
  133. data/lib/libv8/scons/engine/SCons/Tool/nasm.py +2 -2
  134. data/lib/libv8/scons/engine/SCons/Tool/packaging/__init__.py +2 -2
  135. data/lib/libv8/scons/engine/SCons/Tool/packaging/ipk.py +2 -2
  136. data/lib/libv8/scons/engine/SCons/Tool/packaging/msi.py +2 -2
  137. data/lib/libv8/scons/engine/SCons/Tool/packaging/rpm.py +2 -2
  138. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_tarbz2.py +2 -2
  139. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_targz.py +2 -2
  140. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_zip.py +2 -2
  141. data/lib/libv8/scons/engine/SCons/Tool/packaging/tarbz2.py +2 -2
  142. data/lib/libv8/scons/engine/SCons/Tool/packaging/targz.py +2 -2
  143. data/lib/libv8/scons/engine/SCons/Tool/packaging/zip.py +2 -2
  144. data/lib/libv8/scons/engine/SCons/Tool/pdf.py +2 -2
  145. data/lib/libv8/scons/engine/SCons/Tool/pdflatex.py +2 -3
  146. data/lib/libv8/scons/engine/SCons/Tool/pdftex.py +2 -3
  147. data/lib/libv8/scons/engine/SCons/Tool/qt.py +2 -2
  148. data/lib/libv8/scons/engine/SCons/Tool/rmic.py +3 -9
  149. data/lib/libv8/scons/engine/SCons/Tool/rpcgen.py +2 -2
  150. data/lib/libv8/scons/engine/SCons/Tool/rpm.py +2 -2
  151. data/lib/libv8/scons/engine/SCons/Tool/sgiar.py +2 -2
  152. data/lib/libv8/scons/engine/SCons/Tool/sgic++.py +2 -2
  153. data/lib/libv8/scons/engine/SCons/Tool/sgicc.py +2 -2
  154. data/lib/libv8/scons/engine/SCons/Tool/sgilink.py +3 -2
  155. data/lib/libv8/scons/engine/SCons/Tool/sunar.py +2 -2
  156. data/lib/libv8/scons/engine/SCons/Tool/sunc++.py +2 -2
  157. data/lib/libv8/scons/engine/SCons/Tool/suncc.py +2 -2
  158. data/lib/libv8/scons/engine/SCons/Tool/sunf77.py +2 -2
  159. data/lib/libv8/scons/engine/SCons/Tool/sunf90.py +2 -2
  160. data/lib/libv8/scons/engine/SCons/Tool/sunf95.py +2 -2
  161. data/lib/libv8/scons/engine/SCons/Tool/sunlink.py +3 -2
  162. data/lib/libv8/scons/engine/SCons/Tool/swig.py +5 -6
  163. data/lib/libv8/scons/engine/SCons/Tool/tar.py +2 -2
  164. data/lib/libv8/scons/engine/SCons/Tool/tex.py +43 -96
  165. data/lib/libv8/scons/engine/SCons/Tool/textfile.py +2 -2
  166. data/lib/libv8/scons/engine/SCons/Tool/tlib.py +2 -2
  167. data/lib/libv8/scons/engine/SCons/Tool/wix.py +2 -2
  168. data/lib/libv8/scons/engine/SCons/Tool/yacc.py +2 -12
  169. data/lib/libv8/scons/engine/SCons/Tool/zip.py +2 -2
  170. data/lib/libv8/scons/engine/SCons/Util.py +3 -3
  171. data/lib/libv8/scons/engine/SCons/Variables/BoolVariable.py +2 -2
  172. data/lib/libv8/scons/engine/SCons/Variables/EnumVariable.py +3 -3
  173. data/lib/libv8/scons/engine/SCons/Variables/ListVariable.py +2 -2
  174. data/lib/libv8/scons/engine/SCons/Variables/PackageVariable.py +2 -2
  175. data/lib/libv8/scons/engine/SCons/Variables/PathVariable.py +2 -2
  176. data/lib/libv8/scons/engine/SCons/Variables/__init__.py +2 -2
  177. data/lib/libv8/scons/engine/SCons/Warnings.py +2 -2
  178. data/lib/libv8/scons/engine/SCons/__init__.py +6 -6
  179. data/lib/libv8/scons/engine/SCons/compat/__init__.py +2 -2
  180. data/lib/libv8/scons/engine/SCons/compat/_scons_builtins.py +2 -2
  181. data/lib/libv8/scons/engine/SCons/compat/_scons_collections.py +2 -2
  182. data/lib/libv8/scons/engine/SCons/compat/_scons_dbm.py +2 -2
  183. data/lib/libv8/scons/engine/SCons/compat/_scons_hashlib.py +2 -2
  184. data/lib/libv8/scons/engine/SCons/compat/_scons_io.py +2 -2
  185. data/lib/libv8/scons/engine/SCons/cpp.py +2 -2
  186. data/lib/libv8/scons/engine/SCons/dblite.py +1 -4
  187. data/lib/libv8/scons/engine/SCons/exitfuncs.py +2 -2
  188. data/lib/libv8/scons/scons-time.1 +3 -3
  189. data/lib/libv8/scons/scons.1 +1164 -1170
  190. data/lib/libv8/scons/sconsign.1 +3 -3
  191. data/lib/libv8/scons/script/scons +22 -22
  192. data/lib/libv8/scons/script/scons-time +2 -2
  193. data/lib/libv8/scons/script/scons.bat +4 -7
  194. data/lib/libv8/scons/script/sconsign +20 -21
  195. data/lib/libv8/scons/setup.cfg +1 -0
  196. data/lib/libv8/scons/setup.py +40 -38
  197. data/lib/libv8/v8/.gitignore +1 -1
  198. data/lib/libv8/v8/AUTHORS +2 -0
  199. data/lib/libv8/v8/ChangeLog +387 -0
  200. data/lib/libv8/v8/Makefile +171 -0
  201. data/lib/libv8/v8/SConstruct +124 -51
  202. data/lib/libv8/v8/build/README.txt +31 -14
  203. data/lib/libv8/v8/build/all.gyp +11 -4
  204. data/lib/libv8/v8/build/armu.gypi +6 -2
  205. data/lib/libv8/v8/build/common.gypi +240 -94
  206. data/lib/libv8/v8/build/gyp_v8 +32 -4
  207. data/lib/libv8/v8/build/standalone.gypi +200 -0
  208. data/lib/libv8/v8/include/v8-debug.h +0 -0
  209. data/lib/libv8/v8/include/v8-profiler.h +8 -11
  210. data/lib/libv8/v8/include/v8.h +191 -108
  211. data/lib/libv8/v8/preparser/SConscript +2 -2
  212. data/lib/libv8/v8/preparser/preparser-process.cc +3 -3
  213. data/lib/libv8/v8/preparser/preparser.gyp +42 -0
  214. data/lib/libv8/v8/src/SConscript +33 -8
  215. data/lib/libv8/v8/src/accessors.cc +77 -43
  216. data/lib/libv8/v8/src/api.cc +393 -191
  217. data/lib/libv8/v8/src/api.h +4 -8
  218. data/lib/libv8/v8/src/apinatives.js +15 -3
  219. data/lib/libv8/v8/src/arguments.h +8 -0
  220. data/lib/libv8/v8/src/arm/assembler-arm.cc +120 -120
  221. data/lib/libv8/v8/src/arm/assembler-arm.h +92 -43
  222. data/lib/libv8/v8/src/arm/builtins-arm.cc +32 -39
  223. data/lib/libv8/v8/src/arm/code-stubs-arm.cc +572 -351
  224. data/lib/libv8/v8/src/arm/code-stubs-arm.h +8 -77
  225. data/lib/libv8/v8/src/arm/codegen-arm.h +0 -2
  226. data/lib/libv8/v8/src/arm/deoptimizer-arm.cc +50 -30
  227. data/lib/libv8/v8/src/arm/disasm-arm.cc +1 -1
  228. data/lib/libv8/v8/src/arm/frames-arm.h +9 -5
  229. data/lib/libv8/v8/src/arm/full-codegen-arm.cc +331 -432
  230. data/lib/libv8/v8/src/arm/ic-arm.cc +192 -124
  231. data/lib/libv8/v8/src/arm/lithium-arm.cc +216 -232
  232. data/lib/libv8/v8/src/arm/lithium-arm.h +106 -259
  233. data/lib/libv8/v8/src/arm/lithium-codegen-arm.cc +633 -642
  234. data/lib/libv8/v8/src/arm/lithium-codegen-arm.h +4 -4
  235. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.cc +1 -3
  236. data/lib/libv8/v8/src/arm/macro-assembler-arm.cc +260 -185
  237. data/lib/libv8/v8/src/arm/macro-assembler-arm.h +45 -25
  238. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.cc +25 -13
  239. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.h +3 -0
  240. data/lib/libv8/v8/src/arm/stub-cache-arm.cc +413 -226
  241. data/lib/libv8/v8/src/array.js +38 -18
  242. data/lib/libv8/v8/src/assembler.cc +12 -5
  243. data/lib/libv8/v8/src/assembler.h +15 -9
  244. data/lib/libv8/v8/src/ast-inl.h +34 -25
  245. data/lib/libv8/v8/src/ast.cc +141 -72
  246. data/lib/libv8/v8/src/ast.h +255 -181
  247. data/lib/libv8/v8/src/bignum.cc +3 -4
  248. data/lib/libv8/v8/src/bootstrapper.cc +55 -11
  249. data/lib/libv8/v8/src/bootstrapper.h +3 -2
  250. data/lib/libv8/v8/src/builtins.cc +8 -2
  251. data/lib/libv8/v8/src/builtins.h +4 -0
  252. data/lib/libv8/v8/src/cached-powers.cc +8 -4
  253. data/lib/libv8/v8/src/checks.h +3 -3
  254. data/lib/libv8/v8/src/code-stubs.cc +173 -28
  255. data/lib/libv8/v8/src/code-stubs.h +104 -148
  256. data/lib/libv8/v8/src/codegen.cc +8 -8
  257. data/lib/libv8/v8/src/compilation-cache.cc +2 -47
  258. data/lib/libv8/v8/src/compilation-cache.h +0 -10
  259. data/lib/libv8/v8/src/compiler.cc +27 -16
  260. data/lib/libv8/v8/src/compiler.h +13 -18
  261. data/lib/libv8/v8/src/contexts.cc +107 -72
  262. data/lib/libv8/v8/src/contexts.h +70 -34
  263. data/lib/libv8/v8/src/conversions-inl.h +572 -14
  264. data/lib/libv8/v8/src/conversions.cc +9 -707
  265. data/lib/libv8/v8/src/conversions.h +23 -12
  266. data/lib/libv8/v8/src/cpu-profiler-inl.h +2 -19
  267. data/lib/libv8/v8/src/cpu-profiler.cc +4 -21
  268. data/lib/libv8/v8/src/cpu-profiler.h +8 -17
  269. data/lib/libv8/v8/src/d8-debug.cc +5 -3
  270. data/lib/libv8/v8/src/d8-debug.h +6 -7
  271. data/lib/libv8/v8/src/d8-posix.cc +1 -10
  272. data/lib/libv8/v8/src/d8.cc +721 -219
  273. data/lib/libv8/v8/src/d8.gyp +37 -12
  274. data/lib/libv8/v8/src/d8.h +141 -19
  275. data/lib/libv8/v8/src/d8.js +17 -8
  276. data/lib/libv8/v8/src/date.js +16 -5
  277. data/lib/libv8/v8/src/dateparser-inl.h +242 -39
  278. data/lib/libv8/v8/src/dateparser.cc +38 -4
  279. data/lib/libv8/v8/src/dateparser.h +170 -28
  280. data/lib/libv8/v8/src/debug-agent.cc +5 -3
  281. data/lib/libv8/v8/src/debug-agent.h +11 -7
  282. data/lib/libv8/v8/src/debug-debugger.js +65 -34
  283. data/lib/libv8/v8/src/debug.cc +30 -60
  284. data/lib/libv8/v8/src/debug.h +5 -3
  285. data/lib/libv8/v8/src/deoptimizer.cc +227 -10
  286. data/lib/libv8/v8/src/deoptimizer.h +133 -9
  287. data/lib/libv8/v8/src/disassembler.cc +22 -14
  288. data/lib/libv8/v8/src/diy-fp.cc +4 -3
  289. data/lib/libv8/v8/src/diy-fp.h +3 -3
  290. data/lib/libv8/v8/src/elements.cc +634 -0
  291. data/lib/libv8/v8/src/elements.h +95 -0
  292. data/lib/libv8/v8/src/execution.cc +5 -21
  293. data/lib/libv8/v8/src/extensions/experimental/break-iterator.cc +3 -1
  294. data/lib/libv8/v8/src/extensions/experimental/break-iterator.h +1 -1
  295. data/lib/libv8/v8/src/extensions/experimental/collator.cc +6 -2
  296. data/lib/libv8/v8/src/extensions/experimental/collator.h +1 -2
  297. data/lib/libv8/v8/src/extensions/experimental/datetime-format.cc +384 -0
  298. data/lib/libv8/v8/src/extensions/experimental/datetime-format.h +83 -0
  299. data/lib/libv8/v8/src/extensions/experimental/experimental.gyp +18 -7
  300. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.cc +12 -16
  301. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.h +1 -1
  302. data/lib/libv8/v8/src/extensions/experimental/i18n-js2c.py +126 -0
  303. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.cc +3 -4
  304. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.h +1 -1
  305. data/lib/libv8/v8/src/{shell.h → extensions/experimental/i18n-natives.h} +8 -20
  306. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.cc +45 -1
  307. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.h +21 -1
  308. data/lib/libv8/v8/src/extensions/experimental/i18n.js +211 -11
  309. data/lib/libv8/v8/src/extensions/experimental/language-matcher.cc +4 -3
  310. data/lib/libv8/v8/src/extensions/experimental/language-matcher.h +1 -1
  311. data/lib/libv8/v8/src/extensions/experimental/number-format.cc +374 -0
  312. data/lib/libv8/v8/src/extensions/experimental/number-format.h +71 -0
  313. data/lib/libv8/v8/src/factory.cc +89 -18
  314. data/lib/libv8/v8/src/factory.h +36 -8
  315. data/lib/libv8/v8/src/flag-definitions.h +11 -44
  316. data/lib/libv8/v8/src/frames-inl.h +8 -1
  317. data/lib/libv8/v8/src/frames.cc +39 -3
  318. data/lib/libv8/v8/src/frames.h +10 -3
  319. data/lib/libv8/v8/src/full-codegen.cc +311 -293
  320. data/lib/libv8/v8/src/full-codegen.h +183 -143
  321. data/lib/libv8/v8/src/func-name-inferrer.cc +29 -15
  322. data/lib/libv8/v8/src/func-name-inferrer.h +19 -9
  323. data/lib/libv8/v8/src/gdb-jit.cc +658 -55
  324. data/lib/libv8/v8/src/gdb-jit.h +6 -2
  325. data/lib/libv8/v8/src/global-handles.cc +368 -312
  326. data/lib/libv8/v8/src/global-handles.h +29 -36
  327. data/lib/libv8/v8/src/globals.h +3 -1
  328. data/lib/libv8/v8/src/handles.cc +43 -69
  329. data/lib/libv8/v8/src/handles.h +21 -16
  330. data/lib/libv8/v8/src/heap-inl.h +11 -13
  331. data/lib/libv8/v8/src/heap-profiler.cc +0 -999
  332. data/lib/libv8/v8/src/heap-profiler.h +0 -303
  333. data/lib/libv8/v8/src/heap.cc +366 -141
  334. data/lib/libv8/v8/src/heap.h +87 -26
  335. data/lib/libv8/v8/src/hydrogen-instructions.cc +192 -81
  336. data/lib/libv8/v8/src/hydrogen-instructions.h +711 -482
  337. data/lib/libv8/v8/src/hydrogen.cc +1146 -629
  338. data/lib/libv8/v8/src/hydrogen.h +100 -64
  339. data/lib/libv8/v8/src/ia32/assembler-ia32.cc +19 -0
  340. data/lib/libv8/v8/src/ia32/assembler-ia32.h +15 -2
  341. data/lib/libv8/v8/src/ia32/builtins-ia32.cc +34 -39
  342. data/lib/libv8/v8/src/ia32/code-stubs-ia32.cc +675 -377
  343. data/lib/libv8/v8/src/ia32/code-stubs-ia32.h +8 -69
  344. data/lib/libv8/v8/src/ia32/codegen-ia32.cc +1 -0
  345. data/lib/libv8/v8/src/ia32/codegen-ia32.h +0 -2
  346. data/lib/libv8/v8/src/ia32/cpu-ia32.cc +3 -2
  347. data/lib/libv8/v8/src/ia32/deoptimizer-ia32.cc +28 -3
  348. data/lib/libv8/v8/src/ia32/disasm-ia32.cc +21 -10
  349. data/lib/libv8/v8/src/ia32/frames-ia32.h +6 -5
  350. data/lib/libv8/v8/src/ia32/full-codegen-ia32.cc +459 -465
  351. data/lib/libv8/v8/src/ia32/ic-ia32.cc +196 -147
  352. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.cc +575 -650
  353. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.h +19 -21
  354. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.cc +7 -2
  355. data/lib/libv8/v8/src/ia32/lithium-ia32.cc +261 -256
  356. data/lib/libv8/v8/src/ia32/lithium-ia32.h +234 -335
  357. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.cc +224 -67
  358. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.h +63 -19
  359. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.cc +22 -8
  360. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.h +3 -0
  361. data/lib/libv8/v8/src/ia32/stub-cache-ia32.cc +380 -239
  362. data/lib/libv8/v8/src/ic.cc +198 -234
  363. data/lib/libv8/v8/src/ic.h +32 -30
  364. data/lib/libv8/v8/src/interpreter-irregexp.cc +6 -4
  365. data/lib/libv8/v8/src/isolate.cc +112 -95
  366. data/lib/libv8/v8/src/isolate.h +55 -71
  367. data/lib/libv8/v8/src/json-parser.h +486 -48
  368. data/lib/libv8/v8/src/json.js +28 -23
  369. data/lib/libv8/v8/src/jsregexp.cc +163 -208
  370. data/lib/libv8/v8/src/jsregexp.h +0 -1
  371. data/lib/libv8/v8/src/lithium-allocator-inl.h +29 -27
  372. data/lib/libv8/v8/src/lithium-allocator.cc +22 -17
  373. data/lib/libv8/v8/src/lithium-allocator.h +8 -8
  374. data/lib/libv8/v8/src/lithium.cc +16 -11
  375. data/lib/libv8/v8/src/lithium.h +31 -34
  376. data/lib/libv8/v8/src/liveedit.cc +111 -15
  377. data/lib/libv8/v8/src/liveedit.h +3 -4
  378. data/lib/libv8/v8/src/liveobjectlist.cc +116 -80
  379. data/lib/libv8/v8/src/liveobjectlist.h +2 -2
  380. data/lib/libv8/v8/src/log-inl.h +0 -4
  381. data/lib/libv8/v8/src/log-utils.cc +25 -143
  382. data/lib/libv8/v8/src/log-utils.h +13 -92
  383. data/lib/libv8/v8/src/log.cc +26 -249
  384. data/lib/libv8/v8/src/log.h +6 -17
  385. data/lib/libv8/v8/src/macros.py +9 -6
  386. data/lib/libv8/v8/src/mark-compact.cc +276 -56
  387. data/lib/libv8/v8/src/mark-compact.h +20 -0
  388. data/lib/libv8/v8/src/messages.js +93 -39
  389. data/lib/libv8/v8/src/mips/assembler-mips-inl.h +9 -3
  390. data/lib/libv8/v8/src/mips/assembler-mips.cc +297 -189
  391. data/lib/libv8/v8/src/mips/assembler-mips.h +121 -54
  392. data/lib/libv8/v8/src/mips/builtins-mips.cc +23 -24
  393. data/lib/libv8/v8/src/mips/code-stubs-mips.cc +484 -263
  394. data/lib/libv8/v8/src/mips/code-stubs-mips.h +8 -83
  395. data/lib/libv8/v8/src/mips/codegen-mips.h +0 -2
  396. data/lib/libv8/v8/src/mips/constants-mips.h +37 -11
  397. data/lib/libv8/v8/src/mips/deoptimizer-mips.cc +6 -1
  398. data/lib/libv8/v8/src/mips/frames-mips.h +8 -7
  399. data/lib/libv8/v8/src/mips/full-codegen-mips.cc +258 -419
  400. data/lib/libv8/v8/src/mips/ic-mips.cc +181 -121
  401. data/lib/libv8/v8/src/mips/macro-assembler-mips.cc +640 -382
  402. data/lib/libv8/v8/src/mips/macro-assembler-mips.h +94 -89
  403. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.cc +23 -10
  404. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.h +6 -1
  405. data/lib/libv8/v8/src/mips/simulator-mips.cc +249 -49
  406. data/lib/libv8/v8/src/mips/simulator-mips.h +25 -1
  407. data/lib/libv8/v8/src/mips/stub-cache-mips.cc +373 -161
  408. data/lib/libv8/v8/src/mirror-debugger.js +55 -8
  409. data/lib/libv8/v8/src/misc-intrinsics.h +89 -0
  410. data/lib/libv8/v8/src/mksnapshot.cc +36 -4
  411. data/lib/libv8/v8/src/natives.h +5 -2
  412. data/lib/libv8/v8/src/objects-debug.cc +73 -6
  413. data/lib/libv8/v8/src/objects-inl.h +529 -164
  414. data/lib/libv8/v8/src/objects-printer.cc +67 -12
  415. data/lib/libv8/v8/src/objects-visiting.cc +13 -2
  416. data/lib/libv8/v8/src/objects-visiting.h +41 -1
  417. data/lib/libv8/v8/src/objects.cc +2200 -1177
  418. data/lib/libv8/v8/src/objects.h +912 -283
  419. data/lib/libv8/v8/src/parser.cc +566 -371
  420. data/lib/libv8/v8/src/parser.h +35 -33
  421. data/lib/libv8/v8/src/platform-cygwin.cc +10 -25
  422. data/lib/libv8/v8/src/platform-freebsd.cc +4 -29
  423. data/lib/libv8/v8/src/platform-linux.cc +60 -57
  424. data/lib/libv8/v8/src/platform-macos.cc +4 -27
  425. data/lib/libv8/v8/src/platform-nullos.cc +3 -16
  426. data/lib/libv8/v8/src/platform-openbsd.cc +247 -85
  427. data/lib/libv8/v8/src/platform-posix.cc +43 -1
  428. data/lib/libv8/v8/src/platform-solaris.cc +151 -112
  429. data/lib/libv8/v8/src/platform-tls.h +1 -1
  430. data/lib/libv8/v8/src/platform-win32.cc +65 -39
  431. data/lib/libv8/v8/src/platform.h +17 -14
  432. data/lib/libv8/v8/src/preparse-data-format.h +2 -2
  433. data/lib/libv8/v8/src/preparse-data.h +8 -2
  434. data/lib/libv8/v8/src/preparser-api.cc +2 -18
  435. data/lib/libv8/v8/src/preparser.cc +106 -65
  436. data/lib/libv8/v8/src/preparser.h +26 -5
  437. data/lib/libv8/v8/src/prettyprinter.cc +25 -43
  438. data/lib/libv8/v8/src/profile-generator-inl.h +0 -4
  439. data/lib/libv8/v8/src/profile-generator.cc +213 -34
  440. data/lib/libv8/v8/src/profile-generator.h +9 -9
  441. data/lib/libv8/v8/src/property.h +1 -0
  442. data/lib/libv8/v8/src/proxy.js +74 -4
  443. data/lib/libv8/v8/src/regexp-macro-assembler.cc +10 -6
  444. data/lib/libv8/v8/src/regexp.js +16 -11
  445. data/lib/libv8/v8/src/rewriter.cc +24 -133
  446. data/lib/libv8/v8/src/runtime-profiler.cc +27 -151
  447. data/lib/libv8/v8/src/runtime-profiler.h +5 -31
  448. data/lib/libv8/v8/src/runtime.cc +1450 -681
  449. data/lib/libv8/v8/src/runtime.h +47 -31
  450. data/lib/libv8/v8/src/runtime.js +2 -1
  451. data/lib/libv8/v8/src/scanner-base.cc +358 -220
  452. data/lib/libv8/v8/src/scanner-base.h +30 -138
  453. data/lib/libv8/v8/src/scanner.cc +0 -18
  454. data/lib/libv8/v8/src/scanner.h +0 -15
  455. data/lib/libv8/v8/src/scopeinfo.cc +3 -1
  456. data/lib/libv8/v8/src/scopeinfo.h +1 -6
  457. data/lib/libv8/v8/src/scopes.cc +243 -253
  458. data/lib/libv8/v8/src/scopes.h +58 -109
  459. data/lib/libv8/v8/src/serialize.cc +12 -54
  460. data/lib/libv8/v8/src/serialize.h +47 -0
  461. data/lib/libv8/v8/src/small-pointer-list.h +25 -0
  462. data/lib/libv8/v8/src/spaces-inl.h +4 -50
  463. data/lib/libv8/v8/src/spaces.cc +64 -131
  464. data/lib/libv8/v8/src/spaces.h +19 -70
  465. data/lib/libv8/v8/src/string-stream.cc +3 -1
  466. data/lib/libv8/v8/src/string.js +10 -6
  467. data/lib/libv8/v8/src/strtod.cc +7 -3
  468. data/lib/libv8/v8/src/stub-cache.cc +59 -129
  469. data/lib/libv8/v8/src/stub-cache.h +42 -54
  470. data/lib/libv8/v8/src/third_party/valgrind/valgrind.h +1447 -1339
  471. data/lib/libv8/v8/src/token.cc +4 -4
  472. data/lib/libv8/v8/src/token.h +6 -5
  473. data/lib/libv8/v8/src/type-info.cc +173 -129
  474. data/lib/libv8/v8/src/type-info.h +40 -22
  475. data/lib/libv8/v8/src/utils.cc +25 -304
  476. data/lib/libv8/v8/src/utils.h +118 -3
  477. data/lib/libv8/v8/src/v8-counters.h +3 -6
  478. data/lib/libv8/v8/src/v8.cc +34 -27
  479. data/lib/libv8/v8/src/v8.h +7 -7
  480. data/lib/libv8/v8/src/v8conversions.cc +129 -0
  481. data/lib/libv8/v8/src/v8conversions.h +60 -0
  482. data/lib/libv8/v8/src/v8globals.h +15 -6
  483. data/lib/libv8/v8/src/v8natives.js +300 -78
  484. data/lib/libv8/v8/src/v8threads.cc +14 -6
  485. data/lib/libv8/v8/src/v8threads.h +4 -1
  486. data/lib/libv8/v8/src/v8utils.cc +360 -0
  487. data/lib/libv8/v8/src/v8utils.h +17 -66
  488. data/lib/libv8/v8/src/variables.cc +7 -12
  489. data/lib/libv8/v8/src/variables.h +12 -10
  490. data/lib/libv8/v8/src/version.cc +2 -2
  491. data/lib/libv8/v8/src/vm-state-inl.h +0 -41
  492. data/lib/libv8/v8/src/vm-state.h +0 -11
  493. data/lib/libv8/v8/src/weakmap.js +103 -0
  494. data/lib/libv8/v8/src/x64/assembler-x64.h +6 -3
  495. data/lib/libv8/v8/src/x64/builtins-x64.cc +25 -22
  496. data/lib/libv8/v8/src/x64/code-stubs-x64.cc +523 -250
  497. data/lib/libv8/v8/src/x64/code-stubs-x64.h +8 -71
  498. data/lib/libv8/v8/src/x64/codegen-x64.cc +1 -0
  499. data/lib/libv8/v8/src/x64/codegen-x64.h +0 -2
  500. data/lib/libv8/v8/src/x64/cpu-x64.cc +2 -1
  501. data/lib/libv8/v8/src/x64/deoptimizer-x64.cc +40 -8
  502. data/lib/libv8/v8/src/x64/disasm-x64.cc +12 -10
  503. data/lib/libv8/v8/src/x64/frames-x64.h +7 -6
  504. data/lib/libv8/v8/src/x64/full-codegen-x64.cc +310 -415
  505. data/lib/libv8/v8/src/x64/ic-x64.cc +180 -117
  506. data/lib/libv8/v8/src/x64/lithium-codegen-x64.cc +411 -523
  507. data/lib/libv8/v8/src/x64/lithium-codegen-x64.h +11 -6
  508. data/lib/libv8/v8/src/x64/lithium-x64.cc +191 -216
  509. data/lib/libv8/v8/src/x64/lithium-x64.h +112 -263
  510. data/lib/libv8/v8/src/x64/macro-assembler-x64.cc +177 -61
  511. data/lib/libv8/v8/src/x64/macro-assembler-x64.h +23 -7
  512. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.cc +21 -9
  513. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.h +6 -0
  514. data/lib/libv8/v8/src/x64/stub-cache-x64.cc +273 -107
  515. data/lib/libv8/v8/src/zone.cc +31 -22
  516. data/lib/libv8/v8/src/zone.h +12 -6
  517. data/lib/libv8/v8/tools/codemap.js +8 -0
  518. data/lib/libv8/v8/tools/gcmole/Makefile +43 -0
  519. data/lib/libv8/v8/tools/gcmole/gcmole.lua +0 -2
  520. data/lib/libv8/v8/tools/gdb-v8-support.py +154 -0
  521. data/lib/libv8/v8/tools/grokdump.py +44 -35
  522. data/lib/libv8/v8/tools/gyp/v8.gyp +94 -248
  523. data/lib/libv8/v8/tools/js2c.py +83 -52
  524. data/lib/libv8/v8/tools/linux-tick-processor +4 -6
  525. data/lib/libv8/v8/tools/ll_prof.py +3 -3
  526. data/lib/libv8/v8/tools/oom_dump/README +3 -1
  527. data/lib/libv8/v8/tools/presubmit.py +11 -4
  528. data/lib/libv8/v8/tools/profile.js +46 -2
  529. data/lib/libv8/v8/tools/splaytree.js +11 -0
  530. data/lib/libv8/v8/tools/stats-viewer.py +15 -11
  531. data/lib/libv8/v8/tools/test-wrapper-gypbuild.py +227 -0
  532. data/lib/libv8/v8/tools/test.py +28 -8
  533. data/lib/libv8/v8/tools/tickprocessor.js +0 -16
  534. data/lib/libv8/version.rb +1 -1
  535. data/libv8.gemspec +2 -2
  536. metadata +31 -19
  537. data/lib/libv8/scons/engine/SCons/Tool/f03.py +0 -63
  538. data/lib/libv8/v8/src/json-parser.cc +0 -504
@@ -125,18 +125,17 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
125
125
  __ movq(rcx, Operand(rsp, 1 * kPointerSize));
126
126
 
127
127
  // Setup the object header.
128
- __ LoadRoot(kScratchRegister, Heap::kContextMapRootIndex);
128
+ __ LoadRoot(kScratchRegister, Heap::kFunctionContextMapRootIndex);
129
129
  __ movq(FieldOperand(rax, HeapObject::kMapOffset), kScratchRegister);
130
130
  __ Move(FieldOperand(rax, FixedArray::kLengthOffset), Smi::FromInt(length));
131
131
 
132
132
  // Setup the fixed slots.
133
133
  __ Set(rbx, 0); // Set to NULL.
134
134
  __ movq(Operand(rax, Context::SlotOffset(Context::CLOSURE_INDEX)), rcx);
135
- __ movq(Operand(rax, Context::SlotOffset(Context::FCONTEXT_INDEX)), rax);
136
- __ movq(Operand(rax, Context::SlotOffset(Context::PREVIOUS_INDEX)), rbx);
135
+ __ movq(Operand(rax, Context::SlotOffset(Context::PREVIOUS_INDEX)), rsi);
137
136
  __ movq(Operand(rax, Context::SlotOffset(Context::EXTENSION_INDEX)), rbx);
138
137
 
139
- // Copy the global object from the surrounding context.
138
+ // Copy the global object from the previous context.
140
139
  __ movq(rbx, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
141
140
  __ movq(Operand(rax, Context::SlotOffset(Context::GLOBAL_INDEX)), rbx);
142
141
 
@@ -152,7 +151,7 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
152
151
 
153
152
  // Need to collect. Call into runtime system.
154
153
  __ bind(&gc);
155
- __ TailCallRuntime(Runtime::kNewContext, 1, 1);
154
+ __ TailCallRuntime(Runtime::kNewFunctionContext, 1, 1);
156
155
  }
157
156
 
158
157
 
@@ -231,69 +230,139 @@ void FastCloneShallowArrayStub::Generate(MacroAssembler* masm) {
231
230
  }
232
231
 
233
232
 
233
+ // The stub expects its argument on the stack and returns its result in tos_:
234
+ // zero for false, and a non-zero value for true.
234
235
  void ToBooleanStub::Generate(MacroAssembler* masm) {
235
- Label false_result, true_result, not_string;
236
- __ movq(rax, Operand(rsp, 1 * kPointerSize));
236
+ Label patch;
237
+ const Register argument = rax;
238
+ const Register map = rdx;
239
+
240
+ if (!types_.IsEmpty()) {
241
+ __ movq(argument, Operand(rsp, 1 * kPointerSize));
242
+ }
237
243
 
238
244
  // undefined -> false
239
- __ CompareRoot(rax, Heap::kUndefinedValueRootIndex);
240
- __ j(equal, &false_result);
245
+ CheckOddball(masm, UNDEFINED, Heap::kUndefinedValueRootIndex, false);
241
246
 
242
247
  // Boolean -> its value
243
- __ CompareRoot(rax, Heap::kFalseValueRootIndex);
244
- __ j(equal, &false_result);
245
- __ CompareRoot(rax, Heap::kTrueValueRootIndex);
246
- __ j(equal, &true_result);
247
-
248
- // Smis: 0 -> false, all other -> true
249
- __ Cmp(rax, Smi::FromInt(0));
250
- __ j(equal, &false_result);
251
- Condition is_smi = __ CheckSmi(rax);
252
- __ j(is_smi, &true_result);
253
-
254
- // 'null' => false.
255
- __ CompareRoot(rax, Heap::kNullValueRootIndex);
256
- __ j(equal, &false_result, Label::kNear);
257
-
258
- // Get the map and type of the heap object.
259
- // We don't use CmpObjectType because we manipulate the type field.
260
- __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset));
261
- __ movzxbq(rcx, FieldOperand(rdx, Map::kInstanceTypeOffset));
262
-
263
- // Undetectable => false.
264
- __ movzxbq(rbx, FieldOperand(rdx, Map::kBitFieldOffset));
265
- __ and_(rbx, Immediate(1 << Map::kIsUndetectable));
266
- __ j(not_zero, &false_result, Label::kNear);
267
-
268
- // JavaScript object => true.
269
- __ cmpq(rcx, Immediate(FIRST_JS_OBJECT_TYPE));
270
- __ j(above_equal, &true_result, Label::kNear);
271
-
272
- // String value => false iff empty.
273
- __ cmpq(rcx, Immediate(FIRST_NONSTRING_TYPE));
274
- __ j(above_equal, &not_string, Label::kNear);
275
- __ movq(rdx, FieldOperand(rax, String::kLengthOffset));
276
- __ SmiTest(rdx);
277
- __ j(zero, &false_result, Label::kNear);
278
- __ jmp(&true_result, Label::kNear);
248
+ CheckOddball(masm, BOOLEAN, Heap::kFalseValueRootIndex, false);
249
+ CheckOddball(masm, BOOLEAN, Heap::kTrueValueRootIndex, true);
250
+
251
+ // 'null' -> false.
252
+ CheckOddball(masm, NULL_TYPE, Heap::kNullValueRootIndex, false);
253
+
254
+ if (types_.Contains(SMI)) {
255
+ // Smis: 0 -> false, all other -> true
256
+ Label not_smi;
257
+ __ JumpIfNotSmi(argument, &not_smi, Label::kNear);
258
+ // argument contains the correct return value already
259
+ if (!tos_.is(argument)) {
260
+ __ movq(tos_, argument);
261
+ }
262
+ __ ret(1 * kPointerSize);
263
+ __ bind(&not_smi);
264
+ } else if (types_.NeedsMap()) {
265
+ // If we need a map later and have a Smi -> patch.
266
+ __ JumpIfSmi(argument, &patch, Label::kNear);
267
+ }
279
268
 
280
- __ bind(&not_string);
281
- __ CompareRoot(rdx, Heap::kHeapNumberMapRootIndex);
282
- __ j(not_equal, &true_result, Label::kNear);
283
- // HeapNumber => false iff +0, -0, or NaN.
284
- // These three cases set the zero flag when compared to zero using ucomisd.
285
- __ xorps(xmm0, xmm0);
286
- __ ucomisd(xmm0, FieldOperand(rax, HeapNumber::kValueOffset));
287
- __ j(zero, &false_result, Label::kNear);
288
- // Fall through to |true_result|.
269
+ if (types_.NeedsMap()) {
270
+ __ movq(map, FieldOperand(argument, HeapObject::kMapOffset));
271
+
272
+ if (types_.CanBeUndetectable()) {
273
+ __ testb(FieldOperand(map, Map::kBitFieldOffset),
274
+ Immediate(1 << Map::kIsUndetectable));
275
+ // Undetectable -> false.
276
+ Label not_undetectable;
277
+ __ j(zero, &not_undetectable, Label::kNear);
278
+ __ Set(tos_, 0);
279
+ __ ret(1 * kPointerSize);
280
+ __ bind(&not_undetectable);
281
+ }
282
+ }
289
283
 
290
- // Return 1/0 for true/false in rax.
291
- __ bind(&true_result);
292
- __ Set(rax, 1);
293
- __ ret(1 * kPointerSize);
294
- __ bind(&false_result);
295
- __ Set(rax, 0);
296
- __ ret(1 * kPointerSize);
284
+ if (types_.Contains(SPEC_OBJECT)) {
285
+ // spec object -> true.
286
+ Label not_js_object;
287
+ __ CmpInstanceType(map, FIRST_SPEC_OBJECT_TYPE);
288
+ __ j(below, &not_js_object, Label::kNear);
289
+ // argument contains the correct return value already.
290
+ if (!tos_.is(argument)) {
291
+ __ Set(tos_, 1);
292
+ }
293
+ __ ret(1 * kPointerSize);
294
+ __ bind(&not_js_object);
295
+ }
296
+
297
+ if (types_.Contains(STRING)) {
298
+ // String value -> false iff empty.
299
+ Label not_string;
300
+ __ CmpInstanceType(map, FIRST_NONSTRING_TYPE);
301
+ __ j(above_equal, &not_string, Label::kNear);
302
+ __ movq(tos_, FieldOperand(argument, String::kLengthOffset));
303
+ __ ret(1 * kPointerSize); // the string length is OK as the return value
304
+ __ bind(&not_string);
305
+ }
306
+
307
+ if (types_.Contains(HEAP_NUMBER)) {
308
+ // heap number -> false iff +0, -0, or NaN.
309
+ Label not_heap_number, false_result;
310
+ __ CompareRoot(map, Heap::kHeapNumberMapRootIndex);
311
+ __ j(not_equal, &not_heap_number, Label::kNear);
312
+ __ xorps(xmm0, xmm0);
313
+ __ ucomisd(xmm0, FieldOperand(argument, HeapNumber::kValueOffset));
314
+ __ j(zero, &false_result, Label::kNear);
315
+ // argument contains the correct return value already.
316
+ if (!tos_.is(argument)) {
317
+ __ Set(tos_, 1);
318
+ }
319
+ __ ret(1 * kPointerSize);
320
+ __ bind(&false_result);
321
+ __ Set(tos_, 0);
322
+ __ ret(1 * kPointerSize);
323
+ __ bind(&not_heap_number);
324
+ }
325
+
326
+ __ bind(&patch);
327
+ GenerateTypeTransition(masm);
328
+ }
329
+
330
+
331
+ void ToBooleanStub::CheckOddball(MacroAssembler* masm,
332
+ Type type,
333
+ Heap::RootListIndex value,
334
+ bool result) {
335
+ const Register argument = rax;
336
+ if (types_.Contains(type)) {
337
+ // If we see an expected oddball, return its ToBoolean value tos_.
338
+ Label different_value;
339
+ __ CompareRoot(argument, value);
340
+ __ j(not_equal, &different_value, Label::kNear);
341
+ if (!result) {
342
+ // If we have to return zero, there is no way around clearing tos_.
343
+ __ Set(tos_, 0);
344
+ } else if (!tos_.is(argument)) {
345
+ // If we have to return non-zero, we can re-use the argument if it is the
346
+ // same register as the result, because we never see Smi-zero here.
347
+ __ Set(tos_, 1);
348
+ }
349
+ __ ret(1 * kPointerSize);
350
+ __ bind(&different_value);
351
+ }
352
+ }
353
+
354
+
355
+ void ToBooleanStub::GenerateTypeTransition(MacroAssembler* masm) {
356
+ __ pop(rcx); // Get return address, operand is now on top of stack.
357
+ __ Push(Smi::FromInt(tos_.code()));
358
+ __ Push(Smi::FromInt(types_.ToByte()));
359
+ __ push(rcx); // Push return address.
360
+ // Patch the caller to an appropriate specialized stub and return the
361
+ // operation result to the caller of the stub.
362
+ __ TailCallExternalReference(
363
+ ExternalReference(IC_Utility(IC::kToBoolean_Patch), masm->isolate()),
364
+ 3,
365
+ 1);
297
366
  }
298
367
 
299
368
 
@@ -406,12 +475,6 @@ void IntegerConvert(MacroAssembler* masm,
406
475
  }
407
476
 
408
477
 
409
- Handle<Code> GetUnaryOpStub(int key, UnaryOpIC::TypeInfo type_info) {
410
- UnaryOpStub stub(key, type_info);
411
- return stub.GetCode();
412
- }
413
-
414
-
415
478
  void UnaryOpStub::Generate(MacroAssembler* masm) {
416
479
  switch (operand_type_) {
417
480
  case UnaryOpIC::UNINITIALIZED:
@@ -432,12 +495,10 @@ void UnaryOpStub::Generate(MacroAssembler* masm) {
432
495
 
433
496
  void UnaryOpStub::GenerateTypeTransition(MacroAssembler* masm) {
434
497
  __ pop(rcx); // Save return address.
435
- __ push(rax);
436
- // Left and right arguments are now on top.
437
- // Push this stub's key. Although the operation and the type info are
438
- // encoded into the key, the encoding is opaque, so push them too.
439
- __ Push(Smi::FromInt(MinorKey()));
498
+
499
+ __ push(rax); // the operand
440
500
  __ Push(Smi::FromInt(op_));
501
+ __ Push(Smi::FromInt(mode_));
441
502
  __ Push(Smi::FromInt(operand_type_));
442
503
 
443
504
  __ push(rcx); // Push return address.
@@ -445,10 +506,7 @@ void UnaryOpStub::GenerateTypeTransition(MacroAssembler* masm) {
445
506
  // Patch the caller to an appropriate specialized stub and return the
446
507
  // operation result to the caller of the stub.
447
508
  __ TailCallExternalReference(
448
- ExternalReference(IC_Utility(IC::kUnaryOp_Patch),
449
- masm->isolate()),
450
- 4,
451
- 1);
509
+ ExternalReference(IC_Utility(IC::kUnaryOp_Patch), masm->isolate()), 4, 1);
452
510
  }
453
511
 
454
512
 
@@ -655,33 +713,17 @@ void UnaryOpStub::GenerateGenericCodeFallback(MacroAssembler* masm) {
655
713
  }
656
714
 
657
715
 
658
- const char* UnaryOpStub::GetName() {
659
- if (name_ != NULL) return name_;
660
- const int kMaxNameLength = 100;
661
- name_ = Isolate::Current()->bootstrapper()->AllocateAutoDeletedArray(
662
- kMaxNameLength);
663
- if (name_ == NULL) return "OOM";
716
+ void UnaryOpStub::PrintName(StringStream* stream) {
664
717
  const char* op_name = Token::Name(op_);
665
718
  const char* overwrite_name = NULL; // Make g++ happy.
666
719
  switch (mode_) {
667
720
  case UNARY_NO_OVERWRITE: overwrite_name = "Alloc"; break;
668
721
  case UNARY_OVERWRITE: overwrite_name = "Overwrite"; break;
669
722
  }
670
-
671
- OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
672
- "UnaryOpStub_%s_%s_%s",
673
- op_name,
674
- overwrite_name,
675
- UnaryOpIC::GetName(operand_type_));
676
- return name_;
677
- }
678
-
679
-
680
- Handle<Code> GetBinaryOpStub(int key,
681
- BinaryOpIC::TypeInfo type_info,
682
- BinaryOpIC::TypeInfo result_type_info) {
683
- BinaryOpStub stub(key, type_info, result_type_info);
684
- return stub.GetCode();
723
+ stream->Add("UnaryOpStub_%s_%s_%s",
724
+ op_name,
725
+ overwrite_name,
726
+ UnaryOpIC::GetName(operand_type_));
685
727
  }
686
728
 
687
729
 
@@ -742,12 +784,7 @@ void BinaryOpStub::Generate(MacroAssembler* masm) {
742
784
  }
743
785
 
744
786
 
745
- const char* BinaryOpStub::GetName() {
746
- if (name_ != NULL) return name_;
747
- const int kMaxNameLength = 100;
748
- name_ = Isolate::Current()->bootstrapper()->AllocateAutoDeletedArray(
749
- kMaxNameLength);
750
- if (name_ == NULL) return "OOM";
787
+ void BinaryOpStub::PrintName(StringStream* stream) {
751
788
  const char* op_name = Token::Name(op_);
752
789
  const char* overwrite_name;
753
790
  switch (mode_) {
@@ -756,13 +793,10 @@ const char* BinaryOpStub::GetName() {
756
793
  case OVERWRITE_LEFT: overwrite_name = "OverwriteLeft"; break;
757
794
  default: overwrite_name = "UnknownOverwrite"; break;
758
795
  }
759
-
760
- OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
761
- "BinaryOpStub_%s_%s_%s",
762
- op_name,
763
- overwrite_name,
764
- BinaryOpIC::GetName(operands_type_));
765
- return name_;
796
+ stream->Add("BinaryOpStub_%s_%s_%s",
797
+ op_name,
798
+ overwrite_name,
799
+ BinaryOpIC::GetName(operands_type_));
766
800
  }
767
801
 
768
802
 
@@ -1959,49 +1993,288 @@ void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
1959
1993
  }
1960
1994
 
1961
1995
 
1962
- void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
1996
+ void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) {
1997
+ // Stack layout:
1998
+ // rsp[0] : return address
1999
+ // rsp[8] : number of parameters (tagged)
2000
+ // rsp[16] : receiver displacement
2001
+ // rsp[24] : function
2002
+ // Registers used over the whole function:
2003
+ // rbx: the mapped parameter count (untagged)
2004
+ // rax: the allocated object (tagged).
2005
+
2006
+ Factory* factory = masm->isolate()->factory();
2007
+
2008
+ __ SmiToInteger64(rbx, Operand(rsp, 1 * kPointerSize));
2009
+ // rbx = parameter count (untagged)
2010
+
2011
+ // Check if the calling frame is an arguments adaptor frame.
2012
+ Label runtime;
2013
+ Label adaptor_frame, try_allocate;
2014
+ __ movq(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
2015
+ __ movq(rcx, Operand(rdx, StandardFrameConstants::kContextOffset));
2016
+ __ Cmp(rcx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
2017
+ __ j(equal, &adaptor_frame);
2018
+
2019
+ // No adaptor, parameter count = argument count.
2020
+ __ movq(rcx, rbx);
2021
+ __ jmp(&try_allocate, Label::kNear);
2022
+
2023
+ // We have an adaptor frame. Patch the parameters pointer.
2024
+ __ bind(&adaptor_frame);
2025
+ __ SmiToInteger64(rcx,
2026
+ Operand(rdx,
2027
+ ArgumentsAdaptorFrameConstants::kLengthOffset));
2028
+ __ lea(rdx, Operand(rdx, rcx, times_pointer_size,
2029
+ StandardFrameConstants::kCallerSPOffset));
2030
+ __ movq(Operand(rsp, 2 * kPointerSize), rdx);
2031
+
2032
+ // rbx = parameter count (untagged)
2033
+ // rcx = argument count (untagged)
2034
+ // Compute the mapped parameter count = min(rbx, rcx) in rbx.
2035
+ __ cmpq(rbx, rcx);
2036
+ __ j(less_equal, &try_allocate, Label::kNear);
2037
+ __ movq(rbx, rcx);
2038
+
2039
+ __ bind(&try_allocate);
2040
+
2041
+ // Compute the sizes of backing store, parameter map, and arguments object.
2042
+ // 1. Parameter map, has 2 extra words containing context and backing store.
2043
+ const int kParameterMapHeaderSize =
2044
+ FixedArray::kHeaderSize + 2 * kPointerSize;
2045
+ Label no_parameter_map;
2046
+ __ testq(rbx, rbx);
2047
+ __ j(zero, &no_parameter_map, Label::kNear);
2048
+ __ lea(r8, Operand(rbx, times_pointer_size, kParameterMapHeaderSize));
2049
+ __ bind(&no_parameter_map);
2050
+
2051
+ // 2. Backing store.
2052
+ __ lea(r8, Operand(r8, rcx, times_pointer_size, FixedArray::kHeaderSize));
2053
+
2054
+ // 3. Arguments object.
2055
+ __ addq(r8, Immediate(Heap::kArgumentsObjectSize));
2056
+
2057
+ // Do the allocation of all three objects in one go.
2058
+ __ AllocateInNewSpace(r8, rax, rdx, rdi, &runtime, TAG_OBJECT);
2059
+
2060
+ // rax = address of new object(s) (tagged)
2061
+ // rcx = argument count (untagged)
2062
+ // Get the arguments boilerplate from the current (global) context into rdi.
2063
+ Label has_mapped_parameters, copy;
2064
+ __ movq(rdi, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
2065
+ __ movq(rdi, FieldOperand(rdi, GlobalObject::kGlobalContextOffset));
2066
+ __ testq(rbx, rbx);
2067
+ __ j(not_zero, &has_mapped_parameters, Label::kNear);
2068
+
2069
+ const int kIndex = Context::ARGUMENTS_BOILERPLATE_INDEX;
2070
+ __ movq(rdi, Operand(rdi, Context::SlotOffset(kIndex)));
2071
+ __ jmp(&copy, Label::kNear);
2072
+
2073
+ const int kAliasedIndex = Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX;
2074
+ __ bind(&has_mapped_parameters);
2075
+ __ movq(rdi, Operand(rdi, Context::SlotOffset(kAliasedIndex)));
2076
+ __ bind(&copy);
2077
+
2078
+ // rax = address of new object (tagged)
2079
+ // rbx = mapped parameter count (untagged)
2080
+ // rcx = argument count (untagged)
2081
+ // rdi = address of boilerplate object (tagged)
2082
+ // Copy the JS object part.
2083
+ for (int i = 0; i < JSObject::kHeaderSize; i += kPointerSize) {
2084
+ __ movq(rdx, FieldOperand(rdi, i));
2085
+ __ movq(FieldOperand(rax, i), rdx);
2086
+ }
2087
+
2088
+ // Setup the callee in-object property.
2089
+ STATIC_ASSERT(Heap::kArgumentsCalleeIndex == 1);
2090
+ __ movq(rdx, Operand(rsp, 3 * kPointerSize));
2091
+ __ movq(FieldOperand(rax, JSObject::kHeaderSize +
2092
+ Heap::kArgumentsCalleeIndex * kPointerSize),
2093
+ rdx);
2094
+
2095
+ // Use the length (smi tagged) and set that as an in-object property too.
2096
+ // Note: rcx is tagged from here on.
2097
+ STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0);
2098
+ __ Integer32ToSmi(rcx, rcx);
2099
+ __ movq(FieldOperand(rax, JSObject::kHeaderSize +
2100
+ Heap::kArgumentsLengthIndex * kPointerSize),
2101
+ rcx);
2102
+
2103
+ // Setup the elements pointer in the allocated arguments object.
2104
+ // If we allocated a parameter map, edi will point there, otherwise to the
2105
+ // backing store.
2106
+ __ lea(rdi, Operand(rax, Heap::kArgumentsObjectSize));
2107
+ __ movq(FieldOperand(rax, JSObject::kElementsOffset), rdi);
2108
+
2109
+ // rax = address of new object (tagged)
2110
+ // rbx = mapped parameter count (untagged)
2111
+ // rcx = argument count (tagged)
2112
+ // rdi = address of parameter map or backing store (tagged)
2113
+
2114
+ // Initialize parameter map. If there are no mapped arguments, we're done.
2115
+ Label skip_parameter_map;
2116
+ __ testq(rbx, rbx);
2117
+ __ j(zero, &skip_parameter_map);
2118
+
2119
+ __ LoadRoot(kScratchRegister, Heap::kNonStrictArgumentsElementsMapRootIndex);
2120
+ // rbx contains the untagged argument count. Add 2 and tag to write.
2121
+ __ movq(FieldOperand(rdi, FixedArray::kMapOffset), kScratchRegister);
2122
+ __ Integer64PlusConstantToSmi(r9, rbx, 2);
2123
+ __ movq(FieldOperand(rdi, FixedArray::kLengthOffset), r9);
2124
+ __ movq(FieldOperand(rdi, FixedArray::kHeaderSize + 0 * kPointerSize), rsi);
2125
+ __ lea(r9, Operand(rdi, rbx, times_pointer_size, kParameterMapHeaderSize));
2126
+ __ movq(FieldOperand(rdi, FixedArray::kHeaderSize + 1 * kPointerSize), r9);
2127
+
2128
+ // Copy the parameter slots and the holes in the arguments.
2129
+ // We need to fill in mapped_parameter_count slots. They index the context,
2130
+ // where parameters are stored in reverse order, at
2131
+ // MIN_CONTEXT_SLOTS .. MIN_CONTEXT_SLOTS+parameter_count-1
2132
+ // The mapped parameter thus need to get indices
2133
+ // MIN_CONTEXT_SLOTS+parameter_count-1 ..
2134
+ // MIN_CONTEXT_SLOTS+parameter_count-mapped_parameter_count
2135
+ // We loop from right to left.
2136
+ Label parameters_loop, parameters_test;
2137
+
2138
+ // Load tagged parameter count into r9.
2139
+ __ movq(r9, Operand(rsp, 1 * kPointerSize));
2140
+ __ Move(r8, Smi::FromInt(Context::MIN_CONTEXT_SLOTS));
2141
+ __ addq(r8, Operand(rsp, 3 * kPointerSize));
2142
+ __ subq(r8, r9);
2143
+ __ Move(r11, factory->the_hole_value());
2144
+ __ movq(rdx, rdi);
2145
+ __ SmiToInteger64(kScratchRegister, r9);
2146
+ __ lea(rdi, Operand(rdi, kScratchRegister,
2147
+ times_pointer_size,
2148
+ kParameterMapHeaderSize));
2149
+ // r9 = loop variable (tagged)
2150
+ // r8 = mapping index (tagged)
2151
+ // r11 = the hole value
2152
+ // rdx = address of parameter map (tagged)
2153
+ // rdi = address of backing store (tagged)
2154
+ __ jmp(&parameters_test, Label::kNear);
2155
+
2156
+ __ bind(&parameters_loop);
2157
+ __ SmiSubConstant(r9, r9, Smi::FromInt(1));
2158
+ __ SmiToInteger64(kScratchRegister, r9);
2159
+ __ movq(FieldOperand(rdx, kScratchRegister,
2160
+ times_pointer_size,
2161
+ kParameterMapHeaderSize),
2162
+ r8);
2163
+ __ movq(FieldOperand(rdi, kScratchRegister,
2164
+ times_pointer_size,
2165
+ FixedArray::kHeaderSize),
2166
+ r11);
2167
+ __ SmiAddConstant(r8, r8, Smi::FromInt(1));
2168
+ __ bind(&parameters_test);
2169
+ __ SmiTest(r9);
2170
+ __ j(not_zero, &parameters_loop, Label::kNear);
2171
+
2172
+ __ bind(&skip_parameter_map);
2173
+
2174
+ // rcx = argument count (tagged)
2175
+ // rdi = address of backing store (tagged)
2176
+ // Copy arguments header and remaining slots (if there are any).
2177
+ __ Move(FieldOperand(rdi, FixedArray::kMapOffset),
2178
+ factory->fixed_array_map());
2179
+ __ movq(FieldOperand(rdi, FixedArray::kLengthOffset), rcx);
2180
+
2181
+ Label arguments_loop, arguments_test;
2182
+ __ movq(r8, rbx);
2183
+ __ movq(rdx, Operand(rsp, 2 * kPointerSize));
2184
+ // Untag rcx and r8 for the loop below.
2185
+ __ SmiToInteger64(rcx, rcx);
2186
+ __ SmiToInteger64(r8, r8);
2187
+ __ lea(kScratchRegister, Operand(r8, times_pointer_size, 0));
2188
+ __ subq(rdx, kScratchRegister);
2189
+ __ jmp(&arguments_test, Label::kNear);
2190
+
2191
+ __ bind(&arguments_loop);
2192
+ __ subq(rdx, Immediate(kPointerSize));
2193
+ __ movq(r9, Operand(rdx, 0));
2194
+ __ movq(FieldOperand(rdi, r8,
2195
+ times_pointer_size,
2196
+ FixedArray::kHeaderSize),
2197
+ r9);
2198
+ __ addq(r8, Immediate(1));
2199
+
2200
+ __ bind(&arguments_test);
2201
+ __ cmpq(r8, rcx);
2202
+ __ j(less, &arguments_loop, Label::kNear);
2203
+
2204
+ // Return and remove the on-stack parameters.
2205
+ __ ret(3 * kPointerSize);
2206
+
2207
+ // Do the runtime call to allocate the arguments object.
2208
+ // rcx = argument count (untagged)
2209
+ __ bind(&runtime);
2210
+ __ Integer32ToSmi(rcx, rcx);
2211
+ __ movq(Operand(rsp, 1 * kPointerSize), rcx); // Patch argument count.
2212
+ __ TailCallRuntime(Runtime::kNewStrictArgumentsFast, 3, 1);
2213
+ }
2214
+
2215
+
2216
+ void ArgumentsAccessStub::GenerateNewNonStrictSlow(MacroAssembler* masm) {
2217
+ // esp[0] : return address
2218
+ // esp[8] : number of parameters
2219
+ // esp[16] : receiver displacement
2220
+ // esp[24] : function
2221
+
2222
+ // Check if the calling frame is an arguments adaptor frame.
2223
+ Label runtime;
2224
+ __ movq(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
2225
+ __ movq(rcx, Operand(rdx, StandardFrameConstants::kContextOffset));
2226
+ __ Cmp(rcx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
2227
+ __ j(not_equal, &runtime);
2228
+
2229
+ // Patch the arguments.length and the parameters pointer.
2230
+ __ movq(rcx, Operand(rdx, ArgumentsAdaptorFrameConstants::kLengthOffset));
2231
+ __ movq(Operand(rsp, 1 * kPointerSize), rcx);
2232
+ __ SmiToInteger64(rcx, rcx);
2233
+ __ lea(rdx, Operand(rdx, rcx, times_pointer_size,
2234
+ StandardFrameConstants::kCallerSPOffset));
2235
+ __ movq(Operand(rsp, 2 * kPointerSize), rdx);
2236
+
2237
+ __ bind(&runtime);
2238
+ __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1);
2239
+ }
2240
+
2241
+
2242
+ void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) {
1963
2243
  // rsp[0] : return address
1964
2244
  // rsp[8] : number of parameters
1965
2245
  // rsp[16] : receiver displacement
1966
2246
  // rsp[24] : function
1967
2247
 
1968
- // The displacement is used for skipping the return address and the
1969
- // frame pointer on the stack. It is the offset of the last
1970
- // parameter (if any) relative to the frame pointer.
1971
- static const int kDisplacement = 2 * kPointerSize;
1972
-
1973
2248
  // Check if the calling frame is an arguments adaptor frame.
1974
2249
  Label adaptor_frame, try_allocate, runtime;
1975
2250
  __ movq(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
1976
- __ Cmp(Operand(rdx, StandardFrameConstants::kContextOffset),
1977
- Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
2251
+ __ movq(rcx, Operand(rdx, StandardFrameConstants::kContextOffset));
2252
+ __ Cmp(rcx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
1978
2253
  __ j(equal, &adaptor_frame);
1979
2254
 
1980
2255
  // Get the length from the frame.
1981
- __ SmiToInteger32(rcx, Operand(rsp, 1 * kPointerSize));
2256
+ __ movq(rcx, Operand(rsp, 1 * kPointerSize));
2257
+ __ SmiToInteger64(rcx, rcx);
1982
2258
  __ jmp(&try_allocate);
1983
2259
 
1984
2260
  // Patch the arguments.length and the parameters pointer.
1985
2261
  __ bind(&adaptor_frame);
1986
- __ SmiToInteger32(rcx,
1987
- Operand(rdx,
1988
- ArgumentsAdaptorFrameConstants::kLengthOffset));
1989
- // Space on stack must already hold a smi.
1990
- __ Integer32ToSmiField(Operand(rsp, 1 * kPointerSize), rcx);
1991
- // Do not clobber the length index for the indexing operation since
1992
- // it is used compute the size for allocation later.
1993
- __ lea(rdx, Operand(rdx, rcx, times_pointer_size, kDisplacement));
2262
+ __ movq(rcx, Operand(rdx, ArgumentsAdaptorFrameConstants::kLengthOffset));
2263
+ __ movq(Operand(rsp, 1 * kPointerSize), rcx);
2264
+ __ SmiToInteger64(rcx, rcx);
2265
+ __ lea(rdx, Operand(rdx, rcx, times_pointer_size,
2266
+ StandardFrameConstants::kCallerSPOffset));
1994
2267
  __ movq(Operand(rsp, 2 * kPointerSize), rdx);
1995
2268
 
1996
2269
  // Try the new space allocation. Start out with computing the size of
1997
2270
  // the arguments object and the elements array.
1998
2271
  Label add_arguments_object;
1999
2272
  __ bind(&try_allocate);
2000
- __ testl(rcx, rcx);
2001
- __ j(zero, &add_arguments_object);
2002
- __ leal(rcx, Operand(rcx, times_pointer_size, FixedArray::kHeaderSize));
2273
+ __ testq(rcx, rcx);
2274
+ __ j(zero, &add_arguments_object, Label::kNear);
2275
+ __ lea(rcx, Operand(rcx, times_pointer_size, FixedArray::kHeaderSize));
2003
2276
  __ bind(&add_arguments_object);
2004
- __ addl(rcx, Immediate(GetArgumentsObjectSize()));
2277
+ __ addq(rcx, Immediate(Heap::kArgumentsObjectSizeStrict));
2005
2278
 
2006
2279
  // Do the allocation of both objects in one go.
2007
2280
  __ AllocateInNewSpace(rcx, rax, rdx, rbx, &runtime, TAG_OBJECT);
@@ -2009,59 +2282,51 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
2009
2282
  // Get the arguments boilerplate from the current (global) context.
2010
2283
  __ movq(rdi, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
2011
2284
  __ movq(rdi, FieldOperand(rdi, GlobalObject::kGlobalContextOffset));
2012
- __ movq(rdi, Operand(rdi,
2013
- Context::SlotOffset(GetArgumentsBoilerplateIndex())));
2285
+ const int offset =
2286
+ Context::SlotOffset(Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX);
2287
+ __ movq(rdi, Operand(rdi, offset));
2014
2288
 
2015
2289
  // Copy the JS object part.
2016
- STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize);
2017
- __ movq(kScratchRegister, FieldOperand(rdi, 0 * kPointerSize));
2018
- __ movq(rdx, FieldOperand(rdi, 1 * kPointerSize));
2019
- __ movq(rbx, FieldOperand(rdi, 2 * kPointerSize));
2020
- __ movq(FieldOperand(rax, 0 * kPointerSize), kScratchRegister);
2021
- __ movq(FieldOperand(rax, 1 * kPointerSize), rdx);
2022
- __ movq(FieldOperand(rax, 2 * kPointerSize), rbx);
2023
-
2024
- if (type_ == NEW_NON_STRICT) {
2025
- // Setup the callee in-object property.
2026
- ASSERT(Heap::kArgumentsCalleeIndex == 1);
2027
- __ movq(kScratchRegister, Operand(rsp, 3 * kPointerSize));
2028
- __ movq(FieldOperand(rax, JSObject::kHeaderSize +
2029
- Heap::kArgumentsCalleeIndex * kPointerSize),
2030
- kScratchRegister);
2290
+ for (int i = 0; i < JSObject::kHeaderSize; i += kPointerSize) {
2291
+ __ movq(rbx, FieldOperand(rdi, i));
2292
+ __ movq(FieldOperand(rax, i), rbx);
2031
2293
  }
2032
2294
 
2033
2295
  // Get the length (smi tagged) and set that as an in-object property too.
2034
- ASSERT(Heap::kArgumentsLengthIndex == 0);
2296
+ STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0);
2035
2297
  __ movq(rcx, Operand(rsp, 1 * kPointerSize));
2036
2298
  __ movq(FieldOperand(rax, JSObject::kHeaderSize +
2037
- Heap::kArgumentsLengthIndex * kPointerSize),
2299
+ Heap::kArgumentsLengthIndex * kPointerSize),
2038
2300
  rcx);
2039
2301
 
2040
2302
  // If there are no actual arguments, we're done.
2041
2303
  Label done;
2042
- __ SmiTest(rcx);
2304
+ __ testq(rcx, rcx);
2043
2305
  __ j(zero, &done);
2044
2306
 
2045
- // Get the parameters pointer from the stack and untag the length.
2307
+ // Get the parameters pointer from the stack.
2046
2308
  __ movq(rdx, Operand(rsp, 2 * kPointerSize));
2047
2309
 
2048
2310
  // Setup the elements pointer in the allocated arguments object and
2049
2311
  // initialize the header in the elements fixed array.
2050
- __ lea(rdi, Operand(rax, GetArgumentsObjectSize()));
2312
+ __ lea(rdi, Operand(rax, Heap::kArgumentsObjectSizeStrict));
2051
2313
  __ movq(FieldOperand(rax, JSObject::kElementsOffset), rdi);
2052
2314
  __ LoadRoot(kScratchRegister, Heap::kFixedArrayMapRootIndex);
2053
2315
  __ movq(FieldOperand(rdi, FixedArray::kMapOffset), kScratchRegister);
2316
+
2317
+
2054
2318
  __ movq(FieldOperand(rdi, FixedArray::kLengthOffset), rcx);
2055
- __ SmiToInteger32(rcx, rcx); // Untag length for the loop below.
2319
+ // Untag the length for the loop below.
2320
+ __ SmiToInteger64(rcx, rcx);
2056
2321
 
2057
2322
  // Copy the fixed array slots.
2058
2323
  Label loop;
2059
2324
  __ bind(&loop);
2060
- __ movq(kScratchRegister, Operand(rdx, -1 * kPointerSize)); // Skip receiver.
2061
- __ movq(FieldOperand(rdi, FixedArray::kHeaderSize), kScratchRegister);
2325
+ __ movq(rbx, Operand(rdx, -1 * kPointerSize)); // Skip receiver.
2326
+ __ movq(FieldOperand(rdi, FixedArray::kHeaderSize), rbx);
2062
2327
  __ addq(rdi, Immediate(kPointerSize));
2063
2328
  __ subq(rdx, Immediate(kPointerSize));
2064
- __ decl(rcx);
2329
+ __ decq(rcx);
2065
2330
  __ j(not_zero, &loop);
2066
2331
 
2067
2332
  // Return and remove the on-stack parameters.
@@ -2070,7 +2335,7 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
2070
2335
 
2071
2336
  // Do the runtime call to allocate the arguments object.
2072
2337
  __ bind(&runtime);
2073
- __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1);
2338
+ __ TailCallRuntime(Runtime::kNewStrictArgumentsFast, 3, 1);
2074
2339
  }
2075
2340
 
2076
2341
 
@@ -2109,7 +2374,6 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
2109
2374
  __ testq(kScratchRegister, kScratchRegister);
2110
2375
  __ j(zero, &runtime);
2111
2376
 
2112
-
2113
2377
  // Check that the first argument is a JSRegExp object.
2114
2378
  __ movq(rax, Operand(rsp, kJSRegExpOffset));
2115
2379
  __ JumpIfSmi(rax, &runtime);
@@ -2180,10 +2444,14 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
2180
2444
  __ cmpl(rdx, rdi);
2181
2445
  __ j(greater, &runtime);
2182
2446
 
2447
+ // Reset offset for possibly sliced string.
2448
+ __ Set(r14, 0);
2183
2449
  // rax: RegExp data (FixedArray)
2184
2450
  // Check the representation and encoding of the subject string.
2185
2451
  Label seq_ascii_string, seq_two_byte_string, check_code;
2186
2452
  __ movq(rdi, Operand(rsp, kSubjectOffset));
2453
+ // Make a copy of the original subject string.
2454
+ __ movq(r15, rdi);
2187
2455
  __ movq(rbx, FieldOperand(rdi, HeapObject::kMapOffset));
2188
2456
  __ movzxbl(rbx, FieldOperand(rbx, Map::kInstanceTypeOffset));
2189
2457
  // First check for flat two byte string.
@@ -2192,28 +2460,40 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
2192
2460
  STATIC_ASSERT((kStringTag | kSeqStringTag | kTwoByteStringTag) == 0);
2193
2461
  __ j(zero, &seq_two_byte_string, Label::kNear);
2194
2462
  // Any other flat string must be a flat ascii string.
2195
- __ testb(rbx, Immediate(kIsNotStringMask | kStringRepresentationMask));
2463
+ __ andb(rbx, Immediate(kIsNotStringMask | kStringRepresentationMask));
2196
2464
  __ j(zero, &seq_ascii_string, Label::kNear);
2197
2465
 
2198
- // Check for flat cons string.
2466
+ // Check for flat cons string or sliced string.
2199
2467
  // A flat cons string is a cons string where the second part is the empty
2200
2468
  // string. In that case the subject string is just the first part of the cons
2201
2469
  // string. Also in this case the first part of the cons string is known to be
2202
2470
  // a sequential string or an external string.
2203
- STATIC_ASSERT(kExternalStringTag !=0);
2204
- STATIC_ASSERT((kConsStringTag & kExternalStringTag) == 0);
2205
- __ testb(rbx, Immediate(kIsNotStringMask | kExternalStringTag));
2206
- __ j(not_zero, &runtime);
2207
- // String is a cons string.
2471
+ // In the case of a sliced string its offset has to be taken into account.
2472
+ Label cons_string, check_encoding;
2473
+ STATIC_ASSERT(kConsStringTag < kExternalStringTag);
2474
+ STATIC_ASSERT(kSlicedStringTag > kExternalStringTag);
2475
+ __ cmpq(rbx, Immediate(kExternalStringTag));
2476
+ __ j(less, &cons_string, Label::kNear);
2477
+ __ j(equal, &runtime);
2478
+
2479
+ // String is sliced.
2480
+ __ SmiToInteger32(r14, FieldOperand(rdi, SlicedString::kOffsetOffset));
2481
+ __ movq(rdi, FieldOperand(rdi, SlicedString::kParentOffset));
2482
+ // r14: slice offset
2483
+ // r15: original subject string
2484
+ // rdi: parent string
2485
+ __ jmp(&check_encoding, Label::kNear);
2486
+ // String is a cons string, check whether it is flat.
2487
+ __ bind(&cons_string);
2208
2488
  __ CompareRoot(FieldOperand(rdi, ConsString::kSecondOffset),
2209
2489
  Heap::kEmptyStringRootIndex);
2210
2490
  __ j(not_equal, &runtime);
2211
2491
  __ movq(rdi, FieldOperand(rdi, ConsString::kFirstOffset));
2492
+ // rdi: first part of cons string or parent of sliced string.
2493
+ // rbx: map of first part of cons string or map of parent of sliced string.
2494
+ // Is first part of cons or parent of slice a flat two byte string?
2495
+ __ bind(&check_encoding);
2212
2496
  __ movq(rbx, FieldOperand(rdi, HeapObject::kMapOffset));
2213
- // String is a cons string with empty second part.
2214
- // rdi: first part of cons string.
2215
- // rbx: map of first part of cons string.
2216
- // Is first part a flat two byte string?
2217
2497
  __ testb(FieldOperand(rbx, Map::kInstanceTypeOffset),
2218
2498
  Immediate(kStringRepresentationMask | kStringEncodingMask));
2219
2499
  STATIC_ASSERT((kSeqStringTag | kTwoByteStringTag) == 0);
@@ -2239,9 +2519,8 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
2239
2519
  __ bind(&check_code);
2240
2520
  // Check that the irregexp code has been generated for the actual string
2241
2521
  // encoding. If it has, the field contains a code object otherwise it contains
2242
- // the hole.
2243
- __ CmpObjectType(r11, CODE_TYPE, kScratchRegister);
2244
- __ j(not_equal, &runtime);
2522
+ // smi (code flushing support)
2523
+ __ JumpIfSmi(r11, &runtime);
2245
2524
 
2246
2525
  // rdi: subject string
2247
2526
  // rcx: encoding of subject string (1 if ascii, 0 if two_byte);
@@ -2311,32 +2590,40 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
2311
2590
  // rbx: previous index
2312
2591
  // rcx: encoding of subject string (1 if ascii 0 if two_byte);
2313
2592
  // r11: code
2593
+ // r14: slice offset
2594
+ // r15: original subject string
2595
+
2596
+ // Argument 2: Previous index.
2597
+ __ movq(arg2, rbx);
2314
2598
 
2315
2599
  // Argument 4: End of string data
2316
2600
  // Argument 3: Start of string data
2317
- Label setup_two_byte, setup_rest;
2601
+ Label setup_two_byte, setup_rest, got_length, length_not_from_slice;
2602
+ // Prepare start and end index of the input.
2603
+ // Load the length from the original sliced string if that is the case.
2604
+ __ addq(rbx, r14);
2605
+ __ SmiToInteger32(arg3, FieldOperand(r15, String::kLengthOffset));
2606
+ __ addq(r14, arg3); // Using arg3 as scratch.
2607
+
2608
+ // rbx: start index of the input
2609
+ // r14: end index of the input
2610
+ // r15: original subject string
2318
2611
  __ testb(rcx, rcx); // Last use of rcx as encoding of subject string.
2319
2612
  __ j(zero, &setup_two_byte, Label::kNear);
2320
- __ SmiToInteger32(rcx, FieldOperand(rdi, String::kLengthOffset));
2321
- __ lea(arg4, FieldOperand(rdi, rcx, times_1, SeqAsciiString::kHeaderSize));
2613
+ __ lea(arg4, FieldOperand(rdi, r14, times_1, SeqAsciiString::kHeaderSize));
2322
2614
  __ lea(arg3, FieldOperand(rdi, rbx, times_1, SeqAsciiString::kHeaderSize));
2323
2615
  __ jmp(&setup_rest, Label::kNear);
2324
2616
  __ bind(&setup_two_byte);
2325
- __ SmiToInteger32(rcx, FieldOperand(rdi, String::kLengthOffset));
2326
- __ lea(arg4, FieldOperand(rdi, rcx, times_2, SeqTwoByteString::kHeaderSize));
2617
+ __ lea(arg4, FieldOperand(rdi, r14, times_2, SeqTwoByteString::kHeaderSize));
2327
2618
  __ lea(arg3, FieldOperand(rdi, rbx, times_2, SeqTwoByteString::kHeaderSize));
2328
-
2329
2619
  __ bind(&setup_rest);
2330
- // Argument 2: Previous index.
2331
- __ movq(arg2, rbx);
2332
2620
 
2333
- // Argument 1: Subject string.
2334
- #ifdef _WIN64
2335
- __ movq(arg1, rdi);
2336
- #else
2337
- // Already there in AMD64 calling convention.
2338
- ASSERT(arg1.is(rdi));
2339
- #endif
2621
+ // Argument 1: Original subject string.
2622
+ // The original subject is in the previous stack frame. Therefore we have to
2623
+ // use rbp, which points exactly to one pointer size below the previous rsp.
2624
+ // (Because creating a new stack frame pushes the previous rbp onto the stack
2625
+ // and thereby moves up rsp by one kPointerSize.)
2626
+ __ movq(arg1, r15);
2340
2627
 
2341
2628
  // Locate the code entry and call it.
2342
2629
  __ addq(r11, Immediate(Code::kHeaderSize - kHeapObjectTag));
@@ -2712,8 +2999,8 @@ void CompareStub::Generate(MacroAssembler* masm) {
2712
2999
  factory->heap_number_map());
2713
3000
  __ j(equal, &heap_number, Label::kNear);
2714
3001
  if (cc_ != equal) {
2715
- // Call runtime on identical JSObjects. Otherwise return equal.
2716
- __ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rcx);
3002
+ // Call runtime on identical objects. Otherwise return equal.
3003
+ __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx);
2717
3004
  __ j(above_equal, &not_identical, Label::kNear);
2718
3005
  }
2719
3006
  __ Set(rax, EQUAL);
@@ -2769,9 +3056,9 @@ void CompareStub::Generate(MacroAssembler* masm) {
2769
3056
  // There is no test for undetectability in strict equality.
2770
3057
 
2771
3058
  // If the first object is a JS object, we have done pointer comparison.
2772
- STATIC_ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
3059
+ STATIC_ASSERT(LAST_TYPE == LAST_SPEC_OBJECT_TYPE);
2773
3060
  Label first_non_object;
2774
- __ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rcx);
3061
+ __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx);
2775
3062
  __ j(below, &first_non_object, Label::kNear);
2776
3063
  // Return non-zero (eax (not rax) is not zero)
2777
3064
  Label return_not_equal;
@@ -2784,7 +3071,7 @@ void CompareStub::Generate(MacroAssembler* masm) {
2784
3071
  __ CmpInstanceType(rcx, ODDBALL_TYPE);
2785
3072
  __ j(equal, &return_not_equal);
2786
3073
 
2787
- __ CmpObjectType(rdx, FIRST_JS_OBJECT_TYPE, rcx);
3074
+ __ CmpObjectType(rdx, FIRST_SPEC_OBJECT_TYPE, rcx);
2788
3075
  __ j(above_equal, &return_not_equal);
2789
3076
 
2790
3077
  // Check for oddballs: true, false, null, undefined.
@@ -2880,9 +3167,9 @@ void CompareStub::Generate(MacroAssembler* masm) {
2880
3167
  __ lea(rcx, Operand(rax, rdx, times_1, 0));
2881
3168
  __ testb(rcx, Immediate(kSmiTagMask));
2882
3169
  __ j(not_zero, &not_both_objects, Label::kNear);
2883
- __ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rbx);
3170
+ __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rbx);
2884
3171
  __ j(below, &not_both_objects, Label::kNear);
2885
- __ CmpObjectType(rdx, FIRST_JS_OBJECT_TYPE, rcx);
3172
+ __ CmpObjectType(rdx, FIRST_SPEC_OBJECT_TYPE, rcx);
2886
3173
  __ j(below, &not_both_objects, Label::kNear);
2887
3174
  __ testb(FieldOperand(rbx, Map::kBitFieldOffset),
2888
3175
  Immediate(1 << Map::kIsUndetectable));
@@ -2982,7 +3269,11 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
2982
3269
  Label call_as_function;
2983
3270
  __ CompareRoot(rax, Heap::kTheHoleValueRootIndex);
2984
3271
  __ j(equal, &call_as_function);
2985
- __ InvokeFunction(rdi, actual, JUMP_FUNCTION);
3272
+ __ InvokeFunction(rdi,
3273
+ actual,
3274
+ JUMP_FUNCTION,
3275
+ NullCallWrapper(),
3276
+ CALL_AS_METHOD);
2986
3277
  __ bind(&call_as_function);
2987
3278
  }
2988
3279
  __ InvokeFunction(rdi,
@@ -3001,6 +3292,7 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
3001
3292
  __ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION);
3002
3293
  Handle<Code> adaptor =
3003
3294
  Isolate::Current()->builtins()->ArgumentsAdaptorTrampoline();
3295
+ __ SetCallKind(rcx, CALL_AS_METHOD);
3004
3296
  __ Jump(adaptor, RelocInfo::CODE_TARGET);
3005
3297
  }
3006
3298
 
@@ -3237,9 +3529,7 @@ void CEntryStub::Generate(MacroAssembler* masm) {
3237
3529
 
3238
3530
  void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
3239
3531
  Label invoke, exit;
3240
- #ifdef ENABLE_LOGGING_AND_PROFILING
3241
3532
  Label not_outermost_js, not_outermost_js_2;
3242
- #endif
3243
3533
  { // NOLINT. Scope block confuses linter.
3244
3534
  MacroAssembler::NoRootArrayScope uninitialized_root_register(masm);
3245
3535
  // Setup frame.
@@ -3284,7 +3574,6 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
3284
3574
  __ push(c_entry_fp_operand);
3285
3575
  }
3286
3576
 
3287
- #ifdef ENABLE_LOGGING_AND_PROFILING
3288
3577
  // If this is the outermost JS call, set js_entry_sp value.
3289
3578
  ExternalReference js_entry_sp(Isolate::k_js_entry_sp_address, isolate);
3290
3579
  __ Load(rax, js_entry_sp);
@@ -3298,7 +3587,6 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
3298
3587
  __ bind(&not_outermost_js);
3299
3588
  __ Push(Smi::FromInt(StackFrame::INNER_JSENTRY_FRAME));
3300
3589
  __ bind(&cont);
3301
- #endif
3302
3590
 
3303
3591
  // Call a faked try-block that does the invoke.
3304
3592
  __ call(&invoke);
@@ -3342,7 +3630,6 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
3342
3630
  __ PopTryHandler();
3343
3631
 
3344
3632
  __ bind(&exit);
3345
- #ifdef ENABLE_LOGGING_AND_PROFILING
3346
3633
  // Check if the current stack frame is marked as the outermost JS frame.
3347
3634
  __ pop(rbx);
3348
3635
  __ Cmp(rbx, Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME));
@@ -3350,7 +3637,6 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
3350
3637
  __ movq(kScratchRegister, js_entry_sp);
3351
3638
  __ movq(Operand(kScratchRegister, 0), Immediate(0));
3352
3639
  __ bind(&not_outermost_js_2);
3353
- #endif
3354
3640
 
3355
3641
  // Restore the top frame descriptor from the stack.
3356
3642
  { Operand c_entry_fp_operand = masm->ExternalOperand(c_entry_fp);
@@ -3414,9 +3700,9 @@ void InstanceofStub::Generate(MacroAssembler* masm) {
3414
3700
  __ JumpIfSmi(rax, &slow);
3415
3701
 
3416
3702
  // Check that the left hand is a JS object. Leave its map in rax.
3417
- __ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rax);
3703
+ __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rax);
3418
3704
  __ j(below, &slow);
3419
- __ CmpInstanceType(rax, LAST_JS_OBJECT_TYPE);
3705
+ __ CmpInstanceType(rax, LAST_SPEC_OBJECT_TYPE);
3420
3706
  __ j(above, &slow);
3421
3707
 
3422
3708
  // Get the prototype of the function.
@@ -3441,9 +3727,9 @@ void InstanceofStub::Generate(MacroAssembler* masm) {
3441
3727
 
3442
3728
  // Check that the function prototype is a JS object.
3443
3729
  __ JumpIfSmi(rbx, &slow);
3444
- __ CmpObjectType(rbx, FIRST_JS_OBJECT_TYPE, kScratchRegister);
3730
+ __ CmpObjectType(rbx, FIRST_SPEC_OBJECT_TYPE, kScratchRegister);
3445
3731
  __ j(below, &slow);
3446
- __ CmpInstanceType(kScratchRegister, LAST_JS_OBJECT_TYPE);
3732
+ __ CmpInstanceType(kScratchRegister, LAST_SPEC_OBJECT_TYPE);
3447
3733
  __ j(above, &slow);
3448
3734
 
3449
3735
  // Register mapping:
@@ -3559,15 +3845,8 @@ int CompareStub::MinorKey() {
3559
3845
 
3560
3846
  // Unfortunately you have to run without snapshots to see most of these
3561
3847
  // names in the profile since most compare stubs end up in the snapshot.
3562
- const char* CompareStub::GetName() {
3848
+ void CompareStub::PrintName(StringStream* stream) {
3563
3849
  ASSERT(lhs_.is(no_reg) && rhs_.is(no_reg));
3564
-
3565
- if (name_ != NULL) return name_;
3566
- const int kMaxNameLength = 100;
3567
- name_ = Isolate::Current()->bootstrapper()->AllocateAutoDeletedArray(
3568
- kMaxNameLength);
3569
- if (name_ == NULL) return "OOM";
3570
-
3571
3850
  const char* cc_name;
3572
3851
  switch (cc_) {
3573
3852
  case less: cc_name = "LT"; break;
@@ -3578,35 +3857,12 @@ const char* CompareStub::GetName() {
3578
3857
  case not_equal: cc_name = "NE"; break;
3579
3858
  default: cc_name = "UnknownCondition"; break;
3580
3859
  }
3581
-
3582
- const char* strict_name = "";
3583
- if (strict_ && (cc_ == equal || cc_ == not_equal)) {
3584
- strict_name = "_STRICT";
3585
- }
3586
-
3587
- const char* never_nan_nan_name = "";
3588
- if (never_nan_nan_ && (cc_ == equal || cc_ == not_equal)) {
3589
- never_nan_nan_name = "_NO_NAN";
3590
- }
3591
-
3592
- const char* include_number_compare_name = "";
3593
- if (!include_number_compare_) {
3594
- include_number_compare_name = "_NO_NUMBER";
3595
- }
3596
-
3597
- const char* include_smi_compare_name = "";
3598
- if (!include_smi_compare_) {
3599
- include_smi_compare_name = "_NO_SMI";
3600
- }
3601
-
3602
- OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
3603
- "CompareStub_%s%s%s%s",
3604
- cc_name,
3605
- strict_name,
3606
- never_nan_nan_name,
3607
- include_number_compare_name,
3608
- include_smi_compare_name);
3609
- return name_;
3860
+ bool is_equality = cc_ == equal || cc_ == not_equal;
3861
+ stream->Add("CompareStub_%s", cc_name);
3862
+ if (strict_ && is_equality) stream->Add("_STRICT");
3863
+ if (never_nan_nan_ && is_equality) stream->Add("_NO_NAN");
3864
+ if (!include_number_compare_) stream->Add("_NO_NUMBER");
3865
+ if (!include_smi_compare_) stream->Add("_NO_SMI");
3610
3866
  }
3611
3867
 
3612
3868
 
@@ -3617,6 +3873,7 @@ void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) {
3617
3873
  Label flat_string;
3618
3874
  Label ascii_string;
3619
3875
  Label got_char_code;
3876
+ Label sliced_string;
3620
3877
 
3621
3878
  // If the receiver is a smi trigger the non-string case.
3622
3879
  __ JumpIfSmi(object_, receiver_not_string_);
@@ -3645,25 +3902,39 @@ void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) {
3645
3902
  __ j(zero, &flat_string);
3646
3903
 
3647
3904
  // Handle non-flat strings.
3648
- __ testb(result_, Immediate(kIsConsStringMask));
3649
- __ j(zero, &call_runtime_);
3905
+ __ and_(result_, Immediate(kStringRepresentationMask));
3906
+ STATIC_ASSERT(kConsStringTag < kExternalStringTag);
3907
+ STATIC_ASSERT(kSlicedStringTag > kExternalStringTag);
3908
+ __ cmpb(result_, Immediate(kExternalStringTag));
3909
+ __ j(greater, &sliced_string);
3910
+ __ j(equal, &call_runtime_);
3650
3911
 
3651
3912
  // ConsString.
3652
3913
  // Check whether the right hand side is the empty string (i.e. if
3653
3914
  // this is really a flat string in a cons string). If that is not
3654
3915
  // the case we would rather go to the runtime system now to flatten
3655
3916
  // the string.
3917
+ Label assure_seq_string;
3656
3918
  __ CompareRoot(FieldOperand(object_, ConsString::kSecondOffset),
3657
3919
  Heap::kEmptyStringRootIndex);
3658
3920
  __ j(not_equal, &call_runtime_);
3659
3921
  // Get the first of the two strings and load its instance type.
3660
3922
  __ movq(object_, FieldOperand(object_, ConsString::kFirstOffset));
3923
+ __ jmp(&assure_seq_string, Label::kNear);
3924
+
3925
+ // SlicedString, unpack and add offset.
3926
+ __ bind(&sliced_string);
3927
+ __ addq(scratch_, FieldOperand(object_, SlicedString::kOffsetOffset));
3928
+ __ movq(object_, FieldOperand(object_, SlicedString::kParentOffset));
3929
+
3930
+ __ bind(&assure_seq_string);
3661
3931
  __ movq(result_, FieldOperand(object_, HeapObject::kMapOffset));
3662
3932
  __ movzxbl(result_, FieldOperand(result_, Map::kInstanceTypeOffset));
3663
3933
  // If the first cons component is also non-flat, then go to runtime.
3664
3934
  STATIC_ASSERT(kSeqStringTag == 0);
3665
3935
  __ testb(result_, Immediate(kStringRepresentationMask));
3666
3936
  __ j(not_zero, &call_runtime_);
3937
+ __ jmp(&flat_string);
3667
3938
 
3668
3939
  // Check for 1-byte or 2-byte string.
3669
3940
  __ bind(&flat_string);
@@ -3812,15 +4083,12 @@ void StringAddStub::Generate(MacroAssembler* masm) {
3812
4083
 
3813
4084
  // Make sure that both arguments are strings if not known in advance.
3814
4085
  if (flags_ == NO_STRING_ADD_FLAGS) {
3815
- Condition is_smi;
3816
- is_smi = masm->CheckSmi(rax);
3817
- __ j(is_smi, &string_add_runtime);
4086
+ __ JumpIfSmi(rax, &string_add_runtime);
3818
4087
  __ CmpObjectType(rax, FIRST_NONSTRING_TYPE, r8);
3819
4088
  __ j(above_equal, &string_add_runtime);
3820
4089
 
3821
4090
  // First argument is a a string, test second.
3822
- is_smi = masm->CheckSmi(rdx);
3823
- __ j(is_smi, &string_add_runtime);
4091
+ __ JumpIfSmi(rdx, &string_add_runtime);
3824
4092
  __ CmpObjectType(rdx, FIRST_NONSTRING_TYPE, r9);
3825
4093
  __ j(above_equal, &string_add_runtime);
3826
4094
  } else {
@@ -3977,6 +4245,8 @@ void StringAddStub::Generate(MacroAssembler* masm) {
3977
4245
  __ and_(rcx, Immediate(kStringRepresentationMask));
3978
4246
  __ cmpl(rcx, Immediate(kExternalStringTag));
3979
4247
  __ j(equal, &string_add_runtime);
4248
+ // We cannot encounter sliced strings here since:
4249
+ STATIC_ASSERT(SlicedString::kMinLength >= String::kMinNonFlatLength);
3980
4250
  // Now check if both strings are ascii strings.
3981
4251
  // rax: first string
3982
4252
  // rbx: length of resulting flat string
@@ -4369,6 +4639,9 @@ void StringHelper::GenerateHashGetHash(MacroAssembler* masm,
4369
4639
  void SubStringStub::Generate(MacroAssembler* masm) {
4370
4640
  Label runtime;
4371
4641
 
4642
+ if (FLAG_string_slices) {
4643
+ __ jmp(&runtime);
4644
+ }
4372
4645
  // Stack frame on entry.
4373
4646
  // rsp[0]: return address
4374
4647
  // rsp[8]: to