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
@@ -33,6 +33,7 @@
33
33
  #include "factory.h"
34
34
  #include "jsregexp.h"
35
35
  #include "runtime.h"
36
+ #include "small-pointer-list.h"
36
37
  #include "token.h"
37
38
  #include "variables.h"
38
39
 
@@ -60,8 +61,8 @@ namespace internal {
60
61
  V(ContinueStatement) \
61
62
  V(BreakStatement) \
62
63
  V(ReturnStatement) \
63
- V(WithEnterStatement) \
64
- V(WithExitStatement) \
64
+ V(WithStatement) \
65
+ V(ExitContextStatement) \
65
66
  V(SwitchStatement) \
66
67
  V(DoWhileStatement) \
67
68
  V(WhileStatement) \
@@ -80,7 +81,6 @@ namespace internal {
80
81
  V(RegExpLiteral) \
81
82
  V(ObjectLiteral) \
82
83
  V(ArrayLiteral) \
83
- V(CatchExtensionObject) \
84
84
  V(Assignment) \
85
85
  V(Throw) \
86
86
  V(Property) \
@@ -135,11 +135,15 @@ class AstNode: public ZoneObject {
135
135
  static const int kNoNumber = -1;
136
136
  static const int kFunctionEntryId = 2; // Using 0 could disguise errors.
137
137
 
138
- AstNode() : id_(GetNextId()) {
139
- Isolate* isolate = Isolate::Current();
138
+ // Override ZoneObject's new to count allocated AST nodes.
139
+ void* operator new(size_t size, Zone* zone) {
140
+ Isolate* isolate = zone->isolate();
140
141
  isolate->set_ast_node_count(isolate->ast_node_count() + 1);
142
+ return zone->New(static_cast<int>(size));
141
143
  }
142
144
 
145
+ AstNode() {}
146
+
143
147
  virtual ~AstNode() { }
144
148
 
145
149
  virtual void Accept(AstVisitor* v) = 0;
@@ -164,24 +168,22 @@ class AstNode: public ZoneObject {
164
168
 
165
169
  static int Count() { return Isolate::Current()->ast_node_count(); }
166
170
  static void ResetIds() { Isolate::Current()->set_ast_node_id(0); }
167
- unsigned id() const { return id_; }
168
171
 
169
172
  protected:
170
- static unsigned GetNextId() {
171
- Isolate* isolate = Isolate::Current();
172
- unsigned tmp = isolate->ast_node_id();
173
- isolate->set_ast_node_id(tmp + 1);
174
- return tmp;
173
+ static unsigned GetNextId(Isolate* isolate) {
174
+ return ReserveIdRange(isolate, 1);
175
175
  }
176
- static unsigned ReserveIdRange(int n) {
177
- Isolate* isolate = Isolate::Current();
176
+
177
+ static unsigned ReserveIdRange(Isolate* isolate, int n) {
178
178
  unsigned tmp = isolate->ast_node_id();
179
179
  isolate->set_ast_node_id(tmp + n);
180
180
  return tmp;
181
181
  }
182
182
 
183
183
  private:
184
- unsigned id_;
184
+ // Hidden to prevent accidental usage. It would have to load the
185
+ // current zone from the TLS.
186
+ void* operator new(size_t size);
185
187
 
186
188
  friend class CaseClause; // Generates AST IDs.
187
189
  };
@@ -206,6 +208,36 @@ class Statement: public AstNode {
206
208
  };
207
209
 
208
210
 
211
+ class SmallMapList {
212
+ public:
213
+ SmallMapList() {}
214
+ explicit SmallMapList(int capacity) : list_(capacity) {}
215
+
216
+ void Reserve(int capacity) { list_.Reserve(capacity); }
217
+ void Clear() { list_.Clear(); }
218
+
219
+ bool is_empty() const { return list_.is_empty(); }
220
+ int length() const { return list_.length(); }
221
+
222
+ void Add(Handle<Map> handle) {
223
+ list_.Add(handle.location());
224
+ }
225
+
226
+ Handle<Map> at(int i) const {
227
+ return Handle<Map>(list_.at(i));
228
+ }
229
+
230
+ Handle<Map> first() const { return at(0); }
231
+ Handle<Map> last() const { return at(length() - 1); }
232
+
233
+ private:
234
+ // The list stores pointers to Map*, that is Map**, so it's GC safe.
235
+ SmallPointerList<Map*> list_;
236
+
237
+ DISALLOW_COPY_AND_ASSIGN(SmallMapList);
238
+ };
239
+
240
+
209
241
  class Expression: public AstNode {
210
242
  public:
211
243
  enum Context {
@@ -220,7 +252,9 @@ class Expression: public AstNode {
220
252
  kTest
221
253
  };
222
254
 
223
- Expression() {}
255
+ explicit Expression(Isolate* isolate)
256
+ : id_(GetNextId(isolate)),
257
+ test_id_(GetNextId(isolate)) {}
224
258
 
225
259
  virtual int position() const {
226
260
  UNREACHABLE();
@@ -262,24 +296,23 @@ class Expression: public AstNode {
262
296
  UNREACHABLE();
263
297
  return false;
264
298
  }
265
- virtual ZoneMapList* GetReceiverTypes() {
299
+ virtual SmallMapList* GetReceiverTypes() {
266
300
  UNREACHABLE();
267
301
  return NULL;
268
302
  }
269
- virtual Handle<Map> GetMonomorphicReceiverType() {
270
- UNREACHABLE();
271
- return Handle<Map>();
303
+ Handle<Map> GetMonomorphicReceiverType() {
304
+ ASSERT(IsMonomorphic());
305
+ SmallMapList* types = GetReceiverTypes();
306
+ ASSERT(types != NULL && types->length() == 1);
307
+ return types->at(0);
272
308
  }
273
309
 
274
- ExternalArrayType external_array_type() const {
275
- return external_array_type_;
276
- }
277
- void set_external_array_type(ExternalArrayType array_type) {
278
- external_array_type_ = array_type;
279
- }
310
+ unsigned id() const { return id_; }
311
+ unsigned test_id() const { return test_id_; }
280
312
 
281
313
  private:
282
- ExternalArrayType external_array_type_;
314
+ unsigned id_;
315
+ unsigned test_id_;
283
316
  };
284
317
 
285
318
 
@@ -290,6 +323,7 @@ class Expression: public AstNode {
290
323
  */
291
324
  class ValidLeftHandSideSentinel: public Expression {
292
325
  public:
326
+ explicit ValidLeftHandSideSentinel(Isolate* isolate) : Expression(isolate) {}
293
327
  virtual bool IsValidLeftHandSide() { return true; }
294
328
  virtual void Accept(AstVisitor* v) { UNREACHABLE(); }
295
329
  virtual bool IsInlineable() const;
@@ -321,7 +355,7 @@ class BreakableStatement: public Statement {
321
355
  int ExitId() const { return exit_id_; }
322
356
 
323
357
  protected:
324
- inline BreakableStatement(ZoneStringList* labels, Type type);
358
+ BreakableStatement(Isolate* isolate, ZoneStringList* labels, Type type);
325
359
 
326
360
  private:
327
361
  ZoneStringList* labels_;
@@ -334,7 +368,10 @@ class BreakableStatement: public Statement {
334
368
 
335
369
  class Block: public BreakableStatement {
336
370
  public:
337
- inline Block(ZoneStringList* labels, int capacity, bool is_initializer_block);
371
+ inline Block(Isolate* isolate,
372
+ ZoneStringList* labels,
373
+ int capacity,
374
+ bool is_initializer_block);
338
375
 
339
376
  DECLARE_NODE_TYPE(Block)
340
377
 
@@ -355,9 +392,13 @@ class Block: public BreakableStatement {
355
392
  ZoneList<Statement*>* statements() { return &statements_; }
356
393
  bool is_initializer_block() const { return is_initializer_block_; }
357
394
 
395
+ Scope* block_scope() const { return block_scope_; }
396
+ void set_block_scope(Scope* block_scope) { block_scope_ = block_scope; }
397
+
358
398
  private:
359
399
  ZoneList<Statement*> statements_;
360
400
  bool is_initializer_block_;
401
+ Scope* block_scope_;
361
402
  };
362
403
 
363
404
 
@@ -367,9 +408,11 @@ class Declaration: public AstNode {
367
408
  : proxy_(proxy),
368
409
  mode_(mode),
369
410
  fun_(fun) {
370
- ASSERT(mode == Variable::VAR || mode == Variable::CONST);
411
+ ASSERT(mode == Variable::VAR ||
412
+ mode == Variable::CONST ||
413
+ mode == Variable::LET);
371
414
  // At the moment there are no "const functions"'s in JavaScript...
372
- ASSERT(fun == NULL || mode == Variable::VAR);
415
+ ASSERT(fun == NULL || mode == Variable::VAR || mode == Variable::LET);
373
416
  }
374
417
 
375
418
  DECLARE_NODE_TYPE(Declaration)
@@ -396,12 +439,13 @@ class IterationStatement: public BreakableStatement {
396
439
  // Bailout support.
397
440
  int OsrEntryId() const { return osr_entry_id_; }
398
441
  virtual int ContinueId() const = 0;
442
+ virtual int StackCheckId() const = 0;
399
443
 
400
444
  // Code generation
401
445
  Label* continue_target() { return &continue_target_; }
402
446
 
403
447
  protected:
404
- explicit inline IterationStatement(ZoneStringList* labels);
448
+ inline IterationStatement(Isolate* isolate, ZoneStringList* labels);
405
449
 
406
450
  void Initialize(Statement* body) {
407
451
  body_ = body;
@@ -416,7 +460,7 @@ class IterationStatement: public BreakableStatement {
416
460
 
417
461
  class DoWhileStatement: public IterationStatement {
418
462
  public:
419
- explicit inline DoWhileStatement(ZoneStringList* labels);
463
+ inline DoWhileStatement(Isolate* isolate, ZoneStringList* labels);
420
464
 
421
465
  DECLARE_NODE_TYPE(DoWhileStatement)
422
466
 
@@ -434,6 +478,7 @@ class DoWhileStatement: public IterationStatement {
434
478
 
435
479
  // Bailout support.
436
480
  virtual int ContinueId() const { return continue_id_; }
481
+ virtual int StackCheckId() const { return back_edge_id_; }
437
482
  int BackEdgeId() const { return back_edge_id_; }
438
483
 
439
484
  virtual bool IsInlineable() const;
@@ -448,7 +493,7 @@ class DoWhileStatement: public IterationStatement {
448
493
 
449
494
  class WhileStatement: public IterationStatement {
450
495
  public:
451
- explicit inline WhileStatement(ZoneStringList* labels);
496
+ inline WhileStatement(Isolate* isolate, ZoneStringList* labels);
452
497
 
453
498
  DECLARE_NODE_TYPE(WhileStatement)
454
499
 
@@ -468,6 +513,7 @@ class WhileStatement: public IterationStatement {
468
513
 
469
514
  // Bailout support.
470
515
  virtual int ContinueId() const { return EntryId(); }
516
+ virtual int StackCheckId() const { return body_id_; }
471
517
  int BodyId() const { return body_id_; }
472
518
 
473
519
  private:
@@ -480,7 +526,7 @@ class WhileStatement: public IterationStatement {
480
526
 
481
527
  class ForStatement: public IterationStatement {
482
528
  public:
483
- explicit inline ForStatement(ZoneStringList* labels);
529
+ inline ForStatement(Isolate* isolate, ZoneStringList* labels);
484
530
 
485
531
  DECLARE_NODE_TYPE(ForStatement)
486
532
 
@@ -507,6 +553,7 @@ class ForStatement: public IterationStatement {
507
553
 
508
554
  // Bailout support.
509
555
  virtual int ContinueId() const { return continue_id_; }
556
+ virtual int StackCheckId() const { return body_id_; }
510
557
  int BodyId() const { return body_id_; }
511
558
 
512
559
  bool is_fast_smi_loop() { return loop_variable_ != NULL; }
@@ -528,7 +575,7 @@ class ForStatement: public IterationStatement {
528
575
 
529
576
  class ForInStatement: public IterationStatement {
530
577
  public:
531
- explicit inline ForInStatement(ZoneStringList* labels);
578
+ inline ForInStatement(Isolate* isolate, ZoneStringList* labels);
532
579
 
533
580
  DECLARE_NODE_TYPE(ForInStatement)
534
581
 
@@ -545,6 +592,7 @@ class ForInStatement: public IterationStatement {
545
592
  // Bailout support.
546
593
  int AssignmentId() const { return assignment_id_; }
547
594
  virtual int ContinueId() const { return EntryId(); }
595
+ virtual int StackCheckId() const { return EntryId(); }
548
596
 
549
597
  private:
550
598
  Expression* each_;
@@ -618,37 +666,38 @@ class ReturnStatement: public Statement {
618
666
  };
619
667
 
620
668
 
621
- class WithEnterStatement: public Statement {
669
+ class WithStatement: public Statement {
622
670
  public:
623
- explicit WithEnterStatement(Expression* expression, bool is_catch_block)
624
- : expression_(expression), is_catch_block_(is_catch_block) { }
671
+ WithStatement(Expression* expression, Statement* statement)
672
+ : expression_(expression), statement_(statement) { }
625
673
 
626
- DECLARE_NODE_TYPE(WithEnterStatement)
674
+ DECLARE_NODE_TYPE(WithStatement)
627
675
 
628
676
  Expression* expression() const { return expression_; }
677
+ Statement* statement() const { return statement_; }
629
678
 
630
- bool is_catch_block() const { return is_catch_block_; }
631
679
  virtual bool IsInlineable() const;
632
680
 
633
681
  private:
634
682
  Expression* expression_;
635
- bool is_catch_block_;
683
+ Statement* statement_;
636
684
  };
637
685
 
638
686
 
639
- class WithExitStatement: public Statement {
687
+ class ExitContextStatement: public Statement {
640
688
  public:
641
- WithExitStatement() { }
642
-
643
689
  virtual bool IsInlineable() const;
644
690
 
645
- DECLARE_NODE_TYPE(WithExitStatement)
691
+ DECLARE_NODE_TYPE(ExitContextStatement)
646
692
  };
647
693
 
648
694
 
649
695
  class CaseClause: public ZoneObject {
650
696
  public:
651
- CaseClause(Expression* label, ZoneList<Statement*>* statements, int pos);
697
+ CaseClause(Isolate* isolate,
698
+ Expression* label,
699
+ ZoneList<Statement*>* statements,
700
+ int pos);
652
701
 
653
702
  bool is_default() const { return label_ == NULL; }
654
703
  Expression* label() const {
@@ -683,7 +732,7 @@ class CaseClause: public ZoneObject {
683
732
 
684
733
  class SwitchStatement: public BreakableStatement {
685
734
  public:
686
- explicit inline SwitchStatement(ZoneStringList* labels);
735
+ inline SwitchStatement(Isolate* isolate, ZoneStringList* labels);
687
736
 
688
737
  DECLARE_NODE_TYPE(SwitchStatement)
689
738
 
@@ -709,14 +758,16 @@ class SwitchStatement: public BreakableStatement {
709
758
  // given if-statement has a then- or an else-part containing code.
710
759
  class IfStatement: public Statement {
711
760
  public:
712
- IfStatement(Expression* condition,
761
+ IfStatement(Isolate* isolate,
762
+ Expression* condition,
713
763
  Statement* then_statement,
714
764
  Statement* else_statement)
715
765
  : condition_(condition),
716
766
  then_statement_(then_statement),
717
767
  else_statement_(else_statement),
718
- then_id_(GetNextId()),
719
- else_id_(GetNextId()) {
768
+ if_id_(GetNextId(isolate)),
769
+ then_id_(GetNextId(isolate)),
770
+ else_id_(GetNextId(isolate)) {
720
771
  }
721
772
 
722
773
  DECLARE_NODE_TYPE(IfStatement)
@@ -730,6 +781,7 @@ class IfStatement: public Statement {
730
781
  Statement* then_statement() const { return then_statement_; }
731
782
  Statement* else_statement() const { return else_statement_; }
732
783
 
784
+ int IfId() const { return if_id_; }
733
785
  int ThenId() const { return then_id_; }
734
786
  int ElseId() const { return else_id_; }
735
787
 
@@ -737,6 +789,7 @@ class IfStatement: public Statement {
737
789
  Expression* condition_;
738
790
  Statement* then_statement_;
739
791
  Statement* else_statement_;
792
+ int if_id_;
740
793
  int then_id_;
741
794
  int else_id_;
742
795
  };
@@ -746,9 +799,7 @@ class IfStatement: public Statement {
746
799
  // stack in the compiler; this should probably be reworked.
747
800
  class TargetCollector: public AstNode {
748
801
  public:
749
- explicit TargetCollector(ZoneList<Label*>* targets)
750
- : targets_(targets) {
751
- }
802
+ TargetCollector(): targets_(0) { }
752
803
 
753
804
  // Adds a jump target to the collector. The collector stores a pointer not
754
805
  // a copy of the target to make binding work, so make sure not to pass in
@@ -759,11 +810,11 @@ class TargetCollector: public AstNode {
759
810
  virtual void Accept(AstVisitor* v) { UNREACHABLE(); }
760
811
  virtual TargetCollector* AsTargetCollector() { return this; }
761
812
 
762
- ZoneList<Label*>* targets() { return targets_; }
813
+ ZoneList<Label*>* targets() { return &targets_; }
763
814
  virtual bool IsInlineable() const;
764
815
 
765
816
  private:
766
- ZoneList<Label*>* targets_;
817
+ ZoneList<Label*> targets_;
767
818
  };
768
819
 
769
820
 
@@ -789,21 +840,25 @@ class TryStatement: public Statement {
789
840
  class TryCatchStatement: public TryStatement {
790
841
  public:
791
842
  TryCatchStatement(Block* try_block,
792
- VariableProxy* catch_var,
843
+ Scope* scope,
844
+ Variable* variable,
793
845
  Block* catch_block)
794
846
  : TryStatement(try_block),
795
- catch_var_(catch_var),
847
+ scope_(scope),
848
+ variable_(variable),
796
849
  catch_block_(catch_block) {
797
850
  }
798
851
 
799
852
  DECLARE_NODE_TYPE(TryCatchStatement)
800
853
 
801
- VariableProxy* catch_var() const { return catch_var_; }
854
+ Scope* scope() { return scope_; }
855
+ Variable* variable() { return variable_; }
802
856
  Block* catch_block() const { return catch_block_; }
803
857
  virtual bool IsInlineable() const;
804
858
 
805
859
  private:
806
- VariableProxy* catch_var_;
860
+ Scope* scope_;
861
+ Variable* variable_;
807
862
  Block* catch_block_;
808
863
  };
809
864
 
@@ -841,7 +896,8 @@ class EmptyStatement: public Statement {
841
896
 
842
897
  class Literal: public Expression {
843
898
  public:
844
- explicit Literal(Handle<Object> handle) : handle_(handle) { }
899
+ Literal(Isolate* isolate, Handle<Object> handle)
900
+ : Expression(isolate), handle_(handle) { }
845
901
 
846
902
  DECLARE_NODE_TYPE(Literal)
847
903
 
@@ -894,8 +950,14 @@ class Literal: public Expression {
894
950
  // Base class for literals that needs space in the corresponding JSFunction.
895
951
  class MaterializedLiteral: public Expression {
896
952
  public:
897
- explicit MaterializedLiteral(int literal_index, bool is_simple, int depth)
898
- : literal_index_(literal_index), is_simple_(is_simple), depth_(depth) {}
953
+ MaterializedLiteral(Isolate* isolate,
954
+ int literal_index,
955
+ bool is_simple,
956
+ int depth)
957
+ : Expression(isolate),
958
+ literal_index_(literal_index),
959
+ is_simple_(is_simple),
960
+ depth_(depth) {}
899
961
 
900
962
  virtual MaterializedLiteral* AsMaterializedLiteral() { return this; }
901
963
 
@@ -951,14 +1013,15 @@ class ObjectLiteral: public MaterializedLiteral {
951
1013
  bool emit_store_;
952
1014
  };
953
1015
 
954
- ObjectLiteral(Handle<FixedArray> constant_properties,
1016
+ ObjectLiteral(Isolate* isolate,
1017
+ Handle<FixedArray> constant_properties,
955
1018
  ZoneList<Property*>* properties,
956
1019
  int literal_index,
957
1020
  bool is_simple,
958
1021
  bool fast_elements,
959
1022
  int depth,
960
1023
  bool has_function)
961
- : MaterializedLiteral(literal_index, is_simple, depth),
1024
+ : MaterializedLiteral(isolate, literal_index, is_simple, depth),
962
1025
  constant_properties_(constant_properties),
963
1026
  properties_(properties),
964
1027
  fast_elements_(fast_elements),
@@ -997,10 +1060,11 @@ class ObjectLiteral: public MaterializedLiteral {
997
1060
  // Node for capturing a regexp literal.
998
1061
  class RegExpLiteral: public MaterializedLiteral {
999
1062
  public:
1000
- RegExpLiteral(Handle<String> pattern,
1063
+ RegExpLiteral(Isolate* isolate,
1064
+ Handle<String> pattern,
1001
1065
  Handle<String> flags,
1002
1066
  int literal_index)
1003
- : MaterializedLiteral(literal_index, false, 1),
1067
+ : MaterializedLiteral(isolate, literal_index, false, 1),
1004
1068
  pattern_(pattern),
1005
1069
  flags_(flags) {}
1006
1070
 
@@ -1018,15 +1082,16 @@ class RegExpLiteral: public MaterializedLiteral {
1018
1082
  // for minimizing the work when constructing it at runtime.
1019
1083
  class ArrayLiteral: public MaterializedLiteral {
1020
1084
  public:
1021
- ArrayLiteral(Handle<FixedArray> constant_elements,
1085
+ ArrayLiteral(Isolate* isolate,
1086
+ Handle<FixedArray> constant_elements,
1022
1087
  ZoneList<Expression*>* values,
1023
1088
  int literal_index,
1024
1089
  bool is_simple,
1025
1090
  int depth)
1026
- : MaterializedLiteral(literal_index, is_simple, depth),
1091
+ : MaterializedLiteral(isolate, literal_index, is_simple, depth),
1027
1092
  constant_elements_(constant_elements),
1028
1093
  values_(values),
1029
- first_element_id_(ReserveIdRange(values->length())) {}
1094
+ first_element_id_(ReserveIdRange(isolate, values->length())) {}
1030
1095
 
1031
1096
  DECLARE_NODE_TYPE(ArrayLiteral)
1032
1097
 
@@ -1043,44 +1108,14 @@ class ArrayLiteral: public MaterializedLiteral {
1043
1108
  };
1044
1109
 
1045
1110
 
1046
- // Node for constructing a context extension object for a catch block.
1047
- // The catch context extension object has one property, the catch
1048
- // variable, which should be DontDelete.
1049
- class CatchExtensionObject: public Expression {
1050
- public:
1051
- CatchExtensionObject(Literal* key, VariableProxy* value)
1052
- : key_(key), value_(value) {
1053
- }
1054
-
1055
- DECLARE_NODE_TYPE(CatchExtensionObject)
1056
-
1057
- Literal* key() const { return key_; }
1058
- VariableProxy* value() const { return value_; }
1059
- virtual bool IsInlineable() const;
1060
-
1061
- private:
1062
- Literal* key_;
1063
- VariableProxy* value_;
1064
- };
1065
-
1066
-
1067
1111
  class VariableProxy: public Expression {
1068
1112
  public:
1069
- explicit VariableProxy(Variable* var);
1113
+ VariableProxy(Isolate* isolate, Variable* var);
1070
1114
 
1071
1115
  DECLARE_NODE_TYPE(VariableProxy)
1072
1116
 
1073
1117
  // Type testing & conversion
1074
- virtual Property* AsProperty() {
1075
- return var_ == NULL ? NULL : var_->AsProperty();
1076
- }
1077
-
1078
- Variable* AsVariable() {
1079
- if (this == NULL || var_ == NULL) return NULL;
1080
- Expression* rewrite = var_->rewrite();
1081
- if (rewrite == NULL || rewrite->AsSlot() != NULL) return var_;
1082
- return NULL;
1083
- }
1118
+ Variable* AsVariable() { return (this == NULL) ? NULL : var_; }
1084
1119
 
1085
1120
  virtual bool IsValidLeftHandSide() {
1086
1121
  return var_ == NULL ? true : var_->IsValidLeftHandSide();
@@ -1122,11 +1157,12 @@ class VariableProxy: public Expression {
1122
1157
  bool is_trivial_;
1123
1158
  int position_;
1124
1159
 
1125
- VariableProxy(Handle<String> name,
1160
+ VariableProxy(Isolate* isolate,
1161
+ Handle<String> name,
1126
1162
  bool is_this,
1127
1163
  bool inside_with,
1128
1164
  int position = RelocInfo::kNoPosition);
1129
- explicit VariableProxy(bool is_this);
1165
+ VariableProxy(Isolate* isolate, bool is_this);
1130
1166
 
1131
1167
  friend class Scope;
1132
1168
  };
@@ -1137,7 +1173,8 @@ class VariableProxySentinel: public VariableProxy {
1137
1173
  virtual bool IsValidLeftHandSide() { return !is_this(); }
1138
1174
 
1139
1175
  private:
1140
- explicit VariableProxySentinel(bool is_this) : VariableProxy(is_this) { }
1176
+ VariableProxySentinel(Isolate* isolate, bool is_this)
1177
+ : VariableProxy(isolate, is_this) { }
1141
1178
 
1142
1179
  friend class AstSentinels;
1143
1180
  };
@@ -1167,8 +1204,8 @@ class Slot: public Expression {
1167
1204
  LOOKUP
1168
1205
  };
1169
1206
 
1170
- Slot(Variable* var, Type type, int index)
1171
- : var_(var), type_(type), index_(index) {
1207
+ Slot(Isolate* isolate, Variable* var, Type type, int index)
1208
+ : Expression(isolate), var_(var), type_(type), index_(index) {
1172
1209
  ASSERT(var != NULL);
1173
1210
  }
1174
1211
 
@@ -1194,23 +1231,19 @@ class Slot: public Expression {
1194
1231
 
1195
1232
  class Property: public Expression {
1196
1233
  public:
1197
- // Synthetic properties are property lookups introduced by the system,
1198
- // to objects that aren't visible to the user. Function calls to synthetic
1199
- // properties should use the global object as receiver, not the base object
1200
- // of the resolved Reference.
1201
- enum Type { NORMAL, SYNTHETIC };
1202
- Property(Expression* obj, Expression* key, int pos, Type type = NORMAL)
1203
- : obj_(obj),
1234
+ Property(Isolate* isolate,
1235
+ Expression* obj,
1236
+ Expression* key,
1237
+ int pos)
1238
+ : Expression(isolate),
1239
+ obj_(obj),
1204
1240
  key_(key),
1205
1241
  pos_(pos),
1206
- type_(type),
1207
- receiver_types_(NULL),
1208
1242
  is_monomorphic_(false),
1209
1243
  is_array_length_(false),
1210
1244
  is_string_length_(false),
1211
1245
  is_string_access_(false),
1212
- is_function_prototype_(false),
1213
- is_arguments_access_(false) { }
1246
+ is_function_prototype_(false) { }
1214
1247
 
1215
1248
  DECLARE_NODE_TYPE(Property)
1216
1249
 
@@ -1220,55 +1253,44 @@ class Property: public Expression {
1220
1253
  Expression* obj() const { return obj_; }
1221
1254
  Expression* key() const { return key_; }
1222
1255
  virtual int position() const { return pos_; }
1223
- bool is_synthetic() const { return type_ == SYNTHETIC; }
1224
1256
 
1225
1257
  bool IsStringLength() const { return is_string_length_; }
1226
1258
  bool IsStringAccess() const { return is_string_access_; }
1227
1259
  bool IsFunctionPrototype() const { return is_function_prototype_; }
1228
1260
 
1229
- // Marks that this is actually an argument rewritten to a keyed property
1230
- // accessing the argument through the arguments shadow object.
1231
- void set_is_arguments_access(bool is_arguments_access) {
1232
- is_arguments_access_ = is_arguments_access;
1233
- }
1234
- bool is_arguments_access() const { return is_arguments_access_; }
1235
-
1236
1261
  // Type feedback information.
1237
1262
  void RecordTypeFeedback(TypeFeedbackOracle* oracle);
1238
1263
  virtual bool IsMonomorphic() { return is_monomorphic_; }
1239
- virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; }
1264
+ virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; }
1240
1265
  virtual bool IsArrayLength() { return is_array_length_; }
1241
- virtual Handle<Map> GetMonomorphicReceiverType() {
1242
- return monomorphic_receiver_type_;
1243
- }
1244
1266
 
1245
1267
  private:
1246
1268
  Expression* obj_;
1247
1269
  Expression* key_;
1248
1270
  int pos_;
1249
- Type type_;
1250
1271
 
1251
- ZoneMapList* receiver_types_;
1272
+ SmallMapList receiver_types_;
1252
1273
  bool is_monomorphic_ : 1;
1253
1274
  bool is_array_length_ : 1;
1254
1275
  bool is_string_length_ : 1;
1255
1276
  bool is_string_access_ : 1;
1256
1277
  bool is_function_prototype_ : 1;
1257
- bool is_arguments_access_ : 1;
1258
- Handle<Map> monomorphic_receiver_type_;
1259
1278
  };
1260
1279
 
1261
1280
 
1262
1281
  class Call: public Expression {
1263
1282
  public:
1264
- Call(Expression* expression, ZoneList<Expression*>* arguments, int pos)
1265
- : expression_(expression),
1283
+ Call(Isolate* isolate,
1284
+ Expression* expression,
1285
+ ZoneList<Expression*>* arguments,
1286
+ int pos)
1287
+ : Expression(isolate),
1288
+ expression_(expression),
1266
1289
  arguments_(arguments),
1267
1290
  pos_(pos),
1268
1291
  is_monomorphic_(false),
1269
1292
  check_type_(RECEIVER_MAP_CHECK),
1270
- receiver_types_(NULL),
1271
- return_id_(GetNextId()) {
1293
+ return_id_(GetNextId(isolate)) {
1272
1294
  }
1273
1295
 
1274
1296
  DECLARE_NODE_TYPE(Call)
@@ -1281,7 +1303,7 @@ class Call: public Expression {
1281
1303
 
1282
1304
  void RecordTypeFeedback(TypeFeedbackOracle* oracle,
1283
1305
  CallKind call_kind);
1284
- virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; }
1306
+ virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; }
1285
1307
  virtual bool IsMonomorphic() { return is_monomorphic_; }
1286
1308
  CheckType check_type() const { return check_type_; }
1287
1309
  Handle<JSFunction> target() { return target_; }
@@ -1306,7 +1328,7 @@ class Call: public Expression {
1306
1328
 
1307
1329
  bool is_monomorphic_;
1308
1330
  CheckType check_type_;
1309
- ZoneMapList* receiver_types_;
1331
+ SmallMapList receiver_types_;
1310
1332
  Handle<JSFunction> target_;
1311
1333
  Handle<JSObject> holder_;
1312
1334
  Handle<JSGlobalPropertyCell> cell_;
@@ -1347,8 +1369,14 @@ class AstSentinels {
1347
1369
 
1348
1370
  class CallNew: public Expression {
1349
1371
  public:
1350
- CallNew(Expression* expression, ZoneList<Expression*>* arguments, int pos)
1351
- : expression_(expression), arguments_(arguments), pos_(pos) { }
1372
+ CallNew(Isolate* isolate,
1373
+ Expression* expression,
1374
+ ZoneList<Expression*>* arguments,
1375
+ int pos)
1376
+ : Expression(isolate),
1377
+ expression_(expression),
1378
+ arguments_(arguments),
1379
+ pos_(pos) { }
1352
1380
 
1353
1381
  DECLARE_NODE_TYPE(CallNew)
1354
1382
 
@@ -1371,10 +1399,14 @@ class CallNew: public Expression {
1371
1399
  // implemented in JavaScript (see "v8natives.js").
1372
1400
  class CallRuntime: public Expression {
1373
1401
  public:
1374
- CallRuntime(Handle<String> name,
1402
+ CallRuntime(Isolate* isolate,
1403
+ Handle<String> name,
1375
1404
  const Runtime::Function* function,
1376
1405
  ZoneList<Expression*>* arguments)
1377
- : name_(name), function_(function), arguments_(arguments) { }
1406
+ : Expression(isolate),
1407
+ name_(name),
1408
+ function_(function),
1409
+ arguments_(arguments) { }
1378
1410
 
1379
1411
  DECLARE_NODE_TYPE(CallRuntime)
1380
1412
 
@@ -1394,8 +1426,11 @@ class CallRuntime: public Expression {
1394
1426
 
1395
1427
  class UnaryOperation: public Expression {
1396
1428
  public:
1397
- UnaryOperation(Token::Value op, Expression* expression, int pos)
1398
- : op_(op), expression_(expression), pos_(pos) {
1429
+ UnaryOperation(Isolate* isolate,
1430
+ Token::Value op,
1431
+ Expression* expression,
1432
+ int pos)
1433
+ : Expression(isolate), op_(op), expression_(expression), pos_(pos) {
1399
1434
  ASSERT(Token::IsUnaryOp(op));
1400
1435
  }
1401
1436
 
@@ -1418,14 +1453,15 @@ class UnaryOperation: public Expression {
1418
1453
 
1419
1454
  class BinaryOperation: public Expression {
1420
1455
  public:
1421
- BinaryOperation(Token::Value op,
1456
+ BinaryOperation(Isolate* isolate,
1457
+ Token::Value op,
1422
1458
  Expression* left,
1423
1459
  Expression* right,
1424
1460
  int pos)
1425
- : op_(op), left_(left), right_(right), pos_(pos) {
1461
+ : Expression(isolate), op_(op), left_(left), right_(right), pos_(pos) {
1426
1462
  ASSERT(Token::IsBinaryOp(op));
1427
1463
  right_id_ = (op == Token::AND || op == Token::OR)
1428
- ? static_cast<int>(GetNextId())
1464
+ ? static_cast<int>(GetNextId(isolate))
1429
1465
  : AstNode::kNoNumber;
1430
1466
  }
1431
1467
 
@@ -1456,13 +1492,18 @@ class BinaryOperation: public Expression {
1456
1492
 
1457
1493
  class CountOperation: public Expression {
1458
1494
  public:
1459
- CountOperation(Token::Value op, bool is_prefix, Expression* expr, int pos)
1460
- : op_(op),
1495
+ CountOperation(Isolate* isolate,
1496
+ Token::Value op,
1497
+ bool is_prefix,
1498
+ Expression* expr,
1499
+ int pos)
1500
+ : Expression(isolate),
1501
+ op_(op),
1461
1502
  is_prefix_(is_prefix),
1462
1503
  expression_(expr),
1463
1504
  pos_(pos),
1464
- assignment_id_(GetNextId()),
1465
- count_id_(GetNextId()) { }
1505
+ assignment_id_(GetNextId(isolate)),
1506
+ count_id_(GetNextId(isolate)) {}
1466
1507
 
1467
1508
  DECLARE_NODE_TYPE(CountOperation)
1468
1509
 
@@ -1483,9 +1524,7 @@ class CountOperation: public Expression {
1483
1524
 
1484
1525
  void RecordTypeFeedback(TypeFeedbackOracle* oracle);
1485
1526
  virtual bool IsMonomorphic() { return is_monomorphic_; }
1486
- virtual Handle<Map> GetMonomorphicReceiverType() {
1487
- return monomorphic_receiver_type_;
1488
- }
1527
+ virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; }
1489
1528
 
1490
1529
  // Bailout support.
1491
1530
  int AssignmentId() const { return assignment_id_; }
@@ -1499,17 +1538,23 @@ class CountOperation: public Expression {
1499
1538
  int pos_;
1500
1539
  int assignment_id_;
1501
1540
  int count_id_;
1502
- Handle<Map> monomorphic_receiver_type_;
1541
+ SmallMapList receiver_types_;
1503
1542
  };
1504
1543
 
1505
1544
 
1506
1545
  class CompareOperation: public Expression {
1507
1546
  public:
1508
- CompareOperation(Token::Value op,
1547
+ CompareOperation(Isolate* isolate,
1548
+ Token::Value op,
1509
1549
  Expression* left,
1510
1550
  Expression* right,
1511
1551
  int pos)
1512
- : op_(op), left_(left), right_(right), pos_(pos), compare_type_(NONE) {
1552
+ : Expression(isolate),
1553
+ op_(op),
1554
+ left_(left),
1555
+ right_(right),
1556
+ pos_(pos),
1557
+ compare_type_(NONE) {
1513
1558
  ASSERT(Token::IsCompareOp(op));
1514
1559
  }
1515
1560
 
@@ -1527,6 +1572,10 @@ class CompareOperation: public Expression {
1527
1572
  bool IsSmiCompare() { return compare_type_ == SMI_ONLY; }
1528
1573
  bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; }
1529
1574
 
1575
+ // Match special cases.
1576
+ bool IsLiteralCompareTypeof(Expression** expr, Handle<String>* check);
1577
+ bool IsLiteralCompareUndefined(Expression** expr);
1578
+
1530
1579
  private:
1531
1580
  Token::Value op_;
1532
1581
  Expression* left_;
@@ -1540,8 +1589,8 @@ class CompareOperation: public Expression {
1540
1589
 
1541
1590
  class CompareToNull: public Expression {
1542
1591
  public:
1543
- CompareToNull(bool is_strict, Expression* expression)
1544
- : is_strict_(is_strict), expression_(expression) { }
1592
+ CompareToNull(Isolate* isolate, bool is_strict, Expression* expression)
1593
+ : Expression(isolate), is_strict_(is_strict), expression_(expression) { }
1545
1594
 
1546
1595
  DECLARE_NODE_TYPE(CompareToNull)
1547
1596
 
@@ -1559,18 +1608,20 @@ class CompareToNull: public Expression {
1559
1608
 
1560
1609
  class Conditional: public Expression {
1561
1610
  public:
1562
- Conditional(Expression* condition,
1611
+ Conditional(Isolate* isolate,
1612
+ Expression* condition,
1563
1613
  Expression* then_expression,
1564
1614
  Expression* else_expression,
1565
1615
  int then_expression_position,
1566
1616
  int else_expression_position)
1567
- : condition_(condition),
1617
+ : Expression(isolate),
1618
+ condition_(condition),
1568
1619
  then_expression_(then_expression),
1569
1620
  else_expression_(else_expression),
1570
1621
  then_expression_position_(then_expression_position),
1571
1622
  else_expression_position_(else_expression_position),
1572
- then_id_(GetNextId()),
1573
- else_id_(GetNextId()) {
1623
+ then_id_(GetNextId(isolate)),
1624
+ else_id_(GetNextId(isolate)) {
1574
1625
  }
1575
1626
 
1576
1627
  DECLARE_NODE_TYPE(Conditional)
@@ -1600,7 +1651,11 @@ class Conditional: public Expression {
1600
1651
 
1601
1652
  class Assignment: public Expression {
1602
1653
  public:
1603
- Assignment(Token::Value op, Expression* target, Expression* value, int pos);
1654
+ Assignment(Isolate* isolate,
1655
+ Token::Value op,
1656
+ Expression* target,
1657
+ Expression* value,
1658
+ int pos);
1604
1659
 
1605
1660
  DECLARE_NODE_TYPE(Assignment)
1606
1661
 
@@ -1631,10 +1686,7 @@ class Assignment: public Expression {
1631
1686
  // Type feedback information.
1632
1687
  void RecordTypeFeedback(TypeFeedbackOracle* oracle);
1633
1688
  virtual bool IsMonomorphic() { return is_monomorphic_; }
1634
- virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; }
1635
- virtual Handle<Map> GetMonomorphicReceiverType() {
1636
- return monomorphic_receiver_type_;
1637
- }
1689
+ virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; }
1638
1690
 
1639
1691
  // Bailout support.
1640
1692
  int CompoundLoadId() const { return compound_load_id_; }
@@ -1653,15 +1705,14 @@ class Assignment: public Expression {
1653
1705
  bool block_end_;
1654
1706
 
1655
1707
  bool is_monomorphic_;
1656
- ZoneMapList* receiver_types_;
1657
- Handle<Map> monomorphic_receiver_type_;
1708
+ SmallMapList receiver_types_;
1658
1709
  };
1659
1710
 
1660
1711
 
1661
1712
  class Throw: public Expression {
1662
1713
  public:
1663
- Throw(Expression* exception, int pos)
1664
- : exception_(exception), pos_(pos) {}
1714
+ Throw(Isolate* isolate, Expression* exception, int pos)
1715
+ : Expression(isolate), exception_(exception), pos_(pos) {}
1665
1716
 
1666
1717
  DECLARE_NODE_TYPE(Throw)
1667
1718
 
@@ -1677,7 +1728,14 @@ class Throw: public Expression {
1677
1728
 
1678
1729
  class FunctionLiteral: public Expression {
1679
1730
  public:
1680
- FunctionLiteral(Handle<String> name,
1731
+ enum Type {
1732
+ ANONYMOUS_EXPRESSION,
1733
+ NAMED_EXPRESSION,
1734
+ DECLARATION
1735
+ };
1736
+
1737
+ FunctionLiteral(Isolate* isolate,
1738
+ Handle<String> name,
1681
1739
  Scope* scope,
1682
1740
  ZoneList<Statement*>* body,
1683
1741
  int materialized_literal_count,
@@ -1687,8 +1745,10 @@ class FunctionLiteral: public Expression {
1687
1745
  int num_parameters,
1688
1746
  int start_position,
1689
1747
  int end_position,
1690
- bool is_expression)
1691
- : name_(name),
1748
+ Type type,
1749
+ bool has_duplicate_parameters)
1750
+ : Expression(isolate),
1751
+ name_(name),
1692
1752
  scope_(scope),
1693
1753
  body_(body),
1694
1754
  materialized_literal_count_(materialized_literal_count),
@@ -1699,10 +1759,13 @@ class FunctionLiteral: public Expression {
1699
1759
  num_parameters_(num_parameters),
1700
1760
  start_position_(start_position),
1701
1761
  end_position_(end_position),
1702
- is_expression_(is_expression),
1703
1762
  function_token_position_(RelocInfo::kNoPosition),
1704
1763
  inferred_name_(HEAP->empty_string()),
1705
- pretenure_(false) { }
1764
+ is_expression_(type != DECLARATION),
1765
+ is_anonymous_(type == ANONYMOUS_EXPRESSION),
1766
+ pretenure_(false),
1767
+ has_duplicate_parameters_(has_duplicate_parameters) {
1768
+ }
1706
1769
 
1707
1770
  DECLARE_NODE_TYPE(FunctionLiteral)
1708
1771
 
@@ -1714,6 +1777,7 @@ class FunctionLiteral: public Expression {
1714
1777
  int start_position() const { return start_position_; }
1715
1778
  int end_position() const { return end_position_; }
1716
1779
  bool is_expression() const { return is_expression_; }
1780
+ bool is_anonymous() const { return is_anonymous_; }
1717
1781
  bool strict_mode() const;
1718
1782
 
1719
1783
  int materialized_literal_count() { return materialized_literal_count_; }
@@ -1742,6 +1806,8 @@ class FunctionLiteral: public Expression {
1742
1806
  void set_pretenure(bool value) { pretenure_ = value; }
1743
1807
  virtual bool IsInlineable() const;
1744
1808
 
1809
+ bool has_duplicate_parameters() { return has_duplicate_parameters_; }
1810
+
1745
1811
  private:
1746
1812
  Handle<String> name_;
1747
1813
  Scope* scope_;
@@ -1753,18 +1819,21 @@ class FunctionLiteral: public Expression {
1753
1819
  int num_parameters_;
1754
1820
  int start_position_;
1755
1821
  int end_position_;
1756
- bool is_expression_;
1757
1822
  int function_token_position_;
1758
1823
  Handle<String> inferred_name_;
1824
+ bool is_expression_;
1825
+ bool is_anonymous_;
1759
1826
  bool pretenure_;
1827
+ bool has_duplicate_parameters_;
1760
1828
  };
1761
1829
 
1762
1830
 
1763
1831
  class SharedFunctionInfoLiteral: public Expression {
1764
1832
  public:
1765
- explicit SharedFunctionInfoLiteral(
1833
+ SharedFunctionInfoLiteral(
1834
+ Isolate* isolate,
1766
1835
  Handle<SharedFunctionInfo> shared_function_info)
1767
- : shared_function_info_(shared_function_info) { }
1836
+ : Expression(isolate), shared_function_info_(shared_function_info) { }
1768
1837
 
1769
1838
  DECLARE_NODE_TYPE(SharedFunctionInfoLiteral)
1770
1839
 
@@ -1780,6 +1849,7 @@ class SharedFunctionInfoLiteral: public Expression {
1780
1849
 
1781
1850
  class ThisFunction: public Expression {
1782
1851
  public:
1852
+ explicit ThisFunction(Isolate* isolate) : Expression(isolate) {}
1783
1853
  DECLARE_NODE_TYPE(ThisFunction)
1784
1854
  virtual bool IsInlineable() const;
1785
1855
  };
@@ -1950,6 +2020,7 @@ class RegExpCharacterClass: public RegExpTree {
1950
2020
  uc16 standard_type() { return set_.standard_set_type(); }
1951
2021
  ZoneList<CharacterRange>* ranges() { return set_.ranges(); }
1952
2022
  bool is_negated() { return is_negated_; }
2023
+
1953
2024
  private:
1954
2025
  CharacterSet set_;
1955
2026
  bool is_negated_;
@@ -2034,6 +2105,7 @@ class RegExpQuantifier: public RegExpTree {
2034
2105
  bool is_non_greedy() { return type_ == NON_GREEDY; }
2035
2106
  bool is_greedy() { return type_ == GREEDY; }
2036
2107
  RegExpTree* body() { return body_; }
2108
+
2037
2109
  private:
2038
2110
  RegExpTree* body_;
2039
2111
  int min_;
@@ -2066,6 +2138,7 @@ class RegExpCapture: public RegExpTree {
2066
2138
  int index() { return index_; }
2067
2139
  static int StartRegister(int index) { return index * 2; }
2068
2140
  static int EndRegister(int index) { return index * 2 + 1; }
2141
+
2069
2142
  private:
2070
2143
  RegExpTree* body_;
2071
2144
  int index_;
@@ -2096,6 +2169,7 @@ class RegExpLookahead: public RegExpTree {
2096
2169
  bool is_positive() { return is_positive_; }
2097
2170
  int capture_count() { return capture_count_; }
2098
2171
  int capture_from() { return capture_from_; }
2172
+
2099
2173
  private:
2100
2174
  RegExpTree* body_;
2101
2175
  bool is_positive_;