therubyracer 0.7.4 → 0.7.5

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 (482) hide show
  1. data/History.txt +11 -0
  2. data/Rakefile +1 -1
  3. data/ext/v8/extconf.rb +0 -18
  4. data/ext/v8/rr.cpp +2 -2
  5. data/ext/v8/upstream/{2.1.10 → 2.3.3}/AUTHORS +1 -0
  6. data/ext/v8/upstream/{2.1.10 → 2.3.3}/ChangeLog +239 -0
  7. data/ext/v8/upstream/{2.1.10 → 2.3.3}/LICENSE +0 -0
  8. data/ext/v8/upstream/{2.1.10 → 2.3.3}/SConstruct +29 -17
  9. data/ext/v8/upstream/{2.1.10 → 2.3.3}/include/v8-debug.h +61 -3
  10. data/ext/v8/upstream/{2.1.10 → 2.3.3}/include/v8-profiler.h +182 -5
  11. data/ext/v8/upstream/{2.1.10 → 2.3.3}/include/v8.h +458 -257
  12. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/SConscript +2 -5
  13. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/accessors.cc +2 -2
  14. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/accessors.h +0 -0
  15. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/allocation.cc +0 -0
  16. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/allocation.h +0 -0
  17. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/api.cc +574 -30
  18. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/api.h +12 -10
  19. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/apinatives.js +0 -0
  20. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/apiutils.h +0 -0
  21. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arguments.h +0 -0
  22. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/assembler-arm-inl.h +38 -15
  23. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/assembler-arm.cc +646 -101
  24. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/assembler-arm.h +174 -15
  25. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/builtins-arm.cc +56 -47
  26. data/ext/v8/upstream/2.3.3/src/arm/codegen-arm-inl.h +48 -0
  27. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/codegen-arm.cc +2957 -1448
  28. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/codegen-arm.h +230 -74
  29. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/constants-arm.cc +25 -1
  30. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/constants-arm.h +16 -1
  31. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/cpu-arm.cc +4 -0
  32. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/debug-arm.cc +76 -6
  33. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/disasm-arm.cc +168 -20
  34. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/fast-codegen-arm.cc +5 -2
  35. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/frames-arm.cc +4 -4
  36. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/frames-arm.h +0 -0
  37. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/full-codegen-arm.cc +1558 -248
  38. data/ext/v8/upstream/2.3.3/src/arm/ic-arm.cc +2258 -0
  39. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/jump-target-arm.cc +55 -103
  40. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/macro-assembler-arm.cc +358 -185
  41. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/macro-assembler-arm.h +136 -41
  42. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/regexp-macro-assembler-arm.cc +26 -5
  43. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/regexp-macro-assembler-arm.h +0 -0
  44. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/register-allocator-arm-inl.h +0 -0
  45. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/register-allocator-arm.cc +4 -0
  46. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/register-allocator-arm.h +0 -0
  47. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/simulator-arm.cc +203 -22
  48. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/simulator-arm.h +7 -0
  49. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/stub-cache-arm.cc +531 -324
  50. data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm-inl.h +59 -0
  51. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/virtual-frame-arm.cc +247 -81
  52. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/virtual-frame-arm.h +99 -83
  53. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/array.js +2 -2
  54. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/assembler.cc +6 -13
  55. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/assembler.h +36 -10
  56. data/ext/v8/upstream/2.3.3/src/ast-inl.h +81 -0
  57. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ast.cc +14 -0
  58. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ast.h +20 -35
  59. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/bootstrapper.cc +32 -1
  60. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/bootstrapper.h +0 -4
  61. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/builtins.cc +50 -33
  62. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/builtins.h +2 -0
  63. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/bytecodes-irregexp.h +0 -0
  64. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/cached-powers.h +0 -0
  65. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/char-predicates-inl.h +0 -0
  66. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/char-predicates.h +0 -0
  67. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/checks.cc +0 -0
  68. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/checks.h +8 -6
  69. data/ext/v8/upstream/2.3.3/src/circular-queue-inl.h +53 -0
  70. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/circular-queue.cc +0 -0
  71. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/circular-queue.h +0 -26
  72. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/code-stubs.cc +2 -4
  73. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/code-stubs.h +1 -0
  74. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/code.h +0 -0
  75. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/codegen-inl.h +0 -0
  76. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/codegen.cc +44 -13
  77. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/codegen.h +310 -31
  78. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/compilation-cache.cc +28 -0
  79. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/compilation-cache.h +3 -0
  80. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/compiler.cc +45 -14
  81. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/compiler.h +0 -0
  82. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/contexts.cc +11 -11
  83. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/contexts.h +0 -0
  84. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/conversions-inl.h +0 -0
  85. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/conversions.cc +25 -11
  86. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/conversions.h +0 -0
  87. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/counters.cc +0 -0
  88. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/counters.h +0 -0
  89. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/cpu-profiler-inl.h +2 -1
  90. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/cpu-profiler.cc +68 -24
  91. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/cpu-profiler.h +19 -11
  92. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/cpu.h +0 -0
  93. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8-debug.cc +0 -0
  94. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8-debug.h +0 -0
  95. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8-posix.cc +0 -0
  96. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8-readline.cc +0 -0
  97. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8-windows.cc +0 -0
  98. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8.cc +3 -0
  99. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8.h +0 -0
  100. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8.js +55 -2
  101. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/data-flow.cc +3 -0
  102. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/data-flow.h +0 -0
  103. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/date.js +68 -137
  104. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/dateparser-inl.h +0 -0
  105. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/dateparser.cc +2 -8
  106. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/dateparser.h +0 -0
  107. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/debug-agent.cc +3 -3
  108. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/debug-agent.h +0 -0
  109. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/debug-debugger.js +81 -23
  110. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/debug.cc +275 -81
  111. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/debug.h +85 -6
  112. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/disasm.h +0 -0
  113. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/disassembler.cc +1 -1
  114. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/disassembler.h +0 -0
  115. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/diy-fp.cc +0 -0
  116. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/diy-fp.h +0 -0
  117. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/double.h +0 -0
  118. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/dtoa-config.c +0 -0
  119. data/ext/v8/upstream/2.3.3/src/dtoa.cc +77 -0
  120. data/ext/v8/upstream/2.3.3/src/dtoa.h +81 -0
  121. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/execution.cc +111 -3
  122. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/execution.h +12 -1
  123. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/factory.cc +25 -3
  124. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/factory.h +16 -9
  125. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/fast-codegen.cc +0 -0
  126. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/fast-codegen.h +0 -0
  127. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/fast-dtoa.cc +2 -9
  128. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/fast-dtoa.h +1 -2
  129. data/ext/v8/upstream/2.3.3/src/fixed-dtoa.cc +405 -0
  130. data/ext/v8/upstream/{2.1.10/src/jump-target-light.cc → 2.3.3/src/fixed-dtoa.h} +22 -53
  131. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/flag-definitions.h +14 -6
  132. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/flags.cc +5 -9
  133. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/flags.h +0 -0
  134. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/flow-graph.cc +0 -0
  135. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/flow-graph.h +0 -0
  136. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/frame-element.cc +0 -0
  137. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/frame-element.h +0 -0
  138. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/frames-inl.h +0 -0
  139. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/frames.cc +5 -2
  140. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/frames.h +1 -0
  141. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/full-codegen.cc +387 -20
  142. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/full-codegen.h +102 -5
  143. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/func-name-inferrer.cc +0 -0
  144. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/func-name-inferrer.h +0 -0
  145. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/global-handles.cc +8 -4
  146. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/global-handles.h +0 -0
  147. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/globals.h +44 -7
  148. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/handles-inl.h +0 -0
  149. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/handles.cc +19 -0
  150. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/handles.h +8 -0
  151. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/hashmap.cc +0 -0
  152. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/hashmap.h +0 -0
  153. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/heap-inl.h +56 -14
  154. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/heap-profiler.cc +85 -1
  155. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/heap-profiler.h +45 -1
  156. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/heap.cc +994 -396
  157. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/heap.h +220 -65
  158. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/assembler-ia32-inl.h +41 -12
  159. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/assembler-ia32.cc +94 -24
  160. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/assembler-ia32.h +32 -4
  161. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/builtins-ia32.cc +42 -30
  162. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/codegen-ia32-inl.h +0 -0
  163. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/codegen-ia32.cc +1758 -916
  164. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/codegen-ia32.h +67 -74
  165. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/cpu-ia32.cc +4 -0
  166. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/debug-ia32.cc +46 -0
  167. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/disasm-ia32.cc +37 -6
  168. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/fast-codegen-ia32.cc +4 -0
  169. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/fast-codegen-ia32.h +0 -0
  170. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/frames-ia32.cc +4 -0
  171. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/frames-ia32.h +0 -0
  172. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/full-codegen-ia32.cc +1465 -198
  173. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/ic-ia32.cc +688 -367
  174. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/jump-target-ia32.cc +4 -0
  175. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/macro-assembler-ia32.cc +82 -180
  176. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/macro-assembler-ia32.h +41 -25
  177. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/regexp-macro-assembler-ia32.cc +68 -24
  178. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/regexp-macro-assembler-ia32.h +1 -2
  179. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/register-allocator-ia32-inl.h +0 -0
  180. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/register-allocator-ia32.cc +4 -0
  181. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/register-allocator-ia32.h +0 -0
  182. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/simulator-ia32.cc +0 -0
  183. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/simulator-ia32.h +0 -0
  184. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/stub-cache-ia32.cc +649 -302
  185. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/virtual-frame-ia32.cc +23 -1
  186. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/virtual-frame-ia32.h +18 -27
  187. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ic-inl.h +30 -3
  188. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ic.cc +384 -66
  189. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ic.h +65 -24
  190. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/interpreter-irregexp.cc +0 -0
  191. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/interpreter-irregexp.h +0 -0
  192. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/json.js +3 -3
  193. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/jsregexp.cc +20 -4
  194. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/jsregexp.h +0 -0
  195. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/jump-target-heavy-inl.h +0 -0
  196. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/jump-target-heavy.cc +79 -13
  197. data/ext/v8/upstream/{2.1.10/src/jump-target.h → 2.3.3/src/jump-target-heavy.h} +5 -47
  198. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/jump-target-inl.h +0 -0
  199. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/jump-target-light-inl.h +16 -2
  200. data/ext/v8/upstream/2.3.3/src/jump-target-light.cc +110 -0
  201. data/ext/v8/upstream/2.3.3/src/jump-target-light.h +192 -0
  202. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/jump-target.cc +0 -64
  203. data/ext/v8/upstream/2.3.3/src/jump-target.h +90 -0
  204. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/list-inl.h +0 -0
  205. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/list.h +0 -0
  206. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/liveedit-debugger.js +141 -28
  207. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/liveedit.cc +19 -7
  208. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/liveedit.h +0 -0
  209. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/log-inl.h +0 -0
  210. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/log-utils.cc +0 -0
  211. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/log-utils.h +0 -0
  212. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/log.cc +12 -11
  213. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/log.h +12 -0
  214. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/macro-assembler.h +0 -16
  215. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/macros.py +21 -0
  216. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mark-compact.cc +120 -109
  217. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mark-compact.h +25 -37
  218. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/math.js +0 -0
  219. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/memory.h +0 -0
  220. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/messages.cc +8 -3
  221. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/messages.h +2 -1
  222. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/messages.js +15 -7
  223. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/assembler-mips-inl.h +0 -0
  224. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/assembler-mips.cc +12 -1
  225. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/assembler-mips.h +4 -1
  226. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/builtins-mips.cc +3 -0
  227. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/codegen-mips-inl.h +0 -0
  228. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/codegen-mips.cc +9 -0
  229. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/codegen-mips.h +1 -0
  230. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/constants-mips.cc +5 -0
  231. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/constants-mips.h +0 -0
  232. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/cpu-mips.cc +4 -0
  233. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/debug-mips.cc +3 -0
  234. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/disasm-mips.cc +3 -0
  235. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/fast-codegen-mips.cc +3 -0
  236. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/frames-mips.cc +3 -0
  237. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/frames-mips.h +0 -0
  238. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/full-codegen-mips.cc +5 -1
  239. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/ic-mips.cc +3 -0
  240. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/jump-target-mips.cc +3 -0
  241. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/macro-assembler-mips.cc +3 -0
  242. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/macro-assembler-mips.h +0 -0
  243. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/register-allocator-mips-inl.h +0 -0
  244. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/register-allocator-mips.cc +3 -0
  245. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/register-allocator-mips.h +0 -0
  246. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/simulator-mips.cc +3 -0
  247. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/simulator-mips.h +0 -0
  248. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/stub-cache-mips.cc +3 -0
  249. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/virtual-frame-mips.cc +3 -0
  250. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/virtual-frame-mips.h +0 -0
  251. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mirror-debugger.js +46 -4
  252. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mksnapshot.cc +0 -0
  253. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/natives.h +0 -0
  254. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/objects-debug.cc +8 -1
  255. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/objects-inl.h +235 -62
  256. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/objects.cc +497 -231
  257. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/objects.h +355 -149
  258. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/oprofile-agent.cc +0 -0
  259. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/oprofile-agent.h +0 -0
  260. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/parser.cc +31 -6
  261. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/parser.h +1 -1
  262. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-freebsd.cc +9 -6
  263. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-linux.cc +26 -6
  264. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-macos.cc +11 -6
  265. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-nullos.cc +0 -0
  266. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-openbsd.cc +6 -0
  267. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-posix.cc +0 -0
  268. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-solaris.cc +69 -23
  269. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-win32.cc +15 -11
  270. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform.h +10 -6
  271. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/powers-ten.h +0 -0
  272. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/prettyprinter.cc +0 -0
  273. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/prettyprinter.h +0 -0
  274. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/profile-generator-inl.h +26 -2
  275. data/ext/v8/upstream/2.3.3/src/profile-generator.cc +1830 -0
  276. data/ext/v8/upstream/2.3.3/src/profile-generator.h +853 -0
  277. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/property.cc +0 -0
  278. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/property.h +0 -0
  279. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
  280. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-macro-assembler-irregexp.cc +0 -0
  281. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-macro-assembler-irregexp.h +0 -0
  282. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-macro-assembler-tracer.cc +0 -0
  283. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-macro-assembler-tracer.h +0 -0
  284. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-macro-assembler.cc +1 -3
  285. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-macro-assembler.h +0 -0
  286. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-stack.cc +0 -0
  287. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-stack.h +0 -0
  288. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp.js +25 -4
  289. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/register-allocator-inl.h +0 -0
  290. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/register-allocator.cc +4 -3
  291. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/register-allocator.h +0 -0
  292. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/rewriter.cc +85 -8
  293. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/rewriter.h +0 -0
  294. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/runtime.cc +547 -221
  295. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/runtime.h +5 -1
  296. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/runtime.js +23 -31
  297. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/scanner.cc +12 -6
  298. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/scanner.h +60 -53
  299. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/scopeinfo.cc +156 -168
  300. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/scopeinfo.h +58 -62
  301. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/scopes.cc +0 -0
  302. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/scopes.h +0 -0
  303. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/serialize.cc +320 -242
  304. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/serialize.h +81 -48
  305. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/shell.h +0 -0
  306. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/simulator.h +0 -0
  307. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/smart-pointer.h +0 -0
  308. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/snapshot-common.cc +0 -0
  309. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/snapshot-empty.cc +0 -0
  310. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/snapshot.h +0 -0
  311. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/spaces-inl.h +177 -74
  312. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/spaces.cc +138 -315
  313. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/spaces.h +155 -124
  314. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/splay-tree-inl.h +0 -0
  315. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/splay-tree.h +0 -0
  316. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/string-stream.cc +0 -0
  317. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/string-stream.h +0 -0
  318. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/string.js +113 -119
  319. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/stub-cache.cc +242 -97
  320. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/stub-cache.h +118 -55
  321. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/third_party/dtoa/COPYING +0 -0
  322. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/third_party/dtoa/dtoa.c +4 -0
  323. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/third_party/valgrind/valgrind.h +0 -0
  324. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/token.cc +0 -0
  325. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/token.h +0 -0
  326. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/top.cc +107 -26
  327. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/top.h +9 -4
  328. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/type-info.cc +0 -0
  329. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/type-info.h +2 -2
  330. data/ext/v8/upstream/2.3.3/src/unbound-queue-inl.h +95 -0
  331. data/ext/v8/upstream/2.3.3/src/unbound-queue.h +67 -0
  332. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/unicode-inl.h +0 -0
  333. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/unicode.cc +0 -0
  334. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/unicode.h +0 -0
  335. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/uri.js +0 -0
  336. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/utils.cc +0 -0
  337. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/utils.h +83 -1
  338. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/v8-counters.cc +0 -0
  339. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/v8-counters.h +20 -0
  340. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/v8.cc +5 -1
  341. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/v8.h +0 -0
  342. data/ext/v8/upstream/2.3.3/src/v8dll-main.cc +39 -0
  343. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/v8natives.js +210 -33
  344. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/v8threads.cc +1 -1
  345. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/v8threads.h +1 -1
  346. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/variables.cc +0 -0
  347. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/variables.h +0 -0
  348. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/version.cc +3 -3
  349. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/version.h +0 -0
  350. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/virtual-frame-heavy-inl.h +40 -0
  351. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/virtual-frame-heavy.cc +0 -0
  352. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/virtual-frame-inl.h +0 -0
  353. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/virtual-frame-light-inl.h +106 -5
  354. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/virtual-frame-light.cc +4 -1
  355. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/virtual-frame.cc +0 -0
  356. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/virtual-frame.h +0 -0
  357. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/vm-state-inl.h +6 -3
  358. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/vm-state.cc +1 -1
  359. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/vm-state.h +6 -4
  360. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/assembler-x64-inl.h +42 -5
  361. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/assembler-x64.cc +285 -53
  362. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/assembler-x64.h +54 -18
  363. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/builtins-x64.cc +31 -33
  364. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/codegen-x64-inl.h +0 -0
  365. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/codegen-x64.cc +9787 -8722
  366. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/codegen-x64.h +82 -47
  367. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/cpu-x64.cc +4 -0
  368. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/debug-x64.cc +55 -6
  369. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/disasm-x64.cc +42 -19
  370. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/fast-codegen-x64.cc +4 -0
  371. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/frames-x64.cc +4 -0
  372. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/frames-x64.h +4 -0
  373. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/full-codegen-x64.cc +1487 -210
  374. data/ext/v8/upstream/2.3.3/src/x64/ic-x64.cc +1907 -0
  375. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/jump-target-x64.cc +4 -0
  376. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/macro-assembler-x64.cc +366 -338
  377. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/macro-assembler-x64.h +83 -38
  378. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/regexp-macro-assembler-x64.cc +82 -23
  379. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/regexp-macro-assembler-x64.h +1 -2
  380. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/register-allocator-x64-inl.h +6 -5
  381. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/register-allocator-x64.cc +4 -0
  382. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/register-allocator-x64.h +1 -1
  383. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/simulator-x64.cc +0 -0
  384. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/simulator-x64.h +0 -0
  385. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/stub-cache-x64.cc +556 -377
  386. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/virtual-frame-x64.cc +197 -98
  387. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/virtual-frame-x64.h +37 -28
  388. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/zone-inl.h +0 -0
  389. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/zone.cc +0 -0
  390. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/zone.h +0 -0
  391. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/codemap.js +0 -0
  392. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/consarray.js +0 -0
  393. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/csvparser.js +0 -0
  394. data/ext/v8/upstream/2.3.3/tools/gc-nvp-trace-processor.py +317 -0
  395. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/generate-ten-powers.scm +0 -0
  396. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/gyp/v8.gyp +87 -20
  397. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/js2c.py +19 -15
  398. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/jsmin.py +0 -0
  399. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/linux-tick-processor +0 -0
  400. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/linux-tick-processor.py +0 -0
  401. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/logreader.js +0 -0
  402. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/mac-nm +0 -0
  403. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/mac-tick-processor +0 -0
  404. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/annotate +0 -0
  405. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/common +0 -0
  406. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/dump +0 -0
  407. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/report +0 -0
  408. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/reset +0 -0
  409. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/run +0 -0
  410. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/shutdown +0 -0
  411. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/start +0 -0
  412. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/presubmit.py +0 -0
  413. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/process-heap-prof.py +0 -0
  414. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/profile.js +0 -0
  415. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/profile_view.js +0 -0
  416. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/run-valgrind.py +0 -0
  417. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/splaytree.js +0 -0
  418. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/splaytree.py +0 -0
  419. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/stats-viewer.py +25 -13
  420. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/test.py +0 -0
  421. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/tickprocessor-driver.js +0 -0
  422. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/tickprocessor.js +0 -0
  423. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/tickprocessor.py +0 -0
  424. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/utils.py +0 -0
  425. data/ext/v8/upstream/2.3.3/tools/v8.xcodeproj/project.pbxproj +1855 -0
  426. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/README.txt +0 -0
  427. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/arm.vsprops +0 -0
  428. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/common.vsprops +0 -0
  429. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/d8.vcproj +0 -0
  430. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/d8_arm.vcproj +0 -0
  431. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/d8_x64.vcproj +0 -0
  432. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/d8js2c.cmd +0 -0
  433. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/debug.vsprops +0 -0
  434. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/ia32.vsprops +0 -0
  435. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/js2c.cmd +0 -0
  436. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/release.vsprops +0 -0
  437. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8.sln +0 -0
  438. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8.vcproj +0 -0
  439. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_arm.sln +0 -0
  440. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_arm.vcproj +0 -0
  441. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_base.vcproj +40 -0
  442. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_base_arm.vcproj +20 -0
  443. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_base_x64.vcproj +16 -0
  444. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_cctest.vcproj +4 -0
  445. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
  446. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
  447. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
  448. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
  449. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_process_sample.vcproj +0 -0
  450. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
  451. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
  452. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_shell_sample.vcproj +0 -0
  453. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -0
  454. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -0
  455. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_snapshot.vcproj +0 -0
  456. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
  457. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
  458. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
  459. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_x64.sln +0 -0
  460. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_x64.vcproj +0 -0
  461. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/x64.vsprops +0 -0
  462. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/windows-tick-processor.bat +0 -0
  463. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/windows-tick-processor.py +0 -0
  464. data/ext/v8/upstream/Makefile +1 -1
  465. data/ext/v8/v8_template.cpp +94 -2
  466. data/ext/v8/v8_try_catch.cpp +2 -2
  467. data/lib/v8.rb +1 -1
  468. data/lib/v8/access.rb +93 -40
  469. data/lib/v8/cli.rb +1 -1
  470. data/lib/v8/function.rb +14 -2
  471. data/spec/redjs/jsapi_spec.rb +231 -42
  472. data/therubyracer.gemspec +3 -3
  473. metadata +463 -453
  474. data/ext/v8/upstream/2.1.10/src/arm/assembler-thumb2-inl.h +0 -263
  475. data/ext/v8/upstream/2.1.10/src/arm/assembler-thumb2.cc +0 -1878
  476. data/ext/v8/upstream/2.1.10/src/arm/assembler-thumb2.h +0 -1036
  477. data/ext/v8/upstream/2.1.10/src/arm/codegen-arm-inl.h +0 -72
  478. data/ext/v8/upstream/2.1.10/src/arm/ic-arm.cc +0 -1833
  479. data/ext/v8/upstream/2.1.10/src/circular-queue-inl.h +0 -101
  480. data/ext/v8/upstream/2.1.10/src/profile-generator.cc +0 -583
  481. data/ext/v8/upstream/2.1.10/src/profile-generator.h +0 -364
  482. data/ext/v8/upstream/2.1.10/src/x64/ic-x64.cc +0 -1621
