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,325 +0,0 @@
1
- // Copyright (c) 1994-2006 Sun Microsystems Inc.
2
- // All Rights Reserved.
3
- //
4
- // Redistribution and use in source and binary forms, with or without
5
- // modification, are permitted provided that the following conditions are
6
- // met:
7
- //
8
- // - Redistributions of source code must retain the above copyright notice,
9
- // this list of conditions and the following disclaimer.
10
- //
11
- // - Redistribution in binary form must reproduce the above copyright
12
- // notice, this list of conditions and the following disclaimer in the
13
- // documentation and/or other materials provided with the distribution.
14
- //
15
- // - Neither the name of Sun Microsystems or the names of contributors may
16
- // be used to endorse or promote products derived from this software without
17
- // specific prior written permission.
18
- //
19
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
20
- // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21
- // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22
- // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23
- // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24
- // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25
- // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26
- // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27
- // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28
- // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29
- // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
-
31
- // The original source code covered by the above license above has been
32
- // modified significantly by Google Inc.
33
- // Copyright 2006-2008 the V8 project authors. All rights reserved.
34
-
35
- // A light-weight IA32 Assembler.
36
-
37
- #ifndef V8_IA32_ASSEMBLER_IA32_INL_H_
38
- #define V8_IA32_ASSEMBLER_IA32_INL_H_
39
-
40
- #include "cpu.h"
41
-
42
- namespace v8 {
43
- namespace internal {
44
-
45
- Condition NegateCondition(Condition cc) {
46
- return static_cast<Condition>(cc ^ 1);
47
- }
48
-
49
-
50
- // The modes possibly affected by apply must be in kApplyMask.
51
- void RelocInfo::apply(intptr_t delta) {
52
- if (rmode_ == RUNTIME_ENTRY || IsCodeTarget(rmode_)) {
53
- int32_t* p = reinterpret_cast<int32_t*>(pc_);
54
- *p -= delta; // relocate entry
55
- } else if (rmode_ == JS_RETURN && IsPatchedReturnSequence()) {
56
- // Special handling of js_return when a break point is set (call
57
- // instruction has been inserted).
58
- int32_t* p = reinterpret_cast<int32_t*>(pc_ + 1);
59
- *p -= delta; // relocate entry
60
- } else if (IsInternalReference(rmode_)) {
61
- // absolute code pointer inside code object moves with the code object.
62
- int32_t* p = reinterpret_cast<int32_t*>(pc_);
63
- *p += delta; // relocate entry
64
- }
65
- }
66
-
67
-
68
- Address RelocInfo::target_address() {
69
- ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
70
- return Assembler::target_address_at(pc_);
71
- }
72
-
73
-
74
- Address RelocInfo::target_address_address() {
75
- ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
76
- return reinterpret_cast<Address>(pc_);
77
- }
78
-
79
-
80
- void RelocInfo::set_target_address(Address target) {
81
- ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
82
- Assembler::set_target_address_at(pc_, target);
83
- }
84
-
85
-
86
- Object* RelocInfo::target_object() {
87
- ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
88
- return Memory::Object_at(pc_);
89
- }
90
-
91
-
92
- Handle<Object> RelocInfo::target_object_handle(Assembler* origin) {
93
- ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
94
- return Memory::Object_Handle_at(pc_);
95
- }
96
-
97
-
98
- Object** RelocInfo::target_object_address() {
99
- ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
100
- return &Memory::Object_at(pc_);
101
- }
102
-
103
-
104
- void RelocInfo::set_target_object(Object* target) {
105
- ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
106
- Memory::Object_at(pc_) = target;
107
- }
108
-
109
-
110
- Address* RelocInfo::target_reference_address() {
111
- ASSERT(rmode_ == RelocInfo::EXTERNAL_REFERENCE);
112
- return reinterpret_cast<Address*>(pc_);
113
- }
114
-
115
-
116
- Address RelocInfo::call_address() {
117
- ASSERT(IsPatchedReturnSequence());
118
- return Assembler::target_address_at(pc_ + 1);
119
- }
120
-
121
-
122
- void RelocInfo::set_call_address(Address target) {
123
- ASSERT(IsPatchedReturnSequence());
124
- Assembler::set_target_address_at(pc_ + 1, target);
125
- }
126
-
127
-
128
- Object* RelocInfo::call_object() {
129
- ASSERT(IsPatchedReturnSequence());
130
- return *call_object_address();
131
- }
132
-
133
-
134
- Object** RelocInfo::call_object_address() {
135
- ASSERT(IsPatchedReturnSequence());
136
- return reinterpret_cast<Object**>(pc_ + 1);
137
- }
138
-
139
-
140
- void RelocInfo::set_call_object(Object* target) {
141
- ASSERT(IsPatchedReturnSequence());
142
- *call_object_address() = target;
143
- }
144
-
145
-
146
- bool RelocInfo::IsPatchedReturnSequence() {
147
- return *pc_ == 0xE8;
148
- }
149
-
150
-
151
- Immediate::Immediate(int x) {
152
- x_ = x;
153
- rmode_ = RelocInfo::NONE;
154
- }
155
-
156
-
157
- Immediate::Immediate(const ExternalReference& ext) {
158
- x_ = reinterpret_cast<int32_t>(ext.address());
159
- rmode_ = RelocInfo::EXTERNAL_REFERENCE;
160
- }
161
-
162
- Immediate::Immediate(const char* s) {
163
- x_ = reinterpret_cast<int32_t>(s);
164
- rmode_ = RelocInfo::EMBEDDED_STRING;
165
- }
166
-
167
-
168
- Immediate::Immediate(Label* internal_offset) {
169
- x_ = reinterpret_cast<int32_t>(internal_offset);
170
- rmode_ = RelocInfo::INTERNAL_REFERENCE;
171
- }
172
-
173
-
174
- Immediate::Immediate(Handle<Object> handle) {
175
- // Verify all Objects referred by code are NOT in new space.
176
- Object* obj = *handle;
177
- ASSERT(!Heap::InNewSpace(obj));
178
- if (obj->IsHeapObject()) {
179
- x_ = reinterpret_cast<intptr_t>(handle.location());
180
- rmode_ = RelocInfo::EMBEDDED_OBJECT;
181
- } else {
182
- // no relocation needed
183
- x_ = reinterpret_cast<intptr_t>(obj);
184
- rmode_ = RelocInfo::NONE;
185
- }
186
- }
187
-
188
-
189
- Immediate::Immediate(Smi* value) {
190
- x_ = reinterpret_cast<intptr_t>(value);
191
- rmode_ = RelocInfo::NONE;
192
- }
193
-
194
-
195
- void Assembler::emit(uint32_t x) {
196
- *reinterpret_cast<uint32_t*>(pc_) = x;
197
- pc_ += sizeof(uint32_t);
198
- }
199
-
200
-
201
- void Assembler::emit(Handle<Object> handle) {
202
- // Verify all Objects referred by code are NOT in new space.
203
- Object* obj = *handle;
204
- ASSERT(!Heap::InNewSpace(obj));
205
- if (obj->IsHeapObject()) {
206
- emit(reinterpret_cast<intptr_t>(handle.location()),
207
- RelocInfo::EMBEDDED_OBJECT);
208
- } else {
209
- // no relocation needed
210
- emit(reinterpret_cast<intptr_t>(obj));
211
- }
212
- }
213
-
214
-
215
- void Assembler::emit(uint32_t x, RelocInfo::Mode rmode) {
216
- if (rmode != RelocInfo::NONE) RecordRelocInfo(rmode);
217
- emit(x);
218
- }
219
-
220
-
221
- void Assembler::emit(const Immediate& x) {
222
- if (x.rmode_ == RelocInfo::INTERNAL_REFERENCE) {
223
- Label* label = reinterpret_cast<Label*>(x.x_);
224
- emit_code_relative_offset(label);
225
- return;
226
- }
227
- if (x.rmode_ != RelocInfo::NONE) RecordRelocInfo(x.rmode_);
228
- emit(x.x_);
229
- }
230
-
231
-
232
- void Assembler::emit_code_relative_offset(Label* label) {
233
- if (label->is_bound()) {
234
- int32_t pos;
235
- pos = label->pos() + Code::kHeaderSize - kHeapObjectTag;
236
- emit(pos);
237
- } else {
238
- emit_disp(label, Displacement::CODE_RELATIVE);
239
- }
240
- }
241
-
242
-
243
- void Assembler::emit_w(const Immediate& x) {
244
- ASSERT(x.rmode_ == RelocInfo::NONE);
245
- uint16_t value = static_cast<uint16_t>(x.x_);
246
- reinterpret_cast<uint16_t*>(pc_)[0] = value;
247
- pc_ += sizeof(uint16_t);
248
- }
249
-
250
-
251
- Address Assembler::target_address_at(Address pc) {
252
- return pc + sizeof(int32_t) + *reinterpret_cast<int32_t*>(pc);
253
- }
254
-
255
-
256
- void Assembler::set_target_address_at(Address pc, Address target) {
257
- int32_t* p = reinterpret_cast<int32_t*>(pc);
258
- *p = target - (pc + sizeof(int32_t));
259
- CPU::FlushICache(p, sizeof(int32_t));
260
- }
261
-
262
-
263
- Displacement Assembler::disp_at(Label* L) {
264
- return Displacement(long_at(L->pos()));
265
- }
266
-
267
-
268
- void Assembler::disp_at_put(Label* L, Displacement disp) {
269
- long_at_put(L->pos(), disp.data());
270
- }
271
-
272
-
273
- void Assembler::emit_disp(Label* L, Displacement::Type type) {
274
- Displacement disp(L, type);
275
- L->link_to(pc_offset());
276
- emit(static_cast<int>(disp.data()));
277
- }
278
-
279
-
280
- void Operand::set_modrm(int mod, Register rm) {
281
- ASSERT((mod & -4) == 0);
282
- buf_[0] = mod << 6 | rm.code();
283
- len_ = 1;
284
- }
285
-
286
-
287
- void Operand::set_sib(ScaleFactor scale, Register index, Register base) {
288
- ASSERT(len_ == 1);
289
- ASSERT((scale & -4) == 0);
290
- // Use SIB with no index register only for base esp.
291
- ASSERT(!index.is(esp) || base.is(esp));
292
- buf_[1] = scale << 6 | index.code() << 3 | base.code();
293
- len_ = 2;
294
- }
295
-
296
-
297
- void Operand::set_disp8(int8_t disp) {
298
- ASSERT(len_ == 1 || len_ == 2);
299
- *reinterpret_cast<int8_t*>(&buf_[len_++]) = disp;
300
- }
301
-
302
-
303
- void Operand::set_dispr(int32_t disp, RelocInfo::Mode rmode) {
304
- ASSERT(len_ == 1 || len_ == 2);
305
- int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]);
306
- *p = disp;
307
- len_ += sizeof(int32_t);
308
- rmode_ = rmode;
309
- }
310
-
311
- Operand::Operand(Register reg) {
312
- // reg
313
- set_modrm(3, reg);
314
- }
315
-
316
-
317
- Operand::Operand(int32_t disp, RelocInfo::Mode rmode) {
318
- // [disp/r]
319
- set_modrm(0, ebp);
320
- set_dispr(disp, rmode);
321
- }
322
-
323
- } } // namespace v8::internal
324
-
325
- #endif // V8_IA32_ASSEMBLER_IA32_INL_H_
@@ -1,2375 +0,0 @@
1
- // Copyright (c) 1994-2006 Sun Microsystems Inc.
2
- // All Rights Reserved.
3
- //
4
- // Redistribution and use in source and binary forms, with or without
5
- // modification, are permitted provided that the following conditions
6
- // are met:
7
- //
8
- // - Redistributions of source code must retain the above copyright notice,
9
- // this list of conditions and the following disclaimer.
10
- //
11
- // - Redistribution in binary form must reproduce the above copyright
12
- // notice, this list of conditions and the following disclaimer in the
13
- // documentation and/or other materials provided with the
14
- // distribution.
15
- //
16
- // - Neither the name of Sun Microsystems or the names of contributors may
17
- // be used to endorse or promote products derived from this software without
18
- // specific prior written permission.
19
- //
20
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23
- // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
- // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25
- // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26
- // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27
- // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28
- // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29
- // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
- // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
31
- // OF THE POSSIBILITY OF SUCH DAMAGE.
32
-
33
- // The original source code covered by the above license above has been modified
34
- // significantly by Google Inc.
35
- // Copyright 2006-2008 the V8 project authors. All rights reserved.
36
-
37
- #include "v8.h"
38
-
39
- #include "disassembler.h"
40
- #include "macro-assembler.h"
41
- #include "serialize.h"
42
-
43
- namespace v8 {
44
- namespace internal {
45
-
46
- // -----------------------------------------------------------------------------
47
- // Implementation of CpuFeatures
48
-
49
- // Safe default is no features.
50
- uint64_t CpuFeatures::supported_ = 0;
51
- uint64_t CpuFeatures::enabled_ = 0;
52
- uint64_t CpuFeatures::found_by_runtime_probing_ = 0;
53
-
54
-
55
- // The Probe method needs executable memory, so it uses Heap::CreateCode.
56
- // Allocation failure is silent and leads to safe default.
57
- void CpuFeatures::Probe() {
58
- ASSERT(Heap::HasBeenSetup());
59
- ASSERT(supported_ == 0);
60
- if (Serializer::enabled()) {
61
- supported_ |= OS::CpuFeaturesImpliedByPlatform();
62
- return; // No features if we might serialize.
63
- }
64
-
65
- Assembler assm(NULL, 0);
66
- Label cpuid, done;
67
- #define __ assm.
68
- // Save old esp, since we are going to modify the stack.
69
- __ push(ebp);
70
- __ pushfd();
71
- __ push(ecx);
72
- __ push(ebx);
73
- __ mov(ebp, Operand(esp));
74
-
75
- // If we can modify bit 21 of the EFLAGS register, then CPUID is supported.
76
- __ pushfd();
77
- __ pop(eax);
78
- __ mov(edx, Operand(eax));
79
- __ xor_(eax, 0x200000); // Flip bit 21.
80
- __ push(eax);
81
- __ popfd();
82
- __ pushfd();
83
- __ pop(eax);
84
- __ xor_(eax, Operand(edx)); // Different if CPUID is supported.
85
- __ j(not_zero, &cpuid);
86
-
87
- // CPUID not supported. Clear the supported features in edx:eax.
88
- __ xor_(eax, Operand(eax));
89
- __ xor_(edx, Operand(edx));
90
- __ jmp(&done);
91
-
92
- // Invoke CPUID with 1 in eax to get feature information in
93
- // ecx:edx. Temporarily enable CPUID support because we know it's
94
- // safe here.
95
- __ bind(&cpuid);
96
- __ mov(eax, 1);
97
- supported_ = (1 << CPUID);
98
- { Scope fscope(CPUID);
99
- __ cpuid();
100
- }
101
- supported_ = 0;
102
-
103
- // Move the result from ecx:edx to edx:eax and make sure to mark the
104
- // CPUID feature as supported.
105
- __ mov(eax, Operand(edx));
106
- __ or_(eax, 1 << CPUID);
107
- __ mov(edx, Operand(ecx));
108
-
109
- // Done.
110
- __ bind(&done);
111
- __ mov(esp, Operand(ebp));
112
- __ pop(ebx);
113
- __ pop(ecx);
114
- __ popfd();
115
- __ pop(ebp);
116
- __ ret(0);
117
- #undef __
118
-
119
- CodeDesc desc;
120
- assm.GetCode(&desc);
121
- Object* code = Heap::CreateCode(desc,
122
- NULL,
123
- Code::ComputeFlags(Code::STUB),
124
- Handle<Code>::null());
125
- if (!code->IsCode()) return;
126
- LOG(CodeCreateEvent(Logger::BUILTIN_TAG,
127
- Code::cast(code), "CpuFeatures::Probe"));
128
- typedef uint64_t (*F0)();
129
- F0 probe = FUNCTION_CAST<F0>(Code::cast(code)->entry());
130
- supported_ = probe();
131
- found_by_runtime_probing_ = supported_;
132
- uint64_t os_guarantees = OS::CpuFeaturesImpliedByPlatform();
133
- supported_ |= os_guarantees;
134
- found_by_runtime_probing_ &= ~os_guarantees;
135
- }
136
-
137
-
138
- // -----------------------------------------------------------------------------
139
- // Implementation of Displacement
140
-
141
- void Displacement::init(Label* L, Type type) {
142
- ASSERT(!L->is_bound());
143
- int next = 0;
144
- if (L->is_linked()) {
145
- next = L->pos();
146
- ASSERT(next > 0); // Displacements must be at positions > 0
147
- }
148
- // Ensure that we _never_ overflow the next field.
149
- ASSERT(NextField::is_valid(Assembler::kMaximalBufferSize));
150
- data_ = NextField::encode(next) | TypeField::encode(type);
151
- }
152
-
153
-
154
- // -----------------------------------------------------------------------------
155
- // Implementation of RelocInfo
156
-
157
-
158
- const int RelocInfo::kApplyMask =
159
- RelocInfo::kCodeTargetMask | 1 << RelocInfo::RUNTIME_ENTRY |
160
- 1 << RelocInfo::JS_RETURN | 1 << RelocInfo::INTERNAL_REFERENCE;
161
-
162
-
163
- void RelocInfo::PatchCode(byte* instructions, int instruction_count) {
164
- // Patch the code at the current address with the supplied instructions.
165
- for (int i = 0; i < instruction_count; i++) {
166
- *(pc_ + i) = *(instructions + i);
167
- }
168
-
169
- // Indicate that code has changed.
170
- CPU::FlushICache(pc_, instruction_count);
171
- }
172
-
173
-
174
- // Patch the code at the current PC with a call to the target address.
175
- // Additional guard int3 instructions can be added if required.
176
- void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) {
177
- // Call instruction takes up 5 bytes and int3 takes up one byte.
178
- static const int kCallCodeSize = 5;
179
- int code_size = kCallCodeSize + guard_bytes;
180
-
181
- // Create a code patcher.
182
- CodePatcher patcher(pc_, code_size);
183
-
184
- // Add a label for checking the size of the code used for returning.
185
- #ifdef DEBUG
186
- Label check_codesize;
187
- patcher.masm()->bind(&check_codesize);
188
- #endif
189
-
190
- // Patch the code.
191
- patcher.masm()->call(target, RelocInfo::NONE);
192
-
193
- // Check that the size of the code generated is as expected.
194
- ASSERT_EQ(kCallCodeSize,
195
- patcher.masm()->SizeOfCodeGeneratedSince(&check_codesize));
196
-
197
- // Add the requested number of int3 instructions after the call.
198
- for (int i = 0; i < guard_bytes; i++) {
199
- patcher.masm()->int3();
200
- }
201
- }
202
-
203
-
204
- // -----------------------------------------------------------------------------
205
- // Implementation of Operand
206
-
207
- Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) {
208
- // [base + disp/r]
209
- if (disp == 0 && rmode == RelocInfo::NONE && !base.is(ebp)) {
210
- // [base]
211
- set_modrm(0, base);
212
- if (base.is(esp)) set_sib(times_1, esp, base);
213
- } else if (is_int8(disp) && rmode == RelocInfo::NONE) {
214
- // [base + disp8]
215
- set_modrm(1, base);
216
- if (base.is(esp)) set_sib(times_1, esp, base);
217
- set_disp8(disp);
218
- } else {
219
- // [base + disp/r]
220
- set_modrm(2, base);
221
- if (base.is(esp)) set_sib(times_1, esp, base);
222
- set_dispr(disp, rmode);
223
- }
224
- }
225
-
226
-
227
- Operand::Operand(Register base,
228
- Register index,
229
- ScaleFactor scale,
230
- int32_t disp,
231
- RelocInfo::Mode rmode) {
232
- ASSERT(!index.is(esp)); // illegal addressing mode
233
- // [base + index*scale + disp/r]
234
- if (disp == 0 && rmode == RelocInfo::NONE && !base.is(ebp)) {
235
- // [base + index*scale]
236
- set_modrm(0, esp);
237
- set_sib(scale, index, base);
238
- } else if (is_int8(disp) && rmode == RelocInfo::NONE) {
239
- // [base + index*scale + disp8]
240
- set_modrm(1, esp);
241
- set_sib(scale, index, base);
242
- set_disp8(disp);
243
- } else {
244
- // [base + index*scale + disp/r]
245
- set_modrm(2, esp);
246
- set_sib(scale, index, base);
247
- set_dispr(disp, rmode);
248
- }
249
- }
250
-
251
-
252
- Operand::Operand(Register index,
253
- ScaleFactor scale,
254
- int32_t disp,
255
- RelocInfo::Mode rmode) {
256
- ASSERT(!index.is(esp)); // illegal addressing mode
257
- // [index*scale + disp/r]
258
- set_modrm(0, esp);
259
- set_sib(scale, index, ebp);
260
- set_dispr(disp, rmode);
261
- }
262
-
263
-
264
- bool Operand::is_reg(Register reg) const {
265
- return ((buf_[0] & 0xF8) == 0xC0) // addressing mode is register only.
266
- && ((buf_[0] & 0x07) == reg.code()); // register codes match.
267
- }
268
-
269
- // -----------------------------------------------------------------------------
270
- // Implementation of Assembler
271
-
272
- // Emit a single byte. Must always be inlined.
273
- #define EMIT(x) \
274
- *pc_++ = (x)
275
-
276
-
277
- #ifdef GENERATED_CODE_COVERAGE
278
- static void InitCoverageLog();
279
- #endif
280
-
281
- // spare_buffer_
282
- byte* Assembler::spare_buffer_ = NULL;
283
-
284
- Assembler::Assembler(void* buffer, int buffer_size) {
285
- if (buffer == NULL) {
286
- // do our own buffer management
287
- if (buffer_size <= kMinimalBufferSize) {
288
- buffer_size = kMinimalBufferSize;
289
-
290
- if (spare_buffer_ != NULL) {
291
- buffer = spare_buffer_;
292
- spare_buffer_ = NULL;
293
- }
294
- }
295
- if (buffer == NULL) {
296
- buffer_ = NewArray<byte>(buffer_size);
297
- } else {
298
- buffer_ = static_cast<byte*>(buffer);
299
- }
300
- buffer_size_ = buffer_size;
301
- own_buffer_ = true;
302
- } else {
303
- // use externally provided buffer instead
304
- ASSERT(buffer_size > 0);
305
- buffer_ = static_cast<byte*>(buffer);
306
- buffer_size_ = buffer_size;
307
- own_buffer_ = false;
308
- }
309
-
310
- // Clear the buffer in debug mode unless it was provided by the
311
- // caller in which case we can't be sure it's okay to overwrite
312
- // existing code in it; see CodePatcher::CodePatcher(...).
313
- #ifdef DEBUG
314
- if (own_buffer_) {
315
- memset(buffer_, 0xCC, buffer_size); // int3
316
- }
317
- #endif
318
-
319
- // setup buffer pointers
320
- ASSERT(buffer_ != NULL);
321
- pc_ = buffer_;
322
- reloc_info_writer.Reposition(buffer_ + buffer_size, pc_);
323
-
324
- last_pc_ = NULL;
325
- current_statement_position_ = RelocInfo::kNoPosition;
326
- current_position_ = RelocInfo::kNoPosition;
327
- written_statement_position_ = current_statement_position_;
328
- written_position_ = current_position_;
329
- #ifdef GENERATED_CODE_COVERAGE
330
- InitCoverageLog();
331
- #endif
332
- }
333
-
334
-
335
- Assembler::~Assembler() {
336
- if (own_buffer_) {
337
- if (spare_buffer_ == NULL && buffer_size_ == kMinimalBufferSize) {
338
- spare_buffer_ = buffer_;
339
- } else {
340
- DeleteArray(buffer_);
341
- }
342
- }
343
- }
344
-
345
-
346
- void Assembler::GetCode(CodeDesc* desc) {
347
- // finalize code
348
- // (at this point overflow() may be true, but the gap ensures that
349
- // we are still not overlapping instructions and relocation info)
350
- ASSERT(pc_ <= reloc_info_writer.pos()); // no overlap
351
- // setup desc
352
- desc->buffer = buffer_;
353
- desc->buffer_size = buffer_size_;
354
- desc->instr_size = pc_offset();
355
- desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
356
- desc->origin = this;
357
-
358
- Counters::reloc_info_size.Increment(desc->reloc_size);
359
- }
360
-
361
-
362
- void Assembler::Align(int m) {
363
- ASSERT(IsPowerOf2(m));
364
- while ((pc_offset() & (m - 1)) != 0) {
365
- nop();
366
- }
367
- }
368
-
369
-
370
- void Assembler::cpuid() {
371
- ASSERT(CpuFeatures::IsEnabled(CPUID));
372
- EnsureSpace ensure_space(this);
373
- last_pc_ = pc_;
374
- EMIT(0x0F);
375
- EMIT(0xA2);
376
- }
377
-
378
-
379
- void Assembler::pushad() {
380
- EnsureSpace ensure_space(this);
381
- last_pc_ = pc_;
382
- EMIT(0x60);
383
- }
384
-
385
-
386
- void Assembler::popad() {
387
- EnsureSpace ensure_space(this);
388
- last_pc_ = pc_;
389
- EMIT(0x61);
390
- }
391
-
392
-
393
- void Assembler::pushfd() {
394
- EnsureSpace ensure_space(this);
395
- last_pc_ = pc_;
396
- EMIT(0x9C);
397
- }
398
-
399
-
400
- void Assembler::popfd() {
401
- EnsureSpace ensure_space(this);
402
- last_pc_ = pc_;
403
- EMIT(0x9D);
404
- }
405
-
406
-
407
- void Assembler::push(const Immediate& x) {
408
- EnsureSpace ensure_space(this);
409
- last_pc_ = pc_;
410
- if (x.is_int8()) {
411
- EMIT(0x6a);
412
- EMIT(x.x_);
413
- } else {
414
- EMIT(0x68);
415
- emit(x);
416
- }
417
- }
418
-
419
-
420
- void Assembler::push(Register src) {
421
- EnsureSpace ensure_space(this);
422
- last_pc_ = pc_;
423
- EMIT(0x50 | src.code());
424
- }
425
-
426
-
427
- void Assembler::push(const Operand& src) {
428
- EnsureSpace ensure_space(this);
429
- last_pc_ = pc_;
430
- EMIT(0xFF);
431
- emit_operand(esi, src);
432
- }
433
-
434
-
435
- void Assembler::pop(Register dst) {
436
- ASSERT(reloc_info_writer.last_pc() != NULL);
437
- if (FLAG_push_pop_elimination && (reloc_info_writer.last_pc() <= last_pc_)) {
438
- // (last_pc_ != NULL) is rolled into the above check
439
- // If a last_pc_ is set, we need to make sure that there has not been any
440
- // relocation information generated between the last instruction and this
441
- // pop instruction.
442
- byte instr = last_pc_[0];
443
- if ((instr & ~0x7) == 0x50) {
444
- int push_reg_code = instr & 0x7;
445
- if (push_reg_code == dst.code()) {
446
- pc_ = last_pc_;
447
- if (FLAG_print_push_pop_elimination) {
448
- PrintF("%d push/pop (same reg) eliminated\n", pc_offset());
449
- }
450
- } else {
451
- // Convert 'push src; pop dst' to 'mov dst, src'.
452
- last_pc_[0] = 0x8b;
453
- Register src = { push_reg_code };
454
- EnsureSpace ensure_space(this);
455
- emit_operand(dst, Operand(src));
456
- if (FLAG_print_push_pop_elimination) {
457
- PrintF("%d push/pop (reg->reg) eliminated\n", pc_offset());
458
- }
459
- }
460
- last_pc_ = NULL;
461
- return;
462
- } else if (instr == 0xff) { // push of an operand, convert to a move
463
- byte op1 = last_pc_[1];
464
- // Check if the operation is really a push
465
- if ((op1 & 0x38) == (6 << 3)) {
466
- op1 = (op1 & ~0x38) | static_cast<byte>(dst.code() << 3);
467
- last_pc_[0] = 0x8b;
468
- last_pc_[1] = op1;
469
- last_pc_ = NULL;
470
- if (FLAG_print_push_pop_elimination) {
471
- PrintF("%d push/pop (op->reg) eliminated\n", pc_offset());
472
- }
473
- return;
474
- }
475
- } else if ((instr == 0x89) &&
476
- (last_pc_[1] == 0x04) &&
477
- (last_pc_[2] == 0x24)) {
478
- // 0x71283c 396 890424 mov [esp],eax
479
- // 0x71283f 399 58 pop eax
480
- if (dst.is(eax)) {
481
- // change to
482
- // 0x710fac 216 83c404 add esp,0x4
483
- last_pc_[0] = 0x83;
484
- last_pc_[1] = 0xc4;
485
- last_pc_[2] = 0x04;
486
- last_pc_ = NULL;
487
- if (FLAG_print_push_pop_elimination) {
488
- PrintF("%d push/pop (mov-pop) eliminated\n", pc_offset());
489
- }
490
- return;
491
- }
492
- } else if (instr == 0x6a && dst.is(eax)) { // push of immediate 8 bit
493
- byte imm8 = last_pc_[1];
494
- if (imm8 == 0) {
495
- // 6a00 push 0x0
496
- // 58 pop eax
497
- last_pc_[0] = 0x31;
498
- last_pc_[1] = 0xc0;
499
- // change to
500
- // 31c0 xor eax,eax
501
- last_pc_ = NULL;
502
- if (FLAG_print_push_pop_elimination) {
503
- PrintF("%d push/pop (imm->reg) eliminated\n", pc_offset());
504
- }
505
- return;
506
- } else {
507
- // 6a00 push 0xXX
508
- // 58 pop eax
509
- last_pc_[0] = 0xb8;
510
- EnsureSpace ensure_space(this);
511
- if ((imm8 & 0x80) != 0) {
512
- EMIT(0xff);
513
- EMIT(0xff);
514
- EMIT(0xff);
515
- // change to
516
- // b8XXffffff mov eax,0xffffffXX
517
- } else {
518
- EMIT(0x00);
519
- EMIT(0x00);
520
- EMIT(0x00);
521
- // change to
522
- // b8XX000000 mov eax,0x000000XX
523
- }
524
- last_pc_ = NULL;
525
- if (FLAG_print_push_pop_elimination) {
526
- PrintF("%d push/pop (imm->reg) eliminated\n", pc_offset());
527
- }
528
- return;
529
- }
530
- } else if (instr == 0x68 && dst.is(eax)) { // push of immediate 32 bit
531
- // 68XXXXXXXX push 0xXXXXXXXX
532
- // 58 pop eax
533
- last_pc_[0] = 0xb8;
534
- last_pc_ = NULL;
535
- // change to
536
- // b8XXXXXXXX mov eax,0xXXXXXXXX
537
- if (FLAG_print_push_pop_elimination) {
538
- PrintF("%d push/pop (imm->reg) eliminated\n", pc_offset());
539
- }
540
- return;
541
- }
542
-
543
- // Other potential patterns for peephole:
544
- // 0x712716 102 890424 mov [esp], eax
545
- // 0x712719 105 8b1424 mov edx, [esp]
546
- }
547
- EnsureSpace ensure_space(this);
548
- last_pc_ = pc_;
549
- EMIT(0x58 | dst.code());
550
- }
551
-
552
-
553
- void Assembler::pop(const Operand& dst) {
554
- EnsureSpace ensure_space(this);
555
- last_pc_ = pc_;
556
- EMIT(0x8F);
557
- emit_operand(eax, dst);
558
- }
559
-
560
-
561
- void Assembler::enter(const Immediate& size) {
562
- EnsureSpace ensure_space(this);
563
- last_pc_ = pc_;
564
- EMIT(0xC8);
565
- emit_w(size);
566
- EMIT(0);
567
- }
568
-
569
-
570
- void Assembler::leave() {
571
- EnsureSpace ensure_space(this);
572
- last_pc_ = pc_;
573
- EMIT(0xC9);
574
- }
575
-
576
-
577
- void Assembler::mov_b(Register dst, const Operand& src) {
578
- ASSERT(dst.code() < 4);
579
- EnsureSpace ensure_space(this);
580
- last_pc_ = pc_;
581
- EMIT(0x8A);
582
- emit_operand(dst, src);
583
- }
584
-
585
-
586
- void Assembler::mov_b(const Operand& dst, int8_t imm8) {
587
- EnsureSpace ensure_space(this);
588
- last_pc_ = pc_;
589
- EMIT(0xC6);
590
- emit_operand(eax, dst);
591
- EMIT(imm8);
592
- }
593
-
594
-
595
- void Assembler::mov_b(const Operand& dst, Register src) {
596
- ASSERT(src.code() < 4);
597
- EnsureSpace ensure_space(this);
598
- last_pc_ = pc_;
599
- EMIT(0x88);
600
- emit_operand(src, dst);
601
- }
602
-
603
-
604
- void Assembler::mov_w(Register dst, const Operand& src) {
605
- EnsureSpace ensure_space(this);
606
- last_pc_ = pc_;
607
- EMIT(0x66);
608
- EMIT(0x8B);
609
- emit_operand(dst, src);
610
- }
611
-
612
-
613
- void Assembler::mov_w(const Operand& dst, Register src) {
614
- EnsureSpace ensure_space(this);
615
- last_pc_ = pc_;
616
- EMIT(0x66);
617
- EMIT(0x89);
618
- emit_operand(src, dst);
619
- }
620
-
621
-
622
- void Assembler::mov(Register dst, int32_t imm32) {
623
- EnsureSpace ensure_space(this);
624
- last_pc_ = pc_;
625
- EMIT(0xB8 | dst.code());
626
- emit(imm32);
627
- }
628
-
629
-
630
- void Assembler::mov(Register dst, const Immediate& x) {
631
- EnsureSpace ensure_space(this);
632
- last_pc_ = pc_;
633
- EMIT(0xB8 | dst.code());
634
- emit(x);
635
- }
636
-
637
-
638
- void Assembler::mov(Register dst, Handle<Object> handle) {
639
- EnsureSpace ensure_space(this);
640
- last_pc_ = pc_;
641
- EMIT(0xB8 | dst.code());
642
- emit(handle);
643
- }
644
-
645
-
646
- void Assembler::mov(Register dst, const Operand& src) {
647
- EnsureSpace ensure_space(this);
648
- last_pc_ = pc_;
649
- EMIT(0x8B);
650
- emit_operand(dst, src);
651
- }
652
-
653
-
654
- void Assembler::mov(Register dst, Register src) {
655
- EnsureSpace ensure_space(this);
656
- last_pc_ = pc_;
657
- EMIT(0x89);
658
- EMIT(0xC0 | src.code() << 3 | dst.code());
659
- }
660
-
661
-
662
- void Assembler::mov(const Operand& dst, const Immediate& x) {
663
- EnsureSpace ensure_space(this);
664
- last_pc_ = pc_;
665
- EMIT(0xC7);
666
- emit_operand(eax, dst);
667
- emit(x);
668
- }
669
-
670
-
671
- void Assembler::mov(const Operand& dst, Handle<Object> handle) {
672
- EnsureSpace ensure_space(this);
673
- last_pc_ = pc_;
674
- EMIT(0xC7);
675
- emit_operand(eax, dst);
676
- emit(handle);
677
- }
678
-
679
-
680
- void Assembler::mov(const Operand& dst, Register src) {
681
- EnsureSpace ensure_space(this);
682
- last_pc_ = pc_;
683
- EMIT(0x89);
684
- emit_operand(src, dst);
685
- }
686
-
687
-
688
- void Assembler::movsx_b(Register dst, const Operand& src) {
689
- EnsureSpace ensure_space(this);
690
- last_pc_ = pc_;
691
- EMIT(0x0F);
692
- EMIT(0xBE);
693
- emit_operand(dst, src);
694
- }
695
-
696
-
697
- void Assembler::movsx_w(Register dst, const Operand& src) {
698
- EnsureSpace ensure_space(this);
699
- last_pc_ = pc_;
700
- EMIT(0x0F);
701
- EMIT(0xBF);
702
- emit_operand(dst, src);
703
- }
704
-
705
-
706
- void Assembler::movzx_b(Register dst, const Operand& src) {
707
- EnsureSpace ensure_space(this);
708
- last_pc_ = pc_;
709
- EMIT(0x0F);
710
- EMIT(0xB6);
711
- emit_operand(dst, src);
712
- }
713
-
714
-
715
- void Assembler::movzx_w(Register dst, const Operand& src) {
716
- EnsureSpace ensure_space(this);
717
- last_pc_ = pc_;
718
- EMIT(0x0F);
719
- EMIT(0xB7);
720
- emit_operand(dst, src);
721
- }
722
-
723
-
724
- void Assembler::cmov(Condition cc, Register dst, int32_t imm32) {
725
- ASSERT(CpuFeatures::IsEnabled(CMOV));
726
- EnsureSpace ensure_space(this);
727
- last_pc_ = pc_;
728
- UNIMPLEMENTED();
729
- USE(cc);
730
- USE(dst);
731
- USE(imm32);
732
- }
733
-
734
-
735
- void Assembler::cmov(Condition cc, Register dst, Handle<Object> handle) {
736
- ASSERT(CpuFeatures::IsEnabled(CMOV));
737
- EnsureSpace ensure_space(this);
738
- last_pc_ = pc_;
739
- UNIMPLEMENTED();
740
- USE(cc);
741
- USE(dst);
742
- USE(handle);
743
- }
744
-
745
-
746
- void Assembler::cmov(Condition cc, Register dst, const Operand& src) {
747
- ASSERT(CpuFeatures::IsEnabled(CMOV));
748
- EnsureSpace ensure_space(this);
749
- last_pc_ = pc_;
750
- // Opcode: 0f 40 + cc /r
751
- EMIT(0x0F);
752
- EMIT(0x40 + cc);
753
- emit_operand(dst, src);
754
- }
755
-
756
-
757
- void Assembler::rep_movs() {
758
- EnsureSpace ensure_space(this);
759
- last_pc_ = pc_;
760
- EMIT(0xF3);
761
- EMIT(0xA5);
762
- }
763
-
764
-
765
- void Assembler::xchg(Register dst, Register src) {
766
- EnsureSpace ensure_space(this);
767
- last_pc_ = pc_;
768
- if (src.is(eax) || dst.is(eax)) { // Single-byte encoding
769
- EMIT(0x90 | (src.is(eax) ? dst.code() : src.code()));
770
- } else {
771
- EMIT(0x87);
772
- EMIT(0xC0 | src.code() << 3 | dst.code());
773
- }
774
- }
775
-
776
-
777
- void Assembler::adc(Register dst, int32_t imm32) {
778
- EnsureSpace ensure_space(this);
779
- last_pc_ = pc_;
780
- emit_arith(2, Operand(dst), Immediate(imm32));
781
- }
782
-
783
-
784
- void Assembler::adc(Register dst, const Operand& src) {
785
- EnsureSpace ensure_space(this);
786
- last_pc_ = pc_;
787
- EMIT(0x13);
788
- emit_operand(dst, src);
789
- }
790
-
791
-
792
- void Assembler::add(Register dst, const Operand& src) {
793
- EnsureSpace ensure_space(this);
794
- last_pc_ = pc_;
795
- EMIT(0x03);
796
- emit_operand(dst, src);
797
- }
798
-
799
-
800
- void Assembler::add(const Operand& dst, const Immediate& x) {
801
- ASSERT(reloc_info_writer.last_pc() != NULL);
802
- if (FLAG_push_pop_elimination && (reloc_info_writer.last_pc() <= last_pc_)) {
803
- byte instr = last_pc_[0];
804
- if ((instr & 0xf8) == 0x50) {
805
- // Last instruction was a push. Check whether this is a pop without a
806
- // result.
807
- if ((dst.is_reg(esp)) &&
808
- (x.x_ == kPointerSize) && (x.rmode_ == RelocInfo::NONE)) {
809
- pc_ = last_pc_;
810
- last_pc_ = NULL;
811
- if (FLAG_print_push_pop_elimination) {
812
- PrintF("%d push/pop(noreg) eliminated\n", pc_offset());
813
- }
814
- return;
815
- }
816
- }
817
- }
818
- EnsureSpace ensure_space(this);
819
- last_pc_ = pc_;
820
- emit_arith(0, dst, x);
821
- }
822
-
823
-
824
- void Assembler::and_(Register dst, int32_t imm32) {
825
- EnsureSpace ensure_space(this);
826
- last_pc_ = pc_;
827
- emit_arith(4, Operand(dst), Immediate(imm32));
828
- }
829
-
830
-
831
- void Assembler::and_(Register dst, const Operand& src) {
832
- EnsureSpace ensure_space(this);
833
- last_pc_ = pc_;
834
- EMIT(0x23);
835
- emit_operand(dst, src);
836
- }
837
-
838
-
839
- void Assembler::and_(const Operand& dst, const Immediate& x) {
840
- EnsureSpace ensure_space(this);
841
- last_pc_ = pc_;
842
- emit_arith(4, dst, x);
843
- }
844
-
845
-
846
- void Assembler::and_(const Operand& dst, Register src) {
847
- EnsureSpace ensure_space(this);
848
- last_pc_ = pc_;
849
- EMIT(0x21);
850
- emit_operand(src, dst);
851
- }
852
-
853
-
854
- void Assembler::cmpb(const Operand& op, int8_t imm8) {
855
- EnsureSpace ensure_space(this);
856
- last_pc_ = pc_;
857
- EMIT(0x80);
858
- emit_operand(edi, op); // edi == 7
859
- EMIT(imm8);
860
- }
861
-
862
-
863
- void Assembler::cmpw(const Operand& op, Immediate imm16) {
864
- ASSERT(imm16.is_int16());
865
- EnsureSpace ensure_space(this);
866
- last_pc_ = pc_;
867
- EMIT(0x66);
868
- EMIT(0x81);
869
- emit_operand(edi, op);
870
- emit_w(imm16);
871
- }
872
-
873
-
874
- void Assembler::cmp(Register reg, int32_t imm32) {
875
- EnsureSpace ensure_space(this);
876
- last_pc_ = pc_;
877
- emit_arith(7, Operand(reg), Immediate(imm32));
878
- }
879
-
880
-
881
- void Assembler::cmp(Register reg, Handle<Object> handle) {
882
- EnsureSpace ensure_space(this);
883
- last_pc_ = pc_;
884
- emit_arith(7, Operand(reg), Immediate(handle));
885
- }
886
-
887
-
888
- void Assembler::cmp(Register reg, const Operand& op) {
889
- EnsureSpace ensure_space(this);
890
- last_pc_ = pc_;
891
- EMIT(0x3B);
892
- emit_operand(reg, op);
893
- }
894
-
895
-
896
- void Assembler::cmp(const Operand& op, const Immediate& imm) {
897
- EnsureSpace ensure_space(this);
898
- last_pc_ = pc_;
899
- emit_arith(7, op, imm);
900
- }
901
-
902
-
903
- void Assembler::cmp(const Operand& op, Handle<Object> handle) {
904
- EnsureSpace ensure_space(this);
905
- last_pc_ = pc_;
906
- emit_arith(7, op, Immediate(handle));
907
- }
908
-
909
-
910
- void Assembler::cmpb_al(const Operand& op) {
911
- EnsureSpace ensure_space(this);
912
- last_pc_ = pc_;
913
- EMIT(0x38); // CMP r/m8, r8
914
- emit_operand(eax, op); // eax has same code as register al.
915
- }
916
-
917
-
918
- void Assembler::cmpw_ax(const Operand& op) {
919
- EnsureSpace ensure_space(this);
920
- last_pc_ = pc_;
921
- EMIT(0x66);
922
- EMIT(0x39); // CMP r/m16, r16
923
- emit_operand(eax, op); // eax has same code as register ax.
924
- }
925
-
926
-
927
- void Assembler::dec_b(Register dst) {
928
- EnsureSpace ensure_space(this);
929
- last_pc_ = pc_;
930
- EMIT(0xFE);
931
- EMIT(0xC8 | dst.code());
932
- }
933
-
934
-
935
- void Assembler::dec(Register dst) {
936
- EnsureSpace ensure_space(this);
937
- last_pc_ = pc_;
938
- EMIT(0x48 | dst.code());
939
- }
940
-
941
-
942
- void Assembler::dec(const Operand& dst) {
943
- EnsureSpace ensure_space(this);
944
- last_pc_ = pc_;
945
- EMIT(0xFF);
946
- emit_operand(ecx, dst);
947
- }
948
-
949
-
950
- void Assembler::cdq() {
951
- EnsureSpace ensure_space(this);
952
- last_pc_ = pc_;
953
- EMIT(0x99);
954
- }
955
-
956
-
957
- void Assembler::idiv(Register src) {
958
- EnsureSpace ensure_space(this);
959
- last_pc_ = pc_;
960
- EMIT(0xF7);
961
- EMIT(0xF8 | src.code());
962
- }
963
-
964
-
965
- void Assembler::imul(Register reg) {
966
- EnsureSpace ensure_space(this);
967
- last_pc_ = pc_;
968
- EMIT(0xF7);
969
- EMIT(0xE8 | reg.code());
970
- }
971
-
972
-
973
- void Assembler::imul(Register dst, const Operand& src) {
974
- EnsureSpace ensure_space(this);
975
- last_pc_ = pc_;
976
- EMIT(0x0F);
977
- EMIT(0xAF);
978
- emit_operand(dst, src);
979
- }
980
-
981
-
982
- void Assembler::imul(Register dst, Register src, int32_t imm32) {
983
- EnsureSpace ensure_space(this);
984
- last_pc_ = pc_;
985
- if (is_int8(imm32)) {
986
- EMIT(0x6B);
987
- EMIT(0xC0 | dst.code() << 3 | src.code());
988
- EMIT(imm32);
989
- } else {
990
- EMIT(0x69);
991
- EMIT(0xC0 | dst.code() << 3 | src.code());
992
- emit(imm32);
993
- }
994
- }
995
-
996
-
997
- void Assembler::inc(Register dst) {
998
- EnsureSpace ensure_space(this);
999
- last_pc_ = pc_;
1000
- EMIT(0x40 | dst.code());
1001
- }
1002
-
1003
-
1004
- void Assembler::inc(const Operand& dst) {
1005
- EnsureSpace ensure_space(this);
1006
- last_pc_ = pc_;
1007
- EMIT(0xFF);
1008
- emit_operand(eax, dst);
1009
- }
1010
-
1011
-
1012
- void Assembler::lea(Register dst, const Operand& src) {
1013
- EnsureSpace ensure_space(this);
1014
- last_pc_ = pc_;
1015
- EMIT(0x8D);
1016
- emit_operand(dst, src);
1017
- }
1018
-
1019
-
1020
- void Assembler::mul(Register src) {
1021
- EnsureSpace ensure_space(this);
1022
- last_pc_ = pc_;
1023
- EMIT(0xF7);
1024
- EMIT(0xE0 | src.code());
1025
- }
1026
-
1027
-
1028
- void Assembler::neg(Register dst) {
1029
- EnsureSpace ensure_space(this);
1030
- last_pc_ = pc_;
1031
- EMIT(0xF7);
1032
- EMIT(0xD8 | dst.code());
1033
- }
1034
-
1035
-
1036
- void Assembler::not_(Register dst) {
1037
- EnsureSpace ensure_space(this);
1038
- last_pc_ = pc_;
1039
- EMIT(0xF7);
1040
- EMIT(0xD0 | dst.code());
1041
- }
1042
-
1043
-
1044
- void Assembler::or_(Register dst, int32_t imm32) {
1045
- EnsureSpace ensure_space(this);
1046
- last_pc_ = pc_;
1047
- emit_arith(1, Operand(dst), Immediate(imm32));
1048
- }
1049
-
1050
-
1051
- void Assembler::or_(Register dst, const Operand& src) {
1052
- EnsureSpace ensure_space(this);
1053
- last_pc_ = pc_;
1054
- EMIT(0x0B);
1055
- emit_operand(dst, src);
1056
- }
1057
-
1058
-
1059
- void Assembler::or_(const Operand& dst, const Immediate& x) {
1060
- EnsureSpace ensure_space(this);
1061
- last_pc_ = pc_;
1062
- emit_arith(1, dst, x);
1063
- }
1064
-
1065
-
1066
- void Assembler::or_(const Operand& dst, Register src) {
1067
- EnsureSpace ensure_space(this);
1068
- last_pc_ = pc_;
1069
- EMIT(0x09);
1070
- emit_operand(src, dst);
1071
- }
1072
-
1073
-
1074
- void Assembler::rcl(Register dst, uint8_t imm8) {
1075
- EnsureSpace ensure_space(this);
1076
- last_pc_ = pc_;
1077
- ASSERT(is_uint5(imm8)); // illegal shift count
1078
- if (imm8 == 1) {
1079
- EMIT(0xD1);
1080
- EMIT(0xD0 | dst.code());
1081
- } else {
1082
- EMIT(0xC1);
1083
- EMIT(0xD0 | dst.code());
1084
- EMIT(imm8);
1085
- }
1086
- }
1087
-
1088
-
1089
- void Assembler::sar(Register dst, uint8_t imm8) {
1090
- EnsureSpace ensure_space(this);
1091
- last_pc_ = pc_;
1092
- ASSERT(is_uint5(imm8)); // illegal shift count
1093
- if (imm8 == 1) {
1094
- EMIT(0xD1);
1095
- EMIT(0xF8 | dst.code());
1096
- } else {
1097
- EMIT(0xC1);
1098
- EMIT(0xF8 | dst.code());
1099
- EMIT(imm8);
1100
- }
1101
- }
1102
-
1103
-
1104
- void Assembler::sar_cl(Register dst) {
1105
- EnsureSpace ensure_space(this);
1106
- last_pc_ = pc_;
1107
- EMIT(0xD3);
1108
- EMIT(0xF8 | dst.code());
1109
- }
1110
-
1111
-
1112
- void Assembler::sbb(Register dst, const Operand& src) {
1113
- EnsureSpace ensure_space(this);
1114
- last_pc_ = pc_;
1115
- EMIT(0x1B);
1116
- emit_operand(dst, src);
1117
- }
1118
-
1119
-
1120
- void Assembler::shld(Register dst, const Operand& src) {
1121
- EnsureSpace ensure_space(this);
1122
- last_pc_ = pc_;
1123
- EMIT(0x0F);
1124
- EMIT(0xA5);
1125
- emit_operand(dst, src);
1126
- }
1127
-
1128
-
1129
- void Assembler::shl(Register dst, uint8_t imm8) {
1130
- EnsureSpace ensure_space(this);
1131
- last_pc_ = pc_;
1132
- ASSERT(is_uint5(imm8)); // illegal shift count
1133
- if (imm8 == 1) {
1134
- EMIT(0xD1);
1135
- EMIT(0xE0 | dst.code());
1136
- } else {
1137
- EMIT(0xC1);
1138
- EMIT(0xE0 | dst.code());
1139
- EMIT(imm8);
1140
- }
1141
- }
1142
-
1143
-
1144
- void Assembler::shl_cl(Register dst) {
1145
- EnsureSpace ensure_space(this);
1146
- last_pc_ = pc_;
1147
- EMIT(0xD3);
1148
- EMIT(0xE0 | dst.code());
1149
- }
1150
-
1151
-
1152
- void Assembler::shrd(Register dst, const Operand& src) {
1153
- EnsureSpace ensure_space(this);
1154
- last_pc_ = pc_;
1155
- EMIT(0x0F);
1156
- EMIT(0xAD);
1157
- emit_operand(dst, src);
1158
- }
1159
-
1160
-
1161
- void Assembler::shr(Register dst, uint8_t imm8) {
1162
- EnsureSpace ensure_space(this);
1163
- last_pc_ = pc_;
1164
- ASSERT(is_uint5(imm8)); // illegal shift count
1165
- if (imm8 == 1) {
1166
- EMIT(0xD1);
1167
- EMIT(0xE8 | dst.code());
1168
- } else {
1169
- EMIT(0xC1);
1170
- EMIT(0xE8 | dst.code());
1171
- EMIT(imm8);
1172
- }
1173
- }
1174
-
1175
-
1176
- void Assembler::shr_cl(Register dst) {
1177
- EnsureSpace ensure_space(this);
1178
- last_pc_ = pc_;
1179
- EMIT(0xD3);
1180
- EMIT(0xE8 | dst.code());
1181
- }
1182
-
1183
-
1184
- void Assembler::subb(const Operand& op, int8_t imm8) {
1185
- EnsureSpace ensure_space(this);
1186
- last_pc_ = pc_;
1187
- if (op.is_reg(eax)) {
1188
- EMIT(0x2c);
1189
- } else {
1190
- EMIT(0x80);
1191
- emit_operand(ebp, op); // ebp == 5
1192
- }
1193
- EMIT(imm8);
1194
- }
1195
-
1196
-
1197
- void Assembler::sub(const Operand& dst, const Immediate& x) {
1198
- EnsureSpace ensure_space(this);
1199
- last_pc_ = pc_;
1200
- emit_arith(5, dst, x);
1201
- }
1202
-
1203
-
1204
- void Assembler::sub(Register dst, const Operand& src) {
1205
- EnsureSpace ensure_space(this);
1206
- last_pc_ = pc_;
1207
- EMIT(0x2B);
1208
- emit_operand(dst, src);
1209
- }
1210
-
1211
-
1212
- void Assembler::subb(Register dst, const Operand& src) {
1213
- ASSERT(dst.code() < 4);
1214
- EnsureSpace ensure_space(this);
1215
- last_pc_ = pc_;
1216
- EMIT(0x2A);
1217
- emit_operand(dst, src);
1218
- }
1219
-
1220
-
1221
- void Assembler::sub(const Operand& dst, Register src) {
1222
- EnsureSpace ensure_space(this);
1223
- last_pc_ = pc_;
1224
- EMIT(0x29);
1225
- emit_operand(src, dst);
1226
- }
1227
-
1228
-
1229
- void Assembler::test(Register reg, const Immediate& imm) {
1230
- EnsureSpace ensure_space(this);
1231
- last_pc_ = pc_;
1232
- // Only use test against byte for registers that have a byte
1233
- // variant: eax, ebx, ecx, and edx.
1234
- if (imm.rmode_ == RelocInfo::NONE && is_uint8(imm.x_) && reg.code() < 4) {
1235
- uint8_t imm8 = imm.x_;
1236
- if (reg.is(eax)) {
1237
- EMIT(0xA8);
1238
- EMIT(imm8);
1239
- } else {
1240
- emit_arith_b(0xF6, 0xC0, reg, imm8);
1241
- }
1242
- } else {
1243
- // This is not using emit_arith because test doesn't support
1244
- // sign-extension of 8-bit operands.
1245
- if (reg.is(eax)) {
1246
- EMIT(0xA9);
1247
- } else {
1248
- EMIT(0xF7);
1249
- EMIT(0xC0 | reg.code());
1250
- }
1251
- emit(imm);
1252
- }
1253
- }
1254
-
1255
-
1256
- void Assembler::test(Register reg, const Operand& op) {
1257
- EnsureSpace ensure_space(this);
1258
- last_pc_ = pc_;
1259
- EMIT(0x85);
1260
- emit_operand(reg, op);
1261
- }
1262
-
1263
-
1264
- void Assembler::test(const Operand& op, const Immediate& imm) {
1265
- EnsureSpace ensure_space(this);
1266
- last_pc_ = pc_;
1267
- EMIT(0xF7);
1268
- emit_operand(eax, op);
1269
- emit(imm);
1270
- }
1271
-
1272
-
1273
- void Assembler::xor_(Register dst, int32_t imm32) {
1274
- EnsureSpace ensure_space(this);
1275
- last_pc_ = pc_;
1276
- emit_arith(6, Operand(dst), Immediate(imm32));
1277
- }
1278
-
1279
-
1280
- void Assembler::xor_(Register dst, const Operand& src) {
1281
- EnsureSpace ensure_space(this);
1282
- last_pc_ = pc_;
1283
- EMIT(0x33);
1284
- emit_operand(dst, src);
1285
- }
1286
-
1287
-
1288
- void Assembler::xor_(const Operand& src, Register dst) {
1289
- EnsureSpace ensure_space(this);
1290
- last_pc_ = pc_;
1291
- EMIT(0x31);
1292
- emit_operand(dst, src);
1293
- }
1294
-
1295
-
1296
- void Assembler::xor_(const Operand& dst, const Immediate& x) {
1297
- EnsureSpace ensure_space(this);
1298
- last_pc_ = pc_;
1299
- emit_arith(6, dst, x);
1300
- }
1301
-
1302
-
1303
- void Assembler::bt(const Operand& dst, Register src) {
1304
- EnsureSpace ensure_space(this);
1305
- last_pc_ = pc_;
1306
- EMIT(0x0F);
1307
- EMIT(0xA3);
1308
- emit_operand(src, dst);
1309
- }
1310
-
1311
-
1312
- void Assembler::bts(const Operand& dst, Register src) {
1313
- EnsureSpace ensure_space(this);
1314
- last_pc_ = pc_;
1315
- EMIT(0x0F);
1316
- EMIT(0xAB);
1317
- emit_operand(src, dst);
1318
- }
1319
-
1320
-
1321
- void Assembler::hlt() {
1322
- EnsureSpace ensure_space(this);
1323
- last_pc_ = pc_;
1324
- EMIT(0xF4);
1325
- }
1326
-
1327
-
1328
- void Assembler::int3() {
1329
- EnsureSpace ensure_space(this);
1330
- last_pc_ = pc_;
1331
- EMIT(0xCC);
1332
- }
1333
-
1334
-
1335
- void Assembler::nop() {
1336
- EnsureSpace ensure_space(this);
1337
- last_pc_ = pc_;
1338
- EMIT(0x90);
1339
- }
1340
-
1341
-
1342
- void Assembler::rdtsc() {
1343
- ASSERT(CpuFeatures::IsEnabled(RDTSC));
1344
- EnsureSpace ensure_space(this);
1345
- last_pc_ = pc_;
1346
- EMIT(0x0F);
1347
- EMIT(0x31);
1348
- }
1349
-
1350
-
1351
- void Assembler::ret(int imm16) {
1352
- EnsureSpace ensure_space(this);
1353
- last_pc_ = pc_;
1354
- ASSERT(is_uint16(imm16));
1355
- if (imm16 == 0) {
1356
- EMIT(0xC3);
1357
- } else {
1358
- EMIT(0xC2);
1359
- EMIT(imm16 & 0xFF);
1360
- EMIT((imm16 >> 8) & 0xFF);
1361
- }
1362
- }
1363
-
1364
-
1365
- // Labels refer to positions in the (to be) generated code.
1366
- // There are bound, linked, and unused labels.
1367
- //
1368
- // Bound labels refer to known positions in the already
1369
- // generated code. pos() is the position the label refers to.
1370
- //
1371
- // Linked labels refer to unknown positions in the code
1372
- // to be generated; pos() is the position of the 32bit
1373
- // Displacement of the last instruction using the label.
1374
-
1375
-
1376
- void Assembler::print(Label* L) {
1377
- if (L->is_unused()) {
1378
- PrintF("unused label\n");
1379
- } else if (L->is_bound()) {
1380
- PrintF("bound label to %d\n", L->pos());
1381
- } else if (L->is_linked()) {
1382
- Label l = *L;
1383
- PrintF("unbound label");
1384
- while (l.is_linked()) {
1385
- Displacement disp = disp_at(&l);
1386
- PrintF("@ %d ", l.pos());
1387
- disp.print();
1388
- PrintF("\n");
1389
- disp.next(&l);
1390
- }
1391
- } else {
1392
- PrintF("label in inconsistent state (pos = %d)\n", L->pos_);
1393
- }
1394
- }
1395
-
1396
-
1397
- void Assembler::bind_to(Label* L, int pos) {
1398
- EnsureSpace ensure_space(this);
1399
- last_pc_ = NULL;
1400
- ASSERT(0 <= pos && pos <= pc_offset()); // must have a valid binding position
1401
- while (L->is_linked()) {
1402
- Displacement disp = disp_at(L);
1403
- int fixup_pos = L->pos();
1404
- if (disp.type() == Displacement::CODE_RELATIVE) {
1405
- // Relative to Code* heap object pointer.
1406
- long_at_put(fixup_pos, pos + Code::kHeaderSize - kHeapObjectTag);
1407
- } else {
1408
- if (disp.type() == Displacement::UNCONDITIONAL_JUMP) {
1409
- ASSERT(byte_at(fixup_pos - 1) == 0xE9); // jmp expected
1410
- }
1411
- // relative address, relative to point after address
1412
- int imm32 = pos - (fixup_pos + sizeof(int32_t));
1413
- long_at_put(fixup_pos, imm32);
1414
- }
1415
- disp.next(L);
1416
- }
1417
- L->bind_to(pos);
1418
- }
1419
-
1420
-
1421
- void Assembler::link_to(Label* L, Label* appendix) {
1422
- EnsureSpace ensure_space(this);
1423
- last_pc_ = NULL;
1424
- if (appendix->is_linked()) {
1425
- if (L->is_linked()) {
1426
- // append appendix to L's list
1427
- Label p;
1428
- Label q = *L;
1429
- do {
1430
- p = q;
1431
- Displacement disp = disp_at(&q);
1432
- disp.next(&q);
1433
- } while (q.is_linked());
1434
- Displacement disp = disp_at(&p);
1435
- disp.link_to(appendix);
1436
- disp_at_put(&p, disp);
1437
- p.Unuse(); // to avoid assertion failure in ~Label
1438
- } else {
1439
- // L is empty, simply use appendix
1440
- *L = *appendix;
1441
- }
1442
- }
1443
- appendix->Unuse(); // appendix should not be used anymore
1444
- }
1445
-
1446
-
1447
- void Assembler::bind(Label* L) {
1448
- EnsureSpace ensure_space(this);
1449
- last_pc_ = NULL;
1450
- ASSERT(!L->is_bound()); // label can only be bound once
1451
- bind_to(L, pc_offset());
1452
- }
1453
-
1454
-
1455
- void Assembler::call(Label* L) {
1456
- EnsureSpace ensure_space(this);
1457
- last_pc_ = pc_;
1458
- if (L->is_bound()) {
1459
- const int long_size = 5;
1460
- int offs = L->pos() - pc_offset();
1461
- ASSERT(offs <= 0);
1462
- // 1110 1000 #32-bit disp
1463
- EMIT(0xE8);
1464
- emit(offs - long_size);
1465
- } else {
1466
- // 1110 1000 #32-bit disp
1467
- EMIT(0xE8);
1468
- emit_disp(L, Displacement::OTHER);
1469
- }
1470
- }
1471
-
1472
-
1473
- void Assembler::call(byte* entry, RelocInfo::Mode rmode) {
1474
- EnsureSpace ensure_space(this);
1475
- last_pc_ = pc_;
1476
- ASSERT(!RelocInfo::IsCodeTarget(rmode));
1477
- EMIT(0xE8);
1478
- emit(entry - (pc_ + sizeof(int32_t)), rmode);
1479
- }
1480
-
1481
-
1482
- void Assembler::call(const Operand& adr) {
1483
- EnsureSpace ensure_space(this);
1484
- last_pc_ = pc_;
1485
- EMIT(0xFF);
1486
- emit_operand(edx, adr);
1487
- }
1488
-
1489
-
1490
- void Assembler::call(Handle<Code> code, RelocInfo::Mode rmode) {
1491
- WriteRecordedPositions();
1492
- EnsureSpace ensure_space(this);
1493
- last_pc_ = pc_;
1494
- ASSERT(RelocInfo::IsCodeTarget(rmode));
1495
- EMIT(0xE8);
1496
- emit(reinterpret_cast<intptr_t>(code.location()), rmode);
1497
- }
1498
-
1499
-
1500
- void Assembler::jmp(Label* L) {
1501
- EnsureSpace ensure_space(this);
1502
- last_pc_ = pc_;
1503
- if (L->is_bound()) {
1504
- const int short_size = 2;
1505
- const int long_size = 5;
1506
- int offs = L->pos() - pc_offset();
1507
- ASSERT(offs <= 0);
1508
- if (is_int8(offs - short_size)) {
1509
- // 1110 1011 #8-bit disp
1510
- EMIT(0xEB);
1511
- EMIT((offs - short_size) & 0xFF);
1512
- } else {
1513
- // 1110 1001 #32-bit disp
1514
- EMIT(0xE9);
1515
- emit(offs - long_size);
1516
- }
1517
- } else {
1518
- // 1110 1001 #32-bit disp
1519
- EMIT(0xE9);
1520
- emit_disp(L, Displacement::UNCONDITIONAL_JUMP);
1521
- }
1522
- }
1523
-
1524
-
1525
- void Assembler::jmp(byte* entry, RelocInfo::Mode rmode) {
1526
- EnsureSpace ensure_space(this);
1527
- last_pc_ = pc_;
1528
- ASSERT(!RelocInfo::IsCodeTarget(rmode));
1529
- EMIT(0xE9);
1530
- emit(entry - (pc_ + sizeof(int32_t)), rmode);
1531
- }
1532
-
1533
-
1534
- void Assembler::jmp(const Operand& adr) {
1535
- EnsureSpace ensure_space(this);
1536
- last_pc_ = pc_;
1537
- EMIT(0xFF);
1538
- emit_operand(esp, adr);
1539
- }
1540
-
1541
-
1542
- void Assembler::jmp(Handle<Code> code, RelocInfo::Mode rmode) {
1543
- EnsureSpace ensure_space(this);
1544
- last_pc_ = pc_;
1545
- ASSERT(RelocInfo::IsCodeTarget(rmode));
1546
- EMIT(0xE9);
1547
- emit(reinterpret_cast<intptr_t>(code.location()), rmode);
1548
- }
1549
-
1550
-
1551
-
1552
- void Assembler::j(Condition cc, Label* L, Hint hint) {
1553
- EnsureSpace ensure_space(this);
1554
- last_pc_ = pc_;
1555
- ASSERT(0 <= cc && cc < 16);
1556
- if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint);
1557
- if (L->is_bound()) {
1558
- const int short_size = 2;
1559
- const int long_size = 6;
1560
- int offs = L->pos() - pc_offset();
1561
- ASSERT(offs <= 0);
1562
- if (is_int8(offs - short_size)) {
1563
- // 0111 tttn #8-bit disp
1564
- EMIT(0x70 | cc);
1565
- EMIT((offs - short_size) & 0xFF);
1566
- } else {
1567
- // 0000 1111 1000 tttn #32-bit disp
1568
- EMIT(0x0F);
1569
- EMIT(0x80 | cc);
1570
- emit(offs - long_size);
1571
- }
1572
- } else {
1573
- // 0000 1111 1000 tttn #32-bit disp
1574
- // Note: could eliminate cond. jumps to this jump if condition
1575
- // is the same however, seems to be rather unlikely case.
1576
- EMIT(0x0F);
1577
- EMIT(0x80 | cc);
1578
- emit_disp(L, Displacement::OTHER);
1579
- }
1580
- }
1581
-
1582
-
1583
- void Assembler::j(Condition cc, byte* entry, RelocInfo::Mode rmode, Hint hint) {
1584
- EnsureSpace ensure_space(this);
1585
- last_pc_ = pc_;
1586
- ASSERT((0 <= cc) && (cc < 16));
1587
- if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint);
1588
- // 0000 1111 1000 tttn #32-bit disp
1589
- EMIT(0x0F);
1590
- EMIT(0x80 | cc);
1591
- emit(entry - (pc_ + sizeof(int32_t)), rmode);
1592
- }
1593
-
1594
-
1595
- void Assembler::j(Condition cc, Handle<Code> code, Hint hint) {
1596
- EnsureSpace ensure_space(this);
1597
- last_pc_ = pc_;
1598
- if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint);
1599
- // 0000 1111 1000 tttn #32-bit disp
1600
- EMIT(0x0F);
1601
- EMIT(0x80 | cc);
1602
- emit(reinterpret_cast<intptr_t>(code.location()), RelocInfo::CODE_TARGET);
1603
- }
1604
-
1605
-
1606
- // FPU instructions
1607
-
1608
- void Assembler::fld(int i) {
1609
- EnsureSpace ensure_space(this);
1610
- last_pc_ = pc_;
1611
- emit_farith(0xD9, 0xC0, i);
1612
- }
1613
-
1614
-
1615
- void Assembler::fld1() {
1616
- EnsureSpace ensure_space(this);
1617
- last_pc_ = pc_;
1618
- EMIT(0xD9);
1619
- EMIT(0xE8);
1620
- }
1621
-
1622
-
1623
- void Assembler::fldz() {
1624
- EnsureSpace ensure_space(this);
1625
- last_pc_ = pc_;
1626
- EMIT(0xD9);
1627
- EMIT(0xEE);
1628
- }
1629
-
1630
-
1631
- void Assembler::fld_s(const Operand& adr) {
1632
- EnsureSpace ensure_space(this);
1633
- last_pc_ = pc_;
1634
- EMIT(0xD9);
1635
- emit_operand(eax, adr);
1636
- }
1637
-
1638
-
1639
- void Assembler::fld_d(const Operand& adr) {
1640
- EnsureSpace ensure_space(this);
1641
- last_pc_ = pc_;
1642
- EMIT(0xDD);
1643
- emit_operand(eax, adr);
1644
- }
1645
-
1646
-
1647
- void Assembler::fstp_s(const Operand& adr) {
1648
- EnsureSpace ensure_space(this);
1649
- last_pc_ = pc_;
1650
- EMIT(0xD9);
1651
- emit_operand(ebx, adr);
1652
- }
1653
-
1654
-
1655
- void Assembler::fstp_d(const Operand& adr) {
1656
- EnsureSpace ensure_space(this);
1657
- last_pc_ = pc_;
1658
- EMIT(0xDD);
1659
- emit_operand(ebx, adr);
1660
- }
1661
-
1662
-
1663
- void Assembler::fild_s(const Operand& adr) {
1664
- EnsureSpace ensure_space(this);
1665
- last_pc_ = pc_;
1666
- EMIT(0xDB);
1667
- emit_operand(eax, adr);
1668
- }
1669
-
1670
-
1671
- void Assembler::fild_d(const Operand& adr) {
1672
- EnsureSpace ensure_space(this);
1673
- last_pc_ = pc_;
1674
- EMIT(0xDF);
1675
- emit_operand(ebp, adr);
1676
- }
1677
-
1678
-
1679
- void Assembler::fistp_s(const Operand& adr) {
1680
- EnsureSpace ensure_space(this);
1681
- last_pc_ = pc_;
1682
- EMIT(0xDB);
1683
- emit_operand(ebx, adr);
1684
- }
1685
-
1686
-
1687
- void Assembler::fisttp_s(const Operand& adr) {
1688
- ASSERT(CpuFeatures::IsEnabled(SSE3));
1689
- EnsureSpace ensure_space(this);
1690
- last_pc_ = pc_;
1691
- EMIT(0xDB);
1692
- emit_operand(ecx, adr);
1693
- }
1694
-
1695
-
1696
- void Assembler::fisttp_d(const Operand& adr) {
1697
- ASSERT(CpuFeatures::IsEnabled(SSE3));
1698
- EnsureSpace ensure_space(this);
1699
- last_pc_ = pc_;
1700
- EMIT(0xDD);
1701
- emit_operand(ecx, adr);
1702
- }
1703
-
1704
-
1705
- void Assembler::fist_s(const Operand& adr) {
1706
- EnsureSpace ensure_space(this);
1707
- last_pc_ = pc_;
1708
- EMIT(0xDB);
1709
- emit_operand(edx, adr);
1710
- }
1711
-
1712
-
1713
- void Assembler::fistp_d(const Operand& adr) {
1714
- EnsureSpace ensure_space(this);
1715
- last_pc_ = pc_;
1716
- EMIT(0xDF);
1717
- emit_operand(edi, adr);
1718
- }
1719
-
1720
-
1721
- void Assembler::fabs() {
1722
- EnsureSpace ensure_space(this);
1723
- last_pc_ = pc_;
1724
- EMIT(0xD9);
1725
- EMIT(0xE1);
1726
- }
1727
-
1728
-
1729
- void Assembler::fchs() {
1730
- EnsureSpace ensure_space(this);
1731
- last_pc_ = pc_;
1732
- EMIT(0xD9);
1733
- EMIT(0xE0);
1734
- }
1735
-
1736
-
1737
- void Assembler::fcos() {
1738
- EnsureSpace ensure_space(this);
1739
- last_pc_ = pc_;
1740
- EMIT(0xD9);
1741
- EMIT(0xFF);
1742
- }
1743
-
1744
-
1745
- void Assembler::fsin() {
1746
- EnsureSpace ensure_space(this);
1747
- last_pc_ = pc_;
1748
- EMIT(0xD9);
1749
- EMIT(0xFE);
1750
- }
1751
-
1752
-
1753
- void Assembler::fadd(int i) {
1754
- EnsureSpace ensure_space(this);
1755
- last_pc_ = pc_;
1756
- emit_farith(0xDC, 0xC0, i);
1757
- }
1758
-
1759
-
1760
- void Assembler::fsub(int i) {
1761
- EnsureSpace ensure_space(this);
1762
- last_pc_ = pc_;
1763
- emit_farith(0xDC, 0xE8, i);
1764
- }
1765
-
1766
-
1767
- void Assembler::fisub_s(const Operand& adr) {
1768
- EnsureSpace ensure_space(this);
1769
- last_pc_ = pc_;
1770
- EMIT(0xDA);
1771
- emit_operand(esp, adr);
1772
- }
1773
-
1774
-
1775
- void Assembler::fmul(int i) {
1776
- EnsureSpace ensure_space(this);
1777
- last_pc_ = pc_;
1778
- emit_farith(0xDC, 0xC8, i);
1779
- }
1780
-
1781
-
1782
- void Assembler::fdiv(int i) {
1783
- EnsureSpace ensure_space(this);
1784
- last_pc_ = pc_;
1785
- emit_farith(0xDC, 0xF8, i);
1786
- }
1787
-
1788
-
1789
- void Assembler::faddp(int i) {
1790
- EnsureSpace ensure_space(this);
1791
- last_pc_ = pc_;
1792
- emit_farith(0xDE, 0xC0, i);
1793
- }
1794
-
1795
-
1796
- void Assembler::fsubp(int i) {
1797
- EnsureSpace ensure_space(this);
1798
- last_pc_ = pc_;
1799
- emit_farith(0xDE, 0xE8, i);
1800
- }
1801
-
1802
-
1803
- void Assembler::fsubrp(int i) {
1804
- EnsureSpace ensure_space(this);
1805
- last_pc_ = pc_;
1806
- emit_farith(0xDE, 0xE0, i);
1807
- }
1808
-
1809
-
1810
- void Assembler::fmulp(int i) {
1811
- EnsureSpace ensure_space(this);
1812
- last_pc_ = pc_;
1813
- emit_farith(0xDE, 0xC8, i);
1814
- }
1815
-
1816
-
1817
- void Assembler::fdivp(int i) {
1818
- EnsureSpace ensure_space(this);
1819
- last_pc_ = pc_;
1820
- emit_farith(0xDE, 0xF8, i);
1821
- }
1822
-
1823
-
1824
- void Assembler::fprem() {
1825
- EnsureSpace ensure_space(this);
1826
- last_pc_ = pc_;
1827
- EMIT(0xD9);
1828
- EMIT(0xF8);
1829
- }
1830
-
1831
-
1832
- void Assembler::fprem1() {
1833
- EnsureSpace ensure_space(this);
1834
- last_pc_ = pc_;
1835
- EMIT(0xD9);
1836
- EMIT(0xF5);
1837
- }
1838
-
1839
-
1840
- void Assembler::fxch(int i) {
1841
- EnsureSpace ensure_space(this);
1842
- last_pc_ = pc_;
1843
- emit_farith(0xD9, 0xC8, i);
1844
- }
1845
-
1846
-
1847
- void Assembler::fincstp() {
1848
- EnsureSpace ensure_space(this);
1849
- last_pc_ = pc_;
1850
- EMIT(0xD9);
1851
- EMIT(0xF7);
1852
- }
1853
-
1854
-
1855
- void Assembler::ffree(int i) {
1856
- EnsureSpace ensure_space(this);
1857
- last_pc_ = pc_;
1858
- emit_farith(0xDD, 0xC0, i);
1859
- }
1860
-
1861
-
1862
- void Assembler::ftst() {
1863
- EnsureSpace ensure_space(this);
1864
- last_pc_ = pc_;
1865
- EMIT(0xD9);
1866
- EMIT(0xE4);
1867
- }
1868
-
1869
-
1870
- void Assembler::fucomp(int i) {
1871
- EnsureSpace ensure_space(this);
1872
- last_pc_ = pc_;
1873
- emit_farith(0xDD, 0xE8, i);
1874
- }
1875
-
1876
-
1877
- void Assembler::fucompp() {
1878
- EnsureSpace ensure_space(this);
1879
- last_pc_ = pc_;
1880
- EMIT(0xDA);
1881
- EMIT(0xE9);
1882
- }
1883
-
1884
-
1885
- void Assembler::fucomi(int i) {
1886
- EnsureSpace ensure_space(this);
1887
- last_pc_ = pc_;
1888
- EMIT(0xDB);
1889
- EMIT(0xE8 + i);
1890
- }
1891
-
1892
-
1893
- void Assembler::fucomip() {
1894
- EnsureSpace ensure_space(this);
1895
- last_pc_ = pc_;
1896
- EMIT(0xDF);
1897
- EMIT(0xE9);
1898
- }
1899
-
1900
-
1901
- void Assembler::fcompp() {
1902
- EnsureSpace ensure_space(this);
1903
- last_pc_ = pc_;
1904
- EMIT(0xDE);
1905
- EMIT(0xD9);
1906
- }
1907
-
1908
-
1909
- void Assembler::fnstsw_ax() {
1910
- EnsureSpace ensure_space(this);
1911
- last_pc_ = pc_;
1912
- EMIT(0xDF);
1913
- EMIT(0xE0);
1914
- }
1915
-
1916
-
1917
- void Assembler::fwait() {
1918
- EnsureSpace ensure_space(this);
1919
- last_pc_ = pc_;
1920
- EMIT(0x9B);
1921
- }
1922
-
1923
-
1924
- void Assembler::frndint() {
1925
- EnsureSpace ensure_space(this);
1926
- last_pc_ = pc_;
1927
- EMIT(0xD9);
1928
- EMIT(0xFC);
1929
- }
1930
-
1931
-
1932
- void Assembler::fnclex() {
1933
- EnsureSpace ensure_space(this);
1934
- last_pc_ = pc_;
1935
- EMIT(0xDB);
1936
- EMIT(0xE2);
1937
- }
1938
-
1939
-
1940
- void Assembler::sahf() {
1941
- EnsureSpace ensure_space(this);
1942
- last_pc_ = pc_;
1943
- EMIT(0x9E);
1944
- }
1945
-
1946
-
1947
- void Assembler::setcc(Condition cc, Register reg) {
1948
- ASSERT(reg.is_byte_register());
1949
- EnsureSpace ensure_space(this);
1950
- last_pc_ = pc_;
1951
- EMIT(0x0F);
1952
- EMIT(0x90 | cc);
1953
- EMIT(0xC0 | reg.code());
1954
- }
1955
-
1956
-
1957
- void Assembler::cvttss2si(Register dst, const Operand& src) {
1958
- ASSERT(CpuFeatures::IsEnabled(SSE2));
1959
- EnsureSpace ensure_space(this);
1960
- last_pc_ = pc_;
1961
- EMIT(0xF3);
1962
- EMIT(0x0F);
1963
- EMIT(0x2C);
1964
- emit_operand(dst, src);
1965
- }
1966
-
1967
-
1968
- void Assembler::cvttsd2si(Register dst, const Operand& src) {
1969
- ASSERT(CpuFeatures::IsEnabled(SSE2));
1970
- EnsureSpace ensure_space(this);
1971
- last_pc_ = pc_;
1972
- EMIT(0xF2);
1973
- EMIT(0x0F);
1974
- EMIT(0x2C);
1975
- emit_operand(dst, src);
1976
- }
1977
-
1978
-
1979
- void Assembler::cvtsi2sd(XMMRegister dst, const Operand& src) {
1980
- ASSERT(CpuFeatures::IsEnabled(SSE2));
1981
- EnsureSpace ensure_space(this);
1982
- last_pc_ = pc_;
1983
- EMIT(0xF2);
1984
- EMIT(0x0F);
1985
- EMIT(0x2A);
1986
- emit_sse_operand(dst, src);
1987
- }
1988
-
1989
-
1990
- void Assembler::addsd(XMMRegister dst, XMMRegister src) {
1991
- ASSERT(CpuFeatures::IsEnabled(SSE2));
1992
- EnsureSpace ensure_space(this);
1993
- last_pc_ = pc_;
1994
- EMIT(0xF2);
1995
- EMIT(0x0F);
1996
- EMIT(0x58);
1997
- emit_sse_operand(dst, src);
1998
- }
1999
-
2000
-
2001
- void Assembler::mulsd(XMMRegister dst, XMMRegister src) {
2002
- ASSERT(CpuFeatures::IsEnabled(SSE2));
2003
- EnsureSpace ensure_space(this);
2004
- last_pc_ = pc_;
2005
- EMIT(0xF2);
2006
- EMIT(0x0F);
2007
- EMIT(0x59);
2008
- emit_sse_operand(dst, src);
2009
- }
2010
-
2011
-
2012
- void Assembler::subsd(XMMRegister dst, XMMRegister src) {
2013
- ASSERT(CpuFeatures::IsEnabled(SSE2));
2014
- EnsureSpace ensure_space(this);
2015
- last_pc_ = pc_;
2016
- EMIT(0xF2);
2017
- EMIT(0x0F);
2018
- EMIT(0x5C);
2019
- emit_sse_operand(dst, src);
2020
- }
2021
-
2022
-
2023
- void Assembler::divsd(XMMRegister dst, XMMRegister src) {
2024
- ASSERT(CpuFeatures::IsEnabled(SSE2));
2025
- EnsureSpace ensure_space(this);
2026
- last_pc_ = pc_;
2027
- EMIT(0xF2);
2028
- EMIT(0x0F);
2029
- EMIT(0x5E);
2030
- emit_sse_operand(dst, src);
2031
- }
2032
-
2033
-
2034
- void Assembler::xorpd(XMMRegister dst, XMMRegister src) {
2035
- ASSERT(CpuFeatures::IsEnabled(SSE2));
2036
- EnsureSpace ensure_space(this);
2037
- last_pc_ = pc_;
2038
- EMIT(0x66);
2039
- EMIT(0x0F);
2040
- EMIT(0x57);
2041
- emit_sse_operand(dst, src);
2042
- }
2043
-
2044
-
2045
- void Assembler::comisd(XMMRegister dst, XMMRegister src) {
2046
- ASSERT(CpuFeatures::IsEnabled(SSE2));
2047
- EnsureSpace ensure_space(this);
2048
- last_pc_ = pc_;
2049
- EMIT(0x66);
2050
- EMIT(0x0F);
2051
- EMIT(0x2F);
2052
- emit_sse_operand(dst, src);
2053
- }
2054
-
2055
-
2056
- void Assembler::movdqa(const Operand& dst, XMMRegister src ) {
2057
- ASSERT(CpuFeatures::IsEnabled(SSE2));
2058
- EnsureSpace ensure_space(this);
2059
- last_pc_ = pc_;
2060
- EMIT(0x66);
2061
- EMIT(0x0F);
2062
- EMIT(0x7F);
2063
- emit_sse_operand(src, dst);
2064
- }
2065
-
2066
-
2067
- void Assembler::movdqa(XMMRegister dst, const Operand& src) {
2068
- ASSERT(CpuFeatures::IsEnabled(SSE2));
2069
- EnsureSpace ensure_space(this);
2070
- last_pc_ = pc_;
2071
- EMIT(0x66);
2072
- EMIT(0x0F);
2073
- EMIT(0x6F);
2074
- emit_sse_operand(dst, src);
2075
- }
2076
-
2077
-
2078
- void Assembler::movdqu(const Operand& dst, XMMRegister src ) {
2079
- ASSERT(CpuFeatures::IsEnabled(SSE2));
2080
- EnsureSpace ensure_space(this);
2081
- last_pc_ = pc_;
2082
- EMIT(0xF3);
2083
- EMIT(0x0F);
2084
- EMIT(0x7F);
2085
- emit_sse_operand(src, dst);
2086
- }
2087
-
2088
-
2089
- void Assembler::movdqu(XMMRegister dst, const Operand& src) {
2090
- ASSERT(CpuFeatures::IsEnabled(SSE2));
2091
- EnsureSpace ensure_space(this);
2092
- last_pc_ = pc_;
2093
- EMIT(0xF3);
2094
- EMIT(0x0F);
2095
- EMIT(0x6F);
2096
- emit_sse_operand(dst, src);
2097
- }
2098
-
2099
-
2100
- void Assembler::movdbl(XMMRegister dst, const Operand& src) {
2101
- EnsureSpace ensure_space(this);
2102
- last_pc_ = pc_;
2103
- movsd(dst, src);
2104
- }
2105
-
2106
-
2107
- void Assembler::movdbl(const Operand& dst, XMMRegister src) {
2108
- EnsureSpace ensure_space(this);
2109
- last_pc_ = pc_;
2110
- movsd(dst, src);
2111
- }
2112
-
2113
-
2114
- void Assembler::movsd(const Operand& dst, XMMRegister src ) {
2115
- ASSERT(CpuFeatures::IsEnabled(SSE2));
2116
- EnsureSpace ensure_space(this);
2117
- last_pc_ = pc_;
2118
- EMIT(0xF2); // double
2119
- EMIT(0x0F);
2120
- EMIT(0x11); // store
2121
- emit_sse_operand(src, dst);
2122
- }
2123
-
2124
-
2125
- void Assembler::movsd(XMMRegister dst, const Operand& src) {
2126
- ASSERT(CpuFeatures::IsEnabled(SSE2));
2127
- EnsureSpace ensure_space(this);
2128
- last_pc_ = pc_;
2129
- EMIT(0xF2); // double
2130
- EMIT(0x0F);
2131
- EMIT(0x10); // load
2132
- emit_sse_operand(dst, src);
2133
- }
2134
-
2135
-
2136
- void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) {
2137
- Register ireg = { reg.code() };
2138
- emit_operand(ireg, adr);
2139
- }
2140
-
2141
-
2142
- void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) {
2143
- EMIT(0xC0 | dst.code() << 3 | src.code());
2144
- }
2145
-
2146
-
2147
- void Assembler::Print() {
2148
- Disassembler::Decode(stdout, buffer_, pc_);
2149
- }
2150
-
2151
-
2152
- void Assembler::RecordJSReturn() {
2153
- WriteRecordedPositions();
2154
- EnsureSpace ensure_space(this);
2155
- RecordRelocInfo(RelocInfo::JS_RETURN);
2156
- }
2157
-
2158
-
2159
- void Assembler::RecordComment(const char* msg) {
2160
- if (FLAG_debug_code) {
2161
- EnsureSpace ensure_space(this);
2162
- RecordRelocInfo(RelocInfo::COMMENT, reinterpret_cast<intptr_t>(msg));
2163
- }
2164
- }
2165
-
2166
-
2167
- void Assembler::RecordPosition(int pos) {
2168
- ASSERT(pos != RelocInfo::kNoPosition);
2169
- ASSERT(pos >= 0);
2170
- current_position_ = pos;
2171
- }
2172
-
2173
-
2174
- void Assembler::RecordStatementPosition(int pos) {
2175
- ASSERT(pos != RelocInfo::kNoPosition);
2176
- ASSERT(pos >= 0);
2177
- current_statement_position_ = pos;
2178
- }
2179
-
2180
-
2181
- void Assembler::WriteRecordedPositions() {
2182
- // Write the statement position if it is different from what was written last
2183
- // time.
2184
- if (current_statement_position_ != written_statement_position_) {
2185
- EnsureSpace ensure_space(this);
2186
- RecordRelocInfo(RelocInfo::STATEMENT_POSITION, current_statement_position_);
2187
- written_statement_position_ = current_statement_position_;
2188
- }
2189
-
2190
- // Write the position if it is different from what was written last time and
2191
- // also different from the written statement position.
2192
- if (current_position_ != written_position_ &&
2193
- current_position_ != written_statement_position_) {
2194
- EnsureSpace ensure_space(this);
2195
- RecordRelocInfo(RelocInfo::POSITION, current_position_);
2196
- written_position_ = current_position_;
2197
- }
2198
- }
2199
-
2200
-
2201
- void Assembler::GrowBuffer() {
2202
- ASSERT(overflow()); // should not call this otherwise
2203
- if (!own_buffer_) FATAL("external code buffer is too small");
2204
-
2205
- // compute new buffer size
2206
- CodeDesc desc; // the new buffer
2207
- if (buffer_size_ < 4*KB) {
2208
- desc.buffer_size = 4*KB;
2209
- } else {
2210
- desc.buffer_size = 2*buffer_size_;
2211
- }
2212
- // Some internal data structures overflow for very large buffers,
2213
- // they must ensure that kMaximalBufferSize is not too large.
2214
- if ((desc.buffer_size > kMaximalBufferSize) ||
2215
- (desc.buffer_size > Heap::MaxOldGenerationSize())) {
2216
- V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
2217
- }
2218
-
2219
- // setup new buffer
2220
- desc.buffer = NewArray<byte>(desc.buffer_size);
2221
- desc.instr_size = pc_offset();
2222
- desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos());
2223
-
2224
- // Clear the buffer in debug mode. Use 'int3' instructions to make
2225
- // sure to get into problems if we ever run uninitialized code.
2226
- #ifdef DEBUG
2227
- memset(desc.buffer, 0xCC, desc.buffer_size);
2228
- #endif
2229
-
2230
- // copy the data
2231
- int pc_delta = desc.buffer - buffer_;
2232
- int rc_delta = (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_);
2233
- memmove(desc.buffer, buffer_, desc.instr_size);
2234
- memmove(rc_delta + reloc_info_writer.pos(),
2235
- reloc_info_writer.pos(), desc.reloc_size);
2236
-
2237
- // switch buffers
2238
- if (spare_buffer_ == NULL && buffer_size_ == kMinimalBufferSize) {
2239
- spare_buffer_ = buffer_;
2240
- } else {
2241
- DeleteArray(buffer_);
2242
- }
2243
- buffer_ = desc.buffer;
2244
- buffer_size_ = desc.buffer_size;
2245
- pc_ += pc_delta;
2246
- if (last_pc_ != NULL) {
2247
- last_pc_ += pc_delta;
2248
- }
2249
- reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
2250
- reloc_info_writer.last_pc() + pc_delta);
2251
-
2252
- // relocate runtime entries
2253
- for (RelocIterator it(desc); !it.done(); it.next()) {
2254
- RelocInfo::Mode rmode = it.rinfo()->rmode();
2255
- if (rmode == RelocInfo::RUNTIME_ENTRY) {
2256
- int32_t* p = reinterpret_cast<int32_t*>(it.rinfo()->pc());
2257
- *p -= pc_delta; // relocate entry
2258
- } else if (rmode == RelocInfo::INTERNAL_REFERENCE) {
2259
- int32_t* p = reinterpret_cast<int32_t*>(it.rinfo()->pc());
2260
- if (*p != 0) { // 0 means uninitialized.
2261
- *p += pc_delta;
2262
- }
2263
- }
2264
- }
2265
-
2266
- ASSERT(!overflow());
2267
- }
2268
-
2269
-
2270
- void Assembler::emit_arith_b(int op1, int op2, Register dst, int imm8) {
2271
- ASSERT(is_uint8(op1) && is_uint8(op2)); // wrong opcode
2272
- ASSERT(is_uint8(imm8));
2273
- ASSERT((op1 & 0x01) == 0); // should be 8bit operation
2274
- EMIT(op1);
2275
- EMIT(op2 | dst.code());
2276
- EMIT(imm8);
2277
- }
2278
-
2279
-
2280
- void Assembler::emit_arith(int sel, Operand dst, const Immediate& x) {
2281
- ASSERT((0 <= sel) && (sel <= 7));
2282
- Register ireg = { sel };
2283
- if (x.is_int8()) {
2284
- EMIT(0x83); // using a sign-extended 8-bit immediate.
2285
- emit_operand(ireg, dst);
2286
- EMIT(x.x_ & 0xFF);
2287
- } else if (dst.is_reg(eax)) {
2288
- EMIT((sel << 3) | 0x05); // short form if the destination is eax.
2289
- emit(x);
2290
- } else {
2291
- EMIT(0x81); // using a literal 32-bit immediate.
2292
- emit_operand(ireg, dst);
2293
- emit(x);
2294
- }
2295
- }
2296
-
2297
-
2298
- void Assembler::emit_operand(Register reg, const Operand& adr) {
2299
- const unsigned length = adr.len_;
2300
- ASSERT(length > 0);
2301
-
2302
- // Emit updated ModRM byte containing the given register.
2303
- pc_[0] = (adr.buf_[0] & ~0x38) | (reg.code() << 3);
2304
-
2305
- // Emit the rest of the encoded operand.
2306
- for (unsigned i = 1; i < length; i++) pc_[i] = adr.buf_[i];
2307
- pc_ += length;
2308
-
2309
- // Emit relocation information if necessary.
2310
- if (length >= sizeof(int32_t) && adr.rmode_ != RelocInfo::NONE) {
2311
- pc_ -= sizeof(int32_t); // pc_ must be *at* disp32
2312
- RecordRelocInfo(adr.rmode_);
2313
- pc_ += sizeof(int32_t);
2314
- }
2315
- }
2316
-
2317
-
2318
- void Assembler::emit_farith(int b1, int b2, int i) {
2319
- ASSERT(is_uint8(b1) && is_uint8(b2)); // wrong opcode
2320
- ASSERT(0 <= i && i < 8); // illegal stack offset
2321
- EMIT(b1);
2322
- EMIT(b2 + i);
2323
- }
2324
-
2325
-
2326
- void Assembler::dd(uint32_t data, RelocInfo::Mode reloc_info) {
2327
- EnsureSpace ensure_space(this);
2328
- emit(data, reloc_info);
2329
- }
2330
-
2331
-
2332
- void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
2333
- ASSERT(rmode != RelocInfo::NONE);
2334
- // Don't record external references unless the heap will be serialized.
2335
- if (rmode == RelocInfo::EXTERNAL_REFERENCE) {
2336
- #ifdef DEBUG
2337
- if (!Serializer::enabled()) {
2338
- Serializer::TooLateToEnableNow();
2339
- }
2340
- #endif
2341
- if (!Serializer::enabled() && !FLAG_debug_code) {
2342
- return;
2343
- }
2344
- }
2345
- RelocInfo rinfo(pc_, rmode, data);
2346
- reloc_info_writer.Write(&rinfo);
2347
- }
2348
-
2349
-
2350
- #ifdef GENERATED_CODE_COVERAGE
2351
- static FILE* coverage_log = NULL;
2352
-
2353
-
2354
- static void InitCoverageLog() {
2355
- char* file_name = getenv("V8_GENERATED_CODE_COVERAGE_LOG");
2356
- if (file_name != NULL) {
2357
- coverage_log = fopen(file_name, "aw+");
2358
- }
2359
- }
2360
-
2361
-
2362
- void LogGeneratedCodeCoverage(const char* file_line) {
2363
- const char* return_address = (&file_line)[-1];
2364
- char* push_insn = const_cast<char*>(return_address - 12);
2365
- push_insn[0] = 0xeb; // Relative branch insn.
2366
- push_insn[1] = 13; // Skip over coverage insns.
2367
- if (coverage_log != NULL) {
2368
- fprintf(coverage_log, "%s\n", file_line);
2369
- fflush(coverage_log);
2370
- }
2371
- }
2372
-
2373
- #endif
2374
-
2375
- } } // namespace v8::internal