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,2963 +0,0 @@
1
- // Copyright 2009 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #include "v8.h"
29
-
30
- #if defined(V8_TARGET_ARCH_X64)
31
-
32
- #include "macro-assembler.h"
33
- #include "serialize.h"
34
-
35
- namespace v8 {
36
- namespace internal {
37
-
38
- // -----------------------------------------------------------------------------
39
- // Implementation of CpuFeatures
40
-
41
- // The required user mode extensions in X64 are (from AMD64 ABI Table A.1):
42
- // fpu, tsc, cx8, cmov, mmx, sse, sse2, fxsr, syscall
43
- uint64_t CpuFeatures::supported_ = kDefaultCpuFeatures;
44
- uint64_t CpuFeatures::enabled_ = 0;
45
- uint64_t CpuFeatures::found_by_runtime_probing_ = 0;
46
-
47
- void CpuFeatures::Probe() {
48
- ASSERT(Heap::HasBeenSetup());
49
- ASSERT(supported_ == kDefaultCpuFeatures);
50
- if (Serializer::enabled()) {
51
- supported_ |= OS::CpuFeaturesImpliedByPlatform();
52
- return; // No features if we might serialize.
53
- }
54
-
55
- Assembler assm(NULL, 0);
56
- Label cpuid, done;
57
- #define __ assm.
58
- // Save old rsp, since we are going to modify the stack.
59
- __ push(rbp);
60
- __ pushfq();
61
- __ push(rcx);
62
- __ push(rbx);
63
- __ movq(rbp, rsp);
64
-
65
- // If we can modify bit 21 of the EFLAGS register, then CPUID is supported.
66
- __ pushfq();
67
- __ pop(rax);
68
- __ movq(rdx, rax);
69
- __ xor_(rax, Immediate(0x200000)); // Flip bit 21.
70
- __ push(rax);
71
- __ popfq();
72
- __ pushfq();
73
- __ pop(rax);
74
- __ xor_(rax, rdx); // Different if CPUID is supported.
75
- __ j(not_zero, &cpuid);
76
-
77
- // CPUID not supported. Clear the supported features in edx:eax.
78
- __ xor_(rax, rax);
79
- __ jmp(&done);
80
-
81
- // Invoke CPUID with 1 in eax to get feature information in
82
- // ecx:edx. Temporarily enable CPUID support because we know it's
83
- // safe here.
84
- __ bind(&cpuid);
85
- __ movq(rax, Immediate(1));
86
- supported_ = kDefaultCpuFeatures | (1 << CPUID);
87
- { Scope fscope(CPUID);
88
- __ cpuid();
89
- // Move the result from ecx:edx to rdi.
90
- __ movl(rdi, rdx); // Zero-extended to 64 bits.
91
- __ shl(rcx, Immediate(32));
92
- __ or_(rdi, rcx);
93
-
94
- // Get the sahf supported flag, from CPUID(0x80000001)
95
- __ movq(rax, 0x80000001, RelocInfo::NONE);
96
- __ cpuid();
97
- }
98
- supported_ = kDefaultCpuFeatures;
99
-
100
- // Put the CPU flags in rax.
101
- // rax = (rcx & 1) | (rdi & ~1) | (1 << CPUID).
102
- __ movl(rax, Immediate(1));
103
- __ and_(rcx, rax); // Bit 0 is set if SAHF instruction supported.
104
- __ not_(rax);
105
- __ and_(rax, rdi);
106
- __ or_(rax, rcx);
107
- __ or_(rax, Immediate(1 << CPUID));
108
-
109
- // Done.
110
- __ bind(&done);
111
- __ movq(rsp, rbp);
112
- __ pop(rbx);
113
- __ pop(rcx);
114
- __ popfq();
115
- __ pop(rbp);
116
- __ ret(0);
117
- #undef __
118
-
119
- CodeDesc desc;
120
- assm.GetCode(&desc);
121
- Object* code = Heap::CreateCode(desc,
122
- Code::ComputeFlags(Code::STUB),
123
- Handle<Object>());
124
- if (!code->IsCode()) return;
125
- PROFILE(CodeCreateEvent(Logger::BUILTIN_TAG,
126
- Code::cast(code), "CpuFeatures::Probe"));
127
- typedef uint64_t (*F0)();
128
- F0 probe = FUNCTION_CAST<F0>(Code::cast(code)->entry());
129
- supported_ = probe();
130
- found_by_runtime_probing_ = supported_;
131
- found_by_runtime_probing_ &= ~kDefaultCpuFeatures;
132
- uint64_t os_guarantees = OS::CpuFeaturesImpliedByPlatform();
133
- supported_ |= os_guarantees;
134
- found_by_runtime_probing_ &= ~os_guarantees;
135
- // SSE2 and CMOV must be available on an X64 CPU.
136
- ASSERT(IsSupported(CPUID));
137
- ASSERT(IsSupported(SSE2));
138
- ASSERT(IsSupported(CMOV));
139
- }
140
-
141
-
142
- // -----------------------------------------------------------------------------
143
- // Implementation of RelocInfo
144
-
145
- // Patch the code at the current PC with a call to the target address.
146
- // Additional guard int3 instructions can be added if required.
147
- void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) {
148
- // Load register with immediate 64 and call through a register instructions
149
- // takes up 13 bytes and int3 takes up one byte.
150
- static const int kCallCodeSize = 13;
151
- int code_size = kCallCodeSize + guard_bytes;
152
-
153
- // Create a code patcher.
154
- CodePatcher patcher(pc_, code_size);
155
-
156
- // Add a label for checking the size of the code used for returning.
157
- #ifdef DEBUG
158
- Label check_codesize;
159
- patcher.masm()->bind(&check_codesize);
160
- #endif
161
-
162
- // Patch the code.
163
- patcher.masm()->movq(r10, target, RelocInfo::NONE);
164
- patcher.masm()->call(r10);
165
-
166
- // Check that the size of the code generated is as expected.
167
- ASSERT_EQ(kCallCodeSize,
168
- patcher.masm()->SizeOfCodeGeneratedSince(&check_codesize));
169
-
170
- // Add the requested number of int3 instructions after the call.
171
- for (int i = 0; i < guard_bytes; i++) {
172
- patcher.masm()->int3();
173
- }
174
- }
175
-
176
-
177
- void RelocInfo::PatchCode(byte* instructions, int instruction_count) {
178
- // Patch the code at the current address with the supplied instructions.
179
- for (int i = 0; i < instruction_count; i++) {
180
- *(pc_ + i) = *(instructions + i);
181
- }
182
-
183
- // Indicate that code has changed.
184
- CPU::FlushICache(pc_, instruction_count);
185
- }
186
-
187
- // -----------------------------------------------------------------------------
188
- // Implementation of Operand
189
-
190
- Operand::Operand(Register base, int32_t disp) : rex_(0) {
191
- len_ = 1;
192
- if (base.is(rsp) || base.is(r12)) {
193
- // SIB byte is needed to encode (rsp + offset) or (r12 + offset).
194
- set_sib(times_1, rsp, base);
195
- }
196
-
197
- if (disp == 0 && !base.is(rbp) && !base.is(r13)) {
198
- set_modrm(0, base);
199
- } else if (is_int8(disp)) {
200
- set_modrm(1, base);
201
- set_disp8(disp);
202
- } else {
203
- set_modrm(2, base);
204
- set_disp32(disp);
205
- }
206
- }
207
-
208
-
209
- Operand::Operand(Register base,
210
- Register index,
211
- ScaleFactor scale,
212
- int32_t disp) : rex_(0) {
213
- ASSERT(!index.is(rsp));
214
- len_ = 1;
215
- set_sib(scale, index, base);
216
- if (disp == 0 && !base.is(rbp) && !base.is(r13)) {
217
- // This call to set_modrm doesn't overwrite the REX.B (or REX.X) bits
218
- // possibly set by set_sib.
219
- set_modrm(0, rsp);
220
- } else if (is_int8(disp)) {
221
- set_modrm(1, rsp);
222
- set_disp8(disp);
223
- } else {
224
- set_modrm(2, rsp);
225
- set_disp32(disp);
226
- }
227
- }
228
-
229
-
230
- Operand::Operand(Register index,
231
- ScaleFactor scale,
232
- int32_t disp) : rex_(0) {
233
- ASSERT(!index.is(rsp));
234
- len_ = 1;
235
- set_modrm(0, rsp);
236
- set_sib(scale, index, rbp);
237
- set_disp32(disp);
238
- }
239
-
240
-
241
- Operand::Operand(const Operand& operand, int32_t offset) {
242
- ASSERT(operand.len_ >= 1);
243
- // Operand encodes REX ModR/M [SIB] [Disp].
244
- byte modrm = operand.buf_[0];
245
- ASSERT(modrm < 0xC0); // Disallow mode 3 (register target).
246
- bool has_sib = ((modrm & 0x07) == 0x04);
247
- byte mode = modrm & 0xC0;
248
- int disp_offset = has_sib ? 2 : 1;
249
- int base_reg = (has_sib ? operand.buf_[1] : modrm) & 0x07;
250
- // Mode 0 with rbp/r13 as ModR/M or SIB base register always has a 32-bit
251
- // displacement.
252
- bool is_baseless = (mode == 0) && (base_reg == 0x05); // No base or RIP base.
253
- int32_t disp_value = 0;
254
- if (mode == 0x80 || is_baseless) {
255
- // Mode 2 or mode 0 with rbp/r13 as base: Word displacement.
256
- disp_value = *reinterpret_cast<const int32_t*>(&operand.buf_[disp_offset]);
257
- } else if (mode == 0x40) {
258
- // Mode 1: Byte displacement.
259
- disp_value = static_cast<signed char>(operand.buf_[disp_offset]);
260
- }
261
-
262
- // Write new operand with same registers, but with modified displacement.
263
- ASSERT(offset >= 0 ? disp_value + offset > disp_value
264
- : disp_value + offset < disp_value); // No overflow.
265
- disp_value += offset;
266
- rex_ = operand.rex_;
267
- if (!is_int8(disp_value) || is_baseless) {
268
- // Need 32 bits of displacement, mode 2 or mode 1 with register rbp/r13.
269
- buf_[0] = (modrm & 0x3f) | (is_baseless ? 0x00 : 0x80);
270
- len_ = disp_offset + 4;
271
- Memory::int32_at(&buf_[disp_offset]) = disp_value;
272
- } else if (disp_value != 0 || (base_reg == 0x05)) {
273
- // Need 8 bits of displacement.
274
- buf_[0] = (modrm & 0x3f) | 0x40; // Mode 1.
275
- len_ = disp_offset + 1;
276
- buf_[disp_offset] = static_cast<byte>(disp_value);
277
- } else {
278
- // Need no displacement.
279
- buf_[0] = (modrm & 0x3f); // Mode 0.
280
- len_ = disp_offset;
281
- }
282
- if (has_sib) {
283
- buf_[1] = operand.buf_[1];
284
- }
285
- }
286
-
287
- // -----------------------------------------------------------------------------
288
- // Implementation of Assembler.
289
-
290
- #ifdef GENERATED_CODE_COVERAGE
291
- static void InitCoverageLog();
292
- #endif
293
-
294
- byte* Assembler::spare_buffer_ = NULL;
295
-
296
- Assembler::Assembler(void* buffer, int buffer_size)
297
- : code_targets_(100) {
298
- if (buffer == NULL) {
299
- // Do our own buffer management.
300
- if (buffer_size <= kMinimalBufferSize) {
301
- buffer_size = kMinimalBufferSize;
302
-
303
- if (spare_buffer_ != NULL) {
304
- buffer = spare_buffer_;
305
- spare_buffer_ = NULL;
306
- }
307
- }
308
- if (buffer == NULL) {
309
- buffer_ = NewArray<byte>(buffer_size);
310
- } else {
311
- buffer_ = static_cast<byte*>(buffer);
312
- }
313
- buffer_size_ = buffer_size;
314
- own_buffer_ = true;
315
- } else {
316
- // Use externally provided buffer instead.
317
- ASSERT(buffer_size > 0);
318
- buffer_ = static_cast<byte*>(buffer);
319
- buffer_size_ = buffer_size;
320
- own_buffer_ = false;
321
- }
322
-
323
- // Clear the buffer in debug mode unless it was provided by the
324
- // caller in which case we can't be sure it's okay to overwrite
325
- // existing code in it.
326
- #ifdef DEBUG
327
- if (own_buffer_) {
328
- memset(buffer_, 0xCC, buffer_size); // int3
329
- }
330
- #endif
331
-
332
- // Setup buffer pointers.
333
- ASSERT(buffer_ != NULL);
334
- pc_ = buffer_;
335
- reloc_info_writer.Reposition(buffer_ + buffer_size, pc_);
336
-
337
- last_pc_ = NULL;
338
- current_statement_position_ = RelocInfo::kNoPosition;
339
- current_position_ = RelocInfo::kNoPosition;
340
- written_statement_position_ = current_statement_position_;
341
- written_position_ = current_position_;
342
- #ifdef GENERATED_CODE_COVERAGE
343
- InitCoverageLog();
344
- #endif
345
- }
346
-
347
-
348
- Assembler::~Assembler() {
349
- if (own_buffer_) {
350
- if (spare_buffer_ == NULL && buffer_size_ == kMinimalBufferSize) {
351
- spare_buffer_ = buffer_;
352
- } else {
353
- DeleteArray(buffer_);
354
- }
355
- }
356
- }
357
-
358
-
359
- void Assembler::GetCode(CodeDesc* desc) {
360
- // Finalize code (at this point overflow() may be true, but the gap ensures
361
- // that we are still not overlapping instructions and relocation info).
362
- ASSERT(pc_ <= reloc_info_writer.pos()); // No overlap.
363
- // Setup code descriptor.
364
- desc->buffer = buffer_;
365
- desc->buffer_size = buffer_size_;
366
- desc->instr_size = pc_offset();
367
- ASSERT(desc->instr_size > 0); // Zero-size code objects upset the system.
368
- desc->reloc_size =
369
- static_cast<int>((buffer_ + buffer_size_) - reloc_info_writer.pos());
370
- desc->origin = this;
371
-
372
- Counters::reloc_info_size.Increment(desc->reloc_size);
373
- }
374
-
375
-
376
- void Assembler::Align(int m) {
377
- ASSERT(IsPowerOf2(m));
378
- int delta = (m - (pc_offset() & (m - 1))) & (m - 1);
379
- while (delta >= 9) {
380
- nop(9);
381
- delta -= 9;
382
- }
383
- if (delta > 0) {
384
- nop(delta);
385
- }
386
- }
387
-
388
-
389
- void Assembler::CodeTargetAlign() {
390
- Align(16); // Preferred alignment of jump targets on x64.
391
- }
392
-
393
-
394
- void Assembler::bind_to(Label* L, int pos) {
395
- ASSERT(!L->is_bound()); // Label may only be bound once.
396
- last_pc_ = NULL;
397
- ASSERT(0 <= pos && pos <= pc_offset()); // Position must be valid.
398
- if (L->is_linked()) {
399
- int current = L->pos();
400
- int next = long_at(current);
401
- while (next != current) {
402
- // Relative address, relative to point after address.
403
- int imm32 = pos - (current + sizeof(int32_t));
404
- long_at_put(current, imm32);
405
- current = next;
406
- next = long_at(next);
407
- }
408
- // Fix up last fixup on linked list.
409
- int last_imm32 = pos - (current + sizeof(int32_t));
410
- long_at_put(current, last_imm32);
411
- }
412
- L->bind_to(pos);
413
- }
414
-
415
-
416
- void Assembler::bind(Label* L) {
417
- bind_to(L, pc_offset());
418
- }
419
-
420
-
421
- void Assembler::GrowBuffer() {
422
- ASSERT(buffer_overflow());
423
- if (!own_buffer_) FATAL("external code buffer is too small");
424
-
425
- // Compute new buffer size.
426
- CodeDesc desc; // the new buffer
427
- if (buffer_size_ < 4*KB) {
428
- desc.buffer_size = 4*KB;
429
- } else {
430
- desc.buffer_size = 2*buffer_size_;
431
- }
432
- // Some internal data structures overflow for very large buffers,
433
- // they must ensure that kMaximalBufferSize is not too large.
434
- if ((desc.buffer_size > kMaximalBufferSize) ||
435
- (desc.buffer_size > Heap::MaxOldGenerationSize())) {
436
- V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
437
- }
438
-
439
- // Setup new buffer.
440
- desc.buffer = NewArray<byte>(desc.buffer_size);
441
- desc.instr_size = pc_offset();
442
- desc.reloc_size =
443
- static_cast<int>((buffer_ + buffer_size_) - (reloc_info_writer.pos()));
444
-
445
- // Clear the buffer in debug mode. Use 'int3' instructions to make
446
- // sure to get into problems if we ever run uninitialized code.
447
- #ifdef DEBUG
448
- memset(desc.buffer, 0xCC, desc.buffer_size);
449
- #endif
450
-
451
- // Copy the data.
452
- intptr_t pc_delta = desc.buffer - buffer_;
453
- intptr_t rc_delta = (desc.buffer + desc.buffer_size) -
454
- (buffer_ + buffer_size_);
455
- memmove(desc.buffer, buffer_, desc.instr_size);
456
- memmove(rc_delta + reloc_info_writer.pos(),
457
- reloc_info_writer.pos(), desc.reloc_size);
458
-
459
- // Switch buffers.
460
- if (spare_buffer_ == NULL && buffer_size_ == kMinimalBufferSize) {
461
- spare_buffer_ = buffer_;
462
- } else {
463
- DeleteArray(buffer_);
464
- }
465
- buffer_ = desc.buffer;
466
- buffer_size_ = desc.buffer_size;
467
- pc_ += pc_delta;
468
- if (last_pc_ != NULL) {
469
- last_pc_ += pc_delta;
470
- }
471
- reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
472
- reloc_info_writer.last_pc() + pc_delta);
473
-
474
- // Relocate runtime entries.
475
- for (RelocIterator it(desc); !it.done(); it.next()) {
476
- RelocInfo::Mode rmode = it.rinfo()->rmode();
477
- if (rmode == RelocInfo::INTERNAL_REFERENCE) {
478
- intptr_t* p = reinterpret_cast<intptr_t*>(it.rinfo()->pc());
479
- if (*p != 0) { // 0 means uninitialized.
480
- *p += pc_delta;
481
- }
482
- }
483
- }
484
-
485
- ASSERT(!buffer_overflow());
486
- }
487
-
488
-
489
- void Assembler::emit_operand(int code, const Operand& adr) {
490
- ASSERT(is_uint3(code));
491
- const unsigned length = adr.len_;
492
- ASSERT(length > 0);
493
-
494
- // Emit updated ModR/M byte containing the given register.
495
- ASSERT((adr.buf_[0] & 0x38) == 0);
496
- pc_[0] = adr.buf_[0] | code << 3;
497
-
498
- // Emit the rest of the encoded operand.
499
- for (unsigned i = 1; i < length; i++) pc_[i] = adr.buf_[i];
500
- pc_ += length;
501
- }
502
-
503
-
504
- // Assembler Instruction implementations.
505
-
506
- void Assembler::arithmetic_op(byte opcode, Register reg, const Operand& op) {
507
- EnsureSpace ensure_space(this);
508
- last_pc_ = pc_;
509
- emit_rex_64(reg, op);
510
- emit(opcode);
511
- emit_operand(reg, op);
512
- }
513
-
514
-
515
- void Assembler::arithmetic_op(byte opcode, Register reg, Register rm_reg) {
516
- EnsureSpace ensure_space(this);
517
- last_pc_ = pc_;
518
- ASSERT((opcode & 0xC6) == 2);
519
- if (rm_reg.low_bits() == 4) { // Forces SIB byte.
520
- // Swap reg and rm_reg and change opcode operand order.
521
- emit_rex_64(rm_reg, reg);
522
- emit(opcode ^ 0x02);
523
- emit_modrm(rm_reg, reg);
524
- } else {
525
- emit_rex_64(reg, rm_reg);
526
- emit(opcode);
527
- emit_modrm(reg, rm_reg);
528
- }
529
- }
530
-
531
-
532
- void Assembler::arithmetic_op_16(byte opcode, Register reg, Register rm_reg) {
533
- EnsureSpace ensure_space(this);
534
- last_pc_ = pc_;
535
- ASSERT((opcode & 0xC6) == 2);
536
- if (rm_reg.low_bits() == 4) { // Forces SIB byte.
537
- // Swap reg and rm_reg and change opcode operand order.
538
- emit(0x66);
539
- emit_optional_rex_32(rm_reg, reg);
540
- emit(opcode ^ 0x02);
541
- emit_modrm(rm_reg, reg);
542
- } else {
543
- emit(0x66);
544
- emit_optional_rex_32(reg, rm_reg);
545
- emit(opcode);
546
- emit_modrm(reg, rm_reg);
547
- }
548
- }
549
-
550
-
551
- void Assembler::arithmetic_op_16(byte opcode,
552
- Register reg,
553
- const Operand& rm_reg) {
554
- EnsureSpace ensure_space(this);
555
- last_pc_ = pc_;
556
- emit(0x66);
557
- emit_optional_rex_32(reg, rm_reg);
558
- emit(opcode);
559
- emit_operand(reg, rm_reg);
560
- }
561
-
562
-
563
- void Assembler::arithmetic_op_32(byte opcode, Register reg, Register rm_reg) {
564
- EnsureSpace ensure_space(this);
565
- last_pc_ = pc_;
566
- ASSERT((opcode & 0xC6) == 2);
567
- if (rm_reg.low_bits() == 4) { // Forces SIB byte.
568
- // Swap reg and rm_reg and change opcode operand order.
569
- emit_optional_rex_32(rm_reg, reg);
570
- emit(opcode ^ 0x02); // E.g. 0x03 -> 0x01 for ADD.
571
- emit_modrm(rm_reg, reg);
572
- } else {
573
- emit_optional_rex_32(reg, rm_reg);
574
- emit(opcode);
575
- emit_modrm(reg, rm_reg);
576
- }
577
- }
578
-
579
-
580
- void Assembler::arithmetic_op_32(byte opcode,
581
- Register reg,
582
- const Operand& rm_reg) {
583
- EnsureSpace ensure_space(this);
584
- last_pc_ = pc_;
585
- emit_optional_rex_32(reg, rm_reg);
586
- emit(opcode);
587
- emit_operand(reg, rm_reg);
588
- }
589
-
590
-
591
- void Assembler::immediate_arithmetic_op(byte subcode,
592
- Register dst,
593
- Immediate src) {
594
- EnsureSpace ensure_space(this);
595
- last_pc_ = pc_;
596
- emit_rex_64(dst);
597
- if (is_int8(src.value_)) {
598
- emit(0x83);
599
- emit_modrm(subcode, dst);
600
- emit(src.value_);
601
- } else if (dst.is(rax)) {
602
- emit(0x05 | (subcode << 3));
603
- emitl(src.value_);
604
- } else {
605
- emit(0x81);
606
- emit_modrm(subcode, dst);
607
- emitl(src.value_);
608
- }
609
- }
610
-
611
- void Assembler::immediate_arithmetic_op(byte subcode,
612
- const Operand& dst,
613
- Immediate src) {
614
- EnsureSpace ensure_space(this);
615
- last_pc_ = pc_;
616
- emit_rex_64(dst);
617
- if (is_int8(src.value_)) {
618
- emit(0x83);
619
- emit_operand(subcode, dst);
620
- emit(src.value_);
621
- } else {
622
- emit(0x81);
623
- emit_operand(subcode, dst);
624
- emitl(src.value_);
625
- }
626
- }
627
-
628
-
629
- void Assembler::immediate_arithmetic_op_16(byte subcode,
630
- Register dst,
631
- Immediate src) {
632
- EnsureSpace ensure_space(this);
633
- last_pc_ = pc_;
634
- emit(0x66); // Operand size override prefix.
635
- emit_optional_rex_32(dst);
636
- if (is_int8(src.value_)) {
637
- emit(0x83);
638
- emit_modrm(subcode, dst);
639
- emit(src.value_);
640
- } else if (dst.is(rax)) {
641
- emit(0x05 | (subcode << 3));
642
- emitw(src.value_);
643
- } else {
644
- emit(0x81);
645
- emit_modrm(subcode, dst);
646
- emitw(src.value_);
647
- }
648
- }
649
-
650
-
651
- void Assembler::immediate_arithmetic_op_16(byte subcode,
652
- const Operand& dst,
653
- Immediate src) {
654
- EnsureSpace ensure_space(this);
655
- last_pc_ = pc_;
656
- emit(0x66); // Operand size override prefix.
657
- emit_optional_rex_32(dst);
658
- if (is_int8(src.value_)) {
659
- emit(0x83);
660
- emit_operand(subcode, dst);
661
- emit(src.value_);
662
- } else {
663
- emit(0x81);
664
- emit_operand(subcode, dst);
665
- emitw(src.value_);
666
- }
667
- }
668
-
669
-
670
- void Assembler::immediate_arithmetic_op_32(byte subcode,
671
- Register dst,
672
- Immediate src) {
673
- EnsureSpace ensure_space(this);
674
- last_pc_ = pc_;
675
- emit_optional_rex_32(dst);
676
- if (is_int8(src.value_)) {
677
- emit(0x83);
678
- emit_modrm(subcode, dst);
679
- emit(src.value_);
680
- } else if (dst.is(rax)) {
681
- emit(0x05 | (subcode << 3));
682
- emitl(src.value_);
683
- } else {
684
- emit(0x81);
685
- emit_modrm(subcode, dst);
686
- emitl(src.value_);
687
- }
688
- }
689
-
690
-
691
- void Assembler::immediate_arithmetic_op_32(byte subcode,
692
- const Operand& dst,
693
- Immediate src) {
694
- EnsureSpace ensure_space(this);
695
- last_pc_ = pc_;
696
- emit_optional_rex_32(dst);
697
- if (is_int8(src.value_)) {
698
- emit(0x83);
699
- emit_operand(subcode, dst);
700
- emit(src.value_);
701
- } else {
702
- emit(0x81);
703
- emit_operand(subcode, dst);
704
- emitl(src.value_);
705
- }
706
- }
707
-
708
-
709
- void Assembler::immediate_arithmetic_op_8(byte subcode,
710
- const Operand& dst,
711
- Immediate src) {
712
- EnsureSpace ensure_space(this);
713
- last_pc_ = pc_;
714
- emit_optional_rex_32(dst);
715
- ASSERT(is_int8(src.value_) || is_uint8(src.value_));
716
- emit(0x80);
717
- emit_operand(subcode, dst);
718
- emit(src.value_);
719
- }
720
-
721
-
722
- void Assembler::immediate_arithmetic_op_8(byte subcode,
723
- Register dst,
724
- Immediate src) {
725
- EnsureSpace ensure_space(this);
726
- last_pc_ = pc_;
727
- if (dst.code() > 3) {
728
- // Use 64-bit mode byte registers.
729
- emit_rex_64(dst);
730
- }
731
- ASSERT(is_int8(src.value_) || is_uint8(src.value_));
732
- emit(0x80);
733
- emit_modrm(subcode, dst);
734
- emit(src.value_);
735
- }
736
-
737
-
738
- void Assembler::shift(Register dst, Immediate shift_amount, int subcode) {
739
- EnsureSpace ensure_space(this);
740
- last_pc_ = pc_;
741
- ASSERT(is_uint6(shift_amount.value_)); // illegal shift count
742
- if (shift_amount.value_ == 1) {
743
- emit_rex_64(dst);
744
- emit(0xD1);
745
- emit_modrm(subcode, dst);
746
- } else {
747
- emit_rex_64(dst);
748
- emit(0xC1);
749
- emit_modrm(subcode, dst);
750
- emit(shift_amount.value_);
751
- }
752
- }
753
-
754
-
755
- void Assembler::shift(Register dst, int subcode) {
756
- EnsureSpace ensure_space(this);
757
- last_pc_ = pc_;
758
- emit_rex_64(dst);
759
- emit(0xD3);
760
- emit_modrm(subcode, dst);
761
- }
762
-
763
-
764
- void Assembler::shift_32(Register dst, int subcode) {
765
- EnsureSpace ensure_space(this);
766
- last_pc_ = pc_;
767
- emit_optional_rex_32(dst);
768
- emit(0xD3);
769
- emit_modrm(subcode, dst);
770
- }
771
-
772
-
773
- void Assembler::shift_32(Register dst, Immediate shift_amount, int subcode) {
774
- EnsureSpace ensure_space(this);
775
- last_pc_ = pc_;
776
- ASSERT(is_uint5(shift_amount.value_)); // illegal shift count
777
- if (shift_amount.value_ == 1) {
778
- emit_optional_rex_32(dst);
779
- emit(0xD1);
780
- emit_modrm(subcode, dst);
781
- } else {
782
- emit_optional_rex_32(dst);
783
- emit(0xC1);
784
- emit_modrm(subcode, dst);
785
- emit(shift_amount.value_);
786
- }
787
- }
788
-
789
-
790
- void Assembler::bt(const Operand& dst, Register src) {
791
- EnsureSpace ensure_space(this);
792
- last_pc_ = pc_;
793
- emit_rex_64(src, dst);
794
- emit(0x0F);
795
- emit(0xA3);
796
- emit_operand(src, dst);
797
- }
798
-
799
-
800
- void Assembler::bts(const Operand& dst, Register src) {
801
- EnsureSpace ensure_space(this);
802
- last_pc_ = pc_;
803
- emit_rex_64(src, dst);
804
- emit(0x0F);
805
- emit(0xAB);
806
- emit_operand(src, dst);
807
- }
808
-
809
-
810
- void Assembler::call(Label* L) {
811
- EnsureSpace ensure_space(this);
812
- last_pc_ = pc_;
813
- // 1110 1000 #32-bit disp.
814
- emit(0xE8);
815
- if (L->is_bound()) {
816
- int offset = L->pos() - pc_offset() - sizeof(int32_t);
817
- ASSERT(offset <= 0);
818
- emitl(offset);
819
- } else if (L->is_linked()) {
820
- emitl(L->pos());
821
- L->link_to(pc_offset() - sizeof(int32_t));
822
- } else {
823
- ASSERT(L->is_unused());
824
- int32_t current = pc_offset();
825
- emitl(current);
826
- L->link_to(current);
827
- }
828
- }
829
-
830
-
831
- void Assembler::call(Handle<Code> target, RelocInfo::Mode rmode) {
832
- EnsureSpace ensure_space(this);
833
- last_pc_ = pc_;
834
- // 1110 1000 #32-bit disp.
835
- emit(0xE8);
836
- emit_code_target(target, rmode);
837
- }
838
-
839
-
840
- void Assembler::call(Register adr) {
841
- EnsureSpace ensure_space(this);
842
- last_pc_ = pc_;
843
- // Opcode: FF /2 r64.
844
- emit_optional_rex_32(adr);
845
- emit(0xFF);
846
- emit_modrm(0x2, adr);
847
- }
848
-
849
-
850
- void Assembler::call(const Operand& op) {
851
- EnsureSpace ensure_space(this);
852
- last_pc_ = pc_;
853
- // Opcode: FF /2 m64.
854
- emit_optional_rex_32(op);
855
- emit(0xFF);
856
- emit_operand(0x2, op);
857
- }
858
-
859
-
860
- void Assembler::clc() {
861
- EnsureSpace ensure_space(this);
862
- last_pc_ = pc_;
863
- emit(0xF8);
864
- }
865
-
866
- void Assembler::cdq() {
867
- EnsureSpace ensure_space(this);
868
- last_pc_ = pc_;
869
- emit(0x99);
870
- }
871
-
872
-
873
- void Assembler::cmovq(Condition cc, Register dst, Register src) {
874
- if (cc == always) {
875
- movq(dst, src);
876
- } else if (cc == never) {
877
- return;
878
- }
879
- // No need to check CpuInfo for CMOV support, it's a required part of the
880
- // 64-bit architecture.
881
- ASSERT(cc >= 0); // Use mov for unconditional moves.
882
- EnsureSpace ensure_space(this);
883
- last_pc_ = pc_;
884
- // Opcode: REX.W 0f 40 + cc /r.
885
- emit_rex_64(dst, src);
886
- emit(0x0f);
887
- emit(0x40 + cc);
888
- emit_modrm(dst, src);
889
- }
890
-
891
-
892
- void Assembler::cmovq(Condition cc, Register dst, const Operand& src) {
893
- if (cc == always) {
894
- movq(dst, src);
895
- } else if (cc == never) {
896
- return;
897
- }
898
- ASSERT(cc >= 0);
899
- EnsureSpace ensure_space(this);
900
- last_pc_ = pc_;
901
- // Opcode: REX.W 0f 40 + cc /r.
902
- emit_rex_64(dst, src);
903
- emit(0x0f);
904
- emit(0x40 + cc);
905
- emit_operand(dst, src);
906
- }
907
-
908
-
909
- void Assembler::cmovl(Condition cc, Register dst, Register src) {
910
- if (cc == always) {
911
- movl(dst, src);
912
- } else if (cc == never) {
913
- return;
914
- }
915
- ASSERT(cc >= 0);
916
- EnsureSpace ensure_space(this);
917
- last_pc_ = pc_;
918
- // Opcode: 0f 40 + cc /r.
919
- emit_optional_rex_32(dst, src);
920
- emit(0x0f);
921
- emit(0x40 + cc);
922
- emit_modrm(dst, src);
923
- }
924
-
925
-
926
- void Assembler::cmovl(Condition cc, Register dst, const Operand& src) {
927
- if (cc == always) {
928
- movl(dst, src);
929
- } else if (cc == never) {
930
- return;
931
- }
932
- ASSERT(cc >= 0);
933
- EnsureSpace ensure_space(this);
934
- last_pc_ = pc_;
935
- // Opcode: 0f 40 + cc /r.
936
- emit_optional_rex_32(dst, src);
937
- emit(0x0f);
938
- emit(0x40 + cc);
939
- emit_operand(dst, src);
940
- }
941
-
942
-
943
- void Assembler::cmpb_al(Immediate imm8) {
944
- ASSERT(is_int8(imm8.value_) || is_uint8(imm8.value_));
945
- EnsureSpace ensure_space(this);
946
- last_pc_ = pc_;
947
- emit(0x3c);
948
- emit(imm8.value_);
949
- }
950
-
951
-
952
- void Assembler::cpuid() {
953
- ASSERT(CpuFeatures::IsEnabled(CPUID));
954
- EnsureSpace ensure_space(this);
955
- last_pc_ = pc_;
956
- emit(0x0F);
957
- emit(0xA2);
958
- }
959
-
960
-
961
- void Assembler::cqo() {
962
- EnsureSpace ensure_space(this);
963
- last_pc_ = pc_;
964
- emit_rex_64();
965
- emit(0x99);
966
- }
967
-
968
-
969
- void Assembler::decq(Register dst) {
970
- EnsureSpace ensure_space(this);
971
- last_pc_ = pc_;
972
- emit_rex_64(dst);
973
- emit(0xFF);
974
- emit_modrm(0x1, dst);
975
- }
976
-
977
-
978
- void Assembler::decq(const Operand& dst) {
979
- EnsureSpace ensure_space(this);
980
- last_pc_ = pc_;
981
- emit_rex_64(dst);
982
- emit(0xFF);
983
- emit_operand(1, dst);
984
- }
985
-
986
-
987
- void Assembler::decl(Register dst) {
988
- EnsureSpace ensure_space(this);
989
- last_pc_ = pc_;
990
- emit_optional_rex_32(dst);
991
- emit(0xFF);
992
- emit_modrm(0x1, dst);
993
- }
994
-
995
-
996
- void Assembler::decl(const Operand& dst) {
997
- EnsureSpace ensure_space(this);
998
- last_pc_ = pc_;
999
- emit_optional_rex_32(dst);
1000
- emit(0xFF);
1001
- emit_operand(1, dst);
1002
- }
1003
-
1004
-
1005
- void Assembler::decb(Register dst) {
1006
- EnsureSpace ensure_space(this);
1007
- last_pc_ = pc_;
1008
- if (dst.code() > 3) {
1009
- // Register is not one of al, bl, cl, dl. Its encoding needs REX.
1010
- emit_rex_32(dst);
1011
- }
1012
- emit(0xFE);
1013
- emit_modrm(0x1, dst);
1014
- }
1015
-
1016
-
1017
- void Assembler::decb(const Operand& dst) {
1018
- EnsureSpace ensure_space(this);
1019
- last_pc_ = pc_;
1020
- emit_optional_rex_32(dst);
1021
- emit(0xFE);
1022
- emit_operand(1, dst);
1023
- }
1024
-
1025
-
1026
- void Assembler::enter(Immediate size) {
1027
- EnsureSpace ensure_space(this);
1028
- last_pc_ = pc_;
1029
- emit(0xC8);
1030
- emitw(size.value_); // 16 bit operand, always.
1031
- emit(0);
1032
- }
1033
-
1034
-
1035
- void Assembler::hlt() {
1036
- EnsureSpace ensure_space(this);
1037
- last_pc_ = pc_;
1038
- emit(0xF4);
1039
- }
1040
-
1041
-
1042
- void Assembler::idivq(Register src) {
1043
- EnsureSpace ensure_space(this);
1044
- last_pc_ = pc_;
1045
- emit_rex_64(src);
1046
- emit(0xF7);
1047
- emit_modrm(0x7, src);
1048
- }
1049
-
1050
-
1051
- void Assembler::idivl(Register src) {
1052
- EnsureSpace ensure_space(this);
1053
- last_pc_ = pc_;
1054
- emit_optional_rex_32(src);
1055
- emit(0xF7);
1056
- emit_modrm(0x7, src);
1057
- }
1058
-
1059
-
1060
- void Assembler::imul(Register src) {
1061
- EnsureSpace ensure_space(this);
1062
- last_pc_ = pc_;
1063
- emit_rex_64(src);
1064
- emit(0xF7);
1065
- emit_modrm(0x5, src);
1066
- }
1067
-
1068
-
1069
- void Assembler::imul(Register dst, Register src) {
1070
- EnsureSpace ensure_space(this);
1071
- last_pc_ = pc_;
1072
- emit_rex_64(dst, src);
1073
- emit(0x0F);
1074
- emit(0xAF);
1075
- emit_modrm(dst, src);
1076
- }
1077
-
1078
-
1079
- void Assembler::imul(Register dst, const Operand& src) {
1080
- EnsureSpace ensure_space(this);
1081
- last_pc_ = pc_;
1082
- emit_rex_64(dst, src);
1083
- emit(0x0F);
1084
- emit(0xAF);
1085
- emit_operand(dst, src);
1086
- }
1087
-
1088
-
1089
- void Assembler::imul(Register dst, Register src, Immediate imm) {
1090
- EnsureSpace ensure_space(this);
1091
- last_pc_ = pc_;
1092
- emit_rex_64(dst, src);
1093
- if (is_int8(imm.value_)) {
1094
- emit(0x6B);
1095
- emit_modrm(dst, src);
1096
- emit(imm.value_);
1097
- } else {
1098
- emit(0x69);
1099
- emit_modrm(dst, src);
1100
- emitl(imm.value_);
1101
- }
1102
- }
1103
-
1104
-
1105
- void Assembler::imull(Register dst, Register src) {
1106
- EnsureSpace ensure_space(this);
1107
- last_pc_ = pc_;
1108
- emit_optional_rex_32(dst, src);
1109
- emit(0x0F);
1110
- emit(0xAF);
1111
- emit_modrm(dst, src);
1112
- }
1113
-
1114
-
1115
- void Assembler::imull(Register dst, Register src, Immediate imm) {
1116
- EnsureSpace ensure_space(this);
1117
- last_pc_ = pc_;
1118
- emit_optional_rex_32(dst, src);
1119
- if (is_int8(imm.value_)) {
1120
- emit(0x6B);
1121
- emit_modrm(dst, src);
1122
- emit(imm.value_);
1123
- } else {
1124
- emit(0x69);
1125
- emit_modrm(dst, src);
1126
- emitl(imm.value_);
1127
- }
1128
- }
1129
-
1130
-
1131
- void Assembler::incq(Register dst) {
1132
- EnsureSpace ensure_space(this);
1133
- last_pc_ = pc_;
1134
- emit_rex_64(dst);
1135
- emit(0xFF);
1136
- emit_modrm(0x0, dst);
1137
- }
1138
-
1139
-
1140
- void Assembler::incq(const Operand& dst) {
1141
- EnsureSpace ensure_space(this);
1142
- last_pc_ = pc_;
1143
- emit_rex_64(dst);
1144
- emit(0xFF);
1145
- emit_operand(0, dst);
1146
- }
1147
-
1148
-
1149
- void Assembler::incl(const Operand& dst) {
1150
- EnsureSpace ensure_space(this);
1151
- last_pc_ = pc_;
1152
- emit_optional_rex_32(dst);
1153
- emit(0xFF);
1154
- emit_operand(0, dst);
1155
- }
1156
-
1157
-
1158
- void Assembler::incl(Register dst) {
1159
- EnsureSpace ensure_space(this);
1160
- last_pc_ = pc_;
1161
- emit_optional_rex_32(dst);
1162
- emit(0xFF);
1163
- emit_modrm(0, dst);
1164
- }
1165
-
1166
-
1167
- void Assembler::int3() {
1168
- EnsureSpace ensure_space(this);
1169
- last_pc_ = pc_;
1170
- emit(0xCC);
1171
- }
1172
-
1173
-
1174
- void Assembler::j(Condition cc, Label* L) {
1175
- if (cc == always) {
1176
- jmp(L);
1177
- return;
1178
- } else if (cc == never) {
1179
- return;
1180
- }
1181
- EnsureSpace ensure_space(this);
1182
- last_pc_ = pc_;
1183
- ASSERT(is_uint4(cc));
1184
- if (L->is_bound()) {
1185
- const int short_size = 2;
1186
- const int long_size = 6;
1187
- int offs = L->pos() - pc_offset();
1188
- ASSERT(offs <= 0);
1189
- if (is_int8(offs - short_size)) {
1190
- // 0111 tttn #8-bit disp.
1191
- emit(0x70 | cc);
1192
- emit((offs - short_size) & 0xFF);
1193
- } else {
1194
- // 0000 1111 1000 tttn #32-bit disp.
1195
- emit(0x0F);
1196
- emit(0x80 | cc);
1197
- emitl(offs - long_size);
1198
- }
1199
- } else if (L->is_linked()) {
1200
- // 0000 1111 1000 tttn #32-bit disp.
1201
- emit(0x0F);
1202
- emit(0x80 | cc);
1203
- emitl(L->pos());
1204
- L->link_to(pc_offset() - sizeof(int32_t));
1205
- } else {
1206
- ASSERT(L->is_unused());
1207
- emit(0x0F);
1208
- emit(0x80 | cc);
1209
- int32_t current = pc_offset();
1210
- emitl(current);
1211
- L->link_to(current);
1212
- }
1213
- }
1214
-
1215
-
1216
- void Assembler::j(Condition cc,
1217
- Handle<Code> target,
1218
- RelocInfo::Mode rmode) {
1219
- EnsureSpace ensure_space(this);
1220
- last_pc_ = pc_;
1221
- ASSERT(is_uint4(cc));
1222
- // 0000 1111 1000 tttn #32-bit disp.
1223
- emit(0x0F);
1224
- emit(0x80 | cc);
1225
- emit_code_target(target, rmode);
1226
- }
1227
-
1228
-
1229
- void Assembler::jmp(Label* L) {
1230
- EnsureSpace ensure_space(this);
1231
- last_pc_ = pc_;
1232
- const int short_size = sizeof(int8_t);
1233
- const int long_size = sizeof(int32_t);
1234
- if (L->is_bound()) {
1235
- int offs = L->pos() - pc_offset() - 1;
1236
- ASSERT(offs <= 0);
1237
- if (is_int8(offs - short_size)) {
1238
- // 1110 1011 #8-bit disp.
1239
- emit(0xEB);
1240
- emit((offs - short_size) & 0xFF);
1241
- } else {
1242
- // 1110 1001 #32-bit disp.
1243
- emit(0xE9);
1244
- emitl(offs - long_size);
1245
- }
1246
- } else if (L->is_linked()) {
1247
- // 1110 1001 #32-bit disp.
1248
- emit(0xE9);
1249
- emitl(L->pos());
1250
- L->link_to(pc_offset() - long_size);
1251
- } else {
1252
- // 1110 1001 #32-bit disp.
1253
- ASSERT(L->is_unused());
1254
- emit(0xE9);
1255
- int32_t current = pc_offset();
1256
- emitl(current);
1257
- L->link_to(current);
1258
- }
1259
- }
1260
-
1261
-
1262
- void Assembler::jmp(Handle<Code> target, RelocInfo::Mode rmode) {
1263
- EnsureSpace ensure_space(this);
1264
- last_pc_ = pc_;
1265
- // 1110 1001 #32-bit disp.
1266
- emit(0xE9);
1267
- emit_code_target(target, rmode);
1268
- }
1269
-
1270
-
1271
- void Assembler::jmp(Register target) {
1272
- EnsureSpace ensure_space(this);
1273
- last_pc_ = pc_;
1274
- // Opcode FF/4 r64.
1275
- emit_optional_rex_32(target);
1276
- emit(0xFF);
1277
- emit_modrm(0x4, target);
1278
- }
1279
-
1280
-
1281
- void Assembler::jmp(const Operand& src) {
1282
- EnsureSpace ensure_space(this);
1283
- last_pc_ = pc_;
1284
- // Opcode FF/4 m64.
1285
- emit_optional_rex_32(src);
1286
- emit(0xFF);
1287
- emit_operand(0x4, src);
1288
- }
1289
-
1290
-
1291
- void Assembler::lea(Register dst, const Operand& src) {
1292
- EnsureSpace ensure_space(this);
1293
- last_pc_ = pc_;
1294
- emit_rex_64(dst, src);
1295
- emit(0x8D);
1296
- emit_operand(dst, src);
1297
- }
1298
-
1299
-
1300
- void Assembler::leal(Register dst, const Operand& src) {
1301
- EnsureSpace ensure_space(this);
1302
- last_pc_ = pc_;
1303
- emit_optional_rex_32(dst, src);
1304
- emit(0x8D);
1305
- emit_operand(dst, src);
1306
- }
1307
-
1308
-
1309
- void Assembler::load_rax(void* value, RelocInfo::Mode mode) {
1310
- EnsureSpace ensure_space(this);
1311
- last_pc_ = pc_;
1312
- emit(0x48); // REX.W
1313
- emit(0xA1);
1314
- emitq(reinterpret_cast<uintptr_t>(value), mode);
1315
- }
1316
-
1317
-
1318
- void Assembler::load_rax(ExternalReference ref) {
1319
- load_rax(ref.address(), RelocInfo::EXTERNAL_REFERENCE);
1320
- }
1321
-
1322
-
1323
- void Assembler::leave() {
1324
- EnsureSpace ensure_space(this);
1325
- last_pc_ = pc_;
1326
- emit(0xC9);
1327
- }
1328
-
1329
-
1330
- void Assembler::movb(Register dst, const Operand& src) {
1331
- EnsureSpace ensure_space(this);
1332
- last_pc_ = pc_;
1333
- emit_rex_32(dst, src);
1334
- emit(0x8A);
1335
- emit_operand(dst, src);
1336
- }
1337
-
1338
-
1339
- void Assembler::movb(Register dst, Immediate imm) {
1340
- EnsureSpace ensure_space(this);
1341
- last_pc_ = pc_;
1342
- emit_rex_32(dst);
1343
- emit(0xC6);
1344
- emit_modrm(0x0, dst);
1345
- emit(imm.value_);
1346
- }
1347
-
1348
-
1349
- void Assembler::movb(const Operand& dst, Register src) {
1350
- EnsureSpace ensure_space(this);
1351
- last_pc_ = pc_;
1352
- emit_rex_32(src, dst);
1353
- emit(0x88);
1354
- emit_operand(src, dst);
1355
- }
1356
-
1357
-
1358
- void Assembler::movw(const Operand& dst, Register src) {
1359
- EnsureSpace ensure_space(this);
1360
- last_pc_ = pc_;
1361
- emit(0x66);
1362
- emit_optional_rex_32(src, dst);
1363
- emit(0x89);
1364
- emit_operand(src, dst);
1365
- }
1366
-
1367
-
1368
- void Assembler::movl(Register dst, const Operand& src) {
1369
- EnsureSpace ensure_space(this);
1370
- last_pc_ = pc_;
1371
- emit_optional_rex_32(dst, src);
1372
- emit(0x8B);
1373
- emit_operand(dst, src);
1374
- }
1375
-
1376
-
1377
- void Assembler::movl(Register dst, Register src) {
1378
- EnsureSpace ensure_space(this);
1379
- last_pc_ = pc_;
1380
- if (src.low_bits() == 4) {
1381
- emit_optional_rex_32(src, dst);
1382
- emit(0x89);
1383
- emit_modrm(src, dst);
1384
- } else {
1385
- emit_optional_rex_32(dst, src);
1386
- emit(0x8B);
1387
- emit_modrm(dst, src);
1388
- }
1389
- }
1390
-
1391
-
1392
- void Assembler::movl(const Operand& dst, Register src) {
1393
- EnsureSpace ensure_space(this);
1394
- last_pc_ = pc_;
1395
- emit_optional_rex_32(src, dst);
1396
- emit(0x89);
1397
- emit_operand(src, dst);
1398
- }
1399
-
1400
-
1401
- void Assembler::movl(const Operand& dst, Immediate value) {
1402
- EnsureSpace ensure_space(this);
1403
- last_pc_ = pc_;
1404
- emit_optional_rex_32(dst);
1405
- emit(0xC7);
1406
- emit_operand(0x0, dst);
1407
- emit(value); // Only 32-bit immediates are possible, not 8-bit immediates.
1408
- }
1409
-
1410
-
1411
- void Assembler::movl(Register dst, Immediate value) {
1412
- EnsureSpace ensure_space(this);
1413
- last_pc_ = pc_;
1414
- emit_optional_rex_32(dst);
1415
- emit(0xC7);
1416
- emit_modrm(0x0, dst);
1417
- emit(value); // Only 32-bit immediates are possible, not 8-bit immediates.
1418
- }
1419
-
1420
-
1421
- void Assembler::movq(Register dst, const Operand& src) {
1422
- EnsureSpace ensure_space(this);
1423
- last_pc_ = pc_;
1424
- emit_rex_64(dst, src);
1425
- emit(0x8B);
1426
- emit_operand(dst, src);
1427
- }
1428
-
1429
-
1430
- void Assembler::movq(Register dst, Register src) {
1431
- EnsureSpace ensure_space(this);
1432
- last_pc_ = pc_;
1433
- if (src.low_bits() == 4) {
1434
- emit_rex_64(src, dst);
1435
- emit(0x89);
1436
- emit_modrm(src, dst);
1437
- } else {
1438
- emit_rex_64(dst, src);
1439
- emit(0x8B);
1440
- emit_modrm(dst, src);
1441
- }
1442
- }
1443
-
1444
-
1445
- void Assembler::movq(Register dst, Immediate value) {
1446
- EnsureSpace ensure_space(this);
1447
- last_pc_ = pc_;
1448
- emit_rex_64(dst);
1449
- emit(0xC7);
1450
- emit_modrm(0x0, dst);
1451
- emit(value); // Only 32-bit immediates are possible, not 8-bit immediates.
1452
- }
1453
-
1454
-
1455
- void Assembler::movq(const Operand& dst, Register src) {
1456
- EnsureSpace ensure_space(this);
1457
- last_pc_ = pc_;
1458
- emit_rex_64(src, dst);
1459
- emit(0x89);
1460
- emit_operand(src, dst);
1461
- }
1462
-
1463
-
1464
- void Assembler::movq(Register dst, void* value, RelocInfo::Mode rmode) {
1465
- // This method must not be used with heap object references. The stored
1466
- // address is not GC safe. Use the handle version instead.
1467
- ASSERT(rmode > RelocInfo::LAST_GCED_ENUM);
1468
- EnsureSpace ensure_space(this);
1469
- last_pc_ = pc_;
1470
- emit_rex_64(dst);
1471
- emit(0xB8 | dst.low_bits());
1472
- emitq(reinterpret_cast<uintptr_t>(value), rmode);
1473
- }
1474
-
1475
-
1476
- void Assembler::movq(Register dst, int64_t value, RelocInfo::Mode rmode) {
1477
- // Non-relocatable values might not need a 64-bit representation.
1478
- if (rmode == RelocInfo::NONE) {
1479
- // Sadly, there is no zero or sign extending move for 8-bit immediates.
1480
- if (is_int32(value)) {
1481
- movq(dst, Immediate(static_cast<int32_t>(value)));
1482
- return;
1483
- } else if (is_uint32(value)) {
1484
- movl(dst, Immediate(static_cast<int32_t>(value)));
1485
- return;
1486
- }
1487
- // Value cannot be represented by 32 bits, so do a full 64 bit immediate
1488
- // value.
1489
- }
1490
- EnsureSpace ensure_space(this);
1491
- last_pc_ = pc_;
1492
- emit_rex_64(dst);
1493
- emit(0xB8 | dst.low_bits());
1494
- emitq(value, rmode);
1495
- }
1496
-
1497
-
1498
- void Assembler::movq(Register dst, ExternalReference ref) {
1499
- EnsureSpace ensure_space(this);
1500
- last_pc_ = pc_;
1501
- emit_rex_64(dst);
1502
- emit(0xB8 | dst.low_bits());
1503
- emitq(reinterpret_cast<uintptr_t>(ref.address()),
1504
- RelocInfo::EXTERNAL_REFERENCE);
1505
- }
1506
-
1507
-
1508
- void Assembler::movq(const Operand& dst, Immediate value) {
1509
- EnsureSpace ensure_space(this);
1510
- last_pc_ = pc_;
1511
- emit_rex_64(dst);
1512
- emit(0xC7);
1513
- emit_operand(0, dst);
1514
- emit(value);
1515
- }
1516
-
1517
-
1518
- // Loads the ip-relative location of the src label into the target location
1519
- // (as a 32-bit offset sign extended to 64-bit).
1520
- void Assembler::movl(const Operand& dst, Label* src) {
1521
- EnsureSpace ensure_space(this);
1522
- last_pc_ = pc_;
1523
- emit_optional_rex_32(dst);
1524
- emit(0xC7);
1525
- emit_operand(0, dst);
1526
- if (src->is_bound()) {
1527
- int offset = src->pos() - pc_offset() - sizeof(int32_t);
1528
- ASSERT(offset <= 0);
1529
- emitl(offset);
1530
- } else if (src->is_linked()) {
1531
- emitl(src->pos());
1532
- src->link_to(pc_offset() - sizeof(int32_t));
1533
- } else {
1534
- ASSERT(src->is_unused());
1535
- int32_t current = pc_offset();
1536
- emitl(current);
1537
- src->link_to(current);
1538
- }
1539
- }
1540
-
1541
-
1542
- void Assembler::movq(Register dst, Handle<Object> value, RelocInfo::Mode mode) {
1543
- // If there is no relocation info, emit the value of the handle efficiently
1544
- // (possibly using less that 8 bytes for the value).
1545
- if (mode == RelocInfo::NONE) {
1546
- // There is no possible reason to store a heap pointer without relocation
1547
- // info, so it must be a smi.
1548
- ASSERT(value->IsSmi());
1549
- movq(dst, reinterpret_cast<int64_t>(*value), RelocInfo::NONE);
1550
- } else {
1551
- EnsureSpace ensure_space(this);
1552
- last_pc_ = pc_;
1553
- ASSERT(value->IsHeapObject());
1554
- ASSERT(!Heap::InNewSpace(*value));
1555
- emit_rex_64(dst);
1556
- emit(0xB8 | dst.low_bits());
1557
- emitq(reinterpret_cast<uintptr_t>(value.location()), mode);
1558
- }
1559
- }
1560
-
1561
-
1562
- void Assembler::movsxbq(Register dst, const Operand& src) {
1563
- EnsureSpace ensure_space(this);
1564
- last_pc_ = pc_;
1565
- emit_rex_64(dst, src);
1566
- emit(0x0F);
1567
- emit(0xBE);
1568
- emit_operand(dst, src);
1569
- }
1570
-
1571
-
1572
- void Assembler::movsxwq(Register dst, const Operand& src) {
1573
- EnsureSpace ensure_space(this);
1574
- last_pc_ = pc_;
1575
- emit_rex_64(dst, src);
1576
- emit(0x0F);
1577
- emit(0xBF);
1578
- emit_operand(dst, src);
1579
- }
1580
-
1581
-
1582
- void Assembler::movsxlq(Register dst, Register src) {
1583
- EnsureSpace ensure_space(this);
1584
- last_pc_ = pc_;
1585
- emit_rex_64(dst, src);
1586
- emit(0x63);
1587
- emit_modrm(dst, src);
1588
- }
1589
-
1590
-
1591
- void Assembler::movsxlq(Register dst, const Operand& src) {
1592
- EnsureSpace ensure_space(this);
1593
- last_pc_ = pc_;
1594
- emit_rex_64(dst, src);
1595
- emit(0x63);
1596
- emit_operand(dst, src);
1597
- }
1598
-
1599
-
1600
- void Assembler::movzxbq(Register dst, const Operand& src) {
1601
- EnsureSpace ensure_space(this);
1602
- last_pc_ = pc_;
1603
- emit_optional_rex_32(dst, src);
1604
- emit(0x0F);
1605
- emit(0xB6);
1606
- emit_operand(dst, src);
1607
- }
1608
-
1609
-
1610
- void Assembler::movzxbl(Register dst, const Operand& src) {
1611
- EnsureSpace ensure_space(this);
1612
- last_pc_ = pc_;
1613
- emit_optional_rex_32(dst, src);
1614
- emit(0x0F);
1615
- emit(0xB6);
1616
- emit_operand(dst, src);
1617
- }
1618
-
1619
-
1620
- void Assembler::movzxwq(Register dst, const Operand& src) {
1621
- EnsureSpace ensure_space(this);
1622
- last_pc_ = pc_;
1623
- emit_optional_rex_32(dst, src);
1624
- emit(0x0F);
1625
- emit(0xB7);
1626
- emit_operand(dst, src);
1627
- }
1628
-
1629
-
1630
- void Assembler::movzxwl(Register dst, const Operand& src) {
1631
- EnsureSpace ensure_space(this);
1632
- last_pc_ = pc_;
1633
- emit_optional_rex_32(dst, src);
1634
- emit(0x0F);
1635
- emit(0xB7);
1636
- emit_operand(dst, src);
1637
- }
1638
-
1639
-
1640
- void Assembler::repmovsb() {
1641
- EnsureSpace ensure_space(this);
1642
- last_pc_ = pc_;
1643
- emit(0xF3);
1644
- emit(0xA4);
1645
- }
1646
-
1647
-
1648
- void Assembler::repmovsw() {
1649
- EnsureSpace ensure_space(this);
1650
- last_pc_ = pc_;
1651
- emit(0x66); // Operand size override.
1652
- emit(0xF3);
1653
- emit(0xA4);
1654
- }
1655
-
1656
-
1657
- void Assembler::repmovsl() {
1658
- EnsureSpace ensure_space(this);
1659
- last_pc_ = pc_;
1660
- emit(0xF3);
1661
- emit(0xA5);
1662
- }
1663
-
1664
-
1665
- void Assembler::repmovsq() {
1666
- EnsureSpace ensure_space(this);
1667
- last_pc_ = pc_;
1668
- emit(0xF3);
1669
- emit_rex_64();
1670
- emit(0xA5);
1671
- }
1672
-
1673
-
1674
- void Assembler::mul(Register src) {
1675
- EnsureSpace ensure_space(this);
1676
- last_pc_ = pc_;
1677
- emit_rex_64(src);
1678
- emit(0xF7);
1679
- emit_modrm(0x4, src);
1680
- }
1681
-
1682
-
1683
- void Assembler::neg(Register dst) {
1684
- EnsureSpace ensure_space(this);
1685
- last_pc_ = pc_;
1686
- emit_rex_64(dst);
1687
- emit(0xF7);
1688
- emit_modrm(0x3, dst);
1689
- }
1690
-
1691
-
1692
- void Assembler::negl(Register dst) {
1693
- EnsureSpace ensure_space(this);
1694
- last_pc_ = pc_;
1695
- emit_optional_rex_32(dst);
1696
- emit(0xF7);
1697
- emit_modrm(0x3, dst);
1698
- }
1699
-
1700
-
1701
- void Assembler::neg(const Operand& dst) {
1702
- EnsureSpace ensure_space(this);
1703
- last_pc_ = pc_;
1704
- emit_rex_64(dst);
1705
- emit(0xF7);
1706
- emit_operand(3, dst);
1707
- }
1708
-
1709
-
1710
- void Assembler::nop() {
1711
- EnsureSpace ensure_space(this);
1712
- last_pc_ = pc_;
1713
- emit(0x90);
1714
- }
1715
-
1716
-
1717
- void Assembler::not_(Register dst) {
1718
- EnsureSpace ensure_space(this);
1719
- last_pc_ = pc_;
1720
- emit_rex_64(dst);
1721
- emit(0xF7);
1722
- emit_modrm(0x2, dst);
1723
- }
1724
-
1725
-
1726
- void Assembler::not_(const Operand& dst) {
1727
- EnsureSpace ensure_space(this);
1728
- last_pc_ = pc_;
1729
- emit_rex_64(dst);
1730
- emit(0xF7);
1731
- emit_operand(2, dst);
1732
- }
1733
-
1734
-
1735
- void Assembler::notl(Register dst) {
1736
- EnsureSpace ensure_space(this);
1737
- last_pc_ = pc_;
1738
- emit_optional_rex_32(dst);
1739
- emit(0xF7);
1740
- emit_modrm(0x2, dst);
1741
- }
1742
-
1743
-
1744
- void Assembler::nop(int n) {
1745
- // The recommended muti-byte sequences of NOP instructions from the Intel 64
1746
- // and IA-32 Architectures Software Developer's Manual.
1747
- //
1748
- // Length Assembly Byte Sequence
1749
- // 2 bytes 66 NOP 66 90H
1750
- // 3 bytes NOP DWORD ptr [EAX] 0F 1F 00H
1751
- // 4 bytes NOP DWORD ptr [EAX + 00H] 0F 1F 40 00H
1752
- // 5 bytes NOP DWORD ptr [EAX + EAX*1 + 00H] 0F 1F 44 00 00H
1753
- // 6 bytes 66 NOP DWORD ptr [EAX + EAX*1 + 00H] 66 0F 1F 44 00 00H
1754
- // 7 bytes NOP DWORD ptr [EAX + 00000000H] 0F 1F 80 00 00 00 00H
1755
- // 8 bytes NOP DWORD ptr [EAX + EAX*1 + 00000000H] 0F 1F 84 00 00 00 00 00H
1756
- // 9 bytes 66 NOP DWORD ptr [EAX + EAX*1 + 66 0F 1F 84 00 00 00 00
1757
- // 00000000H] 00H
1758
-
1759
- ASSERT(1 <= n);
1760
- ASSERT(n <= 9);
1761
- EnsureSpace ensure_space(this);
1762
- last_pc_ = pc_;
1763
- switch (n) {
1764
- case 1:
1765
- emit(0x90);
1766
- return;
1767
- case 2:
1768
- emit(0x66);
1769
- emit(0x90);
1770
- return;
1771
- case 3:
1772
- emit(0x0f);
1773
- emit(0x1f);
1774
- emit(0x00);
1775
- return;
1776
- case 4:
1777
- emit(0x0f);
1778
- emit(0x1f);
1779
- emit(0x40);
1780
- emit(0x00);
1781
- return;
1782
- case 5:
1783
- emit(0x0f);
1784
- emit(0x1f);
1785
- emit(0x44);
1786
- emit(0x00);
1787
- emit(0x00);
1788
- return;
1789
- case 6:
1790
- emit(0x66);
1791
- emit(0x0f);
1792
- emit(0x1f);
1793
- emit(0x44);
1794
- emit(0x00);
1795
- emit(0x00);
1796
- return;
1797
- case 7:
1798
- emit(0x0f);
1799
- emit(0x1f);
1800
- emit(0x80);
1801
- emit(0x00);
1802
- emit(0x00);
1803
- emit(0x00);
1804
- emit(0x00);
1805
- return;
1806
- case 8:
1807
- emit(0x0f);
1808
- emit(0x1f);
1809
- emit(0x84);
1810
- emit(0x00);
1811
- emit(0x00);
1812
- emit(0x00);
1813
- emit(0x00);
1814
- emit(0x00);
1815
- return;
1816
- case 9:
1817
- emit(0x66);
1818
- emit(0x0f);
1819
- emit(0x1f);
1820
- emit(0x84);
1821
- emit(0x00);
1822
- emit(0x00);
1823
- emit(0x00);
1824
- emit(0x00);
1825
- emit(0x00);
1826
- return;
1827
- }
1828
- }
1829
-
1830
-
1831
- void Assembler::pop(Register dst) {
1832
- EnsureSpace ensure_space(this);
1833
- last_pc_ = pc_;
1834
- emit_optional_rex_32(dst);
1835
- emit(0x58 | dst.low_bits());
1836
- }
1837
-
1838
-
1839
- void Assembler::pop(const Operand& dst) {
1840
- EnsureSpace ensure_space(this);
1841
- last_pc_ = pc_;
1842
- emit_optional_rex_32(dst);
1843
- emit(0x8F);
1844
- emit_operand(0, dst);
1845
- }
1846
-
1847
-
1848
- void Assembler::popfq() {
1849
- EnsureSpace ensure_space(this);
1850
- last_pc_ = pc_;
1851
- emit(0x9D);
1852
- }
1853
-
1854
-
1855
- void Assembler::push(Register src) {
1856
- EnsureSpace ensure_space(this);
1857
- last_pc_ = pc_;
1858
- emit_optional_rex_32(src);
1859
- emit(0x50 | src.low_bits());
1860
- }
1861
-
1862
-
1863
- void Assembler::push(const Operand& src) {
1864
- EnsureSpace ensure_space(this);
1865
- last_pc_ = pc_;
1866
- emit_optional_rex_32(src);
1867
- emit(0xFF);
1868
- emit_operand(6, src);
1869
- }
1870
-
1871
-
1872
- void Assembler::push(Immediate value) {
1873
- EnsureSpace ensure_space(this);
1874
- last_pc_ = pc_;
1875
- if (is_int8(value.value_)) {
1876
- emit(0x6A);
1877
- emit(value.value_); // Emit low byte of value.
1878
- } else {
1879
- emit(0x68);
1880
- emitl(value.value_);
1881
- }
1882
- }
1883
-
1884
-
1885
- void Assembler::pushfq() {
1886
- EnsureSpace ensure_space(this);
1887
- last_pc_ = pc_;
1888
- emit(0x9C);
1889
- }
1890
-
1891
-
1892
- void Assembler::rdtsc() {
1893
- EnsureSpace ensure_space(this);
1894
- last_pc_ = pc_;
1895
- emit(0x0F);
1896
- emit(0x31);
1897
- }
1898
-
1899
-
1900
- void Assembler::ret(int imm16) {
1901
- EnsureSpace ensure_space(this);
1902
- last_pc_ = pc_;
1903
- ASSERT(is_uint16(imm16));
1904
- if (imm16 == 0) {
1905
- emit(0xC3);
1906
- } else {
1907
- emit(0xC2);
1908
- emit(imm16 & 0xFF);
1909
- emit((imm16 >> 8) & 0xFF);
1910
- }
1911
- }
1912
-
1913
-
1914
- void Assembler::setcc(Condition cc, Register reg) {
1915
- if (cc > last_condition) {
1916
- movb(reg, Immediate(cc == always ? 1 : 0));
1917
- return;
1918
- }
1919
- EnsureSpace ensure_space(this);
1920
- last_pc_ = pc_;
1921
- ASSERT(is_uint4(cc));
1922
- if (reg.code() > 3) { // Use x64 byte registers, where different.
1923
- emit_rex_32(reg);
1924
- }
1925
- emit(0x0F);
1926
- emit(0x90 | cc);
1927
- emit_modrm(0x0, reg);
1928
- }
1929
-
1930
-
1931
- void Assembler::shld(Register dst, Register src) {
1932
- EnsureSpace ensure_space(this);
1933
- last_pc_ = pc_;
1934
- emit_rex_64(src, dst);
1935
- emit(0x0F);
1936
- emit(0xA5);
1937
- emit_modrm(src, dst);
1938
- }
1939
-
1940
-
1941
- void Assembler::shrd(Register dst, Register src) {
1942
- EnsureSpace ensure_space(this);
1943
- last_pc_ = pc_;
1944
- emit_rex_64(src, dst);
1945
- emit(0x0F);
1946
- emit(0xAD);
1947
- emit_modrm(src, dst);
1948
- }
1949
-
1950
-
1951
- void Assembler::xchg(Register dst, Register src) {
1952
- EnsureSpace ensure_space(this);
1953
- last_pc_ = pc_;
1954
- if (src.is(rax) || dst.is(rax)) { // Single-byte encoding
1955
- Register other = src.is(rax) ? dst : src;
1956
- emit_rex_64(other);
1957
- emit(0x90 | other.low_bits());
1958
- } else if (dst.low_bits() == 4) {
1959
- emit_rex_64(dst, src);
1960
- emit(0x87);
1961
- emit_modrm(dst, src);
1962
- } else {
1963
- emit_rex_64(src, dst);
1964
- emit(0x87);
1965
- emit_modrm(src, dst);
1966
- }
1967
- }
1968
-
1969
-
1970
- void Assembler::store_rax(void* dst, RelocInfo::Mode mode) {
1971
- EnsureSpace ensure_space(this);
1972
- last_pc_ = pc_;
1973
- emit(0x48); // REX.W
1974
- emit(0xA3);
1975
- emitq(reinterpret_cast<uintptr_t>(dst), mode);
1976
- }
1977
-
1978
-
1979
- void Assembler::store_rax(ExternalReference ref) {
1980
- store_rax(ref.address(), RelocInfo::EXTERNAL_REFERENCE);
1981
- }
1982
-
1983
-
1984
- void Assembler::testb(Register dst, Register src) {
1985
- EnsureSpace ensure_space(this);
1986
- last_pc_ = pc_;
1987
- if (src.low_bits() == 4) {
1988
- emit_rex_32(src, dst);
1989
- emit(0x84);
1990
- emit_modrm(src, dst);
1991
- } else {
1992
- if (dst.code() > 3 || src.code() > 3) {
1993
- // Register is not one of al, bl, cl, dl. Its encoding needs REX.
1994
- emit_rex_32(dst, src);
1995
- }
1996
- emit(0x84);
1997
- emit_modrm(dst, src);
1998
- }
1999
- }
2000
-
2001
-
2002
- void Assembler::testb(Register reg, Immediate mask) {
2003
- ASSERT(is_int8(mask.value_) || is_uint8(mask.value_));
2004
- EnsureSpace ensure_space(this);
2005
- last_pc_ = pc_;
2006
- if (reg.is(rax)) {
2007
- emit(0xA8);
2008
- emit(mask.value_); // Low byte emitted.
2009
- } else {
2010
- if (reg.code() > 3) {
2011
- // Register is not one of al, bl, cl, dl. Its encoding needs REX.
2012
- emit_rex_32(reg);
2013
- }
2014
- emit(0xF6);
2015
- emit_modrm(0x0, reg);
2016
- emit(mask.value_); // Low byte emitted.
2017
- }
2018
- }
2019
-
2020
-
2021
- void Assembler::testb(const Operand& op, Immediate mask) {
2022
- ASSERT(is_int8(mask.value_) || is_uint8(mask.value_));
2023
- EnsureSpace ensure_space(this);
2024
- last_pc_ = pc_;
2025
- emit_optional_rex_32(rax, op);
2026
- emit(0xF6);
2027
- emit_operand(rax, op); // Operation code 0
2028
- emit(mask.value_); // Low byte emitted.
2029
- }
2030
-
2031
-
2032
- void Assembler::testb(const Operand& op, Register reg) {
2033
- EnsureSpace ensure_space(this);
2034
- last_pc_ = pc_;
2035
- if (reg.code() > 3) {
2036
- // Register is not one of al, bl, cl, dl. Its encoding needs REX.
2037
- emit_rex_32(reg, op);
2038
- } else {
2039
- emit_optional_rex_32(reg, op);
2040
- }
2041
- emit(0x84);
2042
- emit_operand(reg, op);
2043
- }
2044
-
2045
-
2046
- void Assembler::testl(Register dst, Register src) {
2047
- EnsureSpace ensure_space(this);
2048
- last_pc_ = pc_;
2049
- if (src.low_bits() == 4) {
2050
- emit_optional_rex_32(src, dst);
2051
- emit(0x85);
2052
- emit_modrm(src, dst);
2053
- } else {
2054
- emit_optional_rex_32(dst, src);
2055
- emit(0x85);
2056
- emit_modrm(dst, src);
2057
- }
2058
- }
2059
-
2060
-
2061
- void Assembler::testl(Register reg, Immediate mask) {
2062
- // testl with a mask that fits in the low byte is exactly testb.
2063
- if (is_uint8(mask.value_)) {
2064
- testb(reg, mask);
2065
- return;
2066
- }
2067
- EnsureSpace ensure_space(this);
2068
- last_pc_ = pc_;
2069
- if (reg.is(rax)) {
2070
- emit(0xA9);
2071
- emit(mask);
2072
- } else {
2073
- emit_optional_rex_32(rax, reg);
2074
- emit(0xF7);
2075
- emit_modrm(0x0, reg);
2076
- emit(mask);
2077
- }
2078
- }
2079
-
2080
-
2081
- void Assembler::testl(const Operand& op, Immediate mask) {
2082
- // testl with a mask that fits in the low byte is exactly testb.
2083
- if (is_uint8(mask.value_)) {
2084
- testb(op, mask);
2085
- return;
2086
- }
2087
- EnsureSpace ensure_space(this);
2088
- last_pc_ = pc_;
2089
- emit_optional_rex_32(rax, op);
2090
- emit(0xF7);
2091
- emit_operand(rax, op); // Operation code 0
2092
- emit(mask);
2093
- }
2094
-
2095
-
2096
- void Assembler::testq(const Operand& op, Register reg) {
2097
- EnsureSpace ensure_space(this);
2098
- last_pc_ = pc_;
2099
- emit_rex_64(reg, op);
2100
- emit(0x85);
2101
- emit_operand(reg, op);
2102
- }
2103
-
2104
-
2105
- void Assembler::testq(Register dst, Register src) {
2106
- EnsureSpace ensure_space(this);
2107
- last_pc_ = pc_;
2108
- if (src.low_bits() == 4) {
2109
- emit_rex_64(src, dst);
2110
- emit(0x85);
2111
- emit_modrm(src, dst);
2112
- } else {
2113
- emit_rex_64(dst, src);
2114
- emit(0x85);
2115
- emit_modrm(dst, src);
2116
- }
2117
- }
2118
-
2119
-
2120
- void Assembler::testq(Register dst, Immediate mask) {
2121
- EnsureSpace ensure_space(this);
2122
- last_pc_ = pc_;
2123
- if (dst.is(rax)) {
2124
- emit_rex_64();
2125
- emit(0xA9);
2126
- emit(mask);
2127
- } else {
2128
- emit_rex_64(dst);
2129
- emit(0xF7);
2130
- emit_modrm(0, dst);
2131
- emit(mask);
2132
- }
2133
- }
2134
-
2135
-
2136
- // FPU instructions.
2137
-
2138
-
2139
- void Assembler::fld(int i) {
2140
- EnsureSpace ensure_space(this);
2141
- last_pc_ = pc_;
2142
- emit_farith(0xD9, 0xC0, i);
2143
- }
2144
-
2145
-
2146
- void Assembler::fld1() {
2147
- EnsureSpace ensure_space(this);
2148
- last_pc_ = pc_;
2149
- emit(0xD9);
2150
- emit(0xE8);
2151
- }
2152
-
2153
-
2154
- void Assembler::fldz() {
2155
- EnsureSpace ensure_space(this);
2156
- last_pc_ = pc_;
2157
- emit(0xD9);
2158
- emit(0xEE);
2159
- }
2160
-
2161
-
2162
- void Assembler::fldpi() {
2163
- EnsureSpace ensure_space(this);
2164
- last_pc_ = pc_;
2165
- emit(0xD9);
2166
- emit(0xEB);
2167
- }
2168
-
2169
-
2170
- void Assembler::fld_s(const Operand& adr) {
2171
- EnsureSpace ensure_space(this);
2172
- last_pc_ = pc_;
2173
- emit_optional_rex_32(adr);
2174
- emit(0xD9);
2175
- emit_operand(0, adr);
2176
- }
2177
-
2178
-
2179
- void Assembler::fld_d(const Operand& adr) {
2180
- EnsureSpace ensure_space(this);
2181
- last_pc_ = pc_;
2182
- emit_optional_rex_32(adr);
2183
- emit(0xDD);
2184
- emit_operand(0, adr);
2185
- }
2186
-
2187
-
2188
- void Assembler::fstp_s(const Operand& adr) {
2189
- EnsureSpace ensure_space(this);
2190
- last_pc_ = pc_;
2191
- emit_optional_rex_32(adr);
2192
- emit(0xD9);
2193
- emit_operand(3, adr);
2194
- }
2195
-
2196
-
2197
- void Assembler::fstp_d(const Operand& adr) {
2198
- EnsureSpace ensure_space(this);
2199
- last_pc_ = pc_;
2200
- emit_optional_rex_32(adr);
2201
- emit(0xDD);
2202
- emit_operand(3, adr);
2203
- }
2204
-
2205
-
2206
- void Assembler::fstp(int index) {
2207
- ASSERT(is_uint3(index));
2208
- EnsureSpace ensure_space(this);
2209
- last_pc_ = pc_;
2210
- emit_farith(0xDD, 0xD8, index);
2211
- }
2212
-
2213
-
2214
- void Assembler::fild_s(const Operand& adr) {
2215
- EnsureSpace ensure_space(this);
2216
- last_pc_ = pc_;
2217
- emit_optional_rex_32(adr);
2218
- emit(0xDB);
2219
- emit_operand(0, adr);
2220
- }
2221
-
2222
-
2223
- void Assembler::fild_d(const Operand& adr) {
2224
- EnsureSpace ensure_space(this);
2225
- last_pc_ = pc_;
2226
- emit_optional_rex_32(adr);
2227
- emit(0xDF);
2228
- emit_operand(5, adr);
2229
- }
2230
-
2231
-
2232
- void Assembler::fistp_s(const Operand& adr) {
2233
- EnsureSpace ensure_space(this);
2234
- last_pc_ = pc_;
2235
- emit_optional_rex_32(adr);
2236
- emit(0xDB);
2237
- emit_operand(3, adr);
2238
- }
2239
-
2240
-
2241
- void Assembler::fisttp_s(const Operand& adr) {
2242
- ASSERT(CpuFeatures::IsEnabled(SSE3));
2243
- EnsureSpace ensure_space(this);
2244
- last_pc_ = pc_;
2245
- emit_optional_rex_32(adr);
2246
- emit(0xDB);
2247
- emit_operand(1, adr);
2248
- }
2249
-
2250
-
2251
- void Assembler::fisttp_d(const Operand& adr) {
2252
- ASSERT(CpuFeatures::IsEnabled(SSE3));
2253
- EnsureSpace ensure_space(this);
2254
- last_pc_ = pc_;
2255
- emit_optional_rex_32(adr);
2256
- emit(0xDD);
2257
- emit_operand(1, adr);
2258
- }
2259
-
2260
-
2261
- void Assembler::fist_s(const Operand& adr) {
2262
- EnsureSpace ensure_space(this);
2263
- last_pc_ = pc_;
2264
- emit_optional_rex_32(adr);
2265
- emit(0xDB);
2266
- emit_operand(2, adr);
2267
- }
2268
-
2269
-
2270
- void Assembler::fistp_d(const Operand& adr) {
2271
- EnsureSpace ensure_space(this);
2272
- last_pc_ = pc_;
2273
- emit_optional_rex_32(adr);
2274
- emit(0xDF);
2275
- emit_operand(7, adr);
2276
- }
2277
-
2278
-
2279
- void Assembler::fabs() {
2280
- EnsureSpace ensure_space(this);
2281
- last_pc_ = pc_;
2282
- emit(0xD9);
2283
- emit(0xE1);
2284
- }
2285
-
2286
-
2287
- void Assembler::fchs() {
2288
- EnsureSpace ensure_space(this);
2289
- last_pc_ = pc_;
2290
- emit(0xD9);
2291
- emit(0xE0);
2292
- }
2293
-
2294
-
2295
- void Assembler::fcos() {
2296
- EnsureSpace ensure_space(this);
2297
- last_pc_ = pc_;
2298
- emit(0xD9);
2299
- emit(0xFF);
2300
- }
2301
-
2302
-
2303
- void Assembler::fsin() {
2304
- EnsureSpace ensure_space(this);
2305
- last_pc_ = pc_;
2306
- emit(0xD9);
2307
- emit(0xFE);
2308
- }
2309
-
2310
-
2311
- void Assembler::fadd(int i) {
2312
- EnsureSpace ensure_space(this);
2313
- last_pc_ = pc_;
2314
- emit_farith(0xDC, 0xC0, i);
2315
- }
2316
-
2317
-
2318
- void Assembler::fsub(int i) {
2319
- EnsureSpace ensure_space(this);
2320
- last_pc_ = pc_;
2321
- emit_farith(0xDC, 0xE8, i);
2322
- }
2323
-
2324
-
2325
- void Assembler::fisub_s(const Operand& adr) {
2326
- EnsureSpace ensure_space(this);
2327
- last_pc_ = pc_;
2328
- emit_optional_rex_32(adr);
2329
- emit(0xDA);
2330
- emit_operand(4, adr);
2331
- }
2332
-
2333
-
2334
- void Assembler::fmul(int i) {
2335
- EnsureSpace ensure_space(this);
2336
- last_pc_ = pc_;
2337
- emit_farith(0xDC, 0xC8, i);
2338
- }
2339
-
2340
-
2341
- void Assembler::fdiv(int i) {
2342
- EnsureSpace ensure_space(this);
2343
- last_pc_ = pc_;
2344
- emit_farith(0xDC, 0xF8, i);
2345
- }
2346
-
2347
-
2348
- void Assembler::faddp(int i) {
2349
- EnsureSpace ensure_space(this);
2350
- last_pc_ = pc_;
2351
- emit_farith(0xDE, 0xC0, i);
2352
- }
2353
-
2354
-
2355
- void Assembler::fsubp(int i) {
2356
- EnsureSpace ensure_space(this);
2357
- last_pc_ = pc_;
2358
- emit_farith(0xDE, 0xE8, i);
2359
- }
2360
-
2361
-
2362
- void Assembler::fsubrp(int i) {
2363
- EnsureSpace ensure_space(this);
2364
- last_pc_ = pc_;
2365
- emit_farith(0xDE, 0xE0, i);
2366
- }
2367
-
2368
-
2369
- void Assembler::fmulp(int i) {
2370
- EnsureSpace ensure_space(this);
2371
- last_pc_ = pc_;
2372
- emit_farith(0xDE, 0xC8, i);
2373
- }
2374
-
2375
-
2376
- void Assembler::fdivp(int i) {
2377
- EnsureSpace ensure_space(this);
2378
- last_pc_ = pc_;
2379
- emit_farith(0xDE, 0xF8, i);
2380
- }
2381
-
2382
-
2383
- void Assembler::fprem() {
2384
- EnsureSpace ensure_space(this);
2385
- last_pc_ = pc_;
2386
- emit(0xD9);
2387
- emit(0xF8);
2388
- }
2389
-
2390
-
2391
- void Assembler::fprem1() {
2392
- EnsureSpace ensure_space(this);
2393
- last_pc_ = pc_;
2394
- emit(0xD9);
2395
- emit(0xF5);
2396
- }
2397
-
2398
-
2399
- void Assembler::fxch(int i) {
2400
- EnsureSpace ensure_space(this);
2401
- last_pc_ = pc_;
2402
- emit_farith(0xD9, 0xC8, i);
2403
- }
2404
-
2405
-
2406
- void Assembler::fincstp() {
2407
- EnsureSpace ensure_space(this);
2408
- last_pc_ = pc_;
2409
- emit(0xD9);
2410
- emit(0xF7);
2411
- }
2412
-
2413
-
2414
- void Assembler::ffree(int i) {
2415
- EnsureSpace ensure_space(this);
2416
- last_pc_ = pc_;
2417
- emit_farith(0xDD, 0xC0, i);
2418
- }
2419
-
2420
-
2421
- void Assembler::ftst() {
2422
- EnsureSpace ensure_space(this);
2423
- last_pc_ = pc_;
2424
- emit(0xD9);
2425
- emit(0xE4);
2426
- }
2427
-
2428
-
2429
- void Assembler::fucomp(int i) {
2430
- EnsureSpace ensure_space(this);
2431
- last_pc_ = pc_;
2432
- emit_farith(0xDD, 0xE8, i);
2433
- }
2434
-
2435
-
2436
- void Assembler::fucompp() {
2437
- EnsureSpace ensure_space(this);
2438
- last_pc_ = pc_;
2439
- emit(0xDA);
2440
- emit(0xE9);
2441
- }
2442
-
2443
-
2444
- void Assembler::fucomi(int i) {
2445
- EnsureSpace ensure_space(this);
2446
- last_pc_ = pc_;
2447
- emit(0xDB);
2448
- emit(0xE8 + i);
2449
- }
2450
-
2451
-
2452
- void Assembler::fucomip() {
2453
- EnsureSpace ensure_space(this);
2454
- last_pc_ = pc_;
2455
- emit(0xDF);
2456
- emit(0xE9);
2457
- }
2458
-
2459
-
2460
- void Assembler::fcompp() {
2461
- EnsureSpace ensure_space(this);
2462
- last_pc_ = pc_;
2463
- emit(0xDE);
2464
- emit(0xD9);
2465
- }
2466
-
2467
-
2468
- void Assembler::fnstsw_ax() {
2469
- EnsureSpace ensure_space(this);
2470
- last_pc_ = pc_;
2471
- emit(0xDF);
2472
- emit(0xE0);
2473
- }
2474
-
2475
-
2476
- void Assembler::fwait() {
2477
- EnsureSpace ensure_space(this);
2478
- last_pc_ = pc_;
2479
- emit(0x9B);
2480
- }
2481
-
2482
-
2483
- void Assembler::frndint() {
2484
- EnsureSpace ensure_space(this);
2485
- last_pc_ = pc_;
2486
- emit(0xD9);
2487
- emit(0xFC);
2488
- }
2489
-
2490
-
2491
- void Assembler::fnclex() {
2492
- EnsureSpace ensure_space(this);
2493
- last_pc_ = pc_;
2494
- emit(0xDB);
2495
- emit(0xE2);
2496
- }
2497
-
2498
-
2499
- void Assembler::sahf() {
2500
- // TODO(X64): Test for presence. Not all 64-bit intel CPU's have sahf
2501
- // in 64-bit mode. Test CpuID.
2502
- EnsureSpace ensure_space(this);
2503
- last_pc_ = pc_;
2504
- emit(0x9E);
2505
- }
2506
-
2507
-
2508
- void Assembler::emit_farith(int b1, int b2, int i) {
2509
- ASSERT(is_uint8(b1) && is_uint8(b2)); // wrong opcode
2510
- ASSERT(is_uint3(i)); // illegal stack offset
2511
- emit(b1);
2512
- emit(b2 + i);
2513
- }
2514
-
2515
- // SSE 2 operations.
2516
-
2517
- void Assembler::movd(XMMRegister dst, Register src) {
2518
- EnsureSpace ensure_space(this);
2519
- last_pc_ = pc_;
2520
- emit(0x66);
2521
- emit_optional_rex_32(dst, src);
2522
- emit(0x0F);
2523
- emit(0x6E);
2524
- emit_sse_operand(dst, src);
2525
- }
2526
-
2527
-
2528
- void Assembler::movd(Register dst, XMMRegister src) {
2529
- EnsureSpace ensure_space(this);
2530
- last_pc_ = pc_;
2531
- emit(0x66);
2532
- emit_optional_rex_32(dst, src);
2533
- emit(0x0F);
2534
- emit(0x7E);
2535
- emit_sse_operand(dst, src);
2536
- }
2537
-
2538
-
2539
- void Assembler::movq(XMMRegister dst, Register src) {
2540
- EnsureSpace ensure_space(this);
2541
- last_pc_ = pc_;
2542
- emit(0x66);
2543
- emit_rex_64(dst, src);
2544
- emit(0x0F);
2545
- emit(0x6E);
2546
- emit_sse_operand(dst, src);
2547
- }
2548
-
2549
-
2550
- void Assembler::movq(Register dst, XMMRegister src) {
2551
- EnsureSpace ensure_space(this);
2552
- last_pc_ = pc_;
2553
- emit(0x66);
2554
- emit_rex_64(dst, src);
2555
- emit(0x0F);
2556
- emit(0x7E);
2557
- emit_sse_operand(dst, src);
2558
- }
2559
-
2560
-
2561
- void Assembler::extractps(Register dst, XMMRegister src, byte imm8) {
2562
- ASSERT(is_uint2(imm8));
2563
- EnsureSpace ensure_space(this);
2564
- last_pc_ = pc_;
2565
- emit(0x66);
2566
- emit_optional_rex_32(dst, src);
2567
- emit(0x0F);
2568
- emit(0x3A);
2569
- emit(0x17);
2570
- emit_sse_operand(dst, src);
2571
- emit(imm8);
2572
- }
2573
-
2574
-
2575
- void Assembler::movsd(const Operand& dst, XMMRegister src) {
2576
- EnsureSpace ensure_space(this);
2577
- last_pc_ = pc_;
2578
- emit(0xF2); // double
2579
- emit_optional_rex_32(src, dst);
2580
- emit(0x0F);
2581
- emit(0x11); // store
2582
- emit_sse_operand(src, dst);
2583
- }
2584
-
2585
-
2586
- void Assembler::movsd(XMMRegister dst, XMMRegister src) {
2587
- EnsureSpace ensure_space(this);
2588
- last_pc_ = pc_;
2589
- emit(0xF2); // double
2590
- emit_optional_rex_32(dst, src);
2591
- emit(0x0F);
2592
- emit(0x10); // load
2593
- emit_sse_operand(dst, src);
2594
- }
2595
-
2596
-
2597
- void Assembler::movsd(XMMRegister dst, const Operand& src) {
2598
- EnsureSpace ensure_space(this);
2599
- last_pc_ = pc_;
2600
- emit(0xF2); // double
2601
- emit_optional_rex_32(dst, src);
2602
- emit(0x0F);
2603
- emit(0x10); // load
2604
- emit_sse_operand(dst, src);
2605
- }
2606
-
2607
-
2608
- void Assembler::movss(XMMRegister dst, const Operand& src) {
2609
- EnsureSpace ensure_space(this);
2610
- last_pc_ = pc_;
2611
- emit(0xF3); // single
2612
- emit_optional_rex_32(dst, src);
2613
- emit(0x0F);
2614
- emit(0x10); // load
2615
- emit_sse_operand(dst, src);
2616
- }
2617
-
2618
-
2619
- void Assembler::movss(const Operand& src, XMMRegister dst) {
2620
- EnsureSpace ensure_space(this);
2621
- last_pc_ = pc_;
2622
- emit(0xF3); // single
2623
- emit_optional_rex_32(dst, src);
2624
- emit(0x0F);
2625
- emit(0x11); // store
2626
- emit_sse_operand(dst, src);
2627
- }
2628
-
2629
-
2630
- void Assembler::cvttss2si(Register dst, const Operand& src) {
2631
- EnsureSpace ensure_space(this);
2632
- last_pc_ = pc_;
2633
- emit(0xF3);
2634
- emit_optional_rex_32(dst, src);
2635
- emit(0x0F);
2636
- emit(0x2C);
2637
- emit_operand(dst, src);
2638
- }
2639
-
2640
-
2641
- void Assembler::cvttsd2si(Register dst, const Operand& src) {
2642
- EnsureSpace ensure_space(this);
2643
- last_pc_ = pc_;
2644
- emit(0xF2);
2645
- emit_optional_rex_32(dst, src);
2646
- emit(0x0F);
2647
- emit(0x2C);
2648
- emit_operand(dst, src);
2649
- }
2650
-
2651
-
2652
- void Assembler::cvttsd2siq(Register dst, XMMRegister src) {
2653
- EnsureSpace ensure_space(this);
2654
- last_pc_ = pc_;
2655
- emit(0xF2);
2656
- emit_rex_64(dst, src);
2657
- emit(0x0F);
2658
- emit(0x2C);
2659
- emit_sse_operand(dst, src);
2660
- }
2661
-
2662
-
2663
- void Assembler::cvtlsi2sd(XMMRegister dst, const Operand& src) {
2664
- EnsureSpace ensure_space(this);
2665
- last_pc_ = pc_;
2666
- emit(0xF2);
2667
- emit_optional_rex_32(dst, src);
2668
- emit(0x0F);
2669
- emit(0x2A);
2670
- emit_sse_operand(dst, src);
2671
- }
2672
-
2673
-
2674
- void Assembler::cvtlsi2sd(XMMRegister dst, Register src) {
2675
- EnsureSpace ensure_space(this);
2676
- last_pc_ = pc_;
2677
- emit(0xF2);
2678
- emit_optional_rex_32(dst, src);
2679
- emit(0x0F);
2680
- emit(0x2A);
2681
- emit_sse_operand(dst, src);
2682
- }
2683
-
2684
-
2685
- void Assembler::cvtlsi2ss(XMMRegister dst, Register src) {
2686
- EnsureSpace ensure_space(this);
2687
- last_pc_ = pc_;
2688
- emit(0xF3);
2689
- emit_optional_rex_32(dst, src);
2690
- emit(0x0F);
2691
- emit(0x2A);
2692
- emit_sse_operand(dst, src);
2693
- }
2694
-
2695
-
2696
- void Assembler::cvtqsi2sd(XMMRegister dst, Register src) {
2697
- EnsureSpace ensure_space(this);
2698
- last_pc_ = pc_;
2699
- emit(0xF2);
2700
- emit_rex_64(dst, src);
2701
- emit(0x0F);
2702
- emit(0x2A);
2703
- emit_sse_operand(dst, src);
2704
- }
2705
-
2706
-
2707
- void Assembler::cvtss2sd(XMMRegister dst, XMMRegister src) {
2708
- EnsureSpace ensure_space(this);
2709
- last_pc_ = pc_;
2710
- emit(0xF3);
2711
- emit_optional_rex_32(dst, src);
2712
- emit(0x0F);
2713
- emit(0x5A);
2714
- emit_sse_operand(dst, src);
2715
- }
2716
-
2717
-
2718
- void Assembler::cvtss2sd(XMMRegister dst, const Operand& src) {
2719
- EnsureSpace ensure_space(this);
2720
- last_pc_ = pc_;
2721
- emit(0xF3);
2722
- emit_optional_rex_32(dst, src);
2723
- emit(0x0F);
2724
- emit(0x5A);
2725
- emit_sse_operand(dst, src);
2726
- }
2727
-
2728
-
2729
- void Assembler::cvtsd2ss(XMMRegister dst, XMMRegister src) {
2730
- EnsureSpace ensure_space(this);
2731
- last_pc_ = pc_;
2732
- emit(0xF2);
2733
- emit_optional_rex_32(dst, src);
2734
- emit(0x0F);
2735
- emit(0x5A);
2736
- emit_sse_operand(dst, src);
2737
- }
2738
-
2739
-
2740
- void Assembler::cvtsd2si(Register dst, XMMRegister src) {
2741
- EnsureSpace ensure_space(this);
2742
- last_pc_ = pc_;
2743
- emit(0xF2);
2744
- emit_optional_rex_32(dst, src);
2745
- emit(0x0F);
2746
- emit(0x2D);
2747
- emit_sse_operand(dst, src);
2748
- }
2749
-
2750
-
2751
- void Assembler::cvtsd2siq(Register dst, XMMRegister src) {
2752
- EnsureSpace ensure_space(this);
2753
- last_pc_ = pc_;
2754
- emit(0xF2);
2755
- emit_rex_64(dst, src);
2756
- emit(0x0F);
2757
- emit(0x2D);
2758
- emit_sse_operand(dst, src);
2759
- }
2760
-
2761
-
2762
- void Assembler::addsd(XMMRegister dst, XMMRegister src) {
2763
- EnsureSpace ensure_space(this);
2764
- last_pc_ = pc_;
2765
- emit(0xF2);
2766
- emit_optional_rex_32(dst, src);
2767
- emit(0x0F);
2768
- emit(0x58);
2769
- emit_sse_operand(dst, src);
2770
- }
2771
-
2772
-
2773
- void Assembler::mulsd(XMMRegister dst, XMMRegister src) {
2774
- EnsureSpace ensure_space(this);
2775
- last_pc_ = pc_;
2776
- emit(0xF2);
2777
- emit_optional_rex_32(dst, src);
2778
- emit(0x0F);
2779
- emit(0x59);
2780
- emit_sse_operand(dst, src);
2781
- }
2782
-
2783
-
2784
- void Assembler::subsd(XMMRegister dst, XMMRegister src) {
2785
- EnsureSpace ensure_space(this);
2786
- last_pc_ = pc_;
2787
- emit(0xF2);
2788
- emit_optional_rex_32(dst, src);
2789
- emit(0x0F);
2790
- emit(0x5C);
2791
- emit_sse_operand(dst, src);
2792
- }
2793
-
2794
-
2795
- void Assembler::divsd(XMMRegister dst, XMMRegister src) {
2796
- EnsureSpace ensure_space(this);
2797
- last_pc_ = pc_;
2798
- emit(0xF2);
2799
- emit_optional_rex_32(dst, src);
2800
- emit(0x0F);
2801
- emit(0x5E);
2802
- emit_sse_operand(dst, src);
2803
- }
2804
-
2805
-
2806
- void Assembler::xorpd(XMMRegister dst, XMMRegister src) {
2807
- EnsureSpace ensure_space(this);
2808
- last_pc_ = pc_;
2809
- emit(0x66);
2810
- emit_optional_rex_32(dst, src);
2811
- emit(0x0F);
2812
- emit(0x57);
2813
- emit_sse_operand(dst, src);
2814
- }
2815
-
2816
-
2817
- void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) {
2818
- EnsureSpace ensure_space(this);
2819
- last_pc_ = pc_;
2820
- emit(0xF2);
2821
- emit_optional_rex_32(dst, src);
2822
- emit(0x0F);
2823
- emit(0x51);
2824
- emit_sse_operand(dst, src);
2825
- }
2826
-
2827
-
2828
- void Assembler::ucomisd(XMMRegister dst, XMMRegister src) {
2829
- EnsureSpace ensure_space(this);
2830
- last_pc_ = pc_;
2831
- emit(0x66);
2832
- emit_optional_rex_32(dst, src);
2833
- emit(0x0f);
2834
- emit(0x2e);
2835
- emit_sse_operand(dst, src);
2836
- }
2837
-
2838
-
2839
- void Assembler::ucomisd(XMMRegister dst, const Operand& src) {
2840
- EnsureSpace ensure_space(this);
2841
- last_pc_ = pc_;
2842
- emit(0x66);
2843
- emit_optional_rex_32(dst, src);
2844
- emit(0x0f);
2845
- emit(0x2e);
2846
- emit_sse_operand(dst, src);
2847
- }
2848
-
2849
-
2850
-
2851
- void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) {
2852
- Register ireg = { reg.code() };
2853
- emit_operand(ireg, adr);
2854
- }
2855
-
2856
-
2857
- void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) {
2858
- emit(0xC0 | (dst.low_bits() << 3) | src.low_bits());
2859
- }
2860
-
2861
- void Assembler::emit_sse_operand(XMMRegister dst, Register src) {
2862
- emit(0xC0 | (dst.low_bits() << 3) | src.low_bits());
2863
- }
2864
-
2865
- void Assembler::emit_sse_operand(Register dst, XMMRegister src) {
2866
- emit(0xC0 | (dst.low_bits() << 3) | src.low_bits());
2867
- }
2868
-
2869
-
2870
- // Relocation information implementations.
2871
-
2872
- void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
2873
- ASSERT(rmode != RelocInfo::NONE);
2874
- // Don't record external references unless the heap will be serialized.
2875
- if (rmode == RelocInfo::EXTERNAL_REFERENCE &&
2876
- !Serializer::enabled() &&
2877
- !FLAG_debug_code) {
2878
- return;
2879
- }
2880
- RelocInfo rinfo(pc_, rmode, data);
2881
- reloc_info_writer.Write(&rinfo);
2882
- }
2883
-
2884
- void Assembler::RecordJSReturn() {
2885
- WriteRecordedPositions();
2886
- EnsureSpace ensure_space(this);
2887
- RecordRelocInfo(RelocInfo::JS_RETURN);
2888
- }
2889
-
2890
-
2891
- void Assembler::RecordDebugBreakSlot() {
2892
- WriteRecordedPositions();
2893
- EnsureSpace ensure_space(this);
2894
- RecordRelocInfo(RelocInfo::DEBUG_BREAK_SLOT);
2895
- }
2896
-
2897
-
2898
- void Assembler::RecordComment(const char* msg) {
2899
- if (FLAG_debug_code) {
2900
- EnsureSpace ensure_space(this);
2901
- RecordRelocInfo(RelocInfo::COMMENT, reinterpret_cast<intptr_t>(msg));
2902
- }
2903
- }
2904
-
2905
-
2906
- void Assembler::RecordPosition(int pos) {
2907
- ASSERT(pos != RelocInfo::kNoPosition);
2908
- ASSERT(pos >= 0);
2909
- current_position_ = pos;
2910
- }
2911
-
2912
-
2913
- void Assembler::RecordStatementPosition(int pos) {
2914
- ASSERT(pos != RelocInfo::kNoPosition);
2915
- ASSERT(pos >= 0);
2916
- current_statement_position_ = pos;
2917
- }
2918
-
2919
-
2920
- bool Assembler::WriteRecordedPositions() {
2921
- bool written = false;
2922
-
2923
- // Write the statement position if it is different from what was written last
2924
- // time.
2925
- if (current_statement_position_ != written_statement_position_) {
2926
- EnsureSpace ensure_space(this);
2927
- RecordRelocInfo(RelocInfo::STATEMENT_POSITION, current_statement_position_);
2928
- written_statement_position_ = current_statement_position_;
2929
- written = true;
2930
- }
2931
-
2932
- // Write the position if it is different from what was written last time and
2933
- // also different from the written statement position.
2934
- if (current_position_ != written_position_ &&
2935
- current_position_ != written_statement_position_) {
2936
- EnsureSpace ensure_space(this);
2937
- RecordRelocInfo(RelocInfo::POSITION, current_position_);
2938
- written_position_ = current_position_;
2939
- written = true;
2940
- }
2941
-
2942
- // Return whether something was written.
2943
- return written;
2944
- }
2945
-
2946
-
2947
- const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask |
2948
- 1 << RelocInfo::INTERNAL_REFERENCE |
2949
- 1 << RelocInfo::JS_RETURN;
2950
-
2951
-
2952
- bool RelocInfo::IsCodedSpecially() {
2953
- // The deserializer needs to know whether a pointer is specially coded. Being
2954
- // specially coded on x64 means that it is a relative 32 bit address, as used
2955
- // by branch instructions.
2956
- return (1 << rmode_) & kApplyMask;
2957
- }
2958
-
2959
-
2960
-
2961
- } } // namespace v8::internal
2962
-
2963
- #endif // V8_TARGET_ARCH_X64