therubyracer 0.9.0beta2 → 0.9.0beta3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of therubyracer might be problematic. Click here for more details.

Files changed (920) hide show
  1. data/.gitmodules +3 -0
  2. data/ext/v8/upstream/Makefile +1 -2
  3. data/ext/v8/upstream/v8/.gitignore +33 -0
  4. data/ext/v8/upstream/v8/AUTHORS +42 -0
  5. data/ext/v8/upstream/v8/ChangeLog +2663 -0
  6. data/ext/v8/upstream/{3.1.8 → v8}/LICENSE +0 -0
  7. data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.strongtalk +0 -0
  8. data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.v8 +0 -0
  9. data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.valgrind +0 -0
  10. data/ext/v8/upstream/v8/SConstruct +1473 -0
  11. data/ext/v8/upstream/{3.1.8 → v8}/build/README.txt +0 -0
  12. data/ext/v8/upstream/{3.1.8 → v8}/build/all.gyp +0 -0
  13. data/ext/v8/upstream/{3.1.8 → v8}/build/armu.gypi +0 -0
  14. data/ext/v8/upstream/{3.1.8 → v8}/build/common.gypi +0 -0
  15. data/ext/v8/upstream/{3.1.8 → v8}/build/gyp_v8 +0 -0
  16. data/ext/v8/upstream/v8/include/v8-debug.h +394 -0
  17. data/ext/v8/upstream/v8/include/v8-preparser.h +116 -0
  18. data/ext/v8/upstream/v8/include/v8-profiler.h +505 -0
  19. data/ext/v8/upstream/v8/include/v8-testing.h +104 -0
  20. data/ext/v8/upstream/v8/include/v8.h +4000 -0
  21. data/ext/v8/upstream/{3.1.8 → v8}/include/v8stdint.h +0 -0
  22. data/ext/v8/upstream/v8/preparser/SConscript +38 -0
  23. data/ext/v8/upstream/v8/preparser/preparser-process.cc +169 -0
  24. data/ext/v8/upstream/v8/src/SConscript +380 -0
  25. data/ext/v8/upstream/v8/src/accessors.cc +766 -0
  26. data/ext/v8/upstream/{3.1.8 → v8}/src/accessors.h +0 -0
  27. data/ext/v8/upstream/v8/src/allocation-inl.h +49 -0
  28. data/ext/v8/upstream/v8/src/allocation.cc +122 -0
  29. data/ext/v8/upstream/v8/src/allocation.h +143 -0
  30. data/ext/v8/upstream/v8/src/api.cc +5678 -0
  31. data/ext/v8/upstream/v8/src/api.h +572 -0
  32. data/ext/v8/upstream/{3.1.8 → v8}/src/apinatives.js +0 -0
  33. data/ext/v8/upstream/v8/src/apiutils.h +73 -0
  34. data/ext/v8/upstream/v8/src/arguments.h +116 -0
  35. data/ext/v8/upstream/v8/src/arm/assembler-arm-inl.h +353 -0
  36. data/ext/v8/upstream/v8/src/arm/assembler-arm.cc +2877 -0
  37. data/ext/v8/upstream/v8/src/arm/assembler-arm.h +1382 -0
  38. data/ext/v8/upstream/v8/src/arm/builtins-arm.cc +1634 -0
  39. data/ext/v8/upstream/v8/src/arm/code-stubs-arm.cc +6917 -0
  40. data/ext/v8/upstream/v8/src/arm/code-stubs-arm.h +623 -0
  41. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/codegen-arm-inl.h +0 -0
  42. data/ext/v8/upstream/v8/src/arm/codegen-arm.cc +7437 -0
  43. data/ext/v8/upstream/v8/src/arm/codegen-arm.h +595 -0
  44. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/constants-arm.cc +0 -0
  45. data/ext/v8/upstream/v8/src/arm/constants-arm.h +778 -0
  46. data/ext/v8/upstream/v8/src/arm/cpu-arm.cc +149 -0
  47. data/ext/v8/upstream/v8/src/arm/debug-arm.cc +317 -0
  48. data/ext/v8/upstream/v8/src/arm/deoptimizer-arm.cc +737 -0
  49. data/ext/v8/upstream/v8/src/arm/disasm-arm.cc +1503 -0
  50. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/frames-arm.cc +0 -0
  51. data/ext/v8/upstream/v8/src/arm/frames-arm.h +168 -0
  52. data/ext/v8/upstream/v8/src/arm/full-codegen-arm.cc +4374 -0
  53. data/ext/v8/upstream/v8/src/arm/ic-arm.cc +1793 -0
  54. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/jump-target-arm.cc +0 -0
  55. data/ext/v8/upstream/v8/src/arm/lithium-arm.cc +2120 -0
  56. data/ext/v8/upstream/v8/src/arm/lithium-arm.h +2179 -0
  57. data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.cc +4132 -0
  58. data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.h +329 -0
  59. data/ext/v8/upstream/v8/src/arm/lithium-gap-resolver-arm.cc +305 -0
  60. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/lithium-gap-resolver-arm.h +0 -0
  61. data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.cc +2939 -0
  62. data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.h +1071 -0
  63. data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.cc +1287 -0
  64. data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.h +253 -0
  65. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm-inl.h +0 -0
  66. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm.cc +0 -0
  67. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm.h +0 -0
  68. data/ext/v8/upstream/v8/src/arm/simulator-arm.cc +3288 -0
  69. data/ext/v8/upstream/v8/src/arm/simulator-arm.h +413 -0
  70. data/ext/v8/upstream/v8/src/arm/stub-cache-arm.cc +4034 -0
  71. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/virtual-frame-arm-inl.h +0 -0
  72. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.cc +843 -0
  73. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.h +523 -0
  74. data/ext/v8/upstream/v8/src/array.js +1249 -0
  75. data/ext/v8/upstream/v8/src/assembler.cc +1067 -0
  76. data/ext/v8/upstream/v8/src/assembler.h +823 -0
  77. data/ext/v8/upstream/v8/src/ast-inl.h +112 -0
  78. data/ext/v8/upstream/v8/src/ast.cc +1078 -0
  79. data/ext/v8/upstream/v8/src/ast.h +2234 -0
  80. data/ext/v8/upstream/v8/src/atomicops.h +167 -0
  81. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_arm_gcc.h +0 -0
  82. data/ext/v8/upstream/v8/src/atomicops_internals_mips_gcc.h +169 -0
  83. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_gcc.cc +0 -0
  84. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_gcc.h +0 -0
  85. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_macosx.h +0 -0
  86. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_msvc.h +0 -0
  87. data/ext/v8/upstream/{3.1.8 → v8}/src/bignum-dtoa.cc +0 -0
  88. data/ext/v8/upstream/{3.1.8 → v8}/src/bignum-dtoa.h +0 -0
  89. data/ext/v8/upstream/{3.1.8 → v8}/src/bignum.cc +0 -0
  90. data/ext/v8/upstream/{3.1.8 → v8}/src/bignum.h +0 -0
  91. data/ext/v8/upstream/v8/src/bootstrapper.cc +2138 -0
  92. data/ext/v8/upstream/v8/src/bootstrapper.h +185 -0
  93. data/ext/v8/upstream/v8/src/builtins.cc +1708 -0
  94. data/ext/v8/upstream/v8/src/builtins.h +368 -0
  95. data/ext/v8/upstream/{3.1.8 → v8}/src/bytecodes-irregexp.h +0 -0
  96. data/ext/v8/upstream/{3.1.8 → v8}/src/cached-powers.cc +0 -0
  97. data/ext/v8/upstream/{3.1.8 → v8}/src/cached-powers.h +0 -0
  98. data/ext/v8/upstream/{3.1.8 → v8}/src/char-predicates-inl.h +0 -0
  99. data/ext/v8/upstream/{3.1.8 → v8}/src/char-predicates.h +0 -0
  100. data/ext/v8/upstream/v8/src/checks.cc +110 -0
  101. data/ext/v8/upstream/v8/src/checks.h +296 -0
  102. data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue-inl.h +0 -0
  103. data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue.cc +0 -0
  104. data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue.h +0 -0
  105. data/ext/v8/upstream/v8/src/code-stubs.cc +240 -0
  106. data/ext/v8/upstream/v8/src/code-stubs.h +971 -0
  107. data/ext/v8/upstream/{3.1.8 → v8}/src/code.h +0 -0
  108. data/ext/v8/upstream/v8/src/codegen-inl.h +68 -0
  109. data/ext/v8/upstream/v8/src/codegen.cc +505 -0
  110. data/ext/v8/upstream/v8/src/codegen.h +245 -0
  111. data/ext/v8/upstream/v8/src/compilation-cache.cc +540 -0
  112. data/ext/v8/upstream/v8/src/compilation-cache.h +287 -0
  113. data/ext/v8/upstream/v8/src/compiler.cc +792 -0
  114. data/ext/v8/upstream/v8/src/compiler.h +307 -0
  115. data/ext/v8/upstream/v8/src/contexts.cc +327 -0
  116. data/ext/v8/upstream/v8/src/contexts.h +382 -0
  117. data/ext/v8/upstream/{3.1.8 → v8}/src/conversions-inl.h +0 -0
  118. data/ext/v8/upstream/v8/src/conversions.cc +1125 -0
  119. data/ext/v8/upstream/{3.1.8 → v8}/src/conversions.h +0 -0
  120. data/ext/v8/upstream/v8/src/counters.cc +93 -0
  121. data/ext/v8/upstream/v8/src/counters.h +254 -0
  122. data/ext/v8/upstream/v8/src/cpu-profiler-inl.h +101 -0
  123. data/ext/v8/upstream/v8/src/cpu-profiler.cc +606 -0
  124. data/ext/v8/upstream/v8/src/cpu-profiler.h +305 -0
  125. data/ext/v8/upstream/v8/src/cpu.h +67 -0
  126. data/ext/v8/upstream/v8/src/d8-debug.cc +367 -0
  127. data/ext/v8/upstream/v8/src/d8-debug.h +158 -0
  128. data/ext/v8/upstream/v8/src/d8-posix.cc +695 -0
  129. data/ext/v8/upstream/{3.1.8 → v8}/src/d8-readline.cc +0 -0
  130. data/ext/v8/upstream/{3.1.8 → v8}/src/d8-windows.cc +0 -0
  131. data/ext/v8/upstream/v8/src/d8.cc +796 -0
  132. data/ext/v8/upstream/v8/src/d8.gyp +88 -0
  133. data/ext/v8/upstream/{3.1.8 → v8}/src/d8.h +0 -0
  134. data/ext/v8/upstream/{3.1.8 → v8}/src/d8.js +0 -0
  135. data/ext/v8/upstream/{3.1.8 → v8}/src/data-flow.cc +0 -0
  136. data/ext/v8/upstream/v8/src/data-flow.h +379 -0
  137. data/ext/v8/upstream/{3.1.8 → v8}/src/date.js +0 -0
  138. data/ext/v8/upstream/{3.1.8 → v8}/src/dateparser-inl.h +0 -0
  139. data/ext/v8/upstream/{3.1.8 → v8}/src/dateparser.cc +0 -0
  140. data/ext/v8/upstream/v8/src/dateparser.h +265 -0
  141. data/ext/v8/upstream/v8/src/debug-agent.cc +447 -0
  142. data/ext/v8/upstream/v8/src/debug-agent.h +129 -0
  143. data/ext/v8/upstream/{3.1.8 → v8}/src/debug-debugger.js +0 -0
  144. data/ext/v8/upstream/v8/src/debug.cc +3188 -0
  145. data/ext/v8/upstream/v8/src/debug.h +1055 -0
  146. data/ext/v8/upstream/v8/src/deoptimizer.cc +1296 -0
  147. data/ext/v8/upstream/v8/src/deoptimizer.h +629 -0
  148. data/ext/v8/upstream/v8/src/disasm.h +80 -0
  149. data/ext/v8/upstream/v8/src/disassembler.cc +339 -0
  150. data/ext/v8/upstream/{3.1.8 → v8}/src/disassembler.h +0 -0
  151. data/ext/v8/upstream/{3.1.8 → v8}/src/diy-fp.cc +0 -0
  152. data/ext/v8/upstream/{3.1.8 → v8}/src/diy-fp.h +0 -0
  153. data/ext/v8/upstream/{3.1.8 → v8}/src/double.h +0 -0
  154. data/ext/v8/upstream/{3.1.8 → v8}/src/dtoa.cc +0 -0
  155. data/ext/v8/upstream/{3.1.8 → v8}/src/dtoa.h +0 -0
  156. data/ext/v8/upstream/v8/src/execution.cc +791 -0
  157. data/ext/v8/upstream/v8/src/execution.h +291 -0
  158. data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.cc +250 -0
  159. data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.h +89 -0
  160. data/ext/v8/upstream/v8/src/extensions/experimental/experimental.gyp +55 -0
  161. data/ext/v8/upstream/v8/src/extensions/experimental/i18n-extension.cc +284 -0
  162. data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/experimental/i18n-extension.h +0 -0
  163. data/ext/v8/upstream/v8/src/extensions/externalize-string-extension.cc +141 -0
  164. data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/externalize-string-extension.h +0 -0
  165. data/ext/v8/upstream/v8/src/extensions/gc-extension.cc +58 -0
  166. data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/gc-extension.h +0 -0
  167. data/ext/v8/upstream/v8/src/factory.cc +1194 -0
  168. data/ext/v8/upstream/v8/src/factory.h +436 -0
  169. data/ext/v8/upstream/{3.1.8 → v8}/src/fast-dtoa.cc +0 -0
  170. data/ext/v8/upstream/{3.1.8 → v8}/src/fast-dtoa.h +0 -0
  171. data/ext/v8/upstream/{3.1.8 → v8}/src/fixed-dtoa.cc +0 -0
  172. data/ext/v8/upstream/{3.1.8 → v8}/src/fixed-dtoa.h +0 -0
  173. data/ext/v8/upstream/v8/src/flag-definitions.h +556 -0
  174. data/ext/v8/upstream/{3.1.8 → v8}/src/flags.cc +0 -0
  175. data/ext/v8/upstream/{3.1.8 → v8}/src/flags.h +0 -0
  176. data/ext/v8/upstream/v8/src/frame-element.cc +37 -0
  177. data/ext/v8/upstream/v8/src/frame-element.h +269 -0
  178. data/ext/v8/upstream/v8/src/frames-inl.h +236 -0
  179. data/ext/v8/upstream/v8/src/frames.cc +1273 -0
  180. data/ext/v8/upstream/v8/src/frames.h +854 -0
  181. data/ext/v8/upstream/v8/src/full-codegen.cc +1385 -0
  182. data/ext/v8/upstream/v8/src/full-codegen.h +753 -0
  183. data/ext/v8/upstream/v8/src/func-name-inferrer.cc +91 -0
  184. data/ext/v8/upstream/v8/src/func-name-inferrer.h +111 -0
  185. data/ext/v8/upstream/v8/src/gdb-jit.cc +1548 -0
  186. data/ext/v8/upstream/{3.1.8 → v8}/src/gdb-jit.h +0 -0
  187. data/ext/v8/upstream/v8/src/global-handles.cc +596 -0
  188. data/ext/v8/upstream/v8/src/global-handles.h +239 -0
  189. data/ext/v8/upstream/v8/src/globals.h +325 -0
  190. data/ext/v8/upstream/v8/src/handles-inl.h +177 -0
  191. data/ext/v8/upstream/v8/src/handles.cc +965 -0
  192. data/ext/v8/upstream/v8/src/handles.h +372 -0
  193. data/ext/v8/upstream/{3.1.8 → v8}/src/hashmap.cc +0 -0
  194. data/ext/v8/upstream/v8/src/hashmap.h +121 -0
  195. data/ext/v8/upstream/v8/src/heap-inl.h +703 -0
  196. data/ext/v8/upstream/v8/src/heap-profiler.cc +1173 -0
  197. data/ext/v8/upstream/v8/src/heap-profiler.h +396 -0
  198. data/ext/v8/upstream/v8/src/heap.cc +5856 -0
  199. data/ext/v8/upstream/v8/src/heap.h +2264 -0
  200. data/ext/v8/upstream/v8/src/hydrogen-instructions.cc +1639 -0
  201. data/ext/v8/upstream/v8/src/hydrogen-instructions.h +3657 -0
  202. data/ext/v8/upstream/v8/src/hydrogen.cc +6011 -0
  203. data/ext/v8/upstream/v8/src/hydrogen.h +1137 -0
  204. data/ext/v8/upstream/v8/src/ia32/assembler-ia32-inl.h +430 -0
  205. data/ext/v8/upstream/v8/src/ia32/assembler-ia32.cc +2846 -0
  206. data/ext/v8/upstream/v8/src/ia32/assembler-ia32.h +1159 -0
  207. data/ext/v8/upstream/v8/src/ia32/builtins-ia32.cc +1596 -0
  208. data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.cc +6549 -0
  209. data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.h +495 -0
  210. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/codegen-ia32-inl.h +0 -0
  211. data/ext/v8/upstream/v8/src/ia32/codegen-ia32.cc +10385 -0
  212. data/ext/v8/upstream/v8/src/ia32/codegen-ia32.h +801 -0
  213. data/ext/v8/upstream/v8/src/ia32/cpu-ia32.cc +88 -0
  214. data/ext/v8/upstream/v8/src/ia32/debug-ia32.cc +312 -0
  215. data/ext/v8/upstream/v8/src/ia32/deoptimizer-ia32.cc +774 -0
  216. data/ext/v8/upstream/v8/src/ia32/disasm-ia32.cc +1620 -0
  217. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/frames-ia32.cc +0 -0
  218. data/ext/v8/upstream/v8/src/ia32/frames-ia32.h +140 -0
  219. data/ext/v8/upstream/v8/src/ia32/full-codegen-ia32.cc +4357 -0
  220. data/ext/v8/upstream/v8/src/ia32/ic-ia32.cc +1779 -0
  221. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/jump-target-ia32.cc +0 -0
  222. data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.cc +4158 -0
  223. data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.h +318 -0
  224. data/ext/v8/upstream/v8/src/ia32/lithium-gap-resolver-ia32.cc +466 -0
  225. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/lithium-gap-resolver-ia32.h +0 -0
  226. data/ext/v8/upstream/v8/src/ia32/lithium-ia32.cc +2181 -0
  227. data/ext/v8/upstream/v8/src/ia32/lithium-ia32.h +2235 -0
  228. data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.cc +2056 -0
  229. data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.h +807 -0
  230. data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.cc +1264 -0
  231. data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.h +216 -0
  232. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/register-allocator-ia32-inl.h +0 -0
  233. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32.cc +157 -0
  234. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/register-allocator-ia32.h +0 -0
  235. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/simulator-ia32.cc +0 -0
  236. data/ext/v8/upstream/v8/src/ia32/simulator-ia32.h +72 -0
  237. data/ext/v8/upstream/v8/src/ia32/stub-cache-ia32.cc +3711 -0
  238. data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.cc +1366 -0
  239. data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.h +650 -0
  240. data/ext/v8/upstream/v8/src/ic-inl.h +130 -0
  241. data/ext/v8/upstream/v8/src/ic.cc +2389 -0
  242. data/ext/v8/upstream/v8/src/ic.h +675 -0
  243. data/ext/v8/upstream/{3.1.8 → v8}/src/inspector.cc +0 -0
  244. data/ext/v8/upstream/{3.1.8 → v8}/src/inspector.h +0 -0
  245. data/ext/v8/upstream/v8/src/interpreter-irregexp.cc +659 -0
  246. data/ext/v8/upstream/v8/src/interpreter-irregexp.h +49 -0
  247. data/ext/v8/upstream/v8/src/isolate.cc +883 -0
  248. data/ext/v8/upstream/v8/src/isolate.h +1306 -0
  249. data/ext/v8/upstream/v8/src/json.js +342 -0
  250. data/ext/v8/upstream/v8/src/jsregexp.cc +5371 -0
  251. data/ext/v8/upstream/v8/src/jsregexp.h +1483 -0
  252. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-heavy-inl.h +0 -0
  253. data/ext/v8/upstream/v8/src/jump-target-heavy.cc +427 -0
  254. data/ext/v8/upstream/v8/src/jump-target-heavy.h +238 -0
  255. data/ext/v8/upstream/v8/src/jump-target-inl.h +48 -0
  256. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-light-inl.h +0 -0
  257. data/ext/v8/upstream/v8/src/jump-target-light.cc +111 -0
  258. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-light.h +0 -0
  259. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target.cc +0 -0
  260. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target.h +0 -0
  261. data/ext/v8/upstream/{3.1.8 → v8}/src/list-inl.h +0 -0
  262. data/ext/v8/upstream/{3.1.8 → v8}/src/list.h +0 -0
  263. data/ext/v8/upstream/v8/src/lithium-allocator-inl.h +142 -0
  264. data/ext/v8/upstream/v8/src/lithium-allocator.cc +2105 -0
  265. data/ext/v8/upstream/v8/src/lithium-allocator.h +630 -0
  266. data/ext/v8/upstream/v8/src/lithium.cc +169 -0
  267. data/ext/v8/upstream/{3.1.8 → v8}/src/lithium.h +0 -0
  268. data/ext/v8/upstream/{3.1.8 → v8}/src/liveedit-debugger.js +0 -0
  269. data/ext/v8/upstream/v8/src/liveedit.cc +1693 -0
  270. data/ext/v8/upstream/v8/src/liveedit.h +179 -0
  271. data/ext/v8/upstream/{3.1.8 → v8}/src/liveobjectlist-inl.h +0 -0
  272. data/ext/v8/upstream/v8/src/liveobjectlist.cc +2589 -0
  273. data/ext/v8/upstream/v8/src/liveobjectlist.h +322 -0
  274. data/ext/v8/upstream/{3.1.8 → v8}/src/log-inl.h +0 -0
  275. data/ext/v8/upstream/v8/src/log-utils.cc +423 -0
  276. data/ext/v8/upstream/v8/src/log-utils.h +229 -0
  277. data/ext/v8/upstream/v8/src/log.cc +1666 -0
  278. data/ext/v8/upstream/v8/src/log.h +446 -0
  279. data/ext/v8/upstream/{3.1.8 → v8}/src/macro-assembler.h +0 -0
  280. data/ext/v8/upstream/{3.1.8 → v8}/src/macros.py +0 -0
  281. data/ext/v8/upstream/v8/src/mark-compact.cc +3092 -0
  282. data/ext/v8/upstream/v8/src/mark-compact.h +506 -0
  283. data/ext/v8/upstream/{3.1.8 → v8}/src/math.js +0 -0
  284. data/ext/v8/upstream/v8/src/messages.cc +166 -0
  285. data/ext/v8/upstream/{3.1.8 → v8}/src/messages.h +0 -0
  286. data/ext/v8/upstream/v8/src/messages.js +1090 -0
  287. data/ext/v8/upstream/v8/src/mips/assembler-mips-inl.h +335 -0
  288. data/ext/v8/upstream/v8/src/mips/assembler-mips.cc +2093 -0
  289. data/ext/v8/upstream/v8/src/mips/assembler-mips.h +1066 -0
  290. data/ext/v8/upstream/v8/src/mips/builtins-mips.cc +148 -0
  291. data/ext/v8/upstream/v8/src/mips/code-stubs-mips.cc +752 -0
  292. data/ext/v8/upstream/v8/src/mips/code-stubs-mips.h +511 -0
  293. data/ext/v8/upstream/v8/src/mips/codegen-mips-inl.h +64 -0
  294. data/ext/v8/upstream/v8/src/mips/codegen-mips.cc +1213 -0
  295. data/ext/v8/upstream/v8/src/mips/codegen-mips.h +633 -0
  296. data/ext/v8/upstream/v8/src/mips/constants-mips.cc +352 -0
  297. data/ext/v8/upstream/v8/src/mips/constants-mips.h +723 -0
  298. data/ext/v8/upstream/v8/src/mips/cpu-mips.cc +90 -0
  299. data/ext/v8/upstream/v8/src/mips/debug-mips.cc +155 -0
  300. data/ext/v8/upstream/v8/src/mips/deoptimizer-mips.cc +91 -0
  301. data/ext/v8/upstream/v8/src/mips/disasm-mips.cc +1023 -0
  302. data/ext/v8/upstream/v8/src/mips/frames-mips.cc +48 -0
  303. data/ext/v8/upstream/v8/src/mips/frames-mips.h +179 -0
  304. data/ext/v8/upstream/v8/src/mips/full-codegen-mips.cc +727 -0
  305. data/ext/v8/upstream/v8/src/mips/ic-mips.cc +244 -0
  306. data/ext/v8/upstream/v8/src/mips/jump-target-mips.cc +80 -0
  307. data/ext/v8/upstream/v8/src/mips/lithium-codegen-mips.h +65 -0
  308. data/ext/v8/upstream/v8/src/mips/lithium-mips.h +304 -0
  309. data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.cc +3327 -0
  310. data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.h +1058 -0
  311. data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.cc +478 -0
  312. data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.h +250 -0
  313. data/ext/v8/upstream/v8/src/mips/register-allocator-mips-inl.h +134 -0
  314. data/ext/v8/upstream/{3.1.8 → v8}/src/mips/register-allocator-mips.cc +0 -0
  315. data/ext/v8/upstream/v8/src/mips/register-allocator-mips.h +47 -0
  316. data/ext/v8/upstream/v8/src/mips/simulator-mips.cc +2438 -0
  317. data/ext/v8/upstream/v8/src/mips/simulator-mips.h +394 -0
  318. data/ext/v8/upstream/v8/src/mips/stub-cache-mips.cc +601 -0
  319. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips-inl.h +58 -0
  320. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.cc +307 -0
  321. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.h +530 -0
  322. data/ext/v8/upstream/v8/src/mirror-debugger.js +2381 -0
  323. data/ext/v8/upstream/v8/src/mksnapshot.cc +256 -0
  324. data/ext/v8/upstream/{3.1.8 → v8}/src/natives.h +0 -0
  325. data/ext/v8/upstream/v8/src/objects-debug.cc +722 -0
  326. data/ext/v8/upstream/v8/src/objects-inl.h +4166 -0
  327. data/ext/v8/upstream/v8/src/objects-printer.cc +801 -0
  328. data/ext/v8/upstream/v8/src/objects-visiting.cc +142 -0
  329. data/ext/v8/upstream/v8/src/objects-visiting.h +422 -0
  330. data/ext/v8/upstream/v8/src/objects.cc +10296 -0
  331. data/ext/v8/upstream/v8/src/objects.h +6662 -0
  332. data/ext/v8/upstream/v8/src/parser.cc +5168 -0
  333. data/ext/v8/upstream/v8/src/parser.h +823 -0
  334. data/ext/v8/upstream/v8/src/platform-cygwin.cc +811 -0
  335. data/ext/v8/upstream/v8/src/platform-freebsd.cc +854 -0
  336. data/ext/v8/upstream/v8/src/platform-linux.cc +1120 -0
  337. data/ext/v8/upstream/v8/src/platform-macos.cc +865 -0
  338. data/ext/v8/upstream/v8/src/platform-nullos.cc +504 -0
  339. data/ext/v8/upstream/v8/src/platform-openbsd.cc +672 -0
  340. data/ext/v8/upstream/v8/src/platform-posix.cc +424 -0
  341. data/ext/v8/upstream/v8/src/platform-solaris.cc +796 -0
  342. data/ext/v8/upstream/v8/src/platform-tls-mac.h +62 -0
  343. data/ext/v8/upstream/v8/src/platform-tls-win32.h +62 -0
  344. data/ext/v8/upstream/v8/src/platform-tls.h +50 -0
  345. data/ext/v8/upstream/v8/src/platform-win32.cc +2072 -0
  346. data/ext/v8/upstream/v8/src/platform.h +693 -0
  347. data/ext/v8/upstream/v8/src/preparse-data.cc +185 -0
  348. data/ext/v8/upstream/{3.1.8 → v8}/src/preparse-data.h +0 -0
  349. data/ext/v8/upstream/v8/src/preparser-api.cc +219 -0
  350. data/ext/v8/upstream/v8/src/preparser.cc +1205 -0
  351. data/ext/v8/upstream/{3.1.8 → v8}/src/preparser.h +0 -0
  352. data/ext/v8/upstream/v8/src/prettyprinter.cc +1530 -0
  353. data/ext/v8/upstream/v8/src/prettyprinter.h +223 -0
  354. data/ext/v8/upstream/{3.1.8 → v8}/src/profile-generator-inl.h +0 -0
  355. data/ext/v8/upstream/v8/src/profile-generator.cc +3095 -0
  356. data/ext/v8/upstream/v8/src/profile-generator.h +1125 -0
  357. data/ext/v8/upstream/v8/src/property.cc +102 -0
  358. data/ext/v8/upstream/v8/src/property.h +348 -0
  359. data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
  360. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp.cc +470 -0
  361. data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-irregexp.h +0 -0
  362. data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-tracer.cc +0 -0
  363. data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-tracer.h +0 -0
  364. data/ext/v8/upstream/v8/src/regexp-macro-assembler.cc +266 -0
  365. data/ext/v8/upstream/v8/src/regexp-macro-assembler.h +236 -0
  366. data/ext/v8/upstream/v8/src/regexp-stack.cc +111 -0
  367. data/ext/v8/upstream/v8/src/regexp-stack.h +147 -0
  368. data/ext/v8/upstream/v8/src/regexp.js +483 -0
  369. data/ext/v8/upstream/v8/src/register-allocator-inl.h +141 -0
  370. data/ext/v8/upstream/v8/src/register-allocator.cc +98 -0
  371. data/ext/v8/upstream/v8/src/register-allocator.h +310 -0
  372. data/ext/v8/upstream/v8/src/rewriter.cc +1024 -0
  373. data/ext/v8/upstream/{3.1.8 → v8}/src/rewriter.h +0 -0
  374. data/ext/v8/upstream/v8/src/runtime-profiler.cc +478 -0
  375. data/ext/v8/upstream/v8/src/runtime-profiler.h +192 -0
  376. data/ext/v8/upstream/v8/src/runtime.cc +11949 -0
  377. data/ext/v8/upstream/v8/src/runtime.h +643 -0
  378. data/ext/v8/upstream/{3.1.8 → v8}/src/runtime.js +0 -0
  379. data/ext/v8/upstream/v8/src/safepoint-table.cc +256 -0
  380. data/ext/v8/upstream/v8/src/safepoint-table.h +269 -0
  381. data/ext/v8/upstream/v8/src/scanner-base.cc +964 -0
  382. data/ext/v8/upstream/v8/src/scanner-base.h +664 -0
  383. data/ext/v8/upstream/v8/src/scanner.cc +584 -0
  384. data/ext/v8/upstream/v8/src/scanner.h +196 -0
  385. data/ext/v8/upstream/v8/src/scopeinfo.cc +631 -0
  386. data/ext/v8/upstream/v8/src/scopeinfo.h +249 -0
  387. data/ext/v8/upstream/v8/src/scopes.cc +1093 -0
  388. data/ext/v8/upstream/v8/src/scopes.h +508 -0
  389. data/ext/v8/upstream/v8/src/serialize.cc +1574 -0
  390. data/ext/v8/upstream/v8/src/serialize.h +589 -0
  391. data/ext/v8/upstream/{3.1.8 → v8}/src/shell.h +0 -0
  392. data/ext/v8/upstream/{3.1.8 → v8}/src/simulator.h +0 -0
  393. data/ext/v8/upstream/v8/src/small-pointer-list.h +163 -0
  394. data/ext/v8/upstream/{3.1.8 → v8}/src/smart-pointer.h +0 -0
  395. data/ext/v8/upstream/v8/src/snapshot-common.cc +82 -0
  396. data/ext/v8/upstream/{3.1.8 → v8}/src/snapshot-empty.cc +0 -0
  397. data/ext/v8/upstream/v8/src/snapshot.h +73 -0
  398. data/ext/v8/upstream/v8/src/spaces-inl.h +529 -0
  399. data/ext/v8/upstream/v8/src/spaces.cc +3147 -0
  400. data/ext/v8/upstream/v8/src/spaces.h +2368 -0
  401. data/ext/v8/upstream/{3.1.8 → v8}/src/splay-tree-inl.h +0 -0
  402. data/ext/v8/upstream/{3.1.8 → v8}/src/splay-tree.h +0 -0
  403. data/ext/v8/upstream/v8/src/string-search.cc +41 -0
  404. data/ext/v8/upstream/v8/src/string-search.h +568 -0
  405. data/ext/v8/upstream/v8/src/string-stream.cc +592 -0
  406. data/ext/v8/upstream/{3.1.8 → v8}/src/string-stream.h +0 -0
  407. data/ext/v8/upstream/v8/src/string.js +915 -0
  408. data/ext/v8/upstream/{3.1.8 → v8}/src/strtod.cc +0 -0
  409. data/ext/v8/upstream/{3.1.8 → v8}/src/strtod.h +0 -0
  410. data/ext/v8/upstream/v8/src/stub-cache.cc +1940 -0
  411. data/ext/v8/upstream/v8/src/stub-cache.h +866 -0
  412. data/ext/v8/upstream/{3.1.8 → v8}/src/third_party/valgrind/valgrind.h +0 -0
  413. data/ext/v8/upstream/v8/src/token.cc +63 -0
  414. data/ext/v8/upstream/v8/src/token.h +288 -0
  415. data/ext/v8/upstream/v8/src/top.cc +983 -0
  416. data/ext/v8/upstream/v8/src/type-info.cc +472 -0
  417. data/ext/v8/upstream/v8/src/type-info.h +290 -0
  418. data/ext/v8/upstream/{3.1.8 → v8}/src/unbound-queue-inl.h +0 -0
  419. data/ext/v8/upstream/{3.1.8 → v8}/src/unbound-queue.h +0 -0
  420. data/ext/v8/upstream/{3.1.8 → v8}/src/unicode-inl.h +0 -0
  421. data/ext/v8/upstream/v8/src/unicode.cc +1624 -0
  422. data/ext/v8/upstream/v8/src/unicode.h +280 -0
  423. data/ext/v8/upstream/{3.1.8 → v8}/src/uri.js +0 -0
  424. data/ext/v8/upstream/{3.1.8 → v8}/src/utils.cc +0 -0
  425. data/ext/v8/upstream/v8/src/utils.h +796 -0
  426. data/ext/v8/upstream/v8/src/v8-counters.cc +62 -0
  427. data/ext/v8/upstream/v8/src/v8-counters.h +311 -0
  428. data/ext/v8/upstream/v8/src/v8.cc +215 -0
  429. data/ext/v8/upstream/v8/src/v8.h +130 -0
  430. data/ext/v8/upstream/{3.1.8 → v8}/src/v8checks.h +0 -0
  431. data/ext/v8/upstream/{3.1.8 → v8}/src/v8dll-main.cc +0 -0
  432. data/ext/v8/upstream/v8/src/v8globals.h +486 -0
  433. data/ext/v8/upstream/{3.1.8/src/memory.h → v8/src/v8memory.h} +0 -0
  434. data/ext/v8/upstream/v8/src/v8natives.js +1293 -0
  435. data/ext/v8/upstream/{3.1.8 → v8}/src/v8preparserdll-main.cc +0 -0
  436. data/ext/v8/upstream/v8/src/v8threads.cc +453 -0
  437. data/ext/v8/upstream/v8/src/v8threads.h +164 -0
  438. data/ext/v8/upstream/v8/src/v8utils.h +317 -0
  439. data/ext/v8/upstream/{3.1.8 → v8}/src/variables.cc +0 -0
  440. data/ext/v8/upstream/v8/src/variables.h +212 -0
  441. data/ext/v8/upstream/v8/src/version.cc +116 -0
  442. data/ext/v8/upstream/v8/src/version.h +68 -0
  443. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-heavy-inl.h +0 -0
  444. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-heavy.cc +0 -0
  445. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-inl.h +0 -0
  446. data/ext/v8/upstream/v8/src/virtual-frame-light-inl.h +171 -0
  447. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-light.cc +0 -0
  448. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame.cc +0 -0
  449. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame.h +0 -0
  450. data/ext/v8/upstream/v8/src/vm-state-inl.h +138 -0
  451. data/ext/v8/upstream/v8/src/vm-state.h +70 -0
  452. data/ext/v8/upstream/v8/src/win32-headers.h +96 -0
  453. data/ext/v8/upstream/v8/src/x64/assembler-x64-inl.h +456 -0
  454. data/ext/v8/upstream/v8/src/x64/assembler-x64.cc +2954 -0
  455. data/ext/v8/upstream/v8/src/x64/assembler-x64.h +1630 -0
  456. data/ext/v8/upstream/v8/src/x64/builtins-x64.cc +1493 -0
  457. data/ext/v8/upstream/v8/src/x64/code-stubs-x64.cc +5132 -0
  458. data/ext/v8/upstream/v8/src/x64/code-stubs-x64.h +477 -0
  459. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/codegen-x64-inl.h +0 -0
  460. data/ext/v8/upstream/v8/src/x64/codegen-x64.cc +8843 -0
  461. data/ext/v8/upstream/v8/src/x64/codegen-x64.h +753 -0
  462. data/ext/v8/upstream/v8/src/x64/cpu-x64.cc +88 -0
  463. data/ext/v8/upstream/v8/src/x64/debug-x64.cc +318 -0
  464. data/ext/v8/upstream/v8/src/x64/deoptimizer-x64.cc +815 -0
  465. data/ext/v8/upstream/v8/src/x64/disasm-x64.cc +1752 -0
  466. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/frames-x64.cc +0 -0
  467. data/ext/v8/upstream/v8/src/x64/frames-x64.h +130 -0
  468. data/ext/v8/upstream/v8/src/x64/full-codegen-x64.cc +4339 -0
  469. data/ext/v8/upstream/v8/src/x64/ic-x64.cc +1752 -0
  470. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/jump-target-x64.cc +0 -0
  471. data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.cc +3970 -0
  472. data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.h +318 -0
  473. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/lithium-gap-resolver-x64.cc +0 -0
  474. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/lithium-gap-resolver-x64.h +0 -0
  475. data/ext/v8/upstream/v8/src/x64/lithium-x64.cc +2115 -0
  476. data/ext/v8/upstream/v8/src/x64/lithium-x64.h +2161 -0
  477. data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.cc +2911 -0
  478. data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.h +1984 -0
  479. data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.cc +1398 -0
  480. data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.h +282 -0
  481. data/ext/v8/upstream/v8/src/x64/register-allocator-x64-inl.h +87 -0
  482. data/ext/v8/upstream/v8/src/x64/register-allocator-x64.cc +95 -0
  483. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/register-allocator-x64.h +0 -0
  484. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/simulator-x64.cc +0 -0
  485. data/ext/v8/upstream/v8/src/x64/simulator-x64.h +71 -0
  486. data/ext/v8/upstream/v8/src/x64/stub-cache-x64.cc +3460 -0
  487. data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.cc +1296 -0
  488. data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.h +597 -0
  489. data/ext/v8/upstream/v8/src/zone-inl.h +129 -0
  490. data/ext/v8/upstream/v8/src/zone.cc +196 -0
  491. data/ext/v8/upstream/v8/src/zone.h +236 -0
  492. data/ext/v8/upstream/{3.1.8 → v8}/tools/codemap.js +0 -0
  493. data/ext/v8/upstream/{3.1.8 → v8}/tools/consarray.js +0 -0
  494. data/ext/v8/upstream/{3.1.8 → v8}/tools/csvparser.js +0 -0
  495. data/ext/v8/upstream/{3.1.8 → v8}/tools/disasm.py +0 -0
  496. data/ext/v8/upstream/v8/tools/freebsd-tick-processor +10 -0
  497. data/ext/v8/upstream/{3.1.8 → v8}/tools/gc-nvp-trace-processor.py +0 -0
  498. data/ext/v8/upstream/{3.1.8 → v8}/tools/generate-ten-powers.scm +0 -0
  499. data/ext/v8/upstream/{3.1.8 → v8}/tools/grokdump.py +0 -0
  500. data/ext/v8/upstream/v8/tools/gyp/v8.gyp +844 -0
  501. data/ext/v8/upstream/{3.1.8 → v8}/tools/js2c.py +0 -0
  502. data/ext/v8/upstream/{3.1.8 → v8}/tools/jsmin.py +0 -0
  503. data/ext/v8/upstream/v8/tools/linux-tick-processor +35 -0
  504. data/ext/v8/upstream/{3.1.8 → v8}/tools/ll_prof.py +0 -0
  505. data/ext/v8/upstream/{3.1.8 → v8}/tools/logreader.js +0 -0
  506. data/ext/v8/upstream/{3.1.8 → v8}/tools/mac-nm +0 -0
  507. data/ext/v8/upstream/{3.1.8 → v8}/tools/mac-tick-processor +0 -0
  508. data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/README +0 -0
  509. data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/SConstruct +0 -0
  510. data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/oom_dump.cc +0 -0
  511. data/ext/v8/upstream/{3.1.8 → v8}/tools/presubmit.py +0 -0
  512. data/ext/v8/upstream/{3.1.8 → v8}/tools/process-heap-prof.py +0 -0
  513. data/ext/v8/upstream/{3.1.8 → v8}/tools/profile.js +0 -0
  514. data/ext/v8/upstream/{3.1.8 → v8}/tools/profile_view.js +0 -0
  515. data/ext/v8/upstream/{3.1.8 → v8}/tools/run-valgrind.py +0 -0
  516. data/ext/v8/upstream/{3.1.8 → v8}/tools/splaytree.js +0 -0
  517. data/ext/v8/upstream/{3.1.8 → v8}/tools/stats-viewer.py +0 -0
  518. data/ext/v8/upstream/v8/tools/test.py +1490 -0
  519. data/ext/v8/upstream/{3.1.8 → v8}/tools/tickprocessor-driver.js +0 -0
  520. data/ext/v8/upstream/v8/tools/tickprocessor.js +877 -0
  521. data/ext/v8/upstream/{3.1.8 → v8}/tools/utils.py +0 -0
  522. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/README.txt +0 -0
  523. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/arm.vsprops +0 -0
  524. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/common.vsprops +0 -0
  525. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8.vcproj +0 -0
  526. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8_arm.vcproj +0 -0
  527. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8_x64.vcproj +0 -0
  528. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8js2c.cmd +0 -0
  529. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/debug.vsprops +0 -0
  530. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/ia32.vsprops +0 -0
  531. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/js2c.cmd +0 -0
  532. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/release.vsprops +0 -0
  533. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8.sln +0 -0
  534. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8.vcproj +0 -0
  535. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_arm.sln +0 -0
  536. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_arm.vcproj +0 -0
  537. data/ext/v8/upstream/v8/tools/visual_studio/v8_base.vcproj +1308 -0
  538. data/ext/v8/upstream/v8/tools/visual_studio/v8_base_arm.vcproj +1238 -0
  539. data/ext/v8/upstream/v8/tools/visual_studio/v8_base_x64.vcproj +1300 -0
  540. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest.vcproj +0 -0
  541. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
  542. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
  543. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
  544. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
  545. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample.vcproj +0 -0
  546. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
  547. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
  548. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample.vcproj +0 -0
  549. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -0
  550. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -0
  551. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot.vcproj +0 -0
  552. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
  553. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
  554. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
  555. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_x64.sln +0 -0
  556. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_x64.vcproj +0 -0
  557. data/ext/v8/upstream/v8/tools/visual_studio/x64.vsprops +18 -0
  558. data/ext/v8/upstream/{3.1.8 → v8}/tools/windows-tick-processor.bat +0 -0
  559. data/ext/v8/v8_callbacks.cpp +52 -92
  560. data/ext/v8/v8_date.cpp +2 -3
  561. data/ext/v8/v8_object.cpp +4 -0
  562. data/ext/v8/v8_template.cpp +2 -2
  563. data/ext/v8/v8_try_catch.cpp +8 -38
  564. data/lib/v8/version.rb +1 -1
  565. data/spec/ext/ext_spec_helper.rb +2 -20
  566. data/spec/ext/object_spec.rb +0 -12
  567. data/spec/ext/try_catch_spec.rb +29 -1
  568. data/spec/spec_helper.rb +1 -0
  569. data/spec/v8/portal/proxies_spec.rb +1 -84
  570. data/specmem/handle_memspec.rb +41 -0
  571. data/specmem/object_memspec.rb +16 -0
  572. data/specmem/proxies_memspec.rb +86 -0
  573. data/specmem/spec_helper.rb +24 -0
  574. data/therubyracer.gemspec +7 -2
  575. metadata +564 -541
  576. data/ext/v8/upstream/3.1.8/.gitignore +0 -31
  577. data/ext/v8/upstream/3.1.8/AUTHORS +0 -40
  578. data/ext/v8/upstream/3.1.8/ChangeLog +0 -2566
  579. data/ext/v8/upstream/3.1.8/SConstruct +0 -1192
  580. data/ext/v8/upstream/3.1.8/include/v8-debug.h +0 -384
  581. data/ext/v8/upstream/3.1.8/include/v8-preparser.h +0 -116
  582. data/ext/v8/upstream/3.1.8/include/v8-profiler.h +0 -426
  583. data/ext/v8/upstream/3.1.8/include/v8-testing.h +0 -99
  584. data/ext/v8/upstream/3.1.8/include/v8.h +0 -3846
  585. data/ext/v8/upstream/3.1.8/preparser/preparser-process.cc +0 -206
  586. data/ext/v8/upstream/3.1.8/src/SConscript +0 -356
  587. data/ext/v8/upstream/3.1.8/src/accessors.cc +0 -907
  588. data/ext/v8/upstream/3.1.8/src/allocation.cc +0 -204
  589. data/ext/v8/upstream/3.1.8/src/allocation.h +0 -176
  590. data/ext/v8/upstream/3.1.8/src/api.cc +0 -5191
  591. data/ext/v8/upstream/3.1.8/src/api.h +0 -508
  592. data/ext/v8/upstream/3.1.8/src/apiutils.h +0 -80
  593. data/ext/v8/upstream/3.1.8/src/arguments.h +0 -105
  594. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm-inl.h +0 -352
  595. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.cc +0 -2756
  596. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.h +0 -1294
  597. data/ext/v8/upstream/3.1.8/src/arm/builtins-arm.cc +0 -1628
  598. data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.cc +0 -6783
  599. data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.h +0 -657
  600. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.cc +0 -7403
  601. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.h +0 -595
  602. data/ext/v8/upstream/3.1.8/src/arm/constants-arm.h +0 -769
  603. data/ext/v8/upstream/3.1.8/src/arm/cpu-arm.cc +0 -147
  604. data/ext/v8/upstream/3.1.8/src/arm/debug-arm.cc +0 -315
  605. data/ext/v8/upstream/3.1.8/src/arm/deoptimizer-arm.cc +0 -700
  606. data/ext/v8/upstream/3.1.8/src/arm/disasm-arm.cc +0 -1439
  607. data/ext/v8/upstream/3.1.8/src/arm/frames-arm.h +0 -168
  608. data/ext/v8/upstream/3.1.8/src/arm/full-codegen-arm.cc +0 -4230
  609. data/ext/v8/upstream/3.1.8/src/arm/ic-arm.cc +0 -1799
  610. data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.cc +0 -2041
  611. data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.h +0 -2046
  612. data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.cc +0 -3822
  613. data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.h +0 -312
  614. data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.cc +0 -303
  615. data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.cc +0 -2701
  616. data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.h +0 -1015
  617. data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.cc +0 -1280
  618. data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.h +0 -252
  619. data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.cc +0 -3165
  620. data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.h +0 -402
  621. data/ext/v8/upstream/3.1.8/src/arm/stub-cache-arm.cc +0 -4077
  622. data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.cc +0 -843
  623. data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.h +0 -520
  624. data/ext/v8/upstream/3.1.8/src/array.js +0 -1231
  625. data/ext/v8/upstream/3.1.8/src/assembler.cc +0 -973
  626. data/ext/v8/upstream/3.1.8/src/assembler.h +0 -787
  627. data/ext/v8/upstream/3.1.8/src/ast-inl.h +0 -107
  628. data/ext/v8/upstream/3.1.8/src/ast.cc +0 -1067
  629. data/ext/v8/upstream/3.1.8/src/ast.h +0 -2177
  630. data/ext/v8/upstream/3.1.8/src/atomicops.h +0 -165
  631. data/ext/v8/upstream/3.1.8/src/bootstrapper.cc +0 -1888
  632. data/ext/v8/upstream/3.1.8/src/bootstrapper.h +0 -118
  633. data/ext/v8/upstream/3.1.8/src/builtins.cc +0 -1586
  634. data/ext/v8/upstream/3.1.8/src/builtins.h +0 -339
  635. data/ext/v8/upstream/3.1.8/src/checks.cc +0 -110
  636. data/ext/v8/upstream/3.1.8/src/checks.h +0 -292
  637. data/ext/v8/upstream/3.1.8/src/code-stubs.cc +0 -230
  638. data/ext/v8/upstream/3.1.8/src/code-stubs.h +0 -950
  639. data/ext/v8/upstream/3.1.8/src/codegen-inl.h +0 -64
  640. data/ext/v8/upstream/3.1.8/src/codegen.cc +0 -495
  641. data/ext/v8/upstream/3.1.8/src/codegen.h +0 -245
  642. data/ext/v8/upstream/3.1.8/src/compilation-cache.cc +0 -654
  643. data/ext/v8/upstream/3.1.8/src/compilation-cache.h +0 -112
  644. data/ext/v8/upstream/3.1.8/src/compiler.cc +0 -806
  645. data/ext/v8/upstream/3.1.8/src/compiler.h +0 -290
  646. data/ext/v8/upstream/3.1.8/src/contexts.cc +0 -320
  647. data/ext/v8/upstream/3.1.8/src/contexts.h +0 -376
  648. data/ext/v8/upstream/3.1.8/src/conversions.cc +0 -1069
  649. data/ext/v8/upstream/3.1.8/src/counters.cc +0 -78
  650. data/ext/v8/upstream/3.1.8/src/counters.h +0 -242
  651. data/ext/v8/upstream/3.1.8/src/cpu-profiler-inl.h +0 -100
  652. data/ext/v8/upstream/3.1.8/src/cpu-profiler.cc +0 -554
  653. data/ext/v8/upstream/3.1.8/src/cpu-profiler.h +0 -291
  654. data/ext/v8/upstream/3.1.8/src/cpu.h +0 -65
  655. data/ext/v8/upstream/3.1.8/src/d8-debug.cc +0 -367
  656. data/ext/v8/upstream/3.1.8/src/d8-debug.h +0 -157
  657. data/ext/v8/upstream/3.1.8/src/d8-posix.cc +0 -693
  658. data/ext/v8/upstream/3.1.8/src/d8.cc +0 -792
  659. data/ext/v8/upstream/3.1.8/src/d8.gyp +0 -85
  660. data/ext/v8/upstream/3.1.8/src/data-flow.h +0 -379
  661. data/ext/v8/upstream/3.1.8/src/dateparser.h +0 -263
  662. data/ext/v8/upstream/3.1.8/src/debug-agent.cc +0 -446
  663. data/ext/v8/upstream/3.1.8/src/debug-agent.h +0 -131
  664. data/ext/v8/upstream/3.1.8/src/debug.cc +0 -3085
  665. data/ext/v8/upstream/3.1.8/src/debug.h +0 -1025
  666. data/ext/v8/upstream/3.1.8/src/deoptimizer.cc +0 -1185
  667. data/ext/v8/upstream/3.1.8/src/deoptimizer.h +0 -529
  668. data/ext/v8/upstream/3.1.8/src/disasm.h +0 -77
  669. data/ext/v8/upstream/3.1.8/src/disassembler.cc +0 -338
  670. data/ext/v8/upstream/3.1.8/src/execution.cc +0 -735
  671. data/ext/v8/upstream/3.1.8/src/execution.h +0 -322
  672. data/ext/v8/upstream/3.1.8/src/extensions/experimental/experimental.gyp +0 -53
  673. data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.cc +0 -264
  674. data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.cc +0 -141
  675. data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.cc +0 -58
  676. data/ext/v8/upstream/3.1.8/src/factory.cc +0 -1087
  677. data/ext/v8/upstream/3.1.8/src/factory.h +0 -432
  678. data/ext/v8/upstream/3.1.8/src/flag-definitions.h +0 -552
  679. data/ext/v8/upstream/3.1.8/src/frame-element.cc +0 -42
  680. data/ext/v8/upstream/3.1.8/src/frame-element.h +0 -277
  681. data/ext/v8/upstream/3.1.8/src/frames-inl.h +0 -210
  682. data/ext/v8/upstream/3.1.8/src/frames.cc +0 -1232
  683. data/ext/v8/upstream/3.1.8/src/frames.h +0 -826
  684. data/ext/v8/upstream/3.1.8/src/full-codegen.cc +0 -1382
  685. data/ext/v8/upstream/3.1.8/src/full-codegen.h +0 -751
  686. data/ext/v8/upstream/3.1.8/src/func-name-inferrer.cc +0 -90
  687. data/ext/v8/upstream/3.1.8/src/func-name-inferrer.h +0 -111
  688. data/ext/v8/upstream/3.1.8/src/gdb-jit.cc +0 -1547
  689. data/ext/v8/upstream/3.1.8/src/global-handles.cc +0 -534
  690. data/ext/v8/upstream/3.1.8/src/global-handles.h +0 -181
  691. data/ext/v8/upstream/3.1.8/src/globals.h +0 -325
  692. data/ext/v8/upstream/3.1.8/src/handles-inl.h +0 -80
  693. data/ext/v8/upstream/3.1.8/src/handles.cc +0 -910
  694. data/ext/v8/upstream/3.1.8/src/handles.h +0 -424
  695. data/ext/v8/upstream/3.1.8/src/hashmap.h +0 -121
  696. data/ext/v8/upstream/3.1.8/src/heap-inl.h +0 -587
  697. data/ext/v8/upstream/3.1.8/src/heap-profiler.cc +0 -1128
  698. data/ext/v8/upstream/3.1.8/src/heap-profiler.h +0 -381
  699. data/ext/v8/upstream/3.1.8/src/heap.cc +0 -5610
  700. data/ext/v8/upstream/3.1.8/src/heap.h +0 -2218
  701. data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.cc +0 -1490
  702. data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.h +0 -3493
  703. data/ext/v8/upstream/3.1.8/src/hydrogen.cc +0 -6056
  704. data/ext/v8/upstream/3.1.8/src/hydrogen.h +0 -1091
  705. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32-inl.h +0 -429
  706. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.cc +0 -2800
  707. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.h +0 -1093
  708. data/ext/v8/upstream/3.1.8/src/ia32/builtins-ia32.cc +0 -1590
  709. data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.cc +0 -6624
  710. data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.h +0 -536
  711. data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.cc +0 -10354
  712. data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.h +0 -798
  713. data/ext/v8/upstream/3.1.8/src/ia32/cpu-ia32.cc +0 -87
  714. data/ext/v8/upstream/3.1.8/src/ia32/debug-ia32.cc +0 -309
  715. data/ext/v8/upstream/3.1.8/src/ia32/deoptimizer-ia32.cc +0 -664
  716. data/ext/v8/upstream/3.1.8/src/ia32/disasm-ia32.cc +0 -1597
  717. data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.h +0 -140
  718. data/ext/v8/upstream/3.1.8/src/ia32/full-codegen-ia32.cc +0 -4278
  719. data/ext/v8/upstream/3.1.8/src/ia32/ic-ia32.cc +0 -1786
  720. data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.cc +0 -3880
  721. data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.h +0 -309
  722. data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.cc +0 -460
  723. data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.cc +0 -2095
  724. data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.h +0 -2127
  725. data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.cc +0 -2031
  726. data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.h +0 -798
  727. data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.cc +0 -1253
  728. data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.h +0 -215
  729. data/ext/v8/upstream/3.1.8/src/ia32/register-allocator-ia32.cc +0 -157
  730. data/ext/v8/upstream/3.1.8/src/ia32/simulator-ia32.h +0 -72
  731. data/ext/v8/upstream/3.1.8/src/ia32/stub-cache-ia32.cc +0 -3732
  732. data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.cc +0 -1360
  733. data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.h +0 -646
  734. data/ext/v8/upstream/3.1.8/src/ic-inl.h +0 -129
  735. data/ext/v8/upstream/3.1.8/src/ic.cc +0 -2333
  736. data/ext/v8/upstream/3.1.8/src/ic.h +0 -639
  737. data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.cc +0 -655
  738. data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.h +0 -48
  739. data/ext/v8/upstream/3.1.8/src/json.js +0 -342
  740. data/ext/v8/upstream/3.1.8/src/jsregexp.cc +0 -5340
  741. data/ext/v8/upstream/3.1.8/src/jsregexp.h +0 -1484
  742. data/ext/v8/upstream/3.1.8/src/jump-target-heavy.cc +0 -430
  743. data/ext/v8/upstream/3.1.8/src/jump-target-heavy.h +0 -244
  744. data/ext/v8/upstream/3.1.8/src/jump-target-inl.h +0 -48
  745. data/ext/v8/upstream/3.1.8/src/jump-target-light.cc +0 -111
  746. data/ext/v8/upstream/3.1.8/src/lithium-allocator-inl.h +0 -140
  747. data/ext/v8/upstream/3.1.8/src/lithium-allocator.cc +0 -2093
  748. data/ext/v8/upstream/3.1.8/src/lithium-allocator.h +0 -644
  749. data/ext/v8/upstream/3.1.8/src/lithium.cc +0 -168
  750. data/ext/v8/upstream/3.1.8/src/liveedit.cc +0 -1650
  751. data/ext/v8/upstream/3.1.8/src/liveedit.h +0 -174
  752. data/ext/v8/upstream/3.1.8/src/liveobjectlist.cc +0 -2527
  753. data/ext/v8/upstream/3.1.8/src/liveobjectlist.h +0 -322
  754. data/ext/v8/upstream/3.1.8/src/log-utils.cc +0 -336
  755. data/ext/v8/upstream/3.1.8/src/log-utils.h +0 -232
  756. data/ext/v8/upstream/3.1.8/src/log.cc +0 -1608
  757. data/ext/v8/upstream/3.1.8/src/log.h +0 -379
  758. data/ext/v8/upstream/3.1.8/src/mark-compact.cc +0 -2957
  759. data/ext/v8/upstream/3.1.8/src/mark-compact.h +0 -433
  760. data/ext/v8/upstream/3.1.8/src/messages.cc +0 -164
  761. data/ext/v8/upstream/3.1.8/src/messages.js +0 -1071
  762. data/ext/v8/upstream/3.1.8/src/mips/assembler-mips-inl.h +0 -215
  763. data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.cc +0 -1219
  764. data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.h +0 -667
  765. data/ext/v8/upstream/3.1.8/src/mips/builtins-mips.cc +0 -205
  766. data/ext/v8/upstream/3.1.8/src/mips/codegen-mips-inl.h +0 -70
  767. data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.cc +0 -1437
  768. data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.h +0 -431
  769. data/ext/v8/upstream/3.1.8/src/mips/constants-mips.cc +0 -328
  770. data/ext/v8/upstream/3.1.8/src/mips/constants-mips.h +0 -525
  771. data/ext/v8/upstream/3.1.8/src/mips/cpu-mips.cc +0 -73
  772. data/ext/v8/upstream/3.1.8/src/mips/debug-mips.cc +0 -127
  773. data/ext/v8/upstream/3.1.8/src/mips/disasm-mips.cc +0 -787
  774. data/ext/v8/upstream/3.1.8/src/mips/fast-codegen-mips.cc +0 -77
  775. data/ext/v8/upstream/3.1.8/src/mips/frames-mips.cc +0 -96
  776. data/ext/v8/upstream/3.1.8/src/mips/frames-mips.h +0 -164
  777. data/ext/v8/upstream/3.1.8/src/mips/full-codegen-mips.cc +0 -277
  778. data/ext/v8/upstream/3.1.8/src/mips/ic-mips.cc +0 -208
  779. data/ext/v8/upstream/3.1.8/src/mips/jump-target-mips.cc +0 -175
  780. data/ext/v8/upstream/3.1.8/src/mips/macro-assembler-mips.cc +0 -1326
  781. data/ext/v8/upstream/3.1.8/src/mips/macro-assembler-mips.h +0 -461
  782. data/ext/v8/upstream/3.1.8/src/mips/register-allocator-mips-inl.h +0 -137
  783. data/ext/v8/upstream/3.1.8/src/mips/register-allocator-mips.h +0 -46
  784. data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.cc +0 -1650
  785. data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.h +0 -311
  786. data/ext/v8/upstream/3.1.8/src/mips/stub-cache-mips.cc +0 -418
  787. data/ext/v8/upstream/3.1.8/src/mips/virtual-frame-mips.cc +0 -319
  788. data/ext/v8/upstream/3.1.8/src/mips/virtual-frame-mips.h +0 -548
  789. data/ext/v8/upstream/3.1.8/src/mirror-debugger.js +0 -2380
  790. data/ext/v8/upstream/3.1.8/src/mksnapshot.cc +0 -256
  791. data/ext/v8/upstream/3.1.8/src/objects-debug.cc +0 -722
  792. data/ext/v8/upstream/3.1.8/src/objects-inl.h +0 -3946
  793. data/ext/v8/upstream/3.1.8/src/objects-printer.cc +0 -801
  794. data/ext/v8/upstream/3.1.8/src/objects-visiting.cc +0 -142
  795. data/ext/v8/upstream/3.1.8/src/objects-visiting.h +0 -401
  796. data/ext/v8/upstream/3.1.8/src/objects.cc +0 -10044
  797. data/ext/v8/upstream/3.1.8/src/objects.h +0 -6571
  798. data/ext/v8/upstream/3.1.8/src/parser.cc +0 -5165
  799. data/ext/v8/upstream/3.1.8/src/parser.h +0 -802
  800. data/ext/v8/upstream/3.1.8/src/platform-cygwin.cc +0 -745
  801. data/ext/v8/upstream/3.1.8/src/platform-freebsd.cc +0 -702
  802. data/ext/v8/upstream/3.1.8/src/platform-linux.cc +0 -981
  803. data/ext/v8/upstream/3.1.8/src/platform-macos.cc +0 -732
  804. data/ext/v8/upstream/3.1.8/src/platform-nullos.cc +0 -498
  805. data/ext/v8/upstream/3.1.8/src/platform-openbsd.cc +0 -657
  806. data/ext/v8/upstream/3.1.8/src/platform-posix.cc +0 -399
  807. data/ext/v8/upstream/3.1.8/src/platform-solaris.cc +0 -714
  808. data/ext/v8/upstream/3.1.8/src/platform-win32.cc +0 -1974
  809. data/ext/v8/upstream/3.1.8/src/platform.h +0 -636
  810. data/ext/v8/upstream/3.1.8/src/preparse-data.cc +0 -183
  811. data/ext/v8/upstream/3.1.8/src/preparser-api.cc +0 -213
  812. data/ext/v8/upstream/3.1.8/src/preparser.cc +0 -1205
  813. data/ext/v8/upstream/3.1.8/src/prettyprinter.cc +0 -1539
  814. data/ext/v8/upstream/3.1.8/src/prettyprinter.h +0 -223
  815. data/ext/v8/upstream/3.1.8/src/profile-generator.cc +0 -2899
  816. data/ext/v8/upstream/3.1.8/src/profile-generator.h +0 -1151
  817. data/ext/v8/upstream/3.1.8/src/property.cc +0 -96
  818. data/ext/v8/upstream/3.1.8/src/property.h +0 -337
  819. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.cc +0 -470
  820. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.cc +0 -257
  821. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.h +0 -231
  822. data/ext/v8/upstream/3.1.8/src/regexp-stack.cc +0 -103
  823. data/ext/v8/upstream/3.1.8/src/regexp-stack.h +0 -123
  824. data/ext/v8/upstream/3.1.8/src/regexp.js +0 -483
  825. data/ext/v8/upstream/3.1.8/src/register-allocator-inl.h +0 -141
  826. data/ext/v8/upstream/3.1.8/src/register-allocator.cc +0 -104
  827. data/ext/v8/upstream/3.1.8/src/register-allocator.h +0 -320
  828. data/ext/v8/upstream/3.1.8/src/rewriter.cc +0 -1023
  829. data/ext/v8/upstream/3.1.8/src/runtime-profiler.cc +0 -443
  830. data/ext/v8/upstream/3.1.8/src/runtime-profiler.h +0 -77
  831. data/ext/v8/upstream/3.1.8/src/runtime.cc +0 -11592
  832. data/ext/v8/upstream/3.1.8/src/runtime.h +0 -582
  833. data/ext/v8/upstream/3.1.8/src/safepoint-table.cc +0 -253
  834. data/ext/v8/upstream/3.1.8/src/safepoint-table.h +0 -263
  835. data/ext/v8/upstream/3.1.8/src/scanner-base.cc +0 -971
  836. data/ext/v8/upstream/3.1.8/src/scanner-base.h +0 -653
  837. data/ext/v8/upstream/3.1.8/src/scanner.cc +0 -586
  838. data/ext/v8/upstream/3.1.8/src/scanner.h +0 -194
  839. data/ext/v8/upstream/3.1.8/src/scopeinfo.cc +0 -636
  840. data/ext/v8/upstream/3.1.8/src/scopeinfo.h +0 -238
  841. data/ext/v8/upstream/3.1.8/src/scopes.cc +0 -1063
  842. data/ext/v8/upstream/3.1.8/src/scopes.h +0 -494
  843. data/ext/v8/upstream/3.1.8/src/serialize.cc +0 -1535
  844. data/ext/v8/upstream/3.1.8/src/serialize.h +0 -584
  845. data/ext/v8/upstream/3.1.8/src/snapshot-common.cc +0 -82
  846. data/ext/v8/upstream/3.1.8/src/snapshot.h +0 -71
  847. data/ext/v8/upstream/3.1.8/src/spaces-inl.h +0 -524
  848. data/ext/v8/upstream/3.1.8/src/spaces.cc +0 -3254
  849. data/ext/v8/upstream/3.1.8/src/spaces.h +0 -2362
  850. data/ext/v8/upstream/3.1.8/src/string-search.cc +0 -40
  851. data/ext/v8/upstream/3.1.8/src/string-search.h +0 -567
  852. data/ext/v8/upstream/3.1.8/src/string-stream.cc +0 -584
  853. data/ext/v8/upstream/3.1.8/src/string.js +0 -915
  854. data/ext/v8/upstream/3.1.8/src/stub-cache.cc +0 -1878
  855. data/ext/v8/upstream/3.1.8/src/stub-cache.h +0 -849
  856. data/ext/v8/upstream/3.1.8/src/token.cc +0 -63
  857. data/ext/v8/upstream/3.1.8/src/token.h +0 -288
  858. data/ext/v8/upstream/3.1.8/src/top.cc +0 -1152
  859. data/ext/v8/upstream/3.1.8/src/top.h +0 -608
  860. data/ext/v8/upstream/3.1.8/src/type-info.cc +0 -406
  861. data/ext/v8/upstream/3.1.8/src/type-info.h +0 -283
  862. data/ext/v8/upstream/3.1.8/src/unicode.cc +0 -1624
  863. data/ext/v8/upstream/3.1.8/src/unicode.h +0 -280
  864. data/ext/v8/upstream/3.1.8/src/utils.h +0 -793
  865. data/ext/v8/upstream/3.1.8/src/v8-counters.cc +0 -55
  866. data/ext/v8/upstream/3.1.8/src/v8-counters.h +0 -290
  867. data/ext/v8/upstream/3.1.8/src/v8.cc +0 -270
  868. data/ext/v8/upstream/3.1.8/src/v8.h +0 -127
  869. data/ext/v8/upstream/3.1.8/src/v8globals.h +0 -480
  870. data/ext/v8/upstream/3.1.8/src/v8natives.js +0 -1252
  871. data/ext/v8/upstream/3.1.8/src/v8threads.cc +0 -440
  872. data/ext/v8/upstream/3.1.8/src/v8threads.h +0 -157
  873. data/ext/v8/upstream/3.1.8/src/v8utils.h +0 -354
  874. data/ext/v8/upstream/3.1.8/src/variables.h +0 -212
  875. data/ext/v8/upstream/3.1.8/src/version.cc +0 -95
  876. data/ext/v8/upstream/3.1.8/src/version.h +0 -64
  877. data/ext/v8/upstream/3.1.8/src/virtual-frame-light-inl.h +0 -170
  878. data/ext/v8/upstream/3.1.8/src/vm-state-inl.h +0 -134
  879. data/ext/v8/upstream/3.1.8/src/vm-state.h +0 -68
  880. data/ext/v8/upstream/3.1.8/src/win32-headers.h +0 -95
  881. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64-inl.h +0 -455
  882. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.cc +0 -3162
  883. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.h +0 -1584
  884. data/ext/v8/upstream/3.1.8/src/x64/builtins-x64.cc +0 -1492
  885. data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.cc +0 -5150
  886. data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.h +0 -519
  887. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.cc +0 -8835
  888. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.h +0 -750
  889. data/ext/v8/upstream/3.1.8/src/x64/cpu-x64.cc +0 -86
  890. data/ext/v8/upstream/3.1.8/src/x64/debug-x64.cc +0 -316
  891. data/ext/v8/upstream/3.1.8/src/x64/deoptimizer-x64.cc +0 -781
  892. data/ext/v8/upstream/3.1.8/src/x64/disasm-x64.cc +0 -1737
  893. data/ext/v8/upstream/3.1.8/src/x64/frames-x64.h +0 -130
  894. data/ext/v8/upstream/3.1.8/src/x64/full-codegen-x64.cc +0 -3984
  895. data/ext/v8/upstream/3.1.8/src/x64/ic-x64.cc +0 -1761
  896. data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.cc +0 -3639
  897. data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.h +0 -305
  898. data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.cc +0 -2044
  899. data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.h +0 -2052
  900. data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.cc +0 -2660
  901. data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.h +0 -1852
  902. data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.cc +0 -1382
  903. data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.h +0 -278
  904. data/ext/v8/upstream/3.1.8/src/x64/register-allocator-x64-inl.h +0 -87
  905. data/ext/v8/upstream/3.1.8/src/x64/register-allocator-x64.cc +0 -91
  906. data/ext/v8/upstream/3.1.8/src/x64/simulator-x64.h +0 -71
  907. data/ext/v8/upstream/3.1.8/src/x64/stub-cache-x64.cc +0 -3509
  908. data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.cc +0 -1292
  909. data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.h +0 -593
  910. data/ext/v8/upstream/3.1.8/src/zone-inl.h +0 -83
  911. data/ext/v8/upstream/3.1.8/src/zone.cc +0 -195
  912. data/ext/v8/upstream/3.1.8/src/zone.h +0 -233
  913. data/ext/v8/upstream/3.1.8/tools/gyp/v8.gyp +0 -869
  914. data/ext/v8/upstream/3.1.8/tools/linux-tick-processor +0 -33
  915. data/ext/v8/upstream/3.1.8/tools/tickprocessor.js +0 -863
  916. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base.vcproj +0 -1296
  917. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_arm.vcproj +0 -1234
  918. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_x64.vcproj +0 -1296
  919. data/ext/v8/upstream/3.1.8/tools/visual_studio/x64.vsprops +0 -17
  920. data/spec/ext/mem_spec.rb +0 -42
