therubyracer 0.9.0beta4 → 0.9.0beta5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of therubyracer might be problematic. Click here for more details.

Files changed (771) hide show
  1. data/.gitignore +1 -0
  2. data/Rakefile +0 -11
  3. data/ext/v8/extconf.rb +9 -9
  4. data/ext/v8/v8_external.cpp +40 -10
  5. data/lib/v8/cli.rb +2 -1
  6. data/lib/v8/version.rb +1 -1
  7. data/spec/redjs/.gitignore +1 -0
  8. data/therubyracer.gemspec +2 -3
  9. metadata +33 -779
  10. data/ext/v8/upstream/Makefile +0 -38
  11. data/ext/v8/upstream/detect_cpu.rb +0 -27
  12. data/ext/v8/upstream/fpic-on-linux-amd64.patch +0 -13
  13. data/ext/v8/upstream/scons/CHANGES.txt +0 -5183
  14. data/ext/v8/upstream/scons/LICENSE.txt +0 -20
  15. data/ext/v8/upstream/scons/MANIFEST +0 -202
  16. data/ext/v8/upstream/scons/PKG-INFO +0 -13
  17. data/ext/v8/upstream/scons/README.txt +0 -273
  18. data/ext/v8/upstream/scons/RELEASE.txt +0 -1040
  19. data/ext/v8/upstream/scons/engine/SCons/Action.py +0 -1256
  20. data/ext/v8/upstream/scons/engine/SCons/Builder.py +0 -868
  21. data/ext/v8/upstream/scons/engine/SCons/CacheDir.py +0 -217
  22. data/ext/v8/upstream/scons/engine/SCons/Conftest.py +0 -794
  23. data/ext/v8/upstream/scons/engine/SCons/Debug.py +0 -237
  24. data/ext/v8/upstream/scons/engine/SCons/Defaults.py +0 -485
  25. data/ext/v8/upstream/scons/engine/SCons/Environment.py +0 -2327
  26. data/ext/v8/upstream/scons/engine/SCons/Errors.py +0 -207
  27. data/ext/v8/upstream/scons/engine/SCons/Executor.py +0 -636
  28. data/ext/v8/upstream/scons/engine/SCons/Job.py +0 -435
  29. data/ext/v8/upstream/scons/engine/SCons/Memoize.py +0 -292
  30. data/ext/v8/upstream/scons/engine/SCons/Node/Alias.py +0 -153
  31. data/ext/v8/upstream/scons/engine/SCons/Node/FS.py +0 -3220
  32. data/ext/v8/upstream/scons/engine/SCons/Node/Python.py +0 -128
  33. data/ext/v8/upstream/scons/engine/SCons/Node/__init__.py +0 -1341
  34. data/ext/v8/upstream/scons/engine/SCons/Options/BoolOption.py +0 -50
  35. data/ext/v8/upstream/scons/engine/SCons/Options/EnumOption.py +0 -50
  36. data/ext/v8/upstream/scons/engine/SCons/Options/ListOption.py +0 -50
  37. data/ext/v8/upstream/scons/engine/SCons/Options/PackageOption.py +0 -50
  38. data/ext/v8/upstream/scons/engine/SCons/Options/PathOption.py +0 -76
  39. data/ext/v8/upstream/scons/engine/SCons/Options/__init__.py +0 -74
  40. data/ext/v8/upstream/scons/engine/SCons/PathList.py +0 -232
  41. data/ext/v8/upstream/scons/engine/SCons/Platform/__init__.py +0 -236
  42. data/ext/v8/upstream/scons/engine/SCons/Platform/aix.py +0 -70
  43. data/ext/v8/upstream/scons/engine/SCons/Platform/cygwin.py +0 -55
  44. data/ext/v8/upstream/scons/engine/SCons/Platform/darwin.py +0 -46
  45. data/ext/v8/upstream/scons/engine/SCons/Platform/hpux.py +0 -46
  46. data/ext/v8/upstream/scons/engine/SCons/Platform/irix.py +0 -44
  47. data/ext/v8/upstream/scons/engine/SCons/Platform/os2.py +0 -58
  48. data/ext/v8/upstream/scons/engine/SCons/Platform/posix.py +0 -264
  49. data/ext/v8/upstream/scons/engine/SCons/Platform/sunos.py +0 -50
  50. data/ext/v8/upstream/scons/engine/SCons/Platform/win32.py +0 -386
  51. data/ext/v8/upstream/scons/engine/SCons/SConf.py +0 -1038
  52. data/ext/v8/upstream/scons/engine/SCons/SConsign.py +0 -381
  53. data/ext/v8/upstream/scons/engine/SCons/Scanner/C.py +0 -132
  54. data/ext/v8/upstream/scons/engine/SCons/Scanner/D.py +0 -74
  55. data/ext/v8/upstream/scons/engine/SCons/Scanner/Dir.py +0 -111
  56. data/ext/v8/upstream/scons/engine/SCons/Scanner/Fortran.py +0 -320
  57. data/ext/v8/upstream/scons/engine/SCons/Scanner/IDL.py +0 -48
  58. data/ext/v8/upstream/scons/engine/SCons/Scanner/LaTeX.py +0 -378
  59. data/ext/v8/upstream/scons/engine/SCons/Scanner/Prog.py +0 -103
  60. data/ext/v8/upstream/scons/engine/SCons/Scanner/RC.py +0 -55
  61. data/ext/v8/upstream/scons/engine/SCons/Scanner/__init__.py +0 -415
  62. data/ext/v8/upstream/scons/engine/SCons/Script/Interactive.py +0 -386
  63. data/ext/v8/upstream/scons/engine/SCons/Script/Main.py +0 -1360
  64. data/ext/v8/upstream/scons/engine/SCons/Script/SConsOptions.py +0 -944
  65. data/ext/v8/upstream/scons/engine/SCons/Script/SConscript.py +0 -642
  66. data/ext/v8/upstream/scons/engine/SCons/Script/__init__.py +0 -414
  67. data/ext/v8/upstream/scons/engine/SCons/Sig.py +0 -63
  68. data/ext/v8/upstream/scons/engine/SCons/Subst.py +0 -911
  69. data/ext/v8/upstream/scons/engine/SCons/Taskmaster.py +0 -1030
  70. data/ext/v8/upstream/scons/engine/SCons/Tool/386asm.py +0 -61
  71. data/ext/v8/upstream/scons/engine/SCons/Tool/BitKeeper.py +0 -65
  72. data/ext/v8/upstream/scons/engine/SCons/Tool/CVS.py +0 -73
  73. data/ext/v8/upstream/scons/engine/SCons/Tool/FortranCommon.py +0 -247
  74. data/ext/v8/upstream/scons/engine/SCons/Tool/JavaCommon.py +0 -324
  75. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/__init__.py +0 -56
  76. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/arch.py +0 -61
  77. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/common.py +0 -210
  78. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/netframework.py +0 -84
  79. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/sdk.py +0 -321
  80. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vc.py +0 -367
  81. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vs.py +0 -497
  82. data/ext/v8/upstream/scons/engine/SCons/Tool/Perforce.py +0 -104
  83. data/ext/v8/upstream/scons/engine/SCons/Tool/PharLapCommon.py +0 -138
  84. data/ext/v8/upstream/scons/engine/SCons/Tool/RCS.py +0 -64
  85. data/ext/v8/upstream/scons/engine/SCons/Tool/SCCS.py +0 -64
  86. data/ext/v8/upstream/scons/engine/SCons/Tool/Subversion.py +0 -71
  87. data/ext/v8/upstream/scons/engine/SCons/Tool/__init__.py +0 -675
  88. data/ext/v8/upstream/scons/engine/SCons/Tool/aixc++.py +0 -82
  89. data/ext/v8/upstream/scons/engine/SCons/Tool/aixcc.py +0 -74
  90. data/ext/v8/upstream/scons/engine/SCons/Tool/aixf77.py +0 -80
  91. data/ext/v8/upstream/scons/engine/SCons/Tool/aixlink.py +0 -76
  92. data/ext/v8/upstream/scons/engine/SCons/Tool/applelink.py +0 -71
  93. data/ext/v8/upstream/scons/engine/SCons/Tool/ar.py +0 -63
  94. data/ext/v8/upstream/scons/engine/SCons/Tool/as.py +0 -78
  95. data/ext/v8/upstream/scons/engine/SCons/Tool/bcc32.py +0 -82
  96. data/ext/v8/upstream/scons/engine/SCons/Tool/c++.py +0 -99
  97. data/ext/v8/upstream/scons/engine/SCons/Tool/cc.py +0 -114
  98. data/ext/v8/upstream/scons/engine/SCons/Tool/cvf.py +0 -58
  99. data/ext/v8/upstream/scons/engine/SCons/Tool/default.py +0 -50
  100. data/ext/v8/upstream/scons/engine/SCons/Tool/dmd.py +0 -224
  101. data/ext/v8/upstream/scons/engine/SCons/Tool/dvi.py +0 -64
  102. data/ext/v8/upstream/scons/engine/SCons/Tool/dvipdf.py +0 -125
  103. data/ext/v8/upstream/scons/engine/SCons/Tool/dvips.py +0 -94
  104. data/ext/v8/upstream/scons/engine/SCons/Tool/f77.py +0 -62
  105. data/ext/v8/upstream/scons/engine/SCons/Tool/f90.py +0 -62
  106. data/ext/v8/upstream/scons/engine/SCons/Tool/f95.py +0 -63
  107. data/ext/v8/upstream/scons/engine/SCons/Tool/filesystem.py +0 -98
  108. data/ext/v8/upstream/scons/engine/SCons/Tool/fortran.py +0 -63
  109. data/ext/v8/upstream/scons/engine/SCons/Tool/g++.py +0 -90
  110. data/ext/v8/upstream/scons/engine/SCons/Tool/g77.py +0 -73
  111. data/ext/v8/upstream/scons/engine/SCons/Tool/gas.py +0 -53
  112. data/ext/v8/upstream/scons/engine/SCons/Tool/gcc.py +0 -80
  113. data/ext/v8/upstream/scons/engine/SCons/Tool/gfortran.py +0 -64
  114. data/ext/v8/upstream/scons/engine/SCons/Tool/gnulink.py +0 -63
  115. data/ext/v8/upstream/scons/engine/SCons/Tool/gs.py +0 -81
  116. data/ext/v8/upstream/scons/engine/SCons/Tool/hpc++.py +0 -85
  117. data/ext/v8/upstream/scons/engine/SCons/Tool/hpcc.py +0 -53
  118. data/ext/v8/upstream/scons/engine/SCons/Tool/hplink.py +0 -77
  119. data/ext/v8/upstream/scons/engine/SCons/Tool/icc.py +0 -59
  120. data/ext/v8/upstream/scons/engine/SCons/Tool/icl.py +0 -52
  121. data/ext/v8/upstream/scons/engine/SCons/Tool/ifl.py +0 -72
  122. data/ext/v8/upstream/scons/engine/SCons/Tool/ifort.py +0 -90
  123. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink.py +0 -59
  124. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink32.py +0 -60
  125. data/ext/v8/upstream/scons/engine/SCons/Tool/install.py +0 -229
  126. data/ext/v8/upstream/scons/engine/SCons/Tool/intelc.py +0 -490
  127. data/ext/v8/upstream/scons/engine/SCons/Tool/ipkg.py +0 -71
  128. data/ext/v8/upstream/scons/engine/SCons/Tool/jar.py +0 -110
  129. data/ext/v8/upstream/scons/engine/SCons/Tool/javac.py +0 -234
  130. data/ext/v8/upstream/scons/engine/SCons/Tool/javah.py +0 -138
  131. data/ext/v8/upstream/scons/engine/SCons/Tool/latex.py +0 -79
  132. data/ext/v8/upstream/scons/engine/SCons/Tool/lex.py +0 -99
  133. data/ext/v8/upstream/scons/engine/SCons/Tool/link.py +0 -121
  134. data/ext/v8/upstream/scons/engine/SCons/Tool/linkloc.py +0 -112
  135. data/ext/v8/upstream/scons/engine/SCons/Tool/m4.py +0 -63
  136. data/ext/v8/upstream/scons/engine/SCons/Tool/masm.py +0 -77
  137. data/ext/v8/upstream/scons/engine/SCons/Tool/midl.py +0 -90
  138. data/ext/v8/upstream/scons/engine/SCons/Tool/mingw.py +0 -159
  139. data/ext/v8/upstream/scons/engine/SCons/Tool/mslib.py +0 -64
  140. data/ext/v8/upstream/scons/engine/SCons/Tool/mslink.py +0 -266
  141. data/ext/v8/upstream/scons/engine/SCons/Tool/mssdk.py +0 -50
  142. data/ext/v8/upstream/scons/engine/SCons/Tool/msvc.py +0 -269
  143. data/ext/v8/upstream/scons/engine/SCons/Tool/msvs.py +0 -1439
  144. data/ext/v8/upstream/scons/engine/SCons/Tool/mwcc.py +0 -208
  145. data/ext/v8/upstream/scons/engine/SCons/Tool/mwld.py +0 -107
  146. data/ext/v8/upstream/scons/engine/SCons/Tool/nasm.py +0 -72
  147. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/__init__.py +0 -314
  148. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/ipk.py +0 -185
  149. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/msi.py +0 -526
  150. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/rpm.py +0 -367
  151. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_tarbz2.py +0 -43
  152. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_targz.py +0 -43
  153. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_zip.py +0 -43
  154. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/tarbz2.py +0 -44
  155. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/targz.py +0 -44
  156. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/zip.py +0 -44
  157. data/ext/v8/upstream/scons/engine/SCons/Tool/pdf.py +0 -78
  158. data/ext/v8/upstream/scons/engine/SCons/Tool/pdflatex.py +0 -83
  159. data/ext/v8/upstream/scons/engine/SCons/Tool/pdftex.py +0 -108
  160. data/ext/v8/upstream/scons/engine/SCons/Tool/qt.py +0 -336
  161. data/ext/v8/upstream/scons/engine/SCons/Tool/rmic.py +0 -121
  162. data/ext/v8/upstream/scons/engine/SCons/Tool/rpcgen.py +0 -70
  163. data/ext/v8/upstream/scons/engine/SCons/Tool/rpm.py +0 -132
  164. data/ext/v8/upstream/scons/engine/SCons/Tool/sgiar.py +0 -68
  165. data/ext/v8/upstream/scons/engine/SCons/Tool/sgic++.py +0 -58
  166. data/ext/v8/upstream/scons/engine/SCons/Tool/sgicc.py +0 -53
  167. data/ext/v8/upstream/scons/engine/SCons/Tool/sgilink.py +0 -63
  168. data/ext/v8/upstream/scons/engine/SCons/Tool/sunar.py +0 -67
  169. data/ext/v8/upstream/scons/engine/SCons/Tool/sunc++.py +0 -142
  170. data/ext/v8/upstream/scons/engine/SCons/Tool/suncc.py +0 -58
  171. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf77.py +0 -63
  172. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf90.py +0 -64
  173. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf95.py +0 -64
  174. data/ext/v8/upstream/scons/engine/SCons/Tool/sunlink.py +0 -77
  175. data/ext/v8/upstream/scons/engine/SCons/Tool/swig.py +0 -186
  176. data/ext/v8/upstream/scons/engine/SCons/Tool/tar.py +0 -73
  177. data/ext/v8/upstream/scons/engine/SCons/Tool/tex.py +0 -805
  178. data/ext/v8/upstream/scons/engine/SCons/Tool/textfile.py +0 -175
  179. data/ext/v8/upstream/scons/engine/SCons/Tool/tlib.py +0 -53
  180. data/ext/v8/upstream/scons/engine/SCons/Tool/wix.py +0 -100
  181. data/ext/v8/upstream/scons/engine/SCons/Tool/yacc.py +0 -131
  182. data/ext/v8/upstream/scons/engine/SCons/Tool/zip.py +0 -100
  183. data/ext/v8/upstream/scons/engine/SCons/Util.py +0 -1645
  184. data/ext/v8/upstream/scons/engine/SCons/Variables/BoolVariable.py +0 -91
  185. data/ext/v8/upstream/scons/engine/SCons/Variables/EnumVariable.py +0 -107
  186. data/ext/v8/upstream/scons/engine/SCons/Variables/ListVariable.py +0 -139
  187. data/ext/v8/upstream/scons/engine/SCons/Variables/PackageVariable.py +0 -109
  188. data/ext/v8/upstream/scons/engine/SCons/Variables/PathVariable.py +0 -147
  189. data/ext/v8/upstream/scons/engine/SCons/Variables/__init__.py +0 -317
  190. data/ext/v8/upstream/scons/engine/SCons/Warnings.py +0 -228
  191. data/ext/v8/upstream/scons/engine/SCons/__init__.py +0 -49
  192. data/ext/v8/upstream/scons/engine/SCons/compat/__init__.py +0 -302
  193. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_UserString.py +0 -98
  194. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_hashlib.py +0 -91
  195. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_itertools.py +0 -124
  196. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_optparse.py +0 -1725
  197. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets.py +0 -583
  198. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets15.py +0 -176
  199. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_shlex.py +0 -325
  200. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_subprocess.py +0 -1296
  201. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_textwrap.py +0 -382
  202. data/ext/v8/upstream/scons/engine/SCons/compat/builtins.py +0 -187
  203. data/ext/v8/upstream/scons/engine/SCons/cpp.py +0 -598
  204. data/ext/v8/upstream/scons/engine/SCons/dblite.py +0 -248
  205. data/ext/v8/upstream/scons/engine/SCons/exitfuncs.py +0 -77
  206. data/ext/v8/upstream/scons/os_spawnv_fix.diff +0 -83
  207. data/ext/v8/upstream/scons/scons-time.1 +0 -1017
  208. data/ext/v8/upstream/scons/scons.1 +0 -15179
  209. data/ext/v8/upstream/scons/sconsign.1 +0 -208
  210. data/ext/v8/upstream/scons/script/scons +0 -184
  211. data/ext/v8/upstream/scons/script/scons-time +0 -1529
  212. data/ext/v8/upstream/scons/script/scons.bat +0 -31
  213. data/ext/v8/upstream/scons/script/sconsign +0 -508
  214. data/ext/v8/upstream/scons/setup.cfg +0 -6
  215. data/ext/v8/upstream/scons/setup.py +0 -427
  216. data/ext/v8/upstream/v8/.gitignore +0 -33
  217. data/ext/v8/upstream/v8/AUTHORS +0 -42
  218. data/ext/v8/upstream/v8/ChangeLog +0 -2663
  219. data/ext/v8/upstream/v8/LICENSE +0 -52
  220. data/ext/v8/upstream/v8/LICENSE.strongtalk +0 -29
  221. data/ext/v8/upstream/v8/LICENSE.v8 +0 -26
  222. data/ext/v8/upstream/v8/LICENSE.valgrind +0 -45
  223. data/ext/v8/upstream/v8/SConstruct +0 -1473
  224. data/ext/v8/upstream/v8/build/README.txt +0 -25
  225. data/ext/v8/upstream/v8/build/all.gyp +0 -18
  226. data/ext/v8/upstream/v8/build/armu.gypi +0 -32
  227. data/ext/v8/upstream/v8/build/common.gypi +0 -82
  228. data/ext/v8/upstream/v8/build/gyp_v8 +0 -145
  229. data/ext/v8/upstream/v8/include/v8-debug.h +0 -394
  230. data/ext/v8/upstream/v8/include/v8-preparser.h +0 -116
  231. data/ext/v8/upstream/v8/include/v8-profiler.h +0 -505
  232. data/ext/v8/upstream/v8/include/v8-testing.h +0 -104
  233. data/ext/v8/upstream/v8/include/v8.h +0 -4000
  234. data/ext/v8/upstream/v8/include/v8stdint.h +0 -53
  235. data/ext/v8/upstream/v8/preparser/SConscript +0 -38
  236. data/ext/v8/upstream/v8/preparser/preparser-process.cc +0 -169
  237. data/ext/v8/upstream/v8/src/SConscript +0 -380
  238. data/ext/v8/upstream/v8/src/accessors.cc +0 -766
  239. data/ext/v8/upstream/v8/src/accessors.h +0 -121
  240. data/ext/v8/upstream/v8/src/allocation-inl.h +0 -49
  241. data/ext/v8/upstream/v8/src/allocation.cc +0 -122
  242. data/ext/v8/upstream/v8/src/allocation.h +0 -143
  243. data/ext/v8/upstream/v8/src/api.cc +0 -5678
  244. data/ext/v8/upstream/v8/src/api.h +0 -572
  245. data/ext/v8/upstream/v8/src/apinatives.js +0 -110
  246. data/ext/v8/upstream/v8/src/apiutils.h +0 -73
  247. data/ext/v8/upstream/v8/src/arguments.h +0 -116
  248. data/ext/v8/upstream/v8/src/arm/assembler-arm-inl.h +0 -353
  249. data/ext/v8/upstream/v8/src/arm/assembler-arm.cc +0 -2877
  250. data/ext/v8/upstream/v8/src/arm/assembler-arm.h +0 -1382
  251. data/ext/v8/upstream/v8/src/arm/builtins-arm.cc +0 -1634
  252. data/ext/v8/upstream/v8/src/arm/code-stubs-arm.cc +0 -6917
  253. data/ext/v8/upstream/v8/src/arm/code-stubs-arm.h +0 -623
  254. data/ext/v8/upstream/v8/src/arm/codegen-arm-inl.h +0 -48
  255. data/ext/v8/upstream/v8/src/arm/codegen-arm.cc +0 -7437
  256. data/ext/v8/upstream/v8/src/arm/codegen-arm.h +0 -595
  257. data/ext/v8/upstream/v8/src/arm/constants-arm.cc +0 -152
  258. data/ext/v8/upstream/v8/src/arm/constants-arm.h +0 -778
  259. data/ext/v8/upstream/v8/src/arm/cpu-arm.cc +0 -149
  260. data/ext/v8/upstream/v8/src/arm/debug-arm.cc +0 -317
  261. data/ext/v8/upstream/v8/src/arm/deoptimizer-arm.cc +0 -737
  262. data/ext/v8/upstream/v8/src/arm/disasm-arm.cc +0 -1503
  263. data/ext/v8/upstream/v8/src/arm/frames-arm.cc +0 -45
  264. data/ext/v8/upstream/v8/src/arm/frames-arm.h +0 -168
  265. data/ext/v8/upstream/v8/src/arm/full-codegen-arm.cc +0 -4374
  266. data/ext/v8/upstream/v8/src/arm/ic-arm.cc +0 -1793
  267. data/ext/v8/upstream/v8/src/arm/jump-target-arm.cc +0 -174
  268. data/ext/v8/upstream/v8/src/arm/lithium-arm.cc +0 -2120
  269. data/ext/v8/upstream/v8/src/arm/lithium-arm.h +0 -2179
  270. data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.cc +0 -4132
  271. data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.h +0 -329
  272. data/ext/v8/upstream/v8/src/arm/lithium-gap-resolver-arm.cc +0 -305
  273. data/ext/v8/upstream/v8/src/arm/lithium-gap-resolver-arm.h +0 -84
  274. data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.cc +0 -2939
  275. data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.h +0 -1071
  276. data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.cc +0 -1287
  277. data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.h +0 -253
  278. data/ext/v8/upstream/v8/src/arm/register-allocator-arm-inl.h +0 -100
  279. data/ext/v8/upstream/v8/src/arm/register-allocator-arm.cc +0 -63
  280. data/ext/v8/upstream/v8/src/arm/register-allocator-arm.h +0 -44
  281. data/ext/v8/upstream/v8/src/arm/simulator-arm.cc +0 -3288
  282. data/ext/v8/upstream/v8/src/arm/simulator-arm.h +0 -413
  283. data/ext/v8/upstream/v8/src/arm/stub-cache-arm.cc +0 -4034
  284. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm-inl.h +0 -59
  285. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.cc +0 -843
  286. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.h +0 -523
  287. data/ext/v8/upstream/v8/src/array.js +0 -1249
  288. data/ext/v8/upstream/v8/src/assembler.cc +0 -1067
  289. data/ext/v8/upstream/v8/src/assembler.h +0 -823
  290. data/ext/v8/upstream/v8/src/ast-inl.h +0 -112
  291. data/ext/v8/upstream/v8/src/ast.cc +0 -1078
  292. data/ext/v8/upstream/v8/src/ast.h +0 -2234
  293. data/ext/v8/upstream/v8/src/atomicops.h +0 -167
  294. data/ext/v8/upstream/v8/src/atomicops_internals_arm_gcc.h +0 -145
  295. data/ext/v8/upstream/v8/src/atomicops_internals_mips_gcc.h +0 -169
  296. data/ext/v8/upstream/v8/src/atomicops_internals_x86_gcc.cc +0 -126
  297. data/ext/v8/upstream/v8/src/atomicops_internals_x86_gcc.h +0 -287
  298. data/ext/v8/upstream/v8/src/atomicops_internals_x86_macosx.h +0 -301
  299. data/ext/v8/upstream/v8/src/atomicops_internals_x86_msvc.h +0 -203
  300. data/ext/v8/upstream/v8/src/bignum-dtoa.cc +0 -655
  301. data/ext/v8/upstream/v8/src/bignum-dtoa.h +0 -81
  302. data/ext/v8/upstream/v8/src/bignum.cc +0 -768
  303. data/ext/v8/upstream/v8/src/bignum.h +0 -140
  304. data/ext/v8/upstream/v8/src/bootstrapper.cc +0 -2138
  305. data/ext/v8/upstream/v8/src/bootstrapper.h +0 -185
  306. data/ext/v8/upstream/v8/src/builtins.cc +0 -1708
  307. data/ext/v8/upstream/v8/src/builtins.h +0 -368
  308. data/ext/v8/upstream/v8/src/bytecodes-irregexp.h +0 -105
  309. data/ext/v8/upstream/v8/src/cached-powers.cc +0 -177
  310. data/ext/v8/upstream/v8/src/cached-powers.h +0 -65
  311. data/ext/v8/upstream/v8/src/char-predicates-inl.h +0 -94
  312. data/ext/v8/upstream/v8/src/char-predicates.h +0 -65
  313. data/ext/v8/upstream/v8/src/checks.cc +0 -110
  314. data/ext/v8/upstream/v8/src/checks.h +0 -296
  315. data/ext/v8/upstream/v8/src/circular-queue-inl.h +0 -53
  316. data/ext/v8/upstream/v8/src/circular-queue.cc +0 -122
  317. data/ext/v8/upstream/v8/src/circular-queue.h +0 -103
  318. data/ext/v8/upstream/v8/src/code-stubs.cc +0 -240
  319. data/ext/v8/upstream/v8/src/code-stubs.h +0 -971
  320. data/ext/v8/upstream/v8/src/code.h +0 -68
  321. data/ext/v8/upstream/v8/src/codegen-inl.h +0 -68
  322. data/ext/v8/upstream/v8/src/codegen.cc +0 -505
  323. data/ext/v8/upstream/v8/src/codegen.h +0 -245
  324. data/ext/v8/upstream/v8/src/compilation-cache.cc +0 -540
  325. data/ext/v8/upstream/v8/src/compilation-cache.h +0 -287
  326. data/ext/v8/upstream/v8/src/compiler.cc +0 -792
  327. data/ext/v8/upstream/v8/src/compiler.h +0 -307
  328. data/ext/v8/upstream/v8/src/contexts.cc +0 -327
  329. data/ext/v8/upstream/v8/src/contexts.h +0 -382
  330. data/ext/v8/upstream/v8/src/conversions-inl.h +0 -110
  331. data/ext/v8/upstream/v8/src/conversions.cc +0 -1125
  332. data/ext/v8/upstream/v8/src/conversions.h +0 -122
  333. data/ext/v8/upstream/v8/src/counters.cc +0 -93
  334. data/ext/v8/upstream/v8/src/counters.h +0 -254
  335. data/ext/v8/upstream/v8/src/cpu-profiler-inl.h +0 -101
  336. data/ext/v8/upstream/v8/src/cpu-profiler.cc +0 -606
  337. data/ext/v8/upstream/v8/src/cpu-profiler.h +0 -305
  338. data/ext/v8/upstream/v8/src/cpu.h +0 -67
  339. data/ext/v8/upstream/v8/src/d8-debug.cc +0 -367
  340. data/ext/v8/upstream/v8/src/d8-debug.h +0 -158
  341. data/ext/v8/upstream/v8/src/d8-posix.cc +0 -695
  342. data/ext/v8/upstream/v8/src/d8-readline.cc +0 -128
  343. data/ext/v8/upstream/v8/src/d8-windows.cc +0 -42
  344. data/ext/v8/upstream/v8/src/d8.cc +0 -796
  345. data/ext/v8/upstream/v8/src/d8.gyp +0 -88
  346. data/ext/v8/upstream/v8/src/d8.h +0 -231
  347. data/ext/v8/upstream/v8/src/d8.js +0 -2798
  348. data/ext/v8/upstream/v8/src/data-flow.cc +0 -545
  349. data/ext/v8/upstream/v8/src/data-flow.h +0 -379
  350. data/ext/v8/upstream/v8/src/date.js +0 -1103
  351. data/ext/v8/upstream/v8/src/dateparser-inl.h +0 -125
  352. data/ext/v8/upstream/v8/src/dateparser.cc +0 -178
  353. data/ext/v8/upstream/v8/src/dateparser.h +0 -265
  354. data/ext/v8/upstream/v8/src/debug-agent.cc +0 -447
  355. data/ext/v8/upstream/v8/src/debug-agent.h +0 -129
  356. data/ext/v8/upstream/v8/src/debug-debugger.js +0 -2569
  357. data/ext/v8/upstream/v8/src/debug.cc +0 -3188
  358. data/ext/v8/upstream/v8/src/debug.h +0 -1055
  359. data/ext/v8/upstream/v8/src/deoptimizer.cc +0 -1296
  360. data/ext/v8/upstream/v8/src/deoptimizer.h +0 -629
  361. data/ext/v8/upstream/v8/src/disasm.h +0 -80
  362. data/ext/v8/upstream/v8/src/disassembler.cc +0 -339
  363. data/ext/v8/upstream/v8/src/disassembler.h +0 -56
  364. data/ext/v8/upstream/v8/src/diy-fp.cc +0 -58
  365. data/ext/v8/upstream/v8/src/diy-fp.h +0 -117
  366. data/ext/v8/upstream/v8/src/double.h +0 -238
  367. data/ext/v8/upstream/v8/src/dtoa.cc +0 -103
  368. data/ext/v8/upstream/v8/src/dtoa.h +0 -85
  369. data/ext/v8/upstream/v8/src/execution.cc +0 -791
  370. data/ext/v8/upstream/v8/src/execution.h +0 -291
  371. data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.cc +0 -250
  372. data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.h +0 -89
  373. data/ext/v8/upstream/v8/src/extensions/experimental/experimental.gyp +0 -55
  374. data/ext/v8/upstream/v8/src/extensions/experimental/i18n-extension.cc +0 -284
  375. data/ext/v8/upstream/v8/src/extensions/experimental/i18n-extension.h +0 -64
  376. data/ext/v8/upstream/v8/src/extensions/externalize-string-extension.cc +0 -141
  377. data/ext/v8/upstream/v8/src/extensions/externalize-string-extension.h +0 -50
  378. data/ext/v8/upstream/v8/src/extensions/gc-extension.cc +0 -58
  379. data/ext/v8/upstream/v8/src/extensions/gc-extension.h +0 -49
  380. data/ext/v8/upstream/v8/src/factory.cc +0 -1194
  381. data/ext/v8/upstream/v8/src/factory.h +0 -436
  382. data/ext/v8/upstream/v8/src/fast-dtoa.cc +0 -736
  383. data/ext/v8/upstream/v8/src/fast-dtoa.h +0 -83
  384. data/ext/v8/upstream/v8/src/fixed-dtoa.cc +0 -405
  385. data/ext/v8/upstream/v8/src/fixed-dtoa.h +0 -55
  386. data/ext/v8/upstream/v8/src/flag-definitions.h +0 -556
  387. data/ext/v8/upstream/v8/src/flags.cc +0 -551
  388. data/ext/v8/upstream/v8/src/flags.h +0 -79
  389. data/ext/v8/upstream/v8/src/frame-element.cc +0 -37
  390. data/ext/v8/upstream/v8/src/frame-element.h +0 -269
  391. data/ext/v8/upstream/v8/src/frames-inl.h +0 -236
  392. data/ext/v8/upstream/v8/src/frames.cc +0 -1273
  393. data/ext/v8/upstream/v8/src/frames.h +0 -854
  394. data/ext/v8/upstream/v8/src/full-codegen.cc +0 -1385
  395. data/ext/v8/upstream/v8/src/full-codegen.h +0 -753
  396. data/ext/v8/upstream/v8/src/func-name-inferrer.cc +0 -91
  397. data/ext/v8/upstream/v8/src/func-name-inferrer.h +0 -111
  398. data/ext/v8/upstream/v8/src/gdb-jit.cc +0 -1548
  399. data/ext/v8/upstream/v8/src/gdb-jit.h +0 -138
  400. data/ext/v8/upstream/v8/src/global-handles.cc +0 -596
  401. data/ext/v8/upstream/v8/src/global-handles.h +0 -239
  402. data/ext/v8/upstream/v8/src/globals.h +0 -325
  403. data/ext/v8/upstream/v8/src/handles-inl.h +0 -177
  404. data/ext/v8/upstream/v8/src/handles.cc +0 -965
  405. data/ext/v8/upstream/v8/src/handles.h +0 -372
  406. data/ext/v8/upstream/v8/src/hashmap.cc +0 -230
  407. data/ext/v8/upstream/v8/src/hashmap.h +0 -121
  408. data/ext/v8/upstream/v8/src/heap-inl.h +0 -703
  409. data/ext/v8/upstream/v8/src/heap-profiler.cc +0 -1173
  410. data/ext/v8/upstream/v8/src/heap-profiler.h +0 -396
  411. data/ext/v8/upstream/v8/src/heap.cc +0 -5856
  412. data/ext/v8/upstream/v8/src/heap.h +0 -2264
  413. data/ext/v8/upstream/v8/src/hydrogen-instructions.cc +0 -1639
  414. data/ext/v8/upstream/v8/src/hydrogen-instructions.h +0 -3657
  415. data/ext/v8/upstream/v8/src/hydrogen.cc +0 -6011
  416. data/ext/v8/upstream/v8/src/hydrogen.h +0 -1137
  417. data/ext/v8/upstream/v8/src/ia32/assembler-ia32-inl.h +0 -430
  418. data/ext/v8/upstream/v8/src/ia32/assembler-ia32.cc +0 -2846
  419. data/ext/v8/upstream/v8/src/ia32/assembler-ia32.h +0 -1159
  420. data/ext/v8/upstream/v8/src/ia32/builtins-ia32.cc +0 -1596
  421. data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.cc +0 -6549
  422. data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.h +0 -495
  423. data/ext/v8/upstream/v8/src/ia32/codegen-ia32-inl.h +0 -46
  424. data/ext/v8/upstream/v8/src/ia32/codegen-ia32.cc +0 -10385
  425. data/ext/v8/upstream/v8/src/ia32/codegen-ia32.h +0 -801
  426. data/ext/v8/upstream/v8/src/ia32/cpu-ia32.cc +0 -88
  427. data/ext/v8/upstream/v8/src/ia32/debug-ia32.cc +0 -312
  428. data/ext/v8/upstream/v8/src/ia32/deoptimizer-ia32.cc +0 -774
  429. data/ext/v8/upstream/v8/src/ia32/disasm-ia32.cc +0 -1620
  430. data/ext/v8/upstream/v8/src/ia32/frames-ia32.cc +0 -45
  431. data/ext/v8/upstream/v8/src/ia32/frames-ia32.h +0 -140
  432. data/ext/v8/upstream/v8/src/ia32/full-codegen-ia32.cc +0 -4357
  433. data/ext/v8/upstream/v8/src/ia32/ic-ia32.cc +0 -1779
  434. data/ext/v8/upstream/v8/src/ia32/jump-target-ia32.cc +0 -437
  435. data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.cc +0 -4158
  436. data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.h +0 -318
  437. data/ext/v8/upstream/v8/src/ia32/lithium-gap-resolver-ia32.cc +0 -466
  438. data/ext/v8/upstream/v8/src/ia32/lithium-gap-resolver-ia32.h +0 -110
  439. data/ext/v8/upstream/v8/src/ia32/lithium-ia32.cc +0 -2181
  440. data/ext/v8/upstream/v8/src/ia32/lithium-ia32.h +0 -2235
  441. data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.cc +0 -2056
  442. data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.h +0 -807
  443. data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.cc +0 -1264
  444. data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.h +0 -216
  445. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32-inl.h +0 -82
  446. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32.cc +0 -157
  447. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32.h +0 -43
  448. data/ext/v8/upstream/v8/src/ia32/simulator-ia32.cc +0 -30
  449. data/ext/v8/upstream/v8/src/ia32/simulator-ia32.h +0 -72
  450. data/ext/v8/upstream/v8/src/ia32/stub-cache-ia32.cc +0 -3711
  451. data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.cc +0 -1366
  452. data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.h +0 -650
  453. data/ext/v8/upstream/v8/src/ic-inl.h +0 -130
  454. data/ext/v8/upstream/v8/src/ic.cc +0 -2389
  455. data/ext/v8/upstream/v8/src/ic.h +0 -675
  456. data/ext/v8/upstream/v8/src/inspector.cc +0 -63
  457. data/ext/v8/upstream/v8/src/inspector.h +0 -62
  458. data/ext/v8/upstream/v8/src/interpreter-irregexp.cc +0 -659
  459. data/ext/v8/upstream/v8/src/interpreter-irregexp.h +0 -49
  460. data/ext/v8/upstream/v8/src/isolate.cc +0 -883
  461. data/ext/v8/upstream/v8/src/isolate.h +0 -1306
  462. data/ext/v8/upstream/v8/src/json.js +0 -342
  463. data/ext/v8/upstream/v8/src/jsregexp.cc +0 -5371
  464. data/ext/v8/upstream/v8/src/jsregexp.h +0 -1483
  465. data/ext/v8/upstream/v8/src/jump-target-heavy-inl.h +0 -51
  466. data/ext/v8/upstream/v8/src/jump-target-heavy.cc +0 -427
  467. data/ext/v8/upstream/v8/src/jump-target-heavy.h +0 -238
  468. data/ext/v8/upstream/v8/src/jump-target-inl.h +0 -48
  469. data/ext/v8/upstream/v8/src/jump-target-light-inl.h +0 -56
  470. data/ext/v8/upstream/v8/src/jump-target-light.cc +0 -111
  471. data/ext/v8/upstream/v8/src/jump-target-light.h +0 -193
  472. data/ext/v8/upstream/v8/src/jump-target.cc +0 -91
  473. data/ext/v8/upstream/v8/src/jump-target.h +0 -90
  474. data/ext/v8/upstream/v8/src/list-inl.h +0 -206
  475. data/ext/v8/upstream/v8/src/list.h +0 -164
  476. data/ext/v8/upstream/v8/src/lithium-allocator-inl.h +0 -142
  477. data/ext/v8/upstream/v8/src/lithium-allocator.cc +0 -2105
  478. data/ext/v8/upstream/v8/src/lithium-allocator.h +0 -630
  479. data/ext/v8/upstream/v8/src/lithium.cc +0 -169
  480. data/ext/v8/upstream/v8/src/lithium.h +0 -592
  481. data/ext/v8/upstream/v8/src/liveedit-debugger.js +0 -1082
  482. data/ext/v8/upstream/v8/src/liveedit.cc +0 -1693
  483. data/ext/v8/upstream/v8/src/liveedit.h +0 -179
  484. data/ext/v8/upstream/v8/src/liveobjectlist-inl.h +0 -126
  485. data/ext/v8/upstream/v8/src/liveobjectlist.cc +0 -2589
  486. data/ext/v8/upstream/v8/src/liveobjectlist.h +0 -322
  487. data/ext/v8/upstream/v8/src/log-inl.h +0 -59
  488. data/ext/v8/upstream/v8/src/log-utils.cc +0 -423
  489. data/ext/v8/upstream/v8/src/log-utils.h +0 -229
  490. data/ext/v8/upstream/v8/src/log.cc +0 -1666
  491. data/ext/v8/upstream/v8/src/log.h +0 -446
  492. data/ext/v8/upstream/v8/src/macro-assembler.h +0 -120
  493. data/ext/v8/upstream/v8/src/macros.py +0 -178
  494. data/ext/v8/upstream/v8/src/mark-compact.cc +0 -3092
  495. data/ext/v8/upstream/v8/src/mark-compact.h +0 -506
  496. data/ext/v8/upstream/v8/src/math.js +0 -264
  497. data/ext/v8/upstream/v8/src/messages.cc +0 -166
  498. data/ext/v8/upstream/v8/src/messages.h +0 -114
  499. data/ext/v8/upstream/v8/src/messages.js +0 -1090
  500. data/ext/v8/upstream/v8/src/mips/assembler-mips-inl.h +0 -335
  501. data/ext/v8/upstream/v8/src/mips/assembler-mips.cc +0 -2093
  502. data/ext/v8/upstream/v8/src/mips/assembler-mips.h +0 -1066
  503. data/ext/v8/upstream/v8/src/mips/builtins-mips.cc +0 -148
  504. data/ext/v8/upstream/v8/src/mips/code-stubs-mips.cc +0 -752
  505. data/ext/v8/upstream/v8/src/mips/code-stubs-mips.h +0 -511
  506. data/ext/v8/upstream/v8/src/mips/codegen-mips-inl.h +0 -64
  507. data/ext/v8/upstream/v8/src/mips/codegen-mips.cc +0 -1213
  508. data/ext/v8/upstream/v8/src/mips/codegen-mips.h +0 -633
  509. data/ext/v8/upstream/v8/src/mips/constants-mips.cc +0 -352
  510. data/ext/v8/upstream/v8/src/mips/constants-mips.h +0 -723
  511. data/ext/v8/upstream/v8/src/mips/cpu-mips.cc +0 -90
  512. data/ext/v8/upstream/v8/src/mips/debug-mips.cc +0 -155
  513. data/ext/v8/upstream/v8/src/mips/deoptimizer-mips.cc +0 -91
  514. data/ext/v8/upstream/v8/src/mips/disasm-mips.cc +0 -1023
  515. data/ext/v8/upstream/v8/src/mips/frames-mips.cc +0 -48
  516. data/ext/v8/upstream/v8/src/mips/frames-mips.h +0 -179
  517. data/ext/v8/upstream/v8/src/mips/full-codegen-mips.cc +0 -727
  518. data/ext/v8/upstream/v8/src/mips/ic-mips.cc +0 -244
  519. data/ext/v8/upstream/v8/src/mips/jump-target-mips.cc +0 -80
  520. data/ext/v8/upstream/v8/src/mips/lithium-codegen-mips.h +0 -65
  521. data/ext/v8/upstream/v8/src/mips/lithium-mips.h +0 -304
  522. data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.cc +0 -3327
  523. data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.h +0 -1058
  524. data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.cc +0 -478
  525. data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.h +0 -250
  526. data/ext/v8/upstream/v8/src/mips/register-allocator-mips-inl.h +0 -134
  527. data/ext/v8/upstream/v8/src/mips/register-allocator-mips.cc +0 -63
  528. data/ext/v8/upstream/v8/src/mips/register-allocator-mips.h +0 -47
  529. data/ext/v8/upstream/v8/src/mips/simulator-mips.cc +0 -2438
  530. data/ext/v8/upstream/v8/src/mips/simulator-mips.h +0 -394
  531. data/ext/v8/upstream/v8/src/mips/stub-cache-mips.cc +0 -601
  532. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips-inl.h +0 -58
  533. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.cc +0 -307
  534. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.h +0 -530
  535. data/ext/v8/upstream/v8/src/mirror-debugger.js +0 -2381
  536. data/ext/v8/upstream/v8/src/mksnapshot.cc +0 -256
  537. data/ext/v8/upstream/v8/src/natives.h +0 -63
  538. data/ext/v8/upstream/v8/src/objects-debug.cc +0 -722
  539. data/ext/v8/upstream/v8/src/objects-inl.h +0 -4166
  540. data/ext/v8/upstream/v8/src/objects-printer.cc +0 -801
  541. data/ext/v8/upstream/v8/src/objects-visiting.cc +0 -142
  542. data/ext/v8/upstream/v8/src/objects-visiting.h +0 -422
  543. data/ext/v8/upstream/v8/src/objects.cc +0 -10296
  544. data/ext/v8/upstream/v8/src/objects.h +0 -6662
  545. data/ext/v8/upstream/v8/src/parser.cc +0 -5168
  546. data/ext/v8/upstream/v8/src/parser.h +0 -823
  547. data/ext/v8/upstream/v8/src/platform-cygwin.cc +0 -811
  548. data/ext/v8/upstream/v8/src/platform-freebsd.cc +0 -854
  549. data/ext/v8/upstream/v8/src/platform-linux.cc +0 -1120
  550. data/ext/v8/upstream/v8/src/platform-macos.cc +0 -865
  551. data/ext/v8/upstream/v8/src/platform-nullos.cc +0 -504
  552. data/ext/v8/upstream/v8/src/platform-openbsd.cc +0 -672
  553. data/ext/v8/upstream/v8/src/platform-posix.cc +0 -424
  554. data/ext/v8/upstream/v8/src/platform-solaris.cc +0 -796
  555. data/ext/v8/upstream/v8/src/platform-tls-mac.h +0 -62
  556. data/ext/v8/upstream/v8/src/platform-tls-win32.h +0 -62
  557. data/ext/v8/upstream/v8/src/platform-tls.h +0 -50
  558. data/ext/v8/upstream/v8/src/platform-win32.cc +0 -2072
  559. data/ext/v8/upstream/v8/src/platform.h +0 -693
  560. data/ext/v8/upstream/v8/src/preparse-data.cc +0 -185
  561. data/ext/v8/upstream/v8/src/preparse-data.h +0 -249
  562. data/ext/v8/upstream/v8/src/preparser-api.cc +0 -219
  563. data/ext/v8/upstream/v8/src/preparser.cc +0 -1205
  564. data/ext/v8/upstream/v8/src/preparser.h +0 -278
  565. data/ext/v8/upstream/v8/src/prettyprinter.cc +0 -1530
  566. data/ext/v8/upstream/v8/src/prettyprinter.h +0 -223
  567. data/ext/v8/upstream/v8/src/profile-generator-inl.h +0 -128
  568. data/ext/v8/upstream/v8/src/profile-generator.cc +0 -3095
  569. data/ext/v8/upstream/v8/src/profile-generator.h +0 -1125
  570. data/ext/v8/upstream/v8/src/property.cc +0 -102
  571. data/ext/v8/upstream/v8/src/property.h +0 -348
  572. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp-inl.h +0 -78
  573. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp.cc +0 -470
  574. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp.h +0 -142
  575. data/ext/v8/upstream/v8/src/regexp-macro-assembler-tracer.cc +0 -373
  576. data/ext/v8/upstream/v8/src/regexp-macro-assembler-tracer.h +0 -104
  577. data/ext/v8/upstream/v8/src/regexp-macro-assembler.cc +0 -266
  578. data/ext/v8/upstream/v8/src/regexp-macro-assembler.h +0 -236
  579. data/ext/v8/upstream/v8/src/regexp-stack.cc +0 -111
  580. data/ext/v8/upstream/v8/src/regexp-stack.h +0 -147
  581. data/ext/v8/upstream/v8/src/regexp.js +0 -483
  582. data/ext/v8/upstream/v8/src/register-allocator-inl.h +0 -141
  583. data/ext/v8/upstream/v8/src/register-allocator.cc +0 -98
  584. data/ext/v8/upstream/v8/src/register-allocator.h +0 -310
  585. data/ext/v8/upstream/v8/src/rewriter.cc +0 -1024
  586. data/ext/v8/upstream/v8/src/rewriter.h +0 -59
  587. data/ext/v8/upstream/v8/src/runtime-profiler.cc +0 -478
  588. data/ext/v8/upstream/v8/src/runtime-profiler.h +0 -192
  589. data/ext/v8/upstream/v8/src/runtime.cc +0 -11949
  590. data/ext/v8/upstream/v8/src/runtime.h +0 -643
  591. data/ext/v8/upstream/v8/src/runtime.js +0 -643
  592. data/ext/v8/upstream/v8/src/safepoint-table.cc +0 -256
  593. data/ext/v8/upstream/v8/src/safepoint-table.h +0 -269
  594. data/ext/v8/upstream/v8/src/scanner-base.cc +0 -964
  595. data/ext/v8/upstream/v8/src/scanner-base.h +0 -664
  596. data/ext/v8/upstream/v8/src/scanner.cc +0 -584
  597. data/ext/v8/upstream/v8/src/scanner.h +0 -196
  598. data/ext/v8/upstream/v8/src/scopeinfo.cc +0 -631
  599. data/ext/v8/upstream/v8/src/scopeinfo.h +0 -249
  600. data/ext/v8/upstream/v8/src/scopes.cc +0 -1093
  601. data/ext/v8/upstream/v8/src/scopes.h +0 -508
  602. data/ext/v8/upstream/v8/src/serialize.cc +0 -1574
  603. data/ext/v8/upstream/v8/src/serialize.h +0 -589
  604. data/ext/v8/upstream/v8/src/shell.h +0 -55
  605. data/ext/v8/upstream/v8/src/simulator.h +0 -43
  606. data/ext/v8/upstream/v8/src/small-pointer-list.h +0 -163
  607. data/ext/v8/upstream/v8/src/smart-pointer.h +0 -109
  608. data/ext/v8/upstream/v8/src/snapshot-common.cc +0 -82
  609. data/ext/v8/upstream/v8/src/snapshot-empty.cc +0 -50
  610. data/ext/v8/upstream/v8/src/snapshot.h +0 -73
  611. data/ext/v8/upstream/v8/src/spaces-inl.h +0 -529
  612. data/ext/v8/upstream/v8/src/spaces.cc +0 -3147
  613. data/ext/v8/upstream/v8/src/spaces.h +0 -2368
  614. data/ext/v8/upstream/v8/src/splay-tree-inl.h +0 -310
  615. data/ext/v8/upstream/v8/src/splay-tree.h +0 -203
  616. data/ext/v8/upstream/v8/src/string-search.cc +0 -41
  617. data/ext/v8/upstream/v8/src/string-search.h +0 -568
  618. data/ext/v8/upstream/v8/src/string-stream.cc +0 -592
  619. data/ext/v8/upstream/v8/src/string-stream.h +0 -191
  620. data/ext/v8/upstream/v8/src/string.js +0 -915
  621. data/ext/v8/upstream/v8/src/strtod.cc +0 -440
  622. data/ext/v8/upstream/v8/src/strtod.h +0 -40
  623. data/ext/v8/upstream/v8/src/stub-cache.cc +0 -1940
  624. data/ext/v8/upstream/v8/src/stub-cache.h +0 -866
  625. data/ext/v8/upstream/v8/src/third_party/valgrind/valgrind.h +0 -3925
  626. data/ext/v8/upstream/v8/src/token.cc +0 -63
  627. data/ext/v8/upstream/v8/src/token.h +0 -288
  628. data/ext/v8/upstream/v8/src/top.cc +0 -983
  629. data/ext/v8/upstream/v8/src/type-info.cc +0 -472
  630. data/ext/v8/upstream/v8/src/type-info.h +0 -290
  631. data/ext/v8/upstream/v8/src/unbound-queue-inl.h +0 -95
  632. data/ext/v8/upstream/v8/src/unbound-queue.h +0 -67
  633. data/ext/v8/upstream/v8/src/unicode-inl.h +0 -238
  634. data/ext/v8/upstream/v8/src/unicode.cc +0 -1624
  635. data/ext/v8/upstream/v8/src/unicode.h +0 -280
  636. data/ext/v8/upstream/v8/src/uri.js +0 -402
  637. data/ext/v8/upstream/v8/src/utils.cc +0 -371
  638. data/ext/v8/upstream/v8/src/utils.h +0 -796
  639. data/ext/v8/upstream/v8/src/v8-counters.cc +0 -62
  640. data/ext/v8/upstream/v8/src/v8-counters.h +0 -311
  641. data/ext/v8/upstream/v8/src/v8.cc +0 -215
  642. data/ext/v8/upstream/v8/src/v8.h +0 -130
  643. data/ext/v8/upstream/v8/src/v8checks.h +0 -64
  644. data/ext/v8/upstream/v8/src/v8dll-main.cc +0 -39
  645. data/ext/v8/upstream/v8/src/v8globals.h +0 -486
  646. data/ext/v8/upstream/v8/src/v8memory.h +0 -82
  647. data/ext/v8/upstream/v8/src/v8natives.js +0 -1293
  648. data/ext/v8/upstream/v8/src/v8preparserdll-main.cc +0 -39
  649. data/ext/v8/upstream/v8/src/v8threads.cc +0 -453
  650. data/ext/v8/upstream/v8/src/v8threads.h +0 -164
  651. data/ext/v8/upstream/v8/src/v8utils.h +0 -317
  652. data/ext/v8/upstream/v8/src/variables.cc +0 -132
  653. data/ext/v8/upstream/v8/src/variables.h +0 -212
  654. data/ext/v8/upstream/v8/src/version.cc +0 -116
  655. data/ext/v8/upstream/v8/src/version.h +0 -68
  656. data/ext/v8/upstream/v8/src/virtual-frame-heavy-inl.h +0 -190
  657. data/ext/v8/upstream/v8/src/virtual-frame-heavy.cc +0 -312
  658. data/ext/v8/upstream/v8/src/virtual-frame-inl.h +0 -39
  659. data/ext/v8/upstream/v8/src/virtual-frame-light-inl.h +0 -171
  660. data/ext/v8/upstream/v8/src/virtual-frame-light.cc +0 -52
  661. data/ext/v8/upstream/v8/src/virtual-frame.cc +0 -49
  662. data/ext/v8/upstream/v8/src/virtual-frame.h +0 -59
  663. data/ext/v8/upstream/v8/src/vm-state-inl.h +0 -138
  664. data/ext/v8/upstream/v8/src/vm-state.h +0 -70
  665. data/ext/v8/upstream/v8/src/win32-headers.h +0 -96
  666. data/ext/v8/upstream/v8/src/x64/assembler-x64-inl.h +0 -456
  667. data/ext/v8/upstream/v8/src/x64/assembler-x64.cc +0 -2954
  668. data/ext/v8/upstream/v8/src/x64/assembler-x64.h +0 -1630
  669. data/ext/v8/upstream/v8/src/x64/builtins-x64.cc +0 -1493
  670. data/ext/v8/upstream/v8/src/x64/code-stubs-x64.cc +0 -5132
  671. data/ext/v8/upstream/v8/src/x64/code-stubs-x64.h +0 -477
  672. data/ext/v8/upstream/v8/src/x64/codegen-x64-inl.h +0 -46
  673. data/ext/v8/upstream/v8/src/x64/codegen-x64.cc +0 -8843
  674. data/ext/v8/upstream/v8/src/x64/codegen-x64.h +0 -753
  675. data/ext/v8/upstream/v8/src/x64/cpu-x64.cc +0 -88
  676. data/ext/v8/upstream/v8/src/x64/debug-x64.cc +0 -318
  677. data/ext/v8/upstream/v8/src/x64/deoptimizer-x64.cc +0 -815
  678. data/ext/v8/upstream/v8/src/x64/disasm-x64.cc +0 -1752
  679. data/ext/v8/upstream/v8/src/x64/frames-x64.cc +0 -45
  680. data/ext/v8/upstream/v8/src/x64/frames-x64.h +0 -130
  681. data/ext/v8/upstream/v8/src/x64/full-codegen-x64.cc +0 -4339
  682. data/ext/v8/upstream/v8/src/x64/ic-x64.cc +0 -1752
  683. data/ext/v8/upstream/v8/src/x64/jump-target-x64.cc +0 -437
  684. data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.cc +0 -3970
  685. data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.h +0 -318
  686. data/ext/v8/upstream/v8/src/x64/lithium-gap-resolver-x64.cc +0 -320
  687. data/ext/v8/upstream/v8/src/x64/lithium-gap-resolver-x64.h +0 -74
  688. data/ext/v8/upstream/v8/src/x64/lithium-x64.cc +0 -2115
  689. data/ext/v8/upstream/v8/src/x64/lithium-x64.h +0 -2161
  690. data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.cc +0 -2911
  691. data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.h +0 -1984
  692. data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.cc +0 -1398
  693. data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.h +0 -282
  694. data/ext/v8/upstream/v8/src/x64/register-allocator-x64-inl.h +0 -87
  695. data/ext/v8/upstream/v8/src/x64/register-allocator-x64.cc +0 -95
  696. data/ext/v8/upstream/v8/src/x64/register-allocator-x64.h +0 -43
  697. data/ext/v8/upstream/v8/src/x64/simulator-x64.cc +0 -27
  698. data/ext/v8/upstream/v8/src/x64/simulator-x64.h +0 -71
  699. data/ext/v8/upstream/v8/src/x64/stub-cache-x64.cc +0 -3460
  700. data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.cc +0 -1296
  701. data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.h +0 -597
  702. data/ext/v8/upstream/v8/src/zone-inl.h +0 -129
  703. data/ext/v8/upstream/v8/src/zone.cc +0 -196
  704. data/ext/v8/upstream/v8/src/zone.h +0 -236
  705. data/ext/v8/upstream/v8/tools/codemap.js +0 -265
  706. data/ext/v8/upstream/v8/tools/consarray.js +0 -93
  707. data/ext/v8/upstream/v8/tools/csvparser.js +0 -78
  708. data/ext/v8/upstream/v8/tools/disasm.py +0 -92
  709. data/ext/v8/upstream/v8/tools/freebsd-tick-processor +0 -10
  710. data/ext/v8/upstream/v8/tools/gc-nvp-trace-processor.py +0 -328
  711. data/ext/v8/upstream/v8/tools/generate-ten-powers.scm +0 -286
  712. data/ext/v8/upstream/v8/tools/grokdump.py +0 -840
  713. data/ext/v8/upstream/v8/tools/gyp/v8.gyp +0 -844
  714. data/ext/v8/upstream/v8/tools/js2c.py +0 -380
  715. data/ext/v8/upstream/v8/tools/jsmin.py +0 -280
  716. data/ext/v8/upstream/v8/tools/linux-tick-processor +0 -35
  717. data/ext/v8/upstream/v8/tools/ll_prof.py +0 -919
  718. data/ext/v8/upstream/v8/tools/logreader.js +0 -185
  719. data/ext/v8/upstream/v8/tools/mac-nm +0 -18
  720. data/ext/v8/upstream/v8/tools/mac-tick-processor +0 -6
  721. data/ext/v8/upstream/v8/tools/oom_dump/README +0 -31
  722. data/ext/v8/upstream/v8/tools/oom_dump/SConstruct +0 -42
  723. data/ext/v8/upstream/v8/tools/oom_dump/oom_dump.cc +0 -288
  724. data/ext/v8/upstream/v8/tools/presubmit.py +0 -305
  725. data/ext/v8/upstream/v8/tools/process-heap-prof.py +0 -120
  726. data/ext/v8/upstream/v8/tools/profile.js +0 -751
  727. data/ext/v8/upstream/v8/tools/profile_view.js +0 -219
  728. data/ext/v8/upstream/v8/tools/run-valgrind.py +0 -77
  729. data/ext/v8/upstream/v8/tools/splaytree.js +0 -316
  730. data/ext/v8/upstream/v8/tools/stats-viewer.py +0 -468
  731. data/ext/v8/upstream/v8/tools/test.py +0 -1490
  732. data/ext/v8/upstream/v8/tools/tickprocessor-driver.js +0 -59
  733. data/ext/v8/upstream/v8/tools/tickprocessor.js +0 -877
  734. data/ext/v8/upstream/v8/tools/utils.py +0 -96
  735. data/ext/v8/upstream/v8/tools/visual_studio/README.txt +0 -70
  736. data/ext/v8/upstream/v8/tools/visual_studio/arm.vsprops +0 -14
  737. data/ext/v8/upstream/v8/tools/visual_studio/common.vsprops +0 -34
  738. data/ext/v8/upstream/v8/tools/visual_studio/d8.vcproj +0 -193
  739. data/ext/v8/upstream/v8/tools/visual_studio/d8_arm.vcproj +0 -193
  740. data/ext/v8/upstream/v8/tools/visual_studio/d8_x64.vcproj +0 -209
  741. data/ext/v8/upstream/v8/tools/visual_studio/d8js2c.cmd +0 -6
  742. data/ext/v8/upstream/v8/tools/visual_studio/debug.vsprops +0 -17
  743. data/ext/v8/upstream/v8/tools/visual_studio/ia32.vsprops +0 -17
  744. data/ext/v8/upstream/v8/tools/visual_studio/js2c.cmd +0 -6
  745. data/ext/v8/upstream/v8/tools/visual_studio/release.vsprops +0 -24
  746. data/ext/v8/upstream/v8/tools/visual_studio/v8.sln +0 -101
  747. data/ext/v8/upstream/v8/tools/visual_studio/v8.vcproj +0 -227
  748. data/ext/v8/upstream/v8/tools/visual_studio/v8_arm.sln +0 -74
  749. data/ext/v8/upstream/v8/tools/visual_studio/v8_arm.vcproj +0 -227
  750. data/ext/v8/upstream/v8/tools/visual_studio/v8_base.vcproj +0 -1308
  751. data/ext/v8/upstream/v8/tools/visual_studio/v8_base_arm.vcproj +0 -1238
  752. data/ext/v8/upstream/v8/tools/visual_studio/v8_base_x64.vcproj +0 -1300
  753. data/ext/v8/upstream/v8/tools/visual_studio/v8_cctest.vcproj +0 -265
  754. data/ext/v8/upstream/v8/tools/visual_studio/v8_cctest_arm.vcproj +0 -249
  755. data/ext/v8/upstream/v8/tools/visual_studio/v8_cctest_x64.vcproj +0 -257
  756. data/ext/v8/upstream/v8/tools/visual_studio/v8_mksnapshot.vcproj +0 -145
  757. data/ext/v8/upstream/v8/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -145
  758. data/ext/v8/upstream/v8/tools/visual_studio/v8_process_sample.vcproj +0 -145
  759. data/ext/v8/upstream/v8/tools/visual_studio/v8_process_sample_arm.vcproj +0 -145
  760. data/ext/v8/upstream/v8/tools/visual_studio/v8_process_sample_x64.vcproj +0 -161
  761. data/ext/v8/upstream/v8/tools/visual_studio/v8_shell_sample.vcproj +0 -147
  762. data/ext/v8/upstream/v8/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -147
  763. data/ext/v8/upstream/v8/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -163
  764. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot.vcproj +0 -142
  765. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot_cc.vcproj +0 -92
  766. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -92
  767. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot_x64.vcproj +0 -142
  768. data/ext/v8/upstream/v8/tools/visual_studio/v8_x64.sln +0 -101
  769. data/ext/v8/upstream/v8/tools/visual_studio/v8_x64.vcproj +0 -227
  770. data/ext/v8/upstream/v8/tools/visual_studio/x64.vsprops +0 -18
  771. data/ext/v8/upstream/v8/tools/windows-tick-processor.bat +0 -30
@@ -1,2264 +0,0 @@
1
- // Copyright 2010 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_HEAP_H_
29
- #define V8_HEAP_H_
30
-
31
- #include <math.h>
32
-
33
- #include "globals.h"
34
- #include "list.h"
35
- #include "mark-compact.h"
36
- #include "spaces.h"
37
- #include "splay-tree-inl.h"
38
- #include "v8-counters.h"
39
-
40
- namespace v8 {
41
- namespace internal {
42
-
43
- // TODO(isolates): remove HEAP here
44
- #define HEAP (_inline_get_heap_())
45
- class Heap;
46
- inline Heap* _inline_get_heap_();
47
-
48
-
49
- // Defines all the roots in Heap.
50
- #define STRONG_ROOT_LIST(V) \
51
- /* Put the byte array map early. We need it to be in place by the time */ \
52
- /* the deserializer hits the next page, since it wants to put a byte */ \
53
- /* array in the unused space at the end of the page. */ \
54
- V(Map, byte_array_map, ByteArrayMap) \
55
- V(Map, one_pointer_filler_map, OnePointerFillerMap) \
56
- V(Map, two_pointer_filler_map, TwoPointerFillerMap) \
57
- /* Cluster the most popular ones in a few cache lines here at the top. */ \
58
- V(Object, undefined_value, UndefinedValue) \
59
- V(Object, the_hole_value, TheHoleValue) \
60
- V(Object, null_value, NullValue) \
61
- V(Object, true_value, TrueValue) \
62
- V(Object, false_value, FalseValue) \
63
- V(Object, arguments_marker, ArgumentsMarker) \
64
- V(Map, heap_number_map, HeapNumberMap) \
65
- V(Map, global_context_map, GlobalContextMap) \
66
- V(Map, fixed_array_map, FixedArrayMap) \
67
- V(Map, fixed_cow_array_map, FixedCOWArrayMap) \
68
- V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \
69
- V(Map, meta_map, MetaMap) \
70
- V(Map, hash_table_map, HashTableMap) \
71
- V(Smi, stack_limit, StackLimit) \
72
- V(FixedArray, number_string_cache, NumberStringCache) \
73
- V(Object, instanceof_cache_function, InstanceofCacheFunction) \
74
- V(Object, instanceof_cache_map, InstanceofCacheMap) \
75
- V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \
76
- V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \
77
- V(Object, termination_exception, TerminationException) \
78
- V(FixedArray, empty_fixed_array, EmptyFixedArray) \
79
- V(ByteArray, empty_byte_array, EmptyByteArray) \
80
- V(String, empty_string, EmptyString) \
81
- V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \
82
- V(Map, string_map, StringMap) \
83
- V(Map, ascii_string_map, AsciiStringMap) \
84
- V(Map, symbol_map, SymbolMap) \
85
- V(Map, cons_string_map, ConsStringMap) \
86
- V(Map, cons_ascii_string_map, ConsAsciiStringMap) \
87
- V(Map, ascii_symbol_map, AsciiSymbolMap) \
88
- V(Map, cons_symbol_map, ConsSymbolMap) \
89
- V(Map, cons_ascii_symbol_map, ConsAsciiSymbolMap) \
90
- V(Map, external_symbol_map, ExternalSymbolMap) \
91
- V(Map, external_symbol_with_ascii_data_map, ExternalSymbolWithAsciiDataMap) \
92
- V(Map, external_ascii_symbol_map, ExternalAsciiSymbolMap) \
93
- V(Map, external_string_map, ExternalStringMap) \
94
- V(Map, external_string_with_ascii_data_map, ExternalStringWithAsciiDataMap) \
95
- V(Map, external_ascii_string_map, ExternalAsciiStringMap) \
96
- V(Map, undetectable_string_map, UndetectableStringMap) \
97
- V(Map, undetectable_ascii_string_map, UndetectableAsciiStringMap) \
98
- V(Map, external_pixel_array_map, ExternalPixelArrayMap) \
99
- V(Map, external_byte_array_map, ExternalByteArrayMap) \
100
- V(Map, external_unsigned_byte_array_map, ExternalUnsignedByteArrayMap) \
101
- V(Map, external_short_array_map, ExternalShortArrayMap) \
102
- V(Map, external_unsigned_short_array_map, ExternalUnsignedShortArrayMap) \
103
- V(Map, external_int_array_map, ExternalIntArrayMap) \
104
- V(Map, external_unsigned_int_array_map, ExternalUnsignedIntArrayMap) \
105
- V(Map, external_float_array_map, ExternalFloatArrayMap) \
106
- V(Map, context_map, ContextMap) \
107
- V(Map, catch_context_map, CatchContextMap) \
108
- V(Map, code_map, CodeMap) \
109
- V(Map, oddball_map, OddballMap) \
110
- V(Map, global_property_cell_map, GlobalPropertyCellMap) \
111
- V(Map, shared_function_info_map, SharedFunctionInfoMap) \
112
- V(Map, message_object_map, JSMessageObjectMap) \
113
- V(Map, proxy_map, ProxyMap) \
114
- V(Object, nan_value, NanValue) \
115
- V(Object, minus_zero_value, MinusZeroValue) \
116
- V(Map, neander_map, NeanderMap) \
117
- V(JSObject, message_listeners, MessageListeners) \
118
- V(Proxy, prototype_accessors, PrototypeAccessors) \
119
- V(NumberDictionary, code_stubs, CodeStubs) \
120
- V(NumberDictionary, non_monomorphic_cache, NonMonomorphicCache) \
121
- V(Code, js_entry_code, JsEntryCode) \
122
- V(Code, js_construct_entry_code, JsConstructEntryCode) \
123
- V(FixedArray, natives_source_cache, NativesSourceCache) \
124
- V(Object, last_script_id, LastScriptId) \
125
- V(Script, empty_script, EmptyScript) \
126
- V(Smi, real_stack_limit, RealStackLimit) \
127
- V(StringDictionary, intrinsic_function_names, IntrinsicFunctionNames) \
128
-
129
- #define ROOT_LIST(V) \
130
- STRONG_ROOT_LIST(V) \
131
- V(SymbolTable, symbol_table, SymbolTable)
132
-
133
- #define SYMBOL_LIST(V) \
134
- V(Array_symbol, "Array") \
135
- V(Object_symbol, "Object") \
136
- V(Proto_symbol, "__proto__") \
137
- V(StringImpl_symbol, "StringImpl") \
138
- V(arguments_symbol, "arguments") \
139
- V(Arguments_symbol, "Arguments") \
140
- V(arguments_shadow_symbol, ".arguments") \
141
- V(call_symbol, "call") \
142
- V(apply_symbol, "apply") \
143
- V(caller_symbol, "caller") \
144
- V(boolean_symbol, "boolean") \
145
- V(Boolean_symbol, "Boolean") \
146
- V(callee_symbol, "callee") \
147
- V(constructor_symbol, "constructor") \
148
- V(code_symbol, ".code") \
149
- V(result_symbol, ".result") \
150
- V(catch_var_symbol, ".catch-var") \
151
- V(empty_symbol, "") \
152
- V(eval_symbol, "eval") \
153
- V(function_symbol, "function") \
154
- V(length_symbol, "length") \
155
- V(name_symbol, "name") \
156
- V(number_symbol, "number") \
157
- V(Number_symbol, "Number") \
158
- V(nan_symbol, "NaN") \
159
- V(RegExp_symbol, "RegExp") \
160
- V(source_symbol, "source") \
161
- V(global_symbol, "global") \
162
- V(ignore_case_symbol, "ignoreCase") \
163
- V(multiline_symbol, "multiline") \
164
- V(input_symbol, "input") \
165
- V(index_symbol, "index") \
166
- V(last_index_symbol, "lastIndex") \
167
- V(object_symbol, "object") \
168
- V(prototype_symbol, "prototype") \
169
- V(string_symbol, "string") \
170
- V(String_symbol, "String") \
171
- V(Date_symbol, "Date") \
172
- V(this_symbol, "this") \
173
- V(to_string_symbol, "toString") \
174
- V(char_at_symbol, "CharAt") \
175
- V(undefined_symbol, "undefined") \
176
- V(value_of_symbol, "valueOf") \
177
- V(InitializeVarGlobal_symbol, "InitializeVarGlobal") \
178
- V(InitializeConstGlobal_symbol, "InitializeConstGlobal") \
179
- V(KeyedLoadSpecialized_symbol, "KeyedLoadSpecialized") \
180
- V(KeyedStoreSpecialized_symbol, "KeyedStoreSpecialized") \
181
- V(stack_overflow_symbol, "kStackOverflowBoilerplate") \
182
- V(illegal_access_symbol, "illegal access") \
183
- V(out_of_memory_symbol, "out-of-memory") \
184
- V(illegal_execution_state_symbol, "illegal execution state") \
185
- V(get_symbol, "get") \
186
- V(set_symbol, "set") \
187
- V(function_class_symbol, "Function") \
188
- V(illegal_argument_symbol, "illegal argument") \
189
- V(MakeReferenceError_symbol, "MakeReferenceError") \
190
- V(MakeSyntaxError_symbol, "MakeSyntaxError") \
191
- V(MakeTypeError_symbol, "MakeTypeError") \
192
- V(invalid_lhs_in_assignment_symbol, "invalid_lhs_in_assignment") \
193
- V(invalid_lhs_in_for_in_symbol, "invalid_lhs_in_for_in") \
194
- V(invalid_lhs_in_postfix_op_symbol, "invalid_lhs_in_postfix_op") \
195
- V(invalid_lhs_in_prefix_op_symbol, "invalid_lhs_in_prefix_op") \
196
- V(illegal_return_symbol, "illegal_return") \
197
- V(illegal_break_symbol, "illegal_break") \
198
- V(illegal_continue_symbol, "illegal_continue") \
199
- V(unknown_label_symbol, "unknown_label") \
200
- V(redeclaration_symbol, "redeclaration") \
201
- V(failure_symbol, "<failure>") \
202
- V(space_symbol, " ") \
203
- V(exec_symbol, "exec") \
204
- V(zero_symbol, "0") \
205
- V(global_eval_symbol, "GlobalEval") \
206
- V(identity_hash_symbol, "v8::IdentityHash") \
207
- V(closure_symbol, "(closure)") \
208
- V(use_strict, "use strict") \
209
- V(KeyedLoadExternalByteArray_symbol, "KeyedLoadExternalByteArray") \
210
- V(KeyedLoadExternalUnsignedByteArray_symbol, \
211
- "KeyedLoadExternalUnsignedByteArray") \
212
- V(KeyedLoadExternalShortArray_symbol, \
213
- "KeyedLoadExternalShortArray") \
214
- V(KeyedLoadExternalUnsignedShortArray_symbol, \
215
- "KeyedLoadExternalUnsignedShortArray") \
216
- V(KeyedLoadExternalIntArray_symbol, "KeyedLoadExternalIntArray") \
217
- V(KeyedLoadExternalUnsignedIntArray_symbol, \
218
- "KeyedLoadExternalUnsignedIntArray") \
219
- V(KeyedLoadExternalFloatArray_symbol, "KeyedLoadExternalFloatArray") \
220
- V(KeyedLoadExternalPixelArray_symbol, "KeyedLoadExternalPixelArray") \
221
- V(KeyedStoreExternalByteArray_symbol, "KeyedStoreExternalByteArray") \
222
- V(KeyedStoreExternalUnsignedByteArray_symbol, \
223
- "KeyedStoreExternalUnsignedByteArray") \
224
- V(KeyedStoreExternalShortArray_symbol, "KeyedStoreExternalShortArray") \
225
- V(KeyedStoreExternalUnsignedShortArray_symbol, \
226
- "KeyedStoreExternalUnsignedShortArray") \
227
- V(KeyedStoreExternalIntArray_symbol, "KeyedStoreExternalIntArray") \
228
- V(KeyedStoreExternalUnsignedIntArray_symbol, \
229
- "KeyedStoreExternalUnsignedIntArray") \
230
- V(KeyedStoreExternalFloatArray_symbol, "KeyedStoreExternalFloatArray") \
231
- V(KeyedStoreExternalPixelArray_symbol, "KeyedStoreExternalPixelArray")
232
-
233
- // Forward declarations.
234
- class GCTracer;
235
- class HeapStats;
236
- class Isolate;
237
- class WeakObjectRetainer;
238
-
239
-
240
- typedef String* (*ExternalStringTableUpdaterCallback)(Heap* heap,
241
- Object** pointer);
242
-
243
- typedef bool (*DirtyRegionCallback)(Heap* heap,
244
- Address start,
245
- Address end,
246
- ObjectSlotCallback copy_object_func);
247
-
248
-
249
- // The all static Heap captures the interface to the global object heap.
250
- // All JavaScript contexts by this process share the same object heap.
251
-
252
- #ifdef DEBUG
253
- class HeapDebugUtils;
254
- #endif
255
-
256
-
257
- // A queue of objects promoted during scavenge. Each object is accompanied
258
- // by it's size to avoid dereferencing a map pointer for scanning.
259
- class PromotionQueue {
260
- public:
261
- PromotionQueue() : front_(NULL), rear_(NULL) { }
262
-
263
- void Initialize(Address start_address) {
264
- front_ = rear_ = reinterpret_cast<intptr_t*>(start_address);
265
- }
266
-
267
- bool is_empty() { return front_ <= rear_; }
268
-
269
- inline void insert(HeapObject* target, int size);
270
-
271
- void remove(HeapObject** target, int* size) {
272
- *target = reinterpret_cast<HeapObject*>(*(--front_));
273
- *size = static_cast<int>(*(--front_));
274
- // Assert no underflow.
275
- ASSERT(front_ >= rear_);
276
- }
277
-
278
- private:
279
- // The front of the queue is higher in memory than the rear.
280
- intptr_t* front_;
281
- intptr_t* rear_;
282
-
283
- DISALLOW_COPY_AND_ASSIGN(PromotionQueue);
284
- };
285
-
286
-
287
- // External strings table is a place where all external strings are
288
- // registered. We need to keep track of such strings to properly
289
- // finalize them.
290
- class ExternalStringTable {
291
- public:
292
- // Registers an external string.
293
- inline void AddString(String* string);
294
-
295
- inline void Iterate(ObjectVisitor* v);
296
-
297
- // Restores internal invariant and gets rid of collected strings.
298
- // Must be called after each Iterate() that modified the strings.
299
- void CleanUp();
300
-
301
- // Destroys all allocated memory.
302
- void TearDown();
303
-
304
- private:
305
- ExternalStringTable() { }
306
-
307
- friend class Heap;
308
-
309
- inline void Verify();
310
-
311
- inline void AddOldString(String* string);
312
-
313
- // Notifies the table that only a prefix of the new list is valid.
314
- inline void ShrinkNewStrings(int position);
315
-
316
- // To speed up scavenge collections new space string are kept
317
- // separate from old space strings.
318
- List<Object*> new_space_strings_;
319
- List<Object*> old_space_strings_;
320
-
321
- Heap* heap_;
322
-
323
- DISALLOW_COPY_AND_ASSIGN(ExternalStringTable);
324
- };
325
-
326
-
327
- class Heap {
328
- public:
329
- // Configure heap size before setup. Return false if the heap has been
330
- // setup already.
331
- bool ConfigureHeap(int max_semispace_size,
332
- int max_old_gen_size,
333
- int max_executable_size);
334
- bool ConfigureHeapDefault();
335
-
336
- // Initializes the global object heap. If create_heap_objects is true,
337
- // also creates the basic non-mutable objects.
338
- // Returns whether it succeeded.
339
- bool Setup(bool create_heap_objects);
340
-
341
- // Destroys all memory allocated by the heap.
342
- void TearDown();
343
-
344
- // Set the stack limit in the roots_ array. Some architectures generate
345
- // code that looks here, because it is faster than loading from the static
346
- // jslimit_/real_jslimit_ variable in the StackGuard.
347
- void SetStackLimits();
348
-
349
- // Returns whether Setup has been called.
350
- bool HasBeenSetup();
351
-
352
- // Returns the maximum amount of memory reserved for the heap. For
353
- // the young generation, we reserve 4 times the amount needed for a
354
- // semi space. The young generation consists of two semi spaces and
355
- // we reserve twice the amount needed for those in order to ensure
356
- // that new space can be aligned to its size.
357
- intptr_t MaxReserved() {
358
- return 4 * reserved_semispace_size_ + max_old_generation_size_;
359
- }
360
- int MaxSemiSpaceSize() { return max_semispace_size_; }
361
- int ReservedSemiSpaceSize() { return reserved_semispace_size_; }
362
- int InitialSemiSpaceSize() { return initial_semispace_size_; }
363
- intptr_t MaxOldGenerationSize() { return max_old_generation_size_; }
364
- intptr_t MaxExecutableSize() { return max_executable_size_; }
365
-
366
- // Returns the capacity of the heap in bytes w/o growing. Heap grows when
367
- // more spaces are needed until it reaches the limit.
368
- intptr_t Capacity();
369
-
370
- // Returns the amount of memory currently committed for the heap.
371
- intptr_t CommittedMemory();
372
-
373
- // Returns the amount of executable memory currently committed for the heap.
374
- intptr_t CommittedMemoryExecutable();
375
-
376
- // Returns the available bytes in space w/o growing.
377
- // Heap doesn't guarantee that it can allocate an object that requires
378
- // all available bytes. Check MaxHeapObjectSize() instead.
379
- intptr_t Available();
380
-
381
- // Returns the maximum object size in paged space.
382
- inline int MaxObjectSizeInPagedSpace();
383
-
384
- // Returns of size of all objects residing in the heap.
385
- intptr_t SizeOfObjects();
386
-
387
- // Return the starting address and a mask for the new space. And-masking an
388
- // address with the mask will result in the start address of the new space
389
- // for all addresses in either semispace.
390
- Address NewSpaceStart() { return new_space_.start(); }
391
- uintptr_t NewSpaceMask() { return new_space_.mask(); }
392
- Address NewSpaceTop() { return new_space_.top(); }
393
-
394
- NewSpace* new_space() { return &new_space_; }
395
- OldSpace* old_pointer_space() { return old_pointer_space_; }
396
- OldSpace* old_data_space() { return old_data_space_; }
397
- OldSpace* code_space() { return code_space_; }
398
- MapSpace* map_space() { return map_space_; }
399
- CellSpace* cell_space() { return cell_space_; }
400
- LargeObjectSpace* lo_space() { return lo_space_; }
401
-
402
- bool always_allocate() { return always_allocate_scope_depth_ != 0; }
403
- Address always_allocate_scope_depth_address() {
404
- return reinterpret_cast<Address>(&always_allocate_scope_depth_);
405
- }
406
- bool linear_allocation() {
407
- return linear_allocation_scope_depth_ != 0;
408
- }
409
-
410
- Address* NewSpaceAllocationTopAddress() {
411
- return new_space_.allocation_top_address();
412
- }
413
- Address* NewSpaceAllocationLimitAddress() {
414
- return new_space_.allocation_limit_address();
415
- }
416
-
417
- // Uncommit unused semi space.
418
- bool UncommitFromSpace() { return new_space_.UncommitFromSpace(); }
419
-
420
- #ifdef ENABLE_HEAP_PROTECTION
421
- // Protect/unprotect the heap by marking all spaces read-only/writable.
422
- void Protect();
423
- void Unprotect();
424
- #endif
425
-
426
- // Allocates and initializes a new JavaScript object based on a
427
- // constructor.
428
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
429
- // failed.
430
- // Please note this does not perform a garbage collection.
431
- MUST_USE_RESULT MaybeObject* AllocateJSObject(
432
- JSFunction* constructor, PretenureFlag pretenure = NOT_TENURED);
433
-
434
- // Allocates and initializes a new global object based on a constructor.
435
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
436
- // failed.
437
- // Please note this does not perform a garbage collection.
438
- MUST_USE_RESULT MaybeObject* AllocateGlobalObject(JSFunction* constructor);
439
-
440
- // Returns a deep copy of the JavaScript object.
441
- // Properties and elements are copied too.
442
- // Returns failure if allocation failed.
443
- MUST_USE_RESULT MaybeObject* CopyJSObject(JSObject* source);
444
-
445
- // Allocates the function prototype.
446
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
447
- // failed.
448
- // Please note this does not perform a garbage collection.
449
- MUST_USE_RESULT MaybeObject* AllocateFunctionPrototype(JSFunction* function);
450
-
451
- // Reinitialize an JSGlobalProxy based on a constructor. The object
452
- // must have the same size as objects allocated using the
453
- // constructor. The object is reinitialized and behaves as an
454
- // object that has been freshly allocated using the constructor.
455
- MUST_USE_RESULT MaybeObject* ReinitializeJSGlobalProxy(
456
- JSFunction* constructor, JSGlobalProxy* global);
457
-
458
- // Allocates and initializes a new JavaScript object based on a map.
459
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
460
- // failed.
461
- // Please note this does not perform a garbage collection.
462
- MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMap(
463
- Map* map, PretenureFlag pretenure = NOT_TENURED);
464
-
465
- // Allocates a heap object based on the map.
466
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
467
- // failed.
468
- // Please note this function does not perform a garbage collection.
469
- MUST_USE_RESULT MaybeObject* Allocate(Map* map, AllocationSpace space);
470
-
471
- // Allocates a JS Map in the heap.
472
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
473
- // failed.
474
- // Please note this function does not perform a garbage collection.
475
- MUST_USE_RESULT MaybeObject* AllocateMap(InstanceType instance_type,
476
- int instance_size);
477
-
478
- // Allocates a partial map for bootstrapping.
479
- MUST_USE_RESULT MaybeObject* AllocatePartialMap(InstanceType instance_type,
480
- int instance_size);
481
-
482
- // Allocate a map for the specified function
483
- MUST_USE_RESULT MaybeObject* AllocateInitialMap(JSFunction* fun);
484
-
485
- // Allocates an empty code cache.
486
- MUST_USE_RESULT MaybeObject* AllocateCodeCache();
487
-
488
- // Clear the Instanceof cache (used when a prototype changes).
489
- inline void ClearInstanceofCache();
490
-
491
- // Allocates and fully initializes a String. There are two String
492
- // encodings: ASCII and two byte. One should choose between the three string
493
- // allocation functions based on the encoding of the string buffer used to
494
- // initialized the string.
495
- // - ...FromAscii initializes the string from a buffer that is ASCII
496
- // encoded (it does not check that the buffer is ASCII encoded) and the
497
- // result will be ASCII encoded.
498
- // - ...FromUTF8 initializes the string from a buffer that is UTF-8
499
- // encoded. If the characters are all single-byte characters, the
500
- // result will be ASCII encoded, otherwise it will converted to two
501
- // byte.
502
- // - ...FromTwoByte initializes the string from a buffer that is two-byte
503
- // encoded. If the characters are all single-byte characters, the
504
- // result will be converted to ASCII, otherwise it will be left as
505
- // two-byte.
506
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
507
- // failed.
508
- // Please note this does not perform a garbage collection.
509
- MUST_USE_RESULT MaybeObject* AllocateStringFromAscii(
510
- Vector<const char> str,
511
- PretenureFlag pretenure = NOT_TENURED);
512
- MUST_USE_RESULT inline MaybeObject* AllocateStringFromUtf8(
513
- Vector<const char> str,
514
- PretenureFlag pretenure = NOT_TENURED);
515
- MUST_USE_RESULT MaybeObject* AllocateStringFromUtf8Slow(
516
- Vector<const char> str,
517
- PretenureFlag pretenure = NOT_TENURED);
518
- MUST_USE_RESULT MaybeObject* AllocateStringFromTwoByte(
519
- Vector<const uc16> str,
520
- PretenureFlag pretenure = NOT_TENURED);
521
-
522
- // Allocates a symbol in old space based on the character stream.
523
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
524
- // failed.
525
- // Please note this function does not perform a garbage collection.
526
- MUST_USE_RESULT inline MaybeObject* AllocateSymbol(Vector<const char> str,
527
- int chars,
528
- uint32_t hash_field);
529
-
530
- MUST_USE_RESULT inline MaybeObject* AllocateAsciiSymbol(
531
- Vector<const char> str,
532
- uint32_t hash_field);
533
-
534
- MUST_USE_RESULT inline MaybeObject* AllocateTwoByteSymbol(
535
- Vector<const uc16> str,
536
- uint32_t hash_field);
537
-
538
- MUST_USE_RESULT MaybeObject* AllocateInternalSymbol(
539
- unibrow::CharacterStream* buffer, int chars, uint32_t hash_field);
540
-
541
- MUST_USE_RESULT MaybeObject* AllocateExternalSymbol(
542
- Vector<const char> str,
543
- int chars);
544
-
545
- // Allocates and partially initializes a String. There are two String
546
- // encodings: ASCII and two byte. These functions allocate a string of the
547
- // given length and set its map and length fields. The characters of the
548
- // string are uninitialized.
549
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
550
- // failed.
551
- // Please note this does not perform a garbage collection.
552
- MUST_USE_RESULT MaybeObject* AllocateRawAsciiString(
553
- int length,
554
- PretenureFlag pretenure = NOT_TENURED);
555
- MUST_USE_RESULT MaybeObject* AllocateRawTwoByteString(
556
- int length,
557
- PretenureFlag pretenure = NOT_TENURED);
558
-
559
- // Computes a single character string where the character has code.
560
- // A cache is used for ascii codes.
561
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
562
- // failed. Please note this does not perform a garbage collection.
563
- MUST_USE_RESULT MaybeObject* LookupSingleCharacterStringFromCode(
564
- uint16_t code);
565
-
566
- // Allocate a byte array of the specified length
567
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
568
- // failed.
569
- // Please note this does not perform a garbage collection.
570
- MUST_USE_RESULT MaybeObject* AllocateByteArray(int length,
571
- PretenureFlag pretenure);
572
-
573
- // Allocate a non-tenured byte array of the specified length
574
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
575
- // failed.
576
- // Please note this does not perform a garbage collection.
577
- MUST_USE_RESULT MaybeObject* AllocateByteArray(int length);
578
-
579
- // Allocates an external array of the specified length and type.
580
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
581
- // failed.
582
- // Please note this does not perform a garbage collection.
583
- MUST_USE_RESULT MaybeObject* AllocateExternalArray(
584
- int length,
585
- ExternalArrayType array_type,
586
- void* external_pointer,
587
- PretenureFlag pretenure);
588
-
589
- // Allocate a tenured JS global property cell.
590
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
591
- // failed.
592
- // Please note this does not perform a garbage collection.
593
- MUST_USE_RESULT MaybeObject* AllocateJSGlobalPropertyCell(Object* value);
594
-
595
- // Allocates a fixed array initialized with undefined values
596
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
597
- // failed.
598
- // Please note this does not perform a garbage collection.
599
- MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length,
600
- PretenureFlag pretenure);
601
- // Allocates a fixed array initialized with undefined values
602
- MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length);
603
-
604
- // Allocates an uninitialized fixed array. It must be filled by the caller.
605
- //
606
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
607
- // failed.
608
- // Please note this does not perform a garbage collection.
609
- MUST_USE_RESULT MaybeObject* AllocateUninitializedFixedArray(int length);
610
-
611
- // Make a copy of src and return it. Returns
612
- // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed.
613
- MUST_USE_RESULT inline MaybeObject* CopyFixedArray(FixedArray* src);
614
-
615
- // Make a copy of src, set the map, and return the copy. Returns
616
- // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed.
617
- MUST_USE_RESULT MaybeObject* CopyFixedArrayWithMap(FixedArray* src, Map* map);
618
-
619
- // Allocates a fixed array initialized with the hole values.
620
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
621
- // failed.
622
- // Please note this does not perform a garbage collection.
623
- MUST_USE_RESULT MaybeObject* AllocateFixedArrayWithHoles(
624
- int length,
625
- PretenureFlag pretenure = NOT_TENURED);
626
-
627
- // AllocateHashTable is identical to AllocateFixedArray except
628
- // that the resulting object has hash_table_map as map.
629
- MUST_USE_RESULT MaybeObject* AllocateHashTable(
630
- int length, PretenureFlag pretenure = NOT_TENURED);
631
-
632
- // Allocate a global (but otherwise uninitialized) context.
633
- MUST_USE_RESULT MaybeObject* AllocateGlobalContext();
634
-
635
- // Allocate a function context.
636
- MUST_USE_RESULT MaybeObject* AllocateFunctionContext(int length,
637
- JSFunction* closure);
638
-
639
- // Allocate a 'with' context.
640
- MUST_USE_RESULT MaybeObject* AllocateWithContext(Context* previous,
641
- JSObject* extension,
642
- bool is_catch_context);
643
-
644
- // Allocates a new utility object in the old generation.
645
- MUST_USE_RESULT MaybeObject* AllocateStruct(InstanceType type);
646
-
647
- // Allocates a function initialized with a shared part.
648
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
649
- // failed.
650
- // Please note this does not perform a garbage collection.
651
- MUST_USE_RESULT MaybeObject* AllocateFunction(
652
- Map* function_map,
653
- SharedFunctionInfo* shared,
654
- Object* prototype,
655
- PretenureFlag pretenure = TENURED);
656
-
657
- // Arguments object size.
658
- static const int kArgumentsObjectSize =
659
- JSObject::kHeaderSize + 2 * kPointerSize;
660
- // Strict mode arguments has no callee so it is smaller.
661
- static const int kArgumentsObjectSizeStrict =
662
- JSObject::kHeaderSize + 1 * kPointerSize;
663
- // Indicies for direct access into argument objects.
664
- static const int kArgumentsLengthIndex = 0;
665
- // callee is only valid in non-strict mode.
666
- static const int kArgumentsCalleeIndex = 1;
667
-
668
- // Allocates an arguments object - optionally with an elements array.
669
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
670
- // failed.
671
- // Please note this does not perform a garbage collection.
672
- MUST_USE_RESULT MaybeObject* AllocateArgumentsObject(
673
- Object* callee, int length);
674
-
675
- // Same as NewNumberFromDouble, but may return a preallocated/immutable
676
- // number object (e.g., minus_zero_value_, nan_value_)
677
- MUST_USE_RESULT MaybeObject* NumberFromDouble(
678
- double value, PretenureFlag pretenure = NOT_TENURED);
679
-
680
- // Allocated a HeapNumber from value.
681
- MUST_USE_RESULT MaybeObject* AllocateHeapNumber(
682
- double value,
683
- PretenureFlag pretenure);
684
- // pretenure = NOT_TENURED
685
- MUST_USE_RESULT MaybeObject* AllocateHeapNumber(double value);
686
-
687
- // Converts an int into either a Smi or a HeapNumber object.
688
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
689
- // failed.
690
- // Please note this does not perform a garbage collection.
691
- MUST_USE_RESULT inline MaybeObject* NumberFromInt32(int32_t value);
692
-
693
- // Converts an int into either a Smi or a HeapNumber object.
694
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
695
- // failed.
696
- // Please note this does not perform a garbage collection.
697
- MUST_USE_RESULT inline MaybeObject* NumberFromUint32(uint32_t value);
698
-
699
- // Allocates a new proxy object.
700
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
701
- // failed.
702
- // Please note this does not perform a garbage collection.
703
- MUST_USE_RESULT MaybeObject* AllocateProxy(
704
- Address proxy, PretenureFlag pretenure = NOT_TENURED);
705
-
706
- // Allocates a new SharedFunctionInfo object.
707
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
708
- // failed.
709
- // Please note this does not perform a garbage collection.
710
- MUST_USE_RESULT MaybeObject* AllocateSharedFunctionInfo(Object* name);
711
-
712
- // Allocates a new JSMessageObject object.
713
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
714
- // failed.
715
- // Please note that this does not perform a garbage collection.
716
- MUST_USE_RESULT MaybeObject* AllocateJSMessageObject(
717
- String* type,
718
- JSArray* arguments,
719
- int start_position,
720
- int end_position,
721
- Object* script,
722
- Object* stack_trace,
723
- Object* stack_frames);
724
-
725
- // Allocates a new cons string object.
726
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
727
- // failed.
728
- // Please note this does not perform a garbage collection.
729
- MUST_USE_RESULT MaybeObject* AllocateConsString(String* first,
730
- String* second);
731
-
732
- // Allocates a new sub string object which is a substring of an underlying
733
- // string buffer stretching from the index start (inclusive) to the index
734
- // end (exclusive).
735
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
736
- // failed.
737
- // Please note this does not perform a garbage collection.
738
- MUST_USE_RESULT MaybeObject* AllocateSubString(
739
- String* buffer,
740
- int start,
741
- int end,
742
- PretenureFlag pretenure = NOT_TENURED);
743
-
744
- // Allocate a new external string object, which is backed by a string
745
- // resource that resides outside the V8 heap.
746
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
747
- // failed.
748
- // Please note this does not perform a garbage collection.
749
- MUST_USE_RESULT MaybeObject* AllocateExternalStringFromAscii(
750
- ExternalAsciiString::Resource* resource);
751
- MUST_USE_RESULT MaybeObject* AllocateExternalStringFromTwoByte(
752
- ExternalTwoByteString::Resource* resource);
753
-
754
- // Finalizes an external string by deleting the associated external
755
- // data and clearing the resource pointer.
756
- inline void FinalizeExternalString(String* string);
757
-
758
- // Allocates an uninitialized object. The memory is non-executable if the
759
- // hardware and OS allow.
760
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
761
- // failed.
762
- // Please note this function does not perform a garbage collection.
763
- MUST_USE_RESULT inline MaybeObject* AllocateRaw(int size_in_bytes,
764
- AllocationSpace space,
765
- AllocationSpace retry_space);
766
-
767
- // Initialize a filler object to keep the ability to iterate over the heap
768
- // when shortening objects.
769
- void CreateFillerObjectAt(Address addr, int size);
770
-
771
- // Makes a new native code object
772
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
773
- // failed. On success, the pointer to the Code object is stored in the
774
- // self_reference. This allows generated code to reference its own Code
775
- // object by containing this pointer.
776
- // Please note this function does not perform a garbage collection.
777
- MUST_USE_RESULT MaybeObject* CreateCode(const CodeDesc& desc,
778
- Code::Flags flags,
779
- Handle<Object> self_reference,
780
- bool immovable = false);
781
-
782
- MUST_USE_RESULT MaybeObject* CopyCode(Code* code);
783
-
784
- // Copy the code and scope info part of the code object, but insert
785
- // the provided data as the relocation information.
786
- MUST_USE_RESULT MaybeObject* CopyCode(Code* code, Vector<byte> reloc_info);
787
-
788
- // Finds the symbol for string in the symbol table.
789
- // If not found, a new symbol is added to the table and returned.
790
- // Returns Failure::RetryAfterGC(requested_bytes, space) if allocation
791
- // failed.
792
- // Please note this function does not perform a garbage collection.
793
- MUST_USE_RESULT MaybeObject* LookupSymbol(Vector<const char> str);
794
- MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(Vector<const char> str);
795
- MUST_USE_RESULT MaybeObject* LookupTwoByteSymbol(
796
- Vector<const uc16> str);
797
- MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(const char* str) {
798
- return LookupSymbol(CStrVector(str));
799
- }
800
- MUST_USE_RESULT MaybeObject* LookupSymbol(String* str);
801
- bool LookupSymbolIfExists(String* str, String** symbol);
802
- bool LookupTwoCharsSymbolIfExists(String* str, String** symbol);
803
-
804
- // Compute the matching symbol map for a string if possible.
805
- // NULL is returned if string is in new space or not flattened.
806
- Map* SymbolMapForString(String* str);
807
-
808
- // Tries to flatten a string before compare operation.
809
- //
810
- // Returns a failure in case it was decided that flattening was
811
- // necessary and failed. Note, if flattening is not necessary the
812
- // string might stay non-flat even when not a failure is returned.
813
- //
814
- // Please note this function does not perform a garbage collection.
815
- MUST_USE_RESULT inline MaybeObject* PrepareForCompare(String* str);
816
-
817
- // Converts the given boolean condition to JavaScript boolean value.
818
- inline Object* ToBoolean(bool condition);
819
-
820
- // Code that should be run before and after each GC. Includes some
821
- // reporting/verification activities when compiled with DEBUG set.
822
- void GarbageCollectionPrologue();
823
- void GarbageCollectionEpilogue();
824
-
825
- // Performs garbage collection operation.
826
- // Returns whether there is a chance that another major GC could
827
- // collect more garbage.
828
- bool CollectGarbage(AllocationSpace space, GarbageCollector collector);
829
-
830
- // Performs garbage collection operation.
831
- // Returns whether there is a chance that another major GC could
832
- // collect more garbage.
833
- inline bool CollectGarbage(AllocationSpace space);
834
-
835
- // Performs a full garbage collection. Force compaction if the
836
- // parameter is true.
837
- void CollectAllGarbage(bool force_compaction);
838
-
839
- // Last hope GC, should try to squeeze as much as possible.
840
- void CollectAllAvailableGarbage();
841
-
842
- // Notify the heap that a context has been disposed.
843
- int NotifyContextDisposed() { return ++contexts_disposed_; }
844
-
845
- // Utility to invoke the scavenger. This is needed in test code to
846
- // ensure correct callback for weak global handles.
847
- void PerformScavenge();
848
-
849
- PromotionQueue* promotion_queue() { return &promotion_queue_; }
850
-
851
- #ifdef DEBUG
852
- // Utility used with flag gc-greedy.
853
- void GarbageCollectionGreedyCheck();
854
- #endif
855
-
856
- void AddGCPrologueCallback(
857
- GCEpilogueCallback callback, GCType gc_type_filter);
858
- void RemoveGCPrologueCallback(GCEpilogueCallback callback);
859
-
860
- void AddGCEpilogueCallback(
861
- GCEpilogueCallback callback, GCType gc_type_filter);
862
- void RemoveGCEpilogueCallback(GCEpilogueCallback callback);
863
-
864
- void SetGlobalGCPrologueCallback(GCCallback callback) {
865
- ASSERT((callback == NULL) ^ (global_gc_prologue_callback_ == NULL));
866
- global_gc_prologue_callback_ = callback;
867
- }
868
- void SetGlobalGCEpilogueCallback(GCCallback callback) {
869
- ASSERT((callback == NULL) ^ (global_gc_epilogue_callback_ == NULL));
870
- global_gc_epilogue_callback_ = callback;
871
- }
872
-
873
- // Heap root getters. We have versions with and without type::cast() here.
874
- // You can't use type::cast during GC because the assert fails.
875
- #define ROOT_ACCESSOR(type, name, camel_name) \
876
- type* name() { \
877
- return type::cast(roots_[k##camel_name##RootIndex]); \
878
- } \
879
- type* raw_unchecked_##name() { \
880
- return reinterpret_cast<type*>(roots_[k##camel_name##RootIndex]); \
881
- }
882
- ROOT_LIST(ROOT_ACCESSOR)
883
- #undef ROOT_ACCESSOR
884
-
885
- // Utility type maps
886
- #define STRUCT_MAP_ACCESSOR(NAME, Name, name) \
887
- Map* name##_map() { \
888
- return Map::cast(roots_[k##Name##MapRootIndex]); \
889
- }
890
- STRUCT_LIST(STRUCT_MAP_ACCESSOR)
891
- #undef STRUCT_MAP_ACCESSOR
892
-
893
- #define SYMBOL_ACCESSOR(name, str) String* name() { \
894
- return String::cast(roots_[k##name##RootIndex]); \
895
- }
896
- SYMBOL_LIST(SYMBOL_ACCESSOR)
897
- #undef SYMBOL_ACCESSOR
898
-
899
- // The hidden_symbol is special because it is the empty string, but does
900
- // not match the empty string.
901
- String* hidden_symbol() { return hidden_symbol_; }
902
-
903
- void set_global_contexts_list(Object* object) {
904
- global_contexts_list_ = object;
905
- }
906
- Object* global_contexts_list() { return global_contexts_list_; }
907
-
908
- // Iterates over all roots in the heap.
909
- void IterateRoots(ObjectVisitor* v, VisitMode mode);
910
- // Iterates over all strong roots in the heap.
911
- void IterateStrongRoots(ObjectVisitor* v, VisitMode mode);
912
- // Iterates over all the other roots in the heap.
913
- void IterateWeakRoots(ObjectVisitor* v, VisitMode mode);
914
-
915
- enum ExpectedPageWatermarkState {
916
- WATERMARK_SHOULD_BE_VALID,
917
- WATERMARK_CAN_BE_INVALID
918
- };
919
-
920
- // For each dirty region on a page in use from an old space call
921
- // visit_dirty_region callback.
922
- // If either visit_dirty_region or callback can cause an allocation
923
- // in old space and changes in allocation watermark then
924
- // can_preallocate_during_iteration should be set to true.
925
- // All pages will be marked as having invalid watermark upon
926
- // iteration completion.
927
- void IterateDirtyRegions(
928
- PagedSpace* space,
929
- DirtyRegionCallback visit_dirty_region,
930
- ObjectSlotCallback callback,
931
- ExpectedPageWatermarkState expected_page_watermark_state);
932
-
933
- // Interpret marks as a bitvector of dirty marks for regions of size
934
- // Page::kRegionSize aligned by Page::kRegionAlignmentMask and covering
935
- // memory interval from start to top. For each dirty region call a
936
- // visit_dirty_region callback. Return updated bitvector of dirty marks.
937
- uint32_t IterateDirtyRegions(uint32_t marks,
938
- Address start,
939
- Address end,
940
- DirtyRegionCallback visit_dirty_region,
941
- ObjectSlotCallback callback);
942
-
943
- // Iterate pointers to from semispace of new space found in memory interval
944
- // from start to end.
945
- // Update dirty marks for page containing start address.
946
- void IterateAndMarkPointersToFromSpace(Address start,
947
- Address end,
948
- ObjectSlotCallback callback);
949
-
950
- // Iterate pointers to new space found in memory interval from start to end.
951
- // Return true if pointers to new space was found.
952
- static bool IteratePointersInDirtyRegion(Heap* heap,
953
- Address start,
954
- Address end,
955
- ObjectSlotCallback callback);
956
-
957
-
958
- // Iterate pointers to new space found in memory interval from start to end.
959
- // This interval is considered to belong to the map space.
960
- // Return true if pointers to new space was found.
961
- static bool IteratePointersInDirtyMapsRegion(Heap* heap,
962
- Address start,
963
- Address end,
964
- ObjectSlotCallback callback);
965
-
966
-
967
- // Returns whether the object resides in new space.
968
- inline bool InNewSpace(Object* object);
969
- inline bool InFromSpace(Object* object);
970
- inline bool InToSpace(Object* object);
971
-
972
- // Checks whether an address/object in the heap (including auxiliary
973
- // area and unused area).
974
- bool Contains(Address addr);
975
- bool Contains(HeapObject* value);
976
-
977
- // Checks whether an address/object in a space.
978
- // Currently used by tests, serialization and heap verification only.
979
- bool InSpace(Address addr, AllocationSpace space);
980
- bool InSpace(HeapObject* value, AllocationSpace space);
981
-
982
- // Finds out which space an object should get promoted to based on its type.
983
- inline OldSpace* TargetSpace(HeapObject* object);
984
- inline AllocationSpace TargetSpaceId(InstanceType type);
985
-
986
- // Sets the stub_cache_ (only used when expanding the dictionary).
987
- void public_set_code_stubs(NumberDictionary* value) {
988
- roots_[kCodeStubsRootIndex] = value;
989
- }
990
-
991
- // Support for computing object sizes for old objects during GCs. Returns
992
- // a function that is guaranteed to be safe for computing object sizes in
993
- // the current GC phase.
994
- HeapObjectCallback GcSafeSizeOfOldObjectFunction() {
995
- return gc_safe_size_of_old_object_;
996
- }
997
-
998
- // Sets the non_monomorphic_cache_ (only used when expanding the dictionary).
999
- void public_set_non_monomorphic_cache(NumberDictionary* value) {
1000
- roots_[kNonMonomorphicCacheRootIndex] = value;
1001
- }
1002
-
1003
- void public_set_empty_script(Script* script) {
1004
- roots_[kEmptyScriptRootIndex] = script;
1005
- }
1006
-
1007
- // Update the next script id.
1008
- inline void SetLastScriptId(Object* last_script_id);
1009
-
1010
- // Generated code can embed this address to get access to the roots.
1011
- Object** roots_address() { return roots_; }
1012
-
1013
- // Get address of global contexts list for serialization support.
1014
- Object** global_contexts_list_address() {
1015
- return &global_contexts_list_;
1016
- }
1017
-
1018
- #ifdef DEBUG
1019
- void Print();
1020
- void PrintHandles();
1021
-
1022
- // Verify the heap is in its normal state before or after a GC.
1023
- void Verify();
1024
-
1025
- // Report heap statistics.
1026
- void ReportHeapStatistics(const char* title);
1027
- void ReportCodeStatistics(const char* title);
1028
-
1029
- // Fill in bogus values in from space
1030
- void ZapFromSpace();
1031
- #endif
1032
-
1033
- #if defined(ENABLE_LOGGING_AND_PROFILING)
1034
- // Print short heap statistics.
1035
- void PrintShortHeapStatistics();
1036
- #endif
1037
-
1038
- // Makes a new symbol object
1039
- // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
1040
- // failed.
1041
- // Please note this function does not perform a garbage collection.
1042
- MUST_USE_RESULT MaybeObject* CreateSymbol(
1043
- const char* str, int length, int hash);
1044
- MUST_USE_RESULT MaybeObject* CreateSymbol(String* str);
1045
-
1046
- // Write barrier support for address[offset] = o.
1047
- inline void RecordWrite(Address address, int offset);
1048
-
1049
- // Write barrier support for address[start : start + len[ = o.
1050
- inline void RecordWrites(Address address, int start, int len);
1051
-
1052
- // Given an address occupied by a live code object, return that object.
1053
- Object* FindCodeObject(Address a);
1054
-
1055
- // Invoke Shrink on shrinkable spaces.
1056
- void Shrink();
1057
-
1058
- enum HeapState { NOT_IN_GC, SCAVENGE, MARK_COMPACT };
1059
- inline HeapState gc_state() { return gc_state_; }
1060
-
1061
- #ifdef DEBUG
1062
- bool IsAllocationAllowed() { return allocation_allowed_; }
1063
- inline bool allow_allocation(bool enable);
1064
-
1065
- bool disallow_allocation_failure() {
1066
- return disallow_allocation_failure_;
1067
- }
1068
-
1069
- void TracePathToObject(Object* target);
1070
- void TracePathToGlobal();
1071
- #endif
1072
-
1073
- // Callback function passed to Heap::Iterate etc. Copies an object if
1074
- // necessary, the object might be promoted to an old space. The caller must
1075
- // ensure the precondition that the object is (a) a heap object and (b) in
1076
- // the heap's from space.
1077
- static inline void ScavengePointer(HeapObject** p);
1078
- static inline void ScavengeObject(HeapObject** p, HeapObject* object);
1079
-
1080
- // Commits from space if it is uncommitted.
1081
- void EnsureFromSpaceIsCommitted();
1082
-
1083
- // Support for partial snapshots. After calling this we can allocate a
1084
- // certain number of bytes using only linear allocation (with a
1085
- // LinearAllocationScope and an AlwaysAllocateScope) without using freelists
1086
- // or causing a GC. It returns true of space was reserved or false if a GC is
1087
- // needed. For paged spaces the space requested must include the space wasted
1088
- // at the end of each page when allocating linearly.
1089
- void ReserveSpace(
1090
- int new_space_size,
1091
- int pointer_space_size,
1092
- int data_space_size,
1093
- int code_space_size,
1094
- int map_space_size,
1095
- int cell_space_size,
1096
- int large_object_size);
1097
-
1098
- //
1099
- // Support for the API.
1100
- //
1101
-
1102
- bool CreateApiObjects();
1103
-
1104
- // Attempt to find the number in a small cache. If we finds it, return
1105
- // the string representation of the number. Otherwise return undefined.
1106
- Object* GetNumberStringCache(Object* number);
1107
-
1108
- // Update the cache with a new number-string pair.
1109
- void SetNumberStringCache(Object* number, String* str);
1110
-
1111
- // Adjusts the amount of registered external memory.
1112
- // Returns the adjusted value.
1113
- inline int AdjustAmountOfExternalAllocatedMemory(int change_in_bytes);
1114
-
1115
- // Allocate uninitialized fixed array.
1116
- MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length);
1117
- MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length,
1118
- PretenureFlag pretenure);
1119
-
1120
- // True if we have reached the allocation limit in the old generation that
1121
- // should force the next GC (caused normally) to be a full one.
1122
- bool OldGenerationPromotionLimitReached() {
1123
- return (PromotedSpaceSize() + PromotedExternalMemorySize())
1124
- > old_gen_promotion_limit_;
1125
- }
1126
-
1127
- intptr_t OldGenerationSpaceAvailable() {
1128
- return old_gen_allocation_limit_ -
1129
- (PromotedSpaceSize() + PromotedExternalMemorySize());
1130
- }
1131
-
1132
- // True if we have reached the allocation limit in the old generation that
1133
- // should artificially cause a GC right now.
1134
- bool OldGenerationAllocationLimitReached() {
1135
- return OldGenerationSpaceAvailable() < 0;
1136
- }
1137
-
1138
- // Can be called when the embedding application is idle.
1139
- bool IdleNotification();
1140
-
1141
- // Declare all the root indices.
1142
- enum RootListIndex {
1143
- #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex,
1144
- STRONG_ROOT_LIST(ROOT_INDEX_DECLARATION)
1145
- #undef ROOT_INDEX_DECLARATION
1146
-
1147
- // Utility type maps
1148
- #define DECLARE_STRUCT_MAP(NAME, Name, name) k##Name##MapRootIndex,
1149
- STRUCT_LIST(DECLARE_STRUCT_MAP)
1150
- #undef DECLARE_STRUCT_MAP
1151
-
1152
- #define SYMBOL_INDEX_DECLARATION(name, str) k##name##RootIndex,
1153
- SYMBOL_LIST(SYMBOL_INDEX_DECLARATION)
1154
- #undef SYMBOL_DECLARATION
1155
-
1156
- kSymbolTableRootIndex,
1157
- kStrongRootListLength = kSymbolTableRootIndex,
1158
- kRootListLength
1159
- };
1160
-
1161
- MUST_USE_RESULT MaybeObject* NumberToString(
1162
- Object* number, bool check_number_string_cache = true);
1163
-
1164
- Map* MapForExternalArrayType(ExternalArrayType array_type);
1165
- RootListIndex RootIndexForExternalArrayType(
1166
- ExternalArrayType array_type);
1167
-
1168
- void RecordStats(HeapStats* stats, bool take_snapshot = false);
1169
-
1170
- // Copy block of memory from src to dst. Size of block should be aligned
1171
- // by pointer size.
1172
- static inline void CopyBlock(Address dst, Address src, int byte_size);
1173
-
1174
- inline void CopyBlockToOldSpaceAndUpdateRegionMarks(Address dst,
1175
- Address src,
1176
- int byte_size);
1177
-
1178
- // Optimized version of memmove for blocks with pointer size aligned sizes and
1179
- // pointer size aligned addresses.
1180
- static inline void MoveBlock(Address dst, Address src, int byte_size);
1181
-
1182
- inline void MoveBlockToOldSpaceAndUpdateRegionMarks(Address dst,
1183
- Address src,
1184
- int byte_size);
1185
-
1186
- // Check new space expansion criteria and expand semispaces if it was hit.
1187
- void CheckNewSpaceExpansionCriteria();
1188
-
1189
- inline void IncrementYoungSurvivorsCounter(int survived) {
1190
- young_survivors_after_last_gc_ = survived;
1191
- survived_since_last_expansion_ += survived;
1192
- }
1193
-
1194
- void UpdateNewSpaceReferencesInExternalStringTable(
1195
- ExternalStringTableUpdaterCallback updater_func);
1196
-
1197
- void ProcessWeakReferences(WeakObjectRetainer* retainer);
1198
-
1199
- // Helper function that governs the promotion policy from new space to
1200
- // old. If the object's old address lies below the new space's age
1201
- // mark or if we've already filled the bottom 1/16th of the to space,
1202
- // we try to promote this object.
1203
- inline bool ShouldBePromoted(Address old_address, int object_size);
1204
-
1205
- int MaxObjectSizeInNewSpace() { return kMaxObjectSizeInNewSpace; }
1206
-
1207
- void ClearJSFunctionResultCaches();
1208
-
1209
- void ClearNormalizedMapCaches();
1210
-
1211
- GCTracer* tracer() { return tracer_; }
1212
-
1213
- // Returns maximum GC pause.
1214
- int get_max_gc_pause() { return max_gc_pause_; }
1215
-
1216
- // Returns maximum size of objects alive after GC.
1217
- intptr_t get_max_alive_after_gc() { return max_alive_after_gc_; }
1218
-
1219
- // Returns minimal interval between two subsequent collections.
1220
- int get_min_in_mutator() { return min_in_mutator_; }
1221
-
1222
- MarkCompactCollector* mark_compact_collector() {
1223
- return &mark_compact_collector_;
1224
- }
1225
-
1226
- ExternalStringTable* external_string_table() {
1227
- return &external_string_table_;
1228
- }
1229
-
1230
- inline Isolate* isolate();
1231
- bool is_safe_to_read_maps() { return is_safe_to_read_maps_; }
1232
-
1233
- void CallGlobalGCPrologueCallback() {
1234
- if (global_gc_prologue_callback_ != NULL) global_gc_prologue_callback_();
1235
- }
1236
-
1237
- void CallGlobalGCEpilogueCallback() {
1238
- if (global_gc_epilogue_callback_ != NULL) global_gc_epilogue_callback_();
1239
- }
1240
-
1241
- private:
1242
- Heap();
1243
-
1244
- // This can be calculated directly from a pointer to the heap; however, it is
1245
- // more expedient to get at the isolate directly from within Heap methods.
1246
- Isolate* isolate_;
1247
-
1248
- int reserved_semispace_size_;
1249
- int max_semispace_size_;
1250
- int initial_semispace_size_;
1251
- intptr_t max_old_generation_size_;
1252
- intptr_t max_executable_size_;
1253
- intptr_t code_range_size_;
1254
-
1255
- // For keeping track of how much data has survived
1256
- // scavenge since last new space expansion.
1257
- int survived_since_last_expansion_;
1258
-
1259
- int always_allocate_scope_depth_;
1260
- int linear_allocation_scope_depth_;
1261
-
1262
- // For keeping track of context disposals.
1263
- int contexts_disposed_;
1264
-
1265
- #if defined(V8_TARGET_ARCH_X64)
1266
- static const int kMaxObjectSizeInNewSpace = 1024*KB;
1267
- #else
1268
- static const int kMaxObjectSizeInNewSpace = 512*KB;
1269
- #endif
1270
-
1271
- NewSpace new_space_;
1272
- OldSpace* old_pointer_space_;
1273
- OldSpace* old_data_space_;
1274
- OldSpace* code_space_;
1275
- MapSpace* map_space_;
1276
- CellSpace* cell_space_;
1277
- LargeObjectSpace* lo_space_;
1278
- HeapState gc_state_;
1279
-
1280
- // Returns the size of object residing in non new spaces.
1281
- intptr_t PromotedSpaceSize();
1282
-
1283
- // Returns the amount of external memory registered since last global gc.
1284
- int PromotedExternalMemorySize();
1285
-
1286
- int mc_count_; // how many mark-compact collections happened
1287
- int ms_count_; // how many mark-sweep collections happened
1288
- unsigned int gc_count_; // how many gc happened
1289
-
1290
- // Total length of the strings we failed to flatten since the last GC.
1291
- int unflattened_strings_length_;
1292
-
1293
- #define ROOT_ACCESSOR(type, name, camel_name) \
1294
- inline void set_##name(type* value) { \
1295
- roots_[k##camel_name##RootIndex] = value; \
1296
- }
1297
- ROOT_LIST(ROOT_ACCESSOR)
1298
- #undef ROOT_ACCESSOR
1299
-
1300
- #ifdef DEBUG
1301
- bool allocation_allowed_;
1302
-
1303
- // If the --gc-interval flag is set to a positive value, this
1304
- // variable holds the value indicating the number of allocations
1305
- // remain until the next failure and garbage collection.
1306
- int allocation_timeout_;
1307
-
1308
- // Do we expect to be able to handle allocation failure at this
1309
- // time?
1310
- bool disallow_allocation_failure_;
1311
-
1312
- HeapDebugUtils* debug_utils_;
1313
- #endif // DEBUG
1314
-
1315
- // Limit that triggers a global GC on the next (normally caused) GC. This
1316
- // is checked when we have already decided to do a GC to help determine
1317
- // which collector to invoke.
1318
- intptr_t old_gen_promotion_limit_;
1319
-
1320
- // Limit that triggers a global GC as soon as is reasonable. This is
1321
- // checked before expanding a paged space in the old generation and on
1322
- // every allocation in large object space.
1323
- intptr_t old_gen_allocation_limit_;
1324
-
1325
- // Limit on the amount of externally allocated memory allowed
1326
- // between global GCs. If reached a global GC is forced.
1327
- intptr_t external_allocation_limit_;
1328
-
1329
- // The amount of external memory registered through the API kept alive
1330
- // by global handles
1331
- int amount_of_external_allocated_memory_;
1332
-
1333
- // Caches the amount of external memory registered at the last global gc.
1334
- int amount_of_external_allocated_memory_at_last_global_gc_;
1335
-
1336
- // Indicates that an allocation has failed in the old generation since the
1337
- // last GC.
1338
- int old_gen_exhausted_;
1339
-
1340
- Object* roots_[kRootListLength];
1341
-
1342
- Object* global_contexts_list_;
1343
-
1344
- struct StringTypeTable {
1345
- InstanceType type;
1346
- int size;
1347
- RootListIndex index;
1348
- };
1349
-
1350
- struct ConstantSymbolTable {
1351
- const char* contents;
1352
- RootListIndex index;
1353
- };
1354
-
1355
- struct StructTable {
1356
- InstanceType type;
1357
- int size;
1358
- RootListIndex index;
1359
- };
1360
-
1361
- static const StringTypeTable string_type_table[];
1362
- static const ConstantSymbolTable constant_symbol_table[];
1363
- static const StructTable struct_table[];
1364
-
1365
- // The special hidden symbol which is an empty string, but does not match
1366
- // any string when looked up in properties.
1367
- String* hidden_symbol_;
1368
-
1369
- // GC callback function, called before and after mark-compact GC.
1370
- // Allocations in the callback function are disallowed.
1371
- struct GCPrologueCallbackPair {
1372
- GCPrologueCallbackPair(GCPrologueCallback callback, GCType gc_type)
1373
- : callback(callback), gc_type(gc_type) {
1374
- }
1375
- bool operator==(const GCPrologueCallbackPair& pair) const {
1376
- return pair.callback == callback;
1377
- }
1378
- GCPrologueCallback callback;
1379
- GCType gc_type;
1380
- };
1381
- List<GCPrologueCallbackPair> gc_prologue_callbacks_;
1382
-
1383
- struct GCEpilogueCallbackPair {
1384
- GCEpilogueCallbackPair(GCEpilogueCallback callback, GCType gc_type)
1385
- : callback(callback), gc_type(gc_type) {
1386
- }
1387
- bool operator==(const GCEpilogueCallbackPair& pair) const {
1388
- return pair.callback == callback;
1389
- }
1390
- GCEpilogueCallback callback;
1391
- GCType gc_type;
1392
- };
1393
- List<GCEpilogueCallbackPair> gc_epilogue_callbacks_;
1394
-
1395
- GCCallback global_gc_prologue_callback_;
1396
- GCCallback global_gc_epilogue_callback_;
1397
-
1398
- // Support for computing object sizes during GC.
1399
- HeapObjectCallback gc_safe_size_of_old_object_;
1400
- static int GcSafeSizeOfOldObject(HeapObject* object);
1401
- static int GcSafeSizeOfOldObjectWithEncodedMap(HeapObject* object);
1402
-
1403
- // Update the GC state. Called from the mark-compact collector.
1404
- void MarkMapPointersAsEncoded(bool encoded) {
1405
- gc_safe_size_of_old_object_ = encoded
1406
- ? &GcSafeSizeOfOldObjectWithEncodedMap
1407
- : &GcSafeSizeOfOldObject;
1408
- }
1409
-
1410
- // Checks whether a global GC is necessary
1411
- GarbageCollector SelectGarbageCollector(AllocationSpace space);
1412
-
1413
- // Performs garbage collection
1414
- // Returns whether there is a chance another major GC could
1415
- // collect more garbage.
1416
- bool PerformGarbageCollection(GarbageCollector collector,
1417
- GCTracer* tracer);
1418
-
1419
- static const intptr_t kMinimumPromotionLimit = 2 * MB;
1420
- static const intptr_t kMinimumAllocationLimit = 8 * MB;
1421
-
1422
- inline void UpdateOldSpaceLimits();
1423
-
1424
- // Allocate an uninitialized object in map space. The behavior is identical
1425
- // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't
1426
- // have to test the allocation space argument and (b) can reduce code size
1427
- // (since both AllocateRaw and AllocateRawMap are inlined).
1428
- MUST_USE_RESULT inline MaybeObject* AllocateRawMap();
1429
-
1430
- // Allocate an uninitialized object in the global property cell space.
1431
- MUST_USE_RESULT inline MaybeObject* AllocateRawCell();
1432
-
1433
- // Initializes a JSObject based on its map.
1434
- void InitializeJSObjectFromMap(JSObject* obj,
1435
- FixedArray* properties,
1436
- Map* map);
1437
-
1438
- bool CreateInitialMaps();
1439
- bool CreateInitialObjects();
1440
-
1441
- // These five Create*EntryStub functions are here and forced to not be inlined
1442
- // because of a gcc-4.4 bug that assigns wrong vtable entries.
1443
- NO_INLINE(void CreateJSEntryStub());
1444
- NO_INLINE(void CreateJSConstructEntryStub());
1445
-
1446
- void CreateFixedStubs();
1447
-
1448
- MaybeObject* CreateOddball(const char* to_string,
1449
- Object* to_number,
1450
- byte kind);
1451
-
1452
- // Allocate empty fixed array.
1453
- MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray();
1454
-
1455
- void SwitchScavengingVisitorsTableIfProfilingWasEnabled();
1456
-
1457
- // Performs a minor collection in new generation.
1458
- void Scavenge();
1459
-
1460
- static String* UpdateNewSpaceReferenceInExternalStringTableEntry(
1461
- Heap* heap,
1462
- Object** pointer);
1463
-
1464
- Address DoScavenge(ObjectVisitor* scavenge_visitor, Address new_space_front);
1465
-
1466
- // Performs a major collection in the whole heap.
1467
- void MarkCompact(GCTracer* tracer);
1468
-
1469
- // Code to be run before and after mark-compact.
1470
- void MarkCompactPrologue(bool is_compacting);
1471
-
1472
- // Completely clear the Instanceof cache (to stop it keeping objects alive
1473
- // around a GC).
1474
- inline void CompletelyClearInstanceofCache();
1475
-
1476
- #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
1477
- // Record statistics before and after garbage collection.
1478
- void ReportStatisticsBeforeGC();
1479
- void ReportStatisticsAfterGC();
1480
- #endif
1481
-
1482
- // Slow part of scavenge object.
1483
- static void ScavengeObjectSlow(HeapObject** p, HeapObject* object);
1484
-
1485
- // Initializes a function with a shared part and prototype.
1486
- // Returns the function.
1487
- // Note: this code was factored out of AllocateFunction such that
1488
- // other parts of the VM could use it. Specifically, a function that creates
1489
- // instances of type JS_FUNCTION_TYPE benefit from the use of this function.
1490
- // Please note this does not perform a garbage collection.
1491
- MUST_USE_RESULT inline MaybeObject* InitializeFunction(
1492
- JSFunction* function,
1493
- SharedFunctionInfo* shared,
1494
- Object* prototype);
1495
-
1496
- GCTracer* tracer_;
1497
-
1498
-
1499
- // Initializes the number to string cache based on the max semispace size.
1500
- MUST_USE_RESULT MaybeObject* InitializeNumberStringCache();
1501
- // Flush the number to string cache.
1502
- void FlushNumberStringCache();
1503
-
1504
- void UpdateSurvivalRateTrend(int start_new_space_size);
1505
-
1506
- enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING };
1507
-
1508
- static const int kYoungSurvivalRateThreshold = 90;
1509
- static const int kYoungSurvivalRateAllowedDeviation = 15;
1510
-
1511
- int young_survivors_after_last_gc_;
1512
- int high_survival_rate_period_length_;
1513
- double survival_rate_;
1514
- SurvivalRateTrend previous_survival_rate_trend_;
1515
- SurvivalRateTrend survival_rate_trend_;
1516
-
1517
- void set_survival_rate_trend(SurvivalRateTrend survival_rate_trend) {
1518
- ASSERT(survival_rate_trend != FLUCTUATING);
1519
- previous_survival_rate_trend_ = survival_rate_trend_;
1520
- survival_rate_trend_ = survival_rate_trend;
1521
- }
1522
-
1523
- SurvivalRateTrend survival_rate_trend() {
1524
- if (survival_rate_trend_ == STABLE) {
1525
- return STABLE;
1526
- } else if (previous_survival_rate_trend_ == STABLE) {
1527
- return survival_rate_trend_;
1528
- } else if (survival_rate_trend_ != previous_survival_rate_trend_) {
1529
- return FLUCTUATING;
1530
- } else {
1531
- return survival_rate_trend_;
1532
- }
1533
- }
1534
-
1535
- bool IsStableOrIncreasingSurvivalTrend() {
1536
- switch (survival_rate_trend()) {
1537
- case STABLE:
1538
- case INCREASING:
1539
- return true;
1540
- default:
1541
- return false;
1542
- }
1543
- }
1544
-
1545
- bool IsIncreasingSurvivalTrend() {
1546
- return survival_rate_trend() == INCREASING;
1547
- }
1548
-
1549
- bool IsHighSurvivalRate() {
1550
- return high_survival_rate_period_length_ > 0;
1551
- }
1552
-
1553
- static const int kInitialSymbolTableSize = 2048;
1554
- static const int kInitialEvalCacheSize = 64;
1555
-
1556
- // Maximum GC pause.
1557
- int max_gc_pause_;
1558
-
1559
- // Maximum size of objects alive after GC.
1560
- intptr_t max_alive_after_gc_;
1561
-
1562
- // Minimal interval between two subsequent collections.
1563
- int min_in_mutator_;
1564
-
1565
- // Size of objects alive after last GC.
1566
- intptr_t alive_after_last_gc_;
1567
-
1568
- double last_gc_end_timestamp_;
1569
-
1570
- MarkCompactCollector mark_compact_collector_;
1571
-
1572
- // This field contains the meaning of the WATERMARK_INVALIDATED flag.
1573
- // Instead of clearing this flag from all pages we just flip
1574
- // its meaning at the beginning of a scavenge.
1575
- intptr_t page_watermark_invalidated_mark_;
1576
-
1577
- int number_idle_notifications_;
1578
- unsigned int last_idle_notification_gc_count_;
1579
- bool last_idle_notification_gc_count_init_;
1580
-
1581
- // Shared state read by the scavenge collector and set by ScavengeObject.
1582
- PromotionQueue promotion_queue_;
1583
-
1584
- // Flag is set when the heap has been configured. The heap can be repeatedly
1585
- // configured through the API until it is setup.
1586
- bool configured_;
1587
-
1588
- ExternalStringTable external_string_table_;
1589
-
1590
- bool is_safe_to_read_maps_;
1591
-
1592
- friend class Factory;
1593
- friend class GCTracer;
1594
- friend class DisallowAllocationFailure;
1595
- friend class AlwaysAllocateScope;
1596
- friend class LinearAllocationScope;
1597
- friend class Page;
1598
- friend class Isolate;
1599
- friend class MarkCompactCollector;
1600
- friend class MapCompact;
1601
-
1602
- DISALLOW_COPY_AND_ASSIGN(Heap);
1603
- };
1604
-
1605
-
1606
- class HeapStats {
1607
- public:
1608
- static const int kStartMarker = 0xDECADE00;
1609
- static const int kEndMarker = 0xDECADE01;
1610
-
1611
- int* start_marker; // 0
1612
- int* new_space_size; // 1
1613
- int* new_space_capacity; // 2
1614
- intptr_t* old_pointer_space_size; // 3
1615
- intptr_t* old_pointer_space_capacity; // 4
1616
- intptr_t* old_data_space_size; // 5
1617
- intptr_t* old_data_space_capacity; // 6
1618
- intptr_t* code_space_size; // 7
1619
- intptr_t* code_space_capacity; // 8
1620
- intptr_t* map_space_size; // 9
1621
- intptr_t* map_space_capacity; // 10
1622
- intptr_t* cell_space_size; // 11
1623
- intptr_t* cell_space_capacity; // 12
1624
- intptr_t* lo_space_size; // 13
1625
- int* global_handle_count; // 14
1626
- int* weak_global_handle_count; // 15
1627
- int* pending_global_handle_count; // 16
1628
- int* near_death_global_handle_count; // 17
1629
- int* destroyed_global_handle_count; // 18
1630
- intptr_t* memory_allocator_size; // 19
1631
- intptr_t* memory_allocator_capacity; // 20
1632
- int* objects_per_type; // 21
1633
- int* size_per_type; // 22
1634
- int* os_error; // 23
1635
- int* end_marker; // 24
1636
- };
1637
-
1638
-
1639
- class AlwaysAllocateScope {
1640
- public:
1641
- AlwaysAllocateScope() {
1642
- // We shouldn't hit any nested scopes, because that requires
1643
- // non-handle code to call handle code. The code still works but
1644
- // performance will degrade, so we want to catch this situation
1645
- // in debug mode.
1646
- ASSERT(HEAP->always_allocate_scope_depth_ == 0);
1647
- HEAP->always_allocate_scope_depth_++;
1648
- }
1649
-
1650
- ~AlwaysAllocateScope() {
1651
- HEAP->always_allocate_scope_depth_--;
1652
- ASSERT(HEAP->always_allocate_scope_depth_ == 0);
1653
- }
1654
- };
1655
-
1656
-
1657
- class LinearAllocationScope {
1658
- public:
1659
- LinearAllocationScope() {
1660
- HEAP->linear_allocation_scope_depth_++;
1661
- }
1662
-
1663
- ~LinearAllocationScope() {
1664
- HEAP->linear_allocation_scope_depth_--;
1665
- ASSERT(HEAP->linear_allocation_scope_depth_ >= 0);
1666
- }
1667
- };
1668
-
1669
-
1670
- #ifdef DEBUG
1671
- // Visitor class to verify interior pointers in spaces that do not contain
1672
- // or care about intergenerational references. All heap object pointers have to
1673
- // point into the heap to a location that has a map pointer at its first word.
1674
- // Caveat: Heap::Contains is an approximation because it can return true for
1675
- // objects in a heap space but above the allocation pointer.
1676
- class VerifyPointersVisitor: public ObjectVisitor {
1677
- public:
1678
- void VisitPointers(Object** start, Object** end) {
1679
- for (Object** current = start; current < end; current++) {
1680
- if ((*current)->IsHeapObject()) {
1681
- HeapObject* object = HeapObject::cast(*current);
1682
- ASSERT(HEAP->Contains(object));
1683
- ASSERT(object->map()->IsMap());
1684
- }
1685
- }
1686
- }
1687
- };
1688
-
1689
-
1690
- // Visitor class to verify interior pointers in spaces that use region marks
1691
- // to keep track of intergenerational references.
1692
- // As VerifyPointersVisitor but also checks that dirty marks are set
1693
- // for regions covering intergenerational references.
1694
- class VerifyPointersAndDirtyRegionsVisitor: public ObjectVisitor {
1695
- public:
1696
- void VisitPointers(Object** start, Object** end) {
1697
- for (Object** current = start; current < end; current++) {
1698
- if ((*current)->IsHeapObject()) {
1699
- HeapObject* object = HeapObject::cast(*current);
1700
- ASSERT(HEAP->Contains(object));
1701
- ASSERT(object->map()->IsMap());
1702
- if (HEAP->InNewSpace(object)) {
1703
- ASSERT(HEAP->InToSpace(object));
1704
- Address addr = reinterpret_cast<Address>(current);
1705
- ASSERT(Page::FromAddress(addr)->IsRegionDirty(addr));
1706
- }
1707
- }
1708
- }
1709
- }
1710
- };
1711
- #endif
1712
-
1713
-
1714
- // Space iterator for iterating over all spaces of the heap.
1715
- // Returns each space in turn, and null when it is done.
1716
- class AllSpaces BASE_EMBEDDED {
1717
- public:
1718
- Space* next();
1719
- AllSpaces() { counter_ = FIRST_SPACE; }
1720
- private:
1721
- int counter_;
1722
- };
1723
-
1724
-
1725
- // Space iterator for iterating over all old spaces of the heap: Old pointer
1726
- // space, old data space and code space.
1727
- // Returns each space in turn, and null when it is done.
1728
- class OldSpaces BASE_EMBEDDED {
1729
- public:
1730
- OldSpace* next();
1731
- OldSpaces() { counter_ = OLD_POINTER_SPACE; }
1732
- private:
1733
- int counter_;
1734
- };
1735
-
1736
-
1737
- // Space iterator for iterating over all the paged spaces of the heap:
1738
- // Map space, old pointer space, old data space, code space and cell space.
1739
- // Returns each space in turn, and null when it is done.
1740
- class PagedSpaces BASE_EMBEDDED {
1741
- public:
1742
- PagedSpace* next();
1743
- PagedSpaces() { counter_ = OLD_POINTER_SPACE; }
1744
- private:
1745
- int counter_;
1746
- };
1747
-
1748
-
1749
- // Space iterator for iterating over all spaces of the heap.
1750
- // For each space an object iterator is provided. The deallocation of the
1751
- // returned object iterators is handled by the space iterator.
1752
- class SpaceIterator : public Malloced {
1753
- public:
1754
- SpaceIterator();
1755
- explicit SpaceIterator(HeapObjectCallback size_func);
1756
- virtual ~SpaceIterator();
1757
-
1758
- bool has_next();
1759
- ObjectIterator* next();
1760
-
1761
- private:
1762
- ObjectIterator* CreateIterator();
1763
-
1764
- int current_space_; // from enum AllocationSpace.
1765
- ObjectIterator* iterator_; // object iterator for the current space.
1766
- HeapObjectCallback size_func_;
1767
- };
1768
-
1769
-
1770
- // A HeapIterator provides iteration over the whole heap. It
1771
- // aggregates the specific iterators for the different spaces as
1772
- // these can only iterate over one space only.
1773
- //
1774
- // HeapIterator can skip free list nodes (that is, de-allocated heap
1775
- // objects that still remain in the heap). As implementation of free
1776
- // nodes filtering uses GC marks, it can't be used during MS/MC GC
1777
- // phases. Also, it is forbidden to interrupt iteration in this mode,
1778
- // as this will leave heap objects marked (and thus, unusable).
1779
- class HeapObjectsFilter;
1780
-
1781
- class HeapIterator BASE_EMBEDDED {
1782
- public:
1783
- enum HeapObjectsFiltering {
1784
- kNoFiltering,
1785
- kFilterFreeListNodes,
1786
- kFilterUnreachable
1787
- };
1788
-
1789
- HeapIterator();
1790
- explicit HeapIterator(HeapObjectsFiltering filtering);
1791
- ~HeapIterator();
1792
-
1793
- HeapObject* next();
1794
- void reset();
1795
-
1796
- private:
1797
- // Perform the initialization.
1798
- void Init();
1799
- // Perform all necessary shutdown (destruction) work.
1800
- void Shutdown();
1801
- HeapObject* NextObject();
1802
-
1803
- HeapObjectsFiltering filtering_;
1804
- HeapObjectsFilter* filter_;
1805
- // Space iterator for iterating all the spaces.
1806
- SpaceIterator* space_iterator_;
1807
- // Object iterator for the space currently being iterated.
1808
- ObjectIterator* object_iterator_;
1809
- };
1810
-
1811
-
1812
- // Cache for mapping (map, property name) into field offset.
1813
- // Cleared at startup and prior to mark sweep collection.
1814
- class KeyedLookupCache {
1815
- public:
1816
- // Lookup field offset for (map, name). If absent, -1 is returned.
1817
- int Lookup(Map* map, String* name);
1818
-
1819
- // Update an element in the cache.
1820
- void Update(Map* map, String* name, int field_offset);
1821
-
1822
- // Clear the cache.
1823
- void Clear();
1824
-
1825
- static const int kLength = 64;
1826
- static const int kCapacityMask = kLength - 1;
1827
- static const int kMapHashShift = 2;
1828
- static const int kNotFound = -1;
1829
-
1830
- private:
1831
- KeyedLookupCache() {
1832
- for (int i = 0; i < kLength; ++i) {
1833
- keys_[i].map = NULL;
1834
- keys_[i].name = NULL;
1835
- field_offsets_[i] = kNotFound;
1836
- }
1837
- }
1838
-
1839
- static inline int Hash(Map* map, String* name);
1840
-
1841
- // Get the address of the keys and field_offsets arrays. Used in
1842
- // generated code to perform cache lookups.
1843
- Address keys_address() {
1844
- return reinterpret_cast<Address>(&keys_);
1845
- }
1846
-
1847
- Address field_offsets_address() {
1848
- return reinterpret_cast<Address>(&field_offsets_);
1849
- }
1850
-
1851
- struct Key {
1852
- Map* map;
1853
- String* name;
1854
- };
1855
-
1856
- Key keys_[kLength];
1857
- int field_offsets_[kLength];
1858
-
1859
- friend class ExternalReference;
1860
- friend class Isolate;
1861
- DISALLOW_COPY_AND_ASSIGN(KeyedLookupCache);
1862
- };
1863
-
1864
-
1865
- // Cache for mapping (array, property name) into descriptor index.
1866
- // The cache contains both positive and negative results.
1867
- // Descriptor index equals kNotFound means the property is absent.
1868
- // Cleared at startup and prior to any gc.
1869
- class DescriptorLookupCache {
1870
- public:
1871
- // Lookup descriptor index for (map, name).
1872
- // If absent, kAbsent is returned.
1873
- int Lookup(DescriptorArray* array, String* name) {
1874
- if (!StringShape(name).IsSymbol()) return kAbsent;
1875
- int index = Hash(array, name);
1876
- Key& key = keys_[index];
1877
- if ((key.array == array) && (key.name == name)) return results_[index];
1878
- return kAbsent;
1879
- }
1880
-
1881
- // Update an element in the cache.
1882
- void Update(DescriptorArray* array, String* name, int result) {
1883
- ASSERT(result != kAbsent);
1884
- if (StringShape(name).IsSymbol()) {
1885
- int index = Hash(array, name);
1886
- Key& key = keys_[index];
1887
- key.array = array;
1888
- key.name = name;
1889
- results_[index] = result;
1890
- }
1891
- }
1892
-
1893
- // Clear the cache.
1894
- void Clear();
1895
-
1896
- static const int kAbsent = -2;
1897
- private:
1898
- DescriptorLookupCache() {
1899
- for (int i = 0; i < kLength; ++i) {
1900
- keys_[i].array = NULL;
1901
- keys_[i].name = NULL;
1902
- results_[i] = kAbsent;
1903
- }
1904
- }
1905
-
1906
- static int Hash(DescriptorArray* array, String* name) {
1907
- // Uses only lower 32 bits if pointers are larger.
1908
- uint32_t array_hash =
1909
- static_cast<uint32_t>(reinterpret_cast<uintptr_t>(array)) >> 2;
1910
- uint32_t name_hash =
1911
- static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name)) >> 2;
1912
- return (array_hash ^ name_hash) % kLength;
1913
- }
1914
-
1915
- static const int kLength = 64;
1916
- struct Key {
1917
- DescriptorArray* array;
1918
- String* name;
1919
- };
1920
-
1921
- Key keys_[kLength];
1922
- int results_[kLength];
1923
-
1924
- friend class Isolate;
1925
- DISALLOW_COPY_AND_ASSIGN(DescriptorLookupCache);
1926
- };
1927
-
1928
-
1929
- // A helper class to document/test C++ scopes where we do not
1930
- // expect a GC. Usage:
1931
- //
1932
- // /* Allocation not allowed: we cannot handle a GC in this scope. */
1933
- // { AssertNoAllocation nogc;
1934
- // ...
1935
- // }
1936
-
1937
- #ifdef DEBUG
1938
-
1939
- class DisallowAllocationFailure {
1940
- public:
1941
- DisallowAllocationFailure() {
1942
- old_state_ = HEAP->disallow_allocation_failure_;
1943
- HEAP->disallow_allocation_failure_ = true;
1944
- }
1945
- ~DisallowAllocationFailure() {
1946
- HEAP->disallow_allocation_failure_ = old_state_;
1947
- }
1948
- private:
1949
- bool old_state_;
1950
- };
1951
-
1952
- class AssertNoAllocation {
1953
- public:
1954
- AssertNoAllocation() {
1955
- old_state_ = HEAP->allow_allocation(false);
1956
- }
1957
-
1958
- ~AssertNoAllocation() {
1959
- HEAP->allow_allocation(old_state_);
1960
- }
1961
-
1962
- private:
1963
- bool old_state_;
1964
- };
1965
-
1966
- class DisableAssertNoAllocation {
1967
- public:
1968
- DisableAssertNoAllocation() {
1969
- old_state_ = HEAP->allow_allocation(true);
1970
- }
1971
-
1972
- ~DisableAssertNoAllocation() {
1973
- HEAP->allow_allocation(old_state_);
1974
- }
1975
-
1976
- private:
1977
- bool old_state_;
1978
- };
1979
-
1980
- #else // ndef DEBUG
1981
-
1982
- class AssertNoAllocation {
1983
- public:
1984
- AssertNoAllocation() { }
1985
- ~AssertNoAllocation() { }
1986
- };
1987
-
1988
- class DisableAssertNoAllocation {
1989
- public:
1990
- DisableAssertNoAllocation() { }
1991
- ~DisableAssertNoAllocation() { }
1992
- };
1993
-
1994
- #endif
1995
-
1996
- // GCTracer collects and prints ONE line after each garbage collector
1997
- // invocation IFF --trace_gc is used.
1998
-
1999
- class GCTracer BASE_EMBEDDED {
2000
- public:
2001
- class Scope BASE_EMBEDDED {
2002
- public:
2003
- enum ScopeId {
2004
- EXTERNAL,
2005
- MC_MARK,
2006
- MC_SWEEP,
2007
- MC_SWEEP_NEWSPACE,
2008
- MC_COMPACT,
2009
- MC_FLUSH_CODE,
2010
- kNumberOfScopes
2011
- };
2012
-
2013
- Scope(GCTracer* tracer, ScopeId scope)
2014
- : tracer_(tracer),
2015
- scope_(scope) {
2016
- start_time_ = OS::TimeCurrentMillis();
2017
- }
2018
-
2019
- ~Scope() {
2020
- ASSERT(scope_ < kNumberOfScopes); // scope_ is unsigned.
2021
- tracer_->scopes_[scope_] += OS::TimeCurrentMillis() - start_time_;
2022
- }
2023
-
2024
- private:
2025
- GCTracer* tracer_;
2026
- ScopeId scope_;
2027
- double start_time_;
2028
- };
2029
-
2030
- explicit GCTracer(Heap* heap);
2031
- ~GCTracer();
2032
-
2033
- // Sets the collector.
2034
- void set_collector(GarbageCollector collector) { collector_ = collector; }
2035
-
2036
- // Sets the GC count.
2037
- void set_gc_count(unsigned int count) { gc_count_ = count; }
2038
-
2039
- // Sets the full GC count.
2040
- void set_full_gc_count(int count) { full_gc_count_ = count; }
2041
-
2042
- // Sets the flag that this is a compacting full GC.
2043
- void set_is_compacting() { is_compacting_ = true; }
2044
- bool is_compacting() const { return is_compacting_; }
2045
-
2046
- // Increment and decrement the count of marked objects.
2047
- void increment_marked_count() { ++marked_count_; }
2048
- void decrement_marked_count() { --marked_count_; }
2049
-
2050
- int marked_count() { return marked_count_; }
2051
-
2052
- void increment_promoted_objects_size(int object_size) {
2053
- promoted_objects_size_ += object_size;
2054
- }
2055
-
2056
- private:
2057
- // Returns a string matching the collector.
2058
- const char* CollectorString();
2059
-
2060
- // Returns size of object in heap (in MB).
2061
- double SizeOfHeapObjects() {
2062
- return (static_cast<double>(HEAP->SizeOfObjects())) / MB;
2063
- }
2064
-
2065
- double start_time_; // Timestamp set in the constructor.
2066
- intptr_t start_size_; // Size of objects in heap set in constructor.
2067
- GarbageCollector collector_; // Type of collector.
2068
-
2069
- // A count (including this one, eg, the first collection is 1) of the
2070
- // number of garbage collections.
2071
- unsigned int gc_count_;
2072
-
2073
- // A count (including this one) of the number of full garbage collections.
2074
- int full_gc_count_;
2075
-
2076
- // True if the current GC is a compacting full collection, false
2077
- // otherwise.
2078
- bool is_compacting_;
2079
-
2080
- // True if the *previous* full GC cwas a compacting collection (will be
2081
- // false if there has not been a previous full GC).
2082
- bool previous_has_compacted_;
2083
-
2084
- // On a full GC, a count of the number of marked objects. Incremented
2085
- // when an object is marked and decremented when an object's mark bit is
2086
- // cleared. Will be zero on a scavenge collection.
2087
- int marked_count_;
2088
-
2089
- // The count from the end of the previous full GC. Will be zero if there
2090
- // was no previous full GC.
2091
- int previous_marked_count_;
2092
-
2093
- // Amounts of time spent in different scopes during GC.
2094
- double scopes_[Scope::kNumberOfScopes];
2095
-
2096
- // Total amount of space either wasted or contained in one of free lists
2097
- // before the current GC.
2098
- intptr_t in_free_list_or_wasted_before_gc_;
2099
-
2100
- // Difference between space used in the heap at the beginning of the current
2101
- // collection and the end of the previous collection.
2102
- intptr_t allocated_since_last_gc_;
2103
-
2104
- // Amount of time spent in mutator that is time elapsed between end of the
2105
- // previous collection and the beginning of the current one.
2106
- double spent_in_mutator_;
2107
-
2108
- // Size of objects promoted during the current collection.
2109
- intptr_t promoted_objects_size_;
2110
-
2111
- Heap* heap_;
2112
- };
2113
-
2114
-
2115
- class TranscendentalCache {
2116
- public:
2117
- enum Type {ACOS, ASIN, ATAN, COS, EXP, LOG, SIN, TAN, kNumberOfCaches};
2118
- static const int kTranscendentalTypeBits = 3;
2119
- STATIC_ASSERT((1 << kTranscendentalTypeBits) >= kNumberOfCaches);
2120
-
2121
- // Returns a heap number with f(input), where f is a math function specified
2122
- // by the 'type' argument.
2123
- MUST_USE_RESULT inline MaybeObject* Get(Type type, double input);
2124
-
2125
- // The cache contains raw Object pointers. This method disposes of
2126
- // them before a garbage collection.
2127
- void Clear();
2128
-
2129
- private:
2130
- class SubCache {
2131
- static const int kCacheSize = 512;
2132
-
2133
- explicit SubCache(Type t);
2134
-
2135
- MUST_USE_RESULT inline MaybeObject* Get(double input);
2136
-
2137
- inline double Calculate(double input);
2138
-
2139
- struct Element {
2140
- uint32_t in[2];
2141
- Object* output;
2142
- };
2143
-
2144
- union Converter {
2145
- double dbl;
2146
- uint32_t integers[2];
2147
- };
2148
-
2149
- inline static int Hash(const Converter& c) {
2150
- uint32_t hash = (c.integers[0] ^ c.integers[1]);
2151
- hash ^= static_cast<int32_t>(hash) >> 16;
2152
- hash ^= static_cast<int32_t>(hash) >> 8;
2153
- return (hash & (kCacheSize - 1));
2154
- }
2155
-
2156
- Element elements_[kCacheSize];
2157
- Type type_;
2158
- Isolate* isolate_;
2159
-
2160
- // Allow access to the caches_ array as an ExternalReference.
2161
- friend class ExternalReference;
2162
- // Inline implementation of the cache.
2163
- friend class TranscendentalCacheStub;
2164
- // For evaluating value.
2165
- friend class TranscendentalCache;
2166
-
2167
- DISALLOW_COPY_AND_ASSIGN(SubCache);
2168
- };
2169
-
2170
- TranscendentalCache() {
2171
- for (int i = 0; i < kNumberOfCaches; ++i) caches_[i] = NULL;
2172
- }
2173
-
2174
- // Used to create an external reference.
2175
- inline Address cache_array_address();
2176
-
2177
- // Instantiation
2178
- friend class Isolate;
2179
- // Inline implementation of the caching.
2180
- friend class TranscendentalCacheStub;
2181
- // Allow access to the caches_ array as an ExternalReference.
2182
- friend class ExternalReference;
2183
-
2184
- SubCache* caches_[kNumberOfCaches];
2185
- DISALLOW_COPY_AND_ASSIGN(TranscendentalCache);
2186
- };
2187
-
2188
-
2189
- // Abstract base class for checking whether a weak object should be retained.
2190
- class WeakObjectRetainer {
2191
- public:
2192
- virtual ~WeakObjectRetainer() {}
2193
-
2194
- // Return whether this object should be retained. If NULL is returned the
2195
- // object has no references. Otherwise the address of the retained object
2196
- // should be returned as in some GC situations the object has been moved.
2197
- virtual Object* RetainAs(Object* object) = 0;
2198
- };
2199
-
2200
-
2201
- #if defined(DEBUG) || defined(LIVE_OBJECT_LIST)
2202
- // Helper class for tracing paths to a search target Object from all roots.
2203
- // The TracePathFrom() method can be used to trace paths from a specific
2204
- // object to the search target object.
2205
- class PathTracer : public ObjectVisitor {
2206
- public:
2207
- enum WhatToFind {
2208
- FIND_ALL, // Will find all matches.
2209
- FIND_FIRST // Will stop the search after first match.
2210
- };
2211
-
2212
- // For the WhatToFind arg, if FIND_FIRST is specified, tracing will stop
2213
- // after the first match. If FIND_ALL is specified, then tracing will be
2214
- // done for all matches.
2215
- PathTracer(Object* search_target,
2216
- WhatToFind what_to_find,
2217
- VisitMode visit_mode)
2218
- : search_target_(search_target),
2219
- found_target_(false),
2220
- found_target_in_trace_(false),
2221
- what_to_find_(what_to_find),
2222
- visit_mode_(visit_mode),
2223
- object_stack_(20),
2224
- no_alloc() {}
2225
-
2226
- virtual void VisitPointers(Object** start, Object** end);
2227
-
2228
- void Reset();
2229
- void TracePathFrom(Object** root);
2230
-
2231
- bool found() const { return found_target_; }
2232
-
2233
- static Object* const kAnyGlobalObject;
2234
-
2235
- protected:
2236
- class MarkVisitor;
2237
- class UnmarkVisitor;
2238
-
2239
- void MarkRecursively(Object** p, MarkVisitor* mark_visitor);
2240
- void UnmarkRecursively(Object** p, UnmarkVisitor* unmark_visitor);
2241
- virtual void ProcessResults();
2242
-
2243
- // Tags 0, 1, and 3 are used. Use 2 for marking visited HeapObject.
2244
- static const int kMarkTag = 2;
2245
-
2246
- Object* search_target_;
2247
- bool found_target_;
2248
- bool found_target_in_trace_;
2249
- WhatToFind what_to_find_;
2250
- VisitMode visit_mode_;
2251
- List<Object*> object_stack_;
2252
-
2253
- AssertNoAllocation no_alloc; // i.e. no gc allowed.
2254
-
2255
- DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2256
- };
2257
- #endif // DEBUG || LIVE_OBJECT_LIST
2258
-
2259
-
2260
- } } // namespace v8::internal
2261
-
2262
- #undef HEAP
2263
-
2264
- #endif // V8_HEAP_H_