therubyracer 0.5.0-x86-linux → 0.11.0beta5-x86-linux

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 (721) hide show
  1. data/.gitignore +23 -11
  2. data/.travis.yml +10 -0
  3. data/Changelog.md +242 -0
  4. data/Gemfile +16 -0
  5. data/README.md +185 -0
  6. data/Rakefile +42 -51
  7. data/benchmarks.rb +217 -0
  8. data/ext/v8/accessor.cc +181 -0
  9. data/ext/v8/array.cc +26 -0
  10. data/ext/v8/backref.cc +56 -0
  11. data/ext/v8/build.rb +52 -0
  12. data/ext/v8/constants.cc +34 -0
  13. data/ext/v8/constraints.cc +52 -0
  14. data/ext/v8/context.cc +130 -0
  15. data/ext/v8/date.cc +18 -0
  16. data/ext/v8/exception.cc +38 -0
  17. data/ext/v8/extconf.rb +16 -29
  18. data/ext/v8/external.cc +43 -0
  19. data/ext/v8/function.cc +58 -0
  20. data/ext/v8/gc.cc +43 -0
  21. data/ext/v8/handles.cc +34 -0
  22. data/ext/v8/heap.cc +31 -0
  23. data/ext/v8/init.cc +39 -0
  24. data/ext/v8/init.so +0 -0
  25. data/ext/v8/invocation.cc +86 -0
  26. data/ext/v8/locker.cc +77 -0
  27. data/ext/v8/message.cc +51 -0
  28. data/ext/v8/object.cc +334 -0
  29. data/ext/v8/primitive.cc +8 -0
  30. data/ext/v8/rr.cc +83 -0
  31. data/ext/v8/rr.h +883 -0
  32. data/ext/v8/script.cc +80 -0
  33. data/ext/v8/signature.cc +18 -0
  34. data/ext/v8/stack.cc +75 -0
  35. data/ext/v8/string.cc +47 -0
  36. data/ext/v8/template.cc +175 -0
  37. data/ext/v8/trycatch.cc +86 -0
  38. data/ext/v8/v8.cc +87 -0
  39. data/ext/v8/value.cc +239 -0
  40. data/lib/v8.rb +30 -9
  41. data/lib/v8/access.rb +5 -0
  42. data/lib/v8/access/indices.rb +40 -0
  43. data/lib/v8/access/invocation.rb +47 -0
  44. data/lib/v8/access/names.rb +65 -0
  45. data/lib/v8/array.rb +26 -0
  46. data/lib/v8/context.rb +217 -75
  47. data/lib/v8/conversion.rb +35 -0
  48. data/lib/v8/conversion/array.rb +11 -0
  49. data/lib/v8/conversion/class.rb +120 -0
  50. data/lib/v8/conversion/code.rb +38 -0
  51. data/lib/v8/conversion/fundamental.rb +11 -0
  52. data/lib/v8/conversion/hash.rb +11 -0
  53. data/lib/v8/conversion/indentity.rb +31 -0
  54. data/lib/v8/conversion/method.rb +26 -0
  55. data/lib/v8/conversion/object.rb +28 -0
  56. data/lib/v8/conversion/primitive.rb +7 -0
  57. data/lib/v8/conversion/proc.rb +5 -0
  58. data/lib/v8/conversion/reference.rb +16 -0
  59. data/lib/v8/conversion/string.rb +12 -0
  60. data/lib/v8/conversion/symbol.rb +7 -0
  61. data/lib/v8/conversion/time.rb +13 -0
  62. data/lib/v8/error.rb +25 -0
  63. data/lib/v8/error/protect.rb +20 -0
  64. data/lib/v8/error/try.rb +15 -0
  65. data/lib/v8/function.rb +28 -0
  66. data/lib/v8/object.rb +69 -28
  67. data/lib/v8/util/weakcell.rb +29 -0
  68. data/lib/v8/version.rb +3 -0
  69. data/spec/c/array_spec.rb +17 -0
  70. data/spec/c/constants_spec.rb +20 -0
  71. data/spec/c/exception_spec.rb +26 -0
  72. data/spec/c/external_spec.rb +9 -0
  73. data/spec/c/function_spec.rb +46 -0
  74. data/spec/c/handles_spec.rb +35 -0
  75. data/spec/c/locker_spec.rb +38 -0
  76. data/spec/c/object_spec.rb +46 -0
  77. data/spec/c/script_spec.rb +28 -0
  78. data/spec/c/string_spec.rb +16 -0
  79. data/spec/c/template_spec.rb +30 -0
  80. data/spec/c/trycatch_spec.rb +51 -0
  81. data/spec/mem/blunt_spec.rb +42 -0
  82. data/spec/redjs_spec.rb +10 -0
  83. data/spec/spec_helper.rb +43 -12
  84. data/spec/threading_spec.rb +52 -0
  85. data/spec/v8/context_spec.rb +19 -0
  86. data/spec/v8/conversion_spec.rb +9 -0
  87. data/spec/v8/error_spec.rb +21 -0
  88. data/spec/v8/function_spec.rb +9 -0
  89. data/spec/v8/object_spec.rb +15 -0
  90. data/thefrontside.png +0 -0
  91. data/therubyracer.gemspec +15 -676
  92. metadata +146 -680
  93. data/.gitmodules +0 -3
  94. data/Doxyfile +0 -1514
  95. data/History.txt +0 -51
  96. data/README.rdoc +0 -158
  97. data/docs/data_conversion.txt +0 -18
  98. data/ext/v8/callbacks.cpp +0 -160
  99. data/ext/v8/callbacks.h +0 -14
  100. data/ext/v8/convert_ruby.cpp +0 -8
  101. data/ext/v8/convert_ruby.h +0 -99
  102. data/ext/v8/convert_string.cpp +0 -10
  103. data/ext/v8/convert_string.h +0 -73
  104. data/ext/v8/convert_v8.cpp +0 -9
  105. data/ext/v8/convert_v8.h +0 -121
  106. data/ext/v8/converters.cpp +0 -83
  107. data/ext/v8/converters.h +0 -23
  108. data/ext/v8/upstream/2.0.6/.gitignore +0 -26
  109. data/ext/v8/upstream/2.0.6/AUTHORS +0 -23
  110. data/ext/v8/upstream/2.0.6/ChangeLog +0 -1479
  111. data/ext/v8/upstream/2.0.6/LICENSE +0 -55
  112. data/ext/v8/upstream/2.0.6/SConstruct +0 -1028
  113. data/ext/v8/upstream/2.0.6/include/v8-debug.h +0 -275
  114. data/ext/v8/upstream/2.0.6/include/v8.h +0 -3236
  115. data/ext/v8/upstream/2.0.6/src/SConscript +0 -283
  116. data/ext/v8/upstream/2.0.6/src/accessors.cc +0 -695
  117. data/ext/v8/upstream/2.0.6/src/accessors.h +0 -114
  118. data/ext/v8/upstream/2.0.6/src/allocation.cc +0 -198
  119. data/ext/v8/upstream/2.0.6/src/allocation.h +0 -169
  120. data/ext/v8/upstream/2.0.6/src/api.cc +0 -3831
  121. data/ext/v8/upstream/2.0.6/src/api.h +0 -479
  122. data/ext/v8/upstream/2.0.6/src/apinatives.js +0 -110
  123. data/ext/v8/upstream/2.0.6/src/apiutils.h +0 -69
  124. data/ext/v8/upstream/2.0.6/src/arguments.h +0 -97
  125. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm-inl.h +0 -277
  126. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.cc +0 -1821
  127. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.h +0 -1027
  128. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2-inl.h +0 -267
  129. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.cc +0 -1821
  130. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.h +0 -1027
  131. data/ext/v8/upstream/2.0.6/src/arm/builtins-arm.cc +0 -1271
  132. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm-inl.h +0 -74
  133. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.cc +0 -6682
  134. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.h +0 -535
  135. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.cc +0 -112
  136. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.h +0 -347
  137. data/ext/v8/upstream/2.0.6/src/arm/cpu-arm.cc +0 -132
  138. data/ext/v8/upstream/2.0.6/src/arm/debug-arm.cc +0 -213
  139. data/ext/v8/upstream/2.0.6/src/arm/disasm-arm.cc +0 -1166
  140. data/ext/v8/upstream/2.0.6/src/arm/fast-codegen-arm.cc +0 -1698
  141. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.cc +0 -123
  142. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.h +0 -162
  143. data/ext/v8/upstream/2.0.6/src/arm/ic-arm.cc +0 -849
  144. data/ext/v8/upstream/2.0.6/src/arm/jump-target-arm.cc +0 -238
  145. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.cc +0 -1259
  146. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.h +0 -423
  147. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.cc +0 -1266
  148. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.h +0 -282
  149. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm-inl.h +0 -103
  150. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.cc +0 -59
  151. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.h +0 -43
  152. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.cc +0 -2264
  153. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.h +0 -306
  154. data/ext/v8/upstream/2.0.6/src/arm/stub-cache-arm.cc +0 -1516
  155. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.cc +0 -412
  156. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.h +0 -532
  157. data/ext/v8/upstream/2.0.6/src/array.js +0 -1154
  158. data/ext/v8/upstream/2.0.6/src/assembler.cc +0 -772
  159. data/ext/v8/upstream/2.0.6/src/assembler.h +0 -525
  160. data/ext/v8/upstream/2.0.6/src/ast.cc +0 -512
  161. data/ext/v8/upstream/2.0.6/src/ast.h +0 -1820
  162. data/ext/v8/upstream/2.0.6/src/bootstrapper.cc +0 -1680
  163. data/ext/v8/upstream/2.0.6/src/bootstrapper.h +0 -103
  164. data/ext/v8/upstream/2.0.6/src/builtins.cc +0 -851
  165. data/ext/v8/upstream/2.0.6/src/builtins.h +0 -245
  166. data/ext/v8/upstream/2.0.6/src/bytecodes-irregexp.h +0 -104
  167. data/ext/v8/upstream/2.0.6/src/char-predicates-inl.h +0 -86
  168. data/ext/v8/upstream/2.0.6/src/char-predicates.h +0 -65
  169. data/ext/v8/upstream/2.0.6/src/checks.cc +0 -100
  170. data/ext/v8/upstream/2.0.6/src/checks.h +0 -284
  171. data/ext/v8/upstream/2.0.6/src/code-stubs.cc +0 -164
  172. data/ext/v8/upstream/2.0.6/src/code-stubs.h +0 -164
  173. data/ext/v8/upstream/2.0.6/src/code.h +0 -68
  174. data/ext/v8/upstream/2.0.6/src/codegen-inl.h +0 -88
  175. data/ext/v8/upstream/2.0.6/src/codegen.cc +0 -504
  176. data/ext/v8/upstream/2.0.6/src/codegen.h +0 -522
  177. data/ext/v8/upstream/2.0.6/src/compilation-cache.cc +0 -490
  178. data/ext/v8/upstream/2.0.6/src/compilation-cache.h +0 -98
  179. data/ext/v8/upstream/2.0.6/src/compiler.cc +0 -1132
  180. data/ext/v8/upstream/2.0.6/src/compiler.h +0 -107
  181. data/ext/v8/upstream/2.0.6/src/contexts.cc +0 -256
  182. data/ext/v8/upstream/2.0.6/src/contexts.h +0 -345
  183. data/ext/v8/upstream/2.0.6/src/conversions-inl.h +0 -95
  184. data/ext/v8/upstream/2.0.6/src/conversions.cc +0 -709
  185. data/ext/v8/upstream/2.0.6/src/conversions.h +0 -118
  186. data/ext/v8/upstream/2.0.6/src/counters.cc +0 -78
  187. data/ext/v8/upstream/2.0.6/src/counters.h +0 -239
  188. data/ext/v8/upstream/2.0.6/src/cpu.h +0 -65
  189. data/ext/v8/upstream/2.0.6/src/d8-debug.cc +0 -345
  190. data/ext/v8/upstream/2.0.6/src/d8-debug.h +0 -155
  191. data/ext/v8/upstream/2.0.6/src/d8-posix.cc +0 -675
  192. data/ext/v8/upstream/2.0.6/src/d8-readline.cc +0 -128
  193. data/ext/v8/upstream/2.0.6/src/d8-windows.cc +0 -42
  194. data/ext/v8/upstream/2.0.6/src/d8.cc +0 -776
  195. data/ext/v8/upstream/2.0.6/src/d8.h +0 -225
  196. data/ext/v8/upstream/2.0.6/src/d8.js +0 -1625
  197. data/ext/v8/upstream/2.0.6/src/date-delay.js +0 -1138
  198. data/ext/v8/upstream/2.0.6/src/dateparser-inl.h +0 -114
  199. data/ext/v8/upstream/2.0.6/src/dateparser.cc +0 -186
  200. data/ext/v8/upstream/2.0.6/src/dateparser.h +0 -240
  201. data/ext/v8/upstream/2.0.6/src/debug-agent.cc +0 -425
  202. data/ext/v8/upstream/2.0.6/src/debug-agent.h +0 -129
  203. data/ext/v8/upstream/2.0.6/src/debug-delay.js +0 -2073
  204. data/ext/v8/upstream/2.0.6/src/debug.cc +0 -2751
  205. data/ext/v8/upstream/2.0.6/src/debug.h +0 -866
  206. data/ext/v8/upstream/2.0.6/src/disasm.h +0 -77
  207. data/ext/v8/upstream/2.0.6/src/disassembler.cc +0 -318
  208. data/ext/v8/upstream/2.0.6/src/disassembler.h +0 -56
  209. data/ext/v8/upstream/2.0.6/src/dtoa-config.c +0 -91
  210. data/ext/v8/upstream/2.0.6/src/execution.cc +0 -701
  211. data/ext/v8/upstream/2.0.6/src/execution.h +0 -312
  212. data/ext/v8/upstream/2.0.6/src/factory.cc +0 -957
  213. data/ext/v8/upstream/2.0.6/src/factory.h +0 -393
  214. data/ext/v8/upstream/2.0.6/src/fast-codegen.cc +0 -725
  215. data/ext/v8/upstream/2.0.6/src/fast-codegen.h +0 -371
  216. data/ext/v8/upstream/2.0.6/src/flag-definitions.h +0 -426
  217. data/ext/v8/upstream/2.0.6/src/flags.cc +0 -555
  218. data/ext/v8/upstream/2.0.6/src/flags.h +0 -81
  219. data/ext/v8/upstream/2.0.6/src/frame-element.cc +0 -45
  220. data/ext/v8/upstream/2.0.6/src/frame-element.h +0 -235
  221. data/ext/v8/upstream/2.0.6/src/frames-inl.h +0 -215
  222. data/ext/v8/upstream/2.0.6/src/frames.cc +0 -749
  223. data/ext/v8/upstream/2.0.6/src/frames.h +0 -659
  224. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.cc +0 -76
  225. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.h +0 -135
  226. data/ext/v8/upstream/2.0.6/src/global-handles.cc +0 -516
  227. data/ext/v8/upstream/2.0.6/src/global-handles.h +0 -180
  228. data/ext/v8/upstream/2.0.6/src/globals.h +0 -608
  229. data/ext/v8/upstream/2.0.6/src/handles-inl.h +0 -76
  230. data/ext/v8/upstream/2.0.6/src/handles.cc +0 -811
  231. data/ext/v8/upstream/2.0.6/src/handles.h +0 -367
  232. data/ext/v8/upstream/2.0.6/src/hashmap.cc +0 -226
  233. data/ext/v8/upstream/2.0.6/src/hashmap.h +0 -120
  234. data/ext/v8/upstream/2.0.6/src/heap-inl.h +0 -407
  235. data/ext/v8/upstream/2.0.6/src/heap-profiler.cc +0 -695
  236. data/ext/v8/upstream/2.0.6/src/heap-profiler.h +0 -277
  237. data/ext/v8/upstream/2.0.6/src/heap.cc +0 -4204
  238. data/ext/v8/upstream/2.0.6/src/heap.h +0 -1704
  239. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32-inl.h +0 -325
  240. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.cc +0 -2375
  241. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.h +0 -914
  242. data/ext/v8/upstream/2.0.6/src/ia32/builtins-ia32.cc +0 -1222
  243. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32-inl.h +0 -46
  244. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.cc +0 -9770
  245. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.h +0 -834
  246. data/ext/v8/upstream/2.0.6/src/ia32/cpu-ia32.cc +0 -79
  247. data/ext/v8/upstream/2.0.6/src/ia32/debug-ia32.cc +0 -208
  248. data/ext/v8/upstream/2.0.6/src/ia32/disasm-ia32.cc +0 -1357
  249. data/ext/v8/upstream/2.0.6/src/ia32/fast-codegen-ia32.cc +0 -1813
  250. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.cc +0 -111
  251. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.h +0 -135
  252. data/ext/v8/upstream/2.0.6/src/ia32/ic-ia32.cc +0 -1490
  253. data/ext/v8/upstream/2.0.6/src/ia32/jump-target-ia32.cc +0 -432
  254. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.cc +0 -1517
  255. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.h +0 -528
  256. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.cc +0 -1219
  257. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.h +0 -230
  258. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32-inl.h +0 -82
  259. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.cc +0 -99
  260. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.h +0 -43
  261. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.cc +0 -30
  262. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.h +0 -62
  263. data/ext/v8/upstream/2.0.6/src/ia32/stub-cache-ia32.cc +0 -1961
  264. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.cc +0 -1105
  265. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.h +0 -580
  266. data/ext/v8/upstream/2.0.6/src/ic-inl.h +0 -93
  267. data/ext/v8/upstream/2.0.6/src/ic.cc +0 -1426
  268. data/ext/v8/upstream/2.0.6/src/ic.h +0 -443
  269. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.cc +0 -646
  270. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.h +0 -48
  271. data/ext/v8/upstream/2.0.6/src/json-delay.js +0 -254
  272. data/ext/v8/upstream/2.0.6/src/jsregexp.cc +0 -5234
  273. data/ext/v8/upstream/2.0.6/src/jsregexp.h +0 -1439
  274. data/ext/v8/upstream/2.0.6/src/jump-target-inl.h +0 -49
  275. data/ext/v8/upstream/2.0.6/src/jump-target.cc +0 -383
  276. data/ext/v8/upstream/2.0.6/src/jump-target.h +0 -280
  277. data/ext/v8/upstream/2.0.6/src/list-inl.h +0 -166
  278. data/ext/v8/upstream/2.0.6/src/list.h +0 -158
  279. data/ext/v8/upstream/2.0.6/src/log-inl.h +0 -126
  280. data/ext/v8/upstream/2.0.6/src/log-utils.cc +0 -503
  281. data/ext/v8/upstream/2.0.6/src/log-utils.h +0 -292
  282. data/ext/v8/upstream/2.0.6/src/log.cc +0 -1457
  283. data/ext/v8/upstream/2.0.6/src/log.h +0 -371
  284. data/ext/v8/upstream/2.0.6/src/macro-assembler.h +0 -93
  285. data/ext/v8/upstream/2.0.6/src/macros.py +0 -137
  286. data/ext/v8/upstream/2.0.6/src/mark-compact.cc +0 -2007
  287. data/ext/v8/upstream/2.0.6/src/mark-compact.h +0 -442
  288. data/ext/v8/upstream/2.0.6/src/math.js +0 -263
  289. data/ext/v8/upstream/2.0.6/src/memory.h +0 -74
  290. data/ext/v8/upstream/2.0.6/src/messages.cc +0 -177
  291. data/ext/v8/upstream/2.0.6/src/messages.h +0 -112
  292. data/ext/v8/upstream/2.0.6/src/messages.js +0 -937
  293. data/ext/v8/upstream/2.0.6/src/mirror-delay.js +0 -2332
  294. data/ext/v8/upstream/2.0.6/src/mksnapshot.cc +0 -169
  295. data/ext/v8/upstream/2.0.6/src/natives.h +0 -63
  296. data/ext/v8/upstream/2.0.6/src/objects-debug.cc +0 -1317
  297. data/ext/v8/upstream/2.0.6/src/objects-inl.h +0 -3044
  298. data/ext/v8/upstream/2.0.6/src/objects.cc +0 -8306
  299. data/ext/v8/upstream/2.0.6/src/objects.h +0 -4960
  300. data/ext/v8/upstream/2.0.6/src/oprofile-agent.cc +0 -116
  301. data/ext/v8/upstream/2.0.6/src/oprofile-agent.h +0 -69
  302. data/ext/v8/upstream/2.0.6/src/parser.cc +0 -4810
  303. data/ext/v8/upstream/2.0.6/src/parser.h +0 -195
  304. data/ext/v8/upstream/2.0.6/src/platform-freebsd.cc +0 -645
  305. data/ext/v8/upstream/2.0.6/src/platform-linux.cc +0 -808
  306. data/ext/v8/upstream/2.0.6/src/platform-macos.cc +0 -643
  307. data/ext/v8/upstream/2.0.6/src/platform-nullos.cc +0 -454
  308. data/ext/v8/upstream/2.0.6/src/platform-openbsd.cc +0 -597
  309. data/ext/v8/upstream/2.0.6/src/platform-posix.cc +0 -380
  310. data/ext/v8/upstream/2.0.6/src/platform-win32.cc +0 -1908
  311. data/ext/v8/upstream/2.0.6/src/platform.h +0 -556
  312. data/ext/v8/upstream/2.0.6/src/prettyprinter.cc +0 -1511
  313. data/ext/v8/upstream/2.0.6/src/prettyprinter.h +0 -219
  314. data/ext/v8/upstream/2.0.6/src/property.cc +0 -96
  315. data/ext/v8/upstream/2.0.6/src/property.h +0 -327
  316. data/ext/v8/upstream/2.0.6/src/regexp-delay.js +0 -406
  317. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp-inl.h +0 -78
  318. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.cc +0 -464
  319. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.h +0 -141
  320. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.cc +0 -356
  321. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.h +0 -103
  322. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.cc +0 -240
  323. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.h +0 -220
  324. data/ext/v8/upstream/2.0.6/src/regexp-stack.cc +0 -103
  325. data/ext/v8/upstream/2.0.6/src/regexp-stack.h +0 -123
  326. data/ext/v8/upstream/2.0.6/src/register-allocator-inl.h +0 -74
  327. data/ext/v8/upstream/2.0.6/src/register-allocator.cc +0 -100
  328. data/ext/v8/upstream/2.0.6/src/register-allocator.h +0 -295
  329. data/ext/v8/upstream/2.0.6/src/rewriter.cc +0 -855
  330. data/ext/v8/upstream/2.0.6/src/rewriter.h +0 -54
  331. data/ext/v8/upstream/2.0.6/src/runtime.cc +0 -8163
  332. data/ext/v8/upstream/2.0.6/src/runtime.h +0 -432
  333. data/ext/v8/upstream/2.0.6/src/runtime.js +0 -626
  334. data/ext/v8/upstream/2.0.6/src/scanner.cc +0 -1098
  335. data/ext/v8/upstream/2.0.6/src/scanner.h +0 -425
  336. data/ext/v8/upstream/2.0.6/src/scopeinfo.cc +0 -649
  337. data/ext/v8/upstream/2.0.6/src/scopeinfo.h +0 -236
  338. data/ext/v8/upstream/2.0.6/src/scopes.cc +0 -963
  339. data/ext/v8/upstream/2.0.6/src/scopes.h +0 -401
  340. data/ext/v8/upstream/2.0.6/src/serialize.cc +0 -1260
  341. data/ext/v8/upstream/2.0.6/src/serialize.h +0 -404
  342. data/ext/v8/upstream/2.0.6/src/shell.h +0 -55
  343. data/ext/v8/upstream/2.0.6/src/simulator.h +0 -41
  344. data/ext/v8/upstream/2.0.6/src/smart-pointer.h +0 -109
  345. data/ext/v8/upstream/2.0.6/src/snapshot-common.cc +0 -97
  346. data/ext/v8/upstream/2.0.6/src/snapshot-empty.cc +0 -40
  347. data/ext/v8/upstream/2.0.6/src/snapshot.h +0 -59
  348. data/ext/v8/upstream/2.0.6/src/spaces-inl.h +0 -372
  349. data/ext/v8/upstream/2.0.6/src/spaces.cc +0 -2864
  350. data/ext/v8/upstream/2.0.6/src/spaces.h +0 -2072
  351. data/ext/v8/upstream/2.0.6/src/string-stream.cc +0 -584
  352. data/ext/v8/upstream/2.0.6/src/string-stream.h +0 -189
  353. data/ext/v8/upstream/2.0.6/src/string.js +0 -901
  354. data/ext/v8/upstream/2.0.6/src/stub-cache.cc +0 -1108
  355. data/ext/v8/upstream/2.0.6/src/stub-cache.h +0 -578
  356. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/COPYING +0 -15
  357. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/dtoa.c +0 -3330
  358. data/ext/v8/upstream/2.0.6/src/third_party/valgrind/valgrind.h +0 -3925
  359. data/ext/v8/upstream/2.0.6/src/token.cc +0 -56
  360. data/ext/v8/upstream/2.0.6/src/token.h +0 -270
  361. data/ext/v8/upstream/2.0.6/src/top.cc +0 -991
  362. data/ext/v8/upstream/2.0.6/src/top.h +0 -459
  363. data/ext/v8/upstream/2.0.6/src/unicode-inl.h +0 -238
  364. data/ext/v8/upstream/2.0.6/src/unicode.cc +0 -749
  365. data/ext/v8/upstream/2.0.6/src/unicode.h +0 -279
  366. data/ext/v8/upstream/2.0.6/src/uri.js +0 -415
  367. data/ext/v8/upstream/2.0.6/src/usage-analyzer.cc +0 -426
  368. data/ext/v8/upstream/2.0.6/src/usage-analyzer.h +0 -40
  369. data/ext/v8/upstream/2.0.6/src/utils.cc +0 -322
  370. data/ext/v8/upstream/2.0.6/src/utils.h +0 -592
  371. data/ext/v8/upstream/2.0.6/src/v8-counters.cc +0 -55
  372. data/ext/v8/upstream/2.0.6/src/v8-counters.h +0 -198
  373. data/ext/v8/upstream/2.0.6/src/v8.cc +0 -193
  374. data/ext/v8/upstream/2.0.6/src/v8.h +0 -119
  375. data/ext/v8/upstream/2.0.6/src/v8natives.js +0 -846
  376. data/ext/v8/upstream/2.0.6/src/v8threads.cc +0 -450
  377. data/ext/v8/upstream/2.0.6/src/v8threads.h +0 -144
  378. data/ext/v8/upstream/2.0.6/src/variables.cc +0 -163
  379. data/ext/v8/upstream/2.0.6/src/variables.h +0 -235
  380. data/ext/v8/upstream/2.0.6/src/version.cc +0 -88
  381. data/ext/v8/upstream/2.0.6/src/version.h +0 -64
  382. data/ext/v8/upstream/2.0.6/src/virtual-frame.cc +0 -381
  383. data/ext/v8/upstream/2.0.6/src/virtual-frame.h +0 -44
  384. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64-inl.h +0 -352
  385. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.cc +0 -2539
  386. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.h +0 -1399
  387. data/ext/v8/upstream/2.0.6/src/x64/builtins-x64.cc +0 -1255
  388. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64-inl.h +0 -46
  389. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.cc +0 -8223
  390. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.h +0 -785
  391. data/ext/v8/upstream/2.0.6/src/x64/cpu-x64.cc +0 -79
  392. data/ext/v8/upstream/2.0.6/src/x64/debug-x64.cc +0 -202
  393. data/ext/v8/upstream/2.0.6/src/x64/disasm-x64.cc +0 -1596
  394. data/ext/v8/upstream/2.0.6/src/x64/fast-codegen-x64.cc +0 -1820
  395. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.cc +0 -109
  396. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.h +0 -121
  397. data/ext/v8/upstream/2.0.6/src/x64/ic-x64.cc +0 -1392
  398. data/ext/v8/upstream/2.0.6/src/x64/jump-target-x64.cc +0 -432
  399. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.cc +0 -2409
  400. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.h +0 -765
  401. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.cc +0 -1337
  402. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.h +0 -295
  403. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64-inl.h +0 -86
  404. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.cc +0 -84
  405. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.h +0 -43
  406. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.cc +0 -27
  407. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.h +0 -63
  408. data/ext/v8/upstream/2.0.6/src/x64/stub-cache-x64.cc +0 -1884
  409. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.cc +0 -1089
  410. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.h +0 -560
  411. data/ext/v8/upstream/2.0.6/src/zone-inl.h +0 -297
  412. data/ext/v8/upstream/2.0.6/src/zone.cc +0 -193
  413. data/ext/v8/upstream/2.0.6/src/zone.h +0 -305
  414. data/ext/v8/upstream/2.0.6/tools/codemap.js +0 -258
  415. data/ext/v8/upstream/2.0.6/tools/consarray.js +0 -93
  416. data/ext/v8/upstream/2.0.6/tools/csvparser.js +0 -98
  417. data/ext/v8/upstream/2.0.6/tools/gyp/v8.gyp +0 -620
  418. data/ext/v8/upstream/2.0.6/tools/js2c.py +0 -376
  419. data/ext/v8/upstream/2.0.6/tools/jsmin.py +0 -280
  420. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor +0 -24
  421. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor.py +0 -78
  422. data/ext/v8/upstream/2.0.6/tools/logreader.js +0 -320
  423. data/ext/v8/upstream/2.0.6/tools/mac-nm +0 -18
  424. data/ext/v8/upstream/2.0.6/tools/mac-tick-processor +0 -6
  425. data/ext/v8/upstream/2.0.6/tools/oprofile/annotate +0 -7
  426. data/ext/v8/upstream/2.0.6/tools/oprofile/common +0 -19
  427. data/ext/v8/upstream/2.0.6/tools/oprofile/dump +0 -7
  428. data/ext/v8/upstream/2.0.6/tools/oprofile/report +0 -7
  429. data/ext/v8/upstream/2.0.6/tools/oprofile/reset +0 -7
  430. data/ext/v8/upstream/2.0.6/tools/oprofile/run +0 -14
  431. data/ext/v8/upstream/2.0.6/tools/oprofile/shutdown +0 -7
  432. data/ext/v8/upstream/2.0.6/tools/oprofile/start +0 -7
  433. data/ext/v8/upstream/2.0.6/tools/presubmit.py +0 -299
  434. data/ext/v8/upstream/2.0.6/tools/process-heap-prof.py +0 -120
  435. data/ext/v8/upstream/2.0.6/tools/profile.js +0 -621
  436. data/ext/v8/upstream/2.0.6/tools/profile_view.js +0 -224
  437. data/ext/v8/upstream/2.0.6/tools/run-valgrind.py +0 -77
  438. data/ext/v8/upstream/2.0.6/tools/splaytree.js +0 -322
  439. data/ext/v8/upstream/2.0.6/tools/splaytree.py +0 -226
  440. data/ext/v8/upstream/2.0.6/tools/stats-viewer.py +0 -456
  441. data/ext/v8/upstream/2.0.6/tools/test.py +0 -1370
  442. data/ext/v8/upstream/2.0.6/tools/tickprocessor-driver.js +0 -53
  443. data/ext/v8/upstream/2.0.6/tools/tickprocessor.js +0 -731
  444. data/ext/v8/upstream/2.0.6/tools/tickprocessor.py +0 -535
  445. data/ext/v8/upstream/2.0.6/tools/utils.py +0 -82
  446. data/ext/v8/upstream/2.0.6/tools/visual_studio/README.txt +0 -71
  447. data/ext/v8/upstream/2.0.6/tools/visual_studio/arm.vsprops +0 -14
  448. data/ext/v8/upstream/2.0.6/tools/visual_studio/common.vsprops +0 -35
  449. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8.vcproj +0 -199
  450. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_arm.vcproj +0 -199
  451. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_x64.vcproj +0 -201
  452. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8js2c.cmd +0 -6
  453. data/ext/v8/upstream/2.0.6/tools/visual_studio/debug.vsprops +0 -17
  454. data/ext/v8/upstream/2.0.6/tools/visual_studio/ia32.vsprops +0 -13
  455. data/ext/v8/upstream/2.0.6/tools/visual_studio/js2c.cmd +0 -6
  456. data/ext/v8/upstream/2.0.6/tools/visual_studio/release.vsprops +0 -24
  457. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.sln +0 -101
  458. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.vcproj +0 -223
  459. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.sln +0 -74
  460. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.vcproj +0 -223
  461. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base.vcproj +0 -971
  462. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_arm.vcproj +0 -983
  463. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_x64.vcproj +0 -959
  464. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest.vcproj +0 -255
  465. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_arm.vcproj +0 -243
  466. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_x64.vcproj +0 -257
  467. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot.vcproj +0 -151
  468. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -151
  469. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample.vcproj +0 -151
  470. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_arm.vcproj +0 -151
  471. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_x64.vcproj +0 -151
  472. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample.vcproj +0 -151
  473. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -151
  474. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -153
  475. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot.vcproj +0 -142
  476. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc.vcproj +0 -92
  477. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -92
  478. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_x64.vcproj +0 -142
  479. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.sln +0 -101
  480. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.vcproj +0 -223
  481. data/ext/v8/upstream/2.0.6/tools/visual_studio/x64.vsprops +0 -13
  482. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.bat +0 -5
  483. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.py +0 -137
  484. data/ext/v8/upstream/Makefile +0 -32
  485. data/ext/v8/upstream/fpic-on-linux-amd64.patch +0 -13
  486. data/ext/v8/upstream/no-strict-aliasing.patch +0 -13
  487. data/ext/v8/upstream/scons/CHANGES.txt +0 -5183
  488. data/ext/v8/upstream/scons/LICENSE.txt +0 -20
  489. data/ext/v8/upstream/scons/MANIFEST +0 -202
  490. data/ext/v8/upstream/scons/PKG-INFO +0 -13
  491. data/ext/v8/upstream/scons/README.txt +0 -273
  492. data/ext/v8/upstream/scons/RELEASE.txt +0 -1040
  493. data/ext/v8/upstream/scons/engine/SCons/Action.py +0 -1256
  494. data/ext/v8/upstream/scons/engine/SCons/Builder.py +0 -868
  495. data/ext/v8/upstream/scons/engine/SCons/CacheDir.py +0 -217
  496. data/ext/v8/upstream/scons/engine/SCons/Conftest.py +0 -794
  497. data/ext/v8/upstream/scons/engine/SCons/Debug.py +0 -237
  498. data/ext/v8/upstream/scons/engine/SCons/Defaults.py +0 -485
  499. data/ext/v8/upstream/scons/engine/SCons/Environment.py +0 -2327
  500. data/ext/v8/upstream/scons/engine/SCons/Errors.py +0 -207
  501. data/ext/v8/upstream/scons/engine/SCons/Executor.py +0 -636
  502. data/ext/v8/upstream/scons/engine/SCons/Job.py +0 -435
  503. data/ext/v8/upstream/scons/engine/SCons/Memoize.py +0 -292
  504. data/ext/v8/upstream/scons/engine/SCons/Node/Alias.py +0 -153
  505. data/ext/v8/upstream/scons/engine/SCons/Node/FS.py +0 -3220
  506. data/ext/v8/upstream/scons/engine/SCons/Node/Python.py +0 -128
  507. data/ext/v8/upstream/scons/engine/SCons/Node/__init__.py +0 -1341
  508. data/ext/v8/upstream/scons/engine/SCons/Options/BoolOption.py +0 -50
  509. data/ext/v8/upstream/scons/engine/SCons/Options/EnumOption.py +0 -50
  510. data/ext/v8/upstream/scons/engine/SCons/Options/ListOption.py +0 -50
  511. data/ext/v8/upstream/scons/engine/SCons/Options/PackageOption.py +0 -50
  512. data/ext/v8/upstream/scons/engine/SCons/Options/PathOption.py +0 -76
  513. data/ext/v8/upstream/scons/engine/SCons/Options/__init__.py +0 -74
  514. data/ext/v8/upstream/scons/engine/SCons/PathList.py +0 -232
  515. data/ext/v8/upstream/scons/engine/SCons/Platform/__init__.py +0 -236
  516. data/ext/v8/upstream/scons/engine/SCons/Platform/aix.py +0 -70
  517. data/ext/v8/upstream/scons/engine/SCons/Platform/cygwin.py +0 -55
  518. data/ext/v8/upstream/scons/engine/SCons/Platform/darwin.py +0 -46
  519. data/ext/v8/upstream/scons/engine/SCons/Platform/hpux.py +0 -46
  520. data/ext/v8/upstream/scons/engine/SCons/Platform/irix.py +0 -44
  521. data/ext/v8/upstream/scons/engine/SCons/Platform/os2.py +0 -58
  522. data/ext/v8/upstream/scons/engine/SCons/Platform/posix.py +0 -264
  523. data/ext/v8/upstream/scons/engine/SCons/Platform/sunos.py +0 -50
  524. data/ext/v8/upstream/scons/engine/SCons/Platform/win32.py +0 -386
  525. data/ext/v8/upstream/scons/engine/SCons/SConf.py +0 -1038
  526. data/ext/v8/upstream/scons/engine/SCons/SConsign.py +0 -381
  527. data/ext/v8/upstream/scons/engine/SCons/Scanner/C.py +0 -132
  528. data/ext/v8/upstream/scons/engine/SCons/Scanner/D.py +0 -74
  529. data/ext/v8/upstream/scons/engine/SCons/Scanner/Dir.py +0 -111
  530. data/ext/v8/upstream/scons/engine/SCons/Scanner/Fortran.py +0 -320
  531. data/ext/v8/upstream/scons/engine/SCons/Scanner/IDL.py +0 -48
  532. data/ext/v8/upstream/scons/engine/SCons/Scanner/LaTeX.py +0 -378
  533. data/ext/v8/upstream/scons/engine/SCons/Scanner/Prog.py +0 -103
  534. data/ext/v8/upstream/scons/engine/SCons/Scanner/RC.py +0 -55
  535. data/ext/v8/upstream/scons/engine/SCons/Scanner/__init__.py +0 -415
  536. data/ext/v8/upstream/scons/engine/SCons/Script/Interactive.py +0 -386
  537. data/ext/v8/upstream/scons/engine/SCons/Script/Main.py +0 -1360
  538. data/ext/v8/upstream/scons/engine/SCons/Script/SConsOptions.py +0 -944
  539. data/ext/v8/upstream/scons/engine/SCons/Script/SConscript.py +0 -642
  540. data/ext/v8/upstream/scons/engine/SCons/Script/__init__.py +0 -414
  541. data/ext/v8/upstream/scons/engine/SCons/Sig.py +0 -63
  542. data/ext/v8/upstream/scons/engine/SCons/Subst.py +0 -911
  543. data/ext/v8/upstream/scons/engine/SCons/Taskmaster.py +0 -1030
  544. data/ext/v8/upstream/scons/engine/SCons/Tool/386asm.py +0 -61
  545. data/ext/v8/upstream/scons/engine/SCons/Tool/BitKeeper.py +0 -65
  546. data/ext/v8/upstream/scons/engine/SCons/Tool/CVS.py +0 -73
  547. data/ext/v8/upstream/scons/engine/SCons/Tool/FortranCommon.py +0 -247
  548. data/ext/v8/upstream/scons/engine/SCons/Tool/JavaCommon.py +0 -324
  549. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/__init__.py +0 -56
  550. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/arch.py +0 -61
  551. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/common.py +0 -210
  552. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/netframework.py +0 -84
  553. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/sdk.py +0 -321
  554. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vc.py +0 -367
  555. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vs.py +0 -497
  556. data/ext/v8/upstream/scons/engine/SCons/Tool/Perforce.py +0 -104
  557. data/ext/v8/upstream/scons/engine/SCons/Tool/PharLapCommon.py +0 -138
  558. data/ext/v8/upstream/scons/engine/SCons/Tool/RCS.py +0 -64
  559. data/ext/v8/upstream/scons/engine/SCons/Tool/SCCS.py +0 -64
  560. data/ext/v8/upstream/scons/engine/SCons/Tool/Subversion.py +0 -71
  561. data/ext/v8/upstream/scons/engine/SCons/Tool/__init__.py +0 -675
  562. data/ext/v8/upstream/scons/engine/SCons/Tool/aixc++.py +0 -82
  563. data/ext/v8/upstream/scons/engine/SCons/Tool/aixcc.py +0 -74
  564. data/ext/v8/upstream/scons/engine/SCons/Tool/aixf77.py +0 -80
  565. data/ext/v8/upstream/scons/engine/SCons/Tool/aixlink.py +0 -76
  566. data/ext/v8/upstream/scons/engine/SCons/Tool/applelink.py +0 -71
  567. data/ext/v8/upstream/scons/engine/SCons/Tool/ar.py +0 -63
  568. data/ext/v8/upstream/scons/engine/SCons/Tool/as.py +0 -78
  569. data/ext/v8/upstream/scons/engine/SCons/Tool/bcc32.py +0 -82
  570. data/ext/v8/upstream/scons/engine/SCons/Tool/c++.py +0 -99
  571. data/ext/v8/upstream/scons/engine/SCons/Tool/cc.py +0 -114
  572. data/ext/v8/upstream/scons/engine/SCons/Tool/cvf.py +0 -58
  573. data/ext/v8/upstream/scons/engine/SCons/Tool/default.py +0 -50
  574. data/ext/v8/upstream/scons/engine/SCons/Tool/dmd.py +0 -224
  575. data/ext/v8/upstream/scons/engine/SCons/Tool/dvi.py +0 -64
  576. data/ext/v8/upstream/scons/engine/SCons/Tool/dvipdf.py +0 -125
  577. data/ext/v8/upstream/scons/engine/SCons/Tool/dvips.py +0 -94
  578. data/ext/v8/upstream/scons/engine/SCons/Tool/f77.py +0 -62
  579. data/ext/v8/upstream/scons/engine/SCons/Tool/f90.py +0 -62
  580. data/ext/v8/upstream/scons/engine/SCons/Tool/f95.py +0 -63
  581. data/ext/v8/upstream/scons/engine/SCons/Tool/filesystem.py +0 -98
  582. data/ext/v8/upstream/scons/engine/SCons/Tool/fortran.py +0 -63
  583. data/ext/v8/upstream/scons/engine/SCons/Tool/g++.py +0 -90
  584. data/ext/v8/upstream/scons/engine/SCons/Tool/g77.py +0 -73
  585. data/ext/v8/upstream/scons/engine/SCons/Tool/gas.py +0 -53
  586. data/ext/v8/upstream/scons/engine/SCons/Tool/gcc.py +0 -80
  587. data/ext/v8/upstream/scons/engine/SCons/Tool/gfortran.py +0 -64
  588. data/ext/v8/upstream/scons/engine/SCons/Tool/gnulink.py +0 -63
  589. data/ext/v8/upstream/scons/engine/SCons/Tool/gs.py +0 -81
  590. data/ext/v8/upstream/scons/engine/SCons/Tool/hpc++.py +0 -85
  591. data/ext/v8/upstream/scons/engine/SCons/Tool/hpcc.py +0 -53
  592. data/ext/v8/upstream/scons/engine/SCons/Tool/hplink.py +0 -77
  593. data/ext/v8/upstream/scons/engine/SCons/Tool/icc.py +0 -59
  594. data/ext/v8/upstream/scons/engine/SCons/Tool/icl.py +0 -52
  595. data/ext/v8/upstream/scons/engine/SCons/Tool/ifl.py +0 -72
  596. data/ext/v8/upstream/scons/engine/SCons/Tool/ifort.py +0 -90
  597. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink.py +0 -59
  598. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink32.py +0 -60
  599. data/ext/v8/upstream/scons/engine/SCons/Tool/install.py +0 -229
  600. data/ext/v8/upstream/scons/engine/SCons/Tool/intelc.py +0 -490
  601. data/ext/v8/upstream/scons/engine/SCons/Tool/ipkg.py +0 -71
  602. data/ext/v8/upstream/scons/engine/SCons/Tool/jar.py +0 -110
  603. data/ext/v8/upstream/scons/engine/SCons/Tool/javac.py +0 -234
  604. data/ext/v8/upstream/scons/engine/SCons/Tool/javah.py +0 -138
  605. data/ext/v8/upstream/scons/engine/SCons/Tool/latex.py +0 -79
  606. data/ext/v8/upstream/scons/engine/SCons/Tool/lex.py +0 -99
  607. data/ext/v8/upstream/scons/engine/SCons/Tool/link.py +0 -121
  608. data/ext/v8/upstream/scons/engine/SCons/Tool/linkloc.py +0 -112
  609. data/ext/v8/upstream/scons/engine/SCons/Tool/m4.py +0 -63
  610. data/ext/v8/upstream/scons/engine/SCons/Tool/masm.py +0 -77
  611. data/ext/v8/upstream/scons/engine/SCons/Tool/midl.py +0 -90
  612. data/ext/v8/upstream/scons/engine/SCons/Tool/mingw.py +0 -159
  613. data/ext/v8/upstream/scons/engine/SCons/Tool/mslib.py +0 -64
  614. data/ext/v8/upstream/scons/engine/SCons/Tool/mslink.py +0 -266
  615. data/ext/v8/upstream/scons/engine/SCons/Tool/mssdk.py +0 -50
  616. data/ext/v8/upstream/scons/engine/SCons/Tool/msvc.py +0 -269
  617. data/ext/v8/upstream/scons/engine/SCons/Tool/msvs.py +0 -1439
  618. data/ext/v8/upstream/scons/engine/SCons/Tool/mwcc.py +0 -208
  619. data/ext/v8/upstream/scons/engine/SCons/Tool/mwld.py +0 -107
  620. data/ext/v8/upstream/scons/engine/SCons/Tool/nasm.py +0 -72
  621. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/__init__.py +0 -314
  622. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/ipk.py +0 -185
  623. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/msi.py +0 -526
  624. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/rpm.py +0 -367
  625. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_tarbz2.py +0 -43
  626. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_targz.py +0 -43
  627. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_zip.py +0 -43
  628. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/tarbz2.py +0 -44
  629. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/targz.py +0 -44
  630. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/zip.py +0 -44
  631. data/ext/v8/upstream/scons/engine/SCons/Tool/pdf.py +0 -78
  632. data/ext/v8/upstream/scons/engine/SCons/Tool/pdflatex.py +0 -83
  633. data/ext/v8/upstream/scons/engine/SCons/Tool/pdftex.py +0 -108
  634. data/ext/v8/upstream/scons/engine/SCons/Tool/qt.py +0 -336
  635. data/ext/v8/upstream/scons/engine/SCons/Tool/rmic.py +0 -121
  636. data/ext/v8/upstream/scons/engine/SCons/Tool/rpcgen.py +0 -70
  637. data/ext/v8/upstream/scons/engine/SCons/Tool/rpm.py +0 -132
  638. data/ext/v8/upstream/scons/engine/SCons/Tool/sgiar.py +0 -68
  639. data/ext/v8/upstream/scons/engine/SCons/Tool/sgic++.py +0 -58
  640. data/ext/v8/upstream/scons/engine/SCons/Tool/sgicc.py +0 -53
  641. data/ext/v8/upstream/scons/engine/SCons/Tool/sgilink.py +0 -63
  642. data/ext/v8/upstream/scons/engine/SCons/Tool/sunar.py +0 -67
  643. data/ext/v8/upstream/scons/engine/SCons/Tool/sunc++.py +0 -142
  644. data/ext/v8/upstream/scons/engine/SCons/Tool/suncc.py +0 -58
  645. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf77.py +0 -63
  646. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf90.py +0 -64
  647. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf95.py +0 -64
  648. data/ext/v8/upstream/scons/engine/SCons/Tool/sunlink.py +0 -77
  649. data/ext/v8/upstream/scons/engine/SCons/Tool/swig.py +0 -186
  650. data/ext/v8/upstream/scons/engine/SCons/Tool/tar.py +0 -73
  651. data/ext/v8/upstream/scons/engine/SCons/Tool/tex.py +0 -805
  652. data/ext/v8/upstream/scons/engine/SCons/Tool/textfile.py +0 -175
  653. data/ext/v8/upstream/scons/engine/SCons/Tool/tlib.py +0 -53
  654. data/ext/v8/upstream/scons/engine/SCons/Tool/wix.py +0 -100
  655. data/ext/v8/upstream/scons/engine/SCons/Tool/yacc.py +0 -131
  656. data/ext/v8/upstream/scons/engine/SCons/Tool/zip.py +0 -100
  657. data/ext/v8/upstream/scons/engine/SCons/Util.py +0 -1645
  658. data/ext/v8/upstream/scons/engine/SCons/Variables/BoolVariable.py +0 -91
  659. data/ext/v8/upstream/scons/engine/SCons/Variables/EnumVariable.py +0 -107
  660. data/ext/v8/upstream/scons/engine/SCons/Variables/ListVariable.py +0 -139
  661. data/ext/v8/upstream/scons/engine/SCons/Variables/PackageVariable.py +0 -109
  662. data/ext/v8/upstream/scons/engine/SCons/Variables/PathVariable.py +0 -147
  663. data/ext/v8/upstream/scons/engine/SCons/Variables/__init__.py +0 -317
  664. data/ext/v8/upstream/scons/engine/SCons/Warnings.py +0 -228
  665. data/ext/v8/upstream/scons/engine/SCons/__init__.py +0 -49
  666. data/ext/v8/upstream/scons/engine/SCons/compat/__init__.py +0 -302
  667. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_UserString.py +0 -98
  668. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_hashlib.py +0 -91
  669. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_itertools.py +0 -124
  670. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_optparse.py +0 -1725
  671. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets.py +0 -583
  672. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets15.py +0 -176
  673. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_shlex.py +0 -325
  674. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_subprocess.py +0 -1296
  675. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_textwrap.py +0 -382
  676. data/ext/v8/upstream/scons/engine/SCons/compat/builtins.py +0 -187
  677. data/ext/v8/upstream/scons/engine/SCons/cpp.py +0 -598
  678. data/ext/v8/upstream/scons/engine/SCons/dblite.py +0 -248
  679. data/ext/v8/upstream/scons/engine/SCons/exitfuncs.py +0 -77
  680. data/ext/v8/upstream/scons/os_spawnv_fix.diff +0 -83
  681. data/ext/v8/upstream/scons/scons-time.1 +0 -1017
  682. data/ext/v8/upstream/scons/scons.1 +0 -15179
  683. data/ext/v8/upstream/scons/sconsign.1 +0 -208
  684. data/ext/v8/upstream/scons/script/scons +0 -184
  685. data/ext/v8/upstream/scons/script/scons-time +0 -1529
  686. data/ext/v8/upstream/scons/script/scons.bat +0 -31
  687. data/ext/v8/upstream/scons/script/sconsign +0 -508
  688. data/ext/v8/upstream/scons/setup.cfg +0 -6
  689. data/ext/v8/upstream/scons/setup.py +0 -427
  690. data/ext/v8/v8.cpp +0 -89
  691. data/ext/v8/v8_cxt.cpp +0 -92
  692. data/ext/v8/v8_cxt.h +0 -20
  693. data/ext/v8/v8_func.cpp +0 -10
  694. data/ext/v8/v8_func.h +0 -11
  695. data/ext/v8/v8_msg.cpp +0 -54
  696. data/ext/v8/v8_msg.h +0 -18
  697. data/ext/v8/v8_obj.cpp +0 -52
  698. data/ext/v8/v8_obj.h +0 -13
  699. data/ext/v8/v8_ref.cpp +0 -26
  700. data/ext/v8/v8_ref.h +0 -31
  701. data/ext/v8/v8_script.cpp +0 -20
  702. data/ext/v8/v8_script.h +0 -8
  703. data/ext/v8/v8_standalone.cpp +0 -69
  704. data/ext/v8/v8_standalone.h +0 -31
  705. data/ext/v8/v8_str.cpp +0 -17
  706. data/ext/v8/v8_str.h +0 -9
  707. data/ext/v8/v8_template.cpp +0 -53
  708. data/ext/v8/v8_template.h +0 -13
  709. data/lib/v8/to.rb +0 -33
  710. data/lib/v8/v8.so +0 -0
  711. data/script/console +0 -10
  712. data/script/destroy +0 -14
  713. data/script/generate +0 -14
  714. data/spec/ext/cxt_spec.rb +0 -25
  715. data/spec/ext/obj_spec.rb +0 -13
  716. data/spec/redjs/jsapi_spec.rb +0 -405
  717. data/spec/redjs/tap.rb +0 -8
  718. data/spec/redjs_helper.rb +0 -3
  719. data/spec/spec.opts +0 -1
  720. data/spec/v8/to_spec.rb +0 -15
  721. data/tasks/rspec.rake +0 -21
