libv8 3.3.10.4 → 3.5.10.beta1

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -195,7 +195,8 @@ ScopeType = { Global: 0,
195
195
  Local: 1,
196
196
  With: 2,
197
197
  Closure: 3,
198
- Catch: 4 };
198
+ Catch: 4,
199
+ Block: 5 };
199
200
 
200
201
 
201
202
  // Mirror hierarchy:
@@ -1243,13 +1244,17 @@ const kFrameDetailsLocalCountIndex = 4;
1243
1244
  const kFrameDetailsSourcePositionIndex = 5;
1244
1245
  const kFrameDetailsConstructCallIndex = 6;
1245
1246
  const kFrameDetailsAtReturnIndex = 7;
1246
- const kFrameDetailsDebuggerFrameIndex = 8;
1247
+ const kFrameDetailsFlagsIndex = 8;
1247
1248
  const kFrameDetailsFirstDynamicIndex = 9;
1248
1249
 
1249
1250
  const kFrameDetailsNameIndex = 0;
1250
1251
  const kFrameDetailsValueIndex = 1;
1251
1252
  const kFrameDetailsNameValueSize = 2;
1252
1253
 
1254
+ const kFrameDetailsFlagDebuggerFrameMask = 1 << 0;
1255
+ const kFrameDetailsFlagOptimizedFrameMask = 1 << 1;
1256
+ const kFrameDetailsFlagInlinedFrameIndexMask = 7 << 2;
1257
+
1253
1258
  /**
1254
1259
  * Wrapper for the frame details information retreived from the VM. The frame
1255
1260
  * details from the VM is an array with the following content. See runtime.cc
@@ -1262,7 +1267,7 @@ const kFrameDetailsNameValueSize = 2;
1262
1267
  * 5: Source position
1263
1268
  * 6: Construct call
1264
1269
  * 7: Is at return
1265
- * 8: Debugger frame
1270
+ * 8: Flags (debugger frame, optimized frame, inlined frame index)
1266
1271
  * Arguments name, value
1267
1272
  * Locals name, value
1268
1273
  * Return value if any
@@ -1308,7 +1313,27 @@ FrameDetails.prototype.isAtReturn = function() {
1308
1313
 
1309
1314
  FrameDetails.prototype.isDebuggerFrame = function() {
1310
1315
  %CheckExecutionState(this.break_id_);
1311
- return this.details_[kFrameDetailsDebuggerFrameIndex];
1316
+ var f = kFrameDetailsFlagDebuggerFrameMask;
1317
+ return (this.details_[kFrameDetailsFlagsIndex] & f) == f;
1318
+ }
1319
+
1320
+
1321
+ FrameDetails.prototype.isOptimizedFrame = function() {
1322
+ %CheckExecutionState(this.break_id_);
1323
+ var f = kFrameDetailsFlagOptimizedFrameMask;
1324
+ return (this.details_[kFrameDetailsFlagsIndex] & f) == f;
1325
+ }
1326
+
1327
+
1328
+ FrameDetails.prototype.isInlinedFrame = function() {
1329
+ return this.inlinedFrameIndex() > 0;
1330
+ }
1331
+
1332
+
1333
+ FrameDetails.prototype.inlinedFrameIndex = function() {
1334
+ %CheckExecutionState(this.break_id_);
1335
+ var f = kFrameDetailsFlagInlinedFrameIndexMask;
1336
+ return (this.details_[kFrameDetailsFlagsIndex] & f) >> 2
1312
1337
  }
1313
1338
 
1314
1339
 
@@ -1447,6 +1472,21 @@ FrameMirror.prototype.isDebuggerFrame = function() {
1447
1472
  };
1448
1473
 
1449
1474
 
1475
+ FrameMirror.prototype.isOptimizedFrame = function() {
1476
+ return this.details_.isOptimizedFrame();
1477
+ };
1478
+
1479
+
1480
+ FrameMirror.prototype.isInlinedFrame = function() {
1481
+ return this.details_.isInlinedFrame();
1482
+ };
1483
+
1484
+
1485
+ FrameMirror.prototype.inlinedFrameIndex = function() {
1486
+ return this.details_.inlinedFrameIndex();
1487
+ };
1488
+
1489
+
1450
1490
  FrameMirror.prototype.argumentCount = function() {
1451
1491
  return this.details_.argumentCount();
1452
1492
  };
@@ -1536,8 +1576,12 @@ FrameMirror.prototype.scope = function(index) {
1536
1576
 
1537
1577
 
1538
1578
  FrameMirror.prototype.evaluate = function(source, disable_break, opt_context_object) {
1539
- var result = %DebugEvaluate(this.break_id_, this.details_.frameId(),
1540
- source, Boolean(disable_break), opt_context_object);
1579
+ var result = %DebugEvaluate(this.break_id_,
1580
+ this.details_.frameId(),
1581
+ this.details_.inlinedFrameIndex(),
1582
+ source,
1583
+ Boolean(disable_break),
1584
+ opt_context_object);
1541
1585
  return MakeMirror(result);
1542
1586
  };
1543
1587
 
@@ -1562,8 +1606,10 @@ FrameMirror.prototype.invocationText = function() {
1562
1606
  // Try to find the function as a property in the receiver. Include the
1563
1607
  // prototype chain in the lookup.
1564
1608
  var property = GetUndefinedMirror();
1565
- if (!receiver.isUndefined()) {
1566
- for (var r = receiver; !r.isNull() && property.isUndefined(); r = r.protoObject()) {
1609
+ if (receiver.isObject()) {
1610
+ for (var r = receiver;
1611
+ !r.isNull() && property.isUndefined();
1612
+ r = r.protoObject()) {
1567
1613
  property = r.lookupProperty(func);
1568
1614
  }
1569
1615
  }
@@ -1690,6 +1736,7 @@ function ScopeDetails(frame, index) {
1690
1736
  this.break_id_ = frame.break_id_;
1691
1737
  this.details_ = %GetScopeDetails(frame.break_id_,
1692
1738
  frame.details_.frameId(),
1739
+ frame.details_.inlinedFrameIndex(),
1693
1740
  index);
1694
1741
  }
1695
1742
 
@@ -0,0 +1,89 @@
1
+ // Copyright 2011 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #ifndef V8_MISC_INTRINSICS_H_
29
+ #define V8_MISC_INTRINSICS_H_
30
+
31
+ #include "../include/v8.h"
32
+ #include "globals.h"
33
+
34
+ namespace v8 {
35
+ namespace internal {
36
+
37
+ // Returns the index of the leading 1 bit, counting the least significant bit at
38
+ // index 0. (1 << IntegerLog2(x)) is a mask for the most significant bit of x.
39
+ // Result is undefined if input is zero.
40
+ int IntegerLog2(uint32_t value);
41
+
42
+ #if defined(__GNUC__)
43
+
44
+ inline int IntegerLog2(uint32_t value) {
45
+ return 31 - __builtin_clz(value);
46
+ }
47
+
48
+ #elif defined(_MSC_VER)
49
+
50
+ #pragma intrinsic(_BitScanReverse)
51
+
52
+ inline int IntegerLog2(uint32_t value) {
53
+ unsigned long result; // NOLINT: MSVC intrinsic demands this type.
54
+ _BitScanReverse(&result, value);
55
+ return result;
56
+ }
57
+
58
+ #else
59
+
60
+ // Default version using regular operations. Code taken from:
61
+ // http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog
62
+ inline int IntegerLog2(uint32_t value) {
63
+ int result, shift;
64
+
65
+ shift = (value > 0xFFFF) << 4;
66
+ value >>= shift;
67
+ result = shift;
68
+
69
+ shift = (value > 0xFF) << 3;
70
+ value >>= shift;
71
+ result |= shift;
72
+
73
+ shift = (value > 0xF) << 2;
74
+ value >>= shift;
75
+ result |= shift;
76
+
77
+ shift = (value > 0x3) << 1;
78
+ value >>= shift;
79
+ result |= shift;
80
+
81
+ result |= (value >> 1);
82
+
83
+ return result;
84
+ }
85
+ #endif
86
+
87
+ } } // namespace v8::internal
88
+
89
+ #endif // V8_MISC_INTRINSICS_H_
@@ -40,8 +40,6 @@
40
40
  #include "serialize.h"
41
41
  #include "list.h"
42
42
 
43
- // use explicit namespace to avoid clashing with types in namespace v8
44
- namespace i = v8::internal;
45
43
  using namespace v8;
46
44
 
47
45
  static const unsigned int kMaxCounters = 256;
@@ -136,6 +134,7 @@ class PartialSnapshotSink : public i::SnapshotByteSink {
136
134
  return true;
137
135
  }
138
136
  int raw_size() { return raw_size_; }
137
+
139
138
  private:
140
139
  i::List<char> data_;
141
140
  int raw_size_;
@@ -265,14 +264,39 @@ class BZip2Compressor : public Compressor {
265
264
  private:
266
265
  i::ScopedVector<char>* output_;
267
266
  };
267
+
268
+
269
+ class BZip2Decompressor : public StartupDataDecompressor {
270
+ public:
271
+ virtual ~BZip2Decompressor() { }
272
+
273
+ protected:
274
+ virtual int DecompressData(char* raw_data,
275
+ int* raw_data_size,
276
+ const char* compressed_data,
277
+ int compressed_data_size) {
278
+ ASSERT_EQ(StartupData::kBZip2,
279
+ V8::GetCompressedStartupDataAlgorithm());
280
+ unsigned int decompressed_size = *raw_data_size;
281
+ int result =
282
+ BZ2_bzBuffToBuffDecompress(raw_data,
283
+ &decompressed_size,
284
+ const_cast<char*>(compressed_data),
285
+ compressed_data_size,
286
+ 0, 1);
287
+ if (result == BZ_OK) {
288
+ *raw_data_size = decompressed_size;
289
+ }
290
+ return result;
291
+ }
292
+ };
268
293
  #endif
269
294
 
270
295
 
271
296
  int main(int argc, char** argv) {
272
- #ifdef ENABLE_LOGGING_AND_PROFILING
273
297
  // By default, log code create information in the snapshot.
274
298
  i::FLAG_log_code = true;
275
- #endif
299
+
276
300
  // Print the usage if an error occurs when parsing the command line
277
301
  // flags or if the help flag is set.
278
302
  int result = i::FlagList::SetFlagsFromCommandLine(&argc, argv, true);
@@ -281,6 +305,14 @@ int main(int argc, char** argv) {
281
305
  i::FlagList::PrintHelp();
282
306
  return !i::FLAG_help;
283
307
  }
308
+ #ifdef COMPRESS_STARTUP_DATA_BZ2
309
+ BZip2Decompressor natives_decompressor;
310
+ int bz2_result = natives_decompressor.Decompress();
311
+ if (bz2_result != BZ_OK) {
312
+ fprintf(stderr, "bzip error code: %d\n", bz2_result);
313
+ exit(1);
314
+ }
315
+ #endif
284
316
  i::Serializer::Enable();
285
317
  Persistent<Context> context = v8::Context::New();
286
318
  ASSERT(!context.IsEmpty());
@@ -36,7 +36,7 @@ typedef bool (*NativeSourceCallback)(Vector<const char> name,
36
36
  int index);
37
37
 
38
38
  enum NativeType {
39
- CORE, EXPERIMENTAL, D8, I18N
39
+ CORE, EXPERIMENTAL, D8, TEST
40
40
  };
41
41
 
42
42
  template <NativeType type>
@@ -52,8 +52,11 @@ class NativesCollection {
52
52
  // non-debugger scripts have an index in the interval [GetDebuggerCount(),
53
53
  // GetNativesCount()).
54
54
  static int GetIndex(const char* name);
55
- static Vector<const char> GetScriptSource(int index);
55
+ static int GetRawScriptsSize();
56
+ static Vector<const char> GetRawScriptSource(int index);
56
57
  static Vector<const char> GetScriptName(int index);
58
+ static Vector<const byte> GetScriptsSource();
59
+ static void SetRawScriptsSource(Vector<const char> raw_source);
57
60
  };
58
61
 
59
62
  typedef NativesCollection<CORE> Natives;
@@ -88,6 +88,9 @@ void HeapObject::HeapObjectVerify() {
88
88
  case FIXED_ARRAY_TYPE:
89
89
  FixedArray::cast(this)->FixedArrayVerify();
90
90
  break;
91
+ case FIXED_DOUBLE_ARRAY_TYPE:
92
+ FixedDoubleArray::cast(this)->FixedDoubleArrayVerify();
93
+ break;
91
94
  case BYTE_ARRAY_TYPE:
92
95
  ByteArray::cast(this)->ByteArrayVerify();
93
96
  break;
@@ -150,6 +153,9 @@ void HeapObject::HeapObjectVerify() {
150
153
  case JS_ARRAY_TYPE:
151
154
  JSArray::cast(this)->JSArrayVerify();
152
155
  break;
156
+ case JS_WEAK_MAP_TYPE:
157
+ JSWeakMap::cast(this)->JSWeakMapVerify();
158
+ break;
153
159
  case JS_REGEXP_TYPE:
154
160
  JSRegExp::cast(this)->JSRegExpVerify();
155
161
  break;
@@ -289,6 +295,12 @@ void CodeCache::CodeCacheVerify() {
289
295
  }
290
296
 
291
297
 
298
+ void PolymorphicCodeCache::PolymorphicCodeCacheVerify() {
299
+ VerifyHeapPointer(cache());
300
+ ASSERT(cache()->IsUndefined() || cache()->IsPolymorphicCodeCacheHashTable());
301
+ }
302
+
303
+
292
304
  void FixedArray::FixedArrayVerify() {
293
305
  for (int i = 0; i < length(); i++) {
294
306
  Object* e = get(i);
@@ -301,6 +313,18 @@ void FixedArray::FixedArrayVerify() {
301
313
  }
302
314
 
303
315
 
316
+ void FixedDoubleArray::FixedDoubleArrayVerify() {
317
+ for (int i = 0; i < length(); i++) {
318
+ if (!is_the_hole(i)) {
319
+ double value = get_scalar(i);
320
+ ASSERT(!isnan(value) ||
321
+ (BitCast<uint64_t>(value) ==
322
+ BitCast<uint64_t>(canonical_not_the_hole_nan_as_double())));
323
+ }
324
+ }
325
+ }
326
+
327
+
304
328
  void JSValue::JSValueVerify() {
305
329
  Object* v = value();
306
330
  if (v->IsHeapObject()) {
@@ -328,6 +352,31 @@ void String::StringVerify() {
328
352
  if (IsSymbol()) {
329
353
  CHECK(!HEAP->InNewSpace(this));
330
354
  }
355
+ if (IsConsString()) {
356
+ ConsString::cast(this)->ConsStringVerify();
357
+ } else if (IsSlicedString()) {
358
+ SlicedString::cast(this)->SlicedStringVerify();
359
+ }
360
+ }
361
+
362
+
363
+ void ConsString::ConsStringVerify() {
364
+ CHECK(this->first()->IsString());
365
+ CHECK(this->second() == GetHeap()->empty_string() ||
366
+ this->second()->IsString());
367
+ CHECK(this->length() >= String::kMinNonFlatLength);
368
+ if (this->IsFlat()) {
369
+ // A flat cons can only be created by String::SlowTryFlatten.
370
+ // Afterwards, the first part may be externalized.
371
+ CHECK(this->first()->IsSeqString() || this->first()->IsExternalString());
372
+ }
373
+ }
374
+
375
+
376
+ void SlicedString::SlicedStringVerify() {
377
+ CHECK(!this->parent()->IsConsString());
378
+ CHECK(!this->parent()->IsSlicedString());
379
+ CHECK(this->length() >= SlicedString::kMinLength);
331
380
  }
332
381
 
333
382
 
@@ -426,7 +475,17 @@ void Code::CodeVerify() {
426
475
  void JSArray::JSArrayVerify() {
427
476
  JSObjectVerify();
428
477
  ASSERT(length()->IsNumber() || length()->IsUndefined());
429
- ASSERT(elements()->IsUndefined() || elements()->IsFixedArray());
478
+ ASSERT(elements()->IsUndefined() ||
479
+ elements()->IsFixedArray() ||
480
+ elements()->IsFixedDoubleArray());
481
+ }
482
+
483
+
484
+ void JSWeakMap::JSWeakMapVerify() {
485
+ CHECK(IsJSWeakMap());
486
+ JSObjectVerify();
487
+ VerifyHeapPointer(table());
488
+ ASSERT(table()->IsHashTable());
430
489
  }
431
490
 
432
491
 
@@ -444,14 +503,22 @@ void JSRegExp::JSRegExpVerify() {
444
503
 
445
504
  FixedArray* arr = FixedArray::cast(data());
446
505
  Object* ascii_data = arr->get(JSRegExp::kIrregexpASCIICodeIndex);
447
- // TheHole : Not compiled yet.
506
+ // Smi : Not compiled yet (-1) or code prepared for flushing.
448
507
  // JSObject: Compilation error.
449
508
  // Code/ByteArray: Compiled code.
450
- ASSERT(ascii_data->IsTheHole() || ascii_data->IsJSObject() ||
451
- (is_native ? ascii_data->IsCode() : ascii_data->IsByteArray()));
509
+ ASSERT(ascii_data->IsSmi() ||
510
+ (is_native ? ascii_data->IsCode() : ascii_data->IsByteArray()));
452
511
  Object* uc16_data = arr->get(JSRegExp::kIrregexpUC16CodeIndex);
453
- ASSERT(uc16_data->IsTheHole() || uc16_data->IsJSObject() ||
454
- (is_native ? uc16_data->IsCode() : uc16_data->IsByteArray()));
512
+ ASSERT(uc16_data->IsSmi() ||
513
+ (is_native ? uc16_data->IsCode() : uc16_data->IsByteArray()));
514
+
515
+ Object* ascii_saved = arr->get(JSRegExp::kIrregexpASCIICodeSavedIndex);
516
+ ASSERT(ascii_saved->IsSmi() || ascii_saved->IsString() ||
517
+ ascii_saved->IsCode());
518
+ Object* uc16_saved = arr->get(JSRegExp::kIrregexpUC16CodeSavedIndex);
519
+ ASSERT(uc16_saved->IsSmi() || uc16_saved->IsString() ||
520
+ uc16_saved->IsCode());
521
+
455
522
  ASSERT(arr->get(JSRegExp::kIrregexpCaptureCountIndex)->IsSmi());
456
523
  ASSERT(arr->get(JSRegExp::kIrregexpMaxRegisterCountIndex)->IsSmi());
457
524
  break;
@@ -35,6 +35,7 @@
35
35
  #ifndef V8_OBJECTS_INL_H_
36
36
  #define V8_OBJECTS_INL_H_
37
37
 
38
+ #include "elements.h"
38
39
  #include "objects.h"
39
40
  #include "contexts.h"
40
41
  #include "conversions-inl.h"
@@ -158,23 +159,33 @@ bool Object::IsString() {
158
159
  }
159
160
 
160
161
 
162
+ bool Object::IsSpecObject() {
163
+ return Object::IsHeapObject()
164
+ && HeapObject::cast(this)->map()->instance_type() >= FIRST_SPEC_OBJECT_TYPE;
165
+ }
166
+
167
+
161
168
  bool Object::IsSymbol() {
162
169
  if (!this->IsHeapObject()) return false;
163
170
  uint32_t type = HeapObject::cast(this)->map()->instance_type();
164
171
  // Because the symbol tag is non-zero and no non-string types have the
165
172
  // symbol bit set we can test for symbols with a very simple test
166
173
  // operation.
167
- ASSERT(kSymbolTag != 0);
174
+ STATIC_ASSERT(kSymbolTag != 0);
168
175
  ASSERT(kNotStringTag + kIsSymbolMask > LAST_TYPE);
169
176
  return (type & kIsSymbolMask) != 0;
170
177
  }
171
178
 
172
179
 
173
180
  bool Object::IsConsString() {
174
- if (!this->IsHeapObject()) return false;
175
- uint32_t type = HeapObject::cast(this)->map()->instance_type();
176
- return (type & (kIsNotStringMask | kStringRepresentationMask)) ==
177
- (kStringTag | kConsStringTag);
181
+ if (!IsString()) return false;
182
+ return StringShape(String::cast(this)).IsCons();
183
+ }
184
+
185
+
186
+ bool Object::IsSlicedString() {
187
+ if (!IsString()) return false;
188
+ return StringShape(String::cast(this)).IsSliced();
178
189
  }
179
190
 
180
191
 
@@ -217,6 +228,10 @@ bool Object::IsExternalTwoByteString() {
217
228
  String::cast(this)->IsTwoByteRepresentation();
218
229
  }
219
230
 
231
+ bool Object::HasValidElements() {
232
+ // Dictionary is covered under FixedArray.
233
+ return IsFixedArray() || IsFixedDoubleArray() || IsExternalArray();
234
+ }
220
235
 
221
236
  StringShape::StringShape(String* str)
222
237
  : type_(str->map()->instance_type()) {
@@ -241,7 +256,7 @@ StringShape::StringShape(InstanceType t)
241
256
 
242
257
  bool StringShape::IsSymbol() {
243
258
  ASSERT(valid());
244
- ASSERT(kSymbolTag != 0);
259
+ STATIC_ASSERT(kSymbolTag != 0);
245
260
  return (type_ & kIsSymbolMask) != 0;
246
261
  }
247
262
 
@@ -258,6 +273,38 @@ bool String::IsTwoByteRepresentation() {
258
273
  }
259
274
 
260
275
 
276
+ bool String::IsAsciiRepresentationUnderneath() {
277
+ uint32_t type = map()->instance_type();
278
+ STATIC_ASSERT(kIsIndirectStringTag != 0);
279
+ STATIC_ASSERT((kIsIndirectStringMask & kStringEncodingMask) == 0);
280
+ ASSERT(IsFlat());
281
+ switch (type & (kIsIndirectStringMask | kStringEncodingMask)) {
282
+ case kAsciiStringTag:
283
+ return true;
284
+ case kTwoByteStringTag:
285
+ return false;
286
+ default: // Cons or sliced string. Need to go deeper.
287
+ return GetUnderlying()->IsAsciiRepresentation();
288
+ }
289
+ }
290
+
291
+
292
+ bool String::IsTwoByteRepresentationUnderneath() {
293
+ uint32_t type = map()->instance_type();
294
+ STATIC_ASSERT(kIsIndirectStringTag != 0);
295
+ STATIC_ASSERT((kIsIndirectStringMask & kStringEncodingMask) == 0);
296
+ ASSERT(IsFlat());
297
+ switch (type & (kIsIndirectStringMask | kStringEncodingMask)) {
298
+ case kAsciiStringTag:
299
+ return false;
300
+ case kTwoByteStringTag:
301
+ return true;
302
+ default: // Cons or sliced string. Need to go deeper.
303
+ return GetUnderlying()->IsTwoByteRepresentation();
304
+ }
305
+ }
306
+
307
+
261
308
  bool String::HasOnlyAsciiChars() {
262
309
  uint32_t type = map()->instance_type();
263
310
  return (type & kStringEncodingMask) == kAsciiStringTag ||
@@ -270,6 +317,16 @@ bool StringShape::IsCons() {
270
317
  }
271
318
 
272
319
 
320
+ bool StringShape::IsSliced() {
321
+ return (type_ & kStringRepresentationMask) == kSlicedStringTag;
322
+ }
323
+
324
+
325
+ bool StringShape::IsIndirect() {
326
+ return (type_ & kIsIndirectStringMask) == kIsIndirectStringTag;
327
+ }
328
+
329
+
273
330
  bool StringShape::IsExternal() {
274
331
  return (type_ & kStringRepresentationMask) == kExternalStringTag;
275
332
  }
@@ -286,6 +343,11 @@ StringRepresentationTag StringShape::representation_tag() {
286
343
  }
287
344
 
288
345
 
346
+ uint32_t StringShape::encoding_tag() {
347
+ return type_ & kStringEncodingMask;
348
+ }
349
+
350
+
289
351
  uint32_t StringShape::full_representation_tag() {
290
352
  return (type_ & (kStringRepresentationMask | kStringEncodingMask));
291
353
  }
@@ -446,9 +508,33 @@ Failure* Failure::cast(MaybeObject* obj) {
446
508
  }
447
509
 
448
510
 
511
+ bool Object::IsJSReceiver() {
512
+ return IsHeapObject() &&
513
+ HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_RECEIVER_TYPE;
514
+ }
515
+
516
+
449
517
  bool Object::IsJSObject() {
450
- return IsHeapObject()
451
- && HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_OBJECT_TYPE;
518
+ return IsJSReceiver() && !IsJSProxy();
519
+ }
520
+
521
+
522
+ bool Object::IsJSProxy() {
523
+ return Object::IsHeapObject() &&
524
+ (HeapObject::cast(this)->map()->instance_type() == JS_PROXY_TYPE ||
525
+ HeapObject::cast(this)->map()->instance_type() == JS_FUNCTION_PROXY_TYPE);
526
+ }
527
+
528
+
529
+ bool Object::IsJSFunctionProxy() {
530
+ return Object::IsHeapObject() &&
531
+ HeapObject::cast(this)->map()->instance_type() == JS_FUNCTION_PROXY_TYPE;
532
+ }
533
+
534
+
535
+ bool Object::IsJSWeakMap() {
536
+ return Object::IsJSObject() &&
537
+ HeapObject::cast(this)->map()->instance_type() == JS_WEAK_MAP_TYPE;
452
538
  }
453
539
 
454
540
 
@@ -471,6 +557,13 @@ bool Object::IsFixedArray() {
471
557
  }
472
558
 
473
559
 
560
+ bool Object::IsFixedDoubleArray() {
561
+ return Object::IsHeapObject()
562
+ && HeapObject::cast(this)->map()->instance_type() ==
563
+ FIXED_DOUBLE_ARRAY_TYPE;
564
+ }
565
+
566
+
474
567
  bool Object::IsDescriptorArray() {
475
568
  return IsFixedArray();
476
569
  }
@@ -505,26 +598,29 @@ bool Object::IsDeoptimizationOutputData() {
505
598
 
506
599
  bool Object::IsContext() {
507
600
  if (Object::IsHeapObject()) {
508
- Heap* heap = HeapObject::cast(this)->GetHeap();
509
- return (HeapObject::cast(this)->map() == heap->context_map() ||
510
- HeapObject::cast(this)->map() == heap->catch_context_map() ||
511
- HeapObject::cast(this)->map() == heap->global_context_map());
601
+ Map* map = HeapObject::cast(this)->map();
602
+ Heap* heap = map->GetHeap();
603
+ return (map == heap->function_context_map() ||
604
+ map == heap->catch_context_map() ||
605
+ map == heap->with_context_map() ||
606
+ map == heap->global_context_map() ||
607
+ map == heap->block_context_map());
512
608
  }
513
609
  return false;
514
610
  }
515
611
 
516
612
 
517
- bool Object::IsCatchContext() {
613
+ bool Object::IsGlobalContext() {
518
614
  return Object::IsHeapObject() &&
519
615
  HeapObject::cast(this)->map() ==
520
- HeapObject::cast(this)->GetHeap()->catch_context_map();
616
+ HeapObject::cast(this)->GetHeap()->global_context_map();
521
617
  }
522
618
 
523
619
 
524
- bool Object::IsGlobalContext() {
620
+ bool Object::IsSerializedScopeInfo() {
525
621
  return Object::IsHeapObject() &&
526
622
  HeapObject::cast(this)->map() ==
527
- HeapObject::cast(this)->GetHeap()->global_context_map();
623
+ HeapObject::cast(this)->GetHeap()->serialized_scope_info_map();
528
624
  }
529
625
 
530
626
 
@@ -584,12 +680,6 @@ bool Object::IsStringWrapper() {
584
680
  }
585
681
 
586
682
 
587
- bool Object::IsJSProxy() {
588
- return Object::IsHeapObject()
589
- && HeapObject::cast(this)->map()->instance_type() == JS_PROXY_TYPE;
590
- }
591
-
592
-
593
683
  bool Object::IsForeign() {
594
684
  return Object::IsHeapObject()
595
685
  && HeapObject::cast(this)->map()->instance_type() == FOREIGN_TYPE;
@@ -627,8 +717,8 @@ bool Object::IsHashTable() {
627
717
 
628
718
 
629
719
  bool Object::IsDictionary() {
630
- return IsHashTable() && this !=
631
- HeapObject::cast(this)->GetHeap()->symbol_table();
720
+ return IsHashTable() &&
721
+ this != HeapObject::cast(this)->GetHeap()->symbol_table();
632
722
  }
633
723
 
634
724
 
@@ -676,6 +766,11 @@ bool Object::IsCodeCacheHashTable() {
676
766
  }
677
767
 
678
768
 
769
+ bool Object::IsPolymorphicCodeCacheHashTable() {
770
+ return IsHashTable();
771
+ }
772
+
773
+
679
774
  bool Object::IsMapCache() {
680
775
  return IsHashTable();
681
776
  }
@@ -867,7 +962,7 @@ MaybeObject* Object::GetProperty(String* key, PropertyAttributes* attributes) {
867
962
  #else // V8_TARGET_ARCH_MIPS
868
963
  // Prevent gcc from using load-double (mips ldc1) on (possibly)
869
964
  // non-64-bit aligned HeapNumber::value.
870
- static inline double read_double_field(HeapNumber* p, int offset) {
965
+ static inline double read_double_field(void* p, int offset) {
871
966
  union conversion {
872
967
  double d;
873
968
  uint32_t u[2];
@@ -886,7 +981,7 @@ MaybeObject* Object::GetProperty(String* key, PropertyAttributes* attributes) {
886
981
  #else // V8_TARGET_ARCH_MIPS
887
982
  // Prevent gcc from using store-double (mips sdc1) on (possibly)
888
983
  // non-64-bit aligned HeapNumber::value.
889
- static inline void write_double_field(HeapNumber* p, int offset,
984
+ static inline void write_double_field(void* p, int offset,
890
985
  double value) {
891
986
  union conversion {
892
987
  double d;
@@ -1299,20 +1394,20 @@ int HeapNumber::get_sign() {
1299
1394
  ACCESSORS(JSObject, properties, FixedArray, kPropertiesOffset)
1300
1395
 
1301
1396
 
1302
- HeapObject* JSObject::elements() {
1397
+ FixedArrayBase* JSObject::elements() {
1303
1398
  Object* array = READ_FIELD(this, kElementsOffset);
1304
- // In the assert below Dictionary is covered under FixedArray.
1305
- ASSERT(array->IsFixedArray() || array->IsExternalArray());
1306
- return reinterpret_cast<HeapObject*>(array);
1399
+ ASSERT(array->HasValidElements());
1400
+ return static_cast<FixedArrayBase*>(array);
1307
1401
  }
1308
1402
 
1309
1403
 
1310
- void JSObject::set_elements(HeapObject* value, WriteBarrierMode mode) {
1404
+ void JSObject::set_elements(FixedArrayBase* value, WriteBarrierMode mode) {
1311
1405
  ASSERT(map()->has_fast_elements() ==
1312
1406
  (value->map() == GetHeap()->fixed_array_map() ||
1313
1407
  value->map() == GetHeap()->fixed_cow_array_map()));
1314
- // In the assert below Dictionary is covered under FixedArray.
1315
- ASSERT(value->IsFixedArray() || value->IsExternalArray());
1408
+ ASSERT(map()->has_fast_double_elements() ==
1409
+ value->IsFixedDoubleArray());
1410
+ ASSERT(value->HasValidElements());
1316
1411
  WRITE_FIELD(this, kElementsOffset, value);
1317
1412
  CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kElementsOffset, mode);
1318
1413
  }
@@ -1387,6 +1482,8 @@ int JSObject::GetHeaderSize() {
1387
1482
  return JSValue::kSize;
1388
1483
  case JS_ARRAY_TYPE:
1389
1484
  return JSValue::kSize;
1485
+ case JS_WEAK_MAP_TYPE:
1486
+ return JSWeakMap::kSize;
1390
1487
  case JS_REGEXP_TYPE:
1391
1488
  return JSValue::kSize;
1392
1489
  case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
@@ -1560,6 +1657,12 @@ bool Object::IsStringObjectWithCharacterAt(uint32_t index) {
1560
1657
  }
1561
1658
 
1562
1659
 
1660
+ FixedArrayBase* FixedArrayBase::cast(Object* object) {
1661
+ ASSERT(object->IsFixedArray() || object->IsFixedDoubleArray());
1662
+ return reinterpret_cast<FixedArrayBase*>(object);
1663
+ }
1664
+
1665
+
1563
1666
  Object* FixedArray::get(int index) {
1564
1667
  ASSERT(index >= 0 && index < this->length());
1565
1668
  return READ_FIELD(this, kHeaderSize + index * kPointerSize);
@@ -1568,6 +1671,7 @@ Object* FixedArray::get(int index) {
1568
1671
 
1569
1672
  void FixedArray::set(int index, Smi* value) {
1570
1673
  ASSERT(map() != HEAP->fixed_cow_array_map());
1674
+ ASSERT(index >= 0 && index < this->length());
1571
1675
  ASSERT(reinterpret_cast<Object*>(value)->IsSmi());
1572
1676
  int offset = kHeaderSize + index * kPointerSize;
1573
1677
  WRITE_FIELD(this, offset, value);
@@ -1583,6 +1687,114 @@ void FixedArray::set(int index, Object* value) {
1583
1687
  }
1584
1688
 
1585
1689
 
1690
+ inline bool FixedDoubleArray::is_the_hole_nan(double value) {
1691
+ return BitCast<uint64_t, double>(value) == kHoleNanInt64;
1692
+ }
1693
+
1694
+
1695
+ inline double FixedDoubleArray::hole_nan_as_double() {
1696
+ return BitCast<double, uint64_t>(kHoleNanInt64);
1697
+ }
1698
+
1699
+
1700
+ inline double FixedDoubleArray::canonical_not_the_hole_nan_as_double() {
1701
+ ASSERT(BitCast<uint64_t>(OS::nan_value()) != kHoleNanInt64);
1702
+ ASSERT((BitCast<uint64_t>(OS::nan_value()) >> 32) != kHoleNanUpper32);
1703
+ return OS::nan_value();
1704
+ }
1705
+
1706
+
1707
+ double FixedDoubleArray::get_scalar(int index) {
1708
+ ASSERT(map() != HEAP->fixed_cow_array_map() &&
1709
+ map() != HEAP->fixed_array_map());
1710
+ ASSERT(index >= 0 && index < this->length());
1711
+ double result = READ_DOUBLE_FIELD(this, kHeaderSize + index * kDoubleSize);
1712
+ ASSERT(!is_the_hole_nan(result));
1713
+ return result;
1714
+ }
1715
+
1716
+
1717
+ MaybeObject* FixedDoubleArray::get(int index) {
1718
+ if (is_the_hole(index)) {
1719
+ return GetHeap()->the_hole_value();
1720
+ } else {
1721
+ return GetHeap()->NumberFromDouble(get_scalar(index));
1722
+ }
1723
+ }
1724
+
1725
+
1726
+ void FixedDoubleArray::set(int index, double value) {
1727
+ ASSERT(map() != HEAP->fixed_cow_array_map() &&
1728
+ map() != HEAP->fixed_array_map());
1729
+ int offset = kHeaderSize + index * kDoubleSize;
1730
+ if (isnan(value)) value = canonical_not_the_hole_nan_as_double();
1731
+ WRITE_DOUBLE_FIELD(this, offset, value);
1732
+ }
1733
+
1734
+
1735
+ void FixedDoubleArray::set_the_hole(int index) {
1736
+ ASSERT(map() != HEAP->fixed_cow_array_map() &&
1737
+ map() != HEAP->fixed_array_map());
1738
+ int offset = kHeaderSize + index * kDoubleSize;
1739
+ WRITE_DOUBLE_FIELD(this, offset, hole_nan_as_double());
1740
+ }
1741
+
1742
+
1743
+ bool FixedDoubleArray::is_the_hole(int index) {
1744
+ int offset = kHeaderSize + index * kDoubleSize;
1745
+ return is_the_hole_nan(READ_DOUBLE_FIELD(this, offset));
1746
+ }
1747
+
1748
+
1749
+ void FixedDoubleArray::Initialize(FixedDoubleArray* from) {
1750
+ int old_length = from->length();
1751
+ ASSERT(old_length < length());
1752
+ OS::MemCopy(FIELD_ADDR(this, kHeaderSize),
1753
+ FIELD_ADDR(from, kHeaderSize),
1754
+ old_length * kDoubleSize);
1755
+ int offset = kHeaderSize + old_length * kDoubleSize;
1756
+ for (int current = from->length(); current < length(); ++current) {
1757
+ WRITE_DOUBLE_FIELD(this, offset, hole_nan_as_double());
1758
+ offset += kDoubleSize;
1759
+ }
1760
+ }
1761
+
1762
+
1763
+ void FixedDoubleArray::Initialize(FixedArray* from) {
1764
+ int old_length = from->length();
1765
+ ASSERT(old_length < length());
1766
+ for (int i = 0; i < old_length; i++) {
1767
+ Object* hole_or_object = from->get(i);
1768
+ if (hole_or_object->IsTheHole()) {
1769
+ set_the_hole(i);
1770
+ } else {
1771
+ set(i, hole_or_object->Number());
1772
+ }
1773
+ }
1774
+ int offset = kHeaderSize + old_length * kDoubleSize;
1775
+ for (int current = from->length(); current < length(); ++current) {
1776
+ WRITE_DOUBLE_FIELD(this, offset, hole_nan_as_double());
1777
+ offset += kDoubleSize;
1778
+ }
1779
+ }
1780
+
1781
+
1782
+ void FixedDoubleArray::Initialize(NumberDictionary* from) {
1783
+ int offset = kHeaderSize;
1784
+ for (int current = 0; current < length(); ++current) {
1785
+ WRITE_DOUBLE_FIELD(this, offset, hole_nan_as_double());
1786
+ offset += kDoubleSize;
1787
+ }
1788
+ for (int i = 0; i < from->Capacity(); i++) {
1789
+ Object* key = from->KeyAt(i);
1790
+ if (key->IsNumber()) {
1791
+ uint32_t entry = static_cast<uint32_t>(key->Number());
1792
+ set(entry, from->ValueAt(i)->Number());
1793
+ }
1794
+ }
1795
+ }
1796
+
1797
+
1586
1798
  WriteBarrierMode HeapObject::GetWriteBarrierMode(const AssertNoAllocation&) {
1587
1799
  if (GetHeap()->InNewSpace(this)) return SKIP_WRITE_BARRIER;
1588
1800
  return UPDATE_WRITE_BARRIER;
@@ -1834,6 +2046,17 @@ void DescriptorArray::Swap(int first, int second) {
1834
2046
  }
1835
2047
 
1836
2048
 
2049
+ template<typename Shape, typename Key>
2050
+ int HashTable<Shape, Key>::ComputeCapacity(int at_least_space_for) {
2051
+ const int kMinCapacity = 32;
2052
+ int capacity = RoundUpToPowerOf2(at_least_space_for * 2);
2053
+ if (capacity < kMinCapacity) {
2054
+ capacity = kMinCapacity; // Guarantee min capacity.
2055
+ }
2056
+ return capacity;
2057
+ }
2058
+
2059
+
1837
2060
  template<typename Shape, typename Key>
1838
2061
  int HashTable<Shape, Key>::FindEntry(Key key) {
1839
2062
  return FindEntry(GetIsolate(), key);
@@ -1883,6 +2106,7 @@ void NumberDictionary::set_requires_slow_elements() {
1883
2106
 
1884
2107
 
1885
2108
  CAST_ACCESSOR(FixedArray)
2109
+ CAST_ACCESSOR(FixedDoubleArray)
1886
2110
  CAST_ACCESSOR(DescriptorArray)
1887
2111
  CAST_ACCESSOR(DeoptimizationInputData)
1888
2112
  CAST_ACCESSOR(DeoptimizationOutputData)
@@ -1891,15 +2115,18 @@ CAST_ACCESSOR(JSFunctionResultCache)
1891
2115
  CAST_ACCESSOR(NormalizedMapCache)
1892
2116
  CAST_ACCESSOR(CompilationCacheTable)
1893
2117
  CAST_ACCESSOR(CodeCacheHashTable)
2118
+ CAST_ACCESSOR(PolymorphicCodeCacheHashTable)
1894
2119
  CAST_ACCESSOR(MapCache)
1895
2120
  CAST_ACCESSOR(String)
1896
2121
  CAST_ACCESSOR(SeqString)
1897
2122
  CAST_ACCESSOR(SeqAsciiString)
1898
2123
  CAST_ACCESSOR(SeqTwoByteString)
2124
+ CAST_ACCESSOR(SlicedString)
1899
2125
  CAST_ACCESSOR(ConsString)
1900
2126
  CAST_ACCESSOR(ExternalString)
1901
2127
  CAST_ACCESSOR(ExternalAsciiString)
1902
2128
  CAST_ACCESSOR(ExternalTwoByteString)
2129
+ CAST_ACCESSOR(JSReceiver)
1903
2130
  CAST_ACCESSOR(JSObject)
1904
2131
  CAST_ACCESSOR(Smi)
1905
2132
  CAST_ACCESSOR(HeapObject)
@@ -1917,6 +2144,8 @@ CAST_ACCESSOR(Code)
1917
2144
  CAST_ACCESSOR(JSArray)
1918
2145
  CAST_ACCESSOR(JSRegExp)
1919
2146
  CAST_ACCESSOR(JSProxy)
2147
+ CAST_ACCESSOR(JSFunctionProxy)
2148
+ CAST_ACCESSOR(JSWeakMap)
1920
2149
  CAST_ACCESSOR(Foreign)
1921
2150
  CAST_ACCESSOR(ByteArray)
1922
2151
  CAST_ACCESSOR(ExternalArray)
@@ -1944,11 +2173,7 @@ HashTable<Shape, Key>* HashTable<Shape, Key>::cast(Object* obj) {
1944
2173
  }
1945
2174
 
1946
2175
 
1947
- SMI_ACCESSORS(FixedArray, length, kLengthOffset)
1948
- SMI_ACCESSORS(ByteArray, length, kLengthOffset)
1949
-
1950
- INT_ACCESSORS(ExternalArray, length, kLengthOffset)
1951
-
2176
+ SMI_ACCESSORS(FixedArrayBase, length, kLengthOffset)
1952
2177
 
1953
2178
  SMI_ACCESSORS(String, length, kLengthOffset)
1954
2179
 
@@ -1978,7 +2203,7 @@ bool String::Equals(String* other) {
1978
2203
  MaybeObject* String::TryFlatten(PretenureFlag pretenure) {
1979
2204
  if (!StringShape(this).IsCons()) return this;
1980
2205
  ConsString* cons = ConsString::cast(this);
1981
- if (cons->second()->length() == 0) return cons->first();
2206
+ if (cons->IsFlat()) return cons->first();
1982
2207
  return SlowTryFlatten(pretenure);
1983
2208
  }
1984
2209
 
@@ -1986,10 +2211,8 @@ MaybeObject* String::TryFlatten(PretenureFlag pretenure) {
1986
2211
  String* String::TryFlattenGetString(PretenureFlag pretenure) {
1987
2212
  MaybeObject* flat = TryFlatten(pretenure);
1988
2213
  Object* successfully_flattened;
1989
- if (flat->ToObject(&successfully_flattened)) {
1990
- return String::cast(successfully_flattened);
1991
- }
1992
- return this;
2214
+ if (!flat->ToObject(&successfully_flattened)) return this;
2215
+ return String::cast(successfully_flattened);
1993
2216
  }
1994
2217
 
1995
2218
 
@@ -2007,6 +2230,9 @@ uint16_t String::Get(int index) {
2007
2230
  return ExternalAsciiString::cast(this)->ExternalAsciiStringGet(index);
2008
2231
  case kExternalStringTag | kTwoByteStringTag:
2009
2232
  return ExternalTwoByteString::cast(this)->ExternalTwoByteStringGet(index);
2233
+ case kSlicedStringTag | kAsciiStringTag:
2234
+ case kSlicedStringTag | kTwoByteStringTag:
2235
+ return SlicedString::cast(this)->SlicedStringGet(index);
2010
2236
  default:
2011
2237
  break;
2012
2238
  }
@@ -2027,15 +2253,19 @@ void String::Set(int index, uint16_t value) {
2027
2253
 
2028
2254
 
2029
2255
  bool String::IsFlat() {
2030
- switch (StringShape(this).representation_tag()) {
2031
- case kConsStringTag: {
2032
- String* second = ConsString::cast(this)->second();
2033
- // Only flattened strings have second part empty.
2034
- return second->length() == 0;
2035
- }
2036
- default:
2037
- return true;
2038
- }
2256
+ if (!StringShape(this).IsCons()) return true;
2257
+ return ConsString::cast(this)->second()->length() == 0;
2258
+ }
2259
+
2260
+
2261
+ String* String::GetUnderlying() {
2262
+ // Giving direct access to underlying string only makes sense if the
2263
+ // wrapping string is already flattened.
2264
+ ASSERT(this->IsFlat());
2265
+ ASSERT(StringShape(this).IsIndirect());
2266
+ STATIC_ASSERT(ConsString::kFirstOffset == SlicedString::kParentOffset);
2267
+ const int kUnderlyingOffset = SlicedString::kParentOffset;
2268
+ return String::cast(READ_FIELD(this, kUnderlyingOffset));
2039
2269
  }
2040
2270
 
2041
2271
 
@@ -2094,6 +2324,20 @@ int SeqAsciiString::SeqAsciiStringSize(InstanceType instance_type) {
2094
2324
  }
2095
2325
 
2096
2326
 
2327
+ String* SlicedString::parent() {
2328
+ return String::cast(READ_FIELD(this, kParentOffset));
2329
+ }
2330
+
2331
+
2332
+ void SlicedString::set_parent(String* parent) {
2333
+ ASSERT(parent->IsSeqString());
2334
+ WRITE_FIELD(this, kParentOffset, parent);
2335
+ }
2336
+
2337
+
2338
+ SMI_ACCESSORS(SlicedString, offset, kOffsetOffset)
2339
+
2340
+
2097
2341
  String* ConsString::first() {
2098
2342
  return String::cast(READ_FIELD(this, kFirstOffset));
2099
2343
  }
@@ -2218,13 +2462,18 @@ uint8_t* ExternalPixelArray::external_pixel_pointer() {
2218
2462
  }
2219
2463
 
2220
2464
 
2221
- uint8_t ExternalPixelArray::get(int index) {
2465
+ uint8_t ExternalPixelArray::get_scalar(int index) {
2222
2466
  ASSERT((index >= 0) && (index < this->length()));
2223
2467
  uint8_t* ptr = external_pixel_pointer();
2224
2468
  return ptr[index];
2225
2469
  }
2226
2470
 
2227
2471
 
2472
+ MaybeObject* ExternalPixelArray::get(int index) {
2473
+ return Smi::FromInt(static_cast<int>(get_scalar(index)));
2474
+ }
2475
+
2476
+
2228
2477
  void ExternalPixelArray::set(int index, uint8_t value) {
2229
2478
  ASSERT((index >= 0) && (index < this->length()));
2230
2479
  uint8_t* ptr = external_pixel_pointer();
@@ -2244,13 +2493,18 @@ void ExternalArray::set_external_pointer(void* value, WriteBarrierMode mode) {
2244
2493
  }
2245
2494
 
2246
2495
 
2247
- int8_t ExternalByteArray::get(int index) {
2496
+ int8_t ExternalByteArray::get_scalar(int index) {
2248
2497
  ASSERT((index >= 0) && (index < this->length()));
2249
2498
  int8_t* ptr = static_cast<int8_t*>(external_pointer());
2250
2499
  return ptr[index];
2251
2500
  }
2252
2501
 
2253
2502
 
2503
+ MaybeObject* ExternalByteArray::get(int index) {
2504
+ return Smi::FromInt(static_cast<int>(get_scalar(index)));
2505
+ }
2506
+
2507
+
2254
2508
  void ExternalByteArray::set(int index, int8_t value) {
2255
2509
  ASSERT((index >= 0) && (index < this->length()));
2256
2510
  int8_t* ptr = static_cast<int8_t*>(external_pointer());
@@ -2258,13 +2512,18 @@ void ExternalByteArray::set(int index, int8_t value) {
2258
2512
  }
2259
2513
 
2260
2514
 
2261
- uint8_t ExternalUnsignedByteArray::get(int index) {
2515
+ uint8_t ExternalUnsignedByteArray::get_scalar(int index) {
2262
2516
  ASSERT((index >= 0) && (index < this->length()));
2263
2517
  uint8_t* ptr = static_cast<uint8_t*>(external_pointer());
2264
2518
  return ptr[index];
2265
2519
  }
2266
2520
 
2267
2521
 
2522
+ MaybeObject* ExternalUnsignedByteArray::get(int index) {
2523
+ return Smi::FromInt(static_cast<int>(get_scalar(index)));
2524
+ }
2525
+
2526
+
2268
2527
  void ExternalUnsignedByteArray::set(int index, uint8_t value) {
2269
2528
  ASSERT((index >= 0) && (index < this->length()));
2270
2529
  uint8_t* ptr = static_cast<uint8_t*>(external_pointer());
@@ -2272,13 +2531,18 @@ void ExternalUnsignedByteArray::set(int index, uint8_t value) {
2272
2531
  }
2273
2532
 
2274
2533
 
2275
- int16_t ExternalShortArray::get(int index) {
2534
+ int16_t ExternalShortArray::get_scalar(int index) {
2276
2535
  ASSERT((index >= 0) && (index < this->length()));
2277
2536
  int16_t* ptr = static_cast<int16_t*>(external_pointer());
2278
2537
  return ptr[index];
2279
2538
  }
2280
2539
 
2281
2540
 
2541
+ MaybeObject* ExternalShortArray::get(int index) {
2542
+ return Smi::FromInt(static_cast<int>(get_scalar(index)));
2543
+ }
2544
+
2545
+
2282
2546
  void ExternalShortArray::set(int index, int16_t value) {
2283
2547
  ASSERT((index >= 0) && (index < this->length()));
2284
2548
  int16_t* ptr = static_cast<int16_t*>(external_pointer());
@@ -2286,13 +2550,18 @@ void ExternalShortArray::set(int index, int16_t value) {
2286
2550
  }
2287
2551
 
2288
2552
 
2289
- uint16_t ExternalUnsignedShortArray::get(int index) {
2553
+ uint16_t ExternalUnsignedShortArray::get_scalar(int index) {
2290
2554
  ASSERT((index >= 0) && (index < this->length()));
2291
2555
  uint16_t* ptr = static_cast<uint16_t*>(external_pointer());
2292
2556
  return ptr[index];
2293
2557
  }
2294
2558
 
2295
2559
 
2560
+ MaybeObject* ExternalUnsignedShortArray::get(int index) {
2561
+ return Smi::FromInt(static_cast<int>(get_scalar(index)));
2562
+ }
2563
+
2564
+
2296
2565
  void ExternalUnsignedShortArray::set(int index, uint16_t value) {
2297
2566
  ASSERT((index >= 0) && (index < this->length()));
2298
2567
  uint16_t* ptr = static_cast<uint16_t*>(external_pointer());
@@ -2300,13 +2569,18 @@ void ExternalUnsignedShortArray::set(int index, uint16_t value) {
2300
2569
  }
2301
2570
 
2302
2571
 
2303
- int32_t ExternalIntArray::get(int index) {
2572
+ int32_t ExternalIntArray::get_scalar(int index) {
2304
2573
  ASSERT((index >= 0) && (index < this->length()));
2305
2574
  int32_t* ptr = static_cast<int32_t*>(external_pointer());
2306
2575
  return ptr[index];
2307
2576
  }
2308
2577
 
2309
2578
 
2579
+ MaybeObject* ExternalIntArray::get(int index) {
2580
+ return GetHeap()->NumberFromInt32(get_scalar(index));
2581
+ }
2582
+
2583
+
2310
2584
  void ExternalIntArray::set(int index, int32_t value) {
2311
2585
  ASSERT((index >= 0) && (index < this->length()));
2312
2586
  int32_t* ptr = static_cast<int32_t*>(external_pointer());
@@ -2314,13 +2588,18 @@ void ExternalIntArray::set(int index, int32_t value) {
2314
2588
  }
2315
2589
 
2316
2590
 
2317
- uint32_t ExternalUnsignedIntArray::get(int index) {
2591
+ uint32_t ExternalUnsignedIntArray::get_scalar(int index) {
2318
2592
  ASSERT((index >= 0) && (index < this->length()));
2319
2593
  uint32_t* ptr = static_cast<uint32_t*>(external_pointer());
2320
2594
  return ptr[index];
2321
2595
  }
2322
2596
 
2323
2597
 
2598
+ MaybeObject* ExternalUnsignedIntArray::get(int index) {
2599
+ return GetHeap()->NumberFromUint32(get_scalar(index));
2600
+ }
2601
+
2602
+
2324
2603
  void ExternalUnsignedIntArray::set(int index, uint32_t value) {
2325
2604
  ASSERT((index >= 0) && (index < this->length()));
2326
2605
  uint32_t* ptr = static_cast<uint32_t*>(external_pointer());
@@ -2328,13 +2607,18 @@ void ExternalUnsignedIntArray::set(int index, uint32_t value) {
2328
2607
  }
2329
2608
 
2330
2609
 
2331
- float ExternalFloatArray::get(int index) {
2610
+ float ExternalFloatArray::get_scalar(int index) {
2332
2611
  ASSERT((index >= 0) && (index < this->length()));
2333
2612
  float* ptr = static_cast<float*>(external_pointer());
2334
2613
  return ptr[index];
2335
2614
  }
2336
2615
 
2337
2616
 
2617
+ MaybeObject* ExternalFloatArray::get(int index) {
2618
+ return GetHeap()->NumberFromDouble(get_scalar(index));
2619
+ }
2620
+
2621
+
2338
2622
  void ExternalFloatArray::set(int index, float value) {
2339
2623
  ASSERT((index >= 0) && (index < this->length()));
2340
2624
  float* ptr = static_cast<float*>(external_pointer());
@@ -2342,13 +2626,18 @@ void ExternalFloatArray::set(int index, float value) {
2342
2626
  }
2343
2627
 
2344
2628
 
2345
- double ExternalDoubleArray::get(int index) {
2629
+ double ExternalDoubleArray::get_scalar(int index) {
2346
2630
  ASSERT((index >= 0) && (index < this->length()));
2347
2631
  double* ptr = static_cast<double*>(external_pointer());
2348
2632
  return ptr[index];
2349
2633
  }
2350
2634
 
2351
2635
 
2636
+ MaybeObject* ExternalDoubleArray::get(int index) {
2637
+ return GetHeap()->NumberFromDouble(get_scalar(index));
2638
+ }
2639
+
2640
+
2352
2641
  void ExternalDoubleArray::set(int index, double value) {
2353
2642
  ASSERT((index >= 0) && (index < this->length()));
2354
2643
  double* ptr = static_cast<double*>(external_pointer());
@@ -2403,6 +2692,10 @@ int HeapObject::SizeFromMap(Map* map) {
2403
2692
  return SeqTwoByteString::SizeFor(
2404
2693
  reinterpret_cast<SeqTwoByteString*>(this)->length());
2405
2694
  }
2695
+ if (instance_type == FIXED_DOUBLE_ARRAY_TYPE) {
2696
+ return FixedDoubleArray::SizeFor(
2697
+ reinterpret_cast<FixedDoubleArray*>(this)->length());
2698
+ }
2406
2699
  ASSERT(instance_type == CODE_TYPE);
2407
2700
  return reinterpret_cast<Code*>(this)->CodeSize();
2408
2701
  }
@@ -2621,7 +2914,8 @@ int Code::major_key() {
2621
2914
  ASSERT(kind() == STUB ||
2622
2915
  kind() == UNARY_OP_IC ||
2623
2916
  kind() == BINARY_OP_IC ||
2624
- kind() == COMPARE_IC);
2917
+ kind() == COMPARE_IC ||
2918
+ kind() == TO_BOOLEAN_IC);
2625
2919
  return READ_BYTE_FIELD(this, kStubMajorKeyOffset);
2626
2920
  }
2627
2921
 
@@ -2630,7 +2924,8 @@ void Code::set_major_key(int major) {
2630
2924
  ASSERT(kind() == STUB ||
2631
2925
  kind() == UNARY_OP_IC ||
2632
2926
  kind() == BINARY_OP_IC ||
2633
- kind() == COMPARE_IC);
2927
+ kind() == COMPARE_IC ||
2928
+ kind() == TO_BOOLEAN_IC);
2634
2929
  ASSERT(0 <= major && major < 256);
2635
2930
  WRITE_BYTE_FIELD(this, kStubMajorKeyOffset, major);
2636
2931
  }
@@ -2724,19 +3019,6 @@ void Code::set_check_type(CheckType value) {
2724
3019
  }
2725
3020
 
2726
3021
 
2727
- ExternalArrayType Code::external_array_type() {
2728
- ASSERT(is_keyed_load_stub() || is_keyed_store_stub());
2729
- byte type = READ_BYTE_FIELD(this, kExternalArrayTypeOffset);
2730
- return static_cast<ExternalArrayType>(type);
2731
- }
2732
-
2733
-
2734
- void Code::set_external_array_type(ExternalArrayType value) {
2735
- ASSERT(is_keyed_load_stub() || is_keyed_store_stub());
2736
- WRITE_BYTE_FIELD(this, kExternalArrayTypeOffset, value);
2737
- }
2738
-
2739
-
2740
3022
  byte Code::unary_op_type() {
2741
3023
  ASSERT(is_unary_op_stub());
2742
3024
  return READ_BYTE_FIELD(this, kUnaryOpTypeOffset);
@@ -2785,6 +3067,17 @@ void Code::set_compare_state(byte value) {
2785
3067
  }
2786
3068
 
2787
3069
 
3070
+ byte Code::to_boolean_state() {
3071
+ ASSERT(is_to_boolean_ic_stub());
3072
+ return READ_BYTE_FIELD(this, kToBooleanTypeOffset);
3073
+ }
3074
+
3075
+
3076
+ void Code::set_to_boolean_state(byte value) {
3077
+ ASSERT(is_to_boolean_ic_stub());
3078
+ WRITE_BYTE_FIELD(this, kToBooleanTypeOffset, value);
3079
+ }
3080
+
2788
3081
  bool Code::is_inline_cache_stub() {
2789
3082
  Kind kind = this->kind();
2790
3083
  return kind >= FIRST_IC_KIND && kind <= LAST_IC_KIND;
@@ -2947,7 +3240,7 @@ Object* Map::prototype() {
2947
3240
 
2948
3241
 
2949
3242
  void Map::set_prototype(Object* value, WriteBarrierMode mode) {
2950
- ASSERT(value->IsNull() || value->IsJSObject());
3243
+ ASSERT(value->IsNull() || value->IsJSReceiver());
2951
3244
  WRITE_FIELD(this, kPrototypeOffset, value);
2952
3245
  CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kPrototypeOffset, mode);
2953
3246
  }
@@ -2960,21 +3253,34 @@ MaybeObject* Map::GetFastElementsMap() {
2960
3253
  if (!maybe_obj->ToObject(&obj)) return maybe_obj;
2961
3254
  }
2962
3255
  Map* new_map = Map::cast(obj);
2963
- new_map->set_has_fast_elements(true);
2964
- isolate()->counters()->map_slow_to_fast_elements()->Increment();
3256
+ new_map->set_elements_kind(JSObject::FAST_ELEMENTS);
3257
+ isolate()->counters()->map_to_fast_elements()->Increment();
3258
+ return new_map;
3259
+ }
3260
+
3261
+
3262
+ MaybeObject* Map::GetFastDoubleElementsMap() {
3263
+ if (has_fast_double_elements()) return this;
3264
+ Object* obj;
3265
+ { MaybeObject* maybe_obj = CopyDropTransitions();
3266
+ if (!maybe_obj->ToObject(&obj)) return maybe_obj;
3267
+ }
3268
+ Map* new_map = Map::cast(obj);
3269
+ new_map->set_elements_kind(JSObject::FAST_DOUBLE_ELEMENTS);
3270
+ isolate()->counters()->map_to_fast_double_elements()->Increment();
2965
3271
  return new_map;
2966
3272
  }
2967
3273
 
2968
3274
 
2969
3275
  MaybeObject* Map::GetSlowElementsMap() {
2970
- if (!has_fast_elements()) return this;
3276
+ if (!has_fast_elements() && !has_fast_double_elements()) return this;
2971
3277
  Object* obj;
2972
3278
  { MaybeObject* maybe_obj = CopyDropTransitions();
2973
3279
  if (!maybe_obj->ToObject(&obj)) return maybe_obj;
2974
3280
  }
2975
3281
  Map* new_map = Map::cast(obj);
2976
- new_map->set_has_fast_elements(false);
2977
- isolate()->counters()->map_fast_to_slow_elements()->Increment();
3282
+ new_map->set_elements_kind(JSObject::DICTIONARY_ELEMENTS);
3283
+ isolate()->counters()->map_to_slow_elements()->Increment();
2978
3284
  return new_map;
2979
3285
  }
2980
3286
 
@@ -3167,17 +3473,28 @@ BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype,
3167
3473
  BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit)
3168
3474
  BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check,
3169
3475
  kNeedsAccessCheckBit)
3476
+ BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype,
3477
+ kReadOnlyPrototypeBit)
3170
3478
  BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_expression,
3171
3479
  kIsExpressionBit)
3172
3480
  BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_toplevel,
3173
3481
  kIsTopLevelBit)
3174
- BOOL_GETTER(SharedFunctionInfo, compiler_hints,
3482
+ BOOL_GETTER(SharedFunctionInfo,
3483
+ compiler_hints,
3175
3484
  has_only_simple_this_property_assignments,
3176
3485
  kHasOnlySimpleThisPropertyAssignments)
3177
3486
  BOOL_ACCESSORS(SharedFunctionInfo,
3178
3487
  compiler_hints,
3179
3488
  allows_lazy_compilation,
3180
3489
  kAllowLazyCompilation)
3490
+ BOOL_ACCESSORS(SharedFunctionInfo,
3491
+ compiler_hints,
3492
+ uses_arguments,
3493
+ kUsesArguments)
3494
+ BOOL_ACCESSORS(SharedFunctionInfo,
3495
+ compiler_hints,
3496
+ has_duplicate_parameters,
3497
+ kHasDuplicateParameters)
3181
3498
 
3182
3499
 
3183
3500
  #if V8_HOST_ARCH_32_BIT
@@ -3261,18 +3578,10 @@ void SharedFunctionInfo::set_construction_count(int value) {
3261
3578
  }
3262
3579
 
3263
3580
 
3264
- bool SharedFunctionInfo::live_objects_may_exist() {
3265
- return (compiler_hints() & (1 << kLiveObjectsMayExist)) != 0;
3266
- }
3267
-
3268
-
3269
- void SharedFunctionInfo::set_live_objects_may_exist(bool value) {
3270
- if (value) {
3271
- set_compiler_hints(compiler_hints() | (1 << kLiveObjectsMayExist));
3272
- } else {
3273
- set_compiler_hints(compiler_hints() & ~(1 << kLiveObjectsMayExist));
3274
- }
3275
- }
3581
+ BOOL_ACCESSORS(SharedFunctionInfo,
3582
+ compiler_hints,
3583
+ live_objects_may_exist,
3584
+ kLiveObjectsMayExist)
3276
3585
 
3277
3586
 
3278
3587
  bool SharedFunctionInfo::IsInobjectSlackTrackingInProgress() {
@@ -3280,9 +3589,10 @@ bool SharedFunctionInfo::IsInobjectSlackTrackingInProgress() {
3280
3589
  }
3281
3590
 
3282
3591
 
3283
- bool SharedFunctionInfo::optimization_disabled() {
3284
- return BooleanBit::get(compiler_hints(), kOptimizationDisabled);
3285
- }
3592
+ BOOL_GETTER(SharedFunctionInfo,
3593
+ compiler_hints,
3594
+ optimization_disabled,
3595
+ kOptimizationDisabled)
3286
3596
 
3287
3597
 
3288
3598
  void SharedFunctionInfo::set_optimization_disabled(bool disable) {
@@ -3297,33 +3607,20 @@ void SharedFunctionInfo::set_optimization_disabled(bool disable) {
3297
3607
  }
3298
3608
 
3299
3609
 
3300
- bool SharedFunctionInfo::strict_mode() {
3301
- return BooleanBit::get(compiler_hints(), kStrictModeFunction);
3302
- }
3303
-
3304
-
3305
- void SharedFunctionInfo::set_strict_mode(bool value) {
3306
- set_compiler_hints(BooleanBit::set(compiler_hints(),
3307
- kStrictModeFunction,
3308
- value));
3309
- }
3310
-
3311
-
3312
- bool SharedFunctionInfo::es5_native() {
3313
- return BooleanBit::get(compiler_hints(), kES5Native);
3314
- }
3315
-
3316
-
3317
- void SharedFunctionInfo::set_es5_native(bool value) {
3318
- set_compiler_hints(BooleanBit::set(compiler_hints(),
3319
- kES5Native,
3320
- value));
3321
- }
3322
-
3610
+ BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, strict_mode,
3611
+ kStrictModeFunction)
3612
+ BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative)
3613
+ BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints,
3614
+ name_should_print_as_anonymous,
3615
+ kNameShouldPrintAsAnonymous)
3616
+ BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, bound, kBoundFunction)
3617
+ BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous, kIsAnonymous)
3323
3618
 
3324
3619
  ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset)
3325
3620
  ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset)
3326
3621
 
3622
+ ACCESSORS(PolymorphicCodeCache, cache, Object, kCacheOffset)
3623
+
3327
3624
  bool Script::HasValidSource() {
3328
3625
  Object* src = this->source();
3329
3626
  if (!src->IsString()) return true;
@@ -3613,6 +3910,16 @@ void JSBuiltinsObject::set_javascript_builtin_code(Builtins::JavaScript id,
3613
3910
 
3614
3911
 
3615
3912
  ACCESSORS(JSProxy, handler, Object, kHandlerOffset)
3913
+ ACCESSORS(JSProxy, padding, Object, kPaddingOffset)
3914
+
3915
+
3916
+ ACCESSORS(JSWeakMap, table, ObjectHashTable, kTableOffset)
3917
+ ACCESSORS_GCSAFE(JSWeakMap, next, Object, kNextOffset)
3918
+
3919
+
3920
+ ObjectHashTable* JSWeakMap::unchecked_table() {
3921
+ return reinterpret_cast<ObjectHashTable*>(READ_FIELD(this, kTableOffset));
3922
+ }
3616
3923
 
3617
3924
 
3618
3925
  Address Foreign::address() {
@@ -3719,6 +4026,12 @@ JSRegExp::Type JSRegExp::TypeTag() {
3719
4026
  }
3720
4027
 
3721
4028
 
4029
+ JSRegExp::Type JSRegExp::TypeTagUnchecked() {
4030
+ Smi* smi = Smi::cast(DataAtUnchecked(kTagIndex));
4031
+ return static_cast<JSRegExp::Type>(smi->value());
4032
+ }
4033
+
4034
+
3722
4035
  int JSRegExp::CaptureCount() {
3723
4036
  switch (TypeTag()) {
3724
4037
  case ATOM:
@@ -3754,6 +4067,13 @@ Object* JSRegExp::DataAt(int index) {
3754
4067
  }
3755
4068
 
3756
4069
 
4070
+ Object* JSRegExp::DataAtUnchecked(int index) {
4071
+ FixedArray* fa = reinterpret_cast<FixedArray*>(data());
4072
+ int offset = FixedArray::kHeaderSize + index * kPointerSize;
4073
+ return READ_FIELD(fa, offset);
4074
+ }
4075
+
4076
+
3757
4077
  void JSRegExp::SetDataAt(int index, Object* value) {
3758
4078
  ASSERT(TypeTag() != NOT_COMPILED);
3759
4079
  ASSERT(index >= kDataIndex); // Only implementation data can be set this way.
@@ -3761,46 +4081,34 @@ void JSRegExp::SetDataAt(int index, Object* value) {
3761
4081
  }
3762
4082
 
3763
4083
 
3764
- JSObject::ElementsKind JSObject::GetElementsKind() {
3765
- if (map()->has_fast_elements()) {
3766
- ASSERT(elements()->map() == GetHeap()->fixed_array_map() ||
3767
- elements()->map() == GetHeap()->fixed_cow_array_map());
3768
- return FAST_ELEMENTS;
3769
- }
3770
- HeapObject* array = elements();
3771
- if (array->IsFixedArray()) {
3772
- // FAST_ELEMENTS or DICTIONARY_ELEMENTS are both stored in a
3773
- // FixedArray, but FAST_ELEMENTS is already handled above.
3774
- ASSERT(array->IsDictionary());
3775
- return DICTIONARY_ELEMENTS;
3776
- }
3777
- ASSERT(!map()->has_fast_elements());
3778
- if (array->IsExternalArray()) {
3779
- switch (array->map()->instance_type()) {
3780
- case EXTERNAL_BYTE_ARRAY_TYPE:
3781
- return EXTERNAL_BYTE_ELEMENTS;
3782
- case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE:
3783
- return EXTERNAL_UNSIGNED_BYTE_ELEMENTS;
3784
- case EXTERNAL_SHORT_ARRAY_TYPE:
3785
- return EXTERNAL_SHORT_ELEMENTS;
3786
- case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE:
3787
- return EXTERNAL_UNSIGNED_SHORT_ELEMENTS;
3788
- case EXTERNAL_INT_ARRAY_TYPE:
3789
- return EXTERNAL_INT_ELEMENTS;
3790
- case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE:
3791
- return EXTERNAL_UNSIGNED_INT_ELEMENTS;
3792
- case EXTERNAL_FLOAT_ARRAY_TYPE:
3793
- return EXTERNAL_FLOAT_ELEMENTS;
3794
- case EXTERNAL_DOUBLE_ARRAY_TYPE:
3795
- return EXTERNAL_DOUBLE_ELEMENTS;
3796
- case EXTERNAL_PIXEL_ARRAY_TYPE:
3797
- return EXTERNAL_PIXEL_ELEMENTS;
3798
- default:
3799
- break;
3800
- }
4084
+ void JSRegExp::SetDataAtUnchecked(int index, Object* value, Heap* heap) {
4085
+ ASSERT(index >= kDataIndex); // Only implementation data can be set this way.
4086
+ FixedArray* fa = reinterpret_cast<FixedArray*>(data());
4087
+ if (value->IsSmi()) {
4088
+ fa->set_unchecked(index, Smi::cast(value));
4089
+ } else {
4090
+ fa->set_unchecked(heap, index, value, SKIP_WRITE_BARRIER);
3801
4091
  }
3802
- UNREACHABLE();
3803
- return DICTIONARY_ELEMENTS;
4092
+ }
4093
+
4094
+
4095
+ JSObject::ElementsKind JSObject::GetElementsKind() {
4096
+ ElementsKind kind = map()->elements_kind();
4097
+ ASSERT((kind == FAST_ELEMENTS &&
4098
+ (elements()->map() == GetHeap()->fixed_array_map() ||
4099
+ elements()->map() == GetHeap()->fixed_cow_array_map())) ||
4100
+ (kind == FAST_DOUBLE_ELEMENTS &&
4101
+ elements()->IsFixedDoubleArray()) ||
4102
+ (kind == DICTIONARY_ELEMENTS &&
4103
+ elements()->IsFixedArray() &&
4104
+ elements()->IsDictionary()) ||
4105
+ (kind > DICTIONARY_ELEMENTS));
4106
+ return kind;
4107
+ }
4108
+
4109
+
4110
+ ElementsAccessor* JSObject::GetElementsAccessor() {
4111
+ return ElementsAccessor::ForKind(GetElementsKind());
3804
4112
  }
3805
4113
 
3806
4114
 
@@ -3809,6 +4117,11 @@ bool JSObject::HasFastElements() {
3809
4117
  }
3810
4118
 
3811
4119
 
4120
+ bool JSObject::HasFastDoubleElements() {
4121
+ return GetElementsKind() == FAST_DOUBLE_ELEMENTS;
4122
+ }
4123
+
4124
+
3812
4125
  bool JSObject::HasDictionaryElements() {
3813
4126
  return GetElementsKind() == DICTIONARY_ELEMENTS;
3814
4127
  }
@@ -3857,7 +4170,8 @@ bool JSObject::HasIndexedInterceptor() {
3857
4170
 
3858
4171
 
3859
4172
  bool JSObject::AllowsSetElementsLength() {
3860
- bool result = elements()->IsFixedArray();
4173
+ bool result = elements()->IsFixedArray() ||
4174
+ elements()->IsFixedDoubleArray();
3861
4175
  ASSERT(result == !HasExternalArrayElements());
3862
4176
  return result;
3863
4177
  }
@@ -4002,12 +4316,28 @@ bool String::AsArrayIndex(uint32_t* index) {
4002
4316
  }
4003
4317
 
4004
4318
 
4005
- Object* JSObject::GetPrototype() {
4006
- return JSObject::cast(this)->map()->prototype();
4319
+ Object* JSReceiver::GetPrototype() {
4320
+ return HeapObject::cast(this)->map()->prototype();
4007
4321
  }
4008
4322
 
4009
4323
 
4010
- PropertyAttributes JSObject::GetPropertyAttribute(String* key) {
4324
+ bool JSReceiver::HasProperty(String* name) {
4325
+ if (IsJSProxy()) {
4326
+ return JSProxy::cast(this)->HasPropertyWithHandler(name);
4327
+ }
4328
+ return GetPropertyAttribute(name) != ABSENT;
4329
+ }
4330
+
4331
+
4332
+ bool JSReceiver::HasLocalProperty(String* name) {
4333
+ if (IsJSProxy()) {
4334
+ return JSProxy::cast(this)->HasPropertyWithHandler(name);
4335
+ }
4336
+ return GetLocalPropertyAttribute(name) != ABSENT;
4337
+ }
4338
+
4339
+
4340
+ PropertyAttributes JSReceiver::GetPropertyAttribute(String* key) {
4011
4341
  return GetPropertyAttributeWithReceiver(this, key);
4012
4342
  }
4013
4343
 
@@ -4055,6 +4385,11 @@ MaybeObject* JSObject::SetHiddenPropertiesObject(Object* hidden_obj) {
4055
4385
  }
4056
4386
 
4057
4387
 
4388
+ bool JSObject::HasHiddenProperties() {
4389
+ return !GetHiddenProperties(OMIT_CREATION)->ToObjectChecked()->IsUndefined();
4390
+ }
4391
+
4392
+
4058
4393
  bool JSObject::HasElement(uint32_t index) {
4059
4394
  return HasElementWithReceiver(this, index);
4060
4395
  }
@@ -4170,6 +4505,36 @@ MaybeObject* StringDictionaryShape::AsObject(String* key) {
4170
4505
  }
4171
4506
 
4172
4507
 
4508
+ bool ObjectHashTableShape::IsMatch(JSObject* key, Object* other) {
4509
+ return key == JSObject::cast(other);
4510
+ }
4511
+
4512
+
4513
+ uint32_t ObjectHashTableShape::Hash(JSObject* key) {
4514
+ MaybeObject* maybe_hash = key->GetIdentityHash(JSObject::OMIT_CREATION);
4515
+ ASSERT(!maybe_hash->IsFailure());
4516
+ return Smi::cast(maybe_hash->ToObjectUnchecked())->value();
4517
+ }
4518
+
4519
+
4520
+ uint32_t ObjectHashTableShape::HashForObject(JSObject* key, Object* other) {
4521
+ MaybeObject* maybe_hash = JSObject::cast(other)->GetIdentityHash(
4522
+ JSObject::OMIT_CREATION);
4523
+ ASSERT(!maybe_hash->IsFailure());
4524
+ return Smi::cast(maybe_hash->ToObjectUnchecked())->value();
4525
+ }
4526
+
4527
+
4528
+ MaybeObject* ObjectHashTableShape::AsObject(JSObject* key) {
4529
+ return key;
4530
+ }
4531
+
4532
+
4533
+ void ObjectHashTable::RemoveEntry(int entry) {
4534
+ RemoveEntry(entry, GetHeap());
4535
+ }
4536
+
4537
+
4173
4538
  void Map::ClearCodeCache(Heap* heap) {
4174
4539
  // No write barrier is needed since empty_fixed_array is not in new space.
4175
4540
  // Please note this function is used during marking: