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,2368 +0,0 @@
1
- // Copyright 2006-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_SPACES_H_
29
- #define V8_SPACES_H_
30
-
31
- #include "list-inl.h"
32
- #include "log.h"
33
-
34
- namespace v8 {
35
- namespace internal {
36
-
37
- class Isolate;
38
-
39
- // -----------------------------------------------------------------------------
40
- // Heap structures:
41
- //
42
- // A JS heap consists of a young generation, an old generation, and a large
43
- // object space. The young generation is divided into two semispaces. A
44
- // scavenger implements Cheney's copying algorithm. The old generation is
45
- // separated into a map space and an old object space. The map space contains
46
- // all (and only) map objects, the rest of old objects go into the old space.
47
- // The old generation is collected by a mark-sweep-compact collector.
48
- //
49
- // The semispaces of the young generation are contiguous. The old and map
50
- // spaces consists of a list of pages. A page has a page header and an object
51
- // area. A page size is deliberately chosen as 8K bytes.
52
- // The first word of a page is an opaque page header that has the
53
- // address of the next page and its ownership information. The second word may
54
- // have the allocation top address of this page. Heap objects are aligned to the
55
- // pointer size.
56
- //
57
- // There is a separate large object space for objects larger than
58
- // Page::kMaxHeapObjectSize, so that they do not have to move during
59
- // collection. The large object space is paged. Pages in large object space
60
- // may be larger than 8K.
61
- //
62
- // A card marking write barrier is used to keep track of intergenerational
63
- // references. Old space pages are divided into regions of Page::kRegionSize
64
- // size. Each region has a corresponding dirty bit in the page header which is
65
- // set if the region might contain pointers to new space. For details about
66
- // dirty bits encoding see comments in the Page::GetRegionNumberForAddress()
67
- // method body.
68
- //
69
- // During scavenges and mark-sweep collections we iterate intergenerational
70
- // pointers without decoding heap object maps so if the page belongs to old
71
- // pointer space or large object space it is essential to guarantee that
72
- // the page does not contain any garbage pointers to new space: every pointer
73
- // aligned word which satisfies the Heap::InNewSpace() predicate must be a
74
- // pointer to a live heap object in new space. Thus objects in old pointer
75
- // and large object spaces should have a special layout (e.g. no bare integer
76
- // fields). This requirement does not apply to map space which is iterated in
77
- // a special fashion. However we still require pointer fields of dead maps to
78
- // be cleaned.
79
- //
80
- // To enable lazy cleaning of old space pages we use a notion of allocation
81
- // watermark. Every pointer under watermark is considered to be well formed.
82
- // Page allocation watermark is not necessarily equal to page allocation top but
83
- // all alive objects on page should reside under allocation watermark.
84
- // During scavenge allocation watermark might be bumped and invalid pointers
85
- // might appear below it. To avoid following them we store a valid watermark
86
- // into special field in the page header and set a page WATERMARK_INVALIDATED
87
- // flag. For details see comments in the Page::SetAllocationWatermark() method
88
- // body.
89
- //
90
-
91
- // Some assertion macros used in the debugging mode.
92
-
93
- #define ASSERT_PAGE_ALIGNED(address) \
94
- ASSERT((OffsetFrom(address) & Page::kPageAlignmentMask) == 0)
95
-
96
- #define ASSERT_OBJECT_ALIGNED(address) \
97
- ASSERT((OffsetFrom(address) & kObjectAlignmentMask) == 0)
98
-
99
- #define ASSERT_MAP_ALIGNED(address) \
100
- ASSERT((OffsetFrom(address) & kMapAlignmentMask) == 0)
101
-
102
- #define ASSERT_OBJECT_SIZE(size) \
103
- ASSERT((0 < size) && (size <= Page::kMaxHeapObjectSize))
104
-
105
- #define ASSERT_PAGE_OFFSET(offset) \
106
- ASSERT((Page::kObjectStartOffset <= offset) \
107
- && (offset <= Page::kPageSize))
108
-
109
- #define ASSERT_MAP_PAGE_INDEX(index) \
110
- ASSERT((0 <= index) && (index <= MapSpace::kMaxMapPageIndex))
111
-
112
-
113
- class PagedSpace;
114
- class MemoryAllocator;
115
- class AllocationInfo;
116
-
117
- // -----------------------------------------------------------------------------
118
- // A page normally has 8K bytes. Large object pages may be larger. A page
119
- // address is always aligned to the 8K page size.
120
- //
121
- // Each page starts with a header of Page::kPageHeaderSize size which contains
122
- // bookkeeping data.
123
- //
124
- // The mark-compact collector transforms a map pointer into a page index and a
125
- // page offset. The exact encoding is described in the comments for
126
- // class MapWord in objects.h.
127
- //
128
- // The only way to get a page pointer is by calling factory methods:
129
- // Page* p = Page::FromAddress(addr); or
130
- // Page* p = Page::FromAllocationTop(top);
131
- class Page {
132
- public:
133
- // Returns the page containing a given address. The address ranges
134
- // from [page_addr .. page_addr + kPageSize[
135
- //
136
- // Note that this function only works for addresses in normal paged
137
- // spaces and addresses in the first 8K of large object pages (i.e.,
138
- // the start of large objects but not necessarily derived pointers
139
- // within them).
140
- INLINE(static Page* FromAddress(Address a)) {
141
- return reinterpret_cast<Page*>(OffsetFrom(a) & ~kPageAlignmentMask);
142
- }
143
-
144
- // Returns the page containing an allocation top. Because an allocation
145
- // top address can be the upper bound of the page, we need to subtract
146
- // it with kPointerSize first. The address ranges from
147
- // [page_addr + kObjectStartOffset .. page_addr + kPageSize].
148
- INLINE(static Page* FromAllocationTop(Address top)) {
149
- Page* p = FromAddress(top - kPointerSize);
150
- ASSERT_PAGE_OFFSET(p->Offset(top));
151
- return p;
152
- }
153
-
154
- // Returns the start address of this page.
155
- Address address() { return reinterpret_cast<Address>(this); }
156
-
157
- // Checks whether this is a valid page address.
158
- bool is_valid() { return address() != NULL; }
159
-
160
- // Returns the next page of this page.
161
- inline Page* next_page();
162
-
163
- // Return the end of allocation in this page. Undefined for unused pages.
164
- inline Address AllocationTop();
165
-
166
- // Return the allocation watermark for the page.
167
- // For old space pages it is guaranteed that the area under the watermark
168
- // does not contain any garbage pointers to new space.
169
- inline Address AllocationWatermark();
170
-
171
- // Return the allocation watermark offset from the beginning of the page.
172
- inline uint32_t AllocationWatermarkOffset();
173
-
174
- inline void SetAllocationWatermark(Address allocation_watermark);
175
-
176
- inline void SetCachedAllocationWatermark(Address allocation_watermark);
177
- inline Address CachedAllocationWatermark();
178
-
179
- // Returns the start address of the object area in this page.
180
- Address ObjectAreaStart() { return address() + kObjectStartOffset; }
181
-
182
- // Returns the end address (exclusive) of the object area in this page.
183
- Address ObjectAreaEnd() { return address() + Page::kPageSize; }
184
-
185
- // Checks whether an address is page aligned.
186
- static bool IsAlignedToPageSize(Address a) {
187
- return 0 == (OffsetFrom(a) & kPageAlignmentMask);
188
- }
189
-
190
- // True if this page was in use before current compaction started.
191
- // Result is valid only for pages owned by paged spaces and
192
- // only after PagedSpace::PrepareForMarkCompact was called.
193
- inline bool WasInUseBeforeMC();
194
-
195
- inline void SetWasInUseBeforeMC(bool was_in_use);
196
-
197
- // True if this page is a large object page.
198
- inline bool IsLargeObjectPage();
199
-
200
- inline void SetIsLargeObjectPage(bool is_large_object_page);
201
-
202
- inline bool IsPageExecutable();
203
-
204
- inline void SetIsPageExecutable(bool is_page_executable);
205
-
206
- // Returns the offset of a given address to this page.
207
- INLINE(int Offset(Address a)) {
208
- int offset = static_cast<int>(a - address());
209
- ASSERT_PAGE_OFFSET(offset);
210
- return offset;
211
- }
212
-
213
- // Returns the address for a given offset to the this page.
214
- Address OffsetToAddress(int offset) {
215
- ASSERT_PAGE_OFFSET(offset);
216
- return address() + offset;
217
- }
218
-
219
- // ---------------------------------------------------------------------
220
- // Card marking support
221
-
222
- static const uint32_t kAllRegionsCleanMarks = 0x0;
223
- static const uint32_t kAllRegionsDirtyMarks = 0xFFFFFFFF;
224
-
225
- inline uint32_t GetRegionMarks();
226
- inline void SetRegionMarks(uint32_t dirty);
227
-
228
- inline uint32_t GetRegionMaskForAddress(Address addr);
229
- inline uint32_t GetRegionMaskForSpan(Address start, int length_in_bytes);
230
- inline int GetRegionNumberForAddress(Address addr);
231
-
232
- inline void MarkRegionDirty(Address addr);
233
- inline bool IsRegionDirty(Address addr);
234
-
235
- inline void ClearRegionMarks(Address start,
236
- Address end,
237
- bool reaches_limit);
238
-
239
- // Page size in bytes. This must be a multiple of the OS page size.
240
- static const int kPageSize = 1 << kPageSizeBits;
241
-
242
- // Page size mask.
243
- static const intptr_t kPageAlignmentMask = (1 << kPageSizeBits) - 1;
244
-
245
- static const int kPageHeaderSize = kPointerSize + kPointerSize + kIntSize +
246
- kIntSize + kPointerSize + kPointerSize;
247
-
248
- // The start offset of the object area in a page. Aligned to both maps and
249
- // code alignment to be suitable for both.
250
- static const int kObjectStartOffset =
251
- CODE_POINTER_ALIGN(MAP_POINTER_ALIGN(kPageHeaderSize));
252
-
253
- // Object area size in bytes.
254
- static const int kObjectAreaSize = kPageSize - kObjectStartOffset;
255
-
256
- // Maximum object size that fits in a page.
257
- static const int kMaxHeapObjectSize = kObjectAreaSize;
258
-
259
- static const int kDirtyFlagOffset = 2 * kPointerSize;
260
- static const int kRegionSizeLog2 = 8;
261
- static const int kRegionSize = 1 << kRegionSizeLog2;
262
- static const intptr_t kRegionAlignmentMask = (kRegionSize - 1);
263
-
264
- STATIC_CHECK(kRegionSize == kPageSize / kBitsPerInt);
265
-
266
- enum PageFlag {
267
- IS_NORMAL_PAGE = 0,
268
- WAS_IN_USE_BEFORE_MC,
269
-
270
- // Page allocation watermark was bumped by preallocation during scavenge.
271
- // Correct watermark can be retrieved by CachedAllocationWatermark() method
272
- WATERMARK_INVALIDATED,
273
- IS_EXECUTABLE,
274
- NUM_PAGE_FLAGS // Must be last
275
- };
276
- static const int kPageFlagMask = (1 << NUM_PAGE_FLAGS) - 1;
277
-
278
- // To avoid an additional WATERMARK_INVALIDATED flag clearing pass during
279
- // scavenge we just invalidate the watermark on each old space page after
280
- // processing it. And then we flip the meaning of the WATERMARK_INVALIDATED
281
- // flag at the beginning of the next scavenge and each page becomes marked as
282
- // having a valid watermark.
283
- //
284
- // The following invariant must hold for pages in old pointer and map spaces:
285
- // If page is in use then page is marked as having invalid watermark at
286
- // the beginning and at the end of any GC.
287
- //
288
- // This invariant guarantees that after flipping flag meaning at the
289
- // beginning of scavenge all pages in use will be marked as having valid
290
- // watermark.
291
- static inline void FlipMeaningOfInvalidatedWatermarkFlag(Heap* heap);
292
-
293
- // Returns true if the page allocation watermark was not altered during
294
- // scavenge.
295
- inline bool IsWatermarkValid();
296
-
297
- inline void InvalidateWatermark(bool value);
298
-
299
- inline bool GetPageFlag(PageFlag flag);
300
- inline void SetPageFlag(PageFlag flag, bool value);
301
- inline void ClearPageFlags();
302
-
303
- inline void ClearGCFields();
304
-
305
- static const int kAllocationWatermarkOffsetShift = WATERMARK_INVALIDATED + 1;
306
- static const int kAllocationWatermarkOffsetBits = kPageSizeBits + 1;
307
- static const uint32_t kAllocationWatermarkOffsetMask =
308
- ((1 << kAllocationWatermarkOffsetBits) - 1) <<
309
- kAllocationWatermarkOffsetShift;
310
-
311
- static const uint32_t kFlagsMask =
312
- ((1 << kAllocationWatermarkOffsetShift) - 1);
313
-
314
- STATIC_CHECK(kBitsPerInt - kAllocationWatermarkOffsetShift >=
315
- kAllocationWatermarkOffsetBits);
316
-
317
- //---------------------------------------------------------------------------
318
- // Page header description.
319
- //
320
- // If a page is not in the large object space, the first word,
321
- // opaque_header, encodes the next page address (aligned to kPageSize 8K)
322
- // and the chunk number (0 ~ 8K-1). Only MemoryAllocator should use
323
- // opaque_header. The value range of the opaque_header is [0..kPageSize[,
324
- // or [next_page_start, next_page_end[. It cannot point to a valid address
325
- // in the current page. If a page is in the large object space, the first
326
- // word *may* (if the page start and large object chunk start are the
327
- // same) contain the address of the next large object chunk.
328
- intptr_t opaque_header;
329
-
330
- // If the page is not in the large object space, the low-order bit of the
331
- // second word is set. If the page is in the large object space, the
332
- // second word *may* (if the page start and large object chunk start are
333
- // the same) contain the large object chunk size. In either case, the
334
- // low-order bit for large object pages will be cleared.
335
- // For normal pages this word is used to store page flags and
336
- // offset of allocation top.
337
- intptr_t flags_;
338
-
339
- // This field contains dirty marks for regions covering the page. Only dirty
340
- // regions might contain intergenerational references.
341
- // Only 32 dirty marks are supported so for large object pages several regions
342
- // might be mapped to a single dirty mark.
343
- uint32_t dirty_regions_;
344
-
345
- // The index of the page in its owner space.
346
- int mc_page_index;
347
-
348
- // During mark-compact collections this field contains the forwarding address
349
- // of the first live object in this page.
350
- // During scavenge collection this field is used to store allocation watermark
351
- // if it is altered during scavenge.
352
- Address mc_first_forwarded;
353
-
354
- Heap* heap_;
355
- };
356
-
357
-
358
- // ----------------------------------------------------------------------------
359
- // Space is the abstract superclass for all allocation spaces.
360
- class Space : public Malloced {
361
- public:
362
- Space(Heap* heap, AllocationSpace id, Executability executable)
363
- : heap_(heap), id_(id), executable_(executable) {}
364
-
365
- virtual ~Space() {}
366
-
367
- Heap* heap() const { return heap_; }
368
-
369
- // Does the space need executable memory?
370
- Executability executable() { return executable_; }
371
-
372
- // Identity used in error reporting.
373
- AllocationSpace identity() { return id_; }
374
-
375
- // Returns allocated size.
376
- virtual intptr_t Size() = 0;
377
-
378
- // Returns size of objects. Can differ from the allocated size
379
- // (e.g. see LargeObjectSpace).
380
- virtual intptr_t SizeOfObjects() { return Size(); }
381
-
382
- #ifdef ENABLE_HEAP_PROTECTION
383
- // Protect/unprotect the space by marking it read-only/writable.
384
- virtual void Protect() = 0;
385
- virtual void Unprotect() = 0;
386
- #endif
387
-
388
- #ifdef DEBUG
389
- virtual void Print() = 0;
390
- #endif
391
-
392
- // After calling this we can allocate a certain number of bytes using only
393
- // linear allocation (with a LinearAllocationScope and an AlwaysAllocateScope)
394
- // without using freelists or causing a GC. This is used by partial
395
- // snapshots. It returns true of space was reserved or false if a GC is
396
- // needed. For paged spaces the space requested must include the space wasted
397
- // at the end of each when allocating linearly.
398
- virtual bool ReserveSpace(int bytes) = 0;
399
-
400
- private:
401
- Heap* heap_;
402
- AllocationSpace id_;
403
- Executability executable_;
404
- };
405
-
406
-
407
- // ----------------------------------------------------------------------------
408
- // All heap objects containing executable code (code objects) must be allocated
409
- // from a 2 GB range of memory, so that they can call each other using 32-bit
410
- // displacements. This happens automatically on 32-bit platforms, where 32-bit
411
- // displacements cover the entire 4GB virtual address space. On 64-bit
412
- // platforms, we support this using the CodeRange object, which reserves and
413
- // manages a range of virtual memory.
414
- class CodeRange {
415
- public:
416
- // Reserves a range of virtual memory, but does not commit any of it.
417
- // Can only be called once, at heap initialization time.
418
- // Returns false on failure.
419
- bool Setup(const size_t requested_size);
420
-
421
- // Frees the range of virtual memory, and frees the data structures used to
422
- // manage it.
423
- void TearDown();
424
-
425
- bool exists() { return code_range_ != NULL; }
426
- bool contains(Address address) {
427
- if (code_range_ == NULL) return false;
428
- Address start = static_cast<Address>(code_range_->address());
429
- return start <= address && address < start + code_range_->size();
430
- }
431
-
432
- // Allocates a chunk of memory from the large-object portion of
433
- // the code range. On platforms with no separate code range, should
434
- // not be called.
435
- MUST_USE_RESULT void* AllocateRawMemory(const size_t requested,
436
- size_t* allocated);
437
- void FreeRawMemory(void* buf, size_t length);
438
-
439
- private:
440
- CodeRange();
441
-
442
- // The reserved range of virtual memory that all code objects are put in.
443
- VirtualMemory* code_range_;
444
- // Plain old data class, just a struct plus a constructor.
445
- class FreeBlock {
446
- public:
447
- FreeBlock(Address start_arg, size_t size_arg)
448
- : start(start_arg), size(size_arg) {}
449
- FreeBlock(void* start_arg, size_t size_arg)
450
- : start(static_cast<Address>(start_arg)), size(size_arg) {}
451
-
452
- Address start;
453
- size_t size;
454
- };
455
-
456
- // Freed blocks of memory are added to the free list. When the allocation
457
- // list is exhausted, the free list is sorted and merged to make the new
458
- // allocation list.
459
- List<FreeBlock> free_list_;
460
- // Memory is allocated from the free blocks on the allocation list.
461
- // The block at current_allocation_block_index_ is the current block.
462
- List<FreeBlock> allocation_list_;
463
- int current_allocation_block_index_;
464
-
465
- // Finds a block on the allocation list that contains at least the
466
- // requested amount of memory. If none is found, sorts and merges
467
- // the existing free memory blocks, and searches again.
468
- // If none can be found, terminates V8 with FatalProcessOutOfMemory.
469
- void GetNextAllocationBlock(size_t requested);
470
- // Compares the start addresses of two free blocks.
471
- static int CompareFreeBlockAddress(const FreeBlock* left,
472
- const FreeBlock* right);
473
-
474
- friend class Isolate;
475
-
476
- Isolate* isolate_;
477
-
478
- DISALLOW_COPY_AND_ASSIGN(CodeRange);
479
- };
480
-
481
-
482
- // ----------------------------------------------------------------------------
483
- // A space acquires chunks of memory from the operating system. The memory
484
- // allocator manages chunks for the paged heap spaces (old space and map
485
- // space). A paged chunk consists of pages. Pages in a chunk have contiguous
486
- // addresses and are linked as a list.
487
- //
488
- // The allocator keeps an initial chunk which is used for the new space. The
489
- // leftover regions of the initial chunk are used for the initial chunks of
490
- // old space and map space if they are big enough to hold at least one page.
491
- // The allocator assumes that there is one old space and one map space, each
492
- // expands the space by allocating kPagesPerChunk pages except the last
493
- // expansion (before running out of space). The first chunk may contain fewer
494
- // than kPagesPerChunk pages as well.
495
- //
496
- // The memory allocator also allocates chunks for the large object space, but
497
- // they are managed by the space itself. The new space does not expand.
498
- //
499
- // The fact that pages for paged spaces are allocated and deallocated in chunks
500
- // induces a constraint on the order of pages in a linked lists. We say that
501
- // pages are linked in the chunk-order if and only if every two consecutive
502
- // pages from the same chunk are consecutive in the linked list.
503
- //
504
-
505
-
506
- class MemoryAllocator {
507
- public:
508
- // Initializes its internal bookkeeping structures.
509
- // Max capacity of the total space and executable memory limit.
510
- bool Setup(intptr_t max_capacity, intptr_t capacity_executable);
511
-
512
- // Deletes valid chunks.
513
- void TearDown();
514
-
515
- // Reserves an initial address range of virtual memory to be split between
516
- // the two new space semispaces, the old space, and the map space. The
517
- // memory is not yet committed or assigned to spaces and split into pages.
518
- // The initial chunk is unmapped when the memory allocator is torn down.
519
- // This function should only be called when there is not already a reserved
520
- // initial chunk (initial_chunk_ should be NULL). It returns the start
521
- // address of the initial chunk if successful, with the side effect of
522
- // setting the initial chunk, or else NULL if unsuccessful and leaves the
523
- // initial chunk NULL.
524
- void* ReserveInitialChunk(const size_t requested);
525
-
526
- // Commits pages from an as-yet-unmanaged block of virtual memory into a
527
- // paged space. The block should be part of the initial chunk reserved via
528
- // a call to ReserveInitialChunk. The number of pages is always returned in
529
- // the output parameter num_pages. This function assumes that the start
530
- // address is non-null and that it is big enough to hold at least one
531
- // page-aligned page. The call always succeeds, and num_pages is always
532
- // greater than zero.
533
- Page* CommitPages(Address start, size_t size, PagedSpace* owner,
534
- int* num_pages);
535
-
536
- // Commit a contiguous block of memory from the initial chunk. Assumes that
537
- // the address is not NULL, the size is greater than zero, and that the
538
- // block is contained in the initial chunk. Returns true if it succeeded
539
- // and false otherwise.
540
- bool CommitBlock(Address start, size_t size, Executability executable);
541
-
542
- // Uncommit a contiguous block of memory [start..(start+size)[.
543
- // start is not NULL, the size is greater than zero, and the
544
- // block is contained in the initial chunk. Returns true if it succeeded
545
- // and false otherwise.
546
- bool UncommitBlock(Address start, size_t size);
547
-
548
- // Zaps a contiguous block of memory [start..(start+size)[ thus
549
- // filling it up with a recognizable non-NULL bit pattern.
550
- void ZapBlock(Address start, size_t size);
551
-
552
- // Attempts to allocate the requested (non-zero) number of pages from the
553
- // OS. Fewer pages might be allocated than requested. If it fails to
554
- // allocate memory for the OS or cannot allocate a single page, this
555
- // function returns an invalid page pointer (NULL). The caller must check
556
- // whether the returned page is valid (by calling Page::is_valid()). It is
557
- // guaranteed that allocated pages have contiguous addresses. The actual
558
- // number of allocated pages is returned in the output parameter
559
- // allocated_pages. If the PagedSpace owner is executable and there is
560
- // a code range, the pages are allocated from the code range.
561
- Page* AllocatePages(int requested_pages, int* allocated_pages,
562
- PagedSpace* owner);
563
-
564
- // Frees pages from a given page and after. Requires pages to be
565
- // linked in chunk-order (see comment for class).
566
- // If 'p' is the first page of a chunk, pages from 'p' are freed
567
- // and this function returns an invalid page pointer.
568
- // Otherwise, the function searches a page after 'p' that is
569
- // the first page of a chunk. Pages after the found page
570
- // are freed and the function returns 'p'.
571
- Page* FreePages(Page* p);
572
-
573
- // Frees all pages owned by given space.
574
- void FreeAllPages(PagedSpace* space);
575
-
576
- // Allocates and frees raw memory of certain size.
577
- // These are just thin wrappers around OS::Allocate and OS::Free,
578
- // but keep track of allocated bytes as part of heap.
579
- // If the flag is EXECUTABLE and a code range exists, the requested
580
- // memory is allocated from the code range. If a code range exists
581
- // and the freed memory is in it, the code range manages the freed memory.
582
- MUST_USE_RESULT void* AllocateRawMemory(const size_t requested,
583
- size_t* allocated,
584
- Executability executable);
585
- void FreeRawMemory(void* buf,
586
- size_t length,
587
- Executability executable);
588
- void PerformAllocationCallback(ObjectSpace space,
589
- AllocationAction action,
590
- size_t size);
591
-
592
- void AddMemoryAllocationCallback(MemoryAllocationCallback callback,
593
- ObjectSpace space,
594
- AllocationAction action);
595
- void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback);
596
- bool MemoryAllocationCallbackRegistered(MemoryAllocationCallback callback);
597
-
598
- // Returns the maximum available bytes of heaps.
599
- intptr_t Available() { return capacity_ < size_ ? 0 : capacity_ - size_; }
600
-
601
- // Returns allocated spaces in bytes.
602
- intptr_t Size() { return size_; }
603
-
604
- // Returns the maximum available executable bytes of heaps.
605
- intptr_t AvailableExecutable() {
606
- if (capacity_executable_ < size_executable_) return 0;
607
- return capacity_executable_ - size_executable_;
608
- }
609
-
610
- // Returns allocated executable spaces in bytes.
611
- intptr_t SizeExecutable() { return size_executable_; }
612
-
613
- // Returns maximum available bytes that the old space can have.
614
- intptr_t MaxAvailable() {
615
- return (Available() / Page::kPageSize) * Page::kObjectAreaSize;
616
- }
617
-
618
- // Links two pages.
619
- inline void SetNextPage(Page* prev, Page* next);
620
-
621
- // Returns the next page of a given page.
622
- inline Page* GetNextPage(Page* p);
623
-
624
- // Checks whether a page belongs to a space.
625
- inline bool IsPageInSpace(Page* p, PagedSpace* space);
626
-
627
- // Returns the space that owns the given page.
628
- inline PagedSpace* PageOwner(Page* page);
629
-
630
- // Finds the first/last page in the same chunk as a given page.
631
- Page* FindFirstPageInSameChunk(Page* p);
632
- Page* FindLastPageInSameChunk(Page* p);
633
-
634
- // Relinks list of pages owned by space to make it chunk-ordered.
635
- // Returns new first and last pages of space.
636
- // Also returns last page in relinked list which has WasInUsedBeforeMC
637
- // flag set.
638
- void RelinkPageListInChunkOrder(PagedSpace* space,
639
- Page** first_page,
640
- Page** last_page,
641
- Page** last_page_in_use);
642
-
643
- #ifdef ENABLE_HEAP_PROTECTION
644
- // Protect/unprotect a block of memory by marking it read-only/writable.
645
- inline void Protect(Address start, size_t size);
646
- inline void Unprotect(Address start, size_t size,
647
- Executability executable);
648
-
649
- // Protect/unprotect a chunk given a page in the chunk.
650
- inline void ProtectChunkFromPage(Page* page);
651
- inline void UnprotectChunkFromPage(Page* page);
652
- #endif
653
-
654
- #ifdef DEBUG
655
- // Reports statistic info of the space.
656
- void ReportStatistics();
657
- #endif
658
-
659
- // Due to encoding limitation, we can only have 8K chunks.
660
- static const int kMaxNofChunks = 1 << kPageSizeBits;
661
- // If a chunk has at least 16 pages, the maximum heap size is about
662
- // 8K * 8K * 16 = 1G bytes.
663
- #ifdef V8_TARGET_ARCH_X64
664
- static const int kPagesPerChunk = 32;
665
- // On 64 bit the chunk table consists of 4 levels of 4096-entry tables.
666
- static const int kPagesPerChunkLog2 = 5;
667
- static const int kChunkTableLevels = 4;
668
- static const int kChunkTableBitsPerLevel = 12;
669
- #else
670
- static const int kPagesPerChunk = 16;
671
- // On 32 bit the chunk table consists of 2 levels of 256-entry tables.
672
- static const int kPagesPerChunkLog2 = 4;
673
- static const int kChunkTableLevels = 2;
674
- static const int kChunkTableBitsPerLevel = 8;
675
- #endif
676
-
677
- private:
678
- MemoryAllocator();
679
-
680
- static const int kChunkSize = kPagesPerChunk * Page::kPageSize;
681
- static const int kChunkSizeLog2 = kPagesPerChunkLog2 + kPageSizeBits;
682
-
683
- // Maximum space size in bytes.
684
- intptr_t capacity_;
685
- // Maximum subset of capacity_ that can be executable
686
- intptr_t capacity_executable_;
687
-
688
- // Allocated space size in bytes.
689
- intptr_t size_;
690
-
691
- // Allocated executable space size in bytes.
692
- intptr_t size_executable_;
693
-
694
- struct MemoryAllocationCallbackRegistration {
695
- MemoryAllocationCallbackRegistration(MemoryAllocationCallback callback,
696
- ObjectSpace space,
697
- AllocationAction action)
698
- : callback(callback), space(space), action(action) {
699
- }
700
- MemoryAllocationCallback callback;
701
- ObjectSpace space;
702
- AllocationAction action;
703
- };
704
- // A List of callback that are triggered when memory is allocated or free'd
705
- List<MemoryAllocationCallbackRegistration>
706
- memory_allocation_callbacks_;
707
-
708
- // The initial chunk of virtual memory.
709
- VirtualMemory* initial_chunk_;
710
-
711
- // Allocated chunk info: chunk start address, chunk size, and owning space.
712
- class ChunkInfo BASE_EMBEDDED {
713
- public:
714
- ChunkInfo() : address_(NULL),
715
- size_(0),
716
- owner_(NULL),
717
- executable_(NOT_EXECUTABLE),
718
- owner_identity_(FIRST_SPACE) {}
719
- inline void init(Address a, size_t s, PagedSpace* o);
720
- Address address() { return address_; }
721
- size_t size() { return size_; }
722
- PagedSpace* owner() { return owner_; }
723
- // We save executability of the owner to allow using it
724
- // when collecting stats after the owner has been destroyed.
725
- Executability executable() const { return executable_; }
726
- AllocationSpace owner_identity() const { return owner_identity_; }
727
-
728
- private:
729
- Address address_;
730
- size_t size_;
731
- PagedSpace* owner_;
732
- Executability executable_;
733
- AllocationSpace owner_identity_;
734
- };
735
-
736
- // Chunks_, free_chunk_ids_ and top_ act as a stack of free chunk ids.
737
- List<ChunkInfo> chunks_;
738
- List<int> free_chunk_ids_;
739
- int max_nof_chunks_;
740
- int top_;
741
-
742
- // Push/pop a free chunk id onto/from the stack.
743
- void Push(int free_chunk_id);
744
- int Pop();
745
- bool OutOfChunkIds() { return top_ == 0; }
746
-
747
- // Frees a chunk.
748
- void DeleteChunk(int chunk_id);
749
-
750
- // Basic check whether a chunk id is in the valid range.
751
- inline bool IsValidChunkId(int chunk_id);
752
-
753
- // Checks whether a chunk id identifies an allocated chunk.
754
- inline bool IsValidChunk(int chunk_id);
755
-
756
- // Returns the chunk id that a page belongs to.
757
- inline int GetChunkId(Page* p);
758
-
759
- // True if the address lies in the initial chunk.
760
- inline bool InInitialChunk(Address address);
761
-
762
- // Initializes pages in a chunk. Returns the first page address.
763
- // This function and GetChunkId() are provided for the mark-compact
764
- // collector to rebuild page headers in the from space, which is
765
- // used as a marking stack and its page headers are destroyed.
766
- Page* InitializePagesInChunk(int chunk_id, int pages_in_chunk,
767
- PagedSpace* owner);
768
-
769
- Page* RelinkPagesInChunk(int chunk_id,
770
- Address chunk_start,
771
- size_t chunk_size,
772
- Page* prev,
773
- Page** last_page_in_use);
774
-
775
- friend class Isolate;
776
-
777
- Isolate* isolate_;
778
-
779
- DISALLOW_COPY_AND_ASSIGN(MemoryAllocator);
780
- };
781
-
782
-
783
- // -----------------------------------------------------------------------------
784
- // Interface for heap object iterator to be implemented by all object space
785
- // object iterators.
786
- //
787
- // NOTE: The space specific object iterators also implements the own next()
788
- // method which is used to avoid using virtual functions
789
- // iterating a specific space.
790
-
791
- class ObjectIterator : public Malloced {
792
- public:
793
- virtual ~ObjectIterator() { }
794
-
795
- virtual HeapObject* next_object() = 0;
796
- };
797
-
798
-
799
- // -----------------------------------------------------------------------------
800
- // Heap object iterator in new/old/map spaces.
801
- //
802
- // A HeapObjectIterator iterates objects from a given address to the
803
- // top of a space. The given address must be below the current
804
- // allocation pointer (space top). There are some caveats.
805
- //
806
- // (1) If the space top changes upward during iteration (because of
807
- // allocating new objects), the iterator does not iterate objects
808
- // above the original space top. The caller must create a new
809
- // iterator starting from the old top in order to visit these new
810
- // objects.
811
- //
812
- // (2) If new objects are allocated below the original allocation top
813
- // (e.g., free-list allocation in paged spaces), the new objects
814
- // may or may not be iterated depending on their position with
815
- // respect to the current point of iteration.
816
- //
817
- // (3) The space top should not change downward during iteration,
818
- // otherwise the iterator will return not-necessarily-valid
819
- // objects.
820
-
821
- class HeapObjectIterator: public ObjectIterator {
822
- public:
823
- // Creates a new object iterator in a given space. If a start
824
- // address is not given, the iterator starts from the space bottom.
825
- // If the size function is not given, the iterator calls the default
826
- // Object::Size().
827
- explicit HeapObjectIterator(PagedSpace* space);
828
- HeapObjectIterator(PagedSpace* space, HeapObjectCallback size_func);
829
- HeapObjectIterator(PagedSpace* space, Address start);
830
- HeapObjectIterator(PagedSpace* space,
831
- Address start,
832
- HeapObjectCallback size_func);
833
- HeapObjectIterator(Page* page, HeapObjectCallback size_func);
834
-
835
- inline HeapObject* next() {
836
- return (cur_addr_ < cur_limit_) ? FromCurrentPage() : FromNextPage();
837
- }
838
-
839
- // implementation of ObjectIterator.
840
- virtual HeapObject* next_object() { return next(); }
841
-
842
- private:
843
- Address cur_addr_; // current iteration point
844
- Address end_addr_; // end iteration point
845
- Address cur_limit_; // current page limit
846
- HeapObjectCallback size_func_; // size function
847
- Page* end_page_; // caches the page of the end address
848
-
849
- HeapObject* FromCurrentPage() {
850
- ASSERT(cur_addr_ < cur_limit_);
851
-
852
- HeapObject* obj = HeapObject::FromAddress(cur_addr_);
853
- int obj_size = (size_func_ == NULL) ? obj->Size() : size_func_(obj);
854
- ASSERT_OBJECT_SIZE(obj_size);
855
-
856
- cur_addr_ += obj_size;
857
- ASSERT(cur_addr_ <= cur_limit_);
858
-
859
- return obj;
860
- }
861
-
862
- // Slow path of next, goes into the next page.
863
- HeapObject* FromNextPage();
864
-
865
- // Initializes fields.
866
- void Initialize(Address start, Address end, HeapObjectCallback size_func);
867
-
868
- #ifdef DEBUG
869
- // Verifies whether fields have valid values.
870
- void Verify();
871
- #endif
872
- };
873
-
874
-
875
- // -----------------------------------------------------------------------------
876
- // A PageIterator iterates the pages in a paged space.
877
- //
878
- // The PageIterator class provides three modes for iterating pages in a space:
879
- // PAGES_IN_USE iterates pages containing allocated objects.
880
- // PAGES_USED_BY_MC iterates pages that hold relocated objects during a
881
- // mark-compact collection.
882
- // ALL_PAGES iterates all pages in the space.
883
- //
884
- // There are some caveats.
885
- //
886
- // (1) If the space expands during iteration, new pages will not be
887
- // returned by the iterator in any mode.
888
- //
889
- // (2) If new objects are allocated during iteration, they will appear
890
- // in pages returned by the iterator. Allocation may cause the
891
- // allocation pointer or MC allocation pointer in the last page to
892
- // change between constructing the iterator and iterating the last
893
- // page.
894
- //
895
- // (3) The space should not shrink during iteration, otherwise the
896
- // iterator will return deallocated pages.
897
-
898
- class PageIterator BASE_EMBEDDED {
899
- public:
900
- enum Mode {
901
- PAGES_IN_USE,
902
- PAGES_USED_BY_MC,
903
- ALL_PAGES
904
- };
905
-
906
- PageIterator(PagedSpace* space, Mode mode);
907
-
908
- inline bool has_next();
909
- inline Page* next();
910
-
911
- private:
912
- PagedSpace* space_;
913
- Page* prev_page_; // Previous page returned.
914
- Page* stop_page_; // Page to stop at (last page returned by the iterator).
915
- };
916
-
917
-
918
- // -----------------------------------------------------------------------------
919
- // A space has a list of pages. The next page can be accessed via
920
- // Page::next_page() call. The next page of the last page is an
921
- // invalid page pointer. A space can expand and shrink dynamically.
922
-
923
- // An abstraction of allocation and relocation pointers in a page-structured
924
- // space.
925
- class AllocationInfo {
926
- public:
927
- Address top; // current allocation top
928
- Address limit; // current allocation limit
929
-
930
- #ifdef DEBUG
931
- bool VerifyPagedAllocation() {
932
- return (Page::FromAllocationTop(top) == Page::FromAllocationTop(limit))
933
- && (top <= limit);
934
- }
935
- #endif
936
- };
937
-
938
-
939
- // An abstraction of the accounting statistics of a page-structured space.
940
- // The 'capacity' of a space is the number of object-area bytes (ie, not
941
- // including page bookkeeping structures) currently in the space. The 'size'
942
- // of a space is the number of allocated bytes, the 'waste' in the space is
943
- // the number of bytes that are not allocated and not available to
944
- // allocation without reorganizing the space via a GC (eg, small blocks due
945
- // to internal fragmentation, top of page areas in map space), and the bytes
946
- // 'available' is the number of unallocated bytes that are not waste. The
947
- // capacity is the sum of size, waste, and available.
948
- //
949
- // The stats are only set by functions that ensure they stay balanced. These
950
- // functions increase or decrease one of the non-capacity stats in
951
- // conjunction with capacity, or else they always balance increases and
952
- // decreases to the non-capacity stats.
953
- class AllocationStats BASE_EMBEDDED {
954
- public:
955
- AllocationStats() { Clear(); }
956
-
957
- // Zero out all the allocation statistics (ie, no capacity).
958
- void Clear() {
959
- capacity_ = 0;
960
- available_ = 0;
961
- size_ = 0;
962
- waste_ = 0;
963
- }
964
-
965
- // Reset the allocation statistics (ie, available = capacity with no
966
- // wasted or allocated bytes).
967
- void Reset() {
968
- available_ = capacity_;
969
- size_ = 0;
970
- waste_ = 0;
971
- }
972
-
973
- // Accessors for the allocation statistics.
974
- intptr_t Capacity() { return capacity_; }
975
- intptr_t Available() { return available_; }
976
- intptr_t Size() { return size_; }
977
- intptr_t Waste() { return waste_; }
978
-
979
- // Grow the space by adding available bytes.
980
- void ExpandSpace(int size_in_bytes) {
981
- capacity_ += size_in_bytes;
982
- available_ += size_in_bytes;
983
- }
984
-
985
- // Shrink the space by removing available bytes.
986
- void ShrinkSpace(int size_in_bytes) {
987
- capacity_ -= size_in_bytes;
988
- available_ -= size_in_bytes;
989
- }
990
-
991
- // Allocate from available bytes (available -> size).
992
- void AllocateBytes(intptr_t size_in_bytes) {
993
- available_ -= size_in_bytes;
994
- size_ += size_in_bytes;
995
- }
996
-
997
- // Free allocated bytes, making them available (size -> available).
998
- void DeallocateBytes(intptr_t size_in_bytes) {
999
- size_ -= size_in_bytes;
1000
- available_ += size_in_bytes;
1001
- }
1002
-
1003
- // Waste free bytes (available -> waste).
1004
- void WasteBytes(int size_in_bytes) {
1005
- available_ -= size_in_bytes;
1006
- waste_ += size_in_bytes;
1007
- }
1008
-
1009
- // Consider the wasted bytes to be allocated, as they contain filler
1010
- // objects (waste -> size).
1011
- void FillWastedBytes(intptr_t size_in_bytes) {
1012
- waste_ -= size_in_bytes;
1013
- size_ += size_in_bytes;
1014
- }
1015
-
1016
- private:
1017
- intptr_t capacity_;
1018
- intptr_t available_;
1019
- intptr_t size_;
1020
- intptr_t waste_;
1021
- };
1022
-
1023
-
1024
- class PagedSpace : public Space {
1025
- public:
1026
- // Creates a space with a maximum capacity, and an id.
1027
- PagedSpace(Heap* heap,
1028
- intptr_t max_capacity,
1029
- AllocationSpace id,
1030
- Executability executable);
1031
-
1032
- virtual ~PagedSpace() {}
1033
-
1034
- // Set up the space using the given address range of virtual memory (from
1035
- // the memory allocator's initial chunk) if possible. If the block of
1036
- // addresses is not big enough to contain a single page-aligned page, a
1037
- // fresh chunk will be allocated.
1038
- bool Setup(Address start, size_t size);
1039
-
1040
- // Returns true if the space has been successfully set up and not
1041
- // subsequently torn down.
1042
- bool HasBeenSetup();
1043
-
1044
- // Cleans up the space, frees all pages in this space except those belonging
1045
- // to the initial chunk, uncommits addresses in the initial chunk.
1046
- void TearDown();
1047
-
1048
- // Checks whether an object/address is in this space.
1049
- inline bool Contains(Address a);
1050
- bool Contains(HeapObject* o) { return Contains(o->address()); }
1051
- // Never crashes even if a is not a valid pointer.
1052
- inline bool SafeContains(Address a);
1053
-
1054
- // Given an address occupied by a live object, return that object if it is
1055
- // in this space, or Failure::Exception() if it is not. The implementation
1056
- // iterates over objects in the page containing the address, the cost is
1057
- // linear in the number of objects in the page. It may be slow.
1058
- MUST_USE_RESULT MaybeObject* FindObject(Address addr);
1059
-
1060
- // Checks whether page is currently in use by this space.
1061
- bool IsUsed(Page* page);
1062
-
1063
- void MarkAllPagesClean();
1064
-
1065
- // Prepares for a mark-compact GC.
1066
- virtual void PrepareForMarkCompact(bool will_compact);
1067
-
1068
- // The top of allocation in a page in this space. Undefined if page is unused.
1069
- Address PageAllocationTop(Page* page) {
1070
- return page == TopPageOf(allocation_info_) ? top()
1071
- : PageAllocationLimit(page);
1072
- }
1073
-
1074
- // The limit of allocation for a page in this space.
1075
- virtual Address PageAllocationLimit(Page* page) = 0;
1076
-
1077
- void FlushTopPageWatermark() {
1078
- AllocationTopPage()->SetCachedAllocationWatermark(top());
1079
- AllocationTopPage()->InvalidateWatermark(true);
1080
- }
1081
-
1082
- // Current capacity without growing (Size() + Available() + Waste()).
1083
- intptr_t Capacity() { return accounting_stats_.Capacity(); }
1084
-
1085
- // Total amount of memory committed for this space. For paged
1086
- // spaces this equals the capacity.
1087
- intptr_t CommittedMemory() { return Capacity(); }
1088
-
1089
- // Available bytes without growing.
1090
- intptr_t Available() { return accounting_stats_.Available(); }
1091
-
1092
- // Allocated bytes in this space.
1093
- virtual intptr_t Size() { return accounting_stats_.Size(); }
1094
-
1095
- // Wasted bytes due to fragmentation and not recoverable until the
1096
- // next GC of this space.
1097
- intptr_t Waste() { return accounting_stats_.Waste(); }
1098
-
1099
- // Returns the address of the first object in this space.
1100
- Address bottom() { return first_page_->ObjectAreaStart(); }
1101
-
1102
- // Returns the allocation pointer in this space.
1103
- Address top() { return allocation_info_.top; }
1104
-
1105
- // Allocate the requested number of bytes in the space if possible, return a
1106
- // failure object if not.
1107
- MUST_USE_RESULT inline MaybeObject* AllocateRaw(int size_in_bytes);
1108
-
1109
- // Allocate the requested number of bytes for relocation during mark-compact
1110
- // collection.
1111
- MUST_USE_RESULT inline MaybeObject* MCAllocateRaw(int size_in_bytes);
1112
-
1113
- virtual bool ReserveSpace(int bytes);
1114
-
1115
- // Used by ReserveSpace.
1116
- virtual void PutRestOfCurrentPageOnFreeList(Page* current_page) = 0;
1117
-
1118
- // Free all pages in range from prev (exclusive) to last (inclusive).
1119
- // Freed pages are moved to the end of page list.
1120
- void FreePages(Page* prev, Page* last);
1121
-
1122
- // Deallocates a block.
1123
- virtual void DeallocateBlock(Address start,
1124
- int size_in_bytes,
1125
- bool add_to_freelist) = 0;
1126
-
1127
- // Set space allocation info.
1128
- void SetTop(Address top) {
1129
- allocation_info_.top = top;
1130
- allocation_info_.limit = PageAllocationLimit(Page::FromAllocationTop(top));
1131
- }
1132
-
1133
- // ---------------------------------------------------------------------------
1134
- // Mark-compact collection support functions
1135
-
1136
- // Set the relocation point to the beginning of the space.
1137
- void MCResetRelocationInfo();
1138
-
1139
- // Writes relocation info to the top page.
1140
- void MCWriteRelocationInfoToPage() {
1141
- TopPageOf(mc_forwarding_info_)->
1142
- SetAllocationWatermark(mc_forwarding_info_.top);
1143
- }
1144
-
1145
- // Computes the offset of a given address in this space to the beginning
1146
- // of the space.
1147
- int MCSpaceOffsetForAddress(Address addr);
1148
-
1149
- // Updates the allocation pointer to the relocation top after a mark-compact
1150
- // collection.
1151
- virtual void MCCommitRelocationInfo() = 0;
1152
-
1153
- // Releases half of unused pages.
1154
- void Shrink();
1155
-
1156
- // Ensures that the capacity is at least 'capacity'. Returns false on failure.
1157
- bool EnsureCapacity(int capacity);
1158
-
1159
- #ifdef ENABLE_HEAP_PROTECTION
1160
- // Protect/unprotect the space by marking it read-only/writable.
1161
- void Protect();
1162
- void Unprotect();
1163
- #endif
1164
-
1165
- #ifdef DEBUG
1166
- // Print meta info and objects in this space.
1167
- virtual void Print();
1168
-
1169
- // Verify integrity of this space.
1170
- virtual void Verify(ObjectVisitor* visitor);
1171
-
1172
- // Overridden by subclasses to verify space-specific object
1173
- // properties (e.g., only maps or free-list nodes are in map space).
1174
- virtual void VerifyObject(HeapObject* obj) {}
1175
-
1176
- // Report code object related statistics
1177
- void CollectCodeStatistics();
1178
- static void ReportCodeStatistics();
1179
- static void ResetCodeStatistics();
1180
- #endif
1181
-
1182
- // Returns the page of the allocation pointer.
1183
- Page* AllocationTopPage() { return TopPageOf(allocation_info_); }
1184
-
1185
- void RelinkPageListInChunkOrder(bool deallocate_blocks);
1186
-
1187
- protected:
1188
- // Maximum capacity of this space.
1189
- intptr_t max_capacity_;
1190
-
1191
- // Accounting information for this space.
1192
- AllocationStats accounting_stats_;
1193
-
1194
- // The first page in this space.
1195
- Page* first_page_;
1196
-
1197
- // The last page in this space. Initially set in Setup, updated in
1198
- // Expand and Shrink.
1199
- Page* last_page_;
1200
-
1201
- // True if pages owned by this space are linked in chunk-order.
1202
- // See comment for class MemoryAllocator for definition of chunk-order.
1203
- bool page_list_is_chunk_ordered_;
1204
-
1205
- // Normal allocation information.
1206
- AllocationInfo allocation_info_;
1207
-
1208
- // Relocation information during mark-compact collections.
1209
- AllocationInfo mc_forwarding_info_;
1210
-
1211
- // Bytes of each page that cannot be allocated. Possibly non-zero
1212
- // for pages in spaces with only fixed-size objects. Always zero
1213
- // for pages in spaces with variable sized objects (those pages are
1214
- // padded with free-list nodes).
1215
- int page_extra_;
1216
-
1217
- // Sets allocation pointer to a page bottom.
1218
- static void SetAllocationInfo(AllocationInfo* alloc_info, Page* p);
1219
-
1220
- // Returns the top page specified by an allocation info structure.
1221
- static Page* TopPageOf(AllocationInfo alloc_info) {
1222
- return Page::FromAllocationTop(alloc_info.limit);
1223
- }
1224
-
1225
- int CountPagesToTop() {
1226
- Page* p = Page::FromAllocationTop(allocation_info_.top);
1227
- PageIterator it(this, PageIterator::ALL_PAGES);
1228
- int counter = 1;
1229
- while (it.has_next()) {
1230
- if (it.next() == p) return counter;
1231
- counter++;
1232
- }
1233
- UNREACHABLE();
1234
- return -1;
1235
- }
1236
-
1237
- // Expands the space by allocating a fixed number of pages. Returns false if
1238
- // it cannot allocate requested number of pages from OS. Newly allocated
1239
- // pages are append to the last_page;
1240
- bool Expand(Page* last_page);
1241
-
1242
- // Generic fast case allocation function that tries linear allocation in
1243
- // the top page of 'alloc_info'. Returns NULL on failure.
1244
- inline HeapObject* AllocateLinearly(AllocationInfo* alloc_info,
1245
- int size_in_bytes);
1246
-
1247
- // During normal allocation or deserialization, roll to the next page in
1248
- // the space (there is assumed to be one) and allocate there. This
1249
- // function is space-dependent.
1250
- virtual HeapObject* AllocateInNextPage(Page* current_page,
1251
- int size_in_bytes) = 0;
1252
-
1253
- // Slow path of AllocateRaw. This function is space-dependent.
1254
- MUST_USE_RESULT virtual HeapObject* SlowAllocateRaw(int size_in_bytes) = 0;
1255
-
1256
- // Slow path of MCAllocateRaw.
1257
- MUST_USE_RESULT HeapObject* SlowMCAllocateRaw(int size_in_bytes);
1258
-
1259
- #ifdef DEBUG
1260
- // Returns the number of total pages in this space.
1261
- int CountTotalPages();
1262
- #endif
1263
- private:
1264
-
1265
- // Returns a pointer to the page of the relocation pointer.
1266
- Page* MCRelocationTopPage() { return TopPageOf(mc_forwarding_info_); }
1267
-
1268
- friend class PageIterator;
1269
- };
1270
-
1271
-
1272
- #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
1273
- class NumberAndSizeInfo BASE_EMBEDDED {
1274
- public:
1275
- NumberAndSizeInfo() : number_(0), bytes_(0) {}
1276
-
1277
- int number() const { return number_; }
1278
- void increment_number(int num) { number_ += num; }
1279
-
1280
- int bytes() const { return bytes_; }
1281
- void increment_bytes(int size) { bytes_ += size; }
1282
-
1283
- void clear() {
1284
- number_ = 0;
1285
- bytes_ = 0;
1286
- }
1287
-
1288
- private:
1289
- int number_;
1290
- int bytes_;
1291
- };
1292
-
1293
-
1294
- // HistogramInfo class for recording a single "bar" of a histogram. This
1295
- // class is used for collecting statistics to print to stdout (when compiled
1296
- // with DEBUG) or to the log file (when compiled with
1297
- // ENABLE_LOGGING_AND_PROFILING).
1298
- class HistogramInfo: public NumberAndSizeInfo {
1299
- public:
1300
- HistogramInfo() : NumberAndSizeInfo() {}
1301
-
1302
- const char* name() { return name_; }
1303
- void set_name(const char* name) { name_ = name; }
1304
-
1305
- private:
1306
- const char* name_;
1307
- };
1308
- #endif
1309
-
1310
-
1311
- // -----------------------------------------------------------------------------
1312
- // SemiSpace in young generation
1313
- //
1314
- // A semispace is a contiguous chunk of memory. The mark-compact collector
1315
- // uses the memory in the from space as a marking stack when tracing live
1316
- // objects.
1317
-
1318
- class SemiSpace : public Space {
1319
- public:
1320
- // Constructor.
1321
- explicit SemiSpace(Heap* heap) : Space(heap, NEW_SPACE, NOT_EXECUTABLE) {
1322
- start_ = NULL;
1323
- age_mark_ = NULL;
1324
- }
1325
-
1326
- // Sets up the semispace using the given chunk.
1327
- bool Setup(Address start, int initial_capacity, int maximum_capacity);
1328
-
1329
- // Tear down the space. Heap memory was not allocated by the space, so it
1330
- // is not deallocated here.
1331
- void TearDown();
1332
-
1333
- // True if the space has been set up but not torn down.
1334
- bool HasBeenSetup() { return start_ != NULL; }
1335
-
1336
- // Grow the size of the semispace by committing extra virtual memory.
1337
- // Assumes that the caller has checked that the semispace has not reached
1338
- // its maximum capacity (and thus there is space available in the reserved
1339
- // address range to grow).
1340
- bool Grow();
1341
-
1342
- // Grow the semispace to the new capacity. The new capacity
1343
- // requested must be larger than the current capacity.
1344
- bool GrowTo(int new_capacity);
1345
-
1346
- // Shrinks the semispace to the new capacity. The new capacity
1347
- // requested must be more than the amount of used memory in the
1348
- // semispace and less than the current capacity.
1349
- bool ShrinkTo(int new_capacity);
1350
-
1351
- // Returns the start address of the space.
1352
- Address low() { return start_; }
1353
- // Returns one past the end address of the space.
1354
- Address high() { return low() + capacity_; }
1355
-
1356
- // Age mark accessors.
1357
- Address age_mark() { return age_mark_; }
1358
- void set_age_mark(Address mark) { age_mark_ = mark; }
1359
-
1360
- // True if the address is in the address range of this semispace (not
1361
- // necessarily below the allocation pointer).
1362
- bool Contains(Address a) {
1363
- return (reinterpret_cast<uintptr_t>(a) & address_mask_)
1364
- == reinterpret_cast<uintptr_t>(start_);
1365
- }
1366
-
1367
- // True if the object is a heap object in the address range of this
1368
- // semispace (not necessarily below the allocation pointer).
1369
- bool Contains(Object* o) {
1370
- return (reinterpret_cast<uintptr_t>(o) & object_mask_) == object_expected_;
1371
- }
1372
-
1373
- // The offset of an address from the beginning of the space.
1374
- int SpaceOffsetForAddress(Address addr) {
1375
- return static_cast<int>(addr - low());
1376
- }
1377
-
1378
- // If we don't have these here then SemiSpace will be abstract. However
1379
- // they should never be called.
1380
- virtual intptr_t Size() {
1381
- UNREACHABLE();
1382
- return 0;
1383
- }
1384
-
1385
- virtual bool ReserveSpace(int bytes) {
1386
- UNREACHABLE();
1387
- return false;
1388
- }
1389
-
1390
- bool is_committed() { return committed_; }
1391
- bool Commit();
1392
- bool Uncommit();
1393
-
1394
- #ifdef ENABLE_HEAP_PROTECTION
1395
- // Protect/unprotect the space by marking it read-only/writable.
1396
- virtual void Protect() {}
1397
- virtual void Unprotect() {}
1398
- #endif
1399
-
1400
- #ifdef DEBUG
1401
- virtual void Print();
1402
- virtual void Verify();
1403
- #endif
1404
-
1405
- // Returns the current capacity of the semi space.
1406
- int Capacity() { return capacity_; }
1407
-
1408
- // Returns the maximum capacity of the semi space.
1409
- int MaximumCapacity() { return maximum_capacity_; }
1410
-
1411
- // Returns the initial capacity of the semi space.
1412
- int InitialCapacity() { return initial_capacity_; }
1413
-
1414
- private:
1415
- // The current and maximum capacity of the space.
1416
- int capacity_;
1417
- int maximum_capacity_;
1418
- int initial_capacity_;
1419
-
1420
- // The start address of the space.
1421
- Address start_;
1422
- // Used to govern object promotion during mark-compact collection.
1423
- Address age_mark_;
1424
-
1425
- // Masks and comparison values to test for containment in this semispace.
1426
- uintptr_t address_mask_;
1427
- uintptr_t object_mask_;
1428
- uintptr_t object_expected_;
1429
-
1430
- bool committed_;
1431
-
1432
- public:
1433
- TRACK_MEMORY("SemiSpace")
1434
- };
1435
-
1436
-
1437
- // A SemiSpaceIterator is an ObjectIterator that iterates over the active
1438
- // semispace of the heap's new space. It iterates over the objects in the
1439
- // semispace from a given start address (defaulting to the bottom of the
1440
- // semispace) to the top of the semispace. New objects allocated after the
1441
- // iterator is created are not iterated.
1442
- class SemiSpaceIterator : public ObjectIterator {
1443
- public:
1444
- // Create an iterator over the objects in the given space. If no start
1445
- // address is given, the iterator starts from the bottom of the space. If
1446
- // no size function is given, the iterator calls Object::Size().
1447
- explicit SemiSpaceIterator(NewSpace* space);
1448
- SemiSpaceIterator(NewSpace* space, HeapObjectCallback size_func);
1449
- SemiSpaceIterator(NewSpace* space, Address start);
1450
-
1451
- HeapObject* next() {
1452
- if (current_ == limit_) return NULL;
1453
-
1454
- HeapObject* object = HeapObject::FromAddress(current_);
1455
- int size = (size_func_ == NULL) ? object->Size() : size_func_(object);
1456
-
1457
- current_ += size;
1458
- return object;
1459
- }
1460
-
1461
- // Implementation of the ObjectIterator functions.
1462
- virtual HeapObject* next_object() { return next(); }
1463
-
1464
- private:
1465
- void Initialize(NewSpace* space, Address start, Address end,
1466
- HeapObjectCallback size_func);
1467
-
1468
- // The semispace.
1469
- SemiSpace* space_;
1470
- // The current iteration point.
1471
- Address current_;
1472
- // The end of iteration.
1473
- Address limit_;
1474
- // The callback function.
1475
- HeapObjectCallback size_func_;
1476
- };
1477
-
1478
-
1479
- // -----------------------------------------------------------------------------
1480
- // The young generation space.
1481
- //
1482
- // The new space consists of a contiguous pair of semispaces. It simply
1483
- // forwards most functions to the appropriate semispace.
1484
-
1485
- class NewSpace : public Space {
1486
- public:
1487
- // Constructor.
1488
- explicit NewSpace(Heap* heap)
1489
- : Space(heap, NEW_SPACE, NOT_EXECUTABLE),
1490
- to_space_(heap),
1491
- from_space_(heap) {}
1492
-
1493
- // Sets up the new space using the given chunk.
1494
- bool Setup(Address start, int size);
1495
-
1496
- // Tears down the space. Heap memory was not allocated by the space, so it
1497
- // is not deallocated here.
1498
- void TearDown();
1499
-
1500
- // True if the space has been set up but not torn down.
1501
- bool HasBeenSetup() {
1502
- return to_space_.HasBeenSetup() && from_space_.HasBeenSetup();
1503
- }
1504
-
1505
- // Flip the pair of spaces.
1506
- void Flip();
1507
-
1508
- // Grow the capacity of the semispaces. Assumes that they are not at
1509
- // their maximum capacity.
1510
- void Grow();
1511
-
1512
- // Shrink the capacity of the semispaces.
1513
- void Shrink();
1514
-
1515
- // True if the address or object lies in the address range of either
1516
- // semispace (not necessarily below the allocation pointer).
1517
- bool Contains(Address a) {
1518
- return (reinterpret_cast<uintptr_t>(a) & address_mask_)
1519
- == reinterpret_cast<uintptr_t>(start_);
1520
- }
1521
- bool Contains(Object* o) {
1522
- return (reinterpret_cast<uintptr_t>(o) & object_mask_) == object_expected_;
1523
- }
1524
-
1525
- // Return the allocated bytes in the active semispace.
1526
- virtual intptr_t Size() { return static_cast<int>(top() - bottom()); }
1527
- // The same, but returning an int. We have to have the one that returns
1528
- // intptr_t because it is inherited, but if we know we are dealing with the
1529
- // new space, which can't get as big as the other spaces then this is useful:
1530
- int SizeAsInt() { return static_cast<int>(Size()); }
1531
-
1532
- // Return the current capacity of a semispace.
1533
- intptr_t Capacity() {
1534
- ASSERT(to_space_.Capacity() == from_space_.Capacity());
1535
- return to_space_.Capacity();
1536
- }
1537
-
1538
- // Return the total amount of memory committed for new space.
1539
- intptr_t CommittedMemory() {
1540
- if (from_space_.is_committed()) return 2 * Capacity();
1541
- return Capacity();
1542
- }
1543
-
1544
- // Return the available bytes without growing in the active semispace.
1545
- intptr_t Available() { return Capacity() - Size(); }
1546
-
1547
- // Return the maximum capacity of a semispace.
1548
- int MaximumCapacity() {
1549
- ASSERT(to_space_.MaximumCapacity() == from_space_.MaximumCapacity());
1550
- return to_space_.MaximumCapacity();
1551
- }
1552
-
1553
- // Returns the initial capacity of a semispace.
1554
- int InitialCapacity() {
1555
- ASSERT(to_space_.InitialCapacity() == from_space_.InitialCapacity());
1556
- return to_space_.InitialCapacity();
1557
- }
1558
-
1559
- // Return the address of the allocation pointer in the active semispace.
1560
- Address top() { return allocation_info_.top; }
1561
- // Return the address of the first object in the active semispace.
1562
- Address bottom() { return to_space_.low(); }
1563
-
1564
- // Get the age mark of the inactive semispace.
1565
- Address age_mark() { return from_space_.age_mark(); }
1566
- // Set the age mark in the active semispace.
1567
- void set_age_mark(Address mark) { to_space_.set_age_mark(mark); }
1568
-
1569
- // The start address of the space and a bit mask. Anding an address in the
1570
- // new space with the mask will result in the start address.
1571
- Address start() { return start_; }
1572
- uintptr_t mask() { return address_mask_; }
1573
-
1574
- // The allocation top and limit addresses.
1575
- Address* allocation_top_address() { return &allocation_info_.top; }
1576
- Address* allocation_limit_address() { return &allocation_info_.limit; }
1577
-
1578
- MUST_USE_RESULT MaybeObject* AllocateRaw(int size_in_bytes) {
1579
- return AllocateRawInternal(size_in_bytes, &allocation_info_);
1580
- }
1581
-
1582
- // Allocate the requested number of bytes for relocation during mark-compact
1583
- // collection.
1584
- MUST_USE_RESULT MaybeObject* MCAllocateRaw(int size_in_bytes) {
1585
- return AllocateRawInternal(size_in_bytes, &mc_forwarding_info_);
1586
- }
1587
-
1588
- // Reset the allocation pointer to the beginning of the active semispace.
1589
- void ResetAllocationInfo();
1590
- // Reset the reloction pointer to the bottom of the inactive semispace in
1591
- // preparation for mark-compact collection.
1592
- void MCResetRelocationInfo();
1593
- // Update the allocation pointer in the active semispace after a
1594
- // mark-compact collection.
1595
- void MCCommitRelocationInfo();
1596
-
1597
- // Get the extent of the inactive semispace (for use as a marking stack).
1598
- Address FromSpaceLow() { return from_space_.low(); }
1599
- Address FromSpaceHigh() { return from_space_.high(); }
1600
-
1601
- // Get the extent of the active semispace (to sweep newly copied objects
1602
- // during a scavenge collection).
1603
- Address ToSpaceLow() { return to_space_.low(); }
1604
- Address ToSpaceHigh() { return to_space_.high(); }
1605
-
1606
- // Offsets from the beginning of the semispaces.
1607
- int ToSpaceOffsetForAddress(Address a) {
1608
- return to_space_.SpaceOffsetForAddress(a);
1609
- }
1610
- int FromSpaceOffsetForAddress(Address a) {
1611
- return from_space_.SpaceOffsetForAddress(a);
1612
- }
1613
-
1614
- // True if the object is a heap object in the address range of the
1615
- // respective semispace (not necessarily below the allocation pointer of the
1616
- // semispace).
1617
- bool ToSpaceContains(Object* o) { return to_space_.Contains(o); }
1618
- bool FromSpaceContains(Object* o) { return from_space_.Contains(o); }
1619
-
1620
- bool ToSpaceContains(Address a) { return to_space_.Contains(a); }
1621
- bool FromSpaceContains(Address a) { return from_space_.Contains(a); }
1622
-
1623
- virtual bool ReserveSpace(int bytes);
1624
-
1625
- // Resizes a sequential string which must be the most recent thing that was
1626
- // allocated in new space.
1627
- template <typename StringType>
1628
- inline void ShrinkStringAtAllocationBoundary(String* string, int len);
1629
-
1630
- #ifdef ENABLE_HEAP_PROTECTION
1631
- // Protect/unprotect the space by marking it read-only/writable.
1632
- virtual void Protect();
1633
- virtual void Unprotect();
1634
- #endif
1635
-
1636
- #ifdef DEBUG
1637
- // Verify the active semispace.
1638
- virtual void Verify();
1639
- // Print the active semispace.
1640
- virtual void Print() { to_space_.Print(); }
1641
- #endif
1642
-
1643
- #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
1644
- // Iterates the active semispace to collect statistics.
1645
- void CollectStatistics();
1646
- // Reports previously collected statistics of the active semispace.
1647
- void ReportStatistics();
1648
- // Clears previously collected statistics.
1649
- void ClearHistograms();
1650
-
1651
- // Record the allocation or promotion of a heap object. Note that we don't
1652
- // record every single allocation, but only those that happen in the
1653
- // to space during a scavenge GC.
1654
- void RecordAllocation(HeapObject* obj);
1655
- void RecordPromotion(HeapObject* obj);
1656
- #endif
1657
-
1658
- // Return whether the operation succeded.
1659
- bool CommitFromSpaceIfNeeded() {
1660
- if (from_space_.is_committed()) return true;
1661
- return from_space_.Commit();
1662
- }
1663
-
1664
- bool UncommitFromSpace() {
1665
- if (!from_space_.is_committed()) return true;
1666
- return from_space_.Uncommit();
1667
- }
1668
-
1669
- private:
1670
- // The semispaces.
1671
- SemiSpace to_space_;
1672
- SemiSpace from_space_;
1673
-
1674
- // Start address and bit mask for containment testing.
1675
- Address start_;
1676
- uintptr_t address_mask_;
1677
- uintptr_t object_mask_;
1678
- uintptr_t object_expected_;
1679
-
1680
- // Allocation pointer and limit for normal allocation and allocation during
1681
- // mark-compact collection.
1682
- AllocationInfo allocation_info_;
1683
- AllocationInfo mc_forwarding_info_;
1684
-
1685
- #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
1686
- HistogramInfo* allocated_histogram_;
1687
- HistogramInfo* promoted_histogram_;
1688
- #endif
1689
-
1690
- // Implementation of AllocateRaw and MCAllocateRaw.
1691
- MUST_USE_RESULT inline MaybeObject* AllocateRawInternal(
1692
- int size_in_bytes,
1693
- AllocationInfo* alloc_info);
1694
-
1695
- friend class SemiSpaceIterator;
1696
-
1697
- public:
1698
- TRACK_MEMORY("NewSpace")
1699
- };
1700
-
1701
-
1702
- // -----------------------------------------------------------------------------
1703
- // Free lists for old object spaces
1704
- //
1705
- // Free-list nodes are free blocks in the heap. They look like heap objects
1706
- // (free-list node pointers have the heap object tag, and they have a map like
1707
- // a heap object). They have a size and a next pointer. The next pointer is
1708
- // the raw address of the next free list node (or NULL).
1709
- class FreeListNode: public HeapObject {
1710
- public:
1711
- // Obtain a free-list node from a raw address. This is not a cast because
1712
- // it does not check nor require that the first word at the address is a map
1713
- // pointer.
1714
- static FreeListNode* FromAddress(Address address) {
1715
- return reinterpret_cast<FreeListNode*>(HeapObject::FromAddress(address));
1716
- }
1717
-
1718
- static inline bool IsFreeListNode(HeapObject* object);
1719
-
1720
- // Set the size in bytes, which can be read with HeapObject::Size(). This
1721
- // function also writes a map to the first word of the block so that it
1722
- // looks like a heap object to the garbage collector and heap iteration
1723
- // functions.
1724
- void set_size(Heap* heap, int size_in_bytes);
1725
-
1726
- // Accessors for the next field.
1727
- inline Address next(Heap* heap);
1728
- inline void set_next(Heap* heap, Address next);
1729
-
1730
- private:
1731
- static const int kNextOffset = POINTER_SIZE_ALIGN(ByteArray::kHeaderSize);
1732
-
1733
- DISALLOW_IMPLICIT_CONSTRUCTORS(FreeListNode);
1734
- };
1735
-
1736
-
1737
- // The free list for the old space.
1738
- class OldSpaceFreeList BASE_EMBEDDED {
1739
- public:
1740
- OldSpaceFreeList(Heap* heap, AllocationSpace owner);
1741
-
1742
- // Clear the free list.
1743
- void Reset();
1744
-
1745
- // Return the number of bytes available on the free list.
1746
- intptr_t available() { return available_; }
1747
-
1748
- // Place a node on the free list. The block of size 'size_in_bytes'
1749
- // starting at 'start' is placed on the free list. The return value is the
1750
- // number of bytes that have been lost due to internal fragmentation by
1751
- // freeing the block. Bookkeeping information will be written to the block,
1752
- // ie, its contents will be destroyed. The start address should be word
1753
- // aligned, and the size should be a non-zero multiple of the word size.
1754
- int Free(Address start, int size_in_bytes);
1755
-
1756
- // Allocate a block of size 'size_in_bytes' from the free list. The block
1757
- // is unitialized. A failure is returned if no block is available. The
1758
- // number of bytes lost to fragmentation is returned in the output parameter
1759
- // 'wasted_bytes'. The size should be a non-zero multiple of the word size.
1760
- MUST_USE_RESULT MaybeObject* Allocate(int size_in_bytes, int* wasted_bytes);
1761
-
1762
- void MarkNodes();
1763
-
1764
- private:
1765
- // The size range of blocks, in bytes. (Smaller allocations are allowed, but
1766
- // will always result in waste.)
1767
- static const int kMinBlockSize = 2 * kPointerSize;
1768
- static const int kMaxBlockSize = Page::kMaxHeapObjectSize;
1769
-
1770
- Heap* heap_;
1771
-
1772
- // The identity of the owning space, for building allocation Failure
1773
- // objects.
1774
- AllocationSpace owner_;
1775
-
1776
- // Total available bytes in all blocks on this free list.
1777
- int available_;
1778
-
1779
- // Blocks are put on exact free lists in an array, indexed by size in words.
1780
- // The available sizes are kept in an increasingly ordered list. Entries
1781
- // corresponding to sizes < kMinBlockSize always have an empty free list
1782
- // (but index kHead is used for the head of the size list).
1783
- struct SizeNode {
1784
- // Address of the head FreeListNode of the implied block size or NULL.
1785
- Address head_node_;
1786
- // Size (words) of the next larger available size if head_node_ != NULL.
1787
- int next_size_;
1788
- };
1789
- static const int kFreeListsLength = kMaxBlockSize / kPointerSize + 1;
1790
- SizeNode free_[kFreeListsLength];
1791
-
1792
- // Sentinel elements for the size list. Real elements are in ]kHead..kEnd[.
1793
- static const int kHead = kMinBlockSize / kPointerSize - 1;
1794
- static const int kEnd = kMaxInt;
1795
-
1796
- // We keep a "finger" in the size list to speed up a common pattern:
1797
- // repeated requests for the same or increasing sizes.
1798
- int finger_;
1799
-
1800
- // Starting from *prev, find and return the smallest size >= index (words),
1801
- // or kEnd. Update *prev to be the largest size < index, or kHead.
1802
- int FindSize(int index, int* prev) {
1803
- int cur = free_[*prev].next_size_;
1804
- while (cur < index) {
1805
- *prev = cur;
1806
- cur = free_[cur].next_size_;
1807
- }
1808
- return cur;
1809
- }
1810
-
1811
- // Remove an existing element from the size list.
1812
- void RemoveSize(int index) {
1813
- int prev = kHead;
1814
- int cur = FindSize(index, &prev);
1815
- ASSERT(cur == index);
1816
- free_[prev].next_size_ = free_[cur].next_size_;
1817
- finger_ = prev;
1818
- }
1819
-
1820
- // Insert a new element into the size list.
1821
- void InsertSize(int index) {
1822
- int prev = kHead;
1823
- int cur = FindSize(index, &prev);
1824
- ASSERT(cur != index);
1825
- free_[prev].next_size_ = index;
1826
- free_[index].next_size_ = cur;
1827
- }
1828
-
1829
- // The size list is not updated during a sequence of calls to Free, but is
1830
- // rebuilt before the next allocation.
1831
- void RebuildSizeList();
1832
- bool needs_rebuild_;
1833
-
1834
- #ifdef DEBUG
1835
- // Does this free list contain a free block located at the address of 'node'?
1836
- bool Contains(FreeListNode* node);
1837
- #endif
1838
-
1839
- DISALLOW_COPY_AND_ASSIGN(OldSpaceFreeList);
1840
- };
1841
-
1842
-
1843
- // The free list for the map space.
1844
- class FixedSizeFreeList BASE_EMBEDDED {
1845
- public:
1846
- FixedSizeFreeList(Heap* heap, AllocationSpace owner, int object_size);
1847
-
1848
- // Clear the free list.
1849
- void Reset();
1850
-
1851
- // Return the number of bytes available on the free list.
1852
- intptr_t available() { return available_; }
1853
-
1854
- // Place a node on the free list. The block starting at 'start' (assumed to
1855
- // have size object_size_) is placed on the free list. Bookkeeping
1856
- // information will be written to the block, ie, its contents will be
1857
- // destroyed. The start address should be word aligned.
1858
- void Free(Address start);
1859
-
1860
- // Allocate a fixed sized block from the free list. The block is unitialized.
1861
- // A failure is returned if no block is available.
1862
- MUST_USE_RESULT MaybeObject* Allocate();
1863
-
1864
- void MarkNodes();
1865
-
1866
- private:
1867
-
1868
- Heap* heap_;
1869
-
1870
- // Available bytes on the free list.
1871
- intptr_t available_;
1872
-
1873
- // The head of the free list.
1874
- Address head_;
1875
-
1876
- // The tail of the free list.
1877
- Address tail_;
1878
-
1879
- // The identity of the owning space, for building allocation Failure
1880
- // objects.
1881
- AllocationSpace owner_;
1882
-
1883
- // The size of the objects in this space.
1884
- int object_size_;
1885
-
1886
- DISALLOW_COPY_AND_ASSIGN(FixedSizeFreeList);
1887
- };
1888
-
1889
-
1890
- // -----------------------------------------------------------------------------
1891
- // Old object space (excluding map objects)
1892
-
1893
- class OldSpace : public PagedSpace {
1894
- public:
1895
- // Creates an old space object with a given maximum capacity.
1896
- // The constructor does not allocate pages from OS.
1897
- OldSpace(Heap* heap,
1898
- intptr_t max_capacity,
1899
- AllocationSpace id,
1900
- Executability executable)
1901
- : PagedSpace(heap, max_capacity, id, executable),
1902
- free_list_(heap, id) {
1903
- page_extra_ = 0;
1904
- }
1905
-
1906
- // The bytes available on the free list (ie, not above the linear allocation
1907
- // pointer).
1908
- intptr_t AvailableFree() { return free_list_.available(); }
1909
-
1910
- // The limit of allocation for a page in this space.
1911
- virtual Address PageAllocationLimit(Page* page) {
1912
- return page->ObjectAreaEnd();
1913
- }
1914
-
1915
- // Give a block of memory to the space's free list. It might be added to
1916
- // the free list or accounted as waste.
1917
- // If add_to_freelist is false then just accounting stats are updated and
1918
- // no attempt to add area to free list is made.
1919
- void Free(Address start, int size_in_bytes, bool add_to_freelist) {
1920
- accounting_stats_.DeallocateBytes(size_in_bytes);
1921
-
1922
- if (add_to_freelist) {
1923
- int wasted_bytes = free_list_.Free(start, size_in_bytes);
1924
- accounting_stats_.WasteBytes(wasted_bytes);
1925
- }
1926
- }
1927
-
1928
- virtual void DeallocateBlock(Address start,
1929
- int size_in_bytes,
1930
- bool add_to_freelist);
1931
-
1932
- // Prepare for full garbage collection. Resets the relocation pointer and
1933
- // clears the free list.
1934
- virtual void PrepareForMarkCompact(bool will_compact);
1935
-
1936
- // Updates the allocation pointer to the relocation top after a mark-compact
1937
- // collection.
1938
- virtual void MCCommitRelocationInfo();
1939
-
1940
- virtual void PutRestOfCurrentPageOnFreeList(Page* current_page);
1941
-
1942
- void MarkFreeListNodes() { free_list_.MarkNodes(); }
1943
-
1944
- #ifdef DEBUG
1945
- // Reports statistics for the space
1946
- void ReportStatistics();
1947
- #endif
1948
-
1949
- protected:
1950
- // Virtual function in the superclass. Slow path of AllocateRaw.
1951
- MUST_USE_RESULT HeapObject* SlowAllocateRaw(int size_in_bytes);
1952
-
1953
- // Virtual function in the superclass. Allocate linearly at the start of
1954
- // the page after current_page (there is assumed to be one).
1955
- HeapObject* AllocateInNextPage(Page* current_page, int size_in_bytes);
1956
-
1957
- private:
1958
- // The space's free list.
1959
- OldSpaceFreeList free_list_;
1960
-
1961
- public:
1962
- TRACK_MEMORY("OldSpace")
1963
- };
1964
-
1965
-
1966
- // -----------------------------------------------------------------------------
1967
- // Old space for objects of a fixed size
1968
-
1969
- class FixedSpace : public PagedSpace {
1970
- public:
1971
- FixedSpace(Heap* heap,
1972
- intptr_t max_capacity,
1973
- AllocationSpace id,
1974
- int object_size_in_bytes,
1975
- const char* name)
1976
- : PagedSpace(heap, max_capacity, id, NOT_EXECUTABLE),
1977
- object_size_in_bytes_(object_size_in_bytes),
1978
- name_(name),
1979
- free_list_(heap, id, object_size_in_bytes) {
1980
- page_extra_ = Page::kObjectAreaSize % object_size_in_bytes;
1981
- }
1982
-
1983
- // The limit of allocation for a page in this space.
1984
- virtual Address PageAllocationLimit(Page* page) {
1985
- return page->ObjectAreaEnd() - page_extra_;
1986
- }
1987
-
1988
- int object_size_in_bytes() { return object_size_in_bytes_; }
1989
-
1990
- // Give a fixed sized block of memory to the space's free list.
1991
- // If add_to_freelist is false then just accounting stats are updated and
1992
- // no attempt to add area to free list is made.
1993
- void Free(Address start, bool add_to_freelist) {
1994
- if (add_to_freelist) {
1995
- free_list_.Free(start);
1996
- }
1997
- accounting_stats_.DeallocateBytes(object_size_in_bytes_);
1998
- }
1999
-
2000
- // Prepares for a mark-compact GC.
2001
- virtual void PrepareForMarkCompact(bool will_compact);
2002
-
2003
- // Updates the allocation pointer to the relocation top after a mark-compact
2004
- // collection.
2005
- virtual void MCCommitRelocationInfo();
2006
-
2007
- virtual void PutRestOfCurrentPageOnFreeList(Page* current_page);
2008
-
2009
- virtual void DeallocateBlock(Address start,
2010
- int size_in_bytes,
2011
- bool add_to_freelist);
2012
-
2013
- void MarkFreeListNodes() { free_list_.MarkNodes(); }
2014
-
2015
- #ifdef DEBUG
2016
- // Reports statistic info of the space
2017
- void ReportStatistics();
2018
- #endif
2019
-
2020
- protected:
2021
- // Virtual function in the superclass. Slow path of AllocateRaw.
2022
- MUST_USE_RESULT HeapObject* SlowAllocateRaw(int size_in_bytes);
2023
-
2024
- // Virtual function in the superclass. Allocate linearly at the start of
2025
- // the page after current_page (there is assumed to be one).
2026
- HeapObject* AllocateInNextPage(Page* current_page, int size_in_bytes);
2027
-
2028
- void ResetFreeList() {
2029
- free_list_.Reset();
2030
- }
2031
-
2032
- private:
2033
- // The size of objects in this space.
2034
- int object_size_in_bytes_;
2035
-
2036
- // The name of this space.
2037
- const char* name_;
2038
-
2039
- // The space's free list.
2040
- FixedSizeFreeList free_list_;
2041
- };
2042
-
2043
-
2044
- // -----------------------------------------------------------------------------
2045
- // Old space for all map objects
2046
-
2047
- class MapSpace : public FixedSpace {
2048
- public:
2049
- // Creates a map space object with a maximum capacity.
2050
- MapSpace(Heap* heap,
2051
- intptr_t max_capacity,
2052
- int max_map_space_pages,
2053
- AllocationSpace id)
2054
- : FixedSpace(heap, max_capacity, id, Map::kSize, "map"),
2055
- max_map_space_pages_(max_map_space_pages) {
2056
- ASSERT(max_map_space_pages < kMaxMapPageIndex);
2057
- }
2058
-
2059
- // Prepares for a mark-compact GC.
2060
- virtual void PrepareForMarkCompact(bool will_compact);
2061
-
2062
- // Given an index, returns the page address.
2063
- Address PageAddress(int page_index) { return page_addresses_[page_index]; }
2064
-
2065
- static const int kMaxMapPageIndex = 1 << MapWord::kMapPageIndexBits;
2066
-
2067
- // Are map pointers encodable into map word?
2068
- bool MapPointersEncodable() {
2069
- if (!FLAG_use_big_map_space) {
2070
- ASSERT(CountPagesToTop() <= kMaxMapPageIndex);
2071
- return true;
2072
- }
2073
- return CountPagesToTop() <= max_map_space_pages_;
2074
- }
2075
-
2076
- // Should be called after forced sweep to find out if map space needs
2077
- // compaction.
2078
- bool NeedsCompaction(int live_maps) {
2079
- return !MapPointersEncodable() && live_maps <= CompactionThreshold();
2080
- }
2081
-
2082
- Address TopAfterCompaction(int live_maps) {
2083
- ASSERT(NeedsCompaction(live_maps));
2084
-
2085
- int pages_left = live_maps / kMapsPerPage;
2086
- PageIterator it(this, PageIterator::ALL_PAGES);
2087
- while (pages_left-- > 0) {
2088
- ASSERT(it.has_next());
2089
- it.next()->SetRegionMarks(Page::kAllRegionsCleanMarks);
2090
- }
2091
- ASSERT(it.has_next());
2092
- Page* top_page = it.next();
2093
- top_page->SetRegionMarks(Page::kAllRegionsCleanMarks);
2094
- ASSERT(top_page->is_valid());
2095
-
2096
- int offset = live_maps % kMapsPerPage * Map::kSize;
2097
- Address top = top_page->ObjectAreaStart() + offset;
2098
- ASSERT(top < top_page->ObjectAreaEnd());
2099
- ASSERT(Contains(top));
2100
-
2101
- return top;
2102
- }
2103
-
2104
- void FinishCompaction(Address new_top, int live_maps) {
2105
- Page* top_page = Page::FromAddress(new_top);
2106
- ASSERT(top_page->is_valid());
2107
-
2108
- SetAllocationInfo(&allocation_info_, top_page);
2109
- allocation_info_.top = new_top;
2110
-
2111
- int new_size = live_maps * Map::kSize;
2112
- accounting_stats_.DeallocateBytes(accounting_stats_.Size());
2113
- accounting_stats_.AllocateBytes(new_size);
2114
-
2115
- // Flush allocation watermarks.
2116
- for (Page* p = first_page_; p != top_page; p = p->next_page()) {
2117
- p->SetAllocationWatermark(p->AllocationTop());
2118
- }
2119
- top_page->SetAllocationWatermark(new_top);
2120
-
2121
- #ifdef DEBUG
2122
- if (FLAG_enable_slow_asserts) {
2123
- intptr_t actual_size = 0;
2124
- for (Page* p = first_page_; p != top_page; p = p->next_page())
2125
- actual_size += kMapsPerPage * Map::kSize;
2126
- actual_size += (new_top - top_page->ObjectAreaStart());
2127
- ASSERT(accounting_stats_.Size() == actual_size);
2128
- }
2129
- #endif
2130
-
2131
- Shrink();
2132
- ResetFreeList();
2133
- }
2134
-
2135
- protected:
2136
- #ifdef DEBUG
2137
- virtual void VerifyObject(HeapObject* obj);
2138
- #endif
2139
-
2140
- private:
2141
- static const int kMapsPerPage = Page::kObjectAreaSize / Map::kSize;
2142
-
2143
- // Do map space compaction if there is a page gap.
2144
- int CompactionThreshold() {
2145
- return kMapsPerPage * (max_map_space_pages_ - 1);
2146
- }
2147
-
2148
- const int max_map_space_pages_;
2149
-
2150
- // An array of page start address in a map space.
2151
- Address page_addresses_[kMaxMapPageIndex];
2152
-
2153
- public:
2154
- TRACK_MEMORY("MapSpace")
2155
- };
2156
-
2157
-
2158
- // -----------------------------------------------------------------------------
2159
- // Old space for all global object property cell objects
2160
-
2161
- class CellSpace : public FixedSpace {
2162
- public:
2163
- // Creates a property cell space object with a maximum capacity.
2164
- CellSpace(Heap* heap, intptr_t max_capacity, AllocationSpace id)
2165
- : FixedSpace(heap, max_capacity, id, JSGlobalPropertyCell::kSize, "cell")
2166
- {}
2167
-
2168
- protected:
2169
- #ifdef DEBUG
2170
- virtual void VerifyObject(HeapObject* obj);
2171
- #endif
2172
-
2173
- public:
2174
- TRACK_MEMORY("CellSpace")
2175
- };
2176
-
2177
-
2178
- // -----------------------------------------------------------------------------
2179
- // Large objects ( > Page::kMaxHeapObjectSize ) are allocated and managed by
2180
- // the large object space. A large object is allocated from OS heap with
2181
- // extra padding bytes (Page::kPageSize + Page::kObjectStartOffset).
2182
- // A large object always starts at Page::kObjectStartOffset to a page.
2183
- // Large objects do not move during garbage collections.
2184
-
2185
- // A LargeObjectChunk holds exactly one large object page with exactly one
2186
- // large object.
2187
- class LargeObjectChunk {
2188
- public:
2189
- // Allocates a new LargeObjectChunk that contains a large object page
2190
- // (Page::kPageSize aligned) that has at least size_in_bytes (for a large
2191
- // object) bytes after the object area start of that page.
2192
- static LargeObjectChunk* New(int size_in_bytes, Executability executable);
2193
-
2194
- // Free the memory associated with the chunk.
2195
- inline void Free(Executability executable);
2196
-
2197
- // Interpret a raw address as a large object chunk.
2198
- static LargeObjectChunk* FromAddress(Address address) {
2199
- return reinterpret_cast<LargeObjectChunk*>(address);
2200
- }
2201
-
2202
- // Returns the address of this chunk.
2203
- Address address() { return reinterpret_cast<Address>(this); }
2204
-
2205
- // Accessors for the fields of the chunk.
2206
- LargeObjectChunk* next() { return next_; }
2207
- void set_next(LargeObjectChunk* chunk) { next_ = chunk; }
2208
- size_t size() { return size_ & ~Page::kPageFlagMask; }
2209
-
2210
- // Compute the start address in the chunk.
2211
- inline Address GetStartAddress();
2212
-
2213
- // Returns the object in this chunk.
2214
- HeapObject* GetObject() { return HeapObject::FromAddress(GetStartAddress()); }
2215
-
2216
- // Given a requested size returns the physical size of a chunk to be
2217
- // allocated.
2218
- static int ChunkSizeFor(int size_in_bytes);
2219
-
2220
- // Given a chunk size, returns the object size it can accommodate. Used by
2221
- // LargeObjectSpace::Available.
2222
- static intptr_t ObjectSizeFor(intptr_t chunk_size) {
2223
- if (chunk_size <= (Page::kPageSize + Page::kObjectStartOffset)) return 0;
2224
- return chunk_size - Page::kPageSize - Page::kObjectStartOffset;
2225
- }
2226
-
2227
- private:
2228
- // A pointer to the next large object chunk in the space or NULL.
2229
- LargeObjectChunk* next_;
2230
-
2231
- // The total size of this chunk.
2232
- size_t size_;
2233
-
2234
- public:
2235
- TRACK_MEMORY("LargeObjectChunk")
2236
- };
2237
-
2238
-
2239
- class LargeObjectSpace : public Space {
2240
- public:
2241
- LargeObjectSpace(Heap* heap, AllocationSpace id);
2242
- virtual ~LargeObjectSpace() {}
2243
-
2244
- // Initializes internal data structures.
2245
- bool Setup();
2246
-
2247
- // Releases internal resources, frees objects in this space.
2248
- void TearDown();
2249
-
2250
- // Allocates a (non-FixedArray, non-Code) large object.
2251
- MUST_USE_RESULT MaybeObject* AllocateRaw(int size_in_bytes);
2252
- // Allocates a large Code object.
2253
- MUST_USE_RESULT MaybeObject* AllocateRawCode(int size_in_bytes);
2254
- // Allocates a large FixedArray.
2255
- MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int size_in_bytes);
2256
-
2257
- // Available bytes for objects in this space.
2258
- inline intptr_t Available();
2259
-
2260
- virtual intptr_t Size() {
2261
- return size_;
2262
- }
2263
-
2264
- virtual intptr_t SizeOfObjects() {
2265
- return objects_size_;
2266
- }
2267
-
2268
- int PageCount() {
2269
- return page_count_;
2270
- }
2271
-
2272
- // Finds an object for a given address, returns Failure::Exception()
2273
- // if it is not found. The function iterates through all objects in this
2274
- // space, may be slow.
2275
- MaybeObject* FindObject(Address a);
2276
-
2277
- // Finds a large object page containing the given pc, returns NULL
2278
- // if such a page doesn't exist.
2279
- LargeObjectChunk* FindChunkContainingPc(Address pc);
2280
-
2281
- // Iterates objects covered by dirty regions.
2282
- void IterateDirtyRegions(ObjectSlotCallback func);
2283
-
2284
- // Frees unmarked objects.
2285
- void FreeUnmarkedObjects();
2286
-
2287
- // Checks whether a heap object is in this space; O(1).
2288
- bool Contains(HeapObject* obj);
2289
-
2290
- // Checks whether the space is empty.
2291
- bool IsEmpty() { return first_chunk_ == NULL; }
2292
-
2293
- // See the comments for ReserveSpace in the Space class. This has to be
2294
- // called after ReserveSpace has been called on the paged spaces, since they
2295
- // may use some memory, leaving less for large objects.
2296
- virtual bool ReserveSpace(int bytes);
2297
-
2298
- #ifdef ENABLE_HEAP_PROTECTION
2299
- // Protect/unprotect the space by marking it read-only/writable.
2300
- void Protect();
2301
- void Unprotect();
2302
- #endif
2303
-
2304
- #ifdef DEBUG
2305
- virtual void Verify();
2306
- virtual void Print();
2307
- void ReportStatistics();
2308
- void CollectCodeStatistics();
2309
- #endif
2310
- // Checks whether an address is in the object area in this space. It
2311
- // iterates all objects in the space. May be slow.
2312
- bool SlowContains(Address addr) { return !FindObject(addr)->IsFailure(); }
2313
-
2314
- private:
2315
- // The head of the linked list of large object chunks.
2316
- LargeObjectChunk* first_chunk_;
2317
- intptr_t size_; // allocated bytes
2318
- int page_count_; // number of chunks
2319
- intptr_t objects_size_; // size of objects
2320
-
2321
- // Shared implementation of AllocateRaw, AllocateRawCode and
2322
- // AllocateRawFixedArray.
2323
- MUST_USE_RESULT MaybeObject* AllocateRawInternal(int requested_size,
2324
- int object_size,
2325
- Executability executable);
2326
-
2327
- friend class LargeObjectIterator;
2328
-
2329
- public:
2330
- TRACK_MEMORY("LargeObjectSpace")
2331
- };
2332
-
2333
-
2334
- class LargeObjectIterator: public ObjectIterator {
2335
- public:
2336
- explicit LargeObjectIterator(LargeObjectSpace* space);
2337
- LargeObjectIterator(LargeObjectSpace* space, HeapObjectCallback size_func);
2338
-
2339
- HeapObject* next();
2340
-
2341
- // implementation of ObjectIterator.
2342
- virtual HeapObject* next_object() { return next(); }
2343
-
2344
- private:
2345
- LargeObjectChunk* current_;
2346
- HeapObjectCallback size_func_;
2347
- };
2348
-
2349
-
2350
- #ifdef DEBUG
2351
- struct CommentStatistic {
2352
- const char* comment;
2353
- int size;
2354
- int count;
2355
- void Clear() {
2356
- comment = NULL;
2357
- size = 0;
2358
- count = 0;
2359
- }
2360
- // Must be small, since an iteration is used for lookup.
2361
- static const int kMaxComments = 64;
2362
- };
2363
- #endif
2364
-
2365
-
2366
- } } // namespace v8::internal
2367
-
2368
- #endif // V8_SPACES_H_