libv8-sgonyea 3.3.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (500) hide show
  1. data/.gitignore +8 -0
  2. data/.gitmodules +3 -0
  3. data/Gemfile +4 -0
  4. data/README.md +76 -0
  5. data/Rakefile +113 -0
  6. data/ext/libv8/extconf.rb +28 -0
  7. data/lib/libv8.rb +15 -0
  8. data/lib/libv8/Makefile +30 -0
  9. data/lib/libv8/detect_cpu.rb +27 -0
  10. data/lib/libv8/fpic-on-linux-amd64.patch +13 -0
  11. data/lib/libv8/v8/.gitignore +35 -0
  12. data/lib/libv8/v8/AUTHORS +44 -0
  13. data/lib/libv8/v8/ChangeLog +2839 -0
  14. data/lib/libv8/v8/LICENSE +52 -0
  15. data/lib/libv8/v8/LICENSE.strongtalk +29 -0
  16. data/lib/libv8/v8/LICENSE.v8 +26 -0
  17. data/lib/libv8/v8/LICENSE.valgrind +45 -0
  18. data/lib/libv8/v8/SConstruct +1478 -0
  19. data/lib/libv8/v8/build/README.txt +49 -0
  20. data/lib/libv8/v8/build/all.gyp +18 -0
  21. data/lib/libv8/v8/build/armu.gypi +32 -0
  22. data/lib/libv8/v8/build/common.gypi +144 -0
  23. data/lib/libv8/v8/build/gyp_v8 +145 -0
  24. data/lib/libv8/v8/include/v8-debug.h +395 -0
  25. data/lib/libv8/v8/include/v8-preparser.h +117 -0
  26. data/lib/libv8/v8/include/v8-profiler.h +505 -0
  27. data/lib/libv8/v8/include/v8-testing.h +104 -0
  28. data/lib/libv8/v8/include/v8.h +4124 -0
  29. data/lib/libv8/v8/include/v8stdint.h +53 -0
  30. data/lib/libv8/v8/preparser/SConscript +38 -0
  31. data/lib/libv8/v8/preparser/preparser-process.cc +379 -0
  32. data/lib/libv8/v8/src/SConscript +368 -0
  33. data/lib/libv8/v8/src/accessors.cc +767 -0
  34. data/lib/libv8/v8/src/accessors.h +123 -0
  35. data/lib/libv8/v8/src/allocation-inl.h +49 -0
  36. data/lib/libv8/v8/src/allocation.cc +122 -0
  37. data/lib/libv8/v8/src/allocation.h +143 -0
  38. data/lib/libv8/v8/src/api.cc +5845 -0
  39. data/lib/libv8/v8/src/api.h +574 -0
  40. data/lib/libv8/v8/src/apinatives.js +110 -0
  41. data/lib/libv8/v8/src/apiutils.h +73 -0
  42. data/lib/libv8/v8/src/arguments.h +118 -0
  43. data/lib/libv8/v8/src/arm/assembler-arm-inl.h +353 -0
  44. data/lib/libv8/v8/src/arm/assembler-arm.cc +2661 -0
  45. data/lib/libv8/v8/src/arm/assembler-arm.h +1375 -0
  46. data/lib/libv8/v8/src/arm/builtins-arm.cc +1658 -0
  47. data/lib/libv8/v8/src/arm/code-stubs-arm.cc +6398 -0
  48. data/lib/libv8/v8/src/arm/code-stubs-arm.h +673 -0
  49. data/lib/libv8/v8/src/arm/codegen-arm.cc +52 -0
  50. data/lib/libv8/v8/src/arm/codegen-arm.h +91 -0
  51. data/lib/libv8/v8/src/arm/constants-arm.cc +152 -0
  52. data/lib/libv8/v8/src/arm/constants-arm.h +775 -0
  53. data/lib/libv8/v8/src/arm/cpu-arm.cc +120 -0
  54. data/lib/libv8/v8/src/arm/debug-arm.cc +317 -0
  55. data/lib/libv8/v8/src/arm/deoptimizer-arm.cc +754 -0
  56. data/lib/libv8/v8/src/arm/disasm-arm.cc +1506 -0
  57. data/lib/libv8/v8/src/arm/frames-arm.cc +45 -0
  58. data/lib/libv8/v8/src/arm/frames-arm.h +168 -0
  59. data/lib/libv8/v8/src/arm/full-codegen-arm.cc +4375 -0
  60. data/lib/libv8/v8/src/arm/ic-arm.cc +1562 -0
  61. data/lib/libv8/v8/src/arm/lithium-arm.cc +2206 -0
  62. data/lib/libv8/v8/src/arm/lithium-arm.h +2348 -0
  63. data/lib/libv8/v8/src/arm/lithium-codegen-arm.cc +4526 -0
  64. data/lib/libv8/v8/src/arm/lithium-codegen-arm.h +403 -0
  65. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.cc +305 -0
  66. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.h +84 -0
  67. data/lib/libv8/v8/src/arm/macro-assembler-arm.cc +3163 -0
  68. data/lib/libv8/v8/src/arm/macro-assembler-arm.h +1126 -0
  69. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.cc +1287 -0
  70. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.h +253 -0
  71. data/lib/libv8/v8/src/arm/simulator-arm.cc +3424 -0
  72. data/lib/libv8/v8/src/arm/simulator-arm.h +431 -0
  73. data/lib/libv8/v8/src/arm/stub-cache-arm.cc +4243 -0
  74. data/lib/libv8/v8/src/array.js +1366 -0
  75. data/lib/libv8/v8/src/assembler.cc +1207 -0
  76. data/lib/libv8/v8/src/assembler.h +858 -0
  77. data/lib/libv8/v8/src/ast-inl.h +112 -0
  78. data/lib/libv8/v8/src/ast.cc +1146 -0
  79. data/lib/libv8/v8/src/ast.h +2188 -0
  80. data/lib/libv8/v8/src/atomicops.h +167 -0
  81. data/lib/libv8/v8/src/atomicops_internals_arm_gcc.h +145 -0
  82. data/lib/libv8/v8/src/atomicops_internals_mips_gcc.h +169 -0
  83. data/lib/libv8/v8/src/atomicops_internals_x86_gcc.cc +133 -0
  84. data/lib/libv8/v8/src/atomicops_internals_x86_gcc.h +287 -0
  85. data/lib/libv8/v8/src/atomicops_internals_x86_macosx.h +301 -0
  86. data/lib/libv8/v8/src/atomicops_internals_x86_msvc.h +203 -0
  87. data/lib/libv8/v8/src/bignum-dtoa.cc +655 -0
  88. data/lib/libv8/v8/src/bignum-dtoa.h +81 -0
  89. data/lib/libv8/v8/src/bignum.cc +768 -0
  90. data/lib/libv8/v8/src/bignum.h +140 -0
  91. data/lib/libv8/v8/src/bootstrapper.cc +2184 -0
  92. data/lib/libv8/v8/src/bootstrapper.h +188 -0
  93. data/lib/libv8/v8/src/builtins.cc +1707 -0
  94. data/lib/libv8/v8/src/builtins.h +371 -0
  95. data/lib/libv8/v8/src/bytecodes-irregexp.h +105 -0
  96. data/lib/libv8/v8/src/cached-powers.cc +177 -0
  97. data/lib/libv8/v8/src/cached-powers.h +65 -0
  98. data/lib/libv8/v8/src/char-predicates-inl.h +94 -0
  99. data/lib/libv8/v8/src/char-predicates.h +67 -0
  100. data/lib/libv8/v8/src/checks.cc +110 -0
  101. data/lib/libv8/v8/src/checks.h +296 -0
  102. data/lib/libv8/v8/src/circular-queue-inl.h +53 -0
  103. data/lib/libv8/v8/src/circular-queue.cc +122 -0
  104. data/lib/libv8/v8/src/circular-queue.h +103 -0
  105. data/lib/libv8/v8/src/code-stubs.cc +267 -0
  106. data/lib/libv8/v8/src/code-stubs.h +1011 -0
  107. data/lib/libv8/v8/src/code.h +70 -0
  108. data/lib/libv8/v8/src/codegen.cc +231 -0
  109. data/lib/libv8/v8/src/codegen.h +84 -0
  110. data/lib/libv8/v8/src/compilation-cache.cc +540 -0
  111. data/lib/libv8/v8/src/compilation-cache.h +287 -0
  112. data/lib/libv8/v8/src/compiler.cc +786 -0
  113. data/lib/libv8/v8/src/compiler.h +312 -0
  114. data/lib/libv8/v8/src/contexts.cc +347 -0
  115. data/lib/libv8/v8/src/contexts.h +391 -0
  116. data/lib/libv8/v8/src/conversions-inl.h +106 -0
  117. data/lib/libv8/v8/src/conversions.cc +1131 -0
  118. data/lib/libv8/v8/src/conversions.h +135 -0
  119. data/lib/libv8/v8/src/counters.cc +93 -0
  120. data/lib/libv8/v8/src/counters.h +254 -0
  121. data/lib/libv8/v8/src/cpu-profiler-inl.h +101 -0
  122. data/lib/libv8/v8/src/cpu-profiler.cc +609 -0
  123. data/lib/libv8/v8/src/cpu-profiler.h +302 -0
  124. data/lib/libv8/v8/src/cpu.h +69 -0
  125. data/lib/libv8/v8/src/d8-debug.cc +367 -0
  126. data/lib/libv8/v8/src/d8-debug.h +158 -0
  127. data/lib/libv8/v8/src/d8-posix.cc +695 -0
  128. data/lib/libv8/v8/src/d8-readline.cc +130 -0
  129. data/lib/libv8/v8/src/d8-windows.cc +42 -0
  130. data/lib/libv8/v8/src/d8.cc +803 -0
  131. data/lib/libv8/v8/src/d8.gyp +91 -0
  132. data/lib/libv8/v8/src/d8.h +235 -0
  133. data/lib/libv8/v8/src/d8.js +2798 -0
  134. data/lib/libv8/v8/src/data-flow.cc +66 -0
  135. data/lib/libv8/v8/src/data-flow.h +205 -0
  136. data/lib/libv8/v8/src/date.js +1103 -0
  137. data/lib/libv8/v8/src/dateparser-inl.h +127 -0
  138. data/lib/libv8/v8/src/dateparser.cc +178 -0
  139. data/lib/libv8/v8/src/dateparser.h +266 -0
  140. data/lib/libv8/v8/src/debug-agent.cc +447 -0
  141. data/lib/libv8/v8/src/debug-agent.h +129 -0
  142. data/lib/libv8/v8/src/debug-debugger.js +2569 -0
  143. data/lib/libv8/v8/src/debug.cc +3165 -0
  144. data/lib/libv8/v8/src/debug.h +1057 -0
  145. data/lib/libv8/v8/src/deoptimizer.cc +1256 -0
  146. data/lib/libv8/v8/src/deoptimizer.h +602 -0
  147. data/lib/libv8/v8/src/disasm.h +80 -0
  148. data/lib/libv8/v8/src/disassembler.cc +343 -0
  149. data/lib/libv8/v8/src/disassembler.h +58 -0
  150. data/lib/libv8/v8/src/diy-fp.cc +58 -0
  151. data/lib/libv8/v8/src/diy-fp.h +117 -0
  152. data/lib/libv8/v8/src/double.h +238 -0
  153. data/lib/libv8/v8/src/dtoa.cc +103 -0
  154. data/lib/libv8/v8/src/dtoa.h +85 -0
  155. data/lib/libv8/v8/src/execution.cc +849 -0
  156. data/lib/libv8/v8/src/execution.h +297 -0
  157. data/lib/libv8/v8/src/extensions/experimental/break-iterator.cc +250 -0
  158. data/lib/libv8/v8/src/extensions/experimental/break-iterator.h +89 -0
  159. data/lib/libv8/v8/src/extensions/experimental/collator.cc +218 -0
  160. data/lib/libv8/v8/src/extensions/experimental/collator.h +69 -0
  161. data/lib/libv8/v8/src/extensions/experimental/experimental.gyp +94 -0
  162. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.cc +78 -0
  163. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.h +54 -0
  164. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.cc +112 -0
  165. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.h +60 -0
  166. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.cc +43 -0
  167. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.h +49 -0
  168. data/lib/libv8/v8/src/extensions/experimental/i18n.js +180 -0
  169. data/lib/libv8/v8/src/extensions/experimental/language-matcher.cc +251 -0
  170. data/lib/libv8/v8/src/extensions/experimental/language-matcher.h +95 -0
  171. data/lib/libv8/v8/src/extensions/externalize-string-extension.cc +141 -0
  172. data/lib/libv8/v8/src/extensions/externalize-string-extension.h +50 -0
  173. data/lib/libv8/v8/src/extensions/gc-extension.cc +58 -0
  174. data/lib/libv8/v8/src/extensions/gc-extension.h +49 -0
  175. data/lib/libv8/v8/src/factory.cc +1222 -0
  176. data/lib/libv8/v8/src/factory.h +442 -0
  177. data/lib/libv8/v8/src/fast-dtoa.cc +736 -0
  178. data/lib/libv8/v8/src/fast-dtoa.h +83 -0
  179. data/lib/libv8/v8/src/fixed-dtoa.cc +405 -0
  180. data/lib/libv8/v8/src/fixed-dtoa.h +55 -0
  181. data/lib/libv8/v8/src/flag-definitions.h +560 -0
  182. data/lib/libv8/v8/src/flags.cc +551 -0
  183. data/lib/libv8/v8/src/flags.h +79 -0
  184. data/lib/libv8/v8/src/frames-inl.h +247 -0
  185. data/lib/libv8/v8/src/frames.cc +1243 -0
  186. data/lib/libv8/v8/src/frames.h +870 -0
  187. data/lib/libv8/v8/src/full-codegen.cc +1374 -0
  188. data/lib/libv8/v8/src/full-codegen.h +771 -0
  189. data/lib/libv8/v8/src/func-name-inferrer.cc +92 -0
  190. data/lib/libv8/v8/src/func-name-inferrer.h +111 -0
  191. data/lib/libv8/v8/src/gdb-jit.cc +1555 -0
  192. data/lib/libv8/v8/src/gdb-jit.h +143 -0
  193. data/lib/libv8/v8/src/global-handles.cc +665 -0
  194. data/lib/libv8/v8/src/global-handles.h +284 -0
  195. data/lib/libv8/v8/src/globals.h +325 -0
  196. data/lib/libv8/v8/src/handles-inl.h +177 -0
  197. data/lib/libv8/v8/src/handles.cc +987 -0
  198. data/lib/libv8/v8/src/handles.h +382 -0
  199. data/lib/libv8/v8/src/hashmap.cc +230 -0
  200. data/lib/libv8/v8/src/hashmap.h +123 -0
  201. data/lib/libv8/v8/src/heap-inl.h +704 -0
  202. data/lib/libv8/v8/src/heap-profiler.cc +1173 -0
  203. data/lib/libv8/v8/src/heap-profiler.h +397 -0
  204. data/lib/libv8/v8/src/heap.cc +5930 -0
  205. data/lib/libv8/v8/src/heap.h +2268 -0
  206. data/lib/libv8/v8/src/hydrogen-instructions.cc +1769 -0
  207. data/lib/libv8/v8/src/hydrogen-instructions.h +3971 -0
  208. data/lib/libv8/v8/src/hydrogen.cc +6239 -0
  209. data/lib/libv8/v8/src/hydrogen.h +1202 -0
  210. data/lib/libv8/v8/src/ia32/assembler-ia32-inl.h +446 -0
  211. data/lib/libv8/v8/src/ia32/assembler-ia32.cc +2487 -0
  212. data/lib/libv8/v8/src/ia32/assembler-ia32.h +1144 -0
  213. data/lib/libv8/v8/src/ia32/builtins-ia32.cc +1621 -0
  214. data/lib/libv8/v8/src/ia32/code-stubs-ia32.cc +6198 -0
  215. data/lib/libv8/v8/src/ia32/code-stubs-ia32.h +517 -0
  216. data/lib/libv8/v8/src/ia32/codegen-ia32.cc +265 -0
  217. data/lib/libv8/v8/src/ia32/codegen-ia32.h +79 -0
  218. data/lib/libv8/v8/src/ia32/cpu-ia32.cc +88 -0
  219. data/lib/libv8/v8/src/ia32/debug-ia32.cc +312 -0
  220. data/lib/libv8/v8/src/ia32/deoptimizer-ia32.cc +774 -0
  221. data/lib/libv8/v8/src/ia32/disasm-ia32.cc +1628 -0
  222. data/lib/libv8/v8/src/ia32/frames-ia32.cc +45 -0
  223. data/lib/libv8/v8/src/ia32/frames-ia32.h +142 -0
  224. data/lib/libv8/v8/src/ia32/full-codegen-ia32.cc +4338 -0
  225. data/lib/libv8/v8/src/ia32/ic-ia32.cc +1597 -0
  226. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.cc +4461 -0
  227. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.h +375 -0
  228. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.cc +475 -0
  229. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
  230. data/lib/libv8/v8/src/ia32/lithium-ia32.cc +2261 -0
  231. data/lib/libv8/v8/src/ia32/lithium-ia32.h +2396 -0
  232. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.cc +2136 -0
  233. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.h +775 -0
  234. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.cc +1263 -0
  235. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.h +216 -0
  236. data/lib/libv8/v8/src/ia32/simulator-ia32.cc +30 -0
  237. data/lib/libv8/v8/src/ia32/simulator-ia32.h +74 -0
  238. data/lib/libv8/v8/src/ia32/stub-cache-ia32.cc +3847 -0
  239. data/lib/libv8/v8/src/ic-inl.h +130 -0
  240. data/lib/libv8/v8/src/ic.cc +2577 -0
  241. data/lib/libv8/v8/src/ic.h +736 -0
  242. data/lib/libv8/v8/src/inspector.cc +63 -0
  243. data/lib/libv8/v8/src/inspector.h +62 -0
  244. data/lib/libv8/v8/src/interpreter-irregexp.cc +659 -0
  245. data/lib/libv8/v8/src/interpreter-irregexp.h +49 -0
  246. data/lib/libv8/v8/src/isolate-inl.h +50 -0
  247. data/lib/libv8/v8/src/isolate.cc +1869 -0
  248. data/lib/libv8/v8/src/isolate.h +1382 -0
  249. data/lib/libv8/v8/src/json-parser.cc +504 -0
  250. data/lib/libv8/v8/src/json-parser.h +161 -0
  251. data/lib/libv8/v8/src/json.js +342 -0
  252. data/lib/libv8/v8/src/jsregexp.cc +5385 -0
  253. data/lib/libv8/v8/src/jsregexp.h +1492 -0
  254. data/lib/libv8/v8/src/list-inl.h +212 -0
  255. data/lib/libv8/v8/src/list.h +174 -0
  256. data/lib/libv8/v8/src/lithium-allocator-inl.h +142 -0
  257. data/lib/libv8/v8/src/lithium-allocator.cc +2123 -0
  258. data/lib/libv8/v8/src/lithium-allocator.h +630 -0
  259. data/lib/libv8/v8/src/lithium.cc +190 -0
  260. data/lib/libv8/v8/src/lithium.h +597 -0
  261. data/lib/libv8/v8/src/liveedit-debugger.js +1082 -0
  262. data/lib/libv8/v8/src/liveedit.cc +1691 -0
  263. data/lib/libv8/v8/src/liveedit.h +180 -0
  264. data/lib/libv8/v8/src/liveobjectlist-inl.h +126 -0
  265. data/lib/libv8/v8/src/liveobjectlist.cc +2589 -0
  266. data/lib/libv8/v8/src/liveobjectlist.h +322 -0
  267. data/lib/libv8/v8/src/log-inl.h +59 -0
  268. data/lib/libv8/v8/src/log-utils.cc +428 -0
  269. data/lib/libv8/v8/src/log-utils.h +231 -0
  270. data/lib/libv8/v8/src/log.cc +1993 -0
  271. data/lib/libv8/v8/src/log.h +476 -0
  272. data/lib/libv8/v8/src/macro-assembler.h +120 -0
  273. data/lib/libv8/v8/src/macros.py +178 -0
  274. data/lib/libv8/v8/src/mark-compact.cc +3143 -0
  275. data/lib/libv8/v8/src/mark-compact.h +506 -0
  276. data/lib/libv8/v8/src/math.js +264 -0
  277. data/lib/libv8/v8/src/messages.cc +179 -0
  278. data/lib/libv8/v8/src/messages.h +113 -0
  279. data/lib/libv8/v8/src/messages.js +1096 -0
  280. data/lib/libv8/v8/src/mips/assembler-mips-inl.h +312 -0
  281. data/lib/libv8/v8/src/mips/assembler-mips.cc +1960 -0
  282. data/lib/libv8/v8/src/mips/assembler-mips.h +1138 -0
  283. data/lib/libv8/v8/src/mips/builtins-mips.cc +1628 -0
  284. data/lib/libv8/v8/src/mips/code-stubs-mips.cc +6656 -0
  285. data/lib/libv8/v8/src/mips/code-stubs-mips.h +682 -0
  286. data/lib/libv8/v8/src/mips/codegen-mips.cc +52 -0
  287. data/lib/libv8/v8/src/mips/codegen-mips.h +98 -0
  288. data/lib/libv8/v8/src/mips/constants-mips.cc +352 -0
  289. data/lib/libv8/v8/src/mips/constants-mips.h +739 -0
  290. data/lib/libv8/v8/src/mips/cpu-mips.cc +96 -0
  291. data/lib/libv8/v8/src/mips/debug-mips.cc +308 -0
  292. data/lib/libv8/v8/src/mips/deoptimizer-mips.cc +91 -0
  293. data/lib/libv8/v8/src/mips/disasm-mips.cc +1050 -0
  294. data/lib/libv8/v8/src/mips/frames-mips.cc +47 -0
  295. data/lib/libv8/v8/src/mips/frames-mips.h +219 -0
  296. data/lib/libv8/v8/src/mips/full-codegen-mips.cc +4388 -0
  297. data/lib/libv8/v8/src/mips/ic-mips.cc +1580 -0
  298. data/lib/libv8/v8/src/mips/lithium-codegen-mips.h +65 -0
  299. data/lib/libv8/v8/src/mips/lithium-mips.h +307 -0
  300. data/lib/libv8/v8/src/mips/macro-assembler-mips.cc +4056 -0
  301. data/lib/libv8/v8/src/mips/macro-assembler-mips.h +1214 -0
  302. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.cc +1251 -0
  303. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.h +252 -0
  304. data/lib/libv8/v8/src/mips/simulator-mips.cc +2621 -0
  305. data/lib/libv8/v8/src/mips/simulator-mips.h +401 -0
  306. data/lib/libv8/v8/src/mips/stub-cache-mips.cc +4285 -0
  307. data/lib/libv8/v8/src/mirror-debugger.js +2382 -0
  308. data/lib/libv8/v8/src/mksnapshot.cc +328 -0
  309. data/lib/libv8/v8/src/natives.h +64 -0
  310. data/lib/libv8/v8/src/objects-debug.cc +738 -0
  311. data/lib/libv8/v8/src/objects-inl.h +4323 -0
  312. data/lib/libv8/v8/src/objects-printer.cc +829 -0
  313. data/lib/libv8/v8/src/objects-visiting.cc +148 -0
  314. data/lib/libv8/v8/src/objects-visiting.h +424 -0
  315. data/lib/libv8/v8/src/objects.cc +10585 -0
  316. data/lib/libv8/v8/src/objects.h +6838 -0
  317. data/lib/libv8/v8/src/parser.cc +4997 -0
  318. data/lib/libv8/v8/src/parser.h +765 -0
  319. data/lib/libv8/v8/src/platform-cygwin.cc +779 -0
  320. data/lib/libv8/v8/src/platform-freebsd.cc +826 -0
  321. data/lib/libv8/v8/src/platform-linux.cc +1149 -0
  322. data/lib/libv8/v8/src/platform-macos.cc +830 -0
  323. data/lib/libv8/v8/src/platform-nullos.cc +479 -0
  324. data/lib/libv8/v8/src/platform-openbsd.cc +640 -0
  325. data/lib/libv8/v8/src/platform-posix.cc +424 -0
  326. data/lib/libv8/v8/src/platform-solaris.cc +762 -0
  327. data/lib/libv8/v8/src/platform-tls-mac.h +62 -0
  328. data/lib/libv8/v8/src/platform-tls-win32.h +62 -0
  329. data/lib/libv8/v8/src/platform-tls.h +50 -0
  330. data/lib/libv8/v8/src/platform-win32.cc +2021 -0
  331. data/lib/libv8/v8/src/platform.h +667 -0
  332. data/lib/libv8/v8/src/preparse-data-format.h +62 -0
  333. data/lib/libv8/v8/src/preparse-data.cc +183 -0
  334. data/lib/libv8/v8/src/preparse-data.h +225 -0
  335. data/lib/libv8/v8/src/preparser-api.cc +220 -0
  336. data/lib/libv8/v8/src/preparser.cc +1450 -0
  337. data/lib/libv8/v8/src/preparser.h +493 -0
  338. data/lib/libv8/v8/src/prettyprinter.cc +1493 -0
  339. data/lib/libv8/v8/src/prettyprinter.h +223 -0
  340. data/lib/libv8/v8/src/profile-generator-inl.h +128 -0
  341. data/lib/libv8/v8/src/profile-generator.cc +3098 -0
  342. data/lib/libv8/v8/src/profile-generator.h +1126 -0
  343. data/lib/libv8/v8/src/property.cc +105 -0
  344. data/lib/libv8/v8/src/property.h +365 -0
  345. data/lib/libv8/v8/src/proxy.js +83 -0
  346. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp-inl.h +78 -0
  347. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.cc +471 -0
  348. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.h +142 -0
  349. data/lib/libv8/v8/src/regexp-macro-assembler-tracer.cc +373 -0
  350. data/lib/libv8/v8/src/regexp-macro-assembler-tracer.h +104 -0
  351. data/lib/libv8/v8/src/regexp-macro-assembler.cc +267 -0
  352. data/lib/libv8/v8/src/regexp-macro-assembler.h +243 -0
  353. data/lib/libv8/v8/src/regexp-stack.cc +111 -0
  354. data/lib/libv8/v8/src/regexp-stack.h +147 -0
  355. data/lib/libv8/v8/src/regexp.js +483 -0
  356. data/lib/libv8/v8/src/rewriter.cc +360 -0
  357. data/lib/libv8/v8/src/rewriter.h +50 -0
  358. data/lib/libv8/v8/src/runtime-profiler.cc +489 -0
  359. data/lib/libv8/v8/src/runtime-profiler.h +201 -0
  360. data/lib/libv8/v8/src/runtime.cc +12227 -0
  361. data/lib/libv8/v8/src/runtime.h +652 -0
  362. data/lib/libv8/v8/src/runtime.js +649 -0
  363. data/lib/libv8/v8/src/safepoint-table.cc +256 -0
  364. data/lib/libv8/v8/src/safepoint-table.h +270 -0
  365. data/lib/libv8/v8/src/scanner-base.cc +952 -0
  366. data/lib/libv8/v8/src/scanner-base.h +670 -0
  367. data/lib/libv8/v8/src/scanner.cc +345 -0
  368. data/lib/libv8/v8/src/scanner.h +146 -0
  369. data/lib/libv8/v8/src/scopeinfo.cc +646 -0
  370. data/lib/libv8/v8/src/scopeinfo.h +254 -0
  371. data/lib/libv8/v8/src/scopes.cc +1150 -0
  372. data/lib/libv8/v8/src/scopes.h +507 -0
  373. data/lib/libv8/v8/src/serialize.cc +1574 -0
  374. data/lib/libv8/v8/src/serialize.h +589 -0
  375. data/lib/libv8/v8/src/shell.h +55 -0
  376. data/lib/libv8/v8/src/simulator.h +43 -0
  377. data/lib/libv8/v8/src/small-pointer-list.h +163 -0
  378. data/lib/libv8/v8/src/smart-pointer.h +109 -0
  379. data/lib/libv8/v8/src/snapshot-common.cc +83 -0
  380. data/lib/libv8/v8/src/snapshot-empty.cc +54 -0
  381. data/lib/libv8/v8/src/snapshot.h +91 -0
  382. data/lib/libv8/v8/src/spaces-inl.h +529 -0
  383. data/lib/libv8/v8/src/spaces.cc +3145 -0
  384. data/lib/libv8/v8/src/spaces.h +2369 -0
  385. data/lib/libv8/v8/src/splay-tree-inl.h +310 -0
  386. data/lib/libv8/v8/src/splay-tree.h +205 -0
  387. data/lib/libv8/v8/src/string-search.cc +41 -0
  388. data/lib/libv8/v8/src/string-search.h +568 -0
  389. data/lib/libv8/v8/src/string-stream.cc +592 -0
  390. data/lib/libv8/v8/src/string-stream.h +191 -0
  391. data/lib/libv8/v8/src/string.js +994 -0
  392. data/lib/libv8/v8/src/strtod.cc +440 -0
  393. data/lib/libv8/v8/src/strtod.h +40 -0
  394. data/lib/libv8/v8/src/stub-cache.cc +1965 -0
  395. data/lib/libv8/v8/src/stub-cache.h +924 -0
  396. data/lib/libv8/v8/src/third_party/valgrind/valgrind.h +3925 -0
  397. data/lib/libv8/v8/src/token.cc +63 -0
  398. data/lib/libv8/v8/src/token.h +288 -0
  399. data/lib/libv8/v8/src/type-info.cc +507 -0
  400. data/lib/libv8/v8/src/type-info.h +272 -0
  401. data/lib/libv8/v8/src/unbound-queue-inl.h +95 -0
  402. data/lib/libv8/v8/src/unbound-queue.h +69 -0
  403. data/lib/libv8/v8/src/unicode-inl.h +238 -0
  404. data/lib/libv8/v8/src/unicode.cc +1624 -0
  405. data/lib/libv8/v8/src/unicode.h +280 -0
  406. data/lib/libv8/v8/src/uri.js +408 -0
  407. data/lib/libv8/v8/src/utils-inl.h +48 -0
  408. data/lib/libv8/v8/src/utils.cc +371 -0
  409. data/lib/libv8/v8/src/utils.h +800 -0
  410. data/lib/libv8/v8/src/v8-counters.cc +62 -0
  411. data/lib/libv8/v8/src/v8-counters.h +314 -0
  412. data/lib/libv8/v8/src/v8.cc +213 -0
  413. data/lib/libv8/v8/src/v8.h +131 -0
  414. data/lib/libv8/v8/src/v8checks.h +64 -0
  415. data/lib/libv8/v8/src/v8dll-main.cc +44 -0
  416. data/lib/libv8/v8/src/v8globals.h +512 -0
  417. data/lib/libv8/v8/src/v8memory.h +82 -0
  418. data/lib/libv8/v8/src/v8natives.js +1310 -0
  419. data/lib/libv8/v8/src/v8preparserdll-main.cc +39 -0
  420. data/lib/libv8/v8/src/v8threads.cc +464 -0
  421. data/lib/libv8/v8/src/v8threads.h +165 -0
  422. data/lib/libv8/v8/src/v8utils.h +319 -0
  423. data/lib/libv8/v8/src/variables.cc +114 -0
  424. data/lib/libv8/v8/src/variables.h +167 -0
  425. data/lib/libv8/v8/src/version.cc +116 -0
  426. data/lib/libv8/v8/src/version.h +68 -0
  427. data/lib/libv8/v8/src/vm-state-inl.h +138 -0
  428. data/lib/libv8/v8/src/vm-state.h +71 -0
  429. data/lib/libv8/v8/src/win32-headers.h +96 -0
  430. data/lib/libv8/v8/src/x64/assembler-x64-inl.h +462 -0
  431. data/lib/libv8/v8/src/x64/assembler-x64.cc +3027 -0
  432. data/lib/libv8/v8/src/x64/assembler-x64.h +1633 -0
  433. data/lib/libv8/v8/src/x64/builtins-x64.cc +1520 -0
  434. data/lib/libv8/v8/src/x64/code-stubs-x64.cc +5132 -0
  435. data/lib/libv8/v8/src/x64/code-stubs-x64.h +514 -0
  436. data/lib/libv8/v8/src/x64/codegen-x64.cc +146 -0
  437. data/lib/libv8/v8/src/x64/codegen-x64.h +76 -0
  438. data/lib/libv8/v8/src/x64/cpu-x64.cc +88 -0
  439. data/lib/libv8/v8/src/x64/debug-x64.cc +319 -0
  440. data/lib/libv8/v8/src/x64/deoptimizer-x64.cc +815 -0
  441. data/lib/libv8/v8/src/x64/disasm-x64.cc +1832 -0
  442. data/lib/libv8/v8/src/x64/frames-x64.cc +45 -0
  443. data/lib/libv8/v8/src/x64/frames-x64.h +130 -0
  444. data/lib/libv8/v8/src/x64/full-codegen-x64.cc +4318 -0
  445. data/lib/libv8/v8/src/x64/ic-x64.cc +1608 -0
  446. data/lib/libv8/v8/src/x64/lithium-codegen-x64.cc +4267 -0
  447. data/lib/libv8/v8/src/x64/lithium-codegen-x64.h +367 -0
  448. data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.cc +320 -0
  449. data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.h +74 -0
  450. data/lib/libv8/v8/src/x64/lithium-x64.cc +2202 -0
  451. data/lib/libv8/v8/src/x64/lithium-x64.h +2333 -0
  452. data/lib/libv8/v8/src/x64/macro-assembler-x64.cc +3745 -0
  453. data/lib/libv8/v8/src/x64/macro-assembler-x64.h +1290 -0
  454. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.cc +1398 -0
  455. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.h +282 -0
  456. data/lib/libv8/v8/src/x64/simulator-x64.cc +27 -0
  457. data/lib/libv8/v8/src/x64/simulator-x64.h +72 -0
  458. data/lib/libv8/v8/src/x64/stub-cache-x64.cc +3610 -0
  459. data/lib/libv8/v8/src/zone-inl.h +140 -0
  460. data/lib/libv8/v8/src/zone.cc +196 -0
  461. data/lib/libv8/v8/src/zone.h +240 -0
  462. data/lib/libv8/v8/tools/codemap.js +265 -0
  463. data/lib/libv8/v8/tools/consarray.js +93 -0
  464. data/lib/libv8/v8/tools/csvparser.js +78 -0
  465. data/lib/libv8/v8/tools/disasm.py +92 -0
  466. data/lib/libv8/v8/tools/freebsd-tick-processor +10 -0
  467. data/lib/libv8/v8/tools/gc-nvp-trace-processor.py +342 -0
  468. data/lib/libv8/v8/tools/gcmole/README +62 -0
  469. data/lib/libv8/v8/tools/gcmole/gccause.lua +60 -0
  470. data/lib/libv8/v8/tools/gcmole/gcmole.cc +1261 -0
  471. data/lib/libv8/v8/tools/gcmole/gcmole.lua +378 -0
  472. data/lib/libv8/v8/tools/generate-ten-powers.scm +286 -0
  473. data/lib/libv8/v8/tools/grokdump.py +841 -0
  474. data/lib/libv8/v8/tools/gyp/v8.gyp +995 -0
  475. data/lib/libv8/v8/tools/js2c.py +364 -0
  476. data/lib/libv8/v8/tools/jsmin.py +280 -0
  477. data/lib/libv8/v8/tools/linux-tick-processor +35 -0
  478. data/lib/libv8/v8/tools/ll_prof.py +942 -0
  479. data/lib/libv8/v8/tools/logreader.js +185 -0
  480. data/lib/libv8/v8/tools/mac-nm +18 -0
  481. data/lib/libv8/v8/tools/mac-tick-processor +6 -0
  482. data/lib/libv8/v8/tools/oom_dump/README +31 -0
  483. data/lib/libv8/v8/tools/oom_dump/SConstruct +42 -0
  484. data/lib/libv8/v8/tools/oom_dump/oom_dump.cc +288 -0
  485. data/lib/libv8/v8/tools/presubmit.py +305 -0
  486. data/lib/libv8/v8/tools/process-heap-prof.py +120 -0
  487. data/lib/libv8/v8/tools/profile.js +751 -0
  488. data/lib/libv8/v8/tools/profile_view.js +219 -0
  489. data/lib/libv8/v8/tools/run-valgrind.py +77 -0
  490. data/lib/libv8/v8/tools/splaytree.js +316 -0
  491. data/lib/libv8/v8/tools/stats-viewer.py +468 -0
  492. data/lib/libv8/v8/tools/test.py +1510 -0
  493. data/lib/libv8/v8/tools/tickprocessor-driver.js +59 -0
  494. data/lib/libv8/v8/tools/tickprocessor.js +877 -0
  495. data/lib/libv8/v8/tools/utils.py +96 -0
  496. data/lib/libv8/v8/tools/visual_studio/README.txt +12 -0
  497. data/lib/libv8/v8/tools/windows-tick-processor.bat +30 -0
  498. data/lib/libv8/version.rb +5 -0
  499. data/libv8.gemspec +36 -0
  500. metadata +578 -0
