therubyracer 0.9.0beta2 → 0.9.0beta3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of therubyracer might be problematic. Click here for more details.

Files changed (920) hide show
  1. data/.gitmodules +3 -0
  2. data/ext/v8/upstream/Makefile +1 -2
  3. data/ext/v8/upstream/v8/.gitignore +33 -0
  4. data/ext/v8/upstream/v8/AUTHORS +42 -0
  5. data/ext/v8/upstream/v8/ChangeLog +2663 -0
  6. data/ext/v8/upstream/{3.1.8 → v8}/LICENSE +0 -0
  7. data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.strongtalk +0 -0
  8. data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.v8 +0 -0
  9. data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.valgrind +0 -0
  10. data/ext/v8/upstream/v8/SConstruct +1473 -0
  11. data/ext/v8/upstream/{3.1.8 → v8}/build/README.txt +0 -0
  12. data/ext/v8/upstream/{3.1.8 → v8}/build/all.gyp +0 -0
  13. data/ext/v8/upstream/{3.1.8 → v8}/build/armu.gypi +0 -0
  14. data/ext/v8/upstream/{3.1.8 → v8}/build/common.gypi +0 -0
  15. data/ext/v8/upstream/{3.1.8 → v8}/build/gyp_v8 +0 -0
  16. data/ext/v8/upstream/v8/include/v8-debug.h +394 -0
  17. data/ext/v8/upstream/v8/include/v8-preparser.h +116 -0
  18. data/ext/v8/upstream/v8/include/v8-profiler.h +505 -0
  19. data/ext/v8/upstream/v8/include/v8-testing.h +104 -0
  20. data/ext/v8/upstream/v8/include/v8.h +4000 -0
  21. data/ext/v8/upstream/{3.1.8 → v8}/include/v8stdint.h +0 -0
  22. data/ext/v8/upstream/v8/preparser/SConscript +38 -0
  23. data/ext/v8/upstream/v8/preparser/preparser-process.cc +169 -0
  24. data/ext/v8/upstream/v8/src/SConscript +380 -0
  25. data/ext/v8/upstream/v8/src/accessors.cc +766 -0
  26. data/ext/v8/upstream/{3.1.8 → v8}/src/accessors.h +0 -0
  27. data/ext/v8/upstream/v8/src/allocation-inl.h +49 -0
  28. data/ext/v8/upstream/v8/src/allocation.cc +122 -0
  29. data/ext/v8/upstream/v8/src/allocation.h +143 -0
  30. data/ext/v8/upstream/v8/src/api.cc +5678 -0
  31. data/ext/v8/upstream/v8/src/api.h +572 -0
  32. data/ext/v8/upstream/{3.1.8 → v8}/src/apinatives.js +0 -0
  33. data/ext/v8/upstream/v8/src/apiutils.h +73 -0
  34. data/ext/v8/upstream/v8/src/arguments.h +116 -0
  35. data/ext/v8/upstream/v8/src/arm/assembler-arm-inl.h +353 -0
  36. data/ext/v8/upstream/v8/src/arm/assembler-arm.cc +2877 -0
  37. data/ext/v8/upstream/v8/src/arm/assembler-arm.h +1382 -0
  38. data/ext/v8/upstream/v8/src/arm/builtins-arm.cc +1634 -0
  39. data/ext/v8/upstream/v8/src/arm/code-stubs-arm.cc +6917 -0
  40. data/ext/v8/upstream/v8/src/arm/code-stubs-arm.h +623 -0
  41. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/codegen-arm-inl.h +0 -0
  42. data/ext/v8/upstream/v8/src/arm/codegen-arm.cc +7437 -0
  43. data/ext/v8/upstream/v8/src/arm/codegen-arm.h +595 -0
  44. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/constants-arm.cc +0 -0
  45. data/ext/v8/upstream/v8/src/arm/constants-arm.h +778 -0
  46. data/ext/v8/upstream/v8/src/arm/cpu-arm.cc +149 -0
  47. data/ext/v8/upstream/v8/src/arm/debug-arm.cc +317 -0
  48. data/ext/v8/upstream/v8/src/arm/deoptimizer-arm.cc +737 -0
  49. data/ext/v8/upstream/v8/src/arm/disasm-arm.cc +1503 -0
  50. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/frames-arm.cc +0 -0
  51. data/ext/v8/upstream/v8/src/arm/frames-arm.h +168 -0
  52. data/ext/v8/upstream/v8/src/arm/full-codegen-arm.cc +4374 -0
  53. data/ext/v8/upstream/v8/src/arm/ic-arm.cc +1793 -0
  54. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/jump-target-arm.cc +0 -0
  55. data/ext/v8/upstream/v8/src/arm/lithium-arm.cc +2120 -0
  56. data/ext/v8/upstream/v8/src/arm/lithium-arm.h +2179 -0
  57. data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.cc +4132 -0
  58. data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.h +329 -0
  59. data/ext/v8/upstream/v8/src/arm/lithium-gap-resolver-arm.cc +305 -0
  60. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/lithium-gap-resolver-arm.h +0 -0
  61. data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.cc +2939 -0
  62. data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.h +1071 -0
  63. data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.cc +1287 -0
  64. data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.h +253 -0
  65. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm-inl.h +0 -0
  66. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm.cc +0 -0
  67. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm.h +0 -0
  68. data/ext/v8/upstream/v8/src/arm/simulator-arm.cc +3288 -0
  69. data/ext/v8/upstream/v8/src/arm/simulator-arm.h +413 -0
  70. data/ext/v8/upstream/v8/src/arm/stub-cache-arm.cc +4034 -0
  71. data/ext/v8/upstream/{3.1.8 → v8}/src/arm/virtual-frame-arm-inl.h +0 -0
  72. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.cc +843 -0
  73. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.h +523 -0
  74. data/ext/v8/upstream/v8/src/array.js +1249 -0
  75. data/ext/v8/upstream/v8/src/assembler.cc +1067 -0
  76. data/ext/v8/upstream/v8/src/assembler.h +823 -0
  77. data/ext/v8/upstream/v8/src/ast-inl.h +112 -0
  78. data/ext/v8/upstream/v8/src/ast.cc +1078 -0
  79. data/ext/v8/upstream/v8/src/ast.h +2234 -0
  80. data/ext/v8/upstream/v8/src/atomicops.h +167 -0
  81. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_arm_gcc.h +0 -0
  82. data/ext/v8/upstream/v8/src/atomicops_internals_mips_gcc.h +169 -0
  83. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_gcc.cc +0 -0
  84. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_gcc.h +0 -0
  85. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_macosx.h +0 -0
  86. data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_msvc.h +0 -0
  87. data/ext/v8/upstream/{3.1.8 → v8}/src/bignum-dtoa.cc +0 -0
  88. data/ext/v8/upstream/{3.1.8 → v8}/src/bignum-dtoa.h +0 -0
  89. data/ext/v8/upstream/{3.1.8 → v8}/src/bignum.cc +0 -0
  90. data/ext/v8/upstream/{3.1.8 → v8}/src/bignum.h +0 -0
  91. data/ext/v8/upstream/v8/src/bootstrapper.cc +2138 -0
  92. data/ext/v8/upstream/v8/src/bootstrapper.h +185 -0
  93. data/ext/v8/upstream/v8/src/builtins.cc +1708 -0
  94. data/ext/v8/upstream/v8/src/builtins.h +368 -0
  95. data/ext/v8/upstream/{3.1.8 → v8}/src/bytecodes-irregexp.h +0 -0
  96. data/ext/v8/upstream/{3.1.8 → v8}/src/cached-powers.cc +0 -0
  97. data/ext/v8/upstream/{3.1.8 → v8}/src/cached-powers.h +0 -0
  98. data/ext/v8/upstream/{3.1.8 → v8}/src/char-predicates-inl.h +0 -0
  99. data/ext/v8/upstream/{3.1.8 → v8}/src/char-predicates.h +0 -0
  100. data/ext/v8/upstream/v8/src/checks.cc +110 -0
  101. data/ext/v8/upstream/v8/src/checks.h +296 -0
  102. data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue-inl.h +0 -0
  103. data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue.cc +0 -0
  104. data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue.h +0 -0
  105. data/ext/v8/upstream/v8/src/code-stubs.cc +240 -0
  106. data/ext/v8/upstream/v8/src/code-stubs.h +971 -0
  107. data/ext/v8/upstream/{3.1.8 → v8}/src/code.h +0 -0
  108. data/ext/v8/upstream/v8/src/codegen-inl.h +68 -0
  109. data/ext/v8/upstream/v8/src/codegen.cc +505 -0
  110. data/ext/v8/upstream/v8/src/codegen.h +245 -0
  111. data/ext/v8/upstream/v8/src/compilation-cache.cc +540 -0
  112. data/ext/v8/upstream/v8/src/compilation-cache.h +287 -0
  113. data/ext/v8/upstream/v8/src/compiler.cc +792 -0
  114. data/ext/v8/upstream/v8/src/compiler.h +307 -0
  115. data/ext/v8/upstream/v8/src/contexts.cc +327 -0
  116. data/ext/v8/upstream/v8/src/contexts.h +382 -0
  117. data/ext/v8/upstream/{3.1.8 → v8}/src/conversions-inl.h +0 -0
  118. data/ext/v8/upstream/v8/src/conversions.cc +1125 -0
  119. data/ext/v8/upstream/{3.1.8 → v8}/src/conversions.h +0 -0
  120. data/ext/v8/upstream/v8/src/counters.cc +93 -0
  121. data/ext/v8/upstream/v8/src/counters.h +254 -0
  122. data/ext/v8/upstream/v8/src/cpu-profiler-inl.h +101 -0
  123. data/ext/v8/upstream/v8/src/cpu-profiler.cc +606 -0
  124. data/ext/v8/upstream/v8/src/cpu-profiler.h +305 -0
  125. data/ext/v8/upstream/v8/src/cpu.h +67 -0
  126. data/ext/v8/upstream/v8/src/d8-debug.cc +367 -0
  127. data/ext/v8/upstream/v8/src/d8-debug.h +158 -0
  128. data/ext/v8/upstream/v8/src/d8-posix.cc +695 -0
  129. data/ext/v8/upstream/{3.1.8 → v8}/src/d8-readline.cc +0 -0
  130. data/ext/v8/upstream/{3.1.8 → v8}/src/d8-windows.cc +0 -0
  131. data/ext/v8/upstream/v8/src/d8.cc +796 -0
  132. data/ext/v8/upstream/v8/src/d8.gyp +88 -0
  133. data/ext/v8/upstream/{3.1.8 → v8}/src/d8.h +0 -0
  134. data/ext/v8/upstream/{3.1.8 → v8}/src/d8.js +0 -0
  135. data/ext/v8/upstream/{3.1.8 → v8}/src/data-flow.cc +0 -0
  136. data/ext/v8/upstream/v8/src/data-flow.h +379 -0
  137. data/ext/v8/upstream/{3.1.8 → v8}/src/date.js +0 -0
  138. data/ext/v8/upstream/{3.1.8 → v8}/src/dateparser-inl.h +0 -0
  139. data/ext/v8/upstream/{3.1.8 → v8}/src/dateparser.cc +0 -0
  140. data/ext/v8/upstream/v8/src/dateparser.h +265 -0
  141. data/ext/v8/upstream/v8/src/debug-agent.cc +447 -0
  142. data/ext/v8/upstream/v8/src/debug-agent.h +129 -0
  143. data/ext/v8/upstream/{3.1.8 → v8}/src/debug-debugger.js +0 -0
  144. data/ext/v8/upstream/v8/src/debug.cc +3188 -0
  145. data/ext/v8/upstream/v8/src/debug.h +1055 -0
  146. data/ext/v8/upstream/v8/src/deoptimizer.cc +1296 -0
  147. data/ext/v8/upstream/v8/src/deoptimizer.h +629 -0
  148. data/ext/v8/upstream/v8/src/disasm.h +80 -0
  149. data/ext/v8/upstream/v8/src/disassembler.cc +339 -0
  150. data/ext/v8/upstream/{3.1.8 → v8}/src/disassembler.h +0 -0
  151. data/ext/v8/upstream/{3.1.8 → v8}/src/diy-fp.cc +0 -0
  152. data/ext/v8/upstream/{3.1.8 → v8}/src/diy-fp.h +0 -0
  153. data/ext/v8/upstream/{3.1.8 → v8}/src/double.h +0 -0
  154. data/ext/v8/upstream/{3.1.8 → v8}/src/dtoa.cc +0 -0
  155. data/ext/v8/upstream/{3.1.8 → v8}/src/dtoa.h +0 -0
  156. data/ext/v8/upstream/v8/src/execution.cc +791 -0
  157. data/ext/v8/upstream/v8/src/execution.h +291 -0
  158. data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.cc +250 -0
  159. data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.h +89 -0
  160. data/ext/v8/upstream/v8/src/extensions/experimental/experimental.gyp +55 -0
  161. data/ext/v8/upstream/v8/src/extensions/experimental/i18n-extension.cc +284 -0
  162. data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/experimental/i18n-extension.h +0 -0
  163. data/ext/v8/upstream/v8/src/extensions/externalize-string-extension.cc +141 -0
  164. data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/externalize-string-extension.h +0 -0
  165. data/ext/v8/upstream/v8/src/extensions/gc-extension.cc +58 -0
  166. data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/gc-extension.h +0 -0
  167. data/ext/v8/upstream/v8/src/factory.cc +1194 -0
  168. data/ext/v8/upstream/v8/src/factory.h +436 -0
  169. data/ext/v8/upstream/{3.1.8 → v8}/src/fast-dtoa.cc +0 -0
  170. data/ext/v8/upstream/{3.1.8 → v8}/src/fast-dtoa.h +0 -0
  171. data/ext/v8/upstream/{3.1.8 → v8}/src/fixed-dtoa.cc +0 -0
  172. data/ext/v8/upstream/{3.1.8 → v8}/src/fixed-dtoa.h +0 -0
  173. data/ext/v8/upstream/v8/src/flag-definitions.h +556 -0
  174. data/ext/v8/upstream/{3.1.8 → v8}/src/flags.cc +0 -0
  175. data/ext/v8/upstream/{3.1.8 → v8}/src/flags.h +0 -0
  176. data/ext/v8/upstream/v8/src/frame-element.cc +37 -0
  177. data/ext/v8/upstream/v8/src/frame-element.h +269 -0
  178. data/ext/v8/upstream/v8/src/frames-inl.h +236 -0
  179. data/ext/v8/upstream/v8/src/frames.cc +1273 -0
  180. data/ext/v8/upstream/v8/src/frames.h +854 -0
  181. data/ext/v8/upstream/v8/src/full-codegen.cc +1385 -0
  182. data/ext/v8/upstream/v8/src/full-codegen.h +753 -0
  183. data/ext/v8/upstream/v8/src/func-name-inferrer.cc +91 -0
  184. data/ext/v8/upstream/v8/src/func-name-inferrer.h +111 -0
  185. data/ext/v8/upstream/v8/src/gdb-jit.cc +1548 -0
  186. data/ext/v8/upstream/{3.1.8 → v8}/src/gdb-jit.h +0 -0
  187. data/ext/v8/upstream/v8/src/global-handles.cc +596 -0
  188. data/ext/v8/upstream/v8/src/global-handles.h +239 -0
  189. data/ext/v8/upstream/v8/src/globals.h +325 -0
  190. data/ext/v8/upstream/v8/src/handles-inl.h +177 -0
  191. data/ext/v8/upstream/v8/src/handles.cc +965 -0
  192. data/ext/v8/upstream/v8/src/handles.h +372 -0
  193. data/ext/v8/upstream/{3.1.8 → v8}/src/hashmap.cc +0 -0
  194. data/ext/v8/upstream/v8/src/hashmap.h +121 -0
  195. data/ext/v8/upstream/v8/src/heap-inl.h +703 -0
  196. data/ext/v8/upstream/v8/src/heap-profiler.cc +1173 -0
  197. data/ext/v8/upstream/v8/src/heap-profiler.h +396 -0
  198. data/ext/v8/upstream/v8/src/heap.cc +5856 -0
  199. data/ext/v8/upstream/v8/src/heap.h +2264 -0
  200. data/ext/v8/upstream/v8/src/hydrogen-instructions.cc +1639 -0
  201. data/ext/v8/upstream/v8/src/hydrogen-instructions.h +3657 -0
  202. data/ext/v8/upstream/v8/src/hydrogen.cc +6011 -0
  203. data/ext/v8/upstream/v8/src/hydrogen.h +1137 -0
  204. data/ext/v8/upstream/v8/src/ia32/assembler-ia32-inl.h +430 -0
  205. data/ext/v8/upstream/v8/src/ia32/assembler-ia32.cc +2846 -0
  206. data/ext/v8/upstream/v8/src/ia32/assembler-ia32.h +1159 -0
  207. data/ext/v8/upstream/v8/src/ia32/builtins-ia32.cc +1596 -0
  208. data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.cc +6549 -0
  209. data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.h +495 -0
  210. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/codegen-ia32-inl.h +0 -0
  211. data/ext/v8/upstream/v8/src/ia32/codegen-ia32.cc +10385 -0
  212. data/ext/v8/upstream/v8/src/ia32/codegen-ia32.h +801 -0
  213. data/ext/v8/upstream/v8/src/ia32/cpu-ia32.cc +88 -0
  214. data/ext/v8/upstream/v8/src/ia32/debug-ia32.cc +312 -0
  215. data/ext/v8/upstream/v8/src/ia32/deoptimizer-ia32.cc +774 -0
  216. data/ext/v8/upstream/v8/src/ia32/disasm-ia32.cc +1620 -0
  217. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/frames-ia32.cc +0 -0
  218. data/ext/v8/upstream/v8/src/ia32/frames-ia32.h +140 -0
  219. data/ext/v8/upstream/v8/src/ia32/full-codegen-ia32.cc +4357 -0
  220. data/ext/v8/upstream/v8/src/ia32/ic-ia32.cc +1779 -0
  221. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/jump-target-ia32.cc +0 -0
  222. data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.cc +4158 -0
  223. data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.h +318 -0
  224. data/ext/v8/upstream/v8/src/ia32/lithium-gap-resolver-ia32.cc +466 -0
  225. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/lithium-gap-resolver-ia32.h +0 -0
  226. data/ext/v8/upstream/v8/src/ia32/lithium-ia32.cc +2181 -0
  227. data/ext/v8/upstream/v8/src/ia32/lithium-ia32.h +2235 -0
  228. data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.cc +2056 -0
  229. data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.h +807 -0
  230. data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.cc +1264 -0
  231. data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.h +216 -0
  232. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/register-allocator-ia32-inl.h +0 -0
  233. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32.cc +157 -0
  234. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/register-allocator-ia32.h +0 -0
  235. data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/simulator-ia32.cc +0 -0
  236. data/ext/v8/upstream/v8/src/ia32/simulator-ia32.h +72 -0
  237. data/ext/v8/upstream/v8/src/ia32/stub-cache-ia32.cc +3711 -0
  238. data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.cc +1366 -0
  239. data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.h +650 -0
  240. data/ext/v8/upstream/v8/src/ic-inl.h +130 -0
  241. data/ext/v8/upstream/v8/src/ic.cc +2389 -0
  242. data/ext/v8/upstream/v8/src/ic.h +675 -0
  243. data/ext/v8/upstream/{3.1.8 → v8}/src/inspector.cc +0 -0
  244. data/ext/v8/upstream/{3.1.8 → v8}/src/inspector.h +0 -0
  245. data/ext/v8/upstream/v8/src/interpreter-irregexp.cc +659 -0
  246. data/ext/v8/upstream/v8/src/interpreter-irregexp.h +49 -0
  247. data/ext/v8/upstream/v8/src/isolate.cc +883 -0
  248. data/ext/v8/upstream/v8/src/isolate.h +1306 -0
  249. data/ext/v8/upstream/v8/src/json.js +342 -0
  250. data/ext/v8/upstream/v8/src/jsregexp.cc +5371 -0
  251. data/ext/v8/upstream/v8/src/jsregexp.h +1483 -0
  252. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-heavy-inl.h +0 -0
  253. data/ext/v8/upstream/v8/src/jump-target-heavy.cc +427 -0
  254. data/ext/v8/upstream/v8/src/jump-target-heavy.h +238 -0
  255. data/ext/v8/upstream/v8/src/jump-target-inl.h +48 -0
  256. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-light-inl.h +0 -0
  257. data/ext/v8/upstream/v8/src/jump-target-light.cc +111 -0
  258. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-light.h +0 -0
  259. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target.cc +0 -0
  260. data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target.h +0 -0
  261. data/ext/v8/upstream/{3.1.8 → v8}/src/list-inl.h +0 -0
  262. data/ext/v8/upstream/{3.1.8 → v8}/src/list.h +0 -0
  263. data/ext/v8/upstream/v8/src/lithium-allocator-inl.h +142 -0
  264. data/ext/v8/upstream/v8/src/lithium-allocator.cc +2105 -0
  265. data/ext/v8/upstream/v8/src/lithium-allocator.h +630 -0
  266. data/ext/v8/upstream/v8/src/lithium.cc +169 -0
  267. data/ext/v8/upstream/{3.1.8 → v8}/src/lithium.h +0 -0
  268. data/ext/v8/upstream/{3.1.8 → v8}/src/liveedit-debugger.js +0 -0
  269. data/ext/v8/upstream/v8/src/liveedit.cc +1693 -0
  270. data/ext/v8/upstream/v8/src/liveedit.h +179 -0
  271. data/ext/v8/upstream/{3.1.8 → v8}/src/liveobjectlist-inl.h +0 -0
  272. data/ext/v8/upstream/v8/src/liveobjectlist.cc +2589 -0
  273. data/ext/v8/upstream/v8/src/liveobjectlist.h +322 -0
  274. data/ext/v8/upstream/{3.1.8 → v8}/src/log-inl.h +0 -0
  275. data/ext/v8/upstream/v8/src/log-utils.cc +423 -0
  276. data/ext/v8/upstream/v8/src/log-utils.h +229 -0
  277. data/ext/v8/upstream/v8/src/log.cc +1666 -0
  278. data/ext/v8/upstream/v8/src/log.h +446 -0
  279. data/ext/v8/upstream/{3.1.8 → v8}/src/macro-assembler.h +0 -0
  280. data/ext/v8/upstream/{3.1.8 → v8}/src/macros.py +0 -0
  281. data/ext/v8/upstream/v8/src/mark-compact.cc +3092 -0
  282. data/ext/v8/upstream/v8/src/mark-compact.h +506 -0
  283. data/ext/v8/upstream/{3.1.8 → v8}/src/math.js +0 -0
  284. data/ext/v8/upstream/v8/src/messages.cc +166 -0
  285. data/ext/v8/upstream/{3.1.8 → v8}/src/messages.h +0 -0
  286. data/ext/v8/upstream/v8/src/messages.js +1090 -0
  287. data/ext/v8/upstream/v8/src/mips/assembler-mips-inl.h +335 -0
  288. data/ext/v8/upstream/v8/src/mips/assembler-mips.cc +2093 -0
  289. data/ext/v8/upstream/v8/src/mips/assembler-mips.h +1066 -0
  290. data/ext/v8/upstream/v8/src/mips/builtins-mips.cc +148 -0
  291. data/ext/v8/upstream/v8/src/mips/code-stubs-mips.cc +752 -0
  292. data/ext/v8/upstream/v8/src/mips/code-stubs-mips.h +511 -0
  293. data/ext/v8/upstream/v8/src/mips/codegen-mips-inl.h +64 -0
  294. data/ext/v8/upstream/v8/src/mips/codegen-mips.cc +1213 -0
  295. data/ext/v8/upstream/v8/src/mips/codegen-mips.h +633 -0
  296. data/ext/v8/upstream/v8/src/mips/constants-mips.cc +352 -0
  297. data/ext/v8/upstream/v8/src/mips/constants-mips.h +723 -0
  298. data/ext/v8/upstream/v8/src/mips/cpu-mips.cc +90 -0
  299. data/ext/v8/upstream/v8/src/mips/debug-mips.cc +155 -0
  300. data/ext/v8/upstream/v8/src/mips/deoptimizer-mips.cc +91 -0
  301. data/ext/v8/upstream/v8/src/mips/disasm-mips.cc +1023 -0
  302. data/ext/v8/upstream/v8/src/mips/frames-mips.cc +48 -0
  303. data/ext/v8/upstream/v8/src/mips/frames-mips.h +179 -0
  304. data/ext/v8/upstream/v8/src/mips/full-codegen-mips.cc +727 -0
  305. data/ext/v8/upstream/v8/src/mips/ic-mips.cc +244 -0
  306. data/ext/v8/upstream/v8/src/mips/jump-target-mips.cc +80 -0
  307. data/ext/v8/upstream/v8/src/mips/lithium-codegen-mips.h +65 -0
  308. data/ext/v8/upstream/v8/src/mips/lithium-mips.h +304 -0
  309. data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.cc +3327 -0
  310. data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.h +1058 -0
  311. data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.cc +478 -0
  312. data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.h +250 -0
  313. data/ext/v8/upstream/v8/src/mips/register-allocator-mips-inl.h +134 -0
  314. data/ext/v8/upstream/{3.1.8 → v8}/src/mips/register-allocator-mips.cc +0 -0
  315. data/ext/v8/upstream/v8/src/mips/register-allocator-mips.h +47 -0
  316. data/ext/v8/upstream/v8/src/mips/simulator-mips.cc +2438 -0
  317. data/ext/v8/upstream/v8/src/mips/simulator-mips.h +394 -0
  318. data/ext/v8/upstream/v8/src/mips/stub-cache-mips.cc +601 -0
  319. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips-inl.h +58 -0
  320. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.cc +307 -0
  321. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.h +530 -0
  322. data/ext/v8/upstream/v8/src/mirror-debugger.js +2381 -0
  323. data/ext/v8/upstream/v8/src/mksnapshot.cc +256 -0
  324. data/ext/v8/upstream/{3.1.8 → v8}/src/natives.h +0 -0
  325. data/ext/v8/upstream/v8/src/objects-debug.cc +722 -0
  326. data/ext/v8/upstream/v8/src/objects-inl.h +4166 -0
  327. data/ext/v8/upstream/v8/src/objects-printer.cc +801 -0
  328. data/ext/v8/upstream/v8/src/objects-visiting.cc +142 -0
  329. data/ext/v8/upstream/v8/src/objects-visiting.h +422 -0
  330. data/ext/v8/upstream/v8/src/objects.cc +10296 -0
  331. data/ext/v8/upstream/v8/src/objects.h +6662 -0
  332. data/ext/v8/upstream/v8/src/parser.cc +5168 -0
  333. data/ext/v8/upstream/v8/src/parser.h +823 -0
  334. data/ext/v8/upstream/v8/src/platform-cygwin.cc +811 -0
  335. data/ext/v8/upstream/v8/src/platform-freebsd.cc +854 -0
  336. data/ext/v8/upstream/v8/src/platform-linux.cc +1120 -0
  337. data/ext/v8/upstream/v8/src/platform-macos.cc +865 -0
  338. data/ext/v8/upstream/v8/src/platform-nullos.cc +504 -0
  339. data/ext/v8/upstream/v8/src/platform-openbsd.cc +672 -0
  340. data/ext/v8/upstream/v8/src/platform-posix.cc +424 -0
  341. data/ext/v8/upstream/v8/src/platform-solaris.cc +796 -0
  342. data/ext/v8/upstream/v8/src/platform-tls-mac.h +62 -0
  343. data/ext/v8/upstream/v8/src/platform-tls-win32.h +62 -0
  344. data/ext/v8/upstream/v8/src/platform-tls.h +50 -0
  345. data/ext/v8/upstream/v8/src/platform-win32.cc +2072 -0
  346. data/ext/v8/upstream/v8/src/platform.h +693 -0
  347. data/ext/v8/upstream/v8/src/preparse-data.cc +185 -0
  348. data/ext/v8/upstream/{3.1.8 → v8}/src/preparse-data.h +0 -0
  349. data/ext/v8/upstream/v8/src/preparser-api.cc +219 -0
  350. data/ext/v8/upstream/v8/src/preparser.cc +1205 -0
  351. data/ext/v8/upstream/{3.1.8 → v8}/src/preparser.h +0 -0
  352. data/ext/v8/upstream/v8/src/prettyprinter.cc +1530 -0
  353. data/ext/v8/upstream/v8/src/prettyprinter.h +223 -0
  354. data/ext/v8/upstream/{3.1.8 → v8}/src/profile-generator-inl.h +0 -0
  355. data/ext/v8/upstream/v8/src/profile-generator.cc +3095 -0
  356. data/ext/v8/upstream/v8/src/profile-generator.h +1125 -0
  357. data/ext/v8/upstream/v8/src/property.cc +102 -0
  358. data/ext/v8/upstream/v8/src/property.h +348 -0
  359. data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
  360. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp.cc +470 -0
  361. data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-irregexp.h +0 -0
  362. data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-tracer.cc +0 -0
  363. data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-tracer.h +0 -0
  364. data/ext/v8/upstream/v8/src/regexp-macro-assembler.cc +266 -0
  365. data/ext/v8/upstream/v8/src/regexp-macro-assembler.h +236 -0
  366. data/ext/v8/upstream/v8/src/regexp-stack.cc +111 -0
  367. data/ext/v8/upstream/v8/src/regexp-stack.h +147 -0
  368. data/ext/v8/upstream/v8/src/regexp.js +483 -0
  369. data/ext/v8/upstream/v8/src/register-allocator-inl.h +141 -0
  370. data/ext/v8/upstream/v8/src/register-allocator.cc +98 -0
  371. data/ext/v8/upstream/v8/src/register-allocator.h +310 -0
  372. data/ext/v8/upstream/v8/src/rewriter.cc +1024 -0
  373. data/ext/v8/upstream/{3.1.8 → v8}/src/rewriter.h +0 -0
  374. data/ext/v8/upstream/v8/src/runtime-profiler.cc +478 -0
  375. data/ext/v8/upstream/v8/src/runtime-profiler.h +192 -0
  376. data/ext/v8/upstream/v8/src/runtime.cc +11949 -0
  377. data/ext/v8/upstream/v8/src/runtime.h +643 -0
  378. data/ext/v8/upstream/{3.1.8 → v8}/src/runtime.js +0 -0
  379. data/ext/v8/upstream/v8/src/safepoint-table.cc +256 -0
  380. data/ext/v8/upstream/v8/src/safepoint-table.h +269 -0
  381. data/ext/v8/upstream/v8/src/scanner-base.cc +964 -0
  382. data/ext/v8/upstream/v8/src/scanner-base.h +664 -0
  383. data/ext/v8/upstream/v8/src/scanner.cc +584 -0
  384. data/ext/v8/upstream/v8/src/scanner.h +196 -0
  385. data/ext/v8/upstream/v8/src/scopeinfo.cc +631 -0
  386. data/ext/v8/upstream/v8/src/scopeinfo.h +249 -0
  387. data/ext/v8/upstream/v8/src/scopes.cc +1093 -0
  388. data/ext/v8/upstream/v8/src/scopes.h +508 -0
  389. data/ext/v8/upstream/v8/src/serialize.cc +1574 -0
  390. data/ext/v8/upstream/v8/src/serialize.h +589 -0
  391. data/ext/v8/upstream/{3.1.8 → v8}/src/shell.h +0 -0
  392. data/ext/v8/upstream/{3.1.8 → v8}/src/simulator.h +0 -0
  393. data/ext/v8/upstream/v8/src/small-pointer-list.h +163 -0
  394. data/ext/v8/upstream/{3.1.8 → v8}/src/smart-pointer.h +0 -0
  395. data/ext/v8/upstream/v8/src/snapshot-common.cc +82 -0
  396. data/ext/v8/upstream/{3.1.8 → v8}/src/snapshot-empty.cc +0 -0
  397. data/ext/v8/upstream/v8/src/snapshot.h +73 -0
  398. data/ext/v8/upstream/v8/src/spaces-inl.h +529 -0
  399. data/ext/v8/upstream/v8/src/spaces.cc +3147 -0
  400. data/ext/v8/upstream/v8/src/spaces.h +2368 -0
  401. data/ext/v8/upstream/{3.1.8 → v8}/src/splay-tree-inl.h +0 -0
  402. data/ext/v8/upstream/{3.1.8 → v8}/src/splay-tree.h +0 -0
  403. data/ext/v8/upstream/v8/src/string-search.cc +41 -0
  404. data/ext/v8/upstream/v8/src/string-search.h +568 -0
  405. data/ext/v8/upstream/v8/src/string-stream.cc +592 -0
  406. data/ext/v8/upstream/{3.1.8 → v8}/src/string-stream.h +0 -0
  407. data/ext/v8/upstream/v8/src/string.js +915 -0
  408. data/ext/v8/upstream/{3.1.8 → v8}/src/strtod.cc +0 -0
  409. data/ext/v8/upstream/{3.1.8 → v8}/src/strtod.h +0 -0
  410. data/ext/v8/upstream/v8/src/stub-cache.cc +1940 -0
  411. data/ext/v8/upstream/v8/src/stub-cache.h +866 -0
  412. data/ext/v8/upstream/{3.1.8 → v8}/src/third_party/valgrind/valgrind.h +0 -0
  413. data/ext/v8/upstream/v8/src/token.cc +63 -0
  414. data/ext/v8/upstream/v8/src/token.h +288 -0
  415. data/ext/v8/upstream/v8/src/top.cc +983 -0
  416. data/ext/v8/upstream/v8/src/type-info.cc +472 -0
  417. data/ext/v8/upstream/v8/src/type-info.h +290 -0
  418. data/ext/v8/upstream/{3.1.8 → v8}/src/unbound-queue-inl.h +0 -0
  419. data/ext/v8/upstream/{3.1.8 → v8}/src/unbound-queue.h +0 -0
  420. data/ext/v8/upstream/{3.1.8 → v8}/src/unicode-inl.h +0 -0
  421. data/ext/v8/upstream/v8/src/unicode.cc +1624 -0
  422. data/ext/v8/upstream/v8/src/unicode.h +280 -0
  423. data/ext/v8/upstream/{3.1.8 → v8}/src/uri.js +0 -0
  424. data/ext/v8/upstream/{3.1.8 → v8}/src/utils.cc +0 -0
  425. data/ext/v8/upstream/v8/src/utils.h +796 -0
  426. data/ext/v8/upstream/v8/src/v8-counters.cc +62 -0
  427. data/ext/v8/upstream/v8/src/v8-counters.h +311 -0
  428. data/ext/v8/upstream/v8/src/v8.cc +215 -0
  429. data/ext/v8/upstream/v8/src/v8.h +130 -0
  430. data/ext/v8/upstream/{3.1.8 → v8}/src/v8checks.h +0 -0
  431. data/ext/v8/upstream/{3.1.8 → v8}/src/v8dll-main.cc +0 -0
  432. data/ext/v8/upstream/v8/src/v8globals.h +486 -0
  433. data/ext/v8/upstream/{3.1.8/src/memory.h → v8/src/v8memory.h} +0 -0
  434. data/ext/v8/upstream/v8/src/v8natives.js +1293 -0
  435. data/ext/v8/upstream/{3.1.8 → v8}/src/v8preparserdll-main.cc +0 -0
  436. data/ext/v8/upstream/v8/src/v8threads.cc +453 -0
  437. data/ext/v8/upstream/v8/src/v8threads.h +164 -0
  438. data/ext/v8/upstream/v8/src/v8utils.h +317 -0
  439. data/ext/v8/upstream/{3.1.8 → v8}/src/variables.cc +0 -0
  440. data/ext/v8/upstream/v8/src/variables.h +212 -0
  441. data/ext/v8/upstream/v8/src/version.cc +116 -0
  442. data/ext/v8/upstream/v8/src/version.h +68 -0
  443. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-heavy-inl.h +0 -0
  444. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-heavy.cc +0 -0
  445. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-inl.h +0 -0
  446. data/ext/v8/upstream/v8/src/virtual-frame-light-inl.h +171 -0
  447. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-light.cc +0 -0
  448. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame.cc +0 -0
  449. data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame.h +0 -0
  450. data/ext/v8/upstream/v8/src/vm-state-inl.h +138 -0
  451. data/ext/v8/upstream/v8/src/vm-state.h +70 -0
  452. data/ext/v8/upstream/v8/src/win32-headers.h +96 -0
  453. data/ext/v8/upstream/v8/src/x64/assembler-x64-inl.h +456 -0
  454. data/ext/v8/upstream/v8/src/x64/assembler-x64.cc +2954 -0
  455. data/ext/v8/upstream/v8/src/x64/assembler-x64.h +1630 -0
  456. data/ext/v8/upstream/v8/src/x64/builtins-x64.cc +1493 -0
  457. data/ext/v8/upstream/v8/src/x64/code-stubs-x64.cc +5132 -0
  458. data/ext/v8/upstream/v8/src/x64/code-stubs-x64.h +477 -0
  459. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/codegen-x64-inl.h +0 -0
  460. data/ext/v8/upstream/v8/src/x64/codegen-x64.cc +8843 -0
  461. data/ext/v8/upstream/v8/src/x64/codegen-x64.h +753 -0
  462. data/ext/v8/upstream/v8/src/x64/cpu-x64.cc +88 -0
  463. data/ext/v8/upstream/v8/src/x64/debug-x64.cc +318 -0
  464. data/ext/v8/upstream/v8/src/x64/deoptimizer-x64.cc +815 -0
  465. data/ext/v8/upstream/v8/src/x64/disasm-x64.cc +1752 -0
  466. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/frames-x64.cc +0 -0
  467. data/ext/v8/upstream/v8/src/x64/frames-x64.h +130 -0
  468. data/ext/v8/upstream/v8/src/x64/full-codegen-x64.cc +4339 -0
  469. data/ext/v8/upstream/v8/src/x64/ic-x64.cc +1752 -0
  470. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/jump-target-x64.cc +0 -0
  471. data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.cc +3970 -0
  472. data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.h +318 -0
  473. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/lithium-gap-resolver-x64.cc +0 -0
  474. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/lithium-gap-resolver-x64.h +0 -0
  475. data/ext/v8/upstream/v8/src/x64/lithium-x64.cc +2115 -0
  476. data/ext/v8/upstream/v8/src/x64/lithium-x64.h +2161 -0
  477. data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.cc +2911 -0
  478. data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.h +1984 -0
  479. data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.cc +1398 -0
  480. data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.h +282 -0
  481. data/ext/v8/upstream/v8/src/x64/register-allocator-x64-inl.h +87 -0
  482. data/ext/v8/upstream/v8/src/x64/register-allocator-x64.cc +95 -0
  483. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/register-allocator-x64.h +0 -0
  484. data/ext/v8/upstream/{3.1.8 → v8}/src/x64/simulator-x64.cc +0 -0
  485. data/ext/v8/upstream/v8/src/x64/simulator-x64.h +71 -0
  486. data/ext/v8/upstream/v8/src/x64/stub-cache-x64.cc +3460 -0
  487. data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.cc +1296 -0
  488. data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.h +597 -0
  489. data/ext/v8/upstream/v8/src/zone-inl.h +129 -0
  490. data/ext/v8/upstream/v8/src/zone.cc +196 -0
  491. data/ext/v8/upstream/v8/src/zone.h +236 -0
  492. data/ext/v8/upstream/{3.1.8 → v8}/tools/codemap.js +0 -0
  493. data/ext/v8/upstream/{3.1.8 → v8}/tools/consarray.js +0 -0
  494. data/ext/v8/upstream/{3.1.8 → v8}/tools/csvparser.js +0 -0
  495. data/ext/v8/upstream/{3.1.8 → v8}/tools/disasm.py +0 -0
  496. data/ext/v8/upstream/v8/tools/freebsd-tick-processor +10 -0
  497. data/ext/v8/upstream/{3.1.8 → v8}/tools/gc-nvp-trace-processor.py +0 -0
  498. data/ext/v8/upstream/{3.1.8 → v8}/tools/generate-ten-powers.scm +0 -0
  499. data/ext/v8/upstream/{3.1.8 → v8}/tools/grokdump.py +0 -0
  500. data/ext/v8/upstream/v8/tools/gyp/v8.gyp +844 -0
  501. data/ext/v8/upstream/{3.1.8 → v8}/tools/js2c.py +0 -0
  502. data/ext/v8/upstream/{3.1.8 → v8}/tools/jsmin.py +0 -0
  503. data/ext/v8/upstream/v8/tools/linux-tick-processor +35 -0
  504. data/ext/v8/upstream/{3.1.8 → v8}/tools/ll_prof.py +0 -0
  505. data/ext/v8/upstream/{3.1.8 → v8}/tools/logreader.js +0 -0
  506. data/ext/v8/upstream/{3.1.8 → v8}/tools/mac-nm +0 -0
  507. data/ext/v8/upstream/{3.1.8 → v8}/tools/mac-tick-processor +0 -0
  508. data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/README +0 -0
  509. data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/SConstruct +0 -0
  510. data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/oom_dump.cc +0 -0
  511. data/ext/v8/upstream/{3.1.8 → v8}/tools/presubmit.py +0 -0
  512. data/ext/v8/upstream/{3.1.8 → v8}/tools/process-heap-prof.py +0 -0
  513. data/ext/v8/upstream/{3.1.8 → v8}/tools/profile.js +0 -0
  514. data/ext/v8/upstream/{3.1.8 → v8}/tools/profile_view.js +0 -0
  515. data/ext/v8/upstream/{3.1.8 → v8}/tools/run-valgrind.py +0 -0
  516. data/ext/v8/upstream/{3.1.8 → v8}/tools/splaytree.js +0 -0
  517. data/ext/v8/upstream/{3.1.8 → v8}/tools/stats-viewer.py +0 -0
  518. data/ext/v8/upstream/v8/tools/test.py +1490 -0
  519. data/ext/v8/upstream/{3.1.8 → v8}/tools/tickprocessor-driver.js +0 -0
  520. data/ext/v8/upstream/v8/tools/tickprocessor.js +877 -0
  521. data/ext/v8/upstream/{3.1.8 → v8}/tools/utils.py +0 -0
  522. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/README.txt +0 -0
  523. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/arm.vsprops +0 -0
  524. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/common.vsprops +0 -0
  525. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8.vcproj +0 -0
  526. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8_arm.vcproj +0 -0
  527. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8_x64.vcproj +0 -0
  528. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8js2c.cmd +0 -0
  529. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/debug.vsprops +0 -0
  530. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/ia32.vsprops +0 -0
  531. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/js2c.cmd +0 -0
  532. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/release.vsprops +0 -0
  533. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8.sln +0 -0
  534. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8.vcproj +0 -0
  535. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_arm.sln +0 -0
  536. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_arm.vcproj +0 -0
  537. data/ext/v8/upstream/v8/tools/visual_studio/v8_base.vcproj +1308 -0
  538. data/ext/v8/upstream/v8/tools/visual_studio/v8_base_arm.vcproj +1238 -0
  539. data/ext/v8/upstream/v8/tools/visual_studio/v8_base_x64.vcproj +1300 -0
  540. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest.vcproj +0 -0
  541. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
  542. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
  543. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
  544. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
  545. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample.vcproj +0 -0
  546. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
  547. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
  548. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample.vcproj +0 -0
  549. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -0
  550. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -0
  551. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot.vcproj +0 -0
  552. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
  553. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
  554. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
  555. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_x64.sln +0 -0
  556. data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_x64.vcproj +0 -0
  557. data/ext/v8/upstream/v8/tools/visual_studio/x64.vsprops +18 -0
  558. data/ext/v8/upstream/{3.1.8 → v8}/tools/windows-tick-processor.bat +0 -0
  559. data/ext/v8/v8_callbacks.cpp +52 -92
  560. data/ext/v8/v8_date.cpp +2 -3
  561. data/ext/v8/v8_object.cpp +4 -0
  562. data/ext/v8/v8_template.cpp +2 -2
  563. data/ext/v8/v8_try_catch.cpp +8 -38
  564. data/lib/v8/version.rb +1 -1
  565. data/spec/ext/ext_spec_helper.rb +2 -20
  566. data/spec/ext/object_spec.rb +0 -12
  567. data/spec/ext/try_catch_spec.rb +29 -1
  568. data/spec/spec_helper.rb +1 -0
  569. data/spec/v8/portal/proxies_spec.rb +1 -84
  570. data/specmem/handle_memspec.rb +41 -0
  571. data/specmem/object_memspec.rb +16 -0
  572. data/specmem/proxies_memspec.rb +86 -0
  573. data/specmem/spec_helper.rb +24 -0
  574. data/therubyracer.gemspec +7 -2
  575. metadata +564 -541
  576. data/ext/v8/upstream/3.1.8/.gitignore +0 -31
  577. data/ext/v8/upstream/3.1.8/AUTHORS +0 -40
  578. data/ext/v8/upstream/3.1.8/ChangeLog +0 -2566
  579. data/ext/v8/upstream/3.1.8/SConstruct +0 -1192
  580. data/ext/v8/upstream/3.1.8/include/v8-debug.h +0 -384
  581. data/ext/v8/upstream/3.1.8/include/v8-preparser.h +0 -116
  582. data/ext/v8/upstream/3.1.8/include/v8-profiler.h +0 -426
  583. data/ext/v8/upstream/3.1.8/include/v8-testing.h +0 -99
  584. data/ext/v8/upstream/3.1.8/include/v8.h +0 -3846
  585. data/ext/v8/upstream/3.1.8/preparser/preparser-process.cc +0 -206
  586. data/ext/v8/upstream/3.1.8/src/SConscript +0 -356
  587. data/ext/v8/upstream/3.1.8/src/accessors.cc +0 -907
  588. data/ext/v8/upstream/3.1.8/src/allocation.cc +0 -204
  589. data/ext/v8/upstream/3.1.8/src/allocation.h +0 -176
  590. data/ext/v8/upstream/3.1.8/src/api.cc +0 -5191
  591. data/ext/v8/upstream/3.1.8/src/api.h +0 -508
  592. data/ext/v8/upstream/3.1.8/src/apiutils.h +0 -80
  593. data/ext/v8/upstream/3.1.8/src/arguments.h +0 -105
  594. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm-inl.h +0 -352
  595. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.cc +0 -2756
  596. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.h +0 -1294
  597. data/ext/v8/upstream/3.1.8/src/arm/builtins-arm.cc +0 -1628
  598. data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.cc +0 -6783
  599. data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.h +0 -657
  600. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.cc +0 -7403
  601. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.h +0 -595
  602. data/ext/v8/upstream/3.1.8/src/arm/constants-arm.h +0 -769
  603. data/ext/v8/upstream/3.1.8/src/arm/cpu-arm.cc +0 -147
  604. data/ext/v8/upstream/3.1.8/src/arm/debug-arm.cc +0 -315
  605. data/ext/v8/upstream/3.1.8/src/arm/deoptimizer-arm.cc +0 -700
  606. data/ext/v8/upstream/3.1.8/src/arm/disasm-arm.cc +0 -1439
  607. data/ext/v8/upstream/3.1.8/src/arm/frames-arm.h +0 -168
  608. data/ext/v8/upstream/3.1.8/src/arm/full-codegen-arm.cc +0 -4230
  609. data/ext/v8/upstream/3.1.8/src/arm/ic-arm.cc +0 -1799
  610. data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.cc +0 -2041
  611. data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.h +0 -2046
  612. data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.cc +0 -3822
  613. data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.h +0 -312
  614. data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.cc +0 -303
  615. data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.cc +0 -2701
  616. data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.h +0 -1015
  617. data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.cc +0 -1280
  618. data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.h +0 -252
  619. data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.cc +0 -3165
  620. data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.h +0 -402
  621. data/ext/v8/upstream/3.1.8/src/arm/stub-cache-arm.cc +0 -4077
  622. data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.cc +0 -843
  623. data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.h +0 -520
  624. data/ext/v8/upstream/3.1.8/src/array.js +0 -1231
  625. data/ext/v8/upstream/3.1.8/src/assembler.cc +0 -973
  626. data/ext/v8/upstream/3.1.8/src/assembler.h +0 -787
  627. data/ext/v8/upstream/3.1.8/src/ast-inl.h +0 -107
  628. data/ext/v8/upstream/3.1.8/src/ast.cc +0 -1067
  629. data/ext/v8/upstream/3.1.8/src/ast.h +0 -2177
  630. data/ext/v8/upstream/3.1.8/src/atomicops.h +0 -165
  631. data/ext/v8/upstream/3.1.8/src/bootstrapper.cc +0 -1888
  632. data/ext/v8/upstream/3.1.8/src/bootstrapper.h +0 -118
  633. data/ext/v8/upstream/3.1.8/src/builtins.cc +0 -1586
  634. data/ext/v8/upstream/3.1.8/src/builtins.h +0 -339
  635. data/ext/v8/upstream/3.1.8/src/checks.cc +0 -110
  636. data/ext/v8/upstream/3.1.8/src/checks.h +0 -292
  637. data/ext/v8/upstream/3.1.8/src/code-stubs.cc +0 -230
  638. data/ext/v8/upstream/3.1.8/src/code-stubs.h +0 -950
  639. data/ext/v8/upstream/3.1.8/src/codegen-inl.h +0 -64
  640. data/ext/v8/upstream/3.1.8/src/codegen.cc +0 -495
  641. data/ext/v8/upstream/3.1.8/src/codegen.h +0 -245
  642. data/ext/v8/upstream/3.1.8/src/compilation-cache.cc +0 -654
  643. data/ext/v8/upstream/3.1.8/src/compilation-cache.h +0 -112
  644. data/ext/v8/upstream/3.1.8/src/compiler.cc +0 -806
  645. data/ext/v8/upstream/3.1.8/src/compiler.h +0 -290
  646. data/ext/v8/upstream/3.1.8/src/contexts.cc +0 -320
  647. data/ext/v8/upstream/3.1.8/src/contexts.h +0 -376
  648. data/ext/v8/upstream/3.1.8/src/conversions.cc +0 -1069
  649. data/ext/v8/upstream/3.1.8/src/counters.cc +0 -78
  650. data/ext/v8/upstream/3.1.8/src/counters.h +0 -242
  651. data/ext/v8/upstream/3.1.8/src/cpu-profiler-inl.h +0 -100
  652. data/ext/v8/upstream/3.1.8/src/cpu-profiler.cc +0 -554
  653. data/ext/v8/upstream/3.1.8/src/cpu-profiler.h +0 -291
  654. data/ext/v8/upstream/3.1.8/src/cpu.h +0 -65
  655. data/ext/v8/upstream/3.1.8/src/d8-debug.cc +0 -367
  656. data/ext/v8/upstream/3.1.8/src/d8-debug.h +0 -157
  657. data/ext/v8/upstream/3.1.8/src/d8-posix.cc +0 -693
  658. data/ext/v8/upstream/3.1.8/src/d8.cc +0 -792
  659. data/ext/v8/upstream/3.1.8/src/d8.gyp +0 -85
  660. data/ext/v8/upstream/3.1.8/src/data-flow.h +0 -379
  661. data/ext/v8/upstream/3.1.8/src/dateparser.h +0 -263
  662. data/ext/v8/upstream/3.1.8/src/debug-agent.cc +0 -446
  663. data/ext/v8/upstream/3.1.8/src/debug-agent.h +0 -131
  664. data/ext/v8/upstream/3.1.8/src/debug.cc +0 -3085
  665. data/ext/v8/upstream/3.1.8/src/debug.h +0 -1025
  666. data/ext/v8/upstream/3.1.8/src/deoptimizer.cc +0 -1185
  667. data/ext/v8/upstream/3.1.8/src/deoptimizer.h +0 -529
  668. data/ext/v8/upstream/3.1.8/src/disasm.h +0 -77
  669. data/ext/v8/upstream/3.1.8/src/disassembler.cc +0 -338
  670. data/ext/v8/upstream/3.1.8/src/execution.cc +0 -735
  671. data/ext/v8/upstream/3.1.8/src/execution.h +0 -322
  672. data/ext/v8/upstream/3.1.8/src/extensions/experimental/experimental.gyp +0 -53
  673. data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.cc +0 -264
  674. data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.cc +0 -141
  675. data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.cc +0 -58
  676. data/ext/v8/upstream/3.1.8/src/factory.cc +0 -1087
  677. data/ext/v8/upstream/3.1.8/src/factory.h +0 -432
  678. data/ext/v8/upstream/3.1.8/src/flag-definitions.h +0 -552
  679. data/ext/v8/upstream/3.1.8/src/frame-element.cc +0 -42
  680. data/ext/v8/upstream/3.1.8/src/frame-element.h +0 -277
  681. data/ext/v8/upstream/3.1.8/src/frames-inl.h +0 -210
  682. data/ext/v8/upstream/3.1.8/src/frames.cc +0 -1232
  683. data/ext/v8/upstream/3.1.8/src/frames.h +0 -826
  684. data/ext/v8/upstream/3.1.8/src/full-codegen.cc +0 -1382
  685. data/ext/v8/upstream/3.1.8/src/full-codegen.h +0 -751
  686. data/ext/v8/upstream/3.1.8/src/func-name-inferrer.cc +0 -90
  687. data/ext/v8/upstream/3.1.8/src/func-name-inferrer.h +0 -111
  688. data/ext/v8/upstream/3.1.8/src/gdb-jit.cc +0 -1547
  689. data/ext/v8/upstream/3.1.8/src/global-handles.cc +0 -534
  690. data/ext/v8/upstream/3.1.8/src/global-handles.h +0 -181
  691. data/ext/v8/upstream/3.1.8/src/globals.h +0 -325
  692. data/ext/v8/upstream/3.1.8/src/handles-inl.h +0 -80
  693. data/ext/v8/upstream/3.1.8/src/handles.cc +0 -910
  694. data/ext/v8/upstream/3.1.8/src/handles.h +0 -424
  695. data/ext/v8/upstream/3.1.8/src/hashmap.h +0 -121
  696. data/ext/v8/upstream/3.1.8/src/heap-inl.h +0 -587
  697. data/ext/v8/upstream/3.1.8/src/heap-profiler.cc +0 -1128
  698. data/ext/v8/upstream/3.1.8/src/heap-profiler.h +0 -381
  699. data/ext/v8/upstream/3.1.8/src/heap.cc +0 -5610
  700. data/ext/v8/upstream/3.1.8/src/heap.h +0 -2218
  701. data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.cc +0 -1490
  702. data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.h +0 -3493
  703. data/ext/v8/upstream/3.1.8/src/hydrogen.cc +0 -6056
  704. data/ext/v8/upstream/3.1.8/src/hydrogen.h +0 -1091
  705. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32-inl.h +0 -429
  706. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.cc +0 -2800
  707. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.h +0 -1093
  708. data/ext/v8/upstream/3.1.8/src/ia32/builtins-ia32.cc +0 -1590
  709. data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.cc +0 -6624
  710. data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.h +0 -536
  711. data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.cc +0 -10354
  712. data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.h +0 -798
  713. data/ext/v8/upstream/3.1.8/src/ia32/cpu-ia32.cc +0 -87
  714. data/ext/v8/upstream/3.1.8/src/ia32/debug-ia32.cc +0 -309
  715. data/ext/v8/upstream/3.1.8/src/ia32/deoptimizer-ia32.cc +0 -664
  716. data/ext/v8/upstream/3.1.8/src/ia32/disasm-ia32.cc +0 -1597
  717. data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.h +0 -140
  718. data/ext/v8/upstream/3.1.8/src/ia32/full-codegen-ia32.cc +0 -4278
  719. data/ext/v8/upstream/3.1.8/src/ia32/ic-ia32.cc +0 -1786
  720. data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.cc +0 -3880
  721. data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.h +0 -309
  722. data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.cc +0 -460
  723. data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.cc +0 -2095
  724. data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.h +0 -2127
  725. data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.cc +0 -2031
  726. data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.h +0 -798
  727. data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.cc +0 -1253
  728. data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.h +0 -215
  729. data/ext/v8/upstream/3.1.8/src/ia32/register-allocator-ia32.cc +0 -157
  730. data/ext/v8/upstream/3.1.8/src/ia32/simulator-ia32.h +0 -72
  731. data/ext/v8/upstream/3.1.8/src/ia32/stub-cache-ia32.cc +0 -3732
  732. data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.cc +0 -1360
  733. data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.h +0 -646
  734. data/ext/v8/upstream/3.1.8/src/ic-inl.h +0 -129
  735. data/ext/v8/upstream/3.1.8/src/ic.cc +0 -2333
  736. data/ext/v8/upstream/3.1.8/src/ic.h +0 -639
  737. data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.cc +0 -655
  738. data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.h +0 -48
  739. data/ext/v8/upstream/3.1.8/src/json.js +0 -342
  740. data/ext/v8/upstream/3.1.8/src/jsregexp.cc +0 -5340
  741. data/ext/v8/upstream/3.1.8/src/jsregexp.h +0 -1484
  742. data/ext/v8/upstream/3.1.8/src/jump-target-heavy.cc +0 -430
  743. data/ext/v8/upstream/3.1.8/src/jump-target-heavy.h +0 -244
  744. data/ext/v8/upstream/3.1.8/src/jump-target-inl.h +0 -48
  745. data/ext/v8/upstream/3.1.8/src/jump-target-light.cc +0 -111
  746. data/ext/v8/upstream/3.1.8/src/lithium-allocator-inl.h +0 -140
  747. data/ext/v8/upstream/3.1.8/src/lithium-allocator.cc +0 -2093
  748. data/ext/v8/upstream/3.1.8/src/lithium-allocator.h +0 -644
  749. data/ext/v8/upstream/3.1.8/src/lithium.cc +0 -168
  750. data/ext/v8/upstream/3.1.8/src/liveedit.cc +0 -1650
  751. data/ext/v8/upstream/3.1.8/src/liveedit.h +0 -174
  752. data/ext/v8/upstream/3.1.8/src/liveobjectlist.cc +0 -2527
  753. data/ext/v8/upstream/3.1.8/src/liveobjectlist.h +0 -322
  754. data/ext/v8/upstream/3.1.8/src/log-utils.cc +0 -336
  755. data/ext/v8/upstream/3.1.8/src/log-utils.h +0 -232
  756. data/ext/v8/upstream/3.1.8/src/log.cc +0 -1608
  757. data/ext/v8/upstream/3.1.8/src/log.h +0 -379
  758. data/ext/v8/upstream/3.1.8/src/mark-compact.cc +0 -2957
  759. data/ext/v8/upstream/3.1.8/src/mark-compact.h +0 -433
  760. data/ext/v8/upstream/3.1.8/src/messages.cc +0 -164
  761. data/ext/v8/upstream/3.1.8/src/messages.js +0 -1071
  762. data/ext/v8/upstream/3.1.8/src/mips/assembler-mips-inl.h +0 -215
  763. data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.cc +0 -1219
  764. data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.h +0 -667
  765. data/ext/v8/upstream/3.1.8/src/mips/builtins-mips.cc +0 -205
  766. data/ext/v8/upstream/3.1.8/src/mips/codegen-mips-inl.h +0 -70
  767. data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.cc +0 -1437
  768. data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.h +0 -431
  769. data/ext/v8/upstream/3.1.8/src/mips/constants-mips.cc +0 -328
  770. data/ext/v8/upstream/3.1.8/src/mips/constants-mips.h +0 -525
  771. data/ext/v8/upstream/3.1.8/src/mips/cpu-mips.cc +0 -73
  772. data/ext/v8/upstream/3.1.8/src/mips/debug-mips.cc +0 -127
  773. data/ext/v8/upstream/3.1.8/src/mips/disasm-mips.cc +0 -787
  774. data/ext/v8/upstream/3.1.8/src/mips/fast-codegen-mips.cc +0 -77
  775. data/ext/v8/upstream/3.1.8/src/mips/frames-mips.cc +0 -96
  776. data/ext/v8/upstream/3.1.8/src/mips/frames-mips.h +0 -164
  777. data/ext/v8/upstream/3.1.8/src/mips/full-codegen-mips.cc +0 -277
  778. data/ext/v8/upstream/3.1.8/src/mips/ic-mips.cc +0 -208
  779. data/ext/v8/upstream/3.1.8/src/mips/jump-target-mips.cc +0 -175
  780. data/ext/v8/upstream/3.1.8/src/mips/macro-assembler-mips.cc +0 -1326
  781. data/ext/v8/upstream/3.1.8/src/mips/macro-assembler-mips.h +0 -461
  782. data/ext/v8/upstream/3.1.8/src/mips/register-allocator-mips-inl.h +0 -137
  783. data/ext/v8/upstream/3.1.8/src/mips/register-allocator-mips.h +0 -46
  784. data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.cc +0 -1650
  785. data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.h +0 -311
  786. data/ext/v8/upstream/3.1.8/src/mips/stub-cache-mips.cc +0 -418
  787. data/ext/v8/upstream/3.1.8/src/mips/virtual-frame-mips.cc +0 -319
  788. data/ext/v8/upstream/3.1.8/src/mips/virtual-frame-mips.h +0 -548
  789. data/ext/v8/upstream/3.1.8/src/mirror-debugger.js +0 -2380
  790. data/ext/v8/upstream/3.1.8/src/mksnapshot.cc +0 -256
  791. data/ext/v8/upstream/3.1.8/src/objects-debug.cc +0 -722
  792. data/ext/v8/upstream/3.1.8/src/objects-inl.h +0 -3946
  793. data/ext/v8/upstream/3.1.8/src/objects-printer.cc +0 -801
  794. data/ext/v8/upstream/3.1.8/src/objects-visiting.cc +0 -142
  795. data/ext/v8/upstream/3.1.8/src/objects-visiting.h +0 -401
  796. data/ext/v8/upstream/3.1.8/src/objects.cc +0 -10044
  797. data/ext/v8/upstream/3.1.8/src/objects.h +0 -6571
  798. data/ext/v8/upstream/3.1.8/src/parser.cc +0 -5165
  799. data/ext/v8/upstream/3.1.8/src/parser.h +0 -802
  800. data/ext/v8/upstream/3.1.8/src/platform-cygwin.cc +0 -745
  801. data/ext/v8/upstream/3.1.8/src/platform-freebsd.cc +0 -702
  802. data/ext/v8/upstream/3.1.8/src/platform-linux.cc +0 -981
  803. data/ext/v8/upstream/3.1.8/src/platform-macos.cc +0 -732
  804. data/ext/v8/upstream/3.1.8/src/platform-nullos.cc +0 -498
  805. data/ext/v8/upstream/3.1.8/src/platform-openbsd.cc +0 -657
  806. data/ext/v8/upstream/3.1.8/src/platform-posix.cc +0 -399
  807. data/ext/v8/upstream/3.1.8/src/platform-solaris.cc +0 -714
  808. data/ext/v8/upstream/3.1.8/src/platform-win32.cc +0 -1974
  809. data/ext/v8/upstream/3.1.8/src/platform.h +0 -636
  810. data/ext/v8/upstream/3.1.8/src/preparse-data.cc +0 -183
  811. data/ext/v8/upstream/3.1.8/src/preparser-api.cc +0 -213
  812. data/ext/v8/upstream/3.1.8/src/preparser.cc +0 -1205
  813. data/ext/v8/upstream/3.1.8/src/prettyprinter.cc +0 -1539
  814. data/ext/v8/upstream/3.1.8/src/prettyprinter.h +0 -223
  815. data/ext/v8/upstream/3.1.8/src/profile-generator.cc +0 -2899
  816. data/ext/v8/upstream/3.1.8/src/profile-generator.h +0 -1151
  817. data/ext/v8/upstream/3.1.8/src/property.cc +0 -96
  818. data/ext/v8/upstream/3.1.8/src/property.h +0 -337
  819. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.cc +0 -470
  820. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.cc +0 -257
  821. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.h +0 -231
  822. data/ext/v8/upstream/3.1.8/src/regexp-stack.cc +0 -103
  823. data/ext/v8/upstream/3.1.8/src/regexp-stack.h +0 -123
  824. data/ext/v8/upstream/3.1.8/src/regexp.js +0 -483
  825. data/ext/v8/upstream/3.1.8/src/register-allocator-inl.h +0 -141
  826. data/ext/v8/upstream/3.1.8/src/register-allocator.cc +0 -104
  827. data/ext/v8/upstream/3.1.8/src/register-allocator.h +0 -320
  828. data/ext/v8/upstream/3.1.8/src/rewriter.cc +0 -1023
  829. data/ext/v8/upstream/3.1.8/src/runtime-profiler.cc +0 -443
  830. data/ext/v8/upstream/3.1.8/src/runtime-profiler.h +0 -77
  831. data/ext/v8/upstream/3.1.8/src/runtime.cc +0 -11592
  832. data/ext/v8/upstream/3.1.8/src/runtime.h +0 -582
  833. data/ext/v8/upstream/3.1.8/src/safepoint-table.cc +0 -253
  834. data/ext/v8/upstream/3.1.8/src/safepoint-table.h +0 -263
  835. data/ext/v8/upstream/3.1.8/src/scanner-base.cc +0 -971
  836. data/ext/v8/upstream/3.1.8/src/scanner-base.h +0 -653
  837. data/ext/v8/upstream/3.1.8/src/scanner.cc +0 -586
  838. data/ext/v8/upstream/3.1.8/src/scanner.h +0 -194
  839. data/ext/v8/upstream/3.1.8/src/scopeinfo.cc +0 -636
  840. data/ext/v8/upstream/3.1.8/src/scopeinfo.h +0 -238
  841. data/ext/v8/upstream/3.1.8/src/scopes.cc +0 -1063
  842. data/ext/v8/upstream/3.1.8/src/scopes.h +0 -494
  843. data/ext/v8/upstream/3.1.8/src/serialize.cc +0 -1535
  844. data/ext/v8/upstream/3.1.8/src/serialize.h +0 -584
  845. data/ext/v8/upstream/3.1.8/src/snapshot-common.cc +0 -82
  846. data/ext/v8/upstream/3.1.8/src/snapshot.h +0 -71
  847. data/ext/v8/upstream/3.1.8/src/spaces-inl.h +0 -524
  848. data/ext/v8/upstream/3.1.8/src/spaces.cc +0 -3254
  849. data/ext/v8/upstream/3.1.8/src/spaces.h +0 -2362
  850. data/ext/v8/upstream/3.1.8/src/string-search.cc +0 -40
  851. data/ext/v8/upstream/3.1.8/src/string-search.h +0 -567
  852. data/ext/v8/upstream/3.1.8/src/string-stream.cc +0 -584
  853. data/ext/v8/upstream/3.1.8/src/string.js +0 -915
  854. data/ext/v8/upstream/3.1.8/src/stub-cache.cc +0 -1878
  855. data/ext/v8/upstream/3.1.8/src/stub-cache.h +0 -849
  856. data/ext/v8/upstream/3.1.8/src/token.cc +0 -63
  857. data/ext/v8/upstream/3.1.8/src/token.h +0 -288
  858. data/ext/v8/upstream/3.1.8/src/top.cc +0 -1152
  859. data/ext/v8/upstream/3.1.8/src/top.h +0 -608
  860. data/ext/v8/upstream/3.1.8/src/type-info.cc +0 -406
  861. data/ext/v8/upstream/3.1.8/src/type-info.h +0 -283
  862. data/ext/v8/upstream/3.1.8/src/unicode.cc +0 -1624
  863. data/ext/v8/upstream/3.1.8/src/unicode.h +0 -280
  864. data/ext/v8/upstream/3.1.8/src/utils.h +0 -793
  865. data/ext/v8/upstream/3.1.8/src/v8-counters.cc +0 -55
  866. data/ext/v8/upstream/3.1.8/src/v8-counters.h +0 -290
  867. data/ext/v8/upstream/3.1.8/src/v8.cc +0 -270
  868. data/ext/v8/upstream/3.1.8/src/v8.h +0 -127
  869. data/ext/v8/upstream/3.1.8/src/v8globals.h +0 -480
  870. data/ext/v8/upstream/3.1.8/src/v8natives.js +0 -1252
  871. data/ext/v8/upstream/3.1.8/src/v8threads.cc +0 -440
  872. data/ext/v8/upstream/3.1.8/src/v8threads.h +0 -157
  873. data/ext/v8/upstream/3.1.8/src/v8utils.h +0 -354
  874. data/ext/v8/upstream/3.1.8/src/variables.h +0 -212
  875. data/ext/v8/upstream/3.1.8/src/version.cc +0 -95
  876. data/ext/v8/upstream/3.1.8/src/version.h +0 -64
  877. data/ext/v8/upstream/3.1.8/src/virtual-frame-light-inl.h +0 -170
  878. data/ext/v8/upstream/3.1.8/src/vm-state-inl.h +0 -134
  879. data/ext/v8/upstream/3.1.8/src/vm-state.h +0 -68
  880. data/ext/v8/upstream/3.1.8/src/win32-headers.h +0 -95
  881. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64-inl.h +0 -455
  882. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.cc +0 -3162
  883. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.h +0 -1584
  884. data/ext/v8/upstream/3.1.8/src/x64/builtins-x64.cc +0 -1492
  885. data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.cc +0 -5150
  886. data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.h +0 -519
  887. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.cc +0 -8835
  888. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.h +0 -750
  889. data/ext/v8/upstream/3.1.8/src/x64/cpu-x64.cc +0 -86
  890. data/ext/v8/upstream/3.1.8/src/x64/debug-x64.cc +0 -316
  891. data/ext/v8/upstream/3.1.8/src/x64/deoptimizer-x64.cc +0 -781
  892. data/ext/v8/upstream/3.1.8/src/x64/disasm-x64.cc +0 -1737
  893. data/ext/v8/upstream/3.1.8/src/x64/frames-x64.h +0 -130
  894. data/ext/v8/upstream/3.1.8/src/x64/full-codegen-x64.cc +0 -3984
  895. data/ext/v8/upstream/3.1.8/src/x64/ic-x64.cc +0 -1761
  896. data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.cc +0 -3639
  897. data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.h +0 -305
  898. data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.cc +0 -2044
  899. data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.h +0 -2052
  900. data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.cc +0 -2660
  901. data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.h +0 -1852
  902. data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.cc +0 -1382
  903. data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.h +0 -278
  904. data/ext/v8/upstream/3.1.8/src/x64/register-allocator-x64-inl.h +0 -87
  905. data/ext/v8/upstream/3.1.8/src/x64/register-allocator-x64.cc +0 -91
  906. data/ext/v8/upstream/3.1.8/src/x64/simulator-x64.h +0 -71
  907. data/ext/v8/upstream/3.1.8/src/x64/stub-cache-x64.cc +0 -3509
  908. data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.cc +0 -1292
  909. data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.h +0 -593
  910. data/ext/v8/upstream/3.1.8/src/zone-inl.h +0 -83
  911. data/ext/v8/upstream/3.1.8/src/zone.cc +0 -195
  912. data/ext/v8/upstream/3.1.8/src/zone.h +0 -233
  913. data/ext/v8/upstream/3.1.8/tools/gyp/v8.gyp +0 -869
  914. data/ext/v8/upstream/3.1.8/tools/linux-tick-processor +0 -33
  915. data/ext/v8/upstream/3.1.8/tools/tickprocessor.js +0 -863
  916. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base.vcproj +0 -1296
  917. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_arm.vcproj +0 -1234
  918. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_x64.vcproj +0 -1296
  919. data/ext/v8/upstream/3.1.8/tools/visual_studio/x64.vsprops +0 -17
  920. data/spec/ext/mem_spec.rb +0 -42
