mustang 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (560) hide show
  1. data/.rspec +1 -0
  2. data/Isolate +9 -0
  3. data/README.md +6 -12
  4. data/Rakefile +30 -4
  5. data/TODO.md +9 -0
  6. data/ext/v8/extconf.rb +56 -0
  7. data/ext/v8/v8.cpp +37 -0
  8. data/ext/v8/v8_array.cpp +161 -0
  9. data/ext/v8/v8_array.h +17 -0
  10. data/ext/v8/v8_base.cpp +147 -0
  11. data/ext/v8/v8_base.h +23 -0
  12. data/ext/v8/v8_cast.cpp +151 -0
  13. data/ext/v8/v8_cast.h +64 -0
  14. data/ext/v8/v8_context.cpp +174 -0
  15. data/ext/v8/v8_context.h +12 -0
  16. data/ext/v8/v8_date.cpp +61 -0
  17. data/ext/v8/v8_date.h +16 -0
  18. data/ext/v8/v8_errors.cpp +147 -0
  19. data/ext/v8/v8_errors.h +19 -0
  20. data/ext/v8/v8_external.cpp +66 -0
  21. data/ext/v8/v8_external.h +16 -0
  22. data/ext/v8/v8_function.cpp +182 -0
  23. data/ext/v8/v8_function.h +14 -0
  24. data/ext/v8/v8_integer.cpp +70 -0
  25. data/ext/v8/v8_integer.h +16 -0
  26. data/ext/v8/v8_macros.h +30 -0
  27. data/ext/v8/v8_main.cpp +53 -0
  28. data/ext/v8/v8_main.h +13 -0
  29. data/ext/v8/v8_number.cpp +62 -0
  30. data/ext/v8/v8_number.h +16 -0
  31. data/ext/v8/v8_object.cpp +172 -0
  32. data/ext/v8/v8_object.h +17 -0
  33. data/ext/v8/v8_ref.cpp +72 -0
  34. data/ext/v8/v8_ref.h +43 -0
  35. data/ext/v8/v8_regexp.cpp +148 -0
  36. data/ext/v8/v8_regexp.h +16 -0
  37. data/ext/v8/v8_string.cpp +78 -0
  38. data/ext/v8/v8_string.h +16 -0
  39. data/ext/v8/v8_value.cpp +370 -0
  40. data/ext/v8/v8_value.h +19 -0
  41. data/gemspec.yml +2 -1
  42. data/lib/core_ext/class.rb +14 -0
  43. data/lib/core_ext/object.rb +12 -0
  44. data/lib/core_ext/symbol.rb +23 -0
  45. data/lib/mustang.rb +44 -0
  46. data/lib/mustang/context.rb +69 -0
  47. data/lib/mustang/errors.rb +36 -0
  48. data/lib/support/delegated.rb +25 -0
  49. data/lib/v8/array.rb +21 -0
  50. data/lib/v8/context.rb +13 -0
  51. data/lib/v8/date.rb +20 -0
  52. data/lib/v8/error.rb +15 -0
  53. data/lib/v8/external.rb +16 -0
  54. data/lib/v8/function.rb +11 -0
  55. data/lib/v8/integer.rb +16 -0
  56. data/lib/v8/number.rb +16 -0
  57. data/lib/v8/object.rb +66 -0
  58. data/lib/v8/regexp.rb +23 -0
  59. data/lib/v8/string.rb +27 -0
  60. data/mustang.gemspec +3 -0
  61. data/spec/core_ext/class_spec.rb +19 -0
  62. data/spec/core_ext/object_spec.rb +19 -0
  63. data/spec/core_ext/symbol_spec.rb +27 -0
  64. data/spec/fixtures/test1.js +2 -0
  65. data/spec/fixtures/test2.js +2 -0
  66. data/spec/spec_helper.rb +20 -0
  67. data/spec/v8/array_spec.rb +88 -0
  68. data/spec/v8/cast_spec.rb +151 -0
  69. data/spec/v8/context_spec.rb +78 -0
  70. data/spec/v8/data_spec.rb +39 -0
  71. data/spec/v8/date_spec.rb +45 -0
  72. data/spec/v8/empty_spec.rb +27 -0
  73. data/spec/v8/errors_spec.rb +142 -0
  74. data/spec/v8/external_spec.rb +44 -0
  75. data/spec/v8/function_spec.rb +170 -0
  76. data/spec/v8/integer_spec.rb +41 -0
  77. data/spec/v8/main_spec.rb +18 -0
  78. data/spec/v8/null_spec.rb +27 -0
  79. data/spec/v8/number_spec.rb +40 -0
  80. data/spec/v8/object_spec.rb +79 -0
  81. data/spec/v8/primitive_spec.rb +9 -0
  82. data/spec/v8/regexp_spec.rb +65 -0
  83. data/spec/v8/string_spec.rb +48 -0
  84. data/spec/v8/undefined_spec.rb +27 -0
  85. data/spec/v8/value_spec.rb +215 -0
  86. data/vendor/v8/.gitignore +2 -0
  87. data/vendor/v8/AUTHORS +3 -1
  88. data/vendor/v8/ChangeLog +117 -0
  89. data/vendor/v8/SConstruct +334 -53
  90. data/vendor/v8/include/v8-debug.h +21 -11
  91. data/vendor/v8/include/v8-preparser.h +1 -1
  92. data/vendor/v8/include/v8-profiler.h +122 -43
  93. data/vendor/v8/include/v8-testing.h +5 -0
  94. data/vendor/v8/include/v8.h +171 -17
  95. data/vendor/v8/preparser/SConscript +38 -0
  96. data/vendor/v8/preparser/preparser-process.cc +77 -114
  97. data/vendor/v8/samples/shell.cc +232 -46
  98. data/vendor/v8/src/SConscript +29 -5
  99. data/vendor/v8/src/accessors.cc +70 -211
  100. data/vendor/v8/{test/cctest/test-mips.cc → src/allocation-inl.h} +15 -18
  101. data/vendor/v8/src/allocation.cc +0 -82
  102. data/vendor/v8/src/allocation.h +9 -42
  103. data/vendor/v8/src/api.cc +1645 -1156
  104. data/vendor/v8/src/api.h +76 -12
  105. data/vendor/v8/src/apiutils.h +0 -7
  106. data/vendor/v8/src/arguments.h +15 -4
  107. data/vendor/v8/src/arm/assembler-arm-inl.h +10 -9
  108. data/vendor/v8/src/arm/assembler-arm.cc +62 -23
  109. data/vendor/v8/src/arm/assembler-arm.h +76 -11
  110. data/vendor/v8/src/arm/builtins-arm.cc +39 -33
  111. data/vendor/v8/src/arm/code-stubs-arm.cc +1182 -402
  112. data/vendor/v8/src/arm/code-stubs-arm.h +20 -54
  113. data/vendor/v8/src/arm/codegen-arm.cc +159 -106
  114. data/vendor/v8/src/arm/codegen-arm.h +6 -6
  115. data/vendor/v8/src/arm/constants-arm.h +16 -1
  116. data/vendor/v8/src/arm/cpu-arm.cc +7 -5
  117. data/vendor/v8/src/arm/debug-arm.cc +6 -4
  118. data/vendor/v8/src/arm/deoptimizer-arm.cc +51 -14
  119. data/vendor/v8/src/arm/disasm-arm.cc +47 -15
  120. data/vendor/v8/src/arm/frames-arm.h +1 -1
  121. data/vendor/v8/src/arm/full-codegen-arm.cc +724 -408
  122. data/vendor/v8/src/arm/ic-arm.cc +90 -85
  123. data/vendor/v8/src/arm/lithium-arm.cc +140 -69
  124. data/vendor/v8/src/arm/lithium-arm.h +161 -46
  125. data/vendor/v8/src/arm/lithium-codegen-arm.cc +567 -297
  126. data/vendor/v8/src/arm/lithium-codegen-arm.h +21 -9
  127. data/vendor/v8/src/arm/lithium-gap-resolver-arm.cc +2 -0
  128. data/vendor/v8/src/arm/macro-assembler-arm.cc +457 -96
  129. data/vendor/v8/src/arm/macro-assembler-arm.h +115 -18
  130. data/vendor/v8/src/arm/regexp-macro-assembler-arm.cc +20 -13
  131. data/vendor/v8/src/arm/regexp-macro-assembler-arm.h +1 -0
  132. data/vendor/v8/src/arm/simulator-arm.cc +184 -101
  133. data/vendor/v8/src/arm/simulator-arm.h +26 -21
  134. data/vendor/v8/src/arm/stub-cache-arm.cc +450 -467
  135. data/vendor/v8/src/arm/virtual-frame-arm.cc +14 -12
  136. data/vendor/v8/src/arm/virtual-frame-arm.h +11 -8
  137. data/vendor/v8/src/array.js +35 -18
  138. data/vendor/v8/src/assembler.cc +186 -92
  139. data/vendor/v8/src/assembler.h +106 -69
  140. data/vendor/v8/src/ast-inl.h +5 -0
  141. data/vendor/v8/src/ast.cc +46 -35
  142. data/vendor/v8/src/ast.h +107 -50
  143. data/vendor/v8/src/atomicops.h +2 -0
  144. data/vendor/v8/src/atomicops_internals_mips_gcc.h +169 -0
  145. data/vendor/v8/src/bootstrapper.cc +649 -399
  146. data/vendor/v8/src/bootstrapper.h +94 -27
  147. data/vendor/v8/src/builtins.cc +359 -227
  148. data/vendor/v8/src/builtins.h +157 -123
  149. data/vendor/v8/src/checks.cc +2 -2
  150. data/vendor/v8/src/checks.h +4 -0
  151. data/vendor/v8/src/code-stubs.cc +27 -17
  152. data/vendor/v8/src/code-stubs.h +38 -17
  153. data/vendor/v8/src/codegen-inl.h +5 -1
  154. data/vendor/v8/src/codegen.cc +27 -17
  155. data/vendor/v8/src/codegen.h +9 -9
  156. data/vendor/v8/src/compilation-cache.cc +92 -206
  157. data/vendor/v8/src/compilation-cache.h +205 -30
  158. data/vendor/v8/src/compiler.cc +107 -120
  159. data/vendor/v8/src/compiler.h +17 -2
  160. data/vendor/v8/src/contexts.cc +22 -15
  161. data/vendor/v8/src/contexts.h +14 -8
  162. data/vendor/v8/src/conversions.cc +86 -30
  163. data/vendor/v8/src/counters.cc +19 -4
  164. data/vendor/v8/src/counters.h +28 -16
  165. data/vendor/v8/src/cpu-profiler-inl.h +4 -3
  166. data/vendor/v8/src/cpu-profiler.cc +123 -72
  167. data/vendor/v8/src/cpu-profiler.h +33 -19
  168. data/vendor/v8/src/cpu.h +2 -0
  169. data/vendor/v8/src/d8-debug.cc +3 -3
  170. data/vendor/v8/src/d8-debug.h +7 -6
  171. data/vendor/v8/src/d8-posix.cc +2 -0
  172. data/vendor/v8/src/d8.cc +22 -12
  173. data/vendor/v8/src/d8.gyp +3 -0
  174. data/vendor/v8/src/d8.js +618 -0
  175. data/vendor/v8/src/data-flow.h +3 -3
  176. data/vendor/v8/src/dateparser.h +4 -2
  177. data/vendor/v8/src/debug-agent.cc +10 -9
  178. data/vendor/v8/src/debug-agent.h +9 -11
  179. data/vendor/v8/src/debug-debugger.js +121 -0
  180. data/vendor/v8/src/debug.cc +331 -227
  181. data/vendor/v8/src/debug.h +248 -219
  182. data/vendor/v8/src/deoptimizer.cc +173 -62
  183. data/vendor/v8/src/deoptimizer.h +119 -19
  184. data/vendor/v8/src/disasm.h +3 -0
  185. data/vendor/v8/src/disassembler.cc +10 -9
  186. data/vendor/v8/src/execution.cc +185 -129
  187. data/vendor/v8/src/execution.h +47 -78
  188. data/vendor/v8/src/extensions/experimental/break-iterator.cc +250 -0
  189. data/vendor/v8/src/extensions/experimental/break-iterator.h +89 -0
  190. data/vendor/v8/src/extensions/experimental/experimental.gyp +2 -0
  191. data/vendor/v8/src/extensions/experimental/i18n-extension.cc +22 -2
  192. data/vendor/v8/src/extensions/externalize-string-extension.cc +2 -2
  193. data/vendor/v8/src/extensions/gc-extension.cc +1 -1
  194. data/vendor/v8/src/factory.cc +261 -154
  195. data/vendor/v8/src/factory.h +162 -158
  196. data/vendor/v8/src/flag-definitions.h +17 -11
  197. data/vendor/v8/src/frame-element.cc +0 -5
  198. data/vendor/v8/src/frame-element.h +9 -13
  199. data/vendor/v8/src/frames-inl.h +7 -0
  200. data/vendor/v8/src/frames.cc +56 -46
  201. data/vendor/v8/src/frames.h +36 -25
  202. data/vendor/v8/src/full-codegen.cc +15 -24
  203. data/vendor/v8/src/full-codegen.h +13 -41
  204. data/vendor/v8/src/func-name-inferrer.cc +7 -6
  205. data/vendor/v8/src/func-name-inferrer.h +1 -1
  206. data/vendor/v8/src/gdb-jit.cc +1 -0
  207. data/vendor/v8/src/global-handles.cc +118 -56
  208. data/vendor/v8/src/global-handles.h +98 -40
  209. data/vendor/v8/src/globals.h +2 -2
  210. data/vendor/v8/src/handles-inl.h +106 -9
  211. data/vendor/v8/src/handles.cc +220 -157
  212. data/vendor/v8/src/handles.h +38 -59
  213. data/vendor/v8/src/hashmap.h +3 -3
  214. data/vendor/v8/src/heap-inl.h +141 -25
  215. data/vendor/v8/src/heap-profiler.cc +117 -63
  216. data/vendor/v8/src/heap-profiler.h +38 -21
  217. data/vendor/v8/src/heap.cc +805 -564
  218. data/vendor/v8/src/heap.h +640 -594
  219. data/vendor/v8/src/hydrogen-instructions.cc +216 -73
  220. data/vendor/v8/src/hydrogen-instructions.h +259 -124
  221. data/vendor/v8/src/hydrogen.cc +996 -1171
  222. data/vendor/v8/src/hydrogen.h +163 -144
  223. data/vendor/v8/src/ia32/assembler-ia32-inl.h +12 -11
  224. data/vendor/v8/src/ia32/assembler-ia32.cc +85 -39
  225. data/vendor/v8/src/ia32/assembler-ia32.h +82 -16
  226. data/vendor/v8/src/ia32/builtins-ia32.cc +64 -58
  227. data/vendor/v8/src/ia32/code-stubs-ia32.cc +248 -324
  228. data/vendor/v8/src/ia32/code-stubs-ia32.h +3 -44
  229. data/vendor/v8/src/ia32/codegen-ia32.cc +217 -165
  230. data/vendor/v8/src/ia32/codegen-ia32.h +3 -0
  231. data/vendor/v8/src/ia32/cpu-ia32.cc +6 -5
  232. data/vendor/v8/src/ia32/debug-ia32.cc +8 -5
  233. data/vendor/v8/src/ia32/deoptimizer-ia32.cc +124 -14
  234. data/vendor/v8/src/ia32/disasm-ia32.cc +85 -62
  235. data/vendor/v8/src/ia32/frames-ia32.h +1 -1
  236. data/vendor/v8/src/ia32/full-codegen-ia32.cc +348 -435
  237. data/vendor/v8/src/ia32/ic-ia32.cc +91 -91
  238. data/vendor/v8/src/ia32/lithium-codegen-ia32.cc +500 -255
  239. data/vendor/v8/src/ia32/lithium-codegen-ia32.h +13 -4
  240. data/vendor/v8/src/ia32/lithium-gap-resolver-ia32.cc +6 -0
  241. data/vendor/v8/src/ia32/lithium-ia32.cc +122 -45
  242. data/vendor/v8/src/ia32/lithium-ia32.h +128 -41
  243. data/vendor/v8/src/ia32/macro-assembler-ia32.cc +109 -84
  244. data/vendor/v8/src/ia32/macro-assembler-ia32.h +18 -9
  245. data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.cc +26 -15
  246. data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.h +1 -0
  247. data/vendor/v8/src/ia32/register-allocator-ia32.cc +30 -30
  248. data/vendor/v8/src/ia32/simulator-ia32.h +4 -4
  249. data/vendor/v8/src/ia32/stub-cache-ia32.cc +383 -400
  250. data/vendor/v8/src/ia32/virtual-frame-ia32.cc +36 -13
  251. data/vendor/v8/src/ia32/virtual-frame-ia32.h +11 -5
  252. data/vendor/v8/src/ic-inl.h +12 -2
  253. data/vendor/v8/src/ic.cc +304 -221
  254. data/vendor/v8/src/ic.h +115 -58
  255. data/vendor/v8/src/interpreter-irregexp.cc +25 -21
  256. data/vendor/v8/src/interpreter-irregexp.h +2 -1
  257. data/vendor/v8/src/isolate.cc +883 -0
  258. data/vendor/v8/src/isolate.h +1304 -0
  259. data/vendor/v8/src/json.js +10 -10
  260. data/vendor/v8/src/jsregexp.cc +111 -80
  261. data/vendor/v8/src/jsregexp.h +6 -7
  262. data/vendor/v8/src/jump-target-heavy.cc +5 -8
  263. data/vendor/v8/src/jump-target-heavy.h +0 -6
  264. data/vendor/v8/src/jump-target-inl.h +1 -1
  265. data/vendor/v8/src/jump-target-light.cc +3 -3
  266. data/vendor/v8/src/lithium-allocator-inl.h +2 -0
  267. data/vendor/v8/src/lithium-allocator.cc +42 -30
  268. data/vendor/v8/src/lithium-allocator.h +8 -22
  269. data/vendor/v8/src/lithium.cc +1 -0
  270. data/vendor/v8/src/liveedit.cc +141 -99
  271. data/vendor/v8/src/liveedit.h +7 -2
  272. data/vendor/v8/src/liveobjectlist-inl.h +90 -0
  273. data/vendor/v8/src/liveobjectlist.cc +2537 -1
  274. data/vendor/v8/src/liveobjectlist.h +245 -35
  275. data/vendor/v8/src/log-utils.cc +122 -35
  276. data/vendor/v8/src/log-utils.h +33 -36
  277. data/vendor/v8/src/log.cc +299 -241
  278. data/vendor/v8/src/log.h +177 -110
  279. data/vendor/v8/src/mark-compact.cc +612 -470
  280. data/vendor/v8/src/mark-compact.h +153 -80
  281. data/vendor/v8/src/messages.cc +16 -14
  282. data/vendor/v8/src/messages.js +30 -7
  283. data/vendor/v8/src/mips/assembler-mips-inl.h +155 -35
  284. data/vendor/v8/src/mips/assembler-mips.cc +1093 -219
  285. data/vendor/v8/src/mips/assembler-mips.h +552 -153
  286. data/vendor/v8/src/mips/builtins-mips.cc +43 -100
  287. data/vendor/v8/src/mips/code-stubs-mips.cc +752 -0
  288. data/vendor/v8/src/mips/code-stubs-mips.h +511 -0
  289. data/vendor/v8/src/mips/codegen-mips-inl.h +8 -14
  290. data/vendor/v8/src/mips/codegen-mips.cc +672 -896
  291. data/vendor/v8/src/mips/codegen-mips.h +271 -69
  292. data/vendor/v8/src/mips/constants-mips.cc +44 -20
  293. data/vendor/v8/src/mips/constants-mips.h +238 -40
  294. data/vendor/v8/src/mips/cpu-mips.cc +20 -3
  295. data/vendor/v8/src/mips/debug-mips.cc +35 -7
  296. data/vendor/v8/src/mips/deoptimizer-mips.cc +91 -0
  297. data/vendor/v8/src/mips/disasm-mips.cc +329 -93
  298. data/vendor/v8/src/mips/frames-mips.cc +2 -50
  299. data/vendor/v8/src/mips/frames-mips.h +24 -9
  300. data/vendor/v8/src/mips/full-codegen-mips.cc +473 -23
  301. data/vendor/v8/src/mips/ic-mips.cc +81 -45
  302. data/vendor/v8/src/mips/jump-target-mips.cc +11 -106
  303. data/vendor/v8/src/mips/lithium-codegen-mips.h +65 -0
  304. data/vendor/v8/src/mips/lithium-mips.h +304 -0
  305. data/vendor/v8/src/mips/macro-assembler-mips.cc +2391 -390
  306. data/vendor/v8/src/mips/macro-assembler-mips.h +718 -121
  307. data/vendor/v8/src/mips/regexp-macro-assembler-mips.cc +478 -0
  308. data/vendor/v8/src/mips/regexp-macro-assembler-mips.h +250 -0
  309. data/vendor/v8/src/mips/register-allocator-mips-inl.h +0 -3
  310. data/vendor/v8/src/mips/register-allocator-mips.h +3 -2
  311. data/vendor/v8/src/mips/simulator-mips.cc +1009 -221
  312. data/vendor/v8/src/mips/simulator-mips.h +119 -36
  313. data/vendor/v8/src/mips/stub-cache-mips.cc +331 -148
  314. data/vendor/v8/src/mips/{fast-codegen-mips.cc → virtual-frame-mips-inl.h} +11 -30
  315. data/vendor/v8/src/mips/virtual-frame-mips.cc +137 -149
  316. data/vendor/v8/src/mips/virtual-frame-mips.h +294 -312
  317. data/vendor/v8/src/mirror-debugger.js +9 -8
  318. data/vendor/v8/src/mksnapshot.cc +2 -2
  319. data/vendor/v8/src/objects-debug.cc +16 -16
  320. data/vendor/v8/src/objects-inl.h +421 -195
  321. data/vendor/v8/src/objects-printer.cc +7 -7
  322. data/vendor/v8/src/objects-visiting.cc +1 -1
  323. data/vendor/v8/src/objects-visiting.h +33 -12
  324. data/vendor/v8/src/objects.cc +935 -658
  325. data/vendor/v8/src/objects.h +234 -139
  326. data/vendor/v8/src/parser.cc +484 -439
  327. data/vendor/v8/src/parser.h +35 -14
  328. data/vendor/v8/src/platform-cygwin.cc +173 -107
  329. data/vendor/v8/src/platform-freebsd.cc +224 -72
  330. data/vendor/v8/src/platform-linux.cc +234 -95
  331. data/vendor/v8/src/platform-macos.cc +215 -82
  332. data/vendor/v8/src/platform-nullos.cc +9 -3
  333. data/vendor/v8/src/platform-openbsd.cc +22 -7
  334. data/vendor/v8/src/platform-posix.cc +30 -5
  335. data/vendor/v8/src/platform-solaris.cc +120 -38
  336. data/vendor/v8/src/platform-tls-mac.h +62 -0
  337. data/vendor/v8/src/platform-tls-win32.h +62 -0
  338. data/vendor/v8/src/platform-tls.h +50 -0
  339. data/vendor/v8/src/platform-win32.cc +195 -97
  340. data/vendor/v8/src/platform.h +72 -15
  341. data/vendor/v8/src/preparse-data.cc +2 -0
  342. data/vendor/v8/src/preparser-api.cc +8 -2
  343. data/vendor/v8/src/preparser.cc +1 -1
  344. data/vendor/v8/src/prettyprinter.cc +43 -52
  345. data/vendor/v8/src/prettyprinter.h +1 -1
  346. data/vendor/v8/src/profile-generator-inl.h +0 -28
  347. data/vendor/v8/src/profile-generator.cc +942 -685
  348. data/vendor/v8/src/profile-generator.h +210 -176
  349. data/vendor/v8/src/property.cc +6 -0
  350. data/vendor/v8/src/property.h +14 -3
  351. data/vendor/v8/src/regexp-macro-assembler-irregexp.cc +1 -1
  352. data/vendor/v8/src/regexp-macro-assembler.cc +28 -19
  353. data/vendor/v8/src/regexp-macro-assembler.h +11 -6
  354. data/vendor/v8/src/regexp-stack.cc +18 -10
  355. data/vendor/v8/src/regexp-stack.h +45 -21
  356. data/vendor/v8/src/regexp.js +3 -3
  357. data/vendor/v8/src/register-allocator-inl.h +3 -3
  358. data/vendor/v8/src/register-allocator.cc +1 -7
  359. data/vendor/v8/src/register-allocator.h +5 -15
  360. data/vendor/v8/src/rewriter.cc +2 -1
  361. data/vendor/v8/src/runtime-profiler.cc +158 -128
  362. data/vendor/v8/src/runtime-profiler.h +131 -15
  363. data/vendor/v8/src/runtime.cc +2409 -1692
  364. data/vendor/v8/src/runtime.h +93 -17
  365. data/vendor/v8/src/safepoint-table.cc +3 -0
  366. data/vendor/v8/src/safepoint-table.h +9 -3
  367. data/vendor/v8/src/scanner-base.cc +21 -28
  368. data/vendor/v8/src/scanner-base.h +22 -11
  369. data/vendor/v8/src/scanner.cc +3 -5
  370. data/vendor/v8/src/scanner.h +4 -2
  371. data/vendor/v8/src/scopeinfo.cc +11 -16
  372. data/vendor/v8/src/scopeinfo.h +26 -15
  373. data/vendor/v8/src/scopes.cc +67 -37
  374. data/vendor/v8/src/scopes.h +26 -12
  375. data/vendor/v8/src/serialize.cc +193 -154
  376. data/vendor/v8/src/serialize.h +41 -36
  377. data/vendor/v8/src/small-pointer-list.h +163 -0
  378. data/vendor/v8/src/snapshot-common.cc +1 -1
  379. data/vendor/v8/src/snapshot.h +3 -1
  380. data/vendor/v8/src/spaces-inl.h +30 -25
  381. data/vendor/v8/src/spaces.cc +263 -370
  382. data/vendor/v8/src/spaces.h +178 -166
  383. data/vendor/v8/src/string-search.cc +4 -3
  384. data/vendor/v8/src/string-search.h +21 -20
  385. data/vendor/v8/src/string-stream.cc +32 -24
  386. data/vendor/v8/src/string.js +7 -7
  387. data/vendor/v8/src/stub-cache.cc +324 -248
  388. data/vendor/v8/src/stub-cache.h +181 -155
  389. data/vendor/v8/src/token.cc +3 -3
  390. data/vendor/v8/src/token.h +3 -3
  391. data/vendor/v8/src/top.cc +218 -390
  392. data/vendor/v8/src/type-info.cc +98 -32
  393. data/vendor/v8/src/type-info.h +10 -3
  394. data/vendor/v8/src/unicode.cc +1 -1
  395. data/vendor/v8/src/unicode.h +1 -1
  396. data/vendor/v8/src/utils.h +3 -0
  397. data/vendor/v8/src/v8-counters.cc +18 -11
  398. data/vendor/v8/src/v8-counters.h +34 -13
  399. data/vendor/v8/src/v8.cc +66 -121
  400. data/vendor/v8/src/v8.h +7 -4
  401. data/vendor/v8/src/v8globals.h +18 -12
  402. data/vendor/v8/src/{memory.h → v8memory.h} +0 -0
  403. data/vendor/v8/src/v8natives.js +59 -18
  404. data/vendor/v8/src/v8threads.cc +127 -114
  405. data/vendor/v8/src/v8threads.h +42 -35
  406. data/vendor/v8/src/v8utils.h +2 -39
  407. data/vendor/v8/src/variables.h +1 -1
  408. data/vendor/v8/src/version.cc +26 -5
  409. data/vendor/v8/src/version.h +4 -0
  410. data/vendor/v8/src/virtual-frame-heavy-inl.h +2 -4
  411. data/vendor/v8/src/virtual-frame-light-inl.h +5 -4
  412. data/vendor/v8/src/vm-state-inl.h +21 -17
  413. data/vendor/v8/src/vm-state.h +7 -5
  414. data/vendor/v8/src/win32-headers.h +1 -0
  415. data/vendor/v8/src/x64/assembler-x64-inl.h +12 -11
  416. data/vendor/v8/src/x64/assembler-x64.cc +80 -40
  417. data/vendor/v8/src/x64/assembler-x64.h +67 -17
  418. data/vendor/v8/src/x64/builtins-x64.cc +34 -33
  419. data/vendor/v8/src/x64/code-stubs-x64.cc +636 -377
  420. data/vendor/v8/src/x64/code-stubs-x64.h +14 -48
  421. data/vendor/v8/src/x64/codegen-x64-inl.h +1 -1
  422. data/vendor/v8/src/x64/codegen-x64.cc +158 -136
  423. data/vendor/v8/src/x64/codegen-x64.h +4 -1
  424. data/vendor/v8/src/x64/cpu-x64.cc +7 -5
  425. data/vendor/v8/src/x64/debug-x64.cc +8 -6
  426. data/vendor/v8/src/x64/deoptimizer-x64.cc +195 -20
  427. data/vendor/v8/src/x64/disasm-x64.cc +42 -23
  428. data/vendor/v8/src/x64/frames-x64.cc +1 -1
  429. data/vendor/v8/src/x64/frames-x64.h +2 -2
  430. data/vendor/v8/src/x64/full-codegen-x64.cc +780 -218
  431. data/vendor/v8/src/x64/ic-x64.cc +77 -79
  432. data/vendor/v8/src/x64/jump-target-x64.cc +1 -1
  433. data/vendor/v8/src/x64/lithium-codegen-x64.cc +698 -181
  434. data/vendor/v8/src/x64/lithium-codegen-x64.h +31 -6
  435. data/vendor/v8/src/x64/lithium-x64.cc +136 -54
  436. data/vendor/v8/src/x64/lithium-x64.h +142 -51
  437. data/vendor/v8/src/x64/macro-assembler-x64.cc +456 -187
  438. data/vendor/v8/src/x64/macro-assembler-x64.h +166 -34
  439. data/vendor/v8/src/x64/regexp-macro-assembler-x64.cc +44 -28
  440. data/vendor/v8/src/x64/regexp-macro-assembler-x64.h +8 -4
  441. data/vendor/v8/src/x64/register-allocator-x64-inl.h +3 -3
  442. data/vendor/v8/src/x64/register-allocator-x64.cc +12 -8
  443. data/vendor/v8/src/x64/simulator-x64.h +5 -5
  444. data/vendor/v8/src/x64/stub-cache-x64.cc +299 -344
  445. data/vendor/v8/src/x64/virtual-frame-x64.cc +37 -13
  446. data/vendor/v8/src/x64/virtual-frame-x64.h +13 -7
  447. data/vendor/v8/src/zone-inl.h +49 -3
  448. data/vendor/v8/src/zone.cc +42 -41
  449. data/vendor/v8/src/zone.h +37 -34
  450. data/vendor/v8/test/benchmarks/testcfg.py +100 -0
  451. data/vendor/v8/test/cctest/SConscript +5 -4
  452. data/vendor/v8/test/cctest/cctest.h +3 -2
  453. data/vendor/v8/test/cctest/cctest.status +6 -11
  454. data/vendor/v8/test/cctest/test-accessors.cc +3 -3
  455. data/vendor/v8/test/cctest/test-alloc.cc +39 -33
  456. data/vendor/v8/test/cctest/test-api.cc +1092 -205
  457. data/vendor/v8/test/cctest/test-assembler-arm.cc +39 -25
  458. data/vendor/v8/test/cctest/test-assembler-ia32.cc +36 -37
  459. data/vendor/v8/test/cctest/test-assembler-mips.cc +1098 -40
  460. data/vendor/v8/test/cctest/test-assembler-x64.cc +32 -25
  461. data/vendor/v8/test/cctest/test-ast.cc +1 -0
  462. data/vendor/v8/test/cctest/test-circular-queue.cc +8 -5
  463. data/vendor/v8/test/cctest/test-compiler.cc +24 -24
  464. data/vendor/v8/test/cctest/test-cpu-profiler.cc +140 -5
  465. data/vendor/v8/test/cctest/test-dataflow.cc +1 -0
  466. data/vendor/v8/test/cctest/test-debug.cc +136 -77
  467. data/vendor/v8/test/cctest/test-decls.cc +1 -1
  468. data/vendor/v8/test/cctest/test-deoptimization.cc +25 -24
  469. data/vendor/v8/test/cctest/test-disasm-arm.cc +9 -4
  470. data/vendor/v8/test/cctest/test-disasm-ia32.cc +10 -8
  471. data/vendor/v8/test/cctest/test-func-name-inference.cc +10 -4
  472. data/vendor/v8/test/cctest/test-heap-profiler.cc +226 -164
  473. data/vendor/v8/test/cctest/test-heap.cc +240 -217
  474. data/vendor/v8/test/cctest/test-liveedit.cc +1 -0
  475. data/vendor/v8/test/cctest/test-log-stack-tracer.cc +18 -20
  476. data/vendor/v8/test/cctest/test-log.cc +114 -108
  477. data/vendor/v8/test/cctest/test-macro-assembler-x64.cc +247 -177
  478. data/vendor/v8/test/cctest/test-mark-compact.cc +129 -90
  479. data/vendor/v8/test/cctest/test-parsing.cc +15 -14
  480. data/vendor/v8/test/cctest/test-platform-linux.cc +1 -0
  481. data/vendor/v8/test/cctest/test-platform-tls.cc +66 -0
  482. data/vendor/v8/test/cctest/test-platform-win32.cc +1 -0
  483. data/vendor/v8/test/cctest/test-profile-generator.cc +1 -1
  484. data/vendor/v8/test/cctest/test-regexp.cc +53 -41
  485. data/vendor/v8/test/cctest/test-reloc-info.cc +18 -11
  486. data/vendor/v8/test/cctest/test-serialize.cc +44 -43
  487. data/vendor/v8/test/cctest/test-sockets.cc +8 -3
  488. data/vendor/v8/test/cctest/test-spaces.cc +47 -29
  489. data/vendor/v8/test/cctest/test-strings.cc +20 -20
  490. data/vendor/v8/test/cctest/test-thread-termination.cc +8 -3
  491. data/vendor/v8/test/cctest/test-threads.cc +5 -3
  492. data/vendor/v8/test/cctest/test-utils.cc +5 -4
  493. data/vendor/v8/test/cctest/testcfg.py +7 -3
  494. data/vendor/v8/test/es5conform/es5conform.status +2 -77
  495. data/vendor/v8/test/es5conform/testcfg.py +1 -1
  496. data/vendor/v8/test/message/testcfg.py +1 -1
  497. data/vendor/v8/test/mjsunit/accessors-on-global-object.js +3 -3
  498. data/vendor/v8/test/mjsunit/array-concat.js +43 -1
  499. data/vendor/v8/test/mjsunit/array-join.js +25 -0
  500. data/vendor/v8/test/mjsunit/bitops-info.js +7 -1
  501. data/vendor/v8/test/mjsunit/compiler/array-length.js +2 -2
  502. data/vendor/v8/test/mjsunit/compiler/global-accessors.js +47 -0
  503. data/vendor/v8/test/mjsunit/compiler/pic.js +1 -1
  504. data/vendor/v8/test/mjsunit/compiler/regress-loadfield.js +65 -0
  505. data/vendor/v8/test/mjsunit/math-sqrt.js +5 -1
  506. data/vendor/v8/test/mjsunit/mjsunit.js +59 -8
  507. data/vendor/v8/test/mjsunit/mjsunit.status +0 -12
  508. data/vendor/v8/test/mjsunit/mul-exhaustive.js +129 -11
  509. data/vendor/v8/test/mjsunit/negate-zero.js +1 -1
  510. data/vendor/v8/test/mjsunit/object-freeze.js +5 -13
  511. data/vendor/v8/test/mjsunit/object-prevent-extensions.js +9 -50
  512. data/vendor/v8/test/mjsunit/object-seal.js +4 -13
  513. data/vendor/v8/test/mjsunit/override-eval-with-non-function.js +36 -0
  514. data/vendor/v8/test/mjsunit/regress/regress-1145.js +54 -0
  515. data/vendor/v8/test/mjsunit/regress/regress-1172-bis.js +37 -0
  516. data/vendor/v8/test/mjsunit/regress/regress-1181.js +54 -0
  517. data/vendor/v8/test/mjsunit/regress/regress-1207.js +35 -0
  518. data/vendor/v8/test/mjsunit/regress/regress-1209.js +34 -0
  519. data/vendor/v8/test/mjsunit/regress/regress-1210.js +48 -0
  520. data/vendor/v8/test/mjsunit/regress/regress-1213.js +43 -0
  521. data/vendor/v8/test/mjsunit/regress/regress-1218.js +29 -0
  522. data/vendor/v8/test/mjsunit/regress/regress-1229.js +79 -0
  523. data/vendor/v8/test/mjsunit/regress/regress-1233.js +47 -0
  524. data/vendor/v8/test/mjsunit/regress/regress-1236.js +34 -0
  525. data/vendor/v8/test/mjsunit/regress/regress-1237.js +36 -0
  526. data/vendor/v8/test/mjsunit/regress/regress-1240.js +39 -0
  527. data/vendor/v8/test/mjsunit/regress/regress-1257.js +58 -0
  528. data/vendor/v8/test/mjsunit/regress/regress-1278.js +69 -0
  529. data/vendor/v8/test/mjsunit/regress/regress-create-exception.js +1 -0
  530. data/vendor/v8/test/mjsunit/regress/regress-lazy-deopt-reloc.js +52 -0
  531. data/vendor/v8/test/mjsunit/sin-cos.js +15 -10
  532. data/vendor/v8/test/mjsunit/smi-negative-zero.js +2 -2
  533. data/vendor/v8/test/mjsunit/str-to-num.js +1 -1
  534. data/vendor/v8/test/mjsunit/strict-mode.js +435 -0
  535. data/vendor/v8/test/mjsunit/testcfg.py +23 -6
  536. data/vendor/v8/test/mozilla/mozilla.status +0 -2
  537. data/vendor/v8/test/mozilla/testcfg.py +1 -1
  538. data/vendor/v8/test/preparser/empty.js +28 -0
  539. data/vendor/v8/test/preparser/functions-only.js +38 -0
  540. data/vendor/v8/test/preparser/non-alphanum.js +34 -0
  541. data/vendor/v8/test/preparser/symbols-only.js +49 -0
  542. data/vendor/v8/test/preparser/testcfg.py +90 -0
  543. data/vendor/v8/test/sputnik/testcfg.py +1 -1
  544. data/vendor/v8/test/test262/README +16 -0
  545. data/vendor/v8/test/test262/harness-adapt.js +80 -0
  546. data/vendor/v8/test/test262/test262.status +1506 -0
  547. data/vendor/v8/test/test262/testcfg.py +123 -0
  548. data/vendor/v8/tools/freebsd-tick-processor +10 -0
  549. data/vendor/v8/tools/gyp/v8.gyp +8 -33
  550. data/vendor/v8/tools/linux-tick-processor +5 -3
  551. data/vendor/v8/tools/test.py +37 -14
  552. data/vendor/v8/tools/tickprocessor.js +22 -8
  553. data/vendor/v8/tools/visual_studio/v8_base.vcproj +13 -1
  554. data/vendor/v8/tools/visual_studio/v8_base_arm.vcproj +5 -1
  555. data/vendor/v8/tools/visual_studio/v8_base_x64.vcproj +5 -1
  556. data/vendor/v8/tools/visual_studio/x64.vsprops +1 -0
  557. metadata +1495 -1341
  558. data/ext/extconf.rb +0 -22
  559. data/ext/mustang.cpp +0 -58
  560. data/vendor/v8/src/top.h +0 -608
