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
@@ -28,15 +28,11 @@
28
28
  #ifndef V8_HEAP_PROFILER_H_
29
29
  #define V8_HEAP_PROFILER_H_
30
30
 
31
- #include "allocation.h"
32
31
  #include "isolate.h"
33
- #include "zone-inl.h"
34
32
 
35
33
  namespace v8 {
36
34
  namespace internal {
37
35
 
38
- #ifdef ENABLE_LOGGING_AND_PROFILING
39
-
40
36
  class HeapSnapshot;
41
37
  class HeapSnapshotsCollection;
42
38
 
@@ -47,9 +43,6 @@ class HeapSnapshotsCollection;
47
43
  profiler->call; \
48
44
  } \
49
45
  } while (false)
50
- #else
51
- #define HEAP_PROFILE(heap, call) ((void) 0)
52
- #endif // ENABLE_LOGGING_AND_PROFILING
53
46
 
54
47
  // The HeapProfiler writes data to the log files, which can be postprocessed
55
48
  // to generate .hp files for use by the GHC/Valgrind tool hp2ps.
@@ -58,7 +51,6 @@ class HeapProfiler {
58
51
  static void Setup();
59
52
  static void TearDown();
60
53
 
61
- #ifdef ENABLE_LOGGING_AND_PROFILING
62
54
  static HeapSnapshot* TakeSnapshot(const char* name,
63
55
  int type,
64
56
  v8::ActivityControl* control);
@@ -81,10 +73,6 @@ class HeapProfiler {
81
73
  return snapshots_->is_tracking_objects();
82
74
  }
83
75
 
84
- // Obsolete interface.
85
- // Write a single heap sample to the log file.
86
- static void WriteSample();
87
-
88
76
  private:
89
77
  HeapProfiler();
90
78
  ~HeapProfiler();
@@ -99,299 +87,8 @@ class HeapProfiler {
99
87
  HeapSnapshotsCollection* snapshots_;
100
88
  unsigned next_snapshot_uid_;
101
89
  List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_;
102
-
103
- #endif // ENABLE_LOGGING_AND_PROFILING
104
- };
105
-
106
-
107
- #ifdef ENABLE_LOGGING_AND_PROFILING
108
-
109
- // JSObjectsCluster describes a group of JS objects that are
110
- // considered equivalent in terms of a particular profile.
111
- class JSObjectsCluster BASE_EMBEDDED {
112
- public:
113
- // These special cases are used in retainer profile.
114
- enum SpecialCase {
115
- ROOTS = 1,
116
- GLOBAL_PROPERTY = 2,
117
- CODE = 3,
118
- SELF = 100 // This case is used in ClustersCoarser only.
119
- };
120
-
121
- JSObjectsCluster() : constructor_(NULL), instance_(NULL) {}
122
- explicit JSObjectsCluster(String* constructor)
123
- : constructor_(constructor), instance_(NULL) {}
124
- explicit JSObjectsCluster(SpecialCase special)
125
- : constructor_(FromSpecialCase(special)), instance_(NULL) {}
126
- JSObjectsCluster(String* constructor, Object* instance)
127
- : constructor_(constructor), instance_(instance) {}
128
-
129
- static int CompareConstructors(const JSObjectsCluster& a,
130
- const JSObjectsCluster& b) {
131
- // Strings are unique, so it is sufficient to compare their pointers.
132
- return a.constructor_ == b.constructor_ ? 0
133
- : (a.constructor_ < b.constructor_ ? -1 : 1);
134
- }
135
- static int Compare(const JSObjectsCluster& a, const JSObjectsCluster& b) {
136
- // Strings are unique, so it is sufficient to compare their pointers.
137
- const int cons_cmp = CompareConstructors(a, b);
138
- return cons_cmp == 0 ?
139
- (a.instance_ == b.instance_ ? 0 : (a.instance_ < b.instance_ ? -1 : 1))
140
- : cons_cmp;
141
- }
142
- static int Compare(const JSObjectsCluster* a, const JSObjectsCluster* b) {
143
- return Compare(*a, *b);
144
- }
145
-
146
- bool is_null() const { return constructor_ == NULL; }
147
- bool can_be_coarsed() const { return instance_ != NULL; }
148
- String* constructor() const { return constructor_; }
149
- Object* instance() const { return instance_; }
150
-
151
- const char* GetSpecialCaseName() const;
152
- void Print(StringStream* accumulator) const;
153
- // Allows null clusters to be printed.
154
- void DebugPrint(StringStream* accumulator) const;
155
-
156
- private:
157
- static String* FromSpecialCase(SpecialCase special) {
158
- // We use symbols that are illegal JS identifiers to identify special cases.
159
- // Their actual value is irrelevant for us.
160
- switch (special) {
161
- case ROOTS: return HEAP->result_symbol();
162
- case GLOBAL_PROPERTY: return HEAP->code_symbol();
163
- case CODE: return HEAP->arguments_shadow_symbol();
164
- case SELF: return HEAP->catch_var_symbol();
165
- default:
166
- UNREACHABLE();
167
- return NULL;
168
- }
169
- }
170
-
171
- String* constructor_;
172
- Object* instance_;
173
- };
174
-
175
-
176
- struct JSObjectsClusterTreeConfig {
177
- typedef JSObjectsCluster Key;
178
- typedef NumberAndSizeInfo Value;
179
- static const Key kNoKey;
180
- static const Value kNoValue;
181
- static int Compare(const Key& a, const Key& b) {
182
- return Key::Compare(a, b);
183
- }
184
- };
185
- typedef ZoneSplayTree<JSObjectsClusterTreeConfig> JSObjectsClusterTree;
186
-
187
-
188
- // ConstructorHeapProfile is responsible for gathering and logging
189
- // "constructor profile" of JS objects allocated on heap.
190
- // It is run during garbage collection cycle, thus it doesn't need
191
- // to use handles.
192
- class ConstructorHeapProfile BASE_EMBEDDED {
193
- public:
194
- ConstructorHeapProfile();
195
- virtual ~ConstructorHeapProfile() {}
196
- void CollectStats(HeapObject* obj);
197
- void PrintStats();
198
-
199
- template<class Callback>
200
- void ForEach(Callback* callback) { js_objects_info_tree_.ForEach(callback); }
201
- // Used by ZoneSplayTree::ForEach. Made virtual to allow overriding in tests.
202
- virtual void Call(const JSObjectsCluster& cluster,
203
- const NumberAndSizeInfo& number_and_size);
204
-
205
- private:
206
- ZoneScope zscope_;
207
- JSObjectsClusterTree js_objects_info_tree_;
208
- };
209
-
210
-
211
- // JSObjectsRetainerTree is used to represent retainer graphs using
212
- // adjacency list form:
213
- //
214
- // Cluster -> (Cluster -> NumberAndSizeInfo)
215
- //
216
- // Subordinate splay trees are stored by pointer. They are zone-allocated,
217
- // so it isn't needed to manage their lifetime.
218
- //
219
- struct JSObjectsRetainerTreeConfig {
220
- typedef JSObjectsCluster Key;
221
- typedef JSObjectsClusterTree* Value;
222
- static const Key kNoKey;
223
- static const Value kNoValue;
224
- static int Compare(const Key& a, const Key& b) {
225
- return Key::Compare(a, b);
226
- }
227
- };
228
- typedef ZoneSplayTree<JSObjectsRetainerTreeConfig> JSObjectsRetainerTree;
229
-
230
-
231
- class ClustersCoarser BASE_EMBEDDED {
232
- public:
233
- ClustersCoarser();
234
-
235
- // Processes a given retainer graph.
236
- void Process(JSObjectsRetainerTree* tree);
237
-
238
- // Returns an equivalent cluster (can be the cluster itself).
239
- // If the given cluster doesn't have an equivalent, returns null cluster.
240
- JSObjectsCluster GetCoarseEquivalent(const JSObjectsCluster& cluster);
241
- // Returns whether a cluster can be substitued with an equivalent and thus,
242
- // skipped in some cases.
243
- bool HasAnEquivalent(const JSObjectsCluster& cluster);
244
-
245
- // Used by JSObjectsRetainerTree::ForEach.
246
- void Call(const JSObjectsCluster& cluster, JSObjectsClusterTree* tree);
247
- void Call(const JSObjectsCluster& cluster,
248
- const NumberAndSizeInfo& number_and_size);
249
-
250
- private:
251
- // Stores a list of back references for a cluster.
252
- struct ClusterBackRefs {
253
- explicit ClusterBackRefs(const JSObjectsCluster& cluster_);
254
- ClusterBackRefs(const ClusterBackRefs& src);
255
- ClusterBackRefs& operator=(const ClusterBackRefs& src);
256
-
257
- static int Compare(const ClusterBackRefs& a, const ClusterBackRefs& b);
258
- void SortRefs() { refs.Sort(JSObjectsCluster::Compare); }
259
- static void SortRefsIterator(ClusterBackRefs* ref) { ref->SortRefs(); }
260
-
261
- JSObjectsCluster cluster;
262
- ZoneList<JSObjectsCluster> refs;
263
- };
264
- typedef ZoneList<ClusterBackRefs> SimilarityList;
265
-
266
- // A tree for storing a list of equivalents for a cluster.
267
- struct ClusterEqualityConfig {
268
- typedef JSObjectsCluster Key;
269
- typedef JSObjectsCluster Value;
270
- static const Key kNoKey;
271
- static const Value kNoValue;
272
- static int Compare(const Key& a, const Key& b) {
273
- return Key::Compare(a, b);
274
- }
275
- };
276
- typedef ZoneSplayTree<ClusterEqualityConfig> EqualityTree;
277
-
278
- static int ClusterBackRefsCmp(const ClusterBackRefs* a,
279
- const ClusterBackRefs* b) {
280
- return ClusterBackRefs::Compare(*a, *b);
281
- }
282
- int DoProcess(JSObjectsRetainerTree* tree);
283
- int FillEqualityTree();
284
-
285
- static const int kInitialBackrefsListCapacity = 2;
286
- static const int kInitialSimilarityListCapacity = 2000;
287
- // Number of passes for finding equivalents. Limits the length of paths
288
- // that can be considered equivalent.
289
- static const int kMaxPassesCount = 10;
290
-
291
- ZoneScope zscope_;
292
- SimilarityList sim_list_;
293
- EqualityTree eq_tree_;
294
- ClusterBackRefs* current_pair_;
295
- JSObjectsRetainerTree* current_set_;
296
- const JSObjectsCluster* self_;
297
90
  };
298
91
 
299
-
300
- // RetainerHeapProfile is responsible for gathering and logging
301
- // "retainer profile" of JS objects allocated on heap.
302
- // It is run during garbage collection cycle, thus it doesn't need
303
- // to use handles.
304
- class RetainerTreeAggregator;
305
-
306
- class RetainerHeapProfile BASE_EMBEDDED {
307
- public:
308
- class Printer {
309
- public:
310
- virtual ~Printer() {}
311
- virtual void PrintRetainers(const JSObjectsCluster& cluster,
312
- const StringStream& retainers) = 0;
313
- };
314
-
315
- RetainerHeapProfile();
316
- ~RetainerHeapProfile();
317
-
318
- RetainerTreeAggregator* aggregator() { return aggregator_; }
319
- ClustersCoarser* coarser() { return &coarser_; }
320
- JSObjectsRetainerTree* retainers_tree() { return &retainers_tree_; }
321
-
322
- void CollectStats(HeapObject* obj);
323
- void CoarseAndAggregate();
324
- void PrintStats();
325
- void DebugPrintStats(Printer* printer);
326
- void StoreReference(const JSObjectsCluster& cluster, HeapObject* ref);
327
-
328
- private:
329
- ZoneScope zscope_;
330
- JSObjectsRetainerTree retainers_tree_;
331
- ClustersCoarser coarser_;
332
- RetainerTreeAggregator* aggregator_;
333
- };
334
-
335
-
336
- class AggregatedHeapSnapshot {
337
- public:
338
- AggregatedHeapSnapshot();
339
- ~AggregatedHeapSnapshot();
340
-
341
- HistogramInfo* info() { return info_; }
342
- ConstructorHeapProfile* js_cons_profile() { return &js_cons_profile_; }
343
- RetainerHeapProfile* js_retainer_profile() { return &js_retainer_profile_; }
344
-
345
- private:
346
- HistogramInfo* info_;
347
- ConstructorHeapProfile js_cons_profile_;
348
- RetainerHeapProfile js_retainer_profile_;
349
- };
350
-
351
-
352
- class HeapEntriesMap;
353
- class HeapEntriesAllocator;
354
-
355
- class AggregatedHeapSnapshotGenerator {
356
- public:
357
- explicit AggregatedHeapSnapshotGenerator(AggregatedHeapSnapshot* snapshot);
358
- void GenerateSnapshot();
359
- void FillHeapSnapshot(HeapSnapshot* snapshot);
360
-
361
- static const int kAllStringsType = LAST_TYPE + 1;
362
-
363
- private:
364
- void CalculateStringsStats();
365
- void CollectStats(HeapObject* obj);
366
- template<class Iterator>
367
- void IterateRetainers(
368
- HeapEntriesAllocator* allocator, HeapEntriesMap* entries_map);
369
-
370
- AggregatedHeapSnapshot* agg_snapshot_;
371
- };
372
-
373
-
374
- class ProducerHeapProfile {
375
- public:
376
- void Setup();
377
- void RecordJSObjectAllocation(Object* obj) {
378
- if (FLAG_log_producers) DoRecordJSObjectAllocation(obj);
379
- }
380
-
381
- private:
382
- ProducerHeapProfile() : can_log_(false) { }
383
-
384
- void DoRecordJSObjectAllocation(Object* obj);
385
- Isolate* isolate_;
386
- bool can_log_;
387
-
388
- friend class Isolate;
389
-
390
- DISALLOW_COPY_AND_ASSIGN(ProducerHeapProfile);
391
- };
392
-
393
- #endif // ENABLE_LOGGING_AND_PROFILING
394
-
395
92
  } } // namespace v8::internal
