therubyracer 0.9.0beta2 → 0.9.0beta3

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