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
@@ -661,7 +661,6 @@ bool RegExpMacroAssemblerX64::CheckSpecialCharacterClass(uc16 type,
661
661
  }
662
662
  __ movq(rbx, ExternalReference::re_word_character_map());
663
663
  ASSERT_EQ(0, word_character_map[0]); // Character '\0' is not a word char.
664
- ExternalReference word_map = ExternalReference::re_word_character_map();
665
664
  __ testb(Operand(rbx, current_character(), times_1, 0),
666
665
  current_character());
667
666
  BranchOrBacktrack(zero, on_no_match);
@@ -676,7 +675,6 @@ bool RegExpMacroAssemblerX64::CheckSpecialCharacterClass(uc16 type,
676
675
  }
677
676
  __ movq(rbx, ExternalReference::re_word_character_map());
678
677
  ASSERT_EQ(0, word_character_map[0]); // Character '\0' is not a word char.
679
- ExternalReference word_map = ExternalReference::re_word_character_map();
680
678
  __ testb(Operand(rbx, current_character(), times_1, 0),
681
679
  current_character());
682
680
  BranchOrBacktrack(not_zero, on_no_match);
@@ -1172,12 +1170,13 @@ int RegExpMacroAssemblerX64::CheckStackGuardState(Address* return_address,
1172
1170
  }
1173
1171
 
1174
1172
  // Prepare for possible GC.
1175
- HandleScope handles;
1173
+ HandleScope handles(isolate);
1176
1174
  Handle<Code> code_handle(re_code);
1177
1175
 
1178
1176
  Handle<String> subject(frame_entry<String*>(re_frame, kInputString));
1177
+
1179
1178
  // Current string.
1180
- bool is_ascii = subject->IsAsciiRepresentation();
1179
+ bool is_ascii = subject->IsAsciiRepresentationUnderneath();
1181
1180
 
1182
1181
  ASSERT(re_code->instruction_start() <= *return_address);
