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,2701 +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 <limits.h> // For LONG_MIN, LONG_MAX.
29
-
30
- #include "v8.h"
31
-
32
- #if defined(V8_TARGET_ARCH_ARM)
33
-
34
- #include "bootstrapper.h"
35
- #include "codegen-inl.h"
36
- #include "debug.h"
37
- #include "runtime.h"
38
-
39
- namespace v8 {
40
- namespace internal {
41
-
42
- MacroAssembler::MacroAssembler(void* buffer, int size)
43
- : Assembler(buffer, size),
44
- generating_stub_(false),
45
- allow_stub_calls_(true),
46
- code_object_(Heap::undefined_value()) {
47
- }
48
-
49
-
50
- // We always generate arm code, never thumb code, even if V8 is compiled to
51
- // thumb, so we require inter-working support
52
- #if defined(__thumb__) && !defined(USE_THUMB_INTERWORK)
53
- #error "flag -mthumb-interwork missing"
54
- #endif
55
-
56
-
57
- // We do not support thumb inter-working with an arm architecture not supporting
58
- // the blx instruction (below v5t). If you know what CPU you are compiling for
59
- // you can use -march=armv7 or similar.
60
- #if defined(USE_THUMB_INTERWORK) && !defined(CAN_USE_THUMB_INSTRUCTIONS)
61
- # error "For thumb inter-working we require an architecture which supports blx"
62
- #endif
63
-
64
-
65
- // Using bx does not yield better code, so use it only when required
66
- #if defined(USE_THUMB_INTERWORK)
67
- #define USE_BX 1
68
- #endif
69
-
70
-
71
- void MacroAssembler::Jump(Register target, Condition cond) {
72
- #if USE_BX
73
- bx(target, cond);
74
- #else
75
- mov(pc, Operand(target), LeaveCC, cond);
76
- #endif
77
- }
78
-
79
-
80
- void MacroAssembler::Jump(intptr_t target, RelocInfo::Mode rmode,
81
- Condition cond) {
82
- #if USE_BX
83
- mov(ip, Operand(target, rmode), LeaveCC, cond);
84
- bx(ip, cond);
85
- #else
86
- mov(pc, Operand(target, rmode), LeaveCC, cond);
87
- #endif
88
- }
89
-
90
-
91
- void MacroAssembler::Jump(byte* target, RelocInfo::Mode rmode,
92
- Condition cond) {
93
- ASSERT(!RelocInfo::IsCodeTarget(rmode));
94
- Jump(reinterpret_cast<intptr_t>(target), rmode, cond);
95
- }
96
-
97
-
98
- void MacroAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
99
- Condition cond) {
100
- ASSERT(RelocInfo::IsCodeTarget(rmode));
101
- // 'code' is always generated ARM code, never THUMB code
102
- Jump(reinterpret_cast<intptr_t>(code.location()), rmode, cond);
103
- }
104
-
105
-
106
- void MacroAssembler::Call(Register target, Condition cond) {
107
- #if USE_BLX
108
- blx(target, cond);
109
- #else
110
- // set lr for return at current pc + 8
111
- mov(lr, Operand(pc), LeaveCC, cond);
112
- mov(pc, Operand(target), LeaveCC, cond);
113
- #endif
114
- }
115
-
116
-
117
- void MacroAssembler::Call(intptr_t target, RelocInfo::Mode rmode,
118
- Condition cond) {
119
- #if USE_BLX
120
- // On ARMv5 and after the recommended call sequence is:
121
- // ldr ip, [pc, #...]
122
- // blx ip
123
-
124
- // The two instructions (ldr and blx) could be separated by a constant
125
- // pool and the code would still work. The issue comes from the
126
- // patching code which expect the ldr to be just above the blx.
127
- { BlockConstPoolScope block_const_pool(this);
128
- // Statement positions are expected to be recorded when the target
129
- // address is loaded. The mov method will automatically record
130
- // positions when pc is the target, since this is not the case here
131
- // we have to do it explicitly.
132
- positions_recorder()->WriteRecordedPositions();
133
-
134
- mov(ip, Operand(target, rmode), LeaveCC, cond);
135
- blx(ip, cond);
136
- }
137
-
138
- ASSERT(kCallTargetAddressOffset == 2 * kInstrSize);
139
- #else
140
- // Set lr for return at current pc + 8.
141
- mov(lr, Operand(pc), LeaveCC, cond);
142
- // Emit a ldr<cond> pc, [pc + offset of target in constant pool].
143
- mov(pc, Operand(target, rmode), LeaveCC, cond);
144
-
145
- ASSERT(kCallTargetAddressOffset == kInstrSize);
146
- #endif
147
- }
148
-
149
-
150
- void MacroAssembler::Call(byte* target, RelocInfo::Mode rmode,
151
- Condition cond) {
152
- ASSERT(!RelocInfo::IsCodeTarget(rmode));
153
- Call(reinterpret_cast<intptr_t>(target), rmode, cond);
154
- }
155
-
156
-
157
- void MacroAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode,
158
- Condition cond) {
159
- ASSERT(RelocInfo::IsCodeTarget(rmode));
160
- // 'code' is always generated ARM code, never THUMB code
161
- Call(reinterpret_cast<intptr_t>(code.location()), rmode, cond);
162
- }
163
-
164
-
165
- void MacroAssembler::Ret(Condition cond) {
166
- #if USE_BX
167
- bx(lr, cond);
168
- #else
169
- mov(pc, Operand(lr), LeaveCC, cond);
170
- #endif
171
- }
172
-
173
-
174
- void MacroAssembler::Drop(int count, Condition cond) {
175
- if (count > 0) {
176
- add(sp, sp, Operand(count * kPointerSize), LeaveCC, cond);
177
- }
178
- }
179
-
180
-
181
- void MacroAssembler::Ret(int drop, Condition cond) {
182
- Drop(drop, cond);
183
- Ret(cond);
184
- }
185
-
186
-
187
- void MacroAssembler::Swap(Register reg1,
188
- Register reg2,
189
- Register scratch,
190
- Condition cond) {
191
- if (scratch.is(no_reg)) {
192
- eor(reg1, reg1, Operand(reg2), LeaveCC, cond);
193
- eor(reg2, reg2, Operand(reg1), LeaveCC, cond);
194
- eor(reg1, reg1, Operand(reg2), LeaveCC, cond);
195
- } else {
196
- mov(scratch, reg1, LeaveCC, cond);
197
- mov(reg1, reg2, LeaveCC, cond);
198
- mov(reg2, scratch, LeaveCC, cond);
199
- }
200
- }
201
-
202
-
203
- void MacroAssembler::Call(Label* target) {
204
- bl(target);
205
- }
206
-
207
-
208
- void MacroAssembler::Move(Register dst, Handle<Object> value) {
209
- mov(dst, Operand(value));
210
- }
211
-
212
-
213
- void MacroAssembler::Move(Register dst, Register src) {
214
- if (!dst.is(src)) {
215
- mov(dst, src);
216
- }
217
- }
218
-
219
-
220
- void MacroAssembler::And(Register dst, Register src1, const Operand& src2,
221
- Condition cond) {
222
- if (!src2.is_reg() &&
223
- !src2.must_use_constant_pool() &&
224
- src2.immediate() == 0) {
225
- mov(dst, Operand(0, RelocInfo::NONE), LeaveCC, cond);
226
-
227
- } else if (!src2.is_single_instruction() &&
228
- !src2.must_use_constant_pool() &&
229
- CpuFeatures::IsSupported(ARMv7) &&
230
- IsPowerOf2(src2.immediate() + 1)) {
231
- ubfx(dst, src1, 0, WhichPowerOf2(src2.immediate() + 1), cond);
232
-
233
- } else {
234
- and_(dst, src1, src2, LeaveCC, cond);
235
- }
236
- }
237
-
238
-
239
- void MacroAssembler::Ubfx(Register dst, Register src1, int lsb, int width,
240
- Condition cond) {
241
- ASSERT(lsb < 32);
242
- if (!CpuFeatures::IsSupported(ARMv7)) {
243
- int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1);
244
- and_(dst, src1, Operand(mask), LeaveCC, cond);
245
- if (lsb != 0) {
246
- mov(dst, Operand(dst, LSR, lsb), LeaveCC, cond);
247
- }
248
- } else {
249
- ubfx(dst, src1, lsb, width, cond);
250
- }
251
- }
252
-
253
-
254
- void MacroAssembler::Sbfx(Register dst, Register src1, int lsb, int width,
255
- Condition cond) {
256
- ASSERT(lsb < 32);
257
- if (!CpuFeatures::IsSupported(ARMv7)) {
258
- int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1);
259
- and_(dst, src1, Operand(mask), LeaveCC, cond);
260
- int shift_up = 32 - lsb - width;
261
- int shift_down = lsb + shift_up;
262
- if (shift_up != 0) {
263
- mov(dst, Operand(dst, LSL, shift_up), LeaveCC, cond);
264
- }
265
- if (shift_down != 0) {
266
- mov(dst, Operand(dst, ASR, shift_down), LeaveCC, cond);
267
- }
268
- } else {
269
- sbfx(dst, src1, lsb, width, cond);
270
- }
271
- }
272
-
273
-
274
- void MacroAssembler::Bfi(Register dst,
275
- Register src,
276
- Register scratch,
277
- int lsb,
278
- int width,
279
- Condition cond) {
280
- ASSERT(0 <= lsb && lsb < 32);
281
- ASSERT(0 <= width && width < 32);
282
- ASSERT(lsb + width < 32);
283
- ASSERT(!scratch.is(dst));
284
- if (width == 0) return;
285
- if (!CpuFeatures::IsSupported(ARMv7)) {
286
- int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1);
287
- bic(dst, dst, Operand(mask));
288
- and_(scratch, src, Operand((1 << width) - 1));
289
- mov(scratch, Operand(scratch, LSL, lsb));
290
- orr(dst, dst, scratch);
291
- } else {
292
- bfi(dst, src, lsb, width, cond);
293
- }
294
- }
295
-
296
-
297
- void MacroAssembler::Bfc(Register dst, int lsb, int width, Condition cond) {
298
- ASSERT(lsb < 32);
299
- if (!CpuFeatures::IsSupported(ARMv7)) {
300
- int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1);
301
- bic(dst, dst, Operand(mask));
302
- } else {
303
- bfc(dst, lsb, width, cond);
304
- }
305
- }
306
-
307
-
308
- void MacroAssembler::Usat(Register dst, int satpos, const Operand& src,
309
- Condition cond) {
310
- if (!CpuFeatures::IsSupported(ARMv7)) {
311
- ASSERT(!dst.is(pc) && !src.rm().is(pc));
312
- ASSERT((satpos >= 0) && (satpos <= 31));
313
-
314
- // These asserts are required to ensure compatibility with the ARMv7
315
- // implementation.
316
- ASSERT((src.shift_op() == ASR) || (src.shift_op() == LSL));
317
- ASSERT(src.rs().is(no_reg));
318
-
319
- Label done;
320
- int satval = (1 << satpos) - 1;
321
-
322
- if (cond != al) {
323
- b(NegateCondition(cond), &done); // Skip saturate if !condition.
324
- }
325
- if (!(src.is_reg() && dst.is(src.rm()))) {
326
- mov(dst, src);
327
- }
328
- tst(dst, Operand(~satval));
329
- b(eq, &done);
330
- mov(dst, Operand(0, RelocInfo::NONE), LeaveCC, mi); // 0 if negative.
331
- mov(dst, Operand(satval), LeaveCC, pl); // satval if positive.
332
- bind(&done);
333
- } else {
334
- usat(dst, satpos, src, cond);
335
- }
336
- }
337
-
338
-
339
- void MacroAssembler::SmiJumpTable(Register index, Vector<Label*> targets) {
340
- // Empty the const pool.
341
- CheckConstPool(true, true);
342
- add(pc, pc, Operand(index,
343
- LSL,
344
- Instruction::kInstrSizeLog2 - kSmiTagSize));
345
- BlockConstPoolBefore(pc_offset() + (targets.length() + 1) * kInstrSize);
346
- nop(); // Jump table alignment.
347
- for (int i = 0; i < targets.length(); i++) {
348
- b(targets[i]);
349
- }
350
- }
351
-
352
-
353
- void MacroAssembler::LoadRoot(Register destination,
354
- Heap::RootListIndex index,
355
- Condition cond) {
356
- ldr(destination, MemOperand(roots, index << kPointerSizeLog2), cond);
357
- }
358
-
359
-
360
- void MacroAssembler::StoreRoot(Register source,
361
- Heap::RootListIndex index,
362
- Condition cond) {
363
- str(source, MemOperand(roots, index << kPointerSizeLog2), cond);
364
- }
365
-
366
-
367
- void MacroAssembler::RecordWriteHelper(Register object,
368
- Register address,
369
- Register scratch) {
370
- if (FLAG_debug_code) {
371
- // Check that the object is not in new space.
372
- Label not_in_new_space;
373
- InNewSpace(object, scratch, ne, &not_in_new_space);
374
- Abort("new-space object passed to RecordWriteHelper");
375
- bind(&not_in_new_space);
376
- }
377
-
378
- // Calculate page address.
379
- Bfc(object, 0, kPageSizeBits);
380
-
381
- // Calculate region number.
382
- Ubfx(address, address, Page::kRegionSizeLog2,
383
- kPageSizeBits - Page::kRegionSizeLog2);
384
-
385
- // Mark region dirty.
386
- ldr(scratch, MemOperand(object, Page::kDirtyFlagOffset));
387
- mov(ip, Operand(1));
388
- orr(scratch, scratch, Operand(ip, LSL, address));
389
- str(scratch, MemOperand(object, Page::kDirtyFlagOffset));
390
- }
391
-
392
-
393
- void MacroAssembler::InNewSpace(Register object,
394
- Register scratch,
395
- Condition cond,
396
- Label* branch) {
397
- ASSERT(cond == eq || cond == ne);
398
- and_(scratch, object, Operand(ExternalReference::new_space_mask()));
399
- cmp(scratch, Operand(ExternalReference::new_space_start()));
400
- b(cond, branch);
401
- }
402
-
403
-
404
- // Will clobber 4 registers: object, offset, scratch, ip. The
405
- // register 'object' contains a heap object pointer. The heap object
406
- // tag is shifted away.
407
- void MacroAssembler::RecordWrite(Register object,
408
- Operand offset,
409
- Register scratch0,
410
- Register scratch1) {
411
- // The compiled code assumes that record write doesn't change the
412
- // context register, so we check that none of the clobbered
413
- // registers are cp.
414
- ASSERT(!object.is(cp) && !scratch0.is(cp) && !scratch1.is(cp));
415
-
416
- Label done;
417
-
418
- // First, test that the object is not in the new space. We cannot set
419
- // region marks for new space pages.
420
- InNewSpace(object, scratch0, eq, &done);
421
-
422
- // Add offset into the object.
423
- add(scratch0, object, offset);
424
-
425
- // Record the actual write.
426
- RecordWriteHelper(object, scratch0, scratch1);
427
-
428
- bind(&done);
429
-
430
- // Clobber all input registers when running with the debug-code flag
431
- // turned on to provoke errors.
432
- if (FLAG_debug_code) {
433
- mov(object, Operand(BitCast<int32_t>(kZapValue)));
434
- mov(scratch0, Operand(BitCast<int32_t>(kZapValue)));
435
- mov(scratch1, Operand(BitCast<int32_t>(kZapValue)));
436
- }
437
- }
438
-
439
-
440
- // Will clobber 4 registers: object, address, scratch, ip. The
441
- // register 'object' contains a heap object pointer. The heap object
442
- // tag is shifted away.
443
- void MacroAssembler::RecordWrite(Register object,
444
- Register address,
445
- Register scratch) {
446
- // The compiled code assumes that record write doesn't change the
447
- // context register, so we check that none of the clobbered
448
- // registers are cp.
449
- ASSERT(!object.is(cp) && !address.is(cp) && !scratch.is(cp));
450
-
451
- Label done;
452
-
453
- // First, test that the object is not in the new space. We cannot set
454
- // region marks for new space pages.
455
- InNewSpace(object, scratch, eq, &done);
456
-
457
- // Record the actual write.
458
- RecordWriteHelper(object, address, scratch);
459
-
460
- bind(&done);
461
-
462
- // Clobber all input registers when running with the debug-code flag
463
- // turned on to provoke errors.
464
- if (FLAG_debug_code) {
465
- mov(object, Operand(BitCast<int32_t>(kZapValue)));
466
- mov(address, Operand(BitCast<int32_t>(kZapValue)));
467
- mov(scratch, Operand(BitCast<int32_t>(kZapValue)));
468
- }
469
- }
470
-
471
-
472
- // Push and pop all registers that can hold pointers.
473
- void MacroAssembler::PushSafepointRegisters() {
474
- // Safepoints expect a block of contiguous register values starting with r0:
475
- ASSERT(((1 << kNumSafepointSavedRegisters) - 1) == kSafepointSavedRegisters);
476
- // Safepoints expect a block of kNumSafepointRegisters values on the
477
- // stack, so adjust the stack for unsaved registers.
478
- const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
479
- ASSERT(num_unsaved >= 0);
480
- sub(sp, sp, Operand(num_unsaved * kPointerSize));
481
- stm(db_w, sp, kSafepointSavedRegisters);
482
- }
483
-
484
-
485
- void MacroAssembler::PopSafepointRegisters() {
486
- const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
487
- ldm(ia_w, sp, kSafepointSavedRegisters);
488
- add(sp, sp, Operand(num_unsaved * kPointerSize));
489
- }
490
-
491
-
492
- void MacroAssembler::PushSafepointRegistersAndDoubles() {
493
- PushSafepointRegisters();
494
- sub(sp, sp, Operand(DwVfpRegister::kNumAllocatableRegisters *
495
- kDoubleSize));
496
- for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; i++) {
497
- vstr(DwVfpRegister::FromAllocationIndex(i), sp, i * kDoubleSize);
498
- }
499
- }
500
-
501
-
502
- void MacroAssembler::PopSafepointRegistersAndDoubles() {
503
- for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; i++) {
504
- vldr(DwVfpRegister::FromAllocationIndex(i), sp, i * kDoubleSize);
505
- }
506
- add(sp, sp, Operand(DwVfpRegister::kNumAllocatableRegisters *
507
- kDoubleSize));
508
- PopSafepointRegisters();
509
- }
510
-
511
- void MacroAssembler::StoreToSafepointRegistersAndDoublesSlot(Register src,
512
- Register dst) {
513
- str(src, SafepointRegistersAndDoublesSlot(dst));
514
- }
515
-
516
-
517
- void MacroAssembler::StoreToSafepointRegisterSlot(Register src, Register dst) {
518
- str(src, SafepointRegisterSlot(dst));
519
- }
520
-
521
-
522
- void MacroAssembler::LoadFromSafepointRegisterSlot(Register dst, Register src) {
523
- ldr(dst, SafepointRegisterSlot(src));
524
- }
525
-
526
-
527
- int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
528
- // The registers are pushed starting with the highest encoding,
529
- // which means that lowest encodings are closest to the stack pointer.
530
- ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters);
531
- return reg_code;
532
- }
533
-
534
-
535
- MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) {
536
- return MemOperand(sp, SafepointRegisterStackIndex(reg.code()) * kPointerSize);
537
- }
538
-
539
-
540
- MemOperand MacroAssembler::SafepointRegistersAndDoublesSlot(Register reg) {
541
- // General purpose registers are pushed last on the stack.
542
- int doubles_size = DwVfpRegister::kNumAllocatableRegisters * kDoubleSize;
543
- int register_offset = SafepointRegisterStackIndex(reg.code()) * kPointerSize;
544
- return MemOperand(sp, doubles_size + register_offset);
545
- }
546
-
547
-
548
- void MacroAssembler::Ldrd(Register dst1, Register dst2,
549
- const MemOperand& src, Condition cond) {
550
- ASSERT(src.rm().is(no_reg));
551
- ASSERT(!dst1.is(lr)); // r14.
552
- ASSERT_EQ(0, dst1.code() % 2);
553
- ASSERT_EQ(dst1.code() + 1, dst2.code());
554
-
555
- // Generate two ldr instructions if ldrd is not available.
556
- if (CpuFeatures::IsSupported(ARMv7)) {
557
- CpuFeatures::Scope scope(ARMv7);
558
- ldrd(dst1, dst2, src, cond);
559
- } else {
560
- MemOperand src2(src);
561
- src2.set_offset(src2.offset() + 4);
562
- if (dst1.is(src.rn())) {
563
- ldr(dst2, src2, cond);
564
- ldr(dst1, src, cond);
565
- } else {
566
- ldr(dst1, src, cond);
567
- ldr(dst2, src2, cond);
568
- }
569
- }
570
- }
571
-
572
-
573
- void MacroAssembler::Strd(Register src1, Register src2,
574
- const MemOperand& dst, Condition cond) {
575
- ASSERT(dst.rm().is(no_reg));
576
- ASSERT(!src1.is(lr)); // r14.
577
- ASSERT_EQ(0, src1.code() % 2);
578
- ASSERT_EQ(src1.code() + 1, src2.code());
579
-
580
- // Generate two str instructions if strd is not available.
581
- if (CpuFeatures::IsSupported(ARMv7)) {
582
- CpuFeatures::Scope scope(ARMv7);
583
- strd(src1, src2, dst, cond);
584
- } else {
585
- MemOperand dst2(dst);
586
- dst2.set_offset(dst2.offset() + 4);
587
- str(src1, dst, cond);
588
- str(src2, dst2, cond);
589
- }
590
- }
591
-
592
-
593
- void MacroAssembler::ClearFPSCRBits(const uint32_t bits_to_clear,
594
- const Register scratch,
595
- const Condition cond) {
596
- vmrs(scratch, cond);
597
- bic(scratch, scratch, Operand(bits_to_clear), LeaveCC, cond);
598
- vmsr(scratch, cond);
599
- }
600
-
601
-
602
- void MacroAssembler::VFPCompareAndSetFlags(const DwVfpRegister src1,
603
- const DwVfpRegister src2,
604
- const Condition cond) {
605
- // Compare and move FPSCR flags to the normal condition flags.
606
- VFPCompareAndLoadFlags(src1, src2, pc, cond);
607
- }
608
-
609
- void MacroAssembler::VFPCompareAndSetFlags(const DwVfpRegister src1,
610
- const double src2,
611
- const Condition cond) {
612
- // Compare and move FPSCR flags to the normal condition flags.
613
- VFPCompareAndLoadFlags(src1, src2, pc, cond);
614
- }
615
-
616
-
617
- void MacroAssembler::VFPCompareAndLoadFlags(const DwVfpRegister src1,
618
- const DwVfpRegister src2,
619
- const Register fpscr_flags,
620
- const Condition cond) {
621
- // Compare and load FPSCR.
622
- vcmp(src1, src2, cond);
623
- vmrs(fpscr_flags, cond);
624
- }
625
-
626
- void MacroAssembler::VFPCompareAndLoadFlags(const DwVfpRegister src1,
627
- const double src2,
628
- const Register fpscr_flags,
629
- const Condition cond) {
630
- // Compare and load FPSCR.
631
- vcmp(src1, src2, cond);
632
- vmrs(fpscr_flags, cond);
633
- }
634
-
635
-
636
- void MacroAssembler::EnterFrame(StackFrame::Type type) {
637
- // r0-r3: preserved
638
- stm(db_w, sp, cp.bit() | fp.bit() | lr.bit());
639
- mov(ip, Operand(Smi::FromInt(type)));
640
- push(ip);
641
- mov(ip, Operand(CodeObject()));
642
- push(ip);
643
- add(fp, sp, Operand(3 * kPointerSize)); // Adjust FP to point to saved FP.
644
- }
645
-
646
-
647
- void MacroAssembler::LeaveFrame(StackFrame::Type type) {
648
- // r0: preserved
649
- // r1: preserved
650
- // r2: preserved
651
-
652
- // Drop the execution stack down to the frame pointer and restore
653
- // the caller frame pointer and return address.
654
- mov(sp, fp);
655
- ldm(ia_w, sp, fp.bit() | lr.bit());
656
- }
657
-
658
-
659
- void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space) {
660
- // Setup the frame structure on the stack.
661
- ASSERT_EQ(2 * kPointerSize, ExitFrameConstants::kCallerSPDisplacement);
662
- ASSERT_EQ(1 * kPointerSize, ExitFrameConstants::kCallerPCOffset);
663
- ASSERT_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset);
664
- Push(lr, fp);
665
- mov(fp, Operand(sp)); // Setup new frame pointer.
666
- // Reserve room for saved entry sp and code object.
667
- sub(sp, sp, Operand(2 * kPointerSize));
668
- if (FLAG_debug_code) {
669
- mov(ip, Operand(0));
670
- str(ip, MemOperand(fp, ExitFrameConstants::kSPOffset));
671
- }
672
- mov(ip, Operand(CodeObject()));
673
- str(ip, MemOperand(fp, ExitFrameConstants::kCodeOffset));
674
-
675
- // Save the frame pointer and the context in top.
676
- mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address)));
677
- str(fp, MemOperand(ip));
678
- mov(ip, Operand(ExternalReference(Top::k_context_address)));
679
- str(cp, MemOperand(ip));
680
-
681
- // Optionally save all double registers.
682
- if (save_doubles) {
683
- sub(sp, sp, Operand(DwVfpRegister::kNumRegisters * kDoubleSize));
684
- const int offset = -2 * kPointerSize;
685
- for (int i = 0; i < DwVfpRegister::kNumRegisters; i++) {
686
- DwVfpRegister reg = DwVfpRegister::from_code(i);
687
- vstr(reg, fp, offset - ((i + 1) * kDoubleSize));
688
- }
689
- // Note that d0 will be accessible at
690
- // fp - 2 * kPointerSize - DwVfpRegister::kNumRegisters * kDoubleSize,
691
- // since the sp slot and code slot were pushed after the fp.
692
- }
693
-
694
- // Reserve place for the return address and stack space and align the frame
695
- // preparing for calling the runtime function.
696
- const int frame_alignment = MacroAssembler::ActivationFrameAlignment();
697
- sub(sp, sp, Operand((stack_space + 1) * kPointerSize));
698
- if (frame_alignment > 0) {
699
- ASSERT(IsPowerOf2(frame_alignment));
700
- and_(sp, sp, Operand(-frame_alignment));
701
- }
702
-
703
- // Set the exit frame sp value to point just before the return address
704
- // location.
705
- add(ip, sp, Operand(kPointerSize));
706
- str(ip, MemOperand(fp, ExitFrameConstants::kSPOffset));
707
- }
708
-
709
-
710
- void MacroAssembler::InitializeNewString(Register string,
711
- Register length,
712
- Heap::RootListIndex map_index,
713
- Register scratch1,
714
- Register scratch2) {
715
- mov(scratch1, Operand(length, LSL, kSmiTagSize));
716
- LoadRoot(scratch2, map_index);
717
- str(scratch1, FieldMemOperand(string, String::kLengthOffset));
718
- mov(scratch1, Operand(String::kEmptyHashField));
719
- str(scratch2, FieldMemOperand(string, HeapObject::kMapOffset));
720
- str(scratch1, FieldMemOperand(string, String::kHashFieldOffset));
721
- }
722
-
723
-
724
- int MacroAssembler::ActivationFrameAlignment() {
725
- #if defined(V8_HOST_ARCH_ARM)
726
- // Running on the real platform. Use the alignment as mandated by the local
727
- // environment.
728
- // Note: This will break if we ever start generating snapshots on one ARM
729
- // platform for another ARM platform with a different alignment.
730
- return OS::ActivationFrameAlignment();
731
- #else // defined(V8_HOST_ARCH_ARM)
732
- // If we are using the simulator then we should always align to the expected
733
- // alignment. As the simulator is used to generate snapshots we do not know
734
- // if the target platform will need alignment, so this is controlled from a
735
- // flag.
736
- return FLAG_sim_stack_alignment;
737
- #endif // defined(V8_HOST_ARCH_ARM)
738
- }
739
-
740
-
741
- void MacroAssembler::LeaveExitFrame(bool save_doubles,
742
- Register argument_count) {
743
- // Optionally restore all double registers.
744
- if (save_doubles) {
745
- for (int i = 0; i < DwVfpRegister::kNumRegisters; i++) {
746
- DwVfpRegister reg = DwVfpRegister::from_code(i);
747
- const int offset = -2 * kPointerSize;
748
- vldr(reg, fp, offset - ((i + 1) * kDoubleSize));
749
- }
750
- }
751
-
752
- // Clear top frame.
753
- mov(r3, Operand(0, RelocInfo::NONE));
754
- mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address)));
755
- str(r3, MemOperand(ip));
756
-
757
- // Restore current context from top and clear it in debug mode.
758
- mov(ip, Operand(ExternalReference(Top::k_context_address)));
759
- ldr(cp, MemOperand(ip));
760
- #ifdef DEBUG
761
- str(r3, MemOperand(ip));
762
- #endif
763
-
764
- // Tear down the exit frame, pop the arguments, and return.
765
- mov(sp, Operand(fp));
766
- ldm(ia_w, sp, fp.bit() | lr.bit());
767
- if (argument_count.is_valid()) {
768
- add(sp, sp, Operand(argument_count, LSL, kPointerSizeLog2));
769
- }
770
- }
771
-
772
- void MacroAssembler::GetCFunctionDoubleResult(const DoubleRegister dst) {
773
- #if !defined(USE_ARM_EABI)
774
- UNREACHABLE();
775
- #else
776
- vmov(dst, r0, r1);
777
- #endif
778
- }
779
-
780
-
781
- void MacroAssembler::InvokePrologue(const ParameterCount& expected,
782
- const ParameterCount& actual,
783
- Handle<Code> code_constant,
784
- Register code_reg,
785
- Label* done,
786
- InvokeFlag flag,
787
- PostCallGenerator* post_call_generator) {
788
- bool definitely_matches = false;
789
- Label regular_invoke;
790
-
791
- // Check whether the expected and actual arguments count match. If not,
792
- // setup registers according to contract with ArgumentsAdaptorTrampoline:
793
- // r0: actual arguments count
794
- // r1: function (passed through to callee)
795
- // r2: expected arguments count
796
- // r3: callee code entry
797
-
798
- // The code below is made a lot easier because the calling code already sets
799
- // up actual and expected registers according to the contract if values are
800
- // passed in registers.
801
- ASSERT(actual.is_immediate() || actual.reg().is(r0));
802
- ASSERT(expected.is_immediate() || expected.reg().is(r2));
803
- ASSERT((!code_constant.is_null() && code_reg.is(no_reg)) || code_reg.is(r3));
804
-
805
- if (expected.is_immediate()) {
806
- ASSERT(actual.is_immediate());
807
- if (expected.immediate() == actual.immediate()) {
808
- definitely_matches = true;
809
- } else {
810
- mov(r0, Operand(actual.immediate()));
811
- const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel;
812
- if (expected.immediate() == sentinel) {
813
- // Don't worry about adapting arguments for builtins that
814
- // don't want that done. Skip adaption code by making it look
815
- // like we have a match between expected and actual number of
816
- // arguments.
817
- definitely_matches = true;
818
- } else {
819
- mov(r2, Operand(expected.immediate()));
820
- }
821
- }
822
- } else {
823
- if (actual.is_immediate()) {
824
- cmp(expected.reg(), Operand(actual.immediate()));
825
- b(eq, &regular_invoke);
826
- mov(r0, Operand(actual.immediate()));
827
- } else {
828
- cmp(expected.reg(), Operand(actual.reg()));
829
- b(eq, &regular_invoke);
830
- }
831
- }
832
-
833
- if (!definitely_matches) {
834
- if (!code_constant.is_null()) {
835
- mov(r3, Operand(code_constant));
836
- add(r3, r3, Operand(Code::kHeaderSize - kHeapObjectTag));
837
- }
838
-
839
- Handle<Code> adaptor =
840
- Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline));
841
- if (flag == CALL_FUNCTION) {
842
- Call(adaptor, RelocInfo::CODE_TARGET);
843
- if (post_call_generator != NULL) post_call_generator->Generate();
844
- b(done);
845
- } else {
846
- Jump(adaptor, RelocInfo::CODE_TARGET);
847
- }
848
- bind(&regular_invoke);
849
- }
850
- }
851
-
852
-
853
- void MacroAssembler::InvokeCode(Register code,
854
- const ParameterCount& expected,
855
- const ParameterCount& actual,
856
- InvokeFlag flag,
857
- PostCallGenerator* post_call_generator) {
858
- Label done;
859
-
860
- InvokePrologue(expected, actual, Handle<Code>::null(), code, &done, flag,
861
- post_call_generator);
862
- if (flag == CALL_FUNCTION) {
863
- Call(code);
864
- if (post_call_generator != NULL) post_call_generator->Generate();
865
- } else {
866
- ASSERT(flag == JUMP_FUNCTION);
867
- Jump(code);
868
- }
869
-
870
- // Continue here if InvokePrologue does handle the invocation due to
871
- // mismatched parameter counts.
872
- bind(&done);
873
- }
874
-
875
-
876
- void MacroAssembler::InvokeCode(Handle<Code> code,
877
- const ParameterCount& expected,
878
- const ParameterCount& actual,
879
- RelocInfo::Mode rmode,
880
- InvokeFlag flag) {
881
- Label done;
882
-
883
- InvokePrologue(expected, actual, code, no_reg, &done, flag);
884
- if (flag == CALL_FUNCTION) {
885
- Call(code, rmode);
886
- } else {
887
- Jump(code, rmode);
888
- }
889
-
890
- // Continue here if InvokePrologue does handle the invocation due to
891
- // mismatched parameter counts.
892
- bind(&done);
893
- }
894
-
895
-
896
- void MacroAssembler::InvokeFunction(Register fun,
897
- const ParameterCount& actual,
898
- InvokeFlag flag,
899
- PostCallGenerator* post_call_generator) {
900
- // Contract with called JS functions requires that function is passed in r1.
901
- ASSERT(fun.is(r1));
902
-
903
- Register expected_reg = r2;
904
- Register code_reg = r3;
905
-
906
- ldr(code_reg, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
907
- ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
908
- ldr(expected_reg,
909
- FieldMemOperand(code_reg,
910
- SharedFunctionInfo::kFormalParameterCountOffset));
911
- mov(expected_reg, Operand(expected_reg, ASR, kSmiTagSize));
912
- ldr(code_reg,
913
- FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
914
-
915
- ParameterCount expected(expected_reg);
916
- InvokeCode(code_reg, expected, actual, flag, post_call_generator);
917
- }
918
-
919
-
920
- void MacroAssembler::InvokeFunction(JSFunction* function,
921
- const ParameterCount& actual,
922
- InvokeFlag flag) {
923
- ASSERT(function->is_compiled());
924
-
925
- // Get the function and setup the context.
926
- mov(r1, Operand(Handle<JSFunction>(function)));
927
- ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
928
-
929
- // Invoke the cached code.
930
- Handle<Code> code(function->code());
931
- ParameterCount expected(function->shared()->formal_parameter_count());
932
- if (V8::UseCrankshaft()) {
933
- // TODO(kasperl): For now, we always call indirectly through the
934
- // code field in the function to allow recompilation to take effect
935
- // without changing any of the call sites.
936
- ldr(r3, FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
937
- InvokeCode(r3, expected, actual, flag);
938
- } else {
939
- InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, flag);
940
- }
941
- }
942
-
943
-
944
- void MacroAssembler::IsObjectJSObjectType(Register heap_object,
945
- Register map,
946
- Register scratch,
947
- Label* fail) {
948
- ldr(map, FieldMemOperand(heap_object, HeapObject::kMapOffset));
949
- IsInstanceJSObjectType(map, scratch, fail);
950
- }
951
-
952
-
953
- void MacroAssembler::IsInstanceJSObjectType(Register map,
954
- Register scratch,
955
- Label* fail) {
956
- ldrb(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset));
957
- cmp(scratch, Operand(FIRST_JS_OBJECT_TYPE));
958
- b(lt, fail);
959
- cmp(scratch, Operand(LAST_JS_OBJECT_TYPE));
960
- b(gt, fail);
961
- }
962
-
963
-
964
- void MacroAssembler::IsObjectJSStringType(Register object,
965
- Register scratch,
966
- Label* fail) {
967
- ASSERT(kNotStringTag != 0);
968
-
969
- ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
970
- ldrb(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset));
971
- tst(scratch, Operand(kIsNotStringMask));
972
- b(ne, fail);
973
- }
974
-
975
-
976
- #ifdef ENABLE_DEBUGGER_SUPPORT
977
- void MacroAssembler::DebugBreak() {
978
- ASSERT(allow_stub_calls());
979
- mov(r0, Operand(0, RelocInfo::NONE));
980
- mov(r1, Operand(ExternalReference(Runtime::kDebugBreak)));
981
- CEntryStub ces(1);
982
- Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
983
- }
984
- #endif
985
-
986
-
987
- void MacroAssembler::PushTryHandler(CodeLocation try_location,
988
- HandlerType type) {
989
- // Adjust this code if not the case.
990
- ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
991
- // The pc (return address) is passed in register lr.
992
- if (try_location == IN_JAVASCRIPT) {
993
- if (type == TRY_CATCH_HANDLER) {
994
- mov(r3, Operand(StackHandler::TRY_CATCH));
995
- } else {
996
- mov(r3, Operand(StackHandler::TRY_FINALLY));
997
- }
998
- ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize
999
- && StackHandlerConstants::kFPOffset == 2 * kPointerSize
1000
- && StackHandlerConstants::kPCOffset == 3 * kPointerSize);
1001
- stm(db_w, sp, r3.bit() | fp.bit() | lr.bit());
1002
- // Save the current handler as the next handler.
1003
- mov(r3, Operand(ExternalReference(Top::k_handler_address)));
1004
- ldr(r1, MemOperand(r3));
1005
- ASSERT(StackHandlerConstants::kNextOffset == 0);
1006
- push(r1);
1007
- // Link this handler as the new current one.
1008
- str(sp, MemOperand(r3));
1009
- } else {
1010
- // Must preserve r0-r4, r5-r7 are available.
1011
- ASSERT(try_location == IN_JS_ENTRY);
1012
- // The frame pointer does not point to a JS frame so we save NULL
1013
- // for fp. We expect the code throwing an exception to check fp
1014
- // before dereferencing it to restore the context.
1015
- mov(ip, Operand(0, RelocInfo::NONE)); // To save a NULL frame pointer.
1016
- mov(r6, Operand(StackHandler::ENTRY));
1017
- ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize
1018
- && StackHandlerConstants::kFPOffset == 2 * kPointerSize
1019
- && StackHandlerConstants::kPCOffset == 3 * kPointerSize);
1020
- stm(db_w, sp, r6.bit() | ip.bit() | lr.bit());
1021
- // Save the current handler as the next handler.
1022
- mov(r7, Operand(ExternalReference(Top::k_handler_address)));
1023
- ldr(r6, MemOperand(r7));
1024
- ASSERT(StackHandlerConstants::kNextOffset == 0);
1025
- push(r6);
1026
- // Link this handler as the new current one.
1027
- str(sp, MemOperand(r7));
1028
- }
1029
- }
1030
-
1031
-
1032
- void MacroAssembler::PopTryHandler() {
1033
- ASSERT_EQ(0, StackHandlerConstants::kNextOffset);
1034
- pop(r1);
1035
- mov(ip, Operand(ExternalReference(Top::k_handler_address)));
1036
- add(sp, sp, Operand(StackHandlerConstants::kSize - kPointerSize));
1037
- str(r1, MemOperand(ip));
1038
- }
1039
-
1040
-
1041
- void MacroAssembler::Throw(Register value) {
1042
- // r0 is expected to hold the exception.
1043
- if (!value.is(r0)) {
1044
- mov(r0, value);
1045
- }
1046
-
1047
- // Adjust this code if not the case.
1048
- STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
1049
-
1050
- // Drop the sp to the top of the handler.
1051
- mov(r3, Operand(ExternalReference(Top::k_handler_address)));
1052
- ldr(sp, MemOperand(r3));
1053
-
1054
- // Restore the next handler and frame pointer, discard handler state.
1055
- STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
1056
- pop(r2);
1057
- str(r2, MemOperand(r3));
1058
- STATIC_ASSERT(StackHandlerConstants::kFPOffset == 2 * kPointerSize);
1059
- ldm(ia_w, sp, r3.bit() | fp.bit()); // r3: discarded state.
1060
-
1061
- // Before returning we restore the context from the frame pointer if
1062
- // not NULL. The frame pointer is NULL in the exception handler of a
1063
- // JS entry frame.
1064
- cmp(fp, Operand(0, RelocInfo::NONE));
1065
- // Set cp to NULL if fp is NULL.
1066
- mov(cp, Operand(0, RelocInfo::NONE), LeaveCC, eq);
1067
- // Restore cp otherwise.
1068
- ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset), ne);
1069
- #ifdef DEBUG
1070
- if (FLAG_debug_code) {
1071
- mov(lr, Operand(pc));
1072
- }
1073
- #endif
1074
- STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize);
1075
- pop(pc);
1076
- }
1077
-
1078
-
1079
- void MacroAssembler::ThrowUncatchable(UncatchableExceptionType type,
1080
- Register value) {
1081
- // Adjust this code if not the case.
1082
- STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
1083
-
1084
- // r0 is expected to hold the exception.
1085
- if (!value.is(r0)) {
1086
- mov(r0, value);
1087
- }
1088
-
1089
- // Drop sp to the top stack handler.
1090
- mov(r3, Operand(ExternalReference(Top::k_handler_address)));
1091
- ldr(sp, MemOperand(r3));
1092
-
1093
- // Unwind the handlers until the ENTRY handler is found.
1094
- Label loop, done;
1095
- bind(&loop);
1096
- // Load the type of the current stack handler.
1097
- const int kStateOffset = StackHandlerConstants::kStateOffset;
1098
- ldr(r2, MemOperand(sp, kStateOffset));
1099
- cmp(r2, Operand(StackHandler::ENTRY));
1100
- b(eq, &done);
1101
- // Fetch the next handler in the list.
1102
- const int kNextOffset = StackHandlerConstants::kNextOffset;
1103
- ldr(sp, MemOperand(sp, kNextOffset));
1104
- jmp(&loop);
1105
- bind(&done);
1106
-
1107
- // Set the top handler address to next handler past the current ENTRY handler.
1108
- STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
1109
- pop(r2);
1110
- str(r2, MemOperand(r3));
1111
-
1112
- if (type == OUT_OF_MEMORY) {
1113
- // Set external caught exception to false.
1114
- ExternalReference external_caught(Top::k_external_caught_exception_address);
1115
- mov(r0, Operand(false, RelocInfo::NONE));
1116
- mov(r2, Operand(external_caught));
1117
- str(r0, MemOperand(r2));
1118
-
1119
- // Set pending exception and r0 to out of memory exception.
1120
- Failure* out_of_memory = Failure::OutOfMemoryException();
1121
- mov(r0, Operand(reinterpret_cast<int32_t>(out_of_memory)));
1122
- mov(r2, Operand(ExternalReference(Top::k_pending_exception_address)));
1123
- str(r0, MemOperand(r2));
1124
- }
1125
-
1126
- // Stack layout at this point. See also StackHandlerConstants.
1127
- // sp -> state (ENTRY)
1128
- // fp
1129
- // lr
1130
-
1131
- // Discard handler state (r2 is not used) and restore frame pointer.
1132
- STATIC_ASSERT(StackHandlerConstants::kFPOffset == 2 * kPointerSize);
1133
- ldm(ia_w, sp, r2.bit() | fp.bit()); // r2: discarded state.
1134
- // Before returning we restore the context from the frame pointer if
1135
- // not NULL. The frame pointer is NULL in the exception handler of a
1136
- // JS entry frame.
1137
- cmp(fp, Operand(0, RelocInfo::NONE));
1138
- // Set cp to NULL if fp is NULL.
1139
- mov(cp, Operand(0, RelocInfo::NONE), LeaveCC, eq);
1140
- // Restore cp otherwise.
1141
- ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset), ne);
1142
- #ifdef DEBUG
1143
- if (FLAG_debug_code) {
1144
- mov(lr, Operand(pc));
1145
- }
1146
- #endif
1147
- STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize);
1148
- pop(pc);
1149
- }
1150
-
1151
-
1152
- void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
1153
- Register scratch,
1154
- Label* miss) {
1155
- Label same_contexts;
1156
-
1157
- ASSERT(!holder_reg.is(scratch));
1158
- ASSERT(!holder_reg.is(ip));
1159
- ASSERT(!scratch.is(ip));
1160
-
1161
- // Load current lexical context from the stack frame.
1162
- ldr(scratch, MemOperand(fp, StandardFrameConstants::kContextOffset));
1163
- // In debug mode, make sure the lexical context is set.
1164
- #ifdef DEBUG
1165
- cmp(scratch, Operand(0, RelocInfo::NONE));
1166
- Check(ne, "we should not have an empty lexical context");
1167
- #endif
1168
-
1169
- // Load the global context of the current context.
1170
- int offset = Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
1171
- ldr(scratch, FieldMemOperand(scratch, offset));
1172
- ldr(scratch, FieldMemOperand(scratch, GlobalObject::kGlobalContextOffset));
1173
-
1174
- // Check the context is a global context.
1175
- if (FLAG_debug_code) {
1176
- // TODO(119): avoid push(holder_reg)/pop(holder_reg)
1177
- // Cannot use ip as a temporary in this verification code. Due to the fact
1178
- // that ip is clobbered as part of cmp with an object Operand.
1179
- push(holder_reg); // Temporarily save holder on the stack.
1180
- // Read the first word and compare to the global_context_map.
1181
- ldr(holder_reg, FieldMemOperand(scratch, HeapObject::kMapOffset));
1182
- LoadRoot(ip, Heap::kGlobalContextMapRootIndex);
1183
- cmp(holder_reg, ip);
1184
- Check(eq, "JSGlobalObject::global_context should be a global context.");
1185
- pop(holder_reg); // Restore holder.
1186
- }
1187
-
1188
- // Check if both contexts are the same.
1189
- ldr(ip, FieldMemOperand(holder_reg, JSGlobalProxy::kContextOffset));
1190
- cmp(scratch, Operand(ip));
1191
- b(eq, &same_contexts);
1192
-
1193
- // Check the context is a global context.
1194
- if (FLAG_debug_code) {
1195
- // TODO(119): avoid push(holder_reg)/pop(holder_reg)
1196
- // Cannot use ip as a temporary in this verification code. Due to the fact
1197
- // that ip is clobbered as part of cmp with an object Operand.
1198
- push(holder_reg); // Temporarily save holder on the stack.
1199
- mov(holder_reg, ip); // Move ip to its holding place.
1200
- LoadRoot(ip, Heap::kNullValueRootIndex);
1201
- cmp(holder_reg, ip);
1202
- Check(ne, "JSGlobalProxy::context() should not be null.");
1203
-
1204
- ldr(holder_reg, FieldMemOperand(holder_reg, HeapObject::kMapOffset));
1205
- LoadRoot(ip, Heap::kGlobalContextMapRootIndex);
1206
- cmp(holder_reg, ip);
1207
- Check(eq, "JSGlobalObject::global_context should be a global context.");
1208
- // Restore ip is not needed. ip is reloaded below.
1209
- pop(holder_reg); // Restore holder.
1210
- // Restore ip to holder's context.
1211
- ldr(ip, FieldMemOperand(holder_reg, JSGlobalProxy::kContextOffset));
1212
- }
1213
-
1214
- // Check that the security token in the calling global object is
1215
- // compatible with the security token in the receiving global
1216
- // object.
1217
- int token_offset = Context::kHeaderSize +
1218
- Context::SECURITY_TOKEN_INDEX * kPointerSize;
1219
-
1220
- ldr(scratch, FieldMemOperand(scratch, token_offset));
1221
- ldr(ip, FieldMemOperand(ip, token_offset));
1222
- cmp(scratch, Operand(ip));
1223
- b(ne, miss);
1224
-
1225
- bind(&same_contexts);
1226
- }
1227
-
1228
-
1229
- void MacroAssembler::AllocateInNewSpace(int object_size,
1230
- Register result,
1231
- Register scratch1,
1232
- Register scratch2,
1233
- Label* gc_required,
1234
- AllocationFlags flags) {
1235
- if (!FLAG_inline_new) {
1236
- if (FLAG_debug_code) {
1237
- // Trash the registers to simulate an allocation failure.
1238
- mov(result, Operand(0x7091));
1239
- mov(scratch1, Operand(0x7191));
1240
- mov(scratch2, Operand(0x7291));
1241
- }
1242
- jmp(gc_required);
1243
- return;
1244
- }
1245
-
1246
- ASSERT(!result.is(scratch1));
1247
- ASSERT(!result.is(scratch2));
1248
- ASSERT(!scratch1.is(scratch2));
1249
-
1250
- // Make object size into bytes.
1251
- if ((flags & SIZE_IN_WORDS) != 0) {
1252
- object_size *= kPointerSize;
1253
- }
1254
- ASSERT_EQ(0, object_size & kObjectAlignmentMask);
1255
-
1256
- // Check relative positions of allocation top and limit addresses.
1257
- // The values must be adjacent in memory to allow the use of LDM.
1258
- // Also, assert that the registers are numbered such that the values
1259
- // are loaded in the correct order.
1260
- ExternalReference new_space_allocation_top =
1261
- ExternalReference::new_space_allocation_top_address();
1262
- ExternalReference new_space_allocation_limit =
1263
- ExternalReference::new_space_allocation_limit_address();
1264
- intptr_t top =
1265
- reinterpret_cast<intptr_t>(new_space_allocation_top.address());
1266
- intptr_t limit =
1267
- reinterpret_cast<intptr_t>(new_space_allocation_limit.address());
1268
- ASSERT((limit - top) == kPointerSize);
1269
- ASSERT(result.code() < ip.code());
1270
-
1271
- // Set up allocation top address and object size registers.
1272
- Register topaddr = scratch1;
1273
- Register obj_size_reg = scratch2;
1274
- mov(topaddr, Operand(new_space_allocation_top));
1275
- mov(obj_size_reg, Operand(object_size));
1276
-
1277
- // This code stores a temporary value in ip. This is OK, as the code below
1278
- // does not need ip for implicit literal generation.
1279
- if ((flags & RESULT_CONTAINS_TOP) == 0) {
1280
- // Load allocation top into result and allocation limit into ip.
1281
- ldm(ia, topaddr, result.bit() | ip.bit());
1282
- } else {
1283
- if (FLAG_debug_code) {
1284
- // Assert that result actually contains top on entry. ip is used
1285
- // immediately below so this use of ip does not cause difference with
1286
- // respect to register content between debug and release mode.
1287
- ldr(ip, MemOperand(topaddr));
1288
- cmp(result, ip);
1289
- Check(eq, "Unexpected allocation top");
1290
- }
1291
- // Load allocation limit into ip. Result already contains allocation top.
1292
- ldr(ip, MemOperand(topaddr, limit - top));
1293
- }
1294
-
1295
- // Calculate new top and bail out if new space is exhausted. Use result
1296
- // to calculate the new top.
1297
- add(scratch2, result, Operand(obj_size_reg), SetCC);
1298
- b(cs, gc_required);
1299
- cmp(scratch2, Operand(ip));
1300
- b(hi, gc_required);
1301
- str(scratch2, MemOperand(topaddr));
1302
-
1303
- // Tag object if requested.
1304
- if ((flags & TAG_OBJECT) != 0) {
1305
- add(result, result, Operand(kHeapObjectTag));
1306
- }
1307
- }
1308
-
1309
-
1310
- void MacroAssembler::AllocateInNewSpace(Register object_size,
1311
- Register result,
1312
- Register scratch1,
1313
- Register scratch2,
1314
- Label* gc_required,
1315
- AllocationFlags flags) {
1316
- if (!FLAG_inline_new) {
1317
- if (FLAG_debug_code) {
1318
- // Trash the registers to simulate an allocation failure.
1319
- mov(result, Operand(0x7091));
1320
- mov(scratch1, Operand(0x7191));
1321
- mov(scratch2, Operand(0x7291));
1322
- }
1323
- jmp(gc_required);
1324
- return;
1325
- }
1326
-
1327
- // Assert that the register arguments are different and that none of
1328
- // them are ip. ip is used explicitly in the code generated below.
1329
- ASSERT(!result.is(scratch1));
1330
- ASSERT(!result.is(scratch2));
1331
- ASSERT(!scratch1.is(scratch2));
1332
- ASSERT(!result.is(ip));
1333
- ASSERT(!scratch1.is(ip));
1334
- ASSERT(!scratch2.is(ip));
1335
-
1336
- // Check relative positions of allocation top and limit addresses.
1337
- // The values must be adjacent in memory to allow the use of LDM.
1338
- // Also, assert that the registers are numbered such that the values
1339
- // are loaded in the correct order.
1340
- ExternalReference new_space_allocation_top =
1341
- ExternalReference::new_space_allocation_top_address();
1342
- ExternalReference new_space_allocation_limit =
1343
- ExternalReference::new_space_allocation_limit_address();
1344
- intptr_t top =
1345
- reinterpret_cast<intptr_t>(new_space_allocation_top.address());
1346
- intptr_t limit =
1347
- reinterpret_cast<intptr_t>(new_space_allocation_limit.address());
1348
- ASSERT((limit - top) == kPointerSize);
1349
- ASSERT(result.code() < ip.code());
1350
-
1351
- // Set up allocation top address.
1352
- Register topaddr = scratch1;
1353
- mov(topaddr, Operand(new_space_allocation_top));
1354
-
1355
- // This code stores a temporary value in ip. This is OK, as the code below
1356
- // does not need ip for implicit literal generation.
1357
- if ((flags & RESULT_CONTAINS_TOP) == 0) {
1358
- // Load allocation top into result and allocation limit into ip.
1359
- ldm(ia, topaddr, result.bit() | ip.bit());
1360
- } else {
1361
- if (FLAG_debug_code) {
1362
- // Assert that result actually contains top on entry. ip is used
1363
- // immediately below so this use of ip does not cause difference with
1364
- // respect to register content between debug and release mode.
1365
- ldr(ip, MemOperand(topaddr));
1366
- cmp(result, ip);
1367
- Check(eq, "Unexpected allocation top");
1368
- }
1369
- // Load allocation limit into ip. Result already contains allocation top.
1370
- ldr(ip, MemOperand(topaddr, limit - top));
1371
- }
1372
-
1373
- // Calculate new top and bail out if new space is exhausted. Use result
1374
- // to calculate the new top. Object size may be in words so a shift is
1375
- // required to get the number of bytes.
1376
- if ((flags & SIZE_IN_WORDS) != 0) {
1377
- add(scratch2, result, Operand(object_size, LSL, kPointerSizeLog2), SetCC);
1378
- } else {
1379
- add(scratch2, result, Operand(object_size), SetCC);
1380
- }
1381
- b(cs, gc_required);
1382
- cmp(scratch2, Operand(ip));
1383
- b(hi, gc_required);
1384
-
1385
- // Update allocation top. result temporarily holds the new top.
1386
- if (FLAG_debug_code) {
1387
- tst(scratch2, Operand(kObjectAlignmentMask));
1388
- Check(eq, "Unaligned allocation in new space");
1389
- }
1390
- str(scratch2, MemOperand(topaddr));
1391
-
1392
- // Tag object if requested.
1393
- if ((flags & TAG_OBJECT) != 0) {
1394
- add(result, result, Operand(kHeapObjectTag));
1395
- }
1396
- }
1397
-
1398
-
1399
- void MacroAssembler::UndoAllocationInNewSpace(Register object,
1400
- Register scratch) {
1401
- ExternalReference new_space_allocation_top =
1402
- ExternalReference::new_space_allocation_top_address();
1403
-
1404
- // Make sure the object has no tag before resetting top.
1405
- and_(object, object, Operand(~kHeapObjectTagMask));
1406
- #ifdef DEBUG
1407
- // Check that the object un-allocated is below the current top.
1408
- mov(scratch, Operand(new_space_allocation_top));
1409
- ldr(scratch, MemOperand(scratch));
1410
- cmp(object, scratch);
1411
- Check(lt, "Undo allocation of non allocated memory");
1412
- #endif
1413
- // Write the address of the object to un-allocate as the current top.
1414
- mov(scratch, Operand(new_space_allocation_top));
1415
- str(object, MemOperand(scratch));
1416
- }
1417
-
1418
-
1419
- void MacroAssembler::AllocateTwoByteString(Register result,
1420
- Register length,
1421
- Register scratch1,
1422
- Register scratch2,
1423
- Register scratch3,
1424
- Label* gc_required) {
1425
- // Calculate the number of bytes needed for the characters in the string while
1426
- // observing object alignment.
1427
- ASSERT((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
1428
- mov(scratch1, Operand(length, LSL, 1)); // Length in bytes, not chars.
1429
- add(scratch1, scratch1,
1430
- Operand(kObjectAlignmentMask + SeqTwoByteString::kHeaderSize));
1431
- and_(scratch1, scratch1, Operand(~kObjectAlignmentMask));
1432
-
1433
- // Allocate two-byte string in new space.
1434
- AllocateInNewSpace(scratch1,
1435
- result,
1436
- scratch2,
1437
- scratch3,
1438
- gc_required,
1439
- TAG_OBJECT);
1440
-
1441
- // Set the map, length and hash field.
1442
- InitializeNewString(result,
1443
- length,
1444
- Heap::kStringMapRootIndex,
1445
- scratch1,
1446
- scratch2);
1447
- }
1448
-
1449
-
1450
- void MacroAssembler::AllocateAsciiString(Register result,
1451
- Register length,
1452
- Register scratch1,
1453
- Register scratch2,
1454
- Register scratch3,
1455
- Label* gc_required) {
1456
- // Calculate the number of bytes needed for the characters in the string while
1457
- // observing object alignment.
1458
- ASSERT((SeqAsciiString::kHeaderSize & kObjectAlignmentMask) == 0);
1459
- ASSERT(kCharSize == 1);
1460
- add(scratch1, length,
1461
- Operand(kObjectAlignmentMask + SeqAsciiString::kHeaderSize));
1462
- and_(scratch1, scratch1, Operand(~kObjectAlignmentMask));
1463
-
1464
- // Allocate ASCII string in new space.
1465
- AllocateInNewSpace(scratch1,
1466
- result,
1467
- scratch2,
1468
- scratch3,
1469
- gc_required,
1470
- TAG_OBJECT);
1471
-
1472
- // Set the map, length and hash field.
1473
- InitializeNewString(result,
1474
- length,
1475
- Heap::kAsciiStringMapRootIndex,
1476
- scratch1,
1477
- scratch2);
1478
- }
1479
-
1480
-
1481
- void MacroAssembler::AllocateTwoByteConsString(Register result,
1482
- Register length,
1483
- Register scratch1,
1484
- Register scratch2,
1485
- Label* gc_required) {
1486
- AllocateInNewSpace(ConsString::kSize,
1487
- result,
1488
- scratch1,
1489
- scratch2,
1490
- gc_required,
1491
- TAG_OBJECT);
1492
-
1493
- InitializeNewString(result,
1494
- length,
1495
- Heap::kConsStringMapRootIndex,
1496
- scratch1,
1497
- scratch2);
1498
- }
1499
-
1500
-
1501
- void MacroAssembler::AllocateAsciiConsString(Register result,
1502
- Register length,
1503
- Register scratch1,
1504
- Register scratch2,
1505
- Label* gc_required) {
1506
- AllocateInNewSpace(ConsString::kSize,
1507
- result,
1508
- scratch1,
1509
- scratch2,
1510
- gc_required,
1511
- TAG_OBJECT);
1512
-
1513
- InitializeNewString(result,
1514
- length,
1515
- Heap::kConsAsciiStringMapRootIndex,
1516
- scratch1,
1517
- scratch2);
1518
- }
1519
-
1520
-
1521
- void MacroAssembler::CompareObjectType(Register object,
1522
- Register map,
1523
- Register type_reg,
1524
- InstanceType type) {
1525
- ldr(map, FieldMemOperand(object, HeapObject::kMapOffset));
1526
- CompareInstanceType(map, type_reg, type);
1527
- }
1528
-
1529
-
1530
- void MacroAssembler::CompareInstanceType(Register map,
1531
- Register type_reg,
1532
- InstanceType type) {
1533
- ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset));
1534
- cmp(type_reg, Operand(type));
1535
- }
1536
-
1537
-
1538
- void MacroAssembler::CheckMap(Register obj,
1539
- Register scratch,
1540
- Handle<Map> map,
1541
- Label* fail,
1542
- bool is_heap_object) {
1543
- if (!is_heap_object) {
1544
- JumpIfSmi(obj, fail);
1545
- }
1546
- ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset));
1547
- mov(ip, Operand(map));
1548
- cmp(scratch, ip);
1549
- b(ne, fail);
1550
- }
1551
-
1552
-
1553
- void MacroAssembler::CheckMap(Register obj,
1554
- Register scratch,
1555
- Heap::RootListIndex index,
1556
- Label* fail,
1557
- bool is_heap_object) {
1558
- if (!is_heap_object) {
1559
- JumpIfSmi(obj, fail);
1560
- }
1561
- ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset));
1562
- LoadRoot(ip, index);
1563
- cmp(scratch, ip);
1564
- b(ne, fail);
1565
- }
1566
-
1567
-
1568
- void MacroAssembler::TryGetFunctionPrototype(Register function,
1569
- Register result,
1570
- Register scratch,
1571
- Label* miss) {
1572
- // Check that the receiver isn't a smi.
1573
- JumpIfSmi(function, miss);
1574
-
1575
- // Check that the function really is a function. Load map into result reg.
1576
- CompareObjectType(function, result, scratch, JS_FUNCTION_TYPE);
1577
- b(ne, miss);
1578
-
1579
- // Make sure that the function has an instance prototype.
1580
- Label non_instance;
1581
- ldrb(scratch, FieldMemOperand(result, Map::kBitFieldOffset));
1582
- tst(scratch, Operand(1 << Map::kHasNonInstancePrototype));
1583
- b(ne, &non_instance);
1584
-
1585
- // Get the prototype or initial map from the function.
1586
- ldr(result,
1587
- FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
1588
-
1589
- // If the prototype or initial map is the hole, don't return it and
1590
- // simply miss the cache instead. This will allow us to allocate a
1591
- // prototype object on-demand in the runtime system.
1592
- LoadRoot(ip, Heap::kTheHoleValueRootIndex);
1593
- cmp(result, ip);
1594
- b(eq, miss);
1595
-
1596
- // If the function does not have an initial map, we're done.
1597
- Label done;
1598
- CompareObjectType(result, scratch, scratch, MAP_TYPE);
1599
- b(ne, &done);
1600
-
1601
- // Get the prototype from the initial map.
1602
- ldr(result, FieldMemOperand(result, Map::kPrototypeOffset));
1603
- jmp(&done);
1604
-
1605
- // Non-instance prototype: Fetch prototype from constructor field
1606
- // in initial map.
1607
- bind(&non_instance);
1608
- ldr(result, FieldMemOperand(result, Map::kConstructorOffset));
1609
-
1610
- // All done.
1611
- bind(&done);
1612
- }
1613
-
1614
-
1615
- void MacroAssembler::CallStub(CodeStub* stub, Condition cond) {
1616
- ASSERT(allow_stub_calls()); // Stub calls are not allowed in some stubs.
1617
- Call(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
1618
- }
1619
-
1620
-
1621
- void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) {
1622
- ASSERT(allow_stub_calls()); // Stub calls are not allowed in some stubs.
1623
- Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
1624
- }
1625
-
1626
-
1627
- MaybeObject* MacroAssembler::TryTailCallStub(CodeStub* stub, Condition cond) {
1628
- ASSERT(allow_stub_calls()); // Stub calls are not allowed in some stubs.
1629
- Object* result;
1630
- { MaybeObject* maybe_result = stub->TryGetCode();
1631
- if (!maybe_result->ToObject(&result)) return maybe_result;
1632
- }
1633
- Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
1634
- return result;
1635
- }
1636
-
1637
-
1638
- static int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
1639
- return ref0.address() - ref1.address();
1640
- }
1641
-
1642
-
1643
- MaybeObject* MacroAssembler::TryCallApiFunctionAndReturn(
1644
- ExternalReference function, int stack_space) {
1645
- ExternalReference next_address =
1646
- ExternalReference::handle_scope_next_address();
1647
- const int kNextOffset = 0;
1648
- const int kLimitOffset = AddressOffset(
1649
- ExternalReference::handle_scope_limit_address(),
1650
- next_address);
1651
- const int kLevelOffset = AddressOffset(
1652
- ExternalReference::handle_scope_level_address(),
1653
- next_address);
1654
-
1655
- // Allocate HandleScope in callee-save registers.
1656
- mov(r7, Operand(next_address));
1657
- ldr(r4, MemOperand(r7, kNextOffset));
1658
- ldr(r5, MemOperand(r7, kLimitOffset));
1659
- ldr(r6, MemOperand(r7, kLevelOffset));
1660
- add(r6, r6, Operand(1));
1661
- str(r6, MemOperand(r7, kLevelOffset));
1662
-
1663
- // Native call returns to the DirectCEntry stub which redirects to the
1664
- // return address pushed on stack (could have moved after GC).
1665
- // DirectCEntry stub itself is generated early and never moves.
1666
- DirectCEntryStub stub;
1667
- stub.GenerateCall(this, function);
1668
-
1669
- Label promote_scheduled_exception;
1670
- Label delete_allocated_handles;
1671
- Label leave_exit_frame;
1672
-
1673
- // If result is non-zero, dereference to get the result value
1674
- // otherwise set it to undefined.
1675
- cmp(r0, Operand(0));
1676
- LoadRoot(r0, Heap::kUndefinedValueRootIndex, eq);
1677
- ldr(r0, MemOperand(r0), ne);
1678
-
1679
- // No more valid handles (the result handle was the last one). Restore
1680
- // previous handle scope.
1681
- str(r4, MemOperand(r7, kNextOffset));
1682
- if (FLAG_debug_code) {
1683
- ldr(r1, MemOperand(r7, kLevelOffset));
1684
- cmp(r1, r6);
1685
- Check(eq, "Unexpected level after return from api call");
1686
- }
1687
- sub(r6, r6, Operand(1));
1688
- str(r6, MemOperand(r7, kLevelOffset));
1689
- ldr(ip, MemOperand(r7, kLimitOffset));
1690
- cmp(r5, ip);
1691
- b(ne, &delete_allocated_handles);
1692
-
1693
- // Check if the function scheduled an exception.
1694
- bind(&leave_exit_frame);
1695
- LoadRoot(r4, Heap::kTheHoleValueRootIndex);
1696
- mov(ip, Operand(ExternalReference::scheduled_exception_address()));
1697
- ldr(r5, MemOperand(ip));
1698
- cmp(r4, r5);
1699
- b(ne, &promote_scheduled_exception);
1700
-
1701
- // LeaveExitFrame expects unwind space to be in a register.
1702
- mov(r4, Operand(stack_space));
1703
- LeaveExitFrame(false, r4);
1704
- mov(pc, lr);
1705
-
1706
- bind(&promote_scheduled_exception);
1707
- MaybeObject* result = TryTailCallExternalReference(
1708
- ExternalReference(Runtime::kPromoteScheduledException), 0, 1);
1709
- if (result->IsFailure()) {
1710
- return result;
1711
- }
1712
-
1713
- // HandleScope limit has changed. Delete allocated extensions.
1714
- bind(&delete_allocated_handles);
1715
- str(r5, MemOperand(r7, kLimitOffset));
1716
- mov(r4, r0);
1717
- PrepareCallCFunction(0, r5);
1718
- CallCFunction(ExternalReference::delete_handle_scope_extensions(), 0);
1719
- mov(r0, r4);
1720
- jmp(&leave_exit_frame);
1721
-
1722
- return result;
1723
- }
1724
-
1725
-
1726
- void MacroAssembler::IllegalOperation(int num_arguments) {
1727
- if (num_arguments > 0) {
1728
- add(sp, sp, Operand(num_arguments * kPointerSize));
1729
- }
1730
- LoadRoot(r0, Heap::kUndefinedValueRootIndex);
1731
- }
1732
-
1733
-
1734
- void MacroAssembler::IndexFromHash(Register hash, Register index) {
1735
- // If the hash field contains an array index pick it out. The assert checks
1736
- // that the constants for the maximum number of digits for an array index
1737
- // cached in the hash field and the number of bits reserved for it does not
1738
- // conflict.
1739
- ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) <
1740
- (1 << String::kArrayIndexValueBits));
1741
- // We want the smi-tagged index in key. kArrayIndexValueMask has zeros in
1742
- // the low kHashShift bits.
1743
- STATIC_ASSERT(kSmiTag == 0);
1744
- Ubfx(hash, hash, String::kHashShift, String::kArrayIndexValueBits);
1745
- mov(index, Operand(hash, LSL, kSmiTagSize));
1746
- }
1747
-
1748
-
1749
- void MacroAssembler::IntegerToDoubleConversionWithVFP3(Register inReg,
1750
- Register outHighReg,
1751
- Register outLowReg) {
1752
- // ARMv7 VFP3 instructions to implement integer to double conversion.
1753
- mov(r7, Operand(inReg, ASR, kSmiTagSize));
1754
- vmov(s15, r7);
1755
- vcvt_f64_s32(d7, s15);
1756
- vmov(outLowReg, outHighReg, d7);
1757
- }
1758
-
1759
-
1760
- void MacroAssembler::ObjectToDoubleVFPRegister(Register object,
1761
- DwVfpRegister result,
1762
- Register scratch1,
1763
- Register scratch2,
1764
- Register heap_number_map,
1765
- SwVfpRegister scratch3,
1766
- Label* not_number,
1767
- ObjectToDoubleFlags flags) {
1768
- Label done;
1769
- if ((flags & OBJECT_NOT_SMI) == 0) {
1770
- Label not_smi;
1771
- JumpIfNotSmi(object, &not_smi);
1772
- // Remove smi tag and convert to double.
1773
- mov(scratch1, Operand(object, ASR, kSmiTagSize));
1774
- vmov(scratch3, scratch1);
1775
- vcvt_f64_s32(result, scratch3);
1776
- b(&done);
1777
- bind(&not_smi);
1778
- }
1779
- // Check for heap number and load double value from it.
1780
- ldr(scratch1, FieldMemOperand(object, HeapObject::kMapOffset));
1781
- sub(scratch2, object, Operand(kHeapObjectTag));
1782
- cmp(scratch1, heap_number_map);
1783
- b(ne, not_number);
1784
- if ((flags & AVOID_NANS_AND_INFINITIES) != 0) {
1785
- // If exponent is all ones the number is either a NaN or +/-Infinity.
1786
- ldr(scratch1, FieldMemOperand(object, HeapNumber::kExponentOffset));
1787
- Sbfx(scratch1,
1788
- scratch1,
1789
- HeapNumber::kExponentShift,
1790
- HeapNumber::kExponentBits);
1791
- // All-one value sign extend to -1.
1792
- cmp(scratch1, Operand(-1));
1793
- b(eq, not_number);
1794
- }
1795
- vldr(result, scratch2, HeapNumber::kValueOffset);
1796
- bind(&done);
1797
- }
1798
-
1799
-
1800
- void MacroAssembler::SmiToDoubleVFPRegister(Register smi,
1801
- DwVfpRegister value,
1802
- Register scratch1,
1803
- SwVfpRegister scratch2) {
1804
- mov(scratch1, Operand(smi, ASR, kSmiTagSize));
1805
- vmov(scratch2, scratch1);
1806
- vcvt_f64_s32(value, scratch2);
1807
- }
1808
-
1809
-
1810
- // Tries to get a signed int32 out of a double precision floating point heap
1811
- // number. Rounds towards 0. Branch to 'not_int32' if the double is out of the
1812
- // 32bits signed integer range.
1813
- void MacroAssembler::ConvertToInt32(Register source,
1814
- Register dest,
1815
- Register scratch,
1816
- Register scratch2,
1817
- DwVfpRegister double_scratch,
1818
- Label *not_int32) {
1819
- if (CpuFeatures::IsSupported(VFP3)) {
1820
- CpuFeatures::Scope scope(VFP3);
1821
- sub(scratch, source, Operand(kHeapObjectTag));
1822
- vldr(double_scratch, scratch, HeapNumber::kValueOffset);
1823
- vcvt_s32_f64(double_scratch.low(), double_scratch);
1824
- vmov(dest, double_scratch.low());
1825
- // Signed vcvt instruction will saturate to the minimum (0x80000000) or
1826
- // maximun (0x7fffffff) signed 32bits integer when the double is out of
1827
- // range. When substracting one, the minimum signed integer becomes the
1828
- // maximun signed integer.
1829
- sub(scratch, dest, Operand(1));
1830
- cmp(scratch, Operand(LONG_MAX - 1));
1831
- // If equal then dest was LONG_MAX, if greater dest was LONG_MIN.
1832
- b(ge, not_int32);
1833
- } else {
1834
- // This code is faster for doubles that are in the ranges -0x7fffffff to
1835
- // -0x40000000 or 0x40000000 to 0x7fffffff. This corresponds almost to
1836
- // the range of signed int32 values that are not Smis. Jumps to the label
1837
- // 'not_int32' if the double isn't in the range -0x80000000.0 to
1838
- // 0x80000000.0 (excluding the endpoints).
1839
- Label right_exponent, done;
1840
- // Get exponent word.
1841
- ldr(scratch, FieldMemOperand(source, HeapNumber::kExponentOffset));
1842
- // Get exponent alone in scratch2.
1843
- Ubfx(scratch2,
1844
- scratch,
1845
- HeapNumber::kExponentShift,
1846
- HeapNumber::kExponentBits);
1847
- // Load dest with zero. We use this either for the final shift or
1848
- // for the answer.
1849
- mov(dest, Operand(0, RelocInfo::NONE));
1850
- // Check whether the exponent matches a 32 bit signed int that is not a Smi.
1851
- // A non-Smi integer is 1.xxx * 2^30 so the exponent is 30 (biased). This is
1852
- // the exponent that we are fastest at and also the highest exponent we can
1853
- // handle here.
1854
- const uint32_t non_smi_exponent = HeapNumber::kExponentBias + 30;
1855
- // The non_smi_exponent, 0x41d, is too big for ARM's immediate field so we
1856
- // split it up to avoid a constant pool entry. You can't do that in general
1857
- // for cmp because of the overflow flag, but we know the exponent is in the
1858
- // range 0-2047 so there is no overflow.
1859
- int fudge_factor = 0x400;
1860
- sub(scratch2, scratch2, Operand(fudge_factor));
1861
- cmp(scratch2, Operand(non_smi_exponent - fudge_factor));
1862
- // If we have a match of the int32-but-not-Smi exponent then skip some
1863
- // logic.
1864
- b(eq, &right_exponent);
1865
- // If the exponent is higher than that then go to slow case. This catches
1866
- // numbers that don't fit in a signed int32, infinities and NaNs.
1867
- b(gt, not_int32);
1868
-
1869
- // We know the exponent is smaller than 30 (biased). If it is less than
1870
- // 0 (biased) then the number is smaller in magnitude than 1.0 * 2^0, ie
1871
- // it rounds to zero.
1872
- const uint32_t zero_exponent = HeapNumber::kExponentBias + 0;
1873
- sub(scratch2, scratch2, Operand(zero_exponent - fudge_factor), SetCC);
1874
- // Dest already has a Smi zero.
1875
- b(lt, &done);
1876
-
1877
- // We have an exponent between 0 and 30 in scratch2. Subtract from 30 to
1878
- // get how much to shift down.
1879
- rsb(dest, scratch2, Operand(30));
1880
-
1881
- bind(&right_exponent);
1882
- // Get the top bits of the mantissa.
1883
- and_(scratch2, scratch, Operand(HeapNumber::kMantissaMask));
1884
- // Put back the implicit 1.
1885
- orr(scratch2, scratch2, Operand(1 << HeapNumber::kExponentShift));
1886
- // Shift up the mantissa bits to take up the space the exponent used to
1887
- // take. We just orred in the implicit bit so that took care of one and
1888
- // we want to leave the sign bit 0 so we subtract 2 bits from the shift
1889
- // distance.
1890
- const int shift_distance = HeapNumber::kNonMantissaBitsInTopWord - 2;
1891
- mov(scratch2, Operand(scratch2, LSL, shift_distance));
1892
- // Put sign in zero flag.
1893
- tst(scratch, Operand(HeapNumber::kSignMask));
1894
- // Get the second half of the double. For some exponents we don't
1895
- // actually need this because the bits get shifted out again, but
1896
- // it's probably slower to test than just to do it.
1897
- ldr(scratch, FieldMemOperand(source, HeapNumber::kMantissaOffset));
1898
- // Shift down 22 bits to get the last 10 bits.
1899
- orr(scratch, scratch2, Operand(scratch, LSR, 32 - shift_distance));
1900
- // Move down according to the exponent.
1901
- mov(dest, Operand(scratch, LSR, dest));
1902
- // Fix sign if sign bit was set.
1903
- rsb(dest, dest, Operand(0, RelocInfo::NONE), LeaveCC, ne);
1904
- bind(&done);
1905
- }
1906
- }
1907
-
1908
-
1909
- void MacroAssembler::EmitVFPTruncate(VFPRoundingMode rounding_mode,
1910
- SwVfpRegister result,
1911
- DwVfpRegister double_input,
1912
- Register scratch1,
1913
- Register scratch2,
1914
- CheckForInexactConversion check_inexact) {
1915
- ASSERT(CpuFeatures::IsSupported(VFP3));
1916
- CpuFeatures::Scope scope(VFP3);
1917
- Register prev_fpscr = scratch1;
1918
- Register scratch = scratch2;
1919
-
1920
- int32_t check_inexact_conversion =
1921
- (check_inexact == kCheckForInexactConversion) ? kVFPInexactExceptionBit : 0;
1922
-
1923
- // Set custom FPCSR:
1924
- // - Set rounding mode.
1925
- // - Clear vfp cumulative exception flags.
1926
- // - Make sure Flush-to-zero mode control bit is unset.
1927
- vmrs(prev_fpscr);
1928
- bic(scratch,
1929
- prev_fpscr,
1930
- Operand(kVFPExceptionMask |
1931
- check_inexact_conversion |
1932
- kVFPRoundingModeMask |
1933
- kVFPFlushToZeroMask));
1934
- // 'Round To Nearest' is encoded by 0b00 so no bits need to be set.
1935
- if (rounding_mode != kRoundToNearest) {
1936
- orr(scratch, scratch, Operand(rounding_mode));
1937
- }
1938
- vmsr(scratch);
1939
-
1940
- // Convert the argument to an integer.
1941
- vcvt_s32_f64(result,
1942
- double_input,
1943
- (rounding_mode == kRoundToZero) ? kDefaultRoundToZero
1944
- : kFPSCRRounding);
1945
-
1946
- // Retrieve FPSCR.
1947
- vmrs(scratch);
1948
- // Restore FPSCR.
1949
- vmsr(prev_fpscr);
1950
- // Check for vfp exceptions.
1951
- tst(scratch, Operand(kVFPExceptionMask | check_inexact_conversion));
1952
- }
1953
-
1954
-
1955
- void MacroAssembler::GetLeastBitsFromSmi(Register dst,
1956
- Register src,
1957
- int num_least_bits) {
1958
- if (CpuFeatures::IsSupported(ARMv7)) {
1959
- ubfx(dst, src, kSmiTagSize, num_least_bits);
1960
- } else {
1961
- mov(dst, Operand(src, ASR, kSmiTagSize));
1962
- and_(dst, dst, Operand((1 << num_least_bits) - 1));
1963
- }
1964
- }
1965
-
1966
-
1967
- void MacroAssembler::GetLeastBitsFromInt32(Register dst,
1968
- Register src,
1969
- int num_least_bits) {
1970
- and_(dst, src, Operand((1 << num_least_bits) - 1));
1971
- }
1972
-
1973
-
1974
- void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) {
1975
- // All parameters are on the stack. r0 has the return value after call.
1976
-
1977
- // If the expected number of arguments of the runtime function is
1978
- // constant, we check that the actual number of arguments match the
1979
- // expectation.
1980
- if (f->nargs >= 0 && f->nargs != num_arguments) {
1981
- IllegalOperation(num_arguments);
1982
- return;
1983
- }
1984
-
1985
- // TODO(1236192): Most runtime routines don't need the number of
1986
- // arguments passed in because it is constant. At some point we
1987
- // should remove this need and make the runtime routine entry code
1988
- // smarter.
1989
- mov(r0, Operand(num_arguments));
1990
- mov(r1, Operand(ExternalReference(f)));
1991
- CEntryStub stub(1);
1992
- CallStub(&stub);
1993
- }
1994
-
1995
-
1996
- void MacroAssembler::CallRuntime(Runtime::FunctionId fid, int num_arguments) {
1997
- CallRuntime(Runtime::FunctionForId(fid), num_arguments);
1998
- }
1999
-
2000
-
2001
- void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) {
2002
- Runtime::Function* function = Runtime::FunctionForId(id);
2003
- mov(r0, Operand(function->nargs));
2004
- mov(r1, Operand(ExternalReference(function)));
2005
- CEntryStub stub(1);
2006
- stub.SaveDoubles();
2007
- CallStub(&stub);
2008
- }
2009
-
2010
-
2011
- void MacroAssembler::CallExternalReference(const ExternalReference& ext,
2012
- int num_arguments) {
2013
- mov(r0, Operand(num_arguments));
2014
- mov(r1, Operand(ext));
2015
-
2016
- CEntryStub stub(1);
2017
- CallStub(&stub);
2018
- }
2019
-
2020
-
2021
- void MacroAssembler::TailCallExternalReference(const ExternalReference& ext,
2022
- int num_arguments,
2023
- int result_size) {
2024
- // TODO(1236192): Most runtime routines don't need the number of
2025
- // arguments passed in because it is constant. At some point we
2026
- // should remove this need and make the runtime routine entry code
2027
- // smarter.
2028
- mov(r0, Operand(num_arguments));
2029
- JumpToExternalReference(ext);
2030
- }
2031
-
2032
-
2033
- MaybeObject* MacroAssembler::TryTailCallExternalReference(
2034
- const ExternalReference& ext, int num_arguments, int result_size) {
2035
- // TODO(1236192): Most runtime routines don't need the number of
2036
- // arguments passed in because it is constant. At some point we
2037
- // should remove this need and make the runtime routine entry code
2038
- // smarter.
2039
- mov(r0, Operand(num_arguments));
2040
- return TryJumpToExternalReference(ext);
2041
- }
2042
-
2043
-
2044
- void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
2045
- int num_arguments,
2046
- int result_size) {
2047
- TailCallExternalReference(ExternalReference(fid), num_arguments, result_size);
2048
- }
2049
-
2050
-
2051
- void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) {
2052
- #if defined(__thumb__)
2053
- // Thumb mode builtin.
2054
- ASSERT((reinterpret_cast<intptr_t>(builtin.address()) & 1) == 1);
2055
- #endif
2056
- mov(r1, Operand(builtin));
2057
- CEntryStub stub(1);
2058
- Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
2059
- }
2060
-
2061
-
2062
- MaybeObject* MacroAssembler::TryJumpToExternalReference(
2063
- const ExternalReference& builtin) {
2064
- #if defined(__thumb__)
2065
- // Thumb mode builtin.
2066
- ASSERT((reinterpret_cast<intptr_t>(builtin.address()) & 1) == 1);
2067
- #endif
2068
- mov(r1, Operand(builtin));
2069
- CEntryStub stub(1);
2070
- return TryTailCallStub(&stub);
2071
- }
2072
-
2073
-
2074
- void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
2075
- InvokeJSFlags flags,
2076
- PostCallGenerator* post_call_generator) {
2077
- GetBuiltinEntry(r2, id);
2078
- if (flags == CALL_JS) {
2079
- Call(r2);
2080
- if (post_call_generator != NULL) post_call_generator->Generate();
2081
- } else {
2082
- ASSERT(flags == JUMP_JS);
2083
- Jump(r2);
2084
- }
2085
- }
2086
-
2087
-
2088
- void MacroAssembler::GetBuiltinFunction(Register target,
2089
- Builtins::JavaScript id) {
2090
- // Load the builtins object into target register.
2091
- ldr(target, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
2092
- ldr(target, FieldMemOperand(target, GlobalObject::kBuiltinsOffset));
2093
- // Load the JavaScript builtin function from the builtins object.
2094
- ldr(target, FieldMemOperand(target,
2095
- JSBuiltinsObject::OffsetOfFunctionWithId(id)));
2096
- }
2097
-
2098
-
2099
- void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) {
2100
- ASSERT(!target.is(r1));
2101
- GetBuiltinFunction(r1, id);
2102
- // Load the code entry point from the builtins object.
2103
- ldr(target, FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
2104
- }
2105
-
2106
-
2107
- void MacroAssembler::SetCounter(StatsCounter* counter, int value,
2108
- Register scratch1, Register scratch2) {
2109
- if (FLAG_native_code_counters && counter->Enabled()) {
2110
- mov(scratch1, Operand(value));
2111
- mov(scratch2, Operand(ExternalReference(counter)));
2112
- str(scratch1, MemOperand(scratch2));
2113
- }
2114
- }
2115
-
2116
-
2117
- void MacroAssembler::IncrementCounter(StatsCounter* counter, int value,
2118
- Register scratch1, Register scratch2) {
2119
- ASSERT(value > 0);
2120
- if (FLAG_native_code_counters && counter->Enabled()) {
2121
- mov(scratch2, Operand(ExternalReference(counter)));
2122
- ldr(scratch1, MemOperand(scratch2));
2123
- add(scratch1, scratch1, Operand(value));
2124
- str(scratch1, MemOperand(scratch2));
2125
- }
2126
- }
2127
-
2128
-
2129
- void MacroAssembler::DecrementCounter(StatsCounter* counter, int value,
2130
- Register scratch1, Register scratch2) {
2131
- ASSERT(value > 0);
2132
- if (FLAG_native_code_counters && counter->Enabled()) {
2133
- mov(scratch2, Operand(ExternalReference(counter)));
2134
- ldr(scratch1, MemOperand(scratch2));
2135
- sub(scratch1, scratch1, Operand(value));
2136
- str(scratch1, MemOperand(scratch2));
2137
- }
2138
- }
2139
-
2140
-
2141
- void MacroAssembler::Assert(Condition cond, const char* msg) {
2142
- if (FLAG_debug_code)
2143
- Check(cond, msg);
2144
- }
2145
-
2146
-
2147
- void MacroAssembler::AssertRegisterIsRoot(Register reg,
2148
- Heap::RootListIndex index) {
2149
- if (FLAG_debug_code) {
2150
- LoadRoot(ip, index);
2151
- cmp(reg, ip);
2152
- Check(eq, "Register did not match expected root");
2153
- }
2154
- }
2155
-
2156
-
2157
- void MacroAssembler::AssertFastElements(Register elements) {
2158
- if (FLAG_debug_code) {
2159
- ASSERT(!elements.is(ip));
2160
- Label ok;
2161
- push(elements);
2162
- ldr(elements, FieldMemOperand(elements, HeapObject::kMapOffset));
2163
- LoadRoot(ip, Heap::kFixedArrayMapRootIndex);
2164
- cmp(elements, ip);
2165
- b(eq, &ok);
2166
- LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex);
2167
- cmp(elements, ip);
2168
- b(eq, &ok);
2169
- Abort("JSObject with fast elements map has slow elements");
2170
- bind(&ok);
2171
- pop(elements);
2172
- }
2173
- }
2174
-
2175
-
2176
- void MacroAssembler::Check(Condition cond, const char* msg) {
2177
- Label L;
2178
- b(cond, &L);
2179
- Abort(msg);
2180
- // will not return here
2181
- bind(&L);
2182
- }
2183
-
2184
-
2185
- void MacroAssembler::Abort(const char* msg) {
2186
- Label abort_start;
2187
- bind(&abort_start);
2188
- // We want to pass the msg string like a smi to avoid GC
2189
- // problems, however msg is not guaranteed to be aligned
2190
- // properly. Instead, we pass an aligned pointer that is
2191
- // a proper v8 smi, but also pass the alignment difference
2192
- // from the real pointer as a smi.
2193
- intptr_t p1 = reinterpret_cast<intptr_t>(msg);
2194
- intptr_t p0 = (p1 & ~kSmiTagMask) + kSmiTag;
2195
- ASSERT(reinterpret_cast<Object*>(p0)->IsSmi());
2196
- #ifdef DEBUG
2197
- if (msg != NULL) {
2198
- RecordComment("Abort message: ");
2199
- RecordComment(msg);
2200
- }
2201
- #endif
2202
- // Disable stub call restrictions to always allow calls to abort.
2203
- AllowStubCallsScope allow_scope(this, true);
2204
-
2205
- mov(r0, Operand(p0));
2206
- push(r0);
2207
- mov(r0, Operand(Smi::FromInt(p1 - p0)));
2208
- push(r0);
2209
- CallRuntime(Runtime::kAbort, 2);
2210
- // will not return here
2211
- if (is_const_pool_blocked()) {
2212
- // If the calling code cares about the exact number of
2213
- // instructions generated, we insert padding here to keep the size
2214
- // of the Abort macro constant.
2215
- static const int kExpectedAbortInstructions = 10;
2216
- int abort_instructions = InstructionsGeneratedSince(&abort_start);
2217
- ASSERT(abort_instructions <= kExpectedAbortInstructions);
2218
- while (abort_instructions++ < kExpectedAbortInstructions) {
2219
- nop();
2220
- }
2221
- }
2222
- }
2223
-
2224
-
2225
- void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
2226
- if (context_chain_length > 0) {
2227
- // Move up the chain of contexts to the context containing the slot.
2228
- ldr(dst, MemOperand(cp, Context::SlotOffset(Context::CLOSURE_INDEX)));
2229
- // Load the function context (which is the incoming, outer context).
2230
- ldr(dst, FieldMemOperand(dst, JSFunction::kContextOffset));
2231
- for (int i = 1; i < context_chain_length; i++) {
2232
- ldr(dst, MemOperand(dst, Context::SlotOffset(Context::CLOSURE_INDEX)));
2233
- ldr(dst, FieldMemOperand(dst, JSFunction::kContextOffset));
2234
- }
2235
- } else {
2236
- // Slot is in the current function context. Move it into the
2237
- // destination register in case we store into it (the write barrier
2238
- // cannot be allowed to destroy the context in esi).
2239
- mov(dst, cp);
2240
- }
2241
-
2242
- // We should not have found a 'with' context by walking the context chain
2243
- // (i.e., the static scope chain and runtime context chain do not agree).
2244
- // A variable occurring in such a scope should have slot type LOOKUP and
2245
- // not CONTEXT.
2246
- if (FLAG_debug_code) {
2247
- ldr(ip, MemOperand(dst, Context::SlotOffset(Context::FCONTEXT_INDEX)));
2248
- cmp(dst, ip);
2249
- Check(eq, "Yo dawg, I heard you liked function contexts "
2250
- "so I put function contexts in all your contexts");
2251
- }
2252
- }
2253
-
2254
-
2255
- void MacroAssembler::LoadGlobalFunction(int index, Register function) {
2256
- // Load the global or builtins object from the current context.
2257
- ldr(function, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
2258
- // Load the global context from the global or builtins object.
2259
- ldr(function, FieldMemOperand(function,
2260
- GlobalObject::kGlobalContextOffset));
2261
- // Load the function from the global context.
2262
- ldr(function, MemOperand(function, Context::SlotOffset(index)));
2263
- }
2264
-
2265
-
2266
- void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
2267
- Register map,
2268
- Register scratch) {
2269
- // Load the initial map. The global functions all have initial maps.
2270
- ldr(map, FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
2271
- if (FLAG_debug_code) {
2272
- Label ok, fail;
2273
- CheckMap(map, scratch, Heap::kMetaMapRootIndex, &fail, false);
2274
- b(&ok);
2275
- bind(&fail);
2276
- Abort("Global functions must have initial map");
2277
- bind(&ok);
2278
- }
2279
- }
2280
-
2281
-
2282
- void MacroAssembler::JumpIfNotPowerOfTwoOrZero(
2283
- Register reg,
2284
- Register scratch,
2285
- Label* not_power_of_two_or_zero) {
2286
- sub(scratch, reg, Operand(1), SetCC);
2287
- b(mi, not_power_of_two_or_zero);
2288
- tst(scratch, reg);
2289
- b(ne, not_power_of_two_or_zero);
2290
- }
2291
-
2292
-
2293
- void MacroAssembler::JumpIfNotBothSmi(Register reg1,
2294
- Register reg2,
2295
- Label* on_not_both_smi) {
2296
- STATIC_ASSERT(kSmiTag == 0);
2297
- tst(reg1, Operand(kSmiTagMask));
2298
- tst(reg2, Operand(kSmiTagMask), eq);
2299
- b(ne, on_not_both_smi);
2300
- }
2301
-
2302
-
2303
- void MacroAssembler::JumpIfEitherSmi(Register reg1,
2304
- Register reg2,
2305
- Label* on_either_smi) {
2306
- STATIC_ASSERT(kSmiTag == 0);
2307
- tst(reg1, Operand(kSmiTagMask));
2308
- tst(reg2, Operand(kSmiTagMask), ne);
2309
- b(eq, on_either_smi);
2310
- }
2311
-
2312
-
2313
- void MacroAssembler::AbortIfSmi(Register object) {
2314
- STATIC_ASSERT(kSmiTag == 0);
2315
- tst(object, Operand(kSmiTagMask));
2316
- Assert(ne, "Operand is a smi");
2317
- }
2318
-
2319
-
2320
- void MacroAssembler::AbortIfNotSmi(Register object) {
2321
- STATIC_ASSERT(kSmiTag == 0);
2322
- tst(object, Operand(kSmiTagMask));
2323
- Assert(eq, "Operand is not smi");
2324
- }
2325
-
2326
-
2327
- void MacroAssembler::AbortIfNotString(Register object) {
2328
- STATIC_ASSERT(kSmiTag == 0);
2329
- tst(object, Operand(kSmiTagMask));
2330
- Assert(ne, "Operand is not a string");
2331
- push(object);
2332
- ldr(object, FieldMemOperand(object, HeapObject::kMapOffset));
2333
- CompareInstanceType(object, object, FIRST_NONSTRING_TYPE);
2334
- pop(object);
2335
- Assert(lo, "Operand is not a string");
2336
- }
2337
-
2338
-
2339
-
2340
- void MacroAssembler::AbortIfNotRootValue(Register src,
2341
- Heap::RootListIndex root_value_index,
2342
- const char* message) {
2343
- ASSERT(!src.is(ip));
2344
- LoadRoot(ip, root_value_index);
2345
- cmp(src, ip);
2346
- Assert(eq, message);
2347
- }
2348
-
2349
-
2350
- void MacroAssembler::JumpIfNotHeapNumber(Register object,
2351
- Register heap_number_map,
2352
- Register scratch,
2353
- Label* on_not_heap_number) {
2354
- ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
2355
- AssertRegisterIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
2356
- cmp(scratch, heap_number_map);
2357
- b(ne, on_not_heap_number);
2358
- }
2359
-
2360
-
2361
- void MacroAssembler::JumpIfNonSmisNotBothSequentialAsciiStrings(
2362
- Register first,
2363
- Register second,
2364
- Register scratch1,
2365
- Register scratch2,
2366
- Label* failure) {
2367
- // Test that both first and second are sequential ASCII strings.
2368
- // Assume that they are non-smis.
2369
- ldr(scratch1, FieldMemOperand(first, HeapObject::kMapOffset));
2370
- ldr(scratch2, FieldMemOperand(second, HeapObject::kMapOffset));
2371
- ldrb(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset));
2372
- ldrb(scratch2, FieldMemOperand(scratch2, Map::kInstanceTypeOffset));
2373
-
2374
- JumpIfBothInstanceTypesAreNotSequentialAscii(scratch1,
2375
- scratch2,
2376
- scratch1,
2377
- scratch2,
2378
- failure);
2379
- }
2380
-
2381
- void MacroAssembler::JumpIfNotBothSequentialAsciiStrings(Register first,
2382
- Register second,
2383
- Register scratch1,
2384
- Register scratch2,
2385
- Label* failure) {
2386
- // Check that neither is a smi.
2387
- STATIC_ASSERT(kSmiTag == 0);
2388
- and_(scratch1, first, Operand(second));
2389
- tst(scratch1, Operand(kSmiTagMask));
2390
- b(eq, failure);
2391
- JumpIfNonSmisNotBothSequentialAsciiStrings(first,
2392
- second,
2393
- scratch1,
2394
- scratch2,
2395
- failure);
2396
- }
2397
-
2398
-
2399
- // Allocates a heap number or jumps to the need_gc label if the young space
2400
- // is full and a scavenge is needed.
2401
- void MacroAssembler::AllocateHeapNumber(Register result,
2402
- Register scratch1,
2403
- Register scratch2,
2404
- Register heap_number_map,
2405
- Label* gc_required) {
2406
- // Allocate an object in the heap for the heap number and tag it as a heap
2407
- // object.
2408
- AllocateInNewSpace(HeapNumber::kSize,
2409
- result,
2410
- scratch1,
2411
- scratch2,
2412
- gc_required,
2413
- TAG_OBJECT);
2414
-
2415
- // Store heap number map in the allocated object.
2416
- AssertRegisterIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
2417
- str(heap_number_map, FieldMemOperand(result, HeapObject::kMapOffset));
2418
- }
2419
-
2420
-
2421
- void MacroAssembler::AllocateHeapNumberWithValue(Register result,
2422
- DwVfpRegister value,
2423
- Register scratch1,
2424
- Register scratch2,
2425
- Register heap_number_map,
2426
- Label* gc_required) {
2427
- AllocateHeapNumber(result, scratch1, scratch2, heap_number_map, gc_required);
2428
- sub(scratch1, result, Operand(kHeapObjectTag));
2429
- vstr(value, scratch1, HeapNumber::kValueOffset);
2430
- }
2431
-
2432
-
2433
- // Copies a fixed number of fields of heap objects from src to dst.
2434
- void MacroAssembler::CopyFields(Register dst,
2435
- Register src,
2436
- RegList temps,
2437
- int field_count) {
2438
- // At least one bit set in the first 15 registers.
2439
- ASSERT((temps & ((1 << 15) - 1)) != 0);
2440
- ASSERT((temps & dst.bit()) == 0);
2441
- ASSERT((temps & src.bit()) == 0);
2442
- // Primitive implementation using only one temporary register.
2443
-
2444
- Register tmp = no_reg;
2445
- // Find a temp register in temps list.
2446
- for (int i = 0; i < 15; i++) {
2447
- if ((temps & (1 << i)) != 0) {
2448
- tmp.set_code(i);
2449
- break;
2450
- }
2451
- }
2452
- ASSERT(!tmp.is(no_reg));
2453
-
2454
- for (int i = 0; i < field_count; i++) {
2455
- ldr(tmp, FieldMemOperand(src, i * kPointerSize));
2456
- str(tmp, FieldMemOperand(dst, i * kPointerSize));
2457
- }
2458
- }
2459
-
2460
-
2461
- void MacroAssembler::CopyBytes(Register src,
2462
- Register dst,
2463
- Register length,
2464
- Register scratch) {
2465
- Label align_loop, align_loop_1, word_loop, byte_loop, byte_loop_1, done;
2466
-
2467
- // Align src before copying in word size chunks.
2468
- bind(&align_loop);
2469
- cmp(length, Operand(0));
2470
- b(eq, &done);
2471
- bind(&align_loop_1);
2472
- tst(src, Operand(kPointerSize - 1));
2473
- b(eq, &word_loop);
2474
- ldrb(scratch, MemOperand(src, 1, PostIndex));
2475
- strb(scratch, MemOperand(dst, 1, PostIndex));
2476
- sub(length, length, Operand(1), SetCC);
2477
- b(ne, &byte_loop_1);
2478
-
2479
- // Copy bytes in word size chunks.
2480
- bind(&word_loop);
2481
- if (FLAG_debug_code) {
2482
- tst(src, Operand(kPointerSize - 1));
2483
- Assert(eq, "Expecting alignment for CopyBytes");
2484
- }
2485
- cmp(length, Operand(kPointerSize));
2486
- b(lt, &byte_loop);
2487
- ldr(scratch, MemOperand(src, kPointerSize, PostIndex));
2488
- #if CAN_USE_UNALIGNED_ACCESSES
2489
- str(scratch, MemOperand(dst, kPointerSize, PostIndex));
2490
- #else
2491
- strb(scratch, MemOperand(dst, 1, PostIndex));
2492
- mov(scratch, Operand(scratch, LSR, 8));
2493
- strb(scratch, MemOperand(dst, 1, PostIndex));
2494
- mov(scratch, Operand(scratch, LSR, 8));
2495
- strb(scratch, MemOperand(dst, 1, PostIndex));
2496
- mov(scratch, Operand(scratch, LSR, 8));
2497
- strb(scratch, MemOperand(dst, 1, PostIndex));
2498
- #endif
2499
- sub(length, length, Operand(kPointerSize));
2500
- b(&word_loop);
2501
-
2502
- // Copy the last bytes if any left.
2503
- bind(&byte_loop);
2504
- cmp(length, Operand(0));
2505
- b(eq, &done);
2506
- bind(&byte_loop_1);
2507
- ldrb(scratch, MemOperand(src, 1, PostIndex));
2508
- strb(scratch, MemOperand(dst, 1, PostIndex));
2509
- sub(length, length, Operand(1), SetCC);
2510
- b(ne, &byte_loop_1);
2511
- bind(&done);
2512
- }
2513
-
2514
-
2515
- void MacroAssembler::CountLeadingZeros(Register zeros, // Answer.
2516
- Register source, // Input.
2517
- Register scratch) {
2518
- ASSERT(!zeros.is(source) || !source.is(scratch));
2519
- ASSERT(!zeros.is(scratch));
2520
- ASSERT(!scratch.is(ip));
2521
- ASSERT(!source.is(ip));
2522
- ASSERT(!zeros.is(ip));
2523
- #ifdef CAN_USE_ARMV5_INSTRUCTIONS
2524
- clz(zeros, source); // This instruction is only supported after ARM5.
2525
- #else
2526
- mov(zeros, Operand(0, RelocInfo::NONE));
2527
- Move(scratch, source);
2528
- // Top 16.
2529
- tst(scratch, Operand(0xffff0000));
2530
- add(zeros, zeros, Operand(16), LeaveCC, eq);
2531
- mov(scratch, Operand(scratch, LSL, 16), LeaveCC, eq);
2532
- // Top 8.
2533
- tst(scratch, Operand(0xff000000));
2534
- add(zeros, zeros, Operand(8), LeaveCC, eq);
2535
- mov(scratch, Operand(scratch, LSL, 8), LeaveCC, eq);
2536
- // Top 4.
2537
- tst(scratch, Operand(0xf0000000));
2538
- add(zeros, zeros, Operand(4), LeaveCC, eq);
2539
- mov(scratch, Operand(scratch, LSL, 4), LeaveCC, eq);
2540
- // Top 2.
2541
- tst(scratch, Operand(0xc0000000));
2542
- add(zeros, zeros, Operand(2), LeaveCC, eq);
2543
- mov(scratch, Operand(scratch, LSL, 2), LeaveCC, eq);
2544
- // Top bit.
2545
- tst(scratch, Operand(0x80000000u));
2546
- add(zeros, zeros, Operand(1), LeaveCC, eq);
2547
- #endif
2548
- }
2549
-
2550
-
2551
- void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii(
2552
- Register first,
2553
- Register second,
2554
- Register scratch1,
2555
- Register scratch2,
2556
- Label* failure) {
2557
- int kFlatAsciiStringMask =
2558
- kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask;
2559
- int kFlatAsciiStringTag = ASCII_STRING_TYPE;
2560
- and_(scratch1, first, Operand(kFlatAsciiStringMask));
2561
- and_(scratch2, second, Operand(kFlatAsciiStringMask));
2562
- cmp(scratch1, Operand(kFlatAsciiStringTag));
2563
- // Ignore second test if first test failed.
2564
- cmp(scratch2, Operand(kFlatAsciiStringTag), eq);
2565
- b(ne, failure);
2566
- }
2567
-
2568
-
2569
- void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(Register type,
2570
- Register scratch,
2571
- Label* failure) {
2572
- int kFlatAsciiStringMask =
2573
- kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask;
2574
- int kFlatAsciiStringTag = ASCII_STRING_TYPE;
2575
- and_(scratch, type, Operand(kFlatAsciiStringMask));
2576
- cmp(scratch, Operand(kFlatAsciiStringTag));
2577
- b(ne, failure);
2578
- }
2579
-
2580
-
2581
- void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) {
2582
- int frame_alignment = ActivationFrameAlignment();
2583
- // Up to four simple arguments are passed in registers r0..r3.
2584
- int stack_passed_arguments = (num_arguments <= 4) ? 0 : num_arguments - 4;
2585
- if (frame_alignment > kPointerSize) {
2586
- // Make stack end at alignment and make room for num_arguments - 4 words
2587
- // and the original value of sp.
2588
- mov(scratch, sp);
2589
- sub(sp, sp, Operand((stack_passed_arguments + 1) * kPointerSize));
2590
- ASSERT(IsPowerOf2(frame_alignment));
2591
- and_(sp, sp, Operand(-frame_alignment));
2592
- str(scratch, MemOperand(sp, stack_passed_arguments * kPointerSize));
2593
- } else {
2594
- sub(sp, sp, Operand(stack_passed_arguments * kPointerSize));
2595
- }
2596
- }
2597
-
2598
-
2599
- void MacroAssembler::CallCFunction(ExternalReference function,
2600
- int num_arguments) {
2601
- mov(ip, Operand(function));
2602
- CallCFunction(ip, num_arguments);
2603
- }
2604
-
2605
-
2606
- void MacroAssembler::CallCFunction(Register function, int num_arguments) {
2607
- // Make sure that the stack is aligned before calling a C function unless
2608
- // running in the simulator. The simulator has its own alignment check which
2609
- // provides more information.
2610
- #if defined(V8_HOST_ARCH_ARM)
2611
- if (FLAG_debug_code) {
2612
- int frame_alignment = OS::ActivationFrameAlignment();
2613
- int frame_alignment_mask = frame_alignment - 1;
2614
- if (frame_alignment > kPointerSize) {
2615
- ASSERT(IsPowerOf2(frame_alignment));
2616
- Label alignment_as_expected;
2617
- tst(sp, Operand(frame_alignment_mask));
2618
- b(eq, &alignment_as_expected);
2619
- // Don't use Check here, as it will call Runtime_Abort possibly
2620
- // re-entering here.
2621
- stop("Unexpected alignment");
2622
- bind(&alignment_as_expected);
2623
- }
2624
- }
2625
- #endif
2626
-
2627
- // Just call directly. The function called cannot cause a GC, or
2628
- // allow preemption, so the return address in the link register
2629
- // stays correct.
2630
- Call(function);
2631
- int stack_passed_arguments = (num_arguments <= 4) ? 0 : num_arguments - 4;
2632
- if (OS::ActivationFrameAlignment() > kPointerSize) {
2633
- ldr(sp, MemOperand(sp, stack_passed_arguments * kPointerSize));
2634
- } else {
2635
- add(sp, sp, Operand(stack_passed_arguments * sizeof(kPointerSize)));
2636
- }
2637
- }
2638
-
2639
-
2640
- void MacroAssembler::GetRelocatedValueLocation(Register ldr_location,
2641
- Register result) {
2642
- const uint32_t kLdrOffsetMask = (1 << 12) - 1;
2643
- const int32_t kPCRegOffset = 2 * kPointerSize;
2644
- ldr(result, MemOperand(ldr_location));
2645
- if (FLAG_debug_code) {
2646
- // Check that the instruction is a ldr reg, [pc + offset] .
2647
- and_(result, result, Operand(kLdrPCPattern));
2648
- cmp(result, Operand(kLdrPCPattern));
2649
- Check(eq, "The instruction to patch should be a load from pc.");
2650
- // Result was clobbered. Restore it.
2651
- ldr(result, MemOperand(ldr_location));
2652
- }
2653
- // Get the address of the constant.
2654
- and_(result, result, Operand(kLdrOffsetMask));
2655
- add(result, ldr_location, Operand(result));
2656
- add(result, result, Operand(kPCRegOffset));
2657
- }
2658
-
2659
-
2660
- CodePatcher::CodePatcher(byte* address, int instructions)
2661
- : address_(address),
2662
- instructions_(instructions),
2663
- size_(instructions * Assembler::kInstrSize),
2664
- masm_(address, size_ + Assembler::kGap) {
2665
- // Create a new macro assembler pointing to the address of the code to patch.
2666
- // The size is adjusted with kGap on order for the assembler to generate size
2667
- // bytes of instructions without failing with buffer size constraints.
2668
- ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2669
- }
2670
-
2671
-
2672
- CodePatcher::~CodePatcher() {
2673
- // Indicate that code has changed.
2674
- CPU::FlushICache(address_, size_);
2675
-
2676
- // Check that the code was patched as expected.
2677
- ASSERT(masm_.pc_ == address_ + size_);
2678
- ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2679
- }
2680
-
2681
-
2682
- void CodePatcher::Emit(Instr instr) {
2683
- masm()->emit(instr);
2684
- }
2685
-
2686
-
2687
- void CodePatcher::Emit(Address addr) {
2688
- masm()->emit(reinterpret_cast<Instr>(addr));
2689
- }
2690
-
2691
-
2692
- void CodePatcher::EmitCondition(Condition cond) {
2693
- Instr instr = Assembler::instr_at(masm_.pc_);
2694
- instr = (instr & ~kCondMask) | cond;
2695
- masm_.emit(instr);
2696
- }
2697
-
2698
-
2699
- } } // namespace v8::internal
2700
-
2701
- #endif // V8_TARGET_ARCH_ARM