396
93
 
397
94
  #endif // V8_HEAP_PROFILER_H_
@@ -33,6 +33,7 @@
33
33
  #include "codegen.h"
34
34
  #include "compilation-cache.h"
35
35
  #include "debug.h"
36
+ #include "deoptimizer.h"
36
37
  #include "global-handles.h"
37
38
  #include "heap-profiler.h"
38
39
  #include "liveobjectlist-inl.h"
@@ -96,6 +97,7 @@ Heap::Heap()
96
97
  // Will be 4 * reserved_semispace_size_ to ensure that young
97
98
  // generation can be aligned to its size.
98
99
  survived_since_last_expansion_(0),
100
+ sweep_generation_(0),
99
101
  always_allocate_scope_depth_(0),
100
102
  linear_allocation_scope_depth_(0),
101
103
  contexts_disposed_(0),
@@ -107,6 +109,7 @@ Heap::Heap()
107
109
  cell_space_(NULL),
108
110
  lo_space_(NULL),
109
111
  gc_state_(NOT_IN_GC),
112
+ gc_post_processing_depth_(0),
110
113
  mc_count_(0),
111
114
  ms_count_(0),
112
115
  gc_count_(0),
@@ -152,6 +155,15 @@ Heap::Heap()
152
155
  max_semispace_size_ = reserved_semispace_size_ = V8_MAX_SEMISPACE_SIZE;
