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
@@ -158,7 +158,7 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
158
158
  __ lw(a3, MemOperand(sp, 0));
159
159
 
160
160
  // Setup the object header.
161
- __ LoadRoot(a2, Heap::kContextMapRootIndex);
161
+ __ LoadRoot(a2, Heap::kFunctionContextMapRootIndex);
162
162
  __ sw(a2, FieldMemOperand(v0, HeapObject::kMapOffset));
163
163
  __ li(a2, Operand(Smi::FromInt(length)));
164
164
  __ sw(a2, FieldMemOperand(v0, FixedArray::kLengthOffset));
@@ -166,11 +166,10 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
166
166
  // Setup the fixed slots.
167
167
  __ li(a1, Operand(Smi::FromInt(0)));
168
168
  __ sw(a3, MemOperand(v0, Context::SlotOffset(Context::CLOSURE_INDEX)));
169
- __ sw(v0, MemOperand(v0, Context::SlotOffset(Context::FCONTEXT_INDEX)));
170
- __ sw(a1, MemOperand(v0, Context::SlotOffset(Context::PREVIOUS_INDEX)));
169
+ __ sw(cp, MemOperand(v0, Context::SlotOffset(Context::PREVIOUS_INDEX)));
171
170
  __ sw(a1, MemOperand(v0, Context::SlotOffset(Context::EXTENSION_INDEX)));
172
171
 
173
- // Copy the global object from the surrounding context.
172
+ // Copy the global object from the previous context.
174
173
  __ lw(a1, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
175
174
  __ sw(a1, MemOperand(v0, Context::SlotOffset(Context::GLOBAL_INDEX)));
176
175
 
@@ -187,7 +186,7 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
187
186
 
188
187
  // Need to collect. Call into runtime system.
189
188
  __ bind(&gc);
190
- __ TailCallRuntime(Runtime::kNewContext, 1, 1);
189
+ __ TailCallRuntime(Runtime::kNewFunctionContext, 1, 1);
191
190
  }
192
191
 
193
192
 
@@ -306,12 +305,6 @@ class ConvertToDoubleStub : public CodeStub {
306
305
  }
307
306
 
308
307
  void Generate(MacroAssembler* masm);
309
-
310
- const char* GetName() { return "ConvertToDoubleStub"; }
311
-
312
- #ifdef DEBUG
313
- void Print() { PrintF("ConvertToDoubleStub\n"); }
314
- #endif
315
308
  };
316
309
 
317
310
 
@@ -397,11 +390,11 @@ void FloatingPointHelper::LoadSmis(MacroAssembler* masm,
397
390
  __ mov(scratch1, a0);
398
391
  ConvertToDoubleStub stub1(a3, a2, scratch1, scratch2);
399
392
  __ push(ra);
400
- __ Call(stub1.GetCode(), RelocInfo::CODE_TARGET);
393
+ __ Call(stub1.GetCode());
401
394
  // Write Smi from a1 to a1 and a0 in double format.
402
395
  __ mov(scratch1, a1);
403
396
  ConvertToDoubleStub stub2(a1, a0, scratch1, scratch2);
404
- __ Call(stub2.GetCode(), RelocInfo::CODE_TARGET);
397
+ __ Call(stub2.GetCode());
405
398
  __ pop(ra);
406
399
  }
407
400
  }
@@ -483,7 +476,7 @@ void FloatingPointHelper::LoadNumber(MacroAssembler* masm,
483
476
  __ mov(scratch1, object);
484
477
  ConvertToDoubleStub stub(dst2, dst1, scratch1, scratch2);
485
478
  __ push(ra);
486
- __ Call(stub.GetCode(), RelocInfo::CODE_TARGET);
479
+ __ Call(stub.GetCode());
487
480
  __ pop(ra);
488
481
  }
489
482
 
