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
@@ -1,4 +1,4 @@
1
- // Copyright 2010 the V8 project authors. All rights reserved.
1
+ // Copyright 2011 the V8 project authors. All rights reserved.
2
2
  // Redistribution and use in source and binary forms, with or without
3
3
  // modification, are permitted provided that the following conditions are
4
4
  // met:
@@ -65,8 +65,9 @@ namespace internal {
65
65
  F(ToSlowProperties, 1, 1) \
66
66
  F(FinishArrayPrototypeSetup, 1, 1) \
67
67
  F(SpecialArrayFunctions, 1, 1) \
68
- F(GetGlobalReceiver, 0, 1) \
68
+ F(GetDefaultReceiver, 1, 1) \
69
69
  \
70
+ F(GetPrototype, 1, 1) \
70
71
  F(IsInPrototypeChain, 2, 1) \
71
72
  F(SetHiddenPrototype, 2, 1) \
72
73
  \
@@ -81,18 +82,20 @@ namespace internal {
81
82
  F(GetFunctionDelegate, 1, 1) \
82
83
  F(GetConstructorDelegate, 1, 1) \
83
84
  F(NewArgumentsFast, 3, 1) \
85
+ F(NewStrictArgumentsFast, 3, 1) \
84
86
  F(LazyCompile, 1, 1) \
85
87
  F(LazyRecompile, 1, 1) \
86
88
  F(NotifyDeoptimized, 1, 1) \
87
89
  F(NotifyOSR, 0, 1) \
88
90
  F(DeoptimizeFunction, 1, 1) \
91
+ F(RunningInSimulator, 0, 1) \
89
92
  F(OptimizeFunctionOnNextCall, 1, 1) \
90
93
  F(GetOptimizationStatus, 1, 1) \
91
94
  F(GetOptimizationCount, 1, 1) \
92
95
  F(CompileForOnStackReplacement, 1, 1) \
93
96
  F(SetNewFunctionAttributes, 1, 1) \
94
97
  F(AllocateInNewSpace, 1, 1) \
95
- F(SetES5Flag, 1, 1) \
98
+ F(SetNativeFlag, 1, 1) \
96
99
  \
97
100
  /* Array join support */ \
98
101
  F(PushIfAbsent, 2, 1) \
@@ -114,6 +117,7 @@ namespace internal {
114
117
  F(URIUnescape, 1, 1) \
115
118
  F(QuoteJSONString, 1, 1) \
116
119
  F(QuoteJSONStringComma, 1, 1) \
120
+ F(QuoteJSONStringArray, 1, 1) \
117
121
  \
118
122
  F(NumberToString, 1, 1) \
119
123
  F(NumberToStringSkipCache, 1, 1) \
@@ -205,9 +209,14 @@ namespace internal {
205
209
  /* Reflection */ \
206
210
  F(FunctionSetInstanceClassName, 2, 1) \
207
211
  F(FunctionSetLength, 2, 1) \
212
+ F(BoundFunctionSetLength, 2, 1) \
208
213
  F(FunctionSetPrototype, 2, 1) \
214
+ F(FunctionSetReadOnlyPrototype, 1, 1) \
209
215
  F(FunctionGetName, 1, 1) \
210
216
  F(FunctionSetName, 2, 1) \
217
+ F(FunctionNameShouldPrintAsAnonymous, 1, 1) \
218
+ F(FunctionMarkNameShouldPrintAsAnonymous, 1, 1) \
219
+ F(FunctionSetBound, 1, 1) \
211
220
  F(FunctionRemovePrototype, 1, 1) \
212
221
  F(FunctionGetSourceCode, 1, 1) \
213
222
  F(FunctionGetScript, 1, 1) \
@@ -277,9 +286,14 @@ namespace internal {
277
286
  \
278
287
  /* Harmony proxies */ \
279
288
  F(CreateJSProxy, 2, 1) \
289
+ F(IsJSProxy, 1, 1) \
290
+ F(GetHandler, 1, 1) \
291
+ F(Fix, 1, 1) \
280
292
  \
281
- /* Catch context extension objects */ \
282
- F(CreateCatchExtensionObject, 2, 1) \
293
+ /* Harmony weakmaps */ \
294
+ F(WeakMapInitialize, 1, 1) \
295
+ F(WeakMapGet, 2, 1) \
296
+ F(WeakMapSet, 3, 1) \
283
297
  \
284
298
  /* Statements */ \
285
299
  F(NewClosure, 3, 1) \
@@ -293,9 +307,10 @@ namespace internal {
293
307
  F(PromoteScheduledException, 0, 1) \
294
308
  \
295
309
  /* Contexts */ \
296
- F(NewContext, 1, 1) \
297
- F(PushContext, 1, 1) \
298
- F(PushCatchContext, 1, 1) \
310
+ F(NewFunctionContext, 1, 1) \
311
+ F(PushWithContext, 2, 1) \
312
+ F(PushCatchContext, 3, 1) \
313
+ F(PushBlockContext, 2, 1) \
299
314
  F(DeleteContextSlot, 2, 1) \
300
315
  F(LoadContextSlot, 2, 2) \
301
316
  F(LoadContextSlotNoReferenceError, 2, 2) \
@@ -330,7 +345,26 @@ namespace internal {
330
345
  F(MessageGetScript, 1, 1) \
331
346
  \
332
347
  /* Pseudo functions - handled as macros by parser */ \
333
- F(IS_VAR, 1, 1)
348
+ F(IS_VAR, 1, 1) \
349
+ \
350
+ /* expose boolean functions from objects-inl.h */ \
351
+ F(HasFastElements, 1, 1) \
352
+ F(HasFastDoubleElements, 1, 1) \
353
+ F(HasDictionaryElements, 1, 1) \
354
+ F(HasExternalPixelElements, 1, 1) \
355
+ F(HasExternalArrayElements, 1, 1) \
356
+ F(HasExternalByteElements, 1, 1) \
357
+ F(HasExternalUnsignedByteElements, 1, 1) \
358
+ F(HasExternalShortElements, 1, 1) \
359
+ F(HasExternalUnsignedShortElements, 1, 1) \
360
+ F(HasExternalIntElements, 1, 1) \
361
+ F(HasExternalUnsignedIntElements, 1, 1) \
362
+ F(HasExternalFloatElements, 1, 1) \
363
+ F(HasExternalDoubleElements, 1, 1) \
364
+ /* profiler */ \
365
+ F(ProfilerResume, 0, 1) \
366
+ F(ProfilerPause, 0, 1)
367
+
334
368
 
335
369
  #ifdef ENABLE_DEBUGGER_SUPPORT
336
370
  #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \
@@ -349,7 +383,7 @@ namespace internal {
349
383
  F(GetFrameCount, 1, 1) \
350
384
  F(GetFrameDetails, 2, 1) \
351
385
  F(GetScopeCount, 2, 1) \
352
- F(GetScopeDetails, 3, 1) \
386
+ F(GetScopeDetails, 4, 1) \
353
387
  F(DebugPrintScopes, 0, 1) \
354
388
  F(GetThreadCount, 1, 1) \
355
389
  F(GetThreadDetails, 2, 1) \
@@ -362,7 +396,7 @@ namespace internal {
362
396
  F(IsBreakOnException, 1, 1) \
363
397
  F(PrepareStep, 3, 1) \
364
398
  F(ClearStepping, 0, 1) \
365
- F(DebugEvaluate, 5, 1) \
399
+ F(DebugEvaluate, 6, 1) \
366
400
  F(DebugEvaluateGlobal, 4, 1) \
367
401
  F(DebugGetLoadedScripts, 0, 1) \
368
402
  F(DebugReferencedBy, 3, 1) \
@@ -407,14 +441,6 @@ namespace internal {
407
441
  #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F)
408
442
  #endif
409
443
 
410
- #ifdef ENABLE_LOGGING_AND_PROFILING
411
- #define RUNTIME_FUNCTION_LIST_PROFILER_SUPPORT(F) \
412
- F(ProfilerResume, 2, 1) \
413
- F(ProfilerPause, 2, 1)
414
- #else
415
- #define RUNTIME_FUNCTION_LIST_PROFILER_SUPPORT(F)
416
- #endif
417
-
418
444
  #ifdef DEBUG
419
445
  #define RUNTIME_FUNCTION_LIST_DEBUG(F) \
420
446
  /* Testing */ \
@@ -432,8 +458,7 @@ namespace internal {
432
458
  RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \
433
459
  RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \
434
460
  RUNTIME_FUNCTION_LIST_DEBUG(F) \
435
- RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \
436
- RUNTIME_FUNCTION_LIST_PROFILER_SUPPORT(F)
461
+ RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F)
437
462
 
438
463
  // ----------------------------------------------------------------------------
439
464
  // INLINE_FUNCTION_LIST defines all inlined functions accessed
@@ -494,7 +519,6 @@ namespace internal {
494
519
 
495
520
  class RuntimeState {
496
521
  public:
497
-
498
522
  StaticResource<StringInputBuffer>* string_input_buffer() {
499
523
  return &string_input_buffer_;
500
524
  }
@@ -516,12 +540,6 @@ class RuntimeState {
516
540
  StringInputBuffer* string_locale_compare_buf2() {
517
541
  return &string_locale_compare_buf2_;
518
542
  }
519
- int* smi_lexicographic_compare_x_elms() {
520
- return smi_lexicographic_compare_x_elms_;
521
- }
522
- int* smi_lexicographic_compare_y_elms() {
523
- return smi_lexicographic_compare_y_elms_;
524
- }
525
543
 
526
544
  private:
527
545
  RuntimeState() {}
@@ -533,8 +551,6 @@ class RuntimeState {
533
551
  StringInputBuffer string_input_buffer_compare_bufy_;
534
552
  StringInputBuffer string_locale_compare_buf1_;
535
553
  StringInputBuffer string_locale_compare_buf2_;
536
- int smi_lexicographic_compare_x_elms_[10];
537
- int smi_lexicographic_compare_y_elms_[10];
538
554
 
539
555
  friend class Isolate;
540
556
  friend class Runtime;
@@ -630,7 +646,7 @@ class Runtime : public AllStatic {
630
646
 
631
647
  MUST_USE_RESULT static MaybeObject* ForceDeleteObjectProperty(
632
648
  Isolate* isolate,
633
- Handle<JSObject> object,
649
+ Handle<JSReceiver> object,
634
650
  Handle<Object> key);
635
651
 
636
652
  MUST_USE_RESULT static MaybeObject* GetObjectProperty(
@@ -354,7 +354,8 @@ function IN(x) {
354
354
  if (!IS_SPEC_OBJECT(x)) {
355
355
  throw %MakeTypeError('invalid_in_operator_use', [this, x]);
356
356
  }
357
- return %_IsNonNegativeSmi(this) ? %HasElement(x, this) : %HasProperty(x, %ToString(this));
357
+ return %_IsNonNegativeSmi(this) && !%IsJSProxy(x) ?
358
+ %HasElement(x, this) : %HasProperty(x, %ToString(this));
358
359
  }
359
360
 
360
361
 
@@ -41,12 +41,12 @@ Scanner::Scanner(UnicodeCache* unicode_cache)
41
41
  : unicode_cache_(unicode_cache) { }
42
42
 
43
43
 
44
- uc32 Scanner::ScanHexEscape(uc32 c, int length) {
45
- ASSERT(length <= 4); // prevent overflow
44
+ uc32 Scanner::ScanHexNumber(int expected_length) {
45
+ ASSERT(expected_length <= 4); // prevent overflow
46
46
 
47
- uc32 digits[4];
47
+ uc32 digits[4] = { 0, 0, 0, 0 };
48
48
  uc32 x = 0;
49
- for (int i = 0; i < length; i++) {
49
+ for (int i = 0; i < expected_length; i++) {
50
50
  digits[i] = c0_;
51
51
  int d = HexValue(c0_);
52
52
  if (d < 0) {
@@ -54,12 +54,11 @@ uc32 Scanner::ScanHexEscape(uc32 c, int length) {
54
54
  // should be illegal, but other JS VMs just return the
55
55
  // non-escaped version of the original character.
56
56
 
57
- // Push back digits read, except the last one (in c0_).
57
+ // Push back digits that we have advanced past.
58
58
  for (int j = i-1; j >= 0; j--) {
59
59
  PushBack(digits[j]);
60
60
  }
61
- // Notice: No handling of error - treat it as "\u"->"u".
62
- return c;
61
+ return -1;
63
62
  }
64
63
  x = x * 16 + d;
65
64
  Advance();
@@ -74,12 +73,175 @@ uc32 Scanner::ScanHexEscape(uc32 c, int length) {
74
73
  // JavaScriptScanner
75
74
 
76
75
  JavaScriptScanner::JavaScriptScanner(UnicodeCache* scanner_contants)
77
- : Scanner(scanner_contants), octal_pos_(Location::invalid()) { }
76
+ : Scanner(scanner_contants),
77
+ octal_pos_(Location::invalid()),
78
+ harmony_block_scoping_(false) { }
79
+
80
+
81
+ void JavaScriptScanner::Initialize(UC16CharacterStream* source) {
82
+ source_ = source;
83
+ // Need to capture identifiers in order to recognize "get" and "set"
84
+ // in object literals.
85
+ Init();
86
+ // Skip initial whitespace allowing HTML comment ends just like
87
+ // after a newline and scan first token.
88
+ has_line_terminator_before_next_ = true;
89
+ SkipWhiteSpace();
90
+ Scan();
91
+ }
92
+
93
+
94
+ // Ensure that tokens can be stored in a byte.
95
+ STATIC_ASSERT(Token::NUM_TOKENS <= 0x100);
96
+
97
+ // Table of one-character tokens, by character (0x00..0x7f only).
98
+ static const byte one_char_tokens[] = {
99
+ Token::ILLEGAL,
100
+ Token::ILLEGAL,
101
+ Token::ILLEGAL,
102
+ Token::ILLEGAL,
103
+ Token::ILLEGAL,
104
+ Token::ILLEGAL,
105
+ Token::ILLEGAL,
106
+ Token::ILLEGAL,
107
+ Token::ILLEGAL,
108
+ Token::ILLEGAL,
109
+ Token::ILLEGAL,
110
+ Token::ILLEGAL,
111
+ Token::ILLEGAL,
112
+ Token::ILLEGAL,
113
+ Token::ILLEGAL,
114
+ Token::ILLEGAL,
115
+ Token::ILLEGAL,
116
+ Token::ILLEGAL,
117
+ Token::ILLEGAL,
118
+ Token::ILLEGAL,
119
+ Token::ILLEGAL,
120
+ Token::ILLEGAL,
121
+ Token::ILLEGAL,
122
+ Token::ILLEGAL,
123
+ Token::ILLEGAL,
124
+ Token::ILLEGAL,
125
+ Token::ILLEGAL,
126
+ Token::ILLEGAL,
127
+ Token::ILLEGAL,
128
+ Token::ILLEGAL,
129
+ Token::ILLEGAL,
130
+ Token::ILLEGAL,
131
+ Token::ILLEGAL,
132
+ Token::ILLEGAL,
133
+ Token::ILLEGAL,
134
+ Token::ILLEGAL,
135
+ Token::ILLEGAL,
136
+ Token::ILLEGAL,
137
+ Token::ILLEGAL,
138
+ Token::ILLEGAL,
139
+ Token::LPAREN, // 0x28
140
+ Token::RPAREN, // 0x29
141
+ Token::ILLEGAL,
142
+ Token::ILLEGAL,
143
+ Token::COMMA, // 0x2c
144
+ Token::ILLEGAL,
145
+ Token::ILLEGAL,
146
+ Token::ILLEGAL,
147
+ Token::ILLEGAL,
148
+ Token::ILLEGAL,
149
+ Token::ILLEGAL,
150
+ Token::ILLEGAL,
151
+ Token::ILLEGAL,
152
+ Token::ILLEGAL,
153
+ Token::ILLEGAL,
154
+ Token::ILLEGAL,
155
+ Token::ILLEGAL,
156
+ Token::ILLEGAL,
157
+ Token::COLON, // 0x3a
158
+ Token::SEMICOLON, // 0x3b
159
+ Token::ILLEGAL,
160
+ Token::ILLEGAL,
161
+ Token::ILLEGAL,
162
+ Token::CONDITIONAL, // 0x3f
163
+ Token::ILLEGAL,
164
+ Token::ILLEGAL,
165
+ Token::ILLEGAL,
166
+ Token::ILLEGAL,
167
+ Token::ILLEGAL,
168
+ Token::ILLEGAL,
169
+ Token::ILLEGAL,
170
+ Token::ILLEGAL,
171
+ Token::ILLEGAL,
172
+ Token::ILLEGAL,
173
+ Token::ILLEGAL,
174
+ Token::ILLEGAL,
175
+ Token::ILLEGAL,
176
+ Token::ILLEGAL,
177
+ Token::ILLEGAL,
178
+ Token::ILLEGAL,
179
+ Token::ILLEGAL,
180
+ Token::ILLEGAL,
181
+ Token::ILLEGAL,
182
+ Token::ILLEGAL,
183
+ Token::ILLEGAL,
184
+ Token::ILLEGAL,
185
+ Token::ILLEGAL,
186
+ Token::ILLEGAL,
187
+ Token::ILLEGAL,
188
+ Token::ILLEGAL,
189
+ Token::ILLEGAL,
190
+ Token::LBRACK, // 0x5b
191
+ Token::ILLEGAL,
192
+ Token::RBRACK, // 0x5d
193
+ Token::ILLEGAL,
194
+ Token::ILLEGAL,
195
+ Token::ILLEGAL,
196
+ Token::ILLEGAL,
197
+ Token::ILLEGAL,
198
+ Token::ILLEGAL,
199
+ Token::ILLEGAL,
200
+ Token::ILLEGAL,
201
+ Token::ILLEGAL,
202
+ Token::ILLEGAL,
203
+ Token::ILLEGAL,
204
+ Token::ILLEGAL,
205
+ Token::ILLEGAL,
206
+ Token::ILLEGAL,
207
+ Token::ILLEGAL,
208
+ Token::ILLEGAL,
209
+ Token::ILLEGAL,
210
+ Token::ILLEGAL,
211
+ Token::ILLEGAL,
212
+ Token::ILLEGAL,
213
+ Token::ILLEGAL,
214
+ Token::ILLEGAL,
215
+ Token::ILLEGAL,
216
+ Token::ILLEGAL,
217
+ Token::ILLEGAL,
218
+ Token::ILLEGAL,
219
+ Token::ILLEGAL,
220
+ Token::ILLEGAL,
221
+ Token::ILLEGAL,
222
+ Token::LBRACE, // 0x7b
223
+ Token::ILLEGAL,
224
+ Token::RBRACE, // 0x7d
225
+ Token::BIT_NOT, // 0x7e
226
+ Token::ILLEGAL
227
+ };
78
228
 
79
229
 
80
230
  Token::Value JavaScriptScanner::Next() {
81
231
  current_ = next_;
82
232
  has_line_terminator_before_next_ = false;
233
+ has_multiline_comment_before_next_ = false;
234
+ if (static_cast<unsigned>(c0_) <= 0x7f) {
235
+ Token::Value token = static_cast<Token::Value>(one_char_tokens[c0_]);
236
+ if (token != Token::ILLEGAL) {
237
+ int pos = source_pos();
238
+ next_.token = token;
239
+ next_.location.beg_pos = pos;
240
+ next_.location.end_pos = pos + 1;
241
+ Advance();
242
+ return current_.token;
243
+ }
244
+ }
83
245
  Scan();
84
246
  return current_.token;
85
247
  }
@@ -144,7 +306,7 @@ Token::Value JavaScriptScanner::SkipSingleLineComment() {
144
306
  // to be part of the single-line comment; it is recognized
145
307
  // separately by the lexical grammar and becomes part of the
146
308
  // stream of input elements for the syntactic grammar (see
147
- // ECMA-262, section 7.4, page 12).
309
+ // ECMA-262, section 7.4).
148
310
  while (c0_ >= 0 && !unicode_cache_->IsLineTerminator(c0_)) {
149
311
  Advance();
150
312
  }
@@ -158,15 +320,16 @@ Token::Value JavaScriptScanner::SkipMultiLineComment() {
158
320
  Advance();
159
321
 
160
322
  while (c0_ >= 0) {
161
- char ch = c0_;
323
+ uc32 ch = c0_;
162
324
  Advance();
325
+ if (unicode_cache_->IsLineTerminator(ch)) {
326
+ // Following ECMA-262, section 7.4, a comment containing
327
+ // a newline will make the comment count as a line-terminator.
328
+ has_multiline_comment_before_next_ = true;
329
+ }
163
330
  // If we have reached the end of the multi-line comment, we
164
331
  // consume the '/' and insert a whitespace. This way all
165
- // multi-line comments are treated as whitespace - even the ones
166
- // containing line terminators. This contradicts ECMA-262, section
167
- // 7.4, page 12, that says that multi-line comments containing
168
- // line terminators should be treated as a line terminator, but it
169
- // matches the behaviour of SpiderMonkey and KJS.
332
+ // multi-line comments are treated as whitespace.
170
333
  if (ch == '*' && c0_ == '/') {
171
334
  c0_ = ' ';
172
335
  return Token::WHITESPACE;
@@ -448,6 +611,7 @@ void JavaScriptScanner::SeekForward(int pos) {
448
611
  // of the end of a function (at the "}" token). It doesn't matter
449
612
  // whether there was a line terminator in the part we skip.
450
613
  has_line_terminator_before_next_ = false;
614
+ has_multiline_comment_before_next_ = false;
451
615
  }
452
616
  Scan();
453
617
  }
@@ -475,9 +639,17 @@ void JavaScriptScanner::ScanEscape() {
475
639
  case 'n' : c = '\n'; break;
476
640
  case 'r' : c = '\r'; break;
477
641
  case 't' : c = '\t'; break;
478
- case 'u' : c = ScanHexEscape(c, 4); break;
642
+ case 'u' : {
643
+ c = ScanHexNumber(4);
644
+ if (c < 0) c = 'u';
645
+ break;
646
+ }
479
647
  case 'v' : c = '\v'; break;
480
- case 'x' : c = ScanHexEscape(c, 2); break;
648
+ case 'x' : {
649
+ c = ScanHexNumber(2);
650
+ if (c < 0) c = 'x';
651
+ break;
652
+ }
481
653
  case '0' : // fall through
482
654
  case '1' : // fall through
483
655
  case '2' : // fall through
@@ -637,25 +809,133 @@ Token::Value JavaScriptScanner::ScanNumber(bool seen_period) {
637
809
 
638
810
  uc32 JavaScriptScanner::ScanIdentifierUnicodeEscape() {
639
811
  Advance();
640
- if (c0_ != 'u') return unibrow::Utf8::kBadChar;
812
+ if (c0_ != 'u') return -1;
641
813
  Advance();
642
- uc32 c = ScanHexEscape('u', 4);
643
- // We do not allow a unicode escape sequence to start another
644
- // unicode escape sequence.
645
- if (c == '\\') return unibrow::Utf8::kBadChar;
646
- return c;
814
+ uc32 result = ScanHexNumber(4);
815
+ if (result < 0) PushBack('u');
816
+ return result;
817
+ }
818
+
819
+
820
+ // ----------------------------------------------------------------------------
821
+ // Keyword Matcher
822
+
823
+ #define KEYWORDS(KEYWORD_GROUP, KEYWORD) \
824
+ KEYWORD_GROUP('b') \
825
+ KEYWORD("break", Token::BREAK) \
826
+ KEYWORD_GROUP('c') \
827
+ KEYWORD("case", Token::CASE) \
828
+ KEYWORD("catch", Token::CATCH) \
829
+ KEYWORD("class", Token::FUTURE_RESERVED_WORD) \
830
+ KEYWORD("const", Token::CONST) \
831
+ KEYWORD("continue", Token::CONTINUE) \
832
+ KEYWORD_GROUP('d') \
833
+ KEYWORD("debugger", Token::DEBUGGER) \
834
+ KEYWORD("default", Token::DEFAULT) \
835
+ KEYWORD("delete", Token::DELETE) \
836
+ KEYWORD("do", Token::DO) \
837
+ KEYWORD_GROUP('e') \
838
+ KEYWORD("else", Token::ELSE) \
839
+ KEYWORD("enum", Token::FUTURE_RESERVED_WORD) \
840
+ KEYWORD("export", Token::FUTURE_RESERVED_WORD) \
841
+ KEYWORD("extends", Token::FUTURE_RESERVED_WORD) \
842
+ KEYWORD_GROUP('f') \
843
+ KEYWORD("false", Token::FALSE_LITERAL) \
844
+ KEYWORD("finally", Token::FINALLY) \
845
+ KEYWORD("for", Token::FOR) \
846
+ KEYWORD("function", Token::FUNCTION) \
847
+ KEYWORD_GROUP('i') \
848
+ KEYWORD("if", Token::IF) \
849
+ KEYWORD("implements", Token::FUTURE_STRICT_RESERVED_WORD) \
850
+ KEYWORD("import", Token::FUTURE_RESERVED_WORD) \
851
+ KEYWORD("in", Token::IN) \
852
+ KEYWORD("instanceof", Token::INSTANCEOF) \
853
+ KEYWORD("interface", Token::FUTURE_STRICT_RESERVED_WORD) \
854
+ KEYWORD_GROUP('l') \
855
+ KEYWORD("let", harmony_block_scoping \
856
+ ? Token::LET : Token::FUTURE_STRICT_RESERVED_WORD) \
857
+ KEYWORD_GROUP('n') \
858
+ KEYWORD("new", Token::NEW) \
859
+ KEYWORD("null", Token::NULL_LITERAL) \
860
+ KEYWORD_GROUP('p') \
861
+ KEYWORD("package", Token::FUTURE_STRICT_RESERVED_WORD) \
862
+ KEYWORD("private", Token::FUTURE_STRICT_RESERVED_WORD) \
863
+ KEYWORD("protected", Token::FUTURE_STRICT_RESERVED_WORD) \
864
+ KEYWORD("public", Token::FUTURE_STRICT_RESERVED_WORD) \
865
+ KEYWORD_GROUP('r') \
866
+ KEYWORD("return", Token::RETURN) \
867
+ KEYWORD_GROUP('s') \
868
+ KEYWORD("static", Token::FUTURE_STRICT_RESERVED_WORD) \
869
+ KEYWORD("super", Token::FUTURE_RESERVED_WORD) \
870
+ KEYWORD("switch", Token::SWITCH) \
871
+ KEYWORD_GROUP('t') \
872
+ KEYWORD("this", Token::THIS) \
873
+ KEYWORD("throw", Token::THROW) \
874
+ KEYWORD("true", Token::TRUE_LITERAL) \
875
+ KEYWORD("try", Token::TRY) \
876
+ KEYWORD("typeof", Token::TYPEOF) \
877
+ KEYWORD_GROUP('v') \
878
+ KEYWORD("var", Token::VAR) \
879
+ KEYWORD("void", Token::VOID) \
880
+ KEYWORD_GROUP('w') \
881
+ KEYWORD("while", Token::WHILE) \
882
+ KEYWORD("with", Token::WITH) \
883
+ KEYWORD_GROUP('y') \
884
+ KEYWORD("yield", Token::FUTURE_STRICT_RESERVED_WORD)
885
+
886
+
887
+ static Token::Value KeywordOrIdentifierToken(const char* input,
888
+ int input_length,
889
+ bool harmony_block_scoping) {
890
+ ASSERT(input_length >= 1);
891
+ const int kMinLength = 2;
892
+ const int kMaxLength = 10;
893
+ if (input_length < kMinLength || input_length > kMaxLength) {
894
+ return Token::IDENTIFIER;
895
+ }
896
+ switch (input[0]) {
897
+ default:
898
+ #define KEYWORD_GROUP_CASE(ch) \
899
+ break; \
900
+ case ch:
901
+ #define KEYWORD(keyword, token) \
902
+ { \
903
+ /* 'keyword' is a char array, so sizeof(keyword) is */ \
904
+ /* strlen(keyword) plus 1 for the NUL char. */ \
905
+ const int keyword_length = sizeof(keyword) - 1; \
906
+ STATIC_ASSERT(keyword_length >= kMinLength); \
907
+ STATIC_ASSERT(keyword_length <= kMaxLength); \
908
+ if (input_length == keyword_length && \
909
+ input[1] == keyword[1] && \
910
+ (keyword_length <= 2 || input[2] == keyword[2]) && \
911
+ (keyword_length <= 3 || input[3] == keyword[3]) && \
912
+ (keyword_length <= 4 || input[4] == keyword[4]) && \
913
+ (keyword_length <= 5 || input[5] == keyword[5]) && \
914
+ (keyword_length <= 6 || input[6] == keyword[6]) && \
915
+ (keyword_length <= 7 || input[7] == keyword[7]) && \
916
+ (keyword_length <= 8 || input[8] == keyword[8]) && \
917
+ (keyword_length <= 9 || input[9] == keyword[9])) { \
918
+ return token; \
919
+ } \
920
+ }
921
+ KEYWORDS(KEYWORD_GROUP_CASE, KEYWORD)
922
+ }
923
+ return Token::IDENTIFIER;
647
924
  }
648
925
 
649
926
 
650
927
  Token::Value JavaScriptScanner::ScanIdentifierOrKeyword() {
651
928
  ASSERT(unicode_cache_->IsIdentifierStart(c0_));
652
929
  LiteralScope literal(this);
653
- KeywordMatcher keyword_match;
654
930
  // Scan identifier start character.
655
931
  if (c0_ == '\\') {
656
932
  uc32 c = ScanIdentifierUnicodeEscape();
657
933
  // Only allow legal identifier start characters.
658
- if (!unicode_cache_->IsIdentifierStart(c)) return Token::ILLEGAL;
934
+ if (c < 0 ||
935
+ c == '\\' || // No recursive escapes.
936
+ !unicode_cache_->IsIdentifierStart(c)) {
937
+ return Token::ILLEGAL;
938
+ }
659
939
  AddLiteralChar(c);
660
940
  return ScanIdentifierSuffix(&literal);
661
941
  }
@@ -663,9 +943,6 @@ Token::Value JavaScriptScanner::ScanIdentifierOrKeyword() {
663
943
  uc32 first_char = c0_;
664
944
  Advance();
665
945
  AddLiteralChar(first_char);
666
- if (!keyword_match.AddChar(first_char)) {
667
- return ScanIdentifierSuffix(&literal);
668
- }
669
946
 
670
947
  // Scan the rest of the identifier characters.
671
948
  while (unicode_cache_->IsIdentifierPart(c0_)) {
@@ -673,14 +950,22 @@ Token::Value JavaScriptScanner::ScanIdentifierOrKeyword() {
673
950
  uc32 next_char = c0_;
674
951
  Advance();
675
952
  AddLiteralChar(next_char);
676
- if (keyword_match.AddChar(next_char)) continue;
953
+ continue;
677
954
  }
678
- // Fallthrough if no loner able to complete keyword.
955
+ // Fallthrough if no longer able to complete keyword.
679
956
  return ScanIdentifierSuffix(&literal);
680
957
  }
958
+
681
959
  literal.Complete();
682
960
 
683
- return keyword_match.token();
961
+ if (next_.literal_chars->is_ascii()) {
962
+ Vector<const char> chars = next_.literal_chars->ascii_literal();
963
+ return KeywordOrIdentifierToken(chars.start(),
964
+ chars.length(),
965
+ harmony_block_scoping_);
966
+ }
967
+
968
+ return Token::IDENTIFIER;
684
969
  }
685
970
 
686
971
 
@@ -690,7 +975,11 @@ Token::Value JavaScriptScanner::ScanIdentifierSuffix(LiteralScope* literal) {
690
975
  if (c0_ == '\\') {
691
976
  uc32 c = ScanIdentifierUnicodeEscape();
692
977
  // Only allow legal identifier part characters.
693
- if (!unicode_cache_->IsIdentifierPart(c)) return Token::ILLEGAL;
978
+ if (c < 0 ||
979
+ c == '\\' ||
980
+ !unicode_cache_->IsIdentifierPart(c)) {
981
+ return Token::ILLEGAL;
982
+ }
694
983
  AddLiteralChar(c);
695
984
  } else {
696
985
  AddLiteralChar(c0_);
@@ -716,8 +1005,9 @@ bool JavaScriptScanner::ScanRegExpPattern(bool seen_equal) {
716
1005
  // the scanner should pass uninterpreted bodies to the RegExp
717
1006
  // constructor.
718
1007
  LiteralScope literal(this);
719
- if (seen_equal)
1008
+ if (seen_equal) {
720
1009
  AddLiteralChar('=');
1010
+ }
721
1011
 
722
1012
  while (c0_ != '/' || in_character_class) {
723
1013
  if (unicode_cache_->IsLineTerminator(c0_) || c0_ < 0) return false;
@@ -749,20 +1039,47 @@ bool JavaScriptScanner::ScanRegExpPattern(bool seen_equal) {
749
1039
  }
750
1040
 
751
1041
 
1042
+ bool JavaScriptScanner::ScanLiteralUnicodeEscape() {
1043
+ ASSERT(c0_ == '\\');
1044
+ uc32 chars_read[6] = {'\\', 'u', 0, 0, 0, 0};
1045
+ Advance();
1046
+ int i = 1;
1047
+ if (c0_ == 'u') {
1048
+ i++;
1049
+ while (i < 6) {
1050
+ Advance();
1051
+ if (!IsHexDigit(c0_)) break;
1052
+ chars_read[i] = c0_;
1053
+ i++;
1054
+ }
1055
+ }
1056
+ if (i < 6) {
1057
+ // Incomplete escape. Undo all advances and return false.
1058
+ while (i > 0) {
1059
+ i--;
1060
+ PushBack(chars_read[i]);
1061
+ }
1062
+ return false;
1063
+ }
1064
+ // Complete escape. Add all chars to current literal buffer.
1065
+ for (int i = 0; i < 6; i++) {
1066
+ AddLiteralChar(chars_read[i]);
1067
+ }
1068
+ return true;
1069
+ }
1070
+
1071
+
752
1072
  bool JavaScriptScanner::ScanRegExpFlags() {
753
1073
  // Scan regular expression flags.
754
1074
  LiteralScope literal(this);
755
1075
  while (unicode_cache_->IsIdentifierPart(c0_)) {
756
- if (c0_ == '\\') {
757
- uc32 c = ScanIdentifierUnicodeEscape();
758
- if (c != static_cast<uc32>(unibrow::Utf8::kBadChar)) {
759
- // We allow any escaped character, unlike the restriction on
760
- // IdentifierPart when it is used to build an IdentifierName.
761
- AddLiteralChar(c);
762
- continue;
1076
+ if (c0_ != '\\') {
1077
+ AddLiteralCharAdvance();
1078
+ } else {
1079
+ if (!ScanLiteralUnicodeEscape()) {
1080
+ break;
763
1081
  }
764
1082
  }
765
- AddLiteralCharAdvance();
766
1083
  }
767
1084
  literal.Complete();
768
1085
 
@@ -770,183 +1087,4 @@ bool JavaScriptScanner::ScanRegExpFlags() {
770
1087
  return true;
771
1088
  }
772
1089
 
773
- // ----------------------------------------------------------------------------
774
- // Keyword Matcher
775
-
776
- KeywordMatcher::FirstState KeywordMatcher::first_states_[] = {
777
- { "break", KEYWORD_PREFIX, Token::BREAK },
778
- { NULL, C, Token::ILLEGAL },
779
- { NULL, D, Token::ILLEGAL },
780
- { NULL, E, Token::ILLEGAL },
781
- { NULL, F, Token::ILLEGAL },
782
- { NULL, UNMATCHABLE, Token::ILLEGAL },
783
- { NULL, UNMATCHABLE, Token::ILLEGAL },
784
- { NULL, I, Token::ILLEGAL },
785
- { NULL, UNMATCHABLE, Token::ILLEGAL },
786
- { NULL, UNMATCHABLE, Token::ILLEGAL },
787
- { "let", KEYWORD_PREFIX, Token::FUTURE_RESERVED_WORD },
788
- { NULL, UNMATCHABLE, Token::ILLEGAL },
789
- { NULL, N, Token::ILLEGAL },
790
- { NULL, UNMATCHABLE, Token::ILLEGAL },
791
- { NULL, P, Token::ILLEGAL },
792
- { NULL, UNMATCHABLE, Token::ILLEGAL },
793
- { "return", KEYWORD_PREFIX, Token::RETURN },
794
- { NULL, S, Token::ILLEGAL },
795
- { NULL, T, Token::ILLEGAL },
796
- { NULL, UNMATCHABLE, Token::ILLEGAL },
797
- { NULL, V, Token::ILLEGAL },
798
- { NULL, W, Token::ILLEGAL },
799
- { NULL, UNMATCHABLE, Token::ILLEGAL },
800
- { "yield", KEYWORD_PREFIX, Token::FUTURE_RESERVED_WORD }
801
- };
802
-
803
-
804
- void KeywordMatcher::Step(unibrow::uchar input) {
805
- switch (state_) {
806
- case INITIAL: {
807
- // matching the first character is the only state with significant fanout.
808
- // Match only lower-case letters in range 'b'..'y'.
809
- unsigned int offset = input - kFirstCharRangeMin;
810
- if (offset < kFirstCharRangeLength) {
811
- state_ = first_states_[offset].state;
812
- if (state_ == KEYWORD_PREFIX) {
813
- keyword_ = first_states_[offset].keyword;
814
- counter_ = 1;
815
- keyword_token_ = first_states_[offset].token;
816
- }
817
- return;
818
- }
819
- break;
820
- }
821
- case KEYWORD_PREFIX:
822
- if (static_cast<unibrow::uchar>(keyword_[counter_]) == input) {
823
- counter_++;
824
- if (keyword_[counter_] == '\0') {
825
- state_ = KEYWORD_MATCHED;
826
- token_ = keyword_token_;
827
- }
828
- return;
829
- }
830
- break;
831
- case KEYWORD_MATCHED:
832
- token_ = Token::IDENTIFIER;
833
- break;
834
- case C:
835
- if (MatchState(input, 'a', CA)) return;
836
- if (MatchKeywordStart(input, "class", 1,
837
- Token::FUTURE_RESERVED_WORD)) return;
838
- if (MatchState(input, 'o', CO)) return;
839
- break;
840
- case CA:
841
- if (MatchKeywordStart(input, "case", 2, Token::CASE)) return;
842
- if (MatchKeywordStart(input, "catch", 2, Token::CATCH)) return;
843
- break;
844
- case CO:
845
- if (MatchState(input, 'n', CON)) return;
846
- break;
847
- case CON:
848
- if (MatchKeywordStart(input, "const", 3, Token::CONST)) return;
849
- if (MatchKeywordStart(input, "continue", 3, Token::CONTINUE)) return;
850
- break;
851
- case D:
852
- if (MatchState(input, 'e', DE)) return;
853
- if (MatchKeyword(input, 'o', KEYWORD_MATCHED, Token::DO)) return;
854
- break;
855
- case DE:
856
- if (MatchKeywordStart(input, "debugger", 2, Token::DEBUGGER)) return;
857
- if (MatchKeywordStart(input, "default", 2, Token::DEFAULT)) return;
858
- if (MatchKeywordStart(input, "delete", 2, Token::DELETE)) return;
859
- break;
860
- case E:
861
- if (MatchKeywordStart(input, "else", 1, Token::ELSE)) return;
862
- if (MatchKeywordStart(input, "enum", 1,
863
- Token::FUTURE_RESERVED_WORD)) return;
864
- if (MatchState(input, 'x', EX)) return;
865
- break;
866
- case EX:
867
- if (MatchKeywordStart(input, "export", 2,
868
- Token::FUTURE_RESERVED_WORD)) return;
869
- if (MatchKeywordStart(input, "extends", 2,
870
- Token::FUTURE_RESERVED_WORD)) return;
871
- break;
872
- case F:
873
- if (MatchKeywordStart(input, "false", 1, Token::FALSE_LITERAL)) return;
874
- if (MatchKeywordStart(input, "finally", 1, Token::FINALLY)) return;
875
- if (MatchKeywordStart(input, "for", 1, Token::FOR)) return;
876
- if (MatchKeywordStart(input, "function", 1, Token::FUNCTION)) return;
877
- break;
878
- case I:
879
- if (MatchKeyword(input, 'f', KEYWORD_MATCHED, Token::IF)) return;
880
- if (MatchState(input, 'm', IM)) return;
881
- if (MatchKeyword(input, 'n', IN, Token::IN)) return;
882
- break;
883
- case IM:
884
- if (MatchState(input, 'p', IMP)) return;
885
- break;
886
- case IMP:
887
- if (MatchKeywordStart(input, "implements", 3,
888
- Token::FUTURE_RESERVED_WORD )) return;
889
- if (MatchKeywordStart(input, "import", 3,
890
- Token::FUTURE_RESERVED_WORD)) return;
891
- break;
892
- case IN:
893
- token_ = Token::IDENTIFIER;
894
- if (MatchKeywordStart(input, "interface", 2,
895
- Token::FUTURE_RESERVED_WORD)) return;
896
- if (MatchKeywordStart(input, "instanceof", 2, Token::INSTANCEOF)) return;
897
- break;
898
- case N:
899
- if (MatchKeywordStart(input, "native", 1, Token::NATIVE)) return;
900
- if (MatchKeywordStart(input, "new", 1, Token::NEW)) return;
901
- if (MatchKeywordStart(input, "null", 1, Token::NULL_LITERAL)) return;
902
- break;
903
- case P:
904
- if (MatchKeywordStart(input, "package", 1,
905
- Token::FUTURE_RESERVED_WORD)) return;
906
- if (MatchState(input, 'r', PR)) return;
907
- if (MatchKeywordStart(input, "public", 1,
908
- Token::FUTURE_RESERVED_WORD)) return;
909
- break;
910
- case PR:
911
- if (MatchKeywordStart(input, "private", 2,
912
- Token::FUTURE_RESERVED_WORD)) return;
913
- if (MatchKeywordStart(input, "protected", 2,
914
- Token::FUTURE_RESERVED_WORD)) return;
915
- break;
916
- case S:
917
- if (MatchKeywordStart(input, "static", 1,
918
- Token::FUTURE_RESERVED_WORD)) return;
919
- if (MatchKeywordStart(input, "super", 1,
920
- Token::FUTURE_RESERVED_WORD)) return;
921
- if (MatchKeywordStart(input, "switch", 1,
922
- Token::SWITCH)) return;
923
- break;
924
- case T:
925
- if (MatchState(input, 'h', TH)) return;
926
- if (MatchState(input, 'r', TR)) return;
927
- if (MatchKeywordStart(input, "typeof", 1, Token::TYPEOF)) return;
928
- break;
929
- case TH:
930
- if (MatchKeywordStart(input, "this", 2, Token::THIS)) return;
931
- if (MatchKeywordStart(input, "throw", 2, Token::THROW)) return;
932
- break;
933
- case TR:
934
- if (MatchKeywordStart(input, "true", 2, Token::TRUE_LITERAL)) return;
935
- if (MatchKeyword(input, 'y', KEYWORD_MATCHED, Token::TRY)) return;
936
- break;
937
- case V:
938
- if (MatchKeywordStart(input, "var", 1, Token::VAR)) return;
939
- if (MatchKeywordStart(input, "void", 1, Token::VOID)) return;
940
- break;
941
- case W:
942
- if (MatchKeywordStart(input, "while", 1, Token::WHILE)) return;
943
- if (MatchKeywordStart(input, "with", 1, Token::WITH)) return;
944
- break;
945
- case UNMATCHABLE:
946
- break;
947
- }
948
- // On fallthrough, it's a failure.
949
- state_ = UNMATCHABLE;
950
- }
951
-
952
1090
  } } // namespace v8::internal