@@ -0,0 +1,853 @@
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_H_
29
+ #define V8_PROFILE_GENERATOR_H_
30
+
31
+ #ifdef ENABLE_LOGGING_AND_PROFILING
32
+
33
+ #include "hashmap.h"
34
+ #include "../include/v8-profiler.h"
35
+
36
+ namespace v8 {
37
+ namespace internal {
38
+
39
+ class TokenEnumerator {
40
+ public:
41
+ TokenEnumerator();
42
+ ~TokenEnumerator();
43
+ int GetTokenId(Object* token);
44
+
45
+ static const int kNoSecurityToken = -1;
46
+ static const int kInheritsSecurityToken = -2;
47
+
48
+ private:
49
+ static void TokenRemovedCallback(v8::Persistent<v8::Value> handle,
50
+ void* parameter);
51
+ void TokenRemoved(Object** token_location);
52
+
53
+ List<Object**> token_locations_;
54
+ List<bool> token_removed_;
55
+
56
+ friend class TokenEnumeratorTester;
57
+
58
+ DISALLOW_COPY_AND_ASSIGN(TokenEnumerator);
59
+ };
60
+
61
+
62
+ // Provides a storage of strings allocated in C++ heap, to hold them
63
+ // forever, even if they disappear from JS heap or external storage.
64
+ class StringsStorage {
65
+ public:
66
+ StringsStorage();
67
+ ~StringsStorage();
68
+
69
+ const char* GetName(String* name);
70
+
71
+ private:
72
+ INLINE(static bool StringsMatch(void* key1, void* key2)) {
73
+ return strcmp(reinterpret_cast<char*>(key1),
74
+ reinterpret_cast<char*>(key2)) == 0;
75
+ }
76
+
77
+ // Mapping of strings by String::Hash to const char* strings.
78
+ HashMap names_;
79
+
80
+ DISALLOW_COPY_AND_ASSIGN(StringsStorage);
81
+ };
82
+
83
+
84
+ class CodeEntry {
85
+ public:
86
+ explicit INLINE(CodeEntry(int security_token_id));
87
+ // CodeEntry doesn't own name strings, just references them.
88
+ INLINE(CodeEntry(Logger::LogEventsAndTags tag,
89
+ const char* name_prefix,
90
+ const char* name,
91
+ const char* resource_name,
92
+ int line_number,
93
+ int security_token_id));
94
+
95
+ INLINE(bool is_js_function() const) { return is_js_function_tag(tag_); }
96
+ INLINE(const char* name_prefix() const) { return name_prefix_; }
97
+ INLINE(bool has_name_prefix() const) { return name_prefix_[0] != '\0'; }
98
+ INLINE(const char* name() const) { return name_; }
99
+ INLINE(const char* resource_name() const) { return resource_name_; }
100
+ INLINE(int line_number() const) { return line_number_; }
101
+ INLINE(unsigned call_uid() const) { return call_uid_; }
102
+ INLINE(int security_token_id() const) { return security_token_id_; }
103
+
104
+ INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag));
105
+
106
+ void CopyData(const CodeEntry& source);
107
+
108
+ static const char* kEmptyNamePrefix;
109
+
110
+ private:
111
+ unsigned call_uid_;
112
+ Logger::LogEventsAndTags tag_;
113
+ const char* name_prefix_;
114
+ const char* name_;
115
+ const char* resource_name_;
116
+ int line_number_;
117
+ int security_token_id_;
118
+
119
+ static unsigned next_call_uid_;
120
+
121
+ DISALLOW_COPY_AND_ASSIGN(CodeEntry);
122
+ };
123
+
124
+
125
+ class ProfileTree;
126
+
127
+ class ProfileNode {
128
+ public:
129
+ INLINE(ProfileNode(ProfileTree* tree, CodeEntry* entry));
130
+
131
+ ProfileNode* FindChild(CodeEntry* entry);
132
+ ProfileNode* FindOrAddChild(CodeEntry* entry);
133
+ INLINE(void IncrementSelfTicks()) { ++self_ticks_; }
134
+ INLINE(void IncreaseSelfTicks(unsigned amount)) { self_ticks_ += amount; }
135
+ INLINE(void IncreaseTotalTicks(unsigned amount)) { total_ticks_ += amount; }
136
+
137
+ INLINE(CodeEntry* entry() const) { return entry_; }
138
+ INLINE(unsigned self_ticks() const) { return self_ticks_; }
139
+ INLINE(unsigned total_ticks() const) { return total_ticks_; }
140
+ INLINE(const List<ProfileNode*>* children() const) { return &children_list_; }
141
+ double GetSelfMillis() const;
142
+ double GetTotalMillis() const;
143
+
144
+ void Print(int indent);
145
+
146
+ private:
147
+ INLINE(static bool CodeEntriesMatch(void* entry1, void* entry2)) {
148
+ return entry1 == entry2;
149
+ }
150
+
151
+ INLINE(static uint32_t CodeEntryHash(CodeEntry* entry)) {
152
+ return static_cast<int32_t>(reinterpret_cast<intptr_t>(entry));
153
+ }
154
+
155
+ ProfileTree* tree_;
156
+ CodeEntry* entry_;
157
+ unsigned total_ticks_;
158
+ unsigned self_ticks_;
159
+ // Mapping from CodeEntry* to ProfileNode*
160
+ HashMap children_;
161
+ List<ProfileNode*> children_list_;
162
+
163
+ DISALLOW_COPY_AND_ASSIGN(ProfileNode);
164
+ };
165
+
166
+
167
+ class ProfileTree {
168
+ public:
169
+ ProfileTree();
170
+ ~ProfileTree();
171
+
172
+ void AddPathFromEnd(const Vector<CodeEntry*>& path);
173
+ void AddPathFromStart(const Vector<CodeEntry*>& path);
174
+ void CalculateTotalTicks();
175
+ void FilteredClone(ProfileTree* src, int security_token_id);
176
+
177
+ double TicksToMillis(unsigned ticks) const {
178
+ return ticks * ms_to_ticks_scale_;
179
+ }
180
+ ProfileNode* root() const { return root_; }
181
+ void SetTickRatePerMs(double ticks_per_ms);
182
+
183
+ void ShortPrint();
184
+ void Print() {
185
+ root_->Print(0);
186
+ }
187
+
188
+ private:
189
+ template <typename Callback>
190
+ void TraverseDepthFirst(Callback* callback);
191
+
192
+ CodeEntry root_entry_;
193
+ ProfileNode* root_;
194
+ double ms_to_ticks_scale_;
195
+
196
+ DISALLOW_COPY_AND_ASSIGN(ProfileTree);
197
+ };
198
+
199
+
200
+ class CpuProfile {
201
+ public:
202
+ CpuProfile(const char* title, unsigned uid)
203
+ : title_(title), uid_(uid) { }
204
+
205
+ // Add pc -> ... -> main() call path to the profile.
206
+ void AddPath(const Vector<CodeEntry*>& path);
207
+ void CalculateTotalTicks();
208
+ void SetActualSamplingRate(double actual_sampling_rate);
209
+ CpuProfile* FilteredClone(int security_token_id);
210
+
211
+ INLINE(const char* title() const) { return title_; }
212
+ INLINE(unsigned uid() const) { return uid_; }
213
+ INLINE(const ProfileTree* top_down() const) { return &top_down_; }
214
+ INLINE(const ProfileTree* bottom_up() const) { return &bottom_up_; }
215
+
216
+ void UpdateTicksScale();
217
+
218
+ void ShortPrint();
219
+ void Print();
220
+
221
+ private:
222
+ const char* title_;
223
+ unsigned uid_;
224
+ ProfileTree top_down_;
225
+ ProfileTree bottom_up_;
226
+
227
+ DISALLOW_COPY_AND_ASSIGN(CpuProfile);
228
+ };
229
+
230
+
231
+ class CodeMap {
232
+ public:
233
+ CodeMap() { }
234
+ INLINE(void AddCode(Address addr, CodeEntry* entry, unsigned size));
235
+ INLINE(void MoveCode(Address from, Address to));
236
+ INLINE(void DeleteCode(Address addr));
237
+ void AddAlias(Address start, CodeEntry* entry, Address code_start);
238
+ CodeEntry* FindEntry(Address addr);
239
+
240
+ void Print();
241
+
242
+ private:
243
+ struct CodeEntryInfo {
244
+ CodeEntryInfo(CodeEntry* an_entry, unsigned a_size)
245
+ : entry(an_entry), size(a_size) { }
246
+ CodeEntry* entry;
247
+ unsigned size;
248
+ };
249
+
250
+ struct CodeTreeConfig {
251
+ typedef Address Key;
252
+ typedef CodeEntryInfo Value;
253
+ static const Key kNoKey;
254
+ static const Value kNoValue;
255
+ static int Compare(const Key& a, const Key& b) {
256
+ return a < b ? -1 : (a > b ? 1 : 0);
257
+ }
258
+ };
259
+ typedef SplayTree<CodeTreeConfig> CodeTree;
260
+
261
+ class CodeTreePrinter {
262
+ public:
263
+ void Call(const Address& key, const CodeEntryInfo& value);
264
+ };
265
+
266
+ CodeTree tree_;
267
+
268
+ DISALLOW_COPY_AND_ASSIGN(CodeMap);
269
+ };
270
+
271
+
272
+ class CpuProfilesCollection {
273
+ public:
274
+ CpuProfilesCollection();
275
+ ~CpuProfilesCollection();
276
+
277
+ bool StartProfiling(const char* title, unsigned uid);
278
+ bool StartProfiling(String* title, unsigned uid);
279
+ CpuProfile* StopProfiling(int security_token_id,
280
+ const char* title,
281
+ double actual_sampling_rate);
282
+ CpuProfile* StopProfiling(int security_token_id,
283
+ String* title,
284
+ double actual_sampling_rate);
285
+ List<CpuProfile*>* Profiles(int security_token_id);
286
+ const char* GetName(String* name) {
287
+ return function_and_resource_names_.GetName(name);
288
+ }
289
+ CpuProfile* GetProfile(int security_token_id, unsigned uid);
290
+ inline bool is_last_profile();
291
+
292
+ CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag,
293
+ String* name, String* resource_name, int line_number);
294
+ CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, const char* name);
295
+ CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag,
296
+ const char* name_prefix, String* name);
297
+ CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, int args_count);
298
+ CodeEntry* NewCodeEntry(int security_token_id);
299
+
300
+ // Called from profile generator thread.
301
+ void AddPathToCurrentProfiles(const Vector<CodeEntry*>& path);
302
+
303
+ private:
304
+ INLINE(const char* GetFunctionName(String* name));
305
+ INLINE(const char* GetFunctionName(const char* name));
306
+ const char* GetName(int args_count);
307
+ List<CpuProfile*>* GetProfilesList(int security_token_id);
308
+ int TokenToIndex(int security_token_id);
309
+
310
+ INLINE(static bool UidsMatch(void* key1, void* key2)) {
311
+ return key1 == key2;
312
+ }
313
+
314
+ StringsStorage function_and_resource_names_;
315
+ // Mapping from args_count (int) to char* strings.
316
+ List<char*> args_count_names_;
317
+ List<CodeEntry*> code_entries_;
318
+ List<List<CpuProfile*>* > profiles_by_token_;
319
+ // Mapping from profiles' uids to indexes in the second nested list
320
+ // of profiles_by_token_.
321
+ HashMap profiles_uids_;
322
+
323
+ // Accessed by VM thread and profile generator thread.
324
+ List<CpuProfile*> current_profiles_;
325
+ Semaphore* current_profiles_semaphore_;
326
+
327
+ DISALLOW_COPY_AND_ASSIGN(CpuProfilesCollection);
328
+ };
329
+
330
+
331
+ class SampleRateCalculator {
332
+ public:
333
+ SampleRateCalculator()
334
+ : result_(Logger::kSamplingIntervalMs * kResultScale),
335
+ ticks_per_ms_(Logger::kSamplingIntervalMs),
336
+ measurements_count_(0),
337
+ wall_time_query_countdown_(1) {
338
+ }
339
+
340
+ double ticks_per_ms() {
341
+ return result_ / static_cast<double>(kResultScale);
342
+ }
343
+ void Tick();
344
+ void UpdateMeasurements(double current_time);
345
+
346
+ // Instead of querying current wall time each tick,
347
+ // we use this constant to control query intervals.
348
+ static const unsigned kWallTimeQueryIntervalMs = 100;
349
+
350
+ private:
351
+ // As the result needs to be accessed from a different thread, we
352
+ // use type that guarantees atomic writes to memory. There should
353
+ // be <= 1000 ticks per second, thus storing a value of a 10 ** 5
354
+ // order should provide enough precision while keeping away from a
355
+ // potential overflow.
356
+ static const int kResultScale = 100000;
357
+
358
+ AtomicWord result_;
359
+ // All other fields are accessed only from the sampler thread.
360
+ double ticks_per_ms_;
361
+ unsigned measurements_count_;
362
+ unsigned wall_time_query_countdown_;
363
+ double last_wall_time_;
364
+
365
+ DISALLOW_COPY_AND_ASSIGN(SampleRateCalculator);
366
+ };
367
+
368
+
369
+ class ProfileGenerator {
370
+ public:
371
+ explicit ProfileGenerator(CpuProfilesCollection* profiles);
372
+
373
+ INLINE(CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag,
374
+ String* name,
375
+ String* resource_name,
376
+ int line_number)) {
377
+ return profiles_->NewCodeEntry(tag, name, resource_name, line_number);
378
+ }
379
+
380
+ INLINE(CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag,
381
+ const char* name)) {
382
+ return profiles_->NewCodeEntry(tag, name);
383
+ }
384
+
385
+ INLINE(CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag,
386
+ const char* name_prefix,
387
+ String* name)) {
388
+ return profiles_->NewCodeEntry(tag, name_prefix, name);
389
+ }
390
+
391
+ INLINE(CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag,
392
+ int args_count)) {
393
+ return profiles_->NewCodeEntry(tag, args_count);
394
+ }
395
+
396
+ INLINE(CodeEntry* NewCodeEntry(int security_token_id)) {
397
+ return profiles_->NewCodeEntry(security_token_id);
398
+ }
399
+
400
+ void RecordTickSample(const TickSample& sample);
401
+
402
+ INLINE(CodeMap* code_map()) { return &code_map_; }
403
+
404
+ INLINE(void Tick()) { sample_rate_calc_.Tick(); }
405
+ INLINE(double actual_sampling_rate()) {
406
+ return sample_rate_calc_.ticks_per_ms();
407
+ }
408
+
409
+ static const char* kAnonymousFunctionName;
410
+ static const char* kProgramEntryName;
411
+ static const char* kGarbageCollectorEntryName;
412
+
413
+ private:
414
+ INLINE(CodeEntry* EntryForVMState(StateTag tag));
415
+
416
+ CpuProfilesCollection* profiles_;
417
+ CodeMap code_map_;
418
+ CodeEntry* program_entry_;
419
+ CodeEntry* gc_entry_;
420
+ SampleRateCalculator sample_rate_calc_;
421
+
422
+ DISALLOW_COPY_AND_ASSIGN(ProfileGenerator);
423
+ };
424
+
425
+
426
+ class HeapSnapshot;
427
+ class HeapEntry;
428
+
429
+
430
+ class HeapGraphEdge {
431
+ public:
432
+ enum Type {
433
+ CONTEXT_VARIABLE = v8::HeapGraphEdge::CONTEXT_VARIABLE,
434
+ ELEMENT = v8::HeapGraphEdge::ELEMENT,
435
+ PROPERTY = v8::HeapGraphEdge::PROPERTY,
436
+ INTERNAL = v8::HeapGraphEdge::INTERNAL
437
+ };
438
+
439
+ HeapGraphEdge(Type type, const char* name, HeapEntry* from, HeapEntry* to);
440
+ HeapGraphEdge(int index, HeapEntry* from, HeapEntry* to);
441
+
442
+ Type type() const { return type_; }
443
+ int index() const {
444
+ ASSERT(type_ == ELEMENT);
445
+ return index_;
446
+ }
447
+ const char* name() const {
448
+ ASSERT(type_ == CONTEXT_VARIABLE || type_ == PROPERTY || type_ == INTERNAL);
449
+ return name_;
450
+ }
451
+ HeapEntry* from() const { return from_; }
452
+ HeapEntry* to() const { return to_; }
453
+
454
+ private:
455
+ Type type_;
456
+ union {
457
+ int index_;
458
+ const char* name_;
459
+ };
460
+ HeapEntry* from_;
461
+ HeapEntry* to_;
462
+
463
+ DISALLOW_COPY_AND_ASSIGN(HeapGraphEdge);
464
+ };
465
+
466
+
467
+ class HeapGraphPath;
468
+ class CachedHeapGraphPath;
469
+
470
+ class HeapEntry {
471
+ public:
472
+ enum Type {
473
+ INTERNAL = v8::HeapGraphNode::INTERNAL,
474
+ ARRAY = v8::HeapGraphNode::ARRAY,
475
+ STRING = v8::HeapGraphNode::STRING,
476
+ OBJECT = v8::HeapGraphNode::OBJECT,
477
+ CODE = v8::HeapGraphNode::CODE,
478
+ CLOSURE = v8::HeapGraphNode::CLOSURE
479
+ };
480
+
481
+ explicit HeapEntry(HeapSnapshot* snapshot)
482
+ : snapshot_(snapshot),
483
+ visited_(false),
484
+ type_(INTERNAL),
485
+ name_(""),
486
+ id_(0),
487
+ next_auto_index_(0),
488
+ self_size_(0),
489
+ security_token_id_(TokenEnumerator::kNoSecurityToken),
490
+ children_(1),
491
+ retainers_(0),
492
+ retaining_paths_(0),
493
+ total_size_(kUnknownSize),
494
+ non_shared_total_size_(kUnknownSize),
495
+ painted_(kUnpainted) { }
496
+ HeapEntry(HeapSnapshot* snapshot,
497
+ Type type,
498
+ const char* name,
499
+ uint64_t id,
500
+ int self_size,
501
+ int security_token_id)
502
+ : snapshot_(snapshot),
503
+ visited_(false),
504
+ type_(type),
505
+ name_(name),
506
+ id_(id),
507
+ next_auto_index_(1),
508
+ self_size_(self_size),
509
+ security_token_id_(security_token_id),
510
+ children_(4),
511
+ retainers_(4),
512
+ retaining_paths_(4),
513
+ total_size_(kUnknownSize),
514
+ non_shared_total_size_(kUnknownSize),
515
+ painted_(kUnpainted) { }
516
+ ~HeapEntry();
517
+
518
+ bool visited() const { return visited_; }
519
+ Type type() const { return type_; }
520
+ const char* name() const { return name_; }
521
+ uint64_t id() const { return id_; }
522
+ int self_size() const { return self_size_; }
523
+ int security_token_id() const { return security_token_id_; }
524
+ bool painted_reachable() { return painted_ == kPaintReachable; }
525
+ bool not_painted_reachable_from_others() {
526
+ return painted_ != kPaintReachableFromOthers;
527
+ }
528
+ const List<HeapGraphEdge*>* children() const { return &children_; }
529
+ const List<HeapGraphEdge*>* retainers() const { return &retainers_; }
530
+ const List<HeapGraphPath*>* GetRetainingPaths();
531
+
532
+ template<class Visitor>
533
+ void ApplyAndPaintAllReachable(Visitor* visitor);
534
+
535
+ void ClearPaint() { painted_ = kUnpainted; }
536
+ void CutEdges();
537
+ void MarkAsVisited() { visited_ = true; }
538
+ void PaintAllReachable();
539
+ void PaintReachable() {
540
+ ASSERT(painted_ == kUnpainted);
541
+ painted_ = kPaintReachable;
542
+ }
543
+ void PaintReachableFromOthers() { painted_ = kPaintReachableFromOthers; }
544
+ void SetClosureReference(const char* name, HeapEntry* entry);
545
+ void SetElementReference(int index, HeapEntry* entry);
546
+ void SetInternalReference(const char* name, HeapEntry* entry);
547
+ void SetPropertyReference(const char* name, HeapEntry* entry);
548
+ void SetAutoIndexReference(HeapEntry* entry);
549
+ void SetUnidirAutoIndexReference(HeapEntry* entry);
550
+
551
+ int TotalSize();
552
+ int NonSharedTotalSize();
553
+
554
+ void Print(int max_depth, int indent);
555
+
556
+ private:
557
+ void AddEdge(HeapGraphEdge* edge);
558
+ int CalculateTotalSize();
559
+ int CalculateNonSharedTotalSize();
560
+ void FindRetainingPaths(HeapEntry* node, CachedHeapGraphPath* prev_path);
561
+ void RemoveChild(HeapGraphEdge* edge);
562
+ void RemoveRetainer(HeapGraphEdge* edge);
563
+
564
+ const char* TypeAsString();
565
+
566
+ HeapSnapshot* snapshot_;
567
+ bool visited_;
568
+ Type type_;
569
+ const char* name_;
570
+ uint64_t id_;
571
+ int next_auto_index_;
572
+ int self_size_;
573
+ int security_token_id_;
574
+ List<HeapGraphEdge*> children_;
575
+ List<HeapGraphEdge*> retainers_;
576
+ List<HeapGraphPath*> retaining_paths_;
577
+ int total_size_;
578
+ int non_shared_total_size_;
579
+ int painted_;
580
+
581
+ static const int kUnknownSize = -1;
582
+ static const int kUnpainted = 0;
583
+ static const int kPaintReachable = 1;
584
+ static const int kPaintReachableFromOthers = 2;
585
+
586
+ DISALLOW_IMPLICIT_CONSTRUCTORS(HeapEntry);
587
+ };
588
+
589
+
590
+ class HeapGraphPath {
591
+ public:
592
+ HeapGraphPath()
593
+ : path_(8) { }
594
+ explicit HeapGraphPath(const List<HeapGraphEdge*>& path);
595
+
596
+ void Add(HeapGraphEdge* edge) { path_.Add(edge); }
597
+ void Set(int index, HeapGraphEdge* edge) { path_[index] = edge; }
598
+ const List<HeapGraphEdge*>* path() const { return &path_; }
599
+
600
+ void Print();
601
+
602
+ private:
603
+ List<HeapGraphEdge*> path_;
604
+
605
+ DISALLOW_COPY_AND_ASSIGN(HeapGraphPath);
606
+ };
607
+
608
+
609
+ class HeapEntriesMap {
610
+ public:
611
+ HeapEntriesMap();
612
+ ~HeapEntriesMap();
613
+
614
+ void Alias(HeapObject* object, HeapEntry* entry);
615
+ void Apply(void (HeapEntry::*Func)(void));
616
+ template<class Visitor>
617
+ void Apply(Visitor* visitor);
618
+ HeapEntry* Map(HeapObject* object);
619
+ void Pair(HeapObject* object, HeapEntry* entry);
620
+
621
+ uint32_t capacity() { return entries_.capacity(); }
622
+
623
+ private:
624
+ INLINE(uint32_t Hash(HeapObject* object)) {
625
+ return static_cast<uint32_t>(reinterpret_cast<intptr_t>(object));
626
+ }
627
+ INLINE(static bool HeapObjectsMatch(void* key1, void* key2)) {
628
+ return key1 == key2;
629
+ }
630
+ INLINE(bool IsAlias(void* ptr)) {
631
+ return reinterpret_cast<intptr_t>(ptr) & kAliasTag;
632
+ }
633
+
634
+ static const intptr_t kAliasTag = 1;
635
+
636
+ HashMap entries_;
637
+
638
+ DISALLOW_COPY_AND_ASSIGN(HeapEntriesMap);
639
+ };
640
+
641
+
642
+ class HeapSnapshotsCollection;
643
+ class HeapSnapshotsDiff;
644
+
645
+ // HeapSnapshot represents a single heap snapshot. It is stored in
646
+ // HeapSnapshotsCollection, which is also a factory for
647
+ // HeapSnapshots. All HeapSnapshots share strings copied from JS heap
648
+ // to be able to return them even if they were collected.
649
+ // HeapSnapshotGenerator fills in a HeapSnapshot.
650
+ class HeapSnapshot {
651
+ public:
652
+ HeapSnapshot(HeapSnapshotsCollection* collection,
653
+ const char* title,
654
+ unsigned uid);
655
+ ~HeapSnapshot();
656
+ void ClearPaint();
657
+ void CutObjectsFromForeignSecurityContexts();
658
+ HeapEntry* GetEntry(Object* object);
659
+ void SetClosureReference(
660
+ HeapEntry* parent, String* reference_name, Object* child);
661
+ void SetElementReference(HeapEntry* parent, int index, Object* child);
662
+ void SetInternalReference(
663
+ HeapEntry* parent, const char* reference_name, Object* child);
664
+ void SetPropertyReference(
665
+ HeapEntry* parent, String* reference_name, Object* child);
666
+
667
+ INLINE(const char* title() const) { return title_; }
668
+ INLINE(unsigned uid() const) { return uid_; }
669
+ const HeapEntry* const_root() const { return &root_; }
670
+ HeapEntry* root() { return &root_; }
671
+ template<class Visitor>
672
+ void IterateEntries(Visitor* visitor) { entries_.Apply(visitor); }
673
+ List<HeapEntry*>* GetSortedEntriesList();
674
+ HeapSnapshotsDiff* CompareWith(HeapSnapshot* snapshot);
675
+
676
+ void Print(int max_depth);
677
+
678
+ private:
679
+ HeapEntry* AddEntry(HeapObject* object, HeapEntry::Type type) {
680
+ return AddEntry(object, type, "");
681
+ }
682
+ HeapEntry* AddEntry(
683
+ HeapObject* object, HeapEntry::Type type, const char* name);
684
+ void AddEntryAlias(HeapObject* object, HeapEntry* entry) {
685
+ entries_.Alias(object, entry);
686
+ }
687
+ HeapEntry* FindEntry(HeapObject* object) {
688
+ return entries_.Map(object);
689
+ }
690
+ int GetGlobalSecurityToken();
691
+ int GetObjectSecurityToken(HeapObject* obj);
692
+ static int GetObjectSize(HeapObject* obj);
693
+ static int CalculateNetworkSize(JSObject* obj);
694
+
695
+ HeapSnapshotsCollection* collection_;
696
+ const char* title_;
697
+ unsigned uid_;
698
+ HeapEntry root_;
699
+ // Mapping from HeapObject* pointers to HeapEntry* pointers.
700
+ HeapEntriesMap entries_;
701
+ // Entries sorted by id.
702
+ List<HeapEntry*>* sorted_entries_;
703
+
704
+ DISALLOW_COPY_AND_ASSIGN(HeapSnapshot);
705
+ };
706
+
707
+
708
+ class HeapObjectsMap {
709
+ public:
710
+ HeapObjectsMap();
711
+ ~HeapObjectsMap();
712
+
713
+ void SnapshotGenerationFinished();
714
+ uint64_t FindObject(Address addr);
715
+ void MoveObject(Address from, Address to);
716
+
717
+ private:
718
+ struct EntryInfo {
719
+ explicit EntryInfo(uint64_t id) : id(id), accessed(true) { }
720
+ EntryInfo(uint64_t id, bool accessed) : id(id), accessed(accessed) { }
721
+ uint64_t id;
722
+ bool accessed;
723
+ };
724
+
725
+ void AddEntry(Address addr, uint64_t id);
726
+ uint64_t FindEntry(Address addr);
727
+ void RemoveDeadEntries();
728
+
729
+ static bool AddressesMatch(void* key1, void* key2) {
730
+ return key1 == key2;
731
+ }
732
+
733
+ static uint32_t AddressHash(Address addr) {
734
+ return static_cast<int32_t>(reinterpret_cast<intptr_t>(addr));
735
+ }
736
+
737
+ bool initial_fill_mode_;
738
+ uint64_t next_id_;
739
+ HashMap entries_map_;
740
+ List<EntryInfo>* entries_;
741
+
742
+ DISALLOW_COPY_AND_ASSIGN(HeapObjectsMap);
743
+ };
744
+
745
+
746
+ class HeapSnapshotsDiff {
747
+ public:
748
+ HeapSnapshotsDiff(HeapSnapshot* snapshot1, HeapSnapshot* snapshot2)
749
+ : snapshot1_(snapshot1),
750
+ snapshot2_(snapshot2),
751
+ additions_root_(new HeapEntry(snapshot2)),
752
+ deletions_root_(new HeapEntry(snapshot1)) { }
753
+
754
+ ~HeapSnapshotsDiff() {
755
+ delete deletions_root_;
756
+ delete additions_root_;
757
+ }
758
+
759
+ void AddAddedEntry(HeapEntry* entry) {
760
+ additions_root_->SetUnidirAutoIndexReference(entry);
761
+ }
762
+
763
+ void AddDeletedEntry(HeapEntry* entry) {
764
+ deletions_root_->SetUnidirAutoIndexReference(entry);
765
+ }
766
+
767
+ const HeapEntry* additions_root() const { return additions_root_; }
768
+ const HeapEntry* deletions_root() const { return deletions_root_; }
769
+
770
+ private:
771
+ HeapSnapshot* snapshot1_;
772
+ HeapSnapshot* snapshot2_;
773
+ HeapEntry* additions_root_;
774
+ HeapEntry* deletions_root_;
775
+
776
+ DISALLOW_COPY_AND_ASSIGN(HeapSnapshotsDiff);
777
+ };
778
+
779
+
780
+ class HeapSnapshotsComparator {
781
+ public:
782
+ HeapSnapshotsComparator() { }
783
+ ~HeapSnapshotsComparator();
784
+ HeapSnapshotsDiff* Compare(HeapSnapshot* snapshot1, HeapSnapshot* snapshot2);
785
+ private:
786
+ List<HeapSnapshotsDiff*> diffs_;
787
+
788
+ DISALLOW_COPY_AND_ASSIGN(HeapSnapshotsComparator);
789
+ };
790
+
791
+
792
+ class HeapSnapshotsCollection {
793
+ public:
794
+ HeapSnapshotsCollection();
795
+ ~HeapSnapshotsCollection();
796
+
797
+ bool is_tracking_objects() { return is_tracking_objects_; }
798
+
799
+ HeapSnapshot* NewSnapshot(const char* name, unsigned uid);
800
+ void SnapshotGenerationFinished() { ids_.SnapshotGenerationFinished(); }
801
+ List<HeapSnapshot*>* snapshots() { return &snapshots_; }
802
+ HeapSnapshot* GetSnapshot(unsigned uid);
803
+
804
+ const char* GetName(String* name) { return names_.GetName(name); }
805
+
806
+ TokenEnumerator* token_enumerator() { return token_enumerator_; }
807
+
808
+ uint64_t GetObjectId(Address addr) { return ids_.FindObject(addr); }
809
+ void ObjectMoveEvent(Address from, Address to) { ids_.MoveObject(from, to); }
810
+
811
+ HeapSnapshotsDiff* CompareSnapshots(HeapSnapshot* snapshot1,
812
+ HeapSnapshot* snapshot2);
813
+
814
+ private:
815
+ INLINE(static bool HeapSnapshotsMatch(void* key1, void* key2)) {
816
+ return key1 == key2;
817
+ }
818
+
819
+ bool is_tracking_objects_; // Whether tracking object moves is needed.
820
+ List<HeapSnapshot*> snapshots_;
821
+ // Mapping from snapshots' uids to HeapSnapshot* pointers.
822
+ HashMap snapshots_uids_;
823
+ StringsStorage names_;
824
+ TokenEnumerator* token_enumerator_;
825
+ // Mapping from HeapObject addresses to objects' uids.
826
+ HeapObjectsMap ids_;
827
+ HeapSnapshotsComparator comparator_;
828
+
829
+ DISALLOW_COPY_AND_ASSIGN(HeapSnapshotsCollection);
830
+ };
831
+
832
+
833
+ class HeapSnapshotGenerator {
834
+ public:
835
+ explicit HeapSnapshotGenerator(HeapSnapshot* snapshot);
836
+ void GenerateSnapshot();
837
+
838
+ private:
839
+ void ExtractReferences(HeapObject* obj);
840
+ void ExtractClosureReferences(JSObject* js_obj, HeapEntry* entry);
841
+ void ExtractPropertyReferences(JSObject* js_obj, HeapEntry* entry);
842
+ void ExtractElementReferences(JSObject* js_obj, HeapEntry* entry);
843
+
844
+ HeapSnapshot* snapshot_;
845
+
846
+ DISALLOW_COPY_AND_ASSIGN(HeapSnapshotGenerator);
847
+ };
848
+
849
+ } } // namespace v8::internal
850
+
851
+ #endif // ENABLE_LOGGING_AND_PROFILING
852
+
853
+ #endif // V8_PROFILE_GENERATOR_H_