153
156
  #endif
154
157
 
158
+ intptr_t max_virtual = OS::MaxVirtualMemory();
159
+
160
+ if (max_virtual > 0) {
161
+ if (code_range_size_ > 0) {
162
+ // Reserve no more than 1/8 of the memory for the code range.
163
+ code_range_size_ = Min(code_range_size_, max_virtual >> 3);
164
+ }
165
+ }
166
+
155
167
  memset(roots_, 0, sizeof(roots_[0]) * kRootListLength);
156
168
  global_contexts_list_ = NULL;
157
169
  mark_compact_collector_.heap_ = this;
@@ -281,12 +293,11 @@ GarbageCollector Heap::SelectGarbageCollector(AllocationSpace space) {
281
293
 
282
294
  // TODO(1238405): Combine the infrastructure for --heap-stats and
283
295
  // --log-gc to avoid the complicated preprocessor and flag testing.
284
- #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
285
296
  void Heap::ReportStatisticsBeforeGC() {
286
297
  // Heap::ReportHeapStatistics will also log NewSpace statistics when
287
- // compiled with ENABLE_LOGGING_AND_PROFILING and --log-gc is set. The
288
- // following logic is used to avoid double logging.
289
- #if defined(DEBUG) && defined(ENABLE_LOGGING_AND_PROFILING)
298
+ // compiled --log-gc is set. The following logic is used to avoid
299
+ // double logging.
300
+ #ifdef DEBUG
290
301
  if (FLAG_heap_stats || FLAG_log_gc) new_space_.CollectStatistics();
291
302
  if (FLAG_heap_stats) {
292
303
  ReportHeapStatistics("Before GC");
@@ -294,23 +305,16 @@ void Heap::ReportStatisticsBeforeGC() {
294
305
  new_space_.ReportStatistics();
295
306
  }
296
307
  if (FLAG_heap_stats || FLAG_log_gc) new_space_.ClearHistograms();
297
- #elif defined(DEBUG)
298
- if (FLAG_heap_stats) {
299
- new_space_.CollectStatistics();
300
- ReportHeapStatistics("Before GC");
301
- new_space_.ClearHistograms();
302
- }
303
- #elif defined(ENABLE_LOGGING_AND_PROFILING)
308
+ #else
304
309
  if (FLAG_log_gc) {
305
310
  new_space_.CollectStatistics();
306
311
  new_space_.ReportStatistics();
307
312
  new_space_.ClearHistograms();
308
313
  }
309
- #endif
314
+ #endif // DEBUG
310
315
  }
311
316
 
312
317
 
313
- #if defined(ENABLE_LOGGING_AND_PROFILING)
314
318
  void Heap::PrintShortHeapStatistics() {
315
319
  if (!FLAG_trace_gc_verbose) return;
316
320
  PrintF("Memory allocator, used: %8" V8_PTR_PREFIX "d"
@@ -356,7 +360,6 @@ void Heap::PrintShortHeapStatistics() {
356
360
  lo_space_->Size(),
357
361
  lo_space_->Available());
358
362
  }
359
- #endif
360
363
 
361
364
 
362
365
  // TODO(1238405): Combine the infrastructure for --heap-stats and
@@ -364,20 +367,17 @@ void Heap::PrintShortHeapStatistics() {
364
367
  void Heap::ReportStatisticsAfterGC() {
365
368
  // Similar to the before GC, we use some complicated logic to ensure that
366
369
  // NewSpace statistics are logged exactly once when --log-gc is turned on.
367
- #if defined(DEBUG) && defined(ENABLE_LOGGING_AND_PROFILING)
370
+ #if defined(DEBUG)
368
371
  if (FLAG_heap_stats) {
369
372
  new_space_.CollectStatistics();
370
373
  ReportHeapStatistics("After GC");
371
374
  } else if (FLAG_log_gc) {
372
375
  new_space_.ReportStatistics();
373
376
  }
374
- #elif defined(DEBUG)
375
- if (FLAG_heap_stats) ReportHeapStatistics("After GC");
376
- #elif defined(ENABLE_LOGGING_AND_PROFILING)
377
+ #else
377
378
  if (FLAG_log_gc) new_space_.ReportStatistics();
378
- #endif
379
+ #endif // DEBUG
379
380
  }
380
- #endif // defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
381
381
 
382
382
 
383
383
  void Heap::GarbageCollectionPrologue() {
@@ -394,11 +394,11 @@ void Heap::GarbageCollectionPrologue() {
394
394
  }
395
395
 
396
396
  if (FLAG_gc_verbose) Print();
397
- #endif
397
+ #endif // DEBUG
398
398
 
399
- #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
399
+ #if defined(DEBUG)
400
400
  ReportStatisticsBeforeGC();
401
- #endif
401
+ #endif // DEBUG
402
402
 
403
403
  LiveObjectList::GCPrologue();
404
404
  }
@@ -435,12 +435,12 @@ void Heap::GarbageCollectionEpilogue() {
435
435
  symbol_table()->Capacity());
436
436
  isolate_->counters()->number_of_symbols()->Set(
437
437
  symbol_table()->NumberOfElements());
438
- #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
438
+ #if defined(DEBUG)
439
439
  ReportStatisticsAfterGC();
440
- #endif
440
+ #endif // DEBUG
441
441
  #ifdef ENABLE_DEBUGGER_SUPPORT
442
442
  isolate_->debug()->AfterGarbageCollection();
443
- #endif
443
+ #endif // ENABLE_DEBUGGER_SUPPORT
444
444
  }
445
445
 
446
446
 
@@ -513,11 +513,6 @@ bool Heap::CollectGarbage(AllocationSpace space, GarbageCollector collector) {
513
513
  GarbageCollectionEpilogue();
514
514
  }
515
515
 
516
-
517
- #ifdef ENABLE_LOGGING_AND_PROFILING
518
- if (FLAG_log_gc) HeapProfiler::WriteSample();
519
- #endif
520
-
521
516
  return next_gc_likely_to_collect_more;
522
517
  }
523
518
 
@@ -736,7 +731,7 @@ bool Heap::PerformGarbageCollection(GarbageCollector collector,
736
731
  if (collector == MARK_COMPACTOR) {
737
732
  // Perform mark-sweep with optional compaction.
738
733
  MarkCompact(tracer);
739
-
734
+ sweep_generation_++;
740
735
  bool high_survival_rate_during_scavenges = IsHighSurvivalRate() &&
741
736
  IsStableOrIncreasingSurvivalTrend();
742
737
 
@@ -771,11 +766,13 @@ bool Heap::PerformGarbageCollection(GarbageCollector collector,
771
766
 
772
767
  isolate_->counters()->objs_since_last_young()->Set(0);
773
768
 
769
+ gc_post_processing_depth_++;
774
770
  { DisableAssertNoAllocation allow_allocation;
775
771
  GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL);
776
772
  next_gc_likely_to_collect_more =
777
773
  isolate_->global_handles()->PostGarbageCollectionProcessing(collector);
778
774
  }
775
+ gc_post_processing_depth_--;
779
776
 
780
777
  // Update relocatables.
781
778
  Relocatable::PostGarbageCollectionProcessing();
@@ -851,6 +848,9 @@ void Heap::MarkCompactPrologue(bool is_compacting) {
851
848
  CompletelyClearInstanceofCache();
852
849
 
853
850
  if (is_compacting) FlushNumberStringCache();
851
+ if (FLAG_cleanup_code_caches_at_gc) {
852
+ polymorphic_code_cache()->set_cache(undefined_value());
853
+ }
854
854
 
855
855
  ClearNormalizedMapCaches();
856
856
  }
@@ -1034,9 +1034,10 @@ void Heap::Scavenge() {
1034
1034
  scavenge_visitor.VisitPointer(BitCast<Object**>(&global_contexts_list_));
1035
1035
 
1036
1036
  new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
1037
- isolate_->global_handles()->IdentifyWeakIndependentHandles(
1037
+ isolate_->global_handles()->IdentifyNewSpaceWeakIndependentHandles(
1038
1038
  &IsUnscavengedHeapObject);
1039
- isolate_->global_handles()->IterateWeakIndependentRoots(&scavenge_visitor);
1039
+ isolate_->global_handles()->IterateNewSpaceWeakIndependentRoots(
1040
+ &scavenge_visitor);
1040
1041
  new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
1041
1042
 
1042
1043
 
@@ -1279,6 +1280,7 @@ class ScavengingVisitor : public StaticVisitorBase {
1279
1280
  table_.Register(kVisitShortcutCandidate, &EvacuateShortcutCandidate);
1280
1281
  table_.Register(kVisitByteArray, &EvacuateByteArray);
1281
1282
  table_.Register(kVisitFixedArray, &EvacuateFixedArray);
1283
+ table_.Register(kVisitFixedDoubleArray, &EvacuateFixedDoubleArray);
1282
1284
 
1283
1285
  table_.Register(kVisitGlobalContext,
1284
1286
  &ObjectEvacuationStrategy<POINTER_OBJECT>::
@@ -1288,10 +1290,22 @@ class ScavengingVisitor : public StaticVisitorBase {
1288
1290
  &ObjectEvacuationStrategy<POINTER_OBJECT>::
1289
1291
  template VisitSpecialized<ConsString::kSize>);
1290
1292
 
1293
+ table_.Register(kVisitSlicedString,
1294
+ &ObjectEvacuationStrategy<POINTER_OBJECT>::
1295
+ template VisitSpecialized<SlicedString::kSize>);
1296
+
1291
1297
  table_.Register(kVisitSharedFunctionInfo,
1292
1298
  &ObjectEvacuationStrategy<POINTER_OBJECT>::
1293
1299
  template VisitSpecialized<SharedFunctionInfo::kSize>);
1294
1300
 
1301
+ table_.Register(kVisitJSWeakMap,
1302
+ &ObjectEvacuationStrategy<POINTER_OBJECT>::
1303
+ Visit);
1304
+
1305
+ table_.Register(kVisitJSRegExp,
1306
+ &ObjectEvacuationStrategy<POINTER_OBJECT>::
1307
+ Visit);
1308
+
1295
1309
  table_.Register(kVisitJSFunction,
1296
1310
  &ObjectEvacuationStrategy<POINTER_OBJECT>::
1297
1311
  template VisitSpecialized<JSFunction::kSize>);
@@ -1317,15 +1331,12 @@ class ScavengingVisitor : public StaticVisitorBase {
1317
1331
  enum ObjectContents { DATA_OBJECT, POINTER_OBJECT };
1318
1332
  enum SizeRestriction { SMALL, UNKNOWN_SIZE };
1319
1333
 
1320
- #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
1321
1334
  static void RecordCopiedObject(Heap* heap, HeapObject* obj) {
1322
1335
  bool should_record = false;
1323
1336
  #ifdef DEBUG
1324
1337
  should_record = FLAG_heap_stats;
1325
1338
  #endif
1326
- #ifdef ENABLE_LOGGING_AND_PROFILING
1327
1339
  should_record = should_record || FLAG_log_gc;
1328
- #endif
1329
1340
  if (should_record) {
1330
1341
  if (heap->new_space()->Contains(obj)) {
1331
1342
  heap->new_space()->RecordAllocation(obj);
@@ -1334,7 +1345,6 @@ class ScavengingVisitor : public StaticVisitorBase {
1334
1345
  }
1335
1346
  }
1336
1347
  }
1337
- #endif // defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
1338
1348
 
1339
1349
  // Helper function used by CopyObject to copy a source object to an
1340
1350
  // allocated target object and update the forwarding pointer in the source
@@ -1350,12 +1360,9 @@ class ScavengingVisitor : public StaticVisitorBase {
1350
1360
  source->set_map_word(MapWord::FromForwardingAddress(target));
1351
1361
 
1352
1362
  if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) {
1353
- #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
1354
1363
  // Update NewSpace stats if necessary.
1355
1364
  RecordCopiedObject(heap, target);
1356
- #endif
1357
1365
  HEAP_PROFILE(heap, ObjectMoveEvent(source->address(), target->address()));
1358
- #if defined(ENABLE_LOGGING_AND_PROFILING)
1359
1366
  Isolate* isolate = heap->isolate();
1360
1367
  if (isolate->logger()->is_logging() ||
1361
1368
  CpuProfiler::is_profiling(isolate)) {
@@ -1364,7 +1371,6 @@ class ScavengingVisitor : public StaticVisitorBase {
1364
1371
  source->address(), target->address()));
1365
1372
  }
1366
1373
  }
1367
- #endif
1368
1374
  }
1369
1375
 
1370
1376
  return target;
@@ -1426,6 +1432,18 @@ class ScavengingVisitor : public StaticVisitorBase {
1426
1432
  }
1427
1433
 
1428
1434
 
1435
+ static inline void EvacuateFixedDoubleArray(Map* map,
1436
+ HeapObject** slot,
1437
+ HeapObject* object) {
1438
+ int length = reinterpret_cast<FixedDoubleArray*>(object)->length();
1439
+ int object_size = FixedDoubleArray::SizeFor(length);
1440
+ EvacuateObject<DATA_OBJECT, UNKNOWN_SIZE>(map,
1441
+ slot,
1442
+ object,
1443
+ object_size);
1444
+ }
1445
+
1446
+
1429
1447
  static inline void EvacuateByteArray(Map* map,
1430
1448
  HeapObject** slot,
1431
1449
  HeapObject* object) {
@@ -1608,7 +1626,8 @@ MaybeObject* Heap::AllocateMap(InstanceType instance_type, int instance_size) {
1608
1626
  map->set_prototype_transitions(empty_fixed_array());
1609
1627
  map->set_unused_property_fields(0);
1610
1628
  map->set_bit_field(0);
1611
- map->set_bit_field2((1 << Map::kIsExtensible) | (1 << Map::kHasFastElements));
1629
+ map->set_bit_field2(1 << Map::kIsExtensible);
1630
+ map->set_elements_kind(JSObject::FAST_ELEMENTS);
1612
1631
 
1613
1632
  // If the map object is aligned fill the padding area with Smi 0 objects.
1614
1633
  if (Map::kPadStart < Map::kSize) {
@@ -1632,6 +1651,11 @@ MaybeObject* Heap::AllocateCodeCache() {
1632
1651
  }
1633
1652
 
1634
1653
 
1654
+ MaybeObject* Heap::AllocatePolymorphicCodeCache() {
1655
+ return AllocateStruct(POLYMORPHIC_CODE_CACHE_TYPE);
1656
+ }
1657
+
1658
+
1635
1659
  const Heap::StringTypeTable Heap::string_type_table[] = {
1636
1660
  #define STRING_TYPE_ELEMENT(type, size, name, camel_name) \
1637
1661
  {type, size, k##camel_name##MapRootIndex},
@@ -1725,6 +1749,12 @@ bool Heap::CreateInitialMaps() {
1725
1749
  set_fixed_cow_array_map(Map::cast(obj));
1726
1750
  ASSERT(fixed_array_map() != fixed_cow_array_map());
1727
1751
 
1752
+ { MaybeObject* maybe_obj =
1753
+ AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
1754
+ if (!maybe_obj->ToObject(&obj)) return false;
1755
+ }
1756
+ set_serialized_scope_info_map(Map::cast(obj));
1757
+
1728
1758
  { MaybeObject* maybe_obj = AllocateMap(HEAP_NUMBER_TYPE, HeapNumber::kSize);
1729
1759
  if (!maybe_obj->ToObject(&obj)) return false;
1730
1760
  }
@@ -1756,6 +1786,12 @@ bool Heap::CreateInitialMaps() {
1756
1786
  set_undetectable_ascii_string_map(Map::cast(obj));
1757
1787
  Map::cast(obj)->set_is_undetectable();
1758
1788
 
1789
+ { MaybeObject* maybe_obj =
1790
+ AllocateMap(FIXED_DOUBLE_ARRAY_TYPE, kVariableSizeSentinel);
1791
+ if (!maybe_obj->ToObject(&obj)) return false;
1792
+ }
1793
+ set_fixed_double_array_map(Map::cast(obj));
1794
+
1759
1795
  { MaybeObject* maybe_obj =
1760
1796
  AllocateMap(BYTE_ARRAY_TYPE, kVariableSizeSentinel);
1761
1797
  if (!maybe_obj->ToObject(&obj)) return false;
@@ -1815,6 +1851,12 @@ bool Heap::CreateInitialMaps() {
1815
1851
  }
1816
1852
  set_external_float_array_map(Map::cast(obj));
1817
1853
 
1854
+ { MaybeObject* maybe_obj =
1855
+ AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
1856
+ if (!maybe_obj->ToObject(&obj)) return false;
1857
+ }
1858
+ set_non_strict_arguments_elements_map(Map::cast(obj));
1859
+
1818
1860
  { MaybeObject* maybe_obj = AllocateMap(EXTERNAL_DOUBLE_ARRAY_TYPE,
1819
1861
  ExternalArray::kAlignedSize);
1820
1862
  if (!maybe_obj->ToObject(&obj)) return false;
@@ -1860,7 +1902,7 @@ bool Heap::CreateInitialMaps() {
1860
1902
  AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
1861
1903
  if (!maybe_obj->ToObject(&obj)) return false;
1862
1904
  }
1863
- set_context_map(Map::cast(obj));
1905
+ set_function_context_map(Map::cast(obj));
1864
1906
 
1865
1907
  { MaybeObject* maybe_obj =
1866
1908
  AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
@@ -1868,6 +1910,18 @@ bool Heap::CreateInitialMaps() {
1868
1910
  }
1869
1911
  set_catch_context_map(Map::cast(obj));
1870
1912
 
1913
+ { MaybeObject* maybe_obj =
1914
+ AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
1915
+ if (!maybe_obj->ToObject(&obj)) return false;
1916
+ }
1917
+ set_with_context_map(Map::cast(obj));
1918
+
1919
+ { MaybeObject* maybe_obj =
1920
+ AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
1921
+ if (!maybe_obj->ToObject(&obj)) return false;
1922
+ }
1923
+ set_block_context_map(Map::cast(obj));
1924
+
1871
1925
  { MaybeObject* maybe_obj =
1872
1926
  AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
1873
1927
  if (!maybe_obj->ToObject(&obj)) return false;
@@ -2139,6 +2193,11 @@ bool Heap::CreateInitialObjects() {
2139
2193
  }
2140
2194
  set_non_monomorphic_cache(NumberDictionary::cast(obj));
2141
2195
 
2196
+ { MaybeObject* maybe_obj = AllocatePolymorphicCodeCache();
2197
+ if (!maybe_obj->ToObject(&obj)) return false;
2198
+ }
2199
+ set_polymorphic_code_cache(PolymorphicCodeCache::cast(obj));
2200
+
2142
2201
  set_instanceof_cache_function(Smi::FromInt(0));
2143
2202
  set_instanceof_cache_map(Smi::FromInt(0));
2144
2203
  set_instanceof_cache_answer(Smi::FromInt(0));
@@ -2356,40 +2415,41 @@ MaybeObject* Heap::AllocateForeign(Address address, PretenureFlag pretenure) {
2356
2415
 
2357
2416
 
2358
2417
  MaybeObject* Heap::AllocateSharedFunctionInfo(Object* name) {
2359
- Object* result;
2360
- { MaybeObject* maybe_result =
2361
- Allocate(shared_function_info_map(), OLD_POINTER_SPACE);
2362
- if (!maybe_result->ToObject(&result)) return maybe_result;
2363
- }
2418
+ SharedFunctionInfo* share;
2419
+ MaybeObject* maybe = Allocate(shared_function_info_map(), OLD_POINTER_SPACE);
2420
+ if (!maybe->To<SharedFunctionInfo>(&share)) return maybe;
2364
2421
 
2365
- SharedFunctionInfo* share = SharedFunctionInfo::cast(result);
2422
+ // Set pointer fields.
2366
2423
  share->set_name(name);
2367
2424
  Code* illegal = isolate_->builtins()->builtin(Builtins::kIllegal);
2368
2425
  share->set_code(illegal);
2369
2426
  share->set_scope_info(SerializedScopeInfo::Empty());
2370
- Code* construct_stub = isolate_->builtins()->builtin(
2371
- Builtins::kJSConstructStubGeneric);
2427
+ Code* construct_stub =
2428
+ isolate_->builtins()->builtin(Builtins::kJSConstructStubGeneric);
2372
2429
  share->set_construct_stub(construct_stub);
2373
- share->set_expected_nof_properties(0);
2374
- share->set_length(0);
2375
- share->set_formal_parameter_count(0);
2376
2430
  share->set_instance_class_name(Object_symbol());
2377
2431
  share->set_function_data(undefined_value());
2378
2432
  share->set_script(undefined_value());
2379
- share->set_start_position_and_type(0);
2380
2433
  share->set_debug_info(undefined_value());
2381
2434
  share->set_inferred_name(empty_string());
2382
- share->set_compiler_hints(0);
2383
- share->set_deopt_counter(Smi::FromInt(FLAG_deopt_every_n_times));
2384
2435
  share->set_initial_map(undefined_value());
2385
- share->set_this_property_assignments_count(0);
2386
2436
  share->set_this_property_assignments(undefined_value());
2387
- share->set_opt_count(0);
2437
+ share->set_deopt_counter(Smi::FromInt(FLAG_deopt_every_n_times));
2438
+
2439
+ // Set integer fields (smi or int, depending on the architecture).
2440
+ share->set_length(0);
2441
+ share->set_formal_parameter_count(0);
2442
+ share->set_expected_nof_properties(0);
2388
2443
  share->set_num_literals(0);
2444
+ share->set_start_position_and_type(0);
2389
2445
  share->set_end_position(0);
2390
2446
  share->set_function_token_position(0);
2391
- share->set_es5_native(false);
2392
- return result;
2447
+ // All compiler hints default to false or 0.
2448
+ share->set_compiler_hints(0);
2449
+ share->set_this_property_assignments_count(0);
2450
+ share->set_opt_count(0);
2451
+
2452
+ return share;
2393
2453
  }
2394
2454
 
2395
2455
 
@@ -2508,6 +2568,8 @@ MaybeObject* Heap::AllocateConsString(String* first, String* second) {
2508
2568
 
2509
2569
  // If the resulting string is small make a flat string.
2510
2570
  if (length < String::kMinNonFlatLength) {
2571
+ // Note that neither of the two inputs can be a slice because:
2572
+ STATIC_ASSERT(String::kMinNonFlatLength <= SlicedString::kMinLength);
2511
2573
  ASSERT(first->IsFlat());
2512
2574
  ASSERT(second->IsFlat());
2513
2575
  if (is_ascii) {
@@ -2579,12 +2641,13 @@ MaybeObject* Heap::AllocateConsString(String* first, String* second) {
2579
2641
 
2580
2642
 
2581
2643
  MaybeObject* Heap::AllocateSubString(String* buffer,
2582
- int start,
2583
- int end,
2584
- PretenureFlag pretenure) {
2644
+ int start,
2645
+ int end,
2646
+ PretenureFlag pretenure) {
2585
2647
  int length = end - start;
2586
-
2587
- if (length == 1) {
2648
+ if (length == 0) {
2649
+ return empty_string();
2650
+ } else if (length == 1) {
2588
2651
  return LookupSingleCharacterStringFromCode(buffer->Get(start));
2589
2652
  } else if (length == 2) {
2590
2653
  // Optimization for 2-byte strings often used as keys in a decompression
@@ -2598,24 +2661,69 @@ MaybeObject* Heap::AllocateSubString(String* buffer,
2598
2661
  // Make an attempt to flatten the buffer to reduce access time.
2599
2662
  buffer = buffer->TryFlattenGetString();
2600
2663
 
2664
+ // TODO(1626): For now slicing external strings is not supported. However,
2665
+ // a flat cons string can have an external string as first part in some cases.
2666
+ // Therefore we have to single out this case as well.
2667
+ if (!FLAG_string_slices ||
2668
+ (buffer->IsConsString() &&
2669
+ (!buffer->IsFlat() ||
2670
+ !ConsString::cast(buffer)->first()->IsSeqString())) ||
2671
+ buffer->IsExternalString() ||
2672
+ length < SlicedString::kMinLength ||
2673
+ pretenure == TENURED) {
2674
+ Object* result;
2675
+ { MaybeObject* maybe_result = buffer->IsAsciiRepresentation()
2676
+ ? AllocateRawAsciiString(length, pretenure)
2677
+ : AllocateRawTwoByteString(length, pretenure);
2678
+ if (!maybe_result->ToObject(&result)) return maybe_result;
2679
+ }
2680
+ String* string_result = String::cast(result);
2681
+ // Copy the characters into the new object.
2682
+ if (buffer->IsAsciiRepresentation()) {
2683
+ ASSERT(string_result->IsAsciiRepresentation());
2684
+ char* dest = SeqAsciiString::cast(string_result)->GetChars();
2685
+ String::WriteToFlat(buffer, dest, start, end);
2686
+ } else {
2687
+ ASSERT(string_result->IsTwoByteRepresentation());
2688
+ uc16* dest = SeqTwoByteString::cast(string_result)->GetChars();
2689
+ String::WriteToFlat(buffer, dest, start, end);
2690
+ }
2691
+ return result;
2692
+ }
2693
+
2694
+ ASSERT(buffer->IsFlat());
2695
+ ASSERT(!buffer->IsExternalString());
2696
+ #if DEBUG
2697
+ buffer->StringVerify();
2698
+ #endif
2699
+
2601
2700
  Object* result;
2602
- { MaybeObject* maybe_result = buffer->IsAsciiRepresentation()
2603
- ? AllocateRawAsciiString(length, pretenure )
2604
- : AllocateRawTwoByteString(length, pretenure);
2701
+ { Map* map = buffer->IsAsciiRepresentation()
2702
+ ? sliced_ascii_string_map()
2703
+ : sliced_string_map();
2704
+ MaybeObject* maybe_result = Allocate(map, NEW_SPACE);
2605
2705
  if (!maybe_result->ToObject(&result)) return maybe_result;
2606
2706
  }
2607
- String* string_result = String::cast(result);
2608
- // Copy the characters into the new object.
2609
- if (buffer->IsAsciiRepresentation()) {
2610
- ASSERT(string_result->IsAsciiRepresentation());
2611
- char* dest = SeqAsciiString::cast(string_result)->GetChars();
2612
- String::WriteToFlat(buffer, dest, start, end);
2707
+
2708
+ AssertNoAllocation no_gc;
2709
+ SlicedString* sliced_string = SlicedString::cast(result);
2710
+ sliced_string->set_length(length);
2711
+ sliced_string->set_hash_field(String::kEmptyHashField);
2712
+ if (buffer->IsConsString()) {
2713
+ ConsString* cons = ConsString::cast(buffer);
2714
+ ASSERT(cons->second()->length() == 0);
2715
+ sliced_string->set_parent(cons->first());
2716
+ sliced_string->set_offset(start);
2717
+ } else if (buffer->IsSlicedString()) {
2718
+ // Prevent nesting sliced strings.
2719
+ SlicedString* parent_slice = SlicedString::cast(buffer);
2720
+ sliced_string->set_parent(parent_slice->parent());
2721
+ sliced_string->set_offset(start + parent_slice->offset());
2613
2722
  } else {
2614
- ASSERT(string_result->IsTwoByteRepresentation());
2615
- uc16* dest = SeqTwoByteString::cast(string_result)->GetChars();
2616
- String::WriteToFlat(buffer, dest, start, end);
2723
+ sliced_string->set_parent(buffer);
2724
+ sliced_string->set_offset(start);
2617
2725
  }
2618
-
2726
+ ASSERT(sliced_string->parent()->IsSeqString());
2619
2727
  return result;
2620
2728
  }
2621
2729
 
@@ -2924,9 +3032,6 @@ MaybeObject* Heap::Allocate(Map* map, AllocationSpace space) {
2924
3032
  if (!maybe_result->ToObject(&result)) return maybe_result;
2925
3033
  }
2926
3034
  HeapObject::cast(result)->set_map(map);
2927
- #ifdef ENABLE_LOGGING_AND_PROFILING
2928
- isolate_->producer_heap_profile()->RecordJSObjectAllocation(result);
2929
- #endif
2930
3035
  return result;
2931
3036
  }
2932
3037
 
@@ -3232,14 +3337,13 @@ MaybeObject* Heap::AllocateJSProxy(Object* handler, Object* prototype) {
3232
3337
  MaybeObject* maybe_map_obj = AllocateMap(JS_PROXY_TYPE, JSProxy::kSize);
3233
3338
  if (!maybe_map_obj->To<Map>(&map)) return maybe_map_obj;
3234
3339
  map->set_prototype(prototype);
3235
- map->set_pre_allocated_property_fields(1);
3236
- map->set_inobject_properties(1);
3237
3340
 
3238
3341
  // Allocate the proxy object.
3239
3342
  Object* result;
3240
3343
  MaybeObject* maybe_result = Allocate(map, NEW_SPACE);
3241
3344
  if (!maybe_result->ToObject(&result)) return maybe_result;
3242
3345
  JSProxy::cast(result)->set_handler(handler);
3346
+ JSProxy::cast(result)->set_padding(Smi::FromInt(0));
3243
3347
  return result;
3244
3348
  }
3245
3349
 
@@ -3354,17 +3458,22 @@ MaybeObject* Heap::CopyJSObject(JSObject* source) {
3354
3458
  object_size);
3355
3459
  }
3356
3460
 
3357
- FixedArray* elements = FixedArray::cast(source->elements());
3461
+ FixedArrayBase* elements = FixedArrayBase::cast(source->elements());
3358
3462
  FixedArray* properties = FixedArray::cast(source->properties());
3359
3463
  // Update elements if necessary.
3360
3464
  if (elements->length() > 0) {
3361
3465
  Object* elem;
3362
- { MaybeObject* maybe_elem =
3363
- (elements->map() == fixed_cow_array_map()) ?
3364
- elements : CopyFixedArray(elements);
3466
+ { MaybeObject* maybe_elem;
3467
+ if (elements->map() == fixed_cow_array_map()) {
3468
+ maybe_elem = FixedArray::cast(elements);
3469
+ } else if (source->HasFastDoubleElements()) {
3470
+ maybe_elem = CopyFixedDoubleArray(FixedDoubleArray::cast(elements));
3471
+ } else {
3472
+ maybe_elem = CopyFixedArray(FixedArray::cast(elements));
3473
+ }
3365
3474
  if (!maybe_elem->ToObject(&elem)) return maybe_elem;
3366
3475
  }
3367
- JSObject::cast(clone)->set_elements(FixedArray::cast(elem));
3476
+ JSObject::cast(clone)->set_elements(FixedArrayBase::cast(elem));
3368
3477
  }
3369
3478
  // Update properties if necessary.
3370
3479
  if (properties->length() > 0) {
@@ -3375,13 +3484,40 @@ MaybeObject* Heap::CopyJSObject(JSObject* source) {
3375
3484
  JSObject::cast(clone)->set_properties(FixedArray::cast(prop));
3376
3485
  }
3377
3486
  // Return the new clone.
3378
- #ifdef ENABLE_LOGGING_AND_PROFILING
3379
- isolate_->producer_heap_profile()->RecordJSObjectAllocation(clone);
3380
- #endif
3381
3487
  return clone;
3382
3488
  }
3383
3489
 
3384
3490
 
3491
+ MaybeObject* Heap::ReinitializeJSProxyAsJSObject(JSProxy* object) {
3492
+ // Allocate fresh map.
3493
+ // TODO(rossberg): Once we optimize proxies, cache these maps.
3494
+ Map* map;
3495
+ MaybeObject* maybe_map_obj =
3496
+ AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
3497
+ if (!maybe_map_obj->To<Map>(&map)) return maybe_map_obj;
3498
+
3499
+ // Check that the receiver has the same size as a fresh object.
3500
+ ASSERT(map->instance_size() == object->map()->instance_size());
3501
+
3502
+ map->set_prototype(object->map()->prototype());
3503
+
3504
+ // Allocate the backing storage for the properties.
3505
+ int prop_size = map->unused_property_fields() - map->inobject_properties();
3506
+ Object* properties;
3507
+ { MaybeObject* maybe_properties = AllocateFixedArray(prop_size, TENURED);
3508
+ if (!maybe_properties->ToObject(&properties)) return maybe_properties;
3509
+ }
3510
+
3511
+ // Reset the map for the object.
3512
+ object->set_map(map);
3513
+
3514
+ // Reinitialize the object from the constructor map.
3515
+ InitializeJSObjectFromMap(JSObject::cast(object),
3516
+ FixedArray::cast(properties), map);
3517
+ return object;
3518
+ }
3519
+
3520
+
3385
3521
  MaybeObject* Heap::ReinitializeJSGlobalProxy(JSFunction* constructor,
3386
3522
  JSGlobalProxy* object) {
3387
3523
  ASSERT(constructor->has_initial_map());
@@ -3696,6 +3832,23 @@ MaybeObject* Heap::CopyFixedArrayWithMap(FixedArray* src, Map* map) {
3696
3832
  }
3697
3833
 
3698
3834
 
3835
+ MaybeObject* Heap::CopyFixedDoubleArrayWithMap(FixedDoubleArray* src,
3836
+ Map* map) {
3837
+ int len = src->length();
3838
+ Object* obj;
3839
+ { MaybeObject* maybe_obj = AllocateRawFixedDoubleArray(len, NOT_TENURED);
3840
+ if (!maybe_obj->ToObject(&obj)) return maybe_obj;
3841
+ }
3842
+ HeapObject* dst = HeapObject::cast(obj);
3843
+ dst->set_map(map);
3844
+ CopyBlock(
3845
+ dst->address() + FixedDoubleArray::kLengthOffset,
3846
+ src->address() + FixedDoubleArray::kLengthOffset,
3847
+ FixedDoubleArray::SizeFor(len) - FixedDoubleArray::kLengthOffset);
3848
+ return obj;
3849
+ }
3850
+
3851
+
3699
3852
  MaybeObject* Heap::AllocateFixedArray(int length) {
3700
3853
  ASSERT(length >= 0);
3701
3854
  if (length == 0) return empty_fixed_array();
@@ -3792,6 +3945,62 @@ MaybeObject* Heap::AllocateUninitializedFixedArray(int length) {
3792
3945
  }
3793
3946
 
3794
3947
 
3948
+ MaybeObject* Heap::AllocateEmptyFixedDoubleArray() {
3949
+ int size = FixedDoubleArray::SizeFor(0);
3950
+ Object* result;
3951
+ { MaybeObject* maybe_result =
3952
+ AllocateRaw(size, OLD_DATA_SPACE, OLD_DATA_SPACE);
3953
+ if (!maybe_result->ToObject(&result)) return maybe_result;
3954
+ }
3955
+ // Initialize the object.
3956
+ reinterpret_cast<FixedDoubleArray*>(result)->set_map(
3957
+ fixed_double_array_map());
3958
+ reinterpret_cast<FixedDoubleArray*>(result)->set_length(0);
3959
+ return result;
3960
+ }
3961
+
3962
+
3963
+ MaybeObject* Heap::AllocateUninitializedFixedDoubleArray(
3964
+ int length,
3965
+ PretenureFlag pretenure) {
3966
+ if (length == 0) return empty_fixed_double_array();
3967
+
3968
+ Object* obj;
3969
+ { MaybeObject* maybe_obj = AllocateRawFixedDoubleArray(length, pretenure);
3970
+ if (!maybe_obj->ToObject(&obj)) return maybe_obj;
3971
+ }
3972
+
3973
+ reinterpret_cast<FixedDoubleArray*>(obj)->set_map(fixed_double_array_map());
3974
+ FixedDoubleArray::cast(obj)->set_length(length);
3975
+ return obj;
3976
+ }
3977
+
3978
+
3979
+ MaybeObject* Heap::AllocateRawFixedDoubleArray(int length,
3980
+ PretenureFlag pretenure) {
3981
+ if (length < 0 || length > FixedDoubleArray::kMaxLength) {
3982
+ return Failure::OutOfMemoryException();
3983
+ }
3984
+
3985
+ AllocationSpace space =
3986
+ (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE;
3987
+ int size = FixedDoubleArray::SizeFor(length);
3988
+ if (space == NEW_SPACE && size > kMaxObjectSizeInNewSpace) {
3989
+ // Too big for new space.
3990
+ space = LO_SPACE;
3991
+ } else if (space == OLD_DATA_SPACE &&
3992
+ size > MaxObjectSizeInPagedSpace()) {
3993
+ // Too big for old data space.
3994
+ space = LO_SPACE;
3995
+ }
3996
+
3997
+ AllocationSpace retry_space =
3998
+ (size <= MaxObjectSizeInPagedSpace()) ? OLD_DATA_SPACE : LO_SPACE;
3999
+
4000
+ return AllocateRaw(size, space, retry_space);
4001
+ }
4002
+
4003
+
3795
4004
  MaybeObject* Heap::AllocateHashTable(int length, PretenureFlag pretenure) {
3796
4005
  Object* result;
3797
4006
  { MaybeObject* maybe_result = AllocateFixedArray(length, pretenure);
@@ -3824,38 +4033,80 @@ MaybeObject* Heap::AllocateFunctionContext(int length, JSFunction* function) {
3824
4033
  if (!maybe_result->ToObject(&result)) return maybe_result;
3825
4034
  }
3826
4035
  Context* context = reinterpret_cast<Context*>(result);
3827
- context->set_map(context_map());
4036
+ context->set_map(function_context_map());
3828
4037
  context->set_closure(function);
3829
- context->set_fcontext(context);
3830
- context->set_previous(NULL);
4038
+ context->set_previous(function->context());
3831
4039
  context->set_extension(NULL);
3832
4040
  context->set_global(function->context()->global());
3833
- ASSERT(!context->IsGlobalContext());
3834
- ASSERT(context->is_function_context());
3835
- ASSERT(result->IsContext());
3836
- return result;
4041
+ return context;
3837
4042
  }
3838
4043
 
3839
4044
 
3840
- MaybeObject* Heap::AllocateWithContext(Context* previous,
3841
- JSObject* extension,
3842
- bool is_catch_context) {
4045
+ MaybeObject* Heap::AllocateCatchContext(JSFunction* function,
4046
+ Context* previous,
4047
+ String* name,
4048
+ Object* thrown_object) {
4049
+ STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == Context::THROWN_OBJECT_INDEX);
4050
+ Object* result;
4051
+ { MaybeObject* maybe_result =
4052
+ AllocateFixedArray(Context::MIN_CONTEXT_SLOTS + 1);
4053
+ if (!maybe_result->ToObject(&result)) return maybe_result;
4054
+ }
4055
+ Context* context = reinterpret_cast<Context*>(result);
4056
+ context->set_map(catch_context_map());
4057
+ context->set_closure(function);
4058
+ context->set_previous(previous);
4059
+ context->set_extension(name);
4060
+ context->set_global(previous->global());
4061
+ context->set(Context::THROWN_OBJECT_INDEX, thrown_object);
4062
+ return context;
4063
+ }
4064
+
4065
+
4066
+ MaybeObject* Heap::AllocateWithContext(JSFunction* function,
4067
+ Context* previous,
4068
+ JSObject* extension) {
3843
4069
  Object* result;
3844
4070
  { MaybeObject* maybe_result = AllocateFixedArray(Context::MIN_CONTEXT_SLOTS);
3845
4071
  if (!maybe_result->ToObject(&result)) return maybe_result;
3846
4072
  }
3847
4073
  Context* context = reinterpret_cast<Context*>(result);
3848
- context->set_map(is_catch_context ? catch_context_map() :
3849
- context_map());
3850
- context->set_closure(previous->closure());
3851
- context->set_fcontext(previous->fcontext());
4074
+ context->set_map(with_context_map());
4075
+ context->set_closure(function);
3852
4076
  context->set_previous(previous);
3853
4077
  context->set_extension(extension);
3854
4078
  context->set_global(previous->global());
3855
- ASSERT(!context->IsGlobalContext());
3856
- ASSERT(!context->is_function_context());
3857
- ASSERT(result->IsContext());
3858
- return result;
4079
+ return context;
4080
+ }
4081
+
4082
+
4083
+ MaybeObject* Heap::AllocateBlockContext(JSFunction* function,
4084
+ Context* previous,
4085
+ SerializedScopeInfo* scope_info) {
4086
+ Object* result;
4087
+ { MaybeObject* maybe_result =
4088
+ AllocateFixedArrayWithHoles(scope_info->NumberOfContextSlots());
4089
+ if (!maybe_result->ToObject(&result)) return maybe_result;
4090
+ }
4091
+ Context* context = reinterpret_cast<Context*>(result);
4092
+ context->set_map(block_context_map());
4093
+ context->set_closure(function);
4094
+ context->set_previous(previous);
4095
+ context->set_extension(scope_info);
4096
+ context->set_global(previous->global());
4097
+ return context;
4098
+ }
4099
+
4100
+
4101
+ MaybeObject* Heap::AllocateSerializedScopeInfo(int length) {
4102
+ Object* result;
4103
+ { MaybeObject* maybe_result = AllocateFixedArray(length, TENURED);
4104
+ if (!maybe_result->ToObject(&result)) return maybe_result;
4105
+ }
4106
+ SerializedScopeInfo* scope_info =
4107
+ reinterpret_cast<SerializedScopeInfo*>(result);
4108
+ scope_info->set_map(serialized_scope_info_map());
4109
+ return scope_info;
3859
4110
  }
3860
4111
 
3861
4112
 
@@ -4546,6 +4797,9 @@ void Heap::IterateStrongRoots(ObjectVisitor* v, VisitMode mode) {
4546
4797
 
4547
4798
  #ifdef ENABLE_DEBUGGER_SUPPORT
4548
4799
  isolate_->debug()->Iterate(v);
4800
+ if (isolate_->deoptimizer_data() != NULL) {
4801
+ isolate_->deoptimizer_data()->Iterate(v);
4802
+ }
4549
4803
  #endif
4550
4804
  v->Synchronize("debug");
4551
4805
  isolate_->compilation_cache()->Iterate(v);
@@ -4570,7 +4824,7 @@ void Heap::IterateStrongRoots(ObjectVisitor* v, VisitMode mode) {
4570
4824
  isolate_->global_handles()->IterateStrongRoots(v);
4571
4825
  break;
4572
4826
  case VISIT_ALL_IN_SCAVENGE:
4573
- isolate_->global_handles()->IterateStrongAndDependentRoots(v);
4827
+ isolate_->global_handles()->IterateNewSpaceStrongAndDependentRoots(v);
4574
4828
  break;
4575
4829
  case VISIT_ALL_IN_SWEEP_NEWSPACE:
4576
4830
  case VISIT_ALL:
@@ -4993,11 +5247,6 @@ bool Heap::Setup(bool create_heap_objects) {
4993
5247
  LOG(isolate_, IntPtrTEvent("heap-capacity", Capacity()));
4994
5248
  LOG(isolate_, IntPtrTEvent("heap-available", Available()));
4995
5249
 
4996
- #ifdef ENABLE_LOGGING_AND_PROFILING
4997
- // This should be called only after initial objects have been created.
4998
- isolate_->producer_heap_profile()->Setup();
4999
- #endif
5000
-
5001
5250
  return true;
5002
5251
  }
5003
5252
 
@@ -5091,28 +5340,6 @@ void Heap::Shrink() {
5091
5340
  }
5092
5341
 
5093
5342
 
5094
- #ifdef ENABLE_HEAP_PROTECTION
5095
-
5096
- void Heap::Protect() {
5097
- if (HasBeenSetup()) {
5098
- AllSpaces spaces;
5099
- for (Space* space = spaces.next(); space != NULL; space = spaces.next())
5100
- space->Protect();
5101
- }
5102
- }
5103
-
5104
-
5105
- void Heap::Unprotect() {
5106
- if (HasBeenSetup()) {
5107
- AllSpaces spaces;
5108
- for (Space* space = spaces.next(); space != NULL; space = spaces.next())
5109
- space->Unprotect();
5110
- }
5111
- }
5112
-
5113
- #endif
5114
-
5115
-
5116
5343
  void Heap::AddGCPrologueCallback(GCPrologueCallback callback, GCType gc_type) {
5117
5344
  ASSERT(callback != NULL);
5118
5345
  GCPrologueCallbackPair pair(callback, gc_type);
@@ -5808,9 +6035,7 @@ GCTracer::~GCTracer() {
5808
6035
  PrintF("\n");
5809
6036
  }
5810
6037
 
5811
- #if defined(ENABLE_LOGGING_AND_PROFILING)
5812
6038
  heap_->PrintShortHeapStatistics();
5813
- #endif
5814
6039
  }
5815
6040
 
5816
6041