therubyracer 0.8.1.pre2 → 0.8.1

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

Potentially problematic release.


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

Files changed (877) hide show
  1. data/Changelog.md +2 -1
  2. data/README.md +6 -3
  3. data/ext/v8/upstream/3.1.8/.gitignore +31 -0
  4. data/ext/v8/upstream/3.1.8/AUTHORS +40 -0
  5. data/ext/v8/upstream/3.1.8/ChangeLog +2566 -0
  6. data/ext/v8/upstream/3.1.8/LICENSE +52 -0
  7. data/ext/v8/upstream/3.1.8/LICENSE.strongtalk +29 -0
  8. data/ext/v8/upstream/3.1.8/LICENSE.v8 +26 -0
  9. data/ext/v8/upstream/3.1.8/LICENSE.valgrind +45 -0
  10. data/ext/v8/upstream/3.1.8/SConstruct +1192 -0
  11. data/ext/v8/upstream/3.1.8/build/README.txt +25 -0
  12. data/ext/v8/upstream/3.1.8/build/all.gyp +18 -0
  13. data/ext/v8/upstream/3.1.8/build/armu.gypi +32 -0
  14. data/ext/v8/upstream/3.1.8/build/common.gypi +82 -0
  15. data/ext/v8/upstream/3.1.8/build/gyp_v8 +145 -0
  16. data/ext/v8/upstream/3.1.8/include/v8-debug.h +384 -0
  17. data/ext/v8/upstream/3.1.8/include/v8-preparser.h +116 -0
  18. data/ext/v8/upstream/3.1.8/include/v8-profiler.h +426 -0
  19. data/ext/v8/upstream/3.1.8/include/v8-testing.h +99 -0
  20. data/ext/v8/upstream/3.1.8/include/v8.h +3846 -0
  21. data/ext/v8/upstream/3.1.8/include/v8stdint.h +53 -0
  22. data/ext/v8/upstream/3.1.8/preparser/preparser-process.cc +206 -0
  23. data/ext/v8/upstream/3.1.8/src/SConscript +356 -0
  24. data/ext/v8/upstream/3.1.8/src/accessors.cc +907 -0
  25. data/ext/v8/upstream/3.1.8/src/accessors.h +121 -0
  26. data/ext/v8/upstream/3.1.8/src/allocation.cc +204 -0
  27. data/ext/v8/upstream/3.1.8/src/allocation.h +176 -0
  28. data/ext/v8/upstream/3.1.8/src/api.cc +5191 -0
  29. data/ext/v8/upstream/3.1.8/src/api.h +508 -0
  30. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/apinatives.js +0 -0
  31. data/ext/v8/upstream/3.1.8/src/apiutils.h +80 -0
  32. data/ext/v8/upstream/3.1.8/src/arguments.h +105 -0
  33. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm-inl.h +352 -0
  34. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.cc +2756 -0
  35. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.h +1294 -0
  36. data/ext/v8/upstream/3.1.8/src/arm/builtins-arm.cc +1628 -0
  37. data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.cc +6783 -0
  38. data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.h +657 -0
  39. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm-inl.h +48 -0
  40. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.cc +7403 -0
  41. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.h +595 -0
  42. data/ext/v8/upstream/3.1.8/src/arm/constants-arm.cc +152 -0
  43. data/ext/v8/upstream/3.1.8/src/arm/constants-arm.h +769 -0
  44. data/ext/v8/upstream/3.1.8/src/arm/cpu-arm.cc +147 -0
  45. data/ext/v8/upstream/3.1.8/src/arm/debug-arm.cc +315 -0
  46. data/ext/v8/upstream/3.1.8/src/arm/deoptimizer-arm.cc +700 -0
  47. data/ext/v8/upstream/3.1.8/src/arm/disasm-arm.cc +1439 -0
  48. data/ext/v8/upstream/3.1.8/src/arm/frames-arm.cc +45 -0
  49. data/ext/v8/upstream/3.1.8/src/arm/frames-arm.h +168 -0
  50. data/ext/v8/upstream/3.1.8/src/arm/full-codegen-arm.cc +4230 -0
  51. data/ext/v8/upstream/3.1.8/src/arm/ic-arm.cc +1799 -0
  52. data/ext/v8/upstream/3.1.8/src/arm/jump-target-arm.cc +174 -0
  53. data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.cc +2041 -0
  54. data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.h +2046 -0
  55. data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.cc +3822 -0
  56. data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.h +312 -0
  57. data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.cc +303 -0
  58. data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.h +84 -0
  59. data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.cc +2701 -0
  60. data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.h +1015 -0
  61. data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.cc +1280 -0
  62. data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.h +252 -0
  63. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm-inl.h +0 -0
  64. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm.cc +0 -0
  65. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm.h +0 -0
  66. data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.cc +3165 -0
  67. data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.h +402 -0
  68. data/ext/v8/upstream/3.1.8/src/arm/stub-cache-arm.cc +4077 -0
  69. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/virtual-frame-arm-inl.h +0 -0
  70. data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.cc +843 -0
  71. data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.h +520 -0
  72. data/ext/v8/upstream/3.1.8/src/array.js +1231 -0
  73. data/ext/v8/upstream/3.1.8/src/assembler.cc +973 -0
  74. data/ext/v8/upstream/3.1.8/src/assembler.h +787 -0
  75. data/ext/v8/upstream/3.1.8/src/ast-inl.h +107 -0
  76. data/ext/v8/upstream/3.1.8/src/ast.cc +1067 -0
  77. data/ext/v8/upstream/3.1.8/src/ast.h +2177 -0
  78. data/ext/v8/upstream/3.1.8/src/atomicops.h +165 -0
  79. data/ext/v8/upstream/3.1.8/src/atomicops_internals_arm_gcc.h +145 -0
  80. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_gcc.cc +126 -0
  81. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_gcc.h +287 -0
  82. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_macosx.h +301 -0
  83. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_msvc.h +203 -0
  84. data/ext/v8/upstream/3.1.8/src/bignum-dtoa.cc +655 -0
  85. data/ext/v8/upstream/3.1.8/src/bignum-dtoa.h +81 -0
  86. data/ext/v8/upstream/3.1.8/src/bignum.cc +768 -0
  87. data/ext/v8/upstream/3.1.8/src/bignum.h +140 -0
  88. data/ext/v8/upstream/3.1.8/src/bootstrapper.cc +1888 -0
  89. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/bootstrapper.h +0 -0
  90. data/ext/v8/upstream/3.1.8/src/builtins.cc +1586 -0
  91. data/ext/v8/upstream/3.1.8/src/builtins.h +339 -0
  92. data/ext/v8/upstream/3.1.8/src/bytecodes-irregexp.h +105 -0
  93. data/ext/v8/upstream/3.1.8/src/cached-powers.cc +177 -0
  94. data/ext/v8/upstream/3.1.8/src/cached-powers.h +65 -0
  95. data/ext/v8/upstream/3.1.8/src/char-predicates-inl.h +94 -0
  96. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/char-predicates.h +0 -0
  97. data/ext/v8/upstream/3.1.8/src/checks.cc +110 -0
  98. data/ext/v8/upstream/3.1.8/src/checks.h +292 -0
  99. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/circular-queue-inl.h +0 -0
  100. data/ext/v8/upstream/3.1.8/src/circular-queue.cc +122 -0
  101. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/circular-queue.h +0 -0
  102. data/ext/v8/upstream/3.1.8/src/code-stubs.cc +230 -0
  103. data/ext/v8/upstream/3.1.8/src/code-stubs.h +950 -0
  104. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/code.h +0 -0
  105. data/ext/v8/upstream/3.1.8/src/codegen-inl.h +64 -0
  106. data/ext/v8/upstream/3.1.8/src/codegen.cc +495 -0
  107. data/ext/v8/upstream/3.1.8/src/codegen.h +245 -0
  108. data/ext/v8/upstream/3.1.8/src/compilation-cache.cc +654 -0
  109. data/ext/v8/upstream/3.1.8/src/compilation-cache.h +112 -0
  110. data/ext/v8/upstream/3.1.8/src/compiler.cc +806 -0
  111. data/ext/v8/upstream/3.1.8/src/compiler.h +290 -0
  112. data/ext/v8/upstream/3.1.8/src/contexts.cc +320 -0
  113. data/ext/v8/upstream/3.1.8/src/contexts.h +376 -0
  114. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/conversions-inl.h +0 -0
  115. data/ext/v8/upstream/3.1.8/src/conversions.cc +1069 -0
  116. data/ext/v8/upstream/3.1.8/src/conversions.h +122 -0
  117. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/counters.cc +0 -0
  118. data/ext/v8/upstream/3.1.8/src/counters.h +242 -0
  119. data/ext/v8/upstream/3.1.8/src/cpu-profiler-inl.h +100 -0
  120. data/ext/v8/upstream/3.1.8/src/cpu-profiler.cc +554 -0
  121. data/ext/v8/upstream/3.1.8/src/cpu-profiler.h +291 -0
  122. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/cpu.h +0 -0
  123. data/ext/v8/upstream/3.1.8/src/d8-debug.cc +367 -0
  124. data/ext/v8/upstream/3.1.8/src/d8-debug.h +157 -0
  125. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-posix.cc +0 -0
  126. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-readline.cc +0 -0
  127. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-windows.cc +0 -0
  128. data/ext/v8/upstream/3.1.8/src/d8.cc +792 -0
  129. data/ext/v8/upstream/3.1.8/src/d8.gyp +85 -0
  130. data/ext/v8/upstream/3.1.8/src/d8.h +231 -0
  131. data/ext/v8/upstream/3.1.8/src/d8.js +2798 -0
  132. data/ext/v8/upstream/3.1.8/src/data-flow.cc +545 -0
  133. data/ext/v8/upstream/3.1.8/src/data-flow.h +379 -0
  134. data/ext/v8/upstream/3.1.8/src/date.js +1103 -0
  135. data/ext/v8/upstream/3.1.8/src/dateparser-inl.h +125 -0
  136. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/dateparser.cc +0 -0
  137. data/ext/v8/upstream/3.1.8/src/dateparser.h +263 -0
  138. data/ext/v8/upstream/3.1.8/src/debug-agent.cc +446 -0
  139. data/ext/v8/upstream/3.1.8/src/debug-agent.h +131 -0
  140. data/ext/v8/upstream/3.1.8/src/debug-debugger.js +2569 -0
  141. data/ext/v8/upstream/3.1.8/src/debug.cc +3085 -0
  142. data/ext/v8/upstream/3.1.8/src/debug.h +1025 -0
  143. data/ext/v8/upstream/3.1.8/src/deoptimizer.cc +1185 -0
  144. data/ext/v8/upstream/3.1.8/src/deoptimizer.h +529 -0
  145. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/disasm.h +0 -0
  146. data/ext/v8/upstream/3.1.8/src/disassembler.cc +338 -0
  147. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/disassembler.h +0 -0
  148. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/diy-fp.cc +0 -0
  149. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/diy-fp.h +0 -0
  150. data/ext/v8/upstream/3.1.8/src/double.h +238 -0
  151. data/ext/v8/upstream/3.1.8/src/dtoa.cc +103 -0
  152. data/ext/v8/upstream/3.1.8/src/dtoa.h +85 -0
  153. data/ext/v8/upstream/3.1.8/src/execution.cc +735 -0
  154. data/ext/v8/upstream/3.1.8/src/execution.h +322 -0
  155. data/ext/v8/upstream/3.1.8/src/extensions/experimental/experimental.gyp +53 -0
  156. data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.cc +264 -0
  157. data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.h +64 -0
  158. data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.cc +141 -0
  159. data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.h +50 -0
  160. data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.cc +58 -0
  161. data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.h +49 -0
  162. data/ext/v8/upstream/3.1.8/src/factory.cc +1087 -0
  163. data/ext/v8/upstream/3.1.8/src/factory.h +432 -0
  164. data/ext/v8/upstream/3.1.8/src/fast-dtoa.cc +736 -0
  165. data/ext/v8/upstream/3.1.8/src/fast-dtoa.h +83 -0
  166. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/fixed-dtoa.cc +0 -0
  167. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/fixed-dtoa.h +0 -0
  168. data/ext/v8/upstream/3.1.8/src/flag-definitions.h +552 -0
  169. data/ext/v8/upstream/3.1.8/src/flags.cc +551 -0
  170. data/ext/v8/upstream/3.1.8/src/flags.h +79 -0
  171. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/frame-element.cc +0 -0
  172. data/ext/v8/upstream/3.1.8/src/frame-element.h +277 -0
  173. data/ext/v8/upstream/3.1.8/src/frames-inl.h +210 -0
  174. data/ext/v8/upstream/3.1.8/src/frames.cc +1232 -0
  175. data/ext/v8/upstream/3.1.8/src/frames.h +826 -0
  176. data/ext/v8/upstream/3.1.8/src/full-codegen.cc +1382 -0
  177. data/ext/v8/upstream/3.1.8/src/full-codegen.h +751 -0
  178. data/ext/v8/upstream/3.1.8/src/func-name-inferrer.cc +90 -0
  179. data/ext/v8/upstream/3.1.8/src/func-name-inferrer.h +111 -0
  180. data/ext/v8/upstream/3.1.8/src/gdb-jit.cc +1547 -0
  181. data/ext/v8/upstream/3.1.8/src/gdb-jit.h +138 -0
  182. data/ext/v8/upstream/3.1.8/src/global-handles.cc +534 -0
  183. data/ext/v8/upstream/3.1.8/src/global-handles.h +181 -0
  184. data/ext/v8/upstream/3.1.8/src/globals.h +325 -0
  185. data/ext/v8/upstream/3.1.8/src/handles-inl.h +80 -0
  186. data/ext/v8/upstream/3.1.8/src/handles.cc +910 -0
  187. data/ext/v8/upstream/3.1.8/src/handles.h +424 -0
  188. data/ext/v8/upstream/3.1.8/src/hashmap.cc +230 -0
  189. data/ext/v8/upstream/3.1.8/src/hashmap.h +121 -0
  190. data/ext/v8/upstream/3.1.8/src/heap-inl.h +587 -0
  191. data/ext/v8/upstream/3.1.8/src/heap-profiler.cc +1128 -0
  192. data/ext/v8/upstream/3.1.8/src/heap-profiler.h +381 -0
  193. data/ext/v8/upstream/3.1.8/src/heap.cc +5610 -0
  194. data/ext/v8/upstream/3.1.8/src/heap.h +2218 -0
  195. data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.cc +1490 -0
  196. data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.h +3493 -0
  197. data/ext/v8/upstream/3.1.8/src/hydrogen.cc +6056 -0
  198. data/ext/v8/upstream/3.1.8/src/hydrogen.h +1091 -0
  199. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32-inl.h +429 -0
  200. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.cc +2800 -0
  201. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.h +1093 -0
  202. data/ext/v8/upstream/3.1.8/src/ia32/builtins-ia32.cc +1590 -0
  203. data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.cc +6624 -0
  204. data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.h +536 -0
  205. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/codegen-ia32-inl.h +0 -0
  206. data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.cc +10354 -0
  207. data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.h +798 -0
  208. data/ext/v8/upstream/3.1.8/src/ia32/cpu-ia32.cc +87 -0
  209. data/ext/v8/upstream/3.1.8/src/ia32/debug-ia32.cc +309 -0
  210. data/ext/v8/upstream/3.1.8/src/ia32/deoptimizer-ia32.cc +664 -0
  211. data/ext/v8/upstream/3.1.8/src/ia32/disasm-ia32.cc +1597 -0
  212. data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.cc +45 -0
  213. data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.h +140 -0
  214. data/ext/v8/upstream/3.1.8/src/ia32/full-codegen-ia32.cc +4278 -0
  215. data/ext/v8/upstream/3.1.8/src/ia32/ic-ia32.cc +1786 -0
  216. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/jump-target-ia32.cc +0 -0
  217. data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.cc +3880 -0
  218. data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.h +309 -0
  219. data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.cc +460 -0
  220. data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
  221. data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.cc +2095 -0
  222. data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.h +2127 -0
  223. data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.cc +2031 -0
  224. data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.h +798 -0
  225. data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.cc +1253 -0
  226. data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.h +215 -0
  227. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32-inl.h +0 -0
  228. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32.cc +0 -0
  229. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32.h +0 -0
  230. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/simulator-ia32.cc +0 -0
  231. data/ext/v8/upstream/3.1.8/src/ia32/simulator-ia32.h +72 -0
  232. data/ext/v8/upstream/3.1.8/src/ia32/stub-cache-ia32.cc +3732 -0
  233. data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.cc +1360 -0
  234. data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.h +646 -0
  235. data/ext/v8/upstream/3.1.8/src/ic-inl.h +129 -0
  236. data/ext/v8/upstream/3.1.8/src/ic.cc +2333 -0
  237. data/ext/v8/upstream/3.1.8/src/ic.h +639 -0
  238. data/ext/v8/upstream/3.1.8/src/inspector.cc +63 -0
  239. data/ext/v8/upstream/3.1.8/src/inspector.h +62 -0
  240. data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.cc +655 -0
  241. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/interpreter-irregexp.h +0 -0
  242. data/ext/v8/upstream/3.1.8/src/json.js +342 -0
  243. data/ext/v8/upstream/3.1.8/src/jsregexp.cc +5340 -0
  244. data/ext/v8/upstream/3.1.8/src/jsregexp.h +1484 -0
  245. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-heavy-inl.h +0 -0
  246. data/ext/v8/upstream/3.1.8/src/jump-target-heavy.cc +430 -0
  247. data/ext/v8/upstream/3.1.8/src/jump-target-heavy.h +244 -0
  248. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-inl.h +0 -0
  249. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-light-inl.h +0 -0
  250. data/ext/v8/upstream/3.1.8/src/jump-target-light.cc +111 -0
  251. data/ext/v8/upstream/3.1.8/src/jump-target-light.h +193 -0
  252. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target.cc +0 -0
  253. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target.h +0 -0
  254. data/ext/v8/upstream/3.1.8/src/list-inl.h +206 -0
  255. data/ext/v8/upstream/3.1.8/src/list.h +164 -0
  256. data/ext/v8/upstream/3.1.8/src/lithium-allocator-inl.h +140 -0
  257. data/ext/v8/upstream/3.1.8/src/lithium-allocator.cc +2093 -0
  258. data/ext/v8/upstream/3.1.8/src/lithium-allocator.h +644 -0
  259. data/ext/v8/upstream/3.1.8/src/lithium.cc +168 -0
  260. data/ext/v8/upstream/3.1.8/src/lithium.h +592 -0
  261. data/ext/v8/upstream/3.1.8/src/liveedit-debugger.js +1082 -0
  262. data/ext/v8/upstream/3.1.8/src/liveedit.cc +1650 -0
  263. data/ext/v8/upstream/3.1.8/src/liveedit.h +174 -0
  264. data/ext/v8/upstream/3.1.8/src/liveobjectlist-inl.h +126 -0
  265. data/ext/v8/upstream/3.1.8/src/liveobjectlist.cc +2527 -0
  266. data/ext/v8/upstream/3.1.8/src/liveobjectlist.h +322 -0
  267. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/log-inl.h +0 -0
  268. data/ext/v8/upstream/3.1.8/src/log-utils.cc +336 -0
  269. data/ext/v8/upstream/3.1.8/src/log-utils.h +232 -0
  270. data/ext/v8/upstream/3.1.8/src/log.cc +1608 -0
  271. data/ext/v8/upstream/3.1.8/src/log.h +379 -0
  272. data/ext/v8/upstream/3.1.8/src/macro-assembler.h +120 -0
  273. data/ext/v8/upstream/3.1.8/src/macros.py +178 -0
  274. data/ext/v8/upstream/3.1.8/src/mark-compact.cc +2957 -0
  275. data/ext/v8/upstream/3.1.8/src/mark-compact.h +433 -0
  276. data/ext/v8/upstream/3.1.8/src/math.js +264 -0
  277. data/ext/v8/upstream/3.1.8/src/memory.h +82 -0
  278. data/ext/v8/upstream/3.1.8/src/messages.cc +164 -0
  279. data/ext/v8/upstream/3.1.8/src/messages.h +114 -0
  280. data/ext/v8/upstream/3.1.8/src/messages.js +1071 -0
  281. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/assembler-mips-inl.h +0 -0
  282. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/assembler-mips.cc +0 -0
  283. data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.h +667 -0
  284. data/ext/v8/upstream/3.1.8/src/mips/builtins-mips.cc +205 -0
  285. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/codegen-mips-inl.h +0 -0
  286. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/codegen-mips.cc +0 -0
  287. data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.h +431 -0
  288. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/constants-mips.cc +0 -0
  289. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/constants-mips.h +0 -0
  290. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/cpu-mips.cc +0 -0
  291. data/ext/v8/upstream/3.1.8/src/mips/debug-mips.cc +127 -0
  292. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/disasm-mips.cc +0 -0
  293. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/fast-codegen-mips.cc +0 -0
  294. data/ext/v8/upstream/3.1.8/src/mips/frames-mips.cc +96 -0
  295. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/frames-mips.h +0 -0
  296. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/full-codegen-mips.cc +0 -0
  297. data/ext/v8/upstream/3.1.8/src/mips/ic-mips.cc +208 -0
  298. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/jump-target-mips.cc +0 -0
  299. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/macro-assembler-mips.cc +0 -0
  300. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/macro-assembler-mips.h +0 -0
  301. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips-inl.h +0 -0
  302. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips.cc +0 -0
  303. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips.h +0 -0
  304. data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.cc +1650 -0
  305. data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.h +311 -0
  306. data/ext/v8/upstream/3.1.8/src/mips/stub-cache-mips.cc +418 -0
  307. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/virtual-frame-mips.cc +0 -0
  308. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/virtual-frame-mips.h +0 -0
  309. data/ext/v8/upstream/3.1.8/src/mirror-debugger.js +2380 -0
  310. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mksnapshot.cc +0 -0
  311. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/natives.h +0 -0
  312. data/ext/v8/upstream/3.1.8/src/objects-debug.cc +722 -0
  313. data/ext/v8/upstream/3.1.8/src/objects-inl.h +3946 -0
  314. data/ext/v8/upstream/3.1.8/src/objects-printer.cc +801 -0
  315. data/ext/v8/upstream/3.1.8/src/objects-visiting.cc +142 -0
  316. data/ext/v8/upstream/3.1.8/src/objects-visiting.h +401 -0
  317. data/ext/v8/upstream/3.1.8/src/objects.cc +10044 -0
  318. data/ext/v8/upstream/3.1.8/src/objects.h +6571 -0
  319. data/ext/v8/upstream/3.1.8/src/parser.cc +5165 -0
  320. data/ext/v8/upstream/3.1.8/src/parser.h +802 -0
  321. data/ext/v8/upstream/3.1.8/src/platform-cygwin.cc +745 -0
  322. data/ext/v8/upstream/3.1.8/src/platform-freebsd.cc +702 -0
  323. data/ext/v8/upstream/3.1.8/src/platform-linux.cc +981 -0
  324. data/ext/v8/upstream/3.1.8/src/platform-macos.cc +732 -0
  325. data/ext/v8/upstream/3.1.8/src/platform-nullos.cc +498 -0
  326. data/ext/v8/upstream/3.1.8/src/platform-openbsd.cc +657 -0
  327. data/ext/v8/upstream/3.1.8/src/platform-posix.cc +399 -0
  328. data/ext/v8/upstream/3.1.8/src/platform-solaris.cc +714 -0
  329. data/ext/v8/upstream/3.1.8/src/platform-win32.cc +1974 -0
  330. data/ext/v8/upstream/3.1.8/src/platform.h +636 -0
  331. data/ext/v8/upstream/3.1.8/src/preparse-data.cc +183 -0
  332. data/ext/v8/upstream/3.1.8/src/preparse-data.h +249 -0
  333. data/ext/v8/upstream/3.1.8/src/preparser-api.cc +213 -0
  334. data/ext/v8/upstream/3.1.8/src/preparser.cc +1205 -0
  335. data/ext/v8/upstream/3.1.8/src/preparser.h +278 -0
  336. data/ext/v8/upstream/3.1.8/src/prettyprinter.cc +1539 -0
  337. data/ext/v8/upstream/3.1.8/src/prettyprinter.h +223 -0
  338. data/ext/v8/upstream/3.1.8/src/profile-generator-inl.h +128 -0
  339. data/ext/v8/upstream/3.1.8/src/profile-generator.cc +2899 -0
  340. data/ext/v8/upstream/3.1.8/src/profile-generator.h +1151 -0
  341. data/ext/v8/upstream/3.1.8/src/property.cc +96 -0
  342. data/ext/v8/upstream/3.1.8/src/property.h +337 -0
  343. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
  344. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.cc +470 -0
  345. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.h +142 -0
  346. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-tracer.cc +373 -0
  347. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-tracer.h +104 -0
  348. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.cc +257 -0
  349. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.h +231 -0
  350. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-stack.cc +0 -0
  351. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-stack.h +0 -0
  352. data/ext/v8/upstream/3.1.8/src/regexp.js +483 -0
  353. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator-inl.h +0 -0
  354. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator.cc +0 -0
  355. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator.h +0 -0
  356. data/ext/v8/upstream/3.1.8/src/rewriter.cc +1023 -0
  357. data/ext/v8/upstream/3.1.8/src/rewriter.h +59 -0
  358. data/ext/v8/upstream/3.1.8/src/runtime-profiler.cc +443 -0
  359. data/ext/v8/upstream/3.1.8/src/runtime-profiler.h +77 -0
  360. data/ext/v8/upstream/3.1.8/src/runtime.cc +11592 -0
  361. data/ext/v8/upstream/3.1.8/src/runtime.h +582 -0
  362. data/ext/v8/upstream/3.1.8/src/runtime.js +643 -0
  363. data/ext/v8/upstream/3.1.8/src/safepoint-table.cc +253 -0
  364. data/ext/v8/upstream/3.1.8/src/safepoint-table.h +263 -0
  365. data/ext/v8/upstream/3.1.8/src/scanner-base.cc +971 -0
  366. data/ext/v8/upstream/3.1.8/src/scanner-base.h +653 -0
  367. data/ext/v8/upstream/3.1.8/src/scanner.cc +586 -0
  368. data/ext/v8/upstream/3.1.8/src/scanner.h +194 -0
  369. data/ext/v8/upstream/3.1.8/src/scopeinfo.cc +636 -0
  370. data/ext/v8/upstream/3.1.8/src/scopeinfo.h +238 -0
  371. data/ext/v8/upstream/3.1.8/src/scopes.cc +1063 -0
  372. data/ext/v8/upstream/3.1.8/src/scopes.h +494 -0
  373. data/ext/v8/upstream/3.1.8/src/serialize.cc +1535 -0
  374. data/ext/v8/upstream/3.1.8/src/serialize.h +584 -0
  375. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/shell.h +0 -0
  376. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/simulator.h +0 -0
  377. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/smart-pointer.h +0 -0
  378. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot-common.cc +0 -0
  379. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot-empty.cc +0 -0
  380. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot.h +0 -0
  381. data/ext/v8/upstream/3.1.8/src/spaces-inl.h +524 -0
  382. data/ext/v8/upstream/3.1.8/src/spaces.cc +3254 -0
  383. data/ext/v8/upstream/3.1.8/src/spaces.h +2362 -0
  384. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/splay-tree-inl.h +0 -0
  385. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/splay-tree.h +0 -0
  386. data/ext/v8/upstream/3.1.8/src/string-search.cc +40 -0
  387. data/ext/v8/upstream/3.1.8/src/string-search.h +567 -0
  388. data/ext/v8/upstream/3.1.8/src/string-stream.cc +584 -0
  389. data/ext/v8/upstream/3.1.8/src/string-stream.h +191 -0
  390. data/ext/v8/upstream/3.1.8/src/string.js +915 -0
  391. data/ext/v8/upstream/3.1.8/src/strtod.cc +440 -0
  392. data/ext/v8/upstream/3.1.8/src/strtod.h +40 -0
  393. data/ext/v8/upstream/3.1.8/src/stub-cache.cc +1878 -0
  394. data/ext/v8/upstream/3.1.8/src/stub-cache.h +849 -0
  395. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/third_party/valgrind/valgrind.h +0 -0
  396. data/ext/v8/upstream/3.1.8/src/token.cc +63 -0
  397. data/ext/v8/upstream/3.1.8/src/token.h +288 -0
  398. data/ext/v8/upstream/3.1.8/src/top.cc +1152 -0
  399. data/ext/v8/upstream/3.1.8/src/top.h +608 -0
  400. data/ext/v8/upstream/3.1.8/src/type-info.cc +406 -0
  401. data/ext/v8/upstream/3.1.8/src/type-info.h +283 -0
  402. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/unbound-queue-inl.h +0 -0
  403. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/unbound-queue.h +0 -0
  404. data/ext/v8/upstream/3.1.8/src/unicode-inl.h +238 -0
  405. data/ext/v8/upstream/3.1.8/src/unicode.cc +1624 -0
  406. data/ext/v8/upstream/3.1.8/src/unicode.h +280 -0
  407. data/ext/v8/upstream/3.1.8/src/uri.js +402 -0
  408. data/ext/v8/upstream/3.1.8/src/utils.cc +371 -0
  409. data/ext/v8/upstream/3.1.8/src/utils.h +793 -0
  410. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/v8-counters.cc +0 -0
  411. data/ext/v8/upstream/3.1.8/src/v8-counters.h +290 -0
  412. data/ext/v8/upstream/3.1.8/src/v8.cc +270 -0
  413. data/ext/v8/upstream/3.1.8/src/v8.h +127 -0
  414. data/ext/v8/upstream/3.1.8/src/v8checks.h +64 -0
  415. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/v8dll-main.cc +0 -0
  416. data/ext/v8/upstream/3.1.8/src/v8globals.h +480 -0
  417. data/ext/v8/upstream/3.1.8/src/v8natives.js +1252 -0
  418. data/ext/v8/upstream/3.1.8/src/v8preparserdll-main.cc +39 -0
  419. data/ext/v8/upstream/3.1.8/src/v8threads.cc +440 -0
  420. data/ext/v8/upstream/3.1.8/src/v8threads.h +157 -0
  421. data/ext/v8/upstream/3.1.8/src/v8utils.h +354 -0
  422. data/ext/v8/upstream/3.1.8/src/variables.cc +132 -0
  423. data/ext/v8/upstream/3.1.8/src/variables.h +212 -0
  424. data/ext/v8/upstream/3.1.8/src/version.cc +95 -0
  425. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/version.h +0 -0
  426. data/ext/v8/upstream/3.1.8/src/virtual-frame-heavy-inl.h +190 -0
  427. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-heavy.cc +0 -0
  428. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-inl.h +0 -0
  429. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-light-inl.h +0 -0
  430. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-light.cc +0 -0
  431. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame.cc +0 -0
  432. data/ext/v8/upstream/3.1.8/src/virtual-frame.h +59 -0
  433. data/ext/v8/upstream/3.1.8/src/vm-state-inl.h +134 -0
  434. data/ext/v8/upstream/3.1.8/src/vm-state.h +68 -0
  435. data/ext/v8/upstream/3.1.8/src/win32-headers.h +95 -0
  436. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64-inl.h +455 -0
  437. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.cc +3162 -0
  438. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.h +1584 -0
  439. data/ext/v8/upstream/3.1.8/src/x64/builtins-x64.cc +1492 -0
  440. data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.cc +5150 -0
  441. data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.h +519 -0
  442. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64-inl.h +46 -0
  443. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.cc +8835 -0
  444. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.h +750 -0
  445. data/ext/v8/upstream/3.1.8/src/x64/cpu-x64.cc +86 -0
  446. data/ext/v8/upstream/3.1.8/src/x64/debug-x64.cc +316 -0
  447. data/ext/v8/upstream/3.1.8/src/x64/deoptimizer-x64.cc +781 -0
  448. data/ext/v8/upstream/3.1.8/src/x64/disasm-x64.cc +1737 -0
  449. data/ext/v8/upstream/3.1.8/src/x64/frames-x64.cc +45 -0
  450. data/ext/v8/upstream/3.1.8/src/x64/frames-x64.h +130 -0
  451. data/ext/v8/upstream/3.1.8/src/x64/full-codegen-x64.cc +3984 -0
  452. data/ext/v8/upstream/3.1.8/src/x64/ic-x64.cc +1761 -0
  453. data/ext/v8/upstream/3.1.8/src/x64/jump-target-x64.cc +437 -0
  454. data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.cc +3639 -0
  455. data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.h +305 -0
  456. data/ext/v8/upstream/3.1.8/src/x64/lithium-gap-resolver-x64.cc +320 -0
  457. data/ext/v8/upstream/3.1.8/src/x64/lithium-gap-resolver-x64.h +74 -0
  458. data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.cc +2044 -0
  459. data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.h +2052 -0
  460. data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.cc +2660 -0
  461. data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.h +1852 -0
  462. data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.cc +1382 -0
  463. data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.h +278 -0
  464. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64-inl.h +0 -0
  465. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64.cc +0 -0
  466. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64.h +0 -0
  467. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/simulator-x64.cc +0 -0
  468. data/ext/v8/upstream/3.1.8/src/x64/simulator-x64.h +71 -0
  469. data/ext/v8/upstream/3.1.8/src/x64/stub-cache-x64.cc +3509 -0
  470. data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.cc +1292 -0
  471. data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.h +593 -0
  472. data/ext/v8/upstream/3.1.8/src/zone-inl.h +83 -0
  473. data/ext/v8/upstream/3.1.8/src/zone.cc +195 -0
  474. data/ext/v8/upstream/3.1.8/src/zone.h +233 -0
  475. data/ext/v8/upstream/3.1.8/tools/codemap.js +265 -0
  476. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/consarray.js +0 -0
  477. data/ext/v8/upstream/3.1.8/tools/csvparser.js +78 -0
  478. data/ext/v8/upstream/3.1.8/tools/disasm.py +92 -0
  479. data/ext/v8/upstream/3.1.8/tools/gc-nvp-trace-processor.py +328 -0
  480. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/generate-ten-powers.scm +0 -0
  481. data/ext/v8/upstream/3.1.8/tools/grokdump.py +840 -0
  482. data/ext/v8/upstream/3.1.8/tools/gyp/v8.gyp +869 -0
  483. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/js2c.py +0 -0
  484. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/jsmin.py +0 -0
  485. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/linux-tick-processor +0 -0
  486. data/ext/v8/upstream/3.1.8/tools/ll_prof.py +919 -0
  487. data/ext/v8/upstream/3.1.8/tools/logreader.js +185 -0
  488. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/mac-nm +0 -0
  489. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/mac-tick-processor +0 -0
  490. data/ext/v8/upstream/3.1.8/tools/oom_dump/README +31 -0
  491. data/ext/v8/upstream/3.1.8/tools/oom_dump/SConstruct +42 -0
  492. data/ext/v8/upstream/3.1.8/tools/oom_dump/oom_dump.cc +288 -0
  493. data/ext/v8/upstream/3.1.8/tools/presubmit.py +305 -0
  494. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/process-heap-prof.py +0 -0
  495. data/ext/v8/upstream/3.1.8/tools/profile.js +751 -0
  496. data/ext/v8/upstream/3.1.8/tools/profile_view.js +219 -0
  497. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/run-valgrind.py +0 -0
  498. data/ext/v8/upstream/3.1.8/tools/splaytree.js +316 -0
  499. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/stats-viewer.py +0 -0
  500. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/tickprocessor-driver.js +0 -0
  501. data/ext/v8/upstream/3.1.8/tools/tickprocessor.js +863 -0
  502. data/ext/v8/upstream/3.1.8/tools/utils.py +96 -0
  503. data/ext/v8/upstream/3.1.8/tools/visual_studio/README.txt +70 -0
  504. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/arm.vsprops +0 -0
  505. data/ext/v8/upstream/3.1.8/tools/visual_studio/common.vsprops +34 -0
  506. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8.vcproj +0 -0
  507. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8_arm.vcproj +0 -0
  508. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8_x64.vcproj +0 -0
  509. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8js2c.cmd +0 -0
  510. data/ext/v8/upstream/3.1.8/tools/visual_studio/debug.vsprops +17 -0
  511. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/ia32.vsprops +0 -0
  512. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/js2c.cmd +0 -0
  513. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/release.vsprops +0 -0
  514. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8.sln +0 -0
  515. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8.vcproj +0 -0
  516. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_arm.sln +0 -0
  517. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_arm.vcproj +0 -0
  518. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base.vcproj +1296 -0
  519. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_arm.vcproj +1234 -0
  520. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_x64.vcproj +1296 -0
  521. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest.vcproj +0 -0
  522. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
  523. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
  524. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
  525. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
  526. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample.vcproj +0 -0
  527. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
  528. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
  529. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample.vcproj +147 -0
  530. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample_arm.vcproj +147 -0
  531. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample_x64.vcproj +163 -0
  532. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot.vcproj +0 -0
  533. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
  534. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
  535. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
  536. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_x64.sln +0 -0
  537. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_x64.vcproj +0 -0
  538. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/x64.vsprops +0 -0
  539. data/ext/v8/upstream/3.1.8/tools/windows-tick-processor.bat +30 -0
  540. data/ext/v8/upstream/Makefile +2 -1
  541. data/ext/v8/v8_template.cpp +2 -2
  542. data/lib/v8/version.rb +1 -1
  543. data/spec/redjs/jsapi_spec.rb +2 -2
  544. metadata +552 -490
  545. data/ext/v8/upstream/2.3.3/.gitignore +0 -26
  546. data/ext/v8/upstream/2.3.3/AUTHORS +0 -31
  547. data/ext/v8/upstream/2.3.3/ChangeLog +0 -1916
  548. data/ext/v8/upstream/2.3.3/LICENSE +0 -55
  549. data/ext/v8/upstream/2.3.3/SConstruct +0 -1154
  550. data/ext/v8/upstream/2.3.3/include/v8-debug.h +0 -381
  551. data/ext/v8/upstream/2.3.3/include/v8-profiler.h +0 -353
  552. data/ext/v8/upstream/2.3.3/include/v8.h +0 -3616
  553. data/ext/v8/upstream/2.3.3/src/SConscript +0 -330
  554. data/ext/v8/upstream/2.3.3/src/accessors.cc +0 -661
  555. data/ext/v8/upstream/2.3.3/src/accessors.h +0 -114
  556. data/ext/v8/upstream/2.3.3/src/allocation.cc +0 -198
  557. data/ext/v8/upstream/2.3.3/src/allocation.h +0 -169
  558. data/ext/v8/upstream/2.3.3/src/api.cc +0 -4795
  559. data/ext/v8/upstream/2.3.3/src/api.h +0 -485
  560. data/ext/v8/upstream/2.3.3/src/apiutils.h +0 -69
  561. data/ext/v8/upstream/2.3.3/src/arguments.h +0 -96
  562. data/ext/v8/upstream/2.3.3/src/arm/assembler-arm-inl.h +0 -305
  563. data/ext/v8/upstream/2.3.3/src/arm/assembler-arm.cc +0 -2580
  564. data/ext/v8/upstream/2.3.3/src/arm/assembler-arm.h +0 -1275
  565. data/ext/v8/upstream/2.3.3/src/arm/builtins-arm.cc +0 -1320
  566. data/ext/v8/upstream/2.3.3/src/arm/codegen-arm-inl.h +0 -48
  567. data/ext/v8/upstream/2.3.3/src/arm/codegen-arm.cc +0 -11398
  568. data/ext/v8/upstream/2.3.3/src/arm/codegen-arm.h +0 -1102
  569. data/ext/v8/upstream/2.3.3/src/arm/constants-arm.cc +0 -154
  570. data/ext/v8/upstream/2.3.3/src/arm/constants-arm.h +0 -388
  571. data/ext/v8/upstream/2.3.3/src/arm/cpu-arm.cc +0 -142
  572. data/ext/v8/upstream/2.3.3/src/arm/debug-arm.cc +0 -309
  573. data/ext/v8/upstream/2.3.3/src/arm/disasm-arm.cc +0 -1459
  574. data/ext/v8/upstream/2.3.3/src/arm/fast-codegen-arm.cc +0 -241
  575. data/ext/v8/upstream/2.3.3/src/arm/frames-arm.cc +0 -123
  576. data/ext/v8/upstream/2.3.3/src/arm/frames-arm.h +0 -162
  577. data/ext/v8/upstream/2.3.3/src/arm/full-codegen-arm.cc +0 -3178
  578. data/ext/v8/upstream/2.3.3/src/arm/ic-arm.cc +0 -2258
  579. data/ext/v8/upstream/2.3.3/src/arm/jump-target-arm.cc +0 -164
  580. data/ext/v8/upstream/2.3.3/src/arm/macro-assembler-arm.cc +0 -1892
  581. data/ext/v8/upstream/2.3.3/src/arm/macro-assembler-arm.h +0 -727
  582. data/ext/v8/upstream/2.3.3/src/arm/regexp-macro-assembler-arm.cc +0 -1261
  583. data/ext/v8/upstream/2.3.3/src/arm/regexp-macro-assembler-arm.h +0 -266
  584. data/ext/v8/upstream/2.3.3/src/arm/simulator-arm.cc +0 -2822
  585. data/ext/v8/upstream/2.3.3/src/arm/simulator-arm.h +0 -361
  586. data/ext/v8/upstream/2.3.3/src/arm/stub-cache-arm.cc +0 -2387
  587. data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm.cc +0 -834
  588. data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm.h +0 -519
  589. data/ext/v8/upstream/2.3.3/src/array.js +0 -1127
  590. data/ext/v8/upstream/2.3.3/src/assembler.cc +0 -801
  591. data/ext/v8/upstream/2.3.3/src/assembler.h +0 -573
  592. data/ext/v8/upstream/2.3.3/src/ast-inl.h +0 -81
  593. data/ext/v8/upstream/2.3.3/src/ast.cc +0 -1152
  594. data/ext/v8/upstream/2.3.3/src/ast.h +0 -2106
  595. data/ext/v8/upstream/2.3.3/src/bootstrapper.cc +0 -1819
  596. data/ext/v8/upstream/2.3.3/src/builtins.cc +0 -1529
  597. data/ext/v8/upstream/2.3.3/src/builtins.h +0 -263
  598. data/ext/v8/upstream/2.3.3/src/bytecodes-irregexp.h +0 -104
  599. data/ext/v8/upstream/2.3.3/src/cached-powers.h +0 -119
  600. data/ext/v8/upstream/2.3.3/src/char-predicates-inl.h +0 -86
  601. data/ext/v8/upstream/2.3.3/src/checks.cc +0 -100
  602. data/ext/v8/upstream/2.3.3/src/checks.h +0 -310
  603. data/ext/v8/upstream/2.3.3/src/circular-queue.cc +0 -121
  604. data/ext/v8/upstream/2.3.3/src/code-stubs.cc +0 -177
  605. data/ext/v8/upstream/2.3.3/src/code-stubs.h +0 -177
  606. data/ext/v8/upstream/2.3.3/src/codegen-inl.h +0 -60
  607. data/ext/v8/upstream/2.3.3/src/codegen.cc +0 -516
  608. data/ext/v8/upstream/2.3.3/src/codegen.h +0 -897
  609. data/ext/v8/upstream/2.3.3/src/compilation-cache.cc +0 -562
  610. data/ext/v8/upstream/2.3.3/src/compilation-cache.h +0 -102
  611. data/ext/v8/upstream/2.3.3/src/compiler.cc +0 -654
  612. data/ext/v8/upstream/2.3.3/src/compiler.h +0 -299
  613. data/ext/v8/upstream/2.3.3/src/contexts.cc +0 -256
  614. data/ext/v8/upstream/2.3.3/src/contexts.h +0 -342
  615. data/ext/v8/upstream/2.3.3/src/conversions.cc +0 -1119
  616. data/ext/v8/upstream/2.3.3/src/conversions.h +0 -123
  617. data/ext/v8/upstream/2.3.3/src/counters.h +0 -239
  618. data/ext/v8/upstream/2.3.3/src/cpu-profiler-inl.h +0 -100
  619. data/ext/v8/upstream/2.3.3/src/cpu-profiler.cc +0 -538
  620. data/ext/v8/upstream/2.3.3/src/cpu-profiler.h +0 -285
  621. data/ext/v8/upstream/2.3.3/src/d8-debug.cc +0 -356
  622. data/ext/v8/upstream/2.3.3/src/d8-debug.h +0 -155
  623. data/ext/v8/upstream/2.3.3/src/d8.cc +0 -783
  624. data/ext/v8/upstream/2.3.3/src/d8.h +0 -227
  625. data/ext/v8/upstream/2.3.3/src/d8.js +0 -1683
  626. data/ext/v8/upstream/2.3.3/src/data-flow.cc +0 -758
  627. data/ext/v8/upstream/2.3.3/src/data-flow.h +0 -278
  628. data/ext/v8/upstream/2.3.3/src/date.js +0 -1059
  629. data/ext/v8/upstream/2.3.3/src/dateparser-inl.h +0 -123
  630. data/ext/v8/upstream/2.3.3/src/dateparser.h +0 -244
  631. data/ext/v8/upstream/2.3.3/src/debug-agent.cc +0 -427
  632. data/ext/v8/upstream/2.3.3/src/debug-agent.h +0 -129
  633. data/ext/v8/upstream/2.3.3/src/debug-debugger.js +0 -2227
  634. data/ext/v8/upstream/2.3.3/src/debug.cc +0 -3005
  635. data/ext/v8/upstream/2.3.3/src/debug.h +0 -993
  636. data/ext/v8/upstream/2.3.3/src/disassembler.cc +0 -312
  637. data/ext/v8/upstream/2.3.3/src/double.h +0 -169
  638. data/ext/v8/upstream/2.3.3/src/dtoa-config.c +0 -92
  639. data/ext/v8/upstream/2.3.3/src/dtoa.cc +0 -77
  640. data/ext/v8/upstream/2.3.3/src/dtoa.h +0 -81
  641. data/ext/v8/upstream/2.3.3/src/execution.cc +0 -809
  642. data/ext/v8/upstream/2.3.3/src/execution.h +0 -336
  643. data/ext/v8/upstream/2.3.3/src/factory.cc +0 -1003
  644. data/ext/v8/upstream/2.3.3/src/factory.h +0 -410
  645. data/ext/v8/upstream/2.3.3/src/fast-codegen.cc +0 -746
  646. data/ext/v8/upstream/2.3.3/src/fast-codegen.h +0 -161
  647. data/ext/v8/upstream/2.3.3/src/fast-dtoa.cc +0 -505
  648. data/ext/v8/upstream/2.3.3/src/fast-dtoa.h +0 -58
  649. data/ext/v8/upstream/2.3.3/src/flag-definitions.h +0 -455
  650. data/ext/v8/upstream/2.3.3/src/flags.cc +0 -551
  651. data/ext/v8/upstream/2.3.3/src/flags.h +0 -81
  652. data/ext/v8/upstream/2.3.3/src/flow-graph.cc +0 -763
  653. data/ext/v8/upstream/2.3.3/src/flow-graph.h +0 -180
  654. data/ext/v8/upstream/2.3.3/src/frame-element.h +0 -273
  655. data/ext/v8/upstream/2.3.3/src/frames-inl.h +0 -217
  656. data/ext/v8/upstream/2.3.3/src/frames.cc +0 -826
  657. data/ext/v8/upstream/2.3.3/src/frames.h +0 -682
  658. data/ext/v8/upstream/2.3.3/src/full-codegen.cc +0 -1443
  659. data/ext/v8/upstream/2.3.3/src/full-codegen.h +0 -548
  660. data/ext/v8/upstream/2.3.3/src/func-name-inferrer.cc +0 -76
  661. data/ext/v8/upstream/2.3.3/src/func-name-inferrer.h +0 -135
  662. data/ext/v8/upstream/2.3.3/src/global-handles.cc +0 -520
  663. data/ext/v8/upstream/2.3.3/src/global-handles.h +0 -180
  664. data/ext/v8/upstream/2.3.3/src/globals.h +0 -669
  665. data/ext/v8/upstream/2.3.3/src/handles-inl.h +0 -76
  666. data/ext/v8/upstream/2.3.3/src/handles.cc +0 -825
  667. data/ext/v8/upstream/2.3.3/src/handles.h +0 -393
  668. data/ext/v8/upstream/2.3.3/src/hashmap.cc +0 -226
  669. data/ext/v8/upstream/2.3.3/src/hashmap.h +0 -120
  670. data/ext/v8/upstream/2.3.3/src/heap-inl.h +0 -493
  671. data/ext/v8/upstream/2.3.3/src/heap-profiler.cc +0 -779
  672. data/ext/v8/upstream/2.3.3/src/heap-profiler.h +0 -323
  673. data/ext/v8/upstream/2.3.3/src/heap.cc +0 -4994
  674. data/ext/v8/upstream/2.3.3/src/heap.h +0 -1984
  675. data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32-inl.h +0 -360
  676. data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32.cc +0 -2600
  677. data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32.h +0 -969
  678. data/ext/v8/upstream/2.3.3/src/ia32/builtins-ia32.cc +0 -1261
  679. data/ext/v8/upstream/2.3.3/src/ia32/codegen-ia32.cc +0 -13968
  680. data/ext/v8/upstream/2.3.3/src/ia32/codegen-ia32.h +0 -1097
  681. data/ext/v8/upstream/2.3.3/src/ia32/cpu-ia32.cc +0 -83
  682. data/ext/v8/upstream/2.3.3/src/ia32/debug-ia32.cc +0 -309
  683. data/ext/v8/upstream/2.3.3/src/ia32/disasm-ia32.cc +0 -1471
  684. data/ext/v8/upstream/2.3.3/src/ia32/fast-codegen-ia32.cc +0 -954
  685. data/ext/v8/upstream/2.3.3/src/ia32/fast-codegen-ia32.h +0 -155
  686. data/ext/v8/upstream/2.3.3/src/ia32/frames-ia32.cc +0 -115
  687. data/ext/v8/upstream/2.3.3/src/ia32/frames-ia32.h +0 -135
  688. data/ext/v8/upstream/2.3.3/src/ia32/full-codegen-ia32.cc +0 -3281
  689. data/ext/v8/upstream/2.3.3/src/ia32/ic-ia32.cc +0 -1966
  690. data/ext/v8/upstream/2.3.3/src/ia32/macro-assembler-ia32.cc +0 -1610
  691. data/ext/v8/upstream/2.3.3/src/ia32/macro-assembler-ia32.h +0 -610
  692. data/ext/v8/upstream/2.3.3/src/ia32/regexp-macro-assembler-ia32.cc +0 -1247
  693. data/ext/v8/upstream/2.3.3/src/ia32/regexp-macro-assembler-ia32.h +0 -214
  694. data/ext/v8/upstream/2.3.3/src/ia32/simulator-ia32.h +0 -62
  695. data/ext/v8/upstream/2.3.3/src/ia32/stub-cache-ia32.cc +0 -2750
  696. data/ext/v8/upstream/2.3.3/src/ia32/virtual-frame-ia32.cc +0 -1334
  697. data/ext/v8/upstream/2.3.3/src/ia32/virtual-frame-ia32.h +0 -627
  698. data/ext/v8/upstream/2.3.3/src/ic-inl.h +0 -120
  699. data/ext/v8/upstream/2.3.3/src/ic.cc +0 -1827
  700. data/ext/v8/upstream/2.3.3/src/ic.h +0 -515
  701. data/ext/v8/upstream/2.3.3/src/interpreter-irregexp.cc +0 -646
  702. data/ext/v8/upstream/2.3.3/src/json.js +0 -268
  703. data/ext/v8/upstream/2.3.3/src/jsregexp.cc +0 -5283
  704. data/ext/v8/upstream/2.3.3/src/jsregexp.h +0 -1463
  705. data/ext/v8/upstream/2.3.3/src/jump-target-heavy.cc +0 -429
  706. data/ext/v8/upstream/2.3.3/src/jump-target-heavy.h +0 -244
  707. data/ext/v8/upstream/2.3.3/src/jump-target-light.cc +0 -110
  708. data/ext/v8/upstream/2.3.3/src/jump-target-light.h +0 -192
  709. data/ext/v8/upstream/2.3.3/src/list-inl.h +0 -166
  710. data/ext/v8/upstream/2.3.3/src/list.h +0 -159
  711. data/ext/v8/upstream/2.3.3/src/liveedit-debugger.js +0 -1057
  712. data/ext/v8/upstream/2.3.3/src/liveedit.cc +0 -1480
  713. data/ext/v8/upstream/2.3.3/src/liveedit.h +0 -170
  714. data/ext/v8/upstream/2.3.3/src/log-utils.cc +0 -497
  715. data/ext/v8/upstream/2.3.3/src/log-utils.h +0 -289
  716. data/ext/v8/upstream/2.3.3/src/log.cc +0 -1561
  717. data/ext/v8/upstream/2.3.3/src/log.h +0 -384
  718. data/ext/v8/upstream/2.3.3/src/macro-assembler.h +0 -86
  719. data/ext/v8/upstream/2.3.3/src/macros.py +0 -177
  720. data/ext/v8/upstream/2.3.3/src/mark-compact.cc +0 -2330
  721. data/ext/v8/upstream/2.3.3/src/mark-compact.h +0 -451
  722. data/ext/v8/upstream/2.3.3/src/math.js +0 -264
  723. data/ext/v8/upstream/2.3.3/src/memory.h +0 -74
  724. data/ext/v8/upstream/2.3.3/src/messages.cc +0 -183
  725. data/ext/v8/upstream/2.3.3/src/messages.h +0 -113
  726. data/ext/v8/upstream/2.3.3/src/messages.js +0 -982
  727. data/ext/v8/upstream/2.3.3/src/mips/assembler-mips.h +0 -668
  728. data/ext/v8/upstream/2.3.3/src/mips/builtins-mips.cc +0 -205
  729. data/ext/v8/upstream/2.3.3/src/mips/codegen-mips.h +0 -434
  730. data/ext/v8/upstream/2.3.3/src/mips/debug-mips.cc +0 -131
  731. data/ext/v8/upstream/2.3.3/src/mips/frames-mips.cc +0 -102
  732. data/ext/v8/upstream/2.3.3/src/mips/ic-mips.cc +0 -220
  733. data/ext/v8/upstream/2.3.3/src/mips/simulator-mips.cc +0 -1651
  734. data/ext/v8/upstream/2.3.3/src/mips/simulator-mips.h +0 -311
  735. data/ext/v8/upstream/2.3.3/src/mips/stub-cache-mips.cc +0 -403
  736. data/ext/v8/upstream/2.3.3/src/mirror-debugger.js +0 -2380
  737. data/ext/v8/upstream/2.3.3/src/objects-debug.cc +0 -1366
  738. data/ext/v8/upstream/2.3.3/src/objects-inl.h +0 -3333
  739. data/ext/v8/upstream/2.3.3/src/objects.cc +0 -8820
  740. data/ext/v8/upstream/2.3.3/src/objects.h +0 -5373
  741. data/ext/v8/upstream/2.3.3/src/oprofile-agent.cc +0 -108
  742. data/ext/v8/upstream/2.3.3/src/oprofile-agent.h +0 -77
  743. data/ext/v8/upstream/2.3.3/src/parser.cc +0 -5207
  744. data/ext/v8/upstream/2.3.3/src/parser.h +0 -197
  745. data/ext/v8/upstream/2.3.3/src/platform-freebsd.cc +0 -667
  746. data/ext/v8/upstream/2.3.3/src/platform-linux.cc +0 -862
  747. data/ext/v8/upstream/2.3.3/src/platform-macos.cc +0 -665
  748. data/ext/v8/upstream/2.3.3/src/platform-nullos.cc +0 -454
  749. data/ext/v8/upstream/2.3.3/src/platform-openbsd.cc +0 -622
  750. data/ext/v8/upstream/2.3.3/src/platform-posix.cc +0 -362
  751. data/ext/v8/upstream/2.3.3/src/platform-solaris.cc +0 -653
  752. data/ext/v8/upstream/2.3.3/src/platform-win32.cc +0 -1911
  753. data/ext/v8/upstream/2.3.3/src/platform.h +0 -577
  754. data/ext/v8/upstream/2.3.3/src/powers-ten.h +0 -2461
  755. data/ext/v8/upstream/2.3.3/src/prettyprinter.cc +0 -1531
  756. data/ext/v8/upstream/2.3.3/src/prettyprinter.h +0 -221
  757. data/ext/v8/upstream/2.3.3/src/profile-generator-inl.h +0 -148
  758. data/ext/v8/upstream/2.3.3/src/profile-generator.cc +0 -1830
  759. data/ext/v8/upstream/2.3.3/src/profile-generator.h +0 -853
  760. data/ext/v8/upstream/2.3.3/src/property.cc +0 -96
  761. data/ext/v8/upstream/2.3.3/src/property.h +0 -315
  762. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-irregexp.cc +0 -464
  763. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-irregexp.h +0 -141
  764. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-tracer.cc +0 -356
  765. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-tracer.h +0 -103
  766. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler.cc +0 -261
  767. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler.h +0 -228
  768. data/ext/v8/upstream/2.3.3/src/regexp.js +0 -549
  769. data/ext/v8/upstream/2.3.3/src/rewriter.cc +0 -1038
  770. data/ext/v8/upstream/2.3.3/src/rewriter.h +0 -54
  771. data/ext/v8/upstream/2.3.3/src/runtime.cc +0 -10599
  772. data/ext/v8/upstream/2.3.3/src/runtime.h +0 -459
  773. data/ext/v8/upstream/2.3.3/src/runtime.js +0 -629
  774. data/ext/v8/upstream/2.3.3/src/scanner.cc +0 -1346
  775. data/ext/v8/upstream/2.3.3/src/scanner.h +0 -503
  776. data/ext/v8/upstream/2.3.3/src/scopeinfo.cc +0 -637
  777. data/ext/v8/upstream/2.3.3/src/scopeinfo.h +0 -233
  778. data/ext/v8/upstream/2.3.3/src/scopes.cc +0 -962
  779. data/ext/v8/upstream/2.3.3/src/scopes.h +0 -400
  780. data/ext/v8/upstream/2.3.3/src/serialize.cc +0 -1461
  781. data/ext/v8/upstream/2.3.3/src/serialize.h +0 -581
  782. data/ext/v8/upstream/2.3.3/src/spaces-inl.h +0 -483
  783. data/ext/v8/upstream/2.3.3/src/spaces.cc +0 -2901
  784. data/ext/v8/upstream/2.3.3/src/spaces.h +0 -2197
  785. data/ext/v8/upstream/2.3.3/src/string-stream.cc +0 -584
  786. data/ext/v8/upstream/2.3.3/src/string-stream.h +0 -189
  787. data/ext/v8/upstream/2.3.3/src/string.js +0 -1006
  788. data/ext/v8/upstream/2.3.3/src/stub-cache.cc +0 -1379
  789. data/ext/v8/upstream/2.3.3/src/stub-cache.h +0 -756
  790. data/ext/v8/upstream/2.3.3/src/third_party/dtoa/COPYING +0 -15
  791. data/ext/v8/upstream/2.3.3/src/third_party/dtoa/dtoa.c +0 -3334
  792. data/ext/v8/upstream/2.3.3/src/token.cc +0 -56
  793. data/ext/v8/upstream/2.3.3/src/token.h +0 -270
  794. data/ext/v8/upstream/2.3.3/src/top.cc +0 -1067
  795. data/ext/v8/upstream/2.3.3/src/top.h +0 -463
  796. data/ext/v8/upstream/2.3.3/src/type-info.cc +0 -53
  797. data/ext/v8/upstream/2.3.3/src/type-info.h +0 -244
  798. data/ext/v8/upstream/2.3.3/src/unicode-inl.h +0 -238
  799. data/ext/v8/upstream/2.3.3/src/unicode.cc +0 -749
  800. data/ext/v8/upstream/2.3.3/src/unicode.h +0 -279
  801. data/ext/v8/upstream/2.3.3/src/uri.js +0 -415
  802. data/ext/v8/upstream/2.3.3/src/utils.cc +0 -285
  803. data/ext/v8/upstream/2.3.3/src/utils.h +0 -745
  804. data/ext/v8/upstream/2.3.3/src/v8-counters.h +0 -250
  805. data/ext/v8/upstream/2.3.3/src/v8.cc +0 -228
  806. data/ext/v8/upstream/2.3.3/src/v8.h +0 -121
  807. data/ext/v8/upstream/2.3.3/src/v8natives.js +0 -1188
  808. data/ext/v8/upstream/2.3.3/src/v8threads.cc +0 -461
  809. data/ext/v8/upstream/2.3.3/src/v8threads.h +0 -159
  810. data/ext/v8/upstream/2.3.3/src/variables.cc +0 -119
  811. data/ext/v8/upstream/2.3.3/src/variables.h +0 -205
  812. data/ext/v8/upstream/2.3.3/src/version.cc +0 -88
  813. data/ext/v8/upstream/2.3.3/src/virtual-frame-heavy-inl.h +0 -192
  814. data/ext/v8/upstream/2.3.3/src/virtual-frame.h +0 -46
  815. data/ext/v8/upstream/2.3.3/src/vm-state-inl.h +0 -137
  816. data/ext/v8/upstream/2.3.3/src/vm-state.cc +0 -39
  817. data/ext/v8/upstream/2.3.3/src/vm-state.h +0 -77
  818. data/ext/v8/upstream/2.3.3/src/x64/assembler-x64-inl.h +0 -400
  819. data/ext/v8/upstream/2.3.3/src/x64/assembler-x64.cc +0 -2963
  820. data/ext/v8/upstream/2.3.3/src/x64/assembler-x64.h +0 -1438
  821. data/ext/v8/upstream/2.3.3/src/x64/builtins-x64.cc +0 -1296
  822. data/ext/v8/upstream/2.3.3/src/x64/codegen-x64-inl.h +0 -46
  823. data/ext/v8/upstream/2.3.3/src/x64/codegen-x64.cc +0 -12491
  824. data/ext/v8/upstream/2.3.3/src/x64/codegen-x64.h +0 -1090
  825. data/ext/v8/upstream/2.3.3/src/x64/cpu-x64.cc +0 -83
  826. data/ext/v8/upstream/2.3.3/src/x64/debug-x64.cc +0 -267
  827. data/ext/v8/upstream/2.3.3/src/x64/disasm-x64.cc +0 -1696
  828. data/ext/v8/upstream/2.3.3/src/x64/fast-codegen-x64.cc +0 -250
  829. data/ext/v8/upstream/2.3.3/src/x64/frames-x64.cc +0 -113
  830. data/ext/v8/upstream/2.3.3/src/x64/frames-x64.h +0 -125
  831. data/ext/v8/upstream/2.3.3/src/x64/full-codegen-x64.cc +0 -3270
  832. data/ext/v8/upstream/2.3.3/src/x64/ic-x64.cc +0 -1907
  833. data/ext/v8/upstream/2.3.3/src/x64/jump-target-x64.cc +0 -437
  834. data/ext/v8/upstream/2.3.3/src/x64/macro-assembler-x64.cc +0 -2793
  835. data/ext/v8/upstream/2.3.3/src/x64/macro-assembler-x64.h +0 -916
  836. data/ext/v8/upstream/2.3.3/src/x64/regexp-macro-assembler-x64.cc +0 -1374
  837. data/ext/v8/upstream/2.3.3/src/x64/regexp-macro-assembler-x64.h +0 -277
  838. data/ext/v8/upstream/2.3.3/src/x64/simulator-x64.h +0 -63
  839. data/ext/v8/upstream/2.3.3/src/x64/stub-cache-x64.cc +0 -2560
  840. data/ext/v8/upstream/2.3.3/src/x64/virtual-frame-x64.cc +0 -1264
  841. data/ext/v8/upstream/2.3.3/src/x64/virtual-frame-x64.h +0 -590
  842. data/ext/v8/upstream/2.3.3/src/zone-inl.h +0 -82
  843. data/ext/v8/upstream/2.3.3/src/zone.cc +0 -194
  844. data/ext/v8/upstream/2.3.3/src/zone.h +0 -221
  845. data/ext/v8/upstream/2.3.3/tools/codemap.js +0 -270
  846. data/ext/v8/upstream/2.3.3/tools/csvparser.js +0 -83
  847. data/ext/v8/upstream/2.3.3/tools/gc-nvp-trace-processor.py +0 -317
  848. data/ext/v8/upstream/2.3.3/tools/gyp/v8.gyp +0 -749
  849. data/ext/v8/upstream/2.3.3/tools/linux-tick-processor.py +0 -78
  850. data/ext/v8/upstream/2.3.3/tools/logreader.js +0 -338
  851. data/ext/v8/upstream/2.3.3/tools/oprofile/annotate +0 -7
  852. data/ext/v8/upstream/2.3.3/tools/oprofile/common +0 -19
  853. data/ext/v8/upstream/2.3.3/tools/oprofile/dump +0 -7
  854. data/ext/v8/upstream/2.3.3/tools/oprofile/report +0 -7
  855. data/ext/v8/upstream/2.3.3/tools/oprofile/reset +0 -7
  856. data/ext/v8/upstream/2.3.3/tools/oprofile/run +0 -14
  857. data/ext/v8/upstream/2.3.3/tools/oprofile/shutdown +0 -7
  858. data/ext/v8/upstream/2.3.3/tools/oprofile/start +0 -7
  859. data/ext/v8/upstream/2.3.3/tools/presubmit.py +0 -299
  860. data/ext/v8/upstream/2.3.3/tools/profile.js +0 -691
  861. data/ext/v8/upstream/2.3.3/tools/profile_view.js +0 -224
  862. data/ext/v8/upstream/2.3.3/tools/splaytree.js +0 -322
  863. data/ext/v8/upstream/2.3.3/tools/splaytree.py +0 -226
  864. data/ext/v8/upstream/2.3.3/tools/tickprocessor.js +0 -862
  865. data/ext/v8/upstream/2.3.3/tools/tickprocessor.py +0 -571
  866. data/ext/v8/upstream/2.3.3/tools/utils.py +0 -88
  867. data/ext/v8/upstream/2.3.3/tools/visual_studio/README.txt +0 -71
  868. data/ext/v8/upstream/2.3.3/tools/visual_studio/common.vsprops +0 -34
  869. data/ext/v8/upstream/2.3.3/tools/visual_studio/debug.vsprops +0 -17
  870. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base.vcproj +0 -1143
  871. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base_arm.vcproj +0 -1115
  872. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base_x64.vcproj +0 -1096
  873. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample.vcproj +0 -145
  874. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -145
  875. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -161
  876. data/ext/v8/upstream/2.3.3/tools/windows-tick-processor.bat +0 -29
  877. data/ext/v8/upstream/2.3.3/tools/windows-tick-processor.py +0 -137