@@ -0,0 +1,3657 @@
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_HYDROGEN_INSTRUCTIONS_H_
29
+ #define V8_HYDROGEN_INSTRUCTIONS_H_
30
+
31
+ #include "v8.h"
32
+
33
+ #include "code-stubs.h"
34
+ #include "small-pointer-list.h"
35
+ #include "string-stream.h"
36
+ #include "zone.h"
37
+
38
+ namespace v8 {
39
+ namespace internal {
40
+
41
+ // Forward declarations.
42
+ class HBasicBlock;
43
+ class HEnvironment;
44
+ class HInstruction;
45
+ class HLoopInformation;
46
+ class HValue;
47
+ class LInstruction;
48
+ class LChunkBuilder;
49
+
50
+
51
+ #define HYDROGEN_ALL_INSTRUCTION_LIST(V) \
52
+ V(ArithmeticBinaryOperation) \
53
+ V(BinaryCall) \
54
+ V(BinaryOperation) \
55
+ V(BitwiseBinaryOperation) \
56
+ V(ControlInstruction) \
57
+ V(Instruction) \
58
+ V(Phi) \
59
+ V(UnaryCall) \
60
+ V(UnaryControlInstruction) \
61
+ V(UnaryOperation) \
62
+ HYDROGEN_CONCRETE_INSTRUCTION_LIST(V)
63
+
64
+
65
+ #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \
66
+ V(AbnormalExit) \
67
+ V(AccessArgumentsAt) \
68
+ V(Add) \
69
+ V(ApplyArguments) \
70
+ V(ArgumentsElements) \
71
+ V(ArgumentsLength) \
72
+ V(ArgumentsObject) \
73
+ V(ArrayLiteral) \
74
+ V(BitAnd) \
75
+ V(BitNot) \
76
+ V(BitOr) \
77
+ V(BitXor) \
78
+ V(BlockEntry) \
79
+ V(BoundsCheck) \
80
+ V(CallConstantFunction) \
81
+ V(CallFunction) \
82
+ V(CallGlobal) \
83
+ V(CallKeyed) \
84
+ V(CallKnownGlobal) \
85
+ V(CallNamed) \
86
+ V(CallNew) \
87
+ V(CallRuntime) \
88
+ V(CallStub) \
89
+ V(Change) \
90
+ V(CheckFunction) \
91
+ V(CheckInstanceType) \
92
+ V(CheckMap) \
93
+ V(CheckNonSmi) \
94
+ V(CheckPrototypeMaps) \
95
+ V(CheckSmi) \
96
+ V(ClassOfTest) \
97
+ V(Compare) \
98
+ V(CompareJSObjectEq) \
99
+ V(CompareMap) \
100
+ V(Constant) \
101
+ V(Context) \
102
+ V(DeleteProperty) \
103
+ V(Deoptimize) \
104
+ V(Div) \
105
+ V(EnterInlined) \
106
+ V(ExternalArrayLength) \
107
+ V(FixedArrayLength) \
108
+ V(FunctionLiteral) \
109
+ V(GetCachedArrayIndex) \
110
+ V(GlobalObject) \
111
+ V(GlobalReceiver) \
112
+ V(Goto) \
113
+ V(HasInstanceType) \
114
+ V(HasCachedArrayIndex) \
115
+ V(InstanceOf) \
116
+ V(InstanceOfKnownGlobal) \
117
+ V(IsNull) \
118
+ V(IsObject) \
119
+ V(IsSmi) \
120
+ V(IsConstructCall) \
121
+ V(JSArrayLength) \
122
+ V(LeaveInlined) \
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(Mod) \
136
+ V(Mul) \
137
+ V(ObjectLiteral) \
138
+ V(OsrEntry) \
139
+ V(OuterContext) \
140
+ V(Parameter) \
141
+ V(Power) \
142
+ V(PushArgument) \
143
+ V(RegExpLiteral) \
144
+ V(Return) \
145
+ V(Sar) \
146
+ V(Shl) \
147
+ V(Shr) \
148
+ V(Simulate) \
149
+ V(StackCheck) \
150
+ V(StoreContextSlot) \
151
+ V(StoreGlobalCell) \
152
+ V(StoreGlobalGeneric) \
153
+ V(StoreKeyedFastElement) \
154
+ V(StoreKeyedSpecializedArrayElement) \
155
+ V(StoreKeyedGeneric) \
156
+ V(StoreNamedField) \
157
+ V(StoreNamedGeneric) \
158
+ V(StringCharCodeAt) \
159
+ V(StringCharFromCode) \
160
+ V(StringLength) \
161
+ V(Sub) \
162
+ V(Test) \
163
+ V(Throw) \
164
+ V(ToFastProperties) \
165
+ V(Typeof) \
166
+ V(TypeofIs) \
167
+ V(UnaryMathOperation) \
168
+ V(UnknownOSRValue) \
169
+ V(ValueOf)
170
+
171
+ #define GVN_FLAG_LIST(V) \
172
+ V(Calls) \
173
+ V(InobjectFields) \
174
+ V(BackingStoreFields) \
175
+ V(ArrayElements) \
176
+ V(SpecializedArrayElements) \
177
+ V(GlobalVars) \
178
+ V(Maps) \
179
+ V(ArrayLengths) \
180
+ V(ContextSlots) \
181
+ V(OsrEntries)
182
+
183
+ #define DECLARE_INSTRUCTION(type) \
184
+ virtual bool Is##type() const { return true; } \
185
+ static H##type* cast(HValue* value) { \
186
+ ASSERT(value->Is##type()); \
187
+ return reinterpret_cast<H##type*>(value); \
188
+ } \
189
+ Opcode opcode() const { return HValue::k##type; }
190
+
191
+
192
+ #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
193
+ virtual LInstruction* CompileToLithium(LChunkBuilder* builder); \
194
+ virtual const char* Mnemonic() const { return mnemonic; } \
195
+ DECLARE_INSTRUCTION(type)
196
+
197
+
198
+ class Range: public ZoneObject {
199
+ public:
200
+ Range()
201
+ : lower_(kMinInt),
202
+ upper_(kMaxInt),
203
+ next_(NULL),
204
+ can_be_minus_zero_(false) { }
205
+
206
+ Range(int32_t lower, int32_t upper)
207
+ : lower_(lower),
208
+ upper_(upper),
209
+ next_(NULL),
210
+ can_be_minus_zero_(false) { }
211
+
212
+ int32_t upper() const { return upper_; }
213
+ int32_t lower() const { return lower_; }
214
+ Range* next() const { return next_; }
215
+ Range* CopyClearLower() const { return new Range(kMinInt, upper_); }
216
+ Range* CopyClearUpper() const { return new Range(lower_, kMaxInt); }
217
+ Range* Copy() const { return new Range(lower_, upper_); }
218
+ int32_t Mask() const;
219
+ void set_can_be_minus_zero(bool b) { can_be_minus_zero_ = b; }
220
+ bool CanBeMinusZero() const { return CanBeZero() && can_be_minus_zero_; }
221
+ bool CanBeZero() const { return upper_ >= 0 && lower_ <= 0; }
222
+ bool CanBeNegative() const { return lower_ < 0; }
223
+ bool Includes(int value) const { return lower_ <= value && upper_ >= value; }
224
+ bool IsMostGeneric() const { return lower_ == kMinInt && upper_ == kMaxInt; }
225
+ bool IsInSmiRange() const {
226
+ return lower_ >= Smi::kMinValue && upper_ <= Smi::kMaxValue;
227
+ }
228
+ void KeepOrder();
229
+ void Verify() const;
230
+
231
+ void StackUpon(Range* other) {
232
+ Intersect(other);
233
+ next_ = other;
234
+ }
235
+
236
+ void Intersect(Range* other);
237
+ void Union(Range* other);
238
+
239
+ void AddConstant(int32_t value);
240
+ void Sar(int32_t value);
241
+ void Shl(int32_t value);
242
+ bool AddAndCheckOverflow(Range* other);
243
+ bool SubAndCheckOverflow(Range* other);
244
+ bool MulAndCheckOverflow(Range* other);
245
+
246
+ private:
247
+ int32_t lower_;
248
+ int32_t upper_;
249
+ Range* next_;
250
+ bool can_be_minus_zero_;
251
+ };
252
+
253
+
254
+ class Representation {
255
+ public:
256
+ enum Kind {
257
+ kNone,
258
+ kTagged,
259
+ kDouble,
260
+ kInteger32,
261
+ kExternal,
262
+ kNumRepresentations
263
+ };
264
+
265
+ Representation() : kind_(kNone) { }
266
+
267
+ static Representation None() { return Representation(kNone); }
268
+ static Representation Tagged() { return Representation(kTagged); }
269
+ static Representation Integer32() { return Representation(kInteger32); }
270
+ static Representation Double() { return Representation(kDouble); }
271
+ static Representation External() { return Representation(kExternal); }
272
+
273
+ bool Equals(const Representation& other) {
274
+ return kind_ == other.kind_;
275
+ }
276
+
277
+ Kind kind() const { return kind_; }
278
+ bool IsNone() const { return kind_ == kNone; }
279
+ bool IsTagged() const { return kind_ == kTagged; }
280
+ bool IsInteger32() const { return kind_ == kInteger32; }
281
+ bool IsDouble() const { return kind_ == kDouble; }
282
+ bool IsExternal() const { return kind_ == kExternal; }
283
+ bool IsSpecialization() const {
284
+ return kind_ == kInteger32 || kind_ == kDouble;
285
+ }
286
+ const char* Mnemonic() const;
287
+
288
+ private:
289
+ explicit Representation(Kind k) : kind_(k) { }
290
+
291
+ Kind kind_;
292
+ };
293
+
294
+
295
+ class HType {
296
+ public:
297
+ HType() : type_(kUninitialized) { }
298
+
299
+ static HType Tagged() { return HType(kTagged); }
300
+ static HType TaggedPrimitive() { return HType(kTaggedPrimitive); }
301
+ static HType TaggedNumber() { return HType(kTaggedNumber); }
302
+ static HType Smi() { return HType(kSmi); }
303
+ static HType HeapNumber() { return HType(kHeapNumber); }
304
+ static HType String() { return HType(kString); }
305
+ static HType Boolean() { return HType(kBoolean); }
306
+ static HType NonPrimitive() { return HType(kNonPrimitive); }
307
+ static HType JSArray() { return HType(kJSArray); }
308
+ static HType JSObject() { return HType(kJSObject); }
309
+ static HType Uninitialized() { return HType(kUninitialized); }
310
+
311
+ // Return the weakest (least precise) common type.
312
+ HType Combine(HType other) {
313
+ return HType(static_cast<Type>(type_ & other.type_));
314
+ }
315
+
316
+ bool Equals(const HType& other) {
317
+ return type_ == other.type_;
318
+ }
319
+
320
+ bool IsSubtypeOf(const HType& other) {
321
+ return Combine(other).Equals(other);
322
+ }
323
+
324
+ bool IsTagged() {
325
+ ASSERT(type_ != kUninitialized);
326
+ return ((type_ & kTagged) == kTagged);
327
+ }
328
+
329
+ bool IsTaggedPrimitive() {
330
+ ASSERT(type_ != kUninitialized);
331
+ return ((type_ & kTaggedPrimitive) == kTaggedPrimitive);
332
+ }
333
+
334
+ bool IsTaggedNumber() {
335
+ ASSERT(type_ != kUninitialized);
336
+ return ((type_ & kTaggedNumber) == kTaggedNumber);
337
+ }
338
+
339
+ bool IsSmi() {
340
+ ASSERT(type_ != kUninitialized);
341
+ return ((type_ & kSmi) == kSmi);
342
+ }
343
+
344
+ bool IsHeapNumber() {
345
+ ASSERT(type_ != kUninitialized);
346
+ return ((type_ & kHeapNumber) == kHeapNumber);
347
+ }
348
+
349
+ bool IsString() {
350
+ ASSERT(type_ != kUninitialized);
351
+ return ((type_ & kString) == kString);
352
+ }
353
+
354
+ bool IsBoolean() {
355
+ ASSERT(type_ != kUninitialized);
356
+ return ((type_ & kBoolean) == kBoolean);
357
+ }
358
+
359
+ bool IsNonPrimitive() {
360
+ ASSERT(type_ != kUninitialized);
361
+ return ((type_ & kNonPrimitive) == kNonPrimitive);
362
+ }
363
+
364
+ bool IsJSArray() {
365
+ ASSERT(type_ != kUninitialized);
366
+ return ((type_ & kJSArray) == kJSArray);
367
+ }
368
+
369
+ bool IsJSObject() {
370
+ ASSERT(type_ != kUninitialized);
371
+ return ((type_ & kJSObject) == kJSObject);
372
+ }
373
+
374
+ bool IsUninitialized() {
375
+ return type_ == kUninitialized;
376
+ }
377
+
378
+ static HType TypeFromValue(Handle<Object> value);
379
+
380
+ const char* ToString();
381
+ const char* ToShortString();
382
+
383
+ private:
384
+ enum Type {
385
+ kTagged = 0x1, // 0000 0000 0000 0001
386
+ kTaggedPrimitive = 0x5, // 0000 0000 0000 0101
387
+ kTaggedNumber = 0xd, // 0000 0000 0000 1101
388
+ kSmi = 0x1d, // 0000 0000 0001 1101
389
+ kHeapNumber = 0x2d, // 0000 0000 0010 1101
390
+ kString = 0x45, // 0000 0000 0100 0101
391
+ kBoolean = 0x85, // 0000 0000 1000 0101
392
+ kNonPrimitive = 0x101, // 0000 0001 0000 0001
393
+ kJSObject = 0x301, // 0000 0011 0000 0001
394
+ kJSArray = 0x701, // 0000 0111 1000 0001
395
+ kUninitialized = 0x1fff // 0001 1111 1111 1111
396
+ };
397
+
398
+ explicit HType(Type t) : type_(t) { }
399
+
400
+ Type type_;
401
+ };
402
+
403
+
404
+ class HValue: public ZoneObject {
405
+ public:
406
+ static const int kNoNumber = -1;
407
+
408
+ // There must be one corresponding kDepends flag for every kChanges flag and
409
+ // the order of the kChanges flags must be exactly the same as of the kDepends
410
+ // flags.
411
+ enum Flag {
412
+ // Declare global value numbering flags.
413
+ #define DECLARE_DO(type) kChanges##type, kDependsOn##type,
414
+ GVN_FLAG_LIST(DECLARE_DO)
415
+ #undef DECLARE_DO
416
+ kFlexibleRepresentation,
417
+ kUseGVN,
418
+ kCanOverflow,
419
+ kBailoutOnMinusZero,
420
+ kCanBeDivByZero,
421
+ kIsArguments,
422
+ kTruncatingToInt32,
423
+ kLastFlag = kTruncatingToInt32
424
+ };
425
+
426
+ STATIC_ASSERT(kLastFlag < kBitsPerInt);
427
+
428
+ static const int kChangesToDependsFlagsLeftShift = 1;
429
+
430
+ static int ChangesFlagsMask() {
431
+ int result = 0;
432
+ // Create changes mask.
433
+ #define DECLARE_DO(type) result |= (1 << kChanges##type);
434
+ GVN_FLAG_LIST(DECLARE_DO)
435
+ #undef DECLARE_DO
436
+ return result;
437
+ }
438
+
439
+ static int DependsFlagsMask() {
440
+ return ConvertChangesToDependsFlags(ChangesFlagsMask());
441
+ }
442
+
443
+ static int ConvertChangesToDependsFlags(int flags) {
444
+ return flags << kChangesToDependsFlagsLeftShift;
445
+ }
446
+
447
+ static HValue* cast(HValue* value) { return value; }
448
+
449
+ enum Opcode {
450
+ // Declare a unique enum value for each hydrogen instruction.
451
+ #define DECLARE_DO(type) k##type,
452
+ HYDROGEN_ALL_INSTRUCTION_LIST(DECLARE_DO)
453
+ #undef DECLARE_DO
454
+ kMaxInstructionClass
455
+ };
456
+
457
+ HValue() : block_(NULL),
458
+ id_(kNoNumber),
459
+ type_(HType::Tagged()),
460
+ range_(NULL),
461
+ flags_(0) {}
462
+ virtual ~HValue() {}
463
+
464
+ HBasicBlock* block() const { return block_; }
465
+ void SetBlock(HBasicBlock* block);
466
+
467
+ int id() const { return id_; }
468
+ void set_id(int id) { id_ = id; }
469
+
470
+ SmallPointerList<HValue>* uses() { return &uses_; }
471
+
472
+ virtual bool EmitAtUses() { return false; }
473
+ Representation representation() const { return representation_; }
474
+ void ChangeRepresentation(Representation r) {
475
+ // Representation was already set and is allowed to be changed.
476
+ ASSERT(!representation_.IsNone());
477
+ ASSERT(!r.IsNone());
478
+ ASSERT(CheckFlag(kFlexibleRepresentation));
479
+ RepresentationChanged(r);
480
+ representation_ = r;
481
+ }
482
+
483
+ HType type() const { return type_; }
484
+ void set_type(HType type) {
485
+ ASSERT(uses_.length() == 0);
486
+ type_ = type;
487
+ }
488
+
489
+ // An operation needs to override this function iff:
490
+ // 1) it can produce an int32 output.
491
+ // 2) the true value of its output can potentially be minus zero.
492
+ // The implementation must set a flag so that it bails out in the case where
493
+ // it would otherwise output what should be a minus zero as an int32 zero.
494
+ // If the operation also exists in a form that takes int32 and outputs int32
495
+ // then the operation should return its input value so that we can propagate
496
+ // back. There are two operations that need to propagate back to more than
497
+ // one input. They are phi and binary add. They always return NULL and
498
+ // expect the caller to take care of things.
499
+ virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited) {
500
+ visited->Add(id());
501
+ return NULL;
502
+ }
503
+
504
+ bool IsDefinedAfter(HBasicBlock* other) const;
505
+
506
+ // Operands.
507
+ virtual int OperandCount() = 0;
508
+ virtual HValue* OperandAt(int index) = 0;
509
+ void SetOperandAt(int index, HValue* value);
510
+
511
+ int LookupOperandIndex(int occurrence_index, HValue* op);
512
+ bool UsesMultipleTimes(HValue* op);
513
+
514
+ void ReplaceAndDelete(HValue* other);
515
+ void ReplaceValue(HValue* other);
516
+ void ReplaceAtUse(HValue* use, HValue* other);
517
+ void ReplaceFirstAtUse(HValue* use, HValue* other, Representation r);
518
+ bool HasNoUses() const { return uses_.is_empty(); }
519
+ void ClearOperands();
520
+ void Delete();
521
+
522
+ int flags() const { return flags_; }
523
+ void SetFlag(Flag f) { flags_ |= (1 << f); }
524
+ void ClearFlag(Flag f) { flags_ &= ~(1 << f); }
525
+ bool CheckFlag(Flag f) const { return (flags_ & (1 << f)) != 0; }
526
+
527
+ void SetAllSideEffects() { flags_ |= AllSideEffects(); }
528
+ void ClearAllSideEffects() { flags_ &= ~AllSideEffects(); }
529
+ bool HasSideEffects() const { return (flags_ & AllSideEffects()) != 0; }
530
+
531
+ Range* range() const { return range_; }
532
+ bool HasRange() const { return range_ != NULL; }
533
+ void AddNewRange(Range* r);
534
+ void RemoveLastAddedRange();
535
+ void ComputeInitialRange();
536
+
537
+ // Representation helpers.
538
+ virtual Representation RequiredInputRepresentation(int index) const = 0;
539
+
540
+ virtual Representation InferredRepresentation() {
541
+ return representation();
542
+ }
543
+
544
+ // This gives the instruction an opportunity to replace itself with an
545
+ // instruction that does the same in some better way. To replace an
546
+ // instruction with a new one, first add the new instruction to the graph,
547
+ // then return it. Return NULL to have the instruction deleted.
548
+ virtual HValue* Canonicalize() { return this; }
549
+
550
+ // Declare virtual type testers.
551
+ #define DECLARE_DO(type) virtual bool Is##type() const { return false; }
552
+ HYDROGEN_ALL_INSTRUCTION_LIST(DECLARE_DO)
553
+ #undef DECLARE_DO
554
+
555
+ bool Equals(HValue* other);
556
+ virtual intptr_t Hashcode();
557
+
558
+ // Printing support.
559
+ virtual void PrintTo(StringStream* stream) = 0;
560
+ void PrintNameTo(StringStream* stream);
561
+ static void PrintTypeTo(HType type, StringStream* stream);
562
+
563
+ virtual const char* Mnemonic() const = 0;
564
+ virtual Opcode opcode() const = 0;
565
+
566
+ // Updated the inferred type of this instruction and returns true if
567
+ // it has changed.
568
+ bool UpdateInferredType();
569
+
570
+ virtual HType CalculateInferredType();
571
+
572
+ #ifdef DEBUG
573
+ virtual void Verify() = 0;
574
+ #endif
575
+
576
+ protected:
577
+ // This function must be overridden for instructions with flag kUseGVN, to
578
+ // compare the non-Operand parts of the instruction.
579
+ virtual bool DataEquals(HValue* other) {
580
+ UNREACHABLE();
581
+ return false;
582
+ }
583
+ virtual void RepresentationChanged(Representation to) { }
584
+ virtual Range* InferRange();
585
+ virtual void DeleteFromGraph() = 0;
586
+ virtual void InternalSetOperandAt(int index, HValue* value) = 0;
587
+ void clear_block() {
588
+ ASSERT(block_ != NULL);
589
+ block_ = NULL;
590
+ }
591
+
592
+ void set_representation(Representation r) {
593
+ // Representation is set-once.
594
+ ASSERT(representation_.IsNone() && !r.IsNone());
595
+ representation_ = r;
596
+ }
597
+
598
+ private:
599
+ // A flag mask to mark an instruction as having arbitrary side effects.
600
+ static int AllSideEffects() {
601
+ return ChangesFlagsMask() & ~(1 << kChangesOsrEntries);
602
+ }
603
+
604
+ void InternalReplaceAtUse(HValue* use, HValue* other);
605
+ void RegisterUse(int index, HValue* new_value);
606
+
607
+ HBasicBlock* block_;
608
+
609
+ // The id of this instruction in the hydrogen graph, assigned when first
610
+ // added to the graph. Reflects creation order.
611
+ int id_;
612
+
613
+ Representation representation_;
614
+ SmallPointerList<HValue> uses_;
615
+ HType type_;
616
+ Range* range_;
617
+ int flags_;
618
+
619
+ DISALLOW_COPY_AND_ASSIGN(HValue);
620
+ };
621
+
622
+
623
+ class HInstruction: public HValue {
624
+ public:
625
+ HInstruction* next() const { return next_; }
626
+ HInstruction* previous() const { return previous_; }
627
+
628
+ virtual void PrintTo(StringStream* stream);
629
+ virtual void PrintDataTo(StringStream* stream) { }
630
+
631
+ bool IsLinked() const { return block() != NULL; }
632
+ void Unlink();
633
+ void InsertBefore(HInstruction* next);
634
+ void InsertAfter(HInstruction* previous);
635
+
636
+ int position() const { return position_; }
637
+ bool has_position() const { return position_ != RelocInfo::kNoPosition; }
638
+ void set_position(int position) { position_ = position; }
639
+
640
+ virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0;
641
+
642
+ #ifdef DEBUG
643
+ virtual void Verify();
644
+ #endif
645
+
646
+ // Returns whether this is some kind of deoptimizing check
647
+ // instruction.
648
+ virtual bool IsCheckInstruction() const { return false; }
649
+
650
+ virtual bool IsCall() { return false; }
651
+
652
+ DECLARE_INSTRUCTION(Instruction)
653
+
654
+ protected:
655
+ HInstruction()
656
+ : next_(NULL),
657
+ previous_(NULL),
658
+ position_(RelocInfo::kNoPosition) {
659
+ SetFlag(kDependsOnOsrEntries);
660
+ }
661
+
662
+ virtual void DeleteFromGraph() { Unlink(); }
663
+
664
+ private:
665
+ void InitializeAsFirst(HBasicBlock* block) {
666
+ ASSERT(!IsLinked());
667
+ SetBlock(block);
668
+ }
669
+
670
+ HInstruction* next_;
671
+ HInstruction* previous_;
672
+ int position_;
673
+
674
+ friend class HBasicBlock;
675
+ };
676
+
677
+
678
+ class HControlInstruction: public HInstruction {
679
+ public:
680
+ HControlInstruction(HBasicBlock* first, HBasicBlock* second)
681
+ : first_successor_(first), second_successor_(second) {
682
+ }
683
+
684
+ HBasicBlock* FirstSuccessor() const { return first_successor_; }
685
+ HBasicBlock* SecondSuccessor() const { return second_successor_; }
686
+
687
+ virtual void PrintDataTo(StringStream* stream);
688
+
689
+ DECLARE_INSTRUCTION(ControlInstruction)
690
+
691
+ private:
692
+ HBasicBlock* first_successor_;
693
+ HBasicBlock* second_successor_;
694
+ };
695
+
696
+
697
+ template<int NumElements>
698
+ class HOperandContainer {
699
+ public:
700
+ HOperandContainer() : elems_() { }
701
+
702
+ int length() { return NumElements; }
703
+ HValue*& operator[](int i) {
704
+ ASSERT(i < length());
705
+ return elems_[i];
706
+ }
707
+
708
+ private:
709
+ HValue* elems_[NumElements];
710
+ };
711
+
712
+
713
+ template<>
714
+ class HOperandContainer<0> {
715
+ public:
716
+ int length() { return 0; }
717
+ HValue*& operator[](int i) {
718
+ UNREACHABLE();
719
+ static HValue* t = 0;
720
+ return t;
721
+ }
722
+ };
723
+
724
+
725
+ template<int V>
726
+ class HTemplateInstruction : public HInstruction {
727
+ public:
728
+ int OperandCount() { return V; }
729
+ HValue* OperandAt(int i) { return inputs_[i]; }
730
+
731
+ protected:
732
+ void InternalSetOperandAt(int i, HValue* value) { inputs_[i] = value; }
733
+
734
+ private:
735
+ HOperandContainer<V> inputs_;
736
+ };
737
+
738
+
739
+ template<int V>
740
+ class HTemplateControlInstruction : public HControlInstruction {
741
+ public:
742
+ HTemplateControlInstruction<V>(HBasicBlock* first, HBasicBlock* second)
743
+ : HControlInstruction(first, second) { }
744
+ int OperandCount() { return V; }
745
+ HValue* OperandAt(int i) { return inputs_[i]; }
746
+
747
+ protected:
748
+ void InternalSetOperandAt(int i, HValue* value) { inputs_[i] = value; }
749
+
750
+ private:
751
+ HOperandContainer<V> inputs_;
752
+ };
753
+
754
+
755
+ class HBlockEntry: public HTemplateInstruction<0> {
756
+ public:
757
+ virtual Representation RequiredInputRepresentation(int index) const {
758
+ return Representation::None();
759
+ }
760
+
761
+ DECLARE_CONCRETE_INSTRUCTION(BlockEntry, "block_entry")
762
+ };
763
+
764
+
765
+ class HDeoptimize: public HControlInstruction {
766
+ public:
767
+ explicit HDeoptimize(int environment_length)
768
+ : HControlInstruction(NULL, NULL),
769
+ values_(environment_length) { }
770
+
771
+ virtual Representation RequiredInputRepresentation(int index) const {
772
+ return Representation::None();
773
+ }
774
+
775
+ virtual int OperandCount() { return values_.length(); }
776
+ virtual HValue* OperandAt(int index) { return values_[index]; }
777
+
778
+ void AddEnvironmentValue(HValue* value) {
779
+ values_.Add(NULL);
780
+ SetOperandAt(values_.length() - 1, value);
781
+ }
782
+
783
+ DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
784
+
785
+ protected:
786
+ virtual void InternalSetOperandAt(int index, HValue* value) {
787
+ values_[index] = value;
788
+ }
789
+
790
+ private:
791
+ ZoneList<HValue*> values_;
792
+ };
793
+
794
+
795
+ class HGoto: public HTemplateControlInstruction<0> {
796
+ public:
797
+ explicit HGoto(HBasicBlock* target)
798
+ : HTemplateControlInstruction<0>(target, NULL),
799
+ include_stack_check_(false) { }
800
+
801
+ void set_include_stack_check(bool include_stack_check) {
802
+ include_stack_check_ = include_stack_check;
803
+ }
804
+ bool include_stack_check() const { return include_stack_check_; }
805
+
806
+ virtual Representation RequiredInputRepresentation(int index) const {
807
+ return Representation::None();
808
+ }
809
+
810
+ DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
811
+
812
+ private:
813
+ bool include_stack_check_;
814
+ };
815
+
816
+
817
+ class HUnaryControlInstruction: public HTemplateControlInstruction<1> {
818
+ public:
819
+ explicit HUnaryControlInstruction(HValue* value,
820
+ HBasicBlock* true_target,
821
+ HBasicBlock* false_target)
822
+ : HTemplateControlInstruction<1>(true_target, false_target) {
823
+ SetOperandAt(0, value);
824
+ }
825
+
826
+ virtual void PrintDataTo(StringStream* stream);
827
+
828
+ HValue* value() { return OperandAt(0); }
829
+
830
+ DECLARE_INSTRUCTION(UnaryControlInstruction)
831
+ };
832
+
833
+
834
+ class HTest: public HUnaryControlInstruction {
835
+ public:
836
+ HTest(HValue* value, HBasicBlock* true_target, HBasicBlock* false_target)
837
+ : HUnaryControlInstruction(value, true_target, false_target) {
838
+ ASSERT(true_target != NULL && false_target != NULL);
839
+ }
840
+
841
+ virtual Representation RequiredInputRepresentation(int index) const {
842
+ return Representation::None();
843
+ }
844
+
845
+ DECLARE_CONCRETE_INSTRUCTION(Test, "test")
846
+ };
847
+
848
+
849
+ class HCompareMap: public HUnaryControlInstruction {
850
+ public:
851
+ HCompareMap(HValue* value,
852
+ Handle<Map> map,
853
+ HBasicBlock* true_target,
854
+ HBasicBlock* false_target)
855
+ : HUnaryControlInstruction(value, true_target, false_target),
856
+ map_(map) {
857
+ ASSERT(true_target != NULL);
858
+ ASSERT(false_target != NULL);
859
+ ASSERT(!map.is_null());
860
+ }
861
+
862
+ virtual void PrintDataTo(StringStream* stream);
863
+
864
+ Handle<Map> map() const { return map_; }
865
+
866
+ virtual Representation RequiredInputRepresentation(int index) const {
867
+ return Representation::Tagged();
868
+ }
869
+
870
+ DECLARE_CONCRETE_INSTRUCTION(CompareMap, "compare_map")
871
+
872
+ private:
873
+ Handle<Map> map_;
874
+ };
875
+
876
+
877
+ class HReturn: public HUnaryControlInstruction {
878
+ public:
879
+ explicit HReturn(HValue* value)
880
+ : HUnaryControlInstruction(value, NULL, NULL) {
881
+ }
882
+
883
+ virtual Representation RequiredInputRepresentation(int index) const {
884
+ return Representation::Tagged();
885
+ }
886
+
887
+ DECLARE_CONCRETE_INSTRUCTION(Return, "return")
888
+ };
889
+
890
+
891
+ class HAbnormalExit: public HTemplateControlInstruction<0> {
892
+ public:
893
+ HAbnormalExit() : HTemplateControlInstruction<0>(NULL, NULL) { }
894
+
895
+ virtual Representation RequiredInputRepresentation(int index) const {
896
+ return Representation::None();
897
+ }
898
+
899
+ DECLARE_CONCRETE_INSTRUCTION(AbnormalExit, "abnormal_exit")
900
+ };
901
+
902
+
903
+ class HUnaryOperation: public HTemplateInstruction<1> {
904
+ public:
905
+ explicit HUnaryOperation(HValue* value) {
906
+ SetOperandAt(0, value);
907
+ }
908
+
909
+ HValue* value() { return OperandAt(0); }
910
+ virtual void PrintDataTo(StringStream* stream);
911
+
912
+ DECLARE_INSTRUCTION(UnaryOperation)
913
+ };
914
+
915
+
916
+ class HThrow: public HUnaryOperation {
917
+ public:
918
+ explicit HThrow(HValue* value) : HUnaryOperation(value) {
919
+ SetAllSideEffects();
920
+ }
921
+
922
+ virtual Representation RequiredInputRepresentation(int index) const {
923
+ return Representation::Tagged();
924
+ }
925
+
926
+ DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
927
+ };
928
+
929
+
930
+ class HChange: public HUnaryOperation {
931
+ public:
932
+ HChange(HValue* value,
933
+ Representation from,
934
+ Representation to,
935
+ bool is_truncating)
936
+ : HUnaryOperation(value), from_(from) {
937
+ ASSERT(!from.IsNone() && !to.IsNone());
938
+ ASSERT(!from.Equals(to));
939
+ set_representation(to);
940
+ SetFlag(kUseGVN);
941
+ if (is_truncating) SetFlag(kTruncatingToInt32);
942
+ if (from.IsInteger32() && to.IsTagged() && value->range() != NULL &&
943
+ value->range()->IsInSmiRange()) {
944
+ set_type(HType::Smi());
945
+ }
946
+ }
947
+
948
+ virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
949
+
950
+ Representation from() const { return from_; }
951
+ Representation to() const { return representation(); }
952
+ virtual Representation RequiredInputRepresentation(int index) const {
953
+ return from_;
954
+ }
955
+
956
+ bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); }
957
+
958
+ virtual void PrintDataTo(StringStream* stream);
959
+
960
+ DECLARE_CONCRETE_INSTRUCTION(Change,
961
+ CanTruncateToInt32() ? "truncate" : "change")
962
+
963
+ protected:
964
+ virtual bool DataEquals(HValue* other) {
965
+ if (!other->IsChange()) return false;
966
+ HChange* change = HChange::cast(other);
967
+ return value() == change->value()
968
+ && to().Equals(change->to());
969
+ }
970
+
971
+ private:
972
+ Representation from_;
973
+ };
974
+
975
+
976
+ class HSimulate: public HInstruction {
977
+ public:
978
+ HSimulate(int ast_id, int pop_count)
979
+ : ast_id_(ast_id),
980
+ pop_count_(pop_count),
981
+ values_(2),
982
+ assigned_indexes_(2) {}
983
+ virtual ~HSimulate() {}
984
+
985
+ virtual void PrintDataTo(StringStream* stream);
986
+
987
+ bool HasAstId() const { return ast_id_ != AstNode::kNoNumber; }
988
+ int ast_id() const { return ast_id_; }
989
+ void set_ast_id(int id) {
990
+ ASSERT(!HasAstId());
991
+ ast_id_ = id;
992
+ }
993
+
994
+ int pop_count() const { return pop_count_; }
995
+ const ZoneList<HValue*>* values() const { return &values_; }
996
+ int GetAssignedIndexAt(int index) const {
997
+ ASSERT(HasAssignedIndexAt(index));
998
+ return assigned_indexes_[index];
999
+ }
1000
+ bool HasAssignedIndexAt(int index) const {
1001
+ return assigned_indexes_[index] != kNoIndex;
1002
+ }
1003
+ void AddAssignedValue(int index, HValue* value) {
1004
+ AddValue(index, value);
1005
+ }
1006
+ void AddPushedValue(HValue* value) {
1007
+ AddValue(kNoIndex, value);
1008
+ }
1009
+ virtual int OperandCount() { return values_.length(); }
1010
+ virtual HValue* OperandAt(int index) { return values_[index]; }
1011
+
1012
+ virtual Representation RequiredInputRepresentation(int index) const {
1013
+ return Representation::None();
1014
+ }
1015
+
1016
+ DECLARE_CONCRETE_INSTRUCTION(Simulate, "simulate")
1017
+
1018
+ #ifdef DEBUG
1019
+ virtual void Verify();
1020
+ #endif
1021
+
1022
+ protected:
1023
+ virtual void InternalSetOperandAt(int index, HValue* value) {
1024
+ values_[index] = value;
1025
+ }
1026
+
1027
+ private:
1028
+ static const int kNoIndex = -1;
1029
+ void AddValue(int index, HValue* value) {
1030
+ assigned_indexes_.Add(index);
1031
+ // Resize the list of pushed values.
1032
+ values_.Add(NULL);
1033
+ // Set the operand through the base method in HValue to make sure that the
1034
+ // use lists are correctly updated.
1035
+ SetOperandAt(values_.length() - 1, value);
1036
+ }
1037
+ int ast_id_;
1038
+ int pop_count_;
1039
+ ZoneList<HValue*> values_;
1040
+ ZoneList<int> assigned_indexes_;
1041
+ };
1042
+
1043
+
1044
+ class HStackCheck: public HTemplateInstruction<0> {
1045
+ public:
1046
+ HStackCheck() { }
1047
+
1048
+ virtual Representation RequiredInputRepresentation(int index) const {
1049
+ return Representation::None();
1050
+ }
1051
+
1052
+ DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack_check")
1053
+ };
1054
+
1055
+
1056
+ class HEnterInlined: public HTemplateInstruction<0> {
1057
+ public:
1058
+ HEnterInlined(Handle<JSFunction> closure, FunctionLiteral* function)
1059
+ : closure_(closure), function_(function) {
1060
+ }
1061
+
1062
+ virtual void PrintDataTo(StringStream* stream);
1063
+
1064
+ Handle<JSFunction> closure() const { return closure_; }
1065
+ FunctionLiteral* function() const { return function_; }
1066
+
1067
+ virtual Representation RequiredInputRepresentation(int index) const {
1068
+ return Representation::None();
1069
+ }
1070
+
1071
+ DECLARE_CONCRETE_INSTRUCTION(EnterInlined, "enter_inlined")
1072
+
1073
+ private:
1074
+ Handle<JSFunction> closure_;
1075
+ FunctionLiteral* function_;
1076
+ };
1077
+
1078
+
1079
+ class HLeaveInlined: public HTemplateInstruction<0> {
1080
+ public:
1081
+ HLeaveInlined() {}
1082
+
1083
+ virtual Representation RequiredInputRepresentation(int index) const {
1084
+ return Representation::None();
1085
+ }
1086
+
1087
+ DECLARE_CONCRETE_INSTRUCTION(LeaveInlined, "leave_inlined")
1088
+ };
1089
+
1090
+
1091
+ class HPushArgument: public HUnaryOperation {
1092
+ public:
1093
+ explicit HPushArgument(HValue* value) : HUnaryOperation(value) {
1094
+ set_representation(Representation::Tagged());
1095
+ }
1096
+
1097
+ virtual Representation RequiredInputRepresentation(int index) const {
1098
+ return Representation::Tagged();
1099
+ }
1100
+
1101
+ HValue* argument() { return OperandAt(0); }
1102
+
1103
+ DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push_argument")
1104
+ };
1105
+
1106
+
1107
+ class HContext: public HTemplateInstruction<0> {
1108
+ public:
1109
+ HContext() {
1110
+ set_representation(Representation::Tagged());
1111
+ SetFlag(kUseGVN);
1112
+ }
1113
+
1114
+ virtual Representation RequiredInputRepresentation(int index) const {
1115
+ return Representation::None();
1116
+ }
1117
+
1118
+ DECLARE_CONCRETE_INSTRUCTION(Context, "context");
1119
+
1120
+ protected:
1121
+ virtual bool DataEquals(HValue* other) { return true; }
1122
+ };
1123
+
1124
+
1125
+ class HOuterContext: public HUnaryOperation {
1126
+ public:
1127
+ explicit HOuterContext(HValue* inner) : HUnaryOperation(inner) {
1128
+ set_representation(Representation::Tagged());
1129
+ SetFlag(kUseGVN);
1130
+ }
1131
+
1132
+ DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer_context");
1133
+
1134
+ virtual Representation RequiredInputRepresentation(int index) const {
1135
+ return Representation::Tagged();
1136
+ }
1137
+
1138
+ protected:
1139
+ virtual bool DataEquals(HValue* other) { return true; }
1140
+ };
1141
+
1142
+
1143
+ class HGlobalObject: public HUnaryOperation {
1144
+ public:
1145
+ explicit HGlobalObject(HValue* context) : HUnaryOperation(context) {
1146
+ set_representation(Representation::Tagged());
1147
+ SetFlag(kUseGVN);
1148
+ }
1149
+
1150
+ DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global_object")
1151
+
1152
+ virtual Representation RequiredInputRepresentation(int index) const {
1153
+ return Representation::Tagged();
1154
+ }
1155
+
1156
+ protected:
1157
+ virtual bool DataEquals(HValue* other) { return true; }
1158
+ };
1159
+
1160
+
1161
+ class HGlobalReceiver: public HUnaryOperation {
1162
+ public:
1163
+ explicit HGlobalReceiver(HValue* global_object)
1164
+ : HUnaryOperation(global_object) {
1165
+ set_representation(Representation::Tagged());
1166
+ SetFlag(kUseGVN);
1167
+ }
1168
+
1169
+ DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global_receiver")
1170
+
1171
+ virtual Representation RequiredInputRepresentation(int index) const {
1172
+ return Representation::Tagged();
1173
+ }
1174
+
1175
+ protected:
1176
+ virtual bool DataEquals(HValue* other) { return true; }
1177
+ };
1178
+
1179
+
1180
+ template <int V>
1181
+ class HCall: public HTemplateInstruction<V> {
1182
+ public:
1183
+ // The argument count includes the receiver.
1184
+ explicit HCall<V>(int argument_count) : argument_count_(argument_count) {
1185
+ this->set_representation(Representation::Tagged());
1186
+ this->SetAllSideEffects();
1187
+ }
1188
+
1189
+ virtual HType CalculateInferredType() { return HType::Tagged(); }
1190
+
1191
+ virtual int argument_count() const { return argument_count_; }
1192
+
1193
+ virtual bool IsCall() { return true; }
1194
+
1195
+ private:
1196
+ int argument_count_;
1197
+ };
1198
+
1199
+
1200
+ class HUnaryCall: public HCall<1> {
1201
+ public:
1202
+ HUnaryCall(HValue* value, int argument_count)
1203
+ : HCall<1>(argument_count) {
1204
+ SetOperandAt(0, value);
1205
+ }
1206
+
1207
+ virtual Representation RequiredInputRepresentation(int index) const {
1208
+ return Representation::Tagged();
1209
+ }
1210
+
1211
+ virtual void PrintDataTo(StringStream* stream);
1212
+
1213
+ HValue* value() { return OperandAt(0); }
1214
+
1215
+ DECLARE_INSTRUCTION(UnaryCall)
1216
+ };
1217
+
1218
+
1219
+ class HBinaryCall: public HCall<2> {
1220
+ public:
1221
+ HBinaryCall(HValue* first, HValue* second, int argument_count)
1222
+ : HCall<2>(argument_count) {
1223
+ SetOperandAt(0, first);
1224
+ SetOperandAt(1, second);
1225
+ }
1226
+
1227
+ virtual void PrintDataTo(StringStream* stream);
1228
+
1229
+ virtual Representation RequiredInputRepresentation(int index) const {
1230
+ return Representation::Tagged();
1231
+ }
1232
+
1233
+ HValue* first() { return OperandAt(0); }
1234
+ HValue* second() { return OperandAt(1); }
1235
+
1236
+ DECLARE_INSTRUCTION(BinaryCall)
1237
+ };
1238
+
1239
+
1240
+ class HCallConstantFunction: public HCall<0> {
1241
+ public:
1242
+ HCallConstantFunction(Handle<JSFunction> function, int argument_count)
1243
+ : HCall<0>(argument_count), function_(function) { }
1244
+
1245
+ Handle<JSFunction> function() const { return function_; }
1246
+
1247
+ bool IsApplyFunction() const {
1248
+ return function_->code() ==
1249
+ Isolate::Current()->builtins()->builtin(Builtins::kFunctionApply);
1250
+ }
1251
+
1252
+ virtual void PrintDataTo(StringStream* stream);
1253
+
1254
+ virtual Representation RequiredInputRepresentation(int index) const {
1255
+ return Representation::None();
1256
+ }
1257
+
1258
+ DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call_constant_function")
1259
+
1260
+ private:
1261
+ Handle<JSFunction> function_;
1262
+ };
1263
+
1264
+
1265
+ class HCallKeyed: public HBinaryCall {
1266
+ public:
1267
+ HCallKeyed(HValue* context, HValue* key, int argument_count)
1268
+ : HBinaryCall(context, key, argument_count) {
1269
+ }
1270
+
1271
+ virtual Representation RequiredInputRepresentation(int index) const {
1272
+ return Representation::Tagged();
1273
+ }
1274
+
1275
+ HValue* context() { return first(); }
1276
+ HValue* key() { return second(); }
1277
+
1278
+ DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call_keyed")
1279
+ };
1280
+
1281
+
1282
+ class HCallNamed: public HUnaryCall {
1283
+ public:
1284
+ HCallNamed(HValue* context, Handle<String> name, int argument_count)
1285
+ : HUnaryCall(context, argument_count), name_(name) {
1286
+ }
1287
+
1288
+ virtual void PrintDataTo(StringStream* stream);
1289
+
1290
+ HValue* context() { return value(); }
1291
+ Handle<String> name() const { return name_; }
1292
+
1293
+ DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call_named")
1294
+
1295
+ virtual Representation RequiredInputRepresentation(int index) const {
1296
+ return Representation::Tagged();
1297
+ }
1298
+
1299
+ private:
1300
+ Handle<String> name_;
1301
+ };
1302
+
1303
+
1304
+ class HCallFunction: public HUnaryCall {
1305
+ public:
1306
+ HCallFunction(HValue* context, int argument_count)
1307
+ : HUnaryCall(context, argument_count) {
1308
+ }
1309
+
1310
+ HValue* context() { return value(); }
1311
+
1312
+ virtual Representation RequiredInputRepresentation(int index) const {
1313
+ return Representation::Tagged();
1314
+ }
1315
+
1316
+ DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call_function")
1317
+ };
1318
+
1319
+
1320
+ class HCallGlobal: public HUnaryCall {
1321
+ public:
1322
+ HCallGlobal(HValue* context, Handle<String> name, int argument_count)
1323
+ : HUnaryCall(context, argument_count), name_(name) {
1324
+ }
1325
+
1326
+ virtual void PrintDataTo(StringStream* stream);
1327
+
1328
+ HValue* context() { return value(); }
1329
+ Handle<String> name() const { return name_; }
1330
+
1331
+ virtual Representation RequiredInputRepresentation(int index) const {
1332
+ return Representation::Tagged();
1333
+ }
1334
+
1335
+ DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call_global")
1336
+
1337
+ private:
1338
+ Handle<String> name_;
1339
+ };
1340
+
1341
+
1342
+ class HCallKnownGlobal: public HCall<0> {
1343
+ public:
1344
+ HCallKnownGlobal(Handle<JSFunction> target, int argument_count)
1345
+ : HCall<0>(argument_count), target_(target) { }
1346
+
1347
+ virtual void PrintDataTo(StringStream* stream);
1348
+
1349
+ Handle<JSFunction> target() const { return target_; }
1350
+
1351
+ virtual Representation RequiredInputRepresentation(int index) const {
1352
+ return Representation::None();
1353
+ }
1354
+
1355
+ DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call_known_global")
1356
+
1357
+ private:
1358
+ Handle<JSFunction> target_;
1359
+ };
1360
+
1361
+
1362
+ class HCallNew: public HBinaryCall {
1363
+ public:
1364
+ HCallNew(HValue* context, HValue* constructor, int argument_count)
1365
+ : HBinaryCall(context, constructor, argument_count) {
1366
+ }
1367
+
1368
+ virtual Representation RequiredInputRepresentation(int index) const {
1369
+ return Representation::Tagged();
1370
+ }
1371
+
1372
+ HValue* context() { return first(); }
1373
+ HValue* constructor() { return second(); }
1374
+
1375
+ DECLARE_CONCRETE_INSTRUCTION(CallNew, "call_new")
1376
+ };
1377
+
1378
+
1379
+ class HCallRuntime: public HCall<0> {
1380
+ public:
1381
+ HCallRuntime(Handle<String> name,
1382
+ const Runtime::Function* c_function,
1383
+ int argument_count)
1384
+ : HCall<0>(argument_count), c_function_(c_function), name_(name) { }
1385
+ virtual void PrintDataTo(StringStream* stream);
1386
+
1387
+ const Runtime::Function* function() const { return c_function_; }
1388
+ Handle<String> name() const { return name_; }
1389
+
1390
+ virtual Representation RequiredInputRepresentation(int index) const {
1391
+ return Representation::None();
1392
+ }
1393
+
1394
+ DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call_runtime")
1395
+
1396
+ private:
1397
+ const Runtime::Function* c_function_;
1398
+ Handle<String> name_;
1399
+ };
1400
+
1401
+
1402
+ class HJSArrayLength: public HUnaryOperation {
1403
+ public:
1404
+ explicit HJSArrayLength(HValue* value) : HUnaryOperation(value) {
1405
+ // The length of an array is stored as a tagged value in the array
1406
+ // object. It is guaranteed to be 32 bit integer, but it can be
1407
+ // represented as either a smi or heap number.
1408
+ set_representation(Representation::Tagged());
1409
+ SetFlag(kUseGVN);
1410
+ SetFlag(kDependsOnArrayLengths);
1411
+ SetFlag(kDependsOnMaps);
1412
+ }
1413
+
1414
+ virtual Representation RequiredInputRepresentation(int index) const {
1415
+ return Representation::Tagged();
1416
+ }
1417
+
1418
+ DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js_array_length")
1419
+
1420
+ protected:
1421
+ virtual bool DataEquals(HValue* other) { return true; }
1422
+ };
1423
+
1424
+
1425
+ class HFixedArrayLength: public HUnaryOperation {
1426
+ public:
1427
+ explicit HFixedArrayLength(HValue* value) : HUnaryOperation(value) {
1428
+ set_representation(Representation::Tagged());
1429
+ SetFlag(kUseGVN);
1430
+ SetFlag(kDependsOnArrayLengths);
1431
+ }
1432
+
1433
+ virtual Representation RequiredInputRepresentation(int index) const {
1434
+ return Representation::Tagged();
1435
+ }
1436
+
1437
+ DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed_array_length")
1438
+
1439
+ protected:
1440
+ virtual bool DataEquals(HValue* other) { return true; }
1441
+ };
1442
+
1443
+
1444
+ class HExternalArrayLength: public HUnaryOperation {
1445
+ public:
1446
+ explicit HExternalArrayLength(HValue* value) : HUnaryOperation(value) {
1447
+ set_representation(Representation::Integer32());
1448
+ // The result of this instruction is idempotent as long as its inputs don't
1449
+ // change. The length of a pixel array cannot change once set, so it's not
1450
+ // necessary to introduce a kDependsOnArrayLengths or any other dependency.
1451
+ SetFlag(kUseGVN);
1452
+ }
1453
+
1454
+ virtual Representation RequiredInputRepresentation(int index) const {
1455
+ return Representation::Tagged();
1456
+ }
1457
+
1458
+ DECLARE_CONCRETE_INSTRUCTION(ExternalArrayLength, "external_array_length")
1459
+
1460
+ protected:
1461
+ virtual bool DataEquals(HValue* other) { return true; }
1462
+ };
1463
+
1464
+
1465
+ class HBitNot: public HUnaryOperation {
1466
+ public:
1467
+ explicit HBitNot(HValue* value) : HUnaryOperation(value) {
1468
+ set_representation(Representation::Integer32());
1469
+ SetFlag(kUseGVN);
1470
+ SetFlag(kTruncatingToInt32);
1471
+ }
1472
+
1473
+ virtual Representation RequiredInputRepresentation(int index) const {
1474
+ return Representation::Integer32();
1475
+ }
1476
+ virtual HType CalculateInferredType();
1477
+
1478
+ DECLARE_CONCRETE_INSTRUCTION(BitNot, "bit_not")
1479
+
1480
+ protected:
1481
+ virtual bool DataEquals(HValue* other) { return true; }
1482
+ };
1483
+
1484
+
1485
+ class HUnaryMathOperation: public HUnaryOperation {
1486
+ public:
1487
+ HUnaryMathOperation(HValue* value, BuiltinFunctionId op)
1488
+ : HUnaryOperation(value), op_(op) {
1489
+ switch (op) {
1490
+ case kMathFloor:
1491
+ case kMathRound:
1492
+ case kMathCeil:
1493
+ set_representation(Representation::Integer32());
1494
+ break;
1495
+ case kMathAbs:
1496
+ set_representation(Representation::Tagged());
1497
+ SetFlag(kFlexibleRepresentation);
1498
+ break;
1499
+ case kMathSqrt:
1500
+ case kMathPowHalf:
1501
+ case kMathLog:
1502
+ case kMathSin:
1503
+ case kMathCos:
1504
+ set_representation(Representation::Double());
1505
+ break;
1506
+ default:
1507
+ UNREACHABLE();
1508
+ }
1509
+ SetFlag(kUseGVN);
1510
+ }
1511
+
1512
+ virtual void PrintDataTo(StringStream* stream);
1513
+
1514
+ virtual HType CalculateInferredType();
1515
+
1516
+ virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
1517
+
1518
+ virtual Representation RequiredInputRepresentation(int index) const {
1519
+ switch (op_) {
1520
+ case kMathFloor:
1521
+ case kMathRound:
1522
+ case kMathCeil:
1523
+ case kMathSqrt:
1524
+ case kMathPowHalf:
1525
+ case kMathLog:
1526
+ case kMathSin:
1527
+ case kMathCos:
1528
+ return Representation::Double();
1529
+ case kMathAbs:
1530
+ return representation();
1531
+ default:
1532
+ UNREACHABLE();
1533
+ return Representation::None();
1534
+ }
1535
+ }
1536
+
1537
+ virtual HValue* Canonicalize() {
1538
+ // If the input is integer32 then we replace the floor instruction
1539
+ // with its inputs. This happens before the representation changes are
1540
+ // introduced.
1541
+ if (op() == kMathFloor) {
1542
+ if (value()->representation().IsInteger32()) return value();
1543
+ }
1544
+ return this;
1545
+ }
1546
+
1547
+ BuiltinFunctionId op() const { return op_; }
1548
+ const char* OpName() const;
1549
+
1550
+ DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary_math_operation")
1551
+
1552
+ protected:
1553
+ virtual bool DataEquals(HValue* other) {
1554
+ HUnaryMathOperation* b = HUnaryMathOperation::cast(other);
1555
+ return op_ == b->op();
1556
+ }
1557
+
1558
+ private:
1559
+ BuiltinFunctionId op_;
1560
+ };
1561
+
1562
+
1563
+ class HLoadElements: public HUnaryOperation {
1564
+ public:
1565
+ explicit HLoadElements(HValue* value) : HUnaryOperation(value) {
1566
+ set_representation(Representation::Tagged());
1567
+ SetFlag(kUseGVN);
1568
+ SetFlag(kDependsOnMaps);
1569
+ }
1570
+
1571
+ virtual Representation RequiredInputRepresentation(int index) const {
1572
+ return Representation::Tagged();
1573
+ }
1574
+
1575
+ DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
1576
+
1577
+ protected:
1578
+ virtual bool DataEquals(HValue* other) { return true; }
1579
+ };
1580
+
1581
+
1582
+ class HLoadExternalArrayPointer: public HUnaryOperation {
1583
+ public:
1584
+ explicit HLoadExternalArrayPointer(HValue* value)
1585
+ : HUnaryOperation(value) {
1586
+ set_representation(Representation::External());
1587
+ // The result of this instruction is idempotent as long as its inputs don't
1588
+ // change. The external array of a specialized array elements object cannot
1589
+ // change once set, so it's no necessary to introduce any additional
1590
+ // dependencies on top of the inputs.
1591
+ SetFlag(kUseGVN);
1592
+ }
1593
+
1594
+ virtual Representation RequiredInputRepresentation(int index) const {
1595
+ return Representation::Tagged();
1596
+ }
1597
+
1598
+ DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer,
1599
+ "load-external-array-pointer")
1600
+
1601
+ protected:
1602
+ virtual bool DataEquals(HValue* other) { return true; }
1603
+ };
1604
+
1605
+
1606
+ class HCheckMap: public HUnaryOperation {
1607
+ public:
1608
+ HCheckMap(HValue* value, Handle<Map> map)
1609
+ : HUnaryOperation(value), map_(map) {
1610
+ set_representation(Representation::Tagged());
1611
+ SetFlag(kUseGVN);
1612
+ SetFlag(kDependsOnMaps);
1613
+ }
1614
+
1615
+ virtual bool IsCheckInstruction() const { return true; }
1616
+
1617
+ virtual Representation RequiredInputRepresentation(int index) const {
1618
+ return Representation::Tagged();
1619
+ }
1620
+ virtual void PrintDataTo(StringStream* stream);
1621
+ virtual HType CalculateInferredType();
1622
+
1623
+ #ifdef DEBUG
1624
+ virtual void Verify();
1625
+ #endif
1626
+
1627
+ Handle<Map> map() const { return map_; }
1628
+
1629
+ DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check_map")
1630
+
1631
+ protected:
1632
+ virtual bool DataEquals(HValue* other) {
1633
+ HCheckMap* b = HCheckMap::cast(other);
1634
+ return map_.is_identical_to(b->map());
1635
+ }
1636
+
1637
+ private:
1638
+ Handle<Map> map_;
1639
+ };
1640
+
1641
+
1642
+ class HCheckFunction: public HUnaryOperation {
1643
+ public:
1644
+ HCheckFunction(HValue* value, Handle<JSFunction> function)
1645
+ : HUnaryOperation(value), target_(function) {
1646
+ set_representation(Representation::Tagged());
1647
+ SetFlag(kUseGVN);
1648
+ }
1649
+
1650
+ virtual bool IsCheckInstruction() const { return true; }
1651
+
1652
+ virtual Representation RequiredInputRepresentation(int index) const {
1653
+ return Representation::Tagged();
1654
+ }
1655
+ virtual void PrintDataTo(StringStream* stream);
1656
+ virtual HType CalculateInferredType();
1657
+
1658
+ #ifdef DEBUG
1659
+ virtual void Verify();
1660
+ #endif
1661
+
1662
+ Handle<JSFunction> target() const { return target_; }
1663
+
1664
+ DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check_function")
1665
+
1666
+ protected:
1667
+ virtual bool DataEquals(HValue* other) {
1668
+ HCheckFunction* b = HCheckFunction::cast(other);
1669
+ return target_.is_identical_to(b->target());
1670
+ }
1671
+
1672
+ private:
1673
+ Handle<JSFunction> target_;
1674
+ };
1675
+
1676
+
1677
+ class HCheckInstanceType: public HUnaryOperation {
1678
+ public:
1679
+ // Check that the instance type is in the range [first, last] where
1680
+ // both first and last are included.
1681
+ HCheckInstanceType(HValue* value, InstanceType first, InstanceType last)
1682
+ : HUnaryOperation(value), first_(first), last_(last) {
1683
+ ASSERT(first <= last);
1684
+ set_representation(Representation::Tagged());
1685
+ SetFlag(kUseGVN);
1686
+ if ((FIRST_STRING_TYPE < first && last <= LAST_STRING_TYPE) ||
1687
+ (FIRST_STRING_TYPE <= first && last < LAST_STRING_TYPE)) {
1688
+ // A particular string instance type can change because of GC or
1689
+ // externalization, but the value still remains a string.
1690
+ SetFlag(kDependsOnMaps);
1691
+ }
1692
+ }
1693
+
1694
+ virtual bool IsCheckInstruction() const { return true; }
1695
+
1696
+ virtual Representation RequiredInputRepresentation(int index) const {
1697
+ return Representation::Tagged();
1698
+ }
1699
+
1700
+ #ifdef DEBUG
1701
+ virtual void Verify();
1702
+ #endif
1703
+
1704
+ static HCheckInstanceType* NewIsJSObjectOrJSFunction(HValue* value);
1705
+
1706
+ InstanceType first() const { return first_; }
1707
+ InstanceType last() const { return last_; }
1708
+
1709
+ DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check_instance_type")
1710
+
1711
+ protected:
1712
+ // TODO(ager): It could be nice to allow the ommision of instance
1713
+ // type checks if we have already performed an instance type check
1714
+ // with a larger range.
1715
+ virtual bool DataEquals(HValue* other) {
1716
+ HCheckInstanceType* b = HCheckInstanceType::cast(other);
1717
+ return (first_ == b->first()) && (last_ == b->last());
1718
+ }
1719
+
1720
+ private:
1721
+ InstanceType first_;
1722
+ InstanceType last_;
1723
+ };
1724
+
1725
+
1726
+ class HCheckNonSmi: public HUnaryOperation {
1727
+ public:
1728
+ explicit HCheckNonSmi(HValue* value) : HUnaryOperation(value) {
1729
+ set_representation(Representation::Tagged());
1730
+ SetFlag(kUseGVN);
1731
+ }
1732
+
1733
+ virtual bool IsCheckInstruction() const { return true; }
1734
+
1735
+ virtual Representation RequiredInputRepresentation(int index) const {
1736
+ return Representation::Tagged();
1737
+ }
1738
+
1739
+ virtual HType CalculateInferredType();
1740
+
1741
+ #ifdef DEBUG
1742
+ virtual void Verify();
1743
+ #endif
1744
+
1745
+ DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check_non_smi")
1746
+
1747
+ protected:
1748
+ virtual bool DataEquals(HValue* other) { return true; }
1749
+ };
1750
+
1751
+
1752
+ class HCheckPrototypeMaps: public HTemplateInstruction<0> {
1753
+ public:
1754
+ HCheckPrototypeMaps(Handle<JSObject> prototype, Handle<JSObject> holder)
1755
+ : prototype_(prototype), holder_(holder) {
1756
+ SetFlag(kUseGVN);
1757
+ SetFlag(kDependsOnMaps);
1758
+ }
1759
+
1760
+ virtual bool IsCheckInstruction() const { return true; }
1761
+
1762
+ #ifdef DEBUG
1763
+ virtual void Verify();
1764
+ #endif
1765
+
1766
+ Handle<JSObject> prototype() const { return prototype_; }
1767
+ Handle<JSObject> holder() const { return holder_; }
1768
+
1769
+ DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check_prototype_maps")
1770
+
1771
+ virtual Representation RequiredInputRepresentation(int index) const {
1772
+ return Representation::None();
1773
+ }
1774
+
1775
+ virtual intptr_t Hashcode() {
1776
+ ASSERT(!HEAP->IsAllocationAllowed());
1777
+ intptr_t hash = reinterpret_cast<intptr_t>(*prototype());
1778
+ hash = 17 * hash + reinterpret_cast<intptr_t>(*holder());
1779
+ return hash;
1780
+ }
1781
+
1782
+ protected:
1783
+ virtual bool DataEquals(HValue* other) {
1784
+ HCheckPrototypeMaps* b = HCheckPrototypeMaps::cast(other);
1785
+ return prototype_.is_identical_to(b->prototype()) &&
1786
+ holder_.is_identical_to(b->holder());
1787
+ }
1788
+
1789
+ private:
1790
+ Handle<JSObject> prototype_;
1791
+ Handle<JSObject> holder_;
1792
+ };
1793
+
1794
+
1795
+ class HCheckSmi: public HUnaryOperation {
1796
+ public:
1797
+ explicit HCheckSmi(HValue* value) : HUnaryOperation(value) {
1798
+ set_representation(Representation::Tagged());
1799
+ SetFlag(kUseGVN);
1800
+ }
1801
+
1802
+ virtual bool IsCheckInstruction() const { return true; }
1803
+
1804
+ virtual Representation RequiredInputRepresentation(int index) const {
1805
+ return Representation::Tagged();
1806
+ }
1807
+ virtual HType CalculateInferredType();
1808
+
1809
+ #ifdef DEBUG
1810
+ virtual void Verify();
1811
+ #endif
1812
+
1813
+ DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check_smi")
1814
+
1815
+ protected:
1816
+ virtual bool DataEquals(HValue* other) { return true; }
1817
+ };
1818
+
1819
+
1820
+ class HPhi: public HValue {
1821
+ public:
1822
+ explicit HPhi(int merged_index)
1823
+ : inputs_(2),
1824
+ merged_index_(merged_index),
1825
+ phi_id_(-1),
1826
+ is_live_(false) {
1827
+ for (int i = 0; i < Representation::kNumRepresentations; i++) {
1828
+ non_phi_uses_[i] = 0;
1829
+ indirect_uses_[i] = 0;
1830
+ }
1831
+ ASSERT(merged_index >= 0);
1832
+ set_representation(Representation::Tagged());
1833
+ SetFlag(kFlexibleRepresentation);
1834
+ }
1835
+
1836
+ virtual Representation InferredRepresentation() {
1837
+ bool double_occurred = false;
1838
+ bool int32_occurred = false;
1839
+ for (int i = 0; i < OperandCount(); ++i) {
1840
+ HValue* value = OperandAt(i);
1841
+ if (value->representation().IsDouble()) double_occurred = true;
1842
+ if (value->representation().IsInteger32()) int32_occurred = true;
1843
+ if (value->representation().IsTagged()) return Representation::Tagged();
1844
+ }
1845
+
1846
+ if (double_occurred) return Representation::Double();
1847
+ if (int32_occurred) return Representation::Integer32();
1848
+ return Representation::None();
1849
+ }
1850
+
1851
+ virtual Range* InferRange();
1852
+ virtual Representation RequiredInputRepresentation(int index) const {
1853
+ return representation();
1854
+ }
1855
+ virtual HType CalculateInferredType();
1856
+ virtual int OperandCount() { return inputs_.length(); }
1857
+ virtual HValue* OperandAt(int index) { return inputs_[index]; }
1858
+ HValue* GetRedundantReplacement();
1859
+ void AddInput(HValue* value);
1860
+ bool HasRealUses();
1861
+
1862
+ bool IsReceiver() { return merged_index_ == 0; }
1863
+
1864
+ int merged_index() const { return merged_index_; }
1865
+
1866
+ virtual const char* Mnemonic() const { return "phi"; }
1867
+
1868
+ virtual void PrintTo(StringStream* stream);
1869
+
1870
+ #ifdef DEBUG
1871
+ virtual void Verify();
1872
+ #endif
1873
+
1874
+ DECLARE_INSTRUCTION(Phi)
1875
+
1876
+ void InitRealUses(int id);
1877
+ void AddNonPhiUsesFrom(HPhi* other);
1878
+ void AddIndirectUsesTo(int* use_count);
1879
+
1880
+ int tagged_non_phi_uses() const {
1881
+ return non_phi_uses_[Representation::kTagged];
1882
+ }
1883
+ int int32_non_phi_uses() const {
1884
+ return non_phi_uses_[Representation::kInteger32];
1885
+ }
1886
+ int double_non_phi_uses() const {
1887
+ return non_phi_uses_[Representation::kDouble];
1888
+ }
1889
+ int tagged_indirect_uses() const {
1890
+ return indirect_uses_[Representation::kTagged];
1891
+ }
1892
+ int int32_indirect_uses() const {
1893
+ return indirect_uses_[Representation::kInteger32];
1894
+ }
1895
+ int double_indirect_uses() const {
1896
+ return indirect_uses_[Representation::kDouble];
1897
+ }
1898
+ int phi_id() { return phi_id_; }
1899
+ bool is_live() { return is_live_; }
1900
+ void set_is_live(bool b) { is_live_ = b; }
1901
+
1902
+ protected:
1903
+ virtual void DeleteFromGraph();
1904
+ virtual void InternalSetOperandAt(int index, HValue* value) {
1905
+ inputs_[index] = value;
1906
+ }
1907
+
1908
+ private:
1909
+ ZoneList<HValue*> inputs_;
1910
+ int merged_index_;
1911
+
1912
+ int non_phi_uses_[Representation::kNumRepresentations];
1913
+ int indirect_uses_[Representation::kNumRepresentations];
1914
+ int phi_id_;
1915
+ bool is_live_;
1916
+ };
1917
+
1918
+
1919
+ class HArgumentsObject: public HTemplateInstruction<0> {
1920
+ public:
1921
+ HArgumentsObject() {
1922
+ set_representation(Representation::Tagged());
1923
+ SetFlag(kIsArguments);
1924
+ }
1925
+
1926
+ virtual Representation RequiredInputRepresentation(int index) const {
1927
+ return Representation::None();
1928
+ }
1929
+
1930
+ DECLARE_CONCRETE_INSTRUCTION(ArgumentsObject, "arguments-object")
1931
+ };
1932
+
1933
+
1934
+ class HConstant: public HTemplateInstruction<0> {
1935
+ public:
1936
+ HConstant(Handle<Object> handle, Representation r);
1937
+
1938
+ Handle<Object> handle() const { return handle_; }
1939
+
1940
+ bool InOldSpace() const { return !HEAP->InNewSpace(*handle_); }
1941
+
1942
+ virtual Representation RequiredInputRepresentation(int index) const {
1943
+ return Representation::None();
1944
+ }
1945
+
1946
+ virtual bool EmitAtUses() { return !representation().IsDouble(); }
1947
+ virtual void PrintDataTo(StringStream* stream);
1948
+ virtual HType CalculateInferredType();
1949
+ bool IsInteger() const { return handle_->IsSmi(); }
1950
+ HConstant* CopyToRepresentation(Representation r) const;
1951
+ HConstant* CopyToTruncatedInt32() const;
1952
+ bool HasInteger32Value() const { return has_int32_value_; }
1953
+ int32_t Integer32Value() const {
1954
+ ASSERT(HasInteger32Value());
1955
+ return int32_value_;
1956
+ }
1957
+ bool HasDoubleValue() const { return has_double_value_; }
1958
+ double DoubleValue() const {
1959
+ ASSERT(HasDoubleValue());
1960
+ return double_value_;
1961
+ }
1962
+ bool HasStringValue() const { return handle_->IsString(); }
1963
+
1964
+ virtual intptr_t Hashcode() {
1965
+ ASSERT(!HEAP->allow_allocation(false));
1966
+ return reinterpret_cast<intptr_t>(*handle());
1967
+ }
1968
+
1969
+ #ifdef DEBUG
1970
+ virtual void Verify() { }
1971
+ #endif
1972
+
1973
+ DECLARE_CONCRETE_INSTRUCTION(Constant, "constant")
1974
+
1975
+ protected:
1976
+ virtual Range* InferRange();
1977
+
1978
+ virtual bool DataEquals(HValue* other) {
1979
+ HConstant* other_constant = HConstant::cast(other);
1980
+ return handle().is_identical_to(other_constant->handle());
1981
+ }
1982
+
1983
+ private:
1984
+ Handle<Object> handle_;
1985
+ HType constant_type_;
1986
+
1987
+ // The following two values represent the int32 and the double value of the
1988
+ // given constant if there is a lossless conversion between the constant
1989
+ // and the specific representation.
1990
+ bool has_int32_value_;
1991
+ int32_t int32_value_;
1992
+ bool has_double_value_;
1993
+ double double_value_;
1994
+ };
1995
+
1996
+
1997
+ class HBinaryOperation: public HTemplateInstruction<2> {
1998
+ public:
1999
+ HBinaryOperation(HValue* left, HValue* right) {
2000
+ ASSERT(left != NULL && right != NULL);
2001
+ SetOperandAt(0, left);
2002
+ SetOperandAt(1, right);
2003
+ }
2004
+
2005
+ HValue* left() { return OperandAt(0); }
2006
+ HValue* right() { return OperandAt(1); }
2007
+
2008
+ // TODO(kasperl): Move these helpers to the IA-32 Lithium
2009
+ // instruction sequence builder.
2010
+ HValue* LeastConstantOperand() {
2011
+ if (IsCommutative() && left()->IsConstant()) return right();
2012
+ return left();
2013
+ }
2014
+ HValue* MostConstantOperand() {
2015
+ if (IsCommutative() && left()->IsConstant()) return left();
2016
+ return right();
2017
+ }
2018
+
2019
+ virtual bool IsCommutative() const { return false; }
2020
+
2021
+ virtual void PrintDataTo(StringStream* stream);
2022
+
2023
+ DECLARE_INSTRUCTION(BinaryOperation)
2024
+ };
2025
+
2026
+
2027
+ class HApplyArguments: public HTemplateInstruction<4> {
2028
+ public:
2029
+ HApplyArguments(HValue* function,
2030
+ HValue* receiver,
2031
+ HValue* length,
2032
+ HValue* elements) {
2033
+ set_representation(Representation::Tagged());
2034
+ SetOperandAt(0, function);
2035
+ SetOperandAt(1, receiver);
2036
+ SetOperandAt(2, length);
2037
+ SetOperandAt(3, elements);
2038
+ SetAllSideEffects();
2039
+ }
2040
+
2041
+ virtual Representation RequiredInputRepresentation(int index) const {
2042
+ // The length is untagged, all other inputs are tagged.
2043
+ return (index == 2)
2044
+ ? Representation::Integer32()
2045
+ : Representation::Tagged();
2046
+ }
2047
+
2048
+ HValue* function() { return OperandAt(0); }
2049
+ HValue* receiver() { return OperandAt(1); }
2050
+ HValue* length() { return OperandAt(2); }
2051
+ HValue* elements() { return OperandAt(3); }
2052
+
2053
+ DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply_arguments")
2054
+ };
2055
+
2056
+
2057
+ class HArgumentsElements: public HTemplateInstruction<0> {
2058
+ public:
2059
+ HArgumentsElements() {
2060
+ // The value produced by this instruction is a pointer into the stack
2061
+ // that looks as if it was a smi because of alignment.
2062
+ set_representation(Representation::Tagged());
2063
+ SetFlag(kUseGVN);
2064
+ }
2065
+
2066
+ DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments_elements")
2067
+
2068
+ virtual Representation RequiredInputRepresentation(int index) const {
2069
+ return Representation::None();
2070
+ }
2071
+
2072
+ protected:
2073
+ virtual bool DataEquals(HValue* other) { return true; }
2074
+ };
2075
+
2076
+
2077
+ class HArgumentsLength: public HUnaryOperation {
2078
+ public:
2079
+ explicit HArgumentsLength(HValue* value) : HUnaryOperation(value) {
2080
+ set_representation(Representation::Integer32());
2081
+ SetFlag(kUseGVN);
2082
+ }
2083
+
2084
+ virtual Representation RequiredInputRepresentation(int index) const {
2085
+ return Representation::Tagged();
2086
+ }
2087
+
2088
+ DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments_length")
2089
+
2090
+ protected:
2091
+ virtual bool DataEquals(HValue* other) { return true; }
2092
+ };
2093
+
2094
+
2095
+ class HAccessArgumentsAt: public HTemplateInstruction<3> {
2096
+ public:
2097
+ HAccessArgumentsAt(HValue* arguments, HValue* length, HValue* index) {
2098
+ set_representation(Representation::Tagged());
2099
+ SetFlag(kUseGVN);
2100
+ SetOperandAt(0, arguments);
2101
+ SetOperandAt(1, length);
2102
+ SetOperandAt(2, index);
2103
+ }
2104
+
2105
+ virtual void PrintDataTo(StringStream* stream);
2106
+
2107
+ virtual Representation RequiredInputRepresentation(int index) const {
2108
+ // The arguments elements is considered tagged.
2109
+ return index == 0
2110
+ ? Representation::Tagged()
2111
+ : Representation::Integer32();
2112
+ }
2113
+
2114
+ HValue* arguments() { return OperandAt(0); }
2115
+ HValue* length() { return OperandAt(1); }
2116
+ HValue* index() { return OperandAt(2); }
2117
+
2118
+ DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access_arguments_at")
2119
+
2120
+ virtual bool DataEquals(HValue* other) { return true; }
2121
+ };
2122
+
2123
+
2124
+ class HBoundsCheck: public HBinaryOperation {
2125
+ public:
2126
+ HBoundsCheck(HValue* index, HValue* length)
2127
+ : HBinaryOperation(index, length) {
2128
+ SetFlag(kUseGVN);
2129
+ }
2130
+
2131
+ virtual bool IsCheckInstruction() const { return true; }
2132
+
2133
+ virtual Representation RequiredInputRepresentation(int index) const {
2134
+ return Representation::Integer32();
2135
+ }
2136
+
2137
+ #ifdef DEBUG
2138
+ virtual void Verify();
2139
+ #endif
2140
+
2141
+ HValue* index() { return left(); }
2142
+ HValue* length() { return right(); }
2143
+
2144
+ DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds_check")
2145
+
2146
+ protected:
2147
+ virtual bool DataEquals(HValue* other) { return true; }
2148
+ };
2149
+
2150
+
2151
+ class HBitwiseBinaryOperation: public HBinaryOperation {
2152
+ public:
2153
+ HBitwiseBinaryOperation(HValue* left, HValue* right)
2154
+ : HBinaryOperation(left, right) {
2155
+ set_representation(Representation::Tagged());
2156
+ SetFlag(kFlexibleRepresentation);
2157
+ SetAllSideEffects();
2158
+ }
2159
+
2160
+ virtual Representation RequiredInputRepresentation(int index) const {
2161
+ return representation();
2162
+ }
2163
+
2164
+ virtual void RepresentationChanged(Representation to) {
2165
+ if (!to.IsTagged()) {
2166
+ ASSERT(to.IsInteger32());
2167
+ ClearAllSideEffects();
2168
+ SetFlag(kTruncatingToInt32);
2169
+ SetFlag(kUseGVN);
2170
+ }
2171
+ }
2172
+
2173
+ virtual HType CalculateInferredType();
2174
+
2175
+ DECLARE_INSTRUCTION(BitwiseBinaryOperation)
2176
+ };
2177
+
2178
+
2179
+ class HArithmeticBinaryOperation: public HBinaryOperation {
2180
+ public:
2181
+ HArithmeticBinaryOperation(HValue* left, HValue* right)
2182
+ : HBinaryOperation(left, right) {
2183
+ set_representation(Representation::Tagged());
2184
+ SetFlag(kFlexibleRepresentation);
2185
+ SetAllSideEffects();
2186
+ }
2187
+
2188
+ virtual void RepresentationChanged(Representation to) {
2189
+ if (!to.IsTagged()) {
2190
+ ClearAllSideEffects();
2191
+ SetFlag(kUseGVN);
2192
+ }
2193
+ }
2194
+
2195
+ virtual HType CalculateInferredType();
2196
+ virtual Representation RequiredInputRepresentation(int index) const {
2197
+ return representation();
2198
+ }
2199
+ virtual Representation InferredRepresentation() {
2200
+ if (left()->representation().Equals(right()->representation())) {
2201
+ return left()->representation();
2202
+ }
2203
+ return HValue::InferredRepresentation();
2204
+ }
2205
+
2206
+ DECLARE_INSTRUCTION(ArithmeticBinaryOperation)
2207
+ };
2208
+
2209
+
2210
+ class HCompare: public HBinaryOperation {
2211
+ public:
2212
+ HCompare(HValue* left, HValue* right, Token::Value token)
2213
+ : HBinaryOperation(left, right), token_(token) {
2214
+ ASSERT(Token::IsCompareOp(token));
2215
+ set_representation(Representation::Tagged());
2216
+ SetAllSideEffects();
2217
+ }
2218
+
2219
+ void SetInputRepresentation(Representation r);
2220
+
2221
+ virtual bool EmitAtUses() {
2222
+ return !HasSideEffects() && (uses()->length() <= 1);
2223
+ }
2224
+
2225
+ virtual Representation RequiredInputRepresentation(int index) const {
2226
+ return input_representation_;
2227
+ }
2228
+ Representation GetInputRepresentation() const {
2229
+ return input_representation_;
2230
+ }
2231
+ Token::Value token() const { return token_; }
2232
+ virtual void PrintDataTo(StringStream* stream);
2233
+
2234
+ virtual HType CalculateInferredType();
2235
+
2236
+ virtual intptr_t Hashcode() {
2237
+ return HValue::Hashcode() * 7 + token_;
2238
+ }
2239
+
2240
+ DECLARE_CONCRETE_INSTRUCTION(Compare, "compare")
2241
+
2242
+ protected:
2243
+ virtual bool DataEquals(HValue* other) {
2244
+ HCompare* comp = HCompare::cast(other);
2245
+ return token_ == comp->token();
2246
+ }
2247
+
2248
+ private:
2249
+ Representation input_representation_;
2250
+ Token::Value token_;
2251
+ };
2252
+
2253
+
2254
+ class HCompareJSObjectEq: public HBinaryOperation {
2255
+ public:
2256
+ HCompareJSObjectEq(HValue* left, HValue* right)
2257
+ : HBinaryOperation(left, right) {
2258
+ set_representation(Representation::Tagged());
2259
+ SetFlag(kUseGVN);
2260
+ SetFlag(kDependsOnMaps);
2261
+ }
2262
+
2263
+ virtual bool EmitAtUses() {
2264
+ return !HasSideEffects() && (uses()->length() <= 1);
2265
+ }
2266
+
2267
+ virtual Representation RequiredInputRepresentation(int index) const {
2268
+ return Representation::Tagged();
2269
+ }
2270
+ virtual HType CalculateInferredType();
2271
+
2272
+ DECLARE_CONCRETE_INSTRUCTION(CompareJSObjectEq, "compare-js-object-eq")
2273
+
2274
+ protected:
2275
+ virtual bool DataEquals(HValue* other) { return true; }
2276
+ };
2277
+
2278
+
2279
+ class HUnaryPredicate: public HUnaryOperation {
2280
+ public:
2281
+ explicit HUnaryPredicate(HValue* value) : HUnaryOperation(value) {
2282
+ set_representation(Representation::Tagged());
2283
+ SetFlag(kUseGVN);
2284
+ }
2285
+
2286
+ virtual bool EmitAtUses() {
2287
+ return !HasSideEffects() && (uses()->length() <= 1);
2288
+ }
2289
+
2290
+ virtual Representation RequiredInputRepresentation(int index) const {
2291
+ return Representation::Tagged();
2292
+ }
2293
+ virtual HType CalculateInferredType();
2294
+ };
2295
+
2296
+
2297
+ class HIsNull: public HUnaryPredicate {
2298
+ public:
2299
+ HIsNull(HValue* value, bool is_strict)
2300
+ : HUnaryPredicate(value), is_strict_(is_strict) { }
2301
+
2302
+ bool is_strict() const { return is_strict_; }
2303
+
2304
+ DECLARE_CONCRETE_INSTRUCTION(IsNull, "is_null")
2305
+
2306
+ protected:
2307
+ virtual bool DataEquals(HValue* other) {
2308
+ HIsNull* b = HIsNull::cast(other);
2309
+ return is_strict_ == b->is_strict();
2310
+ }
2311
+
2312
+ private:
2313
+ bool is_strict_;
2314
+ };
2315
+
2316
+
2317
+ class HIsObject: public HUnaryPredicate {
2318
+ public:
2319
+ explicit HIsObject(HValue* value) : HUnaryPredicate(value) { }
2320
+
2321
+ DECLARE_CONCRETE_INSTRUCTION(IsObject, "is_object")
2322
+
2323
+ protected:
2324
+ virtual bool DataEquals(HValue* other) { return true; }
2325
+ };
2326
+
2327
+
2328
+ class HIsSmi: public HUnaryPredicate {
2329
+ public:
2330
+ explicit HIsSmi(HValue* value) : HUnaryPredicate(value) { }
2331
+
2332
+ DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is_smi")
2333
+
2334
+ protected:
2335
+ virtual bool DataEquals(HValue* other) { return true; }
2336
+ };
2337
+
2338
+
2339
+ class HIsConstructCall: public HTemplateInstruction<0> {
2340
+ public:
2341
+ HIsConstructCall() {
2342
+ set_representation(Representation::Tagged());
2343
+ SetFlag(kUseGVN);
2344
+ }
2345
+
2346
+ virtual bool EmitAtUses() {
2347
+ return !HasSideEffects() && (uses()->length() <= 1);
2348
+ }
2349
+
2350
+ virtual Representation RequiredInputRepresentation(int index) const {
2351
+ return Representation::None();
2352
+ }
2353
+
2354
+ DECLARE_CONCRETE_INSTRUCTION(IsConstructCall, "is_construct_call")
2355
+
2356
+ protected:
2357
+ virtual bool DataEquals(HValue* other) { return true; }
2358
+ };
2359
+
2360
+
2361
+ class HHasInstanceType: public HUnaryPredicate {
2362
+ public:
2363
+ HHasInstanceType(HValue* value, InstanceType type)
2364
+ : HUnaryPredicate(value), from_(type), to_(type) { }
2365
+ HHasInstanceType(HValue* value, InstanceType from, InstanceType to)
2366
+ : HUnaryPredicate(value), from_(from), to_(to) {
2367
+ ASSERT(to == LAST_TYPE); // Others not implemented yet in backend.
2368
+ }
2369
+
2370
+ InstanceType from() { return from_; }
2371
+ InstanceType to() { return to_; }
2372
+
2373
+ virtual void PrintDataTo(StringStream* stream);
2374
+
2375
+ DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has_instance_type")
2376
+
2377
+ protected:
2378
+ virtual bool DataEquals(HValue* other) {
2379
+ HHasInstanceType* b = HHasInstanceType::cast(other);
2380
+ return (from_ == b->from()) && (to_ == b->to());
2381
+ }
2382
+
2383
+ private:
2384
+ InstanceType from_;
2385
+ InstanceType to_; // Inclusive range, not all combinations work.
2386
+ };
2387
+
2388
+
2389
+ class HHasCachedArrayIndex: public HUnaryPredicate {
2390
+ public:
2391
+ explicit HHasCachedArrayIndex(HValue* value) : HUnaryPredicate(value) { }
2392
+
2393
+ DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has_cached_array_index")
2394
+
2395
+ protected:
2396
+ virtual bool DataEquals(HValue* other) { return true; }
2397
+ };
2398
+
2399
+
2400
+ class HGetCachedArrayIndex: public HUnaryPredicate {
2401
+ public:
2402
+ explicit HGetCachedArrayIndex(HValue* value) : HUnaryPredicate(value) { }
2403
+
2404
+ DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get_cached_array_index")
2405
+
2406
+ protected:
2407
+ virtual bool DataEquals(HValue* other) { return true; }
2408
+ };
2409
+
2410
+
2411
+ class HClassOfTest: public HUnaryPredicate {
2412
+ public:
2413
+ HClassOfTest(HValue* value, Handle<String> class_name)
2414
+ : HUnaryPredicate(value), class_name_(class_name) { }
2415
+
2416
+ DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class_of_test")
2417
+
2418
+ virtual void PrintDataTo(StringStream* stream);
2419
+
2420
+ Handle<String> class_name() const { return class_name_; }
2421
+
2422
+ protected:
2423
+ virtual bool DataEquals(HValue* other) {
2424
+ HClassOfTest* b = HClassOfTest::cast(other);
2425
+ return class_name_.is_identical_to(b->class_name_);
2426
+ }
2427
+
2428
+ private:
2429
+ Handle<String> class_name_;
2430
+ };
2431
+
2432
+
2433
+ class HTypeofIs: public HUnaryPredicate {
2434
+ public:
2435
+ HTypeofIs(HValue* value, Handle<String> type_literal)
2436
+ : HUnaryPredicate(value), type_literal_(type_literal) { }
2437
+
2438
+ Handle<String> type_literal() { return type_literal_; }
2439
+ virtual void PrintDataTo(StringStream* stream);
2440
+
2441
+ DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof_is")
2442
+
2443
+ protected:
2444
+ virtual bool DataEquals(HValue* other) {
2445
+ HTypeofIs* b = HTypeofIs::cast(other);
2446
+ return type_literal_.is_identical_to(b->type_literal_);
2447
+ }
2448
+
2449
+ private:
2450
+ Handle<String> type_literal_;
2451
+ };
2452
+
2453
+
2454
+ class HInstanceOf: public HTemplateInstruction<3> {
2455
+ public:
2456
+ HInstanceOf(HValue* context, HValue* left, HValue* right) {
2457
+ SetOperandAt(0, context);
2458
+ SetOperandAt(1, left);
2459
+ SetOperandAt(2, right);
2460
+ set_representation(Representation::Tagged());
2461
+ SetAllSideEffects();
2462
+ }
2463
+
2464
+ HValue* context() { return OperandAt(0); }
2465
+ HValue* left() { return OperandAt(1); }
2466
+ HValue* right() { return OperandAt(2); }
2467
+
2468
+ virtual bool EmitAtUses() {
2469
+ return !HasSideEffects() && (uses()->length() <= 1);
2470
+ }
2471
+
2472
+ virtual Representation RequiredInputRepresentation(int index) const {
2473
+ return Representation::Tagged();
2474
+ }
2475
+
2476
+ virtual void PrintDataTo(StringStream* stream);
2477
+
2478
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance_of")
2479
+ };
2480
+
2481
+
2482
+ class HInstanceOfKnownGlobal: public HUnaryOperation {
2483
+ public:
2484
+ HInstanceOfKnownGlobal(HValue* left, Handle<JSFunction> right)
2485
+ : HUnaryOperation(left), function_(right) {
2486
+ set_representation(Representation::Tagged());
2487
+ SetAllSideEffects();
2488
+ }
2489
+
2490
+ Handle<JSFunction> function() { return function_; }
2491
+
2492
+ virtual Representation RequiredInputRepresentation(int index) const {
2493
+ return Representation::Tagged();
2494
+ }
2495
+
2496
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
2497
+ "instance_of_known_global")
2498
+
2499
+ private:
2500
+ Handle<JSFunction> function_;
2501
+ };
2502
+
2503
+
2504
+ class HPower: public HBinaryOperation {
2505
+ public:
2506
+ HPower(HValue* left, HValue* right)
2507
+ : HBinaryOperation(left, right) {
2508
+ set_representation(Representation::Double());
2509
+ SetFlag(kUseGVN);
2510
+ }
2511
+
2512
+ virtual Representation RequiredInputRepresentation(int index) const {
2513
+ return (index == 1) ? Representation::None() : Representation::Double();
2514
+ }
2515
+
2516
+ DECLARE_CONCRETE_INSTRUCTION(Power, "power")
2517
+
2518
+ protected:
2519
+ virtual bool DataEquals(HValue* other) { return true; }
2520
+ };
2521
+
2522
+
2523
+ class HAdd: public HArithmeticBinaryOperation {
2524
+ public:
2525
+ HAdd(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) {
2526
+ SetFlag(kCanOverflow);
2527
+ }
2528
+
2529
+ // Add is only commutative if two integer values are added and not if two
2530
+ // tagged values are added (because it might be a String concatenation).
2531
+ virtual bool IsCommutative() const {
2532
+ return !representation().IsTagged();
2533
+ }
2534
+
2535
+ virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
2536
+
2537
+ virtual HType CalculateInferredType();
2538
+
2539
+ DECLARE_CONCRETE_INSTRUCTION(Add, "add")
2540
+
2541
+ protected:
2542
+ virtual bool DataEquals(HValue* other) { return true; }
2543
+
2544
+ virtual Range* InferRange();
2545
+ };
2546
+
2547
+
2548
+ class HSub: public HArithmeticBinaryOperation {
2549
+ public:
2550
+ HSub(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) {
2551
+ SetFlag(kCanOverflow);
2552
+ }
2553
+
2554
+ virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
2555
+
2556
+ DECLARE_CONCRETE_INSTRUCTION(Sub, "sub")
2557
+
2558
+ protected:
2559
+ virtual bool DataEquals(HValue* other) { return true; }
2560
+
2561
+ virtual Range* InferRange();
2562
+ };
2563
+
2564
+
2565
+ class HMul: public HArithmeticBinaryOperation {
2566
+ public:
2567
+ HMul(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) {
2568
+ SetFlag(kCanOverflow);
2569
+ }
2570
+
2571
+ virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
2572
+
2573
+ // Only commutative if it is certain that not two objects are multiplicated.
2574
+ virtual bool IsCommutative() const {
2575
+ return !representation().IsTagged();
2576
+ }
2577
+
2578
+ DECLARE_CONCRETE_INSTRUCTION(Mul, "mul")
2579
+
2580
+ protected:
2581
+ virtual bool DataEquals(HValue* other) { return true; }
2582
+
2583
+ virtual Range* InferRange();
2584
+ };
2585
+
2586
+
2587
+ class HMod: public HArithmeticBinaryOperation {
2588
+ public:
2589
+ HMod(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) {
2590
+ SetFlag(kCanBeDivByZero);
2591
+ }
2592
+
2593
+ bool HasPowerOf2Divisor() {
2594
+ if (right()->IsConstant() &&
2595
+ HConstant::cast(right())->HasInteger32Value()) {
2596
+ int32_t value = HConstant::cast(right())->Integer32Value();
2597
+ return value != 0 && (IsPowerOf2(value) || IsPowerOf2(-value));
2598
+ }
2599
+
2600
+ return false;
2601
+ }
2602
+
2603
+ virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
2604
+
2605
+ DECLARE_CONCRETE_INSTRUCTION(Mod, "mod")
2606
+
2607
+ protected:
2608
+ virtual bool DataEquals(HValue* other) { return true; }
2609
+
2610
+ virtual Range* InferRange();
2611
+ };
2612
+
2613
+
2614
+ class HDiv: public HArithmeticBinaryOperation {
2615
+ public:
2616
+ HDiv(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) {
2617
+ SetFlag(kCanBeDivByZero);
2618
+ SetFlag(kCanOverflow);
2619
+ }
2620
+
2621
+ virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
2622
+
2623
+ DECLARE_CONCRETE_INSTRUCTION(Div, "div")
2624
+
2625
+ protected:
2626
+ virtual bool DataEquals(HValue* other) { return true; }
2627
+
2628
+ virtual Range* InferRange();
2629
+ };
2630
+
2631
+
2632
+ class HBitAnd: public HBitwiseBinaryOperation {
2633
+ public:
2634
+ HBitAnd(HValue* left, HValue* right)
2635
+ : HBitwiseBinaryOperation(left, right) { }
2636
+
2637
+ virtual bool IsCommutative() const { return true; }
2638
+ virtual HType CalculateInferredType();
2639
+
2640
+ DECLARE_CONCRETE_INSTRUCTION(BitAnd, "bit_and")
2641
+
2642
+ protected:
2643
+ virtual bool DataEquals(HValue* other) { return true; }
2644
+
2645
+ virtual Range* InferRange();
2646
+ };
2647
+
2648
+
2649
+ class HBitXor: public HBitwiseBinaryOperation {
2650
+ public:
2651
+ HBitXor(HValue* left, HValue* right)
2652
+ : HBitwiseBinaryOperation(left, right) { }
2653
+
2654
+ virtual bool IsCommutative() const { return true; }
2655
+ virtual HType CalculateInferredType();
2656
+
2657
+ DECLARE_CONCRETE_INSTRUCTION(BitXor, "bit_xor")
2658
+
2659
+ protected:
2660
+ virtual bool DataEquals(HValue* other) { return true; }
2661
+ };
2662
+
2663
+
2664
+ class HBitOr: public HBitwiseBinaryOperation {
2665
+ public:
2666
+ HBitOr(HValue* left, HValue* right)
2667
+ : HBitwiseBinaryOperation(left, right) { }
2668
+
2669
+ virtual bool IsCommutative() const { return true; }
2670
+ virtual HType CalculateInferredType();
2671
+
2672
+ DECLARE_CONCRETE_INSTRUCTION(BitOr, "bit_or")
2673
+
2674
+ protected:
2675
+ virtual bool DataEquals(HValue* other) { return true; }
2676
+
2677
+ virtual Range* InferRange();
2678
+ };
2679
+
2680
+
2681
+ class HShl: public HBitwiseBinaryOperation {
2682
+ public:
2683
+ HShl(HValue* left, HValue* right)
2684
+ : HBitwiseBinaryOperation(left, right) { }
2685
+
2686
+ virtual Range* InferRange();
2687
+ virtual HType CalculateInferredType();
2688
+
2689
+ DECLARE_CONCRETE_INSTRUCTION(Shl, "shl")
2690
+
2691
+ protected:
2692
+ virtual bool DataEquals(HValue* other) { return true; }
2693
+ };
2694
+
2695
+
2696
+ class HShr: public HBitwiseBinaryOperation {
2697
+ public:
2698
+ HShr(HValue* left, HValue* right)
2699
+ : HBitwiseBinaryOperation(left, right) { }
2700
+
2701
+ virtual HType CalculateInferredType();
2702
+
2703
+ DECLARE_CONCRETE_INSTRUCTION(Shr, "shr")
2704
+
2705
+ protected:
2706
+ virtual bool DataEquals(HValue* other) { return true; }
2707
+ };
2708
+
2709
+
2710
+ class HSar: public HBitwiseBinaryOperation {
2711
+ public:
2712
+ HSar(HValue* left, HValue* right)
2713
+ : HBitwiseBinaryOperation(left, right) { }
2714
+
2715
+ virtual Range* InferRange();
2716
+ virtual HType CalculateInferredType();
2717
+
2718
+ DECLARE_CONCRETE_INSTRUCTION(Sar, "sar")
2719
+
2720
+ protected:
2721
+ virtual bool DataEquals(HValue* other) { return true; }
2722
+ };
2723
+
2724
+
2725
+ class HOsrEntry: public HTemplateInstruction<0> {
2726
+ public:
2727
+ explicit HOsrEntry(int ast_id) : ast_id_(ast_id) {
2728
+ SetFlag(kChangesOsrEntries);
2729
+ }
2730
+
2731
+ int ast_id() const { return ast_id_; }
2732
+
2733
+ virtual Representation RequiredInputRepresentation(int index) const {
2734
+ return Representation::None();
2735
+ }
2736
+
2737
+ DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr_entry")
2738
+
2739
+ private:
2740
+ int ast_id_;
2741
+ };
2742
+
2743
+
2744
+ class HParameter: public HTemplateInstruction<0> {
2745
+ public:
2746
+ explicit HParameter(unsigned index) : index_(index) {
2747
+ set_representation(Representation::Tagged());
2748
+ }
2749
+
2750
+ unsigned index() const { return index_; }
2751
+
2752
+ virtual void PrintDataTo(StringStream* stream);
2753
+
2754
+ virtual Representation RequiredInputRepresentation(int index) const {
2755
+ return Representation::None();
2756
+ }
2757
+
2758
+ DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
2759
+
2760
+ private:
2761
+ unsigned index_;
2762
+ };
2763
+
2764
+
2765
+ class HCallStub: public HUnaryCall {
2766
+ public:
2767
+ HCallStub(HValue* context, CodeStub::Major major_key, int argument_count)
2768
+ : HUnaryCall(context, argument_count),
2769
+ major_key_(major_key),
2770
+ transcendental_type_(TranscendentalCache::kNumberOfCaches) {
2771
+ }
2772
+
2773
+ CodeStub::Major major_key() { return major_key_; }
2774
+
2775
+ HValue* context() { return value(); }
2776
+
2777
+ void set_transcendental_type(TranscendentalCache::Type transcendental_type) {
2778
+ transcendental_type_ = transcendental_type;
2779
+ }
2780
+ TranscendentalCache::Type transcendental_type() {
2781
+ return transcendental_type_;
2782
+ }
2783
+
2784
+ virtual void PrintDataTo(StringStream* stream);
2785
+
2786
+ virtual Representation RequiredInputRepresentation(int index) const {
2787
+ return Representation::Tagged();
2788
+ }
2789
+
2790
+ DECLARE_CONCRETE_INSTRUCTION(CallStub, "call_stub")
2791
+
2792
+ private:
2793
+ CodeStub::Major major_key_;
2794
+ TranscendentalCache::Type transcendental_type_;
2795
+ };
2796
+
2797
+
2798
+ class HUnknownOSRValue: public HTemplateInstruction<0> {
2799
+ public:
2800
+ HUnknownOSRValue() { set_representation(Representation::Tagged()); }
2801
+
2802
+ virtual Representation RequiredInputRepresentation(int index) const {
2803
+ return Representation::None();
2804
+ }
2805
+
2806
+ DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown_osr_value")
2807
+ };
2808
+
2809
+
2810
+ class HLoadGlobalCell: public HTemplateInstruction<0> {
2811
+ public:
2812
+ HLoadGlobalCell(Handle<JSGlobalPropertyCell> cell, bool check_hole_value)
2813
+ : cell_(cell), check_hole_value_(check_hole_value) {
2814
+ set_representation(Representation::Tagged());
2815
+ SetFlag(kUseGVN);
2816
+ SetFlag(kDependsOnGlobalVars);
2817
+ }
2818
+
2819
+ Handle<JSGlobalPropertyCell> cell() const { return cell_; }
2820
+ bool check_hole_value() const { return check_hole_value_; }
2821
+
2822
+ virtual void PrintDataTo(StringStream* stream);
2823
+
2824
+ virtual intptr_t Hashcode() {
2825
+ ASSERT(!HEAP->allow_allocation(false));
2826
+ return reinterpret_cast<intptr_t>(*cell_);
2827
+ }
2828
+
2829
+ virtual Representation RequiredInputRepresentation(int index) const {
2830
+ return Representation::None();
2831
+ }
2832
+
2833
+ DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load_global_cell")
2834
+
2835
+ protected:
2836
+ virtual bool DataEquals(HValue* other) {
2837
+ HLoadGlobalCell* b = HLoadGlobalCell::cast(other);
2838
+ return cell_.is_identical_to(b->cell());
2839
+ }
2840
+
2841
+ private:
2842
+ Handle<JSGlobalPropertyCell> cell_;
2843
+ bool check_hole_value_;
2844
+ };
2845
+
2846
+
2847
+ class HLoadGlobalGeneric: public HBinaryOperation {
2848
+ public:
2849
+ HLoadGlobalGeneric(HValue* context,
2850
+ HValue* global_object,
2851
+ Handle<Object> name,
2852
+ bool for_typeof)
2853
+ : HBinaryOperation(context, global_object),
2854
+ name_(name),
2855
+ for_typeof_(for_typeof) {
2856
+ set_representation(Representation::Tagged());
2857
+ SetAllSideEffects();
2858
+ }
2859
+
2860
+ HValue* context() { return OperandAt(0); }
2861
+ HValue* global_object() { return OperandAt(1); }
2862
+ Handle<Object> name() const { return name_; }
2863
+ bool for_typeof() const { return for_typeof_; }
2864
+
2865
+ virtual void PrintDataTo(StringStream* stream);
2866
+
2867
+ virtual Representation RequiredInputRepresentation(int index) const {
2868
+ return Representation::Tagged();
2869
+ }
2870
+
2871
+ DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load_global_generic")
2872
+
2873
+ private:
2874
+ Handle<Object> name_;
2875
+ bool for_typeof_;
2876
+ };
2877
+
2878
+
2879
+ class HStoreGlobalCell: public HUnaryOperation {
2880
+ public:
2881
+ HStoreGlobalCell(HValue* value,
2882
+ Handle<JSGlobalPropertyCell> cell,
2883
+ bool check_hole_value)
2884
+ : HUnaryOperation(value),
2885
+ cell_(cell),
2886
+ check_hole_value_(check_hole_value) {
2887
+ SetFlag(kChangesGlobalVars);
2888
+ }
2889
+
2890
+ Handle<JSGlobalPropertyCell> cell() const { return cell_; }
2891
+ bool check_hole_value() const { return check_hole_value_; }
2892
+
2893
+ virtual Representation RequiredInputRepresentation(int index) const {
2894
+ return Representation::Tagged();
2895
+ }
2896
+ virtual void PrintDataTo(StringStream* stream);
2897
+
2898
+ DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store_global_cell")
2899
+
2900
+ private:
2901
+ Handle<JSGlobalPropertyCell> cell_;
2902
+ bool check_hole_value_;
2903
+ };
2904
+
2905
+
2906
+ class HStoreGlobalGeneric: public HTemplateInstruction<3> {
2907
+ public:
2908
+ HStoreGlobalGeneric(HValue* context,
2909
+ HValue* global_object,
2910
+ Handle<Object> name,
2911
+ HValue* value)
2912
+ : name_(name) {
2913
+ SetOperandAt(0, context);
2914
+ SetOperandAt(1, global_object);
2915
+ SetOperandAt(2, value);
2916
+ set_representation(Representation::Tagged());
2917
+ SetAllSideEffects();
2918
+ }
2919
+
2920
+ HValue* context() { return OperandAt(0); }
2921
+ HValue* global_object() { return OperandAt(1); }
2922
+ Handle<Object> name() const { return name_; }
2923
+ HValue* value() { return OperandAt(2); }
2924
+
2925
+ virtual void PrintDataTo(StringStream* stream);
2926
+
2927
+ virtual Representation RequiredInputRepresentation(int index) const {
2928
+ return Representation::Tagged();
2929
+ }
2930
+
2931
+ DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store_global_generic")
2932
+
2933
+ private:
2934
+ Handle<Object> name_;
2935
+ };
2936
+
2937
+
2938
+ class HLoadContextSlot: public HUnaryOperation {
2939
+ public:
2940
+ HLoadContextSlot(HValue* context , int slot_index)
2941
+ : HUnaryOperation(context), slot_index_(slot_index) {
2942
+ set_representation(Representation::Tagged());
2943
+ SetFlag(kUseGVN);
2944
+ SetFlag(kDependsOnContextSlots);
2945
+ }
2946
+
2947
+ int slot_index() const { return slot_index_; }
2948
+
2949
+ virtual Representation RequiredInputRepresentation(int index) const {
2950
+ return Representation::Tagged();
2951
+ }
2952
+
2953
+ virtual void PrintDataTo(StringStream* stream);
2954
+
2955
+ DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load_context_slot")
2956
+
2957
+ protected:
2958
+ virtual bool DataEquals(HValue* other) {
2959
+ HLoadContextSlot* b = HLoadContextSlot::cast(other);
2960
+ return (slot_index() == b->slot_index());
2961
+ }
2962
+
2963
+ private:
2964
+ int slot_index_;
2965
+ };
2966
+
2967
+
2968
+ static inline bool StoringValueNeedsWriteBarrier(HValue* value) {
2969
+ return !value->type().IsSmi() &&
2970
+ !(value->IsConstant() && HConstant::cast(value)->InOldSpace());
2971
+ }
2972
+
2973
+
2974
+ class HStoreContextSlot: public HBinaryOperation {
2975
+ public:
2976
+ HStoreContextSlot(HValue* context, int slot_index, HValue* value)
2977
+ : HBinaryOperation(context, value), slot_index_(slot_index) {
2978
+ SetFlag(kChangesContextSlots);
2979
+ }
2980
+
2981
+ HValue* context() { return OperandAt(0); }
2982
+ HValue* value() { return OperandAt(1); }
2983
+ int slot_index() const { return slot_index_; }
2984
+
2985
+ bool NeedsWriteBarrier() {
2986
+ return StoringValueNeedsWriteBarrier(value());
2987
+ }
2988
+
2989
+ virtual Representation RequiredInputRepresentation(int index) const {
2990
+ return Representation::Tagged();
2991
+ }
2992
+
2993
+ virtual void PrintDataTo(StringStream* stream);
2994
+
2995
+ DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store_context_slot")
2996
+
2997
+ private:
2998
+ int slot_index_;
2999
+ };
3000
+
3001
+
3002
+ class HLoadNamedField: public HUnaryOperation {
3003
+ public:
3004
+ HLoadNamedField(HValue* object, bool is_in_object, int offset)
3005
+ : HUnaryOperation(object),
3006
+ is_in_object_(is_in_object),
3007
+ offset_(offset) {
3008
+ set_representation(Representation::Tagged());
3009
+ SetFlag(kUseGVN);
3010
+ SetFlag(kDependsOnMaps);
3011
+ if (is_in_object) {
3012
+ SetFlag(kDependsOnInobjectFields);
3013
+ } else {
3014
+ SetFlag(kDependsOnBackingStoreFields);
3015
+ }
3016
+ }
3017
+
3018
+ HValue* object() { return OperandAt(0); }
3019
+ bool is_in_object() const { return is_in_object_; }
3020
+ int offset() const { return offset_; }
3021
+
3022
+ virtual Representation RequiredInputRepresentation(int index) const {
3023
+ return Representation::Tagged();
3024
+ }
3025
+ virtual void PrintDataTo(StringStream* stream);
3026
+
3027
+ DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load_named_field")
3028
+
3029
+ protected:
3030
+ virtual bool DataEquals(HValue* other) {
3031
+ HLoadNamedField* b = HLoadNamedField::cast(other);
3032
+ return is_in_object_ == b->is_in_object_ && offset_ == b->offset_;
3033
+ }
3034
+
3035
+ private:
3036
+ bool is_in_object_;
3037
+ int offset_;
3038
+ };
3039
+
3040
+
3041
+ class HLoadNamedFieldPolymorphic: public HUnaryOperation {
3042
+ public:
3043
+ HLoadNamedFieldPolymorphic(HValue* object,
3044
+ ZoneMapList* types,
3045
+ Handle<String> name);
3046
+
3047
+ HValue* object() { return OperandAt(0); }
3048
+ ZoneMapList* types() { return &types_; }
3049
+ Handle<String> name() { return name_; }
3050
+ bool need_generic() { return need_generic_; }
3051
+
3052
+ virtual Representation RequiredInputRepresentation(int index) const {
3053
+ return Representation::Tagged();
3054
+ }
3055
+
3056
+ DECLARE_CONCRETE_INSTRUCTION(LoadNamedFieldPolymorphic,
3057
+ "load_named_field_polymorphic")
3058
+
3059
+ static const int kMaxLoadPolymorphism = 4;
3060
+
3061
+ protected:
3062
+ virtual bool DataEquals(HValue* value);
3063
+
3064
+ private:
3065
+ ZoneMapList types_;
3066
+ Handle<String> name_;
3067
+ bool need_generic_;
3068
+ };
3069
+
3070
+
3071
+
3072
+ class HLoadNamedGeneric: public HBinaryOperation {
3073
+ public:
3074
+ HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name)
3075
+ : HBinaryOperation(context, object), name_(name) {
3076
+ set_representation(Representation::Tagged());
3077
+ SetAllSideEffects();
3078
+ }
3079
+
3080
+ HValue* context() { return OperandAt(0); }
3081
+ HValue* object() { return OperandAt(1); }
3082
+ Handle<Object> name() const { return name_; }
3083
+
3084
+ virtual Representation RequiredInputRepresentation(int index) const {
3085
+ return Representation::Tagged();
3086
+ }
3087
+
3088
+ DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load_named_generic")
3089
+
3090
+ private:
3091
+ Handle<Object> name_;
3092
+ };
3093
+
3094
+
3095
+ class HLoadFunctionPrototype: public HUnaryOperation {
3096
+ public:
3097
+ explicit HLoadFunctionPrototype(HValue* function)
3098
+ : HUnaryOperation(function) {
3099
+ set_representation(Representation::Tagged());
3100
+ SetFlag(kUseGVN);
3101
+ SetFlag(kDependsOnCalls);
3102
+ }
3103
+
3104
+ HValue* function() { return OperandAt(0); }
3105
+
3106
+ virtual Representation RequiredInputRepresentation(int index) const {
3107
+ return Representation::Tagged();
3108
+ }
3109
+
3110
+ DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load_function_prototype")
3111
+
3112
+ protected:
3113
+ virtual bool DataEquals(HValue* other) { return true; }
3114
+ };
3115
+
3116
+
3117
+ class HLoadKeyedFastElement: public HBinaryOperation {
3118
+ public:
3119
+ HLoadKeyedFastElement(HValue* obj, HValue* key) : HBinaryOperation(obj, key) {
3120
+ set_representation(Representation::Tagged());
3121
+ SetFlag(kDependsOnArrayElements);
3122
+ SetFlag(kUseGVN);
3123
+ }
3124
+
3125
+ HValue* object() { return OperandAt(0); }
3126
+ HValue* key() { return OperandAt(1); }
3127
+
3128
+ virtual Representation RequiredInputRepresentation(int index) const {
3129
+ // The key is supposed to be Integer32.
3130
+ return (index == 1) ? Representation::Integer32()
3131
+ : Representation::Tagged();
3132
+ }
3133
+
3134
+ virtual void PrintDataTo(StringStream* stream);
3135
+
3136
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement,
3137
+ "load_keyed_fast_element")
3138
+
3139
+ protected:
3140
+ virtual bool DataEquals(HValue* other) { return true; }
3141
+ };
3142
+
3143
+
3144
+ class HLoadKeyedSpecializedArrayElement: public HBinaryOperation {
3145
+ public:
3146
+ HLoadKeyedSpecializedArrayElement(HValue* external_elements,
3147
+ HValue* key,
3148
+ ExternalArrayType array_type)
3149
+ : HBinaryOperation(external_elements, key),
3150
+ array_type_(array_type) {
3151
+ if (array_type == kExternalFloatArray) {
3152
+ set_representation(Representation::Double());
3153
+ } else {
3154
+ set_representation(Representation::Integer32());
3155
+ }
3156
+ SetFlag(kDependsOnSpecializedArrayElements);
3157
+ // Native code could change the specialized array.
3158
+ SetFlag(kDependsOnCalls);
3159
+ SetFlag(kUseGVN);
3160
+ }
3161
+
3162
+ virtual void PrintDataTo(StringStream* stream);
3163
+
3164
+ virtual Representation RequiredInputRepresentation(int index) const {
3165
+ // The key is supposed to be Integer32, but the base pointer
3166
+ // for the element load is a naked pointer.
3167
+ return (index == 1) ? Representation::Integer32()
3168
+ : Representation::External();
3169
+ }
3170
+
3171
+ HValue* external_pointer() { return OperandAt(0); }
3172
+ HValue* key() { return OperandAt(1); }
3173
+ ExternalArrayType array_type() const { return array_type_; }
3174
+
3175
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement,
3176
+ "load_keyed_specialized_array_element")
3177
+
3178
+ protected:
3179
+ virtual bool DataEquals(HValue* other) {
3180
+ if (!other->IsLoadKeyedSpecializedArrayElement()) return false;
3181
+ HLoadKeyedSpecializedArrayElement* cast_other =
3182
+ HLoadKeyedSpecializedArrayElement::cast(other);
3183
+ return array_type_ == cast_other->array_type();
3184
+ }
3185
+
3186
+ private:
3187
+ ExternalArrayType array_type_;
3188
+ };
3189
+
3190
+
3191
+ class HLoadKeyedGeneric: public HTemplateInstruction<3> {
3192
+ public:
3193
+ HLoadKeyedGeneric(HContext* context, HValue* obj, HValue* key) {
3194
+ set_representation(Representation::Tagged());
3195
+ SetOperandAt(0, obj);
3196
+ SetOperandAt(1, key);
3197
+ SetOperandAt(2, context);
3198
+ SetAllSideEffects();
3199
+ }
3200
+
3201
+ HValue* object() { return OperandAt(0); }
3202
+ HValue* key() { return OperandAt(1); }
3203
+ HValue* context() { return OperandAt(2); }
3204
+
3205
+ virtual void PrintDataTo(StringStream* stream);
3206
+
3207
+ virtual Representation RequiredInputRepresentation(int index) const {
3208
+ return Representation::Tagged();
3209
+ }
3210
+
3211
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load_keyed_generic")
3212
+ };
3213
+
3214
+
3215
+ class HStoreNamedField: public HBinaryOperation {
3216
+ public:
3217
+ HStoreNamedField(HValue* obj,
3218
+ Handle<String> name,
3219
+ HValue* val,
3220
+ bool in_object,
3221
+ int offset)
3222
+ : HBinaryOperation(obj, val),
3223
+ name_(name),
3224
+ is_in_object_(in_object),
3225
+ offset_(offset) {
3226
+ if (is_in_object_) {
3227
+ SetFlag(kChangesInobjectFields);
3228
+ } else {
3229
+ SetFlag(kChangesBackingStoreFields);
3230
+ }
3231
+ }
3232
+
3233
+ DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store_named_field")
3234
+
3235
+ virtual Representation RequiredInputRepresentation(int index) const {
3236
+ return Representation::Tagged();
3237
+ }
3238
+ virtual void PrintDataTo(StringStream* stream);
3239
+
3240
+ HValue* object() { return OperandAt(0); }
3241
+ HValue* value() { return OperandAt(1); }
3242
+
3243
+ Handle<String> name() const { return name_; }
3244
+ bool is_in_object() const { return is_in_object_; }
3245
+ int offset() const { return offset_; }
3246
+ Handle<Map> transition() const { return transition_; }
3247
+ void set_transition(Handle<Map> map) { transition_ = map; }
3248
+
3249
+ bool NeedsWriteBarrier() {
3250
+ return StoringValueNeedsWriteBarrier(value());
3251
+ }
3252
+
3253
+ private:
3254
+ Handle<String> name_;
3255
+ bool is_in_object_;
3256
+ int offset_;
3257
+ Handle<Map> transition_;
3258
+ };
3259
+
3260
+
3261
+ class HStoreNamedGeneric: public HTemplateInstruction<3> {
3262
+ public:
3263
+ HStoreNamedGeneric(HValue* context,
3264
+ HValue* object,
3265
+ Handle<String> name,
3266
+ HValue* value)
3267
+ : name_(name) {
3268
+ SetOperandAt(0, object);
3269
+ SetOperandAt(1, value);
3270
+ SetOperandAt(2, context);
3271
+ SetAllSideEffects();
3272
+ }
3273
+
3274
+ HValue* object() { return OperandAt(0); }
3275
+ HValue* value() { return OperandAt(1); }
3276
+ HValue* context() { return OperandAt(2); }
3277
+ Handle<String> name() { return name_; }
3278
+
3279
+ virtual void PrintDataTo(StringStream* stream);
3280
+
3281
+ virtual Representation RequiredInputRepresentation(int index) const {
3282
+ return Representation::Tagged();
3283
+ }
3284
+
3285
+ DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store_named_generic")
3286
+
3287
+ private:
3288
+ Handle<String> name_;
3289
+ };
3290
+
3291
+
3292
+ class HStoreKeyedFastElement: public HTemplateInstruction<3> {
3293
+ public:
3294
+ HStoreKeyedFastElement(HValue* obj, HValue* key, HValue* val) {
3295
+ SetOperandAt(0, obj);
3296
+ SetOperandAt(1, key);
3297
+ SetOperandAt(2, val);
3298
+ SetFlag(kChangesArrayElements);
3299
+ }
3300
+
3301
+ virtual Representation RequiredInputRepresentation(int index) const {
3302
+ // The key is supposed to be Integer32.
3303
+ return (index == 1) ? Representation::Integer32()
3304
+ : Representation::Tagged();
3305
+ }
3306
+
3307
+ HValue* object() { return OperandAt(0); }
3308
+ HValue* key() { return OperandAt(1); }
3309
+ HValue* value() { return OperandAt(2); }
3310
+
3311
+ bool NeedsWriteBarrier() {
3312
+ return StoringValueNeedsWriteBarrier(value());
3313
+ }
3314
+
3315
+ virtual void PrintDataTo(StringStream* stream);
3316
+
3317
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
3318
+ "store_keyed_fast_element")
3319
+ };
3320
+
3321
+
3322
+ class HStoreKeyedSpecializedArrayElement: public HTemplateInstruction<3> {
3323
+ public:
3324
+ HStoreKeyedSpecializedArrayElement(HValue* external_elements,
3325
+ HValue* key,
3326
+ HValue* val,
3327
+ ExternalArrayType array_type)
3328
+ : array_type_(array_type) {
3329
+ SetFlag(kChangesSpecializedArrayElements);
3330
+ SetOperandAt(0, external_elements);
3331
+ SetOperandAt(1, key);
3332
+ SetOperandAt(2, val);
3333
+ }
3334
+
3335
+ virtual void PrintDataTo(StringStream* stream);
3336
+
3337
+ virtual Representation RequiredInputRepresentation(int index) const {
3338
+ if (index == 0) {
3339
+ return Representation::External();
3340
+ } else {
3341
+ if (index == 2 && array_type() == kExternalFloatArray) {
3342
+ return Representation::Double();
3343
+ } else {
3344
+ return Representation::Integer32();
3345
+ }
3346
+ }
3347
+ }
3348
+
3349
+ HValue* external_pointer() { return OperandAt(0); }
3350
+ HValue* key() { return OperandAt(1); }
3351
+ HValue* value() { return OperandAt(2); }
3352
+ ExternalArrayType array_type() const { return array_type_; }
3353
+
3354
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement,
3355
+ "store_keyed_specialized_array_element")
3356
+ private:
3357
+ ExternalArrayType array_type_;
3358
+ };
3359
+
3360
+
3361
+ class HStoreKeyedGeneric: public HTemplateInstruction<4> {
3362
+ public:
3363
+ HStoreKeyedGeneric(HValue* context,
3364
+ HValue* object,
3365
+ HValue* key,
3366
+ HValue* value) {
3367
+ SetOperandAt(0, object);
3368
+ SetOperandAt(1, key);
3369
+ SetOperandAt(2, value);
3370
+ SetOperandAt(3, context);
3371
+ SetAllSideEffects();
3372
+ }
3373
+
3374
+ HValue* object() { return OperandAt(0); }
3375
+ HValue* key() { return OperandAt(1); }
3376
+ HValue* value() { return OperandAt(2); }
3377
+ HValue* context() { return OperandAt(3); }
3378
+
3379
+ virtual Representation RequiredInputRepresentation(int index) const {
3380
+ return Representation::Tagged();
3381
+ }
3382
+
3383
+ virtual void PrintDataTo(StringStream* stream);
3384
+
3385
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store_keyed_generic")
3386
+ };
3387
+
3388
+
3389
+ class HStringCharCodeAt: public HBinaryOperation {
3390
+ public:
3391
+ HStringCharCodeAt(HValue* string, HValue* index)
3392
+ : HBinaryOperation(string, index) {
3393
+ set_representation(Representation::Integer32());
3394
+ SetFlag(kUseGVN);
3395
+ SetFlag(kDependsOnMaps);
3396
+ }
3397
+
3398
+ virtual Representation RequiredInputRepresentation(int index) const {
3399
+ // The index is supposed to be Integer32.
3400
+ return (index == 1) ? Representation::Integer32()
3401
+ : Representation::Tagged();
3402
+ }
3403
+
3404
+ HValue* string() { return OperandAt(0); }
3405
+ HValue* index() { return OperandAt(1); }
3406
+
3407
+ DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string_char_code_at")
3408
+
3409
+ protected:
3410
+ virtual bool DataEquals(HValue* other) { return true; }
3411
+
3412
+ virtual Range* InferRange() {
3413
+ return new Range(0, String::kMaxUC16CharCode);
3414
+ }
3415
+ };
3416
+
3417
+
3418
+ class HStringCharFromCode: public HUnaryOperation {
3419
+ public:
3420
+ explicit HStringCharFromCode(HValue* char_code) : HUnaryOperation(char_code) {
3421
+ set_representation(Representation::Tagged());
3422
+ SetFlag(kUseGVN);
3423
+ }
3424
+
3425
+ virtual Representation RequiredInputRepresentation(int index) const {
3426
+ return Representation::Integer32();
3427
+ }
3428
+
3429
+ virtual bool DataEquals(HValue* other) { return true; }
3430
+
3431
+ DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string_char_from_code")
3432
+ };
3433
+
3434
+
3435
+ class HStringLength: public HUnaryOperation {
3436
+ public:
3437
+ explicit HStringLength(HValue* string) : HUnaryOperation(string) {
3438
+ set_representation(Representation::Tagged());
3439
+ SetFlag(kUseGVN);
3440
+ SetFlag(kDependsOnMaps);
3441
+ }
3442
+
3443
+ virtual Representation RequiredInputRepresentation(int index) const {
3444
+ return Representation::Tagged();
3445
+ }
3446
+
3447
+ virtual HType CalculateInferredType() {
3448
+ STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue);
3449
+ return HType::Smi();
3450
+ }
3451
+
3452
+ DECLARE_CONCRETE_INSTRUCTION(StringLength, "string_length")
3453
+
3454
+ protected:
3455
+ virtual bool DataEquals(HValue* other) { return true; }
3456
+
3457
+ virtual Range* InferRange() {
3458
+ return new Range(0, String::kMaxLength);
3459
+ }
3460
+ };
3461
+
3462
+
3463
+ template <int V>
3464
+ class HMaterializedLiteral: public HTemplateInstruction<V> {
3465
+ public:
3466
+ HMaterializedLiteral<V>(int index, int depth)
3467
+ : literal_index_(index), depth_(depth) {
3468
+ this->set_representation(Representation::Tagged());
3469
+ }
3470
+
3471
+ int literal_index() const { return literal_index_; }
3472
+ int depth() const { return depth_; }
3473
+
3474
+ private:
3475
+ int literal_index_;
3476
+ int depth_;
3477
+ };
3478
+
3479
+
3480
+ class HArrayLiteral: public HMaterializedLiteral<0> {
3481
+ public:
3482
+ HArrayLiteral(Handle<FixedArray> constant_elements,
3483
+ int length,
3484
+ int literal_index,
3485
+ int depth)
3486
+ : HMaterializedLiteral<0>(literal_index, depth),
3487
+ length_(length),
3488
+ constant_elements_(constant_elements) {}
3489
+
3490
+ Handle<FixedArray> constant_elements() const { return constant_elements_; }
3491
+ int length() const { return length_; }
3492
+
3493
+ bool IsCopyOnWrite() const;
3494
+
3495
+ virtual Representation RequiredInputRepresentation(int index) const {
3496
+ return Representation::None();
3497
+ }
3498
+
3499
+ DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array_literal")
3500
+
3501
+ private:
3502
+ int length_;
3503
+ Handle<FixedArray> constant_elements_;
3504
+ };
3505
+
3506
+
3507
+ class HObjectLiteral: public HMaterializedLiteral<1> {
3508
+ public:
3509
+ HObjectLiteral(HValue* context,
3510
+ Handle<FixedArray> constant_properties,
3511
+ bool fast_elements,
3512
+ int literal_index,
3513
+ int depth,
3514
+ bool has_function)
3515
+ : HMaterializedLiteral<1>(literal_index, depth),
3516
+ constant_properties_(constant_properties),
3517
+ fast_elements_(fast_elements),
3518
+ has_function_(has_function) {
3519
+ SetOperandAt(0, context);
3520
+ }
3521
+
3522
+ HValue* context() { return OperandAt(0); }
3523
+ Handle<FixedArray> constant_properties() const {
3524
+ return constant_properties_;
3525
+ }
3526
+ bool fast_elements() const { return fast_elements_; }
3527
+ bool has_function() const { return has_function_; }
3528
+
3529
+ virtual Representation RequiredInputRepresentation(int index) const {
3530
+ return Representation::Tagged();
3531
+ }
3532
+
3533
+ DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object_literal")
3534
+
3535
+ private:
3536
+ Handle<FixedArray> constant_properties_;
3537
+ bool fast_elements_;
3538
+ bool has_function_;
3539
+ };
3540
+
3541
+
3542
+ class HRegExpLiteral: public HMaterializedLiteral<0> {
3543
+ public:
3544
+ HRegExpLiteral(Handle<String> pattern,
3545
+ Handle<String> flags,
3546
+ int literal_index)
3547
+ : HMaterializedLiteral<0>(literal_index, 0),
3548
+ pattern_(pattern),
3549
+ flags_(flags) { }
3550
+
3551
+ Handle<String> pattern() { return pattern_; }
3552
+ Handle<String> flags() { return flags_; }
3553
+
3554
+ virtual Representation RequiredInputRepresentation(int index) const {
3555
+ return Representation::None();
3556
+ }
3557
+
3558
+ DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp_literal")
3559
+
3560
+ private:
3561
+ Handle<String> pattern_;
3562
+ Handle<String> flags_;
3563
+ };
3564
+
3565
+
3566
+ class HFunctionLiteral: public HTemplateInstruction<0> {
3567
+ public:
3568
+ HFunctionLiteral(Handle<SharedFunctionInfo> shared, bool pretenure)
3569
+ : shared_info_(shared), pretenure_(pretenure) {
3570
+ set_representation(Representation::Tagged());
3571
+ }
3572
+
3573
+ virtual Representation RequiredInputRepresentation(int index) const {
3574
+ return Representation::None();
3575
+ }
3576
+
3577
+ DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function_literal")
3578
+
3579
+ Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
3580
+ bool pretenure() const { return pretenure_; }
3581
+
3582
+ private:
3583
+ Handle<SharedFunctionInfo> shared_info_;
3584
+ bool pretenure_;
3585
+ };
3586
+
3587
+
3588
+ class HTypeof: public HUnaryOperation {
3589
+ public:
3590
+ explicit HTypeof(HValue* value) : HUnaryOperation(value) {
3591
+ set_representation(Representation::Tagged());
3592
+ }
3593
+
3594
+ virtual Representation RequiredInputRepresentation(int index) const {
3595
+ return Representation::Tagged();
3596
+ }
3597
+
3598
+ DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
3599
+ };
3600
+
3601
+
3602
+ class HToFastProperties: public HUnaryOperation {
3603
+ public:
3604
+ explicit HToFastProperties(HValue* value) : HUnaryOperation(value) {
3605
+ // This instruction is not marked as having side effects, but
3606
+ // changes the map of the input operand. Use it only when creating
3607
+ // object literals.
3608
+ ASSERT(value->IsObjectLiteral());
3609
+ set_representation(Representation::Tagged());
3610
+ }
3611
+
3612
+ virtual Representation RequiredInputRepresentation(int index) const {
3613
+ return Representation::Tagged();
3614
+ }
3615
+
3616
+ DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to_fast_properties")
3617
+ };
3618
+
3619
+
3620
+ class HValueOf: public HUnaryOperation {
3621
+ public:
3622
+ explicit HValueOf(HValue* value) : HUnaryOperation(value) {
3623
+ set_representation(Representation::Tagged());
3624
+ }
3625
+
3626
+ virtual Representation RequiredInputRepresentation(int index) const {
3627
+ return Representation::Tagged();
3628
+ }
3629
+
3630
+ DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value_of")
3631
+ };
3632
+
3633
+
3634
+ class HDeleteProperty: public HBinaryOperation {
3635
+ public:
3636
+ HDeleteProperty(HValue* obj, HValue* key)
3637
+ : HBinaryOperation(obj, key) {
3638
+ set_representation(Representation::Tagged());
3639
+ SetAllSideEffects();
3640
+ }
3641
+
3642
+ virtual Representation RequiredInputRepresentation(int index) const {
3643
+ return Representation::Tagged();
3644
+ }
3645
+
3646
+ DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete_property")
3647
+
3648
+ HValue* object() { return left(); }
3649
+ HValue* key() { return right(); }
3650
+ };
3651
+
3652
+ #undef DECLARE_INSTRUCTION
3653
+ #undef DECLARE_CONCRETE_INSTRUCTION
3654
+
3655
+ } } // namespace v8::internal
3656
+
3657
+ #endif // V8_HYDROGEN_INSTRUCTIONS_H_