therubyracer 0.8.1.pre2 → 0.8.1

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 (877) hide show
  1. data/Changelog.md +2 -1
  2. data/README.md +6 -3
  3. data/ext/v8/upstream/3.1.8/.gitignore +31 -0
  4. data/ext/v8/upstream/3.1.8/AUTHORS +40 -0
  5. data/ext/v8/upstream/3.1.8/ChangeLog +2566 -0
  6. data/ext/v8/upstream/3.1.8/LICENSE +52 -0
  7. data/ext/v8/upstream/3.1.8/LICENSE.strongtalk +29 -0
  8. data/ext/v8/upstream/3.1.8/LICENSE.v8 +26 -0
  9. data/ext/v8/upstream/3.1.8/LICENSE.valgrind +45 -0
  10. data/ext/v8/upstream/3.1.8/SConstruct +1192 -0
  11. data/ext/v8/upstream/3.1.8/build/README.txt +25 -0
  12. data/ext/v8/upstream/3.1.8/build/all.gyp +18 -0
  13. data/ext/v8/upstream/3.1.8/build/armu.gypi +32 -0
  14. data/ext/v8/upstream/3.1.8/build/common.gypi +82 -0
  15. data/ext/v8/upstream/3.1.8/build/gyp_v8 +145 -0
  16. data/ext/v8/upstream/3.1.8/include/v8-debug.h +384 -0
  17. data/ext/v8/upstream/3.1.8/include/v8-preparser.h +116 -0
  18. data/ext/v8/upstream/3.1.8/include/v8-profiler.h +426 -0
  19. data/ext/v8/upstream/3.1.8/include/v8-testing.h +99 -0
  20. data/ext/v8/upstream/3.1.8/include/v8.h +3846 -0
  21. data/ext/v8/upstream/3.1.8/include/v8stdint.h +53 -0
  22. data/ext/v8/upstream/3.1.8/preparser/preparser-process.cc +206 -0
  23. data/ext/v8/upstream/3.1.8/src/SConscript +356 -0
  24. data/ext/v8/upstream/3.1.8/src/accessors.cc +907 -0
  25. data/ext/v8/upstream/3.1.8/src/accessors.h +121 -0
  26. data/ext/v8/upstream/3.1.8/src/allocation.cc +204 -0
  27. data/ext/v8/upstream/3.1.8/src/allocation.h +176 -0
  28. data/ext/v8/upstream/3.1.8/src/api.cc +5191 -0
  29. data/ext/v8/upstream/3.1.8/src/api.h +508 -0
  30. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/apinatives.js +0 -0
  31. data/ext/v8/upstream/3.1.8/src/apiutils.h +80 -0
  32. data/ext/v8/upstream/3.1.8/src/arguments.h +105 -0
  33. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm-inl.h +352 -0
  34. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.cc +2756 -0
  35. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.h +1294 -0
  36. data/ext/v8/upstream/3.1.8/src/arm/builtins-arm.cc +1628 -0
  37. data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.cc +6783 -0
  38. data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.h +657 -0
  39. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm-inl.h +48 -0
  40. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.cc +7403 -0
  41. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.h +595 -0
  42. data/ext/v8/upstream/3.1.8/src/arm/constants-arm.cc +152 -0
  43. data/ext/v8/upstream/3.1.8/src/arm/constants-arm.h +769 -0
  44. data/ext/v8/upstream/3.1.8/src/arm/cpu-arm.cc +147 -0
  45. data/ext/v8/upstream/3.1.8/src/arm/debug-arm.cc +315 -0
  46. data/ext/v8/upstream/3.1.8/src/arm/deoptimizer-arm.cc +700 -0
  47. data/ext/v8/upstream/3.1.8/src/arm/disasm-arm.cc +1439 -0
  48. data/ext/v8/upstream/3.1.8/src/arm/frames-arm.cc +45 -0
  49. data/ext/v8/upstream/3.1.8/src/arm/frames-arm.h +168 -0
  50. data/ext/v8/upstream/3.1.8/src/arm/full-codegen-arm.cc +4230 -0
  51. data/ext/v8/upstream/3.1.8/src/arm/ic-arm.cc +1799 -0
  52. data/ext/v8/upstream/3.1.8/src/arm/jump-target-arm.cc +174 -0
  53. data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.cc +2041 -0
  54. data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.h +2046 -0
  55. data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.cc +3822 -0
  56. data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.h +312 -0
  57. data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.cc +303 -0
  58. data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.h +84 -0
  59. data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.cc +2701 -0
  60. data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.h +1015 -0
  61. data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.cc +1280 -0
  62. data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.h +252 -0
  63. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm-inl.h +0 -0
  64. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm.cc +0 -0
  65. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm.h +0 -0
  66. data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.cc +3165 -0
  67. data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.h +402 -0
  68. data/ext/v8/upstream/3.1.8/src/arm/stub-cache-arm.cc +4077 -0
  69. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/virtual-frame-arm-inl.h +0 -0
  70. data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.cc +843 -0
  71. data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.h +520 -0
  72. data/ext/v8/upstream/3.1.8/src/array.js +1231 -0
  73. data/ext/v8/upstream/3.1.8/src/assembler.cc +973 -0
  74. data/ext/v8/upstream/3.1.8/src/assembler.h +787 -0
  75. data/ext/v8/upstream/3.1.8/src/ast-inl.h +107 -0
  76. data/ext/v8/upstream/3.1.8/src/ast.cc +1067 -0
  77. data/ext/v8/upstream/3.1.8/src/ast.h +2177 -0
  78. data/ext/v8/upstream/3.1.8/src/atomicops.h +165 -0
  79. data/ext/v8/upstream/3.1.8/src/atomicops_internals_arm_gcc.h +145 -0
  80. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_gcc.cc +126 -0
  81. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_gcc.h +287 -0
  82. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_macosx.h +301 -0
  83. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_msvc.h +203 -0
  84. data/ext/v8/upstream/3.1.8/src/bignum-dtoa.cc +655 -0
  85. data/ext/v8/upstream/3.1.8/src/bignum-dtoa.h +81 -0
  86. data/ext/v8/upstream/3.1.8/src/bignum.cc +768 -0
  87. data/ext/v8/upstream/3.1.8/src/bignum.h +140 -0
  88. data/ext/v8/upstream/3.1.8/src/bootstrapper.cc +1888 -0
  89. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/bootstrapper.h +0 -0
  90. data/ext/v8/upstream/3.1.8/src/builtins.cc +1586 -0
  91. data/ext/v8/upstream/3.1.8/src/builtins.h +339 -0
  92. data/ext/v8/upstream/3.1.8/src/bytecodes-irregexp.h +105 -0
  93. data/ext/v8/upstream/3.1.8/src/cached-powers.cc +177 -0
  94. data/ext/v8/upstream/3.1.8/src/cached-powers.h +65 -0
  95. data/ext/v8/upstream/3.1.8/src/char-predicates-inl.h +94 -0
  96. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/char-predicates.h +0 -0
  97. data/ext/v8/upstream/3.1.8/src/checks.cc +110 -0
  98. data/ext/v8/upstream/3.1.8/src/checks.h +292 -0
  99. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/circular-queue-inl.h +0 -0
  100. data/ext/v8/upstream/3.1.8/src/circular-queue.cc +122 -0
  101. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/circular-queue.h +0 -0
  102. data/ext/v8/upstream/3.1.8/src/code-stubs.cc +230 -0
  103. data/ext/v8/upstream/3.1.8/src/code-stubs.h +950 -0
  104. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/code.h +0 -0
  105. data/ext/v8/upstream/3.1.8/src/codegen-inl.h +64 -0
  106. data/ext/v8/upstream/3.1.8/src/codegen.cc +495 -0
  107. data/ext/v8/upstream/3.1.8/src/codegen.h +245 -0
  108. data/ext/v8/upstream/3.1.8/src/compilation-cache.cc +654 -0
  109. data/ext/v8/upstream/3.1.8/src/compilation-cache.h +112 -0
  110. data/ext/v8/upstream/3.1.8/src/compiler.cc +806 -0
  111. data/ext/v8/upstream/3.1.8/src/compiler.h +290 -0
  112. data/ext/v8/upstream/3.1.8/src/contexts.cc +320 -0
  113. data/ext/v8/upstream/3.1.8/src/contexts.h +376 -0
  114. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/conversions-inl.h +0 -0
  115. data/ext/v8/upstream/3.1.8/src/conversions.cc +1069 -0
  116. data/ext/v8/upstream/3.1.8/src/conversions.h +122 -0
  117. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/counters.cc +0 -0
  118. data/ext/v8/upstream/3.1.8/src/counters.h +242 -0
  119. data/ext/v8/upstream/3.1.8/src/cpu-profiler-inl.h +100 -0
  120. data/ext/v8/upstream/3.1.8/src/cpu-profiler.cc +554 -0
  121. data/ext/v8/upstream/3.1.8/src/cpu-profiler.h +291 -0
  122. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/cpu.h +0 -0
  123. data/ext/v8/upstream/3.1.8/src/d8-debug.cc +367 -0
  124. data/ext/v8/upstream/3.1.8/src/d8-debug.h +157 -0
  125. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-posix.cc +0 -0
  126. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-readline.cc +0 -0
  127. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-windows.cc +0 -0
  128. data/ext/v8/upstream/3.1.8/src/d8.cc +792 -0
  129. data/ext/v8/upstream/3.1.8/src/d8.gyp +85 -0
  130. data/ext/v8/upstream/3.1.8/src/d8.h +231 -0
  131. data/ext/v8/upstream/3.1.8/src/d8.js +2798 -0
  132. data/ext/v8/upstream/3.1.8/src/data-flow.cc +545 -0
  133. data/ext/v8/upstream/3.1.8/src/data-flow.h +379 -0
  134. data/ext/v8/upstream/3.1.8/src/date.js +1103 -0
  135. data/ext/v8/upstream/3.1.8/src/dateparser-inl.h +125 -0
  136. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/dateparser.cc +0 -0
  137. data/ext/v8/upstream/3.1.8/src/dateparser.h +263 -0
  138. data/ext/v8/upstream/3.1.8/src/debug-agent.cc +446 -0
  139. data/ext/v8/upstream/3.1.8/src/debug-agent.h +131 -0
  140. data/ext/v8/upstream/3.1.8/src/debug-debugger.js +2569 -0
  141. data/ext/v8/upstream/3.1.8/src/debug.cc +3085 -0
  142. data/ext/v8/upstream/3.1.8/src/debug.h +1025 -0
  143. data/ext/v8/upstream/3.1.8/src/deoptimizer.cc +1185 -0
  144. data/ext/v8/upstream/3.1.8/src/deoptimizer.h +529 -0
  145. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/disasm.h +0 -0
  146. data/ext/v8/upstream/3.1.8/src/disassembler.cc +338 -0
  147. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/disassembler.h +0 -0
  148. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/diy-fp.cc +0 -0
  149. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/diy-fp.h +0 -0
  150. data/ext/v8/upstream/3.1.8/src/double.h +238 -0
  151. data/ext/v8/upstream/3.1.8/src/dtoa.cc +103 -0
  152. data/ext/v8/upstream/3.1.8/src/dtoa.h +85 -0
  153. data/ext/v8/upstream/3.1.8/src/execution.cc +735 -0
  154. data/ext/v8/upstream/3.1.8/src/execution.h +322 -0
  155. data/ext/v8/upstream/3.1.8/src/extensions/experimental/experimental.gyp +53 -0
  156. data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.cc +264 -0
  157. data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.h +64 -0
  158. data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.cc +141 -0
  159. data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.h +50 -0
  160. data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.cc +58 -0
  161. data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.h +49 -0
  162. data/ext/v8/upstream/3.1.8/src/factory.cc +1087 -0
  163. data/ext/v8/upstream/3.1.8/src/factory.h +432 -0
  164. data/ext/v8/upstream/3.1.8/src/fast-dtoa.cc +736 -0
  165. data/ext/v8/upstream/3.1.8/src/fast-dtoa.h +83 -0
  166. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/fixed-dtoa.cc +0 -0
  167. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/fixed-dtoa.h +0 -0
  168. data/ext/v8/upstream/3.1.8/src/flag-definitions.h +552 -0
  169. data/ext/v8/upstream/3.1.8/src/flags.cc +551 -0
  170. data/ext/v8/upstream/3.1.8/src/flags.h +79 -0
  171. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/frame-element.cc +0 -0
  172. data/ext/v8/upstream/3.1.8/src/frame-element.h +277 -0
  173. data/ext/v8/upstream/3.1.8/src/frames-inl.h +210 -0
  174. data/ext/v8/upstream/3.1.8/src/frames.cc +1232 -0
  175. data/ext/v8/upstream/3.1.8/src/frames.h +826 -0
  176. data/ext/v8/upstream/3.1.8/src/full-codegen.cc +1382 -0
  177. data/ext/v8/upstream/3.1.8/src/full-codegen.h +751 -0
  178. data/ext/v8/upstream/3.1.8/src/func-name-inferrer.cc +90 -0
  179. data/ext/v8/upstream/3.1.8/src/func-name-inferrer.h +111 -0
  180. data/ext/v8/upstream/3.1.8/src/gdb-jit.cc +1547 -0
  181. data/ext/v8/upstream/3.1.8/src/gdb-jit.h +138 -0
  182. data/ext/v8/upstream/3.1.8/src/global-handles.cc +534 -0
  183. data/ext/v8/upstream/3.1.8/src/global-handles.h +181 -0
  184. data/ext/v8/upstream/3.1.8/src/globals.h +325 -0
  185. data/ext/v8/upstream/3.1.8/src/handles-inl.h +80 -0
  186. data/ext/v8/upstream/3.1.8/src/handles.cc +910 -0
  187. data/ext/v8/upstream/3.1.8/src/handles.h +424 -0
  188. data/ext/v8/upstream/3.1.8/src/hashmap.cc +230 -0
  189. data/ext/v8/upstream/3.1.8/src/hashmap.h +121 -0
  190. data/ext/v8/upstream/3.1.8/src/heap-inl.h +587 -0
  191. data/ext/v8/upstream/3.1.8/src/heap-profiler.cc +1128 -0
  192. data/ext/v8/upstream/3.1.8/src/heap-profiler.h +381 -0
  193. data/ext/v8/upstream/3.1.8/src/heap.cc +5610 -0
  194. data/ext/v8/upstream/3.1.8/src/heap.h +2218 -0
  195. data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.cc +1490 -0
  196. data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.h +3493 -0
  197. data/ext/v8/upstream/3.1.8/src/hydrogen.cc +6056 -0
  198. data/ext/v8/upstream/3.1.8/src/hydrogen.h +1091 -0
  199. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32-inl.h +429 -0
  200. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.cc +2800 -0
  201. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.h +1093 -0
  202. data/ext/v8/upstream/3.1.8/src/ia32/builtins-ia32.cc +1590 -0
  203. data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.cc +6624 -0
  204. data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.h +536 -0
  205. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/codegen-ia32-inl.h +0 -0
  206. data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.cc +10354 -0
  207. data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.h +798 -0
  208. data/ext/v8/upstream/3.1.8/src/ia32/cpu-ia32.cc +87 -0
  209. data/ext/v8/upstream/3.1.8/src/ia32/debug-ia32.cc +309 -0
  210. data/ext/v8/upstream/3.1.8/src/ia32/deoptimizer-ia32.cc +664 -0
  211. data/ext/v8/upstream/3.1.8/src/ia32/disasm-ia32.cc +1597 -0
  212. data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.cc +45 -0
  213. data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.h +140 -0
  214. data/ext/v8/upstream/3.1.8/src/ia32/full-codegen-ia32.cc +4278 -0
  215. data/ext/v8/upstream/3.1.8/src/ia32/ic-ia32.cc +1786 -0
  216. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/jump-target-ia32.cc +0 -0
  217. data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.cc +3880 -0
  218. data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.h +309 -0
  219. data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.cc +460 -0
  220. data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
  221. data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.cc +2095 -0
  222. data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.h +2127 -0
  223. data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.cc +2031 -0
  224. data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.h +798 -0
  225. data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.cc +1253 -0
  226. data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.h +215 -0
  227. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32-inl.h +0 -0
  228. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32.cc +0 -0
  229. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32.h +0 -0
  230. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/simulator-ia32.cc +0 -0
  231. data/ext/v8/upstream/3.1.8/src/ia32/simulator-ia32.h +72 -0
  232. data/ext/v8/upstream/3.1.8/src/ia32/stub-cache-ia32.cc +3732 -0
  233. data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.cc +1360 -0
  234. data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.h +646 -0
  235. data/ext/v8/upstream/3.1.8/src/ic-inl.h +129 -0
  236. data/ext/v8/upstream/3.1.8/src/ic.cc +2333 -0
  237. data/ext/v8/upstream/3.1.8/src/ic.h +639 -0
  238. data/ext/v8/upstream/3.1.8/src/inspector.cc +63 -0
  239. data/ext/v8/upstream/3.1.8/src/inspector.h +62 -0
  240. data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.cc +655 -0
  241. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/interpreter-irregexp.h +0 -0
  242. data/ext/v8/upstream/3.1.8/src/json.js +342 -0
  243. data/ext/v8/upstream/3.1.8/src/jsregexp.cc +5340 -0
  244. data/ext/v8/upstream/3.1.8/src/jsregexp.h +1484 -0
  245. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-heavy-inl.h +0 -0
  246. data/ext/v8/upstream/3.1.8/src/jump-target-heavy.cc +430 -0
  247. data/ext/v8/upstream/3.1.8/src/jump-target-heavy.h +244 -0
  248. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-inl.h +0 -0
  249. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-light-inl.h +0 -0
  250. data/ext/v8/upstream/3.1.8/src/jump-target-light.cc +111 -0
  251. data/ext/v8/upstream/3.1.8/src/jump-target-light.h +193 -0
  252. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target.cc +0 -0
  253. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target.h +0 -0
  254. data/ext/v8/upstream/3.1.8/src/list-inl.h +206 -0
  255. data/ext/v8/upstream/3.1.8/src/list.h +164 -0
  256. data/ext/v8/upstream/3.1.8/src/lithium-allocator-inl.h +140 -0
  257. data/ext/v8/upstream/3.1.8/src/lithium-allocator.cc +2093 -0
  258. data/ext/v8/upstream/3.1.8/src/lithium-allocator.h +644 -0
  259. data/ext/v8/upstream/3.1.8/src/lithium.cc +168 -0
  260. data/ext/v8/upstream/3.1.8/src/lithium.h +592 -0
  261. data/ext/v8/upstream/3.1.8/src/liveedit-debugger.js +1082 -0
  262. data/ext/v8/upstream/3.1.8/src/liveedit.cc +1650 -0
  263. data/ext/v8/upstream/3.1.8/src/liveedit.h +174 -0
  264. data/ext/v8/upstream/3.1.8/src/liveobjectlist-inl.h +126 -0
  265. data/ext/v8/upstream/3.1.8/src/liveobjectlist.cc +2527 -0
  266. data/ext/v8/upstream/3.1.8/src/liveobjectlist.h +322 -0
  267. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/log-inl.h +0 -0
  268. data/ext/v8/upstream/3.1.8/src/log-utils.cc +336 -0
  269. data/ext/v8/upstream/3.1.8/src/log-utils.h +232 -0
  270. data/ext/v8/upstream/3.1.8/src/log.cc +1608 -0
  271. data/ext/v8/upstream/3.1.8/src/log.h +379 -0
  272. data/ext/v8/upstream/3.1.8/src/macro-assembler.h +120 -0
  273. data/ext/v8/upstream/3.1.8/src/macros.py +178 -0
  274. data/ext/v8/upstream/3.1.8/src/mark-compact.cc +2957 -0
  275. data/ext/v8/upstream/3.1.8/src/mark-compact.h +433 -0
  276. data/ext/v8/upstream/3.1.8/src/math.js +264 -0
  277. data/ext/v8/upstream/3.1.8/src/memory.h +82 -0
  278. data/ext/v8/upstream/3.1.8/src/messages.cc +164 -0
  279. data/ext/v8/upstream/3.1.8/src/messages.h +114 -0
  280. data/ext/v8/upstream/3.1.8/src/messages.js +1071 -0
  281. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/assembler-mips-inl.h +0 -0
  282. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/assembler-mips.cc +0 -0
  283. data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.h +667 -0
  284. data/ext/v8/upstream/3.1.8/src/mips/builtins-mips.cc +205 -0
  285. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/codegen-mips-inl.h +0 -0
  286. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/codegen-mips.cc +0 -0
  287. data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.h +431 -0
  288. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/constants-mips.cc +0 -0
  289. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/constants-mips.h +0 -0
  290. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/cpu-mips.cc +0 -0
  291. data/ext/v8/upstream/3.1.8/src/mips/debug-mips.cc +127 -0
  292. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/disasm-mips.cc +0 -0
  293. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/fast-codegen-mips.cc +0 -0
  294. data/ext/v8/upstream/3.1.8/src/mips/frames-mips.cc +96 -0
  295. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/frames-mips.h +0 -0
  296. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/full-codegen-mips.cc +0 -0
  297. data/ext/v8/upstream/3.1.8/src/mips/ic-mips.cc +208 -0
  298. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/jump-target-mips.cc +0 -0
  299. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/macro-assembler-mips.cc +0 -0
  300. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/macro-assembler-mips.h +0 -0
  301. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips-inl.h +0 -0
  302. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips.cc +0 -0
  303. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips.h +0 -0
  304. data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.cc +1650 -0
  305. data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.h +311 -0
  306. data/ext/v8/upstream/3.1.8/src/mips/stub-cache-mips.cc +418 -0
  307. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/virtual-frame-mips.cc +0 -0
  308. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/virtual-frame-mips.h +0 -0
  309. data/ext/v8/upstream/3.1.8/src/mirror-debugger.js +2380 -0
  310. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mksnapshot.cc +0 -0
  311. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/natives.h +0 -0
  312. data/ext/v8/upstream/3.1.8/src/objects-debug.cc +722 -0
  313. data/ext/v8/upstream/3.1.8/src/objects-inl.h +3946 -0
  314. data/ext/v8/upstream/3.1.8/src/objects-printer.cc +801 -0
  315. data/ext/v8/upstream/3.1.8/src/objects-visiting.cc +142 -0
  316. data/ext/v8/upstream/3.1.8/src/objects-visiting.h +401 -0
  317. data/ext/v8/upstream/3.1.8/src/objects.cc +10044 -0
  318. data/ext/v8/upstream/3.1.8/src/objects.h +6571 -0
  319. data/ext/v8/upstream/3.1.8/src/parser.cc +5165 -0
  320. data/ext/v8/upstream/3.1.8/src/parser.h +802 -0
  321. data/ext/v8/upstream/3.1.8/src/platform-cygwin.cc +745 -0
  322. data/ext/v8/upstream/3.1.8/src/platform-freebsd.cc +702 -0
  323. data/ext/v8/upstream/3.1.8/src/platform-linux.cc +981 -0
  324. data/ext/v8/upstream/3.1.8/src/platform-macos.cc +732 -0
  325. data/ext/v8/upstream/3.1.8/src/platform-nullos.cc +498 -0
  326. data/ext/v8/upstream/3.1.8/src/platform-openbsd.cc +657 -0
  327. data/ext/v8/upstream/3.1.8/src/platform-posix.cc +399 -0
  328. data/ext/v8/upstream/3.1.8/src/platform-solaris.cc +714 -0
  329. data/ext/v8/upstream/3.1.8/src/platform-win32.cc +1974 -0
  330. data/ext/v8/upstream/3.1.8/src/platform.h +636 -0
  331. data/ext/v8/upstream/3.1.8/src/preparse-data.cc +183 -0
  332. data/ext/v8/upstream/3.1.8/src/preparse-data.h +249 -0
  333. data/ext/v8/upstream/3.1.8/src/preparser-api.cc +213 -0
  334. data/ext/v8/upstream/3.1.8/src/preparser.cc +1205 -0
  335. data/ext/v8/upstream/3.1.8/src/preparser.h +278 -0
  336. data/ext/v8/upstream/3.1.8/src/prettyprinter.cc +1539 -0
  337. data/ext/v8/upstream/3.1.8/src/prettyprinter.h +223 -0
  338. data/ext/v8/upstream/3.1.8/src/profile-generator-inl.h +128 -0
  339. data/ext/v8/upstream/3.1.8/src/profile-generator.cc +2899 -0
  340. data/ext/v8/upstream/3.1.8/src/profile-generator.h +1151 -0
  341. data/ext/v8/upstream/3.1.8/src/property.cc +96 -0
  342. data/ext/v8/upstream/3.1.8/src/property.h +337 -0
  343. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
  344. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.cc +470 -0
  345. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.h +142 -0
  346. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-tracer.cc +373 -0
  347. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-tracer.h +104 -0
  348. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.cc +257 -0
  349. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.h +231 -0
  350. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-stack.cc +0 -0
  351. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-stack.h +0 -0
  352. data/ext/v8/upstream/3.1.8/src/regexp.js +483 -0
  353. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator-inl.h +0 -0
  354. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator.cc +0 -0
  355. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator.h +0 -0
  356. data/ext/v8/upstream/3.1.8/src/rewriter.cc +1023 -0
  357. data/ext/v8/upstream/3.1.8/src/rewriter.h +59 -0
  358. data/ext/v8/upstream/3.1.8/src/runtime-profiler.cc +443 -0
  359. data/ext/v8/upstream/3.1.8/src/runtime-profiler.h +77 -0
  360. data/ext/v8/upstream/3.1.8/src/runtime.cc +11592 -0
  361. data/ext/v8/upstream/3.1.8/src/runtime.h +582 -0
  362. data/ext/v8/upstream/3.1.8/src/runtime.js +643 -0
  363. data/ext/v8/upstream/3.1.8/src/safepoint-table.cc +253 -0
  364. data/ext/v8/upstream/3.1.8/src/safepoint-table.h +263 -0
  365. data/ext/v8/upstream/3.1.8/src/scanner-base.cc +971 -0
  366. data/ext/v8/upstream/3.1.8/src/scanner-base.h +653 -0
  367. data/ext/v8/upstream/3.1.8/src/scanner.cc +586 -0
  368. data/ext/v8/upstream/3.1.8/src/scanner.h +194 -0
  369. data/ext/v8/upstream/3.1.8/src/scopeinfo.cc +636 -0
  370. data/ext/v8/upstream/3.1.8/src/scopeinfo.h +238 -0
  371. data/ext/v8/upstream/3.1.8/src/scopes.cc +1063 -0
  372. data/ext/v8/upstream/3.1.8/src/scopes.h +494 -0
  373. data/ext/v8/upstream/3.1.8/src/serialize.cc +1535 -0
  374. data/ext/v8/upstream/3.1.8/src/serialize.h +584 -0
  375. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/shell.h +0 -0
  376. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/simulator.h +0 -0
  377. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/smart-pointer.h +0 -0
  378. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot-common.cc +0 -0
  379. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot-empty.cc +0 -0
  380. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot.h +0 -0
  381. data/ext/v8/upstream/3.1.8/src/spaces-inl.h +524 -0
  382. data/ext/v8/upstream/3.1.8/src/spaces.cc +3254 -0
  383. data/ext/v8/upstream/3.1.8/src/spaces.h +2362 -0
  384. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/splay-tree-inl.h +0 -0
  385. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/splay-tree.h +0 -0
  386. data/ext/v8/upstream/3.1.8/src/string-search.cc +40 -0
  387. data/ext/v8/upstream/3.1.8/src/string-search.h +567 -0
  388. data/ext/v8/upstream/3.1.8/src/string-stream.cc +584 -0
  389. data/ext/v8/upstream/3.1.8/src/string-stream.h +191 -0
  390. data/ext/v8/upstream/3.1.8/src/string.js +915 -0
  391. data/ext/v8/upstream/3.1.8/src/strtod.cc +440 -0
  392. data/ext/v8/upstream/3.1.8/src/strtod.h +40 -0
  393. data/ext/v8/upstream/3.1.8/src/stub-cache.cc +1878 -0
  394. data/ext/v8/upstream/3.1.8/src/stub-cache.h +849 -0
  395. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/third_party/valgrind/valgrind.h +0 -0
  396. data/ext/v8/upstream/3.1.8/src/token.cc +63 -0
  397. data/ext/v8/upstream/3.1.8/src/token.h +288 -0
  398. data/ext/v8/upstream/3.1.8/src/top.cc +1152 -0
  399. data/ext/v8/upstream/3.1.8/src/top.h +608 -0
  400. data/ext/v8/upstream/3.1.8/src/type-info.cc +406 -0
  401. data/ext/v8/upstream/3.1.8/src/type-info.h +283 -0
  402. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/unbound-queue-inl.h +0 -0
  403. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/unbound-queue.h +0 -0
  404. data/ext/v8/upstream/3.1.8/src/unicode-inl.h +238 -0
  405. data/ext/v8/upstream/3.1.8/src/unicode.cc +1624 -0
  406. data/ext/v8/upstream/3.1.8/src/unicode.h +280 -0
  407. data/ext/v8/upstream/3.1.8/src/uri.js +402 -0
  408. data/ext/v8/upstream/3.1.8/src/utils.cc +371 -0
  409. data/ext/v8/upstream/3.1.8/src/utils.h +793 -0
  410. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/v8-counters.cc +0 -0
  411. data/ext/v8/upstream/3.1.8/src/v8-counters.h +290 -0
  412. data/ext/v8/upstream/3.1.8/src/v8.cc +270 -0
  413. data/ext/v8/upstream/3.1.8/src/v8.h +127 -0
  414. data/ext/v8/upstream/3.1.8/src/v8checks.h +64 -0
  415. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/v8dll-main.cc +0 -0
  416. data/ext/v8/upstream/3.1.8/src/v8globals.h +480 -0
  417. data/ext/v8/upstream/3.1.8/src/v8natives.js +1252 -0
  418. data/ext/v8/upstream/3.1.8/src/v8preparserdll-main.cc +39 -0
  419. data/ext/v8/upstream/3.1.8/src/v8threads.cc +440 -0
  420. data/ext/v8/upstream/3.1.8/src/v8threads.h +157 -0
  421. data/ext/v8/upstream/3.1.8/src/v8utils.h +354 -0
  422. data/ext/v8/upstream/3.1.8/src/variables.cc +132 -0
  423. data/ext/v8/upstream/3.1.8/src/variables.h +212 -0
  424. data/ext/v8/upstream/3.1.8/src/version.cc +95 -0
  425. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/version.h +0 -0
  426. data/ext/v8/upstream/3.1.8/src/virtual-frame-heavy-inl.h +190 -0
  427. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-heavy.cc +0 -0
  428. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-inl.h +0 -0
  429. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-light-inl.h +0 -0
  430. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-light.cc +0 -0
  431. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame.cc +0 -0
  432. data/ext/v8/upstream/3.1.8/src/virtual-frame.h +59 -0
  433. data/ext/v8/upstream/3.1.8/src/vm-state-inl.h +134 -0
  434. data/ext/v8/upstream/3.1.8/src/vm-state.h +68 -0
  435. data/ext/v8/upstream/3.1.8/src/win32-headers.h +95 -0
  436. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64-inl.h +455 -0
  437. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.cc +3162 -0
  438. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.h +1584 -0
  439. data/ext/v8/upstream/3.1.8/src/x64/builtins-x64.cc +1492 -0
  440. data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.cc +5150 -0
  441. data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.h +519 -0
  442. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64-inl.h +46 -0
  443. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.cc +8835 -0
  444. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.h +750 -0
  445. data/ext/v8/upstream/3.1.8/src/x64/cpu-x64.cc +86 -0
  446. data/ext/v8/upstream/3.1.8/src/x64/debug-x64.cc +316 -0
  447. data/ext/v8/upstream/3.1.8/src/x64/deoptimizer-x64.cc +781 -0
  448. data/ext/v8/upstream/3.1.8/src/x64/disasm-x64.cc +1737 -0
  449. data/ext/v8/upstream/3.1.8/src/x64/frames-x64.cc +45 -0
  450. data/ext/v8/upstream/3.1.8/src/x64/frames-x64.h +130 -0
  451. data/ext/v8/upstream/3.1.8/src/x64/full-codegen-x64.cc +3984 -0
  452. data/ext/v8/upstream/3.1.8/src/x64/ic-x64.cc +1761 -0
  453. data/ext/v8/upstream/3.1.8/src/x64/jump-target-x64.cc +437 -0
  454. data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.cc +3639 -0
  455. data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.h +305 -0
  456. data/ext/v8/upstream/3.1.8/src/x64/lithium-gap-resolver-x64.cc +320 -0
  457. data/ext/v8/upstream/3.1.8/src/x64/lithium-gap-resolver-x64.h +74 -0
  458. data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.cc +2044 -0
  459. data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.h +2052 -0
  460. data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.cc +2660 -0
  461. data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.h +1852 -0
  462. data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.cc +1382 -0
  463. data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.h +278 -0
  464. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64-inl.h +0 -0
  465. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64.cc +0 -0
  466. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64.h +0 -0
  467. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/simulator-x64.cc +0 -0
  468. data/ext/v8/upstream/3.1.8/src/x64/simulator-x64.h +71 -0
  469. data/ext/v8/upstream/3.1.8/src/x64/stub-cache-x64.cc +3509 -0
  470. data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.cc +1292 -0
  471. data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.h +593 -0
  472. data/ext/v8/upstream/3.1.8/src/zone-inl.h +83 -0
  473. data/ext/v8/upstream/3.1.8/src/zone.cc +195 -0
  474. data/ext/v8/upstream/3.1.8/src/zone.h +233 -0
  475. data/ext/v8/upstream/3.1.8/tools/codemap.js +265 -0
  476. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/consarray.js +0 -0
  477. data/ext/v8/upstream/3.1.8/tools/csvparser.js +78 -0
  478. data/ext/v8/upstream/3.1.8/tools/disasm.py +92 -0
  479. data/ext/v8/upstream/3.1.8/tools/gc-nvp-trace-processor.py +328 -0
  480. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/generate-ten-powers.scm +0 -0
  481. data/ext/v8/upstream/3.1.8/tools/grokdump.py +840 -0
  482. data/ext/v8/upstream/3.1.8/tools/gyp/v8.gyp +869 -0
  483. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/js2c.py +0 -0
  484. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/jsmin.py +0 -0
  485. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/linux-tick-processor +0 -0
  486. data/ext/v8/upstream/3.1.8/tools/ll_prof.py +919 -0
  487. data/ext/v8/upstream/3.1.8/tools/logreader.js +185 -0
  488. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/mac-nm +0 -0
  489. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/mac-tick-processor +0 -0
  490. data/ext/v8/upstream/3.1.8/tools/oom_dump/README +31 -0
  491. data/ext/v8/upstream/3.1.8/tools/oom_dump/SConstruct +42 -0
  492. data/ext/v8/upstream/3.1.8/tools/oom_dump/oom_dump.cc +288 -0
  493. data/ext/v8/upstream/3.1.8/tools/presubmit.py +305 -0
  494. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/process-heap-prof.py +0 -0
  495. data/ext/v8/upstream/3.1.8/tools/profile.js +751 -0
  496. data/ext/v8/upstream/3.1.8/tools/profile_view.js +219 -0
  497. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/run-valgrind.py +0 -0
  498. data/ext/v8/upstream/3.1.8/tools/splaytree.js +316 -0
  499. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/stats-viewer.py +0 -0
  500. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/tickprocessor-driver.js +0 -0
  501. data/ext/v8/upstream/3.1.8/tools/tickprocessor.js +863 -0
  502. data/ext/v8/upstream/3.1.8/tools/utils.py +96 -0
  503. data/ext/v8/upstream/3.1.8/tools/visual_studio/README.txt +70 -0
  504. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/arm.vsprops +0 -0
  505. data/ext/v8/upstream/3.1.8/tools/visual_studio/common.vsprops +34 -0
  506. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8.vcproj +0 -0
  507. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8_arm.vcproj +0 -0
  508. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8_x64.vcproj +0 -0
  509. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8js2c.cmd +0 -0
  510. data/ext/v8/upstream/3.1.8/tools/visual_studio/debug.vsprops +17 -0
  511. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/ia32.vsprops +0 -0
  512. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/js2c.cmd +0 -0
  513. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/release.vsprops +0 -0
  514. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8.sln +0 -0
  515. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8.vcproj +0 -0
  516. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_arm.sln +0 -0
  517. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_arm.vcproj +0 -0
  518. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base.vcproj +1296 -0
  519. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_arm.vcproj +1234 -0
  520. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_x64.vcproj +1296 -0
  521. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest.vcproj +0 -0
  522. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
  523. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
  524. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
  525. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
  526. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample.vcproj +0 -0
  527. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
  528. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
  529. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample.vcproj +147 -0
  530. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample_arm.vcproj +147 -0
  531. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample_x64.vcproj +163 -0
  532. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot.vcproj +0 -0
  533. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
  534. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
  535. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
  536. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_x64.sln +0 -0
  537. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_x64.vcproj +0 -0
  538. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/x64.vsprops +0 -0
  539. data/ext/v8/upstream/3.1.8/tools/windows-tick-processor.bat +30 -0
  540. data/ext/v8/upstream/Makefile +2 -1
  541. data/ext/v8/v8_template.cpp +2 -2
  542. data/lib/v8/version.rb +1 -1
  543. data/spec/redjs/jsapi_spec.rb +2 -2
  544. metadata +552 -490
  545. data/ext/v8/upstream/2.3.3/.gitignore +0 -26
  546. data/ext/v8/upstream/2.3.3/AUTHORS +0 -31
  547. data/ext/v8/upstream/2.3.3/ChangeLog +0 -1916
  548. data/ext/v8/upstream/2.3.3/LICENSE +0 -55
  549. data/ext/v8/upstream/2.3.3/SConstruct +0 -1154
  550. data/ext/v8/upstream/2.3.3/include/v8-debug.h +0 -381
  551. data/ext/v8/upstream/2.3.3/include/v8-profiler.h +0 -353
  552. data/ext/v8/upstream/2.3.3/include/v8.h +0 -3616
  553. data/ext/v8/upstream/2.3.3/src/SConscript +0 -330
  554. data/ext/v8/upstream/2.3.3/src/accessors.cc +0 -661
  555. data/ext/v8/upstream/2.3.3/src/accessors.h +0 -114
  556. data/ext/v8/upstream/2.3.3/src/allocation.cc +0 -198
  557. data/ext/v8/upstream/2.3.3/src/allocation.h +0 -169
  558. data/ext/v8/upstream/2.3.3/src/api.cc +0 -4795
  559. data/ext/v8/upstream/2.3.3/src/api.h +0 -485
  560. data/ext/v8/upstream/2.3.3/src/apiutils.h +0 -69
  561. data/ext/v8/upstream/2.3.3/src/arguments.h +0 -96
  562. data/ext/v8/upstream/2.3.3/src/arm/assembler-arm-inl.h +0 -305
  563. data/ext/v8/upstream/2.3.3/src/arm/assembler-arm.cc +0 -2580
  564. data/ext/v8/upstream/2.3.3/src/arm/assembler-arm.h +0 -1275
  565. data/ext/v8/upstream/2.3.3/src/arm/builtins-arm.cc +0 -1320
  566. data/ext/v8/upstream/2.3.3/src/arm/codegen-arm-inl.h +0 -48
  567. data/ext/v8/upstream/2.3.3/src/arm/codegen-arm.cc +0 -11398
  568. data/ext/v8/upstream/2.3.3/src/arm/codegen-arm.h +0 -1102
  569. data/ext/v8/upstream/2.3.3/src/arm/constants-arm.cc +0 -154
  570. data/ext/v8/upstream/2.3.3/src/arm/constants-arm.h +0 -388
  571. data/ext/v8/upstream/2.3.3/src/arm/cpu-arm.cc +0 -142
  572. data/ext/v8/upstream/2.3.3/src/arm/debug-arm.cc +0 -309
  573. data/ext/v8/upstream/2.3.3/src/arm/disasm-arm.cc +0 -1459
  574. data/ext/v8/upstream/2.3.3/src/arm/fast-codegen-arm.cc +0 -241
  575. data/ext/v8/upstream/2.3.3/src/arm/frames-arm.cc +0 -123
  576. data/ext/v8/upstream/2.3.3/src/arm/frames-arm.h +0 -162
  577. data/ext/v8/upstream/2.3.3/src/arm/full-codegen-arm.cc +0 -3178
  578. data/ext/v8/upstream/2.3.3/src/arm/ic-arm.cc +0 -2258
  579. data/ext/v8/upstream/2.3.3/src/arm/jump-target-arm.cc +0 -164
  580. data/ext/v8/upstream/2.3.3/src/arm/macro-assembler-arm.cc +0 -1892
  581. data/ext/v8/upstream/2.3.3/src/arm/macro-assembler-arm.h +0 -727
  582. data/ext/v8/upstream/2.3.3/src/arm/regexp-macro-assembler-arm.cc +0 -1261
  583. data/ext/v8/upstream/2.3.3/src/arm/regexp-macro-assembler-arm.h +0 -266
  584. data/ext/v8/upstream/2.3.3/src/arm/simulator-arm.cc +0 -2822
  585. data/ext/v8/upstream/2.3.3/src/arm/simulator-arm.h +0 -361
  586. data/ext/v8/upstream/2.3.3/src/arm/stub-cache-arm.cc +0 -2387
  587. data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm.cc +0 -834
  588. data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm.h +0 -519
  589. data/ext/v8/upstream/2.3.3/src/array.js +0 -1127
  590. data/ext/v8/upstream/2.3.3/src/assembler.cc +0 -801
  591. data/ext/v8/upstream/2.3.3/src/assembler.h +0 -573
  592. data/ext/v8/upstream/2.3.3/src/ast-inl.h +0 -81
  593. data/ext/v8/upstream/2.3.3/src/ast.cc +0 -1152
  594. data/ext/v8/upstream/2.3.3/src/ast.h +0 -2106
  595. data/ext/v8/upstream/2.3.3/src/bootstrapper.cc +0 -1819
  596. data/ext/v8/upstream/2.3.3/src/builtins.cc +0 -1529
  597. data/ext/v8/upstream/2.3.3/src/builtins.h +0 -263
  598. data/ext/v8/upstream/2.3.3/src/bytecodes-irregexp.h +0 -104
  599. data/ext/v8/upstream/2.3.3/src/cached-powers.h +0 -119
  600. data/ext/v8/upstream/2.3.3/src/char-predicates-inl.h +0 -86
  601. data/ext/v8/upstream/2.3.3/src/checks.cc +0 -100
  602. data/ext/v8/upstream/2.3.3/src/checks.h +0 -310
  603. data/ext/v8/upstream/2.3.3/src/circular-queue.cc +0 -121
  604. data/ext/v8/upstream/2.3.3/src/code-stubs.cc +0 -177
  605. data/ext/v8/upstream/2.3.3/src/code-stubs.h +0 -177
  606. data/ext/v8/upstream/2.3.3/src/codegen-inl.h +0 -60
  607. data/ext/v8/upstream/2.3.3/src/codegen.cc +0 -516
  608. data/ext/v8/upstream/2.3.3/src/codegen.h +0 -897
  609. data/ext/v8/upstream/2.3.3/src/compilation-cache.cc +0 -562
  610. data/ext/v8/upstream/2.3.3/src/compilation-cache.h +0 -102
  611. data/ext/v8/upstream/2.3.3/src/compiler.cc +0 -654
  612. data/ext/v8/upstream/2.3.3/src/compiler.h +0 -299
  613. data/ext/v8/upstream/2.3.3/src/contexts.cc +0 -256
  614. data/ext/v8/upstream/2.3.3/src/contexts.h +0 -342
  615. data/ext/v8/upstream/2.3.3/src/conversions.cc +0 -1119
  616. data/ext/v8/upstream/2.3.3/src/conversions.h +0 -123
  617. data/ext/v8/upstream/2.3.3/src/counters.h +0 -239
  618. data/ext/v8/upstream/2.3.3/src/cpu-profiler-inl.h +0 -100
  619. data/ext/v8/upstream/2.3.3/src/cpu-profiler.cc +0 -538
  620. data/ext/v8/upstream/2.3.3/src/cpu-profiler.h +0 -285
  621. data/ext/v8/upstream/2.3.3/src/d8-debug.cc +0 -356
  622. data/ext/v8/upstream/2.3.3/src/d8-debug.h +0 -155
  623. data/ext/v8/upstream/2.3.3/src/d8.cc +0 -783
  624. data/ext/v8/upstream/2.3.3/src/d8.h +0 -227
  625. data/ext/v8/upstream/2.3.3/src/d8.js +0 -1683
  626. data/ext/v8/upstream/2.3.3/src/data-flow.cc +0 -758
  627. data/ext/v8/upstream/2.3.3/src/data-flow.h +0 -278
  628. data/ext/v8/upstream/2.3.3/src/date.js +0 -1059
  629. data/ext/v8/upstream/2.3.3/src/dateparser-inl.h +0 -123
  630. data/ext/v8/upstream/2.3.3/src/dateparser.h +0 -244
  631. data/ext/v8/upstream/2.3.3/src/debug-agent.cc +0 -427
  632. data/ext/v8/upstream/2.3.3/src/debug-agent.h +0 -129
  633. data/ext/v8/upstream/2.3.3/src/debug-debugger.js +0 -2227
  634. data/ext/v8/upstream/2.3.3/src/debug.cc +0 -3005
  635. data/ext/v8/upstream/2.3.3/src/debug.h +0 -993
  636. data/ext/v8/upstream/2.3.3/src/disassembler.cc +0 -312
  637. data/ext/v8/upstream/2.3.3/src/double.h +0 -169
  638. data/ext/v8/upstream/2.3.3/src/dtoa-config.c +0 -92
  639. data/ext/v8/upstream/2.3.3/src/dtoa.cc +0 -77
  640. data/ext/v8/upstream/2.3.3/src/dtoa.h +0 -81
  641. data/ext/v8/upstream/2.3.3/src/execution.cc +0 -809
  642. data/ext/v8/upstream/2.3.3/src/execution.h +0 -336
  643. data/ext/v8/upstream/2.3.3/src/factory.cc +0 -1003
  644. data/ext/v8/upstream/2.3.3/src/factory.h +0 -410
  645. data/ext/v8/upstream/2.3.3/src/fast-codegen.cc +0 -746
  646. data/ext/v8/upstream/2.3.3/src/fast-codegen.h +0 -161
  647. data/ext/v8/upstream/2.3.3/src/fast-dtoa.cc +0 -505
  648. data/ext/v8/upstream/2.3.3/src/fast-dtoa.h +0 -58
  649. data/ext/v8/upstream/2.3.3/src/flag-definitions.h +0 -455
  650. data/ext/v8/upstream/2.3.3/src/flags.cc +0 -551
  651. data/ext/v8/upstream/2.3.3/src/flags.h +0 -81
  652. data/ext/v8/upstream/2.3.3/src/flow-graph.cc +0 -763
  653. data/ext/v8/upstream/2.3.3/src/flow-graph.h +0 -180
  654. data/ext/v8/upstream/2.3.3/src/frame-element.h +0 -273
  655. data/ext/v8/upstream/2.3.3/src/frames-inl.h +0 -217
  656. data/ext/v8/upstream/2.3.3/src/frames.cc +0 -826
  657. data/ext/v8/upstream/2.3.3/src/frames.h +0 -682
  658. data/ext/v8/upstream/2.3.3/src/full-codegen.cc +0 -1443
  659. data/ext/v8/upstream/2.3.3/src/full-codegen.h +0 -548
  660. data/ext/v8/upstream/2.3.3/src/func-name-inferrer.cc +0 -76
  661. data/ext/v8/upstream/2.3.3/src/func-name-inferrer.h +0 -135
  662. data/ext/v8/upstream/2.3.3/src/global-handles.cc +0 -520
  663. data/ext/v8/upstream/2.3.3/src/global-handles.h +0 -180
  664. data/ext/v8/upstream/2.3.3/src/globals.h +0 -669
  665. data/ext/v8/upstream/2.3.3/src/handles-inl.h +0 -76
  666. data/ext/v8/upstream/2.3.3/src/handles.cc +0 -825
  667. data/ext/v8/upstream/2.3.3/src/handles.h +0 -393
  668. data/ext/v8/upstream/2.3.3/src/hashmap.cc +0 -226
  669. data/ext/v8/upstream/2.3.3/src/hashmap.h +0 -120
  670. data/ext/v8/upstream/2.3.3/src/heap-inl.h +0 -493
  671. data/ext/v8/upstream/2.3.3/src/heap-profiler.cc +0 -779
  672. data/ext/v8/upstream/2.3.3/src/heap-profiler.h +0 -323
  673. data/ext/v8/upstream/2.3.3/src/heap.cc +0 -4994
  674. data/ext/v8/upstream/2.3.3/src/heap.h +0 -1984
  675. data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32-inl.h +0 -360
  676. data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32.cc +0 -2600
  677. data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32.h +0 -969
  678. data/ext/v8/upstream/2.3.3/src/ia32/builtins-ia32.cc +0 -1261
  679. data/ext/v8/upstream/2.3.3/src/ia32/codegen-ia32.cc +0 -13968
  680. data/ext/v8/upstream/2.3.3/src/ia32/codegen-ia32.h +0 -1097
  681. data/ext/v8/upstream/2.3.3/src/ia32/cpu-ia32.cc +0 -83
  682. data/ext/v8/upstream/2.3.3/src/ia32/debug-ia32.cc +0 -309
  683. data/ext/v8/upstream/2.3.3/src/ia32/disasm-ia32.cc +0 -1471
  684. data/ext/v8/upstream/2.3.3/src/ia32/fast-codegen-ia32.cc +0 -954
  685. data/ext/v8/upstream/2.3.3/src/ia32/fast-codegen-ia32.h +0 -155
  686. data/ext/v8/upstream/2.3.3/src/ia32/frames-ia32.cc +0 -115
  687. data/ext/v8/upstream/2.3.3/src/ia32/frames-ia32.h +0 -135
  688. data/ext/v8/upstream/2.3.3/src/ia32/full-codegen-ia32.cc +0 -3281
  689. data/ext/v8/upstream/2.3.3/src/ia32/ic-ia32.cc +0 -1966
  690. data/ext/v8/upstream/2.3.3/src/ia32/macro-assembler-ia32.cc +0 -1610
  691. data/ext/v8/upstream/2.3.3/src/ia32/macro-assembler-ia32.h +0 -610
  692. data/ext/v8/upstream/2.3.3/src/ia32/regexp-macro-assembler-ia32.cc +0 -1247
  693. data/ext/v8/upstream/2.3.3/src/ia32/regexp-macro-assembler-ia32.h +0 -214
  694. data/ext/v8/upstream/2.3.3/src/ia32/simulator-ia32.h +0 -62
  695. data/ext/v8/upstream/2.3.3/src/ia32/stub-cache-ia32.cc +0 -2750
  696. data/ext/v8/upstream/2.3.3/src/ia32/virtual-frame-ia32.cc +0 -1334
  697. data/ext/v8/upstream/2.3.3/src/ia32/virtual-frame-ia32.h +0 -627
  698. data/ext/v8/upstream/2.3.3/src/ic-inl.h +0 -120
  699. data/ext/v8/upstream/2.3.3/src/ic.cc +0 -1827
  700. data/ext/v8/upstream/2.3.3/src/ic.h +0 -515
  701. data/ext/v8/upstream/2.3.3/src/interpreter-irregexp.cc +0 -646
  702. data/ext/v8/upstream/2.3.3/src/json.js +0 -268
  703. data/ext/v8/upstream/2.3.3/src/jsregexp.cc +0 -5283
  704. data/ext/v8/upstream/2.3.3/src/jsregexp.h +0 -1463
  705. data/ext/v8/upstream/2.3.3/src/jump-target-heavy.cc +0 -429
  706. data/ext/v8/upstream/2.3.3/src/jump-target-heavy.h +0 -244
  707. data/ext/v8/upstream/2.3.3/src/jump-target-light.cc +0 -110
  708. data/ext/v8/upstream/2.3.3/src/jump-target-light.h +0 -192
  709. data/ext/v8/upstream/2.3.3/src/list-inl.h +0 -166
  710. data/ext/v8/upstream/2.3.3/src/list.h +0 -159
  711. data/ext/v8/upstream/2.3.3/src/liveedit-debugger.js +0 -1057
  712. data/ext/v8/upstream/2.3.3/src/liveedit.cc +0 -1480
  713. data/ext/v8/upstream/2.3.3/src/liveedit.h +0 -170
  714. data/ext/v8/upstream/2.3.3/src/log-utils.cc +0 -497
  715. data/ext/v8/upstream/2.3.3/src/log-utils.h +0 -289
  716. data/ext/v8/upstream/2.3.3/src/log.cc +0 -1561
  717. data/ext/v8/upstream/2.3.3/src/log.h +0 -384
  718. data/ext/v8/upstream/2.3.3/src/macro-assembler.h +0 -86
  719. data/ext/v8/upstream/2.3.3/src/macros.py +0 -177
  720. data/ext/v8/upstream/2.3.3/src/mark-compact.cc +0 -2330
  721. data/ext/v8/upstream/2.3.3/src/mark-compact.h +0 -451
  722. data/ext/v8/upstream/2.3.3/src/math.js +0 -264
  723. data/ext/v8/upstream/2.3.3/src/memory.h +0 -74
  724. data/ext/v8/upstream/2.3.3/src/messages.cc +0 -183
  725. data/ext/v8/upstream/2.3.3/src/messages.h +0 -113
  726. data/ext/v8/upstream/2.3.3/src/messages.js +0 -982
  727. data/ext/v8/upstream/2.3.3/src/mips/assembler-mips.h +0 -668
  728. data/ext/v8/upstream/2.3.3/src/mips/builtins-mips.cc +0 -205
  729. data/ext/v8/upstream/2.3.3/src/mips/codegen-mips.h +0 -434
  730. data/ext/v8/upstream/2.3.3/src/mips/debug-mips.cc +0 -131
  731. data/ext/v8/upstream/2.3.3/src/mips/frames-mips.cc +0 -102
  732. data/ext/v8/upstream/2.3.3/src/mips/ic-mips.cc +0 -220
  733. data/ext/v8/upstream/2.3.3/src/mips/simulator-mips.cc +0 -1651
  734. data/ext/v8/upstream/2.3.3/src/mips/simulator-mips.h +0 -311
  735. data/ext/v8/upstream/2.3.3/src/mips/stub-cache-mips.cc +0 -403
  736. data/ext/v8/upstream/2.3.3/src/mirror-debugger.js +0 -2380
  737. data/ext/v8/upstream/2.3.3/src/objects-debug.cc +0 -1366
  738. data/ext/v8/upstream/2.3.3/src/objects-inl.h +0 -3333
  739. data/ext/v8/upstream/2.3.3/src/objects.cc +0 -8820
  740. data/ext/v8/upstream/2.3.3/src/objects.h +0 -5373
  741. data/ext/v8/upstream/2.3.3/src/oprofile-agent.cc +0 -108
  742. data/ext/v8/upstream/2.3.3/src/oprofile-agent.h +0 -77
  743. data/ext/v8/upstream/2.3.3/src/parser.cc +0 -5207
  744. data/ext/v8/upstream/2.3.3/src/parser.h +0 -197
  745. data/ext/v8/upstream/2.3.3/src/platform-freebsd.cc +0 -667
  746. data/ext/v8/upstream/2.3.3/src/platform-linux.cc +0 -862
  747. data/ext/v8/upstream/2.3.3/src/platform-macos.cc +0 -665
  748. data/ext/v8/upstream/2.3.3/src/platform-nullos.cc +0 -454
  749. data/ext/v8/upstream/2.3.3/src/platform-openbsd.cc +0 -622
  750. data/ext/v8/upstream/2.3.3/src/platform-posix.cc +0 -362
  751. data/ext/v8/upstream/2.3.3/src/platform-solaris.cc +0 -653
  752. data/ext/v8/upstream/2.3.3/src/platform-win32.cc +0 -1911
  753. data/ext/v8/upstream/2.3.3/src/platform.h +0 -577
  754. data/ext/v8/upstream/2.3.3/src/powers-ten.h +0 -2461
  755. data/ext/v8/upstream/2.3.3/src/prettyprinter.cc +0 -1531
  756. data/ext/v8/upstream/2.3.3/src/prettyprinter.h +0 -221
  757. data/ext/v8/upstream/2.3.3/src/profile-generator-inl.h +0 -148
  758. data/ext/v8/upstream/2.3.3/src/profile-generator.cc +0 -1830
  759. data/ext/v8/upstream/2.3.3/src/profile-generator.h +0 -853
  760. data/ext/v8/upstream/2.3.3/src/property.cc +0 -96
  761. data/ext/v8/upstream/2.3.3/src/property.h +0 -315
  762. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-irregexp.cc +0 -464
  763. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-irregexp.h +0 -141
  764. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-tracer.cc +0 -356
  765. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-tracer.h +0 -103
  766. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler.cc +0 -261
  767. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler.h +0 -228
  768. data/ext/v8/upstream/2.3.3/src/regexp.js +0 -549
  769. data/ext/v8/upstream/2.3.3/src/rewriter.cc +0 -1038
  770. data/ext/v8/upstream/2.3.3/src/rewriter.h +0 -54
  771. data/ext/v8/upstream/2.3.3/src/runtime.cc +0 -10599
  772. data/ext/v8/upstream/2.3.3/src/runtime.h +0 -459
  773. data/ext/v8/upstream/2.3.3/src/runtime.js +0 -629
  774. data/ext/v8/upstream/2.3.3/src/scanner.cc +0 -1346
  775. data/ext/v8/upstream/2.3.3/src/scanner.h +0 -503
  776. data/ext/v8/upstream/2.3.3/src/scopeinfo.cc +0 -637
  777. data/ext/v8/upstream/2.3.3/src/scopeinfo.h +0 -233
  778. data/ext/v8/upstream/2.3.3/src/scopes.cc +0 -962
  779. data/ext/v8/upstream/2.3.3/src/scopes.h +0 -400
  780. data/ext/v8/upstream/2.3.3/src/serialize.cc +0 -1461
  781. data/ext/v8/upstream/2.3.3/src/serialize.h +0 -581
  782. data/ext/v8/upstream/2.3.3/src/spaces-inl.h +0 -483
  783. data/ext/v8/upstream/2.3.3/src/spaces.cc +0 -2901
  784. data/ext/v8/upstream/2.3.3/src/spaces.h +0 -2197
  785. data/ext/v8/upstream/2.3.3/src/string-stream.cc +0 -584
  786. data/ext/v8/upstream/2.3.3/src/string-stream.h +0 -189
  787. data/ext/v8/upstream/2.3.3/src/string.js +0 -1006
  788. data/ext/v8/upstream/2.3.3/src/stub-cache.cc +0 -1379
  789. data/ext/v8/upstream/2.3.3/src/stub-cache.h +0 -756
  790. data/ext/v8/upstream/2.3.3/src/third_party/dtoa/COPYING +0 -15
  791. data/ext/v8/upstream/2.3.3/src/third_party/dtoa/dtoa.c +0 -3334
  792. data/ext/v8/upstream/2.3.3/src/token.cc +0 -56
  793. data/ext/v8/upstream/2.3.3/src/token.h +0 -270
  794. data/ext/v8/upstream/2.3.3/src/top.cc +0 -1067
  795. data/ext/v8/upstream/2.3.3/src/top.h +0 -463
  796. data/ext/v8/upstream/2.3.3/src/type-info.cc +0 -53
  797. data/ext/v8/upstream/2.3.3/src/type-info.h +0 -244
  798. data/ext/v8/upstream/2.3.3/src/unicode-inl.h +0 -238
  799. data/ext/v8/upstream/2.3.3/src/unicode.cc +0 -749
  800. data/ext/v8/upstream/2.3.3/src/unicode.h +0 -279
  801. data/ext/v8/upstream/2.3.3/src/uri.js +0 -415
  802. data/ext/v8/upstream/2.3.3/src/utils.cc +0 -285
  803. data/ext/v8/upstream/2.3.3/src/utils.h +0 -745
  804. data/ext/v8/upstream/2.3.3/src/v8-counters.h +0 -250
  805. data/ext/v8/upstream/2.3.3/src/v8.cc +0 -228
  806. data/ext/v8/upstream/2.3.3/src/v8.h +0 -121
  807. data/ext/v8/upstream/2.3.3/src/v8natives.js +0 -1188
  808. data/ext/v8/upstream/2.3.3/src/v8threads.cc +0 -461
  809. data/ext/v8/upstream/2.3.3/src/v8threads.h +0 -159
  810. data/ext/v8/upstream/2.3.3/src/variables.cc +0 -119
  811. data/ext/v8/upstream/2.3.3/src/variables.h +0 -205
  812. data/ext/v8/upstream/2.3.3/src/version.cc +0 -88
  813. data/ext/v8/upstream/2.3.3/src/virtual-frame-heavy-inl.h +0 -192
  814. data/ext/v8/upstream/2.3.3/src/virtual-frame.h +0 -46
  815. data/ext/v8/upstream/2.3.3/src/vm-state-inl.h +0 -137
  816. data/ext/v8/upstream/2.3.3/src/vm-state.cc +0 -39
  817. data/ext/v8/upstream/2.3.3/src/vm-state.h +0 -77
  818. data/ext/v8/upstream/2.3.3/src/x64/assembler-x64-inl.h +0 -400
  819. data/ext/v8/upstream/2.3.3/src/x64/assembler-x64.cc +0 -2963
  820. data/ext/v8/upstream/2.3.3/src/x64/assembler-x64.h +0 -1438
  821. data/ext/v8/upstream/2.3.3/src/x64/builtins-x64.cc +0 -1296
  822. data/ext/v8/upstream/2.3.3/src/x64/codegen-x64-inl.h +0 -46
  823. data/ext/v8/upstream/2.3.3/src/x64/codegen-x64.cc +0 -12491
  824. data/ext/v8/upstream/2.3.3/src/x64/codegen-x64.h +0 -1090
  825. data/ext/v8/upstream/2.3.3/src/x64/cpu-x64.cc +0 -83
  826. data/ext/v8/upstream/2.3.3/src/x64/debug-x64.cc +0 -267
  827. data/ext/v8/upstream/2.3.3/src/x64/disasm-x64.cc +0 -1696
  828. data/ext/v8/upstream/2.3.3/src/x64/fast-codegen-x64.cc +0 -250
  829. data/ext/v8/upstream/2.3.3/src/x64/frames-x64.cc +0 -113
  830. data/ext/v8/upstream/2.3.3/src/x64/frames-x64.h +0 -125
  831. data/ext/v8/upstream/2.3.3/src/x64/full-codegen-x64.cc +0 -3270
  832. data/ext/v8/upstream/2.3.3/src/x64/ic-x64.cc +0 -1907
  833. data/ext/v8/upstream/2.3.3/src/x64/jump-target-x64.cc +0 -437
  834. data/ext/v8/upstream/2.3.3/src/x64/macro-assembler-x64.cc +0 -2793
  835. data/ext/v8/upstream/2.3.3/src/x64/macro-assembler-x64.h +0 -916
  836. data/ext/v8/upstream/2.3.3/src/x64/regexp-macro-assembler-x64.cc +0 -1374
  837. data/ext/v8/upstream/2.3.3/src/x64/regexp-macro-assembler-x64.h +0 -277
  838. data/ext/v8/upstream/2.3.3/src/x64/simulator-x64.h +0 -63
  839. data/ext/v8/upstream/2.3.3/src/x64/stub-cache-x64.cc +0 -2560
  840. data/ext/v8/upstream/2.3.3/src/x64/virtual-frame-x64.cc +0 -1264
  841. data/ext/v8/upstream/2.3.3/src/x64/virtual-frame-x64.h +0 -590
  842. data/ext/v8/upstream/2.3.3/src/zone-inl.h +0 -82
  843. data/ext/v8/upstream/2.3.3/src/zone.cc +0 -194
  844. data/ext/v8/upstream/2.3.3/src/zone.h +0 -221
  845. data/ext/v8/upstream/2.3.3/tools/codemap.js +0 -270
  846. data/ext/v8/upstream/2.3.3/tools/csvparser.js +0 -83
  847. data/ext/v8/upstream/2.3.3/tools/gc-nvp-trace-processor.py +0 -317
  848. data/ext/v8/upstream/2.3.3/tools/gyp/v8.gyp +0 -749
  849. data/ext/v8/upstream/2.3.3/tools/linux-tick-processor.py +0 -78
  850. data/ext/v8/upstream/2.3.3/tools/logreader.js +0 -338
  851. data/ext/v8/upstream/2.3.3/tools/oprofile/annotate +0 -7
  852. data/ext/v8/upstream/2.3.3/tools/oprofile/common +0 -19
  853. data/ext/v8/upstream/2.3.3/tools/oprofile/dump +0 -7
  854. data/ext/v8/upstream/2.3.3/tools/oprofile/report +0 -7
  855. data/ext/v8/upstream/2.3.3/tools/oprofile/reset +0 -7
  856. data/ext/v8/upstream/2.3.3/tools/oprofile/run +0 -14
  857. data/ext/v8/upstream/2.3.3/tools/oprofile/shutdown +0 -7
  858. data/ext/v8/upstream/2.3.3/tools/oprofile/start +0 -7
  859. data/ext/v8/upstream/2.3.3/tools/presubmit.py +0 -299
  860. data/ext/v8/upstream/2.3.3/tools/profile.js +0 -691
  861. data/ext/v8/upstream/2.3.3/tools/profile_view.js +0 -224
  862. data/ext/v8/upstream/2.3.3/tools/splaytree.js +0 -322
  863. data/ext/v8/upstream/2.3.3/tools/splaytree.py +0 -226
  864. data/ext/v8/upstream/2.3.3/tools/tickprocessor.js +0 -862
  865. data/ext/v8/upstream/2.3.3/tools/tickprocessor.py +0 -571
  866. data/ext/v8/upstream/2.3.3/tools/utils.py +0 -88
  867. data/ext/v8/upstream/2.3.3/tools/visual_studio/README.txt +0 -71
  868. data/ext/v8/upstream/2.3.3/tools/visual_studio/common.vsprops +0 -34
  869. data/ext/v8/upstream/2.3.3/tools/visual_studio/debug.vsprops +0 -17
  870. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base.vcproj +0 -1143
  871. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base_arm.vcproj +0 -1115
  872. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base_x64.vcproj +0 -1096
  873. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample.vcproj +0 -145
  874. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -145
  875. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -161
  876. data/ext/v8/upstream/2.3.3/tools/windows-tick-processor.bat +0 -29
  877. data/ext/v8/upstream/2.3.3/tools/windows-tick-processor.py +0 -137
@@ -0,0 +1,2218 @@
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_