therubyracer 0.8.1.pre2 → 0.8.1

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

Potentially problematic release.


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

Files changed (877) hide show
  1. data/Changelog.md +2 -1
  2. data/README.md +6 -3
  3. data/ext/v8/upstream/3.1.8/.gitignore +31 -0
  4. data/ext/v8/upstream/3.1.8/AUTHORS +40 -0
  5. data/ext/v8/upstream/3.1.8/ChangeLog +2566 -0
  6. data/ext/v8/upstream/3.1.8/LICENSE +52 -0
  7. data/ext/v8/upstream/3.1.8/LICENSE.strongtalk +29 -0
  8. data/ext/v8/upstream/3.1.8/LICENSE.v8 +26 -0
  9. data/ext/v8/upstream/3.1.8/LICENSE.valgrind +45 -0
  10. data/ext/v8/upstream/3.1.8/SConstruct +1192 -0
  11. data/ext/v8/upstream/3.1.8/build/README.txt +25 -0
  12. data/ext/v8/upstream/3.1.8/build/all.gyp +18 -0
  13. data/ext/v8/upstream/3.1.8/build/armu.gypi +32 -0
  14. data/ext/v8/upstream/3.1.8/build/common.gypi +82 -0
  15. data/ext/v8/upstream/3.1.8/build/gyp_v8 +145 -0
  16. data/ext/v8/upstream/3.1.8/include/v8-debug.h +384 -0
  17. data/ext/v8/upstream/3.1.8/include/v8-preparser.h +116 -0
  18. data/ext/v8/upstream/3.1.8/include/v8-profiler.h +426 -0
  19. data/ext/v8/upstream/3.1.8/include/v8-testing.h +99 -0
  20. data/ext/v8/upstream/3.1.8/include/v8.h +3846 -0
  21. data/ext/v8/upstream/3.1.8/include/v8stdint.h +53 -0
  22. data/ext/v8/upstream/3.1.8/preparser/preparser-process.cc +206 -0
  23. data/ext/v8/upstream/3.1.8/src/SConscript +356 -0
  24. data/ext/v8/upstream/3.1.8/src/accessors.cc +907 -0
  25. data/ext/v8/upstream/3.1.8/src/accessors.h +121 -0
  26. data/ext/v8/upstream/3.1.8/src/allocation.cc +204 -0
  27. data/ext/v8/upstream/3.1.8/src/allocation.h +176 -0
  28. data/ext/v8/upstream/3.1.8/src/api.cc +5191 -0
  29. data/ext/v8/upstream/3.1.8/src/api.h +508 -0
  30. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/apinatives.js +0 -0
  31. data/ext/v8/upstream/3.1.8/src/apiutils.h +80 -0
  32. data/ext/v8/upstream/3.1.8/src/arguments.h +105 -0
  33. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm-inl.h +352 -0
  34. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.cc +2756 -0
  35. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.h +1294 -0
  36. data/ext/v8/upstream/3.1.8/src/arm/builtins-arm.cc +1628 -0
  37. data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.cc +6783 -0
  38. data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.h +657 -0
  39. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm-inl.h +48 -0
  40. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.cc +7403 -0
  41. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.h +595 -0
  42. data/ext/v8/upstream/3.1.8/src/arm/constants-arm.cc +152 -0
  43. data/ext/v8/upstream/3.1.8/src/arm/constants-arm.h +769 -0
  44. data/ext/v8/upstream/3.1.8/src/arm/cpu-arm.cc +147 -0
  45. data/ext/v8/upstream/3.1.8/src/arm/debug-arm.cc +315 -0
  46. data/ext/v8/upstream/3.1.8/src/arm/deoptimizer-arm.cc +700 -0
  47. data/ext/v8/upstream/3.1.8/src/arm/disasm-arm.cc +1439 -0
  48. data/ext/v8/upstream/3.1.8/src/arm/frames-arm.cc +45 -0
  49. data/ext/v8/upstream/3.1.8/src/arm/frames-arm.h +168 -0
  50. data/ext/v8/upstream/3.1.8/src/arm/full-codegen-arm.cc +4230 -0
  51. data/ext/v8/upstream/3.1.8/src/arm/ic-arm.cc +1799 -0
  52. data/ext/v8/upstream/3.1.8/src/arm/jump-target-arm.cc +174 -0
  53. data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.cc +2041 -0
  54. data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.h +2046 -0
  55. data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.cc +3822 -0
  56. data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.h +312 -0
  57. data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.cc +303 -0
  58. data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.h +84 -0
  59. data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.cc +2701 -0
  60. data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.h +1015 -0
  61. data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.cc +1280 -0
  62. data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.h +252 -0
  63. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm-inl.h +0 -0
  64. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm.cc +0 -0
  65. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm.h +0 -0
  66. data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.cc +3165 -0
  67. data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.h +402 -0
  68. data/ext/v8/upstream/3.1.8/src/arm/stub-cache-arm.cc +4077 -0
  69. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/virtual-frame-arm-inl.h +0 -0
  70. data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.cc +843 -0
  71. data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.h +520 -0
  72. data/ext/v8/upstream/3.1.8/src/array.js +1231 -0
  73. data/ext/v8/upstream/3.1.8/src/assembler.cc +973 -0
  74. data/ext/v8/upstream/3.1.8/src/assembler.h +787 -0
  75. data/ext/v8/upstream/3.1.8/src/ast-inl.h +107 -0
  76. data/ext/v8/upstream/3.1.8/src/ast.cc +1067 -0
  77. data/ext/v8/upstream/3.1.8/src/ast.h +2177 -0
  78. data/ext/v8/upstream/3.1.8/src/atomicops.h +165 -0
  79. data/ext/v8/upstream/3.1.8/src/atomicops_internals_arm_gcc.h +145 -0
  80. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_gcc.cc +126 -0
  81. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_gcc.h +287 -0
  82. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_macosx.h +301 -0
  83. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_msvc.h +203 -0
  84. data/ext/v8/upstream/3.1.8/src/bignum-dtoa.cc +655 -0
  85. data/ext/v8/upstream/3.1.8/src/bignum-dtoa.h +81 -0
  86. data/ext/v8/upstream/3.1.8/src/bignum.cc +768 -0
  87. data/ext/v8/upstream/3.1.8/src/bignum.h +140 -0
  88. data/ext/v8/upstream/3.1.8/src/bootstrapper.cc +1888 -0
  89. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/bootstrapper.h +0 -0
  90. data/ext/v8/upstream/3.1.8/src/builtins.cc +1586 -0
  91. data/ext/v8/upstream/3.1.8/src/builtins.h +339 -0
  92. data/ext/v8/upstream/3.1.8/src/bytecodes-irregexp.h +105 -0
  93. data/ext/v8/upstream/3.1.8/src/cached-powers.cc +177 -0
  94. data/ext/v8/upstream/3.1.8/src/cached-powers.h +65 -0
  95. data/ext/v8/upstream/3.1.8/src/char-predicates-inl.h +94 -0
  96. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/char-predicates.h +0 -0
  97. data/ext/v8/upstream/3.1.8/src/checks.cc +110 -0
  98. data/ext/v8/upstream/3.1.8/src/checks.h +292 -0
  99. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/circular-queue-inl.h +0 -0
  100. data/ext/v8/upstream/3.1.8/src/circular-queue.cc +122 -0
  101. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/circular-queue.h +0 -0
  102. data/ext/v8/upstream/3.1.8/src/code-stubs.cc +230 -0
  103. data/ext/v8/upstream/3.1.8/src/code-stubs.h +950 -0
  104. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/code.h +0 -0
  105. data/ext/v8/upstream/3.1.8/src/codegen-inl.h +64 -0
  106. data/ext/v8/upstream/3.1.8/src/codegen.cc +495 -0
  107. data/ext/v8/upstream/3.1.8/src/codegen.h +245 -0
  108. data/ext/v8/upstream/3.1.8/src/compilation-cache.cc +654 -0
  109. data/ext/v8/upstream/3.1.8/src/compilation-cache.h +112 -0
  110. data/ext/v8/upstream/3.1.8/src/compiler.cc +806 -0
  111. data/ext/v8/upstream/3.1.8/src/compiler.h +290 -0
  112. data/ext/v8/upstream/3.1.8/src/contexts.cc +320 -0
  113. data/ext/v8/upstream/3.1.8/src/contexts.h +376 -0
  114. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/conversions-inl.h +0 -0
  115. data/ext/v8/upstream/3.1.8/src/conversions.cc +1069 -0
  116. data/ext/v8/upstream/3.1.8/src/conversions.h +122 -0
  117. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/counters.cc +0 -0
  118. data/ext/v8/upstream/3.1.8/src/counters.h +242 -0
  119. data/ext/v8/upstream/3.1.8/src/cpu-profiler-inl.h +100 -0
  120. data/ext/v8/upstream/3.1.8/src/cpu-profiler.cc +554 -0
  121. data/ext/v8/upstream/3.1.8/src/cpu-profiler.h +291 -0
  122. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/cpu.h +0 -0
  123. data/ext/v8/upstream/3.1.8/src/d8-debug.cc +367 -0
  124. data/ext/v8/upstream/3.1.8/src/d8-debug.h +157 -0
  125. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-posix.cc +0 -0
  126. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-readline.cc +0 -0
  127. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-windows.cc +0 -0
  128. data/ext/v8/upstream/3.1.8/src/d8.cc +792 -0
  129. data/ext/v8/upstream/3.1.8/src/d8.gyp +85 -0
  130. data/ext/v8/upstream/3.1.8/src/d8.h +231 -0
  131. data/ext/v8/upstream/3.1.8/src/d8.js +2798 -0
  132. data/ext/v8/upstream/3.1.8/src/data-flow.cc +545 -0
  133. data/ext/v8/upstream/3.1.8/src/data-flow.h +379 -0
  134. data/ext/v8/upstream/3.1.8/src/date.js +1103 -0
  135. data/ext/v8/upstream/3.1.8/src/dateparser-inl.h +125 -0
  136. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/dateparser.cc +0 -0
  137. data/ext/v8/upstream/3.1.8/src/dateparser.h +263 -0
  138. data/ext/v8/upstream/3.1.8/src/debug-agent.cc +446 -0
  139. data/ext/v8/upstream/3.1.8/src/debug-agent.h +131 -0
  140. data/ext/v8/upstream/3.1.8/src/debug-debugger.js +2569 -0
  141. data/ext/v8/upstream/3.1.8/src/debug.cc +3085 -0
  142. data/ext/v8/upstream/3.1.8/src/debug.h +1025 -0
  143. data/ext/v8/upstream/3.1.8/src/deoptimizer.cc +1185 -0
  144. data/ext/v8/upstream/3.1.8/src/deoptimizer.h +529 -0
  145. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/disasm.h +0 -0
  146. data/ext/v8/upstream/3.1.8/src/disassembler.cc +338 -0
  147. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/disassembler.h +0 -0
  148. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/diy-fp.cc +0 -0
  149. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/diy-fp.h +0 -0
  150. data/ext/v8/upstream/3.1.8/src/double.h +238 -0
  151. data/ext/v8/upstream/3.1.8/src/dtoa.cc +103 -0
  152. data/ext/v8/upstream/3.1.8/src/dtoa.h +85 -0
  153. data/ext/v8/upstream/3.1.8/src/execution.cc +735 -0
  154. data/ext/v8/upstream/3.1.8/src/execution.h +322 -0
  155. data/ext/v8/upstream/3.1.8/src/extensions/experimental/experimental.gyp +53 -0
  156. data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.cc +264 -0
  157. data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.h +64 -0
  158. data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.cc +141 -0
  159. data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.h +50 -0
  160. data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.cc +58 -0
  161. data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.h +49 -0
  162. data/ext/v8/upstream/3.1.8/src/factory.cc +1087 -0
  163. data/ext/v8/upstream/3.1.8/src/factory.h +432 -0
  164. data/ext/v8/upstream/3.1.8/src/fast-dtoa.cc +736 -0
  165. data/ext/v8/upstream/3.1.8/src/fast-dtoa.h +83 -0
  166. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/fixed-dtoa.cc +0 -0
  167. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/fixed-dtoa.h +0 -0
  168. data/ext/v8/upstream/3.1.8/src/flag-definitions.h +552 -0
  169. data/ext/v8/upstream/3.1.8/src/flags.cc +551 -0
  170. data/ext/v8/upstream/3.1.8/src/flags.h +79 -0
  171. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/frame-element.cc +0 -0
  172. data/ext/v8/upstream/3.1.8/src/frame-element.h +277 -0
  173. data/ext/v8/upstream/3.1.8/src/frames-inl.h +210 -0
  174. data/ext/v8/upstream/3.1.8/src/frames.cc +1232 -0
  175. data/ext/v8/upstream/3.1.8/src/frames.h +826 -0
  176. data/ext/v8/upstream/3.1.8/src/full-codegen.cc +1382 -0
  177. data/ext/v8/upstream/3.1.8/src/full-codegen.h +751 -0
  178. data/ext/v8/upstream/3.1.8/src/func-name-inferrer.cc +90 -0
  179. data/ext/v8/upstream/3.1.8/src/func-name-inferrer.h +111 -0
  180. data/ext/v8/upstream/3.1.8/src/gdb-jit.cc +1547 -0
  181. data/ext/v8/upstream/3.1.8/src/gdb-jit.h +138 -0
  182. data/ext/v8/upstream/3.1.8/src/global-handles.cc +534 -0
  183. data/ext/v8/upstream/3.1.8/src/global-handles.h +181 -0
  184. data/ext/v8/upstream/3.1.8/src/globals.h +325 -0
  185. data/ext/v8/upstream/3.1.8/src/handles-inl.h +80 -0
  186. data/ext/v8/upstream/3.1.8/src/handles.cc +910 -0
  187. data/ext/v8/upstream/3.1.8/src/handles.h +424 -0
  188. data/ext/v8/upstream/3.1.8/src/hashmap.cc +230 -0
  189. data/ext/v8/upstream/3.1.8/src/hashmap.h +121 -0
  190. data/ext/v8/upstream/3.1.8/src/heap-inl.h +587 -0
  191. data/ext/v8/upstream/3.1.8/src/heap-profiler.cc +1128 -0
  192. data/ext/v8/upstream/3.1.8/src/heap-profiler.h +381 -0
  193. data/ext/v8/upstream/3.1.8/src/heap.cc +5610 -0
  194. data/ext/v8/upstream/3.1.8/src/heap.h +2218 -0
  195. data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.cc +1490 -0
  196. data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.h +3493 -0
  197. data/ext/v8/upstream/3.1.8/src/hydrogen.cc +6056 -0
  198. data/ext/v8/upstream/3.1.8/src/hydrogen.h +1091 -0
  199. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32-inl.h +429 -0
  200. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.cc +2800 -0
  201. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.h +1093 -0
  202. data/ext/v8/upstream/3.1.8/src/ia32/builtins-ia32.cc +1590 -0
  203. data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.cc +6624 -0
  204. data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.h +536 -0
  205. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/codegen-ia32-inl.h +0 -0
  206. data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.cc +10354 -0
  207. data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.h +798 -0
  208. data/ext/v8/upstream/3.1.8/src/ia32/cpu-ia32.cc +87 -0
  209. data/ext/v8/upstream/3.1.8/src/ia32/debug-ia32.cc +309 -0
  210. data/ext/v8/upstream/3.1.8/src/ia32/deoptimizer-ia32.cc +664 -0
  211. data/ext/v8/upstream/3.1.8/src/ia32/disasm-ia32.cc +1597 -0
  212. data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.cc +45 -0
  213. data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.h +140 -0
  214. data/ext/v8/upstream/3.1.8/src/ia32/full-codegen-ia32.cc +4278 -0
  215. data/ext/v8/upstream/3.1.8/src/ia32/ic-ia32.cc +1786 -0
  216. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/jump-target-ia32.cc +0 -0
  217. data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.cc +3880 -0
  218. data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.h +309 -0
  219. data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.cc +460 -0
  220. data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
  221. data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.cc +2095 -0
  222. data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.h +2127 -0
  223. data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.cc +2031 -0
  224. data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.h +798 -0
  225. data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.cc +1253 -0
  226. data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.h +215 -0
  227. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32-inl.h +0 -0
  228. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32.cc +0 -0
  229. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32.h +0 -0
  230. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/simulator-ia32.cc +0 -0
  231. data/ext/v8/upstream/3.1.8/src/ia32/simulator-ia32.h +72 -0
  232. data/ext/v8/upstream/3.1.8/src/ia32/stub-cache-ia32.cc +3732 -0
  233. data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.cc +1360 -0
  234. data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.h +646 -0
  235. data/ext/v8/upstream/3.1.8/src/ic-inl.h +129 -0
  236. data/ext/v8/upstream/3.1.8/src/ic.cc +2333 -0
  237. data/ext/v8/upstream/3.1.8/src/ic.h +639 -0
  238. data/ext/v8/upstream/3.1.8/src/inspector.cc +63 -0
  239. data/ext/v8/upstream/3.1.8/src/inspector.h +62 -0
  240. data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.cc +655 -0
  241. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/interpreter-irregexp.h +0 -0
  242. data/ext/v8/upstream/3.1.8/src/json.js +342 -0
  243. data/ext/v8/upstream/3.1.8/src/jsregexp.cc +5340 -0
  244. data/ext/v8/upstream/3.1.8/src/jsregexp.h +1484 -0
  245. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-heavy-inl.h +0 -0
  246. data/ext/v8/upstream/3.1.8/src/jump-target-heavy.cc +430 -0
  247. data/ext/v8/upstream/3.1.8/src/jump-target-heavy.h +244 -0
  248. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-inl.h +0 -0
  249. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-light-inl.h +0 -0
  250. data/ext/v8/upstream/3.1.8/src/jump-target-light.cc +111 -0
  251. data/ext/v8/upstream/3.1.8/src/jump-target-light.h +193 -0
  252. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target.cc +0 -0
  253. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target.h +0 -0
  254. data/ext/v8/upstream/3.1.8/src/list-inl.h +206 -0
  255. data/ext/v8/upstream/3.1.8/src/list.h +164 -0
  256. data/ext/v8/upstream/3.1.8/src/lithium-allocator-inl.h +140 -0
  257. data/ext/v8/upstream/3.1.8/src/lithium-allocator.cc +2093 -0
  258. data/ext/v8/upstream/3.1.8/src/lithium-allocator.h +644 -0
  259. data/ext/v8/upstream/3.1.8/src/lithium.cc +168 -0
  260. data/ext/v8/upstream/3.1.8/src/lithium.h +592 -0
  261. data/ext/v8/upstream/3.1.8/src/liveedit-debugger.js +1082 -0
  262. data/ext/v8/upstream/3.1.8/src/liveedit.cc +1650 -0
  263. data/ext/v8/upstream/3.1.8/src/liveedit.h +174 -0
  264. data/ext/v8/upstream/3.1.8/src/liveobjectlist-inl.h +126 -0
  265. data/ext/v8/upstream/3.1.8/src/liveobjectlist.cc +2527 -0
  266. data/ext/v8/upstream/3.1.8/src/liveobjectlist.h +322 -0
  267. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/log-inl.h +0 -0
  268. data/ext/v8/upstream/3.1.8/src/log-utils.cc +336 -0
  269. data/ext/v8/upstream/3.1.8/src/log-utils.h +232 -0
  270. data/ext/v8/upstream/3.1.8/src/log.cc +1608 -0
  271. data/ext/v8/upstream/3.1.8/src/log.h +379 -0
  272. data/ext/v8/upstream/3.1.8/src/macro-assembler.h +120 -0
  273. data/ext/v8/upstream/3.1.8/src/macros.py +178 -0
  274. data/ext/v8/upstream/3.1.8/src/mark-compact.cc +2957 -0
  275. data/ext/v8/upstream/3.1.8/src/mark-compact.h +433 -0
  276. data/ext/v8/upstream/3.1.8/src/math.js +264 -0
  277. data/ext/v8/upstream/3.1.8/src/memory.h +82 -0
  278. data/ext/v8/upstream/3.1.8/src/messages.cc +164 -0
  279. data/ext/v8/upstream/3.1.8/src/messages.h +114 -0
  280. data/ext/v8/upstream/3.1.8/src/messages.js +1071 -0
  281. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/assembler-mips-inl.h +0 -0
  282. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/assembler-mips.cc +0 -0
  283. data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.h +667 -0
  284. data/ext/v8/upstream/3.1.8/src/mips/builtins-mips.cc +205 -0
  285. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/codegen-mips-inl.h +0 -0
  286. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/codegen-mips.cc +0 -0
  287. data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.h +431 -0
  288. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/constants-mips.cc +0 -0
  289. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/constants-mips.h +0 -0
  290. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/cpu-mips.cc +0 -0
  291. data/ext/v8/upstream/3.1.8/src/mips/debug-mips.cc +127 -0
  292. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/disasm-mips.cc +0 -0
  293. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/fast-codegen-mips.cc +0 -0
  294. data/ext/v8/upstream/3.1.8/src/mips/frames-mips.cc +96 -0
  295. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/frames-mips.h +0 -0
  296. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/full-codegen-mips.cc +0 -0
  297. data/ext/v8/upstream/3.1.8/src/mips/ic-mips.cc +208 -0
  298. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/jump-target-mips.cc +0 -0
  299. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/macro-assembler-mips.cc +0 -0
  300. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/macro-assembler-mips.h +0 -0
  301. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips-inl.h +0 -0
  302. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips.cc +0 -0
  303. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips.h +0 -0
  304. data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.cc +1650 -0
  305. data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.h +311 -0
  306. data/ext/v8/upstream/3.1.8/src/mips/stub-cache-mips.cc +418 -0
  307. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/virtual-frame-mips.cc +0 -0
  308. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/virtual-frame-mips.h +0 -0
  309. data/ext/v8/upstream/3.1.8/src/mirror-debugger.js +2380 -0
  310. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mksnapshot.cc +0 -0
  311. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/natives.h +0 -0
  312. data/ext/v8/upstream/3.1.8/src/objects-debug.cc +722 -0
  313. data/ext/v8/upstream/3.1.8/src/objects-inl.h +3946 -0
  314. data/ext/v8/upstream/3.1.8/src/objects-printer.cc +801 -0
  315. data/ext/v8/upstream/3.1.8/src/objects-visiting.cc +142 -0
  316. data/ext/v8/upstream/3.1.8/src/objects-visiting.h +401 -0
  317. data/ext/v8/upstream/3.1.8/src/objects.cc +10044 -0
  318. data/ext/v8/upstream/3.1.8/src/objects.h +6571 -0
  319. data/ext/v8/upstream/3.1.8/src/parser.cc +5165 -0
  320. data/ext/v8/upstream/3.1.8/src/parser.h +802 -0
  321. data/ext/v8/upstream/3.1.8/src/platform-cygwin.cc +745 -0
  322. data/ext/v8/upstream/3.1.8/src/platform-freebsd.cc +702 -0
  323. data/ext/v8/upstream/3.1.8/src/platform-linux.cc +981 -0
  324. data/ext/v8/upstream/3.1.8/src/platform-macos.cc +732 -0
  325. data/ext/v8/upstream/3.1.8/src/platform-nullos.cc +498 -0
  326. data/ext/v8/upstream/3.1.8/src/platform-openbsd.cc +657 -0
  327. data/ext/v8/upstream/3.1.8/src/platform-posix.cc +399 -0
  328. data/ext/v8/upstream/3.1.8/src/platform-solaris.cc +714 -0
  329. data/ext/v8/upstream/3.1.8/src/platform-win32.cc +1974 -0
  330. data/ext/v8/upstream/3.1.8/src/platform.h +636 -0
  331. data/ext/v8/upstream/3.1.8/src/preparse-data.cc +183 -0
  332. data/ext/v8/upstream/3.1.8/src/preparse-data.h +249 -0
  333. data/ext/v8/upstream/3.1.8/src/preparser-api.cc +213 -0
  334. data/ext/v8/upstream/3.1.8/src/preparser.cc +1205 -0
  335. data/ext/v8/upstream/3.1.8/src/preparser.h +278 -0
  336. data/ext/v8/upstream/3.1.8/src/prettyprinter.cc +1539 -0
  337. data/ext/v8/upstream/3.1.8/src/prettyprinter.h +223 -0
  338. data/ext/v8/upstream/3.1.8/src/profile-generator-inl.h +128 -0
  339. data/ext/v8/upstream/3.1.8/src/profile-generator.cc +2899 -0
  340. data/ext/v8/upstream/3.1.8/src/profile-generator.h +1151 -0
  341. data/ext/v8/upstream/3.1.8/src/property.cc +96 -0
  342. data/ext/v8/upstream/3.1.8/src/property.h +337 -0
  343. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
  344. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.cc +470 -0
  345. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.h +142 -0
  346. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-tracer.cc +373 -0
  347. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-tracer.h +104 -0
  348. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.cc +257 -0
  349. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.h +231 -0
  350. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-stack.cc +0 -0
  351. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-stack.h +0 -0
  352. data/ext/v8/upstream/3.1.8/src/regexp.js +483 -0
  353. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator-inl.h +0 -0
  354. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator.cc +0 -0
  355. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator.h +0 -0
  356. data/ext/v8/upstream/3.1.8/src/rewriter.cc +1023 -0
  357. data/ext/v8/upstream/3.1.8/src/rewriter.h +59 -0
  358. data/ext/v8/upstream/3.1.8/src/runtime-profiler.cc +443 -0
  359. data/ext/v8/upstream/3.1.8/src/runtime-profiler.h +77 -0
  360. data/ext/v8/upstream/3.1.8/src/runtime.cc +11592 -0
  361. data/ext/v8/upstream/3.1.8/src/runtime.h +582 -0
  362. data/ext/v8/upstream/3.1.8/src/runtime.js +643 -0
  363. data/ext/v8/upstream/3.1.8/src/safepoint-table.cc +253 -0
  364. data/ext/v8/upstream/3.1.8/src/safepoint-table.h +263 -0
  365. data/ext/v8/upstream/3.1.8/src/scanner-base.cc +971 -0
  366. data/ext/v8/upstream/3.1.8/src/scanner-base.h +653 -0
  367. data/ext/v8/upstream/3.1.8/src/scanner.cc +586 -0
  368. data/ext/v8/upstream/3.1.8/src/scanner.h +194 -0
  369. data/ext/v8/upstream/3.1.8/src/scopeinfo.cc +636 -0
  370. data/ext/v8/upstream/3.1.8/src/scopeinfo.h +238 -0
  371. data/ext/v8/upstream/3.1.8/src/scopes.cc +1063 -0
  372. data/ext/v8/upstream/3.1.8/src/scopes.h +494 -0
  373. data/ext/v8/upstream/3.1.8/src/serialize.cc +1535 -0
  374. data/ext/v8/upstream/3.1.8/src/serialize.h +584 -0
  375. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/shell.h +0 -0
  376. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/simulator.h +0 -0
  377. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/smart-pointer.h +0 -0
  378. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot-common.cc +0 -0
  379. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot-empty.cc +0 -0
  380. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot.h +0 -0
  381. data/ext/v8/upstream/3.1.8/src/spaces-inl.h +524 -0
  382. data/ext/v8/upstream/3.1.8/src/spaces.cc +3254 -0
  383. data/ext/v8/upstream/3.1.8/src/spaces.h +2362 -0
  384. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/splay-tree-inl.h +0 -0
  385. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/splay-tree.h +0 -0
  386. data/ext/v8/upstream/3.1.8/src/string-search.cc +40 -0
  387. data/ext/v8/upstream/3.1.8/src/string-search.h +567 -0
  388. data/ext/v8/upstream/3.1.8/src/string-stream.cc +584 -0
  389. data/ext/v8/upstream/3.1.8/src/string-stream.h +191 -0
  390. data/ext/v8/upstream/3.1.8/src/string.js +915 -0
  391. data/ext/v8/upstream/3.1.8/src/strtod.cc +440 -0
  392. data/ext/v8/upstream/3.1.8/src/strtod.h +40 -0
  393. data/ext/v8/upstream/3.1.8/src/stub-cache.cc +1878 -0
  394. data/ext/v8/upstream/3.1.8/src/stub-cache.h +849 -0
  395. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/third_party/valgrind/valgrind.h +0 -0
  396. data/ext/v8/upstream/3.1.8/src/token.cc +63 -0
  397. data/ext/v8/upstream/3.1.8/src/token.h +288 -0
  398. data/ext/v8/upstream/3.1.8/src/top.cc +1152 -0
  399. data/ext/v8/upstream/3.1.8/src/top.h +608 -0
  400. data/ext/v8/upstream/3.1.8/src/type-info.cc +406 -0
  401. data/ext/v8/upstream/3.1.8/src/type-info.h +283 -0
  402. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/unbound-queue-inl.h +0 -0
  403. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/unbound-queue.h +0 -0
  404. data/ext/v8/upstream/3.1.8/src/unicode-inl.h +238 -0
  405. data/ext/v8/upstream/3.1.8/src/unicode.cc +1624 -0
  406. data/ext/v8/upstream/3.1.8/src/unicode.h +280 -0
  407. data/ext/v8/upstream/3.1.8/src/uri.js +402 -0
  408. data/ext/v8/upstream/3.1.8/src/utils.cc +371 -0
  409. data/ext/v8/upstream/3.1.8/src/utils.h +793 -0
  410. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/v8-counters.cc +0 -0
  411. data/ext/v8/upstream/3.1.8/src/v8-counters.h +290 -0
  412. data/ext/v8/upstream/3.1.8/src/v8.cc +270 -0
  413. data/ext/v8/upstream/3.1.8/src/v8.h +127 -0
  414. data/ext/v8/upstream/3.1.8/src/v8checks.h +64 -0
  415. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/v8dll-main.cc +0 -0
  416. data/ext/v8/upstream/3.1.8/src/v8globals.h +480 -0
  417. data/ext/v8/upstream/3.1.8/src/v8natives.js +1252 -0
  418. data/ext/v8/upstream/3.1.8/src/v8preparserdll-main.cc +39 -0
  419. data/ext/v8/upstream/3.1.8/src/v8threads.cc +440 -0
  420. data/ext/v8/upstream/3.1.8/src/v8threads.h +157 -0
  421. data/ext/v8/upstream/3.1.8/src/v8utils.h +354 -0
  422. data/ext/v8/upstream/3.1.8/src/variables.cc +132 -0
  423. data/ext/v8/upstream/3.1.8/src/variables.h +212 -0
  424. data/ext/v8/upstream/3.1.8/src/version.cc +95 -0
  425. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/version.h +0 -0
  426. data/ext/v8/upstream/3.1.8/src/virtual-frame-heavy-inl.h +190 -0
  427. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-heavy.cc +0 -0
  428. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-inl.h +0 -0
  429. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-light-inl.h +0 -0
  430. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-light.cc +0 -0
  431. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame.cc +0 -0
  432. data/ext/v8/upstream/3.1.8/src/virtual-frame.h +59 -0
  433. data/ext/v8/upstream/3.1.8/src/vm-state-inl.h +134 -0
  434. data/ext/v8/upstream/3.1.8/src/vm-state.h +68 -0
  435. data/ext/v8/upstream/3.1.8/src/win32-headers.h +95 -0
  436. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64-inl.h +455 -0
  437. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.cc +3162 -0
  438. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.h +1584 -0
  439. data/ext/v8/upstream/3.1.8/src/x64/builtins-x64.cc +1492 -0
  440. data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.cc +5150 -0
  441. data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.h +519 -0
  442. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64-inl.h +46 -0
  443. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.cc +8835 -0
  444. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.h +750 -0
  445. data/ext/v8/upstream/3.1.8/src/x64/cpu-x64.cc +86 -0
  446. data/ext/v8/upstream/3.1.8/src/x64/debug-x64.cc +316 -0
  447. data/ext/v8/upstream/3.1.8/src/x64/deoptimizer-x64.cc +781 -0
  448. data/ext/v8/upstream/3.1.8/src/x64/disasm-x64.cc +1737 -0
  449. data/ext/v8/upstream/3.1.8/src/x64/frames-x64.cc +45 -0
  450. data/ext/v8/upstream/3.1.8/src/x64/frames-x64.h +130 -0
  451. data/ext/v8/upstream/3.1.8/src/x64/full-codegen-x64.cc +3984 -0
  452. data/ext/v8/upstream/3.1.8/src/x64/ic-x64.cc +1761 -0
  453. data/ext/v8/upstream/3.1.8/src/x64/jump-target-x64.cc +437 -0
  454. data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.cc +3639 -0
  455. data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.h +305 -0
  456. data/ext/v8/upstream/3.1.8/src/x64/lithium-gap-resolver-x64.cc +320 -0
  457. data/ext/v8/upstream/3.1.8/src/x64/lithium-gap-resolver-x64.h +74 -0
  458. data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.cc +2044 -0
  459. data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.h +2052 -0
  460. data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.cc +2660 -0
  461. data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.h +1852 -0
  462. data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.cc +1382 -0
  463. data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.h +278 -0
  464. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64-inl.h +0 -0
  465. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64.cc +0 -0
  466. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64.h +0 -0
  467. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/simulator-x64.cc +0 -0
  468. data/ext/v8/upstream/3.1.8/src/x64/simulator-x64.h +71 -0
  469. data/ext/v8/upstream/3.1.8/src/x64/stub-cache-x64.cc +3509 -0
  470. data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.cc +1292 -0
  471. data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.h +593 -0
  472. data/ext/v8/upstream/3.1.8/src/zone-inl.h +83 -0
  473. data/ext/v8/upstream/3.1.8/src/zone.cc +195 -0
  474. data/ext/v8/upstream/3.1.8/src/zone.h +233 -0
  475. data/ext/v8/upstream/3.1.8/tools/codemap.js +265 -0
  476. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/consarray.js +0 -0
  477. data/ext/v8/upstream/3.1.8/tools/csvparser.js +78 -0
  478. data/ext/v8/upstream/3.1.8/tools/disasm.py +92 -0
  479. data/ext/v8/upstream/3.1.8/tools/gc-nvp-trace-processor.py +328 -0
  480. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/generate-ten-powers.scm +0 -0
  481. data/ext/v8/upstream/3.1.8/tools/grokdump.py +840 -0
  482. data/ext/v8/upstream/3.1.8/tools/gyp/v8.gyp +869 -0
  483. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/js2c.py +0 -0
  484. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/jsmin.py +0 -0
  485. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/linux-tick-processor +0 -0
  486. data/ext/v8/upstream/3.1.8/tools/ll_prof.py +919 -0
  487. data/ext/v8/upstream/3.1.8/tools/logreader.js +185 -0
  488. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/mac-nm +0 -0
  489. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/mac-tick-processor +0 -0
  490. data/ext/v8/upstream/3.1.8/tools/oom_dump/README +31 -0
  491. data/ext/v8/upstream/3.1.8/tools/oom_dump/SConstruct +42 -0
  492. data/ext/v8/upstream/3.1.8/tools/oom_dump/oom_dump.cc +288 -0
  493. data/ext/v8/upstream/3.1.8/tools/presubmit.py +305 -0
  494. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/process-heap-prof.py +0 -0
  495. data/ext/v8/upstream/3.1.8/tools/profile.js +751 -0
  496. data/ext/v8/upstream/3.1.8/tools/profile_view.js +219 -0
  497. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/run-valgrind.py +0 -0
  498. data/ext/v8/upstream/3.1.8/tools/splaytree.js +316 -0
  499. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/stats-viewer.py +0 -0
  500. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/tickprocessor-driver.js +0 -0
  501. data/ext/v8/upstream/3.1.8/tools/tickprocessor.js +863 -0
  502. data/ext/v8/upstream/3.1.8/tools/utils.py +96 -0
  503. data/ext/v8/upstream/3.1.8/tools/visual_studio/README.txt +70 -0
  504. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/arm.vsprops +0 -0
  505. data/ext/v8/upstream/3.1.8/tools/visual_studio/common.vsprops +34 -0
  506. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8.vcproj +0 -0
  507. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8_arm.vcproj +0 -0
  508. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8_x64.vcproj +0 -0
  509. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8js2c.cmd +0 -0
  510. data/ext/v8/upstream/3.1.8/tools/visual_studio/debug.vsprops +17 -0
  511. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/ia32.vsprops +0 -0
  512. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/js2c.cmd +0 -0
  513. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/release.vsprops +0 -0
  514. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8.sln +0 -0
  515. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8.vcproj +0 -0
  516. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_arm.sln +0 -0
  517. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_arm.vcproj +0 -0
  518. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base.vcproj +1296 -0
  519. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_arm.vcproj +1234 -0
  520. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_x64.vcproj +1296 -0
  521. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest.vcproj +0 -0
  522. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
  523. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
  524. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
  525. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
  526. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample.vcproj +0 -0
  527. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
  528. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
  529. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample.vcproj +147 -0
  530. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample_arm.vcproj +147 -0
  531. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample_x64.vcproj +163 -0
  532. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot.vcproj +0 -0
  533. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
  534. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
  535. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
  536. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_x64.sln +0 -0
  537. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_x64.vcproj +0 -0
  538. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/x64.vsprops +0 -0
  539. data/ext/v8/upstream/3.1.8/tools/windows-tick-processor.bat +30 -0
  540. data/ext/v8/upstream/Makefile +2 -1
  541. data/ext/v8/v8_template.cpp +2 -2
  542. data/lib/v8/version.rb +1 -1
  543. data/spec/redjs/jsapi_spec.rb +2 -2
  544. metadata +552 -490
  545. data/ext/v8/upstream/2.3.3/.gitignore +0 -26
  546. data/ext/v8/upstream/2.3.3/AUTHORS +0 -31
  547. data/ext/v8/upstream/2.3.3/ChangeLog +0 -1916
  548. data/ext/v8/upstream/2.3.3/LICENSE +0 -55
  549. data/ext/v8/upstream/2.3.3/SConstruct +0 -1154
  550. data/ext/v8/upstream/2.3.3/include/v8-debug.h +0 -381
  551. data/ext/v8/upstream/2.3.3/include/v8-profiler.h +0 -353
  552. data/ext/v8/upstream/2.3.3/include/v8.h +0 -3616
  553. data/ext/v8/upstream/2.3.3/src/SConscript +0 -330
  554. data/ext/v8/upstream/2.3.3/src/accessors.cc +0 -661
  555. data/ext/v8/upstream/2.3.3/src/accessors.h +0 -114
  556. data/ext/v8/upstream/2.3.3/src/allocation.cc +0 -198
  557. data/ext/v8/upstream/2.3.3/src/allocation.h +0 -169
  558. data/ext/v8/upstream/2.3.3/src/api.cc +0 -4795
  559. data/ext/v8/upstream/2.3.3/src/api.h +0 -485
  560. data/ext/v8/upstream/2.3.3/src/apiutils.h +0 -69
  561. data/ext/v8/upstream/2.3.3/src/arguments.h +0 -96
  562. data/ext/v8/upstream/2.3.3/src/arm/assembler-arm-inl.h +0 -305
  563. data/ext/v8/upstream/2.3.3/src/arm/assembler-arm.cc +0 -2580
  564. data/ext/v8/upstream/2.3.3/src/arm/assembler-arm.h +0 -1275
  565. data/ext/v8/upstream/2.3.3/src/arm/builtins-arm.cc +0 -1320
  566. data/ext/v8/upstream/2.3.3/src/arm/codegen-arm-inl.h +0 -48
  567. data/ext/v8/upstream/2.3.3/src/arm/codegen-arm.cc +0 -11398
  568. data/ext/v8/upstream/2.3.3/src/arm/codegen-arm.h +0 -1102
  569. data/ext/v8/upstream/2.3.3/src/arm/constants-arm.cc +0 -154
  570. data/ext/v8/upstream/2.3.3/src/arm/constants-arm.h +0 -388
  571. data/ext/v8/upstream/2.3.3/src/arm/cpu-arm.cc +0 -142
  572. data/ext/v8/upstream/2.3.3/src/arm/debug-arm.cc +0 -309
  573. data/ext/v8/upstream/2.3.3/src/arm/disasm-arm.cc +0 -1459
  574. data/ext/v8/upstream/2.3.3/src/arm/fast-codegen-arm.cc +0 -241
  575. data/ext/v8/upstream/2.3.3/src/arm/frames-arm.cc +0 -123
  576. data/ext/v8/upstream/2.3.3/src/arm/frames-arm.h +0 -162
  577. data/ext/v8/upstream/2.3.3/src/arm/full-codegen-arm.cc +0 -3178
  578. data/ext/v8/upstream/2.3.3/src/arm/ic-arm.cc +0 -2258
  579. data/ext/v8/upstream/2.3.3/src/arm/jump-target-arm.cc +0 -164
  580. data/ext/v8/upstream/2.3.3/src/arm/macro-assembler-arm.cc +0 -1892
  581. data/ext/v8/upstream/2.3.3/src/arm/macro-assembler-arm.h +0 -727
  582. data/ext/v8/upstream/2.3.3/src/arm/regexp-macro-assembler-arm.cc +0 -1261
  583. data/ext/v8/upstream/2.3.3/src/arm/regexp-macro-assembler-arm.h +0 -266
  584. data/ext/v8/upstream/2.3.3/src/arm/simulator-arm.cc +0 -2822
  585. data/ext/v8/upstream/2.3.3/src/arm/simulator-arm.h +0 -361
  586. data/ext/v8/upstream/2.3.3/src/arm/stub-cache-arm.cc +0 -2387
  587. data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm.cc +0 -834
  588. data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm.h +0 -519
  589. data/ext/v8/upstream/2.3.3/src/array.js +0 -1127
  590. data/ext/v8/upstream/2.3.3/src/assembler.cc +0 -801
  591. data/ext/v8/upstream/2.3.3/src/assembler.h +0 -573
  592. data/ext/v8/upstream/2.3.3/src/ast-inl.h +0 -81
  593. data/ext/v8/upstream/2.3.3/src/ast.cc +0 -1152
  594. data/ext/v8/upstream/2.3.3/src/ast.h +0 -2106
  595. data/ext/v8/upstream/2.3.3/src/bootstrapper.cc +0 -1819
  596. data/ext/v8/upstream/2.3.3/src/builtins.cc +0 -1529
  597. data/ext/v8/upstream/2.3.3/src/builtins.h +0 -263
  598. data/ext/v8/upstream/2.3.3/src/bytecodes-irregexp.h +0 -104
  599. data/ext/v8/upstream/2.3.3/src/cached-powers.h +0 -119
  600. data/ext/v8/upstream/2.3.3/src/char-predicates-inl.h +0 -86
  601. data/ext/v8/upstream/2.3.3/src/checks.cc +0 -100
  602. data/ext/v8/upstream/2.3.3/src/checks.h +0 -310
  603. data/ext/v8/upstream/2.3.3/src/circular-queue.cc +0 -121
  604. data/ext/v8/upstream/2.3.3/src/code-stubs.cc +0 -177
  605. data/ext/v8/upstream/2.3.3/src/code-stubs.h +0 -177
  606. data/ext/v8/upstream/2.3.3/src/codegen-inl.h +0 -60
  607. data/ext/v8/upstream/2.3.3/src/codegen.cc +0 -516
  608. data/ext/v8/upstream/2.3.3/src/codegen.h +0 -897
  609. data/ext/v8/upstream/2.3.3/src/compilation-cache.cc +0 -562
  610. data/ext/v8/upstream/2.3.3/src/compilation-cache.h +0 -102
  611. data/ext/v8/upstream/2.3.3/src/compiler.cc +0 -654
  612. data/ext/v8/upstream/2.3.3/src/compiler.h +0 -299
  613. data/ext/v8/upstream/2.3.3/src/contexts.cc +0 -256
  614. data/ext/v8/upstream/2.3.3/src/contexts.h +0 -342
  615. data/ext/v8/upstream/2.3.3/src/conversions.cc +0 -1119
  616. data/ext/v8/upstream/2.3.3/src/conversions.h +0 -123
  617. data/ext/v8/upstream/2.3.3/src/counters.h +0 -239
  618. data/ext/v8/upstream/2.3.3/src/cpu-profiler-inl.h +0 -100
  619. data/ext/v8/upstream/2.3.3/src/cpu-profiler.cc +0 -538
  620. data/ext/v8/upstream/2.3.3/src/cpu-profiler.h +0 -285
  621. data/ext/v8/upstream/2.3.3/src/d8-debug.cc +0 -356
  622. data/ext/v8/upstream/2.3.3/src/d8-debug.h +0 -155
  623. data/ext/v8/upstream/2.3.3/src/d8.cc +0 -783
  624. data/ext/v8/upstream/2.3.3/src/d8.h +0 -227
  625. data/ext/v8/upstream/2.3.3/src/d8.js +0 -1683
  626. data/ext/v8/upstream/2.3.3/src/data-flow.cc +0 -758
  627. data/ext/v8/upstream/2.3.3/src/data-flow.h +0 -278
  628. data/ext/v8/upstream/2.3.3/src/date.js +0 -1059
  629. data/ext/v8/upstream/2.3.3/src/dateparser-inl.h +0 -123
  630. data/ext/v8/upstream/2.3.3/src/dateparser.h +0 -244
  631. data/ext/v8/upstream/2.3.3/src/debug-agent.cc +0 -427
  632. data/ext/v8/upstream/2.3.3/src/debug-agent.h +0 -129
  633. data/ext/v8/upstream/2.3.3/src/debug-debugger.js +0 -2227
  634. data/ext/v8/upstream/2.3.3/src/debug.cc +0 -3005
  635. data/ext/v8/upstream/2.3.3/src/debug.h +0 -993
  636. data/ext/v8/upstream/2.3.3/src/disassembler.cc +0 -312
  637. data/ext/v8/upstream/2.3.3/src/double.h +0 -169
  638. data/ext/v8/upstream/2.3.3/src/dtoa-config.c +0 -92
  639. data/ext/v8/upstream/2.3.3/src/dtoa.cc +0 -77
  640. data/ext/v8/upstream/2.3.3/src/dtoa.h +0 -81
  641. data/ext/v8/upstream/2.3.3/src/execution.cc +0 -809
  642. data/ext/v8/upstream/2.3.3/src/execution.h +0 -336
  643. data/ext/v8/upstream/2.3.3/src/factory.cc +0 -1003
  644. data/ext/v8/upstream/2.3.3/src/factory.h +0 -410
  645. data/ext/v8/upstream/2.3.3/src/fast-codegen.cc +0 -746
  646. data/ext/v8/upstream/2.3.3/src/fast-codegen.h +0 -161
  647. data/ext/v8/upstream/2.3.3/src/fast-dtoa.cc +0 -505
  648. data/ext/v8/upstream/2.3.3/src/fast-dtoa.h +0 -58
  649. data/ext/v8/upstream/2.3.3/src/flag-definitions.h +0 -455
  650. data/ext/v8/upstream/2.3.3/src/flags.cc +0 -551
  651. data/ext/v8/upstream/2.3.3/src/flags.h +0 -81
  652. data/ext/v8/upstream/2.3.3/src/flow-graph.cc +0 -763
  653. data/ext/v8/upstream/2.3.3/src/flow-graph.h +0 -180
  654. data/ext/v8/upstream/2.3.3/src/frame-element.h +0 -273
  655. data/ext/v8/upstream/2.3.3/src/frames-inl.h +0 -217
  656. data/ext/v8/upstream/2.3.3/src/frames.cc +0 -826
  657. data/ext/v8/upstream/2.3.3/src/frames.h +0 -682
  658. data/ext/v8/upstream/2.3.3/src/full-codegen.cc +0 -1443
  659. data/ext/v8/upstream/2.3.3/src/full-codegen.h +0 -548
  660. data/ext/v8/upstream/2.3.3/src/func-name-inferrer.cc +0 -76
  661. data/ext/v8/upstream/2.3.3/src/func-name-inferrer.h +0 -135
  662. data/ext/v8/upstream/2.3.3/src/global-handles.cc +0 -520
  663. data/ext/v8/upstream/2.3.3/src/global-handles.h +0 -180
  664. data/ext/v8/upstream/2.3.3/src/globals.h +0 -669
  665. data/ext/v8/upstream/2.3.3/src/handles-inl.h +0 -76
  666. data/ext/v8/upstream/2.3.3/src/handles.cc +0 -825
  667. data/ext/v8/upstream/2.3.3/src/handles.h +0 -393
  668. data/ext/v8/upstream/2.3.3/src/hashmap.cc +0 -226
  669. data/ext/v8/upstream/2.3.3/src/hashmap.h +0 -120
  670. data/ext/v8/upstream/2.3.3/src/heap-inl.h +0 -493
  671. data/ext/v8/upstream/2.3.3/src/heap-profiler.cc +0 -779
  672. data/ext/v8/upstream/2.3.3/src/heap-profiler.h +0 -323
  673. data/ext/v8/upstream/2.3.3/src/heap.cc +0 -4994
  674. data/ext/v8/upstream/2.3.3/src/heap.h +0 -1984
  675. data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32-inl.h +0 -360
  676. data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32.cc +0 -2600
  677. data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32.h +0 -969
  678. data/ext/v8/upstream/2.3.3/src/ia32/builtins-ia32.cc +0 -1261
  679. data/ext/v8/upstream/2.3.3/src/ia32/codegen-ia32.cc +0 -13968
  680. data/ext/v8/upstream/2.3.3/src/ia32/codegen-ia32.h +0 -1097
  681. data/ext/v8/upstream/2.3.3/src/ia32/cpu-ia32.cc +0 -83
  682. data/ext/v8/upstream/2.3.3/src/ia32/debug-ia32.cc +0 -309
  683. data/ext/v8/upstream/2.3.3/src/ia32/disasm-ia32.cc +0 -1471
  684. data/ext/v8/upstream/2.3.3/src/ia32/fast-codegen-ia32.cc +0 -954
  685. data/ext/v8/upstream/2.3.3/src/ia32/fast-codegen-ia32.h +0 -155
  686. data/ext/v8/upstream/2.3.3/src/ia32/frames-ia32.cc +0 -115
  687. data/ext/v8/upstream/2.3.3/src/ia32/frames-ia32.h +0 -135
  688. data/ext/v8/upstream/2.3.3/src/ia32/full-codegen-ia32.cc +0 -3281
  689. data/ext/v8/upstream/2.3.3/src/ia32/ic-ia32.cc +0 -1966
  690. data/ext/v8/upstream/2.3.3/src/ia32/macro-assembler-ia32.cc +0 -1610
  691. data/ext/v8/upstream/2.3.3/src/ia32/macro-assembler-ia32.h +0 -610
  692. data/ext/v8/upstream/2.3.3/src/ia32/regexp-macro-assembler-ia32.cc +0 -1247
  693. data/ext/v8/upstream/2.3.3/src/ia32/regexp-macro-assembler-ia32.h +0 -214
  694. data/ext/v8/upstream/2.3.3/src/ia32/simulator-ia32.h +0 -62
  695. data/ext/v8/upstream/2.3.3/src/ia32/stub-cache-ia32.cc +0 -2750
  696. data/ext/v8/upstream/2.3.3/src/ia32/virtual-frame-ia32.cc +0 -1334
  697. data/ext/v8/upstream/2.3.3/src/ia32/virtual-frame-ia32.h +0 -627
  698. data/ext/v8/upstream/2.3.3/src/ic-inl.h +0 -120
  699. data/ext/v8/upstream/2.3.3/src/ic.cc +0 -1827
  700. data/ext/v8/upstream/2.3.3/src/ic.h +0 -515
  701. data/ext/v8/upstream/2.3.3/src/interpreter-irregexp.cc +0 -646
  702. data/ext/v8/upstream/2.3.3/src/json.js +0 -268
  703. data/ext/v8/upstream/2.3.3/src/jsregexp.cc +0 -5283
  704. data/ext/v8/upstream/2.3.3/src/jsregexp.h +0 -1463
  705. data/ext/v8/upstream/2.3.3/src/jump-target-heavy.cc +0 -429
  706. data/ext/v8/upstream/2.3.3/src/jump-target-heavy.h +0 -244
  707. data/ext/v8/upstream/2.3.3/src/jump-target-light.cc +0 -110
  708. data/ext/v8/upstream/2.3.3/src/jump-target-light.h +0 -192
  709. data/ext/v8/upstream/2.3.3/src/list-inl.h +0 -166
  710. data/ext/v8/upstream/2.3.3/src/list.h +0 -159
  711. data/ext/v8/upstream/2.3.3/src/liveedit-debugger.js +0 -1057
  712. data/ext/v8/upstream/2.3.3/src/liveedit.cc +0 -1480
  713. data/ext/v8/upstream/2.3.3/src/liveedit.h +0 -170
  714. data/ext/v8/upstream/2.3.3/src/log-utils.cc +0 -497
  715. data/ext/v8/upstream/2.3.3/src/log-utils.h +0 -289
  716. data/ext/v8/upstream/2.3.3/src/log.cc +0 -1561
  717. data/ext/v8/upstream/2.3.3/src/log.h +0 -384
  718. data/ext/v8/upstream/2.3.3/src/macro-assembler.h +0 -86
  719. data/ext/v8/upstream/2.3.3/src/macros.py +0 -177
  720. data/ext/v8/upstream/2.3.3/src/mark-compact.cc +0 -2330
  721. data/ext/v8/upstream/2.3.3/src/mark-compact.h +0 -451
  722. data/ext/v8/upstream/2.3.3/src/math.js +0 -264
  723. data/ext/v8/upstream/2.3.3/src/memory.h +0 -74
  724. data/ext/v8/upstream/2.3.3/src/messages.cc +0 -183
  725. data/ext/v8/upstream/2.3.3/src/messages.h +0 -113
  726. data/ext/v8/upstream/2.3.3/src/messages.js +0 -982
  727. data/ext/v8/upstream/2.3.3/src/mips/assembler-mips.h +0 -668
  728. data/ext/v8/upstream/2.3.3/src/mips/builtins-mips.cc +0 -205
  729. data/ext/v8/upstream/2.3.3/src/mips/codegen-mips.h +0 -434
  730. data/ext/v8/upstream/2.3.3/src/mips/debug-mips.cc +0 -131
  731. data/ext/v8/upstream/2.3.3/src/mips/frames-mips.cc +0 -102
  732. data/ext/v8/upstream/2.3.3/src/mips/ic-mips.cc +0 -220
  733. data/ext/v8/upstream/2.3.3/src/mips/simulator-mips.cc +0 -1651
  734. data/ext/v8/upstream/2.3.3/src/mips/simulator-mips.h +0 -311
  735. data/ext/v8/upstream/2.3.3/src/mips/stub-cache-mips.cc +0 -403
  736. data/ext/v8/upstream/2.3.3/src/mirror-debugger.js +0 -2380
  737. data/ext/v8/upstream/2.3.3/src/objects-debug.cc +0 -1366
  738. data/ext/v8/upstream/2.3.3/src/objects-inl.h +0 -3333
  739. data/ext/v8/upstream/2.3.3/src/objects.cc +0 -8820
  740. data/ext/v8/upstream/2.3.3/src/objects.h +0 -5373
  741. data/ext/v8/upstream/2.3.3/src/oprofile-agent.cc +0 -108
  742. data/ext/v8/upstream/2.3.3/src/oprofile-agent.h +0 -77
  743. data/ext/v8/upstream/2.3.3/src/parser.cc +0 -5207
  744. data/ext/v8/upstream/2.3.3/src/parser.h +0 -197
  745. data/ext/v8/upstream/2.3.3/src/platform-freebsd.cc +0 -667
  746. data/ext/v8/upstream/2.3.3/src/platform-linux.cc +0 -862
  747. data/ext/v8/upstream/2.3.3/src/platform-macos.cc +0 -665
  748. data/ext/v8/upstream/2.3.3/src/platform-nullos.cc +0 -454
  749. data/ext/v8/upstream/2.3.3/src/platform-openbsd.cc +0 -622
  750. data/ext/v8/upstream/2.3.3/src/platform-posix.cc +0 -362
  751. data/ext/v8/upstream/2.3.3/src/platform-solaris.cc +0 -653
  752. data/ext/v8/upstream/2.3.3/src/platform-win32.cc +0 -1911
  753. data/ext/v8/upstream/2.3.3/src/platform.h +0 -577
  754. data/ext/v8/upstream/2.3.3/src/powers-ten.h +0 -2461
  755. data/ext/v8/upstream/2.3.3/src/prettyprinter.cc +0 -1531
  756. data/ext/v8/upstream/2.3.3/src/prettyprinter.h +0 -221
  757. data/ext/v8/upstream/2.3.3/src/profile-generator-inl.h +0 -148
  758. data/ext/v8/upstream/2.3.3/src/profile-generator.cc +0 -1830
  759. data/ext/v8/upstream/2.3.3/src/profile-generator.h +0 -853
  760. data/ext/v8/upstream/2.3.3/src/property.cc +0 -96
  761. data/ext/v8/upstream/2.3.3/src/property.h +0 -315
  762. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-irregexp.cc +0 -464
  763. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-irregexp.h +0 -141
  764. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-tracer.cc +0 -356
  765. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-tracer.h +0 -103
  766. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler.cc +0 -261
  767. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler.h +0 -228
  768. data/ext/v8/upstream/2.3.3/src/regexp.js +0 -549
  769. data/ext/v8/upstream/2.3.3/src/rewriter.cc +0 -1038
  770. data/ext/v8/upstream/2.3.3/src/rewriter.h +0 -54
  771. data/ext/v8/upstream/2.3.3/src/runtime.cc +0 -10599
  772. data/ext/v8/upstream/2.3.3/src/runtime.h +0 -459
  773. data/ext/v8/upstream/2.3.3/src/runtime.js +0 -629
  774. data/ext/v8/upstream/2.3.3/src/scanner.cc +0 -1346
  775. data/ext/v8/upstream/2.3.3/src/scanner.h +0 -503
  776. data/ext/v8/upstream/2.3.3/src/scopeinfo.cc +0 -637
  777. data/ext/v8/upstream/2.3.3/src/scopeinfo.h +0 -233
  778. data/ext/v8/upstream/2.3.3/src/scopes.cc +0 -962
  779. data/ext/v8/upstream/2.3.3/src/scopes.h +0 -400
  780. data/ext/v8/upstream/2.3.3/src/serialize.cc +0 -1461
  781. data/ext/v8/upstream/2.3.3/src/serialize.h +0 -581
  782. data/ext/v8/upstream/2.3.3/src/spaces-inl.h +0 -483
  783. data/ext/v8/upstream/2.3.3/src/spaces.cc +0 -2901
  784. data/ext/v8/upstream/2.3.3/src/spaces.h +0 -2197
  785. data/ext/v8/upstream/2.3.3/src/string-stream.cc +0 -584
  786. data/ext/v8/upstream/2.3.3/src/string-stream.h +0 -189
  787. data/ext/v8/upstream/2.3.3/src/string.js +0 -1006
  788. data/ext/v8/upstream/2.3.3/src/stub-cache.cc +0 -1379
  789. data/ext/v8/upstream/2.3.3/src/stub-cache.h +0 -756
  790. data/ext/v8/upstream/2.3.3/src/third_party/dtoa/COPYING +0 -15
  791. data/ext/v8/upstream/2.3.3/src/third_party/dtoa/dtoa.c +0 -3334
  792. data/ext/v8/upstream/2.3.3/src/token.cc +0 -56
  793. data/ext/v8/upstream/2.3.3/src/token.h +0 -270
  794. data/ext/v8/upstream/2.3.3/src/top.cc +0 -1067
  795. data/ext/v8/upstream/2.3.3/src/top.h +0 -463
  796. data/ext/v8/upstream/2.3.3/src/type-info.cc +0 -53
  797. data/ext/v8/upstream/2.3.3/src/type-info.h +0 -244
  798. data/ext/v8/upstream/2.3.3/src/unicode-inl.h +0 -238
  799. data/ext/v8/upstream/2.3.3/src/unicode.cc +0 -749
  800. data/ext/v8/upstream/2.3.3/src/unicode.h +0 -279
  801. data/ext/v8/upstream/2.3.3/src/uri.js +0 -415
  802. data/ext/v8/upstream/2.3.3/src/utils.cc +0 -285
  803. data/ext/v8/upstream/2.3.3/src/utils.h +0 -745
  804. data/ext/v8/upstream/2.3.3/src/v8-counters.h +0 -250
  805. data/ext/v8/upstream/2.3.3/src/v8.cc +0 -228
  806. data/ext/v8/upstream/2.3.3/src/v8.h +0 -121
  807. data/ext/v8/upstream/2.3.3/src/v8natives.js +0 -1188
  808. data/ext/v8/upstream/2.3.3/src/v8threads.cc +0 -461
  809. data/ext/v8/upstream/2.3.3/src/v8threads.h +0 -159
  810. data/ext/v8/upstream/2.3.3/src/variables.cc +0 -119
  811. data/ext/v8/upstream/2.3.3/src/variables.h +0 -205
  812. data/ext/v8/upstream/2.3.3/src/version.cc +0 -88
  813. data/ext/v8/upstream/2.3.3/src/virtual-frame-heavy-inl.h +0 -192
  814. data/ext/v8/upstream/2.3.3/src/virtual-frame.h +0 -46
  815. data/ext/v8/upstream/2.3.3/src/vm-state-inl.h +0 -137
  816. data/ext/v8/upstream/2.3.3/src/vm-state.cc +0 -39
  817. data/ext/v8/upstream/2.3.3/src/vm-state.h +0 -77
  818. data/ext/v8/upstream/2.3.3/src/x64/assembler-x64-inl.h +0 -400
  819. data/ext/v8/upstream/2.3.3/src/x64/assembler-x64.cc +0 -2963
  820. data/ext/v8/upstream/2.3.3/src/x64/assembler-x64.h +0 -1438
  821. data/ext/v8/upstream/2.3.3/src/x64/builtins-x64.cc +0 -1296
  822. data/ext/v8/upstream/2.3.3/src/x64/codegen-x64-inl.h +0 -46
  823. data/ext/v8/upstream/2.3.3/src/x64/codegen-x64.cc +0 -12491
  824. data/ext/v8/upstream/2.3.3/src/x64/codegen-x64.h +0 -1090
  825. data/ext/v8/upstream/2.3.3/src/x64/cpu-x64.cc +0 -83
  826. data/ext/v8/upstream/2.3.3/src/x64/debug-x64.cc +0 -267
  827. data/ext/v8/upstream/2.3.3/src/x64/disasm-x64.cc +0 -1696
  828. data/ext/v8/upstream/2.3.3/src/x64/fast-codegen-x64.cc +0 -250
  829. data/ext/v8/upstream/2.3.3/src/x64/frames-x64.cc +0 -113
  830. data/ext/v8/upstream/2.3.3/src/x64/frames-x64.h +0 -125
  831. data/ext/v8/upstream/2.3.3/src/x64/full-codegen-x64.cc +0 -3270
  832. data/ext/v8/upstream/2.3.3/src/x64/ic-x64.cc +0 -1907
  833. data/ext/v8/upstream/2.3.3/src/x64/jump-target-x64.cc +0 -437
  834. data/ext/v8/upstream/2.3.3/src/x64/macro-assembler-x64.cc +0 -2793
  835. data/ext/v8/upstream/2.3.3/src/x64/macro-assembler-x64.h +0 -916
  836. data/ext/v8/upstream/2.3.3/src/x64/regexp-macro-assembler-x64.cc +0 -1374
  837. data/ext/v8/upstream/2.3.3/src/x64/regexp-macro-assembler-x64.h +0 -277
  838. data/ext/v8/upstream/2.3.3/src/x64/simulator-x64.h +0 -63
  839. data/ext/v8/upstream/2.3.3/src/x64/stub-cache-x64.cc +0 -2560
  840. data/ext/v8/upstream/2.3.3/src/x64/virtual-frame-x64.cc +0 -1264
  841. data/ext/v8/upstream/2.3.3/src/x64/virtual-frame-x64.h +0 -590
  842. data/ext/v8/upstream/2.3.3/src/zone-inl.h +0 -82
  843. data/ext/v8/upstream/2.3.3/src/zone.cc +0 -194
  844. data/ext/v8/upstream/2.3.3/src/zone.h +0 -221
  845. data/ext/v8/upstream/2.3.3/tools/codemap.js +0 -270
  846. data/ext/v8/upstream/2.3.3/tools/csvparser.js +0 -83
  847. data/ext/v8/upstream/2.3.3/tools/gc-nvp-trace-processor.py +0 -317
  848. data/ext/v8/upstream/2.3.3/tools/gyp/v8.gyp +0 -749
  849. data/ext/v8/upstream/2.3.3/tools/linux-tick-processor.py +0 -78
  850. data/ext/v8/upstream/2.3.3/tools/logreader.js +0 -338
  851. data/ext/v8/upstream/2.3.3/tools/oprofile/annotate +0 -7
  852. data/ext/v8/upstream/2.3.3/tools/oprofile/common +0 -19
  853. data/ext/v8/upstream/2.3.3/tools/oprofile/dump +0 -7
  854. data/ext/v8/upstream/2.3.3/tools/oprofile/report +0 -7
  855. data/ext/v8/upstream/2.3.3/tools/oprofile/reset +0 -7
  856. data/ext/v8/upstream/2.3.3/tools/oprofile/run +0 -14
  857. data/ext/v8/upstream/2.3.3/tools/oprofile/shutdown +0 -7
  858. data/ext/v8/upstream/2.3.3/tools/oprofile/start +0 -7
  859. data/ext/v8/upstream/2.3.3/tools/presubmit.py +0 -299
  860. data/ext/v8/upstream/2.3.3/tools/profile.js +0 -691
  861. data/ext/v8/upstream/2.3.3/tools/profile_view.js +0 -224
  862. data/ext/v8/upstream/2.3.3/tools/splaytree.js +0 -322
  863. data/ext/v8/upstream/2.3.3/tools/splaytree.py +0 -226
  864. data/ext/v8/upstream/2.3.3/tools/tickprocessor.js +0 -862
  865. data/ext/v8/upstream/2.3.3/tools/tickprocessor.py +0 -571
  866. data/ext/v8/upstream/2.3.3/tools/utils.py +0 -88
  867. data/ext/v8/upstream/2.3.3/tools/visual_studio/README.txt +0 -71
  868. data/ext/v8/upstream/2.3.3/tools/visual_studio/common.vsprops +0 -34
  869. data/ext/v8/upstream/2.3.3/tools/visual_studio/debug.vsprops +0 -17
  870. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base.vcproj +0 -1143
  871. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base_arm.vcproj +0 -1115
  872. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base_x64.vcproj +0 -1096
  873. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample.vcproj +0 -145
  874. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -145
  875. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -161
  876. data/ext/v8/upstream/2.3.3/tools/windows-tick-processor.bat +0 -29
  877. data/ext/v8/upstream/2.3.3/tools/windows-tick-processor.py +0 -137