1183
1182
  ASSERT(*return_address <=
@@ -1186,7 +1185,7 @@ int RegExpMacroAssemblerX64::CheckStackGuardState(Address* return_address,
1186
1185
  MaybeObject* result = Execution::HandleStackGuardInterrupt();
1187
1186
 
1188
1187
  if (*code_handle != re_code) { // Return address no longer valid
1189
- intptr_t delta = *code_handle - re_code;
1188
+ intptr_t delta = code_handle->address() - re_code->address();
1190
1189
  // Overwrite the return address on the stack.
1191
1190
  *return_address += delta;
1192
1191
  }
@@ -1195,8 +1194,20 @@ int RegExpMacroAssemblerX64::CheckStackGuardState(Address* return_address,
1195
1194
  return EXCEPTION;
1196
1195
  }
1197
1196
 
1197
+ Handle<String> subject_tmp = subject;
1198
+ int slice_offset = 0;
1199
+
1200
+ // Extract the underlying string and the slice offset.
1201
+ if (StringShape(*subject_tmp).IsCons()) {
1202
+ subject_tmp = Handle<String>(ConsString::cast(*subject_tmp)->first());
1203
+ } else if (StringShape(*subject_tmp).IsSliced()) {
1204
+ SlicedString* slice = SlicedString::cast(*subject_tmp);
1205
+ subject_tmp = Handle<String>(slice->parent());
1206
+ slice_offset = slice->offset();
1207
+ }
1208
+
1198
1209
  // String might have changed.
1199
- if (subject->IsAsciiRepresentation() != is_ascii) {
1210
+ if (subject_tmp->IsAsciiRepresentation() != is_ascii) {
1200
1211
  // If we changed between an ASCII and an UC16 string, the specialized
1201
1212
  // code cannot be used, and we need to restart regexp matching from
1202
1213
  // scratch (including, potentially, compiling a new version of the code).
@@ -1207,8 +1218,8 @@ int RegExpMacroAssemblerX64::CheckStackGuardState(Address* return_address,
1207
1218
  // be a sequential or external string with the same content.
1208
1219
  // Update the start and end pointers in the stack frame to the current
1209
1220
  // location (whether it has actually moved or not).
1210
- ASSERT(StringShape(*subject).IsSequential() ||
1211
- StringShape(*subject).IsExternal());
1221
+ ASSERT(StringShape(*subject_tmp).IsSequential() ||
1222
+ StringShape(*subject_tmp).IsExternal());
1212
1223
 
1213
1224
  // The original start address of the characters to match.
1214
1225
  const byte* start_address = frame_entry<const byte*>(re_frame, kInputStart);
@@ -1216,7 +1227,8 @@ int RegExpMacroAssemblerX64::CheckStackGuardState(Address* return_address,
1216
1227
  // Find the current start address of the same character at the current string
1217
1228
  // position.
1218
1229
  int start_index = frame_entry<int>(re_frame, kStartIndex);
1219
- const byte* new_address = StringCharacterPosition(*subject, start_index);
1230
+ const byte* new_address = StringCharacterPosition(*subject_tmp,
1231
+ start_index + slice_offset);
1220
1232
 
1221
1233
  if (start_address != new_address) {
1222
1234
  // If there is a difference, update the object pointer and start and end
@@ -28,6 +28,12 @@
28
28
  #ifndef V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_
29
29
  #define V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_
30
30
 
31
+ #include "x64/assembler-x64.h"
32
+ #include "x64/assembler-x64-inl.h"
33
+ #include "macro-assembler.h"
34
+ #include "code.h"
35
+ #include "x64/macro-assembler-x64.h"
36
+
31
37
  namespace v8 {
32
38
  namespace internal {
33
39
 
@@ -105,7 +105,7 @@ MUST_USE_RESULT static MaybeObject* GenerateDictionaryNegativeLookup(
105
105
  __ j(not_zero, miss_label);
106
106
 
107
107
  // Check that receiver is a JSObject.
108
- __ CmpInstanceType(r0, FIRST_JS_OBJECT_TYPE);
108
+ __ CmpInstanceType(r0, FIRST_SPEC_OBJECT_TYPE);
109
109
  __ j(below, miss_label);
110
110
 
111
111
  // Load properties array.
@@ -258,7 +258,7 @@ static void GenerateStringCheck(MacroAssembler* masm,
258
258
  // Check that the object is a string.
259
259
  __ movq(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
260
260
  __ movzxbq(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset));
261
- ASSERT(kNotStringTag != 0);
261
+ STATIC_ASSERT(kNotStringTag != 0);
262
262
  __ testl(scratch, Immediate(kNotStringTag));
263
263
  __ j(not_zero, non_string_object);
264
264
  }
@@ -478,10 +478,12 @@ class CallInterceptorCompiler BASE_EMBEDDED {
478
478
  public:
479
479
  CallInterceptorCompiler(StubCompiler* stub_compiler,
480
480
  const ParameterCount& arguments,
481
- Register name)
481
+ Register name,
482
+ Code::ExtraICState extra_ic_state)
482
483
  : stub_compiler_(stub_compiler),
483
484
  arguments_(arguments),
484
- name_(name) {}
485
+ name_(name),
486
+ extra_ic_state_(extra_ic_state) {}
485
487
 
486
488
  MaybeObject* Compile(MacroAssembler* masm,
487
489
  JSObject* object,
@@ -606,8 +608,11 @@ class CallInterceptorCompiler BASE_EMBEDDED {
606
608
  arguments_.immediate());
607
609
  if (result->IsFailure()) return result;
608
610
  } else {
611
+ CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
612
+ ? CALL_AS_FUNCTION
613
+ : CALL_AS_METHOD;
609
614
  __ InvokeFunction(optimization.constant_function(), arguments_,
610
- JUMP_FUNCTION);
615
+ JUMP_FUNCTION, NullCallWrapper(), call_kind);
611
616
  }
612
617
 
613
618
  // Deferred code for fast API call case---clean preallocated space.
@@ -686,6 +691,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
686
691
  StubCompiler* stub_compiler_;
687
692
  const ParameterCount& arguments_;
688
693
  Register name_;
694
+ Code::ExtraICState extra_ic_state_;
689
695
  };
690
696
 
691
697
 
@@ -1083,9 +1089,8 @@ void StubCompiler::GenerateLoadConstant(JSObject* object,
1083
1089
  __ JumpIfSmi(receiver, miss);
1084
1090
 
1085
1091
  // Check that the maps haven't changed.
1086
- Register reg =
1087
- CheckPrototypes(object, receiver, holder,
1088
- scratch1, scratch2, scratch3, name, miss);
1092
+ CheckPrototypes(object, receiver, holder,
1093
+ scratch1, scratch2, scratch3, name, miss);
1089
1094
 
1090
1095
  // Return the constant value.
1091
1096
  __ Move(rax, Handle<Object>(value));
@@ -1348,7 +1353,11 @@ MaybeObject* CallStubCompiler::CompileCallField(JSObject* object,
1348
1353
  }
1349
1354
 
1350
1355
  // Invoke the function.
1351
- __ InvokeFunction(rdi, arguments(), JUMP_FUNCTION);
1356
+ CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
1357
+ ? CALL_AS_FUNCTION
1358
+ : CALL_AS_METHOD;
1359
+ __ InvokeFunction(rdi, arguments(), JUMP_FUNCTION,
1360
+ NullCallWrapper(), call_kind);
1352
1361
 
1353
1362
  // Handle call cache miss.
1354
1363
  __ bind(&miss);
@@ -1831,7 +1840,11 @@ MaybeObject* CallStubCompiler::CompileStringFromCharCodeCall(
1831
1840
  // Tail call the full function. We do not have to patch the receiver
1832
1841
  // because the function makes no use of it.
1833
1842
  __ bind(&slow);
1834
- __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
1843
+ CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
1844
+ ? CALL_AS_FUNCTION
1845
+ : CALL_AS_METHOD;
1846
+ __ InvokeFunction(function, arguments(), JUMP_FUNCTION,
1847
+ NullCallWrapper(), call_kind);
1835
1848
 
1836
1849
  __ bind(&miss);
1837
1850
  // rcx: function name.
@@ -1944,7 +1957,11 @@ MaybeObject* CallStubCompiler::CompileMathAbsCall(Object* object,
1944
1957
  // Tail call the full function. We do not have to patch the receiver
1945
1958
  // because the function makes no use of it.
1946
1959
  __ bind(&slow);
1947
- __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
1960
+ CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
1961
+ ? CALL_AS_FUNCTION
1962
+ : CALL_AS_METHOD;
1963
+ __ InvokeFunction(function, arguments(), JUMP_FUNCTION,
1964
+ NullCallWrapper(), call_kind);
1948
1965
 
1949
1966
  __ bind(&miss);
1950
1967
  // rcx: function name.
@@ -2138,7 +2155,11 @@ MaybeObject* CallStubCompiler::CompileCallConstant(Object* object,
2138
2155
  UNREACHABLE();
2139
2156
  }
2140
2157
 
2141
- __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
2158
+ CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
2159
+ ? CALL_AS_FUNCTION
2160
+ : CALL_AS_METHOD;
2161
+ __ InvokeFunction(function, arguments(), JUMP_FUNCTION,
2162
+ NullCallWrapper(), call_kind);
2142
2163
 
2143
2164
  // Handle call cache miss.
2144
2165
  __ bind(&miss);
@@ -2175,7 +2196,7 @@ MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object,
2175
2196
  // Get the receiver from the stack.
2176
2197
  __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
2177
2198
 
2178
- CallInterceptorCompiler compiler(this, arguments(), rcx);
2199
+ CallInterceptorCompiler compiler(this, arguments(), rcx, extra_ic_state_);
2179
2200
  MaybeObject* result = compiler.Compile(masm(),
2180
2201
  object,
2181
2202
  holder,
@@ -2205,7 +2226,11 @@ MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object,
2205
2226
 
2206
2227
  // Invoke the function.
2207
2228
  __ movq(rdi, rax);
2208
- __ InvokeFunction(rdi, arguments(), JUMP_FUNCTION);
2229
+ CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
2230
+ ? CALL_AS_FUNCTION
2231
+ : CALL_AS_METHOD;
2232
+ __ InvokeFunction(rdi, arguments(), JUMP_FUNCTION,
2233
+ NullCallWrapper(), call_kind);
2209
2234
 
2210
2235
  // Handle load cache miss.
2211
2236
  __ bind(&miss);
@@ -2217,13 +2242,11 @@ MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object,
2217
2242
  }
2218
2243
 
2219
2244
 
2220
- MaybeObject* CallStubCompiler::CompileCallGlobal(
2221
- JSObject* object,
2222
- GlobalObject* holder,
2223
- JSGlobalPropertyCell* cell,
2224
- JSFunction* function,
2225
- String* name,
2226
- Code::ExtraICState extra_ic_state) {
2245
+ MaybeObject* CallStubCompiler::CompileCallGlobal(JSObject* object,
2246
+ GlobalObject* holder,
2247
+ JSGlobalPropertyCell* cell,
2248
+ JSFunction* function,
2249
+ String* name) {
2227
2250
  // ----------- S t a t e -------------
2228
2251
  // rcx : function name
2229
2252
  // rsp[0] : return address
@@ -2268,7 +2291,7 @@ MaybeObject* CallStubCompiler::CompileCallGlobal(
2268
2291
  __ IncrementCounter(counters->call_global_inline(), 1);
2269
2292
  ASSERT(function->is_compiled());
2270
2293
  ParameterCount expected(function->shared()->formal_parameter_count());
2271
- CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state)
2294
+ CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
2272
2295
  ? CALL_AS_FUNCTION
2273
2296
  : CALL_AS_METHOD;
2274
2297
  if (V8::UseCrankshaft()) {
@@ -2506,18 +2529,18 @@ MaybeObject* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
2506
2529
  }
2507
2530
 
2508
2531
 
2509
- MaybeObject* KeyedStoreStubCompiler::CompileStoreFastElement(
2510
- Map* receiver_map) {
2532
+ MaybeObject* KeyedStoreStubCompiler::CompileStoreElement(Map* receiver_map) {
2511
2533
  // ----------- S t a t e -------------
2512
2534
  // -- rax : value
2513
2535
  // -- rcx : key
2514
2536
  // -- rdx : receiver
2515
2537
  // -- rsp[0] : return address
2516
2538
  // -----------------------------------
2539
+ Code* stub;
2540
+ JSObject::ElementsKind elements_kind = receiver_map->elements_kind();
2517
2541
  bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
2518
2542
  MaybeObject* maybe_stub =
2519
- KeyedStoreFastElementStub(is_js_array).TryGetCode();
2520
- Code* stub;
2543
+ KeyedStoreElementStub(is_js_array, elements_kind).TryGetCode();
2521
2544
  if (!maybe_stub->To(&stub)) return maybe_stub;
2522
2545
  __ DispatchMap(rdx,
2523
2546
  Handle<Map>(receiver_map),
@@ -2966,14 +2989,15 @@ MaybeObject* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
2966
2989
  }
2967
2990
 
2968
2991
 
2969
- MaybeObject* KeyedLoadStubCompiler::CompileLoadFastElement(Map* receiver_map) {
2992
+ MaybeObject* KeyedLoadStubCompiler::CompileLoadElement(Map* receiver_map) {
2970
2993
  // ----------- S t a t e -------------
2971
2994
  // -- rax : key
2972
2995
  // -- rdx : receiver
2973
2996
  // -- rsp[0] : return address
2974
2997
  // -----------------------------------
2975
- MaybeObject* maybe_stub = KeyedLoadFastElementStub().TryGetCode();
2976
2998
  Code* stub;
2999
+ JSObject::ElementsKind elements_kind = receiver_map->elements_kind();
3000
+ MaybeObject* maybe_stub = KeyedLoadElementStub(elements_kind).TryGetCode();
2977
3001
  if (!maybe_stub->To(&stub)) return maybe_stub;
2978
3002
  __ DispatchMap(rdx,
2979
3003
  Handle<Map>(receiver_map),
@@ -3046,7 +3070,7 @@ MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) {
3046
3070
  // Load the initial map and verify that it is in fact a map.
3047
3071
  __ movq(rbx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
3048
3072
  // Will both indicate a NULL and a Smi.
3049
- ASSERT(kSmiTag == 0);
3073
+ STATIC_ASSERT(kSmiTag == 0);
3050
3074
  __ JumpIfSmi(rbx, &generic_stub_call);
3051
3075
  __ CmpObjectType(rbx, MAP_TYPE, rcx);
3052
3076
  __ j(not_equal, &generic_stub_call);
@@ -3152,60 +3176,58 @@ MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) {
3152
3176
  }
3153
3177
 
3154
3178
 
3155
- MaybeObject* ExternalArrayLoadStubCompiler::CompileLoad(
3156
- JSObject*receiver, ExternalArrayType array_type) {
3179
+ #undef __
3180
+ #define __ ACCESS_MASM(masm)
3181
+
3182
+
3183
+ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement(
3184
+ MacroAssembler* masm) {
3157
3185
  // ----------- S t a t e -------------
3158
3186
  // -- rax : key
3159
3187
  // -- rdx : receiver
3160
3188
  // -- rsp[0] : return address
3161
3189
  // -----------------------------------
3162
- MaybeObject* maybe_stub =
3163
- KeyedLoadExternalArrayStub(array_type).TryGetCode();
3164
- Code* stub;
3165
- if (!maybe_stub->To(&stub)) return maybe_stub;
3166
- __ DispatchMap(rdx,
3167
- Handle<Map>(receiver->map()),
3168
- Handle<Code>(stub),
3169
- DO_SMI_CHECK);
3190
+ Label slow, miss_force_generic;
3170
3191
 
3171
- Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss();
3172
- __ jmp(ic, RelocInfo::CODE_TARGET);
3192
+ // This stub is meant to be tail-jumped to, the receiver must already
3193
+ // have been verified by the caller to not be a smi.
3173
3194
 
3174
- // Return the generated code.
3175
- return GetCode();
3176
- }
3195
+ __ JumpIfNotSmi(rax, &miss_force_generic);
3196
+ __ SmiToInteger32(rbx, rax);
3197
+ __ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
3198
+
3199
+ // Check whether the elements is a number dictionary.
3200
+ // rdx: receiver
3201
+ // rax: key
3202
+ // rbx: key as untagged int32
3203
+ // rcx: elements
3204
+ __ LoadFromNumberDictionary(&slow, rcx, rax, rbx, r9, rdi, rax);
3205
+ __ ret(0);
3177
3206
 
3178
- MaybeObject* ExternalArrayStoreStubCompiler::CompileStore(
3179
- JSObject* receiver, ExternalArrayType array_type) {
3207
+ __ bind(&slow);
3180
3208
  // ----------- S t a t e -------------
3181
- // -- rax : value
3182
- // -- rcx : key
3209
+ // -- rax : key
3183
3210
  // -- rdx : receiver
3184
- // -- rsp[0] : return address
3211
+ // -- rsp[0] : return address
3185
3212
  // -----------------------------------
3186
- MaybeObject* maybe_stub =
3187
- KeyedStoreExternalArrayStub(array_type).TryGetCode();
3188
- Code* stub;
3189
- if (!maybe_stub->To(&stub)) return maybe_stub;
3190
- __ DispatchMap(rdx,
3191
- Handle<Map>(receiver->map()),
3192
- Handle<Code>(stub),
3193
- DO_SMI_CHECK);
3213
+ Handle<Code> slow_ic =
3214
+ masm->isolate()->builtins()->KeyedLoadIC_Slow();
3215
+ __ jmp(slow_ic, RelocInfo::CODE_TARGET);
3194
3216
 
3195
- Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss();
3196
- __ jmp(ic, RelocInfo::CODE_TARGET);
3197
-
3198
- return GetCode();
3217
+ __ bind(&miss_force_generic);
3218
+ // ----------- S t a t e -------------
3219
+ // -- rax : key
3220
+ // -- rdx : receiver
3221
+ // -- rsp[0] : return address
3222
+ // -----------------------------------
3223
+ Handle<Code> miss_ic =
3224
+ masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
3225
+ __ jmp(miss_ic, RelocInfo::CODE_TARGET);
3199
3226
  }
3200
3227
 
3201
-
3202
- #undef __
3203
- #define __ ACCESS_MASM(masm)
3204
-
3205
-
3206
3228
  void KeyedLoadStubCompiler::GenerateLoadExternalArray(
3207
3229
  MacroAssembler* masm,
3208
- ExternalArrayType array_type) {
3230
+ JSObject::ElementsKind elements_kind) {
3209
3231
  // ----------- S t a t e -------------
3210
3232
  // -- rax : key
3211
3233
  // -- rdx : receiver
@@ -3222,7 +3244,7 @@ void KeyedLoadStubCompiler::GenerateLoadExternalArray(
3222
3244
  // Check that the index is in range.
3223
3245
  __ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset));
3224
3246
  __ SmiToInteger32(rcx, rax);
3225
- __ cmpl(rcx, FieldOperand(rbx, ExternalArray::kLengthOffset));
3247
+ __ cmpq(rax, FieldOperand(rbx, ExternalArray::kLengthOffset));
3226
3248
  // Unsigned comparison catches both negative and too-large values.
3227
3249
  __ j(above_equal, &miss_force_generic);
3228
3250
 
@@ -3232,30 +3254,30 @@ void KeyedLoadStubCompiler::GenerateLoadExternalArray(
3232
3254
  // rbx: elements array
3233
3255
  __ movq(rbx, FieldOperand(rbx, ExternalArray::kExternalPointerOffset));
3234
3256
  // rbx: base pointer of external storage
3235
- switch (array_type) {
3236
- case kExternalByteArray:
3257
+ switch (elements_kind) {
3258
+ case JSObject::EXTERNAL_BYTE_ELEMENTS:
3237
3259
  __ movsxbq(rcx, Operand(rbx, rcx, times_1, 0));
3238
3260
  break;
3239
- case kExternalPixelArray:
3240
- case kExternalUnsignedByteArray:
3261
+ case JSObject::EXTERNAL_PIXEL_ELEMENTS:
3262
+ case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
3241
3263
  __ movzxbq(rcx, Operand(rbx, rcx, times_1, 0));
3242
3264
  break;
3243
- case kExternalShortArray:
3265
+ case JSObject::EXTERNAL_SHORT_ELEMENTS:
3244
3266
  __ movsxwq(rcx, Operand(rbx, rcx, times_2, 0));
3245
3267
  break;
3246
- case kExternalUnsignedShortArray:
3268
+ case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
3247
3269
  __ movzxwq(rcx, Operand(rbx, rcx, times_2, 0));
3248
3270
  break;
3249
- case kExternalIntArray:
3271
+ case JSObject::EXTERNAL_INT_ELEMENTS:
3250
3272
  __ movsxlq(rcx, Operand(rbx, rcx, times_4, 0));
3251
3273
  break;
3252
- case kExternalUnsignedIntArray:
3274
+ case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS:
3253
3275
  __ movl(rcx, Operand(rbx, rcx, times_4, 0));
3254
3276
  break;
3255
- case kExternalFloatArray:
3277
+ case JSObject::EXTERNAL_FLOAT_ELEMENTS:
3256
3278
  __ cvtss2sd(xmm0, Operand(rbx, rcx, times_4, 0));
3257
3279
  break;
3258
- case kExternalDoubleArray:
3280
+ case JSObject::EXTERNAL_DOUBLE_ELEMENTS:
3259
3281
  __ movsd(xmm0, Operand(rbx, rcx, times_8, 0));
3260
3282
  break;
3261
3283
  default:
@@ -3271,7 +3293,7 @@ void KeyedLoadStubCompiler::GenerateLoadExternalArray(
3271
3293
  // xmm0: value as double.
3272
3294
 
3273
3295
  ASSERT(kSmiValueSize == 32);
3274
- if (array_type == kExternalUnsignedIntArray) {
3296
+ if (elements_kind == JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS) {
3275
3297
  // For the UnsignedInt array type, we need to see whether
3276
3298
  // the value can be represented in a Smi. If not, we need to convert
3277
3299
  // it to a HeapNumber.
@@ -3295,8 +3317,8 @@ void KeyedLoadStubCompiler::GenerateLoadExternalArray(
3295
3317
  __ movsd(FieldOperand(rcx, HeapNumber::kValueOffset), xmm0);
3296
3318
  __ movq(rax, rcx);
3297
3319
  __ ret(0);
3298
- } else if (array_type == kExternalFloatArray ||
3299
- array_type == kExternalDoubleArray) {
3320
+ } else if (elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS ||
3321
+ elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS) {
3300
3322
  // For the floating-point array type, we need to always allocate a
3301
3323
  // HeapNumber.
3302
3324
  __ AllocateHeapNumber(rcx, rbx, &slow);
@@ -3339,7 +3361,7 @@ void KeyedLoadStubCompiler::GenerateLoadExternalArray(
3339
3361
 
3340
3362
  void KeyedStoreStubCompiler::GenerateStoreExternalArray(
3341
3363
  MacroAssembler* masm,
3342
- ExternalArrayType array_type) {
3364
+ JSObject::ElementsKind elements_kind) {
3343
3365
  // ----------- S t a t e -------------
3344
3366
  // -- rax : value
3345
3367
  // -- rcx : key
@@ -3357,7 +3379,7 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
3357
3379
  // Check that the index is in range.
3358
3380
  __ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset));
3359
3381
  __ SmiToInteger32(rdi, rcx); // Untag the index.
3360
- __ cmpl(rdi, FieldOperand(rbx, ExternalArray::kLengthOffset));
3382
+ __ cmpq(rcx, FieldOperand(rbx, ExternalArray::kLengthOffset));
3361
3383
  // Unsigned comparison catches both negative and too-large values.
3362
3384
  __ j(above_equal, &miss_force_generic);
3363
3385
 
@@ -3369,7 +3391,7 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
3369
3391
  // rbx: elements array
3370
3392
  // rdi: untagged key
3371
3393
  Label check_heap_number;
3372
- if (array_type == kExternalPixelArray) {
3394
+ if (elements_kind == JSObject::EXTERNAL_PIXEL_ELEMENTS) {
3373
3395
  // Float to pixel conversion is only implemented in the runtime for now.
3374
3396
  __ JumpIfNotSmi(rax, &slow);
3375
3397
  } else {
@@ -3379,8 +3401,8 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
3379
3401
  __ SmiToInteger32(rdx, rax);
3380
3402
  __ movq(rbx, FieldOperand(rbx, ExternalArray::kExternalPointerOffset));
3381
3403
  // rbx: base pointer of external storage
3382
- switch (array_type) {
3383
- case kExternalPixelArray:
3404
+ switch (elements_kind) {
3405
+ case JSObject::EXTERNAL_PIXEL_ELEMENTS:
3384
3406
  { // Clamp the value to [0..255].
3385
3407
  Label done;
3386
3408
  __ testl(rdx, Immediate(0xFFFFFF00));
@@ -3391,36 +3413,39 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
3391
3413
  }
3392
3414
  __ movb(Operand(rbx, rdi, times_1, 0), rdx);
3393
3415
  break;
3394
- case kExternalByteArray:
3395
- case kExternalUnsignedByteArray:
3416
+ case JSObject::EXTERNAL_BYTE_ELEMENTS:
3417
+ case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
3396
3418
  __ movb(Operand(rbx, rdi, times_1, 0), rdx);
3397
3419
  break;
3398
- case kExternalShortArray:
3399
- case kExternalUnsignedShortArray:
3420
+ case JSObject::EXTERNAL_SHORT_ELEMENTS:
3421
+ case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
3400
3422
  __ movw(Operand(rbx, rdi, times_2, 0), rdx);
3401
3423
  break;
3402
- case kExternalIntArray:
3403
- case kExternalUnsignedIntArray:
3424
+ case JSObject::EXTERNAL_INT_ELEMENTS:
3425
+ case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS:
3404
3426
  __ movl(Operand(rbx, rdi, times_4, 0), rdx);
3405
3427
  break;
3406
- case kExternalFloatArray:
3428
+ case JSObject::EXTERNAL_FLOAT_ELEMENTS:
3407
3429
  // Need to perform int-to-float conversion.
3408
3430
  __ cvtlsi2ss(xmm0, rdx);
3409
3431
  __ movss(Operand(rbx, rdi, times_4, 0), xmm0);
3410
3432
  break;
3411
- case kExternalDoubleArray:
3433
+ case JSObject::EXTERNAL_DOUBLE_ELEMENTS:
3412
3434
  // Need to perform int-to-float conversion.
3413
3435
  __ cvtlsi2sd(xmm0, rdx);
3414
3436
  __ movsd(Operand(rbx, rdi, times_8, 0), xmm0);
3415
3437
  break;
3416
- default:
3438
+ case JSObject::FAST_ELEMENTS:
3439
+ case JSObject::FAST_DOUBLE_ELEMENTS:
3440
+ case JSObject::DICTIONARY_ELEMENTS:
3441
+ case JSObject::NON_STRICT_ARGUMENTS_ELEMENTS:
3417
3442
  UNREACHABLE();
3418
3443
  break;
3419
3444
  }
3420
3445
  __ ret(0);
3421
3446
 
3422
3447
  // TODO(danno): handle heap number -> pixel array conversion
3423
- if (array_type != kExternalPixelArray) {
3448
+ if (elements_kind != JSObject::EXTERNAL_PIXEL_ELEMENTS) {
3424
3449
  __ bind(&check_heap_number);
3425
3450
  // rax: value
3426
3451
  // rcx: key (a smi)
@@ -3439,11 +3464,11 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
3439
3464
  // rdi: untagged index
3440
3465
  // rbx: base pointer of external storage
3441
3466
  // top of FPU stack: value
3442
- if (array_type == kExternalFloatArray) {
3467
+ if (elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) {
3443
3468
  __ cvtsd2ss(xmm0, xmm0);
3444
3469
  __ movss(Operand(rbx, rdi, times_4, 0), xmm0);
3445
3470
  __ ret(0);
3446
- } else if (array_type == kExternalDoubleArray) {
3471
+ } else if (elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS) {
3447
3472
  __ movsd(Operand(rbx, rdi, times_8, 0), xmm0);
3448
3473
  __ ret(0);
3449
3474
  } else {
@@ -3456,26 +3481,31 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
3456
3481
  // rdx: value (converted to an untagged integer)
3457
3482
  // rdi: untagged index
3458
3483
  // rbx: base pointer of external storage
3459
- switch (array_type) {
3460
- case kExternalByteArray:
3461
- case kExternalUnsignedByteArray:
3484
+ switch (elements_kind) {
3485
+ case JSObject::EXTERNAL_BYTE_ELEMENTS:
3486
+ case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
3462
3487
  __ cvttsd2si(rdx, xmm0);
3463
3488
  __ movb(Operand(rbx, rdi, times_1, 0), rdx);
3464
3489
  break;
3465
- case kExternalShortArray:
3466
- case kExternalUnsignedShortArray:
3490
+ case JSObject::EXTERNAL_SHORT_ELEMENTS:
3491
+ case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
3467
3492
  __ cvttsd2si(rdx, xmm0);
3468
3493
  __ movw(Operand(rbx, rdi, times_2, 0), rdx);
3469
3494
  break;
3470
- case kExternalIntArray:
3471
- case kExternalUnsignedIntArray: {
3495
+ case JSObject::EXTERNAL_INT_ELEMENTS:
3496
+ case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS:
3472
3497
  // Convert to int64, so that NaN and infinities become
3473
3498
  // 0x8000000000000000, which is zero mod 2^32.
3474
3499
  __ cvttsd2siq(rdx, xmm0);
3475
3500
  __ movl(Operand(rbx, rdi, times_4, 0), rdx);
3476
3501
  break;
3477
- }
3478
- default:
3502
+ case JSObject::EXTERNAL_PIXEL_ELEMENTS:
3503
+ case JSObject::EXTERNAL_FLOAT_ELEMENTS:
3504
+ case JSObject::EXTERNAL_DOUBLE_ELEMENTS:
3505
+ case JSObject::FAST_ELEMENTS:
3506
+ case JSObject::FAST_DOUBLE_ELEMENTS:
3507
+ case JSObject::DICTIONARY_ELEMENTS:
3508
+ case JSObject::NON_STRICT_ARGUMENTS_ELEMENTS:
3479
3509
  UNREACHABLE();
3480
3510
  break;
3481
3511
  }
@@ -3553,6 +3583,57 @@ void KeyedLoadStubCompiler::GenerateLoadFastElement(MacroAssembler* masm) {
3553
3583
  }
3554
3584
 
3555
3585
 
3586
+ void KeyedLoadStubCompiler::GenerateLoadFastDoubleElement(
3587
+ MacroAssembler* masm) {
3588
+ // ----------- S t a t e -------------
3589
+ // -- rax : key
3590
+ // -- rdx : receiver
3591
+ // -- rsp[0] : return address
3592
+ // -----------------------------------
3593
+ Label miss_force_generic, slow_allocate_heapnumber;
3594
+
3595
+ // This stub is meant to be tail-jumped to, the receiver must already
3596
+ // have been verified by the caller to not be a smi.
3597
+
3598
+ // Check that the key is a smi.
3599
+ __ JumpIfNotSmi(rax, &miss_force_generic);
3600
+
3601
+ // Get the elements array.
3602
+ __ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
3603
+ __ AssertFastElements(rcx);
3604
+
3605
+ // Check that the key is within bounds.
3606
+ __ SmiCompare(rax, FieldOperand(rcx, FixedArray::kLengthOffset));
3607
+ __ j(above_equal, &miss_force_generic);
3608
+
3609
+ // Check for the hole
3610
+ __ SmiToInteger32(kScratchRegister, rax);
3611
+ uint32_t offset = FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32);
3612
+ __ cmpl(FieldOperand(rcx, kScratchRegister, times_8, offset),
3613
+ Immediate(kHoleNanUpper32));
3614
+ __ j(equal, &miss_force_generic);
3615
+
3616
+ // Always allocate a heap number for the result.
3617
+ __ movsd(xmm0, FieldOperand(rcx, kScratchRegister, times_8,
3618
+ FixedDoubleArray::kHeaderSize));
3619
+ __ AllocateHeapNumber(rcx, rbx, &slow_allocate_heapnumber);
3620
+ // Set the value.
3621
+ __ movq(rax, rcx);
3622
+ __ movsd(FieldOperand(rcx, HeapNumber::kValueOffset), xmm0);
3623
+ __ ret(0);
3624
+
3625
+ __ bind(&slow_allocate_heapnumber);
3626
+ Handle<Code> slow_ic =
3627
+ masm->isolate()->builtins()->KeyedLoadIC_Slow();
3628
+ __ jmp(slow_ic, RelocInfo::CODE_TARGET);
3629
+
3630
+ __ bind(&miss_force_generic);
3631
+ Handle<Code> miss_ic =
3632
+ masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
3633
+ __ jmp(miss_ic, RelocInfo::CODE_TARGET);
3634
+ }
3635
+
3636
+
3556
3637
  void KeyedStoreStubCompiler::GenerateStoreFastElement(MacroAssembler* masm,
3557
3638
  bool is_js_array) {
3558
3639
  // ----------- S t a t e -------------
@@ -3603,6 +3684,91 @@ void KeyedStoreStubCompiler::GenerateStoreFastElement(MacroAssembler* masm,
3603
3684
  }
3604
3685
 
3605
3686
 
3687
+ void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(
3688
+ MacroAssembler* masm,
3689
+ bool is_js_array) {
3690
+ // ----------- S t a t e -------------
3691
+ // -- rax : value
3692
+ // -- rcx : key
3693
+ // -- rdx : receiver
3694
+ // -- rsp[0] : return address
3695
+ // -----------------------------------
3696
+ Label miss_force_generic, smi_value, is_nan, maybe_nan;
3697
+ Label have_double_value, not_nan;
3698
+
3699
+ // This stub is meant to be tail-jumped to, the receiver must already
3700
+ // have been verified by the caller to not be a smi.
3701
+
3702
+ // Check that the key is a smi.
3703
+ __ JumpIfNotSmi(rcx, &miss_force_generic);
3704
+
3705
+ // Get the elements array.
3706
+ __ movq(rdi, FieldOperand(rdx, JSObject::kElementsOffset));
3707
+ __ AssertFastElements(rdi);
3708
+
3709
+ // Check that the key is within bounds.
3710
+ if (is_js_array) {
3711
+ __ SmiCompare(rcx, FieldOperand(rdx, JSArray::kLengthOffset));
3712
+ } else {
3713
+ __ SmiCompare(rcx, FieldOperand(rdi, FixedDoubleArray::kLengthOffset));
3714
+ }
3715
+ __ j(above_equal, &miss_force_generic);
3716
+
3717
+ // Handle smi values specially
3718
+ __ JumpIfSmi(rax, &smi_value, Label::kNear);
3719
+
3720
+ __ CheckMap(rax,
3721
+ masm->isolate()->factory()->heap_number_map(),
3722
+ &miss_force_generic,
3723
+ DONT_DO_SMI_CHECK);
3724
+
3725
+ // Double value, canonicalize NaN.
3726
+ uint32_t offset = HeapNumber::kValueOffset + sizeof(kHoleNanLower32);
3727
+ __ cmpl(FieldOperand(rax, offset),
3728
+ Immediate(kNaNOrInfinityLowerBoundUpper32));
3729
+ __ j(greater_equal, &maybe_nan, Label::kNear);
3730
+
3731
+ __ bind(&not_nan);
3732
+ __ movsd(xmm0, FieldOperand(rax, HeapNumber::kValueOffset));
3733
+ __ bind(&have_double_value);
3734
+ __ SmiToInteger32(rcx, rcx);
3735
+ __ movsd(FieldOperand(rdi, rcx, times_8, FixedDoubleArray::kHeaderSize),
3736
+ xmm0);
3737
+ __ ret(0);
3738
+
3739
+ __ bind(&maybe_nan);
3740
+ // Could be NaN or Infinity. If fraction is not zero, it's NaN, otherwise
3741
+ // it's an Infinity, and the non-NaN code path applies.
3742
+ __ j(greater, &is_nan, Label::kNear);
3743
+ __ cmpl(FieldOperand(rax, HeapNumber::kValueOffset), Immediate(0));
3744
+ __ j(zero, &not_nan);
3745
+ __ bind(&is_nan);
3746
+ // Convert all NaNs to the same canonical NaN value when they are stored in
3747
+ // the double array.
3748
+ __ Set(kScratchRegister, BitCast<uint64_t>(
3749
+ FixedDoubleArray::canonical_not_the_hole_nan_as_double()));
3750
+ __ movq(xmm0, kScratchRegister);
3751
+ __ jmp(&have_double_value, Label::kNear);
3752
+
3753
+ __ bind(&smi_value);
3754
+ // Value is a smi. convert to a double and store.
3755
+ // Preserve original value.
3756
+ __ SmiToInteger32(rdx, rax);
3757
+ __ push(rdx);
3758
+ __ fild_s(Operand(rsp, 0));
3759
+ __ pop(rdx);
3760
+ __ SmiToInteger32(rcx, rcx);
3761
+ __ fstp_d(FieldOperand(rdi, rcx, times_8, FixedDoubleArray::kHeaderSize));
3762
+ __ ret(0);
3763
+
3764
+ // Handle store cache miss, replacing the ic with the generic stub.
3765
+ __ bind(&miss_force_generic);
3766
+ Handle<Code> ic_force_generic =
3767
+ masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
3768
+ __ jmp(ic_force_generic, RelocInfo::CODE_TARGET);
3769
+ }
3770
+
3771
+
3606
3772
  #undef __
3607
3773
 
3608
3774
  } } // namespace v8::internal