therubyracer 0.9.0beta2 → 0.9.0beta3

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

Potentially problematic release.


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

Files changed (920) hide show
  1. data/.gitmodules +3 -0
  2. data/ext/v8/upstream/Makefile +1 -2
  3. data/ext/v8/upstream/v8/.gitignore +33 -0
  4. data/ext/v8/upstream/v8/AUTHORS +42 -0
  5. data/ext/v8/upstream/v8/ChangeLog +2663 -0
  6. data/ext/v8/upstream/{3.1.8 → v8}/LICENSE +0 -0
  7. data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.strongtalk +0 -0
  8. data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.v8 +0 -0
  9. data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.valgrind +0 -0
  10. data/ext/v8/upstream/v8/SConstruct +1473 -0
  11. data/ext/v8/upstream/{3.1.8 → v8}/build/README.txt +0 -0
  12. data/ext/v8/upstream/{3.1.8 → v8}/build/all.gyp +0 -0
  13. data/ext/v8/upstream/{3.1.8 → v8}/build/armu.gypi +0 -0
  14. data/ext/v8/upstream/{3.1.8 → v8}/build/common.gypi +0 -0
  15. data/ext/v8/upstream/{3.1.8 → v8}/build/gyp_v8 +0 -0
  16. data/ext/v8/upstream/v8/include/v8-debug.h +394 -0
  17. data/ext/v8/upstream/v8/include/v8-preparser.h +116 -0
  18. data/ext/v8/upstream/v8/include/v8-profiler.h +505 -0
  19. data/ext/v8/upstream/v8/include/v8-testing.h +104 -0
  20. data/ext/v8/upstream/v8/include/v8.h +4000 -0
  21. data/ext/v8/upstream/{3.1.8 → v8}/include/v8stdint.h +0 -0
  22. data/ext/v8/upstream/v8/preparser/SConscript +38 -0
  23. data/ext/v8/upstream/v8/preparser/preparser-process.cc +169 -0
  24. data/ext/v8/upstream/v8/src/SConscript +380 -0
  25. data/ext/v8/upstream/v8/src/accessors.cc +766 -0
  26. data/ext/v8/upstream/{3.1.8 → v8}/src/accessors.h +0 -0
  27. data/ext/v8/upstream/v8/src/allocation-inl.h +49 -0
  28. data/ext/v8/upstream/v8/src/allocation.cc +122 -0
  29. data/ext/v8/upstream/v8/src/allocation.h +143 -0
  30. data/ext/v8/upstream/v8/src/api.cc +5678 -0
  31. data/ext/v8/upstream/v8/src/api.h +572 -0
  32. data/ext/v8/upstream/{3.1.8 → v8}/src/apinatives.js +0 -0
  33. data/ext/v8/upstream/v8/src/apiutils.h +73 -0
  34. data/ext/v8/upstream/v8/src/arguments.h +116 -0
  35. data/ext/v8/upstream/v8/src/arm/assembler-arm-inl.h +353 -0
  36. data/ext/v8/upstream/v8/src/arm/assembler-arm.cc +2877 -0
  37. data/ext/v8/upstream/v8/src/arm/assembler-arm.h +1382 -0
  38. data/ext/v8/upstream/v8/src/arm/builtins-arm.cc +1634 -0
  39. data/ext/v8/upstream/v8/src/arm/code-stubs-arm.cc +6917 -0
  40. data/ext/v8/upstream/v8/src/arm/code-stubs-arm.h +623 -0
  41. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/codegen-arm-inl.h +0 -0
  42. data/ext/v8/upstream/v8/src/arm/codegen-arm.cc +7437 -0
  43. data/ext/v8/upstream/v8/src/arm/codegen-arm.h +595 -0
  44. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/constants-arm.cc +0 -0
  45. data/ext/v8/upstream/v8/src/arm/constants-arm.h +778 -0
  46. data/ext/v8/upstream/v8/src/arm/cpu-arm.cc +149 -0
  47. data/ext/v8/upstream/v8/src/arm/debug-arm.cc +317 -0
  48. data/ext/v8/upstream/v8/src/arm/deoptimizer-arm.cc +737 -0
  49. data/ext/v8/upstream/v8/src/arm/disasm-arm.cc +1503 -0
  50. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/frames-arm.cc +0 -0
  51. data/ext/v8/upstream/v8/src/arm/frames-arm.h +168 -0
  52. data/ext/v8/upstream/v8/src/arm/full-codegen-arm.cc +4374 -0
  53. data/ext/v8/upstream/v8/src/arm/ic-arm.cc +1793 -0
  54. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/jump-target-arm.cc +0 -0
  55. data/ext/v8/upstream/v8/src/arm/lithium-arm.cc +2120 -0
  56. data/ext/v8/upstream/v8/src/arm/lithium-arm.h +2179 -0
  57. data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.cc +4132 -0
  58. data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.h +329 -0
  59. data/ext/v8/upstream/v8/src/arm/lithium-gap-resolver-arm.cc +305 -0
  60. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/lithium-gap-resolver-arm.h +0 -0
  61. data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.cc +2939 -0
  62. data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.h +1071 -0
  63. data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.cc +1287 -0
  64. data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.h +253 -0
  65. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm-inl.h +0 -0
  66. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm.cc +0 -0
  67. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm.h +0 -0
  68. data/ext/v8/upstream/v8/src/arm/simulator-arm.cc +3288 -0
  69. data/ext/v8/upstream/v8/src/arm/simulator-arm.h +413 -0
  70. data/ext/v8/upstream/v8/src/arm/stub-cache-arm.cc +4034 -0
  71. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/virtual-frame-arm-inl.h +0 -0
  72. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.cc +843 -0
  73. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.h +523 -0
  74. data/ext/v8/upstream/v8/src/array.js +1249 -0
  75. data/ext/v8/upstream/v8/src/assembler.cc +1067 -0
  76. data/ext/v8/upstream/v8/src/assembler.h +823 -0
  77. data/ext/v8/upstream/v8/src/ast-inl.h +112 -0
  78. data/ext/v8/upstream/v8/src/ast.cc +1078 -0
  79. data/ext/v8/upstream/v8/src/ast.h +2234 -0
  80. data/ext/v8/upstream/v8/src/atomicops.h +167 -0
  81. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_arm_gcc.h +0 -0
  82. data/ext/v8/upstream/v8/src/atomicops_internals_mips_gcc.h +169 -0
  83. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_gcc.cc +0 -0
  84. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_gcc.h +0 -0
  85. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_macosx.h +0 -0
  86. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_msvc.h +0 -0
  87. data/ext/v8/upstream/{3.1.8 → v8}/src/bignum-dtoa.cc +0 -0
  88. data/ext/v8/upstream/{3.1.8 → v8}/src/bignum-dtoa.h +0 -0
  89. data/ext/v8/upstream/{3.1.8 → v8}/src/bignum.cc +0 -0
  90. data/ext/v8/upstream/{3.1.8 → v8}/src/bignum.h +0 -0
  91. data/ext/v8/upstream/v8/src/bootstrapper.cc +2138 -0
  92. data/ext/v8/upstream/v8/src/bootstrapper.h +185 -0
  93. data/ext/v8/upstream/v8/src/builtins.cc +1708 -0
  94. data/ext/v8/upstream/v8/src/builtins.h +368 -0
  95. data/ext/v8/upstream/{3.1.8 → v8}/src/bytecodes-irregexp.h +0 -0
  96. data/ext/v8/upstream/{3.1.8 → v8}/src/cached-powers.cc +0 -0
  97. data/ext/v8/upstream/{3.1.8 → v8}/src/cached-powers.h +0 -0
  98. data/ext/v8/upstream/{3.1.8 → v8}/src/char-predicates-inl.h +0 -0
  99. data/ext/v8/upstream/{3.1.8 → v8}/src/char-predicates.h +0 -0
  100. data/ext/v8/upstream/v8/src/checks.cc +110 -0
  101. data/ext/v8/upstream/v8/src/checks.h +296 -0
  102. data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue-inl.h +0 -0
  103. data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue.cc +0 -0
  104. data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue.h +0 -0
  105. data/ext/v8/upstream/v8/src/code-stubs.cc +240 -0
  106. data/ext/v8/upstream/v8/src/code-stubs.h +971 -0
  107. data/ext/v8/upstream/{3.1.8 → v8}/src/code.h +0 -0
  108. data/ext/v8/upstream/v8/src/codegen-inl.h +68 -0
  109. data/ext/v8/upstream/v8/src/codegen.cc +505 -0
  110. data/ext/v8/upstream/v8/src/codegen.h +245 -0
  111. data/ext/v8/upstream/v8/src/compilation-cache.cc +540 -0
  112. data/ext/v8/upstream/v8/src/compilation-cache.h +287 -0
  113. data/ext/v8/upstream/v8/src/compiler.cc +792 -0
  114. data/ext/v8/upstream/v8/src/compiler.h +307 -0
  115. data/ext/v8/upstream/v8/src/contexts.cc +327 -0
  116. data/ext/v8/upstream/v8/src/contexts.h +382 -0
  117. data/ext/v8/upstream/{3.1.8 → v8}/src/conversions-inl.h +0 -0
  118. data/ext/v8/upstream/v8/src/conversions.cc +1125 -0
  119. data/ext/v8/upstream/{3.1.8 → v8}/src/conversions.h +0 -0
  120. data/ext/v8/upstream/v8/src/counters.cc +93 -0
  121. data/ext/v8/upstream/v8/src/counters.h +254 -0
  122. data/ext/v8/upstream/v8/src/cpu-profiler-inl.h +101 -0
  123. data/ext/v8/upstream/v8/src/cpu-profiler.cc +606 -0
  124. data/ext/v8/upstream/v8/src/cpu-profiler.h +305 -0
  125. data/ext/v8/upstream/v8/src/cpu.h +67 -0
  126. data/ext/v8/upstream/v8/src/d8-debug.cc +367 -0
  127. data/ext/v8/upstream/v8/src/d8-debug.h +158 -0
  128. data/ext/v8/upstream/v8/src/d8-posix.cc +695 -0
  129. data/ext/v8/upstream/{3.1.8 → v8}/src/d8-readline.cc +0 -0
  130. data/ext/v8/upstream/{3.1.8 → v8}/src/d8-windows.cc +0 -0
  131. data/ext/v8/upstream/v8/src/d8.cc +796 -0
  132. data/ext/v8/upstream/v8/src/d8.gyp +88 -0
  133. data/ext/v8/upstream/{3.1.8 → v8}/src/d8.h +0 -0
  134. data/ext/v8/upstream/{3.1.8 → v8}/src/d8.js +0 -0
  135. data/ext/v8/upstream/{3.1.8 → v8}/src/data-flow.cc +0 -0
  136. data/ext/v8/upstream/v8/src/data-flow.h +379 -0
  137. data/ext/v8/upstream/{3.1.8 → v8}/src/date.js +0 -0
  138. data/ext/v8/upstream/{3.1.8 → v8}/src/dateparser-inl.h +0 -0
  139. data/ext/v8/upstream/{3.1.8 → v8}/src/dateparser.cc +0 -0
  140. data/ext/v8/upstream/v8/src/dateparser.h +265 -0
  141. data/ext/v8/upstream/v8/src/debug-agent.cc +447 -0
  142. data/ext/v8/upstream/v8/src/debug-agent.h +129 -0
  143. data/ext/v8/upstream/{3.1.8 → v8}/src/debug-debugger.js +0 -0
  144. data/ext/v8/upstream/v8/src/debug.cc +3188 -0
  145. data/ext/v8/upstream/v8/src/debug.h +1055 -0
  146. data/ext/v8/upstream/v8/src/deoptimizer.cc +1296 -0
  147. data/ext/v8/upstream/v8/src/deoptimizer.h +629 -0
  148. data/ext/v8/upstream/v8/src/disasm.h +80 -0
  149. data/ext/v8/upstream/v8/src/disassembler.cc +339 -0
  150. data/ext/v8/upstream/{3.1.8 → v8}/src/disassembler.h +0 -0
  151. data/ext/v8/upstream/{3.1.8 → v8}/src/diy-fp.cc +0 -0
  152. data/ext/v8/upstream/{3.1.8 → v8}/src/diy-fp.h +0 -0
  153. data/ext/v8/upstream/{3.1.8 → v8}/src/double.h +0 -0
  154. data/ext/v8/upstream/{3.1.8 → v8}/src/dtoa.cc +0 -0
  155. data/ext/v8/upstream/{3.1.8 → v8}/src/dtoa.h +0 -0
  156. data/ext/v8/upstream/v8/src/execution.cc +791 -0
  157. data/ext/v8/upstream/v8/src/execution.h +291 -0
  158. data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.cc +250 -0
  159. data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.h +89 -0
  160. data/ext/v8/upstream/v8/src/extensions/experimental/experimental.gyp +55 -0
  161. data/ext/v8/upstream/v8/src/extensions/experimental/i18n-extension.cc +284 -0
  162. data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/experimental/i18n-extension.h +0 -0
  163. data/ext/v8/upstream/v8/src/extensions/externalize-string-extension.cc +141 -0
  164. data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/externalize-string-extension.h +0 -0
  165. data/ext/v8/upstream/v8/src/extensions/gc-extension.cc +58 -0
  166. data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/gc-extension.h +0 -0
  167. data/ext/v8/upstream/v8/src/factory.cc +1194 -0
  168. data/ext/v8/upstream/v8/src/factory.h +436 -0
  169. data/ext/v8/upstream/{3.1.8 → v8}/src/fast-dtoa.cc +0 -0
  170. data/ext/v8/upstream/{3.1.8 → v8}/src/fast-dtoa.h +0 -0
  171. data/ext/v8/upstream/{3.1.8 → v8}/src/fixed-dtoa.cc +0 -0
  172. data/ext/v8/upstream/{3.1.8 → v8}/src/fixed-dtoa.h +0 -0
  173. data/ext/v8/upstream/v8/src/flag-definitions.h +556 -0
  174. data/ext/v8/upstream/{3.1.8 → v8}/src/flags.cc +0 -0
  175. data/ext/v8/upstream/{3.1.8 → v8}/src/flags.h +0 -0
  176. data/ext/v8/upstream/v8/src/frame-element.cc +37 -0
  177. data/ext/v8/upstream/v8/src/frame-element.h +269 -0
  178. data/ext/v8/upstream/v8/src/frames-inl.h +236 -0
  179. data/ext/v8/upstream/v8/src/frames.cc +1273 -0
  180. data/ext/v8/upstream/v8/src/frames.h +854 -0
  181. data/ext/v8/upstream/v8/src/full-codegen.cc +1385 -0
  182. data/ext/v8/upstream/v8/src/full-codegen.h +753 -0
  183. data/ext/v8/upstream/v8/src/func-name-inferrer.cc +91 -0
  184. data/ext/v8/upstream/v8/src/func-name-inferrer.h +111 -0
  185. data/ext/v8/upstream/v8/src/gdb-jit.cc +1548 -0
  186. data/ext/v8/upstream/{3.1.8 → v8}/src/gdb-jit.h +0 -0
  187. data/ext/v8/upstream/v8/src/global-handles.cc +596 -0
  188. data/ext/v8/upstream/v8/src/global-handles.h +239 -0
  189. data/ext/v8/upstream/v8/src/globals.h +325 -0
  190. data/ext/v8/upstream/v8/src/handles-inl.h +177 -0
  191. data/ext/v8/upstream/v8/src/handles.cc +965 -0
  192. data/ext/v8/upstream/v8/src/handles.h +372 -0
  193. data/ext/v8/upstream/{3.1.8 → v8}/src/hashmap.cc +0 -0
  194. data/ext/v8/upstream/v8/src/hashmap.h +121 -0
  195. data/ext/v8/upstream/v8/src/heap-inl.h +703 -0
  196. data/ext/v8/upstream/v8/src/heap-profiler.cc +1173 -0
  197. data/ext/v8/upstream/v8/src/heap-profiler.h +396 -0
  198. data/ext/v8/upstream/v8/src/heap.cc +5856 -0
  199. data/ext/v8/upstream/v8/src/heap.h +2264 -0
  200. data/ext/v8/upstream/v8/src/hydrogen-instructions.cc +1639 -0
  201. data/ext/v8/upstream/v8/src/hydrogen-instructions.h +3657 -0
  202. data/ext/v8/upstream/v8/src/hydrogen.cc +6011 -0
  203. data/ext/v8/upstream/v8/src/hydrogen.h +1137 -0
  204. data/ext/v8/upstream/v8/src/ia32/assembler-ia32-inl.h +430 -0
  205. data/ext/v8/upstream/v8/src/ia32/assembler-ia32.cc +2846 -0
  206. data/ext/v8/upstream/v8/src/ia32/assembler-ia32.h +1159 -0
  207. data/ext/v8/upstream/v8/src/ia32/builtins-ia32.cc +1596 -0
  208. data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.cc +6549 -0
  209. data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.h +495 -0
  210. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/codegen-ia32-inl.h +0 -0
  211. data/ext/v8/upstream/v8/src/ia32/codegen-ia32.cc +10385 -0
  212. data/ext/v8/upstream/v8/src/ia32/codegen-ia32.h +801 -0
  213. data/ext/v8/upstream/v8/src/ia32/cpu-ia32.cc +88 -0
  214. data/ext/v8/upstream/v8/src/ia32/debug-ia32.cc +312 -0
  215. data/ext/v8/upstream/v8/src/ia32/deoptimizer-ia32.cc +774 -0
  216. data/ext/v8/upstream/v8/src/ia32/disasm-ia32.cc +1620 -0
  217. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/frames-ia32.cc +0 -0
  218. data/ext/v8/upstream/v8/src/ia32/frames-ia32.h +140 -0
  219. data/ext/v8/upstream/v8/src/ia32/full-codegen-ia32.cc +4357 -0
  220. data/ext/v8/upstream/v8/src/ia32/ic-ia32.cc +1779 -0
  221. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/jump-target-ia32.cc +0 -0
  222. data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.cc +4158 -0
  223. data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.h +318 -0
  224. data/ext/v8/upstream/v8/src/ia32/lithium-gap-resolver-ia32.cc +466 -0
  225. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/lithium-gap-resolver-ia32.h +0 -0
  226. data/ext/v8/upstream/v8/src/ia32/lithium-ia32.cc +2181 -0
  227. data/ext/v8/upstream/v8/src/ia32/lithium-ia32.h +2235 -0
  228. data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.cc +2056 -0
  229. data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.h +807 -0
  230. data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.cc +1264 -0
  231. data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.h +216 -0
  232. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/register-allocator-ia32-inl.h +0 -0
  233. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32.cc +157 -0
  234. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/register-allocator-ia32.h +0 -0
  235. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/simulator-ia32.cc +0 -0
  236. data/ext/v8/upstream/v8/src/ia32/simulator-ia32.h +72 -0
  237. data/ext/v8/upstream/v8/src/ia32/stub-cache-ia32.cc +3711 -0
  238. data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.cc +1366 -0
  239. data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.h +650 -0
  240. data/ext/v8/upstream/v8/src/ic-inl.h +130 -0
  241. data/ext/v8/upstream/v8/src/ic.cc +2389 -0
  242. data/ext/v8/upstream/v8/src/ic.h +675 -0
  243. data/ext/v8/upstream/{3.1.8 → v8}/src/inspector.cc +0 -0
  244. data/ext/v8/upstream/{3.1.8 → v8}/src/inspector.h +0 -0
  245. data/ext/v8/upstream/v8/src/interpreter-irregexp.cc +659 -0
  246. data/ext/v8/upstream/v8/src/interpreter-irregexp.h +49 -0
  247. data/ext/v8/upstream/v8/src/isolate.cc +883 -0
  248. data/ext/v8/upstream/v8/src/isolate.h +1306 -0
  249. data/ext/v8/upstream/v8/src/json.js +342 -0
  250. data/ext/v8/upstream/v8/src/jsregexp.cc +5371 -0
  251. data/ext/v8/upstream/v8/src/jsregexp.h +1483 -0
  252. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-heavy-inl.h +0 -0
  253. data/ext/v8/upstream/v8/src/jump-target-heavy.cc +427 -0
  254. data/ext/v8/upstream/v8/src/jump-target-heavy.h +238 -0
  255. data/ext/v8/upstream/v8/src/jump-target-inl.h +48 -0
  256. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-light-inl.h +0 -0
  257. data/ext/v8/upstream/v8/src/jump-target-light.cc +111 -0
  258. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-light.h +0 -0
  259. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target.cc +0 -0
  260. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target.h +0 -0
  261. data/ext/v8/upstream/{3.1.8 → v8}/src/list-inl.h +0 -0
  262. data/ext/v8/upstream/{3.1.8 → v8}/src/list.h +0 -0
  263. data/ext/v8/upstream/v8/src/lithium-allocator-inl.h +142 -0
  264. data/ext/v8/upstream/v8/src/lithium-allocator.cc +2105 -0
  265. data/ext/v8/upstream/v8/src/lithium-allocator.h +630 -0
  266. data/ext/v8/upstream/v8/src/lithium.cc +169 -0
  267. data/ext/v8/upstream/{3.1.8 → v8}/src/lithium.h +0 -0
  268. data/ext/v8/upstream/{3.1.8 → v8}/src/liveedit-debugger.js +0 -0
  269. data/ext/v8/upstream/v8/src/liveedit.cc +1693 -0
  270. data/ext/v8/upstream/v8/src/liveedit.h +179 -0
  271. data/ext/v8/upstream/{3.1.8 → v8}/src/liveobjectlist-inl.h +0 -0
  272. data/ext/v8/upstream/v8/src/liveobjectlist.cc +2589 -0
  273. data/ext/v8/upstream/v8/src/liveobjectlist.h +322 -0
  274. data/ext/v8/upstream/{3.1.8 → v8}/src/log-inl.h +0 -0
  275. data/ext/v8/upstream/v8/src/log-utils.cc +423 -0
  276. data/ext/v8/upstream/v8/src/log-utils.h +229 -0
  277. data/ext/v8/upstream/v8/src/log.cc +1666 -0
  278. data/ext/v8/upstream/v8/src/log.h +446 -0
  279. data/ext/v8/upstream/{3.1.8 → v8}/src/macro-assembler.h +0 -0
  280. data/ext/v8/upstream/{3.1.8 → v8}/src/macros.py +0 -0
  281. data/ext/v8/upstream/v8/src/mark-compact.cc +3092 -0
  282. data/ext/v8/upstream/v8/src/mark-compact.h +506 -0
  283. data/ext/v8/upstream/{3.1.8 → v8}/src/math.js +0 -0
  284. data/ext/v8/upstream/v8/src/messages.cc +166 -0
  285. data/ext/v8/upstream/{3.1.8 → v8}/src/messages.h +0 -0
  286. data/ext/v8/upstream/v8/src/messages.js +1090 -0
  287. data/ext/v8/upstream/v8/src/mips/assembler-mips-inl.h +335 -0
  288. data/ext/v8/upstream/v8/src/mips/assembler-mips.cc +2093 -0
  289. data/ext/v8/upstream/v8/src/mips/assembler-mips.h +1066 -0
  290. data/ext/v8/upstream/v8/src/mips/builtins-mips.cc +148 -0
  291. data/ext/v8/upstream/v8/src/mips/code-stubs-mips.cc +752 -0
  292. data/ext/v8/upstream/v8/src/mips/code-stubs-mips.h +511 -0
  293. data/ext/v8/upstream/v8/src/mips/codegen-mips-inl.h +64 -0
  294. data/ext/v8/upstream/v8/src/mips/codegen-mips.cc +1213 -0
  295. data/ext/v8/upstream/v8/src/mips/codegen-mips.h +633 -0
  296. data/ext/v8/upstream/v8/src/mips/constants-mips.cc +352 -0
  297. data/ext/v8/upstream/v8/src/mips/constants-mips.h +723 -0
  298. data/ext/v8/upstream/v8/src/mips/cpu-mips.cc +90 -0
  299. data/ext/v8/upstream/v8/src/mips/debug-mips.cc +155 -0
  300. data/ext/v8/upstream/v8/src/mips/deoptimizer-mips.cc +91 -0
  301. data/ext/v8/upstream/v8/src/mips/disasm-mips.cc +1023 -0
  302. data/ext/v8/upstream/v8/src/mips/frames-mips.cc +48 -0
  303. data/ext/v8/upstream/v8/src/mips/frames-mips.h +179 -0
  304. data/ext/v8/upstream/v8/src/mips/full-codegen-mips.cc +727 -0
  305. data/ext/v8/upstream/v8/src/mips/ic-mips.cc +244 -0
  306. data/ext/v8/upstream/v8/src/mips/jump-target-mips.cc +80 -0
  307. data/ext/v8/upstream/v8/src/mips/lithium-codegen-mips.h +65 -0
  308. data/ext/v8/upstream/v8/src/mips/lithium-mips.h +304 -0
  309. data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.cc +3327 -0
  310. data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.h +1058 -0
  311. data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.cc +478 -0
  312. data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.h +250 -0
  313. data/ext/v8/upstream/v8/src/mips/register-allocator-mips-inl.h +134 -0
  314. data/ext/v8/upstream/{3.1.8 → v8}/src/mips/register-allocator-mips.cc +0 -0
  315. data/ext/v8/upstream/v8/src/mips/register-allocator-mips.h +47 -0
  316. data/ext/v8/upstream/v8/src/mips/simulator-mips.cc +2438 -0
  317. data/ext/v8/upstream/v8/src/mips/simulator-mips.h +394 -0
  318. data/ext/v8/upstream/v8/src/mips/stub-cache-mips.cc +601 -0
  319. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips-inl.h +58 -0
  320. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.cc +307 -0
  321. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.h +530 -0
  322. data/ext/v8/upstream/v8/src/mirror-debugger.js +2381 -0
  323. data/ext/v8/upstream/v8/src/mksnapshot.cc +256 -0
  324. data/ext/v8/upstream/{3.1.8 → v8}/src/natives.h +0 -0
  325. data/ext/v8/upstream/v8/src/objects-debug.cc +722 -0
  326. data/ext/v8/upstream/v8/src/objects-inl.h +4166 -0
  327. data/ext/v8/upstream/v8/src/objects-printer.cc +801 -0
  328. data/ext/v8/upstream/v8/src/objects-visiting.cc +142 -0
  329. data/ext/v8/upstream/v8/src/objects-visiting.h +422 -0
  330. data/ext/v8/upstream/v8/src/objects.cc +10296 -0
  331. data/ext/v8/upstream/v8/src/objects.h +6662 -0
  332. data/ext/v8/upstream/v8/src/parser.cc +5168 -0
  333. data/ext/v8/upstream/v8/src/parser.h +823 -0
  334. data/ext/v8/upstream/v8/src/platform-cygwin.cc +811 -0
  335. data/ext/v8/upstream/v8/src/platform-freebsd.cc +854 -0
  336. data/ext/v8/upstream/v8/src/platform-linux.cc +1120 -0
  337. data/ext/v8/upstream/v8/src/platform-macos.cc +865 -0
  338. data/ext/v8/upstream/v8/src/platform-nullos.cc +504 -0
  339. data/ext/v8/upstream/v8/src/platform-openbsd.cc +672 -0
  340. data/ext/v8/upstream/v8/src/platform-posix.cc +424 -0
  341. data/ext/v8/upstream/v8/src/platform-solaris.cc +796 -0
  342. data/ext/v8/upstream/v8/src/platform-tls-mac.h +62 -0
  343. data/ext/v8/upstream/v8/src/platform-tls-win32.h +62 -0
  344. data/ext/v8/upstream/v8/src/platform-tls.h +50 -0
  345. data/ext/v8/upstream/v8/src/platform-win32.cc +2072 -0
  346. data/ext/v8/upstream/v8/src/platform.h +693 -0
  347. data/ext/v8/upstream/v8/src/preparse-data.cc +185 -0
  348. data/ext/v8/upstream/{3.1.8 → v8}/src/preparse-data.h +0 -0
  349. data/ext/v8/upstream/v8/src/preparser-api.cc +219 -0
  350. data/ext/v8/upstream/v8/src/preparser.cc +1205 -0
  351. data/ext/v8/upstream/{3.1.8 → v8}/src/preparser.h +0 -0
  352. data/ext/v8/upstream/v8/src/prettyprinter.cc +1530 -0
  353. data/ext/v8/upstream/v8/src/prettyprinter.h +223 -0
  354. data/ext/v8/upstream/{3.1.8 → v8}/src/profile-generator-inl.h +0 -0
  355. data/ext/v8/upstream/v8/src/profile-generator.cc +3095 -0
  356. data/ext/v8/upstream/v8/src/profile-generator.h +1125 -0
  357. data/ext/v8/upstream/v8/src/property.cc +102 -0
  358. data/ext/v8/upstream/v8/src/property.h +348 -0
  359. data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
  360. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp.cc +470 -0
  361. data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-irregexp.h +0 -0
  362. data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-tracer.cc +0 -0
  363. data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-tracer.h +0 -0
  364. data/ext/v8/upstream/v8/src/regexp-macro-assembler.cc +266 -0
  365. data/ext/v8/upstream/v8/src/regexp-macro-assembler.h +236 -0
  366. data/ext/v8/upstream/v8/src/regexp-stack.cc +111 -0
  367. data/ext/v8/upstream/v8/src/regexp-stack.h +147 -0
  368. data/ext/v8/upstream/v8/src/regexp.js +483 -0
  369. data/ext/v8/upstream/v8/src/register-allocator-inl.h +141 -0
  370. data/ext/v8/upstream/v8/src/register-allocator.cc +98 -0
  371. data/ext/v8/upstream/v8/src/register-allocator.h +310 -0
  372. data/ext/v8/upstream/v8/src/rewriter.cc +1024 -0
  373. data/ext/v8/upstream/{3.1.8 → v8}/src/rewriter.h +0 -0
  374. data/ext/v8/upstream/v8/src/runtime-profiler.cc +478 -0
  375. data/ext/v8/upstream/v8/src/runtime-profiler.h +192 -0
  376. data/ext/v8/upstream/v8/src/runtime.cc +11949 -0
  377. data/ext/v8/upstream/v8/src/runtime.h +643 -0
  378. data/ext/v8/upstream/{3.1.8 → v8}/src/runtime.js +0 -0
  379. data/ext/v8/upstream/v8/src/safepoint-table.cc +256 -0
  380. data/ext/v8/upstream/v8/src/safepoint-table.h +269 -0
  381. data/ext/v8/upstream/v8/src/scanner-base.cc +964 -0
  382. data/ext/v8/upstream/v8/src/scanner-base.h +664 -0
  383. data/ext/v8/upstream/v8/src/scanner.cc +584 -0
  384. data/ext/v8/upstream/v8/src/scanner.h +196 -0
  385. data/ext/v8/upstream/v8/src/scopeinfo.cc +631 -0
  386. data/ext/v8/upstream/v8/src/scopeinfo.h +249 -0
  387. data/ext/v8/upstream/v8/src/scopes.cc +1093 -0
  388. data/ext/v8/upstream/v8/src/scopes.h +508 -0
  389. data/ext/v8/upstream/v8/src/serialize.cc +1574 -0
  390. data/ext/v8/upstream/v8/src/serialize.h +589 -0
  391. data/ext/v8/upstream/{3.1.8 → v8}/src/shell.h +0 -0
  392. data/ext/v8/upstream/{3.1.8 → v8}/src/simulator.h +0 -0
  393. data/ext/v8/upstream/v8/src/small-pointer-list.h +163 -0
  394. data/ext/v8/upstream/{3.1.8 → v8}/src/smart-pointer.h +0 -0
  395. data/ext/v8/upstream/v8/src/snapshot-common.cc +82 -0
  396. data/ext/v8/upstream/{3.1.8 → v8}/src/snapshot-empty.cc +0 -0
  397. data/ext/v8/upstream/v8/src/snapshot.h +73 -0
  398. data/ext/v8/upstream/v8/src/spaces-inl.h +529 -0
  399. data/ext/v8/upstream/v8/src/spaces.cc +3147 -0
  400. data/ext/v8/upstream/v8/src/spaces.h +2368 -0
  401. data/ext/v8/upstream/{3.1.8 → v8}/src/splay-tree-inl.h +0 -0
  402. data/ext/v8/upstream/{3.1.8 → v8}/src/splay-tree.h +0 -0
  403. data/ext/v8/upstream/v8/src/string-search.cc +41 -0
  404. data/ext/v8/upstream/v8/src/string-search.h +568 -0
  405. data/ext/v8/upstream/v8/src/string-stream.cc +592 -0
  406. data/ext/v8/upstream/{3.1.8 → v8}/src/string-stream.h +0 -0
  407. data/ext/v8/upstream/v8/src/string.js +915 -0
  408. data/ext/v8/upstream/{3.1.8 → v8}/src/strtod.cc +0 -0
  409. data/ext/v8/upstream/{3.1.8 → v8}/src/strtod.h +0 -0
  410. data/ext/v8/upstream/v8/src/stub-cache.cc +1940 -0
  411. data/ext/v8/upstream/v8/src/stub-cache.h +866 -0
  412. data/ext/v8/upstream/{3.1.8 → v8}/src/third_party/valgrind/valgrind.h +0 -0
  413. data/ext/v8/upstream/v8/src/token.cc +63 -0
  414. data/ext/v8/upstream/v8/src/token.h +288 -0
  415. data/ext/v8/upstream/v8/src/top.cc +983 -0
  416. data/ext/v8/upstream/v8/src/type-info.cc +472 -0
  417. data/ext/v8/upstream/v8/src/type-info.h +290 -0
  418. data/ext/v8/upstream/{3.1.8 → v8}/src/unbound-queue-inl.h +0 -0
  419. data/ext/v8/upstream/{3.1.8 → v8}/src/unbound-queue.h +0 -0
  420. data/ext/v8/upstream/{3.1.8 → v8}/src/unicode-inl.h +0 -0
  421. data/ext/v8/upstream/v8/src/unicode.cc +1624 -0
  422. data/ext/v8/upstream/v8/src/unicode.h +280 -0
  423. data/ext/v8/upstream/{3.1.8 → v8}/src/uri.js +0 -0
  424. data/ext/v8/upstream/{3.1.8 → v8}/src/utils.cc +0 -0
  425. data/ext/v8/upstream/v8/src/utils.h +796 -0
  426. data/ext/v8/upstream/v8/src/v8-counters.cc +62 -0
  427. data/ext/v8/upstream/v8/src/v8-counters.h +311 -0
  428. data/ext/v8/upstream/v8/src/v8.cc +215 -0
  429. data/ext/v8/upstream/v8/src/v8.h +130 -0
  430. data/ext/v8/upstream/{3.1.8 → v8}/src/v8checks.h +0 -0
  431. data/ext/v8/upstream/{3.1.8 → v8}/src/v8dll-main.cc +0 -0
  432. data/ext/v8/upstream/v8/src/v8globals.h +486 -0
  433. data/ext/v8/upstream/{3.1.8/src/memory.h → v8/src/v8memory.h} +0 -0
  434. data/ext/v8/upstream/v8/src/v8natives.js +1293 -0
  435. data/ext/v8/upstream/{3.1.8 → v8}/src/v8preparserdll-main.cc +0 -0
  436. data/ext/v8/upstream/v8/src/v8threads.cc +453 -0
  437. data/ext/v8/upstream/v8/src/v8threads.h +164 -0
  438. data/ext/v8/upstream/v8/src/v8utils.h +317 -0
  439. data/ext/v8/upstream/{3.1.8 → v8}/src/variables.cc +0 -0
  440. data/ext/v8/upstream/v8/src/variables.h +212 -0
  441. data/ext/v8/upstream/v8/src/version.cc +116 -0
  442. data/ext/v8/upstream/v8/src/version.h +68 -0
  443. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-heavy-inl.h +0 -0
  444. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-heavy.cc +0 -0
  445. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-inl.h +0 -0
  446. data/ext/v8/upstream/v8/src/virtual-frame-light-inl.h +171 -0
  447. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-light.cc +0 -0
  448. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame.cc +0 -0
  449. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame.h +0 -0
  450. data/ext/v8/upstream/v8/src/vm-state-inl.h +138 -0
  451. data/ext/v8/upstream/v8/src/vm-state.h +70 -0
  452. data/ext/v8/upstream/v8/src/win32-headers.h +96 -0
  453. data/ext/v8/upstream/v8/src/x64/assembler-x64-inl.h +456 -0
  454. data/ext/v8/upstream/v8/src/x64/assembler-x64.cc +2954 -0
  455. data/ext/v8/upstream/v8/src/x64/assembler-x64.h +1630 -0
  456. data/ext/v8/upstream/v8/src/x64/builtins-x64.cc +1493 -0
  457. data/ext/v8/upstream/v8/src/x64/code-stubs-x64.cc +5132 -0
  458. data/ext/v8/upstream/v8/src/x64/code-stubs-x64.h +477 -0
  459. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/codegen-x64-inl.h +0 -0
  460. data/ext/v8/upstream/v8/src/x64/codegen-x64.cc +8843 -0
  461. data/ext/v8/upstream/v8/src/x64/codegen-x64.h +753 -0
  462. data/ext/v8/upstream/v8/src/x64/cpu-x64.cc +88 -0
  463. data/ext/v8/upstream/v8/src/x64/debug-x64.cc +318 -0
  464. data/ext/v8/upstream/v8/src/x64/deoptimizer-x64.cc +815 -0
  465. data/ext/v8/upstream/v8/src/x64/disasm-x64.cc +1752 -0
  466. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/frames-x64.cc +0 -0
  467. data/ext/v8/upstream/v8/src/x64/frames-x64.h +130 -0
  468. data/ext/v8/upstream/v8/src/x64/full-codegen-x64.cc +4339 -0
  469. data/ext/v8/upstream/v8/src/x64/ic-x64.cc +1752 -0
  470. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/jump-target-x64.cc +0 -0
  471. data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.cc +3970 -0
  472. data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.h +318 -0
  473. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/lithium-gap-resolver-x64.cc +0 -0
  474. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/lithium-gap-resolver-x64.h +0 -0
  475. data/ext/v8/upstream/v8/src/x64/lithium-x64.cc +2115 -0
  476. data/ext/v8/upstream/v8/src/x64/lithium-x64.h +2161 -0
  477. data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.cc +2911 -0
  478. data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.h +1984 -0
  479. data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.cc +1398 -0
  480. data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.h +282 -0
  481. data/ext/v8/upstream/v8/src/x64/register-allocator-x64-inl.h +87 -0
  482. data/ext/v8/upstream/v8/src/x64/register-allocator-x64.cc +95 -0
  483. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/register-allocator-x64.h +0 -0
  484. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/simulator-x64.cc +0 -0
  485. data/ext/v8/upstream/v8/src/x64/simulator-x64.h +71 -0
  486. data/ext/v8/upstream/v8/src/x64/stub-cache-x64.cc +3460 -0
  487. data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.cc +1296 -0
  488. data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.h +597 -0
  489. data/ext/v8/upstream/v8/src/zone-inl.h +129 -0
  490. data/ext/v8/upstream/v8/src/zone.cc +196 -0
  491. data/ext/v8/upstream/v8/src/zone.h +236 -0
  492. data/ext/v8/upstream/{3.1.8 → v8}/tools/codemap.js +0 -0
  493. data/ext/v8/upstream/{3.1.8 → v8}/tools/consarray.js +0 -0
  494. data/ext/v8/upstream/{3.1.8 → v8}/tools/csvparser.js +0 -0
  495. data/ext/v8/upstream/{3.1.8 → v8}/tools/disasm.py +0 -0
  496. data/ext/v8/upstream/v8/tools/freebsd-tick-processor +10 -0
  497. data/ext/v8/upstream/{3.1.8 → v8}/tools/gc-nvp-trace-processor.py +0 -0
  498. data/ext/v8/upstream/{3.1.8 → v8}/tools/generate-ten-powers.scm +0 -0
  499. data/ext/v8/upstream/{3.1.8 → v8}/tools/grokdump.py +0 -0
  500. data/ext/v8/upstream/v8/tools/gyp/v8.gyp +844 -0
  501. data/ext/v8/upstream/{3.1.8 → v8}/tools/js2c.py +0 -0
  502. data/ext/v8/upstream/{3.1.8 → v8}/tools/jsmin.py +0 -0
  503. data/ext/v8/upstream/v8/tools/linux-tick-processor +35 -0
  504. data/ext/v8/upstream/{3.1.8 → v8}/tools/ll_prof.py +0 -0
  505. data/ext/v8/upstream/{3.1.8 → v8}/tools/logreader.js +0 -0
  506. data/ext/v8/upstream/{3.1.8 → v8}/tools/mac-nm +0 -0
  507. data/ext/v8/upstream/{3.1.8 → v8}/tools/mac-tick-processor +0 -0
  508. data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/README +0 -0
  509. data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/SConstruct +0 -0
  510. data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/oom_dump.cc +0 -0
  511. data/ext/v8/upstream/{3.1.8 → v8}/tools/presubmit.py +0 -0
  512. data/ext/v8/upstream/{3.1.8 → v8}/tools/process-heap-prof.py +0 -0
  513. data/ext/v8/upstream/{3.1.8 → v8}/tools/profile.js +0 -0
  514. data/ext/v8/upstream/{3.1.8 → v8}/tools/profile_view.js +0 -0
  515. data/ext/v8/upstream/{3.1.8 → v8}/tools/run-valgrind.py +0 -0
  516. data/ext/v8/upstream/{3.1.8 → v8}/tools/splaytree.js +0 -0
  517. data/ext/v8/upstream/{3.1.8 → v8}/tools/stats-viewer.py +0 -0
  518. data/ext/v8/upstream/v8/tools/test.py +1490 -0
  519. data/ext/v8/upstream/{3.1.8 → v8}/tools/tickprocessor-driver.js +0 -0
  520. data/ext/v8/upstream/v8/tools/tickprocessor.js +877 -0
  521. data/ext/v8/upstream/{3.1.8 → v8}/tools/utils.py +0 -0
  522. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/README.txt +0 -0
  523. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/arm.vsprops +0 -0
  524. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/common.vsprops +0 -0
  525. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8.vcproj +0 -0
  526. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8_arm.vcproj +0 -0
  527. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8_x64.vcproj +0 -0
  528. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8js2c.cmd +0 -0
  529. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/debug.vsprops +0 -0
  530. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/ia32.vsprops +0 -0
  531. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/js2c.cmd +0 -0
  532. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/release.vsprops +0 -0
  533. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8.sln +0 -0
  534. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8.vcproj +0 -0
  535. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_arm.sln +0 -0
  536. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_arm.vcproj +0 -0
  537. data/ext/v8/upstream/v8/tools/visual_studio/v8_base.vcproj +1308 -0
  538. data/ext/v8/upstream/v8/tools/visual_studio/v8_base_arm.vcproj +1238 -0
  539. data/ext/v8/upstream/v8/tools/visual_studio/v8_base_x64.vcproj +1300 -0
  540. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest.vcproj +0 -0
  541. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
  542. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
  543. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
  544. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
  545. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample.vcproj +0 -0
  546. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
  547. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
  548. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample.vcproj +0 -0
  549. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -0
  550. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -0
  551. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot.vcproj +0 -0
  552. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
  553. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
  554. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
  555. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_x64.sln +0 -0
  556. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_x64.vcproj +0 -0
  557. data/ext/v8/upstream/v8/tools/visual_studio/x64.vsprops +18 -0
  558. data/ext/v8/upstream/{3.1.8 → v8}/tools/windows-tick-processor.bat +0 -0
  559. data/ext/v8/v8_callbacks.cpp +52 -92
  560. data/ext/v8/v8_date.cpp +2 -3
  561. data/ext/v8/v8_object.cpp +4 -0
  562. data/ext/v8/v8_template.cpp +2 -2
  563. data/ext/v8/v8_try_catch.cpp +8 -38
  564. data/lib/v8/version.rb +1 -1
  565. data/spec/ext/ext_spec_helper.rb +2 -20
  566. data/spec/ext/object_spec.rb +0 -12
  567. data/spec/ext/try_catch_spec.rb +29 -1
  568. data/spec/spec_helper.rb +1 -0
  569. data/spec/v8/portal/proxies_spec.rb +1 -84
  570. data/specmem/handle_memspec.rb +41 -0
  571. data/specmem/object_memspec.rb +16 -0
  572. data/specmem/proxies_memspec.rb +86 -0
  573. data/specmem/spec_helper.rb +24 -0
  574. data/therubyracer.gemspec +7 -2
  575. metadata +564 -541
  576. data/ext/v8/upstream/3.1.8/.gitignore +0 -31
  577. data/ext/v8/upstream/3.1.8/AUTHORS +0 -40
  578. data/ext/v8/upstream/3.1.8/ChangeLog +0 -2566
  579. data/ext/v8/upstream/3.1.8/SConstruct +0 -1192
  580. data/ext/v8/upstream/3.1.8/include/v8-debug.h +0 -384
  581. data/ext/v8/upstream/3.1.8/include/v8-preparser.h +0 -116
  582. data/ext/v8/upstream/3.1.8/include/v8-profiler.h +0 -426
  583. data/ext/v8/upstream/3.1.8/include/v8-testing.h +0 -99
  584. data/ext/v8/upstream/3.1.8/include/v8.h +0 -3846
  585. data/ext/v8/upstream/3.1.8/preparser/preparser-process.cc +0 -206
  586. data/ext/v8/upstream/3.1.8/src/SConscript +0 -356
  587. data/ext/v8/upstream/3.1.8/src/accessors.cc +0 -907
  588. data/ext/v8/upstream/3.1.8/src/allocation.cc +0 -204
  589. data/ext/v8/upstream/3.1.8/src/allocation.h +0 -176
  590. data/ext/v8/upstream/3.1.8/src/api.cc +0 -5191
  591. data/ext/v8/upstream/3.1.8/src/api.h +0 -508
  592. data/ext/v8/upstream/3.1.8/src/apiutils.h +0 -80
  593. data/ext/v8/upstream/3.1.8/src/arguments.h +0 -105
  594. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm-inl.h +0 -352
  595. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.cc +0 -2756
  596. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.h +0 -1294
  597. data/ext/v8/upstream/3.1.8/src/arm/builtins-arm.cc +0 -1628
  598. data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.cc +0 -6783
  599. data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.h +0 -657
  600. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.cc +0 -7403
  601. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.h +0 -595
  602. data/ext/v8/upstream/3.1.8/src/arm/constants-arm.h +0 -769
  603. data/ext/v8/upstream/3.1.8/src/arm/cpu-arm.cc +0 -147
  604. data/ext/v8/upstream/3.1.8/src/arm/debug-arm.cc +0 -315
  605. data/ext/v8/upstream/3.1.8/src/arm/deoptimizer-arm.cc +0 -700
  606. data/ext/v8/upstream/3.1.8/src/arm/disasm-arm.cc +0 -1439
  607. data/ext/v8/upstream/3.1.8/src/arm/frames-arm.h +0 -168
  608. data/ext/v8/upstream/3.1.8/src/arm/full-codegen-arm.cc +0 -4230
  609. data/ext/v8/upstream/3.1.8/src/arm/ic-arm.cc +0 -1799
  610. data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.cc +0 -2041
  611. data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.h +0 -2046
  612. data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.cc +0 -3822
  613. data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.h +0 -312
  614. data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.cc +0 -303
  615. data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.cc +0 -2701
  616. data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.h +0 -1015
  617. data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.cc +0 -1280
  618. data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.h +0 -252
  619. data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.cc +0 -3165
  620. data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.h +0 -402
  621. data/ext/v8/upstream/3.1.8/src/arm/stub-cache-arm.cc +0 -4077
  622. data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.cc +0 -843
  623. data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.h +0 -520
  624. data/ext/v8/upstream/3.1.8/src/array.js +0 -1231
  625. data/ext/v8/upstream/3.1.8/src/assembler.cc +0 -973
  626. data/ext/v8/upstream/3.1.8/src/assembler.h +0 -787
  627. data/ext/v8/upstream/3.1.8/src/ast-inl.h +0 -107
  628. data/ext/v8/upstream/3.1.8/src/ast.cc +0 -1067
  629. data/ext/v8/upstream/3.1.8/src/ast.h +0 -2177
  630. data/ext/v8/upstream/3.1.8/src/atomicops.h +0 -165
  631. data/ext/v8/upstream/3.1.8/src/bootstrapper.cc +0 -1888
  632. data/ext/v8/upstream/3.1.8/src/bootstrapper.h +0 -118
  633. data/ext/v8/upstream/3.1.8/src/builtins.cc +0 -1586
  634. data/ext/v8/upstream/3.1.8/src/builtins.h +0 -339
  635. data/ext/v8/upstream/3.1.8/src/checks.cc +0 -110
  636. data/ext/v8/upstream/3.1.8/src/checks.h +0 -292
  637. data/ext/v8/upstream/3.1.8/src/code-stubs.cc +0 -230
  638. data/ext/v8/upstream/3.1.8/src/code-stubs.h +0 -950
  639. data/ext/v8/upstream/3.1.8/src/codegen-inl.h +0 -64
  640. data/ext/v8/upstream/3.1.8/src/codegen.cc +0 -495
  641. data/ext/v8/upstream/3.1.8/src/codegen.h +0 -245
  642. data/ext/v8/upstream/3.1.8/src/compilation-cache.cc +0 -654
  643. data/ext/v8/upstream/3.1.8/src/compilation-cache.h +0 -112
  644. data/ext/v8/upstream/3.1.8/src/compiler.cc +0 -806
  645. data/ext/v8/upstream/3.1.8/src/compiler.h +0 -290
  646. data/ext/v8/upstream/3.1.8/src/contexts.cc +0 -320
  647. data/ext/v8/upstream/3.1.8/src/contexts.h +0 -376
  648. data/ext/v8/upstream/3.1.8/src/conversions.cc +0 -1069
  649. data/ext/v8/upstream/3.1.8/src/counters.cc +0 -78
  650. data/ext/v8/upstream/3.1.8/src/counters.h +0 -242
  651. data/ext/v8/upstream/3.1.8/src/cpu-profiler-inl.h +0 -100
  652. data/ext/v8/upstream/3.1.8/src/cpu-profiler.cc +0 -554
  653. data/ext/v8/upstream/3.1.8/src/cpu-profiler.h +0 -291
  654. data/ext/v8/upstream/3.1.8/src/cpu.h +0 -65
  655. data/ext/v8/upstream/3.1.8/src/d8-debug.cc +0 -367
  656. data/ext/v8/upstream/3.1.8/src/d8-debug.h +0 -157
  657. data/ext/v8/upstream/3.1.8/src/d8-posix.cc +0 -693
  658. data/ext/v8/upstream/3.1.8/src/d8.cc +0 -792
  659. data/ext/v8/upstream/3.1.8/src/d8.gyp +0 -85
  660. data/ext/v8/upstream/3.1.8/src/data-flow.h +0 -379
  661. data/ext/v8/upstream/3.1.8/src/dateparser.h +0 -263
  662. data/ext/v8/upstream/3.1.8/src/debug-agent.cc +0 -446
  663. data/ext/v8/upstream/3.1.8/src/debug-agent.h +0 -131
  664. data/ext/v8/upstream/3.1.8/src/debug.cc +0 -3085
  665. data/ext/v8/upstream/3.1.8/src/debug.h +0 -1025
  666. data/ext/v8/upstream/3.1.8/src/deoptimizer.cc +0 -1185
  667. data/ext/v8/upstream/3.1.8/src/deoptimizer.h +0 -529
  668. data/ext/v8/upstream/3.1.8/src/disasm.h +0 -77
  669. data/ext/v8/upstream/3.1.8/src/disassembler.cc +0 -338
  670. data/ext/v8/upstream/3.1.8/src/execution.cc +0 -735
  671. data/ext/v8/upstream/3.1.8/src/execution.h +0 -322
  672. data/ext/v8/upstream/3.1.8/src/extensions/experimental/experimental.gyp +0 -53
  673. data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.cc +0 -264
  674. data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.cc +0 -141
  675. data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.cc +0 -58
  676. data/ext/v8/upstream/3.1.8/src/factory.cc +0 -1087
  677. data/ext/v8/upstream/3.1.8/src/factory.h +0 -432
  678. data/ext/v8/upstream/3.1.8/src/flag-definitions.h +0 -552
  679. data/ext/v8/upstream/3.1.8/src/frame-element.cc +0 -42
  680. data/ext/v8/upstream/3.1.8/src/frame-element.h +0 -277
  681. data/ext/v8/upstream/3.1.8/src/frames-inl.h +0 -210
  682. data/ext/v8/upstream/3.1.8/src/frames.cc +0 -1232
  683. data/ext/v8/upstream/3.1.8/src/frames.h +0 -826
  684. data/ext/v8/upstream/3.1.8/src/full-codegen.cc +0 -1382
  685. data/ext/v8/upstream/3.1.8/src/full-codegen.h +0 -751
  686. data/ext/v8/upstream/3.1.8/src/func-name-inferrer.cc +0 -90
  687. data/ext/v8/upstream/3.1.8/src/func-name-inferrer.h +0 -111
  688. data/ext/v8/upstream/3.1.8/src/gdb-jit.cc +0 -1547
  689. data/ext/v8/upstream/3.1.8/src/global-handles.cc +0 -534
  690. data/ext/v8/upstream/3.1.8/src/global-handles.h +0 -181
  691. data/ext/v8/upstream/3.1.8/src/globals.h +0 -325
  692. data/ext/v8/upstream/3.1.8/src/handles-inl.h +0 -80
  693. data/ext/v8/upstream/3.1.8/src/handles.cc +0 -910
  694. data/ext/v8/upstream/3.1.8/src/handles.h +0 -424
  695. data/ext/v8/upstream/3.1.8/src/hashmap.h +0 -121
  696. data/ext/v8/upstream/3.1.8/src/heap-inl.h +0 -587
  697. data/ext/v8/upstream/3.1.8/src/heap-profiler.cc +0 -1128
  698. data/ext/v8/upstream/3.1.8/src/heap-profiler.h +0 -381
  699. data/ext/v8/upstream/3.1.8/src/heap.cc +0 -5610
  700. data/ext/v8/upstream/3.1.8/src/heap.h +0 -2218
  701. data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.cc +0 -1490
  702. data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.h +0 -3493
  703. data/ext/v8/upstream/3.1.8/src/hydrogen.cc +0 -6056
  704. data/ext/v8/upstream/3.1.8/src/hydrogen.h +0 -1091
  705. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32-inl.h +0 -429
  706. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.cc +0 -2800
  707. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.h +0 -1093
  708. data/ext/v8/upstream/3.1.8/src/ia32/builtins-ia32.cc +0 -1590
  709. data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.cc +0 -6624
  710. data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.h +0 -536
  711. data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.cc +0 -10354
  712. data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.h +0 -798
  713. data/ext/v8/upstream/3.1.8/src/ia32/cpu-ia32.cc +0 -87
  714. data/ext/v8/upstream/3.1.8/src/ia32/debug-ia32.cc +0 -309
  715. data/ext/v8/upstream/3.1.8/src/ia32/deoptimizer-ia32.cc +0 -664
  716. data/ext/v8/upstream/3.1.8/src/ia32/disasm-ia32.cc +0 -1597
  717. data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.h +0 -140
  718. data/ext/v8/upstream/3.1.8/src/ia32/full-codegen-ia32.cc +0 -4278
  719. data/ext/v8/upstream/3.1.8/src/ia32/ic-ia32.cc +0 -1786
  720. data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.cc +0 -3880
  721. data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.h +0 -309
  722. data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.cc +0 -460
  723. data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.cc +0 -2095
  724. data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.h +0 -2127
  725. data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.cc +0 -2031
  726. data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.h +0 -798
  727. data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.cc +0 -1253
  728. data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.h +0 -215
  729. data/ext/v8/upstream/3.1.8/src/ia32/register-allocator-ia32.cc +0 -157
  730. data/ext/v8/upstream/3.1.8/src/ia32/simulator-ia32.h +0 -72
  731. data/ext/v8/upstream/3.1.8/src/ia32/stub-cache-ia32.cc +0 -3732
  732. data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.cc +0 -1360
  733. data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.h +0 -646
  734. data/ext/v8/upstream/3.1.8/src/ic-inl.h +0 -129
  735. data/ext/v8/upstream/3.1.8/src/ic.cc +0 -2333
  736. data/ext/v8/upstream/3.1.8/src/ic.h +0 -639
  737. data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.cc +0 -655
  738. data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.h +0 -48
  739. data/ext/v8/upstream/3.1.8/src/json.js +0 -342
  740. data/ext/v8/upstream/3.1.8/src/jsregexp.cc +0 -5340
  741. data/ext/v8/upstream/3.1.8/src/jsregexp.h +0 -1484
  742. data/ext/v8/upstream/3.1.8/src/jump-target-heavy.cc +0 -430
  743. data/ext/v8/upstream/3.1.8/src/jump-target-heavy.h +0 -244
  744. data/ext/v8/upstream/3.1.8/src/jump-target-inl.h +0 -48
  745. data/ext/v8/upstream/3.1.8/src/jump-target-light.cc +0 -111
  746. data/ext/v8/upstream/3.1.8/src/lithium-allocator-inl.h +0 -140
  747. data/ext/v8/upstream/3.1.8/src/lithium-allocator.cc +0 -2093
  748. data/ext/v8/upstream/3.1.8/src/lithium-allocator.h +0 -644
  749. data/ext/v8/upstream/3.1.8/src/lithium.cc +0 -168
  750. data/ext/v8/upstream/3.1.8/src/liveedit.cc +0 -1650
  751. data/ext/v8/upstream/3.1.8/src/liveedit.h +0 -174
  752. data/ext/v8/upstream/3.1.8/src/liveobjectlist.cc +0 -2527
  753. data/ext/v8/upstream/3.1.8/src/liveobjectlist.h +0 -322
  754. data/ext/v8/upstream/3.1.8/src/log-utils.cc +0 -336
  755. data/ext/v8/upstream/3.1.8/src/log-utils.h +0 -232
  756. data/ext/v8/upstream/3.1.8/src/log.cc +0 -1608
  757. data/ext/v8/upstream/3.1.8/src/log.h +0 -379
  758. data/ext/v8/upstream/3.1.8/src/mark-compact.cc +0 -2957
  759. data/ext/v8/upstream/3.1.8/src/mark-compact.h +0 -433
  760. data/ext/v8/upstream/3.1.8/src/messages.cc +0 -164
  761. data/ext/v8/upstream/3.1.8/src/messages.js +0 -1071
  762. data/ext/v8/upstream/3.1.8/src/mips/assembler-mips-inl.h +0 -215
  763. data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.cc +0 -1219
  764. data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.h +0 -667
  765. data/ext/v8/upstream/3.1.8/src/mips/builtins-mips.cc +0 -205
  766. data/ext/v8/upstream/3.1.8/src/mips/codegen-mips-inl.h +0 -70
  767. data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.cc +0 -1437
  768. data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.h +0 -431
  769. data/ext/v8/upstream/3.1.8/src/mips/constants-mips.cc +0 -328
  770. data/ext/v8/upstream/3.1.8/src/mips/constants-mips.h +0 -525
  771. data/ext/v8/upstream/3.1.8/src/mips/cpu-mips.cc +0 -73
  772. data/ext/v8/upstream/3.1.8/src/mips/debug-mips.cc +0 -127
  773. data/ext/v8/upstream/3.1.8/src/mips/disasm-mips.cc +0 -787
  774. data/ext/v8/upstream/3.1.8/src/mips/fast-codegen-mips.cc +0 -77
  775. data/ext/v8/upstream/3.1.8/src/mips/frames-mips.cc +0 -96
  776. data/ext/v8/upstream/3.1.8/src/mips/frames-mips.h +0 -164
  777. data/ext/v8/upstream/3.1.8/src/mips/full-codegen-mips.cc +0 -277
  778. data/ext/v8/upstream/3.1.8/src/mips/ic-mips.cc +0 -208
  779. data/ext/v8/upstream/3.1.8/src/mips/jump-target-mips.cc +0 -175
  780. data/ext/v8/upstream/3.1.8/src/mips/macro-assembler-mips.cc +0 -1326
  781. data/ext/v8/upstream/3.1.8/src/mips/macro-assembler-mips.h +0 -461
  782. data/ext/v8/upstream/3.1.8/src/mips/register-allocator-mips-inl.h +0 -137
  783. data/ext/v8/upstream/3.1.8/src/mips/register-allocator-mips.h +0 -46
  784. data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.cc +0 -1650
  785. data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.h +0 -311
  786. data/ext/v8/upstream/3.1.8/src/mips/stub-cache-mips.cc +0 -418
  787. data/ext/v8/upstream/3.1.8/src/mips/virtual-frame-mips.cc +0 -319
  788. data/ext/v8/upstream/3.1.8/src/mips/virtual-frame-mips.h +0 -548
  789. data/ext/v8/upstream/3.1.8/src/mirror-debugger.js +0 -2380
  790. data/ext/v8/upstream/3.1.8/src/mksnapshot.cc +0 -256
  791. data/ext/v8/upstream/3.1.8/src/objects-debug.cc +0 -722
  792. data/ext/v8/upstream/3.1.8/src/objects-inl.h +0 -3946
  793. data/ext/v8/upstream/3.1.8/src/objects-printer.cc +0 -801
  794. data/ext/v8/upstream/3.1.8/src/objects-visiting.cc +0 -142
  795. data/ext/v8/upstream/3.1.8/src/objects-visiting.h +0 -401
  796. data/ext/v8/upstream/3.1.8/src/objects.cc +0 -10044
  797. data/ext/v8/upstream/3.1.8/src/objects.h +0 -6571
  798. data/ext/v8/upstream/3.1.8/src/parser.cc +0 -5165
  799. data/ext/v8/upstream/3.1.8/src/parser.h +0 -802
  800. data/ext/v8/upstream/3.1.8/src/platform-cygwin.cc +0 -745
  801. data/ext/v8/upstream/3.1.8/src/platform-freebsd.cc +0 -702
  802. data/ext/v8/upstream/3.1.8/src/platform-linux.cc +0 -981
  803. data/ext/v8/upstream/3.1.8/src/platform-macos.cc +0 -732
  804. data/ext/v8/upstream/3.1.8/src/platform-nullos.cc +0 -498
  805. data/ext/v8/upstream/3.1.8/src/platform-openbsd.cc +0 -657
  806. data/ext/v8/upstream/3.1.8/src/platform-posix.cc +0 -399
  807. data/ext/v8/upstream/3.1.8/src/platform-solaris.cc +0 -714
  808. data/ext/v8/upstream/3.1.8/src/platform-win32.cc +0 -1974
  809. data/ext/v8/upstream/3.1.8/src/platform.h +0 -636
  810. data/ext/v8/upstream/3.1.8/src/preparse-data.cc +0 -183
  811. data/ext/v8/upstream/3.1.8/src/preparser-api.cc +0 -213
  812. data/ext/v8/upstream/3.1.8/src/preparser.cc +0 -1205
  813. data/ext/v8/upstream/3.1.8/src/prettyprinter.cc +0 -1539
  814. data/ext/v8/upstream/3.1.8/src/prettyprinter.h +0 -223
  815. data/ext/v8/upstream/3.1.8/src/profile-generator.cc +0 -2899
  816. data/ext/v8/upstream/3.1.8/src/profile-generator.h +0 -1151
  817. data/ext/v8/upstream/3.1.8/src/property.cc +0 -96
  818. data/ext/v8/upstream/3.1.8/src/property.h +0 -337
  819. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.cc +0 -470
  820. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.cc +0 -257
  821. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.h +0 -231
  822. data/ext/v8/upstream/3.1.8/src/regexp-stack.cc +0 -103
  823. data/ext/v8/upstream/3.1.8/src/regexp-stack.h +0 -123
  824. data/ext/v8/upstream/3.1.8/src/regexp.js +0 -483
  825. data/ext/v8/upstream/3.1.8/src/register-allocator-inl.h +0 -141
  826. data/ext/v8/upstream/3.1.8/src/register-allocator.cc +0 -104
  827. data/ext/v8/upstream/3.1.8/src/register-allocator.h +0 -320
  828. data/ext/v8/upstream/3.1.8/src/rewriter.cc +0 -1023
  829. data/ext/v8/upstream/3.1.8/src/runtime-profiler.cc +0 -443
  830. data/ext/v8/upstream/3.1.8/src/runtime-profiler.h +0 -77
  831. data/ext/v8/upstream/3.1.8/src/runtime.cc +0 -11592
  832. data/ext/v8/upstream/3.1.8/src/runtime.h +0 -582
  833. data/ext/v8/upstream/3.1.8/src/safepoint-table.cc +0 -253
  834. data/ext/v8/upstream/3.1.8/src/safepoint-table.h +0 -263
  835. data/ext/v8/upstream/3.1.8/src/scanner-base.cc +0 -971
  836. data/ext/v8/upstream/3.1.8/src/scanner-base.h +0 -653
  837. data/ext/v8/upstream/3.1.8/src/scanner.cc +0 -586
  838. data/ext/v8/upstream/3.1.8/src/scanner.h +0 -194
  839. data/ext/v8/upstream/3.1.8/src/scopeinfo.cc +0 -636
  840. data/ext/v8/upstream/3.1.8/src/scopeinfo.h +0 -238
  841. data/ext/v8/upstream/3.1.8/src/scopes.cc +0 -1063
  842. data/ext/v8/upstream/3.1.8/src/scopes.h +0 -494
  843. data/ext/v8/upstream/3.1.8/src/serialize.cc +0 -1535
  844. data/ext/v8/upstream/3.1.8/src/serialize.h +0 -584
  845. data/ext/v8/upstream/3.1.8/src/snapshot-common.cc +0 -82
  846. data/ext/v8/upstream/3.1.8/src/snapshot.h +0 -71
  847. data/ext/v8/upstream/3.1.8/src/spaces-inl.h +0 -524
  848. data/ext/v8/upstream/3.1.8/src/spaces.cc +0 -3254
  849. data/ext/v8/upstream/3.1.8/src/spaces.h +0 -2362
  850. data/ext/v8/upstream/3.1.8/src/string-search.cc +0 -40
  851. data/ext/v8/upstream/3.1.8/src/string-search.h +0 -567
  852. data/ext/v8/upstream/3.1.8/src/string-stream.cc +0 -584
  853. data/ext/v8/upstream/3.1.8/src/string.js +0 -915
  854. data/ext/v8/upstream/3.1.8/src/stub-cache.cc +0 -1878
  855. data/ext/v8/upstream/3.1.8/src/stub-cache.h +0 -849
  856. data/ext/v8/upstream/3.1.8/src/token.cc +0 -63
  857. data/ext/v8/upstream/3.1.8/src/token.h +0 -288
  858. data/ext/v8/upstream/3.1.8/src/top.cc +0 -1152
  859. data/ext/v8/upstream/3.1.8/src/top.h +0 -608
  860. data/ext/v8/upstream/3.1.8/src/type-info.cc +0 -406
  861. data/ext/v8/upstream/3.1.8/src/type-info.h +0 -283
  862. data/ext/v8/upstream/3.1.8/src/unicode.cc +0 -1624
  863. data/ext/v8/upstream/3.1.8/src/unicode.h +0 -280
  864. data/ext/v8/upstream/3.1.8/src/utils.h +0 -793
  865. data/ext/v8/upstream/3.1.8/src/v8-counters.cc +0 -55
  866. data/ext/v8/upstream/3.1.8/src/v8-counters.h +0 -290
  867. data/ext/v8/upstream/3.1.8/src/v8.cc +0 -270
  868. data/ext/v8/upstream/3.1.8/src/v8.h +0 -127
  869. data/ext/v8/upstream/3.1.8/src/v8globals.h +0 -480
  870. data/ext/v8/upstream/3.1.8/src/v8natives.js +0 -1252
  871. data/ext/v8/upstream/3.1.8/src/v8threads.cc +0 -440
  872. data/ext/v8/upstream/3.1.8/src/v8threads.h +0 -157
  873. data/ext/v8/upstream/3.1.8/src/v8utils.h +0 -354
  874. data/ext/v8/upstream/3.1.8/src/variables.h +0 -212
  875. data/ext/v8/upstream/3.1.8/src/version.cc +0 -95
  876. data/ext/v8/upstream/3.1.8/src/version.h +0 -64
  877. data/ext/v8/upstream/3.1.8/src/virtual-frame-light-inl.h +0 -170
  878. data/ext/v8/upstream/3.1.8/src/vm-state-inl.h +0 -134
  879. data/ext/v8/upstream/3.1.8/src/vm-state.h +0 -68
  880. data/ext/v8/upstream/3.1.8/src/win32-headers.h +0 -95
  881. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64-inl.h +0 -455
  882. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.cc +0 -3162
  883. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.h +0 -1584
  884. data/ext/v8/upstream/3.1.8/src/x64/builtins-x64.cc +0 -1492
  885. data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.cc +0 -5150
  886. data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.h +0 -519
  887. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.cc +0 -8835
  888. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.h +0 -750
  889. data/ext/v8/upstream/3.1.8/src/x64/cpu-x64.cc +0 -86
  890. data/ext/v8/upstream/3.1.8/src/x64/debug-x64.cc +0 -316
  891. data/ext/v8/upstream/3.1.8/src/x64/deoptimizer-x64.cc +0 -781
  892. data/ext/v8/upstream/3.1.8/src/x64/disasm-x64.cc +0 -1737
  893. data/ext/v8/upstream/3.1.8/src/x64/frames-x64.h +0 -130
  894. data/ext/v8/upstream/3.1.8/src/x64/full-codegen-x64.cc +0 -3984
  895. data/ext/v8/upstream/3.1.8/src/x64/ic-x64.cc +0 -1761
  896. data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.cc +0 -3639
  897. data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.h +0 -305
  898. data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.cc +0 -2044
  899. data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.h +0 -2052
  900. data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.cc +0 -2660
  901. data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.h +0 -1852
  902. data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.cc +0 -1382
  903. data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.h +0 -278
  904. data/ext/v8/upstream/3.1.8/src/x64/register-allocator-x64-inl.h +0 -87
  905. data/ext/v8/upstream/3.1.8/src/x64/register-allocator-x64.cc +0 -91
  906. data/ext/v8/upstream/3.1.8/src/x64/simulator-x64.h +0 -71
  907. data/ext/v8/upstream/3.1.8/src/x64/stub-cache-x64.cc +0 -3509
  908. data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.cc +0 -1292
  909. data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.h +0 -593
  910. data/ext/v8/upstream/3.1.8/src/zone-inl.h +0 -83
  911. data/ext/v8/upstream/3.1.8/src/zone.cc +0 -195
  912. data/ext/v8/upstream/3.1.8/src/zone.h +0 -233
  913. data/ext/v8/upstream/3.1.8/tools/gyp/v8.gyp +0 -869
  914. data/ext/v8/upstream/3.1.8/tools/linux-tick-processor +0 -33
  915. data/ext/v8/upstream/3.1.8/tools/tickprocessor.js +0 -863
  916. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base.vcproj +0 -1296
  917. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_arm.vcproj +0 -1234
  918. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_x64.vcproj +0 -1296
  919. data/ext/v8/upstream/3.1.8/tools/visual_studio/x64.vsprops +0 -17
  920. data/spec/ext/mem_spec.rb +0 -42