@@ -0,0 +1,2396 @@
1
+ // Copyright 2011 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #ifndef V8_IA32_LITHIUM_IA32_H_
29
+ #define V8_IA32_LITHIUM_IA32_H_
30
+
31
+ #include "hydrogen.h"
32
+ #include "lithium-allocator.h"
33
+ #include "lithium.h"
34
+ #include "safepoint-table.h"
35
+
36
+ namespace v8 {
37
+ namespace internal {
38
+
39
+ // Forward declarations.
40
+ class LCodeGen;
41
+
42
+ #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \
43
+ V(AccessArgumentsAt) \
44
+ V(AddI) \
45
+ V(ApplyArguments) \
46
+ V(ArgumentsElements) \
47
+ V(ArgumentsLength) \
48
+ V(ArithmeticD) \
49
+ V(ArithmeticT) \
50
+ V(ArrayLiteral) \
51
+ V(BitI) \
52
+ V(BitNotI) \
53
+ V(BoundsCheck) \
54
+ V(Branch) \
55
+ V(CallConstantFunction) \
56
+ V(CallFunction) \
57
+ V(CallGlobal) \
58
+ V(CallKeyed) \
59
+ V(CallKnownGlobal) \
60
+ V(CallNamed) \
61
+ V(CallNew) \
62
+ V(CallRuntime) \
63
+ V(CallStub) \
64
+ V(CheckFunction) \
65
+ V(CheckInstanceType) \
66
+ V(CheckMap) \
67
+ V(CheckNonSmi) \
68
+ V(CheckPrototypeMaps) \
69
+ V(CheckSmi) \
70
+ V(ClampDToUint8) \
71
+ V(ClampIToUint8) \
72
+ V(ClampTToUint8) \
73
+ V(ClassOfTest) \
74
+ V(ClassOfTestAndBranch) \
75
+ V(CmpID) \
76
+ V(CmpIDAndBranch) \
77
+ V(CmpJSObjectEq) \
78
+ V(CmpJSObjectEqAndBranch) \
79
+ V(CmpSymbolEq) \
80
+ V(CmpSymbolEqAndBranch) \
81
+ V(CmpMapAndBranch) \
82
+ V(CmpT) \
83
+ V(CmpTAndBranch) \
84
+ V(ConstantD) \
85
+ V(ConstantI) \
86
+ V(ConstantT) \
87
+ V(Context) \
88
+ V(DeleteProperty) \
89
+ V(Deoptimize) \
90
+ V(DivI) \
91
+ V(DoubleToI) \
92
+ V(ExternalArrayLength) \
93
+ V(FixedArrayLength) \
94
+ V(FunctionLiteral) \
95
+ V(GetCachedArrayIndex) \
96
+ V(GlobalObject) \
97
+ V(GlobalReceiver) \
98
+ V(Goto) \
99
+ V(HasCachedArrayIndex) \
100
+ V(HasCachedArrayIndexAndBranch) \
101
+ V(HasInstanceType) \
102
+ V(HasInstanceTypeAndBranch) \
103
+ V(In) \
104
+ V(InstanceOf) \
105
+ V(InstanceOfAndBranch) \
106
+ V(InstanceOfKnownGlobal) \
107
+ V(InstructionGap) \
108
+ V(Integer32ToDouble) \
109
+ V(InvokeFunction) \
110
+ V(IsConstructCall) \
111
+ V(IsConstructCallAndBranch) \
112
+ V(IsNull) \
113
+ V(IsNullAndBranch) \
114
+ V(IsObject) \
115
+ V(IsObjectAndBranch) \
116
+ V(IsSmi) \
117
+ V(IsSmiAndBranch) \
118
+ V(IsUndetectable) \
119
+ V(IsUndetectableAndBranch) \
120
+ V(JSArrayLength) \
121
+ V(Label) \
122
+ V(LazyBailout) \
123
+ V(LoadContextSlot) \
124
+ V(LoadElements) \
125
+ V(LoadExternalArrayPointer) \
126
+ V(LoadFunctionPrototype) \
127
+ V(LoadGlobalCell) \
128
+ V(LoadGlobalGeneric) \
129
+ V(LoadKeyedFastElement) \
130
+ V(LoadKeyedGeneric) \
131
+ V(LoadKeyedSpecializedArrayElement) \
132
+ V(LoadNamedField) \
133
+ V(LoadNamedFieldPolymorphic) \
134
+ V(LoadNamedGeneric) \
135
+ V(ModI) \
136
+ V(MulI) \
137
+ V(NumberTagD) \
138
+ V(NumberTagI) \
139
+ V(NumberUntagD) \
140
+ V(ObjectLiteral) \
141
+ V(OsrEntry) \
142
+ V(OuterContext) \
143
+ V(Parameter) \
144
+ V(Power) \
145
+ V(PushArgument) \
146
+ V(RegExpLiteral) \
147
+ V(Return) \
148
+ V(ShiftI) \
149
+ V(SmiTag) \
150
+ V(SmiUntag) \
151
+ V(StackCheck) \
152
+ V(StoreContextSlot) \
153
+ V(StoreGlobalCell) \
154
+ V(StoreGlobalGeneric) \
155
+ V(StoreKeyedFastElement) \
156
+ V(StoreKeyedGeneric) \
157
+ V(StoreKeyedSpecializedArrayElement) \
158
+ V(StoreNamedField) \
159
+ V(StoreNamedGeneric) \
160
+ V(StringAdd) \
161
+ V(StringCharCodeAt) \
162
+ V(StringCharFromCode) \
163
+ V(StringLength) \
164
+ V(SubI) \
165
+ V(TaggedToI) \
166
+ V(Throw) \
167
+ V(ToFastProperties) \
168
+ V(Typeof) \
169
+ V(TypeofIs) \
170
+ V(TypeofIsAndBranch) \
171
+ V(UnaryMathOperation) \
172
+ V(UnknownOSRValue) \
173
+ V(ValueOf)
174
+
175
+
176
+ #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
177
+ virtual Opcode opcode() const { return LInstruction::k##type; } \
178
+ virtual void CompileToNative(LCodeGen* generator); \
179
+ virtual const char* Mnemonic() const { return mnemonic; } \
180
+ static L##type* cast(LInstruction* instr) { \
181
+ ASSERT(instr->Is##type()); \
182
+ return reinterpret_cast<L##type*>(instr); \
183
+ }
184
+
185
+
186
+ #define DECLARE_HYDROGEN_ACCESSOR(type) \
187
+ H##type* hydrogen() const { \
188
+ return H##type::cast(hydrogen_value()); \
189
+ }
190
+
191
+
192
+ class LInstruction: public ZoneObject {
193
+ public:
194
+ LInstruction()
195
+ : environment_(NULL),
196
+ hydrogen_value_(NULL),
197
+ is_call_(false),
198
+ is_save_doubles_(false) { }
199
+ virtual ~LInstruction() { }
200
+
201
+ virtual void CompileToNative(LCodeGen* generator) = 0;
202
+ virtual const char* Mnemonic() const = 0;
203
+ virtual void PrintTo(StringStream* stream);
204
+ virtual void PrintDataTo(StringStream* stream) = 0;
205
+ virtual void PrintOutputOperandTo(StringStream* stream) = 0;
206
+
207
+ enum Opcode {
208
+ // Declare a unique enum value for each instruction.
209
+ #define DECLARE_OPCODE(type) k##type,
210
+ LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE)
211
+ kNumberOfInstructions
212
+ #undef DECLARE_OPCODE
213
+ };
214
+
215
+ virtual Opcode opcode() const = 0;
216
+
217
+ // Declare non-virtual type testers for all leaf IR classes.
218
+ #define DECLARE_PREDICATE(type) \
219
+ bool Is##type() const { return opcode() == k##type; }
220
+ LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE)
221
+ #undef DECLARE_PREDICATE
222
+
223
+ // Declare virtual predicates for instructions that don't have
224
+ // an opcode.
225
+ virtual bool IsGap() const { return false; }
226
+
227
+ virtual bool IsControl() const { return false; }
228
+ virtual void SetBranchTargets(int true_block_id, int false_block_id) { }
229
+
230
+ void set_environment(LEnvironment* env) { environment_ = env; }
231
+ LEnvironment* environment() const { return environment_; }
232
+ bool HasEnvironment() const { return environment_ != NULL; }
233
+
234
+ void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
235
+ LPointerMap* pointer_map() const { return pointer_map_.get(); }
236
+ bool HasPointerMap() const { return pointer_map_.is_set(); }
237
+
238
+
239
+ void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
240
+ HValue* hydrogen_value() const { return hydrogen_value_; }
241
+
242
+ void set_deoptimization_environment(LEnvironment* env) {
243
+ deoptimization_environment_.set(env);
244
+ }
245
+ LEnvironment* deoptimization_environment() const {
246
+ return deoptimization_environment_.get();
247
+ }
248
+ bool HasDeoptimizationEnvironment() const {
249
+ return deoptimization_environment_.is_set();
250
+ }
251
+
252
+ void MarkAsCall() { is_call_ = true; }
253
+ void MarkAsSaveDoubles() { is_save_doubles_ = true; }
254
+
255
+ // Interface to the register allocator and iterators.
256
+ bool IsMarkedAsCall() const { return is_call_; }
257
+ bool IsMarkedAsSaveDoubles() const { return is_save_doubles_; }
258
+
259
+ virtual bool HasResult() const = 0;
260
+ virtual LOperand* result() = 0;
261
+
262
+ virtual int InputCount() = 0;
263
+ virtual LOperand* InputAt(int i) = 0;
264
+ virtual int TempCount() = 0;
265
+ virtual LOperand* TempAt(int i) = 0;
266
+
267
+ LOperand* FirstInput() { return InputAt(0); }
268
+ LOperand* Output() { return HasResult() ? result() : NULL; }
269
+
270
+ #ifdef DEBUG
271
+ void VerifyCall();
272
+ #endif
273
+
274
+ private:
275
+ LEnvironment* environment_;
276
+ SetOncePointer<LPointerMap> pointer_map_;
277
+ HValue* hydrogen_value_;
278
+ SetOncePointer<LEnvironment> deoptimization_environment_;
279
+ bool is_call_;
280
+ bool is_save_doubles_;
281
+ };
282
+
283
+
284
+ template<typename ElementType, int NumElements>
285
+ class OperandContainer {
286
+ public:
287
+ OperandContainer() {
288
+ for (int i = 0; i < NumElements; i++) elems_[i] = NULL;
289
+ }
290
+ int length() { return NumElements; }
291
+ ElementType& operator[](int i) {
292
+ ASSERT(i < length());
293
+ return elems_[i];
294
+ }
295
+ void PrintOperandsTo(StringStream* stream);
296
+
297
+ private:
298
+ ElementType elems_[NumElements];
299
+ };
300
+
301
+
302
+ template<typename ElementType>
303
+ class OperandContainer<ElementType, 0> {
304
+ public:
305
+ int length() { return 0; }
306
+ void PrintOperandsTo(StringStream* stream) { }
307
+ ElementType& operator[](int i) {
308
+ UNREACHABLE();
309
+ static ElementType t = 0;
310
+ return t;
311
+ }
312
+ };
313
+
314
+
315
+ // R = number of result operands (0 or 1).
316
+ // I = number of input operands.
317
+ // T = number of temporary operands.
318
+ template<int R, int I, int T>
319
+ class LTemplateInstruction: public LInstruction {
320
+ public:
321
+ // Allow 0 or 1 output operands.
322
+ STATIC_ASSERT(R == 0 || R == 1);
323
+ virtual bool HasResult() const { return R != 0; }
324
+ void set_result(LOperand* operand) { results_[0] = operand; }
325
+ LOperand* result() { return results_[0]; }
326
+
327
+ int InputCount() { return I; }
328
+ LOperand* InputAt(int i) { return inputs_[i]; }
329
+
330
+ int TempCount() { return T; }
331
+ LOperand* TempAt(int i) { return temps_[i]; }
332
+
333
+ virtual void PrintDataTo(StringStream* stream);
334
+ virtual void PrintOutputOperandTo(StringStream* stream);
335
+
336
+ protected:
337
+ OperandContainer<LOperand*, R> results_;
338
+ OperandContainer<LOperand*, I> inputs_;
339
+ OperandContainer<LOperand*, T> temps_;
340
+ };
341
+
342
+
343
+ class LGap: public LTemplateInstruction<0, 0, 0> {
344
+ public:
345
+ explicit LGap(HBasicBlock* block) : block_(block) {
346
+ parallel_moves_[BEFORE] = NULL;
347
+ parallel_moves_[START] = NULL;
348
+ parallel_moves_[END] = NULL;
349
+ parallel_moves_[AFTER] = NULL;
350
+ }
351
+
352
+ // Can't use the DECLARE-macro here because of sub-classes.
353
+ virtual bool IsGap() const { return true; }
354
+ virtual void PrintDataTo(StringStream* stream);
355
+ static LGap* cast(LInstruction* instr) {
356
+ ASSERT(instr->IsGap());
357
+ return reinterpret_cast<LGap*>(instr);
358
+ }
359
+
360
+ bool IsRedundant() const;
361
+
362
+ HBasicBlock* block() const { return block_; }
363
+
364
+ enum InnerPosition {
365
+ BEFORE,
366
+ START,
367
+ END,
368
+ AFTER,
369
+ FIRST_INNER_POSITION = BEFORE,
370
+ LAST_INNER_POSITION = AFTER
371
+ };
372
+
373
+ LParallelMove* GetOrCreateParallelMove(InnerPosition pos) {
374
+ if (parallel_moves_[pos] == NULL) parallel_moves_[pos] = new LParallelMove;
375
+ return parallel_moves_[pos];
376
+ }
377
+
378
+ LParallelMove* GetParallelMove(InnerPosition pos) {
379
+ return parallel_moves_[pos];
380
+ }
381
+
382
+ private:
383
+ LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
384
+ HBasicBlock* block_;
385
+ };
386
+
387
+
388
+ class LInstructionGap: public LGap {
389
+ public:
390
+ explicit LInstructionGap(HBasicBlock* block) : LGap(block) { }
391
+
392
+ DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap")
393
+ };
394
+
395
+
396
+ class LGoto: public LTemplateInstruction<0, 0, 0> {
397
+ public:
398
+ LGoto(int block_id, bool include_stack_check = false)
399
+ : block_id_(block_id), include_stack_check_(include_stack_check) { }
400
+
401
+ DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
402
+ virtual void PrintDataTo(StringStream* stream);
403
+ virtual bool IsControl() const { return true; }
404
+
405
+ int block_id() const { return block_id_; }
406
+ bool include_stack_check() const { return include_stack_check_; }
407
+
408
+ private:
409
+ int block_id_;
410
+ bool include_stack_check_;
411
+ };
412
+
413
+
414
+ class LLazyBailout: public LTemplateInstruction<0, 0, 0> {
415
+ public:
416
+ LLazyBailout() : gap_instructions_size_(0) { }
417
+
418
+ DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout")
419
+
420
+ void set_gap_instructions_size(int gap_instructions_size) {
421
+ gap_instructions_size_ = gap_instructions_size;
422
+ }
423
+ int gap_instructions_size() { return gap_instructions_size_; }
424
+
425
+ private:
426
+ int gap_instructions_size_;
427
+ };
428
+
429
+
430
+ class LDeoptimize: public LTemplateInstruction<0, 0, 0> {
431
+ public:
432
+ DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
433
+ };
434
+
435
+
436
+ class LLabel: public LGap {
437
+ public:
438
+ explicit LLabel(HBasicBlock* block)
439
+ : LGap(block), replacement_(NULL) { }
440
+
441
+ DECLARE_CONCRETE_INSTRUCTION(Label, "label")
442
+
443
+ virtual void PrintDataTo(StringStream* stream);
444
+
445
+ int block_id() const { return block()->block_id(); }
446
+ bool is_loop_header() const { return block()->IsLoopHeader(); }
447
+ Label* label() { return &label_; }
448
+ LLabel* replacement() const { return replacement_; }
449
+ void set_replacement(LLabel* label) { replacement_ = label; }
450
+ bool HasReplacement() const { return replacement_ != NULL; }
451
+
452
+ private:
453
+ Label label_;
454
+ LLabel* replacement_;
455
+ };
456
+
457
+
458
+ class LParameter: public LTemplateInstruction<1, 0, 0> {
459
+ public:
460
+ DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
461
+ };
462
+
463
+
464
+ class LCallStub: public LTemplateInstruction<1, 1, 0> {
465
+ public:
466
+ explicit LCallStub(LOperand* context) {
467
+ inputs_[0] = context;
468
+ }
469
+
470
+ DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
471
+ DECLARE_HYDROGEN_ACCESSOR(CallStub)
472
+
473
+ LOperand* context() { return inputs_[0]; }
474
+
475
+ TranscendentalCache::Type transcendental_type() {
476
+ return hydrogen()->transcendental_type();
477
+ }
478
+ };
479
+
480
+
481
+ class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> {
482
+ public:
483
+ DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
484
+ };
485
+
486
+
487
+ template<int I, int T>
488
+ class LControlInstruction: public LTemplateInstruction<0, I, T> {
489
+ public:
490
+ virtual bool IsControl() const { return true; }
491
+
492
+ int true_block_id() const { return true_block_id_; }
493
+ int false_block_id() const { return false_block_id_; }
494
+ void SetBranchTargets(int true_block_id, int false_block_id) {
495
+ true_block_id_ = true_block_id;
496
+ false_block_id_ = false_block_id;
497
+ }
498
+
499
+ private:
500
+ int true_block_id_;
501
+ int false_block_id_;
502
+ };
503
+
504
+
505
+ class LApplyArguments: public LTemplateInstruction<1, 4, 1> {
506
+ public:
507
+ LApplyArguments(LOperand* function,
508
+ LOperand* receiver,
509
+ LOperand* length,
510
+ LOperand* elements,
511
+ LOperand* temp) {
512
+ inputs_[0] = function;
513
+ inputs_[1] = receiver;
514
+ inputs_[2] = length;
515
+ inputs_[3] = elements;
516
+ temps_[0] = temp;
517
+ }
518
+
519
+ DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
520
+
521
+ LOperand* function() { return inputs_[0]; }
522
+ LOperand* receiver() { return inputs_[1]; }
523
+ LOperand* length() { return inputs_[2]; }
524
+ LOperand* elements() { return inputs_[3]; }
525
+ };
526
+
527
+
528
+ class LAccessArgumentsAt: public LTemplateInstruction<1, 3, 0> {
529
+ public:
530
+ LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) {
531
+ inputs_[0] = arguments;
532
+ inputs_[1] = length;
533
+ inputs_[2] = index;
534
+ }
535
+
536
+ DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
537
+
538
+ LOperand* arguments() { return inputs_[0]; }
539
+ LOperand* length() { return inputs_[1]; }
540
+ LOperand* index() { return inputs_[2]; }
541
+
542
+ virtual void PrintDataTo(StringStream* stream);
543
+ };
544
+
545
+
546
+ class LArgumentsLength: public LTemplateInstruction<1, 1, 0> {
547
+ public:
548
+ explicit LArgumentsLength(LOperand* elements) {
549
+ inputs_[0] = elements;
550
+ }
551
+
552
+ DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
553
+ };
554
+
555
+
556
+ class LArgumentsElements: public LTemplateInstruction<1, 0, 0> {
557
+ public:
558
+ LArgumentsElements() { }
559
+
560
+ DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
561
+ };
562
+
563
+
564
+ class LModI: public LTemplateInstruction<1, 2, 1> {
565
+ public:
566
+ LModI(LOperand* left, LOperand* right, LOperand* temp) {
567
+ inputs_[0] = left;
568
+ inputs_[1] = right;
569
+ temps_[0] = temp;
570
+ }
571
+
572
+ DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
573
+ DECLARE_HYDROGEN_ACCESSOR(Mod)
574
+ };
575
+
576
+
577
+ class LDivI: public LTemplateInstruction<1, 2, 1> {
578
+ public:
579
+ LDivI(LOperand* left, LOperand* right, LOperand* temp) {
580
+ inputs_[0] = left;
581
+ inputs_[1] = right;
582
+ temps_[0] = temp;
583
+ }
584
+
585
+ DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
586
+ DECLARE_HYDROGEN_ACCESSOR(Div)
587
+ };
588
+
589
+
590
+ class LMulI: public LTemplateInstruction<1, 2, 1> {
591
+ public:
592
+ LMulI(LOperand* left, LOperand* right, LOperand* temp) {
593
+ inputs_[0] = left;
594
+ inputs_[1] = right;
595
+ temps_[0] = temp;
596
+ }
597
+
598
+ DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
599
+ DECLARE_HYDROGEN_ACCESSOR(Mul)
600
+ };
601
+
602
+
603
+ class LCmpID: public LTemplateInstruction<1, 2, 0> {
604
+ public:
605
+ LCmpID(LOperand* left, LOperand* right) {
606
+ inputs_[0] = left;
607
+ inputs_[1] = right;
608
+ }
609
+
610
+ DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id")
611
+ DECLARE_HYDROGEN_ACCESSOR(Compare)
612
+
613
+ Token::Value op() const { return hydrogen()->token(); }
614
+ bool is_double() const {
615
+ return hydrogen()->GetInputRepresentation().IsDouble();
616
+ }
617
+ };
618
+
619
+
620
+ class LCmpIDAndBranch: public LControlInstruction<2, 0> {
621
+ public:
622
+ LCmpIDAndBranch(LOperand* left, LOperand* right) {
623
+ inputs_[0] = left;
624
+ inputs_[1] = right;
625
+ }
626
+
627
+ DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
628
+ DECLARE_HYDROGEN_ACCESSOR(Compare)
629
+
630
+ Token::Value op() const { return hydrogen()->token(); }
631
+ bool is_double() const {
632
+ return hydrogen()->GetInputRepresentation().IsDouble();
633
+ }
634
+
635
+ virtual void PrintDataTo(StringStream* stream);
636
+ };
637
+
638
+
639
+ class LUnaryMathOperation: public LTemplateInstruction<1, 1, 0> {
640
+ public:
641
+ explicit LUnaryMathOperation(LOperand* value) {
642
+ inputs_[0] = value;
643
+ }
644
+
645
+ DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation")
646
+ DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
647
+
648
+ virtual void PrintDataTo(StringStream* stream);
649
+ BuiltinFunctionId op() const { return hydrogen()->op(); }
650
+ };
651
+
652
+
653
+ class LCmpJSObjectEq: public LTemplateInstruction<1, 2, 0> {
654
+ public:
655
+ LCmpJSObjectEq(LOperand* left, LOperand* right) {
656
+ inputs_[0] = left;
657
+ inputs_[1] = right;
658
+ }
659
+
660
+ DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq")
661
+ };
662
+
663
+
664
+ class LCmpJSObjectEqAndBranch: public LControlInstruction<2, 0> {
665
+ public:
666
+ LCmpJSObjectEqAndBranch(LOperand* left, LOperand* right) {
667
+ inputs_[0] = left;
668
+ inputs_[1] = right;
669
+ }
670
+
671
+ DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch,
672
+ "cmp-jsobject-eq-and-branch")
673
+ };
674
+
675
+
676
+ class LCmpSymbolEq: public LTemplateInstruction<1, 2, 0> {
677
+ public:
678
+ LCmpSymbolEq(LOperand* left, LOperand* right) {
679
+ inputs_[0] = left;
680
+ inputs_[1] = right;
681
+ }
682
+
683
+ DECLARE_CONCRETE_INSTRUCTION(CmpSymbolEq, "cmp-symbol-eq")
684
+ };
685
+
686
+
687
+ class LCmpSymbolEqAndBranch: public LControlInstruction<2, 0> {
688
+ public:
689
+ LCmpSymbolEqAndBranch(LOperand* left, LOperand* right) {
690
+ inputs_[0] = left;
691
+ inputs_[1] = right;
692
+ }
693
+
694
+ DECLARE_CONCRETE_INSTRUCTION(CmpSymbolEqAndBranch, "cmp-symbol-eq-and-branch")
695
+ };
696
+
697
+
698
+ class LIsNull: public LTemplateInstruction<1, 1, 0> {
699
+ public:
700
+ explicit LIsNull(LOperand* value) {
701
+ inputs_[0] = value;
702
+ }
703
+
704
+ DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null")
705
+ DECLARE_HYDROGEN_ACCESSOR(IsNull)
706
+
707
+ bool is_strict() const { return hydrogen()->is_strict(); }
708
+ };
709
+
710
+
711
+ class LIsNullAndBranch: public LControlInstruction<1, 1> {
712
+ public:
713
+ LIsNullAndBranch(LOperand* value, LOperand* temp) {
714
+ inputs_[0] = value;
715
+ temps_[0] = temp;
716
+ }
717
+
718
+ DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch")
719
+ DECLARE_HYDROGEN_ACCESSOR(IsNull)
720
+
721
+ bool is_strict() const { return hydrogen()->is_strict(); }
722
+
723
+ virtual void PrintDataTo(StringStream* stream);
724
+ };
725
+
726
+
727
+ class LIsObject: public LTemplateInstruction<1, 1, 1> {
728
+ public:
729
+ LIsObject(LOperand* value, LOperand* temp) {
730
+ inputs_[0] = value;
731
+ temps_[0] = temp;
732
+ }
733
+
734
+ DECLARE_CONCRETE_INSTRUCTION(IsObject, "is-object")
735
+ };
736
+
737
+
738
+ class LIsObjectAndBranch: public LControlInstruction<1, 2> {
739
+ public:
740
+ LIsObjectAndBranch(LOperand* value, LOperand* temp, LOperand* temp2) {
741
+ inputs_[0] = value;
742
+ temps_[0] = temp;
743
+ temps_[1] = temp2;
744
+ }
745
+
746
+ DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
747
+
748
+ virtual void PrintDataTo(StringStream* stream);
749
+ };
750
+
751
+
752
+ class LIsSmi: public LTemplateInstruction<1, 1, 0> {
753
+ public:
754
+ explicit LIsSmi(LOperand* value) {
755
+ inputs_[0] = value;
756
+ }
757
+
758
+ DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi")
759
+ DECLARE_HYDROGEN_ACCESSOR(IsSmi)
760
+ };
761
+
762
+
763
+ class LIsSmiAndBranch: public LControlInstruction<1, 0> {
764
+ public:
765
+ explicit LIsSmiAndBranch(LOperand* value) {
766
+ inputs_[0] = value;
767
+ }
768
+
769
+ DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
770
+
771
+ virtual void PrintDataTo(StringStream* stream);
772
+ };
773
+
774
+
775
+ class LIsUndetectable: public LTemplateInstruction<1, 1, 0> {
776
+ public:
777
+ explicit LIsUndetectable(LOperand* value) {
778
+ inputs_[0] = value;
779
+ }
780
+
781
+ DECLARE_CONCRETE_INSTRUCTION(IsUndetectable, "is-undetectable")
782
+ DECLARE_HYDROGEN_ACCESSOR(IsUndetectable)
783
+ };
784
+
785
+
786
+ class LIsUndetectableAndBranch: public LControlInstruction<1, 1> {
787
+ public:
788
+ explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
789
+ inputs_[0] = value;
790
+ temps_[0] = temp;
791
+ }
792
+
793
+ DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
794
+ "is-undetectable-and-branch")
795
+
796
+ virtual void PrintDataTo(StringStream* stream);
797
+ };
798
+
799
+
800
+ class LHasInstanceType: public LTemplateInstruction<1, 1, 0> {
801
+ public:
802
+ explicit LHasInstanceType(LOperand* value) {
803
+ inputs_[0] = value;
804
+ }
805
+
806
+ DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type")
807
+ DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
808
+ };
809
+
810
+
811
+ class LHasInstanceTypeAndBranch: public LControlInstruction<1, 1> {
812
+ public:
813
+ LHasInstanceTypeAndBranch(LOperand* value, LOperand* temp) {
814
+ inputs_[0] = value;
815
+ temps_[0] = temp;
816
+ }
817
+
818
+ DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
819
+ "has-instance-type-and-branch")
820
+ DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
821
+
822
+ virtual void PrintDataTo(StringStream* stream);
823
+ };
824
+
825
+
826
+ class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
827
+ public:
828
+ explicit LGetCachedArrayIndex(LOperand* value) {
829
+ inputs_[0] = value;
830
+ }
831
+
832
+ DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
833
+ DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
834
+ };
835
+
836
+
837
+ class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
838
+ public:
839
+ explicit LHasCachedArrayIndex(LOperand* value) {
840
+ inputs_[0] = value;
841
+ }
842
+
843
+ DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index")
844
+ DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex)
845
+ };
846
+
847
+
848
+ class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> {
849
+ public:
850
+ explicit LHasCachedArrayIndexAndBranch(LOperand* value) {
851
+ inputs_[0] = value;
852
+ }
853
+
854
+ DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
855
+ "has-cached-array-index-and-branch")
856
+ virtual void PrintDataTo(StringStream* stream);
857
+ };
858
+
859
+
860
+ class LIsConstructCall: public LTemplateInstruction<1, 0, 0> {
861
+ public:
862
+ DECLARE_CONCRETE_INSTRUCTION(IsConstructCall, "is-construct-call")
863
+ DECLARE_HYDROGEN_ACCESSOR(IsConstructCall)
864
+ };
865
+
866
+
867
+ class LIsConstructCallAndBranch: public LControlInstruction<0, 1> {
868
+ public:
869
+ explicit LIsConstructCallAndBranch(LOperand* temp) {
870
+ temps_[0] = temp;
871
+ }
872
+
873
+ DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
874
+ "is-construct-call-and-branch")
875
+ };
876
+
877
+
878
+ class LClassOfTest: public LTemplateInstruction<1, 1, 1> {
879
+ public:
880
+ LClassOfTest(LOperand* value, LOperand* temp) {
881
+ inputs_[0] = value;
882
+ temps_[0] = temp;
883
+ }
884
+
885
+ DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test")
886
+ DECLARE_HYDROGEN_ACCESSOR(ClassOfTest)
887
+
888
+ virtual void PrintDataTo(StringStream* stream);
889
+ };
890
+
891
+
892
+ class LClassOfTestAndBranch: public LControlInstruction<1, 2> {
893
+ public:
894
+ LClassOfTestAndBranch(LOperand* value, LOperand* temp, LOperand* temp2) {
895
+ inputs_[0] = value;
896
+ temps_[0] = temp;
897
+ temps_[1] = temp2;
898
+ }
899
+
900
+ DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
901
+ "class-of-test-and-branch")
902
+ DECLARE_HYDROGEN_ACCESSOR(ClassOfTest)
903
+
904
+ virtual void PrintDataTo(StringStream* stream);
905
+ };
906
+
907
+
908
+ class LCmpT: public LTemplateInstruction<1, 2, 0> {
909
+ public:
910
+ LCmpT(LOperand* left, LOperand* right) {
911
+ inputs_[0] = left;
912
+ inputs_[1] = right;
913
+ }
914
+
915
+ DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
916
+ DECLARE_HYDROGEN_ACCESSOR(Compare)
917
+
918
+ Token::Value op() const { return hydrogen()->token(); }
919
+ };
920
+
921
+
922
+ class LCmpTAndBranch: public LControlInstruction<2, 0> {
923
+ public:
924
+ LCmpTAndBranch(LOperand* left, LOperand* right) {
925
+ inputs_[0] = left;
926
+ inputs_[1] = right;
927
+ }
928
+
929
+ DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch")
930
+ DECLARE_HYDROGEN_ACCESSOR(Compare)
931
+
932
+ Token::Value op() const { return hydrogen()->token(); }
933
+ };
934
+
935
+
936
+ class LInstanceOf: public LTemplateInstruction<1, 3, 0> {
937
+ public:
938
+ LInstanceOf(LOperand* context, LOperand* left, LOperand* right) {
939
+ inputs_[0] = context;
940
+ inputs_[1] = left;
941
+ inputs_[2] = right;
942
+ }
943
+
944
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
945
+
946
+ LOperand* context() { return inputs_[0]; }
947
+ };
948
+
949
+
950
+ class LInstanceOfAndBranch: public LControlInstruction<3, 0> {
951
+ public:
952
+ LInstanceOfAndBranch(LOperand* context, LOperand* left, LOperand* right) {
953
+ inputs_[0] = context;
954
+ inputs_[1] = left;
955
+ inputs_[2] = right;
956
+ }
957
+
958
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch")
959
+
960
+ LOperand* context() { return inputs_[0]; }
961
+ };
962
+
963
+
964
+ class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> {
965
+ public:
966
+ LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) {
967
+ inputs_[0] = value;
968
+ temps_[0] = temp;
969
+ }
970
+
971
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
972
+ "instance-of-known-global")
973
+ DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
974
+
975
+ Handle<JSFunction> function() const { return hydrogen()->function(); }
976
+ };
977
+
978
+
979
+ class LBoundsCheck: public LTemplateInstruction<0, 2, 0> {
980
+ public:
981
+ LBoundsCheck(LOperand* index, LOperand* length) {
982
+ inputs_[0] = index;
983
+ inputs_[1] = length;
984
+ }
985
+
986
+ LOperand* index() { return inputs_[0]; }
987
+ LOperand* length() { return inputs_[1]; }
988
+
989
+ DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
990
+ };
991
+
992
+
993
+ class LBitI: public LTemplateInstruction<1, 2, 0> {
994
+ public:
995
+ LBitI(Token::Value op, LOperand* left, LOperand* right)
996
+ : op_(op) {
997
+ inputs_[0] = left;
998
+ inputs_[1] = right;
999
+ }
1000
+
1001
+ Token::Value op() const { return op_; }
1002
+
1003
+ DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
1004
+
1005
+ private:
1006
+ Token::Value op_;
1007
+ };
1008
+
1009
+
1010
+ class LShiftI: public LTemplateInstruction<1, 2, 0> {
1011
+ public:
1012
+ LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
1013
+ : op_(op), can_deopt_(can_deopt) {
1014
+ inputs_[0] = left;
1015
+ inputs_[1] = right;
1016
+ }
1017
+
1018
+ Token::Value op() const { return op_; }
1019
+
1020
+ bool can_deopt() const { return can_deopt_; }
1021
+
1022
+ DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
1023
+
1024
+ private:
1025
+ Token::Value op_;
1026
+ bool can_deopt_;
1027
+ };
1028
+
1029
+
1030
+ class LSubI: public LTemplateInstruction<1, 2, 0> {
1031
+ public:
1032
+ LSubI(LOperand* left, LOperand* right) {
1033
+ inputs_[0] = left;
1034
+ inputs_[1] = right;
1035
+ }
1036
+
1037
+ DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
1038
+ DECLARE_HYDROGEN_ACCESSOR(Sub)
1039
+ };
1040
+
1041
+
1042
+ class LConstantI: public LTemplateInstruction<1, 0, 0> {
1043
+ public:
1044
+ DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
1045
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
1046
+
1047
+ int32_t value() const { return hydrogen()->Integer32Value(); }
1048
+ };
1049
+
1050
+
1051
+ class LConstantD: public LTemplateInstruction<1, 0, 1> {
1052
+ public:
1053
+ explicit LConstantD(LOperand* temp) {
1054
+ temps_[0] = temp;
1055
+ }
1056
+
1057
+ DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
1058
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
1059
+
1060
+ double value() const { return hydrogen()->DoubleValue(); }
1061
+ };
1062
+
1063
+
1064
+ class LConstantT: public LTemplateInstruction<1, 0, 0> {
1065
+ public:
1066
+ DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
1067
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
1068
+
1069
+ Handle<Object> value() const { return hydrogen()->handle(); }
1070
+ };
1071
+
1072
+
1073
+ class LBranch: public LControlInstruction<1, 0> {
1074
+ public:
1075
+ explicit LBranch(LOperand* value) {
1076
+ inputs_[0] = value;
1077
+ }
1078
+
1079
+ DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
1080
+ DECLARE_HYDROGEN_ACCESSOR(Value)
1081
+
1082
+ virtual void PrintDataTo(StringStream* stream);
1083
+ };
1084
+
1085
+
1086
+ class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 0> {
1087
+ public:
1088
+ explicit LCmpMapAndBranch(LOperand* value) {
1089
+ inputs_[0] = value;
1090
+ }
1091
+
1092
+ DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1093
+ DECLARE_HYDROGEN_ACCESSOR(CompareMap)
1094
+
1095
+ virtual bool IsControl() const { return true; }
1096
+
1097
+ Handle<Map> map() const { return hydrogen()->map(); }
1098
+ int true_block_id() const {
1099
+ return hydrogen()->FirstSuccessor()->block_id();
1100
+ }
1101
+ int false_block_id() const {
1102
+ return hydrogen()->SecondSuccessor()->block_id();
1103
+ }
1104
+ };
1105
+
1106
+
1107
+ class LJSArrayLength: public LTemplateInstruction<1, 1, 0> {
1108
+ public:
1109
+ explicit LJSArrayLength(LOperand* value) {
1110
+ inputs_[0] = value;
1111
+ }
1112
+
1113
+ DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length")
1114
+ DECLARE_HYDROGEN_ACCESSOR(JSArrayLength)
1115
+ };
1116
+
1117
+
1118
+ class LExternalArrayLength: public LTemplateInstruction<1, 1, 0> {
1119
+ public:
1120
+ explicit LExternalArrayLength(LOperand* value) {
1121
+ inputs_[0] = value;
1122
+ }
1123
+
1124
+ DECLARE_CONCRETE_INSTRUCTION(ExternalArrayLength, "external-array-length")
1125
+ DECLARE_HYDROGEN_ACCESSOR(ExternalArrayLength)
1126
+ };
1127
+
1128
+
1129
+ class LFixedArrayLength: public LTemplateInstruction<1, 1, 0> {
1130
+ public:
1131
+ explicit LFixedArrayLength(LOperand* value) {
1132
+ inputs_[0] = value;
1133
+ }
1134
+
1135
+ DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length")
1136
+ DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength)
1137
+ };
1138
+
1139
+
1140
+ class LValueOf: public LTemplateInstruction<1, 1, 1> {
1141
+ public:
1142
+ LValueOf(LOperand* value, LOperand* temp) {
1143
+ inputs_[0] = value;
1144
+ temps_[0] = temp;
1145
+ }
1146
+
1147
+ DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
1148
+ DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1149
+ };
1150
+
1151
+
1152
+ class LThrow: public LTemplateInstruction<0, 1, 0> {
1153
+ public:
1154
+ explicit LThrow(LOperand* value) {
1155
+ inputs_[0] = value;
1156
+ }
1157
+
1158
+ DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
1159
+ };
1160
+
1161
+
1162
+ class LBitNotI: public LTemplateInstruction<1, 1, 0> {
1163
+ public:
1164
+ explicit LBitNotI(LOperand* value) {
1165
+ inputs_[0] = value;
1166
+ }
1167
+
1168
+ DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i")
1169
+ };
1170
+
1171
+
1172
+ class LAddI: public LTemplateInstruction<1, 2, 0> {
1173
+ public:
1174
+ LAddI(LOperand* left, LOperand* right) {
1175
+ inputs_[0] = left;
1176
+ inputs_[1] = right;
1177
+ }
1178
+
1179
+ DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
1180
+ DECLARE_HYDROGEN_ACCESSOR(Add)
1181
+ };
1182
+
1183
+
1184
+ class LPower: public LTemplateInstruction<1, 2, 0> {
1185
+ public:
1186
+ LPower(LOperand* left, LOperand* right) {
1187
+ inputs_[0] = left;
1188
+ inputs_[1] = right;
1189
+ }
1190
+
1191
+ DECLARE_CONCRETE_INSTRUCTION(Power, "power")
1192
+ DECLARE_HYDROGEN_ACCESSOR(Power)
1193
+ };
1194
+
1195
+
1196
+ class LArithmeticD: public LTemplateInstruction<1, 2, 0> {
1197
+ public:
1198
+ LArithmeticD(Token::Value op, LOperand* left, LOperand* right)
1199
+ : op_(op) {
1200
+ inputs_[0] = left;
1201
+ inputs_[1] = right;
1202
+ }
1203
+
1204
+ Token::Value op() const { return op_; }
1205
+
1206
+ virtual Opcode opcode() const { return LInstruction::kArithmeticD; }
1207
+ virtual void CompileToNative(LCodeGen* generator);
1208
+ virtual const char* Mnemonic() const;
1209
+
1210
+ private:
1211
+ Token::Value op_;
1212
+ };
1213
+
1214
+
1215
+ class LArithmeticT: public LTemplateInstruction<1, 2, 0> {
1216
+ public:
1217
+ LArithmeticT(Token::Value op, LOperand* left, LOperand* right)
1218
+ : op_(op) {
1219
+ inputs_[0] = left;
1220
+ inputs_[1] = right;
1221
+ }
1222
+
1223
+ virtual Opcode opcode() const { return LInstruction::kArithmeticT; }
1224
+ virtual void CompileToNative(LCodeGen* generator);
1225
+ virtual const char* Mnemonic() const;
1226
+
1227
+ Token::Value op() const { return op_; }
1228
+
1229
+ private:
1230
+ Token::Value op_;
1231
+ };
1232
+
1233
+
1234
+ class LReturn: public LTemplateInstruction<0, 1, 0> {
1235
+ public:
1236
+ explicit LReturn(LOperand* value) {
1237
+ inputs_[0] = value;
1238
+ }
1239
+
1240
+ DECLARE_CONCRETE_INSTRUCTION(Return, "return")
1241
+ };
1242
+
1243
+
1244
+ class LLoadNamedField: public LTemplateInstruction<1, 1, 0> {
1245
+ public:
1246
+ explicit LLoadNamedField(LOperand* object) {
1247
+ inputs_[0] = object;
1248
+ }
1249
+
1250
+ DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
1251
+ DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
1252
+
1253
+ LOperand* object() { return inputs_[0]; }
1254
+ };
1255
+
1256
+
1257
+ class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 1, 0> {
1258
+ public:
1259
+ explicit LLoadNamedFieldPolymorphic(LOperand* object) {
1260
+ inputs_[0] = object;
1261
+ }
1262
+
1263
+ DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field-polymorphic")
1264
+ DECLARE_HYDROGEN_ACCESSOR(LoadNamedFieldPolymorphic)
1265
+
1266
+ LOperand* object() { return inputs_[0]; }
1267
+ };
1268
+
1269
+
1270
+ class LLoadNamedGeneric: public LTemplateInstruction<1, 2, 0> {
1271
+ public:
1272
+ LLoadNamedGeneric(LOperand* context, LOperand* object) {
1273
+ inputs_[0] = context;
1274
+ inputs_[1] = object;
1275
+ }
1276
+
1277
+ DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
1278
+ DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
1279
+
1280
+ LOperand* context() { return inputs_[0]; }
1281
+ LOperand* object() { return inputs_[1]; }
1282
+ Handle<Object> name() const { return hydrogen()->name(); }
1283
+ };
1284
+
1285
+
1286
+ class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 1> {
1287
+ public:
1288
+ LLoadFunctionPrototype(LOperand* function, LOperand* temp) {
1289
+ inputs_[0] = function;
1290
+ temps_[0] = temp;
1291
+ }
1292
+
1293
+ DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
1294
+ DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
1295
+
1296
+ LOperand* function() { return inputs_[0]; }
1297
+ };
1298
+
1299
+
1300
+ class LLoadElements: public LTemplateInstruction<1, 1, 0> {
1301
+ public:
1302
+ explicit LLoadElements(LOperand* object) {
1303
+ inputs_[0] = object;
1304
+ }
1305
+
1306
+ DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
1307
+ };
1308
+
1309
+
1310
+ class LLoadExternalArrayPointer: public LTemplateInstruction<1, 1, 0> {
1311
+ public:
1312
+ explicit LLoadExternalArrayPointer(LOperand* object) {
1313
+ inputs_[0] = object;
1314
+ }
1315
+
1316
+ DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer,
1317
+ "load-external-array-pointer")
1318
+ };
1319
+
1320
+
1321
+ class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> {
1322
+ public:
1323
+ LLoadKeyedFastElement(LOperand* elements, LOperand* key) {
1324
+ inputs_[0] = elements;
1325
+ inputs_[1] = key;
1326
+ }
1327
+
1328
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element")
1329
+ DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement)
1330
+
1331
+ LOperand* elements() { return inputs_[0]; }
1332
+ LOperand* key() { return inputs_[1]; }
1333
+ };
1334
+
1335
+
1336
+ class LLoadKeyedSpecializedArrayElement: public LTemplateInstruction<1, 2, 0> {
1337
+ public:
1338
+ LLoadKeyedSpecializedArrayElement(LOperand* external_pointer,
1339
+ LOperand* key) {
1340
+ inputs_[0] = external_pointer;
1341
+ inputs_[1] = key;
1342
+ }
1343
+
1344
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement,
1345
+ "load-keyed-specialized-array-element")
1346
+ DECLARE_HYDROGEN_ACCESSOR(LoadKeyedSpecializedArrayElement)
1347
+
1348
+ LOperand* external_pointer() { return inputs_[0]; }
1349
+ LOperand* key() { return inputs_[1]; }
1350
+ ExternalArrayType array_type() const {
1351
+ return hydrogen()->array_type();
1352
+ }
1353
+ };
1354
+
1355
+
1356
+ class LLoadKeyedGeneric: public LTemplateInstruction<1, 3, 0> {
1357
+ public:
1358
+ LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) {
1359
+ inputs_[0] = context;
1360
+ inputs_[1] = obj;
1361
+ inputs_[2] = key;
1362
+ }
1363
+
1364
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
1365
+
1366
+ LOperand* context() { return inputs_[0]; }
1367
+ LOperand* object() { return inputs_[1]; }
1368
+ LOperand* key() { return inputs_[2]; }
1369
+ };
1370
+
1371
+
1372
+ class LLoadGlobalCell: public LTemplateInstruction<1, 0, 0> {
1373
+ public:
1374
+ DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell")
1375
+ DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell)
1376
+ };
1377
+
1378
+
1379
+ class LLoadGlobalGeneric: public LTemplateInstruction<1, 2, 0> {
1380
+ public:
1381
+ LLoadGlobalGeneric(LOperand* context, LOperand* global_object) {
1382
+ inputs_[0] = context;
1383
+ inputs_[1] = global_object;
1384
+ }
1385
+
1386
+ DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
1387
+ DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
1388
+
1389
+ LOperand* context() { return inputs_[0]; }
1390
+ LOperand* global_object() { return inputs_[1]; }
1391
+ Handle<Object> name() const { return hydrogen()->name(); }
1392
+ bool for_typeof() const { return hydrogen()->for_typeof(); }
1393
+ };
1394
+
1395
+
1396
+ class LStoreGlobalCell: public LTemplateInstruction<0, 1, 0> {
1397
+ public:
1398
+ explicit LStoreGlobalCell(LOperand* value) {
1399
+ inputs_[0] = value;
1400
+ }
1401
+
1402
+ DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell")
1403
+ DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell)
1404
+ };
1405
+
1406
+
1407
+ class LStoreGlobalGeneric: public LTemplateInstruction<0, 3, 0> {
1408
+ public:
1409
+ explicit LStoreGlobalGeneric(LOperand* context,
1410
+ LOperand* global_object,
1411
+ LOperand* value) {
1412
+ inputs_[0] = context;
1413
+ inputs_[1] = global_object;
1414
+ inputs_[2] = value;
1415
+ }
1416
+
1417
+ DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic")
1418
+ DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric)
1419
+
1420
+ LOperand* context() { return InputAt(0); }
1421
+ LOperand* global_object() { return InputAt(1); }
1422
+ Handle<Object> name() const { return hydrogen()->name(); }
1423
+ LOperand* value() { return InputAt(2); }
1424
+ bool strict_mode() { return hydrogen()->strict_mode(); }
1425
+ };
1426
+
1427
+
1428
+ class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> {
1429
+ public:
1430
+ explicit LLoadContextSlot(LOperand* context) {
1431
+ inputs_[0] = context;
1432
+ }
1433
+
1434
+ DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
1435
+ DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
1436
+
1437
+ LOperand* context() { return InputAt(0); }
1438
+ int slot_index() { return hydrogen()->slot_index(); }
1439
+
1440
+ virtual void PrintDataTo(StringStream* stream);
1441
+ };
1442
+
1443
+
1444
+ class LStoreContextSlot: public LTemplateInstruction<0, 2, 1> {
1445
+ public:
1446
+ LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) {
1447
+ inputs_[0] = context;
1448
+ inputs_[1] = value;
1449
+ temps_[0] = temp;
1450
+ }
1451
+
1452
+ DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
1453
+ DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
1454
+
1455
+ LOperand* context() { return InputAt(0); }
1456
+ LOperand* value() { return InputAt(1); }
1457
+ int slot_index() { return hydrogen()->slot_index(); }
1458
+ int needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
1459
+
1460
+ virtual void PrintDataTo(StringStream* stream);
1461
+ };
1462
+
1463
+
1464
+ class LPushArgument: public LTemplateInstruction<0, 1, 0> {
1465
+ public:
1466
+ explicit LPushArgument(LOperand* value) {
1467
+ inputs_[0] = value;
1468
+ }
1469
+
1470
+ DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
1471
+ };
1472
+
1473
+
1474
+ class LContext: public LTemplateInstruction<1, 0, 0> {
1475
+ public:
1476
+ DECLARE_CONCRETE_INSTRUCTION(Context, "context")
1477
+ };
1478
+
1479
+
1480
+ class LOuterContext: public LTemplateInstruction<1, 1, 0> {
1481
+ public:
1482
+ explicit LOuterContext(LOperand* context) {
1483
+ inputs_[0] = context;
1484
+ }
1485
+
1486
+ DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
1487
+
1488
+ LOperand* context() { return InputAt(0); }
1489
+ };
1490
+
1491
+
1492
+ class LGlobalObject: public LTemplateInstruction<1, 1, 0> {
1493
+ public:
1494
+ explicit LGlobalObject(LOperand* context) {
1495
+ inputs_[0] = context;
1496
+ }
1497
+
1498
+ DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
1499
+
1500
+ LOperand* context() { return InputAt(0); }
1501
+ };
1502
+
1503
+
1504
+ class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> {
1505
+ public:
1506
+ explicit LGlobalReceiver(LOperand* global_object) {
1507
+ inputs_[0] = global_object;
1508
+ }
1509
+
1510
+ DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
1511
+
1512
+ LOperand* global() { return InputAt(0); }
1513
+ };
1514
+
1515
+
1516
+ class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> {
1517
+ public:
1518
+ DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function")
1519
+ DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction)
1520
+
1521
+ virtual void PrintDataTo(StringStream* stream);
1522
+
1523
+ Handle<JSFunction> function() { return hydrogen()->function(); }
1524
+ int arity() const { return hydrogen()->argument_count() - 1; }
1525
+ };
1526
+
1527
+
1528
+ class LInvokeFunction: public LTemplateInstruction<1, 2, 0> {
1529
+ public:
1530
+ LInvokeFunction(LOperand* context, LOperand* function) {
1531
+ inputs_[0] = context;
1532
+ inputs_[1] = function;
1533
+ }
1534
+
1535
+ DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1536
+ DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1537
+
1538
+ LOperand* context() { return inputs_[0]; }
1539
+ LOperand* function() { return inputs_[1]; }
1540
+
1541
+ virtual void PrintDataTo(StringStream* stream);
1542
+
1543
+ int arity() const { return hydrogen()->argument_count() - 1; }
1544
+ };
1545
+
1546
+
1547
+ class LCallKeyed: public LTemplateInstruction<1, 2, 0> {
1548
+ public:
1549
+ LCallKeyed(LOperand* context, LOperand* key) {
1550
+ inputs_[0] = context;
1551
+ inputs_[1] = key;
1552
+ }
1553
+
1554
+ DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
1555
+ DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
1556
+
1557
+ LOperand* context() { return inputs_[0]; }
1558
+ LOperand* key() { return inputs_[1]; }
1559
+
1560
+ virtual void PrintDataTo(StringStream* stream);
1561
+
1562
+ int arity() const { return hydrogen()->argument_count() - 1; }
1563
+ };
1564
+
1565
+
1566
+ class LCallNamed: public LTemplateInstruction<1, 1, 0> {
1567
+ public:
1568
+ explicit LCallNamed(LOperand* context) {
1569
+ inputs_[0] = context;
1570
+ }
1571
+
1572
+ DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
1573
+ DECLARE_HYDROGEN_ACCESSOR(CallNamed)
1574
+
1575
+ virtual void PrintDataTo(StringStream* stream);
1576
+
1577
+ LOperand* context() { return inputs_[0]; }
1578
+ Handle<String> name() const { return hydrogen()->name(); }
1579
+ int arity() const { return hydrogen()->argument_count() - 1; }
1580
+ };
1581
+
1582
+
1583
+ class LCallFunction: public LTemplateInstruction<1, 1, 0> {
1584
+ public:
1585
+ explicit LCallFunction(LOperand* context) {
1586
+ inputs_[0] = context;
1587
+ }
1588
+
1589
+ DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
1590
+ DECLARE_HYDROGEN_ACCESSOR(CallFunction)
1591
+
1592
+ LOperand* context() { return inputs_[0]; }
1593
+ int arity() const { return hydrogen()->argument_count() - 2; }
1594
+ };
1595
+
1596
+
1597
+ class LCallGlobal: public LTemplateInstruction<1, 1, 0> {
1598
+ public:
1599
+ explicit LCallGlobal(LOperand* context) {
1600
+ inputs_[0] = context;
1601
+ }
1602
+
1603
+ DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
1604
+ DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
1605
+
1606
+ virtual void PrintDataTo(StringStream* stream);
1607
+
1608
+ LOperand* context() { return inputs_[0]; }
1609
+ Handle<String> name() const {return hydrogen()->name(); }
1610
+ int arity() const { return hydrogen()->argument_count() - 1; }
1611
+ };
1612
+
1613
+
1614
+ class LCallKnownGlobal: public LTemplateInstruction<1, 0, 0> {
1615
+ public:
1616
+ DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
1617
+ DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal)
1618
+
1619
+ virtual void PrintDataTo(StringStream* stream);
1620
+
1621
+ Handle<JSFunction> target() const { return hydrogen()->target(); }
1622
+ int arity() const { return hydrogen()->argument_count() - 1; }
1623
+ };
1624
+
1625
+
1626
+ class LCallNew: public LTemplateInstruction<1, 2, 0> {
1627
+ public:
1628
+ LCallNew(LOperand* context, LOperand* constructor) {
1629
+ inputs_[0] = context;
1630
+ inputs_[1] = constructor;
1631
+ }
1632
+
1633
+ DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
1634
+ DECLARE_HYDROGEN_ACCESSOR(CallNew)
1635
+
1636
+ virtual void PrintDataTo(StringStream* stream);
1637
+
1638
+ LOperand* context() { return inputs_[0]; }
1639
+ LOperand* constructor() { return inputs_[1]; }
1640
+ int arity() const { return hydrogen()->argument_count() - 1; }
1641
+ };
1642
+
1643
+
1644
+ class LCallRuntime: public LTemplateInstruction<1, 0, 0> {
1645
+ public:
1646
+ DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
1647
+ DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
1648
+
1649
+ const Runtime::Function* function() const { return hydrogen()->function(); }
1650
+ int arity() const { return hydrogen()->argument_count(); }
1651
+ };
1652
+
1653
+
1654
+ class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> {
1655
+ public:
1656
+ explicit LInteger32ToDouble(LOperand* value) {
1657
+ inputs_[0] = value;
1658
+ }
1659
+
1660
+ DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
1661
+ };
1662
+
1663
+
1664
+ class LNumberTagI: public LTemplateInstruction<1, 1, 0> {
1665
+ public:
1666
+ explicit LNumberTagI(LOperand* value) {
1667
+ inputs_[0] = value;
1668
+ }
1669
+
1670
+ DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
1671
+ };
1672
+
1673
+
1674
+ class LNumberTagD: public LTemplateInstruction<1, 1, 1> {
1675
+ public:
1676
+ LNumberTagD(LOperand* value, LOperand* temp) {
1677
+ inputs_[0] = value;
1678
+ temps_[0] = temp;
1679
+ }
1680
+
1681
+ DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
1682
+ };
1683
+
1684
+
1685
+ // Sometimes truncating conversion from a tagged value to an int32.
1686
+ class LDoubleToI: public LTemplateInstruction<1, 1, 1> {
1687
+ public:
1688
+ LDoubleToI(LOperand* value, LOperand* temp) {
1689
+ inputs_[0] = value;
1690
+ temps_[0] = temp;
1691
+ }
1692
+
1693
+ DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
1694
+ DECLARE_HYDROGEN_ACCESSOR(Change)
1695
+
1696
+ bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1697
+ };
1698
+
1699
+
1700
+ // Truncating conversion from a tagged value to an int32.
1701
+ class LTaggedToI: public LTemplateInstruction<1, 1, 1> {
1702
+ public:
1703
+ LTaggedToI(LOperand* value, LOperand* temp) {
1704
+ inputs_[0] = value;
1705
+ temps_[0] = temp;
1706
+ }
1707
+
1708
+ DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
1709
+ DECLARE_HYDROGEN_ACCESSOR(Change)
1710
+
1711
+ bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1712
+ };
1713
+
1714
+
1715
+ class LSmiTag: public LTemplateInstruction<1, 1, 0> {
1716
+ public:
1717
+ explicit LSmiTag(LOperand* value) {
1718
+ inputs_[0] = value;
1719
+ }
1720
+
1721
+ DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
1722
+ };
1723
+
1724
+
1725
+ class LNumberUntagD: public LTemplateInstruction<1, 1, 0> {
1726
+ public:
1727
+ explicit LNumberUntagD(LOperand* value) {
1728
+ inputs_[0] = value;
1729
+ }
1730
+
1731
+ DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
1732
+ };
1733
+
1734
+
1735
+ class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
1736
+ public:
1737
+ LSmiUntag(LOperand* value, bool needs_check)
1738
+ : needs_check_(needs_check) {
1739
+ inputs_[0] = value;
1740
+ }
1741
+
1742
+ DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
1743
+
1744
+ bool needs_check() const { return needs_check_; }
1745
+
1746
+ private:
1747
+ bool needs_check_;
1748
+ };
1749
+
1750
+
1751
+ class LStoreNamedField: public LTemplateInstruction<0, 2, 1> {
1752
+ public:
1753
+ LStoreNamedField(LOperand* obj, LOperand* val, LOperand* temp) {
1754
+ inputs_[0] = obj;
1755
+ inputs_[1] = val;
1756
+ temps_[0] = temp;
1757
+ }
1758
+
1759
+ DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
1760
+ DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
1761
+
1762
+ virtual void PrintDataTo(StringStream* stream);
1763
+
1764
+ LOperand* object() { return inputs_[0]; }
1765
+ LOperand* value() { return inputs_[1]; }
1766
+
1767
+ Handle<Object> name() const { return hydrogen()->name(); }
1768
+ bool is_in_object() { return hydrogen()->is_in_object(); }
1769
+ int offset() { return hydrogen()->offset(); }
1770
+ bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
1771
+ Handle<Map> transition() const { return hydrogen()->transition(); }
1772
+ };
1773
+
1774
+
1775
+ class LStoreNamedGeneric: public LTemplateInstruction<0, 3, 0> {
1776
+ public:
1777
+ LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) {
1778
+ inputs_[0] = context;
1779
+ inputs_[1] = object;
1780
+ inputs_[2] = value;
1781
+ }
1782
+
1783
+ DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
1784
+ DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
1785
+
1786
+ virtual void PrintDataTo(StringStream* stream);
1787
+
1788
+ LOperand* context() { return inputs_[0]; }
1789
+ LOperand* object() { return inputs_[1]; }
1790
+ LOperand* value() { return inputs_[2]; }
1791
+ Handle<Object> name() const { return hydrogen()->name(); }
1792
+ bool strict_mode() { return hydrogen()->strict_mode(); }
1793
+ };
1794
+
1795
+
1796
+ class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> {
1797
+ public:
1798
+ LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) {
1799
+ inputs_[0] = obj;
1800
+ inputs_[1] = key;
1801
+ inputs_[2] = val;
1802
+ }
1803
+
1804
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
1805
+ "store-keyed-fast-element")
1806
+ DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
1807
+
1808
+ virtual void PrintDataTo(StringStream* stream);
1809
+
1810
+ LOperand* object() { return inputs_[0]; }
1811
+ LOperand* key() { return inputs_[1]; }
1812
+ LOperand* value() { return inputs_[2]; }
1813
+ };
1814
+
1815
+
1816
+ class LStoreKeyedSpecializedArrayElement: public LTemplateInstruction<0, 3, 0> {
1817
+ public:
1818
+ LStoreKeyedSpecializedArrayElement(LOperand* external_pointer,
1819
+ LOperand* key,
1820
+ LOperand* val) {
1821
+ inputs_[0] = external_pointer;
1822
+ inputs_[1] = key;
1823
+ inputs_[2] = val;
1824
+ }
1825
+
1826
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement,
1827
+ "store-keyed-specialized-array-element")
1828
+ DECLARE_HYDROGEN_ACCESSOR(StoreKeyedSpecializedArrayElement)
1829
+
1830
+ LOperand* external_pointer() { return inputs_[0]; }
1831
+ LOperand* key() { return inputs_[1]; }
1832
+ LOperand* value() { return inputs_[2]; }
1833
+ ExternalArrayType array_type() const {
1834
+ return hydrogen()->array_type();
1835
+ }
1836
+ };
1837
+
1838
+
1839
+ class LStoreKeyedGeneric: public LTemplateInstruction<0, 4, 0> {
1840
+ public:
1841
+ LStoreKeyedGeneric(LOperand* context,
1842
+ LOperand* object,
1843
+ LOperand* key,
1844
+ LOperand* value) {
1845
+ inputs_[0] = context;
1846
+ inputs_[1] = object;
1847
+ inputs_[2] = key;
1848
+ inputs_[3] = value;
1849
+ }
1850
+
1851
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
1852
+ DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
1853
+
1854
+ virtual void PrintDataTo(StringStream* stream);
1855
+
1856
+ LOperand* context() { return inputs_[0]; }
1857
+ LOperand* object() { return inputs_[1]; }
1858
+ LOperand* key() { return inputs_[2]; }
1859
+ LOperand* value() { return inputs_[3]; }
1860
+ bool strict_mode() { return hydrogen()->strict_mode(); }
1861
+ };
1862
+
1863
+
1864
+ class LStringAdd: public LTemplateInstruction<1, 2, 0> {
1865
+ public:
1866
+ LStringAdd(LOperand* left, LOperand* right) {
1867
+ inputs_[0] = left;
1868
+ inputs_[1] = right;
1869
+ }
1870
+
1871
+ DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
1872
+ DECLARE_HYDROGEN_ACCESSOR(StringAdd)
1873
+
1874
+ LOperand* left() { return inputs_[0]; }
1875
+ LOperand* right() { return inputs_[1]; }
1876
+ };
1877
+
1878
+
1879
+ class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> {
1880
+ public:
1881
+ LStringCharCodeAt(LOperand* string, LOperand* index) {
1882
+ inputs_[0] = string;
1883
+ inputs_[1] = index;
1884
+ }
1885
+
1886
+ DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
1887
+ DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
1888
+
1889
+ LOperand* string() { return inputs_[0]; }
1890
+ LOperand* index() { return inputs_[1]; }
1891
+ };
1892
+
1893
+
1894
+ class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> {
1895
+ public:
1896
+ explicit LStringCharFromCode(LOperand* char_code) {
1897
+ inputs_[0] = char_code;
1898
+ }
1899
+
1900
+ DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
1901
+ DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
1902
+
1903
+ LOperand* char_code() { return inputs_[0]; }
1904
+ };
1905
+
1906
+
1907
+ class LStringLength: public LTemplateInstruction<1, 1, 0> {
1908
+ public:
1909
+ explicit LStringLength(LOperand* string) {
1910
+ inputs_[0] = string;
1911
+ }
1912
+
1913
+ DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length")
1914
+ DECLARE_HYDROGEN_ACCESSOR(StringLength)
1915
+
1916
+ LOperand* string() { return inputs_[0]; }
1917
+ };
1918
+
1919
+
1920
+ class LCheckFunction: public LTemplateInstruction<0, 1, 0> {
1921
+ public:
1922
+ explicit LCheckFunction(LOperand* value) {
1923
+ inputs_[0] = value;
1924
+ }
1925
+
1926
+ DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function")
1927
+ DECLARE_HYDROGEN_ACCESSOR(CheckFunction)
1928
+ };
1929
+
1930
+
1931
+ class LCheckInstanceType: public LTemplateInstruction<0, 1, 1> {
1932
+ public:
1933
+ LCheckInstanceType(LOperand* value, LOperand* temp) {
1934
+ inputs_[0] = value;
1935
+ temps_[0] = temp;
1936
+ }
1937
+
1938
+ DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
1939
+ DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
1940
+ };
1941
+
1942
+
1943
+ class LCheckMap: public LTemplateInstruction<0, 1, 0> {
1944
+ public:
1945
+ explicit LCheckMap(LOperand* value) {
1946
+ inputs_[0] = value;
1947
+ }
1948
+
1949
+ DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map")
1950
+ DECLARE_HYDROGEN_ACCESSOR(CheckMap)
1951
+ };
1952
+
1953
+
1954
+ class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 1> {
1955
+ public:
1956
+ explicit LCheckPrototypeMaps(LOperand* temp) {
1957
+ temps_[0] = temp;
1958
+ }
1959
+
1960
+ DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps")
1961
+ DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps)
1962
+
1963
+ Handle<JSObject> prototype() const { return hydrogen()->prototype(); }
1964
+ Handle<JSObject> holder() const { return hydrogen()->holder(); }
1965
+ };
1966
+
1967
+
1968
+ class LCheckSmi: public LTemplateInstruction<0, 1, 0> {
1969
+ public:
1970
+ explicit LCheckSmi(LOperand* value) {
1971
+ inputs_[0] = value;
1972
+ }
1973
+
1974
+ DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
1975
+ };
1976
+
1977
+
1978
+ class LClampDToUint8: public LTemplateInstruction<1, 1, 0> {
1979
+ public:
1980
+ explicit LClampDToUint8(LOperand* value) {
1981
+ inputs_[0] = value;
1982
+ }
1983
+
1984
+ LOperand* unclamped() { return inputs_[0]; }
1985
+
1986
+ DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
1987
+ };
1988
+
1989
+
1990
+ class LClampIToUint8: public LTemplateInstruction<1, 1, 0> {
1991
+ public:
1992
+ explicit LClampIToUint8(LOperand* value) {
1993
+ inputs_[0] = value;
1994
+ }
1995
+
1996
+ LOperand* unclamped() { return inputs_[0]; }
1997
+
1998
+ DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
1999
+ };
2000
+
2001
+
2002
+ class LClampTToUint8: public LTemplateInstruction<1, 1, 1> {
2003
+ public:
2004
+ LClampTToUint8(LOperand* value, LOperand* temp) {
2005
+ inputs_[0] = value;
2006
+ temps_[0] = temp;
2007
+ }
2008
+
2009
+ LOperand* unclamped() { return inputs_[0]; }
2010
+
2011
+ DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
2012
+ };
2013
+
2014
+
2015
+ class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> {
2016
+ public:
2017
+ explicit LCheckNonSmi(LOperand* value) {
2018
+ inputs_[0] = value;
2019
+ }
2020
+
2021
+ DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
2022
+ };
2023
+
2024
+
2025
+ class LArrayLiteral: public LTemplateInstruction<1, 0, 0> {
2026
+ public:
2027
+ DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array-literal")
2028
+ DECLARE_HYDROGEN_ACCESSOR(ArrayLiteral)
2029
+ };
2030
+
2031
+
2032
+ class LObjectLiteral: public LTemplateInstruction<1, 1, 0> {
2033
+ public:
2034
+ explicit LObjectLiteral(LOperand* context) {
2035
+ inputs_[0] = context;
2036
+ }
2037
+
2038
+ DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal")
2039
+ DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral)
2040
+
2041
+ LOperand* context() { return inputs_[0]; }
2042
+ };
2043
+
2044
+
2045
+ class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> {
2046
+ public:
2047
+ DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
2048
+ DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
2049
+ };
2050
+
2051
+
2052
+ class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> {
2053
+ public:
2054
+ DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
2055
+ DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
2056
+
2057
+ Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); }
2058
+ };
2059
+
2060
+
2061
+ class LToFastProperties: public LTemplateInstruction<1, 1, 0> {
2062
+ public:
2063
+ explicit LToFastProperties(LOperand* value) {
2064
+ inputs_[0] = value;
2065
+ }
2066
+
2067
+ DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties")
2068
+ DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
2069
+ };
2070
+
2071
+
2072
+ class LTypeof: public LTemplateInstruction<1, 1, 0> {
2073
+ public:
2074
+ explicit LTypeof(LOperand* value) {
2075
+ inputs_[0] = value;
2076
+ }
2077
+
2078
+ DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
2079
+ };
2080
+
2081
+
2082
+ class LTypeofIs: public LTemplateInstruction<1, 1, 0> {
2083
+ public:
2084
+ explicit LTypeofIs(LOperand* value) {
2085
+ inputs_[0] = value;
2086
+ }
2087
+
2088
+ DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is")
2089
+ DECLARE_HYDROGEN_ACCESSOR(TypeofIs)
2090
+
2091
+ Handle<String> type_literal() { return hydrogen()->type_literal(); }
2092
+
2093
+ virtual void PrintDataTo(StringStream* stream);
2094
+ };
2095
+
2096
+
2097
+ class LTypeofIsAndBranch: public LControlInstruction<1, 0> {
2098
+ public:
2099
+ explicit LTypeofIsAndBranch(LOperand* value) {
2100
+ inputs_[0] = value;
2101
+ }
2102
+
2103
+ DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
2104
+ DECLARE_HYDROGEN_ACCESSOR(TypeofIs)
2105
+
2106
+ Handle<String> type_literal() { return hydrogen()->type_literal(); }
2107
+
2108
+ virtual void PrintDataTo(StringStream* stream);
2109
+ };
2110
+
2111
+
2112
+ class LDeleteProperty: public LTemplateInstruction<1, 2, 0> {
2113
+ public:
2114
+ LDeleteProperty(LOperand* obj, LOperand* key) {
2115
+ inputs_[0] = obj;
2116
+ inputs_[1] = key;
2117
+ }
2118
+
2119
+ DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
2120
+
2121
+ LOperand* object() { return inputs_[0]; }
2122
+ LOperand* key() { return inputs_[1]; }
2123
+ };
2124
+
2125
+
2126
+ class LOsrEntry: public LTemplateInstruction<0, 0, 0> {
2127
+ public:
2128
+ LOsrEntry();
2129
+
2130
+ DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
2131
+
2132
+ LOperand** SpilledRegisterArray() { return register_spills_; }
2133
+ LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; }
2134
+
2135
+ void MarkSpilledRegister(int allocation_index, LOperand* spill_operand);
2136
+ void MarkSpilledDoubleRegister(int allocation_index,
2137
+ LOperand* spill_operand);
2138
+
2139
+ private:
2140
+ // Arrays of spill slot operands for registers with an assigned spill
2141
+ // slot, i.e., that must also be restored to the spill slot on OSR entry.
2142
+ // NULL if the register has no assigned spill slot. Indexed by allocation
2143
+ // index.
2144
+ LOperand* register_spills_[Register::kNumAllocatableRegisters];
2145
+ LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters];
2146
+ };
2147
+
2148
+
2149
+ class LStackCheck: public LTemplateInstruction<0, 0, 0> {
2150
+ public:
2151
+ DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
2152
+ };
2153
+
2154
+
2155
+ class LIn: public LTemplateInstruction<1, 2, 0> {
2156
+ public:
2157
+ LIn(LOperand* key, LOperand* object) {
2158
+ inputs_[0] = key;
2159
+ inputs_[1] = object;
2160
+ }
2161
+
2162
+ LOperand* key() { return inputs_[0]; }
2163
+ LOperand* object() { return inputs_[1]; }
2164
+
2165
+ DECLARE_CONCRETE_INSTRUCTION(In, "in")
2166
+ };
2167
+
2168
+
2169
+ class LChunkBuilder;
2170
+ class LChunk: public ZoneObject {
2171
+ public:
2172
+ explicit LChunk(CompilationInfo* info, HGraph* graph)
2173
+ : spill_slot_count_(0),
2174
+ info_(info),
2175
+ graph_(graph),
2176
+ instructions_(32),
2177
+ pointer_maps_(8),
2178
+ inlined_closures_(1) { }
2179
+
2180
+ void AddInstruction(LInstruction* instruction, HBasicBlock* block);
2181
+ LConstantOperand* DefineConstantOperand(HConstant* constant);
2182
+ Handle<Object> LookupLiteral(LConstantOperand* operand) const;
2183
+ Representation LookupLiteralRepresentation(LConstantOperand* operand) const;
2184
+
2185
+ int GetNextSpillIndex(bool is_double);
2186
+ LOperand* GetNextSpillSlot(bool is_double);
2187
+
2188
+ int ParameterAt(int index);
2189
+ int GetParameterStackSlot(int index) const;
2190
+ int spill_slot_count() const { return spill_slot_count_; }
2191
+ CompilationInfo* info() const { return info_; }
2192
+ HGraph* graph() const { return graph_; }
2193
+ const ZoneList<LInstruction*>* instructions() const { return &instructions_; }
2194
+ void AddGapMove(int index, LOperand* from, LOperand* to);
2195
+ LGap* GetGapAt(int index) const;
2196
+ bool IsGapAt(int index) const;
2197
+ int NearestGapPos(int index) const;
2198
+ void MarkEmptyBlocks();
2199
+ const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; }
2200
+ LLabel* GetLabel(int block_id) const {
2201
+ HBasicBlock* block = graph_->blocks()->at(block_id);
2202
+ int first_instruction = block->first_instruction_index();
2203
+ return LLabel::cast(instructions_[first_instruction]);
2204
+ }
2205
+ int LookupDestination(int block_id) const {
2206
+ LLabel* cur = GetLabel(block_id);
2207
+ while (cur->replacement() != NULL) {
2208
+ cur = cur->replacement();
2209
+ }
2210
+ return cur->block_id();
2211
+ }
2212
+ Label* GetAssemblyLabel(int block_id) const {
2213
+ LLabel* label = GetLabel(block_id);
2214
+ ASSERT(!label->HasReplacement());
2215
+ return label->label();
2216
+ }
2217
+
2218
+ const ZoneList<Handle<JSFunction> >* inlined_closures() const {
2219
+ return &inlined_closures_;
2220
+ }
2221
+
2222
+ void AddInlinedClosure(Handle<JSFunction> closure) {
2223
+ inlined_closures_.Add(closure);
2224
+ }
2225
+
2226
+ private:
2227
+ int spill_slot_count_;
2228
+ CompilationInfo* info_;
2229
+ HGraph* const graph_;
2230
+ ZoneList<LInstruction*> instructions_;
2231
+ ZoneList<LPointerMap*> pointer_maps_;
2232
+ ZoneList<Handle<JSFunction> > inlined_closures_;
2233
+ };
2234
+
2235
+
2236
+ class LChunkBuilder BASE_EMBEDDED {
2237
+ public:
2238
+ LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
2239
+ : chunk_(NULL),
2240
+ info_(info),
2241
+ graph_(graph),
2242
+ status_(UNUSED),
2243
+ current_instruction_(NULL),
2244
+ current_block_(NULL),
2245
+ next_block_(NULL),
2246
+ argument_count_(0),
2247
+ allocator_(allocator),
2248
+ position_(RelocInfo::kNoPosition),
2249
+ instruction_pending_deoptimization_environment_(NULL),
2250
+ pending_deoptimization_ast_id_(AstNode::kNoNumber) { }
2251
+
2252
+ // Build the sequence for the graph.
2253
+ LChunk* Build();
2254
+
2255
+ // Declare methods that deal with the individual node types.
2256
+ #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2257
+ HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
2258
+ #undef DECLARE_DO
2259
+
2260
+ private:
2261
+ enum Status {
2262
+ UNUSED,
2263
+ BUILDING,
2264
+ DONE,
2265
+ ABORTED
2266
+ };
2267
+
2268
+ LChunk* chunk() const { return chunk_; }
2269
+ CompilationInfo* info() const { return info_; }
2270
+ HGraph* graph() const { return graph_; }
2271
+
2272
+ bool is_unused() const { return status_ == UNUSED; }
2273
+ bool is_building() const { return status_ == BUILDING; }
2274
+ bool is_done() const { return status_ == DONE; }
2275
+ bool is_aborted() const { return status_ == ABORTED; }
2276
+
2277
+ void Abort(const char* format, ...);
2278
+
2279
+ // Methods for getting operands for Use / Define / Temp.
2280
+ LRegister* ToOperand(Register reg);
2281
+ LUnallocated* ToUnallocated(Register reg);
2282
+ LUnallocated* ToUnallocated(XMMRegister reg);
2283
+
2284
+ // Methods for setting up define-use relationships.
2285
+ MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand);
2286
+ MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register);
2287
+ MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value,
2288
+ XMMRegister fixed_register);
2289
+
2290
+ // A value that is guaranteed to be allocated to a register.
2291
+ // Operand created by UseRegister is guaranteed to be live until the end of
2292
+ // instruction. This means that register allocator will not reuse it's
2293
+ // register for any other operand inside instruction.
2294
+ // Operand created by UseRegisterAtStart is guaranteed to be live only at
2295
+ // instruction start. Register allocator is free to assign the same register
2296
+ // to some other operand used inside instruction (i.e. temporary or
2297
+ // output).
2298
+ MUST_USE_RESULT LOperand* UseRegister(HValue* value);
2299
+ MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value);
2300
+
2301
+ // An input operand in a register that may be trashed.
2302
+ MUST_USE_RESULT LOperand* UseTempRegister(HValue* value);
2303
+
2304
+ // An input operand in a register or stack slot.
2305
+ MUST_USE_RESULT LOperand* Use(HValue* value);
2306
+ MUST_USE_RESULT LOperand* UseAtStart(HValue* value);
2307
+
2308
+ // An input operand in a register, stack slot or a constant operand.
2309
+ MUST_USE_RESULT LOperand* UseOrConstant(HValue* value);
2310
+ MUST_USE_RESULT LOperand* UseOrConstantAtStart(HValue* value);
2311
+
2312
+ // An input operand in a register or a constant operand.
2313
+ MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value);
2314
+ MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value);
2315
+
2316
+ // An input operand in register, stack slot or a constant operand.
2317
+ // Will not be moved to a register even if one is freely available.
2318
+ MUST_USE_RESULT LOperand* UseAny(HValue* value);
2319
+
2320
+ // Temporary operand that must be in a register.
2321
+ MUST_USE_RESULT LUnallocated* TempRegister();
2322
+ MUST_USE_RESULT LOperand* FixedTemp(Register reg);
2323
+ MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg);
2324
+
2325
+ // Methods for setting up define-use relationships.
2326
+ // Return the same instruction that they are passed.
2327
+ template<int I, int T>
2328
+ LInstruction* Define(LTemplateInstruction<1, I, T>* instr,
2329
+ LUnallocated* result);
2330
+ template<int I, int T>
2331
+ LInstruction* Define(LTemplateInstruction<1, I, T>* instr);
2332
+ template<int I, int T>
2333
+ LInstruction* DefineAsRegister(LTemplateInstruction<1, I, T>* instr);
2334
+ template<int I, int T>
2335
+ LInstruction* DefineAsSpilled(LTemplateInstruction<1, I, T>* instr,
2336
+ int index);
2337
+ template<int I, int T>
2338
+ LInstruction* DefineSameAsFirst(LTemplateInstruction<1, I, T>* instr);
2339
+ template<int I, int T>
2340
+ LInstruction* DefineFixed(LTemplateInstruction<1, I, T>* instr,
2341
+ Register reg);
2342
+ template<int I, int T>
2343
+ LInstruction* DefineFixedDouble(LTemplateInstruction<1, I, T>* instr,
2344
+ XMMRegister reg);
2345
+ LInstruction* AssignEnvironment(LInstruction* instr);
2346
+ LInstruction* AssignPointerMap(LInstruction* instr);
2347
+
2348
+ enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
2349
+
2350
+ // By default we assume that instruction sequences generated for calls
2351
+ // cannot deoptimize eagerly and we do not attach environment to this
2352
+ // instruction.
2353
+ LInstruction* MarkAsCall(
2354
+ LInstruction* instr,
2355
+ HInstruction* hinstr,
2356
+ CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
2357
+ LInstruction* MarkAsSaveDoubles(LInstruction* instr);
2358
+
2359
+ LInstruction* SetInstructionPendingDeoptimizationEnvironment(
2360
+ LInstruction* instr, int ast_id);
2361
+ void ClearInstructionPendingDeoptimizationEnvironment();
2362
+
2363
+ LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env);
2364
+
2365
+ void VisitInstruction(HInstruction* current);
2366
+
2367
+ void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
2368
+ LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr);
2369
+ LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
2370
+ LInstruction* DoArithmeticD(Token::Value op,
2371
+ HArithmeticBinaryOperation* instr);
2372
+ LInstruction* DoArithmeticT(Token::Value op,
2373
+ HArithmeticBinaryOperation* instr);
2374
+
2375
+ LChunk* chunk_;
2376
+ CompilationInfo* info_;
2377
+ HGraph* const graph_;
2378
+ Status status_;
2379
+ HInstruction* current_instruction_;
2380
+ HBasicBlock* current_block_;
2381
+ HBasicBlock* next_block_;
2382
+ int argument_count_;
2383
+ LAllocator* allocator_;
2384
+ int position_;
2385
+ LInstruction* instruction_pending_deoptimization_environment_;
2386
+ int pending_deoptimization_ast_id_;
2387
+
2388
+ DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2389
+ };
2390
+
2391
+ #undef DECLARE_HYDROGEN_ACCESSOR
2392
+ #undef DECLARE_CONCRETE_INSTRUCTION
2393
+
2394
+ } } // namespace v8::internal
2395
+
2396
+ #endif // V8_IA32_LITHIUM_IA32_H_