@@ -35,48 +35,49 @@
35
35
  #include "serialize.h"
36
36
  #include "cctest.h"
37
37
 
38
- using v8::internal::byte;
39
- using v8::internal::OS;
40
38
  using v8::internal::Assembler;
39
+ using v8::internal::CodeDesc;
41
40
  using v8::internal::Condition;
42
- using v8::internal::MacroAssembler;
41
+ using v8::internal::FUNCTION_CAST;
43
42
  using v8::internal::HandleScope;
44
- using v8::internal::Operand;
45
43
  using v8::internal::Immediate;
46
- using v8::internal::SmiIndex;
44
+ using v8::internal::Isolate;
47
45
  using v8::internal::Label;
46
+ using v8::internal::MacroAssembler;
47
+ using v8::internal::OS;
48
+ using v8::internal::Operand;
48
49
  using v8::internal::RelocInfo;
50
+ using v8::internal::Smi;
51
+ using v8::internal::SmiIndex;
52
+ using v8::internal::byte;
53
+ using v8::internal::carry;
54
+ using v8::internal::greater;
55
+ using v8::internal::greater_equal;
56
+ using v8::internal::kIntSize;
57
+ using v8::internal::kPointerSize;
58
+ using v8::internal::kSmiTagMask;
59
+ using v8::internal::kSmiValueSize;
60
+ using v8::internal::less_equal;
61
+ using v8::internal::negative;
62
+ using v8::internal::not_carry;
63
+ using v8::internal::not_equal;
64
+ using v8::internal::not_zero;
65
+ using v8::internal::positive;
66
+ using v8::internal::r11;
67
+ using v8::internal::r13;
68
+ using v8::internal::r14;
69
+ using v8::internal::r15;
70
+ using v8::internal::r8;
71
+ using v8::internal::r9;
49
72
  using v8::internal::rax;
