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
@@ -1,221 +0,0 @@
1
- // Copyright 2006-2008 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_PRETTYPRINTER_H_
29
- #define V8_PRETTYPRINTER_H_
30
-
31
- #include "ast.h"
32
-
33
- namespace v8 {
34
- namespace internal {
35
-
36
- #ifdef DEBUG
37
-
38
- class PrettyPrinter: public AstVisitor {
39
- public:
40
- PrettyPrinter();
41
- virtual ~PrettyPrinter();
42
-
43
- // The following routines print a node into a string.
44
- // The result string is alive as long as the PrettyPrinter is alive.
45
- const char* Print(AstNode* node);
46
- const char* PrintExpression(FunctionLiteral* program);
47
- const char* PrintProgram(FunctionLiteral* program);
48
-
49
- void Print(const char* format, ...);
50
-
51
- // Print a node to stdout.
52
- static void PrintOut(AstNode* node);
53
-
54
- // Individual nodes
55
- #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
56
- AST_NODE_LIST(DECLARE_VISIT)
57
- #undef DECLARE_VISIT
58
-
59
- private:
60
- char* output_; // output string buffer
61
- int size_; // output_ size
62
- int pos_; // current printing position
63
-
64
- protected:
65
- void Init();
66
- const char* Output() const { return output_; }
67
-
68
- virtual void PrintStatements(ZoneList<Statement*>* statements);
69
- void PrintLabels(ZoneStringList* labels);
70
- virtual void PrintArguments(ZoneList<Expression*>* arguments);
71
- void PrintLiteral(Handle<Object> value, bool quote);
72
- void PrintParameters(Scope* scope);
73
- void PrintDeclarations(ZoneList<Declaration*>* declarations);
74
- void PrintFunctionLiteral(FunctionLiteral* function);
75
- void PrintCaseClause(CaseClause* clause);
76
- };
77
-
78
-
79
- // Prints the AST structure
80
- class AstPrinter: public PrettyPrinter {
81
- public:
82
- AstPrinter();
83
- virtual ~AstPrinter();
84
-
85
- const char* PrintProgram(FunctionLiteral* program);
86
-
87
- // Individual nodes
88
- #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
89
- AST_NODE_LIST(DECLARE_VISIT)
90
- #undef DECLARE_VISIT
91
- private:
92
- friend class IndentedScope;
93
- void PrintIndented(const char* txt);
94
- void PrintIndentedVisit(const char* s, AstNode* node);
95
-
96
- void PrintStatements(ZoneList<Statement*>* statements);
97
- void PrintDeclarations(ZoneList<Declaration*>* declarations);
98
- void PrintParameters(Scope* scope);
99
- void PrintArguments(ZoneList<Expression*>* arguments);
100
- void PrintCaseClause(CaseClause* clause);
101
- void PrintLiteralIndented(const char* info, Handle<Object> value, bool quote);
102
- void PrintLiteralWithModeIndented(const char* info,
103
- Variable* var,
104
- Handle<Object> value,
105
- StaticType* type,
106
- int num,
107
- bool is_primitive);
108
- void PrintLabelsIndented(const char* info, ZoneStringList* labels);
109
-
110
- void inc_indent() { indent_++; }
111
- void dec_indent() { indent_--; }
112
-
113
- static int indent_;
114
- };
115
-
116
-
117
- // Forward declaration of helper classes.
118
- class TagScope;
119
- class AttributesScope;
120
-
121
- // Build a C string containing a JSON representation of a function's
122
- // AST. The representation is based on JsonML (www.jsonml.org).
123
- class JsonAstBuilder: public PrettyPrinter {
124
- public:
125
- JsonAstBuilder()
126
- : indent_(0), top_tag_scope_(NULL), attributes_scope_(NULL) {
127
- }
128
- virtual ~JsonAstBuilder() {}
129
-
130
- // Controls the indentation of subsequent lines of a tag body after
131
- // the first line.
132
- static const int kTagIndentSize = 2;
133
-
134
- // Controls the indentation of subsequent lines of an attributes
135
- // blocks's body after the first line.
136
- static const int kAttributesIndentSize = 1;
137
-
138
- // Construct a JSON representation of a function literal.
139
- const char* BuildProgram(FunctionLiteral* program);
140
-
141
- // Print text indented by the current indentation level.
142
- void PrintIndented(const char* text) { Print("%*s%s", indent_, "", text); }
143
-
144
- // Change the indentation level.
145
- void increase_indent(int amount) { indent_ += amount; }
146
- void decrease_indent(int amount) { indent_ -= amount; }
147
-
148
- // The builder maintains a stack of opened AST node constructors.
149
- // Each node constructor corresponds to a JsonML tag.
150
- TagScope* tag() { return top_tag_scope_; }
151
- void set_tag(TagScope* scope) { top_tag_scope_ = scope; }
152
-
153
- // The builder maintains a pointer to the currently opened attributes
154
- // of current AST node or NULL if the attributes are not opened.
155
- AttributesScope* attributes() { return attributes_scope_; }
156
- void set_attributes(AttributesScope* scope) { attributes_scope_ = scope; }
157
-
158
- // Add an attribute to the currently opened attributes.
159
- void AddAttribute(const char* name, Handle<String> value);
160
- void AddAttribute(const char* name, const char* value);
161
- void AddAttribute(const char* name, int value);
162
- void AddAttribute(const char* name, bool value);
163
-
164
- // AST node visit functions.
165
- #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
166
- AST_NODE_LIST(DECLARE_VISIT)
167
- #undef DECLARE_VISIT
168
-
169
- private:
170
- int indent_;
171
- TagScope* top_tag_scope_;
172
- AttributesScope* attributes_scope_;
173
-
174
- // Utility function used by AddAttribute implementations.
175
- void AddAttributePrefix(const char* name);
176
- };
177
-
178
-
179
- // The JSON AST builder keeps a stack of open element tags (AST node
180
- // constructors from the current iteration point to the root of the
181
- // AST). TagScope is a helper class to manage the opening and closing
182
- // of tags, the indentation of their bodies, and comma separating their
183
- // contents.
184
- class TagScope BASE_EMBEDDED {
185
- public:
186
- TagScope(JsonAstBuilder* builder, const char* name);
187
- ~TagScope();
188
-
189
- void use() { has_body_ = true; }
190
-
191
- private:
192
- JsonAstBuilder* builder_;
193
- TagScope* next_;
194
- bool has_body_;
195
- };
196
-
197
-
198
- // AttributesScope is a helper class to manage the opening and closing
199
- // of attribute blocks, the indentation of their bodies, and comma
200
- // separating their contents. JsonAstBuilder::AddAttribute adds an
201
- // attribute to the currently open AttributesScope. They cannot be
202
- // nested so the builder keeps an optional single scope rather than a
203
- // stack.
204
- class AttributesScope BASE_EMBEDDED {
205
- public:
206
- explicit AttributesScope(JsonAstBuilder* builder);
207
- ~AttributesScope();
208
-
209
- bool is_used() { return attribute_count_ > 0; }
210
- void use() { ++attribute_count_; }
211
-
212
- private:
213
- JsonAstBuilder* builder_;
214
- int attribute_count_;
215
- };
216
-
217
- #endif // DEBUG
218
-
219
- } } // namespace v8::internal
220
-
221
- #endif // V8_PRETTYPRINTER_H_
@@ -1,148 +0,0 @@
1
- // Copyright 2010 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #ifndef V8_PROFILE_GENERATOR_INL_H_
29
- #define V8_PROFILE_GENERATOR_INL_H_
30
-
31
- #ifdef ENABLE_LOGGING_AND_PROFILING
32
-
33
- #include "profile-generator.h"
34
-
35
- namespace v8 {
36
- namespace internal {
37
-
38
- CodeEntry::CodeEntry(int security_token_id)
39
- : call_uid_(0),
40
- tag_(Logger::FUNCTION_TAG),
41
- name_prefix_(kEmptyNamePrefix),
42
- name_(""),
43
- resource_name_(""),
44
- line_number_(0),
45
- security_token_id_(security_token_id) {
46
- }
47
-
48
-
49
- CodeEntry::CodeEntry(Logger::LogEventsAndTags tag,
50
- const char* name_prefix,
51
- const char* name,
52
- const char* resource_name,
53
- int line_number,
54
- int security_token_id)
55
- : call_uid_(next_call_uid_++),
56
- tag_(tag),
57
- name_prefix_(name_prefix),
58
- name_(name),
59
- resource_name_(resource_name),
60
- line_number_(line_number),
61
- security_token_id_(security_token_id) {
62
- }
63
-
64
-
65
- bool CodeEntry::is_js_function_tag(Logger::LogEventsAndTags tag) {
66
- return tag == Logger::FUNCTION_TAG
67
- || tag == Logger::LAZY_COMPILE_TAG
68
- || tag == Logger::SCRIPT_TAG
69
- || tag == Logger::NATIVE_FUNCTION_TAG
70
- || tag == Logger::NATIVE_LAZY_COMPILE_TAG
71
- || tag == Logger::NATIVE_SCRIPT_TAG;
72
- }
73
-
74
-
75
- ProfileNode::ProfileNode(ProfileTree* tree, CodeEntry* entry)
76
- : tree_(tree),
77
- entry_(entry),
78
- total_ticks_(0),
79
- self_ticks_(0),
80
- children_(CodeEntriesMatch) {
81
- }
82
-
83
-
84
- void CodeMap::AddCode(Address addr, CodeEntry* entry, unsigned size) {
85
- CodeTree::Locator locator;
86
- tree_.Insert(addr, &locator);
87
- locator.set_value(CodeEntryInfo(entry, size));
88
- }
89
-
90
-
91
- void CodeMap::MoveCode(Address from, Address to) {
92
- tree_.Move(from, to);
93
- }
94
-
95
- void CodeMap::DeleteCode(Address addr) {
96
- tree_.Remove(addr);
97
- }
98
-
99
-
100
- bool CpuProfilesCollection::is_last_profile() {
101
- // Called from VM thread, and only it can mutate the list,
102
- // so no locking is needed here.
103
- return current_profiles_.length() == 1;
104
- }
105
-
106
-
107
- const char* CpuProfilesCollection::GetFunctionName(String* name) {
108
- return GetFunctionName(GetName(name));
109
- }
110
-
111
-
112
- const char* CpuProfilesCollection::GetFunctionName(const char* name) {
113
- return strlen(name) > 0 ? name : ProfileGenerator::kAnonymousFunctionName;
114
- }
115
-
116
-
117
- CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) {
118
- switch (tag) {
119
- case GC:
120
- return gc_entry_;
121
- case JS:
122
- case COMPILER:
123
- // DOM events handlers are reported as OTHER / EXTERNAL entries.
124
- // To avoid confusing people, let's put all these entries into
125
- // one bucket.
126
- case OTHER:
127
- case EXTERNAL:
128
- return program_entry_;
129
- default: return NULL;
130
- }
131
- }
132
-
133
-
134
- template<class Visitor>
135
- void HeapEntriesMap::Apply(Visitor* visitor) {
136
- for (HashMap::Entry* p = entries_.Start();
137
- p != NULL;
138
- p = entries_.Next(p)) {
139
- if (!IsAlias(p->value))
140
- visitor->Apply(reinterpret_cast<HeapEntry*>(p->value));
141
- }
142
- }
143
-
144
- } } // namespace v8::internal
145
-
146
- #endif // ENABLE_LOGGING_AND_PROFILING
147
-
148
- #endif // V8_PROFILE_GENERATOR_INL_H_
@@ -1,1830 +0,0 @@
1
- // Copyright 2010 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #ifdef ENABLE_LOGGING_AND_PROFILING
29
-
30
- #include "v8.h"
31
- #include "global-handles.h"
32
- #include "scopeinfo.h"
33
- #include "top.h"
34
- #include "zone-inl.h"
35
-
36
- #include "profile-generator-inl.h"
37
-
38
- namespace v8 {
39
- namespace internal {
40
-
41
-
42
- TokenEnumerator::TokenEnumerator()
43
- : token_locations_(4),
44
- token_removed_(4) {
45
- }
46
-
47
-
48
- TokenEnumerator::~TokenEnumerator() {
49
- for (int i = 0; i < token_locations_.length(); ++i) {
50
- if (!token_removed_[i]) {
51
- GlobalHandles::ClearWeakness(token_locations_[i]);
52
- GlobalHandles::Destroy(token_locations_[i]);
53
- }
54
- }
55
- }
56
-
57
-
58
- int TokenEnumerator::GetTokenId(Object* token) {
59
- if (token == NULL) return TokenEnumerator::kNoSecurityToken;
60
- for (int i = 0; i < token_locations_.length(); ++i) {
61
- if (*token_locations_[i] == token && !token_removed_[i]) return i;
62
- }
63
- Handle<Object> handle = GlobalHandles::Create(token);
64
- // handle.location() points to a memory cell holding a pointer
65
- // to a token object in the V8's heap.
66
- GlobalHandles::MakeWeak(handle.location(), this, TokenRemovedCallback);
67
- token_locations_.Add(handle.location());
68
- token_removed_.Add(false);
69
- return token_locations_.length() - 1;
70
- }
71
-
72
-
73
- void TokenEnumerator::TokenRemovedCallback(v8::Persistent<v8::Value> handle,
74
- void* parameter) {
75
- reinterpret_cast<TokenEnumerator*>(parameter)->TokenRemoved(
76
- Utils::OpenHandle(*handle).location());
77
- handle.Dispose();
78
- }
79
-
80
-
81
- void TokenEnumerator::TokenRemoved(Object** token_location) {
82
- for (int i = 0; i < token_locations_.length(); ++i) {
83
- if (token_locations_[i] == token_location && !token_removed_[i]) {
84
- token_removed_[i] = true;
85
- return;
86
- }
87
- }
88
- }
89
-
90
-
91
- StringsStorage::StringsStorage()
92
- : names_(StringsMatch) {
93
- }
94
-
95
-
96
- StringsStorage::~StringsStorage() {
97
- for (HashMap::Entry* p = names_.Start();
98
- p != NULL;
99
- p = names_.Next(p)) {
100
- DeleteArray(reinterpret_cast<const char*>(p->value));
101
- }
102
- }
103
-
104
-
105
- const char* StringsStorage::GetName(String* name) {
106
- if (name->IsString()) {
107
- char* c_name =
108
- name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL).Detach();
109
- HashMap::Entry* cache_entry = names_.Lookup(c_name, name->Hash(), true);
110
- if (cache_entry->value == NULL) {
111
- // New entry added.
112
- cache_entry->value = c_name;
113
- } else {
114
- DeleteArray(c_name);
115
- }
116
- return reinterpret_cast<const char*>(cache_entry->value);
117
- }
118
- return "";
119
- }
120
-
121
-
122
- const char* CodeEntry::kEmptyNamePrefix = "";
123
- unsigned CodeEntry::next_call_uid_ = 1;
124
-
125
-
126
- void CodeEntry::CopyData(const CodeEntry& source) {
127
- call_uid_ = source.call_uid_;
128
- tag_ = source.tag_;
129
- name_prefix_ = source.name_prefix_;
130
- name_ = source.name_;
131
- resource_name_ = source.resource_name_;
132
- line_number_ = source.line_number_;
133
- }
134
-
135
-
136
- ProfileNode* ProfileNode::FindChild(CodeEntry* entry) {
137
- HashMap::Entry* map_entry =
138
- children_.Lookup(entry, CodeEntryHash(entry), false);
139
- return map_entry != NULL ?
140
- reinterpret_cast<ProfileNode*>(map_entry->value) : NULL;
141
- }
142
-
143
-
144
- ProfileNode* ProfileNode::FindOrAddChild(CodeEntry* entry) {
145
- HashMap::Entry* map_entry =
146
- children_.Lookup(entry, CodeEntryHash(entry), true);
147
- if (map_entry->value == NULL) {
148
- // New node added.
149
- ProfileNode* new_node = new ProfileNode(tree_, entry);
150
- map_entry->value = new_node;
151
- children_list_.Add(new_node);
152
- }
153
- return reinterpret_cast<ProfileNode*>(map_entry->value);
154
- }
155
-
156
-
157
- double ProfileNode::GetSelfMillis() const {
158
- return tree_->TicksToMillis(self_ticks_);
159
- }
160
-
161
-
162
- double ProfileNode::GetTotalMillis() const {
163
- return tree_->TicksToMillis(total_ticks_);
164
- }
165
-
166
-
167
- void ProfileNode::Print(int indent) {
168
- OS::Print("%5u %5u %*c %s%s [%d]",
169
- total_ticks_, self_ticks_,
170
- indent, ' ',
171
- entry_->name_prefix(),
172
- entry_->name(),
173
- entry_->security_token_id());
174
- if (entry_->resource_name()[0] != '\0')
175
- OS::Print(" %s:%d", entry_->resource_name(), entry_->line_number());
176
- OS::Print("\n");
177
- for (HashMap::Entry* p = children_.Start();
178
- p != NULL;
179
- p = children_.Next(p)) {
180
- reinterpret_cast<ProfileNode*>(p->value)->Print(indent + 2);
181
- }
182
- }
183
-
184
-
185
- class DeleteNodesCallback {
186
- public:
187
- void BeforeTraversingChild(ProfileNode*, ProfileNode*) { }
188
-
189
- void AfterAllChildrenTraversed(ProfileNode* node) {
190
- delete node;
191
- }
192
-
193
- void AfterChildTraversed(ProfileNode*, ProfileNode*) { }
194
- };
195
-
196
-
197
- ProfileTree::ProfileTree()
198
- : root_entry_(Logger::FUNCTION_TAG,
199
- "",
200
- "(root)",
201
- "",
202
- 0,
203
- TokenEnumerator::kNoSecurityToken),
204
- root_(new ProfileNode(this, &root_entry_)) {
205
- }
206
-
207
-
208
- ProfileTree::~ProfileTree() {
209
- DeleteNodesCallback cb;
210
- TraverseDepthFirst(&cb);
211
- }
212
-
213
-
214
- void ProfileTree::AddPathFromEnd(const Vector<CodeEntry*>& path) {
215
- ProfileNode* node = root_;
216
- for (CodeEntry** entry = path.start() + path.length() - 1;
217
- entry != path.start() - 1;
218
- --entry) {
219
- if (*entry != NULL) {
220
- node = node->FindOrAddChild(*entry);
221
- }
222
- }
223
- node->IncrementSelfTicks();
224
- }
225
-
226
-
227
- void ProfileTree::AddPathFromStart(const Vector<CodeEntry*>& path) {
228
- ProfileNode* node = root_;
229
- for (CodeEntry** entry = path.start();
230
- entry != path.start() + path.length();
231
- ++entry) {
232
- if (*entry != NULL) {
233
- node = node->FindOrAddChild(*entry);
234
- }
235
- }
236
- node->IncrementSelfTicks();
237
- }
238
-
239
-
240
- struct NodesPair {
241
- NodesPair(ProfileNode* src, ProfileNode* dst)
242
- : src(src), dst(dst) { }
243
- ProfileNode* src;
244
- ProfileNode* dst;
245
- };
246
-
247
-
248
- class FilteredCloneCallback {
249
- public:
250
- explicit FilteredCloneCallback(ProfileNode* dst_root, int security_token_id)
251
- : stack_(10),
252
- security_token_id_(security_token_id) {
253
- stack_.Add(NodesPair(NULL, dst_root));
254
- }
255
-
256
- void BeforeTraversingChild(ProfileNode* parent, ProfileNode* child) {
257
- if (IsTokenAcceptable(child->entry()->security_token_id(),
258
- parent->entry()->security_token_id())) {
259
- ProfileNode* clone = stack_.last().dst->FindOrAddChild(child->entry());
260
- clone->IncreaseSelfTicks(child->self_ticks());
261
- stack_.Add(NodesPair(child, clone));
262
- } else {
263
- // Attribute ticks to parent node.
264
- stack_.last().dst->IncreaseSelfTicks(child->self_ticks());
265
- }
266
- }
267
-
268
- void AfterAllChildrenTraversed(ProfileNode* parent) { }
269
-
270
- void AfterChildTraversed(ProfileNode*, ProfileNode* child) {
271
- if (stack_.last().src == child) {
272
- stack_.RemoveLast();
273
- }
274
- }
275
-
276
- private:
277
- bool IsTokenAcceptable(int token, int parent_token) {
278
- if (token == TokenEnumerator::kNoSecurityToken
279
- || token == security_token_id_) return true;
280
- if (token == TokenEnumerator::kInheritsSecurityToken) {
281
- ASSERT(parent_token != TokenEnumerator::kInheritsSecurityToken);
282
- return parent_token == TokenEnumerator::kNoSecurityToken
283
- || parent_token == security_token_id_;
284
- }
285
- return false;
286
- }
287
-
288
- List<NodesPair> stack_;
289
- int security_token_id_;
290
- };
291
-
292
- void ProfileTree::FilteredClone(ProfileTree* src, int security_token_id) {
293
- ms_to_ticks_scale_ = src->ms_to_ticks_scale_;
294
- FilteredCloneCallback cb(root_, security_token_id);
295
- src->TraverseDepthFirst(&cb);
296
- CalculateTotalTicks();
297
- }
298
-
299
-
300
- void ProfileTree::SetTickRatePerMs(double ticks_per_ms) {
301
- ms_to_ticks_scale_ = ticks_per_ms > 0 ? 1.0 / ticks_per_ms : 1.0;
302
- }
303
-
304
-
305
- class Position {
306
- public:
307
- explicit Position(ProfileNode* node)
308
- : node(node), child_idx_(0) { }
309
- INLINE(ProfileNode* current_child()) {
310
- return node->children()->at(child_idx_);
311
- }
312
- INLINE(bool has_current_child()) {
313
- return child_idx_ < node->children()->length();
314
- }
315
- INLINE(void next_child()) { ++child_idx_; }
316
-
317
- ProfileNode* node;
318
- private:
319
- int child_idx_;
320
- };
321
-
322
-
323
- // Non-recursive implementation of a depth-first post-order tree traversal.
324
- template <typename Callback>
325
- void ProfileTree::TraverseDepthFirst(Callback* callback) {
326
- List<Position> stack(10);
327
- stack.Add(Position(root_));
328
- while (stack.length() > 0) {
329
- Position& current = stack.last();
330
- if (current.has_current_child()) {
331
- callback->BeforeTraversingChild(current.node, current.current_child());
332
- stack.Add(Position(current.current_child()));
333
- } else {
334
- callback->AfterAllChildrenTraversed(current.node);
335
- if (stack.length() > 1) {
336
- Position& parent = stack[stack.length() - 2];
337
- callback->AfterChildTraversed(parent.node, current.node);
338
- parent.next_child();
339
- }
340
- // Remove child from the stack.
341
- stack.RemoveLast();
342
- }
343
- }
344
- }
345
-
346
-
347
- class CalculateTotalTicksCallback {
348
- public:
349
- void BeforeTraversingChild(ProfileNode*, ProfileNode*) { }
350
-
351
- void AfterAllChildrenTraversed(ProfileNode* node) {
352
- node->IncreaseTotalTicks(node->self_ticks());
353
- }
354
-
355
- void AfterChildTraversed(ProfileNode* parent, ProfileNode* child) {
356
- parent->IncreaseTotalTicks(child->total_ticks());
357
- }
358
- };
359
-
360
-
361
- void ProfileTree::CalculateTotalTicks() {
362
- CalculateTotalTicksCallback cb;
363
- TraverseDepthFirst(&cb);
364
- }
365
-
366
-
367
- void ProfileTree::ShortPrint() {
368
- OS::Print("root: %u %u %.2fms %.2fms\n",
369
- root_->total_ticks(), root_->self_ticks(),
370
- root_->GetTotalMillis(), root_->GetSelfMillis());
371
- }
372
-
373
-
374
- void CpuProfile::AddPath(const Vector<CodeEntry*>& path) {
375
- top_down_.AddPathFromEnd(path);
376
- bottom_up_.AddPathFromStart(path);
377
- }
378
-
379
-
380
- void CpuProfile::CalculateTotalTicks() {
381
- top_down_.CalculateTotalTicks();
382
- bottom_up_.CalculateTotalTicks();
383
- }
384
-
385
-
386
- void CpuProfile::SetActualSamplingRate(double actual_sampling_rate) {
387
- top_down_.SetTickRatePerMs(actual_sampling_rate);
388
- bottom_up_.SetTickRatePerMs(actual_sampling_rate);
389
- }
390
-
391
-
392
- CpuProfile* CpuProfile::FilteredClone(int security_token_id) {
393
- ASSERT(security_token_id != TokenEnumerator::kNoSecurityToken);
394
- CpuProfile* clone = new CpuProfile(title_, uid_);
395
- clone->top_down_.FilteredClone(&top_down_, security_token_id);
396
- clone->bottom_up_.FilteredClone(&bottom_up_, security_token_id);
397
- return clone;
398
- }
399
-
400
-
401
- void CpuProfile::ShortPrint() {
402
- OS::Print("top down ");
403
- top_down_.ShortPrint();
404
- OS::Print("bottom up ");
405
- bottom_up_.ShortPrint();
406
- }
407
-
408
-
409
- void CpuProfile::Print() {
410
- OS::Print("[Top down]:\n");
411
- top_down_.Print();
412
- OS::Print("[Bottom up]:\n");
413
- bottom_up_.Print();
414
- }
415
-
416
-
417
- const CodeMap::CodeTreeConfig::Key CodeMap::CodeTreeConfig::kNoKey = NULL;
418
- const CodeMap::CodeTreeConfig::Value CodeMap::CodeTreeConfig::kNoValue =
419
- CodeMap::CodeEntryInfo(NULL, 0);
420
-
421
-
422
- void CodeMap::AddAlias(Address start, CodeEntry* entry, Address code_start) {
423
- CodeTree::Locator locator;
424
- if (tree_.Find(code_start, &locator)) {
425
- const CodeEntryInfo& code_info = locator.value();
426
- entry->CopyData(*code_info.entry);
427
- tree_.Insert(start, &locator);
428
- locator.set_value(CodeEntryInfo(entry, code_info.size));
429
- }
430
- }
431
-
432
-
433
- CodeEntry* CodeMap::FindEntry(Address addr) {
434
- CodeTree::Locator locator;
435
- if (tree_.FindGreatestLessThan(addr, &locator)) {
436
- // locator.key() <= addr. Need to check that addr is within entry.
437
- const CodeEntryInfo& entry = locator.value();
438
- if (addr < (locator.key() + entry.size))
439
- return entry.entry;
440
- }
441
- return NULL;
442
- }
443
-
444
-
445
- void CodeMap::CodeTreePrinter::Call(
446
- const Address& key, const CodeMap::CodeEntryInfo& value) {
447
- OS::Print("%p %5d %s\n", key, value.size, value.entry->name());
448
- }
449
-
450
-
451
- void CodeMap::Print() {
452
- CodeTreePrinter printer;
453
- tree_.ForEach(&printer);
454
- }
455
-
456
-
457
- CpuProfilesCollection::CpuProfilesCollection()
458
- : profiles_uids_(UidsMatch),
459
- current_profiles_semaphore_(OS::CreateSemaphore(1)) {
460
- // Create list of unabridged profiles.
461
- profiles_by_token_.Add(new List<CpuProfile*>());
462
- }
463
-
464
-
465
- static void DeleteArgsCountName(char** name_ptr) {
466
- DeleteArray(*name_ptr);
467
- }
468
-
469
-
470
- static void DeleteCodeEntry(CodeEntry** entry_ptr) {
471
- delete *entry_ptr;
472
- }
473
-
474
- static void DeleteCpuProfile(CpuProfile** profile_ptr) {
475
- delete *profile_ptr;
476
- }
477
-
478
- static void DeleteProfilesList(List<CpuProfile*>** list_ptr) {
479
- (*list_ptr)->Iterate(DeleteCpuProfile);
480
- delete *list_ptr;
481
- }
482
-
483
- CpuProfilesCollection::~CpuProfilesCollection() {
484
- delete current_profiles_semaphore_;
485
- current_profiles_.Iterate(DeleteCpuProfile);
486
- profiles_by_token_.Iterate(DeleteProfilesList);
487
- code_entries_.Iterate(DeleteCodeEntry);
488
- args_count_names_.Iterate(DeleteArgsCountName);
489
- }
490
-
491
-
492
- bool CpuProfilesCollection::StartProfiling(const char* title, unsigned uid) {
493
- ASSERT(uid > 0);
494
- current_profiles_semaphore_->Wait();
495
- for (int i = 0; i < current_profiles_.length(); ++i) {
496
- if (strcmp(current_profiles_[i]->title(), title) == 0) {
497
- // Ignore attempts to start profile with the same title.
498
- current_profiles_semaphore_->Signal();
499
- return false;
500
- }
501
- }
502
- current_profiles_.Add(new CpuProfile(title, uid));
503
- current_profiles_semaphore_->Signal();
504
- return true;
505
- }
506
-
507
-
508
- bool CpuProfilesCollection::StartProfiling(String* title, unsigned uid) {
509
- return StartProfiling(GetName(title), uid);
510
- }
511
-
512
-
513
- CpuProfile* CpuProfilesCollection::StopProfiling(int security_token_id,
514
- const char* title,
515
- double actual_sampling_rate) {
516
- const int title_len = StrLength(title);
517
- CpuProfile* profile = NULL;
518
- current_profiles_semaphore_->Wait();
519
- for (int i = current_profiles_.length() - 1; i >= 0; --i) {
520
- if (title_len == 0 || strcmp(current_profiles_[i]->title(), title) == 0) {
521
- profile = current_profiles_.Remove(i);
522
- break;
523
- }
524
- }
525
- current_profiles_semaphore_->Signal();
526
-
527
- if (profile != NULL) {
528
- profile->CalculateTotalTicks();
529
- profile->SetActualSamplingRate(actual_sampling_rate);
530
- List<CpuProfile*>* unabridged_list =
531
- profiles_by_token_[TokenToIndex(TokenEnumerator::kNoSecurityToken)];
532
- unabridged_list->Add(profile);
533
- HashMap::Entry* entry =
534
- profiles_uids_.Lookup(reinterpret_cast<void*>(profile->uid()),
535
- static_cast<uint32_t>(profile->uid()),
536
- true);
537
- ASSERT(entry->value == NULL);
538
- entry->value = reinterpret_cast<void*>(unabridged_list->length() - 1);
539
- return GetProfile(security_token_id, profile->uid());
540
- }
541
- return NULL;
542
- }
543
-
544
-
545
- CpuProfile* CpuProfilesCollection::StopProfiling(int security_token_id,
546
- String* title,
547
- double actual_sampling_rate) {
548
- return StopProfiling(security_token_id, GetName(title), actual_sampling_rate);
549
- }
550
-
551
-
552
- CpuProfile* CpuProfilesCollection::GetProfile(int security_token_id,
553
- unsigned uid) {
554
- HashMap::Entry* entry = profiles_uids_.Lookup(reinterpret_cast<void*>(uid),
555
- static_cast<uint32_t>(uid),
556
- false);
557
- int index;
558
- if (entry != NULL) {
559
- index = static_cast<int>(reinterpret_cast<intptr_t>(entry->value));
560
- } else {
561
- return NULL;
562
- }
563
- List<CpuProfile*>* unabridged_list =
564
- profiles_by_token_[TokenToIndex(TokenEnumerator::kNoSecurityToken)];
565
- if (security_token_id == TokenEnumerator::kNoSecurityToken) {
566
- return unabridged_list->at(index);
567
- }
568
- List<CpuProfile*>* list = GetProfilesList(security_token_id);
569
- if (list->at(index) == NULL) {
570
- list->at(index) =
571
- unabridged_list->at(index)->FilteredClone(security_token_id);
572
- }
573
- return list->at(index);
574
- }
575
-
576
-
577
- int CpuProfilesCollection::TokenToIndex(int security_token_id) {
578
- ASSERT(TokenEnumerator::kNoSecurityToken == -1);
579
- return security_token_id + 1; // kNoSecurityToken -> 0, 0 -> 1, ...
580
- }
581
-
582
-
583
- List<CpuProfile*>* CpuProfilesCollection::GetProfilesList(
584
- int security_token_id) {
585
- const int index = TokenToIndex(security_token_id);
586
- const int lists_to_add = index - profiles_by_token_.length() + 1;
587
- if (lists_to_add > 0) profiles_by_token_.AddBlock(NULL, lists_to_add);
588
- List<CpuProfile*>* unabridged_list =
589
- profiles_by_token_[TokenToIndex(TokenEnumerator::kNoSecurityToken)];
590
- const int current_count = unabridged_list->length();
591
- if (profiles_by_token_[index] == NULL) {
592
- profiles_by_token_[index] = new List<CpuProfile*>(current_count);
593
- }
594
- List<CpuProfile*>* list = profiles_by_token_[index];
595
- const int profiles_to_add = current_count - list->length();
596
- if (profiles_to_add > 0) list->AddBlock(NULL, profiles_to_add);
597
- return list;
598
- }
599
-
600
-
601
- List<CpuProfile*>* CpuProfilesCollection::Profiles(int security_token_id) {
602
- List<CpuProfile*>* unabridged_list =
603
- profiles_by_token_[TokenToIndex(TokenEnumerator::kNoSecurityToken)];
604
- if (security_token_id == TokenEnumerator::kNoSecurityToken) {
605
- return unabridged_list;
606
- }
607
- List<CpuProfile*>* list = GetProfilesList(security_token_id);
608
- const int current_count = unabridged_list->length();
609
- for (int i = 0; i < current_count; ++i) {
610
- if (list->at(i) == NULL) {
611
- list->at(i) = unabridged_list->at(i)->FilteredClone(security_token_id);
612
- }
613
- }
614
- return list;
615
- }
616
-
617
-
618
- CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
619
- String* name,
620
- String* resource_name,
621
- int line_number) {
622
- CodeEntry* entry = new CodeEntry(tag,
623
- CodeEntry::kEmptyNamePrefix,
624
- GetFunctionName(name),
625
- GetName(resource_name),
626
- line_number,
627
- TokenEnumerator::kNoSecurityToken);
628
- code_entries_.Add(entry);
629
- return entry;
630
- }
631
-
632
-
633
- CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
634
- const char* name) {
635
- CodeEntry* entry = new CodeEntry(tag,
636
- CodeEntry::kEmptyNamePrefix,
637
- GetFunctionName(name),
638
- "",
639
- v8::CpuProfileNode::kNoLineNumberInfo,
640
- TokenEnumerator::kNoSecurityToken);
641
- code_entries_.Add(entry);
642
- return entry;
643
- }
644
-
645
-
646
- CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
647
- const char* name_prefix,
648
- String* name) {
649
- CodeEntry* entry = new CodeEntry(tag,
650
- name_prefix,
651
- GetName(name),
652
- "",
653
- v8::CpuProfileNode::kNoLineNumberInfo,
654
- TokenEnumerator::kInheritsSecurityToken);
655
- code_entries_.Add(entry);
656
- return entry;
657
- }
658
-
659
-
660
- CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
661
- int args_count) {
662
- CodeEntry* entry = new CodeEntry(tag,
663
- "args_count: ",
664
- GetName(args_count),
665
- "",
666
- v8::CpuProfileNode::kNoLineNumberInfo,
667
- TokenEnumerator::kInheritsSecurityToken);
668
- code_entries_.Add(entry);
669
- return entry;
670
- }
671
-
672
-
673
- CodeEntry* CpuProfilesCollection::NewCodeEntry(int security_token_id) {
674
- CodeEntry* entry = new CodeEntry(security_token_id);
675
- code_entries_.Add(entry);
676
- return entry;
677
- }
678
-
679
-
680
- const char* CpuProfilesCollection::GetName(int args_count) {
681
- ASSERT(args_count >= 0);
682
- if (args_count_names_.length() <= args_count) {
683
- args_count_names_.AddBlock(
684
- NULL, args_count - args_count_names_.length() + 1);
685
- }
686
- if (args_count_names_[args_count] == NULL) {
687
- const int kMaximumNameLength = 32;
688
- char* name = NewArray<char>(kMaximumNameLength);
689
- OS::SNPrintF(Vector<char>(name, kMaximumNameLength), "%d", args_count);
690
- args_count_names_[args_count] = name;
691
- }
692
- return args_count_names_[args_count];
693
- }
694
-
695
-
696
- void CpuProfilesCollection::AddPathToCurrentProfiles(
697
- const Vector<CodeEntry*>& path) {
698
- // As starting / stopping profiles is rare relatively to this
699
- // method, we don't bother minimizing the duration of lock holding,
700
- // e.g. copying contents of the list to a local vector.
701
- current_profiles_semaphore_->Wait();
702
- for (int i = 0; i < current_profiles_.length(); ++i) {
703
- current_profiles_[i]->AddPath(path);
704
- }
705
- current_profiles_semaphore_->Signal();
706
- }
707
-
708
-
709
- void SampleRateCalculator::Tick() {
710
- if (--wall_time_query_countdown_ == 0)
711
- UpdateMeasurements(OS::TimeCurrentMillis());
712
- }
713
-
714
-
715
- void SampleRateCalculator::UpdateMeasurements(double current_time) {
716
- if (measurements_count_++ != 0) {
717
- const double measured_ticks_per_ms =
718
- (kWallTimeQueryIntervalMs * ticks_per_ms_) /
719
- (current_time - last_wall_time_);
720
- // Update the average value.
721
- ticks_per_ms_ +=
722
- (measured_ticks_per_ms - ticks_per_ms_) / measurements_count_;
723
- // Update the externally accessible result.
724
- result_ = static_cast<AtomicWord>(ticks_per_ms_ * kResultScale);
725
- }
726
- last_wall_time_ = current_time;
727
- wall_time_query_countdown_ =
728
- static_cast<unsigned>(kWallTimeQueryIntervalMs * ticks_per_ms_);
729
- }
730
-
731
-
732
- const char* ProfileGenerator::kAnonymousFunctionName = "(anonymous function)";
733
- const char* ProfileGenerator::kProgramEntryName = "(program)";
734
- const char* ProfileGenerator::kGarbageCollectorEntryName =
735
- "(garbage collector)";
736
-
737
-
738
- ProfileGenerator::ProfileGenerator(CpuProfilesCollection* profiles)
739
- : profiles_(profiles),
740
- program_entry_(
741
- profiles->NewCodeEntry(Logger::FUNCTION_TAG, kProgramEntryName)),
742
- gc_entry_(
743
- profiles->NewCodeEntry(Logger::BUILTIN_TAG,
744
- kGarbageCollectorEntryName)) {
745
- }
746
-
747
-
748
- void ProfileGenerator::RecordTickSample(const TickSample& sample) {
749
- // Allocate space for stack frames + pc + function + vm-state.
750
- ScopedVector<CodeEntry*> entries(sample.frames_count + 3);
751
- // As actual number of decoded code entries may vary, initialize
752
- // entries vector with NULL values.
753
- CodeEntry** entry = entries.start();
754
- memset(entry, 0, entries.length() * sizeof(*entry));
755
- if (sample.pc != NULL) {
756
- *entry++ = code_map_.FindEntry(sample.pc);
757
-
758
- if (sample.function != NULL) {
759
- *entry = code_map_.FindEntry(sample.function);
760
- if (*entry != NULL && !(*entry)->is_js_function()) {
761
- *entry = NULL;
762
- } else {
763
- CodeEntry* pc_entry = *entries.start();
764
- if (pc_entry == NULL) {
765
- *entry = NULL;
766
- } else if (pc_entry->is_js_function()) {
767
- // Use function entry in favor of pc entry, as function
768
- // entry has security token.
769
- *entries.start() = NULL;
770
- }
771
- }
772
- entry++;
773
- }
774
-
775
- for (const Address *stack_pos = sample.stack,
776
- *stack_end = stack_pos + sample.frames_count;
777
- stack_pos != stack_end;
778
- ++stack_pos) {
779
- *entry++ = code_map_.FindEntry(*stack_pos);
780
- }
781
- }
782
-
783
- if (FLAG_prof_browser_mode) {
784
- bool no_symbolized_entries = true;
785
- for (CodeEntry** e = entries.start(); e != entry; ++e) {
786
- if (*e != NULL) {
787
- no_symbolized_entries = false;
788
- break;
789
- }
790
- }
791
- // If no frames were symbolized, put the VM state entry in.
792
- if (no_symbolized_entries) {
793
- *entry++ = EntryForVMState(sample.state);
794
- }
795
- }
796
-
797
- profiles_->AddPathToCurrentProfiles(entries);
798
- }
799
-
800
-
801
- HeapGraphEdge::HeapGraphEdge(Type type,
802
- const char* name,
803
- HeapEntry* from,
804
- HeapEntry* to)
805
- : type_(type), name_(name), from_(from), to_(to) {
806
- ASSERT(type_ == CONTEXT_VARIABLE || type_ == PROPERTY || type_ == INTERNAL);
807
- }
808
-
809
-
810
- HeapGraphEdge::HeapGraphEdge(int index,
811
- HeapEntry* from,
812
- HeapEntry* to)
813
- : type_(ELEMENT), index_(index), from_(from), to_(to) {
814
- }
815
-
816
-
817
- static void DeleteHeapGraphEdge(HeapGraphEdge** edge_ptr) {
818
- delete *edge_ptr;
819
- }
820
-
821
-
822
- static void DeleteHeapGraphPath(HeapGraphPath** path_ptr) {
823
- delete *path_ptr;
824
- }
825
-
826
-
827
- HeapEntry::~HeapEntry() {
828
- children_.Iterate(DeleteHeapGraphEdge);
829
- retaining_paths_.Iterate(DeleteHeapGraphPath);
830
- }
831
-
832
-
833
- void HeapEntry::AddEdge(HeapGraphEdge* edge) {
834
- children_.Add(edge);
835
- edge->to()->retainers_.Add(edge);
836
- }
837
-
838
-
839
- void HeapEntry::SetClosureReference(const char* name, HeapEntry* entry) {
840
- AddEdge(
841
- new HeapGraphEdge(HeapGraphEdge::CONTEXT_VARIABLE, name, this, entry));
842
- }
843
-
844
-
845
- void HeapEntry::SetElementReference(int index, HeapEntry* entry) {
846
- AddEdge(new HeapGraphEdge(index, this, entry));
847
- }
848
-
849
-
850
- void HeapEntry::SetInternalReference(const char* name, HeapEntry* entry) {
851
- AddEdge(new HeapGraphEdge(HeapGraphEdge::INTERNAL, name, this, entry));
852
- }
853
-
854
-
855
- void HeapEntry::SetPropertyReference(const char* name, HeapEntry* entry) {
856
- AddEdge(new HeapGraphEdge(HeapGraphEdge::PROPERTY, name, this, entry));
857
- }
858
-
859
-
860
- void HeapEntry::SetAutoIndexReference(HeapEntry* entry) {
861
- SetElementReference(next_auto_index_++, entry);
862
- }
863
-
864
-
865
- void HeapEntry::SetUnidirAutoIndexReference(HeapEntry* entry) {
866
- children_.Add(new HeapGraphEdge(next_auto_index_++, this, entry));
867
- }
868
-
869
-
870
- int HeapEntry::TotalSize() {
871
- return total_size_ != kUnknownSize ? total_size_ : CalculateTotalSize();
872
- }
873
-
874
-
875
- int HeapEntry::NonSharedTotalSize() {
876
- return non_shared_total_size_ != kUnknownSize ?
877
- non_shared_total_size_ : CalculateNonSharedTotalSize();
878
- }
879
-
880
-
881
- template<class Visitor>
882
- void HeapEntry::ApplyAndPaintAllReachable(Visitor* visitor) {
883
- List<HeapEntry*> list(10);
884
- list.Add(this);
885
- this->PaintReachable();
886
- visitor->Apply(this);
887
- while (!list.is_empty()) {
888
- HeapEntry* entry = list.RemoveLast();
889
- const int children_count = entry->children_.length();
890
- for (int i = 0; i < children_count; ++i) {
891
- HeapEntry* child = entry->children_[i]->to();
892
- if (!child->painted_reachable()) {
893
- list.Add(child);
894
- child->PaintReachable();
895
- visitor->Apply(child);
896
- }
897
- }
898
- }
899
- }
900
-
901
-
902
- class NullClass {
903
- public:
904
- void Apply(HeapEntry* entry) { }
905
- };
906
-
907
- void HeapEntry::PaintAllReachable() {
908
- NullClass null;
909
- ApplyAndPaintAllReachable(&null);
910
- }
911
-
912
-
913
- class TotalSizeCalculator {
914
- public:
915
- TotalSizeCalculator()
916
- : total_size_(0) {
917
- }
918
-
919
- int total_size() const { return total_size_; }
920
-
921
- void Apply(HeapEntry* entry) {
922
- total_size_ += entry->self_size();
923
- }
924
-
925
- private:
926
- int total_size_;
927
- };
928
-
929
- int HeapEntry::CalculateTotalSize() {
930
- snapshot_->ClearPaint();
931
- TotalSizeCalculator calc;
932
- ApplyAndPaintAllReachable(&calc);
933
- total_size_ = calc.total_size();
934
- return total_size_;
935
- }
936
-
937
-
938
- class NonSharedSizeCalculator {
939
- public:
940
- NonSharedSizeCalculator()
941
- : non_shared_total_size_(0) {
942
- }
943
-
944
- int non_shared_total_size() const { return non_shared_total_size_; }
945
-
946
- void Apply(HeapEntry* entry) {
947
- if (entry->painted_reachable()) {
948
- non_shared_total_size_ += entry->self_size();
949
- }
950
- }
951
-
952
- private:
953
- int non_shared_total_size_;
954
- };
955
-
956
- int HeapEntry::CalculateNonSharedTotalSize() {
957
- // To calculate non-shared total size, first we paint all reachable
958
- // nodes in one color, then we paint all nodes reachable from other
959
- // nodes with a different color. Then we consider only nodes painted
960
- // with the first color for calculating the total size.
961
- snapshot_->ClearPaint();
962
- PaintAllReachable();
963
-
964
- List<HeapEntry*> list(10);
965
- if (this != snapshot_->root()) {
966
- list.Add(snapshot_->root());
967
- snapshot_->root()->PaintReachableFromOthers();
968
- }
969
- while (!list.is_empty()) {
970
- HeapEntry* entry = list.RemoveLast();
971
- const int children_count = entry->children_.length();
972
- for (int i = 0; i < children_count; ++i) {
973
- HeapEntry* child = entry->children_[i]->to();
974
- if (child != this && child->not_painted_reachable_from_others()) {
975
- list.Add(child);
976
- child->PaintReachableFromOthers();
977
- }
978
- }
979
- }
980
-
981
- NonSharedSizeCalculator calculator;
982
- snapshot_->IterateEntries(&calculator);
983
- non_shared_total_size_ = calculator.non_shared_total_size();
984
- return non_shared_total_size_;
985
- }
986
-
987
-
988
- class CachedHeapGraphPath {
989
- public:
990
- CachedHeapGraphPath()
991
- : nodes_(NodesMatch) { }
992
- CachedHeapGraphPath(const CachedHeapGraphPath& src)
993
- : nodes_(NodesMatch, &HashMap::DefaultAllocator, src.nodes_.capacity()),
994
- path_(src.path_.length() + 1) {
995
- for (HashMap::Entry* p = src.nodes_.Start();
996
- p != NULL;
997
- p = src.nodes_.Next(p)) {
998
- nodes_.Lookup(p->key, p->hash, true);
999
- }
1000
- path_.AddAll(src.path_);
1001
- }
1002
- void Add(HeapGraphEdge* edge) {
1003
- nodes_.Lookup(edge->to(), Hash(edge->to()), true);
1004
- path_.Add(edge);
1005
- }
1006
- bool ContainsNode(HeapEntry* node) {
1007
- return nodes_.Lookup(node, Hash(node), false) != NULL;
1008
- }
1009
- const List<HeapGraphEdge*>* path() const { return &path_; }
1010
-
1011
- private:
1012
- static uint32_t Hash(HeapEntry* entry) {
1013
- return static_cast<uint32_t>(reinterpret_cast<intptr_t>(entry));
1014
- }
1015
- static bool NodesMatch(void* key1, void* key2) { return key1 == key2; }
1016
-
1017
- HashMap nodes_;
1018
- List<HeapGraphEdge*> path_;
1019
- };
1020
-
1021
-
1022
- const List<HeapGraphPath*>* HeapEntry::GetRetainingPaths() {
1023
- if (retaining_paths_.length() == 0 && retainers_.length() != 0) {
1024
- CachedHeapGraphPath path;
1025
- FindRetainingPaths(this, &path);
1026
- }
1027
- return &retaining_paths_;
1028
- }
1029
-
1030
-
1031
- void HeapEntry::FindRetainingPaths(HeapEntry* node,
1032
- CachedHeapGraphPath* prev_path) {
1033
- for (int i = 0; i < node->retainers_.length(); ++i) {
1034
- HeapGraphEdge* ret_edge = node->retainers_[i];
1035
- if (prev_path->ContainsNode(ret_edge->from())) continue;
1036
- if (ret_edge->from() != snapshot_->root()) {
1037
- CachedHeapGraphPath path(*prev_path);
1038
- path.Add(ret_edge);
1039
- FindRetainingPaths(ret_edge->from(), &path);
1040
- } else {
1041
- HeapGraphPath* ret_path = new HeapGraphPath(*prev_path->path());
1042
- ret_path->Set(0, ret_edge);
1043
- retaining_paths_.Add(ret_path);
1044
- }
1045
- }
1046
- }
1047
-
1048
-
1049
- static void RemoveEdge(List<HeapGraphEdge*>* list, HeapGraphEdge* edge) {
1050
- for (int i = 0; i < list->length(); ) {
1051
- if (list->at(i) == edge) {
1052
- list->Remove(i);
1053
- return;
1054
- } else {
1055
- ++i;
1056
- }
1057
- }
1058
- UNREACHABLE();
1059
- }
1060
-
1061
-
1062
- void HeapEntry::RemoveChild(HeapGraphEdge* edge) {
1063
- RemoveEdge(&children_, edge);
1064
- delete edge;
1065
- }
1066
-
1067
-
1068
- void HeapEntry::RemoveRetainer(HeapGraphEdge* edge) {
1069
- RemoveEdge(&retainers_, edge);
1070
- }
1071
-
1072
-
1073
- void HeapEntry::CutEdges() {
1074
- for (int i = 0; i < children_.length(); ++i) {
1075
- HeapGraphEdge* edge = children_[i];
1076
- edge->to()->RemoveRetainer(edge);
1077
- }
1078
- children_.Iterate(DeleteHeapGraphEdge);
1079
- children_.Clear();
1080
-
1081
- for (int i = 0; i < retainers_.length(); ++i) {
1082
- HeapGraphEdge* edge = retainers_[i];
1083
- edge->from()->RemoveChild(edge);
1084
- }
1085
- retainers_.Clear();
1086
- }
1087
-
1088
-
1089
- void HeapEntry::Print(int max_depth, int indent) {
1090
- OS::Print("%6d %6d %6d [%ld] ",
1091
- self_size_, TotalSize(), NonSharedTotalSize(), id_);
1092
- if (type_ != STRING) {
1093
- OS::Print("%s %.40s\n", TypeAsString(), name_);
1094
- } else {
1095
- OS::Print("\"");
1096
- const char* c = name_;
1097
- while (*c && (c - name_) <= 40) {
1098
- if (*c != '\n')
1099
- OS::Print("%c", *c);
1100
- else
1101
- OS::Print("\\n");
1102
- ++c;
1103
- }
1104
- OS::Print("\"\n");
1105
- }
1106
- if (--max_depth == 0) return;
1107
- const int children_count = children_.length();
1108
- for (int i = 0; i < children_count; ++i) {
1109
- HeapGraphEdge* edge = children_[i];
1110
- switch (edge->type()) {
1111
- case HeapGraphEdge::CONTEXT_VARIABLE:
1112
- OS::Print(" %*c #%s: ", indent, ' ', edge->name());
1113
- break;
1114
- case HeapGraphEdge::ELEMENT:
1115
- OS::Print(" %*c %d: ", indent, ' ', edge->index());
1116
- break;
1117
- case HeapGraphEdge::INTERNAL:
1118
- OS::Print(" %*c $%s: ", indent, ' ', edge->name());
1119
- break;
1120
- case HeapGraphEdge::PROPERTY:
1121
- OS::Print(" %*c %s: ", indent, ' ', edge->name());
1122
- break;
1123
- default:
1124
- OS::Print("!!! unknown edge type: %d ", edge->type());
1125
- }
1126
- edge->to()->Print(max_depth, indent + 2);
1127
- }
1128
- }
1129
-
1130
-
1131
- const char* HeapEntry::TypeAsString() {
1132
- switch (type_) {
1133
- case INTERNAL: return "/internal/";
1134
- case OBJECT: return "/object/";
1135
- case CLOSURE: return "/closure/";
1136
- case STRING: return "/string/";
1137
- case CODE: return "/code/";
1138
- case ARRAY: return "/array/";
1139
- default: return "???";
1140
- }
1141
- }
1142
-
1143
-
1144
- HeapGraphPath::HeapGraphPath(const List<HeapGraphEdge*>& path)
1145
- : path_(path.length() + 1) {
1146
- Add(NULL);
1147
- for (int i = path.length() - 1; i >= 0; --i) {
1148
- Add(path[i]);
1149
- }
1150
- }
1151
-
1152
-
1153
- void HeapGraphPath::Print() {
1154
- path_[0]->from()->Print(1, 0);
1155
- for (int i = 0; i < path_.length(); ++i) {
1156
- OS::Print(" -> ");
1157
- HeapGraphEdge* edge = path_[i];
1158
- switch (edge->type()) {
1159
- case HeapGraphEdge::CONTEXT_VARIABLE:
1160
- OS::Print("[#%s] ", edge->name());
1161
- break;
1162
- case HeapGraphEdge::ELEMENT:
1163
- OS::Print("[%d] ", edge->index());
1164
- break;
1165
- case HeapGraphEdge::INTERNAL:
1166
- OS::Print("[$%s] ", edge->name());
1167
- break;
1168
- case HeapGraphEdge::PROPERTY:
1169
- OS::Print("[%s] ", edge->name());
1170
- break;
1171
- default:
1172
- OS::Print("!!! unknown edge type: %d ", edge->type());
1173
- }
1174
- edge->to()->Print(1, 0);
1175
- }
1176
- OS::Print("\n");
1177
- }
1178
-
1179
-
1180
- class IndexedReferencesExtractor : public ObjectVisitor {
1181
- public:
1182
- IndexedReferencesExtractor(HeapSnapshot* snapshot, HeapEntry* parent)
1183
- : snapshot_(snapshot),
1184
- parent_(parent) {
1185
- }
1186
-
1187
- void VisitPointer(Object** o) {
1188
- if (!(*o)->IsHeapObject()) return;
1189
- HeapEntry* entry = snapshot_->GetEntry(HeapObject::cast(*o));
1190
- if (entry != NULL) {
1191
- parent_->SetAutoIndexReference(entry);
1192
- }
1193
- }
1194
-
1195
- void VisitPointers(Object** start, Object** end) {
1196
- for (Object** p = start; p < end; p++) VisitPointer(p);
1197
- }
1198
-
1199
- private:
1200
- HeapSnapshot* snapshot_;
1201
- HeapEntry* parent_;
1202
- };
1203
-
1204
-
1205
- HeapEntriesMap::HeapEntriesMap()
1206
- : entries_(HeapObjectsMatch) {
1207
- }
1208
-
1209
-
1210
- HeapEntriesMap::~HeapEntriesMap() {
1211
- for (HashMap::Entry* p = entries_.Start();
1212
- p != NULL;
1213
- p = entries_.Next(p)) {
1214
- if (!IsAlias(p->value)) delete reinterpret_cast<HeapEntry*>(p->value);
1215
- }
1216
- }
1217
-
1218
-
1219
- void HeapEntriesMap::Alias(HeapObject* object, HeapEntry* entry) {
1220
- HashMap::Entry* cache_entry = entries_.Lookup(object, Hash(object), true);
1221
- if (cache_entry->value == NULL)
1222
- cache_entry->value = reinterpret_cast<void*>(
1223
- reinterpret_cast<intptr_t>(entry) | kAliasTag);
1224
- }
1225
-
1226
-
1227
- void HeapEntriesMap::Apply(void (HeapEntry::*Func)(void)) {
1228
- for (HashMap::Entry* p = entries_.Start();
1229
- p != NULL;
1230
- p = entries_.Next(p)) {
1231
- if (!IsAlias(p->value)) (reinterpret_cast<HeapEntry*>(p->value)->*Func)();
1232
- }
1233
- }
1234
-
1235
-
1236
- HeapEntry* HeapEntriesMap::Map(HeapObject* object) {
1237
- HashMap::Entry* cache_entry = entries_.Lookup(object, Hash(object), false);
1238
- return cache_entry != NULL ?
1239
- reinterpret_cast<HeapEntry*>(
1240
- reinterpret_cast<intptr_t>(cache_entry->value) & (~kAliasTag)) : NULL;
1241
- }
1242
-
1243
-
1244
- void HeapEntriesMap::Pair(HeapObject* object, HeapEntry* entry) {
1245
- HashMap::Entry* cache_entry = entries_.Lookup(object, Hash(object), true);
1246
- ASSERT(cache_entry->value == NULL);
1247
- cache_entry->value = entry;
1248
- }
1249
-
1250
-
1251
- HeapSnapshot::HeapSnapshot(HeapSnapshotsCollection* collection,
1252
- const char* title,
1253
- unsigned uid)
1254
- : collection_(collection),
1255
- title_(title),
1256
- uid_(uid),
1257
- root_(this),
1258
- sorted_entries_(NULL) {
1259
- }
1260
-
1261
-
1262
- HeapSnapshot::~HeapSnapshot() {
1263
- delete sorted_entries_;
1264
- }
1265
-
1266
-
1267
- void HeapSnapshot::ClearPaint() {
1268
- root_.ClearPaint();
1269
- entries_.Apply(&HeapEntry::ClearPaint);
1270
- }
1271
-
1272
-
1273
- HeapEntry* HeapSnapshot::GetEntry(Object* obj) {
1274
- if (!obj->IsHeapObject()) return NULL;
1275
- HeapObject* object = HeapObject::cast(obj);
1276
-
1277
- {
1278
- HeapEntry* existing = FindEntry(object);
1279
- if (existing != NULL) return existing;
1280
- }
1281
-
1282
- // Add new entry.
1283
- if (object->IsJSFunction()) {
1284
- JSFunction* func = JSFunction::cast(object);
1285
- SharedFunctionInfo* shared = func->shared();
1286
- String* name = String::cast(shared->name())->length() > 0 ?
1287
- String::cast(shared->name()) : shared->inferred_name();
1288
- return AddEntry(object, HeapEntry::CLOSURE, collection_->GetName(name));
1289
- } else if (object->IsJSObject()) {
1290
- return AddEntry(object,
1291
- HeapEntry::OBJECT,
1292
- collection_->GetName(
1293
- JSObject::cast(object)->constructor_name()));
1294
- } else if (object->IsJSGlobalPropertyCell()) {
1295
- HeapEntry* value = GetEntry(JSGlobalPropertyCell::cast(object)->value());
1296
- // If GPC references an object that we have interest in, add the object.
1297
- // We don't store HeapEntries for GPCs. Instead, we make our hash map
1298
- // to point to object's HeapEntry by GPCs address.
1299
- if (value != NULL) AddEntryAlias(object, value);
1300
- return value;
1301
- } else if (object->IsString()) {
1302
- return AddEntry(object,
1303
- HeapEntry::STRING,
1304
- collection_->GetName(String::cast(object)));
1305
- } else if (object->IsCode()) {
1306
- return AddEntry(object, HeapEntry::CODE);
1307
- } else if (object->IsSharedFunctionInfo()) {
1308
- SharedFunctionInfo* shared = SharedFunctionInfo::cast(object);
1309
- String* name = String::cast(shared->name())->length() > 0 ?
1310
- String::cast(shared->name()) : shared->inferred_name();
1311
- return AddEntry(object, HeapEntry::CODE, collection_->GetName(name));
1312
- } else if (object->IsScript()) {
1313
- Script* script = Script::cast(object);
1314
- return AddEntry(object,
1315
- HeapEntry::CODE,
1316
- script->name()->IsString() ?
1317
- collection_->GetName(String::cast(script->name())) : "");
1318
- } else if (object->IsFixedArray()) {
1319
- return AddEntry(object, HeapEntry::ARRAY);
1320
- }
1321
- // No interest in this object.
1322
- return NULL;
1323
- }
1324
-
1325
-
1326
- void HeapSnapshot::SetClosureReference(HeapEntry* parent,
1327
- String* reference_name,
1328
- Object* child) {
1329
- HeapEntry* child_entry = GetEntry(child);
1330
- if (child_entry != NULL) {
1331
- parent->SetClosureReference(
1332
- collection_->GetName(reference_name), child_entry);
1333
- }
1334
- }
1335
-
1336
-
1337
- void HeapSnapshot::SetElementReference(HeapEntry* parent,
1338
- int index,
1339
- Object* child) {
1340
- HeapEntry* child_entry = GetEntry(child);
1341
- if (child_entry != NULL) {
1342
- parent->SetElementReference(index, child_entry);
1343
- }
1344
- }
1345
-
1346
-
1347
- void HeapSnapshot::SetInternalReference(HeapEntry* parent,
1348
- const char* reference_name,
1349
- Object* child) {
1350
- HeapEntry* child_entry = GetEntry(child);
1351
- if (child_entry != NULL) {
1352
- parent->SetInternalReference(reference_name, child_entry);
1353
- }
1354
- }
1355
-
1356
-
1357
- void HeapSnapshot::SetPropertyReference(HeapEntry* parent,
1358
- String* reference_name,
1359
- Object* child) {
1360
- HeapEntry* child_entry = GetEntry(child);
1361
- if (child_entry != NULL) {
1362
- parent->SetPropertyReference(
1363
- collection_->GetName(reference_name), child_entry);
1364
- }
1365
- }
1366
-
1367
-
1368
- HeapEntry* HeapSnapshot::AddEntry(HeapObject* object,
1369
- HeapEntry::Type type,
1370
- const char* name) {
1371
- HeapEntry* entry = new HeapEntry(this,
1372
- type,
1373
- name,
1374
- collection_->GetObjectId(object->address()),
1375
- GetObjectSize(object),
1376
- GetObjectSecurityToken(object));
1377
- entries_.Pair(object, entry);
1378
-
1379
- // Detect, if this is a JS global object of the current context, and
1380
- // add it to snapshot's roots. There can be several JS global objects
1381
- // in a context.
1382
- if (object->IsJSGlobalProxy()) {
1383
- int global_security_token = GetGlobalSecurityToken();
1384
- int object_security_token =
1385
- collection_->token_enumerator()->GetTokenId(
1386
- Context::cast(
1387
- JSGlobalProxy::cast(object)->context())->security_token());
1388
- if (object_security_token == TokenEnumerator::kNoSecurityToken
1389
- || object_security_token == global_security_token) {
1390
- HeapEntry* global_object_entry =
1391
- GetEntry(HeapObject::cast(object->map()->prototype()));
1392
- ASSERT(global_object_entry != NULL);
1393
- root_.SetAutoIndexReference(global_object_entry);
1394
- }
1395
- }
1396
-
1397
- return entry;
1398
- }
1399
-
1400
-
1401
- class EdgesCutter {
1402
- public:
1403
- explicit EdgesCutter(int global_security_token)
1404
- : global_security_token_(global_security_token) {
1405
- }
1406
-
1407
- void Apply(HeapEntry* entry) {
1408
- if (entry->security_token_id() != TokenEnumerator::kNoSecurityToken
1409
- && entry->security_token_id() != global_security_token_) {
1410
- entry->CutEdges();
1411
- }
1412
- }
1413
-
1414
- private:
1415
- const int global_security_token_;
1416
- };
1417
-
1418
- void HeapSnapshot::CutObjectsFromForeignSecurityContexts() {
1419
- EdgesCutter cutter(GetGlobalSecurityToken());
1420
- entries_.Apply(&cutter);
1421
- }
1422
-
1423
-
1424
- int HeapSnapshot::GetGlobalSecurityToken() {
1425
- return collection_->token_enumerator()->GetTokenId(
1426
- Top::context()->global()->global_context()->security_token());
1427
- }
1428
-
1429
-
1430
- int HeapSnapshot::GetObjectSize(HeapObject* obj) {
1431
- return obj->IsJSObject() ?
1432
- CalculateNetworkSize(JSObject::cast(obj)) : obj->Size();
1433
- }
1434
-
1435
-
1436
- int HeapSnapshot::GetObjectSecurityToken(HeapObject* obj) {
1437
- if (obj->IsGlobalContext()) {
1438
- return collection_->token_enumerator()->GetTokenId(
1439
- Context::cast(obj)->security_token());
1440
- } else {
1441
- return TokenEnumerator::kNoSecurityToken;
1442
- }
1443
- }
1444
-
1445
-
1446
- int HeapSnapshot::CalculateNetworkSize(JSObject* obj) {
1447
- int size = obj->Size();
1448
- // If 'properties' and 'elements' are non-empty (thus, non-shared),
1449
- // take their size into account.
1450
- if (FixedArray::cast(obj->properties())->length() != 0) {
1451
- size += obj->properties()->Size();
1452
- }
1453
- if (FixedArray::cast(obj->elements())->length() != 0) {
1454
- size += obj->elements()->Size();
1455
- }
1456
- // For functions, also account non-empty context and literals sizes.
1457
- if (obj->IsJSFunction()) {
1458
- JSFunction* f = JSFunction::cast(obj);
1459
- if (f->unchecked_context()->IsContext()) {
1460
- size += f->context()->Size();
1461
- }
1462
- if (f->literals()->length() != 0) {
1463
- size += f->literals()->Size();
1464
- }
1465
- }
1466
- return size;
1467
- }
1468
-
1469
-
1470
- class EntriesCollector {
1471
- public:
1472
- explicit EntriesCollector(List<HeapEntry*>* list) : list_(list) { }
1473
- void Apply(HeapEntry* entry) {
1474
- list_->Add(entry);
1475
- }
1476
- private:
1477
- List<HeapEntry*>* list_;
1478
- };
1479
-
1480
- template<class T>
1481
- static int SortByIds(const T* entry1_ptr,
1482
- const T* entry2_ptr) {
1483
- if ((*entry1_ptr)->id() == (*entry2_ptr)->id()) return 0;
1484
- return (*entry1_ptr)->id() < (*entry2_ptr)->id() ? -1 : 1;
1485
- }
1486
-
1487
- List<HeapEntry*>* HeapSnapshot::GetSortedEntriesList() {
1488
- if (sorted_entries_ != NULL) return sorted_entries_;
1489
- sorted_entries_ = new List<HeapEntry*>(entries_.capacity());
1490
- EntriesCollector collector(sorted_entries_);
1491
- entries_.Apply(&collector);
1492
- sorted_entries_->Sort(SortByIds);
1493
- return sorted_entries_;
1494
- }
1495
-
1496
-
1497
- HeapSnapshotsDiff* HeapSnapshot::CompareWith(HeapSnapshot* snapshot) {
1498
- return collection_->CompareSnapshots(this, snapshot);
1499
- }
1500
-
1501
-
1502
- void HeapSnapshot::Print(int max_depth) {
1503
- root_.Print(max_depth, 0);
1504
- }
1505
-
1506
-
1507
- HeapObjectsMap::HeapObjectsMap()
1508
- : initial_fill_mode_(true),
1509
- next_id_(1),
1510
- entries_map_(AddressesMatch),
1511
- entries_(new List<EntryInfo>()) { }
1512
-
1513
-
1514
- HeapObjectsMap::~HeapObjectsMap() {
1515
- delete entries_;
1516
- }
1517
-
1518
-
1519
- void HeapObjectsMap::SnapshotGenerationFinished() {
1520
- initial_fill_mode_ = false;
1521
- RemoveDeadEntries();
1522
- }
1523
-
1524
-
1525
- uint64_t HeapObjectsMap::FindObject(Address addr) {
1526
- if (!initial_fill_mode_) {
1527
- uint64_t existing = FindEntry(addr);
1528
- if (existing != 0) return existing;
1529
- }
1530
- uint64_t id = next_id_++;
1531
- AddEntry(addr, id);
1532
- return id;
1533
- }
1534
-
1535
-
1536
- void HeapObjectsMap::MoveObject(Address from, Address to) {
1537
- if (from == to) return;
1538
- HashMap::Entry* entry = entries_map_.Lookup(from, AddressHash(from), false);
1539
- if (entry != NULL) {
1540
- void* value = entry->value;
1541
- entries_map_.Remove(from, AddressHash(from));
1542
- entry = entries_map_.Lookup(to, AddressHash(to), true);
1543
- // We can have an entry at the new location, it is OK, as GC can overwrite
1544
- // dead objects with alive objects being moved.
1545
- entry->value = value;
1546
- }
1547
- }
1548
-
1549
-
1550
- void HeapObjectsMap::AddEntry(Address addr, uint64_t id) {
1551
- HashMap::Entry* entry = entries_map_.Lookup(addr, AddressHash(addr), true);
1552
- ASSERT(entry->value == NULL);
1553
- entry->value = reinterpret_cast<void*>(entries_->length());
1554
- entries_->Add(EntryInfo(id));
1555
- }
1556
-
1557
-
1558
- uint64_t HeapObjectsMap::FindEntry(Address addr) {
1559
- HashMap::Entry* entry = entries_map_.Lookup(addr, AddressHash(addr), false);
1560
- if (entry != NULL) {
1561
- int entry_index =
1562
- static_cast<int>(reinterpret_cast<intptr_t>(entry->value));
1563
- EntryInfo& entry_info = entries_->at(entry_index);
1564
- entry_info.accessed = true;
1565
- return entry_info.id;
1566
- } else {
1567
- return 0;
1568
- }
1569
- }
1570
-
1571
-
1572
- void HeapObjectsMap::RemoveDeadEntries() {
1573
- List<EntryInfo>* new_entries = new List<EntryInfo>();
1574
- for (HashMap::Entry* entry = entries_map_.Start();
1575
- entry != NULL;
1576
- entry = entries_map_.Next(entry)) {
1577
- int entry_index =
1578
- static_cast<int>(reinterpret_cast<intptr_t>(entry->value));
1579
- EntryInfo& entry_info = entries_->at(entry_index);
1580
- if (entry_info.accessed) {
1581
- entry->value = reinterpret_cast<void*>(new_entries->length());
1582
- new_entries->Add(EntryInfo(entry_info.id, false));
1583
- }
1584
- }
1585
- delete entries_;
1586
- entries_ = new_entries;
1587
- }
1588
-
1589
-
1590
- HeapSnapshotsCollection::HeapSnapshotsCollection()
1591
- : is_tracking_objects_(false),
1592
- snapshots_uids_(HeapSnapshotsMatch),
1593
- token_enumerator_(new TokenEnumerator()) {
1594
- }
1595
-
1596
-
1597
- static void DeleteHeapSnapshot(HeapSnapshot** snapshot_ptr) {
1598
- delete *snapshot_ptr;
1599
- }
1600
-
1601
-
1602
- HeapSnapshotsCollection::~HeapSnapshotsCollection() {
1603
- delete token_enumerator_;
1604
- snapshots_.Iterate(DeleteHeapSnapshot);
1605
- }
1606
-
1607
-
1608
- HeapSnapshot* HeapSnapshotsCollection::NewSnapshot(const char* name,
1609
- unsigned uid) {
1610
- is_tracking_objects_ = true; // Start watching for heap objects moves.
1611
- HeapSnapshot* snapshot = new HeapSnapshot(this, name, uid);
1612
- snapshots_.Add(snapshot);
1613
- HashMap::Entry* entry =
1614
- snapshots_uids_.Lookup(reinterpret_cast<void*>(snapshot->uid()),
1615
- static_cast<uint32_t>(snapshot->uid()),
1616
- true);
1617
- ASSERT(entry->value == NULL);
1618
- entry->value = snapshot;
1619
- return snapshot;
1620
- }
1621
-
1622
-
1623
- HeapSnapshot* HeapSnapshotsCollection::GetSnapshot(unsigned uid) {
1624
- HashMap::Entry* entry = snapshots_uids_.Lookup(reinterpret_cast<void*>(uid),
1625
- static_cast<uint32_t>(uid),
1626
- false);
1627
- return entry != NULL ? reinterpret_cast<HeapSnapshot*>(entry->value) : NULL;
1628
- }
1629
-
1630
-
1631
- HeapSnapshotsDiff* HeapSnapshotsCollection::CompareSnapshots(
1632
- HeapSnapshot* snapshot1,
1633
- HeapSnapshot* snapshot2) {
1634
- return comparator_.Compare(snapshot1, snapshot2);
1635
- }
1636
-
1637
-
1638
- HeapSnapshotGenerator::HeapSnapshotGenerator(HeapSnapshot* snapshot)
1639
- : snapshot_(snapshot) {
1640
- }
1641
-
1642
-
1643
- void HeapSnapshotGenerator::GenerateSnapshot() {
1644
- AssertNoAllocation no_alloc;
1645
-
1646
- // Iterate heap contents.
1647
- HeapIterator iterator;
1648
- for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
1649
- ExtractReferences(obj);
1650
- }
1651
-
1652
- snapshot_->CutObjectsFromForeignSecurityContexts();
1653
- }
1654
-
1655
-
1656
- void HeapSnapshotGenerator::ExtractReferences(HeapObject* obj) {
1657
- HeapEntry* entry = snapshot_->GetEntry(obj);
1658
- if (entry == NULL) return;
1659
- if (entry->visited()) return;
1660
-
1661
- if (obj->IsJSObject()) {
1662
- JSObject* js_obj = JSObject::cast(obj);
1663
- ExtractClosureReferences(js_obj, entry);
1664
- ExtractPropertyReferences(js_obj, entry);
1665
- ExtractElementReferences(js_obj, entry);
1666
- snapshot_->SetPropertyReference(
1667
- entry, Heap::prototype_symbol(), js_obj->map()->prototype());
1668
- } else if (obj->IsJSGlobalPropertyCell()) {
1669
- JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(obj);
1670
- snapshot_->SetElementReference(entry, 0, cell->value());
1671
- } else if (obj->IsString()) {
1672
- if (obj->IsConsString()) {
1673
- ConsString* cs = ConsString::cast(obj);
1674
- snapshot_->SetElementReference(entry, 0, cs->first());
1675
- snapshot_->SetElementReference(entry, 1, cs->second());
1676
- }
1677
- } else if (obj->IsCode() || obj->IsSharedFunctionInfo() || obj->IsScript()) {
1678
- IndexedReferencesExtractor refs_extractor(snapshot_, entry);
1679
- obj->Iterate(&refs_extractor);
1680
- } else if (obj->IsFixedArray()) {
1681
- IndexedReferencesExtractor refs_extractor(snapshot_, entry);
1682
- obj->Iterate(&refs_extractor);
1683
- }
1684
- entry->MarkAsVisited();
1685
- }
1686
-
1687
-
1688
- void HeapSnapshotGenerator::ExtractClosureReferences(JSObject* js_obj,
1689
- HeapEntry* entry) {
1690
- if (js_obj->IsJSFunction()) {
1691
- HandleScope hs;
1692
- JSFunction* func = JSFunction::cast(js_obj);
1693
- Context* context = func->context();
1694
- ZoneScope zscope(DELETE_ON_EXIT);
1695
- SerializedScopeInfo* serialized_scope_info =
1696
- context->closure()->shared()->scope_info();
1697
- ScopeInfo<ZoneListAllocationPolicy> zone_scope_info(serialized_scope_info);
1698
- int locals_number = zone_scope_info.NumberOfLocals();
1699
- for (int i = 0; i < locals_number; ++i) {
1700
- String* local_name = *zone_scope_info.LocalName(i);
1701
- int idx = serialized_scope_info->ContextSlotIndex(local_name, NULL);
1702
- if (idx >= 0 && idx < context->length()) {
1703
- snapshot_->SetClosureReference(entry, local_name, context->get(idx));
1704
- }
1705
- }
1706
- snapshot_->SetInternalReference(entry, "code", func->shared());
1707
- }
1708
- }
1709
-
1710
-
1711
- void HeapSnapshotGenerator::ExtractPropertyReferences(JSObject* js_obj,
1712
- HeapEntry* entry) {
1713
- if (js_obj->HasFastProperties()) {
1714
- DescriptorArray* descs = js_obj->map()->instance_descriptors();
1715
- for (int i = 0; i < descs->number_of_descriptors(); i++) {
1716
- switch (descs->GetType(i)) {
1717
- case FIELD: {
1718
- int index = descs->GetFieldIndex(i);
1719
- snapshot_->SetPropertyReference(
1720
- entry, descs->GetKey(i), js_obj->FastPropertyAt(index));
1721
- break;
1722
- }
1723
- case CONSTANT_FUNCTION:
1724
- snapshot_->SetPropertyReference(
1725
- entry, descs->GetKey(i), descs->GetConstantFunction(i));
1726
- break;
1727
- default: ;
1728
- }
1729
- }
1730
- } else {
1731
- StringDictionary* dictionary = js_obj->property_dictionary();
1732
- int length = dictionary->Capacity();
1733
- for (int i = 0; i < length; ++i) {
1734
- Object* k = dictionary->KeyAt(i);
1735
- if (dictionary->IsKey(k)) {
1736
- snapshot_->SetPropertyReference(
1737
- entry, String::cast(k), dictionary->ValueAt(i));
1738
- }
1739
- }
1740
- }
1741
- }
1742
-
1743
-
1744
- void HeapSnapshotGenerator::ExtractElementReferences(JSObject* js_obj,
1745
- HeapEntry* entry) {
1746
- if (js_obj->HasFastElements()) {
1747
- FixedArray* elements = FixedArray::cast(js_obj->elements());
1748
- int length = js_obj->IsJSArray() ?
1749
- Smi::cast(JSArray::cast(js_obj)->length())->value() :
1750
- elements->length();
1751
- for (int i = 0; i < length; ++i) {
1752
- if (!elements->get(i)->IsTheHole()) {
1753
- snapshot_->SetElementReference(entry, i, elements->get(i));
1754
- }
1755
- }
1756
- } else if (js_obj->HasDictionaryElements()) {
1757
- NumberDictionary* dictionary = js_obj->element_dictionary();
1758
- int length = dictionary->Capacity();
1759
- for (int i = 0; i < length; ++i) {
1760
- Object* k = dictionary->KeyAt(i);
1761
- if (dictionary->IsKey(k)) {
1762
- ASSERT(k->IsNumber());
1763
- uint32_t index = static_cast<uint32_t>(k->Number());
1764
- snapshot_->SetElementReference(entry, index, dictionary->ValueAt(i));
1765
- }
1766
- }
1767
- }
1768
- }
1769
-
1770
-
1771
- static void DeleteHeapSnapshotsDiff(HeapSnapshotsDiff** diff_ptr) {
1772
- delete *diff_ptr;
1773
- }
1774
-
1775
- HeapSnapshotsComparator::~HeapSnapshotsComparator() {
1776
- diffs_.Iterate(DeleteHeapSnapshotsDiff);
1777
- }
1778
-
1779
-
1780
- HeapSnapshotsDiff* HeapSnapshotsComparator::Compare(HeapSnapshot* snapshot1,
1781
- HeapSnapshot* snapshot2) {
1782
- HeapSnapshotsDiff* diff = new HeapSnapshotsDiff(snapshot1, snapshot2);
1783
- diffs_.Add(diff);
1784
- List<HeapEntry*>* entries1 = snapshot1->GetSortedEntriesList();
1785
- List<HeapEntry*>* entries2 = snapshot2->GetSortedEntriesList();
1786
- int i = 0, j = 0;
1787
- List<HeapEntry*> added_entries, deleted_entries;
1788
- while (i < entries1->length() && j < entries2->length()) {
1789
- uint64_t id1 = entries1->at(i)->id();
1790
- uint64_t id2 = entries2->at(j)->id();
1791
- if (id1 == id2) {
1792
- i++;
1793
- j++;
1794
- } else if (id1 < id2) {
1795
- HeapEntry* entry = entries1->at(i++);
1796
- deleted_entries.Add(entry);
1797
- } else {
1798
- HeapEntry* entry = entries2->at(j++);
1799
- added_entries.Add(entry);
1800
- }
1801
- }
1802
- while (i < entries1->length()) {
1803
- HeapEntry* entry = entries1->at(i++);
1804
- deleted_entries.Add(entry);
1805
- }
1806
- while (j < entries2->length()) {
1807
- HeapEntry* entry = entries2->at(j++);
1808
- added_entries.Add(entry);
1809
- }
1810
-
1811
- snapshot1->ClearPaint();
1812
- snapshot1->root()->PaintAllReachable();
1813
- for (int i = 0; i < deleted_entries.length(); ++i) {
1814
- HeapEntry* entry = deleted_entries[i];
1815
- if (entry->painted_reachable())
1816
- diff->AddDeletedEntry(entry);
1817
- }
1818
- snapshot2->ClearPaint();
1819
- snapshot2->root()->PaintAllReachable();
1820
- for (int i = 0; i < added_entries.length(); ++i) {
1821
- HeapEntry* entry = added_entries[i];
1822
- if (entry->painted_reachable())
1823
- diff->AddAddedEntry(entry);
1824
- }
1825
- return diff;
1826
- }
1827
-
1828
- } } // namespace v8::internal
1829
-
1830
- #endif // ENABLE_LOGGING_AND_PROFILING