@@ -1,266 +0,0 @@
1
- // Copyright 2006-2008 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #ifndef V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_
29
- #define V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_
30
-
31
- namespace v8 {
32
- namespace internal {
33
-
34
-
35
- #ifdef V8_INTERPRETED_REGEXP
36
- class RegExpMacroAssemblerARM: public RegExpMacroAssembler {
37
- public:
38
- RegExpMacroAssemblerARM();
39
- virtual ~RegExpMacroAssemblerARM();
40
- };
41
-
42
- #else // V8_INTERPRETED_REGEXP
43
- class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler {
44
- public:
45
- RegExpMacroAssemblerARM(Mode mode, int registers_to_save);
46
- virtual ~RegExpMacroAssemblerARM();
47
- virtual int stack_limit_slack();
48
- virtual void AdvanceCurrentPosition(int by);
49
- virtual void AdvanceRegister(int reg, int by);
50
- virtual void Backtrack();
51
- virtual void Bind(Label* label);
52
- virtual void CheckAtStart(Label* on_at_start);
53
- virtual void CheckCharacter(uint32_t c, Label* on_equal);
54
- virtual void CheckCharacterAfterAnd(uint32_t c,
55
- uint32_t mask,
56
- Label* on_equal);
57
- virtual void CheckCharacterGT(uc16 limit, Label* on_greater);
58
- virtual void CheckCharacterLT(uc16 limit, Label* on_less);
59
- virtual void CheckCharacters(Vector<const uc16> str,
60
- int cp_offset,
61
- Label* on_failure,
62
- bool check_end_of_string);
63
- // A "greedy loop" is a loop that is both greedy and with a simple
64
- // body. It has a particularly simple implementation.
65
- virtual void CheckGreedyLoop(Label* on_tos_equals_current_position);
66
- virtual void CheckNotAtStart(Label* on_not_at_start);
67
- virtual void CheckNotBackReference(int start_reg, Label* on_no_match);
68
- virtual void CheckNotBackReferenceIgnoreCase(int start_reg,
69
- Label* on_no_match);
70
- virtual void CheckNotRegistersEqual(int reg1, int reg2, Label* on_not_equal);
71
- virtual void CheckNotCharacter(uint32_t c, Label* on_not_equal);
72
- virtual void CheckNotCharacterAfterAnd(uint32_t c,
73
- uint32_t mask,
74
- Label* on_not_equal);
75
- virtual void CheckNotCharacterAfterMinusAnd(uc16 c,
76
- uc16 minus,
77
- uc16 mask,
78
- Label* on_not_equal);
79
- // Checks whether the given offset from the current position is before
80
- // the end of the string.
81
- virtual void CheckPosition(int cp_offset, Label* on_outside_input);
82
- virtual bool CheckSpecialCharacterClass(uc16 type,
83
- Label* on_no_match);
84
- virtual void Fail();
85
- virtual Handle<Object> GetCode(Handle<String> source);
86
- virtual void GoTo(Label* label);
87
- virtual void IfRegisterGE(int reg, int comparand, Label* if_ge);
88
- virtual void IfRegisterLT(int reg, int comparand, Label* if_lt);
89
- virtual void IfRegisterEqPos(int reg, Label* if_eq);
90
- virtual IrregexpImplementation Implementation();
91
- virtual void LoadCurrentCharacter(int cp_offset,
92
- Label* on_end_of_input,
93
- bool check_bounds = true,
94
- int characters = 1);
95
- virtual void PopCurrentPosition();
96
- virtual void PopRegister(int register_index);
97
- virtual void PushBacktrack(Label* label);
98
- virtual void PushCurrentPosition();
99
- virtual void PushRegister(int register_index,
100
- StackCheckFlag check_stack_limit);
101
- virtual void ReadCurrentPositionFromRegister(int reg);
102
- virtual void ReadStackPointerFromRegister(int reg);
103
- virtual void SetRegister(int register_index, int to);
104
- virtual void Succeed();
105
- virtual void WriteCurrentPositionToRegister(int reg, int cp_offset);
106
- virtual void ClearRegisters(int reg_from, int reg_to);
107
- virtual void WriteStackPointerToRegister(int reg);
108
-
109
- // Called from RegExp if the stack-guard is triggered.
110
- // If the code object is relocated, the return address is fixed before
111
- // returning.
112
- static int CheckStackGuardState(Address* return_address,
113
- Code* re_code,
114
- Address re_frame);
115
- private:
116
- // Offsets from frame_pointer() of function parameters and stored registers.
117
- static const int kFramePointer = 0;
118
-
119
- // Above the frame pointer - Stored registers and stack passed parameters.
120
- // Register 4..11.
121
- static const int kStoredRegisters = kFramePointer;
122
- // Return address (stored from link register, read into pc on return).
123
- static const int kReturnAddress = kStoredRegisters + 8 * kPointerSize;
124
- // Stack parameters placed by caller.
125
- static const int kRegisterOutput = kReturnAddress + kPointerSize;
126
- static const int kStackHighEnd = kRegisterOutput + kPointerSize;
127
- static const int kDirectCall = kStackHighEnd + kPointerSize;
128
-
129
- // Below the frame pointer.
130
- // Register parameters stored by setup code.
131
- static const int kInputEnd = kFramePointer - kPointerSize;
132
- static const int kInputStart = kInputEnd - kPointerSize;
133
- static const int kStartIndex = kInputStart - kPointerSize;
134
- static const int kInputString = kStartIndex - kPointerSize;
135
- // When adding local variables remember to push space for them in
136
- // the frame in GetCode.
137
- static const int kInputStartMinusOne = kInputString - kPointerSize;
138
- static const int kAtStart = kInputStartMinusOne - kPointerSize;
139
- // First register address. Following registers are below it on the stack.
140
- static const int kRegisterZero = kAtStart - kPointerSize;
141
-
142
- // Initial size of code buffer.
143
- static const size_t kRegExpCodeSize = 1024;
144
-
145
- static const int kBacktrackConstantPoolSize = 4;
146
-
147
- // Load a number of characters at the given offset from the
148
- // current position, into the current-character register.
149
- void LoadCurrentCharacterUnchecked(int cp_offset, int character_count);
150
-
151
- // Check whether preemption has been requested.
152
- void CheckPreemption();
153
-
154
- // Check whether we are exceeding the stack limit on the backtrack stack.
155
- void CheckStackLimit();
156
-
157
- void EmitBacktrackConstantPool();
158
- int GetBacktrackConstantPoolEntry();
159
-
160
-
161
- // Generate a call to CheckStackGuardState.
162
- void CallCheckStackGuardState(Register scratch);
163
-
164
- // The ebp-relative location of a regexp register.
165
- MemOperand register_location(int register_index);
166
-
167
- // Register holding the current input position as negative offset from
168
- // the end of the string.
169
- inline Register current_input_offset() { return r6; }
170
-
171
- // The register containing the current character after LoadCurrentCharacter.
172
- inline Register current_character() { return r7; }
173
-
174
- // Register holding address of the end of the input string.
175
- inline Register end_of_input_address() { return r10; }
176
-
177
- // Register holding the frame address. Local variables, parameters and
178
- // regexp registers are addressed relative to this.
179
- inline Register frame_pointer() { return fp; }
180
-
181
- // The register containing the backtrack stack top. Provides a meaningful
182
- // name to the register.
183
- inline Register backtrack_stackpointer() { return r8; }
184
-
185
- // Register holding pointer to the current code object.
186
- inline Register code_pointer() { return r5; }
187
-
188
- // Byte size of chars in the string to match (decided by the Mode argument)
189
- inline int char_size() { return static_cast<int>(mode_); }
190
-
191
- // Equivalent to a conditional branch to the label, unless the label
192
- // is NULL, in which case it is a conditional Backtrack.
193
- void BranchOrBacktrack(Condition condition, Label* to);
194
-
195
- // Call and return internally in the generated code in a way that
196
- // is GC-safe (i.e., doesn't leave absolute code addresses on the stack)
197
- inline void SafeCall(Label* to, Condition cond = al);
198
- inline void SafeReturn();
199
- inline void SafeCallTarget(Label* name);
200
-
201
- // Pushes the value of a register on the backtrack stack. Decrements the
202
- // stack pointer by a word size and stores the register's value there.
203
- inline void Push(Register source);
204
-
205
- // Pops a value from the backtrack stack. Reads the word at the stack pointer
206
- // and increments it by a word size.
207
- inline void Pop(Register target);
208
-
209
- // Calls a C function and cleans up the frame alignment done by
210
- // by FrameAlign. The called function *is* allowed to trigger a garbage
211
- // collection, but may not take more than four arguments (no arguments
212
- // passed on the stack), and the first argument will be a pointer to the
213
- // return address.
214
- inline void CallCFunctionUsingStub(ExternalReference function,
215
- int num_arguments);
216
-
217
-
218
- MacroAssembler* masm_;
219
-
220
- // Which mode to generate code for (ASCII or UC16).
221
- Mode mode_;
222
-
223
- // One greater than maximal register index actually used.
224
- int num_registers_;
225
-
226
- // Number of registers to output at the end (the saved registers
227
- // are always 0..num_saved_registers_-1)
228
- int num_saved_registers_;
229
-
230
- // Manage a small pre-allocated pool for writing label targets
231
- // to for pushing backtrack addresses.
232
- int backtrack_constant_pool_offset_;
233
- int backtrack_constant_pool_capacity_;
234
-
235
- // Labels used internally.
236
- Label entry_label_;
237
- Label start_label_;
238
- Label success_label_;
239
- Label backtrack_label_;
240
- Label exit_label_;
241
- Label check_preempt_label_;
242
- Label stack_overflow_label_;
243
- };
244
-
245
-
246
- // Enter C code from generated RegExp code in a way that allows
247
- // the C code to fix the return address in case of a GC.
248
- // Currently only needed on ARM.
249
- class RegExpCEntryStub: public CodeStub {
250
- public:
251
- RegExpCEntryStub() {}
252
- virtual ~RegExpCEntryStub() {}
253
- void Generate(MacroAssembler* masm);
254
-
255
- private:
256
- Major MajorKey() { return RegExpCEntry; }
257
- int MinorKey() { return 0; }
258
- const char* GetName() { return "RegExpCEntryStub"; }
259
- };
260
-
261
- #endif // V8_INTERPRETED_REGEXP
262
-
263
-
264
- }} // namespace v8::internal
265
-
266
- #endif // V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_
@@ -1,2822 +0,0 @@
1
- // Copyright 2010 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #include <stdlib.h>
29
- #include <math.h>
30
- #include <cstdarg>
31
- #include "v8.h"
32
-
33
- #if defined(V8_TARGET_ARCH_ARM)
34
-
35
- #include "disasm.h"
36
- #include "assembler.h"
37
- #include "arm/constants-arm.h"
38
- #include "arm/simulator-arm.h"
39
-
40
- #if !defined(__arm__)
41
-
42
- // Only build the simulator if not compiling for real ARM hardware.
43
- namespace assembler {
44
- namespace arm {
45
-
46
- using ::v8::internal::Object;
47
- using ::v8::internal::PrintF;
48
- using ::v8::internal::OS;
49
- using ::v8::internal::ReadLine;
50
- using ::v8::internal::DeleteArray;
51
-
52
- // This macro provides a platform independent use of sscanf. The reason for
53
- // SScanF not being implemented in a platform independent way through
54
- // ::v8::internal::OS in the same way as SNPrintF is that the
55
- // Windows C Run-Time Library does not provide vsscanf.
56
- #define SScanF sscanf // NOLINT
57
-
58
- // The Debugger class is used by the simulator while debugging simulated ARM
59
- // code.
60
- class Debugger {
61
- public:
62
- explicit Debugger(Simulator* sim);
63
- ~Debugger();
64
-
65
- void Stop(Instr* instr);
66
- void Debug();
67
-
68
- private:
69
- static const instr_t kBreakpointInstr =
70
- ((AL << 28) | (7 << 25) | (1 << 24) | break_point);
71
- static const instr_t kNopInstr =
72
- ((AL << 28) | (13 << 21));
73
-
74
- Simulator* sim_;
75
-
76
- int32_t GetRegisterValue(int regnum);
77
- bool GetValue(const char* desc, int32_t* value);
78
- bool GetVFPSingleValue(const char* desc, float* value);
79
- bool GetVFPDoubleValue(const char* desc, double* value);
80
-
81
- // Set or delete a breakpoint. Returns true if successful.
82
- bool SetBreakpoint(Instr* breakpc);
83
- bool DeleteBreakpoint(Instr* breakpc);
84
-
85
- // Undo and redo all breakpoints. This is needed to bracket disassembly and
86
- // execution to skip past breakpoints when run from the debugger.
87
- void UndoBreakpoints();
88
- void RedoBreakpoints();
89
- };
90
-
91
-
92
- Debugger::Debugger(Simulator* sim) {
93
- sim_ = sim;
94
- }
95
-
96
-
97
- Debugger::~Debugger() {
98
- }
99
-
100
-
101
-
102
- #ifdef GENERATED_CODE_COVERAGE
103
- static FILE* coverage_log = NULL;
104
-
105
-
106
- static void InitializeCoverage() {
107
- char* file_name = getenv("V8_GENERATED_CODE_COVERAGE_LOG");
108
- if (file_name != NULL) {
109
- coverage_log = fopen(file_name, "aw+");
110
- }
111
- }
112
-
113
-
114
- void Debugger::Stop(Instr* instr) {
115
- char* str = reinterpret_cast<char*>(instr->InstructionBits() & 0x0fffffff);
116
- if (strlen(str) > 0) {
117
- if (coverage_log != NULL) {
118
- fprintf(coverage_log, "%s\n", str);
119
- fflush(coverage_log);
120
- }
121
- instr->SetInstructionBits(0xe1a00000); // Overwrite with nop.
122
- }
123
- sim_->set_pc(sim_->get_pc() + Instr::kInstrSize);
124
- }
125
-
126
- #else // ndef GENERATED_CODE_COVERAGE
127
-
128
- static void InitializeCoverage() {
129
- }
130
-
131
-
132
- void Debugger::Stop(Instr* instr) {
133
- const char* str = (const char*)(instr->InstructionBits() & 0x0fffffff);
134
- PrintF("Simulator hit %s\n", str);
135
- sim_->set_pc(sim_->get_pc() + Instr::kInstrSize);
136
- Debug();
137
- }
138
- #endif
139
-
140
-
141
- int32_t Debugger::GetRegisterValue(int regnum) {
142
- if (regnum == kPCRegister) {
143
- return sim_->get_pc();
144
- } else {
145
- return sim_->get_register(regnum);
146
- }
147
- }
148
-
149
-
150
- bool Debugger::GetValue(const char* desc, int32_t* value) {
151
- int regnum = Registers::Number(desc);
152
- if (regnum != kNoRegister) {
153
- *value = GetRegisterValue(regnum);
154
- return true;
155
- } else {
156
- if (strncmp(desc, "0x", 2) == 0) {
157
- return SScanF(desc + 2, "%x", reinterpret_cast<uint32_t*>(value)) == 1;
158
- } else {
159
- return SScanF(desc, "%u", reinterpret_cast<uint32_t*>(value)) == 1;
160
- }
161
- }
162
- return false;
163
- }
164
-
165
-
166
- bool Debugger::GetVFPSingleValue(const char* desc, float* value) {
167
- bool is_double;
168
- int regnum = VFPRegisters::Number(desc, &is_double);
169
- if (regnum != kNoRegister && !is_double) {
170
- *value = sim_->get_float_from_s_register(regnum);
171
- return true;
172
- }
173
- return false;
174
- }
175
-
176
-
177
- bool Debugger::GetVFPDoubleValue(const char* desc, double* value) {
178
- bool is_double;
179
- int regnum = VFPRegisters::Number(desc, &is_double);
180
- if (regnum != kNoRegister && is_double) {
181
- *value = sim_->get_double_from_d_register(regnum);
182
- return true;
183
- }
184
- return false;
185
- }
186
-
187
-
188
- bool Debugger::SetBreakpoint(Instr* breakpc) {
189
- // Check if a breakpoint can be set. If not return without any side-effects.
190
- if (sim_->break_pc_ != NULL) {
191
- return false;
192
- }
193
-
194
- // Set the breakpoint.
195
- sim_->break_pc_ = breakpc;
196
- sim_->break_instr_ = breakpc->InstructionBits();
197
- // Not setting the breakpoint instruction in the code itself. It will be set
198
- // when the debugger shell continues.
199
- return true;
200
- }
201
-
202
-
203
- bool Debugger::DeleteBreakpoint(Instr* breakpc) {
204
- if (sim_->break_pc_ != NULL) {
205
- sim_->break_pc_->SetInstructionBits(sim_->break_instr_);
206
- }
207
-
208
- sim_->break_pc_ = NULL;
209
- sim_->break_instr_ = 0;
210
- return true;
211
- }
212
-
213
-
214
- void Debugger::UndoBreakpoints() {
215
- if (sim_->break_pc_ != NULL) {
216
- sim_->break_pc_->SetInstructionBits(sim_->break_instr_);
217
- }
218
- }
219
-
220
-
221
- void Debugger::RedoBreakpoints() {
222
- if (sim_->break_pc_ != NULL) {
223
- sim_->break_pc_->SetInstructionBits(kBreakpointInstr);
224
- }
225
- }
226
-
227
-
228
- void Debugger::Debug() {
229
- intptr_t last_pc = -1;
230
- bool done = false;
231
-
232
- #define COMMAND_SIZE 63
233
- #define ARG_SIZE 255
234
-
235
- #define STR(a) #a
236
- #define XSTR(a) STR(a)
237
-
238
- char cmd[COMMAND_SIZE + 1];
239
- char arg1[ARG_SIZE + 1];
240
- char arg2[ARG_SIZE + 1];
241
- char* argv[3] = { cmd, arg1, arg2 };
242
-
243
- // make sure to have a proper terminating character if reaching the limit
244
- cmd[COMMAND_SIZE] = 0;
245
- arg1[ARG_SIZE] = 0;
246
- arg2[ARG_SIZE] = 0;
247
-
248
- // Undo all set breakpoints while running in the debugger shell. This will
249
- // make them invisible to all commands.
250
- UndoBreakpoints();
251
-
252
- while (!done) {
253
- if (last_pc != sim_->get_pc()) {
254
- disasm::NameConverter converter;
255
- disasm::Disassembler dasm(converter);
256
- // use a reasonably large buffer
257
- v8::internal::EmbeddedVector<char, 256> buffer;
258
- dasm.InstructionDecode(buffer,
259
- reinterpret_cast<byte*>(sim_->get_pc()));
260
- PrintF(" 0x%08x %s\n", sim_->get_pc(), buffer.start());
261
- last_pc = sim_->get_pc();
262
- }
263
- char* line = ReadLine("sim> ");
264
- if (line == NULL) {
265
- break;
266
- } else {
267
- // Use sscanf to parse the individual parts of the command line. At the
268
- // moment no command expects more than two parameters.
269
- int argc = SScanF(line,
270
- "%" XSTR(COMMAND_SIZE) "s "
271
- "%" XSTR(ARG_SIZE) "s "
272
- "%" XSTR(ARG_SIZE) "s",
273
- cmd, arg1, arg2);
274
- if ((strcmp(cmd, "si") == 0) || (strcmp(cmd, "stepi") == 0)) {
275
- sim_->InstructionDecode(reinterpret_cast<Instr*>(sim_->get_pc()));
276
- } else if ((strcmp(cmd, "c") == 0) || (strcmp(cmd, "cont") == 0)) {
277
- // Execute the one instruction we broke at with breakpoints disabled.
278
- sim_->InstructionDecode(reinterpret_cast<Instr*>(sim_->get_pc()));
279
- // Leave the debugger shell.
280
- done = true;
281
- } else if ((strcmp(cmd, "p") == 0) || (strcmp(cmd, "print") == 0)) {
282
- if (argc == 2) {
283
- int32_t value;
284
- float svalue;
285
- double dvalue;
286
- if (strcmp(arg1, "all") == 0) {
287
- for (int i = 0; i < kNumRegisters; i++) {
288
- value = GetRegisterValue(i);
289
- PrintF("%3s: 0x%08x %10d\n", Registers::Name(i), value, value);
290
- }
291
- } else {
292
- if (GetValue(arg1, &value)) {
293
- PrintF("%s: 0x%08x %d \n", arg1, value, value);
294
- } else if (GetVFPSingleValue(arg1, &svalue)) {
295
- PrintF("%s: %f \n", arg1, svalue);
296
- } else if (GetVFPDoubleValue(arg1, &dvalue)) {
297
- PrintF("%s: %lf \n", arg1, dvalue);
298
- } else {
299
- PrintF("%s unrecognized\n", arg1);
300
- }
301
- }
302
- } else {
303
- PrintF("print <register>\n");
304
- }
305
- } else if ((strcmp(cmd, "po") == 0)
306
- || (strcmp(cmd, "printobject") == 0)) {
307
- if (argc == 2) {
308
- int32_t value;
309
- if (GetValue(arg1, &value)) {
310
- Object* obj = reinterpret_cast<Object*>(value);
311
- PrintF("%s: \n", arg1);
312
- #ifdef DEBUG
313
- obj->PrintLn();
314
- #else
315
- obj->ShortPrint();
316
- PrintF("\n");
317
- #endif
318
- } else {
319
- PrintF("%s unrecognized\n", arg1);
320
- }
321
- } else {
322
- PrintF("printobject <value>\n");
323
- }
324
- } else if (strcmp(cmd, "stack") == 0 || strcmp(cmd, "mem") == 0) {
325
- int32_t* cur = NULL;
326
- int32_t* end = NULL;
327
- int next_arg = 1;
328
-
329
- if (strcmp(cmd, "stack") == 0) {
330
- cur = reinterpret_cast<int32_t*>(sim_->get_register(Simulator::sp));
331
- } else { // "mem"
332
- int32_t value;
333
- if (!GetValue(arg1, &value)) {
334
- PrintF("%s unrecognized\n", arg1);
335
- continue;
336
- }
337
- cur = reinterpret_cast<int32_t*>(value);
338
- next_arg++;
339
- }
340
-
341
- int32_t words;
342
- if (argc == next_arg) {
343
- words = 10;
344
- } else if (argc == next_arg + 1) {
345
- if (!GetValue(argv[next_arg], &words)) {
346
- words = 10;
347
- }
348
- }
349
- end = cur + words;
350
-
351
- while (cur < end) {
352
- PrintF(" 0x%08x: 0x%08x %10d\n", cur, *cur, *cur);
353
- cur++;
354
- }
355
- } else if (strcmp(cmd, "disasm") == 0) {
356
- disasm::NameConverter converter;
357
- disasm::Disassembler dasm(converter);
358
- // use a reasonably large buffer
359
- v8::internal::EmbeddedVector<char, 256> buffer;
360
-
361
- byte* cur = NULL;
362
- byte* end = NULL;
363
-
364
- if (argc == 1) {
365
- cur = reinterpret_cast<byte*>(sim_->get_pc());
366
- end = cur + (10 * Instr::kInstrSize);
367
- } else if (argc == 2) {
368
- int32_t value;
369
- if (GetValue(arg1, &value)) {
370
- cur = reinterpret_cast<byte*>(value);
371
- // no length parameter passed, assume 10 instructions
372
- end = cur + (10 * Instr::kInstrSize);
373
- }
374
- } else {
375
- int32_t value1;
376
- int32_t value2;
377
- if (GetValue(arg1, &value1) && GetValue(arg2, &value2)) {
378
- cur = reinterpret_cast<byte*>(value1);
379
- end = cur + (value2 * Instr::kInstrSize);
380
- }
381
- }
382
-
383
- while (cur < end) {
384
- dasm.InstructionDecode(buffer, cur);
385
- PrintF(" 0x%08x %s\n", cur, buffer.start());
386
- cur += Instr::kInstrSize;
387
- }
388
- } else if (strcmp(cmd, "gdb") == 0) {
389
- PrintF("relinquishing control to gdb\n");
390
- v8::internal::OS::DebugBreak();
391
- PrintF("regaining control from gdb\n");
392
- } else if (strcmp(cmd, "break") == 0) {
393
- if (argc == 2) {
394
- int32_t value;
395
- if (GetValue(arg1, &value)) {
396
- if (!SetBreakpoint(reinterpret_cast<Instr*>(value))) {
397
- PrintF("setting breakpoint failed\n");
398
- }
399
- } else {
400
- PrintF("%s unrecognized\n", arg1);
401
- }
402
- } else {
403
- PrintF("break <address>\n");
404
- }
405
- } else if (strcmp(cmd, "del") == 0) {
406
- if (!DeleteBreakpoint(NULL)) {
407
- PrintF("deleting breakpoint failed\n");
408
- }
409
- } else if (strcmp(cmd, "flags") == 0) {
410
- PrintF("N flag: %d; ", sim_->n_flag_);
411
- PrintF("Z flag: %d; ", sim_->z_flag_);
412
- PrintF("C flag: %d; ", sim_->c_flag_);
413
- PrintF("V flag: %d\n", sim_->v_flag_);
414
- PrintF("INVALID OP flag: %d; ", sim_->inv_op_vfp_flag_);
415
- PrintF("DIV BY ZERO flag: %d; ", sim_->div_zero_vfp_flag_);
416
- PrintF("OVERFLOW flag: %d; ", sim_->overflow_vfp_flag_);
417
- PrintF("UNDERFLOW flag: %d; ", sim_->underflow_vfp_flag_);
418
- PrintF("INEXACT flag: %d; ", sim_->inexact_vfp_flag_);
419
- } else if (strcmp(cmd, "unstop") == 0) {
420
- intptr_t stop_pc = sim_->get_pc() - Instr::kInstrSize;
421
- Instr* stop_instr = reinterpret_cast<Instr*>(stop_pc);
422
- if (stop_instr->ConditionField() == special_condition) {
423
- stop_instr->SetInstructionBits(kNopInstr);
424
- } else {
425
- PrintF("Not at debugger stop.");
426
- }
427
- } else if ((strcmp(cmd, "t") == 0) || strcmp(cmd, "trace") == 0) {
428
- ::v8::internal::FLAG_trace_sim = !::v8::internal::FLAG_trace_sim;
429
- PrintF("Trace of executed instructions is %s\n",
430
- ::v8::internal::FLAG_trace_sim ? "on" : "off");
431
- } else if ((strcmp(cmd, "h") == 0) || (strcmp(cmd, "help") == 0)) {
432
- PrintF("cont\n");
433
- PrintF(" continue execution (alias 'c')\n");
434
- PrintF("stepi\n");
435
- PrintF(" step one instruction (alias 'si')\n");
436
- PrintF("print <register>\n");
437
- PrintF(" print register content (alias 'p')\n");
438
- PrintF(" use register name 'all' to print all registers\n");
439
- PrintF("printobject <register>\n");
440
- PrintF(" print an object from a register (alias 'po')\n");
441
- PrintF("flags\n");
442
- PrintF(" print flags\n");
443
- PrintF("stack [<words>]\n");
444
- PrintF(" dump stack content, default dump 10 words)\n");
445
- PrintF("mem <address> [<words>]\n");
446
- PrintF(" dump memory content, default dump 10 words)\n");
447
- PrintF("disasm [<instructions>]\n");
448
- PrintF("disasm [[<address>] <instructions>]\n");
449
- PrintF(" disassemble code, default is 10 instructions from pc\n");
450
- PrintF("gdb\n");
451
- PrintF(" enter gdb\n");
452
- PrintF("break <address>\n");
453
- PrintF(" set a break point on the address\n");
454
- PrintF("del\n");
455
- PrintF(" delete the breakpoint\n");
456
- PrintF("unstop\n");
457
- PrintF(" ignore the stop instruction at the current location");
458
- PrintF(" from now on\n");
459
- PrintF("trace (alias 't')\n");
460
- PrintF(" toogle the tracing of all executed statements\n");
461
- } else {
462
- PrintF("Unknown command: %s\n", cmd);
463
- }
464
- }
465
- DeleteArray(line);
466
- }
467
-
468
- // Add all the breakpoints back to stop execution and enter the debugger
469
- // shell when hit.
470
- RedoBreakpoints();
471
-
472
- #undef COMMAND_SIZE
473
- #undef ARG_SIZE
474
-
475
- #undef STR
476
- #undef XSTR
477
- }
478
-
479
-
480
- static bool ICacheMatch(void* one, void* two) {
481
- ASSERT((reinterpret_cast<intptr_t>(one) & CachePage::kPageMask) == 0);
482
- ASSERT((reinterpret_cast<intptr_t>(two) & CachePage::kPageMask) == 0);
483
- return one == two;
484
- }
485
-
486
-
487
- static uint32_t ICacheHash(void* key) {
488
- return static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key)) >> 2;
489
- }
490
-
491
-
492
- static bool AllOnOnePage(uintptr_t start, int size) {
493
- intptr_t start_page = (start & ~CachePage::kPageMask);
494
- intptr_t end_page = ((start + size) & ~CachePage::kPageMask);
495
- return start_page == end_page;
496
- }
497
-
498
-
499
- void Simulator::FlushICache(void* start_addr, size_t size) {
500
- intptr_t start = reinterpret_cast<intptr_t>(start_addr);
501
- int intra_line = (start & CachePage::kLineMask);
502
- start -= intra_line;
503
- size += intra_line;
504
- size = ((size - 1) | CachePage::kLineMask) + 1;
505
- int offset = (start & CachePage::kPageMask);
506
- while (!AllOnOnePage(start, size - 1)) {
507
- int bytes_to_flush = CachePage::kPageSize - offset;
508
- FlushOnePage(start, bytes_to_flush);
509
- start += bytes_to_flush;
510
- size -= bytes_to_flush;
511
- ASSERT_EQ(0, start & CachePage::kPageMask);
512
- offset = 0;
513
- }
514
- if (size != 0) {
515
- FlushOnePage(start, size);
516
- }
517
- }
518
-
519
-
520
- CachePage* Simulator::GetCachePage(void* page) {
521
- v8::internal::HashMap::Entry* entry = i_cache_->Lookup(page,
522
- ICacheHash(page),
523
- true);
524
- if (entry->value == NULL) {
525
- CachePage* new_page = new CachePage();
526
- entry->value = new_page;
527
- }
528
- return reinterpret_cast<CachePage*>(entry->value);
529
- }
530
-
531
-
532
- // Flush from start up to and not including start + size.
533
- void Simulator::FlushOnePage(intptr_t start, int size) {
534
- ASSERT(size <= CachePage::kPageSize);
535
- ASSERT(AllOnOnePage(start, size - 1));
536
- ASSERT((start & CachePage::kLineMask) == 0);
537
- ASSERT((size & CachePage::kLineMask) == 0);
538
- void* page = reinterpret_cast<void*>(start & (~CachePage::kPageMask));
539
- int offset = (start & CachePage::kPageMask);
540
- CachePage* cache_page = GetCachePage(page);
541
- char* valid_bytemap = cache_page->ValidityByte(offset);
542
- memset(valid_bytemap, CachePage::LINE_INVALID, size >> CachePage::kLineShift);
543
- }
544
-
545
-
546
- void Simulator::CheckICache(Instr* instr) {
547
- intptr_t address = reinterpret_cast<intptr_t>(instr);
548
- void* page = reinterpret_cast<void*>(address & (~CachePage::kPageMask));
549
- void* line = reinterpret_cast<void*>(address & (~CachePage::kLineMask));
550
- int offset = (address & CachePage::kPageMask);
551
- CachePage* cache_page = GetCachePage(page);
552
- char* cache_valid_byte = cache_page->ValidityByte(offset);
553
- bool cache_hit = (*cache_valid_byte == CachePage::LINE_VALID);
554
- char* cached_line = cache_page->CachedData(offset & ~CachePage::kLineMask);
555
- if (cache_hit) {
556
- // Check that the data in memory matches the contents of the I-cache.
557
- CHECK(memcmp(reinterpret_cast<void*>(instr),
558
- cache_page->CachedData(offset),
559
- Instr::kInstrSize) == 0);
560
- } else {
561
- // Cache miss. Load memory into the cache.
562
- memcpy(cached_line, line, CachePage::kLineLength);
563
- *cache_valid_byte = CachePage::LINE_VALID;
564
- }
565
- }
566
-
567
-
568
- // Create one simulator per thread and keep it in thread local storage.
569
- static v8::internal::Thread::LocalStorageKey simulator_key;
570
-
571
-
572
- bool Simulator::initialized_ = false;
573
-
574
-
575
- void Simulator::Initialize() {
576
- if (initialized_) return;
577
- simulator_key = v8::internal::Thread::CreateThreadLocalKey();
578
- initialized_ = true;
579
- ::v8::internal::ExternalReference::set_redirector(&RedirectExternalReference);
580
- }
581
-
582
-
583
- v8::internal::HashMap* Simulator::i_cache_ = NULL;
584
-
585
-
586
- Simulator::Simulator() {
587
- if (i_cache_ == NULL) {
588
- i_cache_ = new v8::internal::HashMap(&ICacheMatch);
589
- }
590
- Initialize();
591
- // Setup simulator support first. Some of this information is needed to
592
- // setup the architecture state.
593
- size_t stack_size = 1 * 1024*1024; // allocate 1MB for stack
594
- stack_ = reinterpret_cast<char*>(malloc(stack_size));
595
- pc_modified_ = false;
596
- icount_ = 0;
597
- break_pc_ = NULL;
598
- break_instr_ = 0;
599
-
600
- // Setup architecture state.
601
- // All registers are initialized to zero to start with.
602
- for (int i = 0; i < num_registers; i++) {
603
- registers_[i] = 0;
604
- }
605
- n_flag_ = false;
606
- z_flag_ = false;
607
- c_flag_ = false;
608
- v_flag_ = false;
609
-
610
- // Initializing VFP registers.
611
- // All registers are initialized to zero to start with
612
- // even though s_registers_ & d_registers_ share the same
613
- // physical registers in the target.
614
- for (int i = 0; i < num_s_registers; i++) {
615
- vfp_register[i] = 0;
616
- }
617
- n_flag_FPSCR_ = false;
618
- z_flag_FPSCR_ = false;
619
- c_flag_FPSCR_ = false;
620
- v_flag_FPSCR_ = false;
621
-
622
- inv_op_vfp_flag_ = false;
623
- div_zero_vfp_flag_ = false;
624
- overflow_vfp_flag_ = false;
625
- underflow_vfp_flag_ = false;
626
- inexact_vfp_flag_ = false;
627
-
628
- // The sp is initialized to point to the bottom (high address) of the
629
- // allocated stack area. To be safe in potential stack underflows we leave
630
- // some buffer below.
631
- registers_[sp] = reinterpret_cast<int32_t>(stack_) + stack_size - 64;
632
- // The lr and pc are initialized to a known bad value that will cause an
633
- // access violation if the simulator ever tries to execute it.
634
- registers_[pc] = bad_lr;
635
- registers_[lr] = bad_lr;
636
- InitializeCoverage();
637
- }
638
-
639
-
640
- // When the generated code calls an external reference we need to catch that in
641
- // the simulator. The external reference will be a function compiled for the
642
- // host architecture. We need to call that function instead of trying to
643
- // execute it with the simulator. We do that by redirecting the external
644
- // reference to a swi (software-interrupt) instruction that is handled by
645
- // the simulator. We write the original destination of the jump just at a known
646
- // offset from the swi instruction so the simulator knows what to call.
647
- class Redirection {
648
- public:
649
- Redirection(void* external_function, bool fp_return)
650
- : external_function_(external_function),
651
- swi_instruction_((AL << 28) | (0xf << 24) | call_rt_redirected),
652
- fp_return_(fp_return),
653
- next_(list_) {
654
- Simulator::current()->
655
- FlushICache(reinterpret_cast<void*>(&swi_instruction_),
656
- Instr::kInstrSize);
657
- list_ = this;
658
- }
659
-
660
- void* address_of_swi_instruction() {
661
- return reinterpret_cast<void*>(&swi_instruction_);
662
- }
663
-
664
- void* external_function() { return external_function_; }
665
- bool fp_return() { return fp_return_; }
666
-
667
- static Redirection* Get(void* external_function, bool fp_return) {
668
- Redirection* current;
669
- for (current = list_; current != NULL; current = current->next_) {
670
- if (current->external_function_ == external_function) return current;
671
- }
672
- return new Redirection(external_function, fp_return);
673
- }
674
-
675
- static Redirection* FromSwiInstruction(Instr* swi_instruction) {
676
- char* addr_of_swi = reinterpret_cast<char*>(swi_instruction);
677
- char* addr_of_redirection =
678
- addr_of_swi - OFFSET_OF(Redirection, swi_instruction_);
679
- return reinterpret_cast<Redirection*>(addr_of_redirection);
680
- }
681
-
682
- private:
683
- void* external_function_;
684
- uint32_t swi_instruction_;
685
- bool fp_return_;
686
- Redirection* next_;
687
- static Redirection* list_;
688
- };
689
-
690
-
691
- Redirection* Redirection::list_ = NULL;
692
-
693
-
694
- void* Simulator::RedirectExternalReference(void* external_function,
695
- bool fp_return) {
696
- Redirection* redirection = Redirection::Get(external_function, fp_return);
697
- return redirection->address_of_swi_instruction();
698
- }
699
-
700
-
701
- // Get the active Simulator for the current thread.
702
- Simulator* Simulator::current() {
703
- Initialize();
704
- Simulator* sim = reinterpret_cast<Simulator*>(
705
- v8::internal::Thread::GetThreadLocal(simulator_key));
706
- if (sim == NULL) {
707
- // TODO(146): delete the simulator object when a thread goes away.
708
- sim = new Simulator();
709
- v8::internal::Thread::SetThreadLocal(simulator_key, sim);
710
- }
711
- return sim;
712
- }
713
-
714
-
715
- // Sets the register in the architecture state. It will also deal with updating
716
- // Simulator internal state for special registers such as PC.
717
- void Simulator::set_register(int reg, int32_t value) {
718
- ASSERT((reg >= 0) && (reg < num_registers));
719
- if (reg == pc) {
720
- pc_modified_ = true;
721
- }
722
- registers_[reg] = value;
723
- }
724
-
725
-
726
- // Get the register from the architecture state. This function does handle
727
- // the special case of accessing the PC register.
728
- int32_t Simulator::get_register(int reg) const {
729
- ASSERT((reg >= 0) && (reg < num_registers));
730
- return registers_[reg] + ((reg == pc) ? Instr::kPCReadOffset : 0);
731
- }
732
-
733
-
734
- void Simulator::set_dw_register(int dreg, const int* dbl) {
735
- ASSERT((dreg >= 0) && (dreg < num_d_registers));
736
- registers_[dreg] = dbl[0];
737
- registers_[dreg + 1] = dbl[1];
738
- }
739
-
740
-
741
- // Raw access to the PC register.
742
- void Simulator::set_pc(int32_t value) {
743
- pc_modified_ = true;
744
- registers_[pc] = value;
745
- }
746
-
747
-
748
- // Raw access to the PC register without the special adjustment when reading.
749
- int32_t Simulator::get_pc() const {
750
- return registers_[pc];
751
- }
752
-
753
-
754
- // Getting from and setting into VFP registers.
755
- void Simulator::set_s_register(int sreg, unsigned int value) {
756
- ASSERT((sreg >= 0) && (sreg < num_s_registers));
757
- vfp_register[sreg] = value;
758
- }
759
-
760
-
761
- unsigned int Simulator::get_s_register(int sreg) const {
762
- ASSERT((sreg >= 0) && (sreg < num_s_registers));
763
- return vfp_register[sreg];
764
- }
765
-
766
-
767
- void Simulator::set_s_register_from_float(int sreg, const float flt) {
768
- ASSERT((sreg >= 0) && (sreg < num_s_registers));
769
- // Read the bits from the single precision floating point value
770
- // into the unsigned integer element of vfp_register[] given by index=sreg.
771
- char buffer[sizeof(vfp_register[0])];
772
- memcpy(buffer, &flt, sizeof(vfp_register[0]));
773
- memcpy(&vfp_register[sreg], buffer, sizeof(vfp_register[0]));
774
- }
775
-
776
-
777
- void Simulator::set_s_register_from_sinteger(int sreg, const int sint) {
778
- ASSERT((sreg >= 0) && (sreg < num_s_registers));
779
- // Read the bits from the integer value into the unsigned integer element of
780
- // vfp_register[] given by index=sreg.
781
- char buffer[sizeof(vfp_register[0])];
782
- memcpy(buffer, &sint, sizeof(vfp_register[0]));
783
- memcpy(&vfp_register[sreg], buffer, sizeof(vfp_register[0]));
784
- }
785
-
786
-
787
- void Simulator::set_d_register_from_double(int dreg, const double& dbl) {
788
- ASSERT((dreg >= 0) && (dreg < num_d_registers));
789
- // Read the bits from the double precision floating point value into the two
790
- // consecutive unsigned integer elements of vfp_register[] given by index
791
- // 2*sreg and 2*sreg+1.
792
- char buffer[2 * sizeof(vfp_register[0])];
793
- memcpy(buffer, &dbl, 2 * sizeof(vfp_register[0]));
794
- #ifndef BIG_ENDIAN_FLOATING_POINT
795
- memcpy(&vfp_register[dreg * 2], buffer, 2 * sizeof(vfp_register[0]));
796
- #else
797
- memcpy(&vfp_register[dreg * 2], &buffer[4], sizeof(vfp_register[0]));
798
- memcpy(&vfp_register[dreg * 2 + 1], &buffer[0], sizeof(vfp_register[0]));
799
- #endif
800
- }
801
-
802
-
803
- float Simulator::get_float_from_s_register(int sreg) {
804
- ASSERT((sreg >= 0) && (sreg < num_s_registers));
805
-
806
- float sm_val = 0.0;
807
- // Read the bits from the unsigned integer vfp_register[] array
808
- // into the single precision floating point value and return it.
809
- char buffer[sizeof(vfp_register[0])];
810
- memcpy(buffer, &vfp_register[sreg], sizeof(vfp_register[0]));
811
- memcpy(&sm_val, buffer, sizeof(vfp_register[0]));
812
- return(sm_val);
813
- }
814
-
815
-
816
- int Simulator::get_sinteger_from_s_register(int sreg) {
817
- ASSERT((sreg >= 0) && (sreg < num_s_registers));
818
-
819
- int sm_val = 0;
820
- // Read the bits from the unsigned integer vfp_register[] array
821
- // into the single precision floating point value and return it.
822
- char buffer[sizeof(vfp_register[0])];
823
- memcpy(buffer, &vfp_register[sreg], sizeof(vfp_register[0]));
824
- memcpy(&sm_val, buffer, sizeof(vfp_register[0]));
825
- return(sm_val);
826
- }
827
-
828
-
829
- double Simulator::get_double_from_d_register(int dreg) {
830
- ASSERT((dreg >= 0) && (dreg < num_d_registers));
831
-
832
- double dm_val = 0.0;
833
- // Read the bits from the unsigned integer vfp_register[] array
834
- // into the double precision floating point value and return it.
835
- char buffer[2 * sizeof(vfp_register[0])];
836
- #ifdef BIG_ENDIAN_FLOATING_POINT
837
- memcpy(&buffer[0], &vfp_register[2 * dreg + 1], sizeof(vfp_register[0]));
838
- memcpy(&buffer[4], &vfp_register[2 * dreg], sizeof(vfp_register[0]));
839
- #else
840
- memcpy(buffer, &vfp_register[2 * dreg], 2 * sizeof(vfp_register[0]));
841
- #endif
842
- memcpy(&dm_val, buffer, 2 * sizeof(vfp_register[0]));
843
- return(dm_val);
844
- }
845
-
846
-
847
- // For use in calls that take two double values, constructed from r0, r1, r2
848
- // and r3.
849
- void Simulator::GetFpArgs(double* x, double* y) {
850
- // We use a char buffer to get around the strict-aliasing rules which
851
- // otherwise allow the compiler to optimize away the copy.
852
- char buffer[2 * sizeof(registers_[0])];
853
- // Registers 0 and 1 -> x.
854
- memcpy(buffer, registers_, sizeof(buffer));
855
- memcpy(x, buffer, sizeof(buffer));
856
- // Registers 2 and 3 -> y.
857
- memcpy(buffer, registers_ + 2, sizeof(buffer));
858
- memcpy(y, buffer, sizeof(buffer));
859
- }
860
-
861
-
862
- void Simulator::SetFpResult(const double& result) {
863
- char buffer[2 * sizeof(registers_[0])];
864
- memcpy(buffer, &result, sizeof(buffer));
865
- // result -> registers 0 and 1.
866
- memcpy(registers_, buffer, sizeof(buffer));
867
- }
868
-
869
-
870
- void Simulator::TrashCallerSaveRegisters() {
871
- // We don't trash the registers with the return value.
872
- registers_[2] = 0x50Bad4U;
873
- registers_[3] = 0x50Bad4U;
874
- registers_[12] = 0x50Bad4U;
875
- }
876
-
877
- // Some Operating Systems allow unaligned access on ARMv7 targets. We
878
- // assume that unaligned accesses are not allowed unless the v8 build system
879
- // defines the CAN_USE_UNALIGNED_ACCESSES macro to be non-zero.
880
- // The following statements below describes the behavior of the ARM CPUs
881
- // that don't support unaligned access.
882
- // Some ARM platforms raise an interrupt on detecting unaligned access.
883
- // On others it does a funky rotation thing. For now we
884
- // simply disallow unaligned reads. Note that simulator runs have the runtime
885
- // system running directly on the host system and only generated code is
886
- // executed in the simulator. Since the host is typically IA32 we will not
887
- // get the correct ARM-like behaviour on unaligned accesses for those ARM
888
- // targets that don't support unaligned loads and stores.
889
-
890
-
891
- int Simulator::ReadW(int32_t addr, Instr* instr) {
892
- #if V8_TARGET_CAN_READ_UNALIGNED
893
- intptr_t* ptr = reinterpret_cast<intptr_t*>(addr);
894
- return *ptr;
895
- #else
896
- if ((addr & 3) == 0) {
897
- intptr_t* ptr = reinterpret_cast<intptr_t*>(addr);
898
- return *ptr;
899
- }
900
- PrintF("Unaligned read at 0x%08x, pc=%p\n", addr, instr);
901
- UNIMPLEMENTED();
902
- return 0;
903
- #endif
904
- }
905
-
906
-
907
- void Simulator::WriteW(int32_t addr, int value, Instr* instr) {
908
- #if V8_TARGET_CAN_READ_UNALIGNED
909
- intptr_t* ptr = reinterpret_cast<intptr_t*>(addr);
910
- *ptr = value;
911
- return;
912
- #else
913
- if ((addr & 3) == 0) {
914
- intptr_t* ptr = reinterpret_cast<intptr_t*>(addr);
915
- *ptr = value;
916
- return;
917
- }
918
- PrintF("Unaligned write at 0x%08x, pc=%p\n", addr, instr);
919
- UNIMPLEMENTED();
920
- #endif
921
- }
922
-
923
-
924
- uint16_t Simulator::ReadHU(int32_t addr, Instr* instr) {
925
- #if V8_TARGET_CAN_READ_UNALIGNED
926
- uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
927
- return *ptr;
928
- #else
929
- if ((addr & 1) == 0) {
930
- uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
931
- return *ptr;
932
- }
933
- PrintF("Unaligned unsigned halfword read at 0x%08x, pc=%p\n", addr, instr);
934
- UNIMPLEMENTED();
935
- return 0;
936
- #endif
937
- }
938
-
939
-
940
- int16_t Simulator::ReadH(int32_t addr, Instr* instr) {
941
- #if V8_TARGET_CAN_READ_UNALIGNED
942
- int16_t* ptr = reinterpret_cast<int16_t*>(addr);
943
- return *ptr;
944
- #else
945
- if ((addr & 1) == 0) {
946
- int16_t* ptr = reinterpret_cast<int16_t*>(addr);
947
- return *ptr;
948
- }
949
- PrintF("Unaligned signed halfword read at 0x%08x\n", addr);
950
- UNIMPLEMENTED();
951
- return 0;
952
- #endif
953
- }
954
-
955
-
956
- void Simulator::WriteH(int32_t addr, uint16_t value, Instr* instr) {
957
- #if V8_TARGET_CAN_READ_UNALIGNED
958
- uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
959
- *ptr = value;
960
- return;
961
- #else
962
- if ((addr & 1) == 0) {
963
- uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
964
- *ptr = value;
965
- return;
966
- }
967
- PrintF("Unaligned unsigned halfword write at 0x%08x, pc=%p\n", addr, instr);
968
- UNIMPLEMENTED();
969
- #endif
970
- }
971
-
972
-
973
- void Simulator::WriteH(int32_t addr, int16_t value, Instr* instr) {
974
- #if V8_TARGET_CAN_READ_UNALIGNED
975
- int16_t* ptr = reinterpret_cast<int16_t*>(addr);
976
- *ptr = value;
977
- return;
978
- #else
979
- if ((addr & 1) == 0) {
980
- int16_t* ptr = reinterpret_cast<int16_t*>(addr);
981
- *ptr = value;
982
- return;
983
- }
984
- PrintF("Unaligned halfword write at 0x%08x, pc=%p\n", addr, instr);
985
- UNIMPLEMENTED();
986
- #endif
987
- }
988
-
989
-
990
- uint8_t Simulator::ReadBU(int32_t addr) {
991
- uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
992
- return *ptr;
993
- }
994
-
995
-
996
- int8_t Simulator::ReadB(int32_t addr) {
997
- int8_t* ptr = reinterpret_cast<int8_t*>(addr);
998
- return *ptr;
999
- }
1000
-
1001
-
1002
- void Simulator::WriteB(int32_t addr, uint8_t value) {
1003
- uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
1004
- *ptr = value;
1005
- }
1006
-
1007
-
1008
- void Simulator::WriteB(int32_t addr, int8_t value) {
1009
- int8_t* ptr = reinterpret_cast<int8_t*>(addr);
1010
- *ptr = value;
1011
- }
1012
-
1013
-
1014
- int32_t* Simulator::ReadDW(int32_t addr) {
1015
- #if V8_TARGET_CAN_READ_UNALIGNED
1016
- int32_t* ptr = reinterpret_cast<int32_t*>(addr);
1017
- return ptr;
1018
- #else
1019
- if ((addr & 3) == 0) {
1020
- int32_t* ptr = reinterpret_cast<int32_t*>(addr);
1021
- return ptr;
1022
- }
1023
- PrintF("Unaligned read at 0x%08x\n", addr);
1024
- UNIMPLEMENTED();
1025
- return 0;
1026
- #endif
1027
- }
1028
-
1029
-
1030
- void Simulator::WriteDW(int32_t addr, int32_t value1, int32_t value2) {
1031
- #if V8_TARGET_CAN_READ_UNALIGNED
1032
- int32_t* ptr = reinterpret_cast<int32_t*>(addr);
1033
- *ptr++ = value1;
1034
- *ptr = value2;
1035
- return;
1036
- #else
1037
- if ((addr & 3) == 0) {
1038
- int32_t* ptr = reinterpret_cast<int32_t*>(addr);
1039
- *ptr++ = value1;
1040
- *ptr = value2;
1041
- return;
1042
- }
1043
- PrintF("Unaligned write at 0x%08x\n", addr);
1044
- UNIMPLEMENTED();
1045
- #endif
1046
- }
1047
-
1048
-
1049
- // Returns the limit of the stack area to enable checking for stack overflows.
1050
- uintptr_t Simulator::StackLimit() const {
1051
- // Leave a safety margin of 256 bytes to prevent overrunning the stack when
1052
- // pushing values.
1053
- return reinterpret_cast<uintptr_t>(stack_) + 256;
1054
- }
1055
-
1056
-
1057
- // Unsupported instructions use Format to print an error and stop execution.
1058
- void Simulator::Format(Instr* instr, const char* format) {
1059
- PrintF("Simulator found unsupported instruction:\n 0x%08x: %s\n",
1060
- instr, format);
1061
- UNIMPLEMENTED();
1062
- }
1063
-
1064
-
1065
- // Checks if the current instruction should be executed based on its
1066
- // condition bits.
1067
- bool Simulator::ConditionallyExecute(Instr* instr) {
1068
- switch (instr->ConditionField()) {
1069
- case EQ: return z_flag_;
1070
- case NE: return !z_flag_;
1071
- case CS: return c_flag_;
1072
- case CC: return !c_flag_;
1073
- case MI: return n_flag_;
1074
- case PL: return !n_flag_;
1075
- case VS: return v_flag_;
1076
- case VC: return !v_flag_;
1077
- case HI: return c_flag_ && !z_flag_;
1078
- case LS: return !c_flag_ || z_flag_;
1079
- case GE: return n_flag_ == v_flag_;
1080
- case LT: return n_flag_ != v_flag_;
1081
- case GT: return !z_flag_ && (n_flag_ == v_flag_);
1082
- case LE: return z_flag_ || (n_flag_ != v_flag_);
1083
- case AL: return true;
1084
- default: UNREACHABLE();
1085
- }
1086
- return false;
1087
- }
1088
-
1089
-
1090
- // Calculate and set the Negative and Zero flags.
1091
- void Simulator::SetNZFlags(int32_t val) {
1092
- n_flag_ = (val < 0);
1093
- z_flag_ = (val == 0);
1094
- }
1095
-
1096
-
1097
- // Set the Carry flag.
1098
- void Simulator::SetCFlag(bool val) {
1099
- c_flag_ = val;
1100
- }
1101
-
1102
-
1103
- // Set the oVerflow flag.
1104
- void Simulator::SetVFlag(bool val) {
1105
- v_flag_ = val;
1106
- }
1107
-
1108
-
1109
- // Calculate C flag value for additions.
1110
- bool Simulator::CarryFrom(int32_t left, int32_t right) {
1111
- uint32_t uleft = static_cast<uint32_t>(left);
1112
- uint32_t uright = static_cast<uint32_t>(right);
1113
- uint32_t urest = 0xffffffffU - uleft;
1114
-
1115
- return (uright > urest);
1116
- }
1117
-
1118
-
1119
- // Calculate C flag value for subtractions.
1120
- bool Simulator::BorrowFrom(int32_t left, int32_t right) {
1121
- uint32_t uleft = static_cast<uint32_t>(left);
1122
- uint32_t uright = static_cast<uint32_t>(right);
1123
-
1124
- return (uright > uleft);
1125
- }
1126
-
1127
-
1128
- // Calculate V flag value for additions and subtractions.
1129
- bool Simulator::OverflowFrom(int32_t alu_out,
1130
- int32_t left, int32_t right, bool addition) {
1131
- bool overflow;
1132
- if (addition) {
1133
- // operands have the same sign
1134
- overflow = ((left >= 0 && right >= 0) || (left < 0 && right < 0))
1135
- // and operands and result have different sign
1136
- && ((left < 0 && alu_out >= 0) || (left >= 0 && alu_out < 0));
1137
- } else {
1138
- // operands have different signs
1139
- overflow = ((left < 0 && right >= 0) || (left >= 0 && right < 0))
1140
- // and first operand and result have different signs
1141
- && ((left < 0 && alu_out >= 0) || (left >= 0 && alu_out < 0));
1142
- }
1143
- return overflow;
1144
- }
1145
-
1146
-
1147
- // Support for VFP comparisons.
1148
- void Simulator::Compute_FPSCR_Flags(double val1, double val2) {
1149
- if (isnan(val1) || isnan(val2)) {
1150
- n_flag_FPSCR_ = false;
1151
- z_flag_FPSCR_ = false;
1152
- c_flag_FPSCR_ = true;
1153
- v_flag_FPSCR_ = true;
1154
- // All non-NaN cases.
1155
- } else if (val1 == val2) {
1156
- n_flag_FPSCR_ = false;
1157
- z_flag_FPSCR_ = true;
1158
- c_flag_FPSCR_ = true;
1159
- v_flag_FPSCR_ = false;
1160
- } else if (val1 < val2) {
1161
- n_flag_FPSCR_ = true;
1162
- z_flag_FPSCR_ = false;
1163
- c_flag_FPSCR_ = false;
1164
- v_flag_FPSCR_ = false;
1165
- } else {
1166
- // Case when (val1 > val2).
1167
- n_flag_FPSCR_ = false;
1168
- z_flag_FPSCR_ = false;
1169
- c_flag_FPSCR_ = true;
1170
- v_flag_FPSCR_ = false;
1171
- }
1172
- }
1173
-
1174
-
1175
- void Simulator::Copy_FPSCR_to_APSR() {
1176
- n_flag_ = n_flag_FPSCR_;
1177
- z_flag_ = z_flag_FPSCR_;
1178
- c_flag_ = c_flag_FPSCR_;
1179
- v_flag_ = v_flag_FPSCR_;
1180
- }
1181
-
1182
-
1183
- // Addressing Mode 1 - Data-processing operands:
1184
- // Get the value based on the shifter_operand with register.
1185
- int32_t Simulator::GetShiftRm(Instr* instr, bool* carry_out) {
1186
- Shift shift = instr->ShiftField();
1187
- int shift_amount = instr->ShiftAmountField();
1188
- int32_t result = get_register(instr->RmField());
1189
- if (instr->Bit(4) == 0) {
1190
- // by immediate
1191
- if ((shift == ROR) && (shift_amount == 0)) {
1192
- UNIMPLEMENTED();
1193
- return result;
1194
- } else if (((shift == LSR) || (shift == ASR)) && (shift_amount == 0)) {
1195
- shift_amount = 32;
1196
- }
1197
- switch (shift) {
1198
- case ASR: {
1199
- if (shift_amount == 0) {
1200
- if (result < 0) {
1201
- result = 0xffffffff;
1202
- *carry_out = true;
1203
- } else {
1204
- result = 0;
1205
- *carry_out = false;
1206
- }
1207
- } else {
1208
- result >>= (shift_amount - 1);
1209
- *carry_out = (result & 1) == 1;
1210
- result >>= 1;
1211
- }
1212
- break;
1213
- }
1214
-
1215
- case LSL: {
1216
- if (shift_amount == 0) {
1217
- *carry_out = c_flag_;
1218
- } else {
1219
- result <<= (shift_amount - 1);
1220
- *carry_out = (result < 0);
1221
- result <<= 1;
1222
- }
1223
- break;
1224
- }
1225
-
1226
- case LSR: {
1227
- if (shift_amount == 0) {
1228
- result = 0;
1229
- *carry_out = c_flag_;
1230
- } else {
1231
- uint32_t uresult = static_cast<uint32_t>(result);
1232
- uresult >>= (shift_amount - 1);
1233
- *carry_out = (uresult & 1) == 1;
1234
- uresult >>= 1;
1235
- result = static_cast<int32_t>(uresult);
1236
- }
1237
- break;
1238
- }
1239
-
1240
- case ROR: {
1241
- UNIMPLEMENTED();
1242
- break;
1243
- }
1244
-
1245
- default: {
1246
- UNREACHABLE();
1247
- break;
1248
- }
1249
- }
1250
- } else {
1251
- // by register
1252
- int rs = instr->RsField();
1253
- shift_amount = get_register(rs) &0xff;
1254
- switch (shift) {
1255
- case ASR: {
1256
- if (shift_amount == 0) {
1257
- *carry_out = c_flag_;
1258
- } else if (shift_amount < 32) {
1259
- result >>= (shift_amount - 1);
1260
- *carry_out = (result & 1) == 1;
1261
- result >>= 1;
1262
- } else {
1263
- ASSERT(shift_amount >= 32);
1264
- if (result < 0) {
1265
- *carry_out = true;
1266
- result = 0xffffffff;
1267
- } else {
1268
- *carry_out = false;
1269
- result = 0;
1270
- }
1271
- }
1272
- break;
1273
- }
1274
-
1275
- case LSL: {
1276
- if (shift_amount == 0) {
1277
- *carry_out = c_flag_;
1278
- } else if (shift_amount < 32) {
1279
- result <<= (shift_amount - 1);
1280
- *carry_out = (result < 0);
1281
- result <<= 1;
1282
- } else if (shift_amount == 32) {
1283
- *carry_out = (result & 1) == 1;
1284
- result = 0;
1285
- } else {
1286
- ASSERT(shift_amount > 32);
1287
- *carry_out = false;
1288
- result = 0;
1289
- }
1290
- break;
1291
- }
1292
-
1293
- case LSR: {
1294
- if (shift_amount == 0) {
1295
- *carry_out = c_flag_;
1296
- } else if (shift_amount < 32) {
1297
- uint32_t uresult = static_cast<uint32_t>(result);
1298
- uresult >>= (shift_amount - 1);
1299
- *carry_out = (uresult & 1) == 1;
1300
- uresult >>= 1;
1301
- result = static_cast<int32_t>(uresult);
1302
- } else if (shift_amount == 32) {
1303
- *carry_out = (result < 0);
1304
- result = 0;
1305
- } else {
1306
- *carry_out = false;
1307
- result = 0;
1308
- }
1309
- break;
1310
- }
1311
-
1312
- case ROR: {
1313
- UNIMPLEMENTED();
1314
- break;
1315
- }
1316
-
1317
- default: {
1318
- UNREACHABLE();
1319
- break;
1320
- }
1321
- }
1322
- }
1323
- return result;
1324
- }
1325
-
1326
-
1327
- // Addressing Mode 1 - Data-processing operands:
1328
- // Get the value based on the shifter_operand with immediate.
1329
- int32_t Simulator::GetImm(Instr* instr, bool* carry_out) {
1330
- int rotate = instr->RotateField() * 2;
1331
- int immed8 = instr->Immed8Field();
1332
- int imm = (immed8 >> rotate) | (immed8 << (32 - rotate));
1333
- *carry_out = (rotate == 0) ? c_flag_ : (imm < 0);
1334
- return imm;
1335
- }
1336
-
1337
-
1338
- static int count_bits(int bit_vector) {
1339
- int count = 0;
1340
- while (bit_vector != 0) {
1341
- if ((bit_vector & 1) != 0) {
1342
- count++;
1343
- }
1344
- bit_vector >>= 1;
1345
- }
1346
- return count;
1347
- }
1348
-
1349
-
1350
- // Addressing Mode 4 - Load and Store Multiple
1351
- void Simulator::HandleRList(Instr* instr, bool load) {
1352
- int rn = instr->RnField();
1353
- int32_t rn_val = get_register(rn);
1354
- int rlist = instr->RlistField();
1355
- int num_regs = count_bits(rlist);
1356
-
1357
- intptr_t start_address = 0;
1358
- intptr_t end_address = 0;
1359
- switch (instr->PUField()) {
1360
- case 0: {
1361
- // Print("da");
1362
- UNIMPLEMENTED();
1363
- break;
1364
- }
1365
- case 1: {
1366
- // Print("ia");
1367
- start_address = rn_val;
1368
- end_address = rn_val + (num_regs * 4) - 4;
1369
- rn_val = rn_val + (num_regs * 4);
1370
- break;
1371
- }
1372
- case 2: {
1373
- // Print("db");
1374
- start_address = rn_val - (num_regs * 4);
1375
- end_address = rn_val - 4;
1376
- rn_val = start_address;
1377
- break;
1378
- }
1379
- case 3: {
1380
- // Print("ib");
1381
- UNIMPLEMENTED();
1382
- break;
1383
- }
1384
- default: {
1385
- UNREACHABLE();
1386
- break;
1387
- }
1388
- }
1389
- if (instr->HasW()) {
1390
- set_register(rn, rn_val);
1391
- }
1392
- intptr_t* address = reinterpret_cast<intptr_t*>(start_address);
1393
- int reg = 0;
1394
- while (rlist != 0) {
1395
- if ((rlist & 1) != 0) {
1396
- if (load) {
1397
- set_register(reg, *address);
1398
- } else {
1399
- *address = get_register(reg);
1400
- }
1401
- address += 1;
1402
- }
1403
- reg++;
1404
- rlist >>= 1;
1405
- }
1406
- ASSERT(end_address == ((intptr_t)address) - 4);
1407
- }
1408
-
1409
-
1410
- // Calls into the V8 runtime are based on this very simple interface.
1411
- // Note: To be able to return two values from some calls the code in runtime.cc
1412
- // uses the ObjectPair which is essentially two 32-bit values stuffed into a
1413
- // 64-bit value. With the code below we assume that all runtime calls return
1414
- // 64 bits of result. If they don't, the r1 result register contains a bogus
1415
- // value, which is fine because it is caller-saved.
1416
- typedef int64_t (*SimulatorRuntimeCall)(int32_t arg0,
1417
- int32_t arg1,
1418
- int32_t arg2,
1419
- int32_t arg3);
1420
- typedef double (*SimulatorRuntimeFPCall)(int32_t arg0,
1421
- int32_t arg1,
1422
- int32_t arg2,
1423
- int32_t arg3);
1424
-
1425
-
1426
- // Software interrupt instructions are used by the simulator to call into the
1427
- // C-based V8 runtime.
1428
- void Simulator::SoftwareInterrupt(Instr* instr) {
1429
- int swi = instr->SwiField();
1430
- switch (swi) {
1431
- case call_rt_redirected: {
1432
- // Check if stack is aligned. Error if not aligned is reported below to
1433
- // include information on the function called.
1434
- bool stack_aligned =
1435
- (get_register(sp)
1436
- & (::v8::internal::FLAG_sim_stack_alignment - 1)) == 0;
1437
- Redirection* redirection = Redirection::FromSwiInstruction(instr);
1438
- int32_t arg0 = get_register(r0);
1439
- int32_t arg1 = get_register(r1);
1440
- int32_t arg2 = get_register(r2);
1441
- int32_t arg3 = get_register(r3);
1442
- // This is dodgy but it works because the C entry stubs are never moved.
1443
- // See comment in codegen-arm.cc and bug 1242173.
1444
- int32_t saved_lr = get_register(lr);
1445
- if (redirection->fp_return()) {
1446
- intptr_t external =
1447
- reinterpret_cast<intptr_t>(redirection->external_function());
1448
- SimulatorRuntimeFPCall target =
1449
- reinterpret_cast<SimulatorRuntimeFPCall>(external);
1450
- if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
1451
- double x, y;
1452
- GetFpArgs(&x, &y);
1453
- PrintF("Call to host function at %p with args %f, %f",
1454
- FUNCTION_ADDR(target), x, y);
1455
- if (!stack_aligned) {
1456
- PrintF(" with unaligned stack %08x\n", get_register(sp));
1457
- }
1458
- PrintF("\n");
1459
- }
1460
- CHECK(stack_aligned);
1461
- double result = target(arg0, arg1, arg2, arg3);
1462
- SetFpResult(result);
1463
- } else {
1464
- intptr_t external =
1465
- reinterpret_cast<int32_t>(redirection->external_function());
1466
- SimulatorRuntimeCall target =
1467
- reinterpret_cast<SimulatorRuntimeCall>(external);
1468
- if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
1469
- PrintF(
1470
- "Call to host function at %p with args %08x, %08x, %08x, %08x",
1471
- FUNCTION_ADDR(target),
1472
- arg0,
1473
- arg1,
1474
- arg2,
1475
- arg3);
1476
- if (!stack_aligned) {
1477
- PrintF(" with unaligned stack %08x\n", get_register(sp));
1478
- }
1479
- PrintF("\n");
1480
- }
1481
- CHECK(stack_aligned);
1482
- int64_t result = target(arg0, arg1, arg2, arg3);
1483
- int32_t lo_res = static_cast<int32_t>(result);
1484
- int32_t hi_res = static_cast<int32_t>(result >> 32);
1485
- if (::v8::internal::FLAG_trace_sim) {
1486
- PrintF("Returned %08x\n", lo_res);
1487
- }
1488
- set_register(r0, lo_res);
1489
- set_register(r1, hi_res);
1490
- }
1491
- set_register(lr, saved_lr);
1492
- set_pc(get_register(lr));
1493
- break;
1494
- }
1495
- case break_point: {
1496
- Debugger dbg(this);
1497
- dbg.Debug();
1498
- break;
1499
- }
1500
- default: {
1501
- UNREACHABLE();
1502
- break;
1503
- }
1504
- }
1505
- }
1506
-
1507
-
1508
- // Handle execution based on instruction types.
1509
-
1510
- // Instruction types 0 and 1 are both rolled into one function because they
1511
- // only differ in the handling of the shifter_operand.
1512
- void Simulator::DecodeType01(Instr* instr) {
1513
- int type = instr->TypeField();
1514
- if ((type == 0) && instr->IsSpecialType0()) {
1515
- // multiply instruction or extra loads and stores
1516
- if (instr->Bits(7, 4) == 9) {
1517
- if (instr->Bit(24) == 0) {
1518
- // Raw field decoding here. Multiply instructions have their Rd in
1519
- // funny places.
1520
- int rn = instr->RnField();
1521
- int rm = instr->RmField();
1522
- int rs = instr->RsField();
1523
- int32_t rs_val = get_register(rs);
1524
- int32_t rm_val = get_register(rm);
1525
- if (instr->Bit(23) == 0) {
1526
- if (instr->Bit(21) == 0) {
1527
- // The MUL instruction description (A 4.1.33) refers to Rd as being
1528
- // the destination for the operation, but it confusingly uses the
1529
- // Rn field to encode it.
1530
- // Format(instr, "mul'cond's 'rn, 'rm, 'rs");
1531
- int rd = rn; // Remap the rn field to the Rd register.
1532
- int32_t alu_out = rm_val * rs_val;
1533
- set_register(rd, alu_out);
1534
- if (instr->HasS()) {
1535
- SetNZFlags(alu_out);
1536
- }
1537
- } else {
1538
- // The MLA instruction description (A 4.1.28) refers to the order
1539
- // of registers as "Rd, Rm, Rs, Rn". But confusingly it uses the
1540
- // Rn field to encode the Rd register and the Rd field to encode
1541
- // the Rn register.
1542
- Format(instr, "mla'cond's 'rn, 'rm, 'rs, 'rd");
1543
- }
1544
- } else {
1545
- // The signed/long multiply instructions use the terms RdHi and RdLo
1546
- // when referring to the target registers. They are mapped to the Rn
1547
- // and Rd fields as follows:
1548
- // RdLo == Rd
1549
- // RdHi == Rn (This is confusingly stored in variable rd here
1550
- // because the mul instruction from above uses the
1551
- // Rn field to encode the Rd register. Good luck figuring
1552
- // this out without reading the ARM instruction manual
1553
- // at a very detailed level.)
1554
- // Format(instr, "'um'al'cond's 'rd, 'rn, 'rs, 'rm");
1555
- int rd_hi = rn; // Remap the rn field to the RdHi register.
1556
- int rd_lo = instr->RdField();
1557
- int32_t hi_res = 0;
1558
- int32_t lo_res = 0;
1559
- if (instr->Bit(22) == 1) {
1560
- int64_t left_op = static_cast<int32_t>(rm_val);
1561
- int64_t right_op = static_cast<int32_t>(rs_val);
1562
- uint64_t result = left_op * right_op;
1563
- hi_res = static_cast<int32_t>(result >> 32);
1564
- lo_res = static_cast<int32_t>(result & 0xffffffff);
1565
- } else {
1566
- // unsigned multiply
1567
- uint64_t left_op = static_cast<uint32_t>(rm_val);
1568
- uint64_t right_op = static_cast<uint32_t>(rs_val);
1569
- uint64_t result = left_op * right_op;
1570
- hi_res = static_cast<int32_t>(result >> 32);
1571
- lo_res = static_cast<int32_t>(result & 0xffffffff);
1572
- }
1573
- set_register(rd_lo, lo_res);
1574
- set_register(rd_hi, hi_res);
1575
- if (instr->HasS()) {
1576
- UNIMPLEMENTED();
1577
- }
1578
- }
1579
- } else {
1580
- UNIMPLEMENTED(); // Not used by V8.
1581
- }
1582
- } else {
1583
- // extra load/store instructions
1584
- int rd = instr->RdField();
1585
- int rn = instr->RnField();
1586
- int32_t rn_val = get_register(rn);
1587
- int32_t addr = 0;
1588
- if (instr->Bit(22) == 0) {
1589
- int rm = instr->RmField();
1590
- int32_t rm_val = get_register(rm);
1591
- switch (instr->PUField()) {
1592
- case 0: {
1593
- // Format(instr, "'memop'cond'sign'h 'rd, ['rn], -'rm");
1594
- ASSERT(!instr->HasW());
1595
- addr = rn_val;
1596
- rn_val -= rm_val;
1597
- set_register(rn, rn_val);
1598
- break;
1599
- }
1600
- case 1: {
1601
- // Format(instr, "'memop'cond'sign'h 'rd, ['rn], +'rm");
1602
- ASSERT(!instr->HasW());
1603
- addr = rn_val;
1604
- rn_val += rm_val;
1605
- set_register(rn, rn_val);
1606
- break;
1607
- }
1608
- case 2: {
1609
- // Format(instr, "'memop'cond'sign'h 'rd, ['rn, -'rm]'w");
1610
- rn_val -= rm_val;
1611
- addr = rn_val;
1612
- if (instr->HasW()) {
1613
- set_register(rn, rn_val);
1614
- }
1615
- break;
1616
- }
1617
- case 3: {
1618
- // Format(instr, "'memop'cond'sign'h 'rd, ['rn, +'rm]'w");
1619
- rn_val += rm_val;
1620
- addr = rn_val;
1621
- if (instr->HasW()) {
1622
- set_register(rn, rn_val);
1623
- }
1624
- break;
1625
- }
1626
- default: {
1627
- // The PU field is a 2-bit field.
1628
- UNREACHABLE();
1629
- break;
1630
- }
1631
- }
1632
- } else {
1633
- int32_t imm_val = (instr->ImmedHField() << 4) | instr->ImmedLField();
1634
- switch (instr->PUField()) {
1635
- case 0: {
1636
- // Format(instr, "'memop'cond'sign'h 'rd, ['rn], #-'off8");
1637
- ASSERT(!instr->HasW());
1638
- addr = rn_val;
1639
- rn_val -= imm_val;
1640
- set_register(rn, rn_val);
1641
- break;
1642
- }
1643
- case 1: {
1644
- // Format(instr, "'memop'cond'sign'h 'rd, ['rn], #+'off8");
1645
- ASSERT(!instr->HasW());
1646
- addr = rn_val;
1647
- rn_val += imm_val;
1648
- set_register(rn, rn_val);
1649
- break;
1650
- }
1651
- case 2: {
1652
- // Format(instr, "'memop'cond'sign'h 'rd, ['rn, #-'off8]'w");
1653
- rn_val -= imm_val;
1654
- addr = rn_val;
1655
- if (instr->HasW()) {
1656
- set_register(rn, rn_val);
1657
- }
1658
- break;
1659
- }
1660
- case 3: {
1661
- // Format(instr, "'memop'cond'sign'h 'rd, ['rn, #+'off8]'w");
1662
- rn_val += imm_val;
1663
- addr = rn_val;
1664
- if (instr->HasW()) {
1665
- set_register(rn, rn_val);
1666
- }
1667
- break;
1668
- }
1669
- default: {
1670
- // The PU field is a 2-bit field.
1671
- UNREACHABLE();
1672
- break;
1673
- }
1674
- }
1675
- }
1676
- if (((instr->Bits(7, 4) & 0xd) == 0xd) && (instr->Bit(20) == 0)) {
1677
- ASSERT((rd % 2) == 0);
1678
- if (instr->HasH()) {
1679
- // The strd instruction.
1680
- int32_t value1 = get_register(rd);
1681
- int32_t value2 = get_register(rd+1);
1682
- WriteDW(addr, value1, value2);
1683
- } else {
1684
- // The ldrd instruction.
1685
- int* rn_data = ReadDW(addr);
1686
- set_dw_register(rd, rn_data);
1687
- }
1688
- } else if (instr->HasH()) {
1689
- if (instr->HasSign()) {
1690
- if (instr->HasL()) {
1691
- int16_t val = ReadH(addr, instr);
1692
- set_register(rd, val);
1693
- } else {
1694
- int16_t val = get_register(rd);
1695
- WriteH(addr, val, instr);
1696
- }
1697
- } else {
1698
- if (instr->HasL()) {
1699
- uint16_t val = ReadHU(addr, instr);
1700
- set_register(rd, val);
1701
- } else {
1702
- uint16_t val = get_register(rd);
1703
- WriteH(addr, val, instr);
1704
- }
1705
- }
1706
- } else {
1707
- // signed byte loads
1708
- ASSERT(instr->HasSign());
1709
- ASSERT(instr->HasL());
1710
- int8_t val = ReadB(addr);
1711
- set_register(rd, val);
1712
- }
1713
- return;
1714
- }
1715
- } else if ((type == 0) && instr->IsMiscType0()) {
1716
- if (instr->Bits(22, 21) == 1) {
1717
- int rm = instr->RmField();
1718
- switch (instr->Bits(7, 4)) {
1719
- case BX:
1720
- set_pc(get_register(rm));
1721
- break;
1722
- case BLX: {
1723
- uint32_t old_pc = get_pc();
1724
- set_pc(get_register(rm));
1725
- set_register(lr, old_pc + Instr::kInstrSize);
1726
- break;
1727
- }
1728
- case BKPT:
1729
- v8::internal::OS::DebugBreak();
1730
- break;
1731
- default:
1732
- UNIMPLEMENTED();
1733
- }
1734
- } else if (instr->Bits(22, 21) == 3) {
1735
- int rm = instr->RmField();
1736
- int rd = instr->RdField();
1737
- switch (instr->Bits(7, 4)) {
1738
- case CLZ: {
1739
- uint32_t bits = get_register(rm);
1740
- int leading_zeros = 0;
1741
- if (bits == 0) {
1742
- leading_zeros = 32;
1743
- } else {
1744
- while ((bits & 0x80000000u) == 0) {
1745
- bits <<= 1;
1746
- leading_zeros++;
1747
- }
1748
- }
1749
- set_register(rd, leading_zeros);
1750
- break;
1751
- }
1752
- default:
1753
- UNIMPLEMENTED();
1754
- }
1755
- } else {
1756
- PrintF("%08x\n", instr->InstructionBits());
1757
- UNIMPLEMENTED();
1758
- }
1759
- } else {
1760
- int rd = instr->RdField();
1761
- int rn = instr->RnField();
1762
- int32_t rn_val = get_register(rn);
1763
- int32_t shifter_operand = 0;
1764
- bool shifter_carry_out = 0;
1765
- if (type == 0) {
1766
- shifter_operand = GetShiftRm(instr, &shifter_carry_out);
1767
- } else {
1768
- ASSERT(instr->TypeField() == 1);
1769
- shifter_operand = GetImm(instr, &shifter_carry_out);
1770
- }
1771
- int32_t alu_out;
1772
-
1773
- switch (instr->OpcodeField()) {
1774
- case AND: {
1775
- // Format(instr, "and'cond's 'rd, 'rn, 'shift_rm");
1776
- // Format(instr, "and'cond's 'rd, 'rn, 'imm");
1777
- alu_out = rn_val & shifter_operand;
1778
- set_register(rd, alu_out);
1779
- if (instr->HasS()) {
1780
- SetNZFlags(alu_out);
1781
- SetCFlag(shifter_carry_out);
1782
- }
1783
- break;
1784
- }
1785
-
1786
- case EOR: {
1787
- // Format(instr, "eor'cond's 'rd, 'rn, 'shift_rm");
1788
- // Format(instr, "eor'cond's 'rd, 'rn, 'imm");
1789
- alu_out = rn_val ^ shifter_operand;
1790
- set_register(rd, alu_out);
1791
- if (instr->HasS()) {
1792
- SetNZFlags(alu_out);
1793
- SetCFlag(shifter_carry_out);
1794
- }
1795
- break;
1796
- }
1797
-
1798
- case SUB: {
1799
- // Format(instr, "sub'cond's 'rd, 'rn, 'shift_rm");
1800
- // Format(instr, "sub'cond's 'rd, 'rn, 'imm");
1801
- alu_out = rn_val - shifter_operand;
1802
- set_register(rd, alu_out);
1803
- if (instr->HasS()) {
1804
- SetNZFlags(alu_out);
1805
- SetCFlag(!BorrowFrom(rn_val, shifter_operand));
1806
- SetVFlag(OverflowFrom(alu_out, rn_val, shifter_operand, false));
1807
- }
1808
- break;
1809
- }
1810
-
1811
- case RSB: {
1812
- // Format(instr, "rsb'cond's 'rd, 'rn, 'shift_rm");
1813
- // Format(instr, "rsb'cond's 'rd, 'rn, 'imm");
1814
- alu_out = shifter_operand - rn_val;
1815
- set_register(rd, alu_out);
1816
- if (instr->HasS()) {
1817
- SetNZFlags(alu_out);
1818
- SetCFlag(!BorrowFrom(shifter_operand, rn_val));
1819
- SetVFlag(OverflowFrom(alu_out, shifter_operand, rn_val, false));
1820
- }
1821
- break;
1822
- }
1823
-
1824
- case ADD: {
1825
- // Format(instr, "add'cond's 'rd, 'rn, 'shift_rm");
1826
- // Format(instr, "add'cond's 'rd, 'rn, 'imm");
1827
- alu_out = rn_val + shifter_operand;
1828
- set_register(rd, alu_out);
1829
- if (instr->HasS()) {
1830
- SetNZFlags(alu_out);
1831
- SetCFlag(CarryFrom(rn_val, shifter_operand));
1832
- SetVFlag(OverflowFrom(alu_out, rn_val, shifter_operand, true));
1833
- }
1834
- break;
1835
- }
1836
-
1837
- case ADC: {
1838
- Format(instr, "adc'cond's 'rd, 'rn, 'shift_rm");
1839
- Format(instr, "adc'cond's 'rd, 'rn, 'imm");
1840
- break;
1841
- }
1842
-
1843
- case SBC: {
1844
- Format(instr, "sbc'cond's 'rd, 'rn, 'shift_rm");
1845
- Format(instr, "sbc'cond's 'rd, 'rn, 'imm");
1846
- break;
1847
- }
1848
-
1849
- case RSC: {
1850
- Format(instr, "rsc'cond's 'rd, 'rn, 'shift_rm");
1851
- Format(instr, "rsc'cond's 'rd, 'rn, 'imm");
1852
- break;
1853
- }
1854
-
1855
- case TST: {
1856
- if (instr->HasS()) {
1857
- // Format(instr, "tst'cond 'rn, 'shift_rm");
1858
- // Format(instr, "tst'cond 'rn, 'imm");
1859
- alu_out = rn_val & shifter_operand;
1860
- SetNZFlags(alu_out);
1861
- SetCFlag(shifter_carry_out);
1862
- } else {
1863
- // Format(instr, "movw'cond 'rd, 'imm").
1864
- alu_out = instr->ImmedMovwMovtField();
1865
- set_register(rd, alu_out);
1866
- }
1867
- break;
1868
- }
1869
-
1870
- case TEQ: {
1871
- if (instr->HasS()) {
1872
- // Format(instr, "teq'cond 'rn, 'shift_rm");
1873
- // Format(instr, "teq'cond 'rn, 'imm");
1874
- alu_out = rn_val ^ shifter_operand;
1875
- SetNZFlags(alu_out);
1876
- SetCFlag(shifter_carry_out);
1877
- } else {
1878
- // Other instructions matching this pattern are handled in the
1879
- // miscellaneous instructions part above.
1880
- UNREACHABLE();
1881
- }
1882
- break;
1883
- }
1884
-
1885
- case CMP: {
1886
- if (instr->HasS()) {
1887
- // Format(instr, "cmp'cond 'rn, 'shift_rm");
1888
- // Format(instr, "cmp'cond 'rn, 'imm");
1889
- alu_out = rn_val - shifter_operand;
1890
- SetNZFlags(alu_out);
1891
- SetCFlag(!BorrowFrom(rn_val, shifter_operand));
1892
- SetVFlag(OverflowFrom(alu_out, rn_val, shifter_operand, false));
1893
- } else {
1894
- // Format(instr, "movt'cond 'rd, 'imm").
1895
- alu_out = (get_register(rd) & 0xffff) |
1896
- (instr->ImmedMovwMovtField() << 16);
1897
- set_register(rd, alu_out);
1898
- }
1899
- break;
1900
- }
1901
-
1902
- case CMN: {
1903
- if (instr->HasS()) {
1904
- // Format(instr, "cmn'cond 'rn, 'shift_rm");
1905
- // Format(instr, "cmn'cond 'rn, 'imm");
1906
- alu_out = rn_val + shifter_operand;
1907
- SetNZFlags(alu_out);
1908
- SetCFlag(!CarryFrom(rn_val, shifter_operand));
1909
- SetVFlag(OverflowFrom(alu_out, rn_val, shifter_operand, true));
1910
- } else {
1911
- // Other instructions matching this pattern are handled in the
1912
- // miscellaneous instructions part above.
1913
- UNREACHABLE();
1914
- }
1915
- break;
1916
- }
1917
-
1918
- case ORR: {
1919
- // Format(instr, "orr'cond's 'rd, 'rn, 'shift_rm");
1920
- // Format(instr, "orr'cond's 'rd, 'rn, 'imm");
1921
- alu_out = rn_val | shifter_operand;
1922
- set_register(rd, alu_out);
1923
- if (instr->HasS()) {
1924
- SetNZFlags(alu_out);
1925
- SetCFlag(shifter_carry_out);
1926
- }
1927
- break;
1928
- }
1929
-
1930
- case MOV: {
1931
- // Format(instr, "mov'cond's 'rd, 'shift_rm");
1932
- // Format(instr, "mov'cond's 'rd, 'imm");
1933
- alu_out = shifter_operand;
1934
- set_register(rd, alu_out);
1935
- if (instr->HasS()) {
1936
- SetNZFlags(alu_out);
1937
- SetCFlag(shifter_carry_out);
1938
- }
1939
- break;
1940
- }
1941
-
1942
- case BIC: {
1943
- // Format(instr, "bic'cond's 'rd, 'rn, 'shift_rm");
1944
- // Format(instr, "bic'cond's 'rd, 'rn, 'imm");
1945
- alu_out = rn_val & ~shifter_operand;
1946
- set_register(rd, alu_out);
1947
- if (instr->HasS()) {
1948
- SetNZFlags(alu_out);
1949
- SetCFlag(shifter_carry_out);
1950
- }
1951
- break;
1952
- }
1953
-
1954
- case MVN: {
1955
- // Format(instr, "mvn'cond's 'rd, 'shift_rm");
1956
- // Format(instr, "mvn'cond's 'rd, 'imm");
1957
- alu_out = ~shifter_operand;
1958
- set_register(rd, alu_out);
1959
- if (instr->HasS()) {
1960
- SetNZFlags(alu_out);
1961
- SetCFlag(shifter_carry_out);
1962
- }
1963
- break;
1964
- }
1965
-
1966
- default: {
1967
- UNREACHABLE();
1968
- break;
1969
- }
1970
- }
1971
- }
1972
- }
1973
-
1974
-
1975
- void Simulator::DecodeType2(Instr* instr) {
1976
- int rd = instr->RdField();
1977
- int rn = instr->RnField();
1978
- int32_t rn_val = get_register(rn);
1979
- int32_t im_val = instr->Offset12Field();
1980
- int32_t addr = 0;
1981
- switch (instr->PUField()) {
1982
- case 0: {
1983
- // Format(instr, "'memop'cond'b 'rd, ['rn], #-'off12");
1984
- ASSERT(!instr->HasW());
1985
- addr = rn_val;
1986
- rn_val -= im_val;
1987
- set_register(rn, rn_val);
1988
- break;
1989
- }
1990
- case 1: {
1991
- // Format(instr, "'memop'cond'b 'rd, ['rn], #+'off12");
1992
- ASSERT(!instr->HasW());
1993
- addr = rn_val;
1994
- rn_val += im_val;
1995
- set_register(rn, rn_val);
1996
- break;
1997
- }
1998
- case 2: {
1999
- // Format(instr, "'memop'cond'b 'rd, ['rn, #-'off12]'w");
2000
- rn_val -= im_val;
2001
- addr = rn_val;
2002
- if (instr->HasW()) {
2003
- set_register(rn, rn_val);
2004
- }
2005
- break;
2006
- }
2007
- case 3: {
2008
- // Format(instr, "'memop'cond'b 'rd, ['rn, #+'off12]'w");
2009
- rn_val += im_val;
2010
- addr = rn_val;
2011
- if (instr->HasW()) {
2012
- set_register(rn, rn_val);
2013
- }
2014
- break;
2015
- }
2016
- default: {
2017
- UNREACHABLE();
2018
- break;
2019
- }
2020
- }
2021
- if (instr->HasB()) {
2022
- if (instr->HasL()) {
2023
- byte val = ReadBU(addr);
2024
- set_register(rd, val);
2025
- } else {
2026
- byte val = get_register(rd);
2027
- WriteB(addr, val);
2028
- }
2029
- } else {
2030
- if (instr->HasL()) {
2031
- set_register(rd, ReadW(addr, instr));
2032
- } else {
2033
- WriteW(addr, get_register(rd), instr);
2034
- }
2035
- }
2036
- }
2037
-
2038
-
2039
- void Simulator::DecodeType3(Instr* instr) {
2040
- int rd = instr->RdField();
2041
- int rn = instr->RnField();
2042
- int32_t rn_val = get_register(rn);
2043
- bool shifter_carry_out = 0;
2044
- int32_t shifter_operand = GetShiftRm(instr, &shifter_carry_out);
2045
- int32_t addr = 0;
2046
- switch (instr->PUField()) {
2047
- case 0: {
2048
- ASSERT(!instr->HasW());
2049
- Format(instr, "'memop'cond'b 'rd, ['rn], -'shift_rm");
2050
- UNIMPLEMENTED();
2051
- break;
2052
- }
2053
- case 1: {
2054
- if (instr->HasW()) {
2055
- ASSERT(instr->Bits(5, 4) == 0x1);
2056
-
2057
- if (instr->Bit(22) == 0x1) { // USAT.
2058
- int32_t sat_pos = instr->Bits(20, 16);
2059
- int32_t sat_val = (1 << sat_pos) - 1;
2060
- int32_t shift = instr->Bits(11, 7);
2061
- int32_t shift_type = instr->Bit(6);
2062
- int32_t rm_val = get_register(instr->RmField());
2063
- if (shift_type == 0) { // LSL
2064
- rm_val <<= shift;
2065
- } else { // ASR
2066
- rm_val >>= shift;
2067
- }
2068
- // If saturation occurs, the Q flag should be set in the CPSR.
2069
- // There is no Q flag yet, and no instruction (MRS) to read the
2070
- // CPSR directly.
2071
- if (rm_val > sat_val) {
2072
- rm_val = sat_val;
2073
- } else if (rm_val < 0) {
2074
- rm_val = 0;
2075
- }
2076
- set_register(rd, rm_val);
2077
- } else { // SSAT.
2078
- UNIMPLEMENTED();
2079
- }
2080
- return;
2081
- } else {
2082
- Format(instr, "'memop'cond'b 'rd, ['rn], +'shift_rm");
2083
- UNIMPLEMENTED();
2084
- }
2085
- break;
2086
- }
2087
- case 2: {
2088
- // Format(instr, "'memop'cond'b 'rd, ['rn, -'shift_rm]'w");
2089
- addr = rn_val - shifter_operand;
2090
- if (instr->HasW()) {
2091
- set_register(rn, addr);
2092
- }
2093
- break;
2094
- }
2095
- case 3: {
2096
- if (instr->HasW() && (instr->Bits(6, 4) == 0x5)) {
2097
- uint32_t widthminus1 = static_cast<uint32_t>(instr->Bits(20, 16));
2098
- uint32_t lsbit = static_cast<uint32_t>(instr->Bits(11, 7));
2099
- uint32_t msbit = widthminus1 + lsbit;
2100
- if (msbit <= 31) {
2101
- if (instr->Bit(22)) {
2102
- // ubfx - unsigned bitfield extract.
2103
- uint32_t rm_val =
2104
- static_cast<uint32_t>(get_register(instr->RmField()));
2105
- uint32_t extr_val = rm_val << (31 - msbit);
2106
- extr_val = extr_val >> (31 - widthminus1);
2107
- set_register(instr->RdField(), extr_val);
2108
- } else {
2109
- // sbfx - signed bitfield extract.
2110
- int32_t rm_val = get_register(instr->RmField());
2111
- int32_t extr_val = rm_val << (31 - msbit);
2112
- extr_val = extr_val >> (31 - widthminus1);
2113
- set_register(instr->RdField(), extr_val);
2114
- }
2115
- } else {
2116
- UNREACHABLE();
2117
- }
2118
- return;
2119
- } else if (!instr->HasW() && (instr->Bits(6, 4) == 0x1)) {
2120
- uint32_t lsbit = static_cast<uint32_t>(instr->Bits(11, 7));
2121
- uint32_t msbit = static_cast<uint32_t>(instr->Bits(20, 16));
2122
- if (msbit >= lsbit) {
2123
- // bfc or bfi - bitfield clear/insert.
2124
- uint32_t rd_val =
2125
- static_cast<uint32_t>(get_register(instr->RdField()));
2126
- uint32_t bitcount = msbit - lsbit + 1;
2127
- uint32_t mask = (1 << bitcount) - 1;
2128
- rd_val &= ~(mask << lsbit);
2129
- if (instr->RmField() != 15) {
2130
- // bfi - bitfield insert.
2131
- uint32_t rm_val =
2132
- static_cast<uint32_t>(get_register(instr->RmField()));
2133
- rm_val &= mask;
2134
- rd_val |= rm_val << lsbit;
2135
- }
2136
- set_register(instr->RdField(), rd_val);
2137
- } else {
2138
- UNREACHABLE();
2139
- }
2140
- return;
2141
- } else {
2142
- // Format(instr, "'memop'cond'b 'rd, ['rn, +'shift_rm]'w");
2143
- addr = rn_val + shifter_operand;
2144
- if (instr->HasW()) {
2145
- set_register(rn, addr);
2146
- }
2147
- }
2148
- break;
2149
- }
2150
- default: {
2151
- UNREACHABLE();
2152
- break;
2153
- }
2154
- }
2155
- if (instr->HasB()) {
2156
- if (instr->HasL()) {
2157
- uint8_t byte = ReadB(addr);
2158
- set_register(rd, byte);
2159
- } else {
2160
- uint8_t byte = get_register(rd);
2161
- WriteB(addr, byte);
2162
- }
2163
- } else {
2164
- if (instr->HasL()) {
2165
- set_register(rd, ReadW(addr, instr));
2166
- } else {
2167
- WriteW(addr, get_register(rd), instr);
2168
- }
2169
- }
2170
- }
2171
-
2172
-
2173
- void Simulator::DecodeType4(Instr* instr) {
2174
- ASSERT(instr->Bit(22) == 0); // only allowed to be set in privileged mode
2175
- if (instr->HasL()) {
2176
- // Format(instr, "ldm'cond'pu 'rn'w, 'rlist");
2177
- HandleRList(instr, true);
2178
- } else {
2179
- // Format(instr, "stm'cond'pu 'rn'w, 'rlist");
2180
- HandleRList(instr, false);
2181
- }
2182
- }
2183
-
2184
-
2185
- void Simulator::DecodeType5(Instr* instr) {
2186
- // Format(instr, "b'l'cond 'target");
2187
- int off = (instr->SImmed24Field() << 2);
2188
- intptr_t pc_address = get_pc();
2189
- if (instr->HasLink()) {
2190
- set_register(lr, pc_address + Instr::kInstrSize);
2191
- }
2192
- int pc_reg = get_register(pc);
2193
- set_pc(pc_reg + off);
2194
- }
2195
-
2196
-
2197
- void Simulator::DecodeType6(Instr* instr) {
2198
- DecodeType6CoprocessorIns(instr);
2199
- }
2200
-
2201
-
2202
- void Simulator::DecodeType7(Instr* instr) {
2203
- if (instr->Bit(24) == 1) {
2204
- SoftwareInterrupt(instr);
2205
- } else {
2206
- DecodeTypeVFP(instr);
2207
- }
2208
- }
2209
-
2210
-
2211
- void Simulator::DecodeUnconditional(Instr* instr) {
2212
- if (instr->Bits(7, 4) == 0x0B && instr->Bits(27, 25) == 0 && instr->HasL()) {
2213
- // Load halfword instruction, either register or immediate offset.
2214
- int rd = instr->RdField();
2215
- int rn = instr->RnField();
2216
- int32_t rn_val = get_register(rn);
2217
- int32_t addr = 0;
2218
- int32_t offset;
2219
- if (instr->Bit(22) == 0) {
2220
- // Register offset.
2221
- int rm = instr->RmField();
2222
- offset = get_register(rm);
2223
- } else {
2224
- // Immediate offset
2225
- offset = instr->Bits(3, 0) + (instr->Bits(11, 8) << 4);
2226
- }
2227
- switch (instr->PUField()) {
2228
- case 0: {
2229
- // Post index, negative.
2230
- ASSERT(!instr->HasW());
2231
- addr = rn_val;
2232
- rn_val -= offset;
2233
- set_register(rn, rn_val);
2234
- break;
2235
- }
2236
- case 1: {
2237
- // Post index, positive.
2238
- ASSERT(!instr->HasW());
2239
- addr = rn_val;
2240
- rn_val += offset;
2241
- set_register(rn, rn_val);
2242
- break;
2243
- }
2244
- case 2: {
2245
- // Pre index or offset, negative.
2246
- rn_val -= offset;
2247
- addr = rn_val;
2248
- if (instr->HasW()) {
2249
- set_register(rn, rn_val);
2250
- }
2251
- break;
2252
- }
2253
- case 3: {
2254
- // Pre index or offset, positive.
2255
- rn_val += offset;
2256
- addr = rn_val;
2257
- if (instr->HasW()) {
2258
- set_register(rn, rn_val);
2259
- }
2260
- break;
2261
- }
2262
- default: {
2263
- // The PU field is a 2-bit field.
2264
- UNREACHABLE();
2265
- break;
2266
- }
2267
- }
2268
- // Not sign extending, so load as unsigned.
2269
- uint16_t halfword = ReadH(addr, instr);
2270
- set_register(rd, halfword);
2271
- } else {
2272
- Debugger dbg(this);
2273
- dbg.Stop(instr);
2274
- }
2275
- }
2276
-
2277
-
2278
- // Depending on value of last_bit flag glue register code from vm and m values
2279
- // (where m is expected to be a single bit).
2280
- static int GlueRegCode(bool last_bit, int vm, int m) {
2281
- return last_bit ? ((vm << 1) | m) : ((m << 4) | vm);
2282
- }
2283
-
2284
-
2285
- // void Simulator::DecodeTypeVFP(Instr* instr)
2286
- // The Following ARMv7 VFPv instructions are currently supported.
2287
- // vmov :Sn = Rt
2288
- // vmov :Rt = Sn
2289
- // vcvt: Dd = Sm
2290
- // vcvt: Sd = Dm
2291
- // Dd = vadd(Dn, Dm)
2292
- // Dd = vsub(Dn, Dm)
2293
- // Dd = vmul(Dn, Dm)
2294
- // Dd = vdiv(Dn, Dm)
2295
- // vcmp(Dd, Dm)
2296
- // vmrs
2297
- // Dd = vsqrt(Dm)
2298
- void Simulator::DecodeTypeVFP(Instr* instr) {
2299
- ASSERT((instr->TypeField() == 7) && (instr->Bit(24) == 0x0) );
2300
- ASSERT(instr->Bits(11, 9) == 0x5);
2301
-
2302
- int vm = instr->VmField();
2303
- int vd = instr->VdField();
2304
- int vn = instr->VnField();
2305
-
2306
- if (instr->Bit(4) == 0) {
2307
- if (instr->Opc1Field() == 0x7) {
2308
- // Other data processing instructions
2309
- if ((instr->Opc2Field() == 0x0) && (instr->Opc3Field() == 0x1)) {
2310
- // vmov register to register.
2311
- if (instr->SzField() == 0x1) {
2312
- set_d_register_from_double(vd, get_double_from_d_register(vm));
2313
- } else {
2314
- set_s_register_from_float(vd, get_float_from_s_register(vm));
2315
- }
2316
- } else if ((instr->Opc2Field() == 0x7) && (instr->Opc3Field() == 0x3)) {
2317
- DecodeVCVTBetweenDoubleAndSingle(instr);
2318
- } else if ((instr->Opc2Field() == 0x8) && (instr->Opc3Field() & 0x1)) {
2319
- DecodeVCVTBetweenFloatingPointAndInteger(instr);
2320
- } else if (((instr->Opc2Field() >> 1) == 0x6) &&
2321
- (instr->Opc3Field() & 0x1)) {
2322
- DecodeVCVTBetweenFloatingPointAndInteger(instr);
2323
- } else if (((instr->Opc2Field() == 0x4) || (instr->Opc2Field() == 0x5)) &&
2324
- (instr->Opc3Field() & 0x1)) {
2325
- DecodeVCMP(instr);
2326
- } else if (((instr->Opc2Field() == 0x1)) && (instr->Opc3Field() == 0x3)) {
2327
- // vsqrt
2328
- double dm_value = get_double_from_d_register(vm);
2329
- double dd_value = sqrt(dm_value);
2330
- set_d_register_from_double(vd, dd_value);
2331
- } else if (instr->Opc3Field() == 0x0) {
2332
- // vmov immediate.
2333
- if (instr->SzField() == 0x1) {
2334
- set_d_register_from_double(vd, instr->DoubleImmedVmov());
2335
- } else {
2336
- UNREACHABLE(); // Not used by v8.
2337
- }
2338
- } else {
2339
- UNREACHABLE(); // Not used by V8.
2340
- }
2341
- } else if (instr->Opc1Field() == 0x3) {
2342
- if (instr->SzField() != 0x1) {
2343
- UNREACHABLE(); // Not used by V8.
2344
- }
2345
-
2346
- if (instr->Opc3Field() & 0x1) {
2347
- // vsub
2348
- double dn_value = get_double_from_d_register(vn);
2349
- double dm_value = get_double_from_d_register(vm);
2350
- double dd_value = dn_value - dm_value;
2351
- set_d_register_from_double(vd, dd_value);
2352
- } else {
2353
- // vadd
2354
- double dn_value = get_double_from_d_register(vn);
2355
- double dm_value = get_double_from_d_register(vm);
2356
- double dd_value = dn_value + dm_value;
2357
- set_d_register_from_double(vd, dd_value);
2358
- }
2359
- } else if ((instr->Opc1Field() == 0x2) && !(instr->Opc3Field() & 0x1)) {
2360
- // vmul
2361
- if (instr->SzField() != 0x1) {
2362
- UNREACHABLE(); // Not used by V8.
2363
- }
2364
-
2365
- double dn_value = get_double_from_d_register(vn);
2366
- double dm_value = get_double_from_d_register(vm);
2367
- double dd_value = dn_value * dm_value;
2368
- set_d_register_from_double(vd, dd_value);
2369
- } else if ((instr->Opc1Field() == 0x4) && !(instr->Opc3Field() & 0x1)) {
2370
- // vdiv
2371
- if (instr->SzField() != 0x1) {
2372
- UNREACHABLE(); // Not used by V8.
2373
- }
2374
-
2375
- double dn_value = get_double_from_d_register(vn);
2376
- double dm_value = get_double_from_d_register(vm);
2377
- double dd_value = dn_value / dm_value;
2378
- set_d_register_from_double(vd, dd_value);
2379
- } else {
2380
- UNIMPLEMENTED(); // Not used by V8.
2381
- }
2382
- } else {
2383
- if ((instr->VCField() == 0x0) &&
2384
- (instr->VAField() == 0x0)) {
2385
- DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(instr);
2386
- } else if ((instr->VLField() == 0x1) &&
2387
- (instr->VCField() == 0x0) &&
2388
- (instr->VAField() == 0x7) &&
2389
- (instr->Bits(19, 16) == 0x1)) {
2390
- // vmrs
2391
- if (instr->RtField() == 0xF)
2392
- Copy_FPSCR_to_APSR();
2393
- else
2394
- UNIMPLEMENTED(); // Not used by V8.
2395
- } else {
2396
- UNIMPLEMENTED(); // Not used by V8.
2397
- }
2398
- }
2399
- }
2400
-
2401
-
2402
- void Simulator::DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(Instr* instr) {
2403
- ASSERT((instr->Bit(4) == 1) && (instr->VCField() == 0x0) &&
2404
- (instr->VAField() == 0x0));
2405
-
2406
- int t = instr->RtField();
2407
- int n = GlueRegCode(true, instr->VnField(), instr->NField());
2408
- bool to_arm_register = (instr->VLField() == 0x1);
2409
-
2410
- if (to_arm_register) {
2411
- int32_t int_value = get_sinteger_from_s_register(n);
2412
- set_register(t, int_value);
2413
- } else {
2414
- int32_t rs_val = get_register(t);
2415
- set_s_register_from_sinteger(n, rs_val);
2416
- }
2417
- }
2418
-
2419
-
2420
- void Simulator::DecodeVCMP(Instr* instr) {
2421
- ASSERT((instr->Bit(4) == 0) && (instr->Opc1Field() == 0x7));
2422
- ASSERT(((instr->Opc2Field() == 0x4) || (instr->Opc2Field() == 0x5)) &&
2423
- (instr->Opc3Field() & 0x1));
2424
-
2425
- // Comparison.
2426
- bool dp_operation = (instr->SzField() == 1);
2427
-
2428
- if (instr->Bit(7) != 0) {
2429
- // Raising exceptions for quiet NaNs are not supported.
2430
- UNIMPLEMENTED(); // Not used by V8.
2431
- }
2432
-
2433
- int d = GlueRegCode(!dp_operation, instr->VdField(), instr->DField());
2434
- int m = GlueRegCode(!dp_operation, instr->VmField(), instr->MField());
2435
-
2436
- if (dp_operation) {
2437
- double dd_value = get_double_from_d_register(d);
2438
- double dm_value = get_double_from_d_register(m);
2439
-
2440
- Compute_FPSCR_Flags(dd_value, dm_value);
2441
- } else {
2442
- UNIMPLEMENTED(); // Not used by V8.
2443
- }
2444
- }
2445
-
2446
-
2447
- void Simulator::DecodeVCVTBetweenDoubleAndSingle(Instr* instr) {
2448
- ASSERT((instr->Bit(4) == 0) && (instr->Opc1Field() == 0x7));
2449
- ASSERT((instr->Opc2Field() == 0x7) && (instr->Opc3Field() == 0x3));
2450
-
2451
- bool double_to_single = (instr->SzField() == 1);
2452
- int dst = GlueRegCode(double_to_single, instr->VdField(), instr->DField());
2453
- int src = GlueRegCode(!double_to_single, instr->VmField(), instr->MField());
2454
-
2455
- if (double_to_single) {
2456
- double val = get_double_from_d_register(src);
2457
- set_s_register_from_float(dst, static_cast<float>(val));
2458
- } else {
2459
- float val = get_float_from_s_register(src);
2460
- set_d_register_from_double(dst, static_cast<double>(val));
2461
- }
2462
- }
2463
-
2464
-
2465
- void Simulator::DecodeVCVTBetweenFloatingPointAndInteger(Instr* instr) {
2466
- ASSERT((instr->Bit(4) == 0) && (instr->Opc1Field() == 0x7));
2467
- ASSERT(((instr->Opc2Field() == 0x8) && (instr->Opc3Field() & 0x1)) ||
2468
- (((instr->Opc2Field() >> 1) == 0x6) && (instr->Opc3Field() & 0x1)));
2469
-
2470
- // Conversion between floating-point and integer.
2471
- int vd = instr->VdField();
2472
- int d = instr->DField();
2473
- int vm = instr->VmField();
2474
- int m = instr->MField();
2475
-
2476
- bool to_integer = (instr->Bit(18) == 1);
2477
- bool dp_operation = (instr->SzField() == 1);
2478
- if (to_integer) {
2479
- bool unsigned_integer = (instr->Bit(16) == 0);
2480
- if (instr->Bit(7) != 1) {
2481
- // Only rounding towards zero supported.
2482
- UNIMPLEMENTED(); // Not used by V8.
2483
- }
2484
-
2485
- int dst = GlueRegCode(true, vd, d);
2486
- int src = GlueRegCode(!dp_operation, vm, m);
2487
-
2488
- if (dp_operation) {
2489
- double val = get_double_from_d_register(src);
2490
-
2491
- int sint = unsigned_integer ? static_cast<uint32_t>(val) :
2492
- static_cast<int32_t>(val);
2493
-
2494
- set_s_register_from_sinteger(dst, sint);
2495
- } else {
2496
- float val = get_float_from_s_register(src);
2497
-
2498
- int sint = unsigned_integer ? static_cast<uint32_t>(val) :
2499
- static_cast<int32_t>(val);
2500
-
2501
- set_s_register_from_sinteger(dst, sint);
2502
- }
2503
- } else {
2504
- bool unsigned_integer = (instr->Bit(7) == 0);
2505
-
2506
- int dst = GlueRegCode(!dp_operation, vd, d);
2507
- int src = GlueRegCode(true, vm, m);
2508
-
2509
- int val = get_sinteger_from_s_register(src);
2510
-
2511
- if (dp_operation) {
2512
- if (unsigned_integer) {
2513
- set_d_register_from_double(dst,
2514
- static_cast<double>((uint32_t)val));
2515
- } else {
2516
- set_d_register_from_double(dst, static_cast<double>(val));
2517
- }
2518
- } else {
2519
- if (unsigned_integer) {
2520
- set_s_register_from_float(dst,
2521
- static_cast<float>((uint32_t)val));
2522
- } else {
2523
- set_s_register_from_float(dst, static_cast<float>(val));
2524
- }
2525
- }
2526
- }
2527
- }
2528
-
2529
-
2530
- // void Simulator::DecodeType6CoprocessorIns(Instr* instr)
2531
- // Decode Type 6 coprocessor instructions.
2532
- // Dm = vmov(Rt, Rt2)
2533
- // <Rt, Rt2> = vmov(Dm)
2534
- // Ddst = MEM(Rbase + 4*offset).
2535
- // MEM(Rbase + 4*offset) = Dsrc.
2536
- void Simulator::DecodeType6CoprocessorIns(Instr* instr) {
2537
- ASSERT((instr->TypeField() == 6));
2538
-
2539
- if (instr->CoprocessorField() == 0xA) {
2540
- switch (instr->OpcodeField()) {
2541
- case 0x8:
2542
- case 0xC: { // Load and store float to memory.
2543
- int rn = instr->RnField();
2544
- int vd = instr->VdField();
2545
- int offset = instr->Immed8Field();
2546
- if (!instr->HasU()) {
2547
- offset = -offset;
2548
- }
2549
-
2550
- int32_t address = get_register(rn) + 4 * offset;
2551
- if (instr->HasL()) {
2552
- // Load double from memory: vldr.
2553
- set_s_register_from_sinteger(vd, ReadW(address, instr));
2554
- } else {
2555
- // Store double to memory: vstr.
2556
- WriteW(address, get_sinteger_from_s_register(vd), instr);
2557
- }
2558
- break;
2559
- }
2560
- default:
2561
- UNIMPLEMENTED(); // Not used by V8.
2562
- break;
2563
- }
2564
- } else if (instr->CoprocessorField() == 0xB) {
2565
- switch (instr->OpcodeField()) {
2566
- case 0x2:
2567
- // Load and store double to two GP registers
2568
- if (instr->Bits(7, 4) != 0x1) {
2569
- UNIMPLEMENTED(); // Not used by V8.
2570
- } else {
2571
- int rt = instr->RtField();
2572
- int rn = instr->RnField();
2573
- int vm = instr->VmField();
2574
- if (instr->HasL()) {
2575
- int32_t rt_int_value = get_sinteger_from_s_register(2*vm);
2576
- int32_t rn_int_value = get_sinteger_from_s_register(2*vm+1);
2577
-
2578
- set_register(rt, rt_int_value);
2579
- set_register(rn, rn_int_value);
2580
- } else {
2581
- int32_t rs_val = get_register(rt);
2582
- int32_t rn_val = get_register(rn);
2583
-
2584
- set_s_register_from_sinteger(2*vm, rs_val);
2585
- set_s_register_from_sinteger((2*vm+1), rn_val);
2586
- }
2587
- }
2588
- break;
2589
- case 0x8:
2590
- case 0xC: { // Load and store double to memory.
2591
- int rn = instr->RnField();
2592
- int vd = instr->VdField();
2593
- int offset = instr->Immed8Field();
2594
- if (!instr->HasU()) {
2595
- offset = -offset;
2596
- }
2597
- int32_t address = get_register(rn) + 4 * offset;
2598
- if (instr->HasL()) {
2599
- // Load double from memory: vldr.
2600
- set_s_register_from_sinteger(2*vd, ReadW(address, instr));
2601
- set_s_register_from_sinteger(2*vd + 1, ReadW(address + 4, instr));
2602
- } else {
2603
- // Store double to memory: vstr.
2604
- WriteW(address, get_sinteger_from_s_register(2*vd), instr);
2605
- WriteW(address + 4, get_sinteger_from_s_register(2*vd + 1), instr);
2606
- }
2607
- break;
2608
- }
2609
- default:
2610
- UNIMPLEMENTED(); // Not used by V8.
2611
- break;
2612
- }
2613
- } else {
2614
- UNIMPLEMENTED(); // Not used by V8.
2615
- }
2616
- }
2617
-
2618
-
2619
- // Executes the current instruction.
2620
- void Simulator::InstructionDecode(Instr* instr) {
2621
- if (v8::internal::FLAG_check_icache) {
2622
- CheckICache(instr);
2623
- }
2624
- pc_modified_ = false;
2625
- if (::v8::internal::FLAG_trace_sim) {
2626
- disasm::NameConverter converter;
2627
- disasm::Disassembler dasm(converter);
2628
- // use a reasonably large buffer
2629
- v8::internal::EmbeddedVector<char, 256> buffer;
2630
- dasm.InstructionDecode(buffer,
2631
- reinterpret_cast<byte*>(instr));
2632
- PrintF(" 0x%08x %s\n", instr, buffer.start());
2633
- }
2634
- if (instr->ConditionField() == special_condition) {
2635
- DecodeUnconditional(instr);
2636
- } else if (ConditionallyExecute(instr)) {
2637
- switch (instr->TypeField()) {
2638
- case 0:
2639
- case 1: {
2640
- DecodeType01(instr);
2641
- break;
2642
- }
2643
- case 2: {
2644
- DecodeType2(instr);
2645
- break;
2646
- }
2647
- case 3: {
2648
- DecodeType3(instr);
2649
- break;
2650
- }
2651
- case 4: {
2652
- DecodeType4(instr);
2653
- break;
2654
- }
2655
- case 5: {
2656
- DecodeType5(instr);
2657
- break;
2658
- }
2659
- case 6: {
2660
- DecodeType6(instr);
2661
- break;
2662
- }
2663
- case 7: {
2664
- DecodeType7(instr);
2665
- break;
2666
- }
2667
- default: {
2668
- UNIMPLEMENTED();
2669
- break;
2670
- }
2671
- }
2672
- }
2673
- if (!pc_modified_) {
2674
- set_register(pc, reinterpret_cast<int32_t>(instr) + Instr::kInstrSize);
2675
- }
2676
- }
2677
-
2678
-
2679
- void Simulator::Execute() {
2680
- // Get the PC to simulate. Cannot use the accessor here as we need the
2681
- // raw PC value and not the one used as input to arithmetic instructions.
2682
- int program_counter = get_pc();
2683
-
2684
- if (::v8::internal::FLAG_stop_sim_at == 0) {
2685
- // Fast version of the dispatch loop without checking whether the simulator
2686
- // should be stopping at a particular executed instruction.
2687
- while (program_counter != end_sim_pc) {
2688
- Instr* instr = reinterpret_cast<Instr*>(program_counter);
2689
- icount_++;
2690
- InstructionDecode(instr);
2691
- program_counter = get_pc();
2692
- }
2693
- } else {
2694
- // FLAG_stop_sim_at is at the non-default value. Stop in the debugger when
2695
- // we reach the particular instuction count.
2696
- while (program_counter != end_sim_pc) {
2697
- Instr* instr = reinterpret_cast<Instr*>(program_counter);
2698
- icount_++;
2699
- if (icount_ == ::v8::internal::FLAG_stop_sim_at) {
2700
- Debugger dbg(this);
2701
- dbg.Debug();
2702
- } else {
2703
- InstructionDecode(instr);
2704
- }
2705
- program_counter = get_pc();
2706
- }
2707
- }
2708
- }
2709
-
2710
-
2711
- int32_t Simulator::Call(byte* entry, int argument_count, ...) {
2712
- va_list parameters;
2713
- va_start(parameters, argument_count);
2714
- // Setup arguments
2715
-
2716
- // First four arguments passed in registers.
2717
- ASSERT(argument_count >= 4);
2718
- set_register(r0, va_arg(parameters, int32_t));
2719
- set_register(r1, va_arg(parameters, int32_t));
2720
- set_register(r2, va_arg(parameters, int32_t));
2721
- set_register(r3, va_arg(parameters, int32_t));
2722
-
2723
- // Remaining arguments passed on stack.
2724
- int original_stack = get_register(sp);
2725
- // Compute position of stack on entry to generated code.
2726
- int entry_stack = (original_stack - (argument_count - 4) * sizeof(int32_t));
2727
- if (OS::ActivationFrameAlignment() != 0) {
2728
- entry_stack &= -OS::ActivationFrameAlignment();
2729
- }
2730
- // Store remaining arguments on stack, from low to high memory.
2731
- intptr_t* stack_argument = reinterpret_cast<intptr_t*>(entry_stack);
2732
- for (int i = 4; i < argument_count; i++) {
2733
- stack_argument[i - 4] = va_arg(parameters, int32_t);
2734
- }
2735
- va_end(parameters);
2736
- set_register(sp, entry_stack);
2737
-
2738
- // Prepare to execute the code at entry
2739
- set_register(pc, reinterpret_cast<int32_t>(entry));
2740
- // Put down marker for end of simulation. The simulator will stop simulation
2741
- // when the PC reaches this value. By saving the "end simulation" value into
2742
- // the LR the simulation stops when returning to this call point.
2743
- set_register(lr, end_sim_pc);
2744
-
2745
- // Remember the values of callee-saved registers.
2746
- // The code below assumes that r9 is not used as sb (static base) in
2747
- // simulator code and therefore is regarded as a callee-saved register.
2748
- int32_t r4_val = get_register(r4);
2749
- int32_t r5_val = get_register(r5);
2750
- int32_t r6_val = get_register(r6);
2751
- int32_t r7_val = get_register(r7);
2752
- int32_t r8_val = get_register(r8);
2753
- int32_t r9_val = get_register(r9);
2754
- int32_t r10_val = get_register(r10);
2755
- int32_t r11_val = get_register(r11);
2756
-
2757
- // Setup the callee-saved registers with a known value. To be able to check
2758
- // that they are preserved properly across JS execution.
2759
- int32_t callee_saved_value = icount_;
2760
- set_register(r4, callee_saved_value);
2761
- set_register(r5, callee_saved_value);
2762
- set_register(r6, callee_saved_value);
2763
- set_register(r7, callee_saved_value);
2764
- set_register(r8, callee_saved_value);
2765
- set_register(r9, callee_saved_value);
2766
- set_register(r10, callee_saved_value);
2767
- set_register(r11, callee_saved_value);
2768
-
2769
- // Start the simulation
2770
- Execute();
2771
-
2772
- // Check that the callee-saved registers have been preserved.
2773
- CHECK_EQ(callee_saved_value, get_register(r4));
2774
- CHECK_EQ(callee_saved_value, get_register(r5));
2775
- CHECK_EQ(callee_saved_value, get_register(r6));
2776
- CHECK_EQ(callee_saved_value, get_register(r7));
2777
- CHECK_EQ(callee_saved_value, get_register(r8));
2778
- CHECK_EQ(callee_saved_value, get_register(r9));
2779
- CHECK_EQ(callee_saved_value, get_register(r10));
2780
- CHECK_EQ(callee_saved_value, get_register(r11));
2781
-
2782
- // Restore callee-saved registers with the original value.
2783
- set_register(r4, r4_val);
2784
- set_register(r5, r5_val);
2785
- set_register(r6, r6_val);
2786
- set_register(r7, r7_val);
2787
- set_register(r8, r8_val);
2788
- set_register(r9, r9_val);
2789
- set_register(r10, r10_val);
2790
- set_register(r11, r11_val);
2791
-
2792
- // Pop stack passed arguments.
2793
- CHECK_EQ(entry_stack, get_register(sp));
2794
- set_register(sp, original_stack);
2795
-
2796
- int32_t result = get_register(r0);
2797
- return result;
2798
- }
2799
-
2800
-
2801
- uintptr_t Simulator::PushAddress(uintptr_t address) {
2802
- int new_sp = get_register(sp) - sizeof(uintptr_t);
2803
- uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(new_sp);
2804
- *stack_slot = address;
2805
- set_register(sp, new_sp);
2806
- return new_sp;
2807
- }
2808
-
2809
-
2810
- uintptr_t Simulator::PopAddress() {
2811
- int current_sp = get_register(sp);
2812
- uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(current_sp);
2813
- uintptr_t address = *stack_slot;
2814
- set_register(sp, current_sp + sizeof(uintptr_t));
2815
- return address;
2816
- }
2817
-
2818
- } } // namespace assembler::arm
2819
-
2820
- #endif // __arm__
2821
-
2822
- #endif // V8_TARGET_ARCH_ARM