73
+ using v8::internal::rbp;
50
74
  using v8::internal::rbx;
51
- using v8::internal::rsi;
52
- using v8::internal::rdi;
53
75
  using v8::internal::rcx;
76
+ using v8::internal::rdi;
54
77
  using v8::internal::rdx;
55
- using v8::internal::rbp;
78
+ using v8::internal::rsi;
56
79
  using v8::internal::rsp;
57
- using v8::internal::r8;
58
- using v8::internal::r9;
59
- using v8::internal::r11;
60
- using v8::internal::r12;
61
- using v8::internal::r13;
62
- using v8::internal::r14;
63
80
  using v8::internal::times_pointer_size;
64
- using v8::internal::FUNCTION_CAST;
65
- using v8::internal::CodeDesc;
66
- using v8::internal::less_equal;
67
- using v8::internal::not_equal;
68
- using v8::internal::not_zero;
69
- using v8::internal::greater;
70
- using v8::internal::greater_equal;
71
- using v8::internal::carry;
72
- using v8::internal::not_carry;
73
- using v8::internal::negative;
74
- using v8::internal::positive;
75
- using v8::internal::Smi;
76
- using v8::internal::kSmiTagMask;
77
- using v8::internal::kSmiValueSize;
78
- using v8::internal::kPointerSize;
79
- using v8::internal::kIntSize;
80
81
 
