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,2381 @@
1
+ // Copyright 2006-2008 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ // Handle id counters.
29
+ var next_handle_ = 0;
30
+ var next_transient_handle_ = -1;
31
+
32
+ // Mirror cache.
33
+ var mirror_cache_ = [];
34
+
35
+
36
+ /**
37
+ * Clear the mirror handle cache.
38
+ */
39
+ function ClearMirrorCache() {
40
+ next_handle_ = 0;
41
+ mirror_cache_ = [];
42
+ }
43
+
44
+
45
+ /**
46
+ * Returns the mirror for a specified value or object.
47
+ *
48
+ * @param {value or Object} value the value or object to retreive the mirror for
49
+ * @param {boolean} transient indicate whether this object is transient and
50
+ * should not be added to the mirror cache. The default is not transient.
51
+ * @returns {Mirror} the mirror reflects the passed value or object
52
+ */
53
+ function MakeMirror(value, opt_transient) {
54
+ var mirror;
55
+
56
+ // Look for non transient mirrors in the mirror cache.
57
+ if (!opt_transient) {
58
+ for (id in mirror_cache_) {
59
+ mirror = mirror_cache_[id];
60
+ if (mirror.value() === value) {
61
+ return mirror;
62
+ }
63
+ // Special check for NaN as NaN == NaN is false.
64
+ if (mirror.isNumber() && isNaN(mirror.value()) &&
65
+ typeof value == 'number' && isNaN(value)) {
66
+ return mirror;
67
+ }
68
+ }
69
+ }
70
+
71
+ if (IS_UNDEFINED(value)) {
72
+ mirror = new UndefinedMirror();
73
+ } else if (IS_NULL(value)) {
74
+ mirror = new NullMirror();
75
+ } else if (IS_BOOLEAN(value)) {
76
+ mirror = new BooleanMirror(value);
77
+ } else if (IS_NUMBER(value)) {
78
+ mirror = new NumberMirror(value);
79
+ } else if (IS_STRING(value)) {
80
+ mirror = new StringMirror(value);
81
+ } else if (IS_ARRAY(value)) {
82
+ mirror = new ArrayMirror(value);
83
+ } else if (IS_DATE(value)) {
84
+ mirror = new DateMirror(value);
85
+ } else if (IS_FUNCTION(value)) {
86
+ mirror = new FunctionMirror(value);
87
+ } else if (IS_REGEXP(value)) {
88
+ mirror = new RegExpMirror(value);
89
+ } else if (IS_ERROR(value)) {
90
+ mirror = new ErrorMirror(value);
91
+ } else if (IS_SCRIPT(value)) {
92
+ mirror = new ScriptMirror(value);
93
+ } else {
94
+ mirror = new ObjectMirror(value, OBJECT_TYPE, opt_transient);
95
+ }
96
+
97
+ mirror_cache_[mirror.handle()] = mirror;
98
+ return mirror;
99
+ }
100
+
101
+
102
+ /**
103
+ * Returns the mirror for a specified mirror handle.
104
+ *
105
+ * @param {number} handle the handle to find the mirror for
106
+ * @returns {Mirror or undefiend} the mirror with the requested handle or
107
+ * undefined if no mirror with the requested handle was found
108
+ */
109
+ function LookupMirror(handle) {
110
+ return mirror_cache_[handle];
111
+ }
112
+
113
+
114
+ /**
115
+ * Returns the mirror for the undefined value.
116
+ *
117
+ * @returns {Mirror} the mirror reflects the undefined value
118
+ */
119
+ function GetUndefinedMirror() {
120
+ return MakeMirror(void 0);
121
+ }
122
+
123
+
124
+ /**
125
+ * Inherit the prototype methods from one constructor into another.
126
+ *
127
+ * The Function.prototype.inherits from lang.js rewritten as a standalone
128
+ * function (not on Function.prototype). NOTE: If this file is to be loaded
129
+ * during bootstrapping this function needs to be revritten using some native
130
+ * functions as prototype setup using normal JavaScript does not work as
131
+ * expected during bootstrapping (see mirror.js in r114903).
132
+ *
133
+ * @param {function} ctor Constructor function which needs to inherit the
134
+ * prototype
135
+ * @param {function} superCtor Constructor function to inherit prototype from
136
+ */
137
+ function inherits(ctor, superCtor) {
138
+ var tempCtor = function(){};
139
+ tempCtor.prototype = superCtor.prototype;
140
+ ctor.super_ = superCtor.prototype;
141
+ ctor.prototype = new tempCtor();
142
+ ctor.prototype.constructor = ctor;
143
+ }
144
+
145
+
146
+ // Type names of the different mirrors.
147
+ const UNDEFINED_TYPE = 'undefined';
148
+ const NULL_TYPE = 'null';
149
+ const BOOLEAN_TYPE = 'boolean';
150
+ const NUMBER_TYPE = 'number';
151
+ const STRING_TYPE = 'string';
152
+ const OBJECT_TYPE = 'object';
153
+ const FUNCTION_TYPE = 'function';
154
+ const REGEXP_TYPE = 'regexp';
155
+ const ERROR_TYPE = 'error';
156
+ const PROPERTY_TYPE = 'property';
157
+ const FRAME_TYPE = 'frame';
158
+ const SCRIPT_TYPE = 'script';
159
+ const CONTEXT_TYPE = 'context';
160
+ const SCOPE_TYPE = 'scope';
161
+
162
+ // Maximum length when sending strings through the JSON protocol.
163
+ const kMaxProtocolStringLength = 80;
164
+
165
+ // Different kind of properties.
166
+ PropertyKind = {};
167
+ PropertyKind.Named = 1;
168
+ PropertyKind.Indexed = 2;
169
+
170
+
171
+ // A copy of the PropertyType enum from global.h
172
+ PropertyType = {};
173
+ PropertyType.Normal = 0;
174
+ PropertyType.Field = 1;
175
+ PropertyType.ConstantFunction = 2;
176
+ PropertyType.Callbacks = 3;
177
+ PropertyType.Interceptor = 4;
178
+ PropertyType.MapTransition = 5;
179
+ PropertyType.ExternalArrayTransition = 6;
180
+ PropertyType.ConstantTransition = 7;
181
+ PropertyType.NullDescriptor = 8;
182
+
183
+
184
+ // Different attributes for a property.
185
+ PropertyAttribute = {};
186
+ PropertyAttribute.None = NONE;
187
+ PropertyAttribute.ReadOnly = READ_ONLY;
188
+ PropertyAttribute.DontEnum = DONT_ENUM;
189
+ PropertyAttribute.DontDelete = DONT_DELETE;
190
+
191
+
192
+ // A copy of the scope types from runtime.cc.
193
+ ScopeType = { Global: 0,
194
+ Local: 1,
195
+ With: 2,
196
+ Closure: 3,
197
+ Catch: 4 };
198
+
199
+
200
+ // Mirror hierarchy:
201
+ // - Mirror
202
+ // - ValueMirror
203
+ // - UndefinedMirror
204
+ // - NullMirror
205
+ // - NumberMirror
206
+ // - StringMirror
207
+ // - ObjectMirror
208
+ // - FunctionMirror
209
+ // - UnresolvedFunctionMirror
210
+ // - ArrayMirror
211
+ // - DateMirror
212
+ // - RegExpMirror
213
+ // - ErrorMirror
214
+ // - PropertyMirror
215
+ // - FrameMirror
216
+ // - ScriptMirror
217
+
218
+
219
+ /**
220
+ * Base class for all mirror objects.
221
+ * @param {string} type The type of the mirror
222
+ * @constructor
223
+ */
224
+ function Mirror(type) {
225
+ this.type_ = type;
226
+ };
227
+
228
+
229
+ Mirror.prototype.type = function() {
230
+ return this.type_;
231
+ };
232
+
233
+
234
+ /**
235
+ * Check whether the mirror reflects a value.
236
+ * @returns {boolean} True if the mirror reflects a value.
237
+ */
238
+ Mirror.prototype.isValue = function() {
239
+ return this instanceof ValueMirror;
240
+ }
241
+
242
+
243
+ /**
244
+ * Check whether the mirror reflects the undefined value.
245
+ * @returns {boolean} True if the mirror reflects the undefined value.
246
+ */
247
+ Mirror.prototype.isUndefined = function() {
248
+ return this instanceof UndefinedMirror;
249
+ }
250
+
251
+
252
+ /**
253
+ * Check whether the mirror reflects the null value.
254
+ * @returns {boolean} True if the mirror reflects the null value
255
+ */
256
+ Mirror.prototype.isNull = function() {
257
+ return this instanceof NullMirror;
258
+ }
259
+
260
+
261
+ /**
262
+ * Check whether the mirror reflects a boolean value.
263
+ * @returns {boolean} True if the mirror reflects a boolean value
264
+ */
265
+ Mirror.prototype.isBoolean = function() {
266
+ return this instanceof BooleanMirror;
267
+ }
268
+
269
+
270
+ /**
271
+ * Check whether the mirror reflects a number value.
272
+ * @returns {boolean} True if the mirror reflects a number value
273
+ */
274
+ Mirror.prototype.isNumber = function() {
275
+ return this instanceof NumberMirror;
276
+ }
277
+
278
+
279
+ /**
280
+ * Check whether the mirror reflects a string value.
281
+ * @returns {boolean} True if the mirror reflects a string value
282
+ */
283
+ Mirror.prototype.isString = function() {
284
+ return this instanceof StringMirror;
285
+ }
286
+
287
+
288
+ /**
289
+ * Check whether the mirror reflects an object.
290
+ * @returns {boolean} True if the mirror reflects an object
291
+ */
292
+ Mirror.prototype.isObject = function() {
293
+ return this instanceof ObjectMirror;
294
+ }
295
+
296
+
297
+ /**
298
+ * Check whether the mirror reflects a function.
299
+ * @returns {boolean} True if the mirror reflects a function
300
+ */
301
+ Mirror.prototype.isFunction = function() {
302
+ return this instanceof FunctionMirror;
303
+ }
304
+
305
+
306
+ /**
307
+ * Check whether the mirror reflects an unresolved function.
308
+ * @returns {boolean} True if the mirror reflects an unresolved function
309
+ */
310
+ Mirror.prototype.isUnresolvedFunction = function() {
311
+ return this instanceof UnresolvedFunctionMirror;
312
+ }
313
+
314
+
315
+ /**
316
+ * Check whether the mirror reflects an array.
317
+ * @returns {boolean} True if the mirror reflects an array
318
+ */
319
+ Mirror.prototype.isArray = function() {
320
+ return this instanceof ArrayMirror;
321
+ }
322
+
323
+
324
+ /**
325
+ * Check whether the mirror reflects a date.
326
+ * @returns {boolean} True if the mirror reflects a date
327
+ */
328
+ Mirror.prototype.isDate = function() {
329
+ return this instanceof DateMirror;
330
+ }
331
+
332
+
333
+ /**
334
+ * Check whether the mirror reflects a regular expression.
335
+ * @returns {boolean} True if the mirror reflects a regular expression
336
+ */
337
+ Mirror.prototype.isRegExp = function() {
338
+ return this instanceof RegExpMirror;
339
+ }
340
+
341
+
342
+ /**
343
+ * Check whether the mirror reflects an error.
344
+ * @returns {boolean} True if the mirror reflects an error
345
+ */
346
+ Mirror.prototype.isError = function() {
347
+ return this instanceof ErrorMirror;
348
+ }
349
+
350
+
351
+ /**
352
+ * Check whether the mirror reflects a property.
353
+ * @returns {boolean} True if the mirror reflects a property
354
+ */
355
+ Mirror.prototype.isProperty = function() {
356
+ return this instanceof PropertyMirror;
357
+ }
358
+
359
+
360
+ /**
361
+ * Check whether the mirror reflects a stack frame.
362
+ * @returns {boolean} True if the mirror reflects a stack frame
363
+ */
364
+ Mirror.prototype.isFrame = function() {
365
+ return this instanceof FrameMirror;
366
+ }
367
+
368
+
369
+ /**
370
+ * Check whether the mirror reflects a script.
371
+ * @returns {boolean} True if the mirror reflects a script
372
+ */
373
+ Mirror.prototype.isScript = function() {
374
+ return this instanceof ScriptMirror;
375
+ }
376
+
377
+
378
+ /**
379
+ * Check whether the mirror reflects a context.
380
+ * @returns {boolean} True if the mirror reflects a context
381
+ */
382
+ Mirror.prototype.isContext = function() {
383
+ return this instanceof ContextMirror;
384
+ }
385
+
386
+
387
+ /**
388
+ * Check whether the mirror reflects a scope.
389
+ * @returns {boolean} True if the mirror reflects a scope
390
+ */
391
+ Mirror.prototype.isScope = function() {
392
+ return this instanceof ScopeMirror;
393
+ }
394
+
395
+
396
+ /**
397
+ * Allocate a handle id for this object.
398
+ */
399
+ Mirror.prototype.allocateHandle_ = function() {
400
+ this.handle_ = next_handle_++;
401
+ }
402
+
403
+
404
+ /**
405
+ * Allocate a transient handle id for this object. Transient handles are
406
+ * negative.
407
+ */
408
+ Mirror.prototype.allocateTransientHandle_ = function() {
409
+ this.handle_ = next_transient_handle_--;
410
+ }
411
+
412
+
413
+ Mirror.prototype.toText = function() {
414
+ // Simpel to text which is used when on specialization in subclass.
415
+ return "#<" + this.constructor.name + ">";
416
+ }
417
+
418
+
419
+ /**
420
+ * Base class for all value mirror objects.
421
+ * @param {string} type The type of the mirror
422
+ * @param {value} value The value reflected by this mirror
423
+ * @param {boolean} transient indicate whether this object is transient with a
424
+ * transient handle
425
+ * @constructor
426
+ * @extends Mirror
427
+ */
428
+ function ValueMirror(type, value, transient) {
429
+ %_CallFunction(this, type, Mirror);
430
+ this.value_ = value;
431
+ if (!transient) {
432
+ this.allocateHandle_();
433
+ } else {
434
+ this.allocateTransientHandle_();
435
+ }
436
+ }
437
+ inherits(ValueMirror, Mirror);
438
+
439
+
440
+ Mirror.prototype.handle = function() {
441
+ return this.handle_;
442
+ };
443
+
444
+
445
+ /**
446
+ * Check whether this is a primitive value.
447
+ * @return {boolean} True if the mirror reflects a primitive value
448
+ */
449
+ ValueMirror.prototype.isPrimitive = function() {
450
+ var type = this.type();
451
+ return type === 'undefined' ||
452
+ type === 'null' ||
453
+ type === 'boolean' ||
454
+ type === 'number' ||
455
+ type === 'string';
456
+ };
457
+
458
+
459
+ /**
460
+ * Get the actual value reflected by this mirror.
461
+ * @return {value} The value reflected by this mirror
462
+ */
463
+ ValueMirror.prototype.value = function() {
464
+ return this.value_;
465
+ };
466
+
467
+
468
+ /**
469
+ * Mirror object for Undefined.
470
+ * @constructor
471
+ * @extends ValueMirror
472
+ */
473
+ function UndefinedMirror() {
474
+ %_CallFunction(this, UNDEFINED_TYPE, void 0, ValueMirror);
475
+ }
476
+ inherits(UndefinedMirror, ValueMirror);
477
+
478
+
479
+ UndefinedMirror.prototype.toText = function() {
480
+ return 'undefined';
481
+ }
482
+
483
+
484
+ /**
485
+ * Mirror object for null.
486
+ * @constructor
487
+ * @extends ValueMirror
488
+ */
489
+ function NullMirror() {
490
+ %_CallFunction(this, NULL_TYPE, null, ValueMirror);
491
+ }
492
+ inherits(NullMirror, ValueMirror);
493
+
494
+
495
+ NullMirror.prototype.toText = function() {
496
+ return 'null';
497
+ }
498
+
499
+
500
+ /**
501
+ * Mirror object for boolean values.
502
+ * @param {boolean} value The boolean value reflected by this mirror
503
+ * @constructor
504
+ * @extends ValueMirror
505
+ */
506
+ function BooleanMirror(value) {
507
+ %_CallFunction(this, BOOLEAN_TYPE, value, ValueMirror);
508
+ }
509
+ inherits(BooleanMirror, ValueMirror);
510
+
511
+
512
+ BooleanMirror.prototype.toText = function() {
513
+ return this.value_ ? 'true' : 'false';
514
+ }
515
+
516
+
517
+ /**
518
+ * Mirror object for number values.
519
+ * @param {number} value The number value reflected by this mirror
520
+ * @constructor
521
+ * @extends ValueMirror
522
+ */
523
+ function NumberMirror(value) {
524
+ %_CallFunction(this, NUMBER_TYPE, value, ValueMirror);
525
+ }
526
+ inherits(NumberMirror, ValueMirror);
527
+
528
+
529
+ NumberMirror.prototype.toText = function() {
530
+ return %NumberToString(this.value_);
531
+ }
532
+
533
+
534
+ /**
535
+ * Mirror object for string values.
536
+ * @param {string} value The string value reflected by this mirror
537
+ * @constructor
538
+ * @extends ValueMirror
539
+ */
540
+ function StringMirror(value) {
541
+ %_CallFunction(this, STRING_TYPE, value, ValueMirror);
542
+ }
543
+ inherits(StringMirror, ValueMirror);
544
+
545
+
546
+ StringMirror.prototype.length = function() {
547
+ return this.value_.length;
548
+ };
549
+
550
+ StringMirror.prototype.getTruncatedValue = function(maxLength) {
551
+ if (maxLength != -1 && this.length() > maxLength) {
552
+ return this.value_.substring(0, maxLength) +
553
+ '... (length: ' + this.length() + ')';
554
+ }
555
+ return this.value_;
556
+ }
557
+
558
+ StringMirror.prototype.toText = function() {
559
+ return this.getTruncatedValue(kMaxProtocolStringLength);
560
+ }
561
+
562
+
563
+ /**
564
+ * Mirror object for objects.
565
+ * @param {object} value The object reflected by this mirror
566
+ * @param {boolean} transient indicate whether this object is transient with a
567
+ * transient handle
568
+ * @constructor
569
+ * @extends ValueMirror
570
+ */
571
+ function ObjectMirror(value, type, transient) {
572
+ %_CallFunction(this, type || OBJECT_TYPE, value, transient, ValueMirror);
573
+ }
574
+ inherits(ObjectMirror, ValueMirror);
575
+
576
+
577
+ ObjectMirror.prototype.className = function() {
578
+ return %_ClassOf(this.value_);
579
+ };
580
+
581
+
582
+ ObjectMirror.prototype.constructorFunction = function() {
583
+ return MakeMirror(%DebugGetProperty(this.value_, 'constructor'));
584
+ };
585
+
586
+
587
+ ObjectMirror.prototype.prototypeObject = function() {
588
+ return MakeMirror(%DebugGetProperty(this.value_, 'prototype'));
589
+ };
590
+
591
+
592
+ ObjectMirror.prototype.protoObject = function() {
593
+ return MakeMirror(%DebugGetPrototype(this.value_));
594
+ };
595
+
596
+
597
+ ObjectMirror.prototype.hasNamedInterceptor = function() {
598
+ // Get information on interceptors for this object.
599
+ var x = %GetInterceptorInfo(this.value_);
600
+ return (x & 2) != 0;
601
+ };
602
+
603
+
604
+ ObjectMirror.prototype.hasIndexedInterceptor = function() {
605
+ // Get information on interceptors for this object.
606
+ var x = %GetInterceptorInfo(this.value_);
607
+ return (x & 1) != 0;
608
+ };
609
+
610
+
611
+ /**
612
+ * Return the property names for this object.
613
+ * @param {number} kind Indicate whether named, indexed or both kinds of
614
+ * properties are requested
615
+ * @param {number} limit Limit the number of names returend to the specified
616
+ value
617
+ * @return {Array} Property names for this object
618
+ */
619
+ ObjectMirror.prototype.propertyNames = function(kind, limit) {
620
+ // Find kind and limit and allocate array for the result
621
+ kind = kind || PropertyKind.Named | PropertyKind.Indexed;
622
+
623
+ var propertyNames;
624
+ var elementNames;
625
+ var total = 0;
626
+
627
+ // Find all the named properties.
628
+ if (kind & PropertyKind.Named) {
629
+ // Get the local property names.
630
+ propertyNames = %GetLocalPropertyNames(this.value_);
631
+ total += propertyNames.length;
632
+
633
+ // Get names for named interceptor properties if any.
634
+ if (this.hasNamedInterceptor() && (kind & PropertyKind.Named)) {
635
+ var namedInterceptorNames =
636
+ %GetNamedInterceptorPropertyNames(this.value_);
637
+ if (namedInterceptorNames) {
638
+ propertyNames = propertyNames.concat(namedInterceptorNames);
639
+ total += namedInterceptorNames.length;
640
+ }
641
+ }
642
+ }
643
+
644
+ // Find all the indexed properties.
645
+ if (kind & PropertyKind.Indexed) {
646
+ // Get the local element names.
647
+ elementNames = %GetLocalElementNames(this.value_);
648
+ total += elementNames.length;
649
+
650
+ // Get names for indexed interceptor properties.
651
+ if (this.hasIndexedInterceptor() && (kind & PropertyKind.Indexed)) {
652
+ var indexedInterceptorNames =
653
+ %GetIndexedInterceptorElementNames(this.value_);
654
+ if (indexedInterceptorNames) {
655
+ elementNames = elementNames.concat(indexedInterceptorNames);
656
+ total += indexedInterceptorNames.length;
657
+ }
658
+ }
659
+ }
660
+ limit = Math.min(limit || total, total);
661
+
662
+ var names = new Array(limit);
663
+ var index = 0;
664
+
665
+ // Copy names for named properties.
666
+ if (kind & PropertyKind.Named) {
667
+ for (var i = 0; index < limit && i < propertyNames.length; i++) {
668
+ names[index++] = propertyNames[i];
669
+ }
670
+ }
671
+
672
+ // Copy names for indexed properties.
673
+ if (kind & PropertyKind.Indexed) {
674
+ for (var i = 0; index < limit && i < elementNames.length; i++) {
675
+ names[index++] = elementNames[i];
676
+ }
677
+ }
678
+
679
+ return names;
680
+ };
681
+
682
+
683
+ /**
684
+ * Return the properties for this object as an array of PropertyMirror objects.
685
+ * @param {number} kind Indicate whether named, indexed or both kinds of
686
+ * properties are requested
687
+ * @param {number} limit Limit the number of properties returend to the
688
+ specified value
689
+ * @return {Array} Property mirrors for this object
690
+ */
691
+ ObjectMirror.prototype.properties = function(kind, limit) {
692
+ var names = this.propertyNames(kind, limit);
693
+ var properties = new Array(names.length);
694
+ for (var i = 0; i < names.length; i++) {
695
+ properties[i] = this.property(names[i]);
696
+ }
697
+
698
+ return properties;
699
+ };
700
+
701
+
702
+ ObjectMirror.prototype.property = function(name) {
703
+ var details = %DebugGetPropertyDetails(this.value_, %ToString(name));
704
+ if (details) {
705
+ return new PropertyMirror(this, name, details);
706
+ }
707
+
708
+ // Nothing found.
709
+ return GetUndefinedMirror();
710
+ };
711
+
712
+
713
+
714
+ /**
715
+ * Try to find a property from its value.
716
+ * @param {Mirror} value The property value to look for
717
+ * @return {PropertyMirror} The property with the specified value. If no
718
+ * property was found with the specified value UndefinedMirror is returned
719
+ */
720
+ ObjectMirror.prototype.lookupProperty = function(value) {
721
+ var properties = this.properties();
722
+
723
+ // Look for property value in properties.
724
+ for (var i = 0; i < properties.length; i++) {
725
+
726
+ // Skip properties which are defined through assessors.
727
+ var property = properties[i];
728
+ if (property.propertyType() != PropertyType.Callbacks) {
729
+ if (%_ObjectEquals(property.value_, value.value_)) {
730
+ return property;
731
+ }
732
+ }
733
+ }
734
+
735
+ // Nothing found.
736
+ return GetUndefinedMirror();
737
+ };
738
+
739
+
740
+ /**
741
+ * Returns objects which has direct references to this object
742
+ * @param {number} opt_max_objects Optional parameter specifying the maximum
743
+ * number of referencing objects to return.
744
+ * @return {Array} The objects which has direct references to this object.
745
+ */
746
+ ObjectMirror.prototype.referencedBy = function(opt_max_objects) {
747
+ // Find all objects with direct references to this object.
748
+ var result = %DebugReferencedBy(this.value_,
749
+ Mirror.prototype, opt_max_objects || 0);
750
+
751
+ // Make mirrors for all the references found.
752
+ for (var i = 0; i < result.length; i++) {
753
+ result[i] = MakeMirror(result[i]);
754
+ }
755
+
756
+ return result;
757
+ };
758
+
759
+
760
+ ObjectMirror.prototype.toText = function() {
761
+ var name;
762
+ var ctor = this.constructorFunction();
763
+ if (!ctor.isFunction()) {
764
+ name = this.className();
765
+ } else {
766
+ name = ctor.name();
767
+ if (!name) {
768
+ name = this.className();
769
+ }
770
+ }
771
+ return '#<' + name + '>';
772
+ };
773
+
774
+
775
+ /**
776
+ * Mirror object for functions.
777
+ * @param {function} value The function object reflected by this mirror.
778
+ * @constructor
779
+ * @extends ObjectMirror
780
+ */
781
+ function FunctionMirror(value) {
782
+ %_CallFunction(this, value, FUNCTION_TYPE, ObjectMirror);
783
+ this.resolved_ = true;
784
+ }
785
+ inherits(FunctionMirror, ObjectMirror);
786
+
787
+
788
+ /**
789
+ * Returns whether the function is resolved.
790
+ * @return {boolean} True if the function is resolved. Unresolved functions can
791
+ * only originate as functions from stack frames
792
+ */
793
+ FunctionMirror.prototype.resolved = function() {
794
+ return this.resolved_;
795
+ };
796
+
797
+
798
+ /**
799
+ * Returns the name of the function.
800
+ * @return {string} Name of the function
801
+ */
802
+ FunctionMirror.prototype.name = function() {
803
+ return %FunctionGetName(this.value_);
804
+ };
805
+
806
+
807
+ /**
808
+ * Returns the inferred name of the function.
809
+ * @return {string} Name of the function
810
+ */
811
+ FunctionMirror.prototype.inferredName = function() {
812
+ return %FunctionGetInferredName(this.value_);
813
+ };
814
+
815
+
816
+ /**
817
+ * Returns the source code for the function.
818
+ * @return {string or undefined} The source code for the function. If the
819
+ * function is not resolved undefined will be returned.
820
+ */
821
+ FunctionMirror.prototype.source = function() {
822
+ // Return source if function is resolved. Otherwise just fall through to
823
+ // return undefined.
824
+ if (this.resolved()) {
825
+ return builtins.FunctionSourceString(this.value_);
826
+ }
827
+ };
828
+
829
+
830
+ /**
831
+ * Returns the script object for the function.
832
+ * @return {ScriptMirror or undefined} Script object for the function or
833
+ * undefined if the function has no script
834
+ */
835
+ FunctionMirror.prototype.script = function() {
836
+ // Return script if function is resolved. Otherwise just fall through
837
+ // to return undefined.
838
+ if (this.resolved()) {
839
+ var script = %FunctionGetScript(this.value_);
840
+ if (script) {
841
+ return MakeMirror(script);
842
+ }
843
+ }
844
+ };
845
+
846
+
847
+ /**
848
+ * Returns the script source position for the function. Only makes sense
849
+ * for functions which has a script defined.
850
+ * @return {Number or undefined} in-script position for the function
851
+ */
852
+ FunctionMirror.prototype.sourcePosition_ = function() {
853
+ // Return script if function is resolved. Otherwise just fall through
854
+ // to return undefined.
855
+ if (this.resolved()) {
856
+ return %FunctionGetScriptSourcePosition(this.value_);
857
+ }
858
+ };
859
+
860
+
861
+ /**
862
+ * Returns the script source location object for the function. Only makes sense
863
+ * for functions which has a script defined.
864
+ * @return {Location or undefined} in-script location for the function begin
865
+ */
866
+ FunctionMirror.prototype.sourceLocation = function() {
867
+ if (this.resolved() && this.script()) {
868
+ return this.script().locationFromPosition(this.sourcePosition_(),
869
+ true);
870
+ }
871
+ };
872
+
873
+
874
+ /**
875
+ * Returns objects constructed by this function.
876
+ * @param {number} opt_max_instances Optional parameter specifying the maximum
877
+ * number of instances to return.
878
+ * @return {Array or undefined} The objects constructed by this function.
879
+ */
880
+ FunctionMirror.prototype.constructedBy = function(opt_max_instances) {
881
+ if (this.resolved()) {
882
+ // Find all objects constructed from this function.
883
+ var result = %DebugConstructedBy(this.value_, opt_max_instances || 0);
884
+
885
+ // Make mirrors for all the instances found.
886
+ for (var i = 0; i < result.length; i++) {
887
+ result[i] = MakeMirror(result[i]);
888
+ }
889
+
890
+ return result;
891
+ } else {
892
+ return [];
893
+ }
894
+ };
895
+
896
+
897
+ FunctionMirror.prototype.toText = function() {
898
+ return this.source();
899
+ }
900
+
901
+
902
+ /**
903
+ * Mirror object for unresolved functions.
904
+ * @param {string} value The name for the unresolved function reflected by this
905
+ * mirror.
906
+ * @constructor
907
+ * @extends ObjectMirror
908
+ */
909
+ function UnresolvedFunctionMirror(value) {
910
+ // Construct this using the ValueMirror as an unresolved function is not a
911
+ // real object but just a string.
912
+ %_CallFunction(this, FUNCTION_TYPE, value, ValueMirror);
913
+ this.propertyCount_ = 0;
914
+ this.elementCount_ = 0;
915
+ this.resolved_ = false;
916
+ }
917
+ inherits(UnresolvedFunctionMirror, FunctionMirror);
918
+
919
+
920
+ UnresolvedFunctionMirror.prototype.className = function() {
921
+ return 'Function';
922
+ };
923
+
924
+
925
+ UnresolvedFunctionMirror.prototype.constructorFunction = function() {
926
+ return GetUndefinedMirror();
927
+ };
928
+
929
+
930
+ UnresolvedFunctionMirror.prototype.prototypeObject = function() {
931
+ return GetUndefinedMirror();
932
+ };
933
+
934
+
935
+ UnresolvedFunctionMirror.prototype.protoObject = function() {
936
+ return GetUndefinedMirror();
937
+ };
938
+
939
+
940
+ UnresolvedFunctionMirror.prototype.name = function() {
941
+ return this.value_;
942
+ };
943
+
944
+
945
+ UnresolvedFunctionMirror.prototype.inferredName = function() {
946
+ return undefined;
947
+ };
948
+
949
+
950
+ UnresolvedFunctionMirror.prototype.propertyNames = function(kind, limit) {
951
+ return [];
952
+ }
953
+
954
+
955
+ /**
956
+ * Mirror object for arrays.
957
+ * @param {Array} value The Array object reflected by this mirror
958
+ * @constructor
959
+ * @extends ObjectMirror
960
+ */
961
+ function ArrayMirror(value) {
962
+ %_CallFunction(this, value, ObjectMirror);
963
+ }
964
+ inherits(ArrayMirror, ObjectMirror);
965
+
966
+
967
+ ArrayMirror.prototype.length = function() {
968
+ return this.value_.length;
969
+ };
970
+
971
+
972
+ ArrayMirror.prototype.indexedPropertiesFromRange = function(opt_from_index, opt_to_index) {
973
+ var from_index = opt_from_index || 0;
974
+ var to_index = opt_to_index || this.length() - 1;
975
+ if (from_index > to_index) return new Array();
976
+ var values = new Array(to_index - from_index + 1);
977
+ for (var i = from_index; i <= to_index; i++) {
978
+ var details = %DebugGetPropertyDetails(this.value_, %ToString(i));
979
+ var value;
980
+ if (details) {
981
+ value = new PropertyMirror(this, i, details);
982
+ } else {
983
+ value = GetUndefinedMirror();
984
+ }
985
+ values[i - from_index] = value;
986
+ }
987
+ return values;
988
+ }
989
+
990
+
991
+ /**
992
+ * Mirror object for dates.
993
+ * @param {Date} value The Date object reflected by this mirror
994
+ * @constructor
995
+ * @extends ObjectMirror
996
+ */
997
+ function DateMirror(value) {
998
+ %_CallFunction(this, value, ObjectMirror);
999
+ }
1000
+ inherits(DateMirror, ObjectMirror);
1001
+
1002
+
1003
+ DateMirror.prototype.toText = function() {
1004
+ var s = JSON.stringify(this.value_);
1005
+ return s.substring(1, s.length - 1); // cut quotes
1006
+ }
1007
+
1008
+
1009
+ /**
1010
+ * Mirror object for regular expressions.
1011
+ * @param {RegExp} value The RegExp object reflected by this mirror
1012
+ * @constructor
1013
+ * @extends ObjectMirror
1014
+ */
1015
+ function RegExpMirror(value) {
1016
+ %_CallFunction(this, value, REGEXP_TYPE, ObjectMirror);
1017
+ }
1018
+ inherits(RegExpMirror, ObjectMirror);
1019
+
1020
+
1021
+ /**
1022
+ * Returns the source to the regular expression.
1023
+ * @return {string or undefined} The source to the regular expression
1024
+ */
1025
+ RegExpMirror.prototype.source = function() {
1026
+ return this.value_.source;
1027
+ };
1028
+
1029
+
1030
+ /**
1031
+ * Returns whether this regular expression has the global (g) flag set.
1032
+ * @return {boolean} Value of the global flag
1033
+ */
1034
+ RegExpMirror.prototype.global = function() {
1035
+ return this.value_.global;
1036
+ };
1037
+
1038
+
1039
+ /**
1040
+ * Returns whether this regular expression has the ignore case (i) flag set.
1041
+ * @return {boolean} Value of the ignore case flag
1042
+ */
1043
+ RegExpMirror.prototype.ignoreCase = function() {
1044
+ return this.value_.ignoreCase;
1045
+ };
1046
+
1047
+
1048
+ /**
1049
+ * Returns whether this regular expression has the multiline (m) flag set.
1050
+ * @return {boolean} Value of the multiline flag
1051
+ */
1052
+ RegExpMirror.prototype.multiline = function() {
1053
+ return this.value_.multiline;
1054
+ };
1055
+
1056
+
1057
+ RegExpMirror.prototype.toText = function() {
1058
+ // Simpel to text which is used when on specialization in subclass.
1059
+ return "/" + this.source() + "/";
1060
+ }
1061
+
1062
+
1063
+ /**
1064
+ * Mirror object for error objects.
1065
+ * @param {Error} value The error object reflected by this mirror
1066
+ * @constructor
1067
+ * @extends ObjectMirror
1068
+ */
1069
+ function ErrorMirror(value) {
1070
+ %_CallFunction(this, value, ERROR_TYPE, ObjectMirror);
1071
+ }
1072
+ inherits(ErrorMirror, ObjectMirror);
1073
+
1074
+
1075
+ /**
1076
+ * Returns the message for this eror object.
1077
+ * @return {string or undefined} The message for this eror object
1078
+ */
1079
+ ErrorMirror.prototype.message = function() {
1080
+ return this.value_.message;
1081
+ };
1082
+
1083
+
1084
+ ErrorMirror.prototype.toText = function() {
1085
+ // Use the same text representation as in messages.js.
1086
+ var text;
1087
+ try {
1088
+ str = %_CallFunction(this.value_, builtins.errorToString);
1089
+ } catch (e) {
1090
+ str = '#<Error>';
1091
+ }
1092
+ return str;
1093
+ }
1094
+
1095
+
1096
+ /**
1097
+ * Base mirror object for properties.
1098
+ * @param {ObjectMirror} mirror The mirror object having this property
1099
+ * @param {string} name The name of the property
1100
+ * @param {Array} details Details about the property
1101
+ * @constructor
1102
+ * @extends Mirror
1103
+ */
1104
+ function PropertyMirror(mirror, name, details) {
1105
+ %_CallFunction(this, PROPERTY_TYPE, Mirror);
1106
+ this.mirror_ = mirror;
1107
+ this.name_ = name;
1108
+ this.value_ = details[0];
1109
+ this.details_ = details[1];
1110
+ if (details.length > 2) {
1111
+ this.exception_ = details[2]
1112
+ this.getter_ = details[3];
1113
+ this.setter_ = details[4];
1114
+ }
1115
+ }
1116
+ inherits(PropertyMirror, Mirror);
1117
+
1118
+
1119
+ PropertyMirror.prototype.isReadOnly = function() {
1120
+ return (this.attributes() & PropertyAttribute.ReadOnly) != 0;
1121
+ }
1122
+
1123
+
1124
+ PropertyMirror.prototype.isEnum = function() {
1125
+ return (this.attributes() & PropertyAttribute.DontEnum) == 0;
1126
+ }
1127
+
1128
+
1129
+ PropertyMirror.prototype.canDelete = function() {
1130
+ return (this.attributes() & PropertyAttribute.DontDelete) == 0;
1131
+ }
1132
+
1133
+
1134
+ PropertyMirror.prototype.name = function() {
1135
+ return this.name_;
1136
+ }
1137
+
1138
+
1139
+ PropertyMirror.prototype.isIndexed = function() {
1140
+ for (var i = 0; i < this.name_.length; i++) {
1141
+ if (this.name_[i] < '0' || '9' < this.name_[i]) {
1142
+ return false;
1143
+ }
1144
+ }
1145
+ return true;
1146
+ }
1147
+
1148
+
1149
+ PropertyMirror.prototype.value = function() {
1150
+ return MakeMirror(this.value_, false);
1151
+ }
1152
+
1153
+
1154
+ /**
1155
+ * Returns whether this property value is an exception.
1156
+ * @return {booolean} True if this property value is an exception
1157
+ */
1158
+ PropertyMirror.prototype.isException = function() {
1159
+ return this.exception_ ? true : false;
1160
+ }
1161
+
1162
+
1163
+ PropertyMirror.prototype.attributes = function() {
1164
+ return %DebugPropertyAttributesFromDetails(this.details_);
1165
+ }
1166
+
1167
+
1168
+ PropertyMirror.prototype.propertyType = function() {
1169
+ return %DebugPropertyTypeFromDetails(this.details_);
1170
+ }
1171
+
1172
+
1173
+ PropertyMirror.prototype.insertionIndex = function() {
1174
+ return %DebugPropertyIndexFromDetails(this.details_);
1175
+ }
1176
+
1177
+
1178
+ /**
1179
+ * Returns whether this property has a getter defined through __defineGetter__.
1180
+ * @return {booolean} True if this property has a getter
1181
+ */
1182
+ PropertyMirror.prototype.hasGetter = function() {
1183
+ return this.getter_ ? true : false;
1184
+ }
1185
+
1186
+
1187
+ /**
1188
+ * Returns whether this property has a setter defined through __defineSetter__.
1189
+ * @return {booolean} True if this property has a setter
1190
+ */
1191
+ PropertyMirror.prototype.hasSetter = function() {
1192
+ return this.setter_ ? true : false;
1193
+ }
1194
+
1195
+
1196
+ /**
1197
+ * Returns the getter for this property defined through __defineGetter__.
1198
+ * @return {Mirror} FunctionMirror reflecting the getter function or
1199
+ * UndefinedMirror if there is no getter for this property
1200
+ */
1201
+ PropertyMirror.prototype.getter = function() {
1202
+ if (this.hasGetter()) {
1203
+ return MakeMirror(this.getter_);
1204
+ } else {
1205
+ return GetUndefinedMirror();
1206
+ }
1207
+ }
1208
+
1209
+
1210
+ /**
1211
+ * Returns the setter for this property defined through __defineSetter__.
1212
+ * @return {Mirror} FunctionMirror reflecting the setter function or
1213
+ * UndefinedMirror if there is no setter for this property
1214
+ */
1215
+ PropertyMirror.prototype.setter = function() {
1216
+ if (this.hasSetter()) {
1217
+ return MakeMirror(this.setter_);
1218
+ } else {
1219
+ return GetUndefinedMirror();
1220
+ }
1221
+ }
1222
+
1223
+
1224
+ /**
1225
+ * Returns whether this property is natively implemented by the host or a set
1226
+ * through JavaScript code.
1227
+ * @return {boolean} True if the property is
1228
+ * UndefinedMirror if there is no setter for this property
1229
+ */
1230
+ PropertyMirror.prototype.isNative = function() {
1231
+ return (this.propertyType() == PropertyType.Interceptor) ||
1232
+ ((this.propertyType() == PropertyType.Callbacks) &&
1233
+ !this.hasGetter() && !this.hasSetter());
1234
+ }
1235
+
1236
+
1237
+ const kFrameDetailsFrameIdIndex = 0;
1238
+ const kFrameDetailsReceiverIndex = 1;
1239
+ const kFrameDetailsFunctionIndex = 2;
1240
+ const kFrameDetailsArgumentCountIndex = 3;
1241
+ const kFrameDetailsLocalCountIndex = 4;
1242
+ const kFrameDetailsSourcePositionIndex = 5;
1243
+ const kFrameDetailsConstructCallIndex = 6;
1244
+ const kFrameDetailsAtReturnIndex = 7;
1245
+ const kFrameDetailsDebuggerFrameIndex = 8;
1246
+ const kFrameDetailsFirstDynamicIndex = 9;
1247
+
1248
+ const kFrameDetailsNameIndex = 0;
1249
+ const kFrameDetailsValueIndex = 1;
1250
+ const kFrameDetailsNameValueSize = 2;
1251
+
1252
+ /**
1253
+ * Wrapper for the frame details information retreived from the VM. The frame
1254
+ * details from the VM is an array with the following content. See runtime.cc
1255
+ * Runtime_GetFrameDetails.
1256
+ * 0: Id
1257
+ * 1: Receiver
1258
+ * 2: Function
1259
+ * 3: Argument count
1260
+ * 4: Local count
1261
+ * 5: Source position
1262
+ * 6: Construct call
1263
+ * 7: Is at return
1264
+ * 8: Debugger frame
1265
+ * Arguments name, value
1266
+ * Locals name, value
1267
+ * Return value if any
1268
+ * @param {number} break_id Current break id
1269
+ * @param {number} index Frame number
1270
+ * @constructor
1271
+ */
1272
+ function FrameDetails(break_id, index) {
1273
+ this.break_id_ = break_id;
1274
+ this.details_ = %GetFrameDetails(break_id, index);
1275
+ }
1276
+
1277
+
1278
+ FrameDetails.prototype.frameId = function() {
1279
+ %CheckExecutionState(this.break_id_);
1280
+ return this.details_[kFrameDetailsFrameIdIndex];
1281
+ }
1282
+
1283
+
1284
+ FrameDetails.prototype.receiver = function() {
1285
+ %CheckExecutionState(this.break_id_);
1286
+ return this.details_[kFrameDetailsReceiverIndex];
1287
+ }
1288
+
1289
+
1290
+ FrameDetails.prototype.func = function() {
1291
+ %CheckExecutionState(this.break_id_);
1292
+ return this.details_[kFrameDetailsFunctionIndex];
1293
+ }
1294
+
1295
+
1296
+ FrameDetails.prototype.isConstructCall = function() {
1297
+ %CheckExecutionState(this.break_id_);
1298
+ return this.details_[kFrameDetailsConstructCallIndex];
1299
+ }
1300
+
1301
+
1302
+ FrameDetails.prototype.isAtReturn = function() {
1303
+ %CheckExecutionState(this.break_id_);
1304
+ return this.details_[kFrameDetailsAtReturnIndex];
1305
+ }
1306
+
1307
+
1308
+ FrameDetails.prototype.isDebuggerFrame = function() {
1309
+ %CheckExecutionState(this.break_id_);
1310
+ return this.details_[kFrameDetailsDebuggerFrameIndex];
1311
+ }
1312
+
1313
+
1314
+ FrameDetails.prototype.argumentCount = function() {
1315
+ %CheckExecutionState(this.break_id_);
1316
+ return this.details_[kFrameDetailsArgumentCountIndex];
1317
+ }
1318
+
1319
+
1320
+ FrameDetails.prototype.argumentName = function(index) {
1321
+ %CheckExecutionState(this.break_id_);
1322
+ if (index >= 0 && index < this.argumentCount()) {
1323
+ return this.details_[kFrameDetailsFirstDynamicIndex +
1324
+ index * kFrameDetailsNameValueSize +
1325
+ kFrameDetailsNameIndex]
1326
+ }
1327
+ }
1328
+
1329
+
1330
+ FrameDetails.prototype.argumentValue = function(index) {
1331
+ %CheckExecutionState(this.break_id_);
1332
+ if (index >= 0 && index < this.argumentCount()) {
1333
+ return this.details_[kFrameDetailsFirstDynamicIndex +
1334
+ index * kFrameDetailsNameValueSize +
1335
+ kFrameDetailsValueIndex]
1336
+ }
1337
+ }
1338
+
1339
+
1340
+ FrameDetails.prototype.localCount = function() {
1341
+ %CheckExecutionState(this.break_id_);
1342
+ return this.details_[kFrameDetailsLocalCountIndex];
1343
+ }
1344
+
1345
+
1346
+ FrameDetails.prototype.sourcePosition = function() {
1347
+ %CheckExecutionState(this.break_id_);
1348
+ return this.details_[kFrameDetailsSourcePositionIndex];
1349
+ }
1350
+
1351
+
1352
+ FrameDetails.prototype.localName = function(index) {
1353
+ %CheckExecutionState(this.break_id_);
1354
+ if (index >= 0 && index < this.localCount()) {
1355
+ var locals_offset = kFrameDetailsFirstDynamicIndex +
1356
+ this.argumentCount() * kFrameDetailsNameValueSize
1357
+ return this.details_[locals_offset +
1358
+ index * kFrameDetailsNameValueSize +
1359
+ kFrameDetailsNameIndex]
1360
+ }
1361
+ }
1362
+
1363
+
1364
+ FrameDetails.prototype.localValue = function(index) {
1365
+ %CheckExecutionState(this.break_id_);
1366
+ if (index >= 0 && index < this.localCount()) {
1367
+ var locals_offset = kFrameDetailsFirstDynamicIndex +
1368
+ this.argumentCount() * kFrameDetailsNameValueSize
1369
+ return this.details_[locals_offset +
1370
+ index * kFrameDetailsNameValueSize +
1371
+ kFrameDetailsValueIndex]
1372
+ }
1373
+ }
1374
+
1375
+
1376
+ FrameDetails.prototype.returnValue = function() {
1377
+ %CheckExecutionState(this.break_id_);
1378
+ var return_value_offset =
1379
+ kFrameDetailsFirstDynamicIndex +
1380
+ (this.argumentCount() + this.localCount()) * kFrameDetailsNameValueSize;
1381
+ if (this.details_[kFrameDetailsAtReturnIndex]) {
1382
+ return this.details_[return_value_offset];
1383
+ }
1384
+ }
1385
+
1386
+
1387
+ FrameDetails.prototype.scopeCount = function() {
1388
+ return %GetScopeCount(this.break_id_, this.frameId());
1389
+ }
1390
+
1391
+
1392
+ /**
1393
+ * Mirror object for stack frames.
1394
+ * @param {number} break_id The break id in the VM for which this frame is
1395
+ valid
1396
+ * @param {number} index The frame index (top frame is index 0)
1397
+ * @constructor
1398
+ * @extends Mirror
1399
+ */
1400
+ function FrameMirror(break_id, index) {
1401
+ %_CallFunction(this, FRAME_TYPE, Mirror);
1402
+ this.break_id_ = break_id;
1403
+ this.index_ = index;
1404
+ this.details_ = new FrameDetails(break_id, index);
1405
+ }
1406
+ inherits(FrameMirror, Mirror);
1407
+
1408
+
1409
+ FrameMirror.prototype.index = function() {
1410
+ return this.index_;
1411
+ };
1412
+
1413
+
1414
+ FrameMirror.prototype.func = function() {
1415
+ // Get the function for this frame from the VM.
1416
+ var f = this.details_.func();
1417
+
1418
+ // Create a function mirror. NOTE: MakeMirror cannot be used here as the
1419
+ // value returned from the VM might be a string if the function for the
1420
+ // frame is unresolved.
1421
+ if (IS_FUNCTION(f)) {
1422
+ return MakeMirror(f);
1423
+ } else {
1424
+ return new UnresolvedFunctionMirror(f);
1425
+ }
1426
+ };
1427
+
1428
+
1429
+ FrameMirror.prototype.receiver = function() {
1430
+ return MakeMirror(this.details_.receiver());
1431
+ };
1432
+
1433
+
1434
+ FrameMirror.prototype.isConstructCall = function() {
1435
+ return this.details_.isConstructCall();
1436
+ };
1437
+
1438
+
1439
+ FrameMirror.prototype.isAtReturn = function() {
1440
+ return this.details_.isAtReturn();
1441
+ };
1442
+
1443
+
1444
+ FrameMirror.prototype.isDebuggerFrame = function() {
1445
+ return this.details_.isDebuggerFrame();
1446
+ };
1447
+
1448
+
1449
+ FrameMirror.prototype.argumentCount = function() {
1450
+ return this.details_.argumentCount();
1451
+ };
1452
+
1453
+
1454
+ FrameMirror.prototype.argumentName = function(index) {
1455
+ return this.details_.argumentName(index);
1456
+ };
1457
+
1458
+
1459
+ FrameMirror.prototype.argumentValue = function(index) {
1460
+ return MakeMirror(this.details_.argumentValue(index));
1461
+ };
1462
+
1463
+
1464
+ FrameMirror.prototype.localCount = function() {
1465
+ return this.details_.localCount();
1466
+ };
1467
+
1468
+
1469
+ FrameMirror.prototype.localName = function(index) {
1470
+ return this.details_.localName(index);
1471
+ };
1472
+
1473
+
1474
+ FrameMirror.prototype.localValue = function(index) {
1475
+ return MakeMirror(this.details_.localValue(index));
1476
+ };
1477
+
1478
+
1479
+ FrameMirror.prototype.returnValue = function() {
1480
+ return MakeMirror(this.details_.returnValue());
1481
+ };
1482
+
1483
+
1484
+ FrameMirror.prototype.sourcePosition = function() {
1485
+ return this.details_.sourcePosition();
1486
+ };
1487
+
1488
+
1489
+ FrameMirror.prototype.sourceLocation = function() {
1490
+ if (this.func().resolved() && this.func().script()) {
1491
+ return this.func().script().locationFromPosition(this.sourcePosition(),
1492
+ true);
1493
+ }
1494
+ };
1495
+
1496
+
1497
+ FrameMirror.prototype.sourceLine = function() {
1498
+ if (this.func().resolved()) {
1499
+ var location = this.sourceLocation();
1500
+ if (location) {
1501
+ return location.line;
1502
+ }
1503
+ }
1504
+ };
1505
+
1506
+
1507
+ FrameMirror.prototype.sourceColumn = function() {
1508
+ if (this.func().resolved()) {
1509
+ var location = this.sourceLocation();
1510
+ if (location) {
1511
+ return location.column;
1512
+ }
1513
+ }
1514
+ };
1515
+
1516
+
1517
+ FrameMirror.prototype.sourceLineText = function() {
1518
+ if (this.func().resolved()) {
1519
+ var location = this.sourceLocation();
1520
+ if (location) {
1521
+ return location.sourceText();
1522
+ }
1523
+ }
1524
+ };
1525
+
1526
+
1527
+ FrameMirror.prototype.scopeCount = function() {
1528
+ return this.details_.scopeCount();
1529
+ };
1530
+
1531
+
1532
+ FrameMirror.prototype.scope = function(index) {
1533
+ return new ScopeMirror(this, index);
1534
+ };
1535
+
1536
+
1537
+ FrameMirror.prototype.evaluate = function(source, disable_break, opt_context_object) {
1538
+ var result = %DebugEvaluate(this.break_id_, this.details_.frameId(),
1539
+ source, Boolean(disable_break), opt_context_object);
1540
+ return MakeMirror(result);
1541
+ };
1542
+
1543
+
1544
+ FrameMirror.prototype.invocationText = function() {
1545
+ // Format frame invoaction (receiver, function and arguments).
1546
+ var result = '';
1547
+ var func = this.func();
1548
+ var receiver = this.receiver();
1549
+ if (this.isConstructCall()) {
1550
+ // For constructor frames display new followed by the function name.
1551
+ result += 'new ';
1552
+ result += func.name() ? func.name() : '[anonymous]';
1553
+ } else if (this.isDebuggerFrame()) {
1554
+ result += '[debugger]';
1555
+ } else {
1556
+ // If the receiver has a className which is 'global' don't display it.
1557
+ var display_receiver = !receiver.className || receiver.className() != 'global';
1558
+ if (display_receiver) {
1559
+ result += receiver.toText();
1560
+ }
1561
+ // Try to find the function as a property in the receiver. Include the
1562
+ // prototype chain in the lookup.
1563
+ var property = GetUndefinedMirror();
1564
+ if (!receiver.isUndefined()) {
1565
+ for (var r = receiver; !r.isNull() && property.isUndefined(); r = r.protoObject()) {
1566
+ property = r.lookupProperty(func);
1567
+ }
1568
+ }
1569
+ if (!property.isUndefined()) {
1570
+ // The function invoked was found on the receiver. Use the property name
1571
+ // for the backtrace.
1572
+ if (!property.isIndexed()) {
1573
+ if (display_receiver) {
1574
+ result += '.';
1575
+ }
1576
+ result += property.name();
1577
+ } else {
1578
+ result += '[';
1579
+ result += property.name();
1580
+ result += ']';
1581
+ }
1582
+ // Also known as - if the name in the function doesn't match the name
1583
+ // under which it was looked up.
1584
+ if (func.name() && func.name() != property.name()) {
1585
+ result += '(aka ' + func.name() + ')';
1586
+ }
1587
+ } else {
1588
+ // The function invoked was not found on the receiver. Use the function
1589
+ // name if available for the backtrace.
1590
+ if (display_receiver) {
1591
+ result += '.';
1592
+ }
1593
+ result += func.name() ? func.name() : '[anonymous]';
1594
+ }
1595
+ }
1596
+
1597
+ // Render arguments for normal frames.
1598
+ if (!this.isDebuggerFrame()) {
1599
+ result += '(';
1600
+ for (var i = 0; i < this.argumentCount(); i++) {
1601
+ if (i != 0) result += ', ';
1602
+ if (this.argumentName(i)) {
1603
+ result += this.argumentName(i);
1604
+ result += '=';
1605
+ }
1606
+ result += this.argumentValue(i).toText();
1607
+ }
1608
+ result += ')';
1609
+ }
1610
+
1611
+ if (this.isAtReturn()) {
1612
+ result += ' returning ';
1613
+ result += this.returnValue().toText();
1614
+ }
1615
+
1616
+ return result;
1617
+ }
1618
+
1619
+
1620
+ FrameMirror.prototype.sourceAndPositionText = function() {
1621
+ // Format source and position.
1622
+ var result = '';
1623
+ var func = this.func();
1624
+ if (func.resolved()) {
1625
+ if (func.script()) {
1626
+ if (func.script().name()) {
1627
+ result += func.script().name();
1628
+ } else {
1629
+ result += '[unnamed]';
1630
+ }
1631
+ if (!this.isDebuggerFrame()) {
1632
+ var location = this.sourceLocation();
1633
+ result += ' line ';
1634
+ result += !IS_UNDEFINED(location) ? (location.line + 1) : '?';
1635
+ result += ' column ';
1636
+ result += !IS_UNDEFINED(location) ? (location.column + 1) : '?';
1637
+ if (!IS_UNDEFINED(this.sourcePosition())) {
1638
+ result += ' (position ' + (this.sourcePosition() + 1) + ')';
1639
+ }
1640
+ }
1641
+ } else {
1642
+ result += '[no source]';
1643
+ }
1644
+ } else {
1645
+ result += '[unresolved]';
1646
+ }
1647
+
1648
+ return result;
1649
+ }
1650
+
1651
+
1652
+ FrameMirror.prototype.localsText = function() {
1653
+ // Format local variables.
1654
+ var result = '';
1655
+ var locals_count = this.localCount()
1656
+ if (locals_count > 0) {
1657
+ for (var i = 0; i < locals_count; ++i) {
1658
+ result += ' var ';
1659
+ result += this.localName(i);
1660
+ result += ' = ';
1661
+ result += this.localValue(i).toText();
1662
+ if (i < locals_count - 1) result += '\n';
1663
+ }
1664
+ }
1665
+
1666
+ return result;
1667
+ }
1668
+
1669
+
1670
+ FrameMirror.prototype.toText = function(opt_locals) {
1671
+ var result = '';
1672
+ result += '#' + (this.index() <= 9 ? '0' : '') + this.index();
1673
+ result += ' ';
1674
+ result += this.invocationText();
1675
+ result += ' ';
1676
+ result += this.sourceAndPositionText();
1677
+ if (opt_locals) {
1678
+ result += '\n';
1679
+ result += this.localsText();
1680
+ }
1681
+ return result;
1682
+ }
1683
+
1684
+
1685
+ const kScopeDetailsTypeIndex = 0;
1686
+ const kScopeDetailsObjectIndex = 1;
1687
+
1688
+ function ScopeDetails(frame, index) {
1689
+ this.break_id_ = frame.break_id_;
1690
+ this.details_ = %GetScopeDetails(frame.break_id_,
1691
+ frame.details_.frameId(),
1692
+ index);
1693
+ }
1694
+
1695
+
1696
+ ScopeDetails.prototype.type = function() {
1697
+ %CheckExecutionState(this.break_id_);
1698
+ return this.details_[kScopeDetailsTypeIndex];
1699
+ }
1700
+
1701
+
1702
+ ScopeDetails.prototype.object = function() {
1703
+ %CheckExecutionState(this.break_id_);
1704
+ return this.details_[kScopeDetailsObjectIndex];
1705
+ }
1706
+
1707
+
1708
+ /**
1709
+ * Mirror object for scope.
1710
+ * @param {FrameMirror} frame The frame this scope is a part of
1711
+ * @param {number} index The scope index in the frame
1712
+ * @constructor
1713
+ * @extends Mirror
1714
+ */
1715
+ function ScopeMirror(frame, index) {
1716
+ %_CallFunction(this, SCOPE_TYPE, Mirror);
1717
+ this.frame_index_ = frame.index_;
1718
+ this.scope_index_ = index;
1719
+ this.details_ = new ScopeDetails(frame, index);
1720
+ }
1721
+ inherits(ScopeMirror, Mirror);
1722
+
1723
+
1724
+ ScopeMirror.prototype.frameIndex = function() {
1725
+ return this.frame_index_;
1726
+ };
1727
+
1728
+
1729
+ ScopeMirror.prototype.scopeIndex = function() {
1730
+ return this.scope_index_;
1731
+ };
1732
+
1733
+
1734
+ ScopeMirror.prototype.scopeType = function() {
1735
+ return this.details_.type();
1736
+ };
1737
+
1738
+
1739
+ ScopeMirror.prototype.scopeObject = function() {
1740
+ // For local and closure scopes create a transient mirror as these objects are
1741
+ // created on the fly materializing the local or closure scopes and
1742
+ // therefore will not preserve identity.
1743
+ var transient = this.scopeType() == ScopeType.Local ||
1744
+ this.scopeType() == ScopeType.Closure;
1745
+ return MakeMirror(this.details_.object(), transient);
1746
+ };
1747
+
1748
+
1749
+ /**
1750
+ * Mirror object for script source.
1751
+ * @param {Script} script The script object
1752
+ * @constructor
1753
+ * @extends Mirror
1754
+ */
1755
+ function ScriptMirror(script) {
1756
+ %_CallFunction(this, SCRIPT_TYPE, Mirror);
1757
+ this.script_ = script;
1758
+ this.context_ = new ContextMirror(script.context_data);
1759
+ this.allocateHandle_();
1760
+ }
1761
+ inherits(ScriptMirror, Mirror);
1762
+
1763
+
1764
+ ScriptMirror.prototype.value = function() {
1765
+ return this.script_;
1766
+ };
1767
+
1768
+
1769
+ ScriptMirror.prototype.name = function() {
1770
+ return this.script_.name || this.script_.nameOrSourceURL();
1771
+ };
1772
+
1773
+
1774
+ ScriptMirror.prototype.id = function() {
1775
+ return this.script_.id;
1776
+ };
1777
+
1778
+
1779
+ ScriptMirror.prototype.source = function() {
1780
+ return this.script_.source;
1781
+ };
1782
+
1783
+
1784
+ ScriptMirror.prototype.lineOffset = function() {
1785
+ return this.script_.line_offset;
1786
+ };
1787
+
1788
+
1789
+ ScriptMirror.prototype.columnOffset = function() {
1790
+ return this.script_.column_offset;
1791
+ };
1792
+
1793
+
1794
+ ScriptMirror.prototype.data = function() {
1795
+ return this.script_.data;
1796
+ };
1797
+
1798
+
1799
+ ScriptMirror.prototype.scriptType = function() {
1800
+ return this.script_.type;
1801
+ };
1802
+
1803
+
1804
+ ScriptMirror.prototype.compilationType = function() {
1805
+ return this.script_.compilation_type;
1806
+ };
1807
+
1808
+
1809
+ ScriptMirror.prototype.lineCount = function() {
1810
+ return this.script_.lineCount();
1811
+ };
1812
+
1813
+
1814
+ ScriptMirror.prototype.locationFromPosition = function(
1815
+ position, include_resource_offset) {
1816
+ return this.script_.locationFromPosition(position, include_resource_offset);
1817
+ }
1818
+
1819
+
1820
+ ScriptMirror.prototype.sourceSlice = function (opt_from_line, opt_to_line) {
1821
+ return this.script_.sourceSlice(opt_from_line, opt_to_line);
1822
+ }
1823
+
1824
+
1825
+ ScriptMirror.prototype.context = function() {
1826
+ return this.context_;
1827
+ };
1828
+
1829
+
1830
+ ScriptMirror.prototype.evalFromScript = function() {
1831
+ return MakeMirror(this.script_.eval_from_script);
1832
+ };
1833
+
1834
+
1835
+ ScriptMirror.prototype.evalFromFunctionName = function() {
1836
+ return MakeMirror(this.script_.eval_from_function_name);
1837
+ };
1838
+
1839
+
1840
+ ScriptMirror.prototype.evalFromLocation = function() {
1841
+ var eval_from_script = this.evalFromScript();
1842
+ if (!eval_from_script.isUndefined()) {
1843
+ var position = this.script_.eval_from_script_position;
1844
+ return eval_from_script.locationFromPosition(position, true);
1845
+ }
1846
+ };
1847
+
1848
+
1849
+ ScriptMirror.prototype.toText = function() {
1850
+ var result = '';
1851
+ result += this.name();
1852
+ result += ' (lines: ';
1853
+ if (this.lineOffset() > 0) {
1854
+ result += this.lineOffset();
1855
+ result += '-';
1856
+ result += this.lineOffset() + this.lineCount() - 1;
1857
+ } else {
1858
+ result += this.lineCount();
1859
+ }
1860
+ result += ')';
1861
+ return result;
1862
+ }
1863
+
1864
+
1865
+ /**
1866
+ * Mirror object for context.
1867
+ * @param {Object} data The context data
1868
+ * @constructor
1869
+ * @extends Mirror
1870
+ */
1871
+ function ContextMirror(data) {
1872
+ %_CallFunction(this, CONTEXT_TYPE, Mirror);
1873
+ this.data_ = data;
1874
+ this.allocateHandle_();
1875
+ }
1876
+ inherits(ContextMirror, Mirror);
1877
+
1878
+
1879
+ ContextMirror.prototype.data = function() {
1880
+ return this.data_;
1881
+ };
1882
+
1883
+
1884
+ /**
1885
+ * Returns a mirror serializer
1886
+ *
1887
+ * @param {boolean} details Set to true to include details
1888
+ * @param {Object} options Options comtrolling the serialization
1889
+ * The following options can be set:
1890
+ * includeSource: include ths full source of scripts
1891
+ * @returns {MirrorSerializer} mirror serializer
1892
+ */
1893
+ function MakeMirrorSerializer(details, options) {
1894
+ return new JSONProtocolSerializer(details, options);
1895
+ }
1896
+
1897
+
1898
+ /**
1899
+ * Object for serializing a mirror objects and its direct references.
1900
+ * @param {boolean} details Indicates whether to include details for the mirror
1901
+ * serialized
1902
+ * @constructor
1903
+ */
1904
+ function JSONProtocolSerializer(details, options) {
1905
+ this.details_ = details;
1906
+ this.options_ = options;
1907
+ this.mirrors_ = [ ];
1908
+ }
1909
+
1910
+
1911
+ /**
1912
+ * Returns a serialization of an object reference. The referenced object are
1913
+ * added to the serialization state.
1914
+ *
1915
+ * @param {Mirror} mirror The mirror to serialize
1916
+ * @returns {String} JSON serialization
1917
+ */
1918
+ JSONProtocolSerializer.prototype.serializeReference = function(mirror) {
1919
+ return this.serialize_(mirror, true, true);
1920
+ }
1921
+
1922
+
1923
+ /**
1924
+ * Returns a serialization of an object value. The referenced objects are
1925
+ * added to the serialization state.
1926
+ *
1927
+ * @param {Mirror} mirror The mirror to serialize
1928
+ * @returns {String} JSON serialization
1929
+ */
1930
+ JSONProtocolSerializer.prototype.serializeValue = function(mirror) {
1931
+ var json = this.serialize_(mirror, false, true);
1932
+ return json;
1933
+ }
1934
+
1935
+
1936
+ /**
1937
+ * Returns a serialization of all the objects referenced.
1938
+ *
1939
+ * @param {Mirror} mirror The mirror to serialize.
1940
+ * @returns {Array.<Object>} Array of the referenced objects converted to
1941
+ * protcol objects.
1942
+ */
1943
+ JSONProtocolSerializer.prototype.serializeReferencedObjects = function() {
1944
+ // Collect the protocol representation of the referenced objects in an array.
1945
+ var content = [];
1946
+
1947
+ // Get the number of referenced objects.
1948
+ var count = this.mirrors_.length;
1949
+
1950
+ for (var i = 0; i < count; i++) {
1951
+ content.push(this.serialize_(this.mirrors_[i], false, false));
1952
+ }
1953
+
1954
+ return content;
1955
+ }
1956
+
1957
+
1958
+ JSONProtocolSerializer.prototype.includeSource_ = function() {
1959
+ return this.options_ && this.options_.includeSource;
1960
+ }
1961
+
1962
+
1963
+ JSONProtocolSerializer.prototype.inlineRefs_ = function() {
1964
+ return this.options_ && this.options_.inlineRefs;
1965
+ }
1966
+
1967
+
1968
+ JSONProtocolSerializer.prototype.maxStringLength_ = function() {
1969
+ if (IS_UNDEFINED(this.options_) ||
1970
+ IS_UNDEFINED(this.options_.maxStringLength)) {
1971
+ return kMaxProtocolStringLength;
1972
+ }
1973
+ return this.options_.maxStringLength;
1974
+ }
1975
+
1976
+
1977
+ JSONProtocolSerializer.prototype.add_ = function(mirror) {
1978
+ // If this mirror is already in the list just return.
1979
+ for (var i = 0; i < this.mirrors_.length; i++) {
1980
+ if (this.mirrors_[i] === mirror) {
1981
+ return;
1982
+ }
1983
+ }
1984
+
1985
+ // Add the mirror to the list of mirrors to be serialized.
1986
+ this.mirrors_.push(mirror);
1987
+ }
1988
+
1989
+
1990
+ /**
1991
+ * Formats mirror object to protocol reference object with some data that can
1992
+ * be used to display the value in debugger.
1993
+ * @param {Mirror} mirror Mirror to serialize.
1994
+ * @return {Object} Protocol reference object.
1995
+ */
1996
+ JSONProtocolSerializer.prototype.serializeReferenceWithDisplayData_ =
1997
+ function(mirror) {
1998
+ var o = {};
1999
+ o.ref = mirror.handle();
2000
+ o.type = mirror.type();
2001
+ switch (mirror.type()) {
2002
+ case UNDEFINED_TYPE:
2003
+ case NULL_TYPE:
2004
+ case BOOLEAN_TYPE:
2005
+ case NUMBER_TYPE:
2006
+ o.value = mirror.value();
2007
+ break;
2008
+ case STRING_TYPE:
2009
+ o.value = mirror.getTruncatedValue(this.maxStringLength_());
2010
+ break;
2011
+ case FUNCTION_TYPE:
2012
+ o.name = mirror.name();
2013
+ o.inferredName = mirror.inferredName();
2014
+ if (mirror.script()) {
2015
+ o.scriptId = mirror.script().id();
2016
+ }
2017
+ break;
2018
+ case ERROR_TYPE:
2019
+ case REGEXP_TYPE:
2020
+ o.value = mirror.toText();
2021
+ break;
2022
+ case OBJECT_TYPE:
2023
+ o.className = mirror.className();
2024
+ break;
2025
+ }
2026
+ return o;
2027
+ };
2028
+
2029
+
2030
+ JSONProtocolSerializer.prototype.serialize_ = function(mirror, reference,
2031
+ details) {
2032
+ // If serializing a reference to a mirror just return the reference and add
2033
+ // the mirror to the referenced mirrors.
2034
+ if (reference &&
2035
+ (mirror.isValue() || mirror.isScript() || mirror.isContext())) {
2036
+ if (this.inlineRefs_() && mirror.isValue()) {
2037
+ return this.serializeReferenceWithDisplayData_(mirror);
2038
+ } else {
2039
+ this.add_(mirror);
2040
+ return {'ref' : mirror.handle()};
2041
+ }
2042
+ }
2043
+
2044
+ // Collect the JSON property/value pairs.
2045
+ var content = {};
2046
+
2047
+ // Add the mirror handle.
2048
+ if (mirror.isValue() || mirror.isScript() || mirror.isContext()) {
2049
+ content.handle = mirror.handle();
2050
+ }
2051
+
2052
+ // Always add the type.
2053
+ content.type = mirror.type();
2054
+
2055
+ switch (mirror.type()) {
2056
+ case UNDEFINED_TYPE:
2057
+ case NULL_TYPE:
2058
+ // Undefined and null are represented just by their type.
2059
+ break;
2060
+
2061
+ case BOOLEAN_TYPE:
2062
+ // Boolean values are simply represented by their value.
2063
+ content.value = mirror.value();
2064
+ break;
2065
+
2066
+ case NUMBER_TYPE:
2067
+ // Number values are simply represented by their value.
2068
+ content.value = NumberToJSON_(mirror.value());
2069
+ break;
2070
+
2071
+ case STRING_TYPE:
2072
+ // String values might have their value cropped to keep down size.
2073
+ if (this.maxStringLength_() != -1 &&
2074
+ mirror.length() > this.maxStringLength_()) {
2075
+ var str = mirror.getTruncatedValue(this.maxStringLength_());
2076
+ content.value = str;
2077
+ content.fromIndex = 0;
2078
+ content.toIndex = this.maxStringLength_();
2079
+ } else {
2080
+ content.value = mirror.value();
2081
+ }
2082
+ content.length = mirror.length();
2083
+ break;
2084
+
2085
+ case OBJECT_TYPE:
2086
+ case FUNCTION_TYPE:
2087
+ case ERROR_TYPE:
2088
+ case REGEXP_TYPE:
2089
+ // Add object representation.
2090
+ this.serializeObject_(mirror, content, details);
2091
+ break;
2092
+
2093
+ case PROPERTY_TYPE:
2094
+ throw new Error('PropertyMirror cannot be serialized independeltly')
2095
+ break;
2096
+
2097
+ case FRAME_TYPE:
2098
+ // Add object representation.
2099
+ this.serializeFrame_(mirror, content);
2100
+ break;
2101
+
2102
+ case SCOPE_TYPE:
2103
+ // Add object representation.
2104
+ this.serializeScope_(mirror, content);
2105
+ break;
2106
+
2107
+ case SCRIPT_TYPE:
2108
+ // Script is represented by id, name and source attributes.
2109
+ if (mirror.name()) {
2110
+ content.name = mirror.name();
2111
+ }
2112
+ content.id = mirror.id();
2113
+ content.lineOffset = mirror.lineOffset();
2114
+ content.columnOffset = mirror.columnOffset();
2115
+ content.lineCount = mirror.lineCount();
2116
+ if (mirror.data()) {
2117
+ content.data = mirror.data();
2118
+ }
2119
+ if (this.includeSource_()) {
2120
+ content.source = mirror.source();
2121
+ } else {
2122
+ var sourceStart = mirror.source().substring(0, 80);
2123
+ content.sourceStart = sourceStart;
2124
+ }
2125
+ content.sourceLength = mirror.source().length;
2126
+ content.scriptType = mirror.scriptType();
2127
+ content.compilationType = mirror.compilationType();
2128
+ // For compilation type eval emit information on the script from which
2129
+ // eval was called if a script is present.
2130
+ if (mirror.compilationType() == 1 &&
2131
+ mirror.evalFromScript()) {
2132
+ content.evalFromScript =
2133
+ this.serializeReference(mirror.evalFromScript());
2134
+ var evalFromLocation = mirror.evalFromLocation()
2135
+ if (evalFromLocation) {
2136
+ content.evalFromLocation = { line: evalFromLocation.line,
2137
+ column: evalFromLocation.column };
2138
+ }
2139
+ if (mirror.evalFromFunctionName()) {
2140
+ content.evalFromFunctionName = mirror.evalFromFunctionName();
2141
+ }
2142
+ }
2143
+ if (mirror.context()) {
2144
+ content.context = this.serializeReference(mirror.context());
2145
+ }
2146
+ break;
2147
+
2148
+ case CONTEXT_TYPE:
2149
+ content.data = mirror.data();
2150
+ break;
2151
+ }
2152
+
2153
+ // Always add the text representation.
2154
+ content.text = mirror.toText();
2155
+
2156
+ // Create and return the JSON string.
2157
+ return content;
2158
+ }
2159
+
2160
+
2161
+ /**
2162
+ * Serialize object information to the following JSON format.
2163
+ *
2164
+ * {"className":"<class name>",
2165
+ * "constructorFunction":{"ref":<number>},
2166
+ * "protoObject":{"ref":<number>},
2167
+ * "prototypeObject":{"ref":<number>},
2168
+ * "namedInterceptor":<boolean>,
2169
+ * "indexedInterceptor":<boolean>,
2170
+ * "properties":[<properties>]}
2171
+ */
2172
+ JSONProtocolSerializer.prototype.serializeObject_ = function(mirror, content,
2173
+ details) {
2174
+ // Add general object properties.
2175
+ content.className = mirror.className();
2176
+ content.constructorFunction =
2177
+ this.serializeReference(mirror.constructorFunction());
2178
+ content.protoObject = this.serializeReference(mirror.protoObject());
2179
+ content.prototypeObject = this.serializeReference(mirror.prototypeObject());
2180
+
2181
+ // Add flags to indicate whether there are interceptors.
2182
+ if (mirror.hasNamedInterceptor()) {
2183
+ content.namedInterceptor = true;
2184
+ }
2185
+ if (mirror.hasIndexedInterceptor()) {
2186
+ content.indexedInterceptor = true;
2187
+ }
2188
+
2189
+ // Add function specific properties.
2190
+ if (mirror.isFunction()) {
2191
+ // Add function specific properties.
2192
+ content.name = mirror.name();
2193
+ if (!IS_UNDEFINED(mirror.inferredName())) {
2194
+ content.inferredName = mirror.inferredName();
2195
+ }
2196
+ content.resolved = mirror.resolved();
2197
+ if (mirror.resolved()) {
2198
+ content.source = mirror.source();
2199
+ }
2200
+ if (mirror.script()) {
2201
+ content.script = this.serializeReference(mirror.script());
2202
+ content.scriptId = mirror.script().id();
2203
+
2204
+ serializeLocationFields(mirror.sourceLocation(), content);
2205
+ }
2206
+ }
2207
+
2208
+ // Add date specific properties.
2209
+ if (mirror.isDate()) {
2210
+ // Add date specific properties.
2211
+ content.value = mirror.value();
2212
+ }
2213
+
2214
+ // Add actual properties - named properties followed by indexed properties.
2215
+ var propertyNames = mirror.propertyNames(PropertyKind.Named);
2216
+ var propertyIndexes = mirror.propertyNames(PropertyKind.Indexed);
2217
+ var p = new Array(propertyNames.length + propertyIndexes.length);
2218
+ for (var i = 0; i < propertyNames.length; i++) {
2219
+ var propertyMirror = mirror.property(propertyNames[i]);
2220
+ p[i] = this.serializeProperty_(propertyMirror);
2221
+ if (details) {
2222
+ this.add_(propertyMirror.value());
2223
+ }
2224
+ }
2225
+ for (var i = 0; i < propertyIndexes.length; i++) {
2226
+ var propertyMirror = mirror.property(propertyIndexes[i]);
2227
+ p[propertyNames.length + i] = this.serializeProperty_(propertyMirror);
2228
+ if (details) {
2229
+ this.add_(propertyMirror.value());
2230
+ }
2231
+ }
2232
+ content.properties = p;
2233
+ }
2234
+
2235
+
2236
+ /**
2237
+ * Serialize location information to the following JSON format:
2238
+ *
2239
+ * "position":"<position>",
2240
+ * "line":"<line>",
2241
+ * "column":"<column>",
2242
+ *
2243
+ * @param {SourceLocation} location The location to serialize, may be undefined.
2244
+ */
2245
+ function serializeLocationFields (location, content) {
2246
+ if (!location) {
2247
+ return;
2248
+ }
2249
+ content.position = location.position;
2250
+ var line = location.line;
2251
+ if (!IS_UNDEFINED(line)) {
2252
+ content.line = line;
2253
+ }
2254
+ var column = location.column;
2255
+ if (!IS_UNDEFINED(column)) {
2256
+ content.column = column;
2257
+ }
2258
+ }
2259
+
2260
+
2261
+ /**
2262
+ * Serialize property information to the following JSON format for building the
2263
+ * array of properties.
2264
+ *
2265
+ * {"name":"<property name>",
2266
+ * "attributes":<number>,
2267
+ * "propertyType":<number>,
2268
+ * "ref":<number>}
2269
+ *
2270
+ * If the attribute for the property is PropertyAttribute.None it is not added.
2271
+ * If the propertyType for the property is PropertyType.Normal it is not added.
2272
+ * Here are a couple of examples.
2273
+ *
2274
+ * {"name":"hello","ref":1}
2275
+ * {"name":"length","attributes":7,"propertyType":3,"ref":2}
2276
+ *
2277
+ * @param {PropertyMirror} propertyMirror The property to serialize.
2278
+ * @returns {Object} Protocol object representing the property.
2279
+ */
2280
+ JSONProtocolSerializer.prototype.serializeProperty_ = function(propertyMirror) {
2281
+ var result = {};
2282
+
2283
+ result.name = propertyMirror.name();
2284
+ var propertyValue = propertyMirror.value();
2285
+ if (this.inlineRefs_() && propertyValue.isValue()) {
2286
+ result.value = this.serializeReferenceWithDisplayData_(propertyValue);
2287
+ } else {
2288
+ if (propertyMirror.attributes() != PropertyAttribute.None) {
2289
+ result.attributes = propertyMirror.attributes();
2290
+ }
2291
+ if (propertyMirror.propertyType() != PropertyType.Normal) {
2292
+ result.propertyType = propertyMirror.propertyType();
2293
+ }
2294
+ result.ref = propertyValue.handle();
2295
+ }
2296
+ return result;
2297
+ }
2298
+
2299
+
2300
+ JSONProtocolSerializer.prototype.serializeFrame_ = function(mirror, content) {
2301
+ content.index = mirror.index();
2302
+ content.receiver = this.serializeReference(mirror.receiver());
2303
+ var func = mirror.func();
2304
+ content.func = this.serializeReference(func);
2305
+ if (func.script()) {
2306
+ content.script = this.serializeReference(func.script());
2307
+ }
2308
+ content.constructCall = mirror.isConstructCall();
2309
+ content.atReturn = mirror.isAtReturn();
2310
+ if (mirror.isAtReturn()) {
2311
+ content.returnValue = this.serializeReference(mirror.returnValue());
2312
+ }
2313
+ content.debuggerFrame = mirror.isDebuggerFrame();
2314
+ var x = new Array(mirror.argumentCount());
2315
+ for (var i = 0; i < mirror.argumentCount(); i++) {
2316
+ var arg = {};
2317
+ var argument_name = mirror.argumentName(i)
2318
+ if (argument_name) {
2319
+ arg.name = argument_name;
2320
+ }
2321
+ arg.value = this.serializeReference(mirror.argumentValue(i));
2322
+ x[i] = arg;
2323
+ }
2324
+ content.arguments = x;
2325
+ var x = new Array(mirror.localCount());
2326
+ for (var i = 0; i < mirror.localCount(); i++) {
2327
+ var local = {};
2328
+ local.name = mirror.localName(i);
2329
+ local.value = this.serializeReference(mirror.localValue(i));
2330
+ x[i] = local;
2331
+ }
2332
+ content.locals = x;
2333
+ serializeLocationFields(mirror.sourceLocation(), content);
2334
+ var source_line_text = mirror.sourceLineText();
2335
+ if (!IS_UNDEFINED(source_line_text)) {
2336
+ content.sourceLineText = source_line_text;
2337
+ }
2338
+
2339
+ content.scopes = [];
2340
+ for (var i = 0; i < mirror.scopeCount(); i++) {
2341
+ var scope = mirror.scope(i);
2342
+ content.scopes.push({
2343
+ type: scope.scopeType(),
2344
+ index: i
2345
+ });
2346
+ }
2347
+ }
2348
+
2349
+
2350
+ JSONProtocolSerializer.prototype.serializeScope_ = function(mirror, content) {
2351
+ content.index = mirror.scopeIndex();
2352
+ content.frameIndex = mirror.frameIndex();
2353
+ content.type = mirror.scopeType();
2354
+ content.object = this.inlineRefs_() ?
2355
+ this.serializeValue(mirror.scopeObject()) :
2356
+ this.serializeReference(mirror.scopeObject());
2357
+ }
2358
+
2359
+
2360
+ /**
2361
+ * Convert a number to a protocol value. For all finite numbers the number
2362
+ * itself is returned. For non finite numbers NaN, Infinite and
2363
+ * -Infinite the string representation "NaN", "Infinite" or "-Infinite"
2364
+ * (not including the quotes) is returned.
2365
+ *
2366
+ * @param {number} value The number value to convert to a protocol value.
2367
+ * @returns {number|string} Protocol value.
2368
+ */
2369
+ function NumberToJSON_(value) {
2370
+ if (isNaN(value)) {
2371
+ return 'NaN';
2372
+ }
2373
+ if (!NUMBER_IS_FINITE(value)) {
2374
+ if (value > 0) {
2375
+ return 'Infinity';
2376
+ } else {
2377
+ return '-Infinity';
2378
+ }
2379
+ }
2380
+ return value;
2381
+ }