@@ -0,0 +1,91 @@
1
+ // Copyright 2009 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
+ #include "v8.h"
29
+
30
+ #include "ast.h"
31
+ #include "func-name-inferrer.h"
32
+
33
+ namespace v8 {
34
+ namespace internal {
35
+
36
+
37
+ void FuncNameInferrer::PushEnclosingName(Handle<String> name) {
38
+ // Enclosing name is a name of a constructor function. To check
39
+ // that it is really a constructor, we check that it is not empty
40
+ // and starts with a capital letter.
41
+ if (name->length() > 0 && Runtime::IsUpperCaseChar(
42
+ Isolate::Current()->runtime_state(), name->Get(0))) {
43
+ names_stack_.Add(name);
44
+ }
45
+ }
46
+
47
+
48
+ void FuncNameInferrer::PushLiteralName(Handle<String> name) {
49
+ if (IsOpen() && !HEAP->prototype_symbol()->Equals(*name)) {
50
+ names_stack_.Add(name);
51
+ }
52
+ }
53
+
54
+
55
+ void FuncNameInferrer::PushVariableName(Handle<String> name) {
56
+ if (IsOpen() && !HEAP->result_symbol()->Equals(*name)) {
57
+ names_stack_.Add(name);
58
+ }
59
+ }
60
+
61
+
62
+ Handle<String> FuncNameInferrer::MakeNameFromStack() {
63
+ if (names_stack_.is_empty()) {
64
+ return FACTORY->empty_string();
65
+ } else {
66
+ return MakeNameFromStackHelper(1, names_stack_.at(0));
67
+ }
68
+ }
69
+
70
+
71
+ Handle<String> FuncNameInferrer::MakeNameFromStackHelper(int pos,
72
+ Handle<String> prev) {
73
+ if (pos >= names_stack_.length()) {
74
+ return prev;
75
+ } else {
76
+ Handle<String> curr = FACTORY->NewConsString(dot_, names_stack_.at(pos));
77
+ return MakeNameFromStackHelper(pos + 1, FACTORY->NewConsString(prev, curr));
78
+ }
79
+ }
80
+
81
+
82
+ void FuncNameInferrer::InferFunctionsNames() {
83
+ Handle<String> func_name = MakeNameFromStack();
84
+ for (int i = 0; i < funcs_to_infer_.length(); ++i) {
85
+ funcs_to_infer_[i]->set_inferred_name(func_name);
86
+ }
87
+ funcs_to_infer_.Rewind(0);
88
+ }
89
+
90
+
91
+ } } // namespace v8::internal
@@ -0,0 +1,111 @@
1
+ // Copyright 2006-2009 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_FUNC_NAME_INFERRER_H_
29
+ #define V8_FUNC_NAME_INFERRER_H_
30
+
31
+ namespace v8 {
32
+ namespace internal {
33
+
34
+ // FuncNameInferrer is a stateful class that is used to perform name
35
+ // inference for anonymous functions during static analysis of source code.
36
+ // Inference is performed in cases when an anonymous function is assigned
37
+ // to a variable or a property (see test-func-name-inference.cc for examples.)
38
+ //
39
+ // The basic idea is that during parsing of LHSs of certain expressions
40
+ // (assignments, declarations, object literals) we collect name strings,
41
+ // and during parsing of the RHS, a function literal can be collected. After
42
+ // parsing the RHS we can infer a name for function literals that do not have
43
+ // a name.
44
+ class FuncNameInferrer : public ZoneObject {
45
+ public:
46
+ FuncNameInferrer()
47
+ : entries_stack_(10),
48
+ names_stack_(5),
49
+ funcs_to_infer_(4),
50
+ dot_(FACTORY->NewStringFromAscii(CStrVector("."))) {
51
+ }
52
+
53
+ // Returns whether we have entered name collection state.
54
+ bool IsOpen() const { return !entries_stack_.is_empty(); }
55
+
56
+ // Pushes an enclosing the name of enclosing function onto names stack.
57
+ void PushEnclosingName(Handle<String> name);
58
+
59
+ // Enters name collection state.
60
+ void Enter() {
61
+ entries_stack_.Add(names_stack_.length());
62
+ }
63
+
64
+ // Pushes an encountered name onto names stack when in collection state.
65
+ void PushLiteralName(Handle<String> name);
66
+
67
+ void PushVariableName(Handle<String> name);
68
+
69
+ // Adds a function to infer name for.
70
+ void AddFunction(FunctionLiteral* func_to_infer) {
71
+ if (IsOpen()) {
72
+ funcs_to_infer_.Add(func_to_infer);
73
+ }
74
+ }
75
+
76
+ // Infers a function name and leaves names collection state.
77
+ void Infer() {
78
+ ASSERT(IsOpen());
79
+ if (!funcs_to_infer_.is_empty()) {
80
+ InferFunctionsNames();
81
+ }
82
+ }
83
+
84
+ // Infers a function name and leaves names collection state.
85
+ void Leave() {
86
+ ASSERT(IsOpen());
87
+ names_stack_.Rewind(entries_stack_.RemoveLast());
88
+ }
89
+
90
+ private:
91
+ // Constructs a full name in dotted notation from gathered names.
92
+ Handle<String> MakeNameFromStack();
93
+
94
+ // A helper function for MakeNameFromStack.
95
+ Handle<String> MakeNameFromStackHelper(int pos, Handle<String> prev);
96
+
97
+ // Performs name inferring for added functions.
98
+ void InferFunctionsNames();
99
+
100
+ ZoneList<int> entries_stack_;
101
+ ZoneList<Handle<String> > names_stack_;
102
+ ZoneList<FunctionLiteral*> funcs_to_infer_;
103
+ Handle<String> dot_;
104
+
105
+ DISALLOW_COPY_AND_ASSIGN(FuncNameInferrer);
106
+ };
107
+
108
+
109
+ } } // namespace v8::internal
110
+
111
+ #endif // V8_FUNC_NAME_INFERRER_H_
@@ -0,0 +1,1548 @@
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_GDB_JIT_INTERFACE
29
+ #include "v8.h"
30
+ #include "gdb-jit.h"
31
+
32
+ #include "bootstrapper.h"
33
+ #include "compiler.h"
34
+ #include "global-handles.h"
35
+ #include "messages.h"
36
+ #include "natives.h"
37
+
38
+ namespace v8 {
39
+ namespace internal {
40
+
41
+ class ELF;
42
+
43
+ class Writer BASE_EMBEDDED {
44
+ public:
45
+ explicit Writer(ELF* elf)
46
+ : elf_(elf),
47
+ position_(0),
48
+ capacity_(1024),
49
+ buffer_(reinterpret_cast<byte*>(malloc(capacity_))) {
50
+ }
51
+
52
+ ~Writer() {
53
+ free(buffer_);
54
+ }
55
+
56
+ uintptr_t position() const {
57
+ return position_;
58
+ }
59
+
60
+ template<typename T>
61
+ class Slot {
62
+ public:
63
+ Slot(Writer* w, uintptr_t offset) : w_(w), offset_(offset) { }
64
+
65
+ T* operator-> () {
66
+ return w_->RawSlotAt<T>(offset_);
67
+ }
68
+
69
+ void set(const T& value) {
70
+ *w_->RawSlotAt<T>(offset_) = value;
71
+ }
72
+
73
+ Slot<T> at(int i) {
74
+ return Slot<T>(w_, offset_ + sizeof(T) * i);
75
+ }
76
+
77
+ private:
78
+ Writer* w_;
79
+ uintptr_t offset_;
80
+ };
81
+
82
+ template<typename T>
83
+ void Write(const T& val) {
84
+ Ensure(position_ + sizeof(T));
85
+ *RawSlotAt<T>(position_) = val;
86
+ position_ += sizeof(T);
87
+ }
88
+
89
+ template<typename T>
90
+ Slot<T> SlotAt(uintptr_t offset) {
91
+ Ensure(offset + sizeof(T));
92
+ return Slot<T>(this, offset);
93
+ }
94
+
95
+ template<typename T>
96
+ Slot<T> CreateSlotHere() {
97
+ return CreateSlotsHere<T>(1);
98
+ }
99
+
100
+ template<typename T>
101
+ Slot<T> CreateSlotsHere(uint32_t count) {
102
+ uintptr_t slot_position = position_;
103
+ position_ += sizeof(T) * count;
104
+ Ensure(position_);
105
+ return SlotAt<T>(slot_position);
106
+ }
107
+
108
+ void Ensure(uintptr_t pos) {
109
+ if (capacity_ < pos) {
110
+ while (capacity_ < pos) capacity_ *= 2;
111
+ buffer_ = reinterpret_cast<byte*>(realloc(buffer_, capacity_));
112
+ }
113
+ }
114
+
115
+ ELF* elf() { return elf_; }
116
+
117
+ byte* buffer() { return buffer_; }
118
+
119
+ void Align(uintptr_t align) {
120
+ uintptr_t delta = position_ % align;
121
+ if (delta == 0) return;
122
+ uintptr_t padding = align - delta;
123
+ Ensure(position_ += padding);
124
+ ASSERT((position_ % align) == 0);
125
+ }
126
+
127
+ void WriteULEB128(uintptr_t value) {
128
+ do {
129
+ uint8_t byte = value & 0x7F;
130
+ value >>= 7;
131
+ if (value != 0) byte |= 0x80;
132
+ Write<uint8_t>(byte);
133
+ } while (value != 0);
134
+ }
135
+
136
+ void WriteSLEB128(intptr_t value) {
137
+ bool more = true;
138
+ while (more) {
139
+ int8_t byte = value & 0x7F;
140
+ bool byte_sign = byte & 0x40;
141
+ value >>= 7;
142
+
143
+ if ((value == 0 && !byte_sign) || (value == -1 && byte_sign)) {
144
+ more = false;
145
+ } else {
146
+ byte |= 0x80;
147
+ }
148
+
149
+ Write<int8_t>(byte);
150
+ }
151
+ }
152
+
153
+ void WriteString(const char* str) {
154
+ do {
155
+ Write<char>(*str);
156
+ } while (*str++);
157
+ }
158
+
159
+ private:
160
+ template<typename T> friend class Slot;
161
+
162
+ template<typename T>
163
+ T* RawSlotAt(uintptr_t offset) {
164
+ ASSERT(offset < capacity_ && offset + sizeof(T) <= capacity_);
165
+ return reinterpret_cast<T*>(&buffer_[offset]);
166
+ }
167
+
168
+ ELF* elf_;
169
+ uintptr_t position_;
170
+ uintptr_t capacity_;
171
+ byte* buffer_;
172
+ };
173
+
174
+ class StringTable;
175
+
176
+ class ELFSection : public ZoneObject {
177
+ public:
178
+ struct Header {
179
+ uint32_t name;
180
+ uint32_t type;
181
+ uintptr_t flags;
182
+ uintptr_t address;
183
+ uintptr_t offset;
184
+ uintptr_t size;
185
+ uint32_t link;
186
+ uint32_t info;
187
+ uintptr_t alignment;
188
+ uintptr_t entry_size;
189
+ };
190
+
191
+ enum Type {
192
+ TYPE_NULL = 0,
193
+ TYPE_PROGBITS = 1,
194
+ TYPE_SYMTAB = 2,
195
+ TYPE_STRTAB = 3,
196
+ TYPE_RELA = 4,
197
+ TYPE_HASH = 5,
198
+ TYPE_DYNAMIC = 6,
199
+ TYPE_NOTE = 7,
200
+ TYPE_NOBITS = 8,
201
+ TYPE_REL = 9,
202
+ TYPE_SHLIB = 10,
203
+ TYPE_DYNSYM = 11,
204
+ TYPE_LOPROC = 0x70000000,
205
+ TYPE_X86_64_UNWIND = 0x70000001,
206
+ TYPE_HIPROC = 0x7fffffff,
207
+ TYPE_LOUSER = 0x80000000,
208
+ TYPE_HIUSER = 0xffffffff
209
+ };
210
+
211
+ enum Flags {
212
+ FLAG_WRITE = 1,
213
+ FLAG_ALLOC = 2,
214
+ FLAG_EXEC = 4
215
+ };
216
+
217
+ enum SpecialIndexes {
218
+ INDEX_ABSOLUTE = 0xfff1
219
+ };
220
+
221
+ ELFSection(const char* name, Type type, uintptr_t align)
222
+ : name_(name), type_(type), align_(align) { }
223
+
224
+ virtual ~ELFSection() { }
225
+
226
+ void PopulateHeader(Writer::Slot<Header> header, StringTable* strtab);
227
+
228
+ virtual void WriteBody(Writer::Slot<Header> header, Writer* w) {
229
+ uintptr_t start = w->position();
230
+ if (WriteBody(w)) {
231
+ uintptr_t end = w->position();
232
+ header->offset = start;
233
+ header->size = end - start;
234
+ }
235
+ }
236
+
237
+ virtual bool WriteBody(Writer* w) {
238
+ return false;
239
+ }
240
+
241
+ uint16_t index() const { return index_; }
242
+ void set_index(uint16_t index) { index_ = index; }
243
+
244
+ protected:
245
+ virtual void PopulateHeader(Writer::Slot<Header> header) {
246
+ header->flags = 0;
247
+ header->address = 0;
248
+ header->offset = 0;
249
+ header->size = 0;
250
+ header->link = 0;
251
+ header->info = 0;
252
+ header->entry_size = 0;
253
+ }
254
+
255
+
256
+ private:
257
+ const char* name_;
258
+ Type type_;
259
+ uintptr_t align_;
260
+ uint16_t index_;
261
+ };
262
+
263
+
264
+ class FullHeaderELFSection : public ELFSection {
265
+ public:
266
+ FullHeaderELFSection(const char* name,
267
+ Type type,
268
+ uintptr_t align,
269
+ uintptr_t addr,
270
+ uintptr_t offset,
271
+ uintptr_t size,
272
+ uintptr_t flags)
273
+ : ELFSection(name, type, align),
274
+ addr_(addr),
275
+ offset_(offset),
276
+ size_(size),
277
+ flags_(flags) { }
278
+
279
+ protected:
280
+ virtual void PopulateHeader(Writer::Slot<Header> header) {
281
+ ELFSection::PopulateHeader(header);
282
+ header->address = addr_;
283
+ header->offset = offset_;
284
+ header->size = size_;
285
+ header->flags = flags_;
286
+ }
287
+
288
+ private:
289
+ uintptr_t addr_;
290
+ uintptr_t offset_;
291
+ uintptr_t size_;
292
+ uintptr_t flags_;
293
+ };
294
+
295
+
296
+ class StringTable : public ELFSection {
297
+ public:
298
+ explicit StringTable(const char* name)
299
+ : ELFSection(name, TYPE_STRTAB, 1), writer_(NULL), offset_(0), size_(0) {
300
+ }
301
+
302
+ uintptr_t Add(const char* str) {
303
+ if (*str == '\0') return 0;
304
+
305
+ uintptr_t offset = size_;
306
+ WriteString(str);
307
+ return offset;
308
+ }
309
+
310
+ void AttachWriter(Writer* w) {
311
+ writer_ = w;
312
+ offset_ = writer_->position();
313
+
314
+ // First entry in the string table should be an empty string.
315
+ WriteString("");
316
+ }
317
+
318
+ void DetachWriter() {
319
+ writer_ = NULL;
320
+ }
321
+
322
+ virtual void WriteBody(Writer::Slot<Header> header, Writer* w) {
323
+ ASSERT(writer_ == NULL);
324
+ header->offset = offset_;
325
+ header->size = size_;
326
+ }
327
+
328
+ private:
329
+ void WriteString(const char* str) {
330
+ uintptr_t written = 0;
331
+ do {
332
+ writer_->Write(*str);
333
+ written++;
334
+ } while (*str++);
335
+ size_ += written;
336
+ }
337
+
338
+ Writer* writer_;
339
+
340
+ uintptr_t offset_;
341
+ uintptr_t size_;
342
+ };
343
+
344
+
345
+ void ELFSection::PopulateHeader(Writer::Slot<ELFSection::Header> header,
346
+ StringTable* strtab) {
347
+ header->name = strtab->Add(name_);
348
+ header->type = type_;
349
+ header->alignment = align_;
350
+ PopulateHeader(header);
351
+ }
352
+
353
+
354
+ class ELF BASE_EMBEDDED {
355
+ public:
356
+ ELF() : sections_(6) {
357
+ sections_.Add(new ELFSection("", ELFSection::TYPE_NULL, 0));
358
+ sections_.Add(new StringTable(".shstrtab"));
359
+ }
360
+
361
+ void Write(Writer* w) {
362
+ WriteHeader(w);
363
+ WriteSectionTable(w);
364
+ WriteSections(w);
365
+ }
366
+
367
+ ELFSection* SectionAt(uint32_t index) {
368
+ return sections_[index];
369
+ }
370
+
371
+ uint32_t AddSection(ELFSection* section) {
372
+ sections_.Add(section);
373
+ section->set_index(sections_.length() - 1);
374
+ return sections_.length() - 1;
375
+ }
376
+
377
+ private:
378
+ struct ELFHeader {
379
+ uint8_t ident[16];
380
+ uint16_t type;
381
+ uint16_t machine;
382
+ uint32_t version;
383
+ uintptr_t entry;
384
+ uintptr_t pht_offset;
385
+ uintptr_t sht_offset;
386
+ uint32_t flags;
387
+ uint16_t header_size;
388
+ uint16_t pht_entry_size;
389
+ uint16_t pht_entry_num;
390
+ uint16_t sht_entry_size;
391
+ uint16_t sht_entry_num;
392
+ uint16_t sht_strtab_index;
393
+ };
394
+
395
+
396
+ void WriteHeader(Writer* w) {
397
+ ASSERT(w->position() == 0);
398
+ Writer::Slot<ELFHeader> header = w->CreateSlotHere<ELFHeader>();
399
+ #if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_ARM)
400
+ const uint8_t ident[16] =
401
+ { 0x7f, 'E', 'L', 'F', 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
402
+ #elif defined(V8_TARGET_ARCH_X64)
403
+ const uint8_t ident[16] =
404
+ { 0x7f, 'E', 'L', 'F', 2, 1, 1, 0, 0, 0 , 0, 0, 0, 0, 0, 0};
405
+ #else
406
+ #error Unsupported target architecture.
407
+ #endif
408
+ memcpy(header->ident, ident, 16);
409
+ header->type = 1;
410
+ #if defined(V8_TARGET_ARCH_IA32)
411
+ header->machine = 3;
412
+ #elif defined(V8_TARGET_ARCH_X64)
413
+ // Processor identification value for x64 is 62 as defined in
414
+ // System V ABI, AMD64 Supplement
415
+ // http://www.x86-64.org/documentation/abi.pdf
416
+ header->machine = 62;
417
+ #elif defined(V8_TARGET_ARCH_ARM)
418
+ // Set to EM_ARM, defined as 40, in "ARM ELF File Format" at
419
+ // infocenter.arm.com/help/topic/com.arm.doc.dui0101a/DUI0101A_Elf.pdf
420
+ header->machine = 40;
421
+ #else
422
+ #error Unsupported target architecture.
423
+ #endif
424
+ header->version = 1;
425
+ header->entry = 0;
426
+ header->pht_offset = 0;
427
+ header->sht_offset = sizeof(ELFHeader); // Section table follows header.
428
+ header->flags = 0;
429
+ header->header_size = sizeof(ELFHeader);
430
+ header->pht_entry_size = 0;
431
+ header->pht_entry_num = 0;
432
+ header->sht_entry_size = sizeof(ELFSection::Header);
433
+ header->sht_entry_num = sections_.length();
434
+ header->sht_strtab_index = 1;
435
+ }
436
+
437
+ void WriteSectionTable(Writer* w) {
438
+ // Section headers table immediately follows file header.
439
+ ASSERT(w->position() == sizeof(ELFHeader));
440
+
441
+ Writer::Slot<ELFSection::Header> headers =
442
+ w->CreateSlotsHere<ELFSection::Header>(sections_.length());
443
+
444
+ // String table for section table is the first section.
445
+ StringTable* strtab = static_cast<StringTable*>(SectionAt(1));
446
+ strtab->AttachWriter(w);
447
+ for (int i = 0, length = sections_.length();
448
+ i < length;
449
+ i++) {
450
+ sections_[i]->PopulateHeader(headers.at(i), strtab);
451
+ }
452
+ strtab->DetachWriter();
453
+ }
454
+
455
+ int SectionHeaderPosition(uint32_t section_index) {
456
+ return sizeof(ELFHeader) + sizeof(ELFSection::Header) * section_index;
457
+ }
458
+
459
+ void WriteSections(Writer* w) {
460
+ Writer::Slot<ELFSection::Header> headers =
461
+ w->SlotAt<ELFSection::Header>(sizeof(ELFHeader));
462
+
463
+ for (int i = 0, length = sections_.length();
464
+ i < length;
465
+ i++) {
466
+ sections_[i]->WriteBody(headers.at(i), w);
467
+ }
468
+ }
469
+
470
+ ZoneList<ELFSection*> sections_;
471
+ };
472
+
473
+
474
+ class ELFSymbol BASE_EMBEDDED {
475
+ public:
476
+ enum Type {
477
+ TYPE_NOTYPE = 0,
478
+ TYPE_OBJECT = 1,
479
+ TYPE_FUNC = 2,
480
+ TYPE_SECTION = 3,
481
+ TYPE_FILE = 4,
482
+ TYPE_LOPROC = 13,
483
+ TYPE_HIPROC = 15
484
+ };
485
+
486
+ enum Binding {
487
+ BIND_LOCAL = 0,
488
+ BIND_GLOBAL = 1,
489
+ BIND_WEAK = 2,
490
+ BIND_LOPROC = 13,
491
+ BIND_HIPROC = 15
492
+ };
493
+
494
+ ELFSymbol(const char* name,
495
+ uintptr_t value,
496
+ uintptr_t size,
497
+ Binding binding,
498
+ Type type,
499
+ uint16_t section)
500
+ : name(name),
501
+ value(value),
502
+ size(size),
503
+ info((binding << 4) | type),
504
+ other(0),
505
+ section(section) {
506
+ }
507
+
508
+ Binding binding() const {
509
+ return static_cast<Binding>(info >> 4);
510
+ }
511
+ #if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_ARM)
512
+ struct SerializedLayout {
513
+ SerializedLayout(uint32_t name,
514
+ uintptr_t value,
515
+ uintptr_t size,
516
+ Binding binding,
517
+ Type type,
518
+ uint16_t section)
519
+ : name(name),
520
+ value(value),
521
+ size(size),
522
+ info((binding << 4) | type),
523
+ other(0),
524
+ section(section) {
525
+ }
526
+
527
+ uint32_t name;
528
+ uintptr_t value;
529
+ uintptr_t size;
530
+ uint8_t info;
531
+ uint8_t other;
532
+ uint16_t section;
533
+ };
534
+ #elif defined(V8_TARGET_ARCH_X64)
535
+ struct SerializedLayout {
536
+ SerializedLayout(uint32_t name,
537
+ uintptr_t value,
538
+ uintptr_t size,
539
+ Binding binding,
540
+ Type type,
541
+ uint16_t section)
542
+ : name(name),
543
+ info((binding << 4) | type),
544
+ other(0),
545
+ section(section),
546
+ value(value),
547
+ size(size) {
548
+ }
549
+
550
+ uint32_t name;
551
+ uint8_t info;
552
+ uint8_t other;
553
+ uint16_t section;
554
+ uintptr_t value;
555
+ uintptr_t size;
556
+ };
557
+ #endif
558
+
559
+ void Write(Writer::Slot<SerializedLayout> s, StringTable* t) {
560
+ // Convert symbol names from strings to indexes in the string table.
561
+ s->name = t->Add(name);
562
+ s->value = value;
563
+ s->size = size;
564
+ s->info = info;
565
+ s->other = other;
566
+ s->section = section;
567
+ }
568
+
569
+ private:
570
+ const char* name;
571
+ uintptr_t value;
572
+ uintptr_t size;
573
+ uint8_t info;
574
+ uint8_t other;
575
+ uint16_t section;
576
+ };
577
+
578
+
579
+ class ELFSymbolTable : public ELFSection {
580
+ public:
581
+ explicit ELFSymbolTable(const char* name)
582
+ : ELFSection(name, TYPE_SYMTAB, sizeof(uintptr_t)),
583
+ locals_(1),
584
+ globals_(1) {
585
+ }
586
+
587
+ virtual void WriteBody(Writer::Slot<Header> header, Writer* w) {
588
+ w->Align(header->alignment);
589
+ int total_symbols = locals_.length() + globals_.length() + 1;
590
+ header->offset = w->position();
591
+
592
+ Writer::Slot<ELFSymbol::SerializedLayout> symbols =
593
+ w->CreateSlotsHere<ELFSymbol::SerializedLayout>(total_symbols);
594
+
595
+ header->size = w->position() - header->offset;
596
+
597
+ // String table for this symbol table should follow it in the section table.
598
+ StringTable* strtab =
599
+ static_cast<StringTable*>(w->elf()->SectionAt(index() + 1));
600
+ strtab->AttachWriter(w);
601
+ symbols.at(0).set(ELFSymbol::SerializedLayout(0,
602
+ 0,
603
+ 0,
604
+ ELFSymbol::BIND_LOCAL,
605
+ ELFSymbol::TYPE_NOTYPE,
606
+ 0));
607
+ WriteSymbolsList(&locals_, symbols.at(1), strtab);
608
+ WriteSymbolsList(&globals_, symbols.at(locals_.length() + 1), strtab);
609
+ strtab->DetachWriter();
610
+ }
611
+
612
+ void Add(const ELFSymbol& symbol) {
613
+ if (symbol.binding() == ELFSymbol::BIND_LOCAL) {
614
+ locals_.Add(symbol);
615
+ } else {
616
+ globals_.Add(symbol);
617
+ }
618
+ }
619
+
620
+ protected:
621
+ virtual void PopulateHeader(Writer::Slot<Header> header) {
622
+ ELFSection::PopulateHeader(header);
623
+ // We are assuming that string table will follow symbol table.
624
+ header->link = index() + 1;
625
+ header->info = locals_.length() + 1;
626
+ header->entry_size = sizeof(ELFSymbol::SerializedLayout);
627
+ }
628
+
629
+ private:
630
+ void WriteSymbolsList(const ZoneList<ELFSymbol>* src,
631
+ Writer::Slot<ELFSymbol::SerializedLayout> dst,
632
+ StringTable* strtab) {
633
+ for (int i = 0, len = src->length();
634
+ i < len;
635
+ i++) {
636
+ src->at(i).Write(dst.at(i), strtab);
637
+ }
638
+ }
639
+
640
+ ZoneList<ELFSymbol> locals_;
641
+ ZoneList<ELFSymbol> globals_;
642
+ };
643
+
644
+
645
+ class CodeDescription BASE_EMBEDDED {
646
+ public:
647
+
648
+ #ifdef V8_TARGET_ARCH_X64
649
+ enum StackState {
650
+ POST_RBP_PUSH,
651
+ POST_RBP_SET,
652
+ POST_RBP_POP,
653
+ STACK_STATE_MAX
654
+ };
655
+ #endif
656
+
657
+ CodeDescription(const char* name,
658
+ Code* code,
659
+ Handle<Script> script,
660
+ GDBJITLineInfo* lineinfo,
661
+ GDBJITInterface::CodeTag tag)
662
+ : name_(name),
663
+ code_(code),
664
+ script_(script),
665
+ lineinfo_(lineinfo),
666
+ tag_(tag) {
667
+ }
668
+
669
+ const char* name() const {
670
+ return name_;
671
+ }
672
+
673
+ GDBJITLineInfo* lineinfo() const {
674
+ return lineinfo_;
675
+ }
676
+
677
+ GDBJITInterface::CodeTag tag() const {
678
+ return tag_;
679
+ }
680
+
681
+ uintptr_t CodeStart() const {
682
+ return reinterpret_cast<uintptr_t>(code_->instruction_start());
683
+ }
684
+
685
+ uintptr_t CodeEnd() const {
686
+ return reinterpret_cast<uintptr_t>(code_->instruction_end());
687
+ }
688
+
689
+ uintptr_t CodeSize() const {
690
+ return CodeEnd() - CodeStart();
691
+ }
692
+
693
+ bool IsLineInfoAvailable() {
694
+ return !script_.is_null() &&
695
+ script_->source()->IsString() &&
696
+ script_->HasValidSource() &&
697
+ script_->name()->IsString() &&
698
+ lineinfo_ != NULL;
699
+ }
700
+
701
+ #ifdef V8_TARGET_ARCH_X64
702
+ uintptr_t GetStackStateStartAddress(StackState state) const {
703
+ ASSERT(state < STACK_STATE_MAX);
704
+ return stack_state_start_addresses_[state];
705
+ }
706
+
707
+ void SetStackStateStartAddress(StackState state, uintptr_t addr) {
708
+ ASSERT(state < STACK_STATE_MAX);
709
+ stack_state_start_addresses_[state] = addr;
710
+ }
711
+ #endif
712
+
713
+ SmartPointer<char> GetFilename() {
714
+ return String::cast(script_->name())->ToCString();
715
+ }
716
+
717
+ int GetScriptLineNumber(int pos) {
718
+ return GetScriptLineNumberSafe(script_, pos) + 1;
719
+ }
720
+
721
+
722
+ private:
723
+ const char* name_;
724
+ Code* code_;
725
+ Handle<Script> script_;
726
+ GDBJITLineInfo* lineinfo_;
727
+ GDBJITInterface::CodeTag tag_;
728
+ #ifdef V8_TARGET_ARCH_X64
729
+ uintptr_t stack_state_start_addresses_[STACK_STATE_MAX];
730
+ #endif
731
+ };
732
+
733
+
734
+ static void CreateSymbolsTable(CodeDescription* desc,
735
+ ELF* elf,
736
+ int text_section_index) {
737
+ ELFSymbolTable* symtab = new ELFSymbolTable(".symtab");
738
+ StringTable* strtab = new StringTable(".strtab");
739
+
740
+ // Symbol table should be followed by the linked string table.
741
+ elf->AddSection(symtab);
742
+ elf->AddSection(strtab);
743
+
744
+ symtab->Add(ELFSymbol("V8 Code",
745
+ 0,
746
+ 0,
747
+ ELFSymbol::BIND_LOCAL,
748
+ ELFSymbol::TYPE_FILE,
749
+ ELFSection::INDEX_ABSOLUTE));
750
+
751
+ symtab->Add(ELFSymbol(desc->name(),
752
+ 0,
753
+ desc->CodeSize(),
754
+ ELFSymbol::BIND_GLOBAL,
755
+ ELFSymbol::TYPE_FUNC,
756
+ text_section_index));
757
+ }
758
+
759
+
760
+ class DebugInfoSection : public ELFSection {
761
+ public:
762
+ explicit DebugInfoSection(CodeDescription* desc)
763
+ : ELFSection(".debug_info", TYPE_PROGBITS, 1), desc_(desc) { }
764
+
765
+ bool WriteBody(Writer* w) {
766
+ Writer::Slot<uint32_t> size = w->CreateSlotHere<uint32_t>();
767
+ uintptr_t start = w->position();
768
+ w->Write<uint16_t>(2); // DWARF version.
769
+ w->Write<uint32_t>(0); // Abbreviation table offset.
770
+ w->Write<uint8_t>(sizeof(intptr_t));
771
+
772
+ w->WriteULEB128(1); // Abbreviation code.
773
+ w->WriteString(*desc_->GetFilename());
774
+ w->Write<intptr_t>(desc_->CodeStart());
775
+ w->Write<intptr_t>(desc_->CodeStart() + desc_->CodeSize());
776
+ w->Write<uint32_t>(0);
777
+ size.set(static_cast<uint32_t>(w->position() - start));
778
+ return true;
779
+ }
780
+
781
+ private:
782
+ CodeDescription* desc_;
783
+ };
784
+
785
+
786
+ class DebugAbbrevSection : public ELFSection {
787
+ public:
788
+ DebugAbbrevSection() : ELFSection(".debug_abbrev", TYPE_PROGBITS, 1) { }
789
+
790
+ // DWARF2 standard, figure 14.
791
+ enum DWARF2Tags {
792
+ DW_TAG_COMPILE_UNIT = 0x11
793
+ };
794
+
795
+ // DWARF2 standard, figure 16.
796
+ enum DWARF2ChildrenDetermination {
797
+ DW_CHILDREN_NO = 0,
798
+ DW_CHILDREN_YES = 1
799
+ };
800
+
801
+ // DWARF standard, figure 17.
802
+ enum DWARF2Attribute {
803
+ DW_AT_NAME = 0x3,
804
+ DW_AT_STMT_LIST = 0x10,
805
+ DW_AT_LOW_PC = 0x11,
806
+ DW_AT_HIGH_PC = 0x12
807
+ };
808
+
809
+ // DWARF2 standard, figure 19.
810
+ enum DWARF2AttributeForm {
811
+ DW_FORM_ADDR = 0x1,
812
+ DW_FORM_STRING = 0x8,
813
+ DW_FORM_DATA4 = 0x6
814
+ };
815
+
816
+ bool WriteBody(Writer* w) {
817
+ w->WriteULEB128(1);
818
+ w->WriteULEB128(DW_TAG_COMPILE_UNIT);
819
+ w->Write<uint8_t>(DW_CHILDREN_NO);
820
+ w->WriteULEB128(DW_AT_NAME);
821
+ w->WriteULEB128(DW_FORM_STRING);
822
+ w->WriteULEB128(DW_AT_LOW_PC);
823
+ w->WriteULEB128(DW_FORM_ADDR);
824
+ w->WriteULEB128(DW_AT_HIGH_PC);
825
+ w->WriteULEB128(DW_FORM_ADDR);
826
+ w->WriteULEB128(DW_AT_STMT_LIST);
827
+ w->WriteULEB128(DW_FORM_DATA4);
828
+ w->WriteULEB128(0);
829
+ w->WriteULEB128(0);
830
+ w->WriteULEB128(0);
831
+ return true;
832
+ }
833
+ };
834
+
835
+
836
+ class DebugLineSection : public ELFSection {
837
+ public:
838
+ explicit DebugLineSection(CodeDescription* desc)
839
+ : ELFSection(".debug_line", TYPE_PROGBITS, 1),
840
+ desc_(desc) { }
841
+
842
+ // DWARF2 standard, figure 34.
843
+ enum DWARF2Opcodes {
844
+ DW_LNS_COPY = 1,
845
+ DW_LNS_ADVANCE_PC = 2,
846
+ DW_LNS_ADVANCE_LINE = 3,
847
+ DW_LNS_SET_FILE = 4,
848
+ DW_LNS_SET_COLUMN = 5,
849
+ DW_LNS_NEGATE_STMT = 6
850
+ };
851
+
852
+ // DWARF2 standard, figure 35.
853
+ enum DWARF2ExtendedOpcode {
854
+ DW_LNE_END_SEQUENCE = 1,
855
+ DW_LNE_SET_ADDRESS = 2,
856
+ DW_LNE_DEFINE_FILE = 3
857
+ };
858
+
859
+ bool WriteBody(Writer* w) {
860
+ // Write prologue.
861
+ Writer::Slot<uint32_t> total_length = w->CreateSlotHere<uint32_t>();
862
+ uintptr_t start = w->position();
863
+
864
+ // Used for special opcodes
865
+ const int8_t line_base = 1;
866
+ const uint8_t line_range = 7;
867
+ const int8_t max_line_incr = (line_base + line_range - 1);
868
+ const uint8_t opcode_base = DW_LNS_NEGATE_STMT + 1;
869
+
870
+ w->Write<uint16_t>(2); // Field version.
871
+ Writer::Slot<uint32_t> prologue_length = w->CreateSlotHere<uint32_t>();
872
+ uintptr_t prologue_start = w->position();
873
+ w->Write<uint8_t>(1); // Field minimum_instruction_length.
874
+ w->Write<uint8_t>(1); // Field default_is_stmt.
875
+ w->Write<int8_t>(line_base); // Field line_base.
876
+ w->Write<uint8_t>(line_range); // Field line_range.
877
+ w->Write<uint8_t>(opcode_base); // Field opcode_base.
878
+ w->Write<uint8_t>(0); // DW_LNS_COPY operands count.
879
+ w->Write<uint8_t>(1); // DW_LNS_ADVANCE_PC operands count.
880
+ w->Write<uint8_t>(1); // DW_LNS_ADVANCE_LINE operands count.
881
+ w->Write<uint8_t>(1); // DW_LNS_SET_FILE operands count.
882
+ w->Write<uint8_t>(1); // DW_LNS_SET_COLUMN operands count.
883
+ w->Write<uint8_t>(0); // DW_LNS_NEGATE_STMT operands count.
884
+ w->Write<uint8_t>(0); // Empty include_directories sequence.
885
+ w->WriteString(*desc_->GetFilename()); // File name.
886
+ w->WriteULEB128(0); // Current directory.
887
+ w->WriteULEB128(0); // Unknown modification time.
888
+ w->WriteULEB128(0); // Unknown file size.
889
+ w->Write<uint8_t>(0);
890
+ prologue_length.set(static_cast<uint32_t>(w->position() - prologue_start));
891
+
892
+ WriteExtendedOpcode(w, DW_LNE_SET_ADDRESS, sizeof(intptr_t));
893
+ w->Write<intptr_t>(desc_->CodeStart());
894
+ w->Write<uint8_t>(DW_LNS_COPY);
895
+
896
+ intptr_t pc = 0;
897
+ intptr_t line = 1;
898
+ bool is_statement = true;
899
+
900
+ List<GDBJITLineInfo::PCInfo>* pc_info = desc_->lineinfo()->pc_info();
901
+ pc_info->Sort(&ComparePCInfo);
902
+
903
+ int pc_info_length = pc_info->length();
904
+ for (int i = 0; i < pc_info_length; i++) {
905
+ GDBJITLineInfo::PCInfo* info = &pc_info->at(i);
906
+ ASSERT(info->pc_ >= pc);
907
+
908
+ // Reduce bloating in the debug line table by removing duplicate line
909
+ // entries (per DWARF2 standard).
910
+ intptr_t new_line = desc_->GetScriptLineNumber(info->pos_);
911
+ if (new_line == line) {
912
+ continue;
913
+ }
914
+
915
+ // Mark statement boundaries. For a better debugging experience, mark
916
+ // the last pc address in the function as a statement (e.g. "}"), so that
917
+ // a user can see the result of the last line executed in the function,
918
+ // should control reach the end.
919
+ if ((i+1) == pc_info_length) {
920
+ if (!is_statement) {
921
+ w->Write<uint8_t>(DW_LNS_NEGATE_STMT);
922
+ }
923
+ } else if (is_statement != info->is_statement_) {
924
+ w->Write<uint8_t>(DW_LNS_NEGATE_STMT);
925
+ is_statement = !is_statement;
926
+ }
927
+
928
+ // Generate special opcodes, if possible. This results in more compact
929
+ // debug line tables. See the DWARF 2.0 standard to learn more about
930
+ // special opcodes.
931
+ uintptr_t pc_diff = info->pc_ - pc;
932
+ intptr_t line_diff = new_line - line;
933
+
934
+ // Compute special opcode (see DWARF 2.0 standard)
935
+ intptr_t special_opcode = (line_diff - line_base) +
936
+ (line_range * pc_diff) + opcode_base;
937
+
938
+ // If special_opcode is less than or equal to 255, it can be used as a
939
+ // special opcode. If line_diff is larger than the max line increment
940
+ // allowed for a special opcode, or if line_diff is less than the minimum
941
+ // line that can be added to the line register (i.e. line_base), then
942
+ // special_opcode can't be used.
943
+ if ((special_opcode >= opcode_base) && (special_opcode <= 255) &&
944
+ (line_diff <= max_line_incr) && (line_diff >= line_base)) {
945
+ w->Write<uint8_t>(special_opcode);
946
+ } else {
947
+ w->Write<uint8_t>(DW_LNS_ADVANCE_PC);
948
+ w->WriteSLEB128(pc_diff);
949
+ w->Write<uint8_t>(DW_LNS_ADVANCE_LINE);
950
+ w->WriteSLEB128(line_diff);
951
+ w->Write<uint8_t>(DW_LNS_COPY);
952
+ }
953
+
954
+ // Increment the pc and line operands.
955
+ pc += pc_diff;
956
+ line += line_diff;
957
+ }
958
+ // Advance the pc to the end of the routine, since the end sequence opcode
959
+ // requires this.
960
+ w->Write<uint8_t>(DW_LNS_ADVANCE_PC);
961
+ w->WriteSLEB128(desc_->CodeSize() - pc);
962
+ WriteExtendedOpcode(w, DW_LNE_END_SEQUENCE, 0);
963
+ total_length.set(static_cast<uint32_t>(w->position() - start));
964
+ return true;
965
+ }
966
+
967
+ private:
968
+ void WriteExtendedOpcode(Writer* w,
969
+ DWARF2ExtendedOpcode op,
970
+ size_t operands_size) {
971
+ w->Write<uint8_t>(0);
972
+ w->WriteULEB128(operands_size + 1);
973
+ w->Write<uint8_t>(op);
974
+ }
975
+
976
+ static int ComparePCInfo(const GDBJITLineInfo::PCInfo* a,
977
+ const GDBJITLineInfo::PCInfo* b) {
978
+ if (a->pc_ == b->pc_) {
979
+ if (a->is_statement_ != b->is_statement_) {
980
+ return b->is_statement_ ? +1 : -1;
981
+ }
982
+ return 0;
983
+ } else if (a->pc_ > b->pc_) {
984
+ return +1;
985
+ } else {
986
+ return -1;
987
+ }
988
+ }
989
+
990
+ CodeDescription* desc_;
991
+ };
992
+
993
+
994
+ #ifdef V8_TARGET_ARCH_X64
995
+
996
+
997
+ class UnwindInfoSection : public ELFSection {
998
+ public:
999
+ explicit UnwindInfoSection(CodeDescription *desc);
1000
+ virtual bool WriteBody(Writer *w);
1001
+
1002
+ int WriteCIE(Writer *w);
1003
+ void WriteFDE(Writer *w, int);
1004
+
1005
+ void WriteFDEStateOnEntry(Writer *w);
1006
+ void WriteFDEStateAfterRBPPush(Writer *w);
1007
+ void WriteFDEStateAfterRBPSet(Writer *w);
1008
+ void WriteFDEStateAfterRBPPop(Writer *w);
1009
+
1010
+ void WriteLength(Writer *w,
1011
+ Writer::Slot<uint32_t>* length_slot,
1012
+ int initial_position);
1013
+
1014
+ private:
1015
+ CodeDescription *desc_;
1016
+
1017
+ // DWARF3 Specification, Table 7.23
1018
+ enum CFIInstructions {
1019
+ DW_CFA_ADVANCE_LOC = 0x40,
1020
+ DW_CFA_OFFSET = 0x80,
1021
+ DW_CFA_RESTORE = 0xC0,
1022
+ DW_CFA_NOP = 0x00,
1023
+ DW_CFA_SET_LOC = 0x01,
1024
+ DW_CFA_ADVANCE_LOC1 = 0x02,
1025
+ DW_CFA_ADVANCE_LOC2 = 0x03,
1026
+ DW_CFA_ADVANCE_LOC4 = 0x04,
1027
+ DW_CFA_OFFSET_EXTENDED = 0x05,
1028
+ DW_CFA_RESTORE_EXTENDED = 0x06,
1029
+ DW_CFA_UNDEFINED = 0x07,
1030
+ DW_CFA_SAME_VALUE = 0x08,
1031
+ DW_CFA_REGISTER = 0x09,
1032
+ DW_CFA_REMEMBER_STATE = 0x0A,
1033
+ DW_CFA_RESTORE_STATE = 0x0B,
1034
+ DW_CFA_DEF_CFA = 0x0C,
1035
+ DW_CFA_DEF_CFA_REGISTER = 0x0D,
1036
+ DW_CFA_DEF_CFA_OFFSET = 0x0E,
1037
+
1038
+ DW_CFA_DEF_CFA_EXPRESSION = 0x0F,
1039
+ DW_CFA_EXPRESSION = 0x10,
1040
+ DW_CFA_OFFSET_EXTENDED_SF = 0x11,
1041
+ DW_CFA_DEF_CFA_SF = 0x12,
1042
+ DW_CFA_DEF_CFA_OFFSET_SF = 0x13,
1043
+ DW_CFA_VAL_OFFSET = 0x14,
1044
+ DW_CFA_VAL_OFFSET_SF = 0x15,
1045
+ DW_CFA_VAL_EXPRESSION = 0x16
1046
+ };
1047
+
1048
+ // System V ABI, AMD64 Supplement, Version 0.99.5, Figure 3.36
1049
+ enum RegisterMapping {
1050
+ // Only the relevant ones have been added to reduce clutter.
1051
+ AMD64_RBP = 6,
1052
+ AMD64_RSP = 7,
1053
+ AMD64_RA = 16
1054
+ };
1055
+
1056
+ enum CFIConstants {
1057
+ CIE_ID = 0,
1058
+ CIE_VERSION = 1,
1059
+ CODE_ALIGN_FACTOR = 1,
1060
+ DATA_ALIGN_FACTOR = 1,
1061
+ RETURN_ADDRESS_REGISTER = AMD64_RA
1062
+ };
1063
+ };
1064
+
1065
+
1066
+ void UnwindInfoSection::WriteLength(Writer *w,
1067
+ Writer::Slot<uint32_t>* length_slot,
1068
+ int initial_position) {
1069
+ uint32_t align = (w->position() - initial_position) % kPointerSize;
1070
+
1071
+ if (align != 0) {
1072
+ for (uint32_t i = 0; i < (kPointerSize - align); i++) {
1073
+ w->Write<uint8_t>(DW_CFA_NOP);
1074
+ }
1075
+ }
1076
+
1077
+ ASSERT((w->position() - initial_position) % kPointerSize == 0);
1078
+ length_slot->set(w->position() - initial_position);
1079
+ }
1080
+
1081
+
1082
+ UnwindInfoSection::UnwindInfoSection(CodeDescription *desc)
1083
+ : ELFSection(".eh_frame", TYPE_X86_64_UNWIND, 1), desc_(desc)
1084
+ { }
1085
+
1086
+ int UnwindInfoSection::WriteCIE(Writer *w) {
1087
+ Writer::Slot<uint32_t> cie_length_slot = w->CreateSlotHere<uint32_t>();
1088
+ uint32_t cie_position = w->position();
1089
+
1090
+ // Write out the CIE header. Currently no 'common instructions' are
1091
+ // emitted onto the CIE; every FDE has its own set of instructions.
1092
+
1093
+ w->Write<uint32_t>(CIE_ID);
1094
+ w->Write<uint8_t>(CIE_VERSION);
1095
+ w->Write<uint8_t>(0); // Null augmentation string.
1096
+ w->WriteSLEB128(CODE_ALIGN_FACTOR);
1097
+ w->WriteSLEB128(DATA_ALIGN_FACTOR);
1098
+ w->Write<uint8_t>(RETURN_ADDRESS_REGISTER);
1099
+
1100
+ WriteLength(w, &cie_length_slot, cie_position);
1101
+
1102
+ return cie_position;
1103
+ }
1104
+
1105
+
1106
+ void UnwindInfoSection::WriteFDE(Writer *w, int cie_position) {
1107
+ // The only FDE for this function. The CFA is the current RBP.
1108
+ Writer::Slot<uint32_t> fde_length_slot = w->CreateSlotHere<uint32_t>();
1109
+ int fde_position = w->position();
1110
+ w->Write<int32_t>(fde_position - cie_position + 4);
1111
+
1112
+ w->Write<uintptr_t>(desc_->CodeStart());
1113
+ w->Write<uintptr_t>(desc_->CodeSize());
1114
+
1115
+ WriteFDEStateOnEntry(w);
1116
+ WriteFDEStateAfterRBPPush(w);
1117
+ WriteFDEStateAfterRBPSet(w);
1118
+ WriteFDEStateAfterRBPPop(w);
1119
+
1120
+ WriteLength(w, &fde_length_slot, fde_position);
1121
+ }
1122
+
1123
+
1124
+ void UnwindInfoSection::WriteFDEStateOnEntry(Writer *w) {
1125
+ // The first state, just after the control has been transferred to the the
1126
+ // function.
1127
+
1128
+ // RBP for this function will be the value of RSP after pushing the RBP
1129
+ // for the previous function. The previous RBP has not been pushed yet.
1130
+ w->Write<uint8_t>(DW_CFA_DEF_CFA_SF);
1131
+ w->WriteULEB128(AMD64_RSP);
1132
+ w->WriteSLEB128(-kPointerSize);
1133
+
1134
+ // The RA is stored at location CFA + kCallerPCOffset. This is an invariant,
1135
+ // and hence omitted from the next states.
1136
+ w->Write<uint8_t>(DW_CFA_OFFSET_EXTENDED);
1137
+ w->WriteULEB128(AMD64_RA);
1138
+ w->WriteSLEB128(StandardFrameConstants::kCallerPCOffset);
1139
+
1140
+ // The RBP of the previous function is still in RBP.
1141
+ w->Write<uint8_t>(DW_CFA_SAME_VALUE);
1142
+ w->WriteULEB128(AMD64_RBP);
1143
+
1144
+ // Last location described by this entry.
1145
+ w->Write<uint8_t>(DW_CFA_SET_LOC);
1146
+ w->Write<uint64_t>(
1147
+ desc_->GetStackStateStartAddress(CodeDescription::POST_RBP_PUSH));
1148
+ }
1149
+
1150
+
1151
+ void UnwindInfoSection::WriteFDEStateAfterRBPPush(Writer *w) {
1152
+ // The second state, just after RBP has been pushed.
1153
+
1154
+ // RBP / CFA for this function is now the current RSP, so just set the
1155
+ // offset from the previous rule (from -8) to 0.
1156
+ w->Write<uint8_t>(DW_CFA_DEF_CFA_OFFSET);
1157
+ w->WriteULEB128(0);
1158
+
1159
+ // The previous RBP is stored at CFA + kCallerFPOffset. This is an invariant
1160
+ // in this and the next state, and hence omitted in the next state.
1161
+ w->Write<uint8_t>(DW_CFA_OFFSET_EXTENDED);
1162
+ w->WriteULEB128(AMD64_RBP);
1163
+ w->WriteSLEB128(StandardFrameConstants::kCallerFPOffset);
1164
+
1165
+ // Last location described by this entry.
1166
+ w->Write<uint8_t>(DW_CFA_SET_LOC);
1167
+ w->Write<uint64_t>(
1168
+ desc_->GetStackStateStartAddress(CodeDescription::POST_RBP_SET));
1169
+ }
1170
+
1171
+
1172
+ void UnwindInfoSection::WriteFDEStateAfterRBPSet(Writer *w) {
1173
+ // The third state, after the RBP has been set.
1174
+
1175
+ // The CFA can now directly be set to RBP.
1176
+ w->Write<uint8_t>(DW_CFA_DEF_CFA);
1177
+ w->WriteULEB128(AMD64_RBP);
1178
+ w->WriteULEB128(0);
1179
+
1180
+ // Last location described by this entry.
1181
+ w->Write<uint8_t>(DW_CFA_SET_LOC);
1182
+ w->Write<uint64_t>(
1183
+ desc_->GetStackStateStartAddress(CodeDescription::POST_RBP_POP));
1184
+ }
1185
+
1186
+
1187
+ void UnwindInfoSection::WriteFDEStateAfterRBPPop(Writer *w) {
1188
+ // The fourth (final) state. The RBP has been popped (just before issuing a
1189
+ // return).
1190
+
1191
+ // The CFA can is now calculated in the same way as in the first state.
1192
+ w->Write<uint8_t>(DW_CFA_DEF_CFA_SF);
1193
+ w->WriteULEB128(AMD64_RSP);
1194
+ w->WriteSLEB128(-kPointerSize);
1195
+
1196
+ // The RBP
1197
+ w->Write<uint8_t>(DW_CFA_OFFSET_EXTENDED);
1198
+ w->WriteULEB128(AMD64_RBP);
1199
+ w->WriteSLEB128(StandardFrameConstants::kCallerFPOffset);
1200
+
1201
+ // Last location described by this entry.
1202
+ w->Write<uint8_t>(DW_CFA_SET_LOC);
1203
+ w->Write<uint64_t>(desc_->CodeEnd());
1204
+ }
1205
+
1206
+
1207
+ bool UnwindInfoSection::WriteBody(Writer *w) {
1208
+ uint32_t cie_position = WriteCIE(w);
1209
+ WriteFDE(w, cie_position);
1210
+ return true;
1211
+ }
1212
+
1213
+
1214
+ #endif // V8_TARGET_ARCH_X64
1215
+
1216
+
1217
+ static void CreateDWARFSections(CodeDescription* desc, ELF* elf) {
1218
+ if (desc->IsLineInfoAvailable()) {
1219
+ elf->AddSection(new DebugInfoSection(desc));
1220
+ elf->AddSection(new DebugAbbrevSection);
1221
+ elf->AddSection(new DebugLineSection(desc));
1222
+ }
1223
+ #ifdef V8_TARGET_ARCH_X64
1224
+ elf->AddSection(new UnwindInfoSection(desc));
1225
+ #endif
1226
+ }
1227
+
1228
+
1229
+ // -------------------------------------------------------------------
1230
+ // Binary GDB JIT Interface as described in
1231
+ // http://sourceware.org/gdb/onlinedocs/gdb/Declarations.html
1232
+ extern "C" {
1233
+ typedef enum {
1234
+ JIT_NOACTION = 0,
1235
+ JIT_REGISTER_FN,
1236
+ JIT_UNREGISTER_FN
1237
+ } JITAction;
1238
+
1239
+ struct JITCodeEntry {
1240
+ JITCodeEntry* next_;
1241
+ JITCodeEntry* prev_;
1242
+ Address symfile_addr_;
1243
+ uint64_t symfile_size_;
1244
+ };
1245
+
1246
+ struct JITDescriptor {
1247
+ uint32_t version_;
1248
+ uint32_t action_flag_;
1249
+ JITCodeEntry *relevant_entry_;
1250
+ JITCodeEntry *first_entry_;
1251
+ };
1252
+
1253
+ // GDB will place breakpoint into this function.
1254
+ // To prevent GCC from inlining or removing it we place noinline attribute
1255
+ // and inline assembler statement inside.
1256
+ void __attribute__((noinline)) __jit_debug_register_code() {
1257
+ __asm__("");
1258
+ }
1259
+
1260
+ // GDB will inspect contents of this descriptor.
1261
+ // Static initialization is necessary to prevent GDB from seeing
1262
+ // uninitialized descriptor.
1263
+ JITDescriptor __jit_debug_descriptor = { 1, 0, 0, 0 };
1264
+ }
1265
+
1266
+
1267
+ static JITCodeEntry* CreateCodeEntry(Address symfile_addr,
1268
+ uintptr_t symfile_size) {
1269
+ JITCodeEntry* entry = static_cast<JITCodeEntry*>(
1270
+ malloc(sizeof(JITCodeEntry) + symfile_size));
1271
+
1272
+ entry->symfile_addr_ = reinterpret_cast<Address>(entry + 1);
1273
+ entry->symfile_size_ = symfile_size;
1274
+ memcpy(entry->symfile_addr_, symfile_addr, symfile_size);
1275
+
1276
+ entry->prev_ = entry->next_ = NULL;
1277
+
1278
+ return entry;
1279
+ }
1280
+
1281
+
1282
+ static void DestroyCodeEntry(JITCodeEntry* entry) {
1283
+ free(entry);
1284
+ }
1285
+
1286
+
1287
+ static void RegisterCodeEntry(JITCodeEntry* entry) {
1288
+ #if defined(DEBUG) && !defined(WIN32)
1289
+ static int file_num = 0;
1290
+ if (FLAG_gdbjit_dump) {
1291
+ static const int kMaxFileNameSize = 64;
1292
+ static const char* kElfFilePrefix = "/tmp/elfdump";
1293
+ static const char* kObjFileExt = ".o";
1294
+ char file_name[64];
1295
+
1296
+ OS::SNPrintF(Vector<char>(file_name, kMaxFileNameSize), "%s%d%s",
1297
+ kElfFilePrefix, file_num++, kObjFileExt);
1298
+ WriteBytes(file_name, entry->symfile_addr_, entry->symfile_size_);
1299
+ }
1300
+ #endif
1301
+
1302
+ entry->next_ = __jit_debug_descriptor.first_entry_;
1303
+ if (entry->next_ != NULL) entry->next_->prev_ = entry;
1304
+ __jit_debug_descriptor.first_entry_ =
1305
+ __jit_debug_descriptor.relevant_entry_ = entry;
1306
+
1307
+ __jit_debug_descriptor.action_flag_ = JIT_REGISTER_FN;
1308
+ __jit_debug_register_code();
1309
+ }
1310
+
1311
+
1312
+ static void UnregisterCodeEntry(JITCodeEntry* entry) {
1313
+ if (entry->prev_ != NULL) {
1314
+ entry->prev_->next_ = entry->next_;
1315
+ } else {
1316
+ __jit_debug_descriptor.first_entry_ = entry->next_;
1317
+ }
1318
+
1319
+ if (entry->next_ != NULL) {
1320
+ entry->next_->prev_ = entry->prev_;
1321
+ }
1322
+
1323
+ __jit_debug_descriptor.relevant_entry_ = entry;
1324
+ __jit_debug_descriptor.action_flag_ = JIT_UNREGISTER_FN;
1325
+ __jit_debug_register_code();
1326
+ }
1327
+
1328
+
1329
+ static JITCodeEntry* CreateELFObject(CodeDescription* desc) {
1330
+ ZoneScope zone_scope(DELETE_ON_EXIT);
1331
+
1332
+ ELF elf;
1333
+ Writer w(&elf);
1334
+
1335
+ int text_section_index = elf.AddSection(
1336
+ new FullHeaderELFSection(".text",
1337
+ ELFSection::TYPE_NOBITS,
1338
+ kCodeAlignment,
1339
+ desc->CodeStart(),
1340
+ 0,
1341
+ desc->CodeSize(),
1342
+ ELFSection::FLAG_ALLOC | ELFSection::FLAG_EXEC));
1343
+
1344
+ CreateSymbolsTable(desc, &elf, text_section_index);
1345
+
1346
+ CreateDWARFSections(desc, &elf);
1347
+
1348
+ elf.Write(&w);
1349
+
1350
+ return CreateCodeEntry(w.buffer(), w.position());
1351
+ }
1352
+
1353
+
1354
+ static bool SameCodeObjects(void* key1, void* key2) {
1355
+ return key1 == key2;
1356
+ }
1357
+
1358
+
1359
+ static HashMap* GetEntries() {
1360
+ static HashMap* entries = NULL;
1361
+ if (entries == NULL) {
1362
+ entries = new HashMap(&SameCodeObjects);
1363
+ }
1364
+ return entries;
1365
+ }
1366
+
1367
+
1368
+ static uint32_t HashForCodeObject(Code* code) {
1369
+ static const uintptr_t kGoldenRatio = 2654435761u;
1370
+ uintptr_t hash = reinterpret_cast<uintptr_t>(code->address());
1371
+ return static_cast<uint32_t>((hash >> kCodeAlignmentBits) * kGoldenRatio);
1372
+ }
1373
+
1374
+
1375
+ static const intptr_t kLineInfoTag = 0x1;
1376
+
1377
+
1378
+ static bool IsLineInfoTagged(void* ptr) {
1379
+ return 0 != (reinterpret_cast<intptr_t>(ptr) & kLineInfoTag);
1380
+ }
1381
+
1382
+
1383
+ static void* TagLineInfo(GDBJITLineInfo* ptr) {
1384
+ return reinterpret_cast<void*>(
1385
+ reinterpret_cast<intptr_t>(ptr) | kLineInfoTag);
1386
+ }
1387
+
1388
+
1389
+ static GDBJITLineInfo* UntagLineInfo(void* ptr) {
1390
+ return reinterpret_cast<GDBJITLineInfo*>(
1391
+ reinterpret_cast<intptr_t>(ptr) & ~kLineInfoTag);
1392
+ }
1393
+
1394
+
1395
+ void GDBJITInterface::AddCode(Handle<String> name,
1396
+ Handle<Script> script,
1397
+ Handle<Code> code) {
1398
+ if (!FLAG_gdbjit) return;
1399
+
1400
+ // Force initialization of line_ends array.
1401
+ GetScriptLineNumber(script, 0);
1402
+
1403
+ if (!name.is_null()) {
1404
+ SmartPointer<char> name_cstring = name->ToCString(DISALLOW_NULLS);
1405
+ AddCode(*name_cstring, *code, GDBJITInterface::FUNCTION, *script);
1406
+ } else {
1407
+ AddCode("", *code, GDBJITInterface::FUNCTION, *script);
1408
+ }
1409
+ }
1410
+
1411
+ static void AddUnwindInfo(CodeDescription *desc) {
1412
+ #ifdef V8_TARGET_ARCH_X64
1413
+ if (desc->tag() == GDBJITInterface::FUNCTION) {
1414
+ // To avoid propagating unwinding information through
1415
+ // compilation pipeline we use an approximation.
1416
+ // For most use cases this should not affect usability.
1417
+ static const int kFramePointerPushOffset = 1;
1418
+ static const int kFramePointerSetOffset = 4;
1419
+ static const int kFramePointerPopOffset = -3;
1420
+
1421
+ uintptr_t frame_pointer_push_address =
1422
+ desc->CodeStart() + kFramePointerPushOffset;
1423
+
1424
+ uintptr_t frame_pointer_set_address =
1425
+ desc->CodeStart() + kFramePointerSetOffset;
1426
+
1427
+ uintptr_t frame_pointer_pop_address =
1428
+ desc->CodeEnd() + kFramePointerPopOffset;
1429
+
1430
+ desc->SetStackStateStartAddress(CodeDescription::POST_RBP_PUSH,
1431
+ frame_pointer_push_address);
1432
+ desc->SetStackStateStartAddress(CodeDescription::POST_RBP_SET,
1433
+ frame_pointer_set_address);
1434
+ desc->SetStackStateStartAddress(CodeDescription::POST_RBP_POP,
1435
+ frame_pointer_pop_address);
1436
+ } else {
1437
+ desc->SetStackStateStartAddress(CodeDescription::POST_RBP_PUSH,
1438
+ desc->CodeStart());
1439
+ desc->SetStackStateStartAddress(CodeDescription::POST_RBP_SET,
1440
+ desc->CodeStart());
1441
+ desc->SetStackStateStartAddress(CodeDescription::POST_RBP_POP,
1442
+ desc->CodeEnd());
1443
+ }
1444
+ #endif // V8_TARGET_ARCH_X64
1445
+ }
1446
+
1447
+
1448
+ void GDBJITInterface::AddCode(const char* name,
1449
+ Code* code,
1450
+ GDBJITInterface::CodeTag tag,
1451
+ Script* script) {
1452
+ if (!FLAG_gdbjit) return;
1453
+ AssertNoAllocation no_gc;
1454
+
1455
+ HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true);
1456
+ if (e->value != NULL && !IsLineInfoTagged(e->value)) return;
1457
+
1458
+ GDBJITLineInfo* lineinfo = UntagLineInfo(e->value);
1459
+ CodeDescription code_desc(name,
1460
+ code,
1461
+ script != NULL ? Handle<Script>(script)
1462
+ : Handle<Script>(),
1463
+ lineinfo,
1464
+ tag);
1465
+
1466
+ if (!FLAG_gdbjit_full && !code_desc.IsLineInfoAvailable()) {
1467
+ delete lineinfo;
1468
+ GetEntries()->Remove(code, HashForCodeObject(code));
1469
+ return;
1470
+ }
1471
+
1472
+ AddUnwindInfo(&code_desc);
1473
+ JITCodeEntry* entry = CreateELFObject(&code_desc);
1474
+ ASSERT(!IsLineInfoTagged(entry));
1475
+
1476
+ delete lineinfo;
1477
+ e->value = entry;
1478
+
1479
+ RegisterCodeEntry(entry);
1480
+ }
1481
+
1482
+
1483
+ void GDBJITInterface::AddCode(GDBJITInterface::CodeTag tag,
1484
+ const char* name,
1485
+ Code* code) {
1486
+ if (!FLAG_gdbjit) return;
1487
+
1488
+ EmbeddedVector<char, 256> buffer;
1489
+ StringBuilder builder(buffer.start(), buffer.length());
1490
+
1491
+ builder.AddString(Tag2String(tag));
1492
+ if ((name != NULL) && (*name != '\0')) {
1493
+ builder.AddString(": ");
1494
+ builder.AddString(name);
1495
+ } else {
1496
+ builder.AddFormatted(": code object %p", static_cast<void*>(code));
1497
+ }
1498
+
1499
+ AddCode(builder.Finalize(), code, tag);
1500
+ }
1501
+
1502
+
1503
+ void GDBJITInterface::AddCode(GDBJITInterface::CodeTag tag,
1504
+ String* name,
1505
+ Code* code) {
1506
+ if (!FLAG_gdbjit) return;
1507
+ AddCode(tag, name != NULL ? *name->ToCString(DISALLOW_NULLS) : NULL, code);
1508
+ }
1509
+
1510
+
1511
+ void GDBJITInterface::AddCode(GDBJITInterface::CodeTag tag, Code* code) {
1512
+ if (!FLAG_gdbjit) return;
1513
+
1514
+ AddCode(tag, "", code);
1515
+ }
1516
+
1517
+
1518
+ void GDBJITInterface::RemoveCode(Code* code) {
1519
+ if (!FLAG_gdbjit) return;
1520
+
1521
+ HashMap::Entry* e = GetEntries()->Lookup(code,
1522
+ HashForCodeObject(code),
1523
+ false);
1524
+ if (e == NULL) return;
1525
+
1526
+ if (IsLineInfoTagged(e->value)) {
1527
+ delete UntagLineInfo(e->value);
1528
+ } else {
1529
+ JITCodeEntry* entry = static_cast<JITCodeEntry*>(e->value);
1530
+ UnregisterCodeEntry(entry);
1531
+ DestroyCodeEntry(entry);
1532
+ }
1533
+ e->value = NULL;
1534
+ GetEntries()->Remove(code, HashForCodeObject(code));
1535
+ }
1536
+
1537
+
1538
+ void GDBJITInterface::RegisterDetailedLineInfo(Code* code,
1539
+ GDBJITLineInfo* line_info) {
1540
+ ASSERT(!IsLineInfoTagged(line_info));
1541
+ HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true);
1542
+ ASSERT(e->value == NULL);
1543
+ e->value = TagLineInfo(line_info);
1544
+ }
1545
+
1546
+
1547
+ } } // namespace v8::internal
1548
+ #endif