@@ -1,79 +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
- // CPU specific code for x64 independent of OS goes here.
29
-
30
- #ifdef __GNUC__
31
- #include "third_party/valgrind/valgrind.h"
32
- #endif
33
-
34
- #include "v8.h"
35
-
36
- #include "cpu.h"
37
- #include "macro-assembler.h"
38
-
39
- namespace v8 {
40
- namespace internal {
41
-
42
- void CPU::Setup() {
43
- CpuFeatures::Probe();
44
- }
45
-
46
-
47
- void CPU::FlushICache(void* start, size_t size) {
48
- // No need to flush the instruction cache on Intel. On Intel instruction
49
- // cache flushing is only necessary when multiple cores running the same
50
- // code simultaneously. V8 (and JavaScript) is single threaded and when code
51
- // is patched on an intel CPU the core performing the patching will have its
52
- // own instruction cache updated automatically.
53
-
54
- // If flushing of the instruction cache becomes necessary Windows has the
55
- // API function FlushInstructionCache.
56
-
57
- // By default, valgrind only checks the stack for writes that might need to
58
- // invalidate already cached translated code. This leads to random
59
- // instability when code patches or moves are sometimes unnoticed. One
60
- // solution is to run valgrind with --smc-check=all, but this comes at a big
61
- // performance cost. We can notify valgrind to invalidate its cache.
62
- #ifdef VALGRIND_DISCARD_TRANSLATIONS
63
- VALGRIND_DISCARD_TRANSLATIONS(start, size);
64
- #endif
65
- }
66
-
67
-
68
- void CPU::DebugBreak() {
69
- #ifdef _MSC_VER
70
- // To avoid Visual Studio runtime support the following code can be used
71
- // instead
72
- // __asm { int 3 }
73
- __debugbreak();
74
- #else
75
- asm("int $3");
76
- #endif
77
- }
78
-
79
- } } // namespace v8::internal
@@ -1,202 +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
-
29
- #include "v8.h"
30
-
31
- #include "codegen-inl.h"
32
- #include "debug.h"
33
-
34
-
35
- namespace v8 {
36
- namespace internal {
37
-
38
- #ifdef ENABLE_DEBUGGER_SUPPORT
39
-
40
- bool Debug::IsDebugBreakAtReturn(v8::internal::RelocInfo* rinfo) {
41
- ASSERT(RelocInfo::IsJSReturn(rinfo->rmode()));
42
- return rinfo->IsPatchedReturnSequence();
43
- }
44
-
45
- #define __ ACCESS_MASM(masm)
46
-
47
- static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
48
- RegList pointer_regs,
49
- bool convert_call_to_jmp) {
50
- // Save the content of all general purpose registers in memory. This copy in
51
- // memory is later pushed onto the JS expression stack for the fake JS frame
52
- // generated and also to the C frame generated on top of that. In the JS
53
- // frame ONLY the registers containing pointers will be pushed on the
54
- // expression stack. This causes the GC to update these pointers so that
55
- // they will have the correct value when returning from the debugger.
56
- __ SaveRegistersToMemory(kJSCallerSaved);
57
-
58
- // Enter an internal frame.
59
- __ EnterInternalFrame();
60
-
61
- // Store the registers containing object pointers on the expression stack to
62
- // make sure that these are correctly updated during GC.
63
- __ PushRegistersFromMemory(pointer_regs);
64
-
65
- #ifdef DEBUG
66
- __ RecordComment("// Calling from debug break to runtime - come in - over");
67
- #endif
68
- __ xor_(rax, rax); // No arguments (argc == 0).
69
- __ movq(rbx, ExternalReference::debug_break());
70
-
71
- CEntryDebugBreakStub ceb;
72
- __ CallStub(&ceb);
73
-
74
- // Restore the register values containing object pointers from the expression
75
- // stack in the reverse order as they where pushed.
76
- __ PopRegistersToMemory(pointer_regs);
77
-
78
- // Get rid of the internal frame.
79
- __ LeaveInternalFrame();
80
-
81
- // If this call did not replace a call but patched other code then there will
82
- // be an unwanted return address left on the stack. Here we get rid of that.
83
- if (convert_call_to_jmp) {
84
- __ pop(rax);
85
- }
86
-
87
- // Finally restore all registers.
88
- __ RestoreRegistersFromMemory(kJSCallerSaved);
89
-
90
- // Now that the break point has been handled, resume normal execution by
91
- // jumping to the target address intended by the caller and that was
92
- // overwritten by the address of DebugBreakXXX.
93
- ExternalReference after_break_target =
94
- ExternalReference(Debug_Address::AfterBreakTarget());
95
- __ movq(kScratchRegister, after_break_target);
96
- __ jmp(Operand(kScratchRegister, 0));
97
- }
98
-
99
-
100
- void Debug::GenerateCallICDebugBreak(MacroAssembler* masm) {
101
- // Register state for keyed IC call call (from ic-x64.cc)
102
- // ----------- S t a t e -------------
103
- // -- rax: number of arguments
104
- // -----------------------------------
105
- // The number of arguments in rax is not smi encoded.
106
- Generate_DebugBreakCallHelper(masm, 0, false);
107
- }
108
-
109
-
110
- void Debug::GenerateConstructCallDebugBreak(MacroAssembler* masm) {
111
- // Register state just before return from JS function (from codegen-x64.cc).
112
- // rax is the actual number of arguments not encoded as a smi, see comment
113
- // above IC call.
114
- // ----------- S t a t e -------------
115
- // -- rax: number of arguments
116
- // -----------------------------------
117
- // The number of arguments in rax is not smi encoded.
118
- Generate_DebugBreakCallHelper(masm, 0, false);
119
- }
120
-
121
-
122
- void Debug::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) {
123
- // Register state for keyed IC load call (from ic-x64.cc).
124
- // ----------- S t a t e -------------
125
- // No registers used on entry.
126
- // -----------------------------------
127
- Generate_DebugBreakCallHelper(masm, 0, false);
128
- }
129
-
130
-
131
- void Debug::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) {
132
- // Register state for keyed IC load call (from ic-x64.cc).
133
- // ----------- S t a t e -------------
134
- // -- rax : value
135
- // -----------------------------------
136
- // Register rax contains an object that needs to be pushed on the
137
- // expression stack of the fake JS frame.
138
- Generate_DebugBreakCallHelper(masm, rax.bit(), false);
139
- }
140
-
141
-
142
- void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) {
143
- // Register state for IC load call (from ic-x64.cc).
144
- // ----------- S t a t e -------------
145
- // -- rcx : name
146
- // -----------------------------------
147
- Generate_DebugBreakCallHelper(masm, rcx.bit(), false);
148
- }
149
-
150
-
151
- void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) {
152
- // Register state just before return from JS function (from codegen-x64.cc).
153
- // ----------- S t a t e -------------
154
- // -- rax: return value
155
- // -----------------------------------
156
- Generate_DebugBreakCallHelper(masm, rax.bit(), true);
157
- }
158
-
159
-
160
- void Debug::GenerateStoreICDebugBreak(MacroAssembler* masm) {
161
- // REgister state for IC store call (from ic-x64.cc).
162
- // ----------- S t a t e -------------
163
- // -- rax : value
164
- // -- rcx : name
165
- // -----------------------------------
166
- Generate_DebugBreakCallHelper(masm, rax.bit() | rcx.bit(), false);
167
- }
168
-
169
-
170
- void Debug::GenerateStubNoRegistersDebugBreak(MacroAssembler* masm) {
171
- // Register state for stub CallFunction (from CallFunctionStub in ic-x64.cc).
172
- // ----------- S t a t e -------------
173
- // No registers used on entry.
174
- // -----------------------------------
175
- Generate_DebugBreakCallHelper(masm, 0, false);
176
- }
177
-
178
-
179
- #undef __
180
-
181
-
182
- void BreakLocationIterator::ClearDebugBreakAtReturn() {
183
- rinfo()->PatchCode(original_rinfo()->pc(),
184
- Assembler::kJSReturnSequenceLength);
185
- }
186
-
187
-
188
- bool BreakLocationIterator::IsDebugBreakAtReturn() {
189
- return Debug::IsDebugBreakAtReturn(rinfo());
190
- }
191
-
192
-
193
- void BreakLocationIterator::SetDebugBreakAtReturn() {
194
- ASSERT(Assembler::kJSReturnSequenceLength >=
195
- Assembler::kCallInstructionLength);
196
- rinfo()->PatchCodeWithCall(Debug::debug_break_return()->entry(),
197
- Assembler::kJSReturnSequenceLength - Assembler::kCallInstructionLength);
198
- }
199
-
200
- #endif // ENABLE_DEBUGGER_SUPPORT
201
-
202
- } } // namespace v8::internal
@@ -1,1596 +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 <assert.h>
29
- #include <stdio.h>
30
- #include <stdarg.h>
31
-
32
- #include "v8.h"
33
- #include "disasm.h"
34
-
35
- namespace disasm {
36
-
37
- enum OperandType {
38
- UNSET_OP_ORDER = 0,
39
- // Operand size decides between 16, 32 and 64 bit operands.
40
- REG_OPER_OP_ORDER = 1, // Register destination, operand source.
41
- OPER_REG_OP_ORDER = 2, // Operand destination, register source.
42
- // Fixed 8-bit operands.
43
- BYTE_SIZE_OPERAND_FLAG = 4,
44
- BYTE_REG_OPER_OP_ORDER = REG_OPER_OP_ORDER | BYTE_SIZE_OPERAND_FLAG,
45
- BYTE_OPER_REG_OP_ORDER = OPER_REG_OP_ORDER | BYTE_SIZE_OPERAND_FLAG
46
- };
47
-
48
- //------------------------------------------------------------------
49
- // Tables
50
- //------------------------------------------------------------------
51
- struct ByteMnemonic {
52
- int b; // -1 terminates, otherwise must be in range (0..255)
53
- OperandType op_order_;
54
- const char* mnem;
55
- };
56
-
57
-
58
- static ByteMnemonic two_operands_instr[] = {
59
- { 0x00, BYTE_OPER_REG_OP_ORDER, "add" },
60
- { 0x01, OPER_REG_OP_ORDER, "add" },
61
- { 0x02, BYTE_REG_OPER_OP_ORDER, "add" },
62
- { 0x03, REG_OPER_OP_ORDER, "add" },
63
- { 0x08, BYTE_OPER_REG_OP_ORDER, "or" },
64
- { 0x09, OPER_REG_OP_ORDER, "or" },
65
- { 0x0A, BYTE_REG_OPER_OP_ORDER, "or" },
66
- { 0x0B, REG_OPER_OP_ORDER, "or" },
67
- { 0x10, BYTE_OPER_REG_OP_ORDER, "adc" },
68
- { 0x11, OPER_REG_OP_ORDER, "adc" },
69
- { 0x12, BYTE_REG_OPER_OP_ORDER, "adc" },
70
- { 0x13, REG_OPER_OP_ORDER, "adc" },
71
- { 0x18, BYTE_OPER_REG_OP_ORDER, "sbb" },
72
- { 0x19, OPER_REG_OP_ORDER, "sbb" },
73
- { 0x1A, BYTE_REG_OPER_OP_ORDER, "sbb" },
74
- { 0x1B, REG_OPER_OP_ORDER, "sbb" },
75
- { 0x20, BYTE_OPER_REG_OP_ORDER, "and" },
76
- { 0x21, OPER_REG_OP_ORDER, "and" },
77
- { 0x22, BYTE_REG_OPER_OP_ORDER, "and" },
78
- { 0x23, REG_OPER_OP_ORDER, "and" },
79
- { 0x28, BYTE_OPER_REG_OP_ORDER, "sub" },
80
- { 0x29, OPER_REG_OP_ORDER, "sub" },
81
- { 0x2A, BYTE_REG_OPER_OP_ORDER, "sub" },
82
- { 0x2B, REG_OPER_OP_ORDER, "sub" },
83
- { 0x30, BYTE_OPER_REG_OP_ORDER, "xor" },
84
- { 0x31, OPER_REG_OP_ORDER, "xor" },
85
- { 0x32, BYTE_REG_OPER_OP_ORDER, "xor" },
86
- { 0x33, REG_OPER_OP_ORDER, "xor" },
87
- { 0x38, BYTE_OPER_REG_OP_ORDER, "cmp" },
88
- { 0x39, OPER_REG_OP_ORDER, "cmp" },
89
- { 0x3A, BYTE_REG_OPER_OP_ORDER, "cmp" },
90
- { 0x3B, REG_OPER_OP_ORDER, "cmp" },
91
- { 0x63, REG_OPER_OP_ORDER, "movsxlq" },
92
- { 0x84, BYTE_REG_OPER_OP_ORDER, "test" },
93
- { 0x85, REG_OPER_OP_ORDER, "test" },
94
- { 0x86, BYTE_REG_OPER_OP_ORDER, "xchg" },
95
- { 0x87, REG_OPER_OP_ORDER, "xchg" },
96
- { 0x88, BYTE_OPER_REG_OP_ORDER, "mov" },
97
- { 0x89, OPER_REG_OP_ORDER, "mov" },
98
- { 0x8A, BYTE_REG_OPER_OP_ORDER, "mov" },
99
- { 0x8B, REG_OPER_OP_ORDER, "mov" },
100
- { 0x8D, REG_OPER_OP_ORDER, "lea" },
101
- { -1, UNSET_OP_ORDER, "" }
102
- };
103
-
104
-
105
- static ByteMnemonic zero_operands_instr[] = {
106
- { 0xC3, UNSET_OP_ORDER, "ret" },
107
- { 0xC9, UNSET_OP_ORDER, "leave" },
108
- { 0xF4, UNSET_OP_ORDER, "hlt" },
109
- { 0xCC, UNSET_OP_ORDER, "int3" },
110
- { 0x60, UNSET_OP_ORDER, "pushad" },
111
- { 0x61, UNSET_OP_ORDER, "popad" },
112
- { 0x9C, UNSET_OP_ORDER, "pushfd" },
113
- { 0x9D, UNSET_OP_ORDER, "popfd" },
114
- { 0x9E, UNSET_OP_ORDER, "sahf" },
115
- { 0x99, UNSET_OP_ORDER, "cdq" },
116
- { 0x9B, UNSET_OP_ORDER, "fwait" },
117
- { -1, UNSET_OP_ORDER, "" }
118
- };
119
-
120
-
121
- static ByteMnemonic call_jump_instr[] = {
122
- { 0xE8, UNSET_OP_ORDER, "call" },
123
- { 0xE9, UNSET_OP_ORDER, "jmp" },
124
- { -1, UNSET_OP_ORDER, "" }
125
- };
126
-
127
-
128
- static ByteMnemonic short_immediate_instr[] = {
129
- { 0x05, UNSET_OP_ORDER, "add" },
130
- { 0x0D, UNSET_OP_ORDER, "or" },
131
- { 0x15, UNSET_OP_ORDER, "adc" },
132
- { 0x1D, UNSET_OP_ORDER, "sbb" },
133
- { 0x25, UNSET_OP_ORDER, "and" },
134
- { 0x2D, UNSET_OP_ORDER, "sub" },
135
- { 0x35, UNSET_OP_ORDER, "xor" },
136
- { 0x3D, UNSET_OP_ORDER, "cmp" },
137
- { -1, UNSET_OP_ORDER, "" }
138
- };
139
-
140
-
141
- static const char* conditional_code_suffix[] = {
142
- "o", "no", "c", "nc", "z", "nz", "na", "a",
143
- "s", "ns", "pe", "po", "l", "ge", "le", "g"
144
- };
145
-
146
-
147
- enum InstructionType {
148
- NO_INSTR,
149
- ZERO_OPERANDS_INSTR,
150
- TWO_OPERANDS_INSTR,
151
- JUMP_CONDITIONAL_SHORT_INSTR,
152
- REGISTER_INSTR,
153
- PUSHPOP_INSTR, // Has implicit 64-bit operand size.
154
- MOVE_REG_INSTR,
155
- CALL_JUMP_INSTR,
156
- SHORT_IMMEDIATE_INSTR
157
- };
158
-
159
-
160
- struct InstructionDesc {
161
- const char* mnem;
162
- InstructionType type;
163
- OperandType op_order_;
164
- bool byte_size_operation; // Fixed 8-bit operation.
165
- };
166
-
167
-
168
- class InstructionTable {
169
- public:
170
- InstructionTable();
171
- const InstructionDesc& Get(byte x) const {
172
- return instructions_[x];
173
- }
174
-
175
- private:
176
- InstructionDesc instructions_[256];
177
- void Clear();
178
- void Init();
179
- void CopyTable(ByteMnemonic bm[], InstructionType type);
180
- void SetTableRange(InstructionType type, byte start, byte end, bool byte_size,
181
- const char* mnem);
182
- void AddJumpConditionalShort();
183
- };
184
-
185
-
186
- InstructionTable::InstructionTable() {
187
- Clear();
188
- Init();
189
- }
190
-
191
-
192
- void InstructionTable::Clear() {
193
- for (int i = 0; i < 256; i++) {
194
- instructions_[i].mnem = "(bad)";
195
- instructions_[i].type = NO_INSTR;
196
- instructions_[i].op_order_ = UNSET_OP_ORDER;
197
- instructions_[i].byte_size_operation = false;
198
- }
199
- }
200
-
201
-
202
- void InstructionTable::Init() {
203
- CopyTable(two_operands_instr, TWO_OPERANDS_INSTR);
204
- CopyTable(zero_operands_instr, ZERO_OPERANDS_INSTR);
205
- CopyTable(call_jump_instr, CALL_JUMP_INSTR);
206
- CopyTable(short_immediate_instr, SHORT_IMMEDIATE_INSTR);
207
- AddJumpConditionalShort();
208
- SetTableRange(PUSHPOP_INSTR, 0x50, 0x57, false, "push");
209
- SetTableRange(PUSHPOP_INSTR, 0x58, 0x5F, false, "pop");
210
- SetTableRange(MOVE_REG_INSTR, 0xB8, 0xBF, false, "mov");
211
- }
212
-
213
-
214
- void InstructionTable::CopyTable(ByteMnemonic bm[], InstructionType type) {
215
- for (int i = 0; bm[i].b >= 0; i++) {
216
- InstructionDesc* id = &instructions_[bm[i].b];
217
- id->mnem = bm[i].mnem;
218
- OperandType op_order = bm[i].op_order_;
219
- id->op_order_ =
220
- static_cast<OperandType>(op_order & ~BYTE_SIZE_OPERAND_FLAG);
221
- ASSERT_EQ(NO_INSTR, id->type); // Information not already entered
222
- id->type = type;
223
- id->byte_size_operation = ((op_order & BYTE_SIZE_OPERAND_FLAG) != 0);
224
- }
225
- }
226
-
227
-
228
- void InstructionTable::SetTableRange(InstructionType type,
229
- byte start,
230
- byte end,
231
- bool byte_size,
232
- const char* mnem) {
233
- for (byte b = start; b <= end; b++) {
234
- InstructionDesc* id = &instructions_[b];
235
- ASSERT_EQ(NO_INSTR, id->type); // Information not already entered
236
- id->mnem = mnem;
237
- id->type = type;
238
- id->byte_size_operation = byte_size;
239
- }
240
- }
241
-
242
-
243
- void InstructionTable::AddJumpConditionalShort() {
244
- for (byte b = 0x70; b <= 0x7F; b++) {
245
- InstructionDesc* id = &instructions_[b];
246
- ASSERT_EQ(NO_INSTR, id->type); // Information not already entered
247
- id->mnem = NULL; // Computed depending on condition code.
248
- id->type = JUMP_CONDITIONAL_SHORT_INSTR;
249
- }
250
- }
251
-
252
-
253
- static InstructionTable instruction_table;
254
-
255
- static InstructionDesc cmov_instructions[16] = {
256
- {"cmovo", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
257
- {"cmovno", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
258
- {"cmovc", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
259
- {"cmovnc", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
260
- {"cmovz", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
261
- {"cmovnz", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
262
- {"cmovna", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
263
- {"cmova", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
264
- {"cmovs", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
265
- {"cmovns", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
266
- {"cmovpe", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
267
- {"cmovpo", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
268
- {"cmovl", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
269
- {"cmovge", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
270
- {"cmovle", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
271
- {"cmovg", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}
272
- };
273
-
274
- //------------------------------------------------------------------------------
275
- // DisassemblerX64 implementation.
276
-
277
- enum UnimplementedOpcodeAction {
278
- CONTINUE_ON_UNIMPLEMENTED_OPCODE,
279
- ABORT_ON_UNIMPLEMENTED_OPCODE
280
- };
281
-
282
- // A new DisassemblerX64 object is created to disassemble each instruction.
283
- // The object can only disassemble a single instruction.
284
- class DisassemblerX64 {
285
- public:
286
- DisassemblerX64(const NameConverter& converter,
287
- UnimplementedOpcodeAction unimplemented_action =
288
- ABORT_ON_UNIMPLEMENTED_OPCODE)
289
- : converter_(converter),
290
- tmp_buffer_pos_(0),
291
- abort_on_unimplemented_(
292
- unimplemented_action == ABORT_ON_UNIMPLEMENTED_OPCODE),
293
- rex_(0),
294
- operand_size_(0),
295
- group_1_prefix_(0),
296
- byte_size_operand_(false) {
297
- tmp_buffer_[0] = '\0';
298
- }
299
-
300
- virtual ~DisassemblerX64() {
301
- }
302
-
303
- // Writes one disassembled instruction into 'buffer' (0-terminated).
304
- // Returns the length of the disassembled machine instruction in bytes.
305
- int InstructionDecode(v8::internal::Vector<char> buffer, byte* instruction);
306
-
307
- private:
308
- enum OperandSize {
309
- BYTE_SIZE = 0,
310
- WORD_SIZE = 1,
311
- DOUBLEWORD_SIZE = 2,
312
- QUADWORD_SIZE = 3
313
- };
314
-
315
- const NameConverter& converter_;
316
- v8::internal::EmbeddedVector<char, 128> tmp_buffer_;
317
- unsigned int tmp_buffer_pos_;
318
- bool abort_on_unimplemented_;
319
- // Prefixes parsed
320
- byte rex_;
321
- byte operand_size_; // 0x66 or (if no group 3 prefix is present) 0x0.
322
- byte group_1_prefix_; // 0xF2, 0xF3, or (if no group 1 prefix is present) 0.
323
- // Byte size operand override.
324
- bool byte_size_operand_;
325
-
326
- void setRex(byte rex) {
327
- ASSERT_EQ(0x40, rex & 0xF0);
328
- rex_ = rex;
329
- }
330
-
331
- bool rex() { return rex_ != 0; }
332
-
333
- bool rex_b() { return (rex_ & 0x01) != 0; }
334
-
335
- // Actual number of base register given the low bits and the rex.b state.
336
- int base_reg(int low_bits) { return low_bits | ((rex_ & 0x01) << 3); }
337
-
338
- bool rex_x() { return (rex_ & 0x02) != 0; }
339
-
340
- bool rex_r() { return (rex_ & 0x04) != 0; }
341
-
342
- bool rex_w() { return (rex_ & 0x08) != 0; }
343
-
344
- OperandSize operand_size() {
345
- if (byte_size_operand_) return BYTE_SIZE;
346
- if (rex_w()) return QUADWORD_SIZE;
347
- if (operand_size_ != 0) return WORD_SIZE;
348
- return DOUBLEWORD_SIZE;
349
- }
350
-
351
- char operand_size_code() {
352
- return "bwlq"[operand_size()];
353
- }
354
-
355
- const char* NameOfCPURegister(int reg) const {
356
- return converter_.NameOfCPURegister(reg);
357
- }
358
-
359
- const char* NameOfByteCPURegister(int reg) const {
360
- return converter_.NameOfByteCPURegister(reg);
361
- }
362
-
363
- const char* NameOfXMMRegister(int reg) const {
364
- return converter_.NameOfXMMRegister(reg);
365
- }
366
-
367
- const char* NameOfAddress(byte* addr) const {
368
- return converter_.NameOfAddress(addr);
369
- }
370
-
371
- // Disassembler helper functions.
372
- void get_modrm(byte data,
373
- int* mod,
374
- int* regop,
375
- int* rm) {
376
- *mod = (data >> 6) & 3;
377
- *regop = ((data & 0x38) >> 3) | (rex_r() ? 8 : 0);
378
- *rm = (data & 7) | (rex_b() ? 8 : 0);
379
- }
380
-
381
- void get_sib(byte data,
382
- int* scale,
383
- int* index,
384
- int* base) {
385
- *scale = (data >> 6) & 3;
386
- *index = ((data >> 3) & 7) | (rex_x() ? 8 : 0);
387
- *base = (data & 7) | (rex_b() ? 8 : 0);
388
- }
389
-
390
- typedef const char* (DisassemblerX64::*RegisterNameMapping)(int reg) const;
391
-
392
- int PrintRightOperandHelper(byte* modrmp,
393
- RegisterNameMapping register_name);
394
- int PrintRightOperand(byte* modrmp);
395
- int PrintRightByteOperand(byte* modrmp);
396
- int PrintRightXMMOperand(byte* modrmp);
397
- int PrintOperands(const char* mnem,
398
- OperandType op_order,
399
- byte* data);
400
- int PrintImmediate(byte* data, OperandSize size);
401
- int PrintImmediateOp(byte* data);
402
- const char* TwoByteMnemonic(byte opcode);
403
- int TwoByteOpcodeInstruction(byte* data);
404
- int F6F7Instruction(byte* data);
405
- int ShiftInstruction(byte* data);
406
- int JumpShort(byte* data);
407
- int JumpConditional(byte* data);
408
- int JumpConditionalShort(byte* data);
409
- int SetCC(byte* data);
410
- int FPUInstruction(byte* data);
411
- int MemoryFPUInstruction(int escape_opcode, int regop, byte* modrm_start);
412
- int RegisterFPUInstruction(int escape_opcode, byte modrm_byte);
413
- void AppendToBuffer(const char* format, ...);
414
-
415
- void UnimplementedInstruction() {
416
- if (abort_on_unimplemented_) {
417
- CHECK(false);
418
- } else {
419
- AppendToBuffer("'Unimplemented Instruction'");
420
- }
421
- }
422
- };
423
-
424
-
425
- void DisassemblerX64::AppendToBuffer(const char* format, ...) {
426
- v8::internal::Vector<char> buf = tmp_buffer_ + tmp_buffer_pos_;
427
- va_list args;
428
- va_start(args, format);
429
- int result = v8::internal::OS::VSNPrintF(buf, format, args);
430
- va_end(args);
431
- tmp_buffer_pos_ += result;
432
- }
433
-
434
-
435
- int DisassemblerX64::PrintRightOperandHelper(
436
- byte* modrmp,
437
- RegisterNameMapping register_name) {
438
- int mod, regop, rm;
439
- get_modrm(*modrmp, &mod, &regop, &rm);
440
- switch (mod) {
441
- case 0:
442
- if ((rm & 7) == 5) {
443
- int32_t disp = *reinterpret_cast<int32_t*>(modrmp + 1);
444
- AppendToBuffer("[0x%x]", disp);
445
- return 5;
446
- } else if ((rm & 7) == 4) {
447
- // Codes for SIB byte.
448
- byte sib = *(modrmp + 1);
449
- int scale, index, base;
450
- get_sib(sib, &scale, &index, &base);
451
- if (index == 4 && (base & 7) == 4 && scale == 0 /*times_1*/) {
452
- // index == rsp means no index. Only use sib byte with no index for
453
- // rsp and r12 base.
454
- AppendToBuffer("[%s]", (this->*register_name)(base));
455
- return 2;
456
- } else if (base == 5) {
457
- // base == rbp means no base register (when mod == 0).
458
- int32_t disp = *reinterpret_cast<int32_t*>(modrmp + 2);
459
- AppendToBuffer("[%s*%d+0x%x]",
460
- (this->*register_name)(index),
461
- 1 << scale, disp);
462
- return 6;
463
- } else if (index != 4 && base != 5) {
464
- // [base+index*scale]
465
- AppendToBuffer("[%s+%s*%d]",
466
- (this->*register_name)(base),
467
- (this->*register_name)(index),
468
- 1 << scale);
469
- return 2;
470
- } else {
471
- UnimplementedInstruction();
472
- return 1;
473
- }
474
- } else {
475
- AppendToBuffer("[%s]", (this->*register_name)(rm));
476
- return 1;
477
- }
478
- break;
479
- case 1: // fall through
480
- case 2:
481
- if ((rm & 7) == 4) {
482
- byte sib = *(modrmp + 1);
483
- int scale, index, base;
484
- get_sib(sib, &scale, &index, &base);
485
- int disp = (mod == 2) ? *reinterpret_cast<int32_t*>(modrmp + 2)
486
- : *reinterpret_cast<char*>(modrmp + 2);
487
- if (index == 4 && (base & 7) == 4 && scale == 0 /*times_1*/) {
488
- if (-disp > 0) {
489
- AppendToBuffer("[%s-0x%x]", (this->*register_name)(base), -disp);
490
- } else {
491
- AppendToBuffer("[%s+0x%x]", (this->*register_name)(base), disp);
492
- }
493
- } else {
494
- if (-disp > 0) {
495
- AppendToBuffer("[%s+%s*%d-0x%x]",
496
- (this->*register_name)(base),
497
- (this->*register_name)(index),
498
- 1 << scale,
499
- -disp);
500
- } else {
501
- AppendToBuffer("[%s+%s*%d+0x%x]",
502
- (this->*register_name)(base),
503
- (this->*register_name)(index),
504
- 1 << scale,
505
- disp);
506
- }
507
- }
508
- return mod == 2 ? 6 : 3;
509
- } else {
510
- // No sib.
511
- int disp = (mod == 2) ? *reinterpret_cast<int32_t*>(modrmp + 1)
512
- : *reinterpret_cast<char*>(modrmp + 1);
513
- if (-disp > 0) {
514
- AppendToBuffer("[%s-0x%x]", (this->*register_name)(rm), -disp);
515
- } else {
516
- AppendToBuffer("[%s+0x%x]", (this->*register_name)(rm), disp);
517
- }
518
- return (mod == 2) ? 5 : 2;
519
- }
520
- break;
521
- case 3:
522
- AppendToBuffer("%s", (this->*register_name)(rm));
523
- return 1;
524
- default:
525
- UnimplementedInstruction();
526
- return 1;
527
- }
528
- UNREACHABLE();
529
- }
530
-
531
-
532
- int DisassemblerX64::PrintImmediate(byte* data, OperandSize size) {
533
- int64_t value;
534
- int count;
535
- switch (size) {
536
- case BYTE_SIZE:
537
- value = *data;
538
- count = 1;
539
- break;
540
- case WORD_SIZE:
541
- value = *reinterpret_cast<int16_t*>(data);
542
- count = 2;
543
- break;
544
- case DOUBLEWORD_SIZE:
545
- value = *reinterpret_cast<uint32_t*>(data);
546
- count = 4;
547
- break;
548
- case QUADWORD_SIZE:
549
- value = *reinterpret_cast<int32_t*>(data);
550
- count = 4;
551
- break;
552
- default:
553
- UNREACHABLE();
554
- value = 0; // Initialize variables on all paths to satisfy the compiler.
555
- count = 0;
556
- }
557
- AppendToBuffer("%" V8_PTR_PREFIX "x", value);
558
- return count;
559
- }
560
-
561
-
562
- int DisassemblerX64::PrintRightOperand(byte* modrmp) {
563
- return PrintRightOperandHelper(modrmp,
564
- &DisassemblerX64::NameOfCPURegister);
565
- }
566
-
567
-
568
- int DisassemblerX64::PrintRightByteOperand(byte* modrmp) {
569
- return PrintRightOperandHelper(modrmp,
570
- &DisassemblerX64::NameOfByteCPURegister);
571
- }
572
-
573
-
574
- int DisassemblerX64::PrintRightXMMOperand(byte* modrmp) {
575
- return PrintRightOperandHelper(modrmp,
576
- &DisassemblerX64::NameOfXMMRegister);
577
- }
578
-
579
-
580
- // Returns number of bytes used including the current *data.
581
- // Writes instruction's mnemonic, left and right operands to 'tmp_buffer_'.
582
- int DisassemblerX64::PrintOperands(const char* mnem,
583
- OperandType op_order,
584
- byte* data) {
585
- byte modrm = *data;
586
- int mod, regop, rm;
587
- get_modrm(modrm, &mod, &regop, &rm);
588
- int advance = 0;
589
- const char* register_name =
590
- byte_size_operand_ ? NameOfByteCPURegister(regop)
591
- : NameOfCPURegister(regop);
592
- switch (op_order) {
593
- case REG_OPER_OP_ORDER: {
594
- AppendToBuffer("%s%c %s,",
595
- mnem,
596
- operand_size_code(),
597
- register_name);
598
- advance = byte_size_operand_ ? PrintRightByteOperand(data)
599
- : PrintRightOperand(data);
600
- break;
601
- }
602
- case OPER_REG_OP_ORDER: {
603
- AppendToBuffer("%s%c ", mnem, operand_size_code());
604
- advance = byte_size_operand_ ? PrintRightByteOperand(data)
605
- : PrintRightOperand(data);
606
- AppendToBuffer(",%s", register_name);
607
- break;
608
- }
609
- default:
610
- UNREACHABLE();
611
- break;
612
- }
613
- return advance;
614
- }
615
-
616
-
617
- // Returns number of bytes used by machine instruction, including *data byte.
618
- // Writes immediate instructions to 'tmp_buffer_'.
619
- int DisassemblerX64::PrintImmediateOp(byte* data) {
620
- bool byte_size_immediate = (*data & 0x02) != 0;
621
- byte modrm = *(data + 1);
622
- int mod, regop, rm;
623
- get_modrm(modrm, &mod, &regop, &rm);
624
- const char* mnem = "Imm???";
625
- switch (regop) {
626
- case 0:
627
- mnem = "add";
628
- break;
629
- case 1:
630
- mnem = "or";
631
- break;
632
- case 2:
633
- mnem = "adc";
634
- break;
635
- case 4:
636
- mnem = "and";
637
- break;
638
- case 5:
639
- mnem = "sub";
640
- break;
641
- case 6:
642
- mnem = "xor";
643
- break;
644
- case 7:
645
- mnem = "cmp";
646
- break;
647
- default:
648
- UnimplementedInstruction();
649
- }
650
- AppendToBuffer("%s%c ", mnem, operand_size_code());
651
- int count = PrintRightOperand(data + 1);
652
- AppendToBuffer(",0x");
653
- OperandSize immediate_size = byte_size_immediate ? BYTE_SIZE : operand_size();
654
- count += PrintImmediate(data + 1 + count, immediate_size);
655
- return 1 + count;
656
- }
657
-
658
-
659
- // Returns number of bytes used, including *data.
660
- int DisassemblerX64::F6F7Instruction(byte* data) {
661
- ASSERT(*data == 0xF7 || *data == 0xF6);
662
- byte modrm = *(data + 1);
663
- int mod, regop, rm;
664
- get_modrm(modrm, &mod, &regop, &rm);
665
- if (mod == 3 && regop != 0) {
666
- const char* mnem = NULL;
667
- switch (regop) {
668
- case 2:
669
- mnem = "not";
670
- break;
671
- case 3:
672
- mnem = "neg";
673
- break;
674
- case 4:
675
- mnem = "mul";
676
- break;
677
- case 7:
678
- mnem = "idiv";
679
- break;
680
- default:
681
- UnimplementedInstruction();
682
- }
683
- AppendToBuffer("%s%c %s",
684
- mnem,
685
- operand_size_code(),
686
- NameOfCPURegister(rm));
687
- return 2;
688
- } else if (regop == 0) {
689
- AppendToBuffer("test%c ", operand_size_code());
690
- int count = PrintRightOperand(data + 1); // Use name of 64-bit register.
691
- AppendToBuffer(",0x");
692
- count += PrintImmediate(data + 1 + count, operand_size());
693
- return 1 + count;
694
- } else {
695
- UnimplementedInstruction();
696
- return 2;
697
- }
698
- }
699
-
700
-
701
- int DisassemblerX64::ShiftInstruction(byte* data) {
702
- byte op = *data & (~1);
703
- if (op != 0xD0 && op != 0xD2 && op != 0xC0) {
704
- UnimplementedInstruction();
705
- return 1;
706
- }
707
- byte modrm = *(data + 1);
708
- int mod, regop, rm;
709
- get_modrm(modrm, &mod, &regop, &rm);
710
- regop &= 0x7; // The REX.R bit does not affect the operation.
711
- int imm8 = -1;
712
- int num_bytes = 2;
713
- if (mod != 3) {
714
- UnimplementedInstruction();
715
- return num_bytes;
716
- }
717
- const char* mnem = NULL;
718
- switch (regop) {
719
- case 0:
720
- mnem = "rol";
721
- break;
722
- case 1:
723
- mnem = "ror";
724
- break;
725
- case 2:
726
- mnem = "rcl";
727
- break;
728
- case 3:
729
- mnem = "rcr";
730
- break;
731
- case 4:
732
- mnem = "shl";
733
- break;
734
- case 5:
735
- mnem = "shr";
736
- break;
737
- case 7:
738
- mnem = "sar";
739
- break;
740
- default:
741
- UnimplementedInstruction();
742
- return num_bytes;
743
- }
744
- ASSERT_NE(NULL, mnem);
745
- if (op == 0xD0) {
746
- imm8 = 1;
747
- } else if (op == 0xC0) {
748
- imm8 = *(data + 2);
749
- num_bytes = 3;
750
- }
751
- AppendToBuffer("%s%c %s,",
752
- mnem,
753
- operand_size_code(),
754
- byte_size_operand_ ? NameOfByteCPURegister(rm)
755
- : NameOfCPURegister(rm));
756
- if (op == 0xD2) {
757
- AppendToBuffer("cl");
758
- } else {
759
- AppendToBuffer("%d", imm8);
760
- }
761
- return num_bytes;
762
- }
763
-
764
-
765
- // Returns number of bytes used, including *data.
766
- int DisassemblerX64::JumpShort(byte* data) {
767
- ASSERT_EQ(0xEB, *data);
768
- byte b = *(data + 1);
769
- byte* dest = data + static_cast<int8_t>(b) + 2;
770
- AppendToBuffer("jmp %s", NameOfAddress(dest));
771
- return 2;
772
- }
773
-
774
-
775
- // Returns number of bytes used, including *data.
776
- int DisassemblerX64::JumpConditional(byte* data) {
777
- ASSERT_EQ(0x0F, *data);
778
- byte cond = *(data + 1) & 0x0F;
779
- byte* dest = data + *reinterpret_cast<int32_t*>(data + 2) + 6;
780
- const char* mnem = conditional_code_suffix[cond];
781
- AppendToBuffer("j%s %s", mnem, NameOfAddress(dest));
782
- return 6; // includes 0x0F
783
- }
784
-
785
-
786
- // Returns number of bytes used, including *data.
787
- int DisassemblerX64::JumpConditionalShort(byte* data) {
788
- byte cond = *data & 0x0F;
789
- byte b = *(data + 1);
790
- byte* dest = data + static_cast<int8_t>(b) + 2;
791
- const char* mnem = conditional_code_suffix[cond];
792
- AppendToBuffer("j%s %s", mnem, NameOfAddress(dest));
793
- return 2;
794
- }
795
-
796
-
797
- // Returns number of bytes used, including *data.
798
- int DisassemblerX64::SetCC(byte* data) {
799
- ASSERT_EQ(0x0F, *data);
800
- byte cond = *(data + 1) & 0x0F;
801
- const char* mnem = conditional_code_suffix[cond];
802
- AppendToBuffer("set%s%c ", mnem, operand_size_code());
803
- PrintRightByteOperand(data + 2);
804
- return 3; // includes 0x0F
805
- }
806
-
807
-
808
- // Returns number of bytes used, including *data.
809
- int DisassemblerX64::FPUInstruction(byte* data) {
810
- byte escape_opcode = *data;
811
- ASSERT_EQ(0xD8, escape_opcode & 0xF8);
812
- byte modrm_byte = *(data+1);
813
-
814
- if (modrm_byte >= 0xC0) {
815
- return RegisterFPUInstruction(escape_opcode, modrm_byte);
816
- } else {
817
- return MemoryFPUInstruction(escape_opcode, modrm_byte, data+1);
818
- }
819
- }
820
-
821
- int DisassemblerX64::MemoryFPUInstruction(int escape_opcode,
822
- int modrm_byte,
823
- byte* modrm_start) {
824
- const char* mnem = "?";
825
- int regop = (modrm_byte >> 3) & 0x7; // reg/op field of modrm byte.
826
- switch (escape_opcode) {
827
- case 0xD9: switch (regop) {
828
- case 0: mnem = "fld_s"; break;
829
- case 3: mnem = "fstp_s"; break;
830
- case 7: mnem = "fstcw"; break;
831
- default: UnimplementedInstruction();
832
- }
833
- break;
834
-
835
- case 0xDB: switch (regop) {
836
- case 0: mnem = "fild_s"; break;
837
- case 1: mnem = "fisttp_s"; break;
838
- case 2: mnem = "fist_s"; break;
839
- case 3: mnem = "fistp_s"; break;
840
- default: UnimplementedInstruction();
841
- }
842
- break;
843
-
844
- case 0xDD: switch (regop) {
845
- case 0: mnem = "fld_d"; break;
846
- case 3: mnem = "fstp_d"; break;
847
- default: UnimplementedInstruction();
848
- }
849
- break;
850
-
851
- case 0xDF: switch (regop) {
852
- case 5: mnem = "fild_d"; break;
853
- case 7: mnem = "fistp_d"; break;
854
- default: UnimplementedInstruction();
855
- }
856
- break;
857
-
858
- default: UnimplementedInstruction();
859
- }
860
- AppendToBuffer("%s ", mnem);
861
- int count = PrintRightOperand(modrm_start);
862
- return count + 1;
863
- }
864
-
865
- int DisassemblerX64::RegisterFPUInstruction(int escape_opcode,
866
- byte modrm_byte) {
867
- bool has_register = false; // Is the FPU register encoded in modrm_byte?
868
- const char* mnem = "?";
869
-
870
- switch (escape_opcode) {
871
- case 0xD8:
872
- UnimplementedInstruction();
873
- break;
874
-
875
- case 0xD9:
876
- switch (modrm_byte & 0xF8) {
877
- case 0xC8:
878
- mnem = "fxch";
879
- has_register = true;
880
- break;
881
- default:
882
- switch (modrm_byte) {
883
- case 0xE0: mnem = "fchs"; break;
884
- case 0xE1: mnem = "fabs"; break;
885
- case 0xE4: mnem = "ftst"; break;
886
- case 0xE8: mnem = "fld1"; break;
887
- case 0xEE: mnem = "fldz"; break;
888
- case 0xF5: mnem = "fprem1"; break;
889
- case 0xF7: mnem = "fincstp"; break;
890
- case 0xF8: mnem = "fprem"; break;
891
- case 0xFE: mnem = "fsin"; break;
892
- case 0xFF: mnem = "fcos"; break;
893
- default: UnimplementedInstruction();
894
- }
895
- }
896
- break;
897
-
898
- case 0xDA:
899
- if (modrm_byte == 0xE9) {
900
- mnem = "fucompp";
901
- } else {
902
- UnimplementedInstruction();
903
- }
904
- break;
905
-
906
- case 0xDB:
907
- if ((modrm_byte & 0xF8) == 0xE8) {
908
- mnem = "fucomi";
909
- has_register = true;
910
- } else if (modrm_byte == 0xE2) {
911
- mnem = "fclex";
912
- } else {
913
- UnimplementedInstruction();
914
- }
915
- break;
916
-
917
- case 0xDC:
918
- has_register = true;
919
- switch (modrm_byte & 0xF8) {
920
- case 0xC0: mnem = "fadd"; break;
921
- case 0xE8: mnem = "fsub"; break;
922
- case 0xC8: mnem = "fmul"; break;
923
- case 0xF8: mnem = "fdiv"; break;
924
- default: UnimplementedInstruction();
925
- }
926
- break;
927
-
928
- case 0xDD:
929
- has_register = true;
930
- switch (modrm_byte & 0xF8) {
931
- case 0xC0: mnem = "ffree"; break;
932
- case 0xD8: mnem = "fstp"; break;
933
- default: UnimplementedInstruction();
934
- }
935
- break;
936
-
937
- case 0xDE:
938
- if (modrm_byte == 0xD9) {
939
- mnem = "fcompp";
940
- } else {
941
- has_register = true;
942
- switch (modrm_byte & 0xF8) {
943
- case 0xC0: mnem = "faddp"; break;
944
- case 0xE8: mnem = "fsubp"; break;
945
- case 0xC8: mnem = "fmulp"; break;
946
- case 0xF8: mnem = "fdivp"; break;
947
- default: UnimplementedInstruction();
948
- }
949
- }
950
- break;
951
-
952
- case 0xDF:
953
- if (modrm_byte == 0xE0) {
954
- mnem = "fnstsw_ax";
955
- } else if ((modrm_byte & 0xF8) == 0xE8) {
956
- mnem = "fucomip";
957
- has_register = true;
958
- }
959
- break;
960
-
961
- default: UnimplementedInstruction();
962
- }
963
-
964
- if (has_register) {
965
- AppendToBuffer("%s st%d", mnem, modrm_byte & 0x7);
966
- } else {
967
- AppendToBuffer("%s", mnem);
968
- }
969
- return 2;
970
- }
971
-
972
-
973
-
974
- // Handle all two-byte opcodes, which start with 0x0F.
975
- // These instructions may be affected by an 0x66, 0xF2, or 0xF3 prefix.
976
- // We do not use any three-byte opcodes, which start with 0x0F38 or 0x0F3A.
977
- int DisassemblerX64::TwoByteOpcodeInstruction(byte* data) {
978
- byte opcode = *(data + 1);
979
- byte* current = data + 2;
980
- // At return, "current" points to the start of the next instruction.
981
- const char* mnemonic = TwoByteMnemonic(opcode);
982
- if (opcode == 0x1F) {
983
- // NOP
984
- int mod, regop, rm;
985
- get_modrm(*current, &mod, &regop, &rm);
986
- current++;
987
- if (regop == 4) { // SIB byte present.
988
- current++;
989
- }
990
- if (mod == 1) { // Byte displacement.
991
- current += 1;
992
- } else if (mod == 2) { // 32-bit displacement.
993
- current += 4;
994
- } // else no immediate displacement.
995
- AppendToBuffer("nop");
996
-
997
- } else if (opcode == 0xA2 || opcode == 0x31) {
998
- // RDTSC or CPUID
999
- AppendToBuffer("%s", mnemonic);
1000
-
1001
- } else if ((opcode & 0xF0) == 0x40) {
1002
- // CMOVcc: conditional move.
1003
- int condition = opcode & 0x0F;
1004
- const InstructionDesc& idesc = cmov_instructions[condition];
1005
- byte_size_operand_ = idesc.byte_size_operation;
1006
- current += PrintOperands(idesc.mnem, idesc.op_order_, current);
1007
-
1008
- } else if ((opcode & 0xF0) == 0x80) {
1009
- // Jcc: Conditional jump (branch).
1010
- current = data + JumpConditional(data);
1011
-
1012
- } else if (opcode == 0xBE || opcode == 0xBF || opcode == 0xB6 ||
1013
- opcode == 0xB7 || opcode == 0xAF) {
1014
- // Size-extending moves, IMUL.
1015
- current += PrintOperands(mnemonic, REG_OPER_OP_ORDER, current);
1016
-
1017
- } else if ((opcode & 0xF0) == 0x90) {
1018
- // SETcc: Set byte on condition. Needs pointer to beginning of instruction.
1019
- current = data + SetCC(data);
1020
-
1021
- } else if (opcode == 0xAB || opcode == 0xA5 || opcode == 0xAD) {
1022
- // SHLD, SHRD (double-precision shift), BTS (bit set).
1023
- AppendToBuffer("%s ", mnemonic);
1024
- int mod, regop, rm;
1025
- get_modrm(*current, &mod, &regop, &rm);
1026
- current += PrintRightOperand(current);
1027
- if (opcode == 0xAB) {
1028
- AppendToBuffer(",%s", NameOfCPURegister(regop));
1029
- } else {
1030
- AppendToBuffer(",%s,cl", NameOfCPURegister(regop));
1031
- }
1032
- } else if (group_1_prefix_ == 0xF2) {
1033
- // Beginning of instructions with prefix 0xF2.
1034
-
1035
- if (opcode == 0x11 || opcode == 0x10) {
1036
- // MOVSD: Move scalar double-precision fp to/from/between XMM registers.
1037
- AppendToBuffer("movsd ");
1038
- int mod, regop, rm;
1039
- get_modrm(*current, &mod, &regop, &rm);
1040
- if (opcode == 0x11) {
1041
- current += PrintRightOperand(current);
1042
- AppendToBuffer(",%s", NameOfXMMRegister(regop));
1043
- } else {
1044
- AppendToBuffer("%s,", NameOfXMMRegister(regop));
1045
- current += PrintRightOperand(current);
1046
- }
1047
- } else if (opcode == 0x2A) {
1048
- // CVTSI2SD: integer to XMM double conversion.
1049
- int mod, regop, rm;
1050
- get_modrm(*current, &mod, &regop, &rm);
1051
- AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop));
1052
- current += PrintRightOperand(current);
1053
- } else if ((opcode & 0xF8) == 0x58) {
1054
- // XMM arithmetic. Mnemonic was retrieved at the start of this function.
1055
- int mod, regop, rm;
1056
- get_modrm(*current, &mod, &regop, &rm);
1057
- AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop));
1058
- current += PrintRightXMMOperand(current);
1059
- } else {
1060
- UnimplementedInstruction();
1061
- }
1062
- } else if (opcode == 0x2C && group_1_prefix_ == 0xF3) {
1063
- // Instruction with prefix 0xF3.
1064
-
1065
- // CVTTSS2SI: Convert scalar single-precision FP to dword integer.
1066
- // Assert that mod is not 3, so source is memory, not an XMM register.
1067
- ASSERT_NE(0xC0, *current & 0xC0);
1068
- current += PrintOperands("cvttss2si", REG_OPER_OP_ORDER, current);
1069
- } else {
1070
- UnimplementedInstruction();
1071
- }
1072
- return static_cast<int>(current - data);
1073
- }
1074
-
1075
-
1076
- // Mnemonics for two-byte opcode instructions starting with 0x0F.
1077
- // The argument is the second byte of the two-byte opcode.
1078
- // Returns NULL if the instruction is not handled here.
1079
- const char* DisassemblerX64::TwoByteMnemonic(byte opcode) {
1080
- switch (opcode) {
1081
- case 0x1F:
1082
- return "nop";
1083
- case 0x2A: // F2 prefix.
1084
- return "cvtsi2sd";
1085
- case 0x31:
1086
- return "rdtsc";
1087
- case 0x58: // F2 prefix.
1088
- return "addsd";
1089
- case 0x59: // F2 prefix.
1090
- return "mulsd";
1091
- case 0x5C: // F2 prefix.
1092
- return "subsd";
1093
- case 0x5E: // F2 prefix.
1094
- return "divsd";
1095
- case 0xA2:
1096
- return "cpuid";
1097
- case 0xA5:
1098
- return "shld";
1099
- case 0xAB:
1100
- return "bts";
1101
- case 0xAD:
1102
- return "shrd";
1103
- case 0xAF:
1104
- return "imul";
1105
- case 0xB6:
1106
- return "movzxb";
1107
- case 0xB7:
1108
- return "movzxw";
1109
- case 0xBE:
1110
- return "movsxb";
1111
- case 0xBF:
1112
- return "movsxw";
1113
- default:
1114
- return NULL;
1115
- }
1116
- }
1117
-
1118
-
1119
- // Disassembles the instruction at instr, and writes it into out_buffer.
1120
- int DisassemblerX64::InstructionDecode(v8::internal::Vector<char> out_buffer,
1121
- byte* instr) {
1122
- tmp_buffer_pos_ = 0; // starting to write as position 0
1123
- byte* data = instr;
1124
- bool processed = true; // Will be set to false if the current instruction
1125
- // is not in 'instructions' table.
1126
- byte current;
1127
-
1128
- // Scan for prefixes.
1129
- while (true) {
1130
- current = *data;
1131
- if (current == 0x66) { // Group 3 prefix.
1132
- operand_size_ = current;
1133
- } else if ((current & 0xF0) == 0x40) { // REX prefix.
1134
- setRex(current);
1135
- if (rex_w()) AppendToBuffer("REX.W ");
1136
- } else if ((current & 0xFE) == 0xF2) { // Group 1 prefix.
1137
- group_1_prefix_ = current;
1138
- } else { // Not a prefix - an opcode.
1139
- break;
1140
- }
1141
- data++;
1142
- }
1143
-
1144
- const InstructionDesc& idesc = instruction_table.Get(current);
1145
- byte_size_operand_ = idesc.byte_size_operation;
1146
- switch (idesc.type) {
1147
- case ZERO_OPERANDS_INSTR:
1148
- AppendToBuffer(idesc.mnem);
1149
- data++;
1150
- break;
1151
-
1152
- case TWO_OPERANDS_INSTR:
1153
- data++;
1154
- data += PrintOperands(idesc.mnem, idesc.op_order_, data);
1155
- break;
1156
-
1157
- case JUMP_CONDITIONAL_SHORT_INSTR:
1158
- data += JumpConditionalShort(data);
1159
- break;
1160
-
1161
- case REGISTER_INSTR:
1162
- AppendToBuffer("%s%c %s",
1163
- idesc.mnem,
1164
- operand_size_code(),
1165
- NameOfCPURegister(base_reg(current & 0x07)));
1166
- data++;
1167
- break;
1168
- case PUSHPOP_INSTR:
1169
- AppendToBuffer("%s %s",
1170
- idesc.mnem,
1171
- NameOfCPURegister(base_reg(current & 0x07)));
1172
- data++;
1173
- break;
1174
- case MOVE_REG_INSTR: {
1175
- byte* addr = NULL;
1176
- switch (operand_size()) {
1177
- case WORD_SIZE:
1178
- addr = reinterpret_cast<byte*>(*reinterpret_cast<int16_t*>(data + 1));
1179
- data += 3;
1180
- break;
1181
- case DOUBLEWORD_SIZE:
1182
- addr = reinterpret_cast<byte*>(*reinterpret_cast<int32_t*>(data + 1));
1183
- data += 5;
1184
- break;
1185
- case QUADWORD_SIZE:
1186
- addr = reinterpret_cast<byte*>(*reinterpret_cast<int64_t*>(data + 1));
1187
- data += 9;
1188
- break;
1189
- default:
1190
- UNREACHABLE();
1191
- }
1192
- AppendToBuffer("mov%c %s,%s",
1193
- operand_size_code(),
1194
- NameOfCPURegister(base_reg(current & 0x07)),
1195
- NameOfAddress(addr));
1196
- break;
1197
- }
1198
-
1199
- case CALL_JUMP_INSTR: {
1200
- byte* addr = data + *reinterpret_cast<int32_t*>(data + 1) + 5;
1201
- AppendToBuffer("%s %s", idesc.mnem, NameOfAddress(addr));
1202
- data += 5;
1203
- break;
1204
- }
1205
-
1206
- case SHORT_IMMEDIATE_INSTR: {
1207
- byte* addr =
1208
- reinterpret_cast<byte*>(*reinterpret_cast<int32_t*>(data + 1));
1209
- AppendToBuffer("%s rax, %s", idesc.mnem, NameOfAddress(addr));
1210
- data += 5;
1211
- break;
1212
- }
1213
-
1214
- case NO_INSTR:
1215
- processed = false;
1216
- break;
1217
-
1218
- default:
1219
- UNIMPLEMENTED(); // This type is not implemented.
1220
- }
1221
-
1222
- // The first byte didn't match any of the simple opcodes, so we
1223
- // need to do special processing on it.
1224
- if (!processed) {
1225
- switch (*data) {
1226
- case 0xC2:
1227
- AppendToBuffer("ret 0x%x", *reinterpret_cast<uint16_t*>(data + 1));
1228
- data += 3;
1229
- break;
1230
-
1231
- case 0x69: // fall through
1232
- case 0x6B: {
1233
- int mod, regop, rm;
1234
- get_modrm(*(data + 1), &mod, &regop, &rm);
1235
- int32_t imm = *data == 0x6B ? *(data + 2)
1236
- : *reinterpret_cast<int32_t*>(data + 2);
1237
- AppendToBuffer("imul %s,%s,0x%x", NameOfCPURegister(regop),
1238
- NameOfCPURegister(rm), imm);
1239
- data += 2 + (*data == 0x6B ? 1 : 4);
1240
- break;
1241
- }
1242
-
1243
- case 0x81: // fall through
1244
- case 0x83: // 0x81 with sign extension bit set
1245
- data += PrintImmediateOp(data);
1246
- break;
1247
-
1248
- case 0x0F:
1249
- data += TwoByteOpcodeInstruction(data);
1250
- break;
1251
-
1252
- case 0x8F: {
1253
- data++;
1254
- int mod, regop, rm;
1255
- get_modrm(*data, &mod, &regop, &rm);
1256
- if (regop == 0) {
1257
- AppendToBuffer("pop ");
1258
- data += PrintRightOperand(data);
1259
- }
1260
- }
1261
- break;
1262
-
1263
- case 0xFF: {
1264
- data++;
1265
- int mod, regop, rm;
1266
- get_modrm(*data, &mod, &regop, &rm);
1267
- const char* mnem = NULL;
1268
- switch (regop) {
1269
- case 0:
1270
- mnem = "inc";
1271
- break;
1272
- case 1:
1273
- mnem = "dec";
1274
- break;
1275
- case 2:
1276
- mnem = "call";
1277
- break;
1278
- case 4:
1279
- mnem = "jmp";
1280
- break;
1281
- case 6:
1282
- mnem = "push";
1283
- break;
1284
- default:
1285
- mnem = "???";
1286
- }
1287
- AppendToBuffer(((regop <= 1) ? "%s%c " : "%s "),
1288
- mnem,
1289
- operand_size_code());
1290
- data += PrintRightOperand(data);
1291
- }
1292
- break;
1293
-
1294
- case 0xC7: // imm32, fall through
1295
- case 0xC6: // imm8
1296
- {
1297
- bool is_byte = *data == 0xC6;
1298
- data++;
1299
-
1300
- AppendToBuffer("mov%c ", is_byte ? 'b' : operand_size_code());
1301
- data += PrintRightOperand(data);
1302
- int32_t imm = is_byte ? *data : *reinterpret_cast<int32_t*>(data);
1303
- AppendToBuffer(",0x%x", imm);
1304
- data += is_byte ? 1 : 4;
1305
- }
1306
- break;
1307
-
1308
- case 0x80: {
1309
- data++;
1310
- AppendToBuffer("cmpb ");
1311
- data += PrintRightOperand(data);
1312
- int32_t imm = *data;
1313
- AppendToBuffer(",0x%x", imm);
1314
- data++;
1315
- }
1316
- break;
1317
-
1318
- case 0x88: // 8bit, fall through
1319
- case 0x89: // 32bit
1320
- {
1321
- bool is_byte = *data == 0x88;
1322
- int mod, regop, rm;
1323
- data++;
1324
- get_modrm(*data, &mod, &regop, &rm);
1325
- AppendToBuffer("mov%c ", is_byte ? 'b' : operand_size_code());
1326
- data += PrintRightOperand(data);
1327
- AppendToBuffer(",%s", NameOfCPURegister(regop));
1328
- }
1329
- break;
1330
-
1331
- case 0x90:
1332
- case 0x91:
1333
- case 0x92:
1334
- case 0x93:
1335
- case 0x94:
1336
- case 0x95:
1337
- case 0x96:
1338
- case 0x97: {
1339
- int reg = (*data & 0x7) | (rex_b() ? 8 : 0);
1340
- if (reg == 0) {
1341
- AppendToBuffer("nop"); // Common name for xchg rax,rax.
1342
- } else {
1343
- AppendToBuffer("xchg%c rax, %s",
1344
- operand_size_code(),
1345
- NameOfCPURegister(reg));
1346
- }
1347
- data++;
1348
- }
1349
- break;
1350
-
1351
- case 0xFE: {
1352
- data++;
1353
- int mod, regop, rm;
1354
- get_modrm(*data, &mod, &regop, &rm);
1355
- if (mod == 3 && regop == 1) {
1356
- AppendToBuffer("decb %s", NameOfCPURegister(rm));
1357
- } else {
1358
- UnimplementedInstruction();
1359
- }
1360
- data++;
1361
- }
1362
- break;
1363
-
1364
- case 0x68:
1365
- AppendToBuffer("push 0x%x", *reinterpret_cast<int32_t*>(data + 1));
1366
- data += 5;
1367
- break;
1368
-
1369
- case 0x6A:
1370
- AppendToBuffer("push 0x%x", *reinterpret_cast<int8_t*>(data + 1));
1371
- data += 2;
1372
- break;
1373
-
1374
- case 0xA1: // Fall through.
1375
- case 0xA3:
1376
- switch (operand_size()) {
1377
- case DOUBLEWORD_SIZE: {
1378
- const char* memory_location = NameOfAddress(
1379
- reinterpret_cast<byte*>(
1380
- *reinterpret_cast<int32_t*>(data + 1)));
1381
- if (*data == 0xA1) { // Opcode 0xA1
1382
- AppendToBuffer("movzxlq rax,(%s)", memory_location);
1383
- } else { // Opcode 0xA3
1384
- AppendToBuffer("movzxlq (%s),rax", memory_location);
1385
- }
1386
- data += 5;
1387
- break;
1388
- }
1389
- case QUADWORD_SIZE: {
1390
- // New x64 instruction mov rax,(imm_64).
1391
- const char* memory_location = NameOfAddress(
1392
- *reinterpret_cast<byte**>(data + 1));
1393
- if (*data == 0xA1) { // Opcode 0xA1
1394
- AppendToBuffer("movq rax,(%s)", memory_location);
1395
- } else { // Opcode 0xA3
1396
- AppendToBuffer("movq (%s),rax", memory_location);
1397
- }
1398
- data += 9;
1399
- break;
1400
- }
1401
- default:
1402
- UnimplementedInstruction();
1403
- data += 2;
1404
- }
1405
- break;
1406
-
1407
- case 0xA8:
1408
- AppendToBuffer("test al,0x%x", *reinterpret_cast<uint8_t*>(data + 1));
1409
- data += 2;
1410
- break;
1411
-
1412
- case 0xA9: {
1413
- int64_t value = 0;
1414
- switch (operand_size()) {
1415
- case WORD_SIZE:
1416
- value = *reinterpret_cast<uint16_t*>(data + 1);
1417
- data += 3;
1418
- break;
1419
- case DOUBLEWORD_SIZE:
1420
- value = *reinterpret_cast<uint32_t*>(data + 1);
1421
- data += 5;
1422
- break;
1423
- case QUADWORD_SIZE:
1424
- value = *reinterpret_cast<int32_t*>(data + 1);
1425
- data += 5;
1426
- break;
1427
- default:
1428
- UNREACHABLE();
1429
- }
1430
- AppendToBuffer("test%c rax,0x%"V8_PTR_PREFIX"x",
1431
- operand_size_code(),
1432
- value);
1433
- break;
1434
- }
1435
- case 0xD1: // fall through
1436
- case 0xD3: // fall through
1437
- case 0xC1:
1438
- data += ShiftInstruction(data);
1439
- break;
1440
- case 0xD0: // fall through
1441
- case 0xD2: // fall through
1442
- case 0xC0:
1443
- byte_size_operand_ = true;
1444
- data += ShiftInstruction(data);
1445
- break;
1446
-
1447
- case 0xD9: // fall through
1448
- case 0xDA: // fall through
1449
- case 0xDB: // fall through
1450
- case 0xDC: // fall through
1451
- case 0xDD: // fall through
1452
- case 0xDE: // fall through
1453
- case 0xDF:
1454
- data += FPUInstruction(data);
1455
- break;
1456
-
1457
- case 0xEB:
1458
- data += JumpShort(data);
1459
- break;
1460
-
1461
- case 0xF6:
1462
- byte_size_operand_ = true; // fall through
1463
- case 0xF7:
1464
- data += F6F7Instruction(data);
1465
- break;
1466
-
1467
- default:
1468
- UnimplementedInstruction();
1469
- data += 1;
1470
- }
1471
- } // !processed
1472
-
1473
- if (tmp_buffer_pos_ < sizeof tmp_buffer_) {
1474
- tmp_buffer_[tmp_buffer_pos_] = '\0';
1475
- }
1476
-
1477
- int instr_len = static_cast<int>(data - instr);
1478
- ASSERT(instr_len > 0); // Ensure progress.
1479
-
1480
- int outp = 0;
1481
- // Instruction bytes.
1482
- for (byte* bp = instr; bp < data; bp++) {
1483
- outp += v8::internal::OS::SNPrintF(out_buffer + outp, "%02x", *bp);
1484
- }
1485
- for (int i = 6 - instr_len; i >= 0; i--) {
1486
- outp += v8::internal::OS::SNPrintF(out_buffer + outp, " ");
1487
- }
1488
-
1489
- outp += v8::internal::OS::SNPrintF(out_buffer + outp, " %s",
1490
- tmp_buffer_.start());
1491
- return instr_len;
1492
- }
1493
-
1494
- //------------------------------------------------------------------------------
1495
-
1496
-
1497
- static const char* cpu_regs[16] = {
1498
- "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
1499
- "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
1500
- };
1501
-
1502
-
1503
- static const char* byte_cpu_regs[16] = {
1504
- "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",
1505
- "r8l", "r9l", "r10l", "r11l", "r12l", "r13l", "r14l", "r15l"
1506
- };
1507
-
1508
-
1509
- static const char* xmm_regs[16] = {
1510
- "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
1511
- "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"
1512
- };
1513
-
1514
-
1515
- const char* NameConverter::NameOfAddress(byte* addr) const {
1516
- static v8::internal::EmbeddedVector<char, 32> tmp_buffer;
1517
- v8::internal::OS::SNPrintF(tmp_buffer, "%p", addr);
1518
- return tmp_buffer.start();
1519
- }
1520
-
1521
-
1522
- const char* NameConverter::NameOfConstant(byte* addr) const {
1523
- return NameOfAddress(addr);
1524
- }
1525
-
1526
-
1527
- const char* NameConverter::NameOfCPURegister(int reg) const {
1528
- if (0 <= reg && reg < 16)
1529
- return cpu_regs[reg];
1530
- return "noreg";
1531
- }
1532
-
1533
-
1534
- const char* NameConverter::NameOfByteCPURegister(int reg) const {
1535
- if (0 <= reg && reg < 16)
1536
- return byte_cpu_regs[reg];
1537
- return "noreg";
1538
- }
1539
-
1540
-
1541
- const char* NameConverter::NameOfXMMRegister(int reg) const {
1542
- if (0 <= reg && reg < 16)
1543
- return xmm_regs[reg];
1544
- return "noxmmreg";
1545
- }
1546
-
1547
-
1548
- const char* NameConverter::NameInCode(byte* addr) const {
1549
- // X64 does not embed debug strings at the moment.
1550
- UNREACHABLE();
1551
- return "";
1552
- }
1553
-
1554
- //------------------------------------------------------------------------------
1555
-
1556
- Disassembler::Disassembler(const NameConverter& converter)
1557
- : converter_(converter) { }
1558
-
1559
- Disassembler::~Disassembler() { }
1560
-
1561
-
1562
- int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer,
1563
- byte* instruction) {
1564
- DisassemblerX64 d(converter_, CONTINUE_ON_UNIMPLEMENTED_OPCODE);
1565
- return d.InstructionDecode(buffer, instruction);
1566
- }
1567
-
1568
-
1569
- // The X64 assembler does not use constant pools.
1570
- int Disassembler::ConstantPoolSizeAt(byte* instruction) {
1571
- return -1;
1572
- }
1573
-
1574
-
1575
- void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) {
1576
- NameConverter converter;
1577
- Disassembler d(converter);
1578
- for (byte* pc = begin; pc < end;) {
1579
- v8::internal::EmbeddedVector<char, 128> buffer;
1580
- buffer[0] = '\0';
1581
- byte* prev_pc = pc;
1582
- pc += d.InstructionDecode(buffer, pc);
1583
- fprintf(f, "%p", prev_pc);
1584
- fprintf(f, " ");
1585
-
1586
- for (byte* bp = prev_pc; bp < pc; bp++) {
1587
- fprintf(f, "%02x", *bp);
1588
- }
1589
- for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) {
1590
- fprintf(f, " ");
1591
- }
1592
- fprintf(f, " %s\n", buffer.start());
1593
- }
1594
- }
1595
-
1596
- } // namespace disasm