81
82
  // Test the x64 assembler by compiling some simple functions into
82
83
  // a buffer and executing them. These tests do not initialize the
@@ -95,7 +96,9 @@ typedef int (*F0)();
95
96
  static void EntryCode(MacroAssembler* masm) {
96
97
  // Smi constant register is callee save.
97
98
  __ push(v8::internal::kSmiConstantRegister);
99
+ __ push(v8::internal::kRootRegister);
98
100
  __ InitializeSmiConstantRegister();
101
+ __ InitializeRootRegister();
99
102
  }
100
103
 
101
104
 
@@ -105,6 +108,7 @@ static void ExitCode(MacroAssembler* masm) {
105
108
  __ cmpq(rdx, v8::internal::kSmiConstantRegister);
106
109
  __ movq(rdx, Immediate(-1));
107
110
  __ cmovq(not_equal, rax, rdx);
111
+ __ pop(v8::internal::kRootRegister);
108
112
  __ pop(v8::internal::kSmiConstantRegister);
109
113
  }
110
114
 
@@ -146,6 +150,7 @@ static void TestMoveSmi(MacroAssembler* masm, Label* exit, int id, Smi* value) {
146
150
 
147
151
  // Test that we can move a Smi value literally into a register.
148
152
  TEST(SmiMove) {
153
+ v8::internal::V8::Initialize(NULL);
149
154
  // Allocate an executable page of memory.
150
155
  size_t actual_size;
151
156
  byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
@@ -153,7 +158,9 @@ TEST(SmiMove) {
153
158
  true));
154
159
  CHECK(buffer);
155
160
  HandleScope handles;
156
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
161
+ MacroAssembler assembler(Isolate::Current(),
162
+ buffer,
163
+ static_cast<int>(actual_size));
157
164
  MacroAssembler* masm = &assembler; // Create a pointer for the __ macro.
158
165
  masm->set_allow_stub_calls(false);
159
166
  EntryCode(masm);
@@ -220,7 +227,7 @@ void TestSmiCompare(MacroAssembler* masm, Label* exit, int id, int x, int y) {
220
227
  __ j(less_equal, exit);
221
228
  }
222
229
  } else {
223
- __ SmiCompare(rcx, rcx);
230
+ __ cmpq(rcx, rcx);
224
231
  __ movl(rax, Immediate(id + 11));
225
232
  __ j(not_equal, exit);
226
233
  __ incq(rax);
@@ -232,15 +239,18 @@ void TestSmiCompare(MacroAssembler* masm, Label* exit, int id, int x, int y) {
232
239
 
233
240
  // Test that we can compare smis for equality (and more).
234
241
  TEST(SmiCompare) {
242
+ v8::internal::V8::Initialize(NULL);
235
243
  // Allocate an executable page of memory.
236
244
  size_t actual_size;
237
245
  byte* buffer =
238
- static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
246
+ static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize * 2,
239
247
  &actual_size,
240
248
  true));
241
249
  CHECK(buffer);
242
250
  HandleScope handles;
243
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
251
+ MacroAssembler assembler(Isolate::Current(),
252
+ buffer,
253
+ static_cast<int>(actual_size));
244
254
 
245
255
  MacroAssembler* masm = &assembler;
246
256
  masm->set_allow_stub_calls(false);
@@ -282,6 +292,7 @@ TEST(SmiCompare) {
282
292
 
283
293
 
284
294
  TEST(Integer32ToSmi) {
295
+ v8::internal::V8::Initialize(NULL);
285
296
  // Allocate an executable page of memory.
286
297
  size_t actual_size;
287
298
  byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
@@ -289,7 +300,9 @@ TEST(Integer32ToSmi) {
289
300
  true));
290
301
  CHECK(buffer);
291
302
  HandleScope handles;
292
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
303
+ MacroAssembler assembler(Isolate::Current(),
304
+ buffer,
305
+ static_cast<int>(actual_size));
293
306
 
294
307
  MacroAssembler* masm = &assembler;
295
308
  masm->set_allow_stub_calls(false);
@@ -300,35 +313,35 @@ TEST(Integer32ToSmi) {
300
313
  __ movl(rcx, Immediate(0));
301
314
  __ Integer32ToSmi(rcx, rcx);
302
315
  __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(0)));
303
- __ SmiCompare(rcx, rdx);
316
+ __ cmpq(rcx, rdx);
304
317
  __ j(not_equal, &exit);
305
318
 
306
319
  __ movq(rax, Immediate(2)); // Test number.
307
320
  __ movl(rcx, Immediate(1024));
308
321
  __ Integer32ToSmi(rcx, rcx);
309
322
  __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(1024)));
310
- __ SmiCompare(rcx, rdx);
323
+ __ cmpq(rcx, rdx);
311
324
  __ j(not_equal, &exit);
312
325
 
313
326
  __ movq(rax, Immediate(3)); // Test number.
314
327
  __ movl(rcx, Immediate(-1));
315
328
  __ Integer32ToSmi(rcx, rcx);
316
329
  __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(-1)));
317
- __ SmiCompare(rcx, rdx);
330
+ __ cmpq(rcx, rdx);
318
331
  __ j(not_equal, &exit);
319
332
 
320
333
  __ movq(rax, Immediate(4)); // Test number.
321
334
  __ movl(rcx, Immediate(Smi::kMaxValue));
322
335
  __ Integer32ToSmi(rcx, rcx);
323
336
  __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(Smi::kMaxValue)));
324
- __ SmiCompare(rcx, rdx);
337
+ __ cmpq(rcx, rdx);
325
338
  __ j(not_equal, &exit);
326
339
 
327
340
  __ movq(rax, Immediate(5)); // Test number.
328
341
  __ movl(rcx, Immediate(Smi::kMinValue));
329
342
  __ Integer32ToSmi(rcx, rcx);
330
343
  __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(Smi::kMinValue)));
331
- __ SmiCompare(rcx, rdx);
344
+ __ cmpq(rcx, rdx);
332
345
  __ j(not_equal, &exit);
333
346
 
334
347
  // Different target register.
@@ -337,35 +350,35 @@ TEST(Integer32ToSmi) {
337
350
  __ movl(rcx, Immediate(0));
338
351
  __ Integer32ToSmi(r8, rcx);
339
352
  __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(0)));
340
- __ SmiCompare(r8, rdx);
353
+ __ cmpq(r8, rdx);
341
354
  __ j(not_equal, &exit);
342
355
 
343
356
  __ movq(rax, Immediate(7)); // Test number.
344
357
  __ movl(rcx, Immediate(1024));
345
358
  __ Integer32ToSmi(r8, rcx);
346
359
  __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(1024)));
347
- __ SmiCompare(r8, rdx);
360
+ __ cmpq(r8, rdx);
348
361
  __ j(not_equal, &exit);
349
362
 
350
363
  __ movq(rax, Immediate(8)); // Test number.
351
364
  __ movl(rcx, Immediate(-1));
352
365
  __ Integer32ToSmi(r8, rcx);
353
366
  __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(-1)));
354
- __ SmiCompare(r8, rdx);
367
+ __ cmpq(r8, rdx);
355
368
  __ j(not_equal, &exit);
356
369
 
357
370
  __ movq(rax, Immediate(9)); // Test number.
358
371
  __ movl(rcx, Immediate(Smi::kMaxValue));
359
372
  __ Integer32ToSmi(r8, rcx);
360
373
  __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(Smi::kMaxValue)));
361
- __ SmiCompare(r8, rdx);
374
+ __ cmpq(r8, rdx);
362
375
  __ j(not_equal, &exit);
363
376
 
364
377
  __ movq(rax, Immediate(10)); // Test number.
365
378
  __ movl(rcx, Immediate(Smi::kMinValue));
366
379
  __ Integer32ToSmi(r8, rcx);
367
380
  __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(Smi::kMinValue)));
368
- __ SmiCompare(r8, rdx);
381
+ __ cmpq(r8, rdx);
369
382
  __ j(not_equal, &exit);
370
383
 
371
384
 