@@ -672,9 +665,8 @@ void FloatingPointHelper::LoadNumberAsInt32Double(MacroAssembler* masm,
672
665
  // Restore FCSR.
673
666
  __ ctc1(scratch1, FCSR);
674
667
 
675
- // Check for inexact conversion.
676
- __ srl(scratch2, scratch2, kFCSRFlagShift);
677
- __ And(scratch2, scratch2, (kFCSRFlagMask | kFCSRInexactFlagBit));
668
+ // Check for inexact conversion or exception.
669
+ __ And(scratch2, scratch2, kFCSRFlagMask);
678
670
 
679
671
  // Jump to not_int32 if the operation did not succeed.
680
672
  __ Branch(not_int32, ne, scratch2, Operand(zero_reg));
@@ -757,9 +749,8 @@ void FloatingPointHelper::LoadNumberAsInt32(MacroAssembler* masm,
757
749
  // Restore FCSR.
758
750
  __ ctc1(scratch1, FCSR);
759
751
 
760
- // Check for inexact conversion.
761
- __ srl(scratch2, scratch2, kFCSRFlagShift);
762
- __ And(scratch2, scratch2, (kFCSRFlagMask | kFCSRInexactFlagBit));
752
+ // Check for inexact conversion or exception.
753
+ __ And(scratch2, scratch2, kFCSRFlagMask);
763
754
 
764
755
  // Jump to not_int32 if the operation did not succeed.
765
756
  __ Branch(not_int32, ne, scratch2, Operand(zero_reg));
@@ -985,13 +976,13 @@ static void EmitIdenticalObjectComparison(MacroAssembler* masm,
985
976
  // Smis. If it's not a heap number, then return equal.
986
977
  if (cc == less || cc == greater) {
987
978
  __ GetObjectType(a0, t4, t4);
988
- __ Branch(slow, greater, t4, Operand(FIRST_JS_OBJECT_TYPE));
979
+ __ Branch(slow, greater, t4, Operand(FIRST_SPEC_OBJECT_TYPE));
989
980
  } else {
990
981
  __ GetObjectType(a0, t4, t4);
991
982
  __ Branch(&heap_number, eq, t4, Operand(HEAP_NUMBER_TYPE));
992
983
  // Comparing JS objects with <=, >= is complicated.
993
984
  if (cc != eq) {
994
- __ Branch(slow, greater, t4, Operand(FIRST_JS_OBJECT_TYPE));
985
+ __ Branch(slow, greater, t4, Operand(FIRST_SPEC_OBJECT_TYPE));
995
986
  // Normally here we fall through to return_equal, but undefined is
996
987
  // special: (undefined == undefined) == true, but
997
988
  // (undefined <= undefined) == false! See ECMAScript 11.8.5.
@@ -1110,7 +1101,7 @@ static void EmitSmiNonsmiComparison(MacroAssembler* masm,
1110
1101
  __ mov(t6, rhs);
1111
1102
  ConvertToDoubleStub stub1(a1, a0, t6, t5);
1112
1103
  __ push(ra);
1113
- __ Call(stub1.GetCode(), RelocInfo::CODE_TARGET);
1104
+ __ Call(stub1.GetCode());
1114
1105
 
1115
1106
  __ pop(ra);
1116
1107
  }
@@ -1145,7 +1136,7 @@ static void EmitSmiNonsmiComparison(MacroAssembler* masm,
1145
1136
  __ mov(t6, lhs);
1146
1137
  ConvertToDoubleStub stub2(a3, a2, t6, t5);
1147
1138
  __ push(ra);
1148
- __ Call(stub2.GetCode(), RelocInfo::CODE_TARGET);
1139
+ __ Call(stub2.GetCode());
1149
1140
  __ pop(ra);
1150
1141
  // Load rhs to a double in a1, a0.
1151
1142
  if (rhs.is(a0)) {
@@ -1309,15 +1300,15 @@ static void EmitTwoNonNanDoubleComparison(MacroAssembler* masm, Condition cc) {
1309
1300
  static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm,
1310
1301
  Register lhs,
1311
1302
  Register rhs) {
1312
- // If either operand is a JSObject or an oddball value, then they are
1303
+ // If either operand is a JS object or an oddball value, then they are
1313
1304
  // not equal since their pointers are different.
1314
1305
  // There is no test for undetectability in strict equality.
1315
- STATIC_ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
1306
+ STATIC_ASSERT(LAST_TYPE == LAST_CALLABLE_SPEC_OBJECT_TYPE);
1316
1307
  Label first_non_object;
1317
1308
  // Get the type of the first operand into a2 and compare it with
1318
- // FIRST_JS_OBJECT_TYPE.
1309
+ // FIRST_SPEC_OBJECT_TYPE.
1319
1310
  __ GetObjectType(lhs, a2, a2);
1320
- __ Branch(&first_non_object, less, a2, Operand(FIRST_JS_OBJECT_TYPE));
1311
+ __ Branch(&first_non_object, less, a2, Operand(FIRST_SPEC_OBJECT_TYPE));
1321
1312
 
1322
1313
  // Return non-zero.
1323
1314
  Label return_not_equal;
@@ -1330,7 +1321,7 @@ static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm,
1330
1321
  __ Branch(&return_not_equal, eq, a2, Operand(ODDBALL_TYPE));
1331
1322
 
1332
1323
  __ GetObjectType(rhs, a3, a3);
1333
- __ Branch(&return_not_equal, greater, a3, Operand(FIRST_JS_OBJECT_TYPE));
1324
+ __ Branch(&return_not_equal, greater, a3, Operand(FIRST_SPEC_OBJECT_TYPE));
1334
1325
 
1335
1326
  // Check for oddballs: true, false, null, undefined.
1336
1327
  __ Branch(&return_not_equal, eq, a3, Operand(ODDBALL_TYPE));
@@ -1406,9 +1397,9 @@ static void EmitCheckForSymbolsOrObjects(MacroAssembler* masm,
1406
1397
  __ Ret();
1407
1398
 
1408
1399
  __ bind(&object_test);
1409
- __ Branch(not_both_strings, lt, a2, Operand(FIRST_JS_OBJECT_TYPE));
1400
+ __ Branch(not_both_strings, lt, a2, Operand(FIRST_SPEC_OBJECT_TYPE));
1410
1401
  __ GetObjectType(rhs, a2, a3);
1411
- __ Branch(not_both_strings, lt, a3, Operand(FIRST_JS_OBJECT_TYPE));
1402
+ __ Branch(not_both_strings, lt, a3, Operand(FIRST_SPEC_OBJECT_TYPE));
1412
1403
 
1413
1404
  // If both objects are undetectable, they are equal. Otherwise, they
1414
1405
  // are not equal, since they are different objects and an object is not
@@ -1720,7 +1711,6 @@ void CompareStub::Generate(MacroAssembler* masm) {
1720
1711
  }
1721
1712
 
1722
1713
 
1723
- // This stub does not handle the inlined cases (Smis, Booleans, undefined).
1724
1714
  // The stub returns zero for false, and a non-zero value for true.
1725
1715
  void ToBooleanStub::Generate(MacroAssembler* masm) {
1726
1716
  // This stub uses FPU instructions.
@@ -1784,7 +1774,7 @@ void ToBooleanStub::Generate(MacroAssembler* masm) {
1784
1774
  // "tos_" is a register and contains a non-zero value.
1785
1775
  // Hence we implicitly return true if the greater than
1786
1776
  // condition is satisfied.
1787
- __ Ret(gt, scratch0, Operand(FIRST_JS_OBJECT_TYPE));
1777
+ __ Ret(ge, scratch0, Operand(FIRST_SPEC_OBJECT_TYPE));
1788
1778
 
1789
1779
  // Check for string.
1790
1780
  __ lw(scratch0, FieldMemOperand(tos_, HeapObject::kMapOffset));
@@ -1792,7 +1782,7 @@ void ToBooleanStub::Generate(MacroAssembler* masm) {
1792
1782
  // "tos_" is a register and contains a non-zero value.
1793
1783
  // Hence we implicitly return true if the greater than
1794
1784
  // condition is satisfied.
1795
- __ Ret(gt, scratch0, Operand(FIRST_NONSTRING_TYPE));
1785
+ __ Ret(ge, scratch0, Operand(FIRST_NONSTRING_TYPE));
1796
1786
 
1797
1787
  // String value => false iff empty, i.e., length is zero.
1798
1788
  __ lw(tos_, FieldMemOperand(tos_, String::kLengthOffset));
@@ -1807,31 +1797,17 @@ void ToBooleanStub::Generate(MacroAssembler* masm) {
1807
1797
  }
1808
1798
 
1809
1799
 
1810
- Handle<Code> GetUnaryOpStub(int key, UnaryOpIC::TypeInfo type_info) {
1811
- UnaryOpStub stub(key, type_info);
1812
- return stub.GetCode();
1813
- }
1814
-
1815
-
1816
- const char* UnaryOpStub::GetName() {
1817
- if (name_ != NULL) return name_;
1818
- const int kMaxNameLength = 100;
1819
- name_ = Isolate::Current()->bootstrapper()->AllocateAutoDeletedArray(
1820
- kMaxNameLength);
1821
- if (name_ == NULL) return "OOM";
1800
+ void UnaryOpStub::PrintName(StringStream* stream) {
1822
1801
  const char* op_name = Token::Name(op_);
1823
1802
  const char* overwrite_name = NULL; // Make g++ happy.
1824
1803
  switch (mode_) {
1825
1804
  case UNARY_NO_OVERWRITE: overwrite_name = "Alloc"; break;
1826
1805
  case UNARY_OVERWRITE: overwrite_name = "Overwrite"; break;
1827
1806
  }
1828
-
1829
- OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
1830
- "UnaryOpStub_%s_%s_%s",
1831
- op_name,
1832
- overwrite_name,
1833
- UnaryOpIC::GetName(operand_type_));
1834
- return name_;
1807
+ stream->Add("UnaryOpStub_%s_%s_%s",
1808
+ op_name,
1809
+ overwrite_name,
1810
+ UnaryOpIC::GetName(operand_type_));
1835
1811
  }
1836
1812
 
1837
1813
 
@@ -1856,19 +1832,13 @@ void UnaryOpStub::Generate(MacroAssembler* masm) {
1856
1832
 
1857
1833
  void UnaryOpStub::GenerateTypeTransition(MacroAssembler* masm) {
1858
1834
  // Argument is in a0 and v0 at this point, so we can overwrite a0.
1859
- // Push this stub's key. Although the operation and the type info are
1860
- // encoded into the key, the encoding is opaque, so push them too.
1861
- __ li(a2, Operand(Smi::FromInt(MinorKey())));
1862
- __ li(a1, Operand(Smi::FromInt(op_)));
1835
+ __ li(a2, Operand(Smi::FromInt(op_)));
1836
+ __ li(a1, Operand(Smi::FromInt(mode_)));
1863
1837
  __ li(a0, Operand(Smi::FromInt(operand_type_)));
1864
-
1865
1838
  __ Push(v0, a2, a1, a0);
1866
1839
 
1867
1840
  __ TailCallExternalReference(
1868
- ExternalReference(IC_Utility(IC::kUnaryOp_Patch),
1869
- masm->isolate()),
1870
- 4,
1871
- 1);
1841
+ ExternalReference(IC_Utility(IC::kUnaryOp_Patch), masm->isolate()), 4, 1);
1872
1842
  }
1873
1843
 
1874
1844
 
@@ -1966,6 +1936,7 @@ void UnaryOpStub::GenerateHeapNumberStubBitNot(MacroAssembler* masm) {
1966
1936
  GenerateTypeTransition(masm);
1967
1937
  }
1968
1938
 
1939
+
1969
1940
  void UnaryOpStub::GenerateHeapNumberCodeSub(MacroAssembler* masm,
1970
1941
  Label* slow) {
1971
1942
  EmitCheckForHeapNumber(masm, a0, a1, t2, slow);
@@ -2002,6 +1973,8 @@ void UnaryOpStub::GenerateHeapNumberCodeSub(MacroAssembler* masm,
2002
1973
  void UnaryOpStub::GenerateHeapNumberCodeBitNot(
2003
1974
  MacroAssembler* masm,
2004
1975
  Label* slow) {
1976
+ Label impossible;
1977
+
2005
1978
  EmitCheckForHeapNumber(masm, a0, a1, t2, slow);
2006
1979
  // Convert the heap number in a0 to an untagged integer in a1.
2007
1980
  __ ConvertToInt32(a0, a1, a2, a3, f0, slow);
@@ -2020,17 +1993,28 @@ void UnaryOpStub::GenerateHeapNumberCodeBitNot(
2020
1993
  __ bind(&try_float);
2021
1994
  if (mode_ == UNARY_NO_OVERWRITE) {
2022
1995
  Label slow_allocate_heapnumber, heapnumber_allocated;
2023
- __ AllocateHeapNumber(v0, a2, a3, t2, &slow_allocate_heapnumber);
1996
+ // Allocate a new heap number without zapping v0, which we need if it fails.
1997
+ __ AllocateHeapNumber(a2, a3, t0, t2, &slow_allocate_heapnumber);
2024
1998
  __ jmp(&heapnumber_allocated);
2025
1999
 
2026
2000
  __ bind(&slow_allocate_heapnumber);
2027
2001
  __ EnterInternalFrame();
2028
- __ push(a1);
2002
+ __ push(v0); // Push the heap number, not the untagged int32.
2029
2003
  __ CallRuntime(Runtime::kNumberAlloc, 0);
2030
- __ pop(a1);
2004
+ __ mov(a2, v0); // Move the new heap number into a2.
2005
+ // Get the heap number into v0, now that the new heap number is in a2.
2006
+ __ pop(v0);
2031
2007
  __ LeaveInternalFrame();
2032
2008
 
2009
+ // Convert the heap number in v0 to an untagged integer in a1.
2010
+ // This can't go slow-case because it's the same number we already
2011
+ // converted once again.
2012
+ __ ConvertToInt32(v0, a1, a3, t0, f0, &impossible);
2013
+ // Negate the result.
2014
+ __ Xor(a1, a1, -1);
2015
+
2033
2016
  __ bind(&heapnumber_allocated);
2017
+ __ mov(v0, a2); // Move newly allocated heap number to v0.
2034
2018
  }
2035
2019
 
2036
2020
  if (CpuFeatures::IsSupported(FPU)) {
@@ -2046,6 +2030,11 @@ void UnaryOpStub::GenerateHeapNumberCodeBitNot(
2046
2030
  WriteInt32ToHeapNumberStub stub(a1, v0, a2, a3);
2047
2031
  __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
2048
2032
  }
2033
+
2034
+ __ bind(&impossible);
2035
+ if (FLAG_debug_code) {
2036
+ __ stop("Incorrect assumption in bit-not stub");
2037
+ }
2049
2038
  }
2050
2039
 
2051
2040
 
@@ -2101,14 +2090,6 @@ void UnaryOpStub::GenerateGenericCodeFallback(
2101
2090
  }
2102
2091
 
2103
2092
 
2104
- Handle<Code> GetBinaryOpStub(int key,
2105
- BinaryOpIC::TypeInfo type_info,
2106
- BinaryOpIC::TypeInfo result_type_info) {
2107
- BinaryOpStub stub(key, type_info, result_type_info);
2108
- return stub.GetCode();
2109
- }
2110
-
2111
-
2112
2093
  void BinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) {
2113
2094
  Label get_result;
2114
2095
 
@@ -2165,12 +2146,7 @@ void BinaryOpStub::Generate(MacroAssembler* masm) {
2165
2146
  }
2166
2147
 
2167
2148
 
2168
- const char* BinaryOpStub::GetName() {
2169
- if (name_ != NULL) return name_;
2170
- const int kMaxNameLength = 100;
2171
- name_ = Isolate::Current()->bootstrapper()->AllocateAutoDeletedArray(
2172
- kMaxNameLength);
2173
- if (name_ == NULL) return "OOM";
2149
+ void BinaryOpStub::PrintName(StringStream* stream) {
2174
2150
  const char* op_name = Token::Name(op_);
2175
2151
  const char* overwrite_name;
2176
2152
  switch (mode_) {
@@ -2179,13 +2155,10 @@ const char* BinaryOpStub::GetName() {
2179
2155
  case OVERWRITE_LEFT: overwrite_name = "OverwriteLeft"; break;
2180
2156
  default: overwrite_name = "UnknownOverwrite"; break;
2181
2157
  }
2182
-
2183
- OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
2184
- "BinaryOpStub_%s_%s_%s",
2185
- op_name,
2186
- overwrite_name,
2187
- BinaryOpIC::GetName(operands_type_));
2188
- return name_;
2158
+ stream->Add("BinaryOpStub_%s_%s_%s",
2159
+ op_name,
2160
+ overwrite_name,
2161
+ BinaryOpIC::GetName(operands_type_));
2189
2162
  }
2190
2163
 
2191
2164
 
@@ -2533,7 +2506,7 @@ void BinaryOpStub::GenerateFPOperation(MacroAssembler* masm,
2533
2506
  CpuFeatures::Scope scope(FPU);
2534
2507
  __ mtc1(a2, f0);
2535
2508
  if (op_ == Token::SHR) {
2536
- __ Cvt_d_uw(f0, f0);
2509
+ __ Cvt_d_uw(f0, f0, f22);
2537
2510
  } else {
2538
2511
  __ cvt_d_w(f0, f0);
2539
2512
  }
@@ -2687,37 +2660,36 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
2687
2660
  case Token::MUL:
2688
2661
  case Token::DIV:
2689
2662
  case Token::MOD: {
2690
- // Load both operands and check that they are 32-bit integer.
2691
- // Jump to type transition if they are not. The registers a0 and a1 (right
2692
- // and left) are preserved for the runtime call.
2693
- FloatingPointHelper::Destination destination =
2694
- CpuFeatures::IsSupported(FPU) &&
2695
- op_ != Token::MOD ?
2696
- FloatingPointHelper::kFPURegisters :
2697
- FloatingPointHelper::kCoreRegisters;
2698
-
2699
- FloatingPointHelper::LoadNumberAsInt32Double(masm,
2700
- right,
2701
- destination,
2702
- f14,
2703
- a2,
2704
- a3,
2705
- heap_number_map,
2706
- scratch1,
2707
- scratch2,
2708
- f2,
2709
- &transition);
2710
- FloatingPointHelper::LoadNumberAsInt32Double(masm,
2711
- left,
2712
- destination,
2713
- f12,
2714
- t0,
2715
- t1,
2716
- heap_number_map,
2717
- scratch1,
2718
- scratch2,
2719
- f2,
2720
- &transition);
2663
+ // Load both operands and check that they are 32-bit integer.
2664
+ // Jump to type transition if they are not. The registers a0 and a1 (right
2665
+ // and left) are preserved for the runtime call.
2666
+ FloatingPointHelper::Destination destination =
2667
+ (CpuFeatures::IsSupported(FPU) && op_ != Token::MOD)
2668
+ ? FloatingPointHelper::kFPURegisters
2669
+ : FloatingPointHelper::kCoreRegisters;
2670
+
2671
+ FloatingPointHelper::LoadNumberAsInt32Double(masm,
2672
+ right,
2673
+ destination,
2674
+ f14,
2675
+ a2,
2676
+ a3,
2677
+ heap_number_map,
2678
+ scratch1,
2679
+ scratch2,
2680
+ f2,
2681
+ &transition);
2682
+ FloatingPointHelper::LoadNumberAsInt32Double(masm,
2683
+ left,
2684
+ destination,
2685
+ f12,
2686
+ t0,
2687
+ t1,
2688
+ heap_number_map,
2689
+ scratch1,
2690
+ scratch2,
2691
+ f2,
2692
+ &transition);
2721
2693
 
2722
2694
  if (destination == FloatingPointHelper::kFPURegisters) {
2723
2695
  CpuFeatures::Scope scope(FPU);
@@ -2759,8 +2731,7 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
2759
2731
  // Restore FCSR.
2760
2732
  __ ctc1(scratch1, FCSR);
2761
2733
 
2762
- // Check for inexact conversion.
2763
- __ srl(scratch2, scratch2, kFCSRFlagShift);
2734
+ // Check for inexact conversion or exception.
2764
2735
  __ And(scratch2, scratch2, kFCSRFlagMask);
2765
2736
 
2766
2737
  if (result_type_ <= BinaryOpIC::INT32) {
@@ -2788,9 +2759,11 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
2788
2759
  // DIV just falls through to allocating a heap number.
2789
2760
  }
2790
2761
 
2791
- if (result_type_ >= (op_ == Token::DIV) ? BinaryOpIC::HEAP_NUMBER
2792
- : BinaryOpIC::INT32) {
2793
- __ bind(&return_heap_number);
2762
+ __ bind(&return_heap_number);
2763
+ // Return a heap number, or fall through to type transition or runtime
2764
+ // call if we can't.
2765
+ if (result_type_ >= ((op_ == Token::DIV) ? BinaryOpIC::HEAP_NUMBER
2766
+ : BinaryOpIC::INT32)) {
2794
2767
  // We are using FPU registers so s0 is available.
2795
2768
  heap_number_result = s0;
2796
2769
  GenerateHeapResultAllocation(masm,
@@ -2947,7 +2920,7 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
2947
2920
  } else {
2948
2921
  // The result must be interpreted as an unsigned 32-bit integer.
2949
2922
  __ mtc1(a2, double_scratch);
2950
- __ Cvt_d_uw(double_scratch, double_scratch);
2923
+ __ Cvt_d_uw(double_scratch, double_scratch, single_scratch);
2951
2924
  }
2952
2925
 
2953
2926
  // Store the result.
@@ -2969,7 +2942,11 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
2969
2942
  UNREACHABLE();
2970
2943
  }
2971
2944
 
2972
- if (transition.is_linked()) {
2945
+ // We never expect DIV to yield an integer result, so we always generate
2946
+ // type transition code for DIV operations expecting an integer result: the
2947
+ // code will fall through to this type transition.
2948
+ if (transition.is_linked() ||
2949
+ ((op_ == Token::DIV) && (result_type_ <= BinaryOpIC::INT32))) {
2973
2950
  __ bind(&transition);
2974
2951
  GenerateTypeTransition(masm);
2975
2952
  }
@@ -3541,15 +3518,10 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
3541
3518
 
3542
3519
  __ li(a2, Operand(ExternalReference::isolate_address()));
3543
3520
 
3544
- // From arm version of this function:
3545
- // TODO(1242173): To let the GC traverse the return address of the exit
3546
- // frames, we need to know where the return address is. Right now,
3547
- // we push it on the stack to be able to find it again, but we never
3548
- // restore from it in case of changes, which makes it impossible to
3549
- // support moving the C entry code stub. This should be fixed, but currently
3550
- // this is OK because the CEntryStub gets generated so early in the V8 boot
3551
- // sequence that it is not moving ever.
3552
-
3521
+ // To let the GC traverse the return address of the exit frames, we need to
3522
+ // know where the return address is. The CEntryStub is unmovable, so
3523
+ // we can store the address on the stack to be able to find it again and
3524
+ // we never have to restore it, because it will not change.
3553
3525
  { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm);
3554
3526
  // This branch-and-link sequence is needed to find the current PC on mips,
3555
3527
  // saved to the ra register.
@@ -3721,10 +3693,10 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
3721
3693
  // args
3722
3694
 
3723
3695
  // Save callee saved registers on the stack.
3724
- __ MultiPush((kCalleeSaved | ra.bit()) & ~sp.bit());
3696
+ __ MultiPush(kCalleeSaved | ra.bit());
3725
3697
 
3726
3698
  // Load argv in s0 register.
3727
- __ lw(s0, MemOperand(sp, kNumCalleeSaved * kPointerSize +
3699
+ __ lw(s0, MemOperand(sp, (kNumCalleeSaved + 1) * kPointerSize +
3728
3700
  StandardFrameConstants::kCArgsSlotsSize));
3729
3701
 
3730
3702
  // We build an EntryFrame.
@@ -3755,24 +3727,22 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
3755
3727
  // 4 args slots
3756
3728
  // args
3757
3729
 
3758
- #ifdef ENABLE_LOGGING_AND_PROFILING
3759
- // If this is the outermost JS call, set js_entry_sp value.
3760
- Label non_outermost_js;
3761
- ExternalReference js_entry_sp(Isolate::k_js_entry_sp_address,
3762
- masm->isolate());
3763
- __ li(t1, Operand(ExternalReference(js_entry_sp)));
3764
- __ lw(t2, MemOperand(t1));
3765
- __ Branch(&non_outermost_js, ne, t2, Operand(zero_reg));
3766
- __ sw(fp, MemOperand(t1));
3767
- __ li(t0, Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME)));
3768
- Label cont;
3769
- __ b(&cont);
3770
- __ nop(); // Branch delay slot nop.
3771
- __ bind(&non_outermost_js);
3772
- __ li(t0, Operand(Smi::FromInt(StackFrame::INNER_JSENTRY_FRAME)));
3773
- __ bind(&cont);
3774
- __ push(t0);
3775
- #endif
3730
+ // If this is the outermost JS call, set js_entry_sp value.
3731
+ Label non_outermost_js;
3732
+ ExternalReference js_entry_sp(Isolate::k_js_entry_sp_address,
3733
+ masm->isolate());
3734
+ __ li(t1, Operand(ExternalReference(js_entry_sp)));
3735
+ __ lw(t2, MemOperand(t1));
3736
+ __ Branch(&non_outermost_js, ne, t2, Operand(zero_reg));
3737
+ __ sw(fp, MemOperand(t1));
3738
+ __ li(t0, Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME)));
3739
+ Label cont;
3740
+ __ b(&cont);
3741
+ __ nop(); // Branch delay slot nop.
3742
+ __ bind(&non_outermost_js);
3743
+ __ li(t0, Operand(Smi::FromInt(StackFrame::INNER_JSENTRY_FRAME)));
3744
+ __ bind(&cont);
3745
+ __ push(t0);
3776
3746
 
3777
3747
  // Call a faked try-block that does the invoke.
3778
3748
  __ bal(&invoke); // bal exposes branch delay slot.
@@ -3841,16 +3811,14 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
3841
3811
  __ PopTryHandler();
3842
3812
 
3843
3813
  __ bind(&exit); // v0 holds result
3844
- #ifdef ENABLE_LOGGING_AND_PROFILING
3845
- // Check if the current stack frame is marked as the outermost JS frame.
3846
- Label non_outermost_js_2;
3847
- __ pop(t1);
3848
- __ Branch(&non_outermost_js_2, ne, t1,
3849
- Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME)));
3850
- __ li(t1, Operand(ExternalReference(js_entry_sp)));
3851
- __ sw(zero_reg, MemOperand(t1));
3852
- __ bind(&non_outermost_js_2);
3853
- #endif
3814
+ // Check if the current stack frame is marked as the outermost JS frame.
3815
+ Label non_outermost_js_2;
3816
+ __ pop(t1);
3817
+ __ Branch(&non_outermost_js_2, ne, t1,
3818
+ Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME)));
3819
+ __ li(t1, Operand(ExternalReference(js_entry_sp)));
3820
+ __ sw(zero_reg, MemOperand(t1));
3821
+ __ bind(&non_outermost_js_2);
3854
3822
 
3855
3823
  // Restore the top frame descriptors from the stack.
3856
3824
  __ pop(t1);
@@ -3862,7 +3830,7 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
3862
3830
  __ addiu(sp, sp, -EntryFrameConstants::kCallerFPOffset);
3863
3831
 
3864
3832
  // Restore callee saved registers from the stack.
3865
- __ MultiPop((kCalleeSaved | ra.bit()) & ~sp.bit());
3833
+ __ MultiPop(kCalleeSaved | ra.bit());
3866
3834
  // Return.
3867
3835
  __ Jump(ra);
3868
3836
  }
@@ -4074,11 +4042,252 @@ void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
4074
4042
  }
4075
4043
 
4076
4044
 
4077
- void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
4045
+ void ArgumentsAccessStub::GenerateNewNonStrictSlow(MacroAssembler* masm) {
4078
4046
  // sp[0] : number of parameters
4079
4047
  // sp[4] : receiver displacement
4080
4048
  // sp[8] : function
4049
+ // Check if the calling frame is an arguments adaptor frame.
4050
+ Label runtime;
4051
+ __ lw(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
4052
+ __ lw(a2, MemOperand(a3, StandardFrameConstants::kContextOffset));
4053
+ __ Branch(&runtime, ne,
4054
+ a2, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
4055
+
4056
+ // Patch the arguments.length and the parameters pointer in the current frame.
4057
+ __ lw(a2, MemOperand(a3, ArgumentsAdaptorFrameConstants::kLengthOffset));
4058
+ __ sw(a2, MemOperand(sp, 0 * kPointerSize));
4059
+ __ sll(t3, a2, 1);
4060
+ __ Addu(a3, a3, Operand(t3));
4061
+ __ addiu(a3, a3, StandardFrameConstants::kCallerSPOffset);
4062
+ __ sw(a3, MemOperand(sp, 1 * kPointerSize));
4063
+
4064
+ __ bind(&runtime);
4065
+ __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1);
4066
+ }
4067
+
4068
+
4069
+ void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) {
4070
+ // Stack layout:
4071
+ // sp[0] : number of parameters (tagged)
4072
+ // sp[4] : address of receiver argument
4073
+ // sp[8] : function
4074
+ // Registers used over whole function:
4075
+ // t2 : allocated object (tagged)
4076
+ // t5 : mapped parameter count (tagged)
4077
+
4078
+ __ lw(a1, MemOperand(sp, 0 * kPointerSize));
4079
+ // a1 = parameter count (tagged)
4081
4080
 
4081
+ // Check if the calling frame is an arguments adaptor frame.
4082
+ Label runtime;
4083
+ Label adaptor_frame, try_allocate;
4084
+ __ lw(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
4085
+ __ lw(a2, MemOperand(a3, StandardFrameConstants::kContextOffset));
4086
+ __ Branch(&adaptor_frame, eq, a2,
4087
+ Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
4088
+
4089
+ // No adaptor, parameter count = argument count.
4090
+ __ mov(a2, a1);
4091
+ __ b(&try_allocate);
4092
+ __ nop(); // Branch delay slot nop.
4093
+
4094
+ // We have an adaptor frame. Patch the parameters pointer.
4095
+ __ bind(&adaptor_frame);
4096
+ __ lw(a2, MemOperand(a3, ArgumentsAdaptorFrameConstants::kLengthOffset));
4097
+ __ sll(t6, a2, 1);
4098
+ __ Addu(a3, a3, Operand(t6));
4099
+ __ Addu(a3, a3, Operand(StandardFrameConstants::kCallerSPOffset));
4100
+ __ sw(a3, MemOperand(sp, 1 * kPointerSize));
4101
+
4102
+ // a1 = parameter count (tagged)
4103
+ // a2 = argument count (tagged)
4104
+ // Compute the mapped parameter count = min(a1, a2) in a1.
4105
+ Label skip_min;
4106
+ __ Branch(&skip_min, lt, a1, Operand(a2));
4107
+ __ mov(a1, a2);
4108
+ __ bind(&skip_min);
4109
+
4110
+ __ bind(&try_allocate);
4111
+
4112
+ // Compute the sizes of backing store, parameter map, and arguments object.
4113
+ // 1. Parameter map, has 2 extra words containing context and backing store.
4114
+ const int kParameterMapHeaderSize =
4115
+ FixedArray::kHeaderSize + 2 * kPointerSize;
4116
+ // If there are no mapped parameters, we do not need the parameter_map.
4117
+ Label param_map_size;
4118
+ ASSERT_EQ(0, Smi::FromInt(0));
4119
+ __ Branch(USE_DELAY_SLOT, &param_map_size, eq, a1, Operand(zero_reg));
4120
+ __ mov(t5, zero_reg); // In delay slot: param map size = 0 when a1 == 0.
4121
+ __ sll(t5, a1, 1);
4122
+ __ addiu(t5, t5, kParameterMapHeaderSize);
4123
+ __ bind(&param_map_size);
4124
+
4125
+ // 2. Backing store.
4126
+ __ sll(t6, a2, 1);
4127
+ __ Addu(t5, t5, Operand(t6));
4128
+ __ Addu(t5, t5, Operand(FixedArray::kHeaderSize));
4129
+
4130
+ // 3. Arguments object.
4131
+ __ Addu(t5, t5, Operand(Heap::kArgumentsObjectSize));
4132
+
4133
+ // Do the allocation of all three objects in one go.
4134
+ __ AllocateInNewSpace(t5, v0, a3, t0, &runtime, TAG_OBJECT);
4135
+
4136
+ // v0 = address of new object(s) (tagged)
4137
+ // a2 = argument count (tagged)
4138
+ // Get the arguments boilerplate from the current (global) context into t0.
4139
+ const int kNormalOffset =
4140
+ Context::SlotOffset(Context::ARGUMENTS_BOILERPLATE_INDEX);
4141
+ const int kAliasedOffset =
4142
+ Context::SlotOffset(Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX);
4143
+
4144
+ __ lw(t0, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
4145
+ __ lw(t0, FieldMemOperand(t0, GlobalObject::kGlobalContextOffset));
4146
+ Label skip2_ne, skip2_eq;
4147
+ __ Branch(&skip2_ne, ne, a1, Operand(zero_reg));
4148
+ __ lw(t0, MemOperand(t0, kNormalOffset));
4149
+ __ bind(&skip2_ne);
4150
+
4151
+ __ Branch(&skip2_eq, eq, a1, Operand(zero_reg));
4152
+ __ lw(t0, MemOperand(t0, kAliasedOffset));
4153
+ __ bind(&skip2_eq);
4154
+
4155
+ // v0 = address of new object (tagged)
4156
+ // a1 = mapped parameter count (tagged)
4157
+ // a2 = argument count (tagged)
4158
+ // t0 = address of boilerplate object (tagged)
4159
+ // Copy the JS object part.
4160
+ for (int i = 0; i < JSObject::kHeaderSize; i += kPointerSize) {
4161
+ __ lw(a3, FieldMemOperand(t0, i));
4162
+ __ sw(a3, FieldMemOperand(v0, i));
4163
+ }
4164
+
4165
+ // Setup the callee in-object property.
4166
+ STATIC_ASSERT(Heap::kArgumentsCalleeIndex == 1);
4167
+ __ lw(a3, MemOperand(sp, 2 * kPointerSize));
4168
+ const int kCalleeOffset = JSObject::kHeaderSize +
4169
+ Heap::kArgumentsCalleeIndex * kPointerSize;
4170
+ __ sw(a3, FieldMemOperand(v0, kCalleeOffset));
4171
+
4172
+ // Use the length (smi tagged) and set that as an in-object property too.
4173
+ STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0);
4174
+ const int kLengthOffset = JSObject::kHeaderSize +
4175
+ Heap::kArgumentsLengthIndex * kPointerSize;
4176
+ __ sw(a2, FieldMemOperand(v0, kLengthOffset));
4177
+
4178
+ // Setup the elements pointer in the allocated arguments object.
4179
+ // If we allocated a parameter map, t0 will point there, otherwise
4180
+ // it will point to the backing store.
4181
+ __ Addu(t0, v0, Operand(Heap::kArgumentsObjectSize));
4182
+ __ sw(t0, FieldMemOperand(v0, JSObject::kElementsOffset));
4183
+
4184
+ // v0 = address of new object (tagged)
4185
+ // a1 = mapped parameter count (tagged)
4186
+ // a2 = argument count (tagged)
4187
+ // t0 = address of parameter map or backing store (tagged)
4188
+ // Initialize parameter map. If there are no mapped arguments, we're done.
4189
+ Label skip_parameter_map;
4190
+ Label skip3;
4191
+ __ Branch(&skip3, ne, a1, Operand(Smi::FromInt(0)));
4192
+ // Move backing store address to a3, because it is
4193
+ // expected there when filling in the unmapped arguments.
4194
+ __ mov(a3, t0);
4195
+ __ bind(&skip3);
4196
+
4197
+ __ Branch(&skip_parameter_map, eq, a1, Operand(Smi::FromInt(0)));
4198
+
4199
+ __ LoadRoot(t2, Heap::kNonStrictArgumentsElementsMapRootIndex);
4200
+ __ sw(t2, FieldMemOperand(t0, FixedArray::kMapOffset));
4201
+ __ Addu(t2, a1, Operand(Smi::FromInt(2)));
4202
+ __ sw(t2, FieldMemOperand(t0, FixedArray::kLengthOffset));
4203
+ __ sw(cp, FieldMemOperand(t0, FixedArray::kHeaderSize + 0 * kPointerSize));
4204
+ __ sll(t6, a1, 1);
4205
+ __ Addu(t2, t0, Operand(t6));
4206
+ __ Addu(t2, t2, Operand(kParameterMapHeaderSize));
4207
+ __ sw(t2, FieldMemOperand(t0, FixedArray::kHeaderSize + 1 * kPointerSize));
4208
+
4209
+ // Copy the parameter slots and the holes in the arguments.
4210
+ // We need to fill in mapped_parameter_count slots. They index the context,
4211
+ // where parameters are stored in reverse order, at
4212
+ // MIN_CONTEXT_SLOTS .. MIN_CONTEXT_SLOTS+parameter_count-1
4213
+ // The mapped parameter thus need to get indices
4214
+ // MIN_CONTEXT_SLOTS+parameter_count-1 ..
4215
+ // MIN_CONTEXT_SLOTS+parameter_count-mapped_parameter_count
4216
+ // We loop from right to left.
4217
+ Label parameters_loop, parameters_test;
4218
+ __ mov(t2, a1);
4219
+ __ lw(t5, MemOperand(sp, 0 * kPointerSize));
4220
+ __ Addu(t5, t5, Operand(Smi::FromInt(Context::MIN_CONTEXT_SLOTS)));
4221
+ __ Subu(t5, t5, Operand(a1));
4222
+ __ LoadRoot(t3, Heap::kTheHoleValueRootIndex);
4223
+ __ sll(t6, t2, 1);
4224
+ __ Addu(a3, t0, Operand(t6));
4225
+ __ Addu(a3, a3, Operand(kParameterMapHeaderSize));
4226
+
4227
+ // t2 = loop variable (tagged)
4228
+ // a1 = mapping index (tagged)
4229
+ // a3 = address of backing store (tagged)
4230
+ // t0 = address of parameter map (tagged)
4231
+ // t1 = temporary scratch (a.o., for address calculation)
4232
+ // t3 = the hole value
4233
+ __ jmp(&parameters_test);
4234
+
4235
+ __ bind(&parameters_loop);
4236
+ __ Subu(t2, t2, Operand(Smi::FromInt(1)));
4237
+ __ sll(t1, t2, 1);
4238
+ __ Addu(t1, t1, Operand(kParameterMapHeaderSize - kHeapObjectTag));
4239
+ __ Addu(t6, t0, t1);
4240
+ __ sw(t5, MemOperand(t6));
4241
+ __ Subu(t1, t1, Operand(kParameterMapHeaderSize - FixedArray::kHeaderSize));
4242
+ __ Addu(t6, a3, t1);
4243
+ __ sw(t3, MemOperand(t6));
4244
+ __ Addu(t5, t5, Operand(Smi::FromInt(1)));
4245
+ __ bind(&parameters_test);
4246
+ __ Branch(&parameters_loop, ne, t2, Operand(Smi::FromInt(0)));
4247
+
4248
+ __ bind(&skip_parameter_map);
4249
+ // a2 = argument count (tagged)
4250
+ // a3 = address of backing store (tagged)
4251
+ // t1 = scratch
4252
+ // Copy arguments header and remaining slots (if there are any).
4253
+ __ LoadRoot(t1, Heap::kFixedArrayMapRootIndex);
4254
+ __ sw(t1, FieldMemOperand(a3, FixedArray::kMapOffset));
4255
+ __ sw(a2, FieldMemOperand(a3, FixedArray::kLengthOffset));
4256
+
4257
+ Label arguments_loop, arguments_test;
4258
+ __ mov(t5, a1);
4259
+ __ lw(t0, MemOperand(sp, 1 * kPointerSize));
4260
+ __ sll(t6, t5, 1);
4261
+ __ Subu(t0, t0, Operand(t6));
4262
+ __ jmp(&arguments_test);
4263
+
4264
+ __ bind(&arguments_loop);
4265
+ __ Subu(t0, t0, Operand(kPointerSize));
4266
+ __ lw(t2, MemOperand(t0, 0));
4267
+ __ sll(t6, t5, 1);
4268
+ __ Addu(t1, a3, Operand(t6));
4269
+ __ sw(t2, FieldMemOperand(t1, FixedArray::kHeaderSize));
4270
+ __ Addu(t5, t5, Operand(Smi::FromInt(1)));
4271
+
4272
+ __ bind(&arguments_test);
4273
+ __ Branch(&arguments_loop, lt, t5, Operand(a2));
4274
+
4275
+ // Return and remove the on-stack parameters.
4276
+ __ Addu(sp, sp, Operand(3 * kPointerSize));
4277
+ __ Ret();
4278
+
4279
+ // Do the runtime call to allocate the arguments object.
4280
+ // a2 = argument count (taggged)
4281
+ __ bind(&runtime);
4282
+ __ sw(a2, MemOperand(sp, 0 * kPointerSize)); // Patch argument count.
4283
+ __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1);
4284
+ }
4285
+
4286
+
4287
+ void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) {
4288
+ // sp[0] : number of parameters
4289
+ // sp[4] : receiver displacement
4290
+ // sp[8] : function
4082
4291
  // Check if the calling frame is an arguments adaptor frame.
4083
4292
  Label adaptor_frame, try_allocate, runtime;
4084
4293
  __ lw(a2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
@@ -4111,40 +4320,31 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
4111
4320
 
4112
4321
  __ Addu(a1, a1, Operand(FixedArray::kHeaderSize / kPointerSize));
4113
4322
  __ bind(&add_arguments_object);
4114
- __ Addu(a1, a1, Operand(GetArgumentsObjectSize() / kPointerSize));
4323
+ __ Addu(a1, a1, Operand(Heap::kArgumentsObjectSizeStrict / kPointerSize));
4115
4324
 
4116
4325
  // Do the allocation of both objects in one go.
4117
- __ AllocateInNewSpace(
4118
- a1,
4119
- v0,
4120
- a2,
4121
- a3,
4122
- &runtime,
4123
- static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS));
4326
+ __ AllocateInNewSpace(a1,
4327
+ v0,
4328
+ a2,
4329
+ a3,
4330
+ &runtime,
4331
+ static_cast<AllocationFlags>(TAG_OBJECT |
4332
+ SIZE_IN_WORDS));
4124
4333
 
4125
4334
  // Get the arguments boilerplate from the current (global) context.
4126
4335
  __ lw(t0, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
4127
4336
  __ lw(t0, FieldMemOperand(t0, GlobalObject::kGlobalContextOffset));
4128
- __ lw(t0, MemOperand(t0,
4129
- Context::SlotOffset(GetArgumentsBoilerplateIndex())));
4337
+ __ lw(t0, MemOperand(t0, Context::SlotOffset(
4338
+ Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX)));
4130
4339
 
4131
4340
  // Copy the JS object part.
4132
4341
  __ CopyFields(v0, t0, a3.bit(), JSObject::kHeaderSize / kPointerSize);
4133
4342
 
4134
- if (type_ == NEW_NON_STRICT) {
4135
- // Setup the callee in-object property.
4136
- STATIC_ASSERT(Heap::kArgumentsCalleeIndex == 1);
4137
- __ lw(a3, MemOperand(sp, 2 * kPointerSize));
4138
- const int kCalleeOffset = JSObject::kHeaderSize +
4139
- Heap::kArgumentsCalleeIndex * kPointerSize;
4140
- __ sw(a3, FieldMemOperand(v0, kCalleeOffset));
4141
- }
4142
-
4143
4343
  // Get the length (smi tagged) and set that as an in-object property too.
4144
4344
  STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0);
4145
4345
  __ lw(a1, MemOperand(sp, 0 * kPointerSize));
4146
4346
  __ sw(a1, FieldMemOperand(v0, JSObject::kHeaderSize +
4147
- Heap::kArgumentsLengthIndex * kPointerSize));
4347
+ Heap::kArgumentsLengthIndex * kPointerSize));
4148
4348
 
4149
4349
  Label done;
4150
4350
  __ Branch(&done, eq, a1, Operand(zero_reg));
@@ -4154,12 +4354,13 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
4154
4354
 
4155
4355
  // Setup the elements pointer in the allocated arguments object and
4156
4356
  // initialize the header in the elements fixed array.
4157
- __ Addu(t0, v0, Operand(GetArgumentsObjectSize()));
4357
+ __ Addu(t0, v0, Operand(Heap::kArgumentsObjectSizeStrict));
4158
4358
  __ sw(t0, FieldMemOperand(v0, JSObject::kElementsOffset));
4159
4359
  __ LoadRoot(a3, Heap::kFixedArrayMapRootIndex);
4160
4360
  __ sw(a3, FieldMemOperand(t0, FixedArray::kMapOffset));
4161
4361
  __ sw(a1, FieldMemOperand(t0, FixedArray::kLengthOffset));
4162
- __ srl(a1, a1, kSmiTagSize); // Untag the length for the loop.
4362
+ // Untag the length for the loop.
4363
+ __ srl(a1, a1, kSmiTagSize);
4163
4364
 
4164
4365
  // Copy the fixed array slots.
4165
4366
  Label loop;
@@ -4183,7 +4384,7 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
4183
4384
 
4184
4385
  // Do the runtime call to allocate the arguments object.
4185
4386
  __ bind(&runtime);
4186
- __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1);
4387
+ __ TailCallRuntime(Runtime::kNewStrictArgumentsFast, 3, 1);
4187
4388
  }
4188
4389
 
4189
4390
 
@@ -4316,6 +4517,9 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
4316
4517
  __ Addu(a2, a2, Operand(RegExpImpl::kLastMatchOverhead));
4317
4518
  __ sra(at, a0, kSmiTagSize); // Untag length for comparison.
4318
4519
  __ Branch(&runtime, gt, a2, Operand(at));
4520
+
4521
+ // Reset offset for possibly sliced string.
4522
+ __ mov(t0, zero_reg);
4319
4523
  // subject: Subject string
4320
4524
  // regexp_data: RegExp data (FixedArray)
4321
4525
  // Check the representation and encoding of the subject string.
@@ -4323,29 +4527,41 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
4323
4527
  __ lw(a0, FieldMemOperand(subject, HeapObject::kMapOffset));
4324
4528
  __ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset));
4325
4529
  // First check for flat string.
4326
- __ And(at, a0, Operand(kIsNotStringMask | kStringRepresentationMask));
4530
+ __ And(a1, a0, Operand(kIsNotStringMask | kStringRepresentationMask));
4327
4531
  STATIC_ASSERT((kStringTag | kSeqStringTag) == 0);
4328
- __ Branch(&seq_string, eq, at, Operand(zero_reg));
4532
+ __ Branch(&seq_string, eq, a1, Operand(zero_reg));
4329
4533
 
4330
4534
  // subject: Subject string
4331
4535
  // a0: instance type if Subject string
4332
4536
  // regexp_data: RegExp data (FixedArray)
4333
- // Check for flat cons string.
4537
+ // Check for flat cons string or sliced string.
4334
4538
  // A flat cons string is a cons string where the second part is the empty
4335
4539
  // string. In that case the subject string is just the first part of the cons
4336
4540
  // string. Also in this case the first part of the cons string is known to be
4337
4541
  // a sequential string or an external string.
4338
- STATIC_ASSERT(kExternalStringTag != 0);
4339
- STATIC_ASSERT((kConsStringTag & kExternalStringTag) == 0);
4340
- __ And(at, a0, Operand(kIsNotStringMask | kExternalStringTag));
4341
- __ Branch(&runtime, ne, at, Operand(zero_reg));
4542
+ // In the case of a sliced string its offset has to be taken into account.
4543
+ Label cons_string, check_encoding;
4544
+ STATIC_ASSERT(kConsStringTag < kExternalStringTag);
4545
+ STATIC_ASSERT(kSlicedStringTag > kExternalStringTag);
4546
+ __ Branch(&cons_string, lt, a1, Operand(kExternalStringTag));
4547
+ __ Branch(&runtime, eq, a1, Operand(kExternalStringTag));
4548
+
4549
+ // String is sliced.
4550
+ __ lw(t0, FieldMemOperand(subject, SlicedString::kOffsetOffset));
4551
+ __ sra(t0, t0, kSmiTagSize);
4552
+ __ lw(subject, FieldMemOperand(subject, SlicedString::kParentOffset));
4553
+ // t5: offset of sliced string, smi-tagged.
4554
+ __ jmp(&check_encoding);
4555
+ // String is a cons string, check whether it is flat.
4556
+ __ bind(&cons_string);
4342
4557
  __ lw(a0, FieldMemOperand(subject, ConsString::kSecondOffset));
4343
4558
  __ LoadRoot(a1, Heap::kEmptyStringRootIndex);
4344
4559
  __ Branch(&runtime, ne, a0, Operand(a1));
4345
4560
  __ lw(subject, FieldMemOperand(subject, ConsString::kFirstOffset));
4561
+ // Is first part of cons or parent of slice a flat string?
4562
+ __ bind(&check_encoding);
4346
4563
  __ lw(a0, FieldMemOperand(subject, HeapObject::kMapOffset));
4347
4564
  __ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset));
4348
- // Is first part a flat string?
4349
4565
  STATIC_ASSERT(kSeqStringTag == 0);
4350
4566
  __ And(at, a0, Operand(kStringRepresentationMask));
4351
4567
  __ Branch(&runtime, ne, at, Operand(zero_reg));
@@ -4361,14 +4577,13 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
4361
4577
  __ And(a0, a0, Operand(kStringEncodingMask)); // Non-zero for ascii.
4362
4578
  __ lw(t9, FieldMemOperand(regexp_data, JSRegExp::kDataAsciiCodeOffset));
4363
4579
  __ sra(a3, a0, 2); // a3 is 1 for ascii, 0 for UC16 (usyed below).
4364
- __ lw(t0, FieldMemOperand(regexp_data, JSRegExp::kDataUC16CodeOffset));
4365
- __ movz(t9, t0, a0); // If UC16 (a0 is 0), replace t9 w/kDataUC16CodeOffset.
4580
+ __ lw(t1, FieldMemOperand(regexp_data, JSRegExp::kDataUC16CodeOffset));
4581
+ __ movz(t9, t1, a0); // If UC16 (a0 is 0), replace t9 w/kDataUC16CodeOffset.
4366
4582
 
4367
4583
  // Check that the irregexp code has been generated for the actual string
4368
- // encoding. If it has, the field contains a code object otherwise it
4369
- // contains the hole.
4370
- __ GetObjectType(t9, a0, a0);
4371
- __ Branch(&runtime, ne, a0, Operand(CODE_TYPE));
4584
+ // encoding. If it has, the field contains a code object otherwise it contains
4585
+ // a smi (code flushing support).
4586
+ __ JumpIfSmi(t9, &runtime);
4372
4587
 
4373
4588
  // a3: encoding of subject string (1 if ASCII, 0 if two_byte);
4374
4589
  // t9: code
@@ -4430,23 +4645,32 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
4430
4645
 
4431
4646
  // For arguments 4 and 3 get string length, calculate start of string data
4432
4647
  // and calculate the shift of the index (0 for ASCII and 1 for two byte).
4433
- __ lw(a0, FieldMemOperand(subject, String::kLengthOffset));
4434
- __ sra(a0, a0, kSmiTagSize);
4435
4648
  STATIC_ASSERT(SeqAsciiString::kHeaderSize == SeqTwoByteString::kHeaderSize);
4436
- __ Addu(t0, subject, Operand(SeqAsciiString::kHeaderSize - kHeapObjectTag));
4649
+ __ Addu(t2, subject, Operand(SeqAsciiString::kHeaderSize - kHeapObjectTag));
4437
4650
  __ Xor(a3, a3, Operand(1)); // 1 for 2-byte str, 0 for 1-byte.
4438
- // Argument 4 (a3): End of string data
4439
- // Argument 3 (a2): Start of string data
4651
+ // Load the length from the original subject string from the previous stack
4652
+ // frame. Therefore we have to use fp, which points exactly to two pointer
4653
+ // sizes below the previous sp. (Because creating a new stack frame pushes
4654
+ // the previous fp onto the stack and moves up sp by 2 * kPointerSize.)
4655
+ __ lw(a0, MemOperand(fp, kSubjectOffset + 2 * kPointerSize));
4656
+ // If slice offset is not 0, load the length from the original sliced string.
4657
+ // Argument 4, a3: End of string data
4658
+ // Argument 3, a2: Start of string data
4659
+ // Prepare start and end index of the input.
4660
+ __ sllv(t1, t0, a3);
4661
+ __ addu(t0, t2, t1);
4440
4662
  __ sllv(t1, a1, a3);
4441
4663
  __ addu(a2, t0, t1);
4442
- __ sllv(t1, a0, a3);
4443
- __ addu(a3, t0, t1);
4444
4664
 
4665
+ __ lw(t2, FieldMemOperand(a0, String::kLengthOffset));
4666
+ __ sra(t2, t2, kSmiTagSize);
4667
+ __ sllv(t1, t2, a3);
4668
+ __ addu(a3, t0, t1);
4445
4669
  // Argument 2 (a1): Previous index.
4446
4670
  // Already there
4447
4671
 
4448
4672
  // Argument 1 (a0): Subject string.
4449
- __ mov(a0, subject);
4673
+ // Already there
4450
4674
 
4451
4675
  // Locate the code entry and call it.
4452
4676
  __ Addu(t9, t9, Operand(Code::kHeaderSize - kHeapObjectTag));
@@ -4463,11 +4687,14 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
4463
4687
  // Check the result.
4464
4688
 
4465
4689
  Label success;
4466
- __ Branch(&success, eq, v0, Operand(NativeRegExpMacroAssembler::SUCCESS));
4690
+ __ Branch(&success, eq,
4691
+ subject, Operand(NativeRegExpMacroAssembler::SUCCESS));
4467
4692
  Label failure;
4468
- __ Branch(&failure, eq, v0, Operand(NativeRegExpMacroAssembler::FAILURE));
4693
+ __ Branch(&failure, eq,
4694
+ subject, Operand(NativeRegExpMacroAssembler::FAILURE));
4469
4695
  // If not exception it can only be retry. Handle that in the runtime system.
4470
- __ Branch(&runtime, ne, v0, Operand(NativeRegExpMacroAssembler::EXCEPTION));
4696
+ __ Branch(&runtime, ne,
4697
+ subject, Operand(NativeRegExpMacroAssembler::EXCEPTION));
4471
4698
  // Result must now be exception. If there is no pending exception already a
4472
4699
  // stack overflow (on the backtrack stack) was detected in RegExp code but
4473
4700
  // haven't created the exception yet. Handle that in the runtime system.
@@ -4478,16 +4705,16 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
4478
4705
  __ li(a2, Operand(ExternalReference(Isolate::k_pending_exception_address,
4479
4706
  masm->isolate())));
4480
4707
  __ lw(v0, MemOperand(a2, 0));
4481
- __ Branch(&runtime, eq, v0, Operand(a1));
4708
+ __ Branch(&runtime, eq, subject, Operand(a1));
4482
4709
 
4483
4710
  __ sw(a1, MemOperand(a2, 0)); // Clear pending exception.
4484
4711
 
4485
4712
  // Check if the exception is a termination. If so, throw as uncatchable.
4486
4713
  __ LoadRoot(a0, Heap::kTerminationExceptionRootIndex);
4487
4714
  Label termination_exception;
4488
- __ Branch(&termination_exception, eq, v0, Operand(a0));
4715
+ __ Branch(&termination_exception, eq, subject, Operand(a0));
4489
4716
 
4490
- __ Throw(a0); // Expects thrown value in v0.
4717
+ __ Throw(subject); // Expects thrown value in v0.
4491
4718
 
4492
4719
  __ bind(&termination_exception);
4493
4720
  __ ThrowUncatchable(TERMINATION, v0); // Expects thrown value in v0.
@@ -4692,7 +4919,11 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
4692
4919
  Label call_as_function;
4693
4920
  __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
4694
4921
  __ Branch(&call_as_function, eq, t0, Operand(at));
4695
- __ InvokeFunction(a1, actual, JUMP_FUNCTION);
4922
+ __ InvokeFunction(a1,
4923
+ actual,
4924
+ JUMP_FUNCTION,
4925
+ NullCallWrapper(),
4926
+ CALL_AS_METHOD);
4696
4927
  __ bind(&call_as_function);
4697
4928
  }
4698
4929
  __ InvokeFunction(a1,
@@ -4709,6 +4940,7 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
4709
4940
  __ li(a0, Operand(argc_)); // Setup the number of arguments.
4710
4941
  __ mov(a2, zero_reg);
4711
4942
  __ GetBuiltinEntry(a3, Builtins::CALL_NON_FUNCTION);
4943
+ __ SetCallKind(t1, CALL_AS_METHOD);
4712
4944
  __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
4713
4945
  RelocInfo::CODE_TARGET);
4714
4946
  }
@@ -4716,16 +4948,9 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
4716
4948
 
4717
4949
  // Unfortunately you have to run without snapshots to see most of these
4718
4950
  // names in the profile since most compare stubs end up in the snapshot.
4719
- const char* CompareStub::GetName() {
4951
+ void CompareStub::PrintName(StringStream* stream) {
4720
4952
  ASSERT((lhs_.is(a0) && rhs_.is(a1)) ||
4721
4953
  (lhs_.is(a1) && rhs_.is(a0)));
4722
-
4723
- if (name_ != NULL) return name_;
4724
- const int kMaxNameLength = 100;
4725
- name_ = Isolate::Current()->bootstrapper()->AllocateAutoDeletedArray(
4726
- kMaxNameLength);
4727
- if (name_ == NULL) return "OOM";
4728
-
4729
4954
  const char* cc_name;
4730
4955
  switch (cc_) {
4731
4956
  case lt: cc_name = "LT"; break;
@@ -4736,40 +4961,14 @@ const char* CompareStub::GetName() {
4736
4961
  case ne: cc_name = "NE"; break;
4737
4962
  default: cc_name = "UnknownCondition"; break;
4738
4963
  }
4739
-
4740
- const char* lhs_name = lhs_.is(a0) ? "_a0" : "_a1";
4741
- const char* rhs_name = rhs_.is(a0) ? "_a0" : "_a1";
4742
-
4743
- const char* strict_name = "";
4744
- if (strict_ && (cc_ == eq || cc_ == ne)) {
4745
- strict_name = "_STRICT";
4746
- }
4747
-
4748
- const char* never_nan_nan_name = "";
4749
- if (never_nan_nan_ && (cc_ == eq || cc_ == ne)) {
4750
- never_nan_nan_name = "_NO_NAN";
4751
- }
4752
-
4753
- const char* include_number_compare_name = "";
4754
- if (!include_number_compare_) {
4755
- include_number_compare_name = "_NO_NUMBER";
4756
- }
4757
-
4758
- const char* include_smi_compare_name = "";
4759
- if (!include_smi_compare_) {
4760
- include_smi_compare_name = "_NO_SMI";
4761
- }
4762
-
4763
- OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
4764
- "CompareStub_%s%s%s%s%s%s",
4765
- cc_name,
4766
- lhs_name,
4767
- rhs_name,
4768
- strict_name,
4769
- never_nan_nan_name,
4770
- include_number_compare_name,
4771
- include_smi_compare_name);
4772
- return name_;
4964
+ bool is_equality = cc_ == eq || cc_ == ne;
4965
+ stream->Add("CompareStub_%s", cc_name);
4966
+ stream->Add(lhs_.is(a0) ? "_a0" : "_a1");
4967
+ stream->Add(rhs_.is(a0) ? "_a0" : "_a1");
4968
+ if (strict_ && is_equality) stream->Add("_STRICT");
4969
+ if (never_nan_nan_ && is_equality) stream->Add("_NO_NAN");
4970
+ if (!include_number_compare_) stream->Add("_NO_NUMBER");
4971
+ if (!include_smi_compare_) stream->Add("_NO_SMI");
4773
4972
  }
4774
4973
 
4775
4974
 
@@ -4791,6 +4990,7 @@ void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) {
4791
4990
  Label flat_string;
4792
4991
  Label ascii_string;
4793
4992
  Label got_char_code;
4993
+ Label sliced_string;
4794
4994
 
4795
4995
  ASSERT(!t0.is(scratch_));
4796
4996
  ASSERT(!t0.is(index_));
@@ -4824,23 +5024,37 @@ void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) {
4824
5024
  __ Branch(&flat_string, eq, t0, Operand(zero_reg));
4825
5025
 
4826
5026
  // Handle non-flat strings.
4827
- __ And(t0, result_, Operand(kIsConsStringMask));
4828
- __ Branch(&call_runtime_, eq, t0, Operand(zero_reg));
5027
+ __ And(result_, result_, Operand(kStringRepresentationMask));
5028
+ STATIC_ASSERT(kConsStringTag < kExternalStringTag);
5029
+ STATIC_ASSERT(kSlicedStringTag > kExternalStringTag);
5030
+ __ Branch(&sliced_string, gt, result_, Operand(kExternalStringTag));
5031
+ __ Branch(&call_runtime_, eq, result_, Operand(kExternalStringTag));
4829
5032
 
4830
5033
  // ConsString.
4831
5034
  // Check whether the right hand side is the empty string (i.e. if
4832
5035
  // this is really a flat string in a cons string). If that is not
4833
5036
  // the case we would rather go to the runtime system now to flatten
4834
5037
  // the string.
5038
+ Label assure_seq_string;
4835
5039
  __ lw(result_, FieldMemOperand(object_, ConsString::kSecondOffset));
4836
5040
  __ LoadRoot(t0, Heap::kEmptyStringRootIndex);
4837
5041
  __ Branch(&call_runtime_, ne, result_, Operand(t0));
4838
5042
 
4839
5043
  // Get the first of the two strings and load its instance type.
4840
5044
  __ lw(object_, FieldMemOperand(object_, ConsString::kFirstOffset));
5045
+ __ jmp(&assure_seq_string);
5046
+
5047
+ // SlicedString, unpack and add offset.
5048
+ __ bind(&sliced_string);
5049
+ __ lw(result_, FieldMemOperand(object_, SlicedString::kOffsetOffset));
5050
+ __ addu(scratch_, scratch_, result_);
5051
+ __ lw(object_, FieldMemOperand(object_, SlicedString::kParentOffset));
5052
+
5053
+ // Assure that we are dealing with a sequential string. Go to runtime if not.
5054
+ __ bind(&assure_seq_string);
4841
5055
  __ lw(result_, FieldMemOperand(object_, HeapObject::kMapOffset));
4842
5056
  __ lbu(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset));
4843
- // If the first cons component is also non-flat, then go to runtime.
5057
+ // Check that parent is not an external string. Go to runtime otherwise.
4844
5058
  STATIC_ASSERT(kSeqStringTag == 0);
4845
5059
 
4846
5060
  __ And(t0, result_, Operand(kStringRepresentationMask));
@@ -5411,6 +5625,11 @@ void SubStringStub::Generate(MacroAssembler* masm) {
5411
5625
  Register to = t2;
5412
5626
  Register from = t3;
5413
5627
 
5628
+ if (FLAG_string_slices) {
5629
+ __ nop(); // Jumping as first instruction would crash the code generation.
5630
+ __ jmp(&sub_string_runtime);
5631
+ }
5632
+
5414
5633
  // Check bounds and smi-ness.
5415
5634
  __ lw(to, MemOperand(sp, kToOffset));
5416
5635
  __ lw(from, MemOperand(sp, kFromOffset));
@@ -6352,6 +6571,7 @@ void ICCompareStub::GenerateMiss(MacroAssembler* masm) {
6352
6571
  __ Jump(a2);
6353
6572
  }
6354
6573
 
6574
+
6355
6575
  void DirectCEntryStub::Generate(MacroAssembler* masm) {
6356
6576
  // No need to pop or drop anything, LeaveExitFrame will restore the old
6357
6577
  // stack, thus dropping the allocated space for the return value.
@@ -6376,6 +6596,7 @@ void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
6376
6596
  this->GenerateCall(masm, t9);
6377
6597
  }
6378
6598
 
6599
+
6379
6600
  void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
6380
6601
  Register target) {
6381
6602
  __ Move(t9, target);