@@ -1,2031 +0,0 @@
1
- // Copyright 2011 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
- #if defined(V8_TARGET_ARCH_IA32)
31
-
32
- #include "bootstrapper.h"
33
- #include "codegen-inl.h"
34
- #include "debug.h"
35
- #include "runtime.h"
36
- #include "serialize.h"
37
-
38
- namespace v8 {
39
- namespace internal {
40
-
41
- // -------------------------------------------------------------------------
42
- // MacroAssembler implementation.
43
-
44
- MacroAssembler::MacroAssembler(void* buffer, int size)
45
- : Assembler(buffer, size),
46
- generating_stub_(false),
47
- allow_stub_calls_(true),
48
- code_object_(Heap::undefined_value()) {
49
- }
50
-
51
-
52
- void MacroAssembler::RecordWriteHelper(Register object,
53
- Register addr,
54
- Register scratch) {
55
- if (FLAG_debug_code) {
56
- // Check that the object is not in new space.
57
- Label not_in_new_space;
58
- InNewSpace(object, scratch, not_equal, &not_in_new_space);
59
- Abort("new-space object passed to RecordWriteHelper");
60
- bind(&not_in_new_space);
61
- }
62
-
63
- // Compute the page start address from the heap object pointer, and reuse
64
- // the 'object' register for it.
65
- and_(object, ~Page::kPageAlignmentMask);
66
-
67
- // Compute number of region covering addr. See Page::GetRegionNumberForAddress
68
- // method for more details.
69
- and_(addr, Page::kPageAlignmentMask);
70
- shr(addr, Page::kRegionSizeLog2);
71
-
72
- // Set dirty mark for region.
73
- bts(Operand(object, Page::kDirtyFlagOffset), addr);
74
- }
75
-
76
-
77
- void MacroAssembler::RecordWrite(Register object,
78
- int offset,
79
- Register value,
80
- Register scratch) {
81
- // First, check if a write barrier is even needed. The tests below
82
- // catch stores of Smis and stores into young gen.
83
- NearLabel done;
84
-
85
- // Skip barrier if writing a smi.
86
- ASSERT_EQ(0, kSmiTag);
87
- test(value, Immediate(kSmiTagMask));
88
- j(zero, &done);
89
-
90
- InNewSpace(object, value, equal, &done);
91
-
92
- // The offset is relative to a tagged or untagged HeapObject pointer,
93
- // so either offset or offset + kHeapObjectTag must be a
94
- // multiple of kPointerSize.
95
- ASSERT(IsAligned(offset, kPointerSize) ||
96
- IsAligned(offset + kHeapObjectTag, kPointerSize));
97
-
98
- Register dst = scratch;
99
- if (offset != 0) {
100
- lea(dst, Operand(object, offset));
101
- } else {
102
- // Array access: calculate the destination address in the same manner as
103
- // KeyedStoreIC::GenerateGeneric. Multiply a smi by 2 to get an offset
104
- // into an array of words.
105
- ASSERT_EQ(1, kSmiTagSize);
106
- ASSERT_EQ(0, kSmiTag);
107
- lea(dst, Operand(object, dst, times_half_pointer_size,
108
- FixedArray::kHeaderSize - kHeapObjectTag));
109
- }
110
- RecordWriteHelper(object, dst, value);
111
-
112
- bind(&done);
113
-
114
- // Clobber all input registers when running with the debug-code flag
115
- // turned on to provoke errors.
116
- if (FLAG_debug_code) {
117
- mov(object, Immediate(BitCast<int32_t>(kZapValue)));
118
- mov(value, Immediate(BitCast<int32_t>(kZapValue)));
119
- mov(scratch, Immediate(BitCast<int32_t>(kZapValue)));
120
- }
121
- }
122
-
123
-
124
- void MacroAssembler::RecordWrite(Register object,
125
- Register address,
126
- Register value) {
127
- // First, check if a write barrier is even needed. The tests below
128
- // catch stores of Smis and stores into young gen.
129
- Label done;
130
-
131
- // Skip barrier if writing a smi.
132
- ASSERT_EQ(0, kSmiTag);
133
- test(value, Immediate(kSmiTagMask));
134
- j(zero, &done);
135
-
136
- InNewSpace(object, value, equal, &done);
137
-
138
- RecordWriteHelper(object, address, value);
139
-
140
- bind(&done);
141
-
142
- // Clobber all input registers when running with the debug-code flag
143
- // turned on to provoke errors.
144
- if (FLAG_debug_code) {
145
- mov(object, Immediate(BitCast<int32_t>(kZapValue)));
146
- mov(address, Immediate(BitCast<int32_t>(kZapValue)));
147
- mov(value, Immediate(BitCast<int32_t>(kZapValue)));
148
- }
149
- }
150
-
151
-
152
- #ifdef ENABLE_DEBUGGER_SUPPORT
153
- void MacroAssembler::DebugBreak() {
154
- Set(eax, Immediate(0));
155
- mov(ebx, Immediate(ExternalReference(Runtime::kDebugBreak)));
156
- CEntryStub ces(1);
157
- call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
158
- }
159
- #endif
160
-
161
-
162
- void MacroAssembler::Set(Register dst, const Immediate& x) {
163
- if (x.is_zero()) {
164
- xor_(dst, Operand(dst)); // shorter than mov
165
- } else {
166
- mov(dst, x);
167
- }
168
- }
169
-
170
-
171
- void MacroAssembler::Set(const Operand& dst, const Immediate& x) {
172
- mov(dst, x);
173
- }
174
-
175
-
176
- void MacroAssembler::CmpObjectType(Register heap_object,
177
- InstanceType type,
178
- Register map) {
179
- mov(map, FieldOperand(heap_object, HeapObject::kMapOffset));
180
- CmpInstanceType(map, type);
181
- }
182
-
183
-
184
- void MacroAssembler::CmpInstanceType(Register map, InstanceType type) {
185
- cmpb(FieldOperand(map, Map::kInstanceTypeOffset),
186
- static_cast<int8_t>(type));
187
- }
188
-
189
-
190
- void MacroAssembler::CheckMap(Register obj,
191
- Handle<Map> map,
192
- Label* fail,
193
- bool is_heap_object) {
194
- if (!is_heap_object) {
195
- test(obj, Immediate(kSmiTagMask));
196
- j(zero, fail);
197
- }
198
- cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map));
199
- j(not_equal, fail);
200
- }
201
-
202
-
203
- Condition MacroAssembler::IsObjectStringType(Register heap_object,
204
- Register map,
205
- Register instance_type) {
206
- mov(map, FieldOperand(heap_object, HeapObject::kMapOffset));
207
- movzx_b(instance_type, FieldOperand(map, Map::kInstanceTypeOffset));
208
- ASSERT(kNotStringTag != 0);
209
- test(instance_type, Immediate(kIsNotStringMask));
210
- return zero;
211
- }
212
-
213
-
214
- void MacroAssembler::IsObjectJSObjectType(Register heap_object,
215
- Register map,
216
- Register scratch,
217
- Label* fail) {
218
- mov(map, FieldOperand(heap_object, HeapObject::kMapOffset));
219
- IsInstanceJSObjectType(map, scratch, fail);
220
- }
221
-
222
-
223
- void MacroAssembler::IsInstanceJSObjectType(Register map,
224
- Register scratch,
225
- Label* fail) {
226
- movzx_b(scratch, FieldOperand(map, Map::kInstanceTypeOffset));
227
- sub(Operand(scratch), Immediate(FIRST_JS_OBJECT_TYPE));
228
- cmp(scratch, LAST_JS_OBJECT_TYPE - FIRST_JS_OBJECT_TYPE);
229
- j(above, fail);
230
- }
231
-
232
-
233
- void MacroAssembler::FCmp() {
234
- if (CpuFeatures::IsSupported(CMOV)) {
235
- fucomip();
236
- ffree(0);
237
- fincstp();
238
- } else {
239
- fucompp();
240
- push(eax);
241
- fnstsw_ax();
242
- sahf();
243
- pop(eax);
244
- }
245
- }
246
-
247
-
248
- void MacroAssembler::AbortIfNotNumber(Register object) {
249
- Label ok;
250
- test(object, Immediate(kSmiTagMask));
251
- j(zero, &ok);
252
- cmp(FieldOperand(object, HeapObject::kMapOffset),
253
- Factory::heap_number_map());
254
- Assert(equal, "Operand not a number");
255
- bind(&ok);
256
- }
257
-
258
-
259
- void MacroAssembler::AbortIfNotSmi(Register object) {
260
- test(object, Immediate(kSmiTagMask));
261
- Assert(equal, "Operand is not a smi");
262
- }
263
-
264
-
265
- void MacroAssembler::AbortIfNotString(Register object) {
266
- test(object, Immediate(kSmiTagMask));
267
- Assert(not_equal, "Operand is not a string");
268
- push(object);
269
- mov(object, FieldOperand(object, HeapObject::kMapOffset));
270
- CmpInstanceType(object, FIRST_NONSTRING_TYPE);
271
- pop(object);
272
- Assert(below, "Operand is not a string");
273
- }
274
-
275
-
276
- void MacroAssembler::AbortIfSmi(Register object) {
277
- test(object, Immediate(kSmiTagMask));
278
- Assert(not_equal, "Operand is a smi");
279
- }
280
-
281
-
282
- void MacroAssembler::EnterFrame(StackFrame::Type type) {
283
- push(ebp);
284
- mov(ebp, Operand(esp));
285
- push(esi);
286
- push(Immediate(Smi::FromInt(type)));
287
- push(Immediate(CodeObject()));
288
- if (FLAG_debug_code) {
289
- cmp(Operand(esp, 0), Immediate(Factory::undefined_value()));
290
- Check(not_equal, "code object not properly patched");
291
- }
292
- }
293
-
294
-
295
- void MacroAssembler::LeaveFrame(StackFrame::Type type) {
296
- if (FLAG_debug_code) {
297
- cmp(Operand(ebp, StandardFrameConstants::kMarkerOffset),
298
- Immediate(Smi::FromInt(type)));
299
- Check(equal, "stack frame types must match");
300
- }
301
- leave();
302
- }
303
-
304
-
305
- void MacroAssembler::EnterExitFramePrologue() {
306
- // Setup the frame structure on the stack.
307
- ASSERT(ExitFrameConstants::kCallerSPDisplacement == +2 * kPointerSize);
308
- ASSERT(ExitFrameConstants::kCallerPCOffset == +1 * kPointerSize);
309
- ASSERT(ExitFrameConstants::kCallerFPOffset == 0 * kPointerSize);
310
- push(ebp);
311
- mov(ebp, Operand(esp));
312
-
313
- // Reserve room for entry stack pointer and push the code object.
314
- ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize);
315
- push(Immediate(0)); // Saved entry sp, patched before call.
316
- push(Immediate(CodeObject())); // Accessed from ExitFrame::code_slot.
317
-
318
- // Save the frame pointer and the context in top.
319
- ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address);
320
- ExternalReference context_address(Top::k_context_address);
321
- mov(Operand::StaticVariable(c_entry_fp_address), ebp);
322
- mov(Operand::StaticVariable(context_address), esi);
323
- }
324
-
325
-
326
- void MacroAssembler::EnterExitFrameEpilogue(int argc, bool save_doubles) {
327
- // Optionally save all XMM registers.
328
- if (save_doubles) {
329
- CpuFeatures::Scope scope(SSE2);
330
- int space = XMMRegister::kNumRegisters * kDoubleSize + argc * kPointerSize;
331
- sub(Operand(esp), Immediate(space));
332
- const int offset = -2 * kPointerSize;
333
- for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
334
- XMMRegister reg = XMMRegister::from_code(i);
335
- movdbl(Operand(ebp, offset - ((i + 1) * kDoubleSize)), reg);
336
- }
337
- } else {
338
- sub(Operand(esp), Immediate(argc * kPointerSize));
339
- }
340
-
341
- // Get the required frame alignment for the OS.
342
- static const int kFrameAlignment = OS::ActivationFrameAlignment();
343
- if (kFrameAlignment > 0) {
344
- ASSERT(IsPowerOf2(kFrameAlignment));
345
- and_(esp, -kFrameAlignment);
346
- }
347
-
348
- // Patch the saved entry sp.
349
- mov(Operand(ebp, ExitFrameConstants::kSPOffset), esp);
350
- }
351
-
352
-
353
- void MacroAssembler::EnterExitFrame(bool save_doubles) {
354
- EnterExitFramePrologue();
355
-
356
- // Setup argc and argv in callee-saved registers.
357
- int offset = StandardFrameConstants::kCallerSPOffset - kPointerSize;
358
- mov(edi, Operand(eax));
359
- lea(esi, Operand(ebp, eax, times_4, offset));
360
-
361
- EnterExitFrameEpilogue(2, save_doubles);
362
- }
363
-
364
-
365
- void MacroAssembler::EnterApiExitFrame(int argc) {
366
- EnterExitFramePrologue();
367
- EnterExitFrameEpilogue(argc, false);
368
- }
369
-
370
-
371
- void MacroAssembler::LeaveExitFrame(bool save_doubles) {
372
- // Optionally restore all XMM registers.
373
- if (save_doubles) {
374
- CpuFeatures::Scope scope(SSE2);
375
- const int offset = -2 * kPointerSize;
376
- for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
377
- XMMRegister reg = XMMRegister::from_code(i);
378
- movdbl(reg, Operand(ebp, offset - ((i + 1) * kDoubleSize)));
379
- }
380
- }
381
-
382
- // Get the return address from the stack and restore the frame pointer.
383
- mov(ecx, Operand(ebp, 1 * kPointerSize));
384
- mov(ebp, Operand(ebp, 0 * kPointerSize));
385
-
386
- // Pop the arguments and the receiver from the caller stack.
387
- lea(esp, Operand(esi, 1 * kPointerSize));
388
-
389
- // Push the return address to get ready to return.
390
- push(ecx);
391
-
392
- LeaveExitFrameEpilogue();
393
- }
394
-
395
- void MacroAssembler::LeaveExitFrameEpilogue() {
396
- // Restore current context from top and clear it in debug mode.
397
- ExternalReference context_address(Top::k_context_address);
398
- mov(esi, Operand::StaticVariable(context_address));
399
- #ifdef DEBUG
400
- mov(Operand::StaticVariable(context_address), Immediate(0));
401
- #endif
402
-
403
- // Clear the top frame.
404
- ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address);
405
- mov(Operand::StaticVariable(c_entry_fp_address), Immediate(0));
406
- }
407
-
408
-
409
- void MacroAssembler::LeaveApiExitFrame() {
410
- mov(esp, Operand(ebp));
411
- pop(ebp);
412
-
413
- LeaveExitFrameEpilogue();
414
- }
415
-
416
-
417
- void MacroAssembler::PushTryHandler(CodeLocation try_location,
418
- HandlerType type) {
419
- // Adjust this code if not the case.
420
- ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
421
- // The pc (return address) is already on TOS.
422
- if (try_location == IN_JAVASCRIPT) {
423
- if (type == TRY_CATCH_HANDLER) {
424
- push(Immediate(StackHandler::TRY_CATCH));
425
- } else {
426
- push(Immediate(StackHandler::TRY_FINALLY));
427
- }
428
- push(ebp);
429
- } else {
430
- ASSERT(try_location == IN_JS_ENTRY);
431
- // The frame pointer does not point to a JS frame so we save NULL
432
- // for ebp. We expect the code throwing an exception to check ebp
433
- // before dereferencing it to restore the context.
434
- push(Immediate(StackHandler::ENTRY));
435
- push(Immediate(0)); // NULL frame pointer.
436
- }
437
- // Save the current handler as the next handler.
438
- push(Operand::StaticVariable(ExternalReference(Top::k_handler_address)));
439
- // Link this handler as the new current one.
440
- mov(Operand::StaticVariable(ExternalReference(Top::k_handler_address)), esp);
441
- }
442
-
443
-
444
- void MacroAssembler::PopTryHandler() {
445
- ASSERT_EQ(0, StackHandlerConstants::kNextOffset);
446
- pop(Operand::StaticVariable(ExternalReference(Top::k_handler_address)));
447
- add(Operand(esp), Immediate(StackHandlerConstants::kSize - kPointerSize));
448
- }
449
-
450
-
451
- void MacroAssembler::Throw(Register value) {
452
- // Adjust this code if not the case.
453
- STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
454
-
455
- // eax must hold the exception.
456
- if (!value.is(eax)) {
457
- mov(eax, value);
458
- }
459
-
460
- // Drop the sp to the top of the handler.
461
- ExternalReference handler_address(Top::k_handler_address);
462
- mov(esp, Operand::StaticVariable(handler_address));
463
-
464
- // Restore next handler and frame pointer, discard handler state.
465
- STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
466
- pop(Operand::StaticVariable(handler_address));
467
- STATIC_ASSERT(StackHandlerConstants::kFPOffset == 1 * kPointerSize);
468
- pop(ebp);
469
- pop(edx); // Remove state.
470
-
471
- // Before returning we restore the context from the frame pointer if
472
- // not NULL. The frame pointer is NULL in the exception handler of
473
- // a JS entry frame.
474
- Set(esi, Immediate(0)); // Tentatively set context pointer to NULL.
475
- NearLabel skip;
476
- cmp(ebp, 0);
477
- j(equal, &skip, not_taken);
478
- mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
479
- bind(&skip);
480
-
481
- STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize);
482
- ret(0);
483
- }
484
-
485
-
486
- void MacroAssembler::ThrowUncatchable(UncatchableExceptionType type,
487
- Register value) {
488
- // Adjust this code if not the case.
489
- STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
490
-
491
- // eax must hold the exception.
492
- if (!value.is(eax)) {
493
- mov(eax, value);
494
- }
495
-
496
- // Drop sp to the top stack handler.
497
- ExternalReference handler_address(Top::k_handler_address);
498
- mov(esp, Operand::StaticVariable(handler_address));
499
-
500
- // Unwind the handlers until the ENTRY handler is found.
501
- NearLabel loop, done;
502
- bind(&loop);
503
- // Load the type of the current stack handler.
504
- const int kStateOffset = StackHandlerConstants::kStateOffset;
505
- cmp(Operand(esp, kStateOffset), Immediate(StackHandler::ENTRY));
506
- j(equal, &done);
507
- // Fetch the next handler in the list.
508
- const int kNextOffset = StackHandlerConstants::kNextOffset;
509
- mov(esp, Operand(esp, kNextOffset));
510
- jmp(&loop);
511
- bind(&done);
512
-
513
- // Set the top handler address to next handler past the current ENTRY handler.
514
- STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
515
- pop(Operand::StaticVariable(handler_address));
516
-
517
- if (type == OUT_OF_MEMORY) {
518
- // Set external caught exception to false.
519
- ExternalReference external_caught(Top::k_external_caught_exception_address);
520
- mov(eax, false);
521
- mov(Operand::StaticVariable(external_caught), eax);
522
-
523
- // Set pending exception and eax to out of memory exception.
524
- ExternalReference pending_exception(Top::k_pending_exception_address);
525
- mov(eax, reinterpret_cast<int32_t>(Failure::OutOfMemoryException()));
526
- mov(Operand::StaticVariable(pending_exception), eax);
527
- }
528
-
529
- // Clear the context pointer.
530
- Set(esi, Immediate(0));
531
-
532
- // Restore fp from handler and discard handler state.
533
- STATIC_ASSERT(StackHandlerConstants::kFPOffset == 1 * kPointerSize);
534
- pop(ebp);
535
- pop(edx); // State.
536
-
537
- STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize);
538
- ret(0);
539
- }
540
-
541
-
542
- void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
543
- Register scratch,
544
- Label* miss) {
545
- Label same_contexts;
546
-
547
- ASSERT(!holder_reg.is(scratch));
548
-
549
- // Load current lexical context from the stack frame.
550
- mov(scratch, Operand(ebp, StandardFrameConstants::kContextOffset));
551
-
552
- // When generating debug code, make sure the lexical context is set.
553
- if (FLAG_debug_code) {
554
- cmp(Operand(scratch), Immediate(0));
555
- Check(not_equal, "we should not have an empty lexical context");
556
- }
557
- // Load the global context of the current context.
558
- int offset = Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
559
- mov(scratch, FieldOperand(scratch, offset));
560
- mov(scratch, FieldOperand(scratch, GlobalObject::kGlobalContextOffset));
561
-
562
- // Check the context is a global context.
563
- if (FLAG_debug_code) {
564
- push(scratch);
565
- // Read the first word and compare to global_context_map.
566
- mov(scratch, FieldOperand(scratch, HeapObject::kMapOffset));
567
- cmp(scratch, Factory::global_context_map());
568
- Check(equal, "JSGlobalObject::global_context should be a global context.");
569
- pop(scratch);
570
- }
571
-
572
- // Check if both contexts are the same.
573
- cmp(scratch, FieldOperand(holder_reg, JSGlobalProxy::kContextOffset));
574
- j(equal, &same_contexts, taken);
575
-
576
- // Compare security tokens, save holder_reg on the stack so we can use it
577
- // as a temporary register.
578
- //
579
- // TODO(119): avoid push(holder_reg)/pop(holder_reg)
580
- push(holder_reg);
581
- // Check that the security token in the calling global object is
582
- // compatible with the security token in the receiving global
583
- // object.
584
- mov(holder_reg, FieldOperand(holder_reg, JSGlobalProxy::kContextOffset));
585
-
586
- // Check the context is a global context.
587
- if (FLAG_debug_code) {
588
- cmp(holder_reg, Factory::null_value());
589
- Check(not_equal, "JSGlobalProxy::context() should not be null.");
590
-
591
- push(holder_reg);
592
- // Read the first word and compare to global_context_map(),
593
- mov(holder_reg, FieldOperand(holder_reg, HeapObject::kMapOffset));
594
- cmp(holder_reg, Factory::global_context_map());
595
- Check(equal, "JSGlobalObject::global_context should be a global context.");
596
- pop(holder_reg);
597
- }
598
-
599
- int token_offset = Context::kHeaderSize +
600
- Context::SECURITY_TOKEN_INDEX * kPointerSize;
601
- mov(scratch, FieldOperand(scratch, token_offset));
602
- cmp(scratch, FieldOperand(holder_reg, token_offset));
603
- pop(holder_reg);
604
- j(not_equal, miss, not_taken);
605
-
606
- bind(&same_contexts);
607
- }
608
-
609
-
610
- void MacroAssembler::LoadAllocationTopHelper(Register result,
611
- Register scratch,
612
- AllocationFlags flags) {
613
- ExternalReference new_space_allocation_top =
614
- ExternalReference::new_space_allocation_top_address();
615
-
616
- // Just return if allocation top is already known.
617
- if ((flags & RESULT_CONTAINS_TOP) != 0) {
618
- // No use of scratch if allocation top is provided.
619
- ASSERT(scratch.is(no_reg));
620
- #ifdef DEBUG
621
- // Assert that result actually contains top on entry.
622
- cmp(result, Operand::StaticVariable(new_space_allocation_top));
623
- Check(equal, "Unexpected allocation top");
624
- #endif
625
- return;
626
- }
627
-
628
- // Move address of new object to result. Use scratch register if available.
629
- if (scratch.is(no_reg)) {
630
- mov(result, Operand::StaticVariable(new_space_allocation_top));
631
- } else {
632
- mov(Operand(scratch), Immediate(new_space_allocation_top));
633
- mov(result, Operand(scratch, 0));
634
- }
635
- }
636
-
637
-
638
- void MacroAssembler::UpdateAllocationTopHelper(Register result_end,
639
- Register scratch) {
640
- if (FLAG_debug_code) {
641
- test(result_end, Immediate(kObjectAlignmentMask));
642
- Check(zero, "Unaligned allocation in new space");
643
- }
644
-
645
- ExternalReference new_space_allocation_top =
646
- ExternalReference::new_space_allocation_top_address();
647
-
648
- // Update new top. Use scratch if available.
649
- if (scratch.is(no_reg)) {
650
- mov(Operand::StaticVariable(new_space_allocation_top), result_end);
651
- } else {
652
- mov(Operand(scratch, 0), result_end);
653
- }
654
- }
655
-
656
-
657
- void MacroAssembler::AllocateInNewSpace(int object_size,
658
- Register result,
659
- Register result_end,
660
- Register scratch,
661
- Label* gc_required,
662
- AllocationFlags flags) {
663
- if (!FLAG_inline_new) {
664
- if (FLAG_debug_code) {
665
- // Trash the registers to simulate an allocation failure.
666
- mov(result, Immediate(0x7091));
667
- if (result_end.is_valid()) {
668
- mov(result_end, Immediate(0x7191));
669
- }
670
- if (scratch.is_valid()) {
671
- mov(scratch, Immediate(0x7291));
672
- }
673
- }
674
- jmp(gc_required);
675
- return;
676
- }
677
- ASSERT(!result.is(result_end));
678
-
679
- // Load address of new object into result.
680
- LoadAllocationTopHelper(result, scratch, flags);
681
-
682
- Register top_reg = result_end.is_valid() ? result_end : result;
683
-
684
- // Calculate new top and bail out if new space is exhausted.
685
- ExternalReference new_space_allocation_limit =
686
- ExternalReference::new_space_allocation_limit_address();
687
-
688
- if (!top_reg.is(result)) {
689
- mov(top_reg, result);
690
- }
691
- add(Operand(top_reg), Immediate(object_size));
692
- j(carry, gc_required, not_taken);
693
- cmp(top_reg, Operand::StaticVariable(new_space_allocation_limit));
694
- j(above, gc_required, not_taken);
695
-
696
- // Update allocation top.
697
- UpdateAllocationTopHelper(top_reg, scratch);
698
-
699
- // Tag result if requested.
700
- if (top_reg.is(result)) {
701
- if ((flags & TAG_OBJECT) != 0) {
702
- sub(Operand(result), Immediate(object_size - kHeapObjectTag));
703
- } else {
704
- sub(Operand(result), Immediate(object_size));
705
- }
706
- } else if ((flags & TAG_OBJECT) != 0) {
707
- add(Operand(result), Immediate(kHeapObjectTag));
708
- }
709
- }
710
-
711
-
712
- void MacroAssembler::AllocateInNewSpace(int header_size,
713
- ScaleFactor element_size,
714
- Register element_count,
715
- Register result,
716
- Register result_end,
717
- Register scratch,
718
- Label* gc_required,
719
- AllocationFlags flags) {
720
- if (!FLAG_inline_new) {
721
- if (FLAG_debug_code) {
722
- // Trash the registers to simulate an allocation failure.
723
- mov(result, Immediate(0x7091));
724
- mov(result_end, Immediate(0x7191));
725
- if (scratch.is_valid()) {
726
- mov(scratch, Immediate(0x7291));
727
- }
728
- // Register element_count is not modified by the function.
729
- }
730
- jmp(gc_required);
731
- return;
732
- }
733
- ASSERT(!result.is(result_end));
734
-
735
- // Load address of new object into result.
736
- LoadAllocationTopHelper(result, scratch, flags);
737
-
738
- // Calculate new top and bail out if new space is exhausted.
739
- ExternalReference new_space_allocation_limit =
740
- ExternalReference::new_space_allocation_limit_address();
741
-
742
- // We assume that element_count*element_size + header_size does not
743
- // overflow.
744
- lea(result_end, Operand(element_count, element_size, header_size));
745
- add(result_end, Operand(result));
746
- j(carry, gc_required);
747
- cmp(result_end, Operand::StaticVariable(new_space_allocation_limit));
748
- j(above, gc_required);
749
-
750
- // Tag result if requested.
751
- if ((flags & TAG_OBJECT) != 0) {
752
- lea(result, Operand(result, kHeapObjectTag));
753
- }
754
-
755
- // Update allocation top.
756
- UpdateAllocationTopHelper(result_end, scratch);
757
- }
758
-
759
-
760
- void MacroAssembler::AllocateInNewSpace(Register object_size,
761
- Register result,
762
- Register result_end,
763
- Register scratch,
764
- Label* gc_required,
765
- AllocationFlags flags) {
766
- if (!FLAG_inline_new) {
767
- if (FLAG_debug_code) {
768
- // Trash the registers to simulate an allocation failure.
769
- mov(result, Immediate(0x7091));
770
- mov(result_end, Immediate(0x7191));
771
- if (scratch.is_valid()) {
772
- mov(scratch, Immediate(0x7291));
773
- }
774
- // object_size is left unchanged by this function.
775
- }
776
- jmp(gc_required);
777
- return;
778
- }
779
- ASSERT(!result.is(result_end));
780
-
781
- // Load address of new object into result.
782
- LoadAllocationTopHelper(result, scratch, flags);
783
-
784
- // Calculate new top and bail out if new space is exhausted.
785
- ExternalReference new_space_allocation_limit =
786
- ExternalReference::new_space_allocation_limit_address();
787
- if (!object_size.is(result_end)) {
788
- mov(result_end, object_size);
789
- }
790
- add(result_end, Operand(result));
791
- j(carry, gc_required, not_taken);
792
- cmp(result_end, Operand::StaticVariable(new_space_allocation_limit));
793
- j(above, gc_required, not_taken);
794
-
795
- // Tag result if requested.
796
- if ((flags & TAG_OBJECT) != 0) {
797
- lea(result, Operand(result, kHeapObjectTag));
798
- }
799
-
800
- // Update allocation top.
801
- UpdateAllocationTopHelper(result_end, scratch);
802
- }
803
-
804
-
805
- void MacroAssembler::UndoAllocationInNewSpace(Register object) {
806
- ExternalReference new_space_allocation_top =
807
- ExternalReference::new_space_allocation_top_address();
808
-
809
- // Make sure the object has no tag before resetting top.
810
- and_(Operand(object), Immediate(~kHeapObjectTagMask));
811
- #ifdef DEBUG
812
- cmp(object, Operand::StaticVariable(new_space_allocation_top));
813
- Check(below, "Undo allocation of non allocated memory");
814
- #endif
815
- mov(Operand::StaticVariable(new_space_allocation_top), object);
816
- }
817
-
818
-
819
- void MacroAssembler::AllocateHeapNumber(Register result,
820
- Register scratch1,
821
- Register scratch2,
822
- Label* gc_required) {
823
- // Allocate heap number in new space.
824
- AllocateInNewSpace(HeapNumber::kSize,
825
- result,
826
- scratch1,
827
- scratch2,
828
- gc_required,
829
- TAG_OBJECT);
830
-
831
- // Set the map.
832
- mov(FieldOperand(result, HeapObject::kMapOffset),
833
- Immediate(Factory::heap_number_map()));
834
- }
835
-
836
-
837
- void MacroAssembler::AllocateTwoByteString(Register result,
838
- Register length,
839
- Register scratch1,
840
- Register scratch2,
841
- Register scratch3,
842
- Label* gc_required) {
843
- // Calculate the number of bytes needed for the characters in the string while
844
- // observing object alignment.
845
- ASSERT((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
846
- ASSERT(kShortSize == 2);
847
- // scratch1 = length * 2 + kObjectAlignmentMask.
848
- lea(scratch1, Operand(length, length, times_1, kObjectAlignmentMask));
849
- and_(Operand(scratch1), Immediate(~kObjectAlignmentMask));
850
-
851
- // Allocate two byte string in new space.
852
- AllocateInNewSpace(SeqTwoByteString::kHeaderSize,
853
- times_1,
854
- scratch1,
855
- result,
856
- scratch2,
857
- scratch3,
858
- gc_required,
859
- TAG_OBJECT);
860
-
861
- // Set the map, length and hash field.
862
- mov(FieldOperand(result, HeapObject::kMapOffset),
863
- Immediate(Factory::string_map()));
864
- mov(scratch1, length);
865
- SmiTag(scratch1);
866
- mov(FieldOperand(result, String::kLengthOffset), scratch1);
867
- mov(FieldOperand(result, String::kHashFieldOffset),
868
- Immediate(String::kEmptyHashField));
869
- }
870
-
871
-
872
- void MacroAssembler::AllocateAsciiString(Register result,
873
- Register length,
874
- Register scratch1,
875
- Register scratch2,
876
- Register scratch3,
877
- Label* gc_required) {
878
- // Calculate the number of bytes needed for the characters in the string while
879
- // observing object alignment.
880
- ASSERT((SeqAsciiString::kHeaderSize & kObjectAlignmentMask) == 0);
881
- mov(scratch1, length);
882
- ASSERT(kCharSize == 1);
883
- add(Operand(scratch1), Immediate(kObjectAlignmentMask));
884
- and_(Operand(scratch1), Immediate(~kObjectAlignmentMask));
885
-
886
- // Allocate ascii string in new space.
887
- AllocateInNewSpace(SeqAsciiString::kHeaderSize,
888
- times_1,
889
- scratch1,
890
- result,
891
- scratch2,
892
- scratch3,
893
- gc_required,
894
- TAG_OBJECT);
895
-
896
- // Set the map, length and hash field.
897
- mov(FieldOperand(result, HeapObject::kMapOffset),
898
- Immediate(Factory::ascii_string_map()));
899
- mov(scratch1, length);
900
- SmiTag(scratch1);
901
- mov(FieldOperand(result, String::kLengthOffset), scratch1);
902
- mov(FieldOperand(result, String::kHashFieldOffset),
903
- Immediate(String::kEmptyHashField));
904
- }
905
-
906
-
907
- void MacroAssembler::AllocateAsciiString(Register result,
908
- int length,
909
- Register scratch1,
910
- Register scratch2,
911
- Label* gc_required) {
912
- ASSERT(length > 0);
913
-
914
- // Allocate ascii string in new space.
915
- AllocateInNewSpace(SeqAsciiString::SizeFor(length),
916
- result,
917
- scratch1,
918
- scratch2,
919
- gc_required,
920
- TAG_OBJECT);
921
-
922
- // Set the map, length and hash field.
923
- mov(FieldOperand(result, HeapObject::kMapOffset),
924
- Immediate(Factory::ascii_string_map()));
925
- mov(FieldOperand(result, String::kLengthOffset),
926
- Immediate(Smi::FromInt(length)));
927
- mov(FieldOperand(result, String::kHashFieldOffset),
928
- Immediate(String::kEmptyHashField));
929
- }
930
-
931
-
932
- void MacroAssembler::AllocateConsString(Register result,
933
- Register scratch1,
934
- Register scratch2,
935
- Label* gc_required) {
936
- // Allocate heap number in new space.
937
- AllocateInNewSpace(ConsString::kSize,
938
- result,
939
- scratch1,
940
- scratch2,
941
- gc_required,
942
- TAG_OBJECT);
943
-
944
- // Set the map. The other fields are left uninitialized.
945
- mov(FieldOperand(result, HeapObject::kMapOffset),
946
- Immediate(Factory::cons_string_map()));
947
- }
948
-
949
-
950
- void MacroAssembler::AllocateAsciiConsString(Register result,
951
- Register scratch1,
952
- Register scratch2,
953
- Label* gc_required) {
954
- // Allocate heap number in new space.
955
- AllocateInNewSpace(ConsString::kSize,
956
- result,
957
- scratch1,
958
- scratch2,
959
- gc_required,
960
- TAG_OBJECT);
961
-
962
- // Set the map. The other fields are left uninitialized.
963
- mov(FieldOperand(result, HeapObject::kMapOffset),
964
- Immediate(Factory::cons_ascii_string_map()));
965
- }
966
-
967
-
968
- // Copy memory, byte-by-byte, from source to destination. Not optimized for
969
- // long or aligned copies. The contents of scratch and length are destroyed.
970
- // Source and destination are incremented by length.
971
- // Many variants of movsb, loop unrolling, word moves, and indexed operands
972
- // have been tried here already, and this is fastest.
973
- // A simpler loop is faster on small copies, but 30% slower on large ones.
974
- // The cld() instruction must have been emitted, to set the direction flag(),
975
- // before calling this function.
976
- void MacroAssembler::CopyBytes(Register source,
977
- Register destination,
978
- Register length,
979
- Register scratch) {
980
- Label loop, done, short_string, short_loop;
981
- // Experimentation shows that the short string loop is faster if length < 10.
982
- cmp(Operand(length), Immediate(10));
983
- j(less_equal, &short_string);
984
-
985
- ASSERT(source.is(esi));
986
- ASSERT(destination.is(edi));
987
- ASSERT(length.is(ecx));
988
-
989
- // Because source is 4-byte aligned in our uses of this function,
990
- // we keep source aligned for the rep_movs call by copying the odd bytes
991
- // at the end of the ranges.
992
- mov(scratch, Operand(source, length, times_1, -4));
993
- mov(Operand(destination, length, times_1, -4), scratch);
994
- mov(scratch, ecx);
995
- shr(ecx, 2);
996
- rep_movs();
997
- and_(Operand(scratch), Immediate(0x3));
998
- add(destination, Operand(scratch));
999
- jmp(&done);
1000
-
1001
- bind(&short_string);
1002
- test(length, Operand(length));
1003
- j(zero, &done);
1004
-
1005
- bind(&short_loop);
1006
- mov_b(scratch, Operand(source, 0));
1007
- mov_b(Operand(destination, 0), scratch);
1008
- inc(source);
1009
- inc(destination);
1010
- dec(length);
1011
- j(not_zero, &short_loop);
1012
-
1013
- bind(&done);
1014
- }
1015
-
1016
-
1017
- void MacroAssembler::NegativeZeroTest(CodeGenerator* cgen,
1018
- Register result,
1019
- Register op,
1020
- JumpTarget* then_target) {
1021
- JumpTarget ok;
1022
- test(result, Operand(result));
1023
- ok.Branch(not_zero, taken);
1024
- test(op, Operand(op));
1025
- then_target->Branch(sign, not_taken);
1026
- ok.Bind();
1027
- }
1028
-
1029
-
1030
- void MacroAssembler::NegativeZeroTest(Register result,
1031
- Register op,
1032
- Label* then_label) {
1033
- Label ok;
1034
- test(result, Operand(result));
1035
- j(not_zero, &ok, taken);
1036
- test(op, Operand(op));
1037
- j(sign, then_label, not_taken);
1038
- bind(&ok);
1039
- }
1040
-
1041
-
1042
- void MacroAssembler::NegativeZeroTest(Register result,
1043
- Register op1,
1044
- Register op2,
1045
- Register scratch,
1046
- Label* then_label) {
1047
- Label ok;
1048
- test(result, Operand(result));
1049
- j(not_zero, &ok, taken);
1050
- mov(scratch, Operand(op1));
1051
- or_(scratch, Operand(op2));
1052
- j(sign, then_label, not_taken);
1053
- bind(&ok);
1054
- }
1055
-
1056
-
1057
- void MacroAssembler::TryGetFunctionPrototype(Register function,
1058
- Register result,
1059
- Register scratch,
1060
- Label* miss) {
1061
- // Check that the receiver isn't a smi.
1062
- test(function, Immediate(kSmiTagMask));
1063
- j(zero, miss, not_taken);
1064
-
1065
- // Check that the function really is a function.
1066
- CmpObjectType(function, JS_FUNCTION_TYPE, result);
1067
- j(not_equal, miss, not_taken);
1068
-
1069
- // Make sure that the function has an instance prototype.
1070
- Label non_instance;
1071
- movzx_b(scratch, FieldOperand(result, Map::kBitFieldOffset));
1072
- test(scratch, Immediate(1 << Map::kHasNonInstancePrototype));
1073
- j(not_zero, &non_instance, not_taken);
1074
-
1075
- // Get the prototype or initial map from the function.
1076
- mov(result,
1077
- FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
1078
-
1079
- // If the prototype or initial map is the hole, don't return it and
1080
- // simply miss the cache instead. This will allow us to allocate a
1081
- // prototype object on-demand in the runtime system.
1082
- cmp(Operand(result), Immediate(Factory::the_hole_value()));
1083
- j(equal, miss, not_taken);
1084
-
1085
- // If the function does not have an initial map, we're done.
1086
- Label done;
1087
- CmpObjectType(result, MAP_TYPE, scratch);
1088
- j(not_equal, &done);
1089
-
1090
- // Get the prototype from the initial map.
1091
- mov(result, FieldOperand(result, Map::kPrototypeOffset));
1092
- jmp(&done);
1093
-
1094
- // Non-instance prototype: Fetch prototype from constructor field
1095
- // in initial map.
1096
- bind(&non_instance);
1097
- mov(result, FieldOperand(result, Map::kConstructorOffset));
1098
-
1099
- // All done.
1100
- bind(&done);
1101
- }
1102
-
1103
-
1104
- void MacroAssembler::CallStub(CodeStub* stub) {
1105
- ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs.
1106
- call(stub->GetCode(), RelocInfo::CODE_TARGET);
1107
- }
1108
-
1109
-
1110
- MaybeObject* MacroAssembler::TryCallStub(CodeStub* stub) {
1111
- ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs.
1112
- Object* result;
1113
- { MaybeObject* maybe_result = stub->TryGetCode();
1114
- if (!maybe_result->ToObject(&result)) return maybe_result;
1115
- }
1116
- call(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET);
1117
- return result;
1118
- }
1119
-
1120
-
1121
- void MacroAssembler::TailCallStub(CodeStub* stub) {
1122
- ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs.
1123
- jmp(stub->GetCode(), RelocInfo::CODE_TARGET);
1124
- }
1125
-
1126
-
1127
- MaybeObject* MacroAssembler::TryTailCallStub(CodeStub* stub) {
1128
- ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs.
1129
- Object* result;
1130
- { MaybeObject* maybe_result = stub->TryGetCode();
1131
- if (!maybe_result->ToObject(&result)) return maybe_result;
1132
- }
1133
- jmp(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET);
1134
- return result;
1135
- }
1136
-
1137
-
1138
- void MacroAssembler::StubReturn(int argc) {
1139
- ASSERT(argc >= 1 && generating_stub());
1140
- ret((argc - 1) * kPointerSize);
1141
- }
1142
-
1143
-
1144
- void MacroAssembler::IllegalOperation(int num_arguments) {
1145
- if (num_arguments > 0) {
1146
- add(Operand(esp), Immediate(num_arguments * kPointerSize));
1147
- }
1148
- mov(eax, Immediate(Factory::undefined_value()));
1149
- }
1150
-
1151
-
1152
- void MacroAssembler::IndexFromHash(Register hash, Register index) {
1153
- // The assert checks that the constants for the maximum number of digits
1154
- // for an array index cached in the hash field and the number of bits
1155
- // reserved for it does not conflict.
1156
- ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) <
1157
- (1 << String::kArrayIndexValueBits));
1158
- // We want the smi-tagged index in key. kArrayIndexValueMask has zeros in
1159
- // the low kHashShift bits.
1160
- and_(hash, String::kArrayIndexValueMask);
1161
- STATIC_ASSERT(String::kHashShift >= kSmiTagSize && kSmiTag == 0);
1162
- if (String::kHashShift > kSmiTagSize) {
1163
- shr(hash, String::kHashShift - kSmiTagSize);
1164
- }
1165
- if (!index.is(hash)) {
1166
- mov(index, hash);
1167
- }
1168
- }
1169
-
1170
-
1171
- void MacroAssembler::CallRuntime(Runtime::FunctionId id, int num_arguments) {
1172
- CallRuntime(Runtime::FunctionForId(id), num_arguments);
1173
- }
1174
-
1175
-
1176
- void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) {
1177
- Runtime::Function* function = Runtime::FunctionForId(id);
1178
- Set(eax, Immediate(function->nargs));
1179
- mov(ebx, Immediate(ExternalReference(function)));
1180
- CEntryStub ces(1);
1181
- ces.SaveDoubles();
1182
- CallStub(&ces);
1183
- }
1184
-
1185
-
1186
- MaybeObject* MacroAssembler::TryCallRuntime(Runtime::FunctionId id,
1187
- int num_arguments) {
1188
- return TryCallRuntime(Runtime::FunctionForId(id), num_arguments);
1189
- }
1190
-
1191
-
1192
- void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) {
1193
- // If the expected number of arguments of the runtime function is
1194
- // constant, we check that the actual number of arguments match the
1195
- // expectation.
1196
- if (f->nargs >= 0 && f->nargs != num_arguments) {
1197
- IllegalOperation(num_arguments);
1198
- return;
1199
- }
1200
-
1201
- // TODO(1236192): Most runtime routines don't need the number of
1202
- // arguments passed in because it is constant. At some point we
1203
- // should remove this need and make the runtime routine entry code
1204
- // smarter.
1205
- Set(eax, Immediate(num_arguments));
1206
- mov(ebx, Immediate(ExternalReference(f)));
1207
- CEntryStub ces(1);
1208
- CallStub(&ces);
1209
- }
1210
-
1211
-
1212
- MaybeObject* MacroAssembler::TryCallRuntime(Runtime::Function* f,
1213
- int num_arguments) {
1214
- if (f->nargs >= 0 && f->nargs != num_arguments) {
1215
- IllegalOperation(num_arguments);
1216
- // Since we did not call the stub, there was no allocation failure.
1217
- // Return some non-failure object.
1218
- return Heap::undefined_value();
1219
- }
1220
-
1221
- // TODO(1236192): Most runtime routines don't need the number of
1222
- // arguments passed in because it is constant. At some point we
1223
- // should remove this need and make the runtime routine entry code
1224
- // smarter.
1225
- Set(eax, Immediate(num_arguments));
1226
- mov(ebx, Immediate(ExternalReference(f)));
1227
- CEntryStub ces(1);
1228
- return TryCallStub(&ces);
1229
- }
1230
-
1231
-
1232
- void MacroAssembler::CallExternalReference(ExternalReference ref,
1233
- int num_arguments) {
1234
- mov(eax, Immediate(num_arguments));
1235
- mov(ebx, Immediate(ref));
1236
-
1237
- CEntryStub stub(1);
1238
- CallStub(&stub);
1239
- }
1240
-
1241
-
1242
- void MacroAssembler::TailCallExternalReference(const ExternalReference& ext,
1243
- int num_arguments,
1244
- int result_size) {
1245
- // TODO(1236192): Most runtime routines don't need the number of
1246
- // arguments passed in because it is constant. At some point we
1247
- // should remove this need and make the runtime routine entry code
1248
- // smarter.
1249
- Set(eax, Immediate(num_arguments));
1250
- JumpToExternalReference(ext);
1251
- }
1252
-
1253
-
1254
- MaybeObject* MacroAssembler::TryTailCallExternalReference(
1255
- const ExternalReference& ext, int num_arguments, int result_size) {
1256
- // TODO(1236192): Most runtime routines don't need the number of
1257
- // arguments passed in because it is constant. At some point we
1258
- // should remove this need and make the runtime routine entry code
1259
- // smarter.
1260
- Set(eax, Immediate(num_arguments));
1261
- return TryJumpToExternalReference(ext);
1262
- }
1263
-
1264
-
1265
- void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
1266
- int num_arguments,
1267
- int result_size) {
1268
- TailCallExternalReference(ExternalReference(fid), num_arguments, result_size);
1269
- }
1270
-
1271
-
1272
- MaybeObject* MacroAssembler::TryTailCallRuntime(Runtime::FunctionId fid,
1273
- int num_arguments,
1274
- int result_size) {
1275
- return TryTailCallExternalReference(
1276
- ExternalReference(fid), num_arguments, result_size);
1277
- }
1278
-
1279
-
1280
- // If true, a Handle<T> returned by value from a function with cdecl calling
1281
- // convention will be returned directly as a value of location_ field in a
1282
- // register eax.
1283
- // If false, it is returned as a pointer to a preallocated by caller memory
1284
- // region. Pointer to this region should be passed to a function as an
1285
- // implicit first argument.
1286
- #if defined(USING_BSD_ABI) || defined(__MINGW32__) || defined(__CYGWIN__)
1287
- static const bool kReturnHandlesDirectly = true;
1288
- #else
1289
- static const bool kReturnHandlesDirectly = false;
1290
- #endif
1291
-
1292
-
1293
- Operand ApiParameterOperand(int index) {
1294
- return Operand(
1295
- esp, (index + (kReturnHandlesDirectly ? 0 : 1)) * kPointerSize);
1296
- }
1297
-
1298
-
1299
- void MacroAssembler::PrepareCallApiFunction(int argc, Register scratch) {
1300
- if (kReturnHandlesDirectly) {
1301
- EnterApiExitFrame(argc);
1302
- // When handles are returned directly we don't have to allocate extra
1303
- // space for and pass an out parameter.
1304
- } else {
1305
- // We allocate two additional slots: return value and pointer to it.
1306
- EnterApiExitFrame(argc + 2);
1307
-
1308
- // The argument slots are filled as follows:
1309
- //
1310
- // n + 1: output cell
1311
- // n: arg n
1312
- // ...
1313
- // 1: arg1
1314
- // 0: pointer to the output cell
1315
- //
1316
- // Note that this is one more "argument" than the function expects
1317
- // so the out cell will have to be popped explicitly after returning
1318
- // from the function. The out cell contains Handle.
1319
-
1320
- // pointer to out cell.
1321
- lea(scratch, Operand(esp, (argc + 1) * kPointerSize));
1322
- mov(Operand(esp, 0 * kPointerSize), scratch); // output.
1323
- if (FLAG_debug_code) {
1324
- mov(Operand(esp, (argc + 1) * kPointerSize), Immediate(0)); // out cell.
1325
- }
1326
- }
1327
- }
1328
-
1329
-
1330
- MaybeObject* MacroAssembler::TryCallApiFunctionAndReturn(ApiFunction* function,
1331
- int stack_space) {
1332
- ExternalReference next_address =
1333
- ExternalReference::handle_scope_next_address();
1334
- ExternalReference limit_address =
1335
- ExternalReference::handle_scope_limit_address();
1336
- ExternalReference level_address =
1337
- ExternalReference::handle_scope_level_address();
1338
-
1339
- // Allocate HandleScope in callee-save registers.
1340
- mov(ebx, Operand::StaticVariable(next_address));
1341
- mov(edi, Operand::StaticVariable(limit_address));
1342
- add(Operand::StaticVariable(level_address), Immediate(1));
1343
-
1344
- // Call the api function!
1345
- call(function->address(), RelocInfo::RUNTIME_ENTRY);
1346
-
1347
- if (!kReturnHandlesDirectly) {
1348
- // The returned value is a pointer to the handle holding the result.
1349
- // Dereference this to get to the location.
1350
- mov(eax, Operand(eax, 0));
1351
- }
1352
-
1353
- Label empty_handle;
1354
- Label prologue;
1355
- Label promote_scheduled_exception;
1356
- Label delete_allocated_handles;
1357
- Label leave_exit_frame;
1358
-
1359
- // Check if the result handle holds 0.
1360
- test(eax, Operand(eax));
1361
- j(zero, &empty_handle, not_taken);
1362
- // It was non-zero. Dereference to get the result value.
1363
- mov(eax, Operand(eax, 0));
1364
- bind(&prologue);
1365
- // No more valid handles (the result handle was the last one). Restore
1366
- // previous handle scope.
1367
- mov(Operand::StaticVariable(next_address), ebx);
1368
- sub(Operand::StaticVariable(level_address), Immediate(1));
1369
- Assert(above_equal, "Invalid HandleScope level");
1370
- cmp(edi, Operand::StaticVariable(limit_address));
1371
- j(not_equal, &delete_allocated_handles, not_taken);
1372
- bind(&leave_exit_frame);
1373
-
1374
- // Check if the function scheduled an exception.
1375
- ExternalReference scheduled_exception_address =
1376
- ExternalReference::scheduled_exception_address();
1377
- cmp(Operand::StaticVariable(scheduled_exception_address),
1378
- Immediate(Factory::the_hole_value()));
1379
- j(not_equal, &promote_scheduled_exception, not_taken);
1380
- LeaveApiExitFrame();
1381
- ret(stack_space * kPointerSize);
1382
- bind(&promote_scheduled_exception);
1383
- MaybeObject* result =
1384
- TryTailCallRuntime(Runtime::kPromoteScheduledException, 0, 1);
1385
- if (result->IsFailure()) {
1386
- return result;
1387
- }
1388
- bind(&empty_handle);
1389
- // It was zero; the result is undefined.
1390
- mov(eax, Factory::undefined_value());
1391
- jmp(&prologue);
1392
-
1393
- // HandleScope limit has changed. Delete allocated extensions.
1394
- bind(&delete_allocated_handles);
1395
- mov(Operand::StaticVariable(limit_address), edi);
1396
- mov(edi, eax);
1397
- mov(eax, Immediate(ExternalReference::delete_handle_scope_extensions()));
1398
- call(Operand(eax));
1399
- mov(eax, edi);
1400
- jmp(&leave_exit_frame);
1401
-
1402
- return result;
1403
- }
1404
-
1405
-
1406
- void MacroAssembler::JumpToExternalReference(const ExternalReference& ext) {
1407
- // Set the entry point and jump to the C entry runtime stub.
1408
- mov(ebx, Immediate(ext));
1409
- CEntryStub ces(1);
1410
- jmp(ces.GetCode(), RelocInfo::CODE_TARGET);
1411
- }
1412
-
1413
-
1414
- MaybeObject* MacroAssembler::TryJumpToExternalReference(
1415
- const ExternalReference& ext) {
1416
- // Set the entry point and jump to the C entry runtime stub.
1417
- mov(ebx, Immediate(ext));
1418
- CEntryStub ces(1);
1419
- return TryTailCallStub(&ces);
1420
- }
1421
-
1422
-
1423
- void MacroAssembler::InvokePrologue(const ParameterCount& expected,
1424
- const ParameterCount& actual,
1425
- Handle<Code> code_constant,
1426
- const Operand& code_operand,
1427
- Label* done,
1428
- InvokeFlag flag,
1429
- PostCallGenerator* post_call_generator) {
1430
- bool definitely_matches = false;
1431
- Label invoke;
1432
- if (expected.is_immediate()) {
1433
- ASSERT(actual.is_immediate());
1434
- if (expected.immediate() == actual.immediate()) {
1435
- definitely_matches = true;
1436
- } else {
1437
- mov(eax, actual.immediate());
1438
- const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel;
1439
- if (expected.immediate() == sentinel) {
1440
- // Don't worry about adapting arguments for builtins that
1441
- // don't want that done. Skip adaption code by making it look
1442
- // like we have a match between expected and actual number of
1443
- // arguments.
1444
- definitely_matches = true;
1445
- } else {
1446
- mov(ebx, expected.immediate());
1447
- }
1448
- }
1449
- } else {
1450
- if (actual.is_immediate()) {
1451
- // Expected is in register, actual is immediate. This is the
1452
- // case when we invoke function values without going through the
1453
- // IC mechanism.
1454
- cmp(expected.reg(), actual.immediate());
1455
- j(equal, &invoke);
1456
- ASSERT(expected.reg().is(ebx));
1457
- mov(eax, actual.immediate());
1458
- } else if (!expected.reg().is(actual.reg())) {
1459
- // Both expected and actual are in (different) registers. This
1460
- // is the case when we invoke functions using call and apply.
1461
- cmp(expected.reg(), Operand(actual.reg()));
1462
- j(equal, &invoke);
1463
- ASSERT(actual.reg().is(eax));
1464
- ASSERT(expected.reg().is(ebx));
1465
- }
1466
- }
1467
-
1468
- if (!definitely_matches) {
1469
- Handle<Code> adaptor =
1470
- Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline));
1471
- if (!code_constant.is_null()) {
1472
- mov(edx, Immediate(code_constant));
1473
- add(Operand(edx), Immediate(Code::kHeaderSize - kHeapObjectTag));
1474
- } else if (!code_operand.is_reg(edx)) {
1475
- mov(edx, code_operand);
1476
- }
1477
-
1478
- if (flag == CALL_FUNCTION) {
1479
- call(adaptor, RelocInfo::CODE_TARGET);
1480
- if (post_call_generator != NULL) post_call_generator->Generate();
1481
- jmp(done);
1482
- } else {
1483
- jmp(adaptor, RelocInfo::CODE_TARGET);
1484
- }
1485
- bind(&invoke);
1486
- }
1487
- }
1488
-
1489
-
1490
- void MacroAssembler::InvokeCode(const Operand& code,
1491
- const ParameterCount& expected,
1492
- const ParameterCount& actual,
1493
- InvokeFlag flag,
1494
- PostCallGenerator* post_call_generator) {
1495
- Label done;
1496
- InvokePrologue(expected, actual, Handle<Code>::null(), code,
1497
- &done, flag, post_call_generator);
1498
- if (flag == CALL_FUNCTION) {
1499
- call(code);
1500
- if (post_call_generator != NULL) post_call_generator->Generate();
1501
- } else {
1502
- ASSERT(flag == JUMP_FUNCTION);
1503
- jmp(code);
1504
- }
1505
- bind(&done);
1506
- }
1507
-
1508
-
1509
- void MacroAssembler::InvokeCode(Handle<Code> code,
1510
- const ParameterCount& expected,
1511
- const ParameterCount& actual,
1512
- RelocInfo::Mode rmode,
1513
- InvokeFlag flag,
1514
- PostCallGenerator* post_call_generator) {
1515
- Label done;
1516
- Operand dummy(eax);
1517
- InvokePrologue(expected, actual, code, dummy, &done,
1518
- flag, post_call_generator);
1519
- if (flag == CALL_FUNCTION) {
1520
- call(code, rmode);
1521
- if (post_call_generator != NULL) post_call_generator->Generate();
1522
- } else {
1523
- ASSERT(flag == JUMP_FUNCTION);
1524
- jmp(code, rmode);
1525
- }
1526
- bind(&done);
1527
- }
1528
-
1529
-
1530
- void MacroAssembler::InvokeFunction(Register fun,
1531
- const ParameterCount& actual,
1532
- InvokeFlag flag,
1533
- PostCallGenerator* post_call_generator) {
1534
- ASSERT(fun.is(edi));
1535
- mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
1536
- mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
1537
- mov(ebx, FieldOperand(edx, SharedFunctionInfo::kFormalParameterCountOffset));
1538
- SmiUntag(ebx);
1539
-
1540
- ParameterCount expected(ebx);
1541
- InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
1542
- expected, actual, flag, post_call_generator);
1543
- }
1544
-
1545
-
1546
- void MacroAssembler::InvokeFunction(JSFunction* function,
1547
- const ParameterCount& actual,
1548
- InvokeFlag flag,
1549
- PostCallGenerator* post_call_generator) {
1550
- ASSERT(function->is_compiled());
1551
- // Get the function and setup the context.
1552
- mov(edi, Immediate(Handle<JSFunction>(function)));
1553
- mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
1554
-
1555
- ParameterCount expected(function->shared()->formal_parameter_count());
1556
- if (V8::UseCrankshaft()) {
1557
- // TODO(kasperl): For now, we always call indirectly through the
1558
- // code field in the function to allow recompilation to take effect
1559
- // without changing any of the call sites.
1560
- InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
1561
- expected, actual, flag, post_call_generator);
1562
- } else {
1563
- Handle<Code> code(function->code());
1564
- InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET,
1565
- flag, post_call_generator);
1566
- }
1567
- }
1568
-
1569
-
1570
- void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
1571
- InvokeFlag flag,
1572
- PostCallGenerator* post_call_generator) {
1573
- // Calls are not allowed in some stubs.
1574
- ASSERT(flag == JUMP_FUNCTION || allow_stub_calls());
1575
-
1576
- // Rely on the assertion to check that the number of provided
1577
- // arguments match the expected number of arguments. Fake a
1578
- // parameter count to avoid emitting code to do the check.
1579
- ParameterCount expected(0);
1580
- GetBuiltinFunction(edi, id);
1581
- InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
1582
- expected, expected, flag, post_call_generator);
1583
- }
1584
-
1585
- void MacroAssembler::GetBuiltinFunction(Register target,
1586
- Builtins::JavaScript id) {
1587
- // Load the JavaScript builtin function from the builtins object.
1588
- mov(target, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)));
1589
- mov(target, FieldOperand(target, GlobalObject::kBuiltinsOffset));
1590
- mov(target, FieldOperand(target,
1591
- JSBuiltinsObject::OffsetOfFunctionWithId(id)));
1592
- }
1593
-
1594
- void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) {
1595
- ASSERT(!target.is(edi));
1596
- // Load the JavaScript builtin function from the builtins object.
1597
- GetBuiltinFunction(edi, id);
1598
- // Load the code entry point from the function into the target register.
1599
- mov(target, FieldOperand(edi, JSFunction::kCodeEntryOffset));
1600
- }
1601
-
1602
-
1603
- void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
1604
- if (context_chain_length > 0) {
1605
- // Move up the chain of contexts to the context containing the slot.
1606
- mov(dst, Operand(esi, Context::SlotOffset(Context::CLOSURE_INDEX)));
1607
- // Load the function context (which is the incoming, outer context).
1608
- mov(dst, FieldOperand(dst, JSFunction::kContextOffset));
1609
- for (int i = 1; i < context_chain_length; i++) {
1610
- mov(dst, Operand(dst, Context::SlotOffset(Context::CLOSURE_INDEX)));
1611
- mov(dst, FieldOperand(dst, JSFunction::kContextOffset));
1612
- }
1613
- } else {
1614
- // Slot is in the current function context. Move it into the
1615
- // destination register in case we store into it (the write barrier
1616
- // cannot be allowed to destroy the context in esi).
1617
- mov(dst, esi);
1618
- }
1619
-
1620
- // We should not have found a 'with' context by walking the context chain
1621
- // (i.e., the static scope chain and runtime context chain do not agree).
1622
- // A variable occurring in such a scope should have slot type LOOKUP and
1623
- // not CONTEXT.
1624
- if (FLAG_debug_code) {
1625
- cmp(dst, Operand(dst, Context::SlotOffset(Context::FCONTEXT_INDEX)));
1626
- Check(equal, "Yo dawg, I heard you liked function contexts "
1627
- "so I put function contexts in all your contexts");
1628
- }
1629
- }
1630
-
1631
-
1632
- void MacroAssembler::LoadGlobalFunction(int index, Register function) {
1633
- // Load the global or builtins object from the current context.
1634
- mov(function, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)));
1635
- // Load the global context from the global or builtins object.
1636
- mov(function, FieldOperand(function, GlobalObject::kGlobalContextOffset));
1637
- // Load the function from the global context.
1638
- mov(function, Operand(function, Context::SlotOffset(index)));
1639
- }
1640
-
1641
-
1642
- void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
1643
- Register map) {
1644
- // Load the initial map. The global functions all have initial maps.
1645
- mov(map, FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
1646
- if (FLAG_debug_code) {
1647
- Label ok, fail;
1648
- CheckMap(map, Factory::meta_map(), &fail, false);
1649
- jmp(&ok);
1650
- bind(&fail);
1651
- Abort("Global functions must have initial map");
1652
- bind(&ok);
1653
- }
1654
- }
1655
-
1656
-
1657
- // Store the value in register src in the safepoint register stack
1658
- // slot for register dst.
1659
- void MacroAssembler::StoreToSafepointRegisterSlot(Register dst, Register src) {
1660
- mov(SafepointRegisterSlot(dst), src);
1661
- }
1662
-
1663
-
1664
- void MacroAssembler::StoreToSafepointRegisterSlot(Register dst, Immediate src) {
1665
- mov(SafepointRegisterSlot(dst), src);
1666
- }
1667
-
1668
-
1669
- void MacroAssembler::LoadFromSafepointRegisterSlot(Register dst, Register src) {
1670
- mov(dst, SafepointRegisterSlot(src));
1671
- }
1672
-
1673
-
1674
- Operand MacroAssembler::SafepointRegisterSlot(Register reg) {
1675
- return Operand(esp, SafepointRegisterStackIndex(reg.code()) * kPointerSize);
1676
- }
1677
-
1678
-
1679
- int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
1680
- // The registers are pushed starting with the lowest encoding,
1681
- // which means that lowest encodings are furthest away from
1682
- // the stack pointer.
1683
- ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters);
1684
- return kNumSafepointRegisters - reg_code - 1;
1685
- }
1686
-
1687
-
1688
- void MacroAssembler::Ret() {
1689
- ret(0);
1690
- }
1691
-
1692
-
1693
- void MacroAssembler::Ret(int bytes_dropped, Register scratch) {
1694
- if (is_uint16(bytes_dropped)) {
1695
- ret(bytes_dropped);
1696
- } else {
1697
- pop(scratch);
1698
- add(Operand(esp), Immediate(bytes_dropped));
1699
- push(scratch);
1700
- ret(0);
1701
- }
1702
- }
1703
-
1704
-
1705
-
1706
-
1707
- void MacroAssembler::Drop(int stack_elements) {
1708
- if (stack_elements > 0) {
1709
- add(Operand(esp), Immediate(stack_elements * kPointerSize));
1710
- }
1711
- }
1712
-
1713
-
1714
- void MacroAssembler::Move(Register dst, Register src) {
1715
- if (!dst.is(src)) {
1716
- mov(dst, src);
1717
- }
1718
- }
1719
-
1720
-
1721
- void MacroAssembler::Move(Register dst, Handle<Object> value) {
1722
- mov(dst, value);
1723
- }
1724
-
1725
-
1726
- void MacroAssembler::SetCounter(StatsCounter* counter, int value) {
1727
- if (FLAG_native_code_counters && counter->Enabled()) {
1728
- mov(Operand::StaticVariable(ExternalReference(counter)), Immediate(value));
1729
- }
1730
- }
1731
-
1732
-
1733
- void MacroAssembler::IncrementCounter(StatsCounter* counter, int value) {
1734
- ASSERT(value > 0);
1735
- if (FLAG_native_code_counters && counter->Enabled()) {
1736
- Operand operand = Operand::StaticVariable(ExternalReference(counter));
1737
- if (value == 1) {
1738
- inc(operand);
1739
- } else {
1740
- add(operand, Immediate(value));
1741
- }
1742
- }
1743
- }
1744
-
1745
-
1746
- void MacroAssembler::DecrementCounter(StatsCounter* counter, int value) {
1747
- ASSERT(value > 0);
1748
- if (FLAG_native_code_counters && counter->Enabled()) {
1749
- Operand operand = Operand::StaticVariable(ExternalReference(counter));
1750
- if (value == 1) {
1751
- dec(operand);
1752
- } else {
1753
- sub(operand, Immediate(value));
1754
- }
1755
- }
1756
- }
1757
-
1758
-
1759
- void MacroAssembler::IncrementCounter(Condition cc,
1760
- StatsCounter* counter,
1761
- int value) {
1762
- ASSERT(value > 0);
1763
- if (FLAG_native_code_counters && counter->Enabled()) {
1764
- Label skip;
1765
- j(NegateCondition(cc), &skip);
1766
- pushfd();
1767
- IncrementCounter(counter, value);
1768
- popfd();
1769
- bind(&skip);
1770
- }
1771
- }
1772
-
1773
-
1774
- void MacroAssembler::DecrementCounter(Condition cc,
1775
- StatsCounter* counter,
1776
- int value) {
1777
- ASSERT(value > 0);
1778
- if (FLAG_native_code_counters && counter->Enabled()) {
1779
- Label skip;
1780
- j(NegateCondition(cc), &skip);
1781
- pushfd();
1782
- DecrementCounter(counter, value);
1783
- popfd();
1784
- bind(&skip);
1785
- }
1786
- }
1787
-
1788
-
1789
- void MacroAssembler::Assert(Condition cc, const char* msg) {
1790
- if (FLAG_debug_code) Check(cc, msg);
1791
- }
1792
-
1793
-
1794
- void MacroAssembler::AssertFastElements(Register elements) {
1795
- if (FLAG_debug_code) {
1796
- Label ok;
1797
- cmp(FieldOperand(elements, HeapObject::kMapOffset),
1798
- Immediate(Factory::fixed_array_map()));
1799
- j(equal, &ok);
1800
- cmp(FieldOperand(elements, HeapObject::kMapOffset),
1801
- Immediate(Factory::fixed_cow_array_map()));
1802
- j(equal, &ok);
1803
- Abort("JSObject with fast elements map has slow elements");
1804
- bind(&ok);
1805
- }
1806
- }
1807
-
1808
-
1809
- void MacroAssembler::Check(Condition cc, const char* msg) {
1810
- Label L;
1811
- j(cc, &L, taken);
1812
- Abort(msg);
1813
- // will not return here
1814
- bind(&L);
1815
- }
1816
-
1817
-
1818
- void MacroAssembler::CheckStackAlignment() {
1819
- int frame_alignment = OS::ActivationFrameAlignment();
1820
- int frame_alignment_mask = frame_alignment - 1;
1821
- if (frame_alignment > kPointerSize) {
1822
- ASSERT(IsPowerOf2(frame_alignment));
1823
- Label alignment_as_expected;
1824
- test(esp, Immediate(frame_alignment_mask));
1825
- j(zero, &alignment_as_expected);
1826
- // Abort if stack is not aligned.
1827
- int3();
1828
- bind(&alignment_as_expected);
1829
- }
1830
- }
1831
-
1832
-
1833
- void MacroAssembler::Abort(const char* msg) {
1834
- // We want to pass the msg string like a smi to avoid GC
1835
- // problems, however msg is not guaranteed to be aligned
1836
- // properly. Instead, we pass an aligned pointer that is
1837
- // a proper v8 smi, but also pass the alignment difference
1838
- // from the real pointer as a smi.
1839
- intptr_t p1 = reinterpret_cast<intptr_t>(msg);
1840
- intptr_t p0 = (p1 & ~kSmiTagMask) + kSmiTag;
1841
- ASSERT(reinterpret_cast<Object*>(p0)->IsSmi());
1842
- #ifdef DEBUG
1843
- if (msg != NULL) {
1844
- RecordComment("Abort message: ");
1845
- RecordComment(msg);
1846
- }
1847
- #endif
1848
- // Disable stub call restrictions to always allow calls to abort.
1849
- AllowStubCallsScope allow_scope(this, true);
1850
-
1851
- push(eax);
1852
- push(Immediate(p0));
1853
- push(Immediate(reinterpret_cast<intptr_t>(Smi::FromInt(p1 - p0))));
1854
- CallRuntime(Runtime::kAbort, 2);
1855
- // will not return here
1856
- int3();
1857
- }
1858
-
1859
-
1860
- void MacroAssembler::JumpIfNotNumber(Register reg,
1861
- TypeInfo info,
1862
- Label* on_not_number) {
1863
- if (FLAG_debug_code) AbortIfSmi(reg);
1864
- if (!info.IsNumber()) {
1865
- cmp(FieldOperand(reg, HeapObject::kMapOffset),
1866
- Factory::heap_number_map());
1867
- j(not_equal, on_not_number);
1868
- }
1869
- }
1870
-
1871
-
1872
- void MacroAssembler::ConvertToInt32(Register dst,
1873
- Register source,
1874
- Register scratch,
1875
- TypeInfo info,
1876
- Label* on_not_int32) {
1877
- if (FLAG_debug_code) {
1878
- AbortIfSmi(source);
1879
- AbortIfNotNumber(source);
1880
- }
1881
- if (info.IsInteger32()) {
1882
- cvttsd2si(dst, FieldOperand(source, HeapNumber::kValueOffset));
1883
- } else {
1884
- Label done;
1885
- bool push_pop = (scratch.is(no_reg) && dst.is(source));
1886
- ASSERT(!scratch.is(source));
1887
- if (push_pop) {
1888
- push(dst);
1889
- scratch = dst;
1890
- }
1891
- if (scratch.is(no_reg)) scratch = dst;
1892
- cvttsd2si(scratch, FieldOperand(source, HeapNumber::kValueOffset));
1893
- cmp(scratch, 0x80000000u);
1894
- if (push_pop) {
1895
- j(not_equal, &done);
1896
- pop(dst);
1897
- jmp(on_not_int32);
1898
- } else {
1899
- j(equal, on_not_int32);
1900
- }
1901
-
1902
- bind(&done);
1903
- if (push_pop) {
1904
- add(Operand(esp), Immediate(kPointerSize)); // Pop.
1905
- }
1906
- if (!scratch.is(dst)) {
1907
- mov(dst, scratch);
1908
- }
1909
- }
1910
- }
1911
-
1912
-
1913
- void MacroAssembler::LoadPowerOf2(XMMRegister dst,
1914
- Register scratch,
1915
- int power) {
1916
- ASSERT(is_uintn(power + HeapNumber::kExponentBias,
1917
- HeapNumber::kExponentBits));
1918
- mov(scratch, Immediate(power + HeapNumber::kExponentBias));
1919
- movd(dst, Operand(scratch));
1920
- psllq(dst, HeapNumber::kMantissaBits);
1921
- }
1922
-
1923
-
1924
- void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(
1925
- Register instance_type,
1926
- Register scratch,
1927
- Label* failure) {
1928
- if (!scratch.is(instance_type)) {
1929
- mov(scratch, instance_type);
1930
- }
1931
- and_(scratch,
1932
- kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask);
1933
- cmp(scratch, kStringTag | kSeqStringTag | kAsciiStringTag);
1934
- j(not_equal, failure);
1935
- }
1936
-
1937
-
1938
- void MacroAssembler::JumpIfNotBothSequentialAsciiStrings(Register object1,
1939
- Register object2,
1940
- Register scratch1,
1941
- Register scratch2,
1942
- Label* failure) {
1943
- // Check that both objects are not smis.
1944
- ASSERT_EQ(0, kSmiTag);
1945
- mov(scratch1, Operand(object1));
1946
- and_(scratch1, Operand(object2));
1947
- test(scratch1, Immediate(kSmiTagMask));
1948
- j(zero, failure);
1949
-
1950
- // Load instance type for both strings.
1951
- mov(scratch1, FieldOperand(object1, HeapObject::kMapOffset));
1952
- mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset));
1953
- movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset));
1954
- movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset));
1955
-
1956
- // Check that both are flat ascii strings.
1957
- const int kFlatAsciiStringMask =
1958
- kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
1959
- const int kFlatAsciiStringTag = ASCII_STRING_TYPE;
1960
- // Interleave bits from both instance types and compare them in one check.
1961
- ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3));
1962
- and_(scratch1, kFlatAsciiStringMask);
1963
- and_(scratch2, kFlatAsciiStringMask);
1964
- lea(scratch1, Operand(scratch1, scratch2, times_8, 0));
1965
- cmp(scratch1, kFlatAsciiStringTag | (kFlatAsciiStringTag << 3));
1966
- j(not_equal, failure);
1967
- }
1968
-
1969
-
1970
- void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) {
1971
- int frameAlignment = OS::ActivationFrameAlignment();
1972
- if (frameAlignment != 0) {
1973
- // Make stack end at alignment and make room for num_arguments words
1974
- // and the original value of esp.
1975
- mov(scratch, esp);
1976
- sub(Operand(esp), Immediate((num_arguments + 1) * kPointerSize));
1977
- ASSERT(IsPowerOf2(frameAlignment));
1978
- and_(esp, -frameAlignment);
1979
- mov(Operand(esp, num_arguments * kPointerSize), scratch);
1980
- } else {
1981
- sub(Operand(esp), Immediate(num_arguments * kPointerSize));
1982
- }
1983
- }
1984
-
1985
-
1986
- void MacroAssembler::CallCFunction(ExternalReference function,
1987
- int num_arguments) {
1988
- // Trashing eax is ok as it will be the return value.
1989
- mov(Operand(eax), Immediate(function));
1990
- CallCFunction(eax, num_arguments);
1991
- }
1992
-
1993
-
1994
- void MacroAssembler::CallCFunction(Register function,
1995
- int num_arguments) {
1996
- // Check stack alignment.
1997
- if (FLAG_debug_code) {
1998
- CheckStackAlignment();
1999
- }
2000
-
2001
- call(Operand(function));
2002
- if (OS::ActivationFrameAlignment() != 0) {
2003
- mov(esp, Operand(esp, num_arguments * kPointerSize));
2004
- } else {
2005
- add(Operand(esp), Immediate(num_arguments * sizeof(int32_t)));
2006
- }
2007
- }
2008
-
2009
-
2010
- CodePatcher::CodePatcher(byte* address, int size)
2011
- : address_(address), size_(size), masm_(address, size + Assembler::kGap) {
2012
- // Create a new macro assembler pointing to the address of the code to patch.
2013
- // The size is adjusted with kGap on order for the assembler to generate size
2014
- // bytes of instructions without failing with buffer size constraints.
2015
- ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2016
- }
2017
-
2018
-
2019
- CodePatcher::~CodePatcher() {
2020
- // Indicate that code has changed.
2021
- CPU::FlushICache(address_, size_);
2022
-
2023
- // Check that the code was patched as expected.
2024
- ASSERT(masm_.pc_ == address_ + size_);
2025
- ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2026
- }
2027
-
2028
-
2029
- } } // namespace v8::internal
2030
-
2031
- #endif // V8_TARGET_ARCH_IA32