@@ -394,21 +407,22 @@ void TestI64PlusConstantToSmi(MacroAssembler* masm,
394
407
  __ movq(rcx, x, RelocInfo::NONE);
395
408
  __ movq(r11, rcx);
396
409
  __ Integer64PlusConstantToSmi(rdx, rcx, y);
397
- __ SmiCompare(rdx, r8);
410
+ __ cmpq(rdx, r8);
398
411
  __ j(not_equal, exit);
399
412
 
400
413
  __ incq(rax);
401
- __ SmiCompare(r11, rcx);
414
+ __ cmpq(r11, rcx);
402
415
  __ j(not_equal, exit);
403
416
 
404
417
  __ incq(rax);
405
418
  __ Integer64PlusConstantToSmi(rcx, rcx, y);
406
- __ SmiCompare(rcx, r8);
419
+ __ cmpq(rcx, r8);
407
420
  __ j(not_equal, exit);
408
421
  }
409
422
 
410
423
 
411
424
  TEST(Integer64PlusConstantToSmi) {
425
+ v8::internal::V8::Initialize(NULL);
412
426
  // Allocate an executable page of memory.
413
427
  size_t actual_size;
414
428
  byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
@@ -416,7 +430,9 @@ TEST(Integer64PlusConstantToSmi) {
416
430
  true));
417
431
  CHECK(buffer);
418
432
  HandleScope handles;
419
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
433
+ MacroAssembler assembler(Isolate::Current(),
434
+ buffer,
435
+ static_cast<int>(actual_size));
420
436
 
421
437
  MacroAssembler* masm = &assembler;
422
438
  masm->set_allow_stub_calls(false);