@@ -1,1819 +0,0 @@
1
- // Copyright 2006-2008 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #include "v8.h"
29
-
30
- #include "accessors.h"
31
- #include "api.h"
32
- #include "bootstrapper.h"
33
- #include "compiler.h"
34
- #include "debug.h"
35
- #include "execution.h"
36
- #include "global-handles.h"
37
- #include "macro-assembler.h"
38
- #include "natives.h"
39
- #include "snapshot.h"
40
- #include "stub-cache.h"
41
-
42
- namespace v8 {
43
- namespace internal {
44
-
45
- // A SourceCodeCache uses a FixedArray to store pairs of
46
- // (AsciiString*, JSFunction*), mapping names of native code files
47
- // (runtime.js, etc.) to precompiled functions. Instead of mapping
48
- // names to functions it might make sense to let the JS2C tool
49
- // generate an index for each native JS file.
50
- class SourceCodeCache BASE_EMBEDDED {
51
- public:
52
- explicit SourceCodeCache(Script::Type type): type_(type), cache_(NULL) { }
53
-
54
- void Initialize(bool create_heap_objects) {
55
- cache_ = create_heap_objects ? Heap::empty_fixed_array() : NULL;
56
- }
57
-
58
- void Iterate(ObjectVisitor* v) {
59
- v->VisitPointer(BitCast<Object**, FixedArray**>(&cache_));
60
- }
61
-
62
-
63
- bool Lookup(Vector<const char> name, Handle<SharedFunctionInfo>* handle) {
64
- for (int i = 0; i < cache_->length(); i+=2) {
65
- SeqAsciiString* str = SeqAsciiString::cast(cache_->get(i));
66
- if (str->IsEqualTo(name)) {
67
- *handle = Handle<SharedFunctionInfo>(
68
- SharedFunctionInfo::cast(cache_->get(i + 1)));
69
- return true;
70
- }
71
- }
72
- return false;
73
- }
74
-
75
-
76
- void Add(Vector<const char> name, Handle<SharedFunctionInfo> shared) {
77
- HandleScope scope;
78
- int length = cache_->length();
79
- Handle<FixedArray> new_array =
80
- Factory::NewFixedArray(length + 2, TENURED);
81
- cache_->CopyTo(0, *new_array, 0, cache_->length());
82
- cache_ = *new_array;
83
- Handle<String> str = Factory::NewStringFromAscii(name, TENURED);
84
- cache_->set(length, *str);
85
- cache_->set(length + 1, *shared);
86
- Script::cast(shared->script())->set_type(Smi::FromInt(type_));
87
- }
88
-
89
- private:
90
- Script::Type type_;
91
- FixedArray* cache_;
92
- DISALLOW_COPY_AND_ASSIGN(SourceCodeCache);
93
- };
94
-
95
- static SourceCodeCache extensions_cache(Script::TYPE_EXTENSION);
96
- // This is for delete, not delete[].
97
- static List<char*>* delete_these_non_arrays_on_tear_down = NULL;
98
- // This is for delete[]
99
- static List<char*>* delete_these_arrays_on_tear_down = NULL;
100
-
101
-
102
- NativesExternalStringResource::NativesExternalStringResource(const char* source)
103
- : data_(source), length_(StrLength(source)) {
104
- if (delete_these_non_arrays_on_tear_down == NULL) {
105
- delete_these_non_arrays_on_tear_down = new List<char*>(2);
106
- }
107
- // The resources are small objects and we only make a fixed number of
108
- // them, but let's clean them up on exit for neatness.
109
- delete_these_non_arrays_on_tear_down->
110
- Add(reinterpret_cast<char*>(this));
111
- }
112
-
113
-
114
- Handle<String> Bootstrapper::NativesSourceLookup(int index) {
115
- ASSERT(0 <= index && index < Natives::GetBuiltinsCount());
116
- if (Heap::natives_source_cache()->get(index)->IsUndefined()) {
117
- if (!Snapshot::IsEnabled() || FLAG_new_snapshot) {
118
- // We can use external strings for the natives.
119
- NativesExternalStringResource* resource =
120
- new NativesExternalStringResource(
121
- Natives::GetScriptSource(index).start());
122
- Handle<String> source_code =
123
- Factory::NewExternalStringFromAscii(resource);
124
- Heap::natives_source_cache()->set(index, *source_code);
125
- } else {
126
- // Old snapshot code can't cope with external strings at all.
127
- Handle<String> source_code =
128
- Factory::NewStringFromAscii(Natives::GetScriptSource(index));
129
- Heap::natives_source_cache()->set(index, *source_code);
130
- }
131
- }
132
- Handle<Object> cached_source(Heap::natives_source_cache()->get(index));
133
- return Handle<String>::cast(cached_source);
134
- }
135
-
136
-
137
- void Bootstrapper::Initialize(bool create_heap_objects) {
138
- extensions_cache.Initialize(create_heap_objects);
139
- }
140
-
141
-
142
- char* Bootstrapper::AllocateAutoDeletedArray(int bytes) {
143
- char* memory = new char[bytes];
144
- if (memory != NULL) {
145
- if (delete_these_arrays_on_tear_down == NULL) {
146
- delete_these_arrays_on_tear_down = new List<char*>(2);
147
- }
148
- delete_these_arrays_on_tear_down->Add(memory);
149
- }
150
- return memory;
151
- }
152
-
153
-
154
- void Bootstrapper::TearDown() {
155
- if (delete_these_non_arrays_on_tear_down != NULL) {
156
- int len = delete_these_non_arrays_on_tear_down->length();
157
- ASSERT(len < 20); // Don't use this mechanism for unbounded allocations.
158
- for (int i = 0; i < len; i++) {
159
- delete delete_these_non_arrays_on_tear_down->at(i);
160
- delete_these_non_arrays_on_tear_down->at(i) = NULL;
161
- }
162
- delete delete_these_non_arrays_on_tear_down;
163
- delete_these_non_arrays_on_tear_down = NULL;
164
- }
165
-
166
- if (delete_these_arrays_on_tear_down != NULL) {
167
- int len = delete_these_arrays_on_tear_down->length();
168
- ASSERT(len < 1000); // Don't use this mechanism for unbounded allocations.
169
- for (int i = 0; i < len; i++) {
170
- delete[] delete_these_arrays_on_tear_down->at(i);
171
- delete_these_arrays_on_tear_down->at(i) = NULL;
172
- }
173
- delete delete_these_arrays_on_tear_down;
174
- delete_these_arrays_on_tear_down = NULL;
175
- }
176
-
177
- extensions_cache.Initialize(false); // Yes, symmetrical
178
- }
179
-
180
-
181
- class Genesis BASE_EMBEDDED {
182
- public:
183
- Genesis(Handle<Object> global_object,
184
- v8::Handle<v8::ObjectTemplate> global_template,
185
- v8::ExtensionConfiguration* extensions);
186
- ~Genesis() { }
187
-
188
- Handle<Context> result() { return result_; }
189
-
190
- Genesis* previous() { return previous_; }
191
-
192
- private:
193
- Handle<Context> global_context_;
194
-
195
- // There may be more than one active genesis object: When GC is
196
- // triggered during environment creation there may be weak handle
197
- // processing callbacks which may create new environments.
198
- Genesis* previous_;
199
-
200
- Handle<Context> global_context() { return global_context_; }
201
-
202
- // Creates some basic objects. Used for creating a context from scratch.
203
- void CreateRoots();
204
- // Creates the empty function. Used for creating a context from scratch.
205
- Handle<JSFunction> CreateEmptyFunction();
206
- // Creates the global objects using the global and the template passed in
207
- // through the API. We call this regardless of whether we are building a
208
- // context from scratch or using a deserialized one from the partial snapshot
209
- // but in the latter case we don't use the objects it produces directly, as
210
- // we have to used the deserialized ones that are linked together with the
211
- // rest of the context snapshot.
212
- Handle<JSGlobalProxy> CreateNewGlobals(
213
- v8::Handle<v8::ObjectTemplate> global_template,
214
- Handle<Object> global_object,
215
- Handle<GlobalObject>* global_proxy_out);
216
- // Hooks the given global proxy into the context. If the context was created
217
- // by deserialization then this will unhook the global proxy that was
218
- // deserialized, leaving the GC to pick it up.
219
- void HookUpGlobalProxy(Handle<GlobalObject> inner_global,
220
- Handle<JSGlobalProxy> global_proxy);
221
- // Similarly, we want to use the inner global that has been created by the
222
- // templates passed through the API. The inner global from the snapshot is
223
- // detached from the other objects in the snapshot.
224
- void HookUpInnerGlobal(Handle<GlobalObject> inner_global);
225
- // New context initialization. Used for creating a context from scratch.
226
- void InitializeGlobal(Handle<GlobalObject> inner_global,
227
- Handle<JSFunction> empty_function);
228
- // Installs the contents of the native .js files on the global objects.
229
- // Used for creating a context from scratch.
230
- void InstallNativeFunctions();
231
- bool InstallNatives();
232
- void InstallCustomCallGenerators();
233
- void InstallJSFunctionResultCaches();
234
- // Used both for deserialized and from-scratch contexts to add the extensions
235
- // provided.
236
- static bool InstallExtensions(Handle<Context> global_context,
237
- v8::ExtensionConfiguration* extensions);
238
- static bool InstallExtension(const char* name);
239
- static bool InstallExtension(v8::RegisteredExtension* current);
240
- static void InstallSpecialObjects(Handle<Context> global_context);
241
- bool InstallJSBuiltins(Handle<JSBuiltinsObject> builtins);
242
- bool ConfigureApiObject(Handle<JSObject> object,
243
- Handle<ObjectTemplateInfo> object_template);
244
- bool ConfigureGlobalObjects(v8::Handle<v8::ObjectTemplate> global_template);
245
-
246
- // Migrates all properties from the 'from' object to the 'to'
247
- // object and overrides the prototype in 'to' with the one from
248
- // 'from'.
249
- void TransferObject(Handle<JSObject> from, Handle<JSObject> to);
250
- void TransferNamedProperties(Handle<JSObject> from, Handle<JSObject> to);
251
- void TransferIndexedProperties(Handle<JSObject> from, Handle<JSObject> to);
252
-
253
- enum PrototypePropertyMode {
254
- DONT_ADD_PROTOTYPE,
255
- ADD_READONLY_PROTOTYPE,
256
- ADD_WRITEABLE_PROTOTYPE
257
- };
258
- Handle<DescriptorArray> ComputeFunctionInstanceDescriptor(
259
- PrototypePropertyMode prototypeMode);
260
- void MakeFunctionInstancePrototypeWritable();
261
-
262
- static bool CompileBuiltin(int index);
263
- static bool CompileNative(Vector<const char> name, Handle<String> source);
264
- static bool CompileScriptCached(Vector<const char> name,
265
- Handle<String> source,
266
- SourceCodeCache* cache,
267
- v8::Extension* extension,
268
- Handle<Context> top_context,
269
- bool use_runtime_context);
270
-
271
- Handle<Context> result_;
272
- Handle<JSFunction> empty_function_;
273
- BootstrapperActive active_;
274
- friend class Bootstrapper;
275
- };
276
-
277
-
278
- void Bootstrapper::Iterate(ObjectVisitor* v) {
279
- extensions_cache.Iterate(v);
280
- v->Synchronize("Extensions");
281
- }
282
-
283
-
284
- Handle<Context> Bootstrapper::CreateEnvironment(
285
- Handle<Object> global_object,
286
- v8::Handle<v8::ObjectTemplate> global_template,
287
- v8::ExtensionConfiguration* extensions) {
288
- HandleScope scope;
289
- Handle<Context> env;
290
- Genesis genesis(global_object, global_template, extensions);
291
- env = genesis.result();
292
- if (!env.is_null()) {
293
- if (InstallExtensions(env, extensions)) {
294
- return env;
295
- }
296
- }
297
- return Handle<Context>();
298
- }
299
-
300
-
301
- static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) {
302
- // object.__proto__ = proto;
303
- Handle<Map> old_to_map = Handle<Map>(object->map());
304
- Handle<Map> new_to_map = Factory::CopyMapDropTransitions(old_to_map);
305
- new_to_map->set_prototype(*proto);
306
- object->set_map(*new_to_map);
307
- }
308
-
309
-
310
- void Bootstrapper::DetachGlobal(Handle<Context> env) {
311
- JSGlobalProxy::cast(env->global_proxy())->set_context(*Factory::null_value());
312
- SetObjectPrototype(Handle<JSObject>(env->global_proxy()),
313
- Factory::null_value());
314
- env->set_global_proxy(env->global());
315
- env->global()->set_global_receiver(env->global());
316
- }
317
-
318
-
319
- void Bootstrapper::ReattachGlobal(Handle<Context> env,
320
- Handle<Object> global_object) {
321
- ASSERT(global_object->IsJSGlobalProxy());
322
- Handle<JSGlobalProxy> global = Handle<JSGlobalProxy>::cast(global_object);
323
- env->global()->set_global_receiver(*global);
324
- env->set_global_proxy(*global);
325
- SetObjectPrototype(global, Handle<JSObject>(env->global()));
326
- global->set_context(*env);
327
- }
328
-
329
-
330
- static Handle<JSFunction> InstallFunction(Handle<JSObject> target,
331
- const char* name,
332
- InstanceType type,
333
- int instance_size,
334
- Handle<JSObject> prototype,
335
- Builtins::Name call,
336
- bool is_ecma_native) {
337
- Handle<String> symbol = Factory::LookupAsciiSymbol(name);
338
- Handle<Code> call_code = Handle<Code>(Builtins::builtin(call));
339
- Handle<JSFunction> function = prototype.is_null() ?
340
- Factory::NewFunctionWithoutPrototype(symbol, call_code) :
341
- Factory::NewFunctionWithPrototype(symbol,
342
- type,
343
- instance_size,
344
- prototype,
345
- call_code,
346
- is_ecma_native);
347
- SetProperty(target, symbol, function, DONT_ENUM);
348
- if (is_ecma_native) {
349
- function->shared()->set_instance_class_name(*symbol);
350
- }
351
- return function;
352
- }
353
-
354
-
355
- Handle<DescriptorArray> Genesis::ComputeFunctionInstanceDescriptor(
356
- PrototypePropertyMode prototypeMode) {
357
- Handle<DescriptorArray> result = Factory::empty_descriptor_array();
358
-
359
- if (prototypeMode != DONT_ADD_PROTOTYPE) {
360
- PropertyAttributes attributes = static_cast<PropertyAttributes>(
361
- DONT_ENUM |
362
- DONT_DELETE |
363
- (prototypeMode == ADD_READONLY_PROTOTYPE ? READ_ONLY : 0));
364
- result =
365
- Factory::CopyAppendProxyDescriptor(
366
- result,
367
- Factory::prototype_symbol(),
368
- Factory::NewProxy(&Accessors::FunctionPrototype),
369
- attributes);
370
- }
371
-
372
- PropertyAttributes attributes =
373
- static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
374
- // Add length.
375
- result =
376
- Factory::CopyAppendProxyDescriptor(
377
- result,
378
- Factory::length_symbol(),
379
- Factory::NewProxy(&Accessors::FunctionLength),
380
- attributes);
381
-
382
- // Add name.
383
- result =
384
- Factory::CopyAppendProxyDescriptor(
385
- result,
386
- Factory::name_symbol(),
387
- Factory::NewProxy(&Accessors::FunctionName),
388
- attributes);
389
-
390
- // Add arguments.
391
- result =
392
- Factory::CopyAppendProxyDescriptor(
393
- result,
394
- Factory::arguments_symbol(),
395
- Factory::NewProxy(&Accessors::FunctionArguments),
396
- attributes);
397
-
398
- // Add caller.
399
- result =
400
- Factory::CopyAppendProxyDescriptor(
401
- result,
402
- Factory::caller_symbol(),
403
- Factory::NewProxy(&Accessors::FunctionCaller),
404
- attributes);
405
-
406
- return result;
407
- }
408
-
409
-
410
- Handle<JSFunction> Genesis::CreateEmptyFunction() {
411
- // Allocate the map for function instances.
412
- Handle<Map> fm = Factory::NewMap(JS_FUNCTION_TYPE, JSFunction::kSize);
413
- global_context()->set_function_instance_map(*fm);
414
- // Please note that the prototype property for function instances must be
415
- // writable.
416
- Handle<DescriptorArray> function_map_descriptors =
417
- ComputeFunctionInstanceDescriptor(ADD_WRITEABLE_PROTOTYPE);
418
- fm->set_instance_descriptors(*function_map_descriptors);
419
- fm->set_function_with_prototype(true);
420
-
421
- // Functions with this map will not have a 'prototype' property, and
422
- // can not be used as constructors.
423
- Handle<Map> function_without_prototype_map =
424
- Factory::NewMap(JS_FUNCTION_TYPE, JSFunction::kSize);
425
- global_context()->set_function_without_prototype_map(
426
- *function_without_prototype_map);
427
- Handle<DescriptorArray> function_without_prototype_map_descriptors =
428
- ComputeFunctionInstanceDescriptor(DONT_ADD_PROTOTYPE);
429
- function_without_prototype_map->set_instance_descriptors(
430
- *function_without_prototype_map_descriptors);
431
- function_without_prototype_map->set_function_with_prototype(false);
432
-
433
- // Allocate the function map first and then patch the prototype later
434
- fm = Factory::NewMap(JS_FUNCTION_TYPE, JSFunction::kSize);
435
- global_context()->set_function_map(*fm);
436
- function_map_descriptors =
437
- ComputeFunctionInstanceDescriptor(ADD_READONLY_PROTOTYPE);
438
- fm->set_instance_descriptors(*function_map_descriptors);
439
- fm->set_function_with_prototype(true);
440
-
441
- Handle<String> object_name = Handle<String>(Heap::Object_symbol());
442
-
443
- { // --- O b j e c t ---
444
- Handle<JSFunction> object_fun =
445
- Factory::NewFunction(object_name, Factory::null_value());
446
- Handle<Map> object_function_map =
447
- Factory::NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
448
- object_fun->set_initial_map(*object_function_map);
449
- object_function_map->set_constructor(*object_fun);
450
-
451
- global_context()->set_object_function(*object_fun);
452
-
453
- // Allocate a new prototype for the object function.
454
- Handle<JSObject> prototype = Factory::NewJSObject(Top::object_function(),
455
- TENURED);
456
-
457
- global_context()->set_initial_object_prototype(*prototype);
458
- SetPrototype(object_fun, prototype);
459
- object_function_map->
460
- set_instance_descriptors(Heap::empty_descriptor_array());
461
- }
462
-
463
- // Allocate the empty function as the prototype for function ECMAScript
464
- // 262 15.3.4.
465
- Handle<String> symbol = Factory::LookupAsciiSymbol("Empty");
466
- Handle<JSFunction> empty_function =
467
- Factory::NewFunctionWithoutPrototype(symbol);
468
-
469
- // --- E m p t y ---
470
- Handle<Code> code =
471
- Handle<Code>(Builtins::builtin(Builtins::EmptyFunction));
472
- empty_function->set_code(*code);
473
- Handle<String> source = Factory::NewStringFromAscii(CStrVector("() {}"));
474
- Handle<Script> script = Factory::NewScript(source);
475
- script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
476
- empty_function->shared()->set_script(*script);
477
- empty_function->shared()->set_start_position(0);
478
- empty_function->shared()->set_end_position(source->length());
479
- empty_function->shared()->DontAdaptArguments();
480
- global_context()->function_map()->set_prototype(*empty_function);
481
- global_context()->function_instance_map()->set_prototype(*empty_function);
482
- global_context()->function_without_prototype_map()->
483
- set_prototype(*empty_function);
484
-
485
- // Allocate the function map first and then patch the prototype later
486
- Handle<Map> empty_fm = Factory::CopyMapDropDescriptors(
487
- function_without_prototype_map);
488
- empty_fm->set_instance_descriptors(
489
- *function_without_prototype_map_descriptors);
490
- empty_fm->set_prototype(global_context()->object_function()->prototype());
491
- empty_function->set_map(*empty_fm);
492
- return empty_function;
493
- }
494
-
495
-
496
- void Genesis::CreateRoots() {
497
- // Allocate the global context FixedArray first and then patch the
498
- // closure and extension object later (we need the empty function
499
- // and the global object, but in order to create those, we need the
500
- // global context).
501
- global_context_ =
502
- Handle<Context>::cast(
503
- GlobalHandles::Create(*Factory::NewGlobalContext()));
504
- Top::set_context(*global_context());
505
-
506
- // Allocate the message listeners object.
507
- {
508
- v8::NeanderArray listeners;
509
- global_context()->set_message_listeners(*listeners.value());
510
- }
511
- }
512
-
513
-
514
- Handle<JSGlobalProxy> Genesis::CreateNewGlobals(
515
- v8::Handle<v8::ObjectTemplate> global_template,
516
- Handle<Object> global_object,
517
- Handle<GlobalObject>* inner_global_out) {
518
- // The argument global_template aka data is an ObjectTemplateInfo.
519
- // It has a constructor pointer that points at global_constructor which is a
520
- // FunctionTemplateInfo.
521
- // The global_constructor is used to create or reinitialize the global_proxy.
522
- // The global_constructor also has a prototype_template pointer that points at
523
- // js_global_template which is an ObjectTemplateInfo.
524
- // That in turn has a constructor pointer that points at
525
- // js_global_constructor which is a FunctionTemplateInfo.
526
- // js_global_constructor is used to make js_global_function
527
- // js_global_function is used to make the new inner_global.
528
- //
529
- // --- G l o b a l ---
530
- // Step 1: Create a fresh inner JSGlobalObject.
531
- Handle<JSFunction> js_global_function;
532
- Handle<ObjectTemplateInfo> js_global_template;
533
- if (!global_template.IsEmpty()) {
534
- // Get prototype template of the global_template.
535
- Handle<ObjectTemplateInfo> data =
536
- v8::Utils::OpenHandle(*global_template);
537
- Handle<FunctionTemplateInfo> global_constructor =
538
- Handle<FunctionTemplateInfo>(
539
- FunctionTemplateInfo::cast(data->constructor()));
540
- Handle<Object> proto_template(global_constructor->prototype_template());
541
- if (!proto_template->IsUndefined()) {
542
- js_global_template =
543
- Handle<ObjectTemplateInfo>::cast(proto_template);
544
- }
545
- }
546
-
547
- if (js_global_template.is_null()) {
548
- Handle<String> name = Handle<String>(Heap::empty_symbol());
549
- Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::Illegal));
550
- js_global_function =
551
- Factory::NewFunction(name, JS_GLOBAL_OBJECT_TYPE,
552
- JSGlobalObject::kSize, code, true);
553
- // Change the constructor property of the prototype of the
554
- // hidden global function to refer to the Object function.
555
- Handle<JSObject> prototype =
556
- Handle<JSObject>(
557
- JSObject::cast(js_global_function->instance_prototype()));
558
- SetProperty(prototype, Factory::constructor_symbol(),
559
- Top::object_function(), NONE);
560
- } else {
561
- Handle<FunctionTemplateInfo> js_global_constructor(
562
- FunctionTemplateInfo::cast(js_global_template->constructor()));
563
- js_global_function =
564
- Factory::CreateApiFunction(js_global_constructor,
565
- Factory::InnerGlobalObject);
566
- }
567
-
568
- js_global_function->initial_map()->set_is_hidden_prototype();
569
- Handle<GlobalObject> inner_global =
570
- Factory::NewGlobalObject(js_global_function);
571
- if (inner_global_out != NULL) {
572
- *inner_global_out = inner_global;
573
- }
574
-
575
- // Step 2: create or re-initialize the global proxy object.
576
- Handle<JSFunction> global_proxy_function;
577
- if (global_template.IsEmpty()) {
578
- Handle<String> name = Handle<String>(Heap::empty_symbol());
579
- Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::Illegal));
580
- global_proxy_function =
581
- Factory::NewFunction(name, JS_GLOBAL_PROXY_TYPE,
582
- JSGlobalProxy::kSize, code, true);
583
- } else {
584
- Handle<ObjectTemplateInfo> data =
585
- v8::Utils::OpenHandle(*global_template);
586
- Handle<FunctionTemplateInfo> global_constructor(
587
- FunctionTemplateInfo::cast(data->constructor()));
588
- global_proxy_function =
589
- Factory::CreateApiFunction(global_constructor,
590
- Factory::OuterGlobalObject);
591
- }
592
-
593
- Handle<String> global_name = Factory::LookupAsciiSymbol("global");
594
- global_proxy_function->shared()->set_instance_class_name(*global_name);
595
- global_proxy_function->initial_map()->set_is_access_check_needed(true);
596
-
597
- // Set global_proxy.__proto__ to js_global after ConfigureGlobalObjects
598
- // Return the global proxy.
599
-
600
- if (global_object.location() != NULL) {
601
- ASSERT(global_object->IsJSGlobalProxy());
602
- return ReinitializeJSGlobalProxy(
603
- global_proxy_function,
604
- Handle<JSGlobalProxy>::cast(global_object));
605
- } else {
606
- return Handle<JSGlobalProxy>::cast(
607
- Factory::NewJSObject(global_proxy_function, TENURED));
608
- }
609
- }
610
-
611
-
612
- void Genesis::HookUpGlobalProxy(Handle<GlobalObject> inner_global,
613
- Handle<JSGlobalProxy> global_proxy) {
614
- // Set the global context for the global object.
615
- inner_global->set_global_context(*global_context());
616
- inner_global->set_global_receiver(*global_proxy);
617
- global_proxy->set_context(*global_context());
618
- global_context()->set_global_proxy(*global_proxy);
619
- }
620
-
621
-
622
- void Genesis::HookUpInnerGlobal(Handle<GlobalObject> inner_global) {
623
- Handle<GlobalObject> inner_global_from_snapshot(
624
- GlobalObject::cast(global_context_->extension()));
625
- Handle<JSBuiltinsObject> builtins_global(global_context_->builtins());
626
- global_context_->set_extension(*inner_global);
627
- global_context_->set_global(*inner_global);
628
- global_context_->set_security_token(*inner_global);
629
- static const PropertyAttributes attributes =
630
- static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE);
631
- ForceSetProperty(builtins_global,
632
- Factory::LookupAsciiSymbol("global"),
633
- inner_global,
634
- attributes);
635
- // Setup the reference from the global object to the builtins object.
636
- JSGlobalObject::cast(*inner_global)->set_builtins(*builtins_global);
637
- TransferNamedProperties(inner_global_from_snapshot, inner_global);
638
- TransferIndexedProperties(inner_global_from_snapshot, inner_global);
639
- }
640
-
641
-
642
- // This is only called if we are not using snapshots. The equivalent
643
- // work in the snapshot case is done in HookUpInnerGlobal.
644
- void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
645
- Handle<JSFunction> empty_function) {
646
- // --- G l o b a l C o n t e x t ---
647
- // Use the empty function as closure (no scope info).
648
- global_context()->set_closure(*empty_function);
649
- global_context()->set_fcontext(*global_context());
650
- global_context()->set_previous(NULL);
651
- // Set extension and global object.
652
- global_context()->set_extension(*inner_global);
653
- global_context()->set_global(*inner_global);
654
- // Security setup: Set the security token of the global object to
655
- // its the inner global. This makes the security check between two
656
- // different contexts fail by default even in case of global
657
- // object reinitialization.
658
- global_context()->set_security_token(*inner_global);
659
-
660
- Handle<String> object_name = Handle<String>(Heap::Object_symbol());
661
- SetProperty(inner_global, object_name, Top::object_function(), DONT_ENUM);
662
-
663
- Handle<JSObject> global = Handle<JSObject>(global_context()->global());
664
-
665
- // Install global Function object
666
- InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize,
667
- empty_function, Builtins::Illegal, true); // ECMA native.
668
-
669
- { // --- A r r a y ---
670
- Handle<JSFunction> array_function =
671
- InstallFunction(global, "Array", JS_ARRAY_TYPE, JSArray::kSize,
672
- Top::initial_object_prototype(), Builtins::ArrayCode,
673
- true);
674
- array_function->shared()->set_construct_stub(
675
- Builtins::builtin(Builtins::ArrayConstructCode));
676
- array_function->shared()->DontAdaptArguments();
677
-
678
- // This seems a bit hackish, but we need to make sure Array.length
679
- // is 1.
680
- array_function->shared()->set_length(1);
681
- Handle<DescriptorArray> array_descriptors =
682
- Factory::CopyAppendProxyDescriptor(
683
- Factory::empty_descriptor_array(),
684
- Factory::length_symbol(),
685
- Factory::NewProxy(&Accessors::ArrayLength),
686
- static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE));
687
-
688
- // Cache the fast JavaScript array map
689
- global_context()->set_js_array_map(array_function->initial_map());
690
- global_context()->js_array_map()->set_instance_descriptors(
691
- *array_descriptors);
692
- // array_function is used internally. JS code creating array object should
693
- // search for the 'Array' property on the global object and use that one
694
- // as the constructor. 'Array' property on a global object can be
695
- // overwritten by JS code.
696
- global_context()->set_array_function(*array_function);
697
- }
698
-
699
- { // --- N u m b e r ---
700
- Handle<JSFunction> number_fun =
701
- InstallFunction(global, "Number", JS_VALUE_TYPE, JSValue::kSize,
702
- Top::initial_object_prototype(), Builtins::Illegal,
703
- true);
704
- global_context()->set_number_function(*number_fun);
705
- }
706
-
707
- { // --- B o o l e a n ---
708
- Handle<JSFunction> boolean_fun =
709
- InstallFunction(global, "Boolean", JS_VALUE_TYPE, JSValue::kSize,
710
- Top::initial_object_prototype(), Builtins::Illegal,
711
- true);
712
- global_context()->set_boolean_function(*boolean_fun);
713
- }
714
-
715
- { // --- S t r i n g ---
716
- Handle<JSFunction> string_fun =
717
- InstallFunction(global, "String", JS_VALUE_TYPE, JSValue::kSize,
718
- Top::initial_object_prototype(), Builtins::Illegal,
719
- true);
720
- global_context()->set_string_function(*string_fun);
721
- // Add 'length' property to strings.
722
- Handle<DescriptorArray> string_descriptors =
723
- Factory::CopyAppendProxyDescriptor(
724
- Factory::empty_descriptor_array(),
725
- Factory::length_symbol(),
726
- Factory::NewProxy(&Accessors::StringLength),
727
- static_cast<PropertyAttributes>(DONT_ENUM |
728
- DONT_DELETE |
729
- READ_ONLY));
730
-
731
- Handle<Map> string_map =
732
- Handle<Map>(global_context()->string_function()->initial_map());
733
- string_map->set_instance_descriptors(*string_descriptors);
734
- }
735
-
736
- { // --- D a t e ---
737
- // Builtin functions for Date.prototype.
738
- Handle<JSFunction> date_fun =
739
- InstallFunction(global, "Date", JS_VALUE_TYPE, JSValue::kSize,
740
- Top::initial_object_prototype(), Builtins::Illegal,
741
- true);
742
-
743
- global_context()->set_date_function(*date_fun);
744
- }
745
-
746
-
747
- { // -- R e g E x p
748
- // Builtin functions for RegExp.prototype.
749
- Handle<JSFunction> regexp_fun =
750
- InstallFunction(global, "RegExp", JS_REGEXP_TYPE, JSRegExp::kSize,
751
- Top::initial_object_prototype(), Builtins::Illegal,
752
- true);
753
- global_context()->set_regexp_function(*regexp_fun);
754
-
755
- ASSERT(regexp_fun->has_initial_map());
756
- Handle<Map> initial_map(regexp_fun->initial_map());
757
-
758
- ASSERT_EQ(0, initial_map->inobject_properties());
759
-
760
- Handle<DescriptorArray> descriptors = Factory::NewDescriptorArray(5);
761
- PropertyAttributes final =
762
- static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
763
- int enum_index = 0;
764
- {
765
- // ECMA-262, section 15.10.7.1.
766
- FieldDescriptor field(Heap::source_symbol(),
767
- JSRegExp::kSourceFieldIndex,
768
- final,
769
- enum_index++);
770
- descriptors->Set(0, &field);
771
- }
772
- {
773
- // ECMA-262, section 15.10.7.2.
774
- FieldDescriptor field(Heap::global_symbol(),
775
- JSRegExp::kGlobalFieldIndex,
776
- final,
777
- enum_index++);
778
- descriptors->Set(1, &field);
779
- }
780
- {
781
- // ECMA-262, section 15.10.7.3.
782
- FieldDescriptor field(Heap::ignore_case_symbol(),
783
- JSRegExp::kIgnoreCaseFieldIndex,
784
- final,
785
- enum_index++);
786
- descriptors->Set(2, &field);
787
- }
788
- {
789
- // ECMA-262, section 15.10.7.4.
790
- FieldDescriptor field(Heap::multiline_symbol(),
791
- JSRegExp::kMultilineFieldIndex,
792
- final,
793
- enum_index++);
794
- descriptors->Set(3, &field);
795
- }
796
- {
797
- // ECMA-262, section 15.10.7.5.
798
- PropertyAttributes writable =
799
- static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
800
- FieldDescriptor field(Heap::last_index_symbol(),
801
- JSRegExp::kLastIndexFieldIndex,
802
- writable,
803
- enum_index++);
804
- descriptors->Set(4, &field);
805
- }
806
- descriptors->SetNextEnumerationIndex(enum_index);
807
- descriptors->Sort();
808
-
809
- initial_map->set_inobject_properties(5);
810
- initial_map->set_pre_allocated_property_fields(5);
811
- initial_map->set_unused_property_fields(0);
812
- initial_map->set_instance_size(
813
- initial_map->instance_size() + 5 * kPointerSize);
814
- initial_map->set_instance_descriptors(*descriptors);
815
- initial_map->set_scavenger(
816
- Heap::GetScavenger(initial_map->instance_type(),
817
- initial_map->instance_size()));
818
- }
819
-
820
- { // -- J S O N
821
- Handle<String> name = Factory::NewStringFromAscii(CStrVector("JSON"));
822
- Handle<JSFunction> cons = Factory::NewFunction(
823
- name,
824
- Factory::the_hole_value());
825
- cons->SetInstancePrototype(global_context()->initial_object_prototype());
826
- cons->SetInstanceClassName(*name);
827
- Handle<JSObject> json_object = Factory::NewJSObject(cons, TENURED);
828
- ASSERT(json_object->IsJSObject());
829
- SetProperty(global, name, json_object, DONT_ENUM);
830
- global_context()->set_json_object(*json_object);
831
- }
832
-
833
- { // --- arguments_boilerplate_
834
- // Make sure we can recognize argument objects at runtime.
835
- // This is done by introducing an anonymous function with
836
- // class_name equals 'Arguments'.
837
- Handle<String> symbol = Factory::LookupAsciiSymbol("Arguments");
838
- Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::Illegal));
839
- Handle<JSObject> prototype =
840
- Handle<JSObject>(
841
- JSObject::cast(global_context()->object_function()->prototype()));
842
-
843
- Handle<JSFunction> function =
844
- Factory::NewFunctionWithPrototype(symbol,
845
- JS_OBJECT_TYPE,
846
- JSObject::kHeaderSize,
847
- prototype,
848
- code,
849
- false);
850
- ASSERT(!function->has_initial_map());
851
- function->shared()->set_instance_class_name(*symbol);
852
- function->shared()->set_expected_nof_properties(2);
853
- Handle<JSObject> result = Factory::NewJSObject(function);
854
-
855
- global_context()->set_arguments_boilerplate(*result);
856
- // Note: callee must be added as the first property and
857
- // length must be added as the second property.
858
- SetProperty(result, Factory::callee_symbol(),
859
- Factory::undefined_value(),
860
- DONT_ENUM);
861
- SetProperty(result, Factory::length_symbol(),
862
- Factory::undefined_value(),
863
- DONT_ENUM);
864
-
865
- #ifdef DEBUG
866
- LookupResult lookup;
867
- result->LocalLookup(Heap::callee_symbol(), &lookup);
868
- ASSERT(lookup.IsProperty() && (lookup.type() == FIELD));
869
- ASSERT(lookup.GetFieldIndex() == Heap::arguments_callee_index);
870
-
871
- result->LocalLookup(Heap::length_symbol(), &lookup);
872
- ASSERT(lookup.IsProperty() && (lookup.type() == FIELD));
873
- ASSERT(lookup.GetFieldIndex() == Heap::arguments_length_index);
874
-
875
- ASSERT(result->map()->inobject_properties() > Heap::arguments_callee_index);
876
- ASSERT(result->map()->inobject_properties() > Heap::arguments_length_index);
877
-
878
- // Check the state of the object.
879
- ASSERT(result->HasFastProperties());
880
- ASSERT(result->HasFastElements());
881
- #endif
882
- }
883
-
884
- { // --- context extension
885
- // Create a function for the context extension objects.
886
- Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::Illegal));
887
- Handle<JSFunction> context_extension_fun =
888
- Factory::NewFunction(Factory::empty_symbol(),
889
- JS_CONTEXT_EXTENSION_OBJECT_TYPE,
890
- JSObject::kHeaderSize,
891
- code,
892
- true);
893
-
894
- Handle<String> name = Factory::LookupAsciiSymbol("context_extension");
895
- context_extension_fun->shared()->set_instance_class_name(*name);
896
- global_context()->set_context_extension_function(*context_extension_fun);
897
- }
898
-
899
-
900
- {
901
- // Setup the call-as-function delegate.
902
- Handle<Code> code =
903
- Handle<Code>(Builtins::builtin(Builtins::HandleApiCallAsFunction));
904
- Handle<JSFunction> delegate =
905
- Factory::NewFunction(Factory::empty_symbol(), JS_OBJECT_TYPE,
906
- JSObject::kHeaderSize, code, true);
907
- global_context()->set_call_as_function_delegate(*delegate);
908
- delegate->shared()->DontAdaptArguments();
909
- }
910
-
911
- {
912
- // Setup the call-as-constructor delegate.
913
- Handle<Code> code =
914
- Handle<Code>(Builtins::builtin(Builtins::HandleApiCallAsConstructor));
915
- Handle<JSFunction> delegate =
916
- Factory::NewFunction(Factory::empty_symbol(), JS_OBJECT_TYPE,
917
- JSObject::kHeaderSize, code, true);
918
- global_context()->set_call_as_constructor_delegate(*delegate);
919
- delegate->shared()->DontAdaptArguments();
920
- }
921
-
922
- // Initialize the out of memory slot.
923
- global_context()->set_out_of_memory(Heap::false_value());
924
-
925
- // Initialize the data slot.
926
- global_context()->set_data(Heap::undefined_value());
927
- }
928
-
929
-
930
- bool Genesis::CompileBuiltin(int index) {
931
- Vector<const char> name = Natives::GetScriptName(index);
932
- Handle<String> source_code = Bootstrapper::NativesSourceLookup(index);
933
- return CompileNative(name, source_code);
934
- }
935
-
936
-
937
- bool Genesis::CompileNative(Vector<const char> name, Handle<String> source) {
938
- HandleScope scope;
939
- #ifdef ENABLE_DEBUGGER_SUPPORT
940
- Debugger::set_compiling_natives(true);
941
- #endif
942
- bool result = CompileScriptCached(name,
943
- source,
944
- NULL,
945
- NULL,
946
- Handle<Context>(Top::context()),
947
- true);
948
- ASSERT(Top::has_pending_exception() != result);
949
- if (!result) Top::clear_pending_exception();
950
- #ifdef ENABLE_DEBUGGER_SUPPORT
951
- Debugger::set_compiling_natives(false);
952
- #endif
953
- return result;
954
- }
955
-
956
-
957
- bool Genesis::CompileScriptCached(Vector<const char> name,
958
- Handle<String> source,
959
- SourceCodeCache* cache,
960
- v8::Extension* extension,
961
- Handle<Context> top_context,
962
- bool use_runtime_context) {
963
- HandleScope scope;
964
- Handle<SharedFunctionInfo> function_info;
965
-
966
- // If we can't find the function in the cache, we compile a new
967
- // function and insert it into the cache.
968
- if (cache == NULL || !cache->Lookup(name, &function_info)) {
969
- ASSERT(source->IsAsciiRepresentation());
970
- Handle<String> script_name = Factory::NewStringFromUtf8(name);
971
- function_info = Compiler::Compile(
972
- source,
973
- script_name,
974
- 0,
975
- 0,
976
- extension,
977
- NULL,
978
- Handle<String>::null(),
979
- use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE);
980
- if (function_info.is_null()) return false;
981
- if (cache != NULL) cache->Add(name, function_info);
982
- }
983
-
984
- // Setup the function context. Conceptually, we should clone the
985
- // function before overwriting the context but since we're in a
986
- // single-threaded environment it is not strictly necessary.
987
- ASSERT(top_context->IsGlobalContext());
988
- Handle<Context> context =
989
- Handle<Context>(use_runtime_context
990
- ? Handle<Context>(top_context->runtime_context())
991
- : top_context);
992
- Handle<JSFunction> fun =
993
- Factory::NewFunctionFromSharedFunctionInfo(function_info, context);
994
-
995
- // Call function using either the runtime object or the global
996
- // object as the receiver. Provide no parameters.
997
- Handle<Object> receiver =
998
- Handle<Object>(use_runtime_context
999
- ? top_context->builtins()
1000
- : top_context->global());
1001
- bool has_pending_exception;
1002
- Handle<Object> result =
1003
- Execution::Call(fun, receiver, 0, NULL, &has_pending_exception);
1004
- if (has_pending_exception) return false;
1005
- return true;
1006
- }
1007
-
1008
-
1009
- #define INSTALL_NATIVE(Type, name, var) \
1010
- Handle<String> var##_name = Factory::LookupAsciiSymbol(name); \
1011
- global_context()->set_##var(Type::cast(global_context()-> \
1012
- builtins()-> \
1013
- GetProperty(*var##_name)));
1014
-
1015
- void Genesis::InstallNativeFunctions() {
1016
- HandleScope scope;
1017
- INSTALL_NATIVE(JSFunction, "CreateDate", create_date_fun);
1018
- INSTALL_NATIVE(JSFunction, "ToNumber", to_number_fun);
1019
- INSTALL_NATIVE(JSFunction, "ToString", to_string_fun);
1020
- INSTALL_NATIVE(JSFunction, "ToDetailString", to_detail_string_fun);
1021
- INSTALL_NATIVE(JSFunction, "ToObject", to_object_fun);
1022
- INSTALL_NATIVE(JSFunction, "ToInteger", to_integer_fun);
1023
- INSTALL_NATIVE(JSFunction, "ToUint32", to_uint32_fun);
1024
- INSTALL_NATIVE(JSFunction, "ToInt32", to_int32_fun);
1025
- INSTALL_NATIVE(JSFunction, "GlobalEval", global_eval_fun);
1026
- INSTALL_NATIVE(JSFunction, "Instantiate", instantiate_fun);
1027
- INSTALL_NATIVE(JSFunction, "ConfigureTemplateInstance",
1028
- configure_instance_fun);
1029
- INSTALL_NATIVE(JSFunction, "MakeMessage", make_message_fun);
1030
- INSTALL_NATIVE(JSFunction, "GetStackTraceLine", get_stack_trace_line_fun);
1031
- INSTALL_NATIVE(JSObject, "functionCache", function_cache);
1032
- }
1033
-
1034
- #undef INSTALL_NATIVE
1035
-
1036
-
1037
- bool Genesis::InstallNatives() {
1038
- HandleScope scope;
1039
-
1040
- // Create a function for the builtins object. Allocate space for the
1041
- // JavaScript builtins, a reference to the builtins object
1042
- // (itself) and a reference to the global_context directly in the object.
1043
- Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::Illegal));
1044
- Handle<JSFunction> builtins_fun =
1045
- Factory::NewFunction(Factory::empty_symbol(), JS_BUILTINS_OBJECT_TYPE,
1046
- JSBuiltinsObject::kSize, code, true);
1047
-
1048
- Handle<String> name = Factory::LookupAsciiSymbol("builtins");
1049
- builtins_fun->shared()->set_instance_class_name(*name);
1050
-
1051
- // Allocate the builtins object.
1052
- Handle<JSBuiltinsObject> builtins =
1053
- Handle<JSBuiltinsObject>::cast(Factory::NewGlobalObject(builtins_fun));
1054
- builtins->set_builtins(*builtins);
1055
- builtins->set_global_context(*global_context());
1056
- builtins->set_global_receiver(*builtins);
1057
-
1058
- // Setup the 'global' properties of the builtins object. The
1059
- // 'global' property that refers to the global object is the only
1060
- // way to get from code running in the builtins context to the
1061
- // global object.
1062
- static const PropertyAttributes attributes =
1063
- static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE);
1064
- SetProperty(builtins, Factory::LookupAsciiSymbol("global"),
1065
- Handle<Object>(global_context()->global()), attributes);
1066
-
1067
- // Setup the reference from the global object to the builtins object.
1068
- JSGlobalObject::cast(global_context()->global())->set_builtins(*builtins);
1069
-
1070
- // Create a bridge function that has context in the global context.
1071
- Handle<JSFunction> bridge =
1072
- Factory::NewFunction(Factory::empty_symbol(), Factory::undefined_value());
1073
- ASSERT(bridge->context() == *Top::global_context());
1074
-
1075
- // Allocate the builtins context.
1076
- Handle<Context> context =
1077
- Factory::NewFunctionContext(Context::MIN_CONTEXT_SLOTS, bridge);
1078
- context->set_global(*builtins); // override builtins global object
1079
-
1080
- global_context()->set_runtime_context(*context);
1081
-
1082
- { // -- S c r i p t
1083
- // Builtin functions for Script.
1084
- Handle<JSFunction> script_fun =
1085
- InstallFunction(builtins, "Script", JS_VALUE_TYPE, JSValue::kSize,
1086
- Top::initial_object_prototype(), Builtins::Illegal,
1087
- false);
1088
- Handle<JSObject> prototype =
1089
- Factory::NewJSObject(Top::object_function(), TENURED);
1090
- SetPrototype(script_fun, prototype);
1091
- global_context()->set_script_function(*script_fun);
1092
-
1093
- // Add 'source' and 'data' property to scripts.
1094
- PropertyAttributes common_attributes =
1095
- static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
1096
- Handle<Proxy> proxy_source = Factory::NewProxy(&Accessors::ScriptSource);
1097
- Handle<DescriptorArray> script_descriptors =
1098
- Factory::CopyAppendProxyDescriptor(
1099
- Factory::empty_descriptor_array(),
1100
- Factory::LookupAsciiSymbol("source"),
1101
- proxy_source,
1102
- common_attributes);
1103
- Handle<Proxy> proxy_name = Factory::NewProxy(&Accessors::ScriptName);
1104
- script_descriptors =
1105
- Factory::CopyAppendProxyDescriptor(
1106
- script_descriptors,
1107
- Factory::LookupAsciiSymbol("name"),
1108
- proxy_name,
1109
- common_attributes);
1110
- Handle<Proxy> proxy_id = Factory::NewProxy(&Accessors::ScriptId);
1111
- script_descriptors =
1112
- Factory::CopyAppendProxyDescriptor(
1113
- script_descriptors,
1114
- Factory::LookupAsciiSymbol("id"),
1115
- proxy_id,
1116
- common_attributes);
1117
- Handle<Proxy> proxy_line_offset =
1118
- Factory::NewProxy(&Accessors::ScriptLineOffset);
1119
- script_descriptors =
1120
- Factory::CopyAppendProxyDescriptor(
1121
- script_descriptors,
1122
- Factory::LookupAsciiSymbol("line_offset"),
1123
- proxy_line_offset,
1124
- common_attributes);
1125
- Handle<Proxy> proxy_column_offset =
1126
- Factory::NewProxy(&Accessors::ScriptColumnOffset);
1127
- script_descriptors =
1128
- Factory::CopyAppendProxyDescriptor(
1129
- script_descriptors,
1130
- Factory::LookupAsciiSymbol("column_offset"),
1131
- proxy_column_offset,
1132
- common_attributes);
1133
- Handle<Proxy> proxy_data = Factory::NewProxy(&Accessors::ScriptData);
1134
- script_descriptors =
1135
- Factory::CopyAppendProxyDescriptor(
1136
- script_descriptors,
1137
- Factory::LookupAsciiSymbol("data"),
1138
- proxy_data,
1139
- common_attributes);
1140
- Handle<Proxy> proxy_type = Factory::NewProxy(&Accessors::ScriptType);
1141
- script_descriptors =
1142
- Factory::CopyAppendProxyDescriptor(
1143
- script_descriptors,
1144
- Factory::LookupAsciiSymbol("type"),
1145
- proxy_type,
1146
- common_attributes);
1147
- Handle<Proxy> proxy_compilation_type =
1148
- Factory::NewProxy(&Accessors::ScriptCompilationType);
1149
- script_descriptors =
1150
- Factory::CopyAppendProxyDescriptor(
1151
- script_descriptors,
1152
- Factory::LookupAsciiSymbol("compilation_type"),
1153
- proxy_compilation_type,
1154
- common_attributes);
1155
- Handle<Proxy> proxy_line_ends =
1156
- Factory::NewProxy(&Accessors::ScriptLineEnds);
1157
- script_descriptors =
1158
- Factory::CopyAppendProxyDescriptor(
1159
- script_descriptors,
1160
- Factory::LookupAsciiSymbol("line_ends"),
1161
- proxy_line_ends,
1162
- common_attributes);
1163
- Handle<Proxy> proxy_context_data =
1164
- Factory::NewProxy(&Accessors::ScriptContextData);
1165
- script_descriptors =
1166
- Factory::CopyAppendProxyDescriptor(
1167
- script_descriptors,
1168
- Factory::LookupAsciiSymbol("context_data"),
1169
- proxy_context_data,
1170
- common_attributes);
1171
- Handle<Proxy> proxy_eval_from_script =
1172
- Factory::NewProxy(&Accessors::ScriptEvalFromScript);
1173
- script_descriptors =
1174
- Factory::CopyAppendProxyDescriptor(
1175
- script_descriptors,
1176
- Factory::LookupAsciiSymbol("eval_from_script"),
1177
- proxy_eval_from_script,
1178
- common_attributes);
1179
- Handle<Proxy> proxy_eval_from_script_position =
1180
- Factory::NewProxy(&Accessors::ScriptEvalFromScriptPosition);
1181
- script_descriptors =
1182
- Factory::CopyAppendProxyDescriptor(
1183
- script_descriptors,
1184
- Factory::LookupAsciiSymbol("eval_from_script_position"),
1185
- proxy_eval_from_script_position,
1186
- common_attributes);
1187
- Handle<Proxy> proxy_eval_from_function_name =
1188
- Factory::NewProxy(&Accessors::ScriptEvalFromFunctionName);
1189
- script_descriptors =
1190
- Factory::CopyAppendProxyDescriptor(
1191
- script_descriptors,
1192
- Factory::LookupAsciiSymbol("eval_from_function_name"),
1193
- proxy_eval_from_function_name,
1194
- common_attributes);
1195
-
1196
- Handle<Map> script_map = Handle<Map>(script_fun->initial_map());
1197
- script_map->set_instance_descriptors(*script_descriptors);
1198
-
1199
- // Allocate the empty script.
1200
- Handle<Script> script = Factory::NewScript(Factory::empty_string());
1201
- script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
1202
- Heap::public_set_empty_script(*script);
1203
- }
1204
- {
1205
- // Builtin function for OpaqueReference -- a JSValue-based object,
1206
- // that keeps its field isolated from JavaScript code. It may store
1207
- // objects, that JavaScript code may not access.
1208
- Handle<JSFunction> opaque_reference_fun =
1209
- InstallFunction(builtins, "OpaqueReference", JS_VALUE_TYPE,
1210
- JSValue::kSize, Top::initial_object_prototype(),
1211
- Builtins::Illegal, false);
1212
- Handle<JSObject> prototype =
1213
- Factory::NewJSObject(Top::object_function(), TENURED);
1214
- SetPrototype(opaque_reference_fun, prototype);
1215
- global_context()->set_opaque_reference_function(*opaque_reference_fun);
1216
- }
1217
-
1218
- if (FLAG_disable_native_files) {
1219
- PrintF("Warning: Running without installed natives!\n");
1220
- return true;
1221
- }
1222
-
1223
- // Install natives.
1224
- for (int i = Natives::GetDebuggerCount();
1225
- i < Natives::GetBuiltinsCount();
1226
- i++) {
1227
- Vector<const char> name = Natives::GetScriptName(i);
1228
- if (!CompileBuiltin(i)) return false;
1229
- // TODO(ager): We really only need to install the JS builtin
1230
- // functions on the builtins object after compiling and running
1231
- // runtime.js.
1232
- if (!InstallJSBuiltins(builtins)) return false;
1233
- }
1234
-
1235
- InstallNativeFunctions();
1236
-
1237
- InstallCustomCallGenerators();
1238
-
1239
- // Install Function.prototype.call and apply.
1240
- { Handle<String> key = Factory::function_class_symbol();
1241
- Handle<JSFunction> function =
1242
- Handle<JSFunction>::cast(GetProperty(Top::global(), key));
1243
- Handle<JSObject> proto =
1244
- Handle<JSObject>(JSObject::cast(function->instance_prototype()));
1245
-
1246
- // Install the call and the apply functions.
1247
- Handle<JSFunction> call =
1248
- InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize,
1249
- Handle<JSObject>::null(),
1250
- Builtins::FunctionCall,
1251
- false);
1252
- Handle<JSFunction> apply =
1253
- InstallFunction(proto, "apply", JS_OBJECT_TYPE, JSObject::kHeaderSize,
1254
- Handle<JSObject>::null(),
1255
- Builtins::FunctionApply,
1256
- false);
1257
-
1258
- // Make sure that Function.prototype.call appears to be compiled.
1259
- // The code will never be called, but inline caching for call will
1260
- // only work if it appears to be compiled.
1261
- call->shared()->DontAdaptArguments();
1262
- ASSERT(call->is_compiled());
1263
-
1264
- // Set the expected parameters for apply to 2; required by builtin.
1265
- apply->shared()->set_formal_parameter_count(2);
1266
-
1267
- // Set the lengths for the functions to satisfy ECMA-262.
1268
- call->shared()->set_length(1);
1269
- apply->shared()->set_length(2);
1270
- }
1271
-
1272
- // Create a constructor for RegExp results (a variant of Array that
1273
- // predefines the two properties index and match).
1274
- {
1275
- // RegExpResult initial map.
1276
-
1277
- // Find global.Array.prototype to inherit from.
1278
- Handle<JSFunction> array_constructor(global_context()->array_function());
1279
- Handle<JSObject> array_prototype(
1280
- JSObject::cast(array_constructor->instance_prototype()));
1281
-
1282
- // Add initial map.
1283
- Handle<Map> initial_map =
1284
- Factory::NewMap(JS_ARRAY_TYPE, JSRegExpResult::kSize);
1285
- initial_map->set_constructor(*array_constructor);
1286
-
1287
- // Set prototype on map.
1288
- initial_map->set_non_instance_prototype(false);
1289
- initial_map->set_prototype(*array_prototype);
1290
-
1291
- // Update map with length accessor from Array and add "index" and "input".
1292
- Handle<Map> array_map(global_context()->js_array_map());
1293
- Handle<DescriptorArray> array_descriptors(
1294
- array_map->instance_descriptors());
1295
- ASSERT_EQ(1, array_descriptors->number_of_descriptors());
1296
-
1297
- Handle<DescriptorArray> reresult_descriptors =
1298
- Factory::NewDescriptorArray(3);
1299
-
1300
- reresult_descriptors->CopyFrom(0, *array_descriptors, 0);
1301
-
1302
- int enum_index = 0;
1303
- {
1304
- FieldDescriptor index_field(Heap::index_symbol(),
1305
- JSRegExpResult::kIndexIndex,
1306
- NONE,
1307
- enum_index++);
1308
- reresult_descriptors->Set(1, &index_field);
1309
- }
1310
-
1311
- {
1312
- FieldDescriptor input_field(Heap::input_symbol(),
1313
- JSRegExpResult::kInputIndex,
1314
- NONE,
1315
- enum_index++);
1316
- reresult_descriptors->Set(2, &input_field);
1317
- }
1318
- reresult_descriptors->Sort();
1319
-
1320
- initial_map->set_inobject_properties(2);
1321
- initial_map->set_pre_allocated_property_fields(2);
1322
- initial_map->set_unused_property_fields(0);
1323
- initial_map->set_instance_descriptors(*reresult_descriptors);
1324
-
1325
- global_context()->set_regexp_result_map(*initial_map);
1326
- }
1327
-
1328
- #ifdef DEBUG
1329
- builtins->Verify();
1330
- #endif
1331
-
1332
- return true;
1333
- }
1334
-
1335
-
1336
- static void InstallCustomCallGenerator(Handle<JSFunction> holder_function,
1337
- const char* function_name,
1338
- int id) {
1339
- Handle<JSObject> proto(JSObject::cast(holder_function->instance_prototype()));
1340
- Handle<String> name = Factory::LookupAsciiSymbol(function_name);
1341
- Handle<JSFunction> function(JSFunction::cast(proto->GetProperty(*name)));
1342
- function->shared()->set_function_data(Smi::FromInt(id));
1343
- }
1344
-
1345
-
1346
- void Genesis::InstallCustomCallGenerators() {
1347
- HandleScope scope;
1348
- #define INSTALL_CALL_GENERATOR(holder_fun, fun_name, name) \
1349
- { \
1350
- Handle<JSFunction> holder(global_context()->holder_fun##_function()); \
1351
- const int id = CallStubCompiler::k##name##CallGenerator; \
1352
- InstallCustomCallGenerator(holder, #fun_name, id); \
1353
- }
1354
- CUSTOM_CALL_IC_GENERATORS(INSTALL_CALL_GENERATOR)
1355
- #undef INSTALL_CALL_GENERATOR
1356
- }
1357
-
1358
-
1359
- // Do not forget to update macros.py with named constant
1360
- // of cache id.
1361
- #define JSFUNCTION_RESULT_CACHE_LIST(F) \
1362
- F(16, global_context()->regexp_function())
1363
-
1364
-
1365
- static FixedArray* CreateCache(int size, JSFunction* factory) {
1366
- // Caches are supposed to live for a long time, allocate in old space.
1367
- int array_size = JSFunctionResultCache::kEntriesIndex + 2 * size;
1368
- // Cannot use cast as object is not fully initialized yet.
1369
- JSFunctionResultCache* cache = reinterpret_cast<JSFunctionResultCache*>(
1370
- *Factory::NewFixedArrayWithHoles(array_size, TENURED));
1371
- cache->set(JSFunctionResultCache::kFactoryIndex, factory);
1372
- cache->MakeZeroSize();
1373
- return cache;
1374
- }
1375
-
1376
-
1377
- void Genesis::InstallJSFunctionResultCaches() {
1378
- const int kNumberOfCaches = 0 +
1379
- #define F(size, func) + 1
1380
- JSFUNCTION_RESULT_CACHE_LIST(F)
1381
- #undef F
1382
- ;
1383
-
1384
- Handle<FixedArray> caches = Factory::NewFixedArray(kNumberOfCaches, TENURED);
1385
-
1386
- int index = 0;
1387
- #define F(size, func) caches->set(index++, CreateCache(size, func));
1388
- JSFUNCTION_RESULT_CACHE_LIST(F)
1389
- #undef F
1390
-
1391
- global_context()->set_jsfunction_result_caches(*caches);
1392
- }
1393
-
1394
-
1395
- int BootstrapperActive::nesting_ = 0;
1396
-
1397
-
1398
- bool Bootstrapper::InstallExtensions(Handle<Context> global_context,
1399
- v8::ExtensionConfiguration* extensions) {
1400
- BootstrapperActive active;
1401
- SaveContext saved_context;
1402
- Top::set_context(*global_context);
1403
- if (!Genesis::InstallExtensions(global_context, extensions)) return false;
1404
- Genesis::InstallSpecialObjects(global_context);
1405
- return true;
1406
- }
1407
-
1408
-
1409
- void Genesis::InstallSpecialObjects(Handle<Context> global_context) {
1410
- HandleScope scope;
1411
- Handle<JSGlobalObject> js_global(
1412
- JSGlobalObject::cast(global_context->global()));
1413
- // Expose the natives in global if a name for it is specified.
1414
- if (FLAG_expose_natives_as != NULL && strlen(FLAG_expose_natives_as) != 0) {
1415
- Handle<String> natives_string =
1416
- Factory::LookupAsciiSymbol(FLAG_expose_natives_as);
1417
- SetProperty(js_global, natives_string,
1418
- Handle<JSObject>(js_global->builtins()), DONT_ENUM);
1419
- }
1420
-
1421
- Handle<Object> Error = GetProperty(js_global, "Error");
1422
- if (Error->IsJSObject()) {
1423
- Handle<String> name = Factory::LookupAsciiSymbol("stackTraceLimit");
1424
- SetProperty(Handle<JSObject>::cast(Error),
1425
- name,
1426
- Handle<Smi>(Smi::FromInt(FLAG_stack_trace_limit)),
1427
- NONE);
1428
- }
1429
-
1430
- #ifdef ENABLE_DEBUGGER_SUPPORT
1431
- // Expose the debug global object in global if a name for it is specified.
1432
- if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) {
1433
- // If loading fails we just bail out without installing the
1434
- // debugger but without tanking the whole context.
1435
- if (!Debug::Load()) return;
1436
- // Set the security token for the debugger context to the same as
1437
- // the shell global context to allow calling between these (otherwise
1438
- // exposing debug global object doesn't make much sense).
1439
- Debug::debug_context()->set_security_token(
1440
- global_context->security_token());
1441
-
1442
- Handle<String> debug_string =
1443
- Factory::LookupAsciiSymbol(FLAG_expose_debug_as);
1444
- SetProperty(js_global, debug_string,
1445
- Handle<Object>(Debug::debug_context()->global_proxy()), DONT_ENUM);
1446
- }
1447
- #endif
1448
- }
1449
-
1450
-
1451
- bool Genesis::InstallExtensions(Handle<Context> global_context,
1452
- v8::ExtensionConfiguration* extensions) {
1453
- // Clear coloring of extension list
1454
- v8::RegisteredExtension* current = v8::RegisteredExtension::first_extension();
1455
- while (current != NULL) {
1456
- current->set_state(v8::UNVISITED);
1457
- current = current->next();
1458
- }
1459
- // Install auto extensions.
1460
- current = v8::RegisteredExtension::first_extension();
1461
- while (current != NULL) {
1462
- if (current->extension()->auto_enable())
1463
- InstallExtension(current);
1464
- current = current->next();
1465
- }
1466
-
1467
- if (FLAG_expose_gc) InstallExtension("v8/gc");
1468
- if (FLAG_expose_externalize_string) InstallExtension("v8/externalize");
1469
-
1470
- if (extensions == NULL) return true;
1471
- // Install required extensions
1472
- int count = v8::ImplementationUtilities::GetNameCount(extensions);
1473
- const char** names = v8::ImplementationUtilities::GetNames(extensions);
1474
- for (int i = 0; i < count; i++) {
1475
- if (!InstallExtension(names[i]))
1476
- return false;
1477
- }
1478
-
1479
- return true;
1480
- }
1481
-
1482
-
1483
- // Installs a named extension. This methods is unoptimized and does
1484
- // not scale well if we want to support a large number of extensions.
1485
- bool Genesis::InstallExtension(const char* name) {
1486
- v8::RegisteredExtension* current = v8::RegisteredExtension::first_extension();
1487
- // Loop until we find the relevant extension
1488
- while (current != NULL) {
1489
- if (strcmp(name, current->extension()->name()) == 0) break;
1490
- current = current->next();
1491
- }
1492
- // Didn't find the extension; fail.
1493
- if (current == NULL) {
1494
- v8::Utils::ReportApiFailure(
1495
- "v8::Context::New()", "Cannot find required extension");
1496
- return false;
1497
- }
1498
- return InstallExtension(current);
1499
- }
1500
-
1501
-
1502
- bool Genesis::InstallExtension(v8::RegisteredExtension* current) {
1503
- HandleScope scope;
1504
-
1505
- if (current->state() == v8::INSTALLED) return true;
1506
- // The current node has already been visited so there must be a
1507
- // cycle in the dependency graph; fail.
1508
- if (current->state() == v8::VISITED) {
1509
- v8::Utils::ReportApiFailure(
1510
- "v8::Context::New()", "Circular extension dependency");
1511
- return false;
1512
- }
1513
- ASSERT(current->state() == v8::UNVISITED);
1514
- current->set_state(v8::VISITED);
1515
- v8::Extension* extension = current->extension();
1516
- // Install the extension's dependencies
1517
- for (int i = 0; i < extension->dependency_count(); i++) {
1518
- if (!InstallExtension(extension->dependencies()[i])) return false;
1519
- }
1520
- Vector<const char> source = CStrVector(extension->source());
1521
- Handle<String> source_code = Factory::NewStringFromAscii(source);
1522
- bool result = CompileScriptCached(CStrVector(extension->name()),
1523
- source_code,
1524
- &extensions_cache,
1525
- extension,
1526
- Handle<Context>(Top::context()),
1527
- false);
1528
- ASSERT(Top::has_pending_exception() != result);
1529
- if (!result) {
1530
- Top::clear_pending_exception();
1531
- }
1532
- current->set_state(v8::INSTALLED);
1533
- return result;
1534
- }
1535
-
1536
-
1537
- bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) {
1538
- HandleScope scope;
1539
- for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) {
1540
- Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i);
1541
- Handle<String> name = Factory::LookupAsciiSymbol(Builtins::GetName(id));
1542
- Handle<JSFunction> function
1543
- = Handle<JSFunction>(JSFunction::cast(builtins->GetProperty(*name)));
1544
- builtins->set_javascript_builtin(id, *function);
1545
- Handle<SharedFunctionInfo> shared
1546
- = Handle<SharedFunctionInfo>(function->shared());
1547
- if (!EnsureCompiled(shared, CLEAR_EXCEPTION)) return false;
1548
- builtins->set_javascript_builtin_code(id, shared->code());
1549
- }
1550
- return true;
1551
- }
1552
-
1553
-
1554
- bool Genesis::ConfigureGlobalObjects(
1555
- v8::Handle<v8::ObjectTemplate> global_proxy_template) {
1556
- Handle<JSObject> global_proxy(
1557
- JSObject::cast(global_context()->global_proxy()));
1558
- Handle<JSObject> inner_global(JSObject::cast(global_context()->global()));
1559
-
1560
- if (!global_proxy_template.IsEmpty()) {
1561
- // Configure the global proxy object.
1562
- Handle<ObjectTemplateInfo> proxy_data =
1563
- v8::Utils::OpenHandle(*global_proxy_template);
1564
- if (!ConfigureApiObject(global_proxy, proxy_data)) return false;
1565
-
1566
- // Configure the inner global object.
1567
- Handle<FunctionTemplateInfo> proxy_constructor(
1568
- FunctionTemplateInfo::cast(proxy_data->constructor()));
1569
- if (!proxy_constructor->prototype_template()->IsUndefined()) {
1570
- Handle<ObjectTemplateInfo> inner_data(
1571
- ObjectTemplateInfo::cast(proxy_constructor->prototype_template()));
1572
- if (!ConfigureApiObject(inner_global, inner_data)) return false;
1573
- }
1574
- }
1575
-
1576
- SetObjectPrototype(global_proxy, inner_global);
1577
- return true;
1578
- }
1579
-
1580
-
1581
- bool Genesis::ConfigureApiObject(Handle<JSObject> object,
1582
- Handle<ObjectTemplateInfo> object_template) {
1583
- ASSERT(!object_template.is_null());
1584
- ASSERT(object->IsInstanceOf(
1585
- FunctionTemplateInfo::cast(object_template->constructor())));
1586
-
1587
- bool pending_exception = false;
1588
- Handle<JSObject> obj =
1589
- Execution::InstantiateObject(object_template, &pending_exception);
1590
- if (pending_exception) {
1591
- ASSERT(Top::has_pending_exception());
1592
- Top::clear_pending_exception();
1593
- return false;
1594
- }
1595
- TransferObject(obj, object);
1596
- return true;
1597
- }
1598
-
1599
-
1600
- void Genesis::TransferNamedProperties(Handle<JSObject> from,
1601
- Handle<JSObject> to) {
1602
- if (from->HasFastProperties()) {
1603
- Handle<DescriptorArray> descs =
1604
- Handle<DescriptorArray>(from->map()->instance_descriptors());
1605
- for (int i = 0; i < descs->number_of_descriptors(); i++) {
1606
- PropertyDetails details = PropertyDetails(descs->GetDetails(i));
1607
- switch (details.type()) {
1608
- case FIELD: {
1609
- HandleScope inner;
1610
- Handle<String> key = Handle<String>(descs->GetKey(i));
1611
- int index = descs->GetFieldIndex(i);
1612
- Handle<Object> value = Handle<Object>(from->FastPropertyAt(index));
1613
- SetProperty(to, key, value, details.attributes());
1614
- break;
1615
- }
1616
- case CONSTANT_FUNCTION: {
1617
- HandleScope inner;
1618
- Handle<String> key = Handle<String>(descs->GetKey(i));
1619
- Handle<JSFunction> fun =
1620
- Handle<JSFunction>(descs->GetConstantFunction(i));
1621
- SetProperty(to, key, fun, details.attributes());
1622
- break;
1623
- }
1624
- case CALLBACKS: {
1625
- LookupResult result;
1626
- to->LocalLookup(descs->GetKey(i), &result);
1627
- // If the property is already there we skip it
1628
- if (result.IsProperty()) continue;
1629
- HandleScope inner;
1630
- ASSERT(!to->HasFastProperties());
1631
- // Add to dictionary.
1632
- Handle<String> key = Handle<String>(descs->GetKey(i));
1633
- Handle<Object> callbacks(descs->GetCallbacksObject(i));
1634
- PropertyDetails d =
1635
- PropertyDetails(details.attributes(), CALLBACKS, details.index());
1636
- SetNormalizedProperty(to, key, callbacks, d);
1637
- break;
1638
- }
1639
- case MAP_TRANSITION:
1640
- case CONSTANT_TRANSITION:
1641
- case NULL_DESCRIPTOR:
1642
- // Ignore non-properties.
1643
- break;
1644
- case NORMAL:
1645
- // Do not occur since the from object has fast properties.
1646
- case INTERCEPTOR:
1647
- // No element in instance descriptors have interceptor type.
1648
- UNREACHABLE();
1649
- break;
1650
- }
1651
- }
1652
- } else {
1653
- Handle<StringDictionary> properties =
1654
- Handle<StringDictionary>(from->property_dictionary());
1655
- int capacity = properties->Capacity();
1656
- for (int i = 0; i < capacity; i++) {
1657
- Object* raw_key(properties->KeyAt(i));
1658
- if (properties->IsKey(raw_key)) {
1659
- ASSERT(raw_key->IsString());
1660
- // If the property is already there we skip it.
1661
- LookupResult result;
1662
- to->LocalLookup(String::cast(raw_key), &result);
1663
- if (result.IsProperty()) continue;
1664
- // Set the property.
1665
- Handle<String> key = Handle<String>(String::cast(raw_key));
1666
- Handle<Object> value = Handle<Object>(properties->ValueAt(i));
1667
- if (value->IsJSGlobalPropertyCell()) {
1668
- value = Handle<Object>(JSGlobalPropertyCell::cast(*value)->value());
1669
- }
1670
- PropertyDetails details = properties->DetailsAt(i);
1671
- SetProperty(to, key, value, details.attributes());
1672
- }
1673
- }
1674
- }
1675
- }
1676
-
1677
-
1678
- void Genesis::TransferIndexedProperties(Handle<JSObject> from,
1679
- Handle<JSObject> to) {
1680
- // Cloning the elements array is sufficient.
1681
- Handle<FixedArray> from_elements =
1682
- Handle<FixedArray>(FixedArray::cast(from->elements()));
1683
- Handle<FixedArray> to_elements = Factory::CopyFixedArray(from_elements);
1684
- to->set_elements(*to_elements);
1685
- }
1686
-
1687
-
1688
- void Genesis::TransferObject(Handle<JSObject> from, Handle<JSObject> to) {
1689
- HandleScope outer;
1690
-
1691
- ASSERT(!from->IsJSArray());
1692
- ASSERT(!to->IsJSArray());
1693
-
1694
- TransferNamedProperties(from, to);
1695
- TransferIndexedProperties(from, to);
1696
-
1697
- // Transfer the prototype (new map is needed).
1698
- Handle<Map> old_to_map = Handle<Map>(to->map());
1699
- Handle<Map> new_to_map = Factory::CopyMapDropTransitions(old_to_map);
1700
- new_to_map->set_prototype(from->map()->prototype());
1701
- to->set_map(*new_to_map);
1702
- }
1703
-
1704
-
1705
- void Genesis::MakeFunctionInstancePrototypeWritable() {
1706
- // Make a new function map so all future functions
1707
- // will have settable and enumerable prototype properties.
1708
- HandleScope scope;
1709
-
1710
- Handle<DescriptorArray> function_map_descriptors =
1711
- ComputeFunctionInstanceDescriptor(ADD_WRITEABLE_PROTOTYPE);
1712
- Handle<Map> fm = Factory::CopyMapDropDescriptors(Top::function_map());
1713
- fm->set_instance_descriptors(*function_map_descriptors);
1714
- fm->set_function_with_prototype(true);
1715
- Top::context()->global_context()->set_function_map(*fm);
1716
- }
1717
-
1718
-
1719
- Genesis::Genesis(Handle<Object> global_object,
1720
- v8::Handle<v8::ObjectTemplate> global_template,
1721
- v8::ExtensionConfiguration* extensions) {
1722
- result_ = Handle<Context>::null();
1723
- // If V8 isn't running and cannot be initialized, just return.
1724
- if (!V8::IsRunning() && !V8::Initialize(NULL)) return;
1725
-
1726
- // Before creating the roots we must save the context and restore it
1727
- // on all function exits.
1728
- HandleScope scope;
1729
- SaveContext saved_context;
1730
-
1731
- Handle<Context> new_context = Snapshot::NewContextFromSnapshot();
1732
- if (!new_context.is_null()) {
1733
- global_context_ =
1734
- Handle<Context>::cast(GlobalHandles::Create(*new_context));
1735
- Top::set_context(*global_context_);
1736
- i::Counters::contexts_created_by_snapshot.Increment();
1737
- result_ = global_context_;
1738
- JSFunction* empty_function =
1739
- JSFunction::cast(result_->function_map()->prototype());
1740
- empty_function_ = Handle<JSFunction>(empty_function);
1741
- Handle<GlobalObject> inner_global;
1742
- Handle<JSGlobalProxy> global_proxy =
1743
- CreateNewGlobals(global_template,
1744
- global_object,
1745
- &inner_global);
1746
-
1747
- HookUpGlobalProxy(inner_global, global_proxy);
1748
- HookUpInnerGlobal(inner_global);
1749
-
1750
- if (!ConfigureGlobalObjects(global_template)) return;
1751
- } else {
1752
- // We get here if there was no context snapshot.
1753
- CreateRoots();
1754
- Handle<JSFunction> empty_function = CreateEmptyFunction();
1755
- Handle<GlobalObject> inner_global;
1756
- Handle<JSGlobalProxy> global_proxy =
1757
- CreateNewGlobals(global_template, global_object, &inner_global);
1758
- HookUpGlobalProxy(inner_global, global_proxy);
1759
- InitializeGlobal(inner_global, empty_function);
1760
- InstallJSFunctionResultCaches();
1761
- if (!InstallNatives()) return;
1762
-
1763
- MakeFunctionInstancePrototypeWritable();
1764
-
1765
- if (!ConfigureGlobalObjects(global_template)) return;
1766
- i::Counters::contexts_created_from_scratch.Increment();
1767
- }
1768
-
1769
- result_ = global_context_;
1770
- }
1771
-
1772
-
1773
- // Support for thread preemption.
1774
-
1775
- // Reserve space for statics needing saving and restoring.
1776
- int Bootstrapper::ArchiveSpacePerThread() {
1777
- return BootstrapperActive::ArchiveSpacePerThread();
1778
- }
1779
-
1780
-
1781
- // Archive statics that are thread local.
1782
- char* Bootstrapper::ArchiveState(char* to) {
1783
- return BootstrapperActive::ArchiveState(to);
1784
- }
1785
-
1786
-
1787
- // Restore statics that are thread local.
1788
- char* Bootstrapper::RestoreState(char* from) {
1789
- return BootstrapperActive::RestoreState(from);
1790
- }
1791
-
1792
-
1793
- // Called when the top-level V8 mutex is destroyed.
1794
- void Bootstrapper::FreeThreadResources() {
1795
- ASSERT(!BootstrapperActive::IsActive());
1796
- }
1797
-
1798
-
1799
- // Reserve space for statics needing saving and restoring.
1800
- int BootstrapperActive::ArchiveSpacePerThread() {
1801
- return sizeof(nesting_);
1802
- }
1803
-
1804
-
1805
- // Archive statics that are thread local.
1806
- char* BootstrapperActive::ArchiveState(char* to) {
1807
- *reinterpret_cast<int*>(to) = nesting_;
1808
- nesting_ = 0;
1809
- return to + sizeof(nesting_);
1810
- }
1811
-
1812
-
1813
- // Restore statics that are thread local.
1814
- char* BootstrapperActive::RestoreState(char* from) {
1815
- nesting_ = *reinterpret_cast<int*>(from);
1816
- return from + sizeof(nesting_);
1817
- }
1818
-
1819
- } } // namespace v8::internal