@@ -452,6 +468,7 @@ TEST(Integer64PlusConstantToSmi) {
452
468
 
453
469
 
454
470
  TEST(SmiCheck) {
471
+ v8::internal::V8::Initialize(NULL);
455
472
  // Allocate an executable page of memory.
456
473
  size_t actual_size;
457
474
  byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
@@ -459,7 +476,9 @@ TEST(SmiCheck) {
459
476
  true));
460
477
  CHECK(buffer);
461
478
  HandleScope handles;
462
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
479
+ MacroAssembler assembler(Isolate::Current(),
480
+ buffer,
481
+ static_cast<int>(actual_size));
463
482
 
464
483
  MacroAssembler* masm = &assembler;
465
484
  masm->set_allow_stub_calls(false);
@@ -660,14 +679,14 @@ void TestSmiNeg(MacroAssembler* masm, Label* exit, int id, int x) {
660
679
  __ SmiNeg(r9, rcx, exit);
661
680
 
662
681
  __ incq(rax);
663
- __ SmiCompare(r11, rcx);
682
+ __ cmpq(r11, rcx);
664
683
  __ j(not_equal, exit);
665
684
 
666
685
  __ incq(rax);
667
686
  __ SmiNeg(rcx, rcx, exit);
668
687
 
669
688
  __ incq(rax);
670
- __ SmiCompare(r11, rcx);
689
+ __ cmpq(r11, rcx);
671
690
  __ j(not_equal, exit);
672
691
  } else {
673
692
  Label smi_ok, smi_ok2;
@@ -679,11 +698,11 @@ void TestSmiNeg(MacroAssembler* masm, Label* exit, int id, int x) {
679
698
  __ jmp(exit);
680
699
  __ bind(&smi_ok);
681
700
  __ incq(rax);
682
- __ SmiCompare(r9, r8);
701
+ __ cmpq(r9, r8);
683
702
  __ j(not_equal, exit);
684
703
 
685
704
  __ incq(rax);
686
- __ SmiCompare(r11, rcx);
705
+ __ cmpq(r11, rcx);
687
706
  __ j(not_equal, exit);
688
707
 
689
708
  __ incq(rax);
@@ -691,13 +710,14 @@ void TestSmiNeg(MacroAssembler* masm, Label* exit, int id, int x) {
691
710
  __ jmp(exit);
692
711
  __ bind(&smi_ok2);
693
712
  __ incq(rax);
694
- __ SmiCompare(rcx, r8);
713
+ __ cmpq(rcx, r8);
695
714
  __ j(not_equal, exit);
696
715
  }
697
716
  }
698
717
 
699
718
 
700
719
  TEST(SmiNeg) {
720
+ v8::internal::V8::Initialize(NULL);
701
721
  // Allocate an executable page of memory.
702
722
  size_t actual_size;
703
723
  byte* buffer =
@@ -706,7 +726,9 @@ TEST(SmiNeg) {
706
726
  true));
707
727
  CHECK(buffer);
708
728
  HandleScope handles;
709
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
729
+ MacroAssembler assembler(Isolate::Current(),
730
+ buffer,
731
+ static_cast<int>(actual_size));
710
732
 
711
733
  MacroAssembler* masm = &assembler;
712
734
  masm->set_allow_stub_calls(false);
@@ -751,12 +773,12 @@ static void SmiAddTest(MacroAssembler* masm,
751
773
 
752
774
  __ movl(rax, Immediate(id)); // Test number.
753
775
  __ SmiAdd(r9, rcx, rdx, exit);
754
- __ SmiCompare(r9, r8);
776
+ __ cmpq(r9, r8);
755
777
  __ j(not_equal, exit);
756
778
 
757
779
  __ incq(rax);
758
780
  __ SmiAdd(rcx, rcx, rdx, exit); \
759
- __ SmiCompare(rcx, r8);
781
+ __ cmpq(rcx, r8);
760
782
  __ j(not_equal, exit);
761
783
 
762
784
  __ movl(rcx, Immediate(first));
@@ -764,11 +786,11 @@ static void SmiAddTest(MacroAssembler* masm,
764
786
 
765
787
  __ incq(rax);
766
788
  __ SmiAddConstant(r9, rcx, Smi::FromInt(second));
767
- __ SmiCompare(r9, r8);
789
+ __ cmpq(r9, r8);
768
790
  __ j(not_equal, exit);
769
791
 
770
792
  __ SmiAddConstant(rcx, rcx, Smi::FromInt(second));
771
- __ SmiCompare(rcx, r8);
793
+ __ cmpq(rcx, r8);
772
794
  __ j(not_equal, exit);
773
795
 
774
796
  __ movl(rcx, Immediate(first));
@@ -776,16 +798,17 @@ static void SmiAddTest(MacroAssembler* masm,
776
798
 
777
799
  __ incq(rax);
778
800
  __ SmiAddConstant(r9, rcx, Smi::FromInt(second), exit);
779
- __ SmiCompare(r9, r8);
801
+ __ cmpq(r9, r8);
780
802
  __ j(not_equal, exit);
781
803
 
782
804
  __ incq(rax);
783
805
  __ SmiAddConstant(rcx, rcx, Smi::FromInt(second), exit);
784
- __ SmiCompare(rcx, r8);
806
+ __ cmpq(rcx, r8);
785
807
  __ j(not_equal, exit);
786
808
  }
787
809
 
788
810
  TEST(SmiAdd) {
811
+ v8::internal::V8::Initialize(NULL);
789
812
  // Allocate an executable page of memory.
790
813
  size_t actual_size;
791
814
  byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
@@ -793,7 +816,9 @@ TEST(SmiAdd) {
793
816
  true));
794
817
  CHECK(buffer);
795
818
  HandleScope handles;
796
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
819
+ MacroAssembler assembler(Isolate::Current(),
820
+ buffer,
821
+ static_cast<int>(actual_size));
797
822
 
798
823
  MacroAssembler* masm = &assembler;
799
824
  masm->set_allow_stub_calls(false);
@@ -834,36 +859,36 @@ static void SmiSubTest(MacroAssembler* masm,
834
859
 
835
860
  __ movl(rax, Immediate(id)); // Test 0.
836
861
  __ SmiSub(r9, rcx, rdx, exit);
837
- __ SmiCompare(r9, r8);
862
+ __ cmpq(r9, r8);
838
863
  __ j(not_equal, exit);
839
864
 
840
865
  __ incq(rax); // Test 1.
841
866
  __ SmiSub(rcx, rcx, rdx, exit);
842
- __ SmiCompare(rcx, r8);
867
+ __ cmpq(rcx, r8);
843
868
  __ j(not_equal, exit);
844
869
 
845
870
  __ Move(rcx, Smi::FromInt(first));
846
871
 
847
872
  __ incq(rax); // Test 2.
848
873
  __ SmiSubConstant(r9, rcx, Smi::FromInt(second));
849
- __ SmiCompare(r9, r8);
874
+ __ cmpq(r9, r8);
850
875
  __ j(not_equal, exit);
851
876
 
852
877
  __ incq(rax); // Test 3.
853
878
  __ SmiSubConstant(rcx, rcx, Smi::FromInt(second));
854
- __ SmiCompare(rcx, r8);
879
+ __ cmpq(rcx, r8);
855
880
  __ j(not_equal, exit);
856
881
 
857
882
  __ Move(rcx, Smi::FromInt(first));
858
883
 
859
884
  __ incq(rax); // Test 4.
860
885
  __ SmiSubConstant(r9, rcx, Smi::FromInt(second), exit);
861
- __ SmiCompare(r9, r8);
886
+ __ cmpq(r9, r8);
862
887
  __ j(not_equal, exit);
863
888
 
864
889
  __ incq(rax); // Test 5.
865
890
  __ SmiSubConstant(rcx, rcx, Smi::FromInt(second), exit);
866
- __ SmiCompare(rcx, r8);
891
+ __ cmpq(rcx, r8);
867
892
  __ j(not_equal, exit);
868
893
  }
869
894
 
@@ -886,7 +911,7 @@ static void SmiSubOverflowTest(MacroAssembler* masm,
886
911
  __ jmp(exit);
887
912
  __ bind(&overflow_ok);
888
913
  __ incq(rax);
889
- __ SmiCompare(rcx, r11);
914
+ __ cmpq(rcx, r11);
890
915
  __ j(not_equal, exit);
891
916
  }
892
917
 
@@ -897,7 +922,7 @@ static void SmiSubOverflowTest(MacroAssembler* masm,
897
922
  __ jmp(exit);
898
923
  __ bind(&overflow_ok);
899
924
  __ incq(rax);
900
- __ SmiCompare(rcx, r11);
925
+ __ cmpq(rcx, r11);
901
926
  __ j(not_equal, exit);
902
927
  }
903
928
 
@@ -909,7 +934,7 @@ static void SmiSubOverflowTest(MacroAssembler* masm,
909
934
  __ jmp(exit);
910
935
  __ bind(&overflow_ok);
911
936
  __ incq(rax);
912
- __ SmiCompare(rcx, r11);
937
+ __ cmpq(rcx, r11);
913
938
  __ j(not_equal, exit);
914
939
  }
915
940
 
@@ -920,7 +945,7 @@ static void SmiSubOverflowTest(MacroAssembler* masm,
920
945
  __ jmp(exit);
921
946
  __ bind(&overflow_ok);
922
947
  __ incq(rax);
923
- __ SmiCompare(rcx, r11);
948
+ __ cmpq(rcx, r11);
924
949
  __ j(not_equal, exit);
925
950
  }
926
951
 
@@ -933,7 +958,7 @@ static void SmiSubOverflowTest(MacroAssembler* masm,
933
958
  __ jmp(exit);
934
959
  __ bind(&overflow_ok);
935
960
  __ incq(rax);
936
- __ SmiCompare(rcx, r11);
961
+ __ cmpq(rcx, r11);
937
962
  __ j(not_equal, exit);
938
963
  }
939
964
 
@@ -944,7 +969,7 @@ static void SmiSubOverflowTest(MacroAssembler* masm,
944
969
  __ jmp(exit);
945
970
  __ bind(&overflow_ok);
946
971
  __ incq(rax);
947
- __ SmiCompare(rcx, r11);
972
+ __ cmpq(rcx, r11);
948
973
  __ j(not_equal, exit);
949
974
  }
950
975
 
@@ -956,7 +981,7 @@ static void SmiSubOverflowTest(MacroAssembler* masm,
956
981
  __ jmp(exit);
957
982
  __ bind(&overflow_ok);
958
983
  __ incq(rax);
959
- __ SmiCompare(rcx, r11);
984
+ __ cmpq(rcx, r11);
960
985
  __ j(not_equal, exit);
961
986
  }
962
987
 
@@ -967,13 +992,14 @@ static void SmiSubOverflowTest(MacroAssembler* masm,
967
992
  __ jmp(exit);
968
993
  __ bind(&overflow_ok);
969
994
  __ incq(rax);
970
- __ SmiCompare(rcx, r11);
995
+ __ cmpq(rcx, r11);
971
996
  __ j(not_equal, exit);
972
997
  }
973
998
  }
974
999
 
975
1000
 
976
1001
  TEST(SmiSub) {
1002
+ v8::internal::V8::Initialize(NULL);
977
1003
  // Allocate an executable page of memory.
978
1004
  size_t actual_size;
979
1005
  byte* buffer =
@@ -982,7 +1008,9 @@ TEST(SmiSub) {
982
1008
  true));
983
1009
  CHECK(buffer);
984
1010
  HandleScope handles;
985
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
1011
+ MacroAssembler assembler(Isolate::Current(),
1012
+ buffer,
1013
+ static_cast<int>(actual_size));
986
1014
 
987
1015
  MacroAssembler* masm = &assembler;
988
1016
  masm->set_allow_stub_calls(false);
@@ -1032,15 +1060,15 @@ void TestSmiMul(MacroAssembler* masm, Label* exit, int id, int x, int y) {
1032
1060
  __ Move(r8, Smi::FromIntptr(result));
1033
1061
  __ SmiMul(r9, rcx, rdx, exit);
1034
1062
  __ incq(rax);
1035
- __ SmiCompare(r11, rcx);
1063
+ __ cmpq(r11, rcx);
1036
1064
  __ j(not_equal, exit);
1037
1065
  __ incq(rax);
1038
- __ SmiCompare(r9, r8);
1066
+ __ cmpq(r9, r8);
1039
1067
  __ j(not_equal, exit);
1040
1068
 
1041
1069
  __ incq(rax);
1042
1070
  __ SmiMul(rcx, rcx, rdx, exit);
1043
- __ SmiCompare(rcx, r8);
1071
+ __ cmpq(rcx, r8);
1044
1072
  __ j(not_equal, exit);
1045
1073
  } else {
1046
1074
  __ movl(rax, Immediate(id + 8));
@@ -1049,7 +1077,7 @@ void TestSmiMul(MacroAssembler* masm, Label* exit, int id, int x, int y) {
1049
1077
  __ jmp(exit);
1050
1078
  __ bind(&overflow_ok);
1051
1079
  __ incq(rax);
1052
- __ SmiCompare(r11, rcx);
1080
+ __ cmpq(r11, rcx);
1053
1081
  __ j(not_equal, exit);
1054
1082
  __ incq(rax);
1055
1083
  __ SmiMul(rcx, rcx, rdx, &overflow_ok2);
@@ -1057,13 +1085,14 @@ void TestSmiMul(MacroAssembler* masm, Label* exit, int id, int x, int y) {
1057
1085
  __ bind(&overflow_ok2);
1058
1086
  // 31-bit version doesn't preserve rcx on failure.
1059
1087
  // __ incq(rax);
1060
- // __ SmiCompare(r11, rcx);
1088
+ // __ cmpq(r11, rcx);
1061
1089
  // __ j(not_equal, exit);
1062
1090
  }
1063
1091
  }
1064
1092
 
1065
1093
 
1066
1094
  TEST(SmiMul) {
1095
+ v8::internal::V8::Initialize(NULL);
1067
1096
  // Allocate an executable page of memory.
1068
1097
  size_t actual_size;
1069
1098
  byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
@@ -1071,7 +1100,9 @@ TEST(SmiMul) {
1071
1100
  true));
1072
1101
  CHECK(buffer);
1073
1102
  HandleScope handles;
1074
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
1103
+ MacroAssembler assembler(Isolate::Current(),
1104
+ buffer,
1105
+ static_cast<int>(actual_size));
1075
1106
 
1076
1107
  MacroAssembler* masm = &assembler;
1077
1108
  masm->set_allow_stub_calls(false);
@@ -1120,30 +1151,30 @@ void TestSmiDiv(MacroAssembler* masm, Label* exit, int id, int x, int y) {
1120
1151
  if (!fraction && !overflow && !negative_zero && !division_by_zero) {
1121
1152
  // Division succeeds
1122
1153
  __ movq(rcx, r11);
1123
- __ movq(r12, Immediate(id));
1154
+ __ movq(r15, Immediate(id));
1124
1155
  int result = x / y;
1125
1156
  __ Move(r8, Smi::FromInt(result));
1126
1157
  __ SmiDiv(r9, rcx, r14, exit);
1127
1158
  // Might have destroyed rcx and r14.
1128
- __ incq(r12);
1129
- __ SmiCompare(r9, r8);
1159
+ __ incq(r15);
1160
+ __ cmpq(r9, r8);
1130
1161
  __ j(not_equal, exit);
1131
1162
 
1132
- __ incq(r12);
1163
+ __ incq(r15);
1133
1164
  __ movq(rcx, r11);
1134
1165
  __ Move(r14, Smi::FromInt(y));
1135
- __ SmiCompare(rcx, r11);
1166
+ __ cmpq(rcx, r11);
1136
1167
  __ j(not_equal, exit);
1137
1168
 
1138
- __ incq(r12);
1169
+ __ incq(r15);
1139
1170
  __ SmiDiv(rcx, rcx, r14, exit);
1140
1171
 
1141
- __ incq(r12);
1142
- __ SmiCompare(rcx, r8);
1172
+ __ incq(r15);
1173
+ __ cmpq(rcx, r8);
1143
1174
  __ j(not_equal, exit);
1144
1175
  } else {
1145
1176
  // Division fails.
1146
- __ movq(r12, Immediate(id + 8));
1177
+ __ movq(r15, Immediate(id + 8));
1147
1178
 
1148
1179
  Label fail_ok, fail_ok2;
1149
1180
  __ movq(rcx, r11);
@@ -1151,23 +1182,24 @@ void TestSmiDiv(MacroAssembler* masm, Label* exit, int id, int x, int y) {
1151
1182
  __ jmp(exit);
1152
1183
  __ bind(&fail_ok);
1153
1184
 
1154
- __ incq(r12);
1155
- __ SmiCompare(rcx, r11);
1185
+ __ incq(r15);
1186
+ __ cmpq(rcx, r11);
1156
1187
  __ j(not_equal, exit);
1157
1188
 
1158
- __ incq(r12);
1189
+ __ incq(r15);
1159
1190
  __ SmiDiv(rcx, rcx, r14, &fail_ok2);
1160
1191
  __ jmp(exit);
1161
1192
  __ bind(&fail_ok2);
1162
1193
 
1163
- __ incq(r12);
1164
- __ SmiCompare(rcx, r11);
1194
+ __ incq(r15);
1195
+ __ cmpq(rcx, r11);
1165
1196
  __ j(not_equal, exit);
1166
1197
  }
1167
1198
  }
1168
1199
 
1169
1200
 
1170
1201
  TEST(SmiDiv) {
1202
+ v8::internal::V8::Initialize(NULL);
1171
1203
  // Allocate an executable page of memory.
1172
1204
  size_t actual_size;
1173
1205
  byte* buffer =
@@ -1176,7 +1208,9 @@ TEST(SmiDiv) {
1176
1208
  true));
1177
1209
  CHECK(buffer);
1178
1210
  HandleScope handles;
1179
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
1211
+ MacroAssembler assembler(Isolate::Current(),
1212
+ buffer,
1213
+ static_cast<int>(actual_size));
1180
1214
 
1181
1215
  MacroAssembler* masm = &assembler;
1182
1216
  masm->set_allow_stub_calls(false);
@@ -1184,7 +1218,7 @@ TEST(SmiDiv) {
1184
1218
  Label exit;
1185
1219
 
1186
1220
  __ push(r14);
1187
- __ push(r12);
1221
+ __ push(r15);
1188
1222
  TestSmiDiv(masm, &exit, 0x10, 1, 1);
1189
1223
  TestSmiDiv(masm, &exit, 0x20, 1, 0);
1190
1224
  TestSmiDiv(masm, &exit, 0x30, -1, 0);
@@ -1206,10 +1240,10 @@ TEST(SmiDiv) {
1206
1240
  TestSmiDiv(masm, &exit, 0x130, Smi::kMinValue, Smi::kMinValue);
1207
1241
  TestSmiDiv(masm, &exit, 0x140, Smi::kMinValue, -1);
1208
1242
 
1209
- __ xor_(r12, r12); // Success.
1243
+ __ xor_(r15, r15); // Success.
1210
1244
  __ bind(&exit);
1211
- __ movq(rax, r12);
1212
- __ pop(r12);
1245
+ __ movq(rax, r15);
1246
+ __ pop(r15);
1213
1247
  __ pop(r14);
1214
1248
  ExitCode(masm);
1215
1249
  __ ret(0);
@@ -1232,51 +1266,52 @@ void TestSmiMod(MacroAssembler* masm, Label* exit, int id, int x, int y) {
1232
1266
  __ Move(r14, Smi::FromInt(y));
1233
1267
  if (!division_overflow && !negative_zero && !division_by_zero) {
1234
1268
  // Modulo succeeds
1235
- __ movq(r12, Immediate(id));
1269
+ __ movq(r15, Immediate(id));
1236
1270
  int result = x % y;
1237
1271
  __ Move(r8, Smi::FromInt(result));
1238
1272
  __ SmiMod(r9, rcx, r14, exit);
1239
1273
 
1240
- __ incq(r12);
1241
- __ SmiCompare(r9, r8);
1274
+ __ incq(r15);
1275
+ __ cmpq(r9, r8);
1242
1276
  __ j(not_equal, exit);
1243
1277
 
1244
- __ incq(r12);
1245
- __ SmiCompare(rcx, r11);
1278
+ __ incq(r15);
1279
+ __ cmpq(rcx, r11);
1246
1280
  __ j(not_equal, exit);
1247
1281
 
1248
- __ incq(r12);
1282
+ __ incq(r15);
1249
1283
  __ SmiMod(rcx, rcx, r14, exit);
1250
1284
 
1251
- __ incq(r12);
1252
- __ SmiCompare(rcx, r8);
1285
+ __ incq(r15);
1286
+ __ cmpq(rcx, r8);
1253
1287
  __ j(not_equal, exit);
1254
1288
  } else {
1255
1289
  // Modulo fails.
1256
- __ movq(r12, Immediate(id + 8));
1290
+ __ movq(r15, Immediate(id + 8));
1257
1291
 
1258
1292
  Label fail_ok, fail_ok2;
1259
1293
  __ SmiMod(r9, rcx, r14, &fail_ok);
1260
1294
  __ jmp(exit);
1261
1295
  __ bind(&fail_ok);
1262
1296
 
1263
- __ incq(r12);
1264
- __ SmiCompare(rcx, r11);
1297
+ __ incq(r15);
1298
+ __ cmpq(rcx, r11);
1265
1299
  __ j(not_equal, exit);
1266
1300
 
1267
- __ incq(r12);
1301
+ __ incq(r15);
1268
1302
  __ SmiMod(rcx, rcx, r14, &fail_ok2);
1269
1303
  __ jmp(exit);
1270
1304
  __ bind(&fail_ok2);
1271
1305
 
1272
- __ incq(r12);
1273
- __ SmiCompare(rcx, r11);
1306
+ __ incq(r15);
1307
+ __ cmpq(rcx, r11);
1274
1308
  __ j(not_equal, exit);
1275
1309
  }
1276
1310
  }
1277
1311
 
1278
1312
 
1279
1313
  TEST(SmiMod) {
1314
+ v8::internal::V8::Initialize(NULL);
1280
1315
  // Allocate an executable page of memory.
1281
1316
  size_t actual_size;
1282
1317
  byte* buffer =
@@ -1285,7 +1320,9 @@ TEST(SmiMod) {
1285
1320
  true));
1286
1321
  CHECK(buffer);
1287
1322
  HandleScope handles;
1288
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
1323
+ MacroAssembler assembler(Isolate::Current(),
1324
+ buffer,
1325
+ static_cast<int>(actual_size));
1289
1326
 
1290
1327
  MacroAssembler* masm = &assembler;
1291
1328
  masm->set_allow_stub_calls(false);
@@ -1293,7 +1330,7 @@ TEST(SmiMod) {
1293
1330
  Label exit;
1294
1331
 
1295
1332
  __ push(r14);
1296
- __ push(r12);
1333
+ __ push(r15);
1297
1334
  TestSmiMod(masm, &exit, 0x10, 1, 1);
1298
1335
  TestSmiMod(masm, &exit, 0x20, 1, 0);
1299
1336
  TestSmiMod(masm, &exit, 0x30, -1, 0);
@@ -1315,10 +1352,10 @@ TEST(SmiMod) {
1315
1352
  TestSmiMod(masm, &exit, 0x130, Smi::kMinValue, Smi::kMinValue);
1316
1353
  TestSmiMod(masm, &exit, 0x140, Smi::kMinValue, -1);
1317
1354
 
1318
- __ xor_(r12, r12); // Success.
1355
+ __ xor_(r15, r15); // Success.
1319
1356
  __ bind(&exit);
1320
- __ movq(rax, r12);
1321
- __ pop(r12);
1357
+ __ movq(rax, r15);
1358
+ __ pop(r15);
1322
1359
  __ pop(r14);
1323
1360
  ExitCode(masm);
1324
1361
  __ ret(0);
@@ -1340,7 +1377,7 @@ void TestSmiIndex(MacroAssembler* masm, Label* exit, int id, int x) {
1340
1377
  ASSERT(index.reg.is(rcx) || index.reg.is(rdx));
1341
1378
  __ shl(index.reg, Immediate(index.scale));
1342
1379
  __ Set(r8, static_cast<intptr_t>(x) << i);
1343
- __ SmiCompare(index.reg, r8);
1380
+ __ cmpq(index.reg, r8);
1344
1381
  __ j(not_equal, exit);
1345
1382
  __ incq(rax);
1346
1383
  __ Move(rcx, Smi::FromInt(x));
@@ -1348,7 +1385,7 @@ void TestSmiIndex(MacroAssembler* masm, Label* exit, int id, int x) {
1348
1385
  ASSERT(index.reg.is(rcx));
1349
1386
  __ shl(rcx, Immediate(index.scale));
1350
1387
  __ Set(r8, static_cast<intptr_t>(x) << i);
1351
- __ SmiCompare(rcx, r8);
1388
+ __ cmpq(rcx, r8);
1352
1389
  __ j(not_equal, exit);
1353
1390
  __ incq(rax);
1354
1391
 
@@ -1357,7 +1394,7 @@ void TestSmiIndex(MacroAssembler* masm, Label* exit, int id, int x) {
1357
1394
  ASSERT(index.reg.is(rcx) || index.reg.is(rdx));
1358
1395
  __ shl(index.reg, Immediate(index.scale));
1359
1396
  __ Set(r8, static_cast<intptr_t>(-x) << i);
1360
- __ SmiCompare(index.reg, r8);
1397
+ __ cmpq(index.reg, r8);
1361
1398
  __ j(not_equal, exit);
1362
1399
  __ incq(rax);
1363
1400
  __ Move(rcx, Smi::FromInt(x));
@@ -1365,13 +1402,14 @@ void TestSmiIndex(MacroAssembler* masm, Label* exit, int id, int x) {
1365
1402
  ASSERT(index.reg.is(rcx));
1366
1403
  __ shl(rcx, Immediate(index.scale));
1367
1404
  __ Set(r8, static_cast<intptr_t>(-x) << i);
1368
- __ SmiCompare(rcx, r8);
1405
+ __ cmpq(rcx, r8);
1369
1406
  __ j(not_equal, exit);
1370
1407
  __ incq(rax);
1371
1408
  }
1372
1409
  }
1373
1410
 
1374
1411
  TEST(SmiIndex) {
1412
+ v8::internal::V8::Initialize(NULL);
1375
1413
  // Allocate an executable page of memory.
1376
1414
  size_t actual_size;
1377
1415
  byte* buffer =
@@ -1380,7 +1418,9 @@ TEST(SmiIndex) {
1380
1418
  true));
1381
1419
  CHECK(buffer);
1382
1420
  HandleScope handles;
1383
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
1421
+ MacroAssembler assembler(Isolate::Current(),
1422
+ buffer,
1423
+ static_cast<int>(actual_size));
1384
1424
 
1385
1425
  MacroAssembler* masm = &assembler;
1386
1426
  masm->set_allow_stub_calls(false);
@@ -1414,7 +1454,7 @@ void TestSelectNonSmi(MacroAssembler* masm, Label* exit, int id, int x, int y) {
1414
1454
  __ SelectNonSmi(r9, rcx, rdx, exit);
1415
1455
 
1416
1456
  __ incq(rax);
1417
- __ SmiCompare(r9, rdx);
1457
+ __ cmpq(r9, rdx);
1418
1458
  __ j(not_equal, exit);
1419
1459
 
1420
1460
  __ incq(rax);
@@ -1424,7 +1464,7 @@ void TestSelectNonSmi(MacroAssembler* masm, Label* exit, int id, int x, int y) {
1424
1464
  __ SelectNonSmi(r9, rcx, rdx, exit);
1425
1465
 
1426
1466
  __ incq(rax);
1427
- __ SmiCompare(r9, rcx);
1467
+ __ cmpq(r9, rcx);
1428
1468
  __ j(not_equal, exit);
1429
1469
 
1430
1470
  __ incq(rax);
@@ -1440,6 +1480,7 @@ void TestSelectNonSmi(MacroAssembler* masm, Label* exit, int id, int x, int y) {
1440
1480
 
1441
1481
 
1442
1482
  TEST(SmiSelectNonSmi) {
1483
+ v8::internal::V8::Initialize(NULL);
1443
1484
  // Allocate an executable page of memory.
1444
1485
  size_t actual_size;
1445
1486
  byte* buffer =
@@ -1448,7 +1489,9 @@ TEST(SmiSelectNonSmi) {
1448
1489
  true));
1449
1490
  CHECK(buffer);
1450
1491
  HandleScope handles;
1451
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
1492
+ MacroAssembler assembler(Isolate::Current(),
1493
+ buffer,
1494
+ static_cast<int>(actual_size));
1452
1495
 
1453
1496
  MacroAssembler* masm = &assembler;
1454
1497
  masm->set_allow_stub_calls(false); // Avoid inline checks.
@@ -1488,36 +1531,37 @@ void TestSmiAnd(MacroAssembler* masm, Label* exit, int id, int x, int y) {
1488
1531
  __ Move(rdx, Smi::FromInt(y));
1489
1532
  __ Move(r8, Smi::FromInt(result));
1490
1533
  __ SmiAnd(r9, rcx, rdx);
1491
- __ SmiCompare(r8, r9);
1534
+ __ cmpq(r8, r9);
1492
1535
  __ j(not_equal, exit);
1493
1536
 
1494
1537
  __ incq(rax);
1495
- __ SmiCompare(r11, rcx);
1538
+ __ cmpq(r11, rcx);
1496
1539
  __ j(not_equal, exit);
1497
1540
 
1498
1541
  __ incq(rax);
1499
1542
  __ SmiAnd(rcx, rcx, rdx);
1500
- __ SmiCompare(r8, rcx);
1543
+ __ cmpq(r8, rcx);
1501
1544
  __ j(not_equal, exit);
1502
1545
 
1503
1546
  __ movq(rcx, r11);
1504
1547
  __ incq(rax);
1505
1548
  __ SmiAndConstant(r9, rcx, Smi::FromInt(y));
1506
- __ SmiCompare(r8, r9);
1549
+ __ cmpq(r8, r9);
1507
1550
  __ j(not_equal, exit);
1508
1551
 
1509
1552
  __ incq(rax);
1510
- __ SmiCompare(r11, rcx);
1553
+ __ cmpq(r11, rcx);
1511
1554
  __ j(not_equal, exit);
1512
1555
 
1513
1556
  __ incq(rax);
1514
1557
  __ SmiAndConstant(rcx, rcx, Smi::FromInt(y));
1515
- __ SmiCompare(r8, rcx);
1558
+ __ cmpq(r8, rcx);
1516
1559
  __ j(not_equal, exit);
1517
1560
  }
1518
1561
 
1519
1562
 
1520
1563
  TEST(SmiAnd) {
1564
+ v8::internal::V8::Initialize(NULL);
1521
1565
  // Allocate an executable page of memory.
1522
1566
  size_t actual_size;
1523
1567
  byte* buffer =
@@ -1526,7 +1570,9 @@ TEST(SmiAnd) {
1526
1570
  true));
1527
1571
  CHECK(buffer);
1528
1572
  HandleScope handles;
1529
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
1573
+ MacroAssembler assembler(Isolate::Current(),
1574
+ buffer,
1575
+ static_cast<int>(actual_size));
1530
1576
 
1531
1577
  MacroAssembler* masm = &assembler;
1532
1578
  masm->set_allow_stub_calls(false);
@@ -1568,36 +1614,37 @@ void TestSmiOr(MacroAssembler* masm, Label* exit, int id, int x, int y) {
1568
1614
  __ Move(rdx, Smi::FromInt(y));
1569
1615
  __ Move(r8, Smi::FromInt(result));
1570
1616
  __ SmiOr(r9, rcx, rdx);
1571
- __ SmiCompare(r8, r9);
1617
+ __ cmpq(r8, r9);
1572
1618
  __ j(not_equal, exit);
1573
1619
 
1574
1620
  __ incq(rax);
1575
- __ SmiCompare(r11, rcx);
1621
+ __ cmpq(r11, rcx);
1576
1622
  __ j(not_equal, exit);
1577
1623
 
1578
1624
  __ incq(rax);
1579
1625
  __ SmiOr(rcx, rcx, rdx);
1580
- __ SmiCompare(r8, rcx);
1626
+ __ cmpq(r8, rcx);
1581
1627
  __ j(not_equal, exit);
1582
1628
 
1583
1629
  __ movq(rcx, r11);
1584
1630
  __ incq(rax);
1585
1631
  __ SmiOrConstant(r9, rcx, Smi::FromInt(y));
1586
- __ SmiCompare(r8, r9);
1632
+ __ cmpq(r8, r9);
1587
1633
  __ j(not_equal, exit);
1588
1634
 
1589
1635
  __ incq(rax);
1590
- __ SmiCompare(r11, rcx);
1636
+ __ cmpq(r11, rcx);
1591
1637
  __ j(not_equal, exit);
1592
1638
 
1593
1639
  __ incq(rax);
1594
1640
  __ SmiOrConstant(rcx, rcx, Smi::FromInt(y));
1595
- __ SmiCompare(r8, rcx);
1641
+ __ cmpq(r8, rcx);
1596
1642
  __ j(not_equal, exit);
1597
1643
  }
1598
1644
 
1599
1645
 
1600
1646
  TEST(SmiOr) {
1647
+ v8::internal::V8::Initialize(NULL);
1601
1648
  // Allocate an executable page of memory.
1602
1649
  size_t actual_size;
1603
1650
  byte* buffer =
@@ -1606,7 +1653,9 @@ TEST(SmiOr) {
1606
1653
  true));
1607
1654
  CHECK(buffer);
1608
1655
  HandleScope handles;
1609
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
1656
+ MacroAssembler assembler(Isolate::Current(),
1657
+ buffer,
1658
+ static_cast<int>(actual_size));
1610
1659
 
1611
1660
  MacroAssembler* masm = &assembler;
1612
1661
  masm->set_allow_stub_calls(false);
@@ -1650,36 +1699,37 @@ void TestSmiXor(MacroAssembler* masm, Label* exit, int id, int x, int y) {
1650
1699
  __ Move(rdx, Smi::FromInt(y));
1651
1700
  __ Move(r8, Smi::FromInt(result));
1652
1701
  __ SmiXor(r9, rcx, rdx);
1653
- __ SmiCompare(r8, r9);
1702
+ __ cmpq(r8, r9);
1654
1703
  __ j(not_equal, exit);
1655
1704
 
1656
1705
  __ incq(rax);
1657
- __ SmiCompare(r11, rcx);
1706
+ __ cmpq(r11, rcx);
1658
1707
  __ j(not_equal, exit);
1659
1708
 
1660
1709
  __ incq(rax);
1661
1710
  __ SmiXor(rcx, rcx, rdx);
1662
- __ SmiCompare(r8, rcx);
1711
+ __ cmpq(r8, rcx);
1663
1712
  __ j(not_equal, exit);
1664
1713
 
1665
1714
  __ movq(rcx, r11);
1666
1715
  __ incq(rax);
1667
1716
  __ SmiXorConstant(r9, rcx, Smi::FromInt(y));
1668
- __ SmiCompare(r8, r9);
1717
+ __ cmpq(r8, r9);
1669
1718
  __ j(not_equal, exit);
1670
1719
 
1671
1720
  __ incq(rax);
1672
- __ SmiCompare(r11, rcx);
1721
+ __ cmpq(r11, rcx);
1673
1722
  __ j(not_equal, exit);
1674
1723
 
1675
1724
  __ incq(rax);
1676
1725
  __ SmiXorConstant(rcx, rcx, Smi::FromInt(y));
1677
- __ SmiCompare(r8, rcx);
1726
+ __ cmpq(r8, rcx);
1678
1727
  __ j(not_equal, exit);
1679
1728
  }
1680
1729
 
1681
1730
 
1682
1731
  TEST(SmiXor) {
1732
+ v8::internal::V8::Initialize(NULL);
1683
1733
  // Allocate an executable page of memory.
1684
1734
  size_t actual_size;
1685
1735
  byte* buffer =
@@ -1688,7 +1738,9 @@ TEST(SmiXor) {
1688
1738
  true));
1689
1739
  CHECK(buffer);
1690
1740
  HandleScope handles;
1691
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
1741
+ MacroAssembler assembler(Isolate::Current(),
1742
+ buffer,
1743
+ static_cast<int>(actual_size));
1692
1744
 
1693
1745
  MacroAssembler* masm = &assembler;
1694
1746
  masm->set_allow_stub_calls(false);
@@ -1731,21 +1783,22 @@ void TestSmiNot(MacroAssembler* masm, Label* exit, int id, int x) {
1731
1783
  __ movq(r11, rcx);
1732
1784
 
1733
1785
  __ SmiNot(r9, rcx);
1734
- __ SmiCompare(r9, r8);
1786
+ __ cmpq(r9, r8);
1735
1787
  __ j(not_equal, exit);
1736
1788
 
1737
1789
  __ incq(rax);
1738
- __ SmiCompare(r11, rcx);
1790
+ __ cmpq(r11, rcx);
1739
1791
  __ j(not_equal, exit);
1740
1792
 
1741
1793
  __ incq(rax);
1742
1794
  __ SmiNot(rcx, rcx);
1743
- __ SmiCompare(rcx, r8);
1795
+ __ cmpq(rcx, r8);
1744
1796
  __ j(not_equal, exit);
1745
1797
  }
1746
1798
 
1747
1799
 
1748
1800
  TEST(SmiNot) {
1801
+ v8::internal::V8::Initialize(NULL);
1749
1802
  // Allocate an executable page of memory.
1750
1803
  size_t actual_size;
1751
1804
  byte* buffer =
@@ -1754,7 +1807,9 @@ TEST(SmiNot) {
1754
1807
  true));
1755
1808
  CHECK(buffer);
1756
1809
  HandleScope handles;
1757
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
1810
+ MacroAssembler assembler(Isolate::Current(),
1811
+ buffer,
1812
+ static_cast<int>(actual_size));
1758
1813
 
1759
1814
  MacroAssembler* masm = &assembler;
1760
1815
  masm->set_allow_stub_calls(false);
@@ -1797,7 +1852,7 @@ void TestSmiShiftLeft(MacroAssembler* masm, Label* exit, int id, int x) {
1797
1852
  __ SmiShiftLeftConstant(r9, rcx, shift);
1798
1853
 
1799
1854
  __ incq(rax);
1800
- __ SmiCompare(r9, r8);
1855
+ __ cmpq(r9, r8);
1801
1856
  __ j(not_equal, exit);
1802
1857
 
1803
1858
  __ incq(rax);
@@ -1805,7 +1860,7 @@ void TestSmiShiftLeft(MacroAssembler* masm, Label* exit, int id, int x) {
1805
1860
  __ SmiShiftLeftConstant(rcx, rcx, shift);
1806
1861
 
1807
1862
  __ incq(rax);
1808
- __ SmiCompare(rcx, r8);
1863
+ __ cmpq(rcx, r8);
1809
1864
  __ j(not_equal, exit);
1810
1865
 
1811
1866
  __ incq(rax);
@@ -1814,7 +1869,7 @@ void TestSmiShiftLeft(MacroAssembler* masm, Label* exit, int id, int x) {
1814
1869
  __ SmiShiftLeft(r9, rdx, rcx);
1815
1870
 
1816
1871
  __ incq(rax);
1817
- __ SmiCompare(r9, r8);
1872
+ __ cmpq(r9, r8);
1818
1873
  __ j(not_equal, exit);
1819
1874
 
1820
1875
  __ incq(rax);
@@ -1823,7 +1878,7 @@ void TestSmiShiftLeft(MacroAssembler* masm, Label* exit, int id, int x) {
1823
1878
  __ SmiShiftLeft(r9, rdx, r11);
1824
1879
 
1825
1880
  __ incq(rax);
1826
- __ SmiCompare(r9, r8);
1881
+ __ cmpq(r9, r8);
1827
1882
  __ j(not_equal, exit);
1828
1883
 
1829
1884
  __ incq(rax);
@@ -1832,7 +1887,7 @@ void TestSmiShiftLeft(MacroAssembler* masm, Label* exit, int id, int x) {
1832
1887
  __ SmiShiftLeft(rdx, rdx, r11);
1833
1888
 
1834
1889
  __ incq(rax);
1835
- __ SmiCompare(rdx, r8);
1890
+ __ cmpq(rdx, r8);
1836
1891
  __ j(not_equal, exit);
1837
1892
 
1838
1893
  __ incq(rax);
@@ -1841,6 +1896,7 @@ void TestSmiShiftLeft(MacroAssembler* masm, Label* exit, int id, int x) {
1841
1896
 
1842
1897
 
1843
1898
  TEST(SmiShiftLeft) {
1899
+ v8::internal::V8::Initialize(NULL);
1844
1900
  // Allocate an executable page of memory.
1845
1901
  size_t actual_size;
1846
1902
  byte* buffer =
@@ -1849,7 +1905,9 @@ TEST(SmiShiftLeft) {
1849
1905
  true));
1850
1906
  CHECK(buffer);
1851
1907
  HandleScope handles;
1852
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
1908
+ MacroAssembler assembler(Isolate::Current(),
1909
+ buffer,
1910
+ static_cast<int>(actual_size));
1853
1911
 
1854
1912
  MacroAssembler* masm = &assembler;
1855
1913
  masm->set_allow_stub_calls(false);
@@ -1893,7 +1951,7 @@ void TestSmiShiftLogicalRight(MacroAssembler* masm,
1893
1951
  __ SmiShiftLogicalRightConstant(r9, rcx, shift, exit);
1894
1952
 
1895
1953
  __ incq(rax);
1896
- __ SmiCompare(r9, r8);
1954
+ __ cmpq(r9, r8);
1897
1955
  __ j(not_equal, exit);
1898
1956
 
1899
1957
  __ incq(rax);
@@ -1902,7 +1960,7 @@ void TestSmiShiftLogicalRight(MacroAssembler* masm,
1902
1960
  __ SmiShiftLogicalRight(r9, rdx, rcx, exit);
1903
1961
 
1904
1962
  __ incq(rax);
1905
- __ SmiCompare(r9, r8);
1963
+ __ cmpq(r9, r8);
1906
1964
  __ j(not_equal, exit);
1907
1965
 
1908
1966
  __ incq(rax);
@@ -1911,7 +1969,7 @@ void TestSmiShiftLogicalRight(MacroAssembler* masm,
1911
1969
  __ SmiShiftLogicalRight(r9, rdx, r11, exit);
1912
1970
 
1913
1971
  __ incq(rax);
1914
- __ SmiCompare(r9, r8);
1972
+ __ cmpq(r9, r8);
1915
1973
  __ j(not_equal, exit);
1916
1974
 
1917
1975
  __ incq(rax);
@@ -1925,7 +1983,7 @@ void TestSmiShiftLogicalRight(MacroAssembler* masm,
1925
1983
  __ bind(&fail_ok);
1926
1984
 
1927
1985
  __ incq(rax);
1928
- __ SmiCompare(rcx, r11);
1986
+ __ cmpq(rcx, r11);
1929
1987
  __ j(not_equal, exit);
1930
1988
 
1931
1989
  __ incq(rax);
@@ -1936,7 +1994,7 @@ void TestSmiShiftLogicalRight(MacroAssembler* masm,
1936
1994
  __ bind(&fail_ok3);
1937
1995
 
1938
1996
  __ incq(rax);
1939
- __ SmiCompare(rcx, r11);
1997
+ __ cmpq(rcx, r11);
1940
1998
  __ j(not_equal, exit);
1941
1999
 
1942
2000
  __ addq(rax, Immediate(3));
@@ -1946,6 +2004,7 @@ void TestSmiShiftLogicalRight(MacroAssembler* masm,
1946
2004
 
1947
2005
 
1948
2006
  TEST(SmiShiftLogicalRight) {
2007
+ v8::internal::V8::Initialize(NULL);
1949
2008
  // Allocate an executable page of memory.
1950
2009
  size_t actual_size;
1951
2010
  byte* buffer =
@@ -1954,7 +2013,9 @@ TEST(SmiShiftLogicalRight) {
1954
2013
  true));
1955
2014
  CHECK(buffer);
1956
2015
  HandleScope handles;
1957
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
2016
+ MacroAssembler assembler(Isolate::Current(),
2017
+ buffer,
2018
+ static_cast<int>(actual_size));
1958
2019
 
1959
2020
  MacroAssembler* masm = &assembler;
1960
2021
  masm->set_allow_stub_calls(false);
@@ -1997,7 +2058,7 @@ void TestSmiShiftArithmeticRight(MacroAssembler* masm,
1997
2058
  __ Move(rcx, Smi::FromInt(x));
1998
2059
  __ SmiShiftArithmeticRightConstant(rcx, rcx, shift);
1999
2060
 
2000
- __ SmiCompare(rcx, r8);
2061
+ __ cmpq(rcx, r8);
2001
2062
  __ j(not_equal, exit);
2002
2063
 
2003
2064
  __ incq(rax);
@@ -2005,7 +2066,7 @@ void TestSmiShiftArithmeticRight(MacroAssembler* masm,
2005
2066
  __ Move(r11, Smi::FromInt(shift));
2006
2067
  __ SmiShiftArithmeticRight(rdx, rdx, r11);
2007
2068
 
2008
- __ SmiCompare(rdx, r8);
2069
+ __ cmpq(rdx, r8);
2009
2070
  __ j(not_equal, exit);
2010
2071
 
2011
2072
  __ incq(rax);
@@ -2014,6 +2075,7 @@ void TestSmiShiftArithmeticRight(MacroAssembler* masm,
2014
2075
 
2015
2076
 
2016
2077
  TEST(SmiShiftArithmeticRight) {
2078
+ v8::internal::V8::Initialize(NULL);
2017
2079
  // Allocate an executable page of memory.
2018
2080
  size_t actual_size;
2019
2081
  byte* buffer =
@@ -2022,7 +2084,9 @@ TEST(SmiShiftArithmeticRight) {
2022
2084
  true));
2023
2085
  CHECK(buffer);
2024
2086
  HandleScope handles;
2025
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
2087
+ MacroAssembler assembler(Isolate::Current(),
2088
+ buffer,
2089
+ static_cast<int>(actual_size));
2026
2090
 
2027
2091
  MacroAssembler* masm = &assembler;
2028
2092
  masm->set_allow_stub_calls(false);
@@ -2062,14 +2126,14 @@ void TestPositiveSmiPowerUp(MacroAssembler* masm, Label* exit, int id, int x) {
2062
2126
  __ Move(rcx, Smi::FromInt(x));
2063
2127
  __ movq(r11, rcx);
2064
2128
  __ PositiveSmiTimesPowerOfTwoToInteger64(rdx, rcx, power);
2065
- __ SmiCompare(rdx, r8);
2129
+ __ cmpq(rdx, r8);
2066
2130
  __ j(not_equal, exit);
2067
2131
  __ incq(rax);
2068
- __ SmiCompare(r11, rcx); // rcx unchanged.
2132
+ __ cmpq(r11, rcx); // rcx unchanged.
2069
2133
  __ j(not_equal, exit);
2070
2134
  __ incq(rax);
2071
2135
  __ PositiveSmiTimesPowerOfTwoToInteger64(rcx, rcx, power);
2072
- __ SmiCompare(rdx, r8);
2136
+ __ cmpq(rdx, r8);
2073
2137
  __ j(not_equal, exit);
2074
2138
  __ incq(rax);
2075
2139
  }
@@ -2077,15 +2141,18 @@ void TestPositiveSmiPowerUp(MacroAssembler* masm, Label* exit, int id, int x) {
2077
2141
 
2078
2142
 
2079
2143
  TEST(PositiveSmiTimesPowerOfTwoToInteger64) {
2144
+ v8::internal::V8::Initialize(NULL);
2080
2145
  // Allocate an executable page of memory.
2081
2146
  size_t actual_size;
2082
2147
  byte* buffer =
2083
- static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize * 2,
2148
+ static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize * 4,
2084
2149
  &actual_size,
2085
2150
  true));
2086
2151
  CHECK(buffer);
2087
2152
  HandleScope handles;
2088
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
2153
+ MacroAssembler assembler(Isolate::Current(),
2154
+ buffer,
2155
+ static_cast<int>(actual_size));
2089
2156
 
2090
2157
  MacroAssembler* masm = &assembler;
2091
2158
  masm->set_allow_stub_calls(false);
@@ -2116,6 +2183,7 @@ TEST(PositiveSmiTimesPowerOfTwoToInteger64) {
2116
2183
 
2117
2184
 
2118
2185
  TEST(OperandOffset) {
2186
+ v8::internal::V8::Initialize(NULL);
2119
2187
  int data[256];
2120
2188
  for (int i = 0; i < 256; i++) { data[i] = i * 0x01010101; }
2121
2189
 
@@ -2127,7 +2195,9 @@ TEST(OperandOffset) {
2127
2195
  true));
2128
2196
  CHECK(buffer);
2129
2197
  HandleScope handles;
2130
- MacroAssembler assembler(buffer, static_cast<int>(actual_size));
2198
+ MacroAssembler assembler(Isolate::Current(),
2199
+ buffer,
2200
+ static_cast<int>(actual_size));
2131
2201
 
2132
2202
  MacroAssembler* masm = &assembler;
2133
2203
  masm->set_allow_stub_calls(false);
@@ -2150,7 +2220,7 @@ TEST(OperandOffset) {
2150
2220
  __ push(Immediate(0x108));
2151
2221
  __ push(Immediate(0x109)); // <-- rsp
2152
2222
  // rbp = rsp[9]
2153
- // r12 = rsp[3]
2223
+ // r15 = rsp[3]
2154
2224
  // rbx = rsp[5]
2155
2225
  // r13 = rsp[7]
2156
2226
  __ lea(r14, Operand(rsp, 3 * kPointerSize));