therubyracer 0.4.9-x86-linux

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

Potentially problematic release.


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

Files changed (637) hide show
  1. data/.gitignore +11 -0
  2. data/.gitmodules +3 -0
  3. data/Doxyfile +1514 -0
  4. data/History.txt +43 -0
  5. data/README.rdoc +157 -0
  6. data/Rakefile +51 -0
  7. data/docs/data_conversion.txt +18 -0
  8. data/ext/v8/callbacks.cpp +160 -0
  9. data/ext/v8/callbacks.h +14 -0
  10. data/ext/v8/convert_ruby.cpp +8 -0
  11. data/ext/v8/convert_ruby.h +99 -0
  12. data/ext/v8/convert_string.cpp +10 -0
  13. data/ext/v8/convert_string.h +73 -0
  14. data/ext/v8/convert_v8.cpp +9 -0
  15. data/ext/v8/convert_v8.h +121 -0
  16. data/ext/v8/converters.cpp +83 -0
  17. data/ext/v8/converters.h +23 -0
  18. data/ext/v8/extconf.rb +36 -0
  19. data/ext/v8/upstream/2.0.6/.gitignore +26 -0
  20. data/ext/v8/upstream/2.0.6/AUTHORS +23 -0
  21. data/ext/v8/upstream/2.0.6/ChangeLog +1479 -0
  22. data/ext/v8/upstream/2.0.6/LICENSE +55 -0
  23. data/ext/v8/upstream/2.0.6/SConstruct +1028 -0
  24. data/ext/v8/upstream/2.0.6/include/v8-debug.h +275 -0
  25. data/ext/v8/upstream/2.0.6/include/v8.h +3236 -0
  26. data/ext/v8/upstream/2.0.6/src/SConscript +283 -0
  27. data/ext/v8/upstream/2.0.6/src/accessors.cc +695 -0
  28. data/ext/v8/upstream/2.0.6/src/accessors.h +114 -0
  29. data/ext/v8/upstream/2.0.6/src/allocation.cc +198 -0
  30. data/ext/v8/upstream/2.0.6/src/allocation.h +169 -0
  31. data/ext/v8/upstream/2.0.6/src/api.cc +3831 -0
  32. data/ext/v8/upstream/2.0.6/src/api.h +479 -0
  33. data/ext/v8/upstream/2.0.6/src/apinatives.js +110 -0
  34. data/ext/v8/upstream/2.0.6/src/apiutils.h +69 -0
  35. data/ext/v8/upstream/2.0.6/src/arguments.h +97 -0
  36. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm-inl.h +277 -0
  37. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.cc +1821 -0
  38. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.h +1027 -0
  39. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2-inl.h +267 -0
  40. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.cc +1821 -0
  41. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.h +1027 -0
  42. data/ext/v8/upstream/2.0.6/src/arm/builtins-arm.cc +1271 -0
  43. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm-inl.h +74 -0
  44. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.cc +6682 -0
  45. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.h +535 -0
  46. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.cc +112 -0
  47. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.h +347 -0
  48. data/ext/v8/upstream/2.0.6/src/arm/cpu-arm.cc +132 -0
  49. data/ext/v8/upstream/2.0.6/src/arm/debug-arm.cc +213 -0
  50. data/ext/v8/upstream/2.0.6/src/arm/disasm-arm.cc +1166 -0
  51. data/ext/v8/upstream/2.0.6/src/arm/fast-codegen-arm.cc +1698 -0
  52. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.cc +123 -0
  53. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.h +162 -0
  54. data/ext/v8/upstream/2.0.6/src/arm/ic-arm.cc +849 -0
  55. data/ext/v8/upstream/2.0.6/src/arm/jump-target-arm.cc +238 -0
  56. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.cc +1259 -0
  57. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.h +423 -0
  58. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.cc +1266 -0
  59. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.h +282 -0
  60. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm-inl.h +103 -0
  61. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.cc +59 -0
  62. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.h +43 -0
  63. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.cc +2264 -0
  64. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.h +306 -0
  65. data/ext/v8/upstream/2.0.6/src/arm/stub-cache-arm.cc +1516 -0
  66. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.cc +412 -0
  67. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.h +532 -0
  68. data/ext/v8/upstream/2.0.6/src/array.js +1154 -0
  69. data/ext/v8/upstream/2.0.6/src/assembler.cc +772 -0
  70. data/ext/v8/upstream/2.0.6/src/assembler.h +525 -0
  71. data/ext/v8/upstream/2.0.6/src/ast.cc +512 -0
  72. data/ext/v8/upstream/2.0.6/src/ast.h +1820 -0
  73. data/ext/v8/upstream/2.0.6/src/bootstrapper.cc +1680 -0
  74. data/ext/v8/upstream/2.0.6/src/bootstrapper.h +103 -0
  75. data/ext/v8/upstream/2.0.6/src/builtins.cc +851 -0
  76. data/ext/v8/upstream/2.0.6/src/builtins.h +245 -0
  77. data/ext/v8/upstream/2.0.6/src/bytecodes-irregexp.h +104 -0
  78. data/ext/v8/upstream/2.0.6/src/char-predicates-inl.h +86 -0
  79. data/ext/v8/upstream/2.0.6/src/char-predicates.h +65 -0
  80. data/ext/v8/upstream/2.0.6/src/checks.cc +100 -0
  81. data/ext/v8/upstream/2.0.6/src/checks.h +284 -0
  82. data/ext/v8/upstream/2.0.6/src/code-stubs.cc +164 -0
  83. data/ext/v8/upstream/2.0.6/src/code-stubs.h +164 -0
  84. data/ext/v8/upstream/2.0.6/src/code.h +68 -0
  85. data/ext/v8/upstream/2.0.6/src/codegen-inl.h +88 -0
  86. data/ext/v8/upstream/2.0.6/src/codegen.cc +504 -0
  87. data/ext/v8/upstream/2.0.6/src/codegen.h +522 -0
  88. data/ext/v8/upstream/2.0.6/src/compilation-cache.cc +490 -0
  89. data/ext/v8/upstream/2.0.6/src/compilation-cache.h +98 -0
  90. data/ext/v8/upstream/2.0.6/src/compiler.cc +1132 -0
  91. data/ext/v8/upstream/2.0.6/src/compiler.h +107 -0
  92. data/ext/v8/upstream/2.0.6/src/contexts.cc +256 -0
  93. data/ext/v8/upstream/2.0.6/src/contexts.h +345 -0
  94. data/ext/v8/upstream/2.0.6/src/conversions-inl.h +95 -0
  95. data/ext/v8/upstream/2.0.6/src/conversions.cc +709 -0
  96. data/ext/v8/upstream/2.0.6/src/conversions.h +118 -0
  97. data/ext/v8/upstream/2.0.6/src/counters.cc +78 -0
  98. data/ext/v8/upstream/2.0.6/src/counters.h +239 -0
  99. data/ext/v8/upstream/2.0.6/src/cpu.h +65 -0
  100. data/ext/v8/upstream/2.0.6/src/d8-debug.cc +345 -0
  101. data/ext/v8/upstream/2.0.6/src/d8-debug.h +155 -0
  102. data/ext/v8/upstream/2.0.6/src/d8-posix.cc +675 -0
  103. data/ext/v8/upstream/2.0.6/src/d8-readline.cc +128 -0
  104. data/ext/v8/upstream/2.0.6/src/d8-windows.cc +42 -0
  105. data/ext/v8/upstream/2.0.6/src/d8.cc +776 -0
  106. data/ext/v8/upstream/2.0.6/src/d8.h +225 -0
  107. data/ext/v8/upstream/2.0.6/src/d8.js +1625 -0
  108. data/ext/v8/upstream/2.0.6/src/date-delay.js +1138 -0
  109. data/ext/v8/upstream/2.0.6/src/dateparser-inl.h +114 -0
  110. data/ext/v8/upstream/2.0.6/src/dateparser.cc +186 -0
  111. data/ext/v8/upstream/2.0.6/src/dateparser.h +240 -0
  112. data/ext/v8/upstream/2.0.6/src/debug-agent.cc +425 -0
  113. data/ext/v8/upstream/2.0.6/src/debug-agent.h +129 -0
  114. data/ext/v8/upstream/2.0.6/src/debug-delay.js +2073 -0
  115. data/ext/v8/upstream/2.0.6/src/debug.cc +2751 -0
  116. data/ext/v8/upstream/2.0.6/src/debug.h +866 -0
  117. data/ext/v8/upstream/2.0.6/src/disasm.h +77 -0
  118. data/ext/v8/upstream/2.0.6/src/disassembler.cc +318 -0
  119. data/ext/v8/upstream/2.0.6/src/disassembler.h +56 -0
  120. data/ext/v8/upstream/2.0.6/src/dtoa-config.c +91 -0
  121. data/ext/v8/upstream/2.0.6/src/execution.cc +701 -0
  122. data/ext/v8/upstream/2.0.6/src/execution.h +312 -0
  123. data/ext/v8/upstream/2.0.6/src/factory.cc +957 -0
  124. data/ext/v8/upstream/2.0.6/src/factory.h +393 -0
  125. data/ext/v8/upstream/2.0.6/src/fast-codegen.cc +725 -0
  126. data/ext/v8/upstream/2.0.6/src/fast-codegen.h +371 -0
  127. data/ext/v8/upstream/2.0.6/src/flag-definitions.h +426 -0
  128. data/ext/v8/upstream/2.0.6/src/flags.cc +555 -0
  129. data/ext/v8/upstream/2.0.6/src/flags.h +81 -0
  130. data/ext/v8/upstream/2.0.6/src/frame-element.cc +45 -0
  131. data/ext/v8/upstream/2.0.6/src/frame-element.h +235 -0
  132. data/ext/v8/upstream/2.0.6/src/frames-inl.h +215 -0
  133. data/ext/v8/upstream/2.0.6/src/frames.cc +749 -0
  134. data/ext/v8/upstream/2.0.6/src/frames.h +659 -0
  135. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.cc +76 -0
  136. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.h +135 -0
  137. data/ext/v8/upstream/2.0.6/src/global-handles.cc +516 -0
  138. data/ext/v8/upstream/2.0.6/src/global-handles.h +180 -0
  139. data/ext/v8/upstream/2.0.6/src/globals.h +608 -0
  140. data/ext/v8/upstream/2.0.6/src/handles-inl.h +76 -0
  141. data/ext/v8/upstream/2.0.6/src/handles.cc +811 -0
  142. data/ext/v8/upstream/2.0.6/src/handles.h +367 -0
  143. data/ext/v8/upstream/2.0.6/src/hashmap.cc +226 -0
  144. data/ext/v8/upstream/2.0.6/src/hashmap.h +120 -0
  145. data/ext/v8/upstream/2.0.6/src/heap-inl.h +407 -0
  146. data/ext/v8/upstream/2.0.6/src/heap-profiler.cc +695 -0
  147. data/ext/v8/upstream/2.0.6/src/heap-profiler.h +277 -0
  148. data/ext/v8/upstream/2.0.6/src/heap.cc +4204 -0
  149. data/ext/v8/upstream/2.0.6/src/heap.h +1704 -0
  150. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32-inl.h +325 -0
  151. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.cc +2375 -0
  152. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.h +914 -0
  153. data/ext/v8/upstream/2.0.6/src/ia32/builtins-ia32.cc +1222 -0
  154. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32-inl.h +46 -0
  155. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.cc +9770 -0
  156. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.h +834 -0
  157. data/ext/v8/upstream/2.0.6/src/ia32/cpu-ia32.cc +79 -0
  158. data/ext/v8/upstream/2.0.6/src/ia32/debug-ia32.cc +208 -0
  159. data/ext/v8/upstream/2.0.6/src/ia32/disasm-ia32.cc +1357 -0
  160. data/ext/v8/upstream/2.0.6/src/ia32/fast-codegen-ia32.cc +1813 -0
  161. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.cc +111 -0
  162. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.h +135 -0
  163. data/ext/v8/upstream/2.0.6/src/ia32/ic-ia32.cc +1490 -0
  164. data/ext/v8/upstream/2.0.6/src/ia32/jump-target-ia32.cc +432 -0
  165. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.cc +1517 -0
  166. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.h +528 -0
  167. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.cc +1219 -0
  168. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.h +230 -0
  169. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32-inl.h +82 -0
  170. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.cc +99 -0
  171. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.h +43 -0
  172. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.cc +30 -0
  173. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.h +62 -0
  174. data/ext/v8/upstream/2.0.6/src/ia32/stub-cache-ia32.cc +1961 -0
  175. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.cc +1105 -0
  176. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.h +580 -0
  177. data/ext/v8/upstream/2.0.6/src/ic-inl.h +93 -0
  178. data/ext/v8/upstream/2.0.6/src/ic.cc +1426 -0
  179. data/ext/v8/upstream/2.0.6/src/ic.h +443 -0
  180. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.cc +646 -0
  181. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.h +48 -0
  182. data/ext/v8/upstream/2.0.6/src/json-delay.js +254 -0
  183. data/ext/v8/upstream/2.0.6/src/jsregexp.cc +5234 -0
  184. data/ext/v8/upstream/2.0.6/src/jsregexp.h +1439 -0
  185. data/ext/v8/upstream/2.0.6/src/jump-target-inl.h +49 -0
  186. data/ext/v8/upstream/2.0.6/src/jump-target.cc +383 -0
  187. data/ext/v8/upstream/2.0.6/src/jump-target.h +280 -0
  188. data/ext/v8/upstream/2.0.6/src/list-inl.h +166 -0
  189. data/ext/v8/upstream/2.0.6/src/list.h +158 -0
  190. data/ext/v8/upstream/2.0.6/src/log-inl.h +126 -0
  191. data/ext/v8/upstream/2.0.6/src/log-utils.cc +503 -0
  192. data/ext/v8/upstream/2.0.6/src/log-utils.h +292 -0
  193. data/ext/v8/upstream/2.0.6/src/log.cc +1457 -0
  194. data/ext/v8/upstream/2.0.6/src/log.h +371 -0
  195. data/ext/v8/upstream/2.0.6/src/macro-assembler.h +93 -0
  196. data/ext/v8/upstream/2.0.6/src/macros.py +137 -0
  197. data/ext/v8/upstream/2.0.6/src/mark-compact.cc +2007 -0
  198. data/ext/v8/upstream/2.0.6/src/mark-compact.h +442 -0
  199. data/ext/v8/upstream/2.0.6/src/math.js +263 -0
  200. data/ext/v8/upstream/2.0.6/src/memory.h +74 -0
  201. data/ext/v8/upstream/2.0.6/src/messages.cc +177 -0
  202. data/ext/v8/upstream/2.0.6/src/messages.h +112 -0
  203. data/ext/v8/upstream/2.0.6/src/messages.js +937 -0
  204. data/ext/v8/upstream/2.0.6/src/mirror-delay.js +2332 -0
  205. data/ext/v8/upstream/2.0.6/src/mksnapshot.cc +169 -0
  206. data/ext/v8/upstream/2.0.6/src/natives.h +63 -0
  207. data/ext/v8/upstream/2.0.6/src/objects-debug.cc +1317 -0
  208. data/ext/v8/upstream/2.0.6/src/objects-inl.h +3044 -0
  209. data/ext/v8/upstream/2.0.6/src/objects.cc +8306 -0
  210. data/ext/v8/upstream/2.0.6/src/objects.h +4960 -0
  211. data/ext/v8/upstream/2.0.6/src/oprofile-agent.cc +116 -0
  212. data/ext/v8/upstream/2.0.6/src/oprofile-agent.h +69 -0
  213. data/ext/v8/upstream/2.0.6/src/parser.cc +4810 -0
  214. data/ext/v8/upstream/2.0.6/src/parser.h +195 -0
  215. data/ext/v8/upstream/2.0.6/src/platform-freebsd.cc +645 -0
  216. data/ext/v8/upstream/2.0.6/src/platform-linux.cc +808 -0
  217. data/ext/v8/upstream/2.0.6/src/platform-macos.cc +643 -0
  218. data/ext/v8/upstream/2.0.6/src/platform-nullos.cc +454 -0
  219. data/ext/v8/upstream/2.0.6/src/platform-openbsd.cc +597 -0
  220. data/ext/v8/upstream/2.0.6/src/platform-posix.cc +380 -0
  221. data/ext/v8/upstream/2.0.6/src/platform-win32.cc +1908 -0
  222. data/ext/v8/upstream/2.0.6/src/platform.h +556 -0
  223. data/ext/v8/upstream/2.0.6/src/prettyprinter.cc +1511 -0
  224. data/ext/v8/upstream/2.0.6/src/prettyprinter.h +219 -0
  225. data/ext/v8/upstream/2.0.6/src/property.cc +96 -0
  226. data/ext/v8/upstream/2.0.6/src/property.h +327 -0
  227. data/ext/v8/upstream/2.0.6/src/regexp-delay.js +406 -0
  228. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp-inl.h +78 -0
  229. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.cc +464 -0
  230. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.h +141 -0
  231. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.cc +356 -0
  232. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.h +103 -0
  233. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.cc +240 -0
  234. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.h +220 -0
  235. data/ext/v8/upstream/2.0.6/src/regexp-stack.cc +103 -0
  236. data/ext/v8/upstream/2.0.6/src/regexp-stack.h +123 -0
  237. data/ext/v8/upstream/2.0.6/src/register-allocator-inl.h +74 -0
  238. data/ext/v8/upstream/2.0.6/src/register-allocator.cc +100 -0
  239. data/ext/v8/upstream/2.0.6/src/register-allocator.h +295 -0
  240. data/ext/v8/upstream/2.0.6/src/rewriter.cc +855 -0
  241. data/ext/v8/upstream/2.0.6/src/rewriter.h +54 -0
  242. data/ext/v8/upstream/2.0.6/src/runtime.cc +8163 -0
  243. data/ext/v8/upstream/2.0.6/src/runtime.h +432 -0
  244. data/ext/v8/upstream/2.0.6/src/runtime.js +626 -0
  245. data/ext/v8/upstream/2.0.6/src/scanner.cc +1098 -0
  246. data/ext/v8/upstream/2.0.6/src/scanner.h +425 -0
  247. data/ext/v8/upstream/2.0.6/src/scopeinfo.cc +649 -0
  248. data/ext/v8/upstream/2.0.6/src/scopeinfo.h +236 -0
  249. data/ext/v8/upstream/2.0.6/src/scopes.cc +963 -0
  250. data/ext/v8/upstream/2.0.6/src/scopes.h +401 -0
  251. data/ext/v8/upstream/2.0.6/src/serialize.cc +1260 -0
  252. data/ext/v8/upstream/2.0.6/src/serialize.h +404 -0
  253. data/ext/v8/upstream/2.0.6/src/shell.h +55 -0
  254. data/ext/v8/upstream/2.0.6/src/simulator.h +41 -0
  255. data/ext/v8/upstream/2.0.6/src/smart-pointer.h +109 -0
  256. data/ext/v8/upstream/2.0.6/src/snapshot-common.cc +97 -0
  257. data/ext/v8/upstream/2.0.6/src/snapshot-empty.cc +40 -0
  258. data/ext/v8/upstream/2.0.6/src/snapshot.h +59 -0
  259. data/ext/v8/upstream/2.0.6/src/spaces-inl.h +372 -0
  260. data/ext/v8/upstream/2.0.6/src/spaces.cc +2864 -0
  261. data/ext/v8/upstream/2.0.6/src/spaces.h +2072 -0
  262. data/ext/v8/upstream/2.0.6/src/string-stream.cc +584 -0
  263. data/ext/v8/upstream/2.0.6/src/string-stream.h +189 -0
  264. data/ext/v8/upstream/2.0.6/src/string.js +901 -0
  265. data/ext/v8/upstream/2.0.6/src/stub-cache.cc +1108 -0
  266. data/ext/v8/upstream/2.0.6/src/stub-cache.h +578 -0
  267. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/COPYING +15 -0
  268. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/dtoa.c +3330 -0
  269. data/ext/v8/upstream/2.0.6/src/third_party/valgrind/valgrind.h +3925 -0
  270. data/ext/v8/upstream/2.0.6/src/token.cc +56 -0
  271. data/ext/v8/upstream/2.0.6/src/token.h +270 -0
  272. data/ext/v8/upstream/2.0.6/src/top.cc +991 -0
  273. data/ext/v8/upstream/2.0.6/src/top.h +459 -0
  274. data/ext/v8/upstream/2.0.6/src/unicode-inl.h +238 -0
  275. data/ext/v8/upstream/2.0.6/src/unicode.cc +749 -0
  276. data/ext/v8/upstream/2.0.6/src/unicode.h +279 -0
  277. data/ext/v8/upstream/2.0.6/src/uri.js +415 -0
  278. data/ext/v8/upstream/2.0.6/src/usage-analyzer.cc +426 -0
  279. data/ext/v8/upstream/2.0.6/src/usage-analyzer.h +40 -0
  280. data/ext/v8/upstream/2.0.6/src/utils.cc +322 -0
  281. data/ext/v8/upstream/2.0.6/src/utils.h +592 -0
  282. data/ext/v8/upstream/2.0.6/src/v8-counters.cc +55 -0
  283. data/ext/v8/upstream/2.0.6/src/v8-counters.h +198 -0
  284. data/ext/v8/upstream/2.0.6/src/v8.cc +193 -0
  285. data/ext/v8/upstream/2.0.6/src/v8.h +119 -0
  286. data/ext/v8/upstream/2.0.6/src/v8natives.js +846 -0
  287. data/ext/v8/upstream/2.0.6/src/v8threads.cc +450 -0
  288. data/ext/v8/upstream/2.0.6/src/v8threads.h +144 -0
  289. data/ext/v8/upstream/2.0.6/src/variables.cc +163 -0
  290. data/ext/v8/upstream/2.0.6/src/variables.h +235 -0
  291. data/ext/v8/upstream/2.0.6/src/version.cc +88 -0
  292. data/ext/v8/upstream/2.0.6/src/version.h +64 -0
  293. data/ext/v8/upstream/2.0.6/src/virtual-frame.cc +381 -0
  294. data/ext/v8/upstream/2.0.6/src/virtual-frame.h +44 -0
  295. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64-inl.h +352 -0
  296. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.cc +2539 -0
  297. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.h +1399 -0
  298. data/ext/v8/upstream/2.0.6/src/x64/builtins-x64.cc +1255 -0
  299. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64-inl.h +46 -0
  300. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.cc +8223 -0
  301. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.h +785 -0
  302. data/ext/v8/upstream/2.0.6/src/x64/cpu-x64.cc +79 -0
  303. data/ext/v8/upstream/2.0.6/src/x64/debug-x64.cc +202 -0
  304. data/ext/v8/upstream/2.0.6/src/x64/disasm-x64.cc +1596 -0
  305. data/ext/v8/upstream/2.0.6/src/x64/fast-codegen-x64.cc +1820 -0
  306. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.cc +109 -0
  307. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.h +121 -0
  308. data/ext/v8/upstream/2.0.6/src/x64/ic-x64.cc +1392 -0
  309. data/ext/v8/upstream/2.0.6/src/x64/jump-target-x64.cc +432 -0
  310. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.cc +2409 -0
  311. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.h +765 -0
  312. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.cc +1337 -0
  313. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.h +295 -0
  314. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64-inl.h +86 -0
  315. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.cc +84 -0
  316. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.h +43 -0
  317. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.cc +27 -0
  318. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.h +63 -0
  319. data/ext/v8/upstream/2.0.6/src/x64/stub-cache-x64.cc +1884 -0
  320. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.cc +1089 -0
  321. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.h +560 -0
  322. data/ext/v8/upstream/2.0.6/src/zone-inl.h +297 -0
  323. data/ext/v8/upstream/2.0.6/src/zone.cc +193 -0
  324. data/ext/v8/upstream/2.0.6/src/zone.h +305 -0
  325. data/ext/v8/upstream/2.0.6/tools/codemap.js +258 -0
  326. data/ext/v8/upstream/2.0.6/tools/consarray.js +93 -0
  327. data/ext/v8/upstream/2.0.6/tools/csvparser.js +98 -0
  328. data/ext/v8/upstream/2.0.6/tools/gyp/v8.gyp +620 -0
  329. data/ext/v8/upstream/2.0.6/tools/js2c.py +376 -0
  330. data/ext/v8/upstream/2.0.6/tools/jsmin.py +280 -0
  331. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor +24 -0
  332. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor.py +78 -0
  333. data/ext/v8/upstream/2.0.6/tools/logreader.js +320 -0
  334. data/ext/v8/upstream/2.0.6/tools/mac-nm +18 -0
  335. data/ext/v8/upstream/2.0.6/tools/mac-tick-processor +6 -0
  336. data/ext/v8/upstream/2.0.6/tools/oprofile/annotate +7 -0
  337. data/ext/v8/upstream/2.0.6/tools/oprofile/common +19 -0
  338. data/ext/v8/upstream/2.0.6/tools/oprofile/dump +7 -0
  339. data/ext/v8/upstream/2.0.6/tools/oprofile/report +7 -0
  340. data/ext/v8/upstream/2.0.6/tools/oprofile/reset +7 -0
  341. data/ext/v8/upstream/2.0.6/tools/oprofile/run +14 -0
  342. data/ext/v8/upstream/2.0.6/tools/oprofile/shutdown +7 -0
  343. data/ext/v8/upstream/2.0.6/tools/oprofile/start +7 -0
  344. data/ext/v8/upstream/2.0.6/tools/presubmit.py +299 -0
  345. data/ext/v8/upstream/2.0.6/tools/process-heap-prof.py +120 -0
  346. data/ext/v8/upstream/2.0.6/tools/profile.js +621 -0
  347. data/ext/v8/upstream/2.0.6/tools/profile_view.js +224 -0
  348. data/ext/v8/upstream/2.0.6/tools/run-valgrind.py +77 -0
  349. data/ext/v8/upstream/2.0.6/tools/splaytree.js +322 -0
  350. data/ext/v8/upstream/2.0.6/tools/splaytree.py +226 -0
  351. data/ext/v8/upstream/2.0.6/tools/stats-viewer.py +456 -0
  352. data/ext/v8/upstream/2.0.6/tools/test.py +1370 -0
  353. data/ext/v8/upstream/2.0.6/tools/tickprocessor-driver.js +53 -0
  354. data/ext/v8/upstream/2.0.6/tools/tickprocessor.js +731 -0
  355. data/ext/v8/upstream/2.0.6/tools/tickprocessor.py +535 -0
  356. data/ext/v8/upstream/2.0.6/tools/utils.py +82 -0
  357. data/ext/v8/upstream/2.0.6/tools/visual_studio/README.txt +71 -0
  358. data/ext/v8/upstream/2.0.6/tools/visual_studio/arm.vsprops +14 -0
  359. data/ext/v8/upstream/2.0.6/tools/visual_studio/common.vsprops +35 -0
  360. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8.vcproj +199 -0
  361. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_arm.vcproj +199 -0
  362. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_x64.vcproj +201 -0
  363. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8js2c.cmd +6 -0
  364. data/ext/v8/upstream/2.0.6/tools/visual_studio/debug.vsprops +17 -0
  365. data/ext/v8/upstream/2.0.6/tools/visual_studio/ia32.vsprops +13 -0
  366. data/ext/v8/upstream/2.0.6/tools/visual_studio/js2c.cmd +6 -0
  367. data/ext/v8/upstream/2.0.6/tools/visual_studio/release.vsprops +24 -0
  368. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.sln +101 -0
  369. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.vcproj +223 -0
  370. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.sln +74 -0
  371. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.vcproj +223 -0
  372. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base.vcproj +971 -0
  373. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_arm.vcproj +983 -0
  374. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_x64.vcproj +959 -0
  375. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest.vcproj +255 -0
  376. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_arm.vcproj +243 -0
  377. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_x64.vcproj +257 -0
  378. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot.vcproj +151 -0
  379. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot_x64.vcproj +151 -0
  380. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample.vcproj +151 -0
  381. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_arm.vcproj +151 -0
  382. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_x64.vcproj +151 -0
  383. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample.vcproj +151 -0
  384. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_arm.vcproj +151 -0
  385. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_x64.vcproj +153 -0
  386. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot.vcproj +142 -0
  387. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc.vcproj +92 -0
  388. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc_x64.vcproj +92 -0
  389. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_x64.vcproj +142 -0
  390. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.sln +101 -0
  391. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.vcproj +223 -0
  392. data/ext/v8/upstream/2.0.6/tools/visual_studio/x64.vsprops +13 -0
  393. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.bat +5 -0
  394. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.py +137 -0
  395. data/ext/v8/upstream/Makefile +31 -0
  396. data/ext/v8/upstream/no-strict-aliasing.patch +13 -0
  397. data/ext/v8/upstream/scons/CHANGES.txt +5183 -0
  398. data/ext/v8/upstream/scons/LICENSE.txt +20 -0
  399. data/ext/v8/upstream/scons/MANIFEST +202 -0
  400. data/ext/v8/upstream/scons/PKG-INFO +13 -0
  401. data/ext/v8/upstream/scons/README.txt +273 -0
  402. data/ext/v8/upstream/scons/RELEASE.txt +1040 -0
  403. data/ext/v8/upstream/scons/engine/SCons/Action.py +1256 -0
  404. data/ext/v8/upstream/scons/engine/SCons/Builder.py +868 -0
  405. data/ext/v8/upstream/scons/engine/SCons/CacheDir.py +217 -0
  406. data/ext/v8/upstream/scons/engine/SCons/Conftest.py +794 -0
  407. data/ext/v8/upstream/scons/engine/SCons/Debug.py +237 -0
  408. data/ext/v8/upstream/scons/engine/SCons/Defaults.py +485 -0
  409. data/ext/v8/upstream/scons/engine/SCons/Environment.py +2327 -0
  410. data/ext/v8/upstream/scons/engine/SCons/Errors.py +207 -0
  411. data/ext/v8/upstream/scons/engine/SCons/Executor.py +636 -0
  412. data/ext/v8/upstream/scons/engine/SCons/Job.py +435 -0
  413. data/ext/v8/upstream/scons/engine/SCons/Memoize.py +292 -0
  414. data/ext/v8/upstream/scons/engine/SCons/Node/Alias.py +153 -0
  415. data/ext/v8/upstream/scons/engine/SCons/Node/FS.py +3220 -0
  416. data/ext/v8/upstream/scons/engine/SCons/Node/Python.py +128 -0
  417. data/ext/v8/upstream/scons/engine/SCons/Node/__init__.py +1341 -0
  418. data/ext/v8/upstream/scons/engine/SCons/Options/BoolOption.py +50 -0
  419. data/ext/v8/upstream/scons/engine/SCons/Options/EnumOption.py +50 -0
  420. data/ext/v8/upstream/scons/engine/SCons/Options/ListOption.py +50 -0
  421. data/ext/v8/upstream/scons/engine/SCons/Options/PackageOption.py +50 -0
  422. data/ext/v8/upstream/scons/engine/SCons/Options/PathOption.py +76 -0
  423. data/ext/v8/upstream/scons/engine/SCons/Options/__init__.py +74 -0
  424. data/ext/v8/upstream/scons/engine/SCons/PathList.py +232 -0
  425. data/ext/v8/upstream/scons/engine/SCons/Platform/__init__.py +236 -0
  426. data/ext/v8/upstream/scons/engine/SCons/Platform/aix.py +70 -0
  427. data/ext/v8/upstream/scons/engine/SCons/Platform/cygwin.py +55 -0
  428. data/ext/v8/upstream/scons/engine/SCons/Platform/darwin.py +46 -0
  429. data/ext/v8/upstream/scons/engine/SCons/Platform/hpux.py +46 -0
  430. data/ext/v8/upstream/scons/engine/SCons/Platform/irix.py +44 -0
  431. data/ext/v8/upstream/scons/engine/SCons/Platform/os2.py +58 -0
  432. data/ext/v8/upstream/scons/engine/SCons/Platform/posix.py +264 -0
  433. data/ext/v8/upstream/scons/engine/SCons/Platform/sunos.py +50 -0
  434. data/ext/v8/upstream/scons/engine/SCons/Platform/win32.py +386 -0
  435. data/ext/v8/upstream/scons/engine/SCons/SConf.py +1038 -0
  436. data/ext/v8/upstream/scons/engine/SCons/SConsign.py +381 -0
  437. data/ext/v8/upstream/scons/engine/SCons/Scanner/C.py +132 -0
  438. data/ext/v8/upstream/scons/engine/SCons/Scanner/D.py +74 -0
  439. data/ext/v8/upstream/scons/engine/SCons/Scanner/Dir.py +111 -0
  440. data/ext/v8/upstream/scons/engine/SCons/Scanner/Fortran.py +320 -0
  441. data/ext/v8/upstream/scons/engine/SCons/Scanner/IDL.py +48 -0
  442. data/ext/v8/upstream/scons/engine/SCons/Scanner/LaTeX.py +378 -0
  443. data/ext/v8/upstream/scons/engine/SCons/Scanner/Prog.py +103 -0
  444. data/ext/v8/upstream/scons/engine/SCons/Scanner/RC.py +55 -0
  445. data/ext/v8/upstream/scons/engine/SCons/Scanner/__init__.py +415 -0
  446. data/ext/v8/upstream/scons/engine/SCons/Script/Interactive.py +386 -0
  447. data/ext/v8/upstream/scons/engine/SCons/Script/Main.py +1360 -0
  448. data/ext/v8/upstream/scons/engine/SCons/Script/SConsOptions.py +944 -0
  449. data/ext/v8/upstream/scons/engine/SCons/Script/SConscript.py +642 -0
  450. data/ext/v8/upstream/scons/engine/SCons/Script/__init__.py +414 -0
  451. data/ext/v8/upstream/scons/engine/SCons/Sig.py +63 -0
  452. data/ext/v8/upstream/scons/engine/SCons/Subst.py +911 -0
  453. data/ext/v8/upstream/scons/engine/SCons/Taskmaster.py +1030 -0
  454. data/ext/v8/upstream/scons/engine/SCons/Tool/386asm.py +61 -0
  455. data/ext/v8/upstream/scons/engine/SCons/Tool/BitKeeper.py +65 -0
  456. data/ext/v8/upstream/scons/engine/SCons/Tool/CVS.py +73 -0
  457. data/ext/v8/upstream/scons/engine/SCons/Tool/FortranCommon.py +247 -0
  458. data/ext/v8/upstream/scons/engine/SCons/Tool/JavaCommon.py +324 -0
  459. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/__init__.py +56 -0
  460. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/arch.py +61 -0
  461. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/common.py +210 -0
  462. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/netframework.py +84 -0
  463. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/sdk.py +321 -0
  464. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vc.py +367 -0
  465. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vs.py +497 -0
  466. data/ext/v8/upstream/scons/engine/SCons/Tool/Perforce.py +104 -0
  467. data/ext/v8/upstream/scons/engine/SCons/Tool/PharLapCommon.py +138 -0
  468. data/ext/v8/upstream/scons/engine/SCons/Tool/RCS.py +64 -0
  469. data/ext/v8/upstream/scons/engine/SCons/Tool/SCCS.py +64 -0
  470. data/ext/v8/upstream/scons/engine/SCons/Tool/Subversion.py +71 -0
  471. data/ext/v8/upstream/scons/engine/SCons/Tool/__init__.py +675 -0
  472. data/ext/v8/upstream/scons/engine/SCons/Tool/aixc++.py +82 -0
  473. data/ext/v8/upstream/scons/engine/SCons/Tool/aixcc.py +74 -0
  474. data/ext/v8/upstream/scons/engine/SCons/Tool/aixf77.py +80 -0
  475. data/ext/v8/upstream/scons/engine/SCons/Tool/aixlink.py +76 -0
  476. data/ext/v8/upstream/scons/engine/SCons/Tool/applelink.py +71 -0
  477. data/ext/v8/upstream/scons/engine/SCons/Tool/ar.py +63 -0
  478. data/ext/v8/upstream/scons/engine/SCons/Tool/as.py +78 -0
  479. data/ext/v8/upstream/scons/engine/SCons/Tool/bcc32.py +82 -0
  480. data/ext/v8/upstream/scons/engine/SCons/Tool/c++.py +99 -0
  481. data/ext/v8/upstream/scons/engine/SCons/Tool/cc.py +114 -0
  482. data/ext/v8/upstream/scons/engine/SCons/Tool/cvf.py +58 -0
  483. data/ext/v8/upstream/scons/engine/SCons/Tool/default.py +50 -0
  484. data/ext/v8/upstream/scons/engine/SCons/Tool/dmd.py +224 -0
  485. data/ext/v8/upstream/scons/engine/SCons/Tool/dvi.py +64 -0
  486. data/ext/v8/upstream/scons/engine/SCons/Tool/dvipdf.py +125 -0
  487. data/ext/v8/upstream/scons/engine/SCons/Tool/dvips.py +94 -0
  488. data/ext/v8/upstream/scons/engine/SCons/Tool/f77.py +62 -0
  489. data/ext/v8/upstream/scons/engine/SCons/Tool/f90.py +62 -0
  490. data/ext/v8/upstream/scons/engine/SCons/Tool/f95.py +63 -0
  491. data/ext/v8/upstream/scons/engine/SCons/Tool/filesystem.py +98 -0
  492. data/ext/v8/upstream/scons/engine/SCons/Tool/fortran.py +63 -0
  493. data/ext/v8/upstream/scons/engine/SCons/Tool/g++.py +90 -0
  494. data/ext/v8/upstream/scons/engine/SCons/Tool/g77.py +73 -0
  495. data/ext/v8/upstream/scons/engine/SCons/Tool/gas.py +53 -0
  496. data/ext/v8/upstream/scons/engine/SCons/Tool/gcc.py +80 -0
  497. data/ext/v8/upstream/scons/engine/SCons/Tool/gfortran.py +64 -0
  498. data/ext/v8/upstream/scons/engine/SCons/Tool/gnulink.py +63 -0
  499. data/ext/v8/upstream/scons/engine/SCons/Tool/gs.py +81 -0
  500. data/ext/v8/upstream/scons/engine/SCons/Tool/hpc++.py +85 -0
  501. data/ext/v8/upstream/scons/engine/SCons/Tool/hpcc.py +53 -0
  502. data/ext/v8/upstream/scons/engine/SCons/Tool/hplink.py +77 -0
  503. data/ext/v8/upstream/scons/engine/SCons/Tool/icc.py +59 -0
  504. data/ext/v8/upstream/scons/engine/SCons/Tool/icl.py +52 -0
  505. data/ext/v8/upstream/scons/engine/SCons/Tool/ifl.py +72 -0
  506. data/ext/v8/upstream/scons/engine/SCons/Tool/ifort.py +90 -0
  507. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink.py +59 -0
  508. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink32.py +60 -0
  509. data/ext/v8/upstream/scons/engine/SCons/Tool/install.py +229 -0
  510. data/ext/v8/upstream/scons/engine/SCons/Tool/intelc.py +490 -0
  511. data/ext/v8/upstream/scons/engine/SCons/Tool/ipkg.py +71 -0
  512. data/ext/v8/upstream/scons/engine/SCons/Tool/jar.py +110 -0
  513. data/ext/v8/upstream/scons/engine/SCons/Tool/javac.py +234 -0
  514. data/ext/v8/upstream/scons/engine/SCons/Tool/javah.py +138 -0
  515. data/ext/v8/upstream/scons/engine/SCons/Tool/latex.py +79 -0
  516. data/ext/v8/upstream/scons/engine/SCons/Tool/lex.py +99 -0
  517. data/ext/v8/upstream/scons/engine/SCons/Tool/link.py +121 -0
  518. data/ext/v8/upstream/scons/engine/SCons/Tool/linkloc.py +112 -0
  519. data/ext/v8/upstream/scons/engine/SCons/Tool/m4.py +63 -0
  520. data/ext/v8/upstream/scons/engine/SCons/Tool/masm.py +77 -0
  521. data/ext/v8/upstream/scons/engine/SCons/Tool/midl.py +90 -0
  522. data/ext/v8/upstream/scons/engine/SCons/Tool/mingw.py +159 -0
  523. data/ext/v8/upstream/scons/engine/SCons/Tool/mslib.py +64 -0
  524. data/ext/v8/upstream/scons/engine/SCons/Tool/mslink.py +266 -0
  525. data/ext/v8/upstream/scons/engine/SCons/Tool/mssdk.py +50 -0
  526. data/ext/v8/upstream/scons/engine/SCons/Tool/msvc.py +269 -0
  527. data/ext/v8/upstream/scons/engine/SCons/Tool/msvs.py +1439 -0
  528. data/ext/v8/upstream/scons/engine/SCons/Tool/mwcc.py +208 -0
  529. data/ext/v8/upstream/scons/engine/SCons/Tool/mwld.py +107 -0
  530. data/ext/v8/upstream/scons/engine/SCons/Tool/nasm.py +72 -0
  531. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/__init__.py +314 -0
  532. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/ipk.py +185 -0
  533. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/msi.py +526 -0
  534. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/rpm.py +367 -0
  535. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_tarbz2.py +43 -0
  536. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_targz.py +43 -0
  537. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_zip.py +43 -0
  538. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/tarbz2.py +44 -0
  539. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/targz.py +44 -0
  540. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/zip.py +44 -0
  541. data/ext/v8/upstream/scons/engine/SCons/Tool/pdf.py +78 -0
  542. data/ext/v8/upstream/scons/engine/SCons/Tool/pdflatex.py +83 -0
  543. data/ext/v8/upstream/scons/engine/SCons/Tool/pdftex.py +108 -0
  544. data/ext/v8/upstream/scons/engine/SCons/Tool/qt.py +336 -0
  545. data/ext/v8/upstream/scons/engine/SCons/Tool/rmic.py +121 -0
  546. data/ext/v8/upstream/scons/engine/SCons/Tool/rpcgen.py +70 -0
  547. data/ext/v8/upstream/scons/engine/SCons/Tool/rpm.py +132 -0
  548. data/ext/v8/upstream/scons/engine/SCons/Tool/sgiar.py +68 -0
  549. data/ext/v8/upstream/scons/engine/SCons/Tool/sgic++.py +58 -0
  550. data/ext/v8/upstream/scons/engine/SCons/Tool/sgicc.py +53 -0
  551. data/ext/v8/upstream/scons/engine/SCons/Tool/sgilink.py +63 -0
  552. data/ext/v8/upstream/scons/engine/SCons/Tool/sunar.py +67 -0
  553. data/ext/v8/upstream/scons/engine/SCons/Tool/sunc++.py +142 -0
  554. data/ext/v8/upstream/scons/engine/SCons/Tool/suncc.py +58 -0
  555. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf77.py +63 -0
  556. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf90.py +64 -0
  557. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf95.py +64 -0
  558. data/ext/v8/upstream/scons/engine/SCons/Tool/sunlink.py +77 -0
  559. data/ext/v8/upstream/scons/engine/SCons/Tool/swig.py +186 -0
  560. data/ext/v8/upstream/scons/engine/SCons/Tool/tar.py +73 -0
  561. data/ext/v8/upstream/scons/engine/SCons/Tool/tex.py +805 -0
  562. data/ext/v8/upstream/scons/engine/SCons/Tool/textfile.py +175 -0
  563. data/ext/v8/upstream/scons/engine/SCons/Tool/tlib.py +53 -0
  564. data/ext/v8/upstream/scons/engine/SCons/Tool/wix.py +100 -0
  565. data/ext/v8/upstream/scons/engine/SCons/Tool/yacc.py +131 -0
  566. data/ext/v8/upstream/scons/engine/SCons/Tool/zip.py +100 -0
  567. data/ext/v8/upstream/scons/engine/SCons/Util.py +1645 -0
  568. data/ext/v8/upstream/scons/engine/SCons/Variables/BoolVariable.py +91 -0
  569. data/ext/v8/upstream/scons/engine/SCons/Variables/EnumVariable.py +107 -0
  570. data/ext/v8/upstream/scons/engine/SCons/Variables/ListVariable.py +139 -0
  571. data/ext/v8/upstream/scons/engine/SCons/Variables/PackageVariable.py +109 -0
  572. data/ext/v8/upstream/scons/engine/SCons/Variables/PathVariable.py +147 -0
  573. data/ext/v8/upstream/scons/engine/SCons/Variables/__init__.py +317 -0
  574. data/ext/v8/upstream/scons/engine/SCons/Warnings.py +228 -0
  575. data/ext/v8/upstream/scons/engine/SCons/__init__.py +49 -0
  576. data/ext/v8/upstream/scons/engine/SCons/compat/__init__.py +302 -0
  577. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_UserString.py +98 -0
  578. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_hashlib.py +91 -0
  579. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_itertools.py +124 -0
  580. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_optparse.py +1725 -0
  581. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets.py +583 -0
  582. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets15.py +176 -0
  583. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_shlex.py +325 -0
  584. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_subprocess.py +1296 -0
  585. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_textwrap.py +382 -0
  586. data/ext/v8/upstream/scons/engine/SCons/compat/builtins.py +187 -0
  587. data/ext/v8/upstream/scons/engine/SCons/cpp.py +598 -0
  588. data/ext/v8/upstream/scons/engine/SCons/dblite.py +248 -0
  589. data/ext/v8/upstream/scons/engine/SCons/exitfuncs.py +77 -0
  590. data/ext/v8/upstream/scons/os_spawnv_fix.diff +83 -0
  591. data/ext/v8/upstream/scons/scons-time.1 +1017 -0
  592. data/ext/v8/upstream/scons/scons.1 +15179 -0
  593. data/ext/v8/upstream/scons/sconsign.1 +208 -0
  594. data/ext/v8/upstream/scons/script/scons +184 -0
  595. data/ext/v8/upstream/scons/script/scons-time +1529 -0
  596. data/ext/v8/upstream/scons/script/scons.bat +31 -0
  597. data/ext/v8/upstream/scons/script/sconsign +508 -0
  598. data/ext/v8/upstream/scons/setup.cfg +6 -0
  599. data/ext/v8/upstream/scons/setup.py +427 -0
  600. data/ext/v8/v8.cpp +89 -0
  601. data/ext/v8/v8_cxt.cpp +92 -0
  602. data/ext/v8/v8_cxt.h +20 -0
  603. data/ext/v8/v8_func.cpp +10 -0
  604. data/ext/v8/v8_func.h +11 -0
  605. data/ext/v8/v8_msg.cpp +54 -0
  606. data/ext/v8/v8_msg.h +18 -0
  607. data/ext/v8/v8_obj.cpp +52 -0
  608. data/ext/v8/v8_obj.h +13 -0
  609. data/ext/v8/v8_ref.cpp +26 -0
  610. data/ext/v8/v8_ref.h +31 -0
  611. data/ext/v8/v8_script.cpp +20 -0
  612. data/ext/v8/v8_script.h +8 -0
  613. data/ext/v8/v8_standalone.cpp +69 -0
  614. data/ext/v8/v8_standalone.h +31 -0
  615. data/ext/v8/v8_str.cpp +17 -0
  616. data/ext/v8/v8_str.h +9 -0
  617. data/ext/v8/v8_template.cpp +53 -0
  618. data/ext/v8/v8_template.h +13 -0
  619. data/lib/v8.rb +10 -0
  620. data/lib/v8/context.rb +101 -0
  621. data/lib/v8/object.rb +38 -0
  622. data/lib/v8/to.rb +33 -0
  623. data/lib/v8/v8.so +0 -0
  624. data/script/console +10 -0
  625. data/script/destroy +14 -0
  626. data/script/generate +14 -0
  627. data/spec/ext/cxt_spec.rb +25 -0
  628. data/spec/ext/obj_spec.rb +13 -0
  629. data/spec/redjs/jsapi_spec.rb +405 -0
  630. data/spec/redjs/tap.rb +8 -0
  631. data/spec/redjs_helper.rb +3 -0
  632. data/spec/spec.opts +1 -0
  633. data/spec/spec_helper.rb +14 -0
  634. data/spec/v8/to_spec.rb +15 -0
  635. data/tasks/rspec.rake +21 -0
  636. data/therubyracer.gemspec +680 -0
  637. metadata +697 -0
@@ -0,0 +1,43 @@
1
+ // Copyright 2009 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #ifndef V8_X64_REGISTER_ALLOCATOR_X64_H_
29
+ #define V8_X64_REGISTER_ALLOCATOR_X64_H_
30
+
31
+ namespace v8 {
32
+ namespace internal {
33
+
34
+ class RegisterAllocatorConstants : public AllStatic {
35
+ public:
36
+ static const int kNumRegisters = 11;
37
+ static const int kInvalidRegister = -1;
38
+ };
39
+
40
+
41
+ } } // namespace v8::internal
42
+
43
+ #endif // V8_X64_REGISTER_ALLOCATOR_X64_H_
@@ -0,0 +1,27 @@
1
+ // Copyright 2009 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
@@ -0,0 +1,63 @@
1
+ // Copyright 2009 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #ifndef V8_X64_SIMULATOR_X64_H_
29
+ #define V8_X64_SIMULATOR_X64_H_
30
+
31
+ #include "allocation.h"
32
+
33
+ // Since there is no simulator for the ia32 architecture the only thing we can
34
+ // do is to call the entry directly.
35
+ // TODO(X64): Don't pass p0, since it isn't used?
36
+ #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
37
+ entry(p0, p1, p2, p3, p4);
38
+
39
+ // The stack limit beyond which we will throw stack overflow errors in
40
+ // generated code. Because generated code on x64 uses the C stack, we
41
+ // just use the C stack limit.
42
+ class SimulatorStack : public v8::internal::AllStatic {
43
+ public:
44
+ static inline uintptr_t JsLimitFromCLimit(uintptr_t c_limit) {
45
+ return c_limit;
46
+ }
47
+
48
+ static inline uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) {
49
+ return try_catch_address;
50
+ }
51
+
52
+ static inline void UnregisterCTryCatch() { }
53
+ };
54
+
55
+ // Call the generated regexp code directly. The entry function pointer should
56
+ // expect eight int/pointer sized arguments and return an int.
57
+ #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \
58
+ entry(p0, p1, p2, p3, p4, p5, p6, p7)
59
+
60
+ #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
61
+ reinterpret_cast<TryCatch*>(try_catch_address)
62
+
63
+ #endif // V8_X64_SIMULATOR_X64_H_
@@ -0,0 +1,1884 @@
1
+ // Copyright 2009 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+
29
+ #include "v8.h"
30
+
31
+ #include "ic-inl.h"
32
+ #include "codegen-inl.h"
33
+ #include "stub-cache.h"
34
+ #include "macro-assembler-x64.h"
35
+
36
+ namespace v8 {
37
+ namespace internal {
38
+
39
+ //-----------------------------------------------------------------------------
40
+ // StubCompiler static helper functions
41
+
42
+ #define __ ACCESS_MASM(masm)
43
+
44
+
45
+ static void ProbeTable(MacroAssembler* masm,
46
+ Code::Flags flags,
47
+ StubCache::Table table,
48
+ Register name,
49
+ Register offset) {
50
+ ASSERT_EQ(8, kPointerSize);
51
+ ASSERT_EQ(16, sizeof(StubCache::Entry));
52
+ // The offset register holds the entry offset times four (due to masking
53
+ // and shifting optimizations).
54
+ ExternalReference key_offset(SCTableReference::keyReference(table));
55
+ Label miss;
56
+
57
+ __ movq(kScratchRegister, key_offset);
58
+ // Check that the key in the entry matches the name.
59
+ // Multiply entry offset by 16 to get the entry address. Since the
60
+ // offset register already holds the entry offset times four, multiply
61
+ // by a further four.
62
+ __ cmpl(name, Operand(kScratchRegister, offset, times_4, 0));
63
+ __ j(not_equal, &miss);
64
+ // Get the code entry from the cache.
65
+ // Use key_offset + kPointerSize, rather than loading value_offset.
66
+ __ movq(kScratchRegister,
67
+ Operand(kScratchRegister, offset, times_4, kPointerSize));
68
+ // Check that the flags match what we're looking for.
69
+ __ movl(offset, FieldOperand(kScratchRegister, Code::kFlagsOffset));
70
+ __ and_(offset, Immediate(~Code::kFlagsNotUsedInLookup));
71
+ __ cmpl(offset, Immediate(flags));
72
+ __ j(not_equal, &miss);
73
+
74
+ // Jump to the first instruction in the code stub.
75
+ __ addq(kScratchRegister, Immediate(Code::kHeaderSize - kHeapObjectTag));
76
+ __ jmp(kScratchRegister);
77
+
78
+ __ bind(&miss);
79
+ }
80
+
81
+
82
+ void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) {
83
+ ASSERT(kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC);
84
+ Code* code = NULL;
85
+ if (kind == Code::LOAD_IC) {
86
+ code = Builtins::builtin(Builtins::LoadIC_Miss);
87
+ } else {
88
+ code = Builtins::builtin(Builtins::KeyedLoadIC_Miss);
89
+ }
90
+
91
+ Handle<Code> ic(code);
92
+ __ Jump(ic, RelocInfo::CODE_TARGET);
93
+ }
94
+
95
+
96
+ void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
97
+ int index,
98
+ Register prototype) {
99
+ // Load the global or builtins object from the current context.
100
+ __ movq(prototype,
101
+ Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
102
+ // Load the global context from the global or builtins object.
103
+ __ movq(prototype,
104
+ FieldOperand(prototype, GlobalObject::kGlobalContextOffset));
105
+ // Load the function from the global context.
106
+ __ movq(prototype, Operand(prototype, Context::SlotOffset(index)));
107
+ // Load the initial map. The global functions all have initial maps.
108
+ __ movq(prototype,
109
+ FieldOperand(prototype, JSFunction::kPrototypeOrInitialMapOffset));
110
+ // Load the prototype from the initial map.
111
+ __ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
112
+ }
113
+
114
+
115
+ // Load a fast property out of a holder object (src). In-object properties
116
+ // are loaded directly otherwise the property is loaded from the properties
117
+ // fixed array.
118
+ void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm,
119
+ Register dst, Register src,
120
+ JSObject* holder, int index) {
121
+ // Adjust for the number of properties stored in the holder.
122
+ index -= holder->map()->inobject_properties();
123
+ if (index < 0) {
124
+ // Get the property straight out of the holder.
125
+ int offset = holder->map()->instance_size() + (index * kPointerSize);
126
+ __ movq(dst, FieldOperand(src, offset));
127
+ } else {
128
+ // Calculate the offset into the properties array.
129
+ int offset = index * kPointerSize + FixedArray::kHeaderSize;
130
+ __ movq(dst, FieldOperand(src, JSObject::kPropertiesOffset));
131
+ __ movq(dst, FieldOperand(dst, offset));
132
+ }
133
+ }
134
+
135
+
136
+ template <typename Pushable>
137
+ static void PushInterceptorArguments(MacroAssembler* masm,
138
+ Register receiver,
139
+ Register holder,
140
+ Pushable name,
141
+ JSObject* holder_obj) {
142
+ __ push(receiver);
143
+ __ push(holder);
144
+ __ push(name);
145
+ InterceptorInfo* interceptor = holder_obj->GetNamedInterceptor();
146
+ __ movq(kScratchRegister, Handle<Object>(interceptor),
147
+ RelocInfo::EMBEDDED_OBJECT);
148
+ __ push(kScratchRegister);
149
+ __ push(FieldOperand(kScratchRegister, InterceptorInfo::kDataOffset));
150
+ }
151
+
152
+
153
+ void StubCache::GenerateProbe(MacroAssembler* masm,
154
+ Code::Flags flags,
155
+ Register receiver,
156
+ Register name,
157
+ Register scratch,
158
+ Register extra) {
159
+ Label miss;
160
+ USE(extra); // The register extra is not used on the X64 platform.
161
+ // Make sure that code is valid. The shifting code relies on the
162
+ // entry size being 16.
163
+ ASSERT(sizeof(Entry) == 16);
164
+
165
+ // Make sure the flags do not name a specific type.
166
+ ASSERT(Code::ExtractTypeFromFlags(flags) == 0);
167
+
168
+ // Make sure that there are no register conflicts.
169
+ ASSERT(!scratch.is(receiver));
170
+ ASSERT(!scratch.is(name));
171
+
172
+ // Check that the receiver isn't a smi.
173
+ __ JumpIfSmi(receiver, &miss);
174
+
175
+ // Get the map of the receiver and compute the hash.
176
+ __ movl(scratch, FieldOperand(name, String::kHashFieldOffset));
177
+ // Use only the low 32 bits of the map pointer.
178
+ __ addl(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
179
+ __ xor_(scratch, Immediate(flags));
180
+ __ and_(scratch, Immediate((kPrimaryTableSize - 1) << kHeapObjectTagSize));
181
+
182
+ // Probe the primary table.
183
+ ProbeTable(masm, flags, kPrimary, name, scratch);
184
+
185
+ // Primary miss: Compute hash for secondary probe.
186
+ __ movl(scratch, FieldOperand(name, String::kHashFieldOffset));
187
+ __ addl(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
188
+ __ xor_(scratch, Immediate(flags));
189
+ __ and_(scratch, Immediate((kPrimaryTableSize - 1) << kHeapObjectTagSize));
190
+ __ subl(scratch, name);
191
+ __ addl(scratch, Immediate(flags));
192
+ __ and_(scratch, Immediate((kSecondaryTableSize - 1) << kHeapObjectTagSize));
193
+
194
+ // Probe the secondary table.
195
+ ProbeTable(masm, flags, kSecondary, name, scratch);
196
+
197
+ // Cache miss: Fall-through and let caller handle the miss by
198
+ // entering the runtime system.
199
+ __ bind(&miss);
200
+ }
201
+
202
+
203
+ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
204
+ Builtins::Name storage_extend,
205
+ JSObject* object,
206
+ int index,
207
+ Map* transition,
208
+ Register receiver_reg,
209
+ Register name_reg,
210
+ Register scratch,
211
+ Label* miss_label) {
212
+ // Check that the object isn't a smi.
213
+ __ JumpIfSmi(receiver_reg, miss_label);
214
+
215
+ // Check that the map of the object hasn't changed.
216
+ __ Cmp(FieldOperand(receiver_reg, HeapObject::kMapOffset),
217
+ Handle<Map>(object->map()));
218
+ __ j(not_equal, miss_label);
219
+
220
+ // Perform global security token check if needed.
221
+ if (object->IsJSGlobalProxy()) {
222
+ __ CheckAccessGlobalProxy(receiver_reg, scratch, miss_label);
223
+ }
224
+
225
+ // Stub never generated for non-global objects that require access
226
+ // checks.
227
+ ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
228
+
229
+ // Perform map transition for the receiver if necessary.
230
+ if ((transition != NULL) && (object->map()->unused_property_fields() == 0)) {
231
+ // The properties must be extended before we can store the value.
232
+ // We jump to a runtime call that extends the properties array.
233
+ __ Move(rcx, Handle<Map>(transition));
234
+ Handle<Code> ic(Builtins::builtin(storage_extend));
235
+ __ Jump(ic, RelocInfo::CODE_TARGET);
236
+ return;
237
+ }
238
+
239
+ if (transition != NULL) {
240
+ // Update the map of the object; no write barrier updating is
241
+ // needed because the map is never in new space.
242
+ __ Move(FieldOperand(receiver_reg, HeapObject::kMapOffset),
243
+ Handle<Map>(transition));
244
+ }
245
+
246
+ // Adjust for the number of properties stored in the object. Even in the
247
+ // face of a transition we can use the old map here because the size of the
248
+ // object and the number of in-object properties is not going to change.
249
+ index -= object->map()->inobject_properties();
250
+
251
+ if (index < 0) {
252
+ // Set the property straight into the object.
253
+ int offset = object->map()->instance_size() + (index * kPointerSize);
254
+ __ movq(FieldOperand(receiver_reg, offset), rax);
255
+
256
+ // Update the write barrier for the array address.
257
+ // Pass the value being stored in the now unused name_reg.
258
+ __ movq(name_reg, rax);
259
+ __ RecordWrite(receiver_reg, offset, name_reg, scratch);
260
+ } else {
261
+ // Write to the properties array.
262
+ int offset = index * kPointerSize + FixedArray::kHeaderSize;
263
+ // Get the properties array (optimistically).
264
+ __ movq(scratch, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
265
+ __ movq(FieldOperand(scratch, offset), rax);
266
+
267
+ // Update the write barrier for the array address.
268
+ // Pass the value being stored in the now unused name_reg.
269
+ __ movq(name_reg, rax);
270
+ __ RecordWrite(scratch, offset, name_reg, receiver_reg);
271
+ }
272
+
273
+ // Return the value (register rax).
274
+ __ ret(0);
275
+ }
276
+
277
+
278
+ void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm,
279
+ Register receiver,
280
+ Register scratch,
281
+ Label* miss_label) {
282
+ // Check that the receiver isn't a smi.
283
+ __ JumpIfSmi(receiver, miss_label);
284
+
285
+ // Check that the object is a JS array.
286
+ __ CmpObjectType(receiver, JS_ARRAY_TYPE, scratch);
287
+ __ j(not_equal, miss_label);
288
+
289
+ // Load length directly from the JS array.
290
+ __ movq(rax, FieldOperand(receiver, JSArray::kLengthOffset));
291
+ __ ret(0);
292
+ }
293
+
294
+
295
+ // Generate code to check if an object is a string. If the object is
296
+ // a string, the map's instance type is left in the scratch register.
297
+ static void GenerateStringCheck(MacroAssembler* masm,
298
+ Register receiver,
299
+ Register scratch,
300
+ Label* smi,
301
+ Label* non_string_object) {
302
+ // Check that the object isn't a smi.
303
+ __ JumpIfSmi(receiver, smi);
304
+
305
+ // Check that the object is a string.
306
+ __ movq(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
307
+ __ movzxbq(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset));
308
+ ASSERT(kNotStringTag != 0);
309
+ __ testl(scratch, Immediate(kNotStringTag));
310
+ __ j(not_zero, non_string_object);
311
+ }
312
+
313
+
314
+ void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm,
315
+ Register receiver,
316
+ Register scratch,
317
+ Label* miss) {
318
+ Label load_length, check_wrapper;
319
+
320
+ // Check if the object is a string leaving the instance type in the
321
+ // scratch register.
322
+ GenerateStringCheck(masm, receiver, scratch, miss, &check_wrapper);
323
+
324
+ // Load length directly from the string.
325
+ __ bind(&load_length);
326
+ __ movl(rax, FieldOperand(receiver, String::kLengthOffset));
327
+ __ Integer32ToSmi(rax, rax);
328
+ __ ret(0);
329
+
330
+ // Check if the object is a JSValue wrapper.
331
+ __ bind(&check_wrapper);
332
+ __ cmpl(scratch, Immediate(JS_VALUE_TYPE));
333
+ __ j(not_equal, miss);
334
+
335
+ // Check if the wrapped value is a string and load the length
336
+ // directly if it is.
337
+ __ movq(receiver, FieldOperand(receiver, JSValue::kValueOffset));
338
+ GenerateStringCheck(masm, receiver, scratch, miss, miss);
339
+ __ jmp(&load_length);
340
+ }
341
+
342
+
343
+ template <class Pushable>
344
+ static void CompileCallLoadPropertyWithInterceptor(MacroAssembler* masm,
345
+ Register receiver,
346
+ Register holder,
347
+ Pushable name,
348
+ JSObject* holder_obj) {
349
+ PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
350
+
351
+ ExternalReference ref =
352
+ ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly));
353
+ __ movq(rax, Immediate(5));
354
+ __ movq(rbx, ref);
355
+
356
+ CEntryStub stub(1);
357
+ __ CallStub(&stub);
358
+ }
359
+
360
+
361
+
362
+ void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm,
363
+ Register receiver,
364
+ Register result,
365
+ Register scratch,
366
+ Label* miss_label) {
367
+ __ TryGetFunctionPrototype(receiver, result, miss_label);
368
+ if (!result.is(rax)) __ movq(rax, result);
369
+ __ ret(0);
370
+ }
371
+
372
+
373
+ static void LookupPostInterceptor(JSObject* holder,
374
+ String* name,
375
+ LookupResult* lookup) {
376
+ holder->LocalLookupRealNamedProperty(name, lookup);
377
+ if (lookup->IsNotFound()) {
378
+ Object* proto = holder->GetPrototype();
379
+ if (proto != Heap::null_value()) {
380
+ proto->Lookup(name, lookup);
381
+ }
382
+ }
383
+ }
384
+
385
+
386
+ class LoadInterceptorCompiler BASE_EMBEDDED {
387
+ public:
388
+ explicit LoadInterceptorCompiler(Register name) : name_(name) {}
389
+
390
+ void CompileCacheable(MacroAssembler* masm,
391
+ StubCompiler* stub_compiler,
392
+ Register receiver,
393
+ Register holder,
394
+ Register scratch1,
395
+ Register scratch2,
396
+ JSObject* holder_obj,
397
+ LookupResult* lookup,
398
+ String* name,
399
+ Label* miss_label) {
400
+ AccessorInfo* callback = 0;
401
+ bool optimize = false;
402
+ // So far the most popular follow ups for interceptor loads are FIELD
403
+ // and CALLBACKS, so inline only them, other cases may be added
404
+ // later.
405
+ if (lookup->type() == FIELD) {
406
+ optimize = true;
407
+ } else if (lookup->type() == CALLBACKS) {
408
+ Object* callback_object = lookup->GetCallbackObject();
409
+ if (callback_object->IsAccessorInfo()) {
410
+ callback = AccessorInfo::cast(callback_object);
411
+ optimize = callback->getter() != NULL;
412
+ }
413
+ }
414
+
415
+ if (!optimize) {
416
+ CompileRegular(masm, receiver, holder, scratch2, holder_obj, miss_label);
417
+ return;
418
+ }
419
+
420
+ // Note: starting a frame here makes GC aware of pointers pushed below.
421
+ __ EnterInternalFrame();
422
+
423
+ if (lookup->type() == CALLBACKS) {
424
+ __ push(receiver);
425
+ }
426
+ __ push(holder);
427
+ __ push(name_);
428
+
429
+ CompileCallLoadPropertyWithInterceptor(masm,
430
+ receiver,
431
+ holder,
432
+ name_,
433
+ holder_obj);
434
+
435
+ Label interceptor_failed;
436
+ __ CompareRoot(rax, Heap::kNoInterceptorResultSentinelRootIndex);
437
+ __ j(equal, &interceptor_failed);
438
+ __ LeaveInternalFrame();
439
+ __ ret(0);
440
+
441
+ __ bind(&interceptor_failed);
442
+ __ pop(name_);
443
+ __ pop(holder);
444
+ if (lookup->type() == CALLBACKS) {
445
+ __ pop(receiver);
446
+ }
447
+
448
+ __ LeaveInternalFrame();
449
+
450
+ if (lookup->type() == FIELD) {
451
+ holder = stub_compiler->CheckPrototypes(holder_obj,
452
+ holder,
453
+ lookup->holder(),
454
+ scratch1,
455
+ scratch2,
456
+ name,
457
+ miss_label);
458
+ stub_compiler->GenerateFastPropertyLoad(masm,
459
+ rax,
460
+ holder,
461
+ lookup->holder(),
462
+ lookup->GetFieldIndex());
463
+ __ ret(0);
464
+ } else {
465
+ ASSERT(lookup->type() == CALLBACKS);
466
+ ASSERT(lookup->GetCallbackObject()->IsAccessorInfo());
467
+ ASSERT(callback != NULL);
468
+ ASSERT(callback->getter() != NULL);
469
+
470
+ Label cleanup;
471
+ __ pop(scratch2);
472
+ __ push(receiver);
473
+ __ push(scratch2);
474
+
475
+ holder = stub_compiler->CheckPrototypes(holder_obj, holder,
476
+ lookup->holder(), scratch1,
477
+ scratch2,
478
+ name,
479
+ &cleanup);
480
+
481
+ __ pop(scratch2); // save old return address
482
+ __ push(holder);
483
+ __ Move(holder, Handle<AccessorInfo>(callback));
484
+ __ push(holder);
485
+ __ push(FieldOperand(holder, AccessorInfo::kDataOffset));
486
+ __ push(name_);
487
+ __ push(scratch2); // restore old return address
488
+
489
+ ExternalReference ref =
490
+ ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
491
+ __ TailCallRuntime(ref, 5, 1);
492
+
493
+ __ bind(&cleanup);
494
+ __ pop(scratch1);
495
+ __ pop(scratch2);
496
+ __ push(scratch1);
497
+ }
498
+ }
499
+
500
+
501
+ void CompileRegular(MacroAssembler* masm,
502
+ Register receiver,
503
+ Register holder,
504
+ Register scratch,
505
+ JSObject* holder_obj,
506
+ Label* miss_label) {
507
+ __ pop(scratch); // save old return address
508
+ PushInterceptorArguments(masm, receiver, holder, name_, holder_obj);
509
+ __ push(scratch); // restore old return address
510
+
511
+ ExternalReference ref = ExternalReference(
512
+ IC_Utility(IC::kLoadPropertyWithInterceptorForLoad));
513
+ __ TailCallRuntime(ref, 5, 1);
514
+ }
515
+
516
+ private:
517
+ Register name_;
518
+ };
519
+
520
+
521
+ template <class Compiler>
522
+ static void CompileLoadInterceptor(Compiler* compiler,
523
+ StubCompiler* stub_compiler,
524
+ MacroAssembler* masm,
525
+ JSObject* object,
526
+ JSObject* holder,
527
+ String* name,
528
+ LookupResult* lookup,
529
+ Register receiver,
530
+ Register scratch1,
531
+ Register scratch2,
532
+ Label* miss) {
533
+ ASSERT(holder->HasNamedInterceptor());
534
+ ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
535
+
536
+ // Check that the receiver isn't a smi.
537
+ __ JumpIfSmi(receiver, miss);
538
+
539
+ // Check that the maps haven't changed.
540
+ Register reg =
541
+ stub_compiler->CheckPrototypes(object, receiver, holder,
542
+ scratch1, scratch2, name, miss);
543
+
544
+ if (lookup->IsValid() && lookup->IsCacheable()) {
545
+ compiler->CompileCacheable(masm,
546
+ stub_compiler,
547
+ receiver,
548
+ reg,
549
+ scratch1,
550
+ scratch2,
551
+ holder,
552
+ lookup,
553
+ name,
554
+ miss);
555
+ } else {
556
+ compiler->CompileRegular(masm,
557
+ receiver,
558
+ reg,
559
+ scratch2,
560
+ holder,
561
+ miss);
562
+ }
563
+ }
564
+
565
+
566
+ class CallInterceptorCompiler BASE_EMBEDDED {
567
+ public:
568
+ explicit CallInterceptorCompiler(const ParameterCount& arguments)
569
+ : arguments_(arguments), argc_(arguments.immediate()) {}
570
+
571
+ void CompileCacheable(MacroAssembler* masm,
572
+ StubCompiler* stub_compiler,
573
+ Register receiver,
574
+ Register holder,
575
+ Register scratch1,
576
+ Register scratch2,
577
+ JSObject* holder_obj,
578
+ LookupResult* lookup,
579
+ String* name,
580
+ Label* miss_label) {
581
+ JSFunction* function = 0;
582
+ bool optimize = false;
583
+ // So far the most popular case for failed interceptor is
584
+ // CONSTANT_FUNCTION sitting below.
585
+ if (lookup->type() == CONSTANT_FUNCTION) {
586
+ function = lookup->GetConstantFunction();
587
+ // JSArray holder is a special case for call constant function
588
+ // (see the corresponding code).
589
+ if (function->is_compiled() && !holder_obj->IsJSArray()) {
590
+ optimize = true;
591
+ }
592
+ }
593
+
594
+ if (!optimize) {
595
+ CompileRegular(masm, receiver, holder, scratch2, holder_obj, miss_label);
596
+ return;
597
+ }
598
+
599
+ __ EnterInternalFrame();
600
+ __ push(holder); // save the holder
601
+
602
+ CompileCallLoadPropertyWithInterceptor(
603
+ masm,
604
+ receiver,
605
+ holder,
606
+ // Under EnterInternalFrame this refers to name.
607
+ Operand(rbp, (argc_ + 3) * kPointerSize),
608
+ holder_obj);
609
+
610
+ __ pop(receiver); // restore holder
611
+ __ LeaveInternalFrame();
612
+
613
+ __ CompareRoot(rax, Heap::kNoInterceptorResultSentinelRootIndex);
614
+ Label invoke;
615
+ __ j(not_equal, &invoke);
616
+
617
+ stub_compiler->CheckPrototypes(holder_obj, receiver,
618
+ lookup->holder(), scratch1,
619
+ scratch2,
620
+ name,
621
+ miss_label);
622
+ if (lookup->holder()->IsGlobalObject()) {
623
+ __ movq(rdx, Operand(rsp, (argc_ + 1) * kPointerSize));
624
+ __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset));
625
+ __ movq(Operand(rsp, (argc_ + 1) * kPointerSize), rdx);
626
+ }
627
+
628
+ ASSERT(function->is_compiled());
629
+ // Get the function and setup the context.
630
+ __ Move(rdi, Handle<JSFunction>(function));
631
+ __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
632
+
633
+ // Jump to the cached code (tail call).
634
+ ASSERT(function->is_compiled());
635
+ Handle<Code> code(function->code());
636
+ ParameterCount expected(function->shared()->formal_parameter_count());
637
+ __ InvokeCode(code, expected, arguments_,
638
+ RelocInfo::CODE_TARGET, JUMP_FUNCTION);
639
+
640
+ __ bind(&invoke);
641
+ }
642
+
643
+ void CompileRegular(MacroAssembler* masm,
644
+ Register receiver,
645
+ Register holder,
646
+ Register scratch,
647
+ JSObject* holder_obj,
648
+ Label* miss_label) {
649
+ __ EnterInternalFrame();
650
+
651
+ PushInterceptorArguments(masm,
652
+ receiver,
653
+ holder,
654
+ Operand(rbp, (argc_ + 3) * kPointerSize),
655
+ holder_obj);
656
+
657
+ ExternalReference ref = ExternalReference(
658
+ IC_Utility(IC::kLoadPropertyWithInterceptorForCall));
659
+ __ movq(rax, Immediate(5));
660
+ __ movq(rbx, ref);
661
+
662
+ CEntryStub stub(1);
663
+ __ CallStub(&stub);
664
+
665
+ __ LeaveInternalFrame();
666
+ }
667
+
668
+ private:
669
+ const ParameterCount& arguments_;
670
+ int argc_;
671
+ };
672
+
673
+
674
+ #undef __
675
+
676
+ #define __ ACCESS_MASM((masm()))
677
+
678
+
679
+ Object* CallStubCompiler::CompileCallConstant(Object* object,
680
+ JSObject* holder,
681
+ JSFunction* function,
682
+ String* name,
683
+ StubCompiler::CheckType check) {
684
+ // ----------- S t a t e -------------
685
+ // -----------------------------------
686
+ // rsp[0] return address
687
+ // rsp[8] argument argc
688
+ // rsp[16] argument argc - 1
689
+ // ...
690
+ // rsp[argc * 8] argument 1
691
+ // rsp[(argc + 1) * 8] argument 0 = reciever
692
+ // rsp[(argc + 2) * 8] function name
693
+
694
+ Label miss;
695
+
696
+ // Get the receiver from the stack.
697
+ const int argc = arguments().immediate();
698
+ __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
699
+
700
+ // Check that the receiver isn't a smi.
701
+ if (check != NUMBER_CHECK) {
702
+ __ JumpIfSmi(rdx, &miss);
703
+ }
704
+
705
+ // Make sure that it's okay not to patch the on stack receiver
706
+ // unless we're doing a receiver map check.
707
+ ASSERT(!object->IsGlobalObject() || check == RECEIVER_MAP_CHECK);
708
+
709
+ switch (check) {
710
+ case RECEIVER_MAP_CHECK:
711
+ // Check that the maps haven't changed.
712
+ CheckPrototypes(JSObject::cast(object), rdx, holder,
713
+ rbx, rcx, name, &miss);
714
+
715
+ // Patch the receiver on the stack with the global proxy if
716
+ // necessary.
717
+ if (object->IsGlobalObject()) {
718
+ __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset));
719
+ __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx);
720
+ }
721
+ break;
722
+
723
+ case STRING_CHECK:
724
+ // Check that the object is a two-byte string or a symbol.
725
+ __ CmpObjectType(rdx, FIRST_NONSTRING_TYPE, rcx);
726
+ __ j(above_equal, &miss);
727
+ // Check that the maps starting from the prototype haven't changed.
728
+ GenerateLoadGlobalFunctionPrototype(masm(),
729
+ Context::STRING_FUNCTION_INDEX,
730
+ rcx);
731
+ CheckPrototypes(JSObject::cast(object->GetPrototype()), rcx, holder,
732
+ rbx, rdx, name, &miss);
733
+ break;
734
+
735
+ case NUMBER_CHECK: {
736
+ Label fast;
737
+ // Check that the object is a smi or a heap number.
738
+ __ JumpIfSmi(rdx, &fast);
739
+ __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rcx);
740
+ __ j(not_equal, &miss);
741
+ __ bind(&fast);
742
+ // Check that the maps starting from the prototype haven't changed.
743
+ GenerateLoadGlobalFunctionPrototype(masm(),
744
+ Context::NUMBER_FUNCTION_INDEX,
745
+ rcx);
746
+ CheckPrototypes(JSObject::cast(object->GetPrototype()), rcx, holder,
747
+ rbx, rdx, name, &miss);
748
+ break;
749
+ }
750
+
751
+ case BOOLEAN_CHECK: {
752
+ Label fast;
753
+ // Check that the object is a boolean.
754
+ __ CompareRoot(rdx, Heap::kTrueValueRootIndex);
755
+ __ j(equal, &fast);
756
+ __ CompareRoot(rdx, Heap::kFalseValueRootIndex);
757
+ __ j(not_equal, &miss);
758
+ __ bind(&fast);
759
+ // Check that the maps starting from the prototype haven't changed.
760
+ GenerateLoadGlobalFunctionPrototype(masm(),
761
+ Context::BOOLEAN_FUNCTION_INDEX,
762
+ rcx);
763
+ CheckPrototypes(JSObject::cast(object->GetPrototype()), rcx, holder,
764
+ rbx, rdx, name, &miss);
765
+ break;
766
+ }
767
+
768
+ case JSARRAY_HAS_FAST_ELEMENTS_CHECK:
769
+ CheckPrototypes(JSObject::cast(object), rdx, holder,
770
+ rbx, rcx, name, &miss);
771
+ // Make sure object->HasFastElements().
772
+ // Get the elements array of the object.
773
+ __ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset));
774
+ // Check that the object is in fast mode (not dictionary).
775
+ __ Cmp(FieldOperand(rbx, HeapObject::kMapOffset),
776
+ Factory::fixed_array_map());
777
+ __ j(not_equal, &miss);
778
+ break;
779
+
780
+ default:
781
+ UNREACHABLE();
782
+ }
783
+
784
+ // Get the function and setup the context.
785
+ __ Move(rdi, Handle<JSFunction>(function));
786
+ __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
787
+
788
+ // Jump to the cached code (tail call).
789
+ ASSERT(function->is_compiled());
790
+ Handle<Code> code(function->code());
791
+ ParameterCount expected(function->shared()->formal_parameter_count());
792
+ __ InvokeCode(code, expected, arguments(),
793
+ RelocInfo::CODE_TARGET, JUMP_FUNCTION);
794
+
795
+ // Handle call cache miss.
796
+ __ bind(&miss);
797
+ Handle<Code> ic = ComputeCallMiss(arguments().immediate());
798
+ __ Jump(ic, RelocInfo::CODE_TARGET);
799
+
800
+ // Return the generated code.
801
+ String* function_name = NULL;
802
+ if (function->shared()->name()->IsString()) {
803
+ function_name = String::cast(function->shared()->name());
804
+ }
805
+ return GetCode(CONSTANT_FUNCTION, function_name);
806
+ }
807
+
808
+
809
+ Object* CallStubCompiler::CompileCallField(Object* object,
810
+ JSObject* holder,
811
+ int index,
812
+ String* name) {
813
+ // ----------- S t a t e -------------
814
+ // -----------------------------------
815
+ // rsp[0] return address
816
+ // rsp[8] argument argc
817
+ // rsp[16] argument argc - 1
818
+ // ...
819
+ // rsp[argc * 8] argument 1
820
+ // rsp[(argc + 1) * 8] argument 0 = receiver
821
+ // rsp[(argc + 2) * 8] function name
822
+ Label miss;
823
+
824
+ // Get the receiver from the stack.
825
+ const int argc = arguments().immediate();
826
+ __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
827
+
828
+ // Check that the receiver isn't a smi.
829
+ __ JumpIfSmi(rdx, &miss);
830
+
831
+ // Do the right check and compute the holder register.
832
+ Register reg =
833
+ CheckPrototypes(JSObject::cast(object), rdx, holder,
834
+ rbx, rcx, name, &miss);
835
+
836
+ GenerateFastPropertyLoad(masm(), rdi, reg, holder, index);
837
+
838
+ // Check that the function really is a function.
839
+ __ JumpIfSmi(rdi, &miss);
840
+ __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rbx);
841
+ __ j(not_equal, &miss);
842
+
843
+ // Patch the receiver on the stack with the global proxy if
844
+ // necessary.
845
+ if (object->IsGlobalObject()) {
846
+ __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset));
847
+ __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx);
848
+ }
849
+
850
+ // Invoke the function.
851
+ __ InvokeFunction(rdi, arguments(), JUMP_FUNCTION);
852
+
853
+ // Handle call cache miss.
854
+ __ bind(&miss);
855
+ Handle<Code> ic = ComputeCallMiss(arguments().immediate());
856
+ __ Jump(ic, RelocInfo::CODE_TARGET);
857
+
858
+ // Return the generated code.
859
+ return GetCode(FIELD, name);
860
+ }
861
+
862
+
863
+ Object* CallStubCompiler::CompileCallInterceptor(Object* object,
864
+ JSObject* holder,
865
+ String* name) {
866
+ // ----------- S t a t e -------------
867
+ // -----------------------------------
868
+ Label miss;
869
+
870
+ // Get the number of arguments.
871
+ const int argc = arguments().immediate();
872
+
873
+ LookupResult lookup;
874
+ LookupPostInterceptor(holder, name, &lookup);
875
+
876
+ // Get the receiver from the stack.
877
+ __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
878
+
879
+ CallInterceptorCompiler compiler(arguments());
880
+ CompileLoadInterceptor(&compiler,
881
+ this,
882
+ masm(),
883
+ JSObject::cast(object),
884
+ holder,
885
+ name,
886
+ &lookup,
887
+ rdx,
888
+ rbx,
889
+ rcx,
890
+ &miss);
891
+
892
+ // Restore receiver.
893
+ __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
894
+
895
+ // Check that the function really is a function.
896
+ __ JumpIfSmi(rax, &miss);
897
+ __ CmpObjectType(rax, JS_FUNCTION_TYPE, rbx);
898
+ __ j(not_equal, &miss);
899
+
900
+ // Patch the receiver on the stack with the global proxy if
901
+ // necessary.
902
+ if (object->IsGlobalObject()) {
903
+ __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset));
904
+ __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx);
905
+ }
906
+
907
+ // Invoke the function.
908
+ __ movq(rdi, rax);
909
+ __ InvokeFunction(rdi, arguments(), JUMP_FUNCTION);
910
+
911
+ // Handle load cache miss.
912
+ __ bind(&miss);
913
+ Handle<Code> ic = ComputeCallMiss(argc);
914
+ __ Jump(ic, RelocInfo::CODE_TARGET);
915
+
916
+ // Return the generated code.
917
+ return GetCode(INTERCEPTOR, name);
918
+ }
919
+
920
+
921
+
922
+ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
923
+ GlobalObject* holder,
924
+ JSGlobalPropertyCell* cell,
925
+ JSFunction* function,
926
+ String* name) {
927
+ // ----------- S t a t e -------------
928
+ // -----------------------------------
929
+ // rsp[0] return address
930
+ // rsp[8] argument argc
931
+ // rsp[16] argument argc - 1
932
+ // ...
933
+ // rsp[argc * 8] argument 1
934
+ // rsp[(argc + 1) * 8] argument 0 = receiver
935
+ // rsp[(argc + 2) * 8] function name
936
+ Label miss;
937
+
938
+ // Get the number of arguments.
939
+ const int argc = arguments().immediate();
940
+
941
+ // Get the receiver from the stack.
942
+ __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
943
+
944
+ // If the object is the holder then we know that it's a global
945
+ // object which can only happen for contextual calls. In this case,
946
+ // the receiver cannot be a smi.
947
+ if (object != holder) {
948
+ __ JumpIfSmi(rdx, &miss);
949
+ }
950
+
951
+ // Check that the maps haven't changed.
952
+ CheckPrototypes(object, rdx, holder, rbx, rcx, name, &miss);
953
+
954
+ // Get the value from the cell.
955
+ __ Move(rdi, Handle<JSGlobalPropertyCell>(cell));
956
+ __ movq(rdi, FieldOperand(rdi, JSGlobalPropertyCell::kValueOffset));
957
+
958
+ // Check that the cell contains the same function.
959
+ if (Heap::InNewSpace(function)) {
960
+ // We can't embed a pointer to a function in new space so we have
961
+ // to verify that the shared function info is unchanged. This has
962
+ // the nice side effect that multiple closures based on the same
963
+ // function can all use this call IC. Before we load through the
964
+ // function, we have to verify that it still is a function.
965
+ __ JumpIfSmi(rdi, &miss);
966
+ __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx);
967
+ __ j(not_equal, &miss);
968
+
969
+ // Check the shared function info. Make sure it hasn't changed.
970
+ __ Move(rcx, Handle<SharedFunctionInfo>(function->shared()));
971
+ __ cmpq(FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset), rcx);
972
+ __ j(not_equal, &miss);
973
+ } else {
974
+ __ Cmp(rdi, Handle<JSFunction>(function));
975
+ __ j(not_equal, &miss);
976
+ }
977
+
978
+ // Patch the receiver on the stack with the global proxy.
979
+ if (object->IsGlobalObject()) {
980
+ __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset));
981
+ __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx);
982
+ }
983
+
984
+ // Setup the context (function already in edi).
985
+ __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
986
+
987
+ // Jump to the cached code (tail call).
988
+ __ IncrementCounter(&Counters::call_global_inline, 1);
989
+ ASSERT(function->is_compiled());
990
+ Handle<Code> code(function->code());
991
+ ParameterCount expected(function->shared()->formal_parameter_count());
992
+ __ InvokeCode(code, expected, arguments(),
993
+ RelocInfo::CODE_TARGET, JUMP_FUNCTION);
994
+
995
+ // Handle call cache miss.
996
+ __ bind(&miss);
997
+ __ IncrementCounter(&Counters::call_global_inline_miss, 1);
998
+ Handle<Code> ic = ComputeCallMiss(arguments().immediate());
999
+ __ Jump(ic, RelocInfo::CODE_TARGET);
1000
+
1001
+ // Return the generated code.
1002
+ return GetCode(NORMAL, name);
1003
+ }
1004
+
1005
+
1006
+ Object* LoadStubCompiler::CompileLoadCallback(String* name,
1007
+ JSObject* object,
1008
+ JSObject* holder,
1009
+ AccessorInfo* callback) {
1010
+ // ----------- S t a t e -------------
1011
+ // -- rcx : name
1012
+ // -- rsp[0] : return address
1013
+ // -- rsp[8] : receiver
1014
+ // -----------------------------------
1015
+ Label miss;
1016
+
1017
+ __ movq(rax, Operand(rsp, kPointerSize));
1018
+ Failure* failure = Failure::InternalError();
1019
+ bool success = GenerateLoadCallback(object, holder, rax, rcx, rbx, rdx,
1020
+ callback, name, &miss, &failure);
1021
+ if (!success) return failure;
1022
+
1023
+ __ bind(&miss);
1024
+ GenerateLoadMiss(masm(), Code::LOAD_IC);
1025
+
1026
+ // Return the generated code.
1027
+ return GetCode(CALLBACKS, name);
1028
+ }
1029
+
1030
+
1031
+ Object* LoadStubCompiler::CompileLoadConstant(JSObject* object,
1032
+ JSObject* holder,
1033
+ Object* value,
1034
+ String* name) {
1035
+ // ----------- S t a t e -------------
1036
+ // -- rcx : name
1037
+ // -- rsp[0] : return address
1038
+ // -- rsp[8] : receiver
1039
+ // -----------------------------------
1040
+ Label miss;
1041
+
1042
+ __ movq(rax, Operand(rsp, kPointerSize));
1043
+ GenerateLoadConstant(object, holder, rax, rbx, rdx, value, name, &miss);
1044
+ __ bind(&miss);
1045
+ GenerateLoadMiss(masm(), Code::LOAD_IC);
1046
+
1047
+ // Return the generated code.
1048
+ return GetCode(CONSTANT_FUNCTION, name);
1049
+ }
1050
+
1051
+
1052
+ Object* LoadStubCompiler::CompileLoadField(JSObject* object,
1053
+ JSObject* holder,
1054
+ int index,
1055
+ String* name) {
1056
+ // ----------- S t a t e -------------
1057
+ // -- rcx : name
1058
+ // -- rsp[0] : return address
1059
+ // -- rsp[8] : receiver
1060
+ // -----------------------------------
1061
+ Label miss;
1062
+
1063
+ __ movq(rax, Operand(rsp, kPointerSize));
1064
+ GenerateLoadField(object, holder, rax, rbx, rdx, index, name, &miss);
1065
+ __ bind(&miss);
1066
+ GenerateLoadMiss(masm(), Code::LOAD_IC);
1067
+
1068
+ // Return the generated code.
1069
+ return GetCode(FIELD, name);
1070
+ }
1071
+
1072
+
1073
+ Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
1074
+ JSObject* holder,
1075
+ String* name) {
1076
+ // ----------- S t a t e -------------
1077
+ // -- rcx : name
1078
+ // -- rsp[0] : return address
1079
+ // -- rsp[8] : receiver
1080
+ // -----------------------------------
1081
+ Label miss;
1082
+
1083
+ LookupResult lookup;
1084
+ LookupPostInterceptor(holder, name, &lookup);
1085
+
1086
+ __ movq(rax, Operand(rsp, kPointerSize));
1087
+ // TODO(368): Compile in the whole chain: all the interceptors in
1088
+ // prototypes and ultimate answer.
1089
+ GenerateLoadInterceptor(receiver,
1090
+ holder,
1091
+ &lookup,
1092
+ rax,
1093
+ rcx,
1094
+ rdx,
1095
+ rbx,
1096
+ name,
1097
+ &miss);
1098
+
1099
+ __ bind(&miss);
1100
+ GenerateLoadMiss(masm(), Code::LOAD_IC);
1101
+
1102
+ // Return the generated code.
1103
+ return GetCode(INTERCEPTOR, name);
1104
+ }
1105
+
1106
+
1107
+ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
1108
+ GlobalObject* holder,
1109
+ JSGlobalPropertyCell* cell,
1110
+ String* name,
1111
+ bool is_dont_delete) {
1112
+ // ----------- S t a t e -------------
1113
+ // -- rcx : name
1114
+ // -- rsp[0] : return address
1115
+ // -- rsp[8] : receiver
1116
+ // -----------------------------------
1117
+ Label miss;
1118
+
1119
+ // Get the receiver from the stack.
1120
+ __ movq(rax, Operand(rsp, kPointerSize));
1121
+
1122
+ // If the object is the holder then we know that it's a global
1123
+ // object which can only happen for contextual loads. In this case,
1124
+ // the receiver cannot be a smi.
1125
+ if (object != holder) {
1126
+ __ JumpIfSmi(rax, &miss);
1127
+ }
1128
+
1129
+ // Check that the maps haven't changed.
1130
+ CheckPrototypes(object, rax, holder, rbx, rdx, name, &miss);
1131
+
1132
+ // Get the value from the cell.
1133
+ __ Move(rax, Handle<JSGlobalPropertyCell>(cell));
1134
+ __ movq(rax, FieldOperand(rax, JSGlobalPropertyCell::kValueOffset));
1135
+
1136
+ // Check for deleted property if property can actually be deleted.
1137
+ if (!is_dont_delete) {
1138
+ __ CompareRoot(rax, Heap::kTheHoleValueRootIndex);
1139
+ __ j(equal, &miss);
1140
+ } else if (FLAG_debug_code) {
1141
+ __ CompareRoot(rax, Heap::kTheHoleValueRootIndex);
1142
+ __ Check(not_equal, "DontDelete cells can't contain the hole");
1143
+ }
1144
+
1145
+ __ IncrementCounter(&Counters::named_load_global_inline, 1);
1146
+ __ ret(0);
1147
+
1148
+ __ bind(&miss);
1149
+ __ IncrementCounter(&Counters::named_load_global_inline_miss, 1);
1150
+ GenerateLoadMiss(masm(), Code::LOAD_IC);
1151
+
1152
+ // Return the generated code.
1153
+ return GetCode(NORMAL, name);
1154
+ }
1155
+
1156
+
1157
+ Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
1158
+ JSObject* receiver,
1159
+ JSObject* holder,
1160
+ AccessorInfo* callback) {
1161
+ // ----------- S t a t e -------------
1162
+ // -- rsp[0] : return address
1163
+ // -- rsp[8] : name
1164
+ // -- rsp[16] : receiver
1165
+ // -----------------------------------
1166
+ Label miss;
1167
+
1168
+ __ movq(rax, Operand(rsp, kPointerSize));
1169
+ __ movq(rcx, Operand(rsp, 2 * kPointerSize));
1170
+ __ IncrementCounter(&Counters::keyed_load_callback, 1);
1171
+
1172
+ // Check that the name has not changed.
1173
+ __ Cmp(rax, Handle<String>(name));
1174
+ __ j(not_equal, &miss);
1175
+
1176
+ Failure* failure = Failure::InternalError();
1177
+ bool success = GenerateLoadCallback(receiver, holder, rcx, rax, rbx, rdx,
1178
+ callback, name, &miss, &failure);
1179
+ if (!success) return failure;
1180
+
1181
+ __ bind(&miss);
1182
+ __ DecrementCounter(&Counters::keyed_load_callback, 1);
1183
+ GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1184
+
1185
+ // Return the generated code.
1186
+ return GetCode(CALLBACKS, name);
1187
+ }
1188
+
1189
+
1190
+ Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
1191
+ // ----------- S t a t e -------------
1192
+ // -- rsp[0] : return address
1193
+ // -- rsp[8] : name
1194
+ // -- rsp[16] : receiver
1195
+ // -----------------------------------
1196
+ Label miss;
1197
+
1198
+ __ movq(rax, Operand(rsp, kPointerSize));
1199
+ __ movq(rcx, Operand(rsp, 2 * kPointerSize));
1200
+ __ IncrementCounter(&Counters::keyed_load_array_length, 1);
1201
+
1202
+ // Check that the name has not changed.
1203
+ __ Cmp(rax, Handle<String>(name));
1204
+ __ j(not_equal, &miss);
1205
+
1206
+ GenerateLoadArrayLength(masm(), rcx, rdx, &miss);
1207
+ __ bind(&miss);
1208
+ __ DecrementCounter(&Counters::keyed_load_array_length, 1);
1209
+ GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1210
+
1211
+ // Return the generated code.
1212
+ return GetCode(CALLBACKS, name);
1213
+ }
1214
+
1215
+
1216
+ Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
1217
+ JSObject* receiver,
1218
+ JSObject* holder,
1219
+ Object* value) {
1220
+ // ----------- S t a t e -------------
1221
+ // -- rsp[0] : return address
1222
+ // -- rsp[8] : name
1223
+ // -- rsp[16] : receiver
1224
+ // -----------------------------------
1225
+ Label miss;
1226
+
1227
+ __ movq(rax, Operand(rsp, kPointerSize));
1228
+ __ movq(rcx, Operand(rsp, 2 * kPointerSize));
1229
+ __ IncrementCounter(&Counters::keyed_load_constant_function, 1);
1230
+
1231
+ // Check that the name has not changed.
1232
+ __ Cmp(rax, Handle<String>(name));
1233
+ __ j(not_equal, &miss);
1234
+
1235
+ GenerateLoadConstant(receiver, holder, rcx, rbx, rdx,
1236
+ value, name, &miss);
1237
+ __ bind(&miss);
1238
+ __ DecrementCounter(&Counters::keyed_load_constant_function, 1);
1239
+ GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1240
+
1241
+ // Return the generated code.
1242
+ return GetCode(CONSTANT_FUNCTION, name);
1243
+ }
1244
+
1245
+
1246
+ Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
1247
+ // ----------- S t a t e -------------
1248
+ // -- rsp[0] : return address
1249
+ // -- rsp[8] : name
1250
+ // -- rsp[16] : receiver
1251
+ // -----------------------------------
1252
+ Label miss;
1253
+
1254
+ __ movq(rax, Operand(rsp, kPointerSize));
1255
+ __ movq(rcx, Operand(rsp, 2 * kPointerSize));
1256
+ __ IncrementCounter(&Counters::keyed_load_function_prototype, 1);
1257
+
1258
+ // Check that the name has not changed.
1259
+ __ Cmp(rax, Handle<String>(name));
1260
+ __ j(not_equal, &miss);
1261
+
1262
+ GenerateLoadFunctionPrototype(masm(), rcx, rdx, rbx, &miss);
1263
+ __ bind(&miss);
1264
+ __ DecrementCounter(&Counters::keyed_load_function_prototype, 1);
1265
+ GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1266
+
1267
+ // Return the generated code.
1268
+ return GetCode(CALLBACKS, name);
1269
+ }
1270
+
1271
+
1272
+ Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
1273
+ JSObject* holder,
1274
+ String* name) {
1275
+ // ----------- S t a t e -------------
1276
+ // -- rsp[0] : return address
1277
+ // -- rsp[8] : name
1278
+ // -- rsp[16] : receiver
1279
+ // -----------------------------------
1280
+ Label miss;
1281
+
1282
+ __ movq(rax, Operand(rsp, kPointerSize));
1283
+ __ movq(rcx, Operand(rsp, 2 * kPointerSize));
1284
+ __ IncrementCounter(&Counters::keyed_load_interceptor, 1);
1285
+
1286
+ // Check that the name has not changed.
1287
+ __ Cmp(rax, Handle<String>(name));
1288
+ __ j(not_equal, &miss);
1289
+
1290
+ LookupResult lookup;
1291
+ LookupPostInterceptor(holder, name, &lookup);
1292
+ GenerateLoadInterceptor(receiver,
1293
+ holder,
1294
+ &lookup,
1295
+ rcx,
1296
+ rax,
1297
+ rdx,
1298
+ rbx,
1299
+ name,
1300
+ &miss);
1301
+ __ bind(&miss);
1302
+ __ DecrementCounter(&Counters::keyed_load_interceptor, 1);
1303
+ GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1304
+
1305
+ // Return the generated code.
1306
+ return GetCode(INTERCEPTOR, name);
1307
+ }
1308
+
1309
+
1310
+ Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
1311
+ // ----------- S t a t e -------------
1312
+ // -- rsp[0] : return address
1313
+ // -- rsp[8] : name
1314
+ // -- rsp[16] : receiver
1315
+ // -----------------------------------
1316
+ Label miss;
1317
+
1318
+ __ movq(rax, Operand(rsp, kPointerSize));
1319
+ __ movq(rcx, Operand(rsp, 2 * kPointerSize));
1320
+ __ IncrementCounter(&Counters::keyed_load_string_length, 1);
1321
+
1322
+ // Check that the name has not changed.
1323
+ __ Cmp(rax, Handle<String>(name));
1324
+ __ j(not_equal, &miss);
1325
+
1326
+ GenerateLoadStringLength(masm(), rcx, rdx, &miss);
1327
+ __ bind(&miss);
1328
+ __ DecrementCounter(&Counters::keyed_load_string_length, 1);
1329
+ GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1330
+
1331
+ // Return the generated code.
1332
+ return GetCode(CALLBACKS, name);
1333
+ }
1334
+
1335
+
1336
+ Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
1337
+ AccessorInfo* callback,
1338
+ String* name) {
1339
+ // ----------- S t a t e -------------
1340
+ // -- rax : value
1341
+ // -- rcx : name
1342
+ // -- rsp[0] : return address
1343
+ // -- rsp[8] : receiver
1344
+ // -----------------------------------
1345
+ Label miss;
1346
+
1347
+ // Get the object from the stack.
1348
+ __ movq(rbx, Operand(rsp, 1 * kPointerSize));
1349
+
1350
+ // Check that the object isn't a smi.
1351
+ __ JumpIfSmi(rbx, &miss);
1352
+
1353
+ // Check that the map of the object hasn't changed.
1354
+ __ Cmp(FieldOperand(rbx, HeapObject::kMapOffset),
1355
+ Handle<Map>(object->map()));
1356
+ __ j(not_equal, &miss);
1357
+
1358
+ // Perform global security token check if needed.
1359
+ if (object->IsJSGlobalProxy()) {
1360
+ __ CheckAccessGlobalProxy(rbx, rdx, &miss);
1361
+ }
1362
+
1363
+ // Stub never generated for non-global objects that require access
1364
+ // checks.
1365
+ ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
1366
+
1367
+ __ pop(rbx); // remove the return address
1368
+ __ push(Operand(rsp, 0)); // receiver
1369
+ __ Push(Handle<AccessorInfo>(callback)); // callback info
1370
+ __ push(rcx); // name
1371
+ __ push(rax); // value
1372
+ __ push(rbx); // restore return address
1373
+
1374
+ // Do tail-call to the runtime system.
1375
+ ExternalReference store_callback_property =
1376
+ ExternalReference(IC_Utility(IC::kStoreCallbackProperty));
1377
+ __ TailCallRuntime(store_callback_property, 4, 1);
1378
+
1379
+ // Handle store cache miss.
1380
+ __ bind(&miss);
1381
+ __ Move(rcx, Handle<String>(name)); // restore name
1382
+ Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
1383
+ __ Jump(ic, RelocInfo::CODE_TARGET);
1384
+
1385
+ // Return the generated code.
1386
+ return GetCode(CALLBACKS, name);
1387
+ }
1388
+
1389
+
1390
+ Object* StoreStubCompiler::CompileStoreField(JSObject* object,
1391
+ int index,
1392
+ Map* transition,
1393
+ String* name) {
1394
+ // ----------- S t a t e -------------
1395
+ // -- rax : value
1396
+ // -- rcx : name
1397
+ // -- rsp[0] : return address
1398
+ // -- rsp[8] : receiver
1399
+ // -----------------------------------
1400
+ Label miss;
1401
+
1402
+ // Get the object from the stack.
1403
+ __ movq(rbx, Operand(rsp, 1 * kPointerSize));
1404
+
1405
+ // Generate store field code. Trashes the name register.
1406
+ GenerateStoreField(masm(),
1407
+ Builtins::StoreIC_ExtendStorage,
1408
+ object,
1409
+ index,
1410
+ transition,
1411
+ rbx, rcx, rdx,
1412
+ &miss);
1413
+
1414
+ // Handle store cache miss.
1415
+ __ bind(&miss);
1416
+ __ Move(rcx, Handle<String>(name)); // restore name
1417
+ Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
1418
+ __ Jump(ic, RelocInfo::CODE_TARGET);
1419
+
1420
+ // Return the generated code.
1421
+ return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name);
1422
+ }
1423
+
1424
+
1425
+ Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
1426
+ String* name) {
1427
+ // ----------- S t a t e -------------
1428
+ // -- rax : value
1429
+ // -- rcx : name
1430
+ // -- rsp[0] : return address
1431
+ // -- rsp[8] : receiver
1432
+ // -----------------------------------
1433
+ Label miss;
1434
+
1435
+ // Get the object from the stack.
1436
+ __ movq(rbx, Operand(rsp, 1 * kPointerSize));
1437
+
1438
+ // Check that the object isn't a smi.
1439
+ __ JumpIfSmi(rbx, &miss);
1440
+
1441
+ // Check that the map of the object hasn't changed.
1442
+ __ Cmp(FieldOperand(rbx, HeapObject::kMapOffset),
1443
+ Handle<Map>(receiver->map()));
1444
+ __ j(not_equal, &miss);
1445
+
1446
+ // Perform global security token check if needed.
1447
+ if (receiver->IsJSGlobalProxy()) {
1448
+ __ CheckAccessGlobalProxy(rbx, rdx, &miss);
1449
+ }
1450
+
1451
+ // Stub never generated for non-global objects that require access
1452
+ // checks.
1453
+ ASSERT(receiver->IsJSGlobalProxy() || !receiver->IsAccessCheckNeeded());
1454
+
1455
+ __ pop(rbx); // remove the return address
1456
+ __ push(Operand(rsp, 0)); // receiver
1457
+ __ push(rcx); // name
1458
+ __ push(rax); // value
1459
+ __ push(rbx); // restore return address
1460
+
1461
+ // Do tail-call to the runtime system.
1462
+ ExternalReference store_ic_property =
1463
+ ExternalReference(IC_Utility(IC::kStoreInterceptorProperty));
1464
+ __ TailCallRuntime(store_ic_property, 3, 1);
1465
+
1466
+ // Handle store cache miss.
1467
+ __ bind(&miss);
1468
+ __ Move(rcx, Handle<String>(name)); // restore name
1469
+ Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
1470
+ __ Jump(ic, RelocInfo::CODE_TARGET);
1471
+
1472
+ // Return the generated code.
1473
+ return GetCode(INTERCEPTOR, name);
1474
+ }
1475
+
1476
+
1477
+ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
1478
+ JSGlobalPropertyCell* cell,
1479
+ String* name) {
1480
+ // ----------- S t a t e -------------
1481
+ // -- rax : value
1482
+ // -- rcx : name
1483
+ // -- rsp[0] : return address
1484
+ // -- rsp[8] : receiver
1485
+ // -----------------------------------
1486
+ Label miss;
1487
+
1488
+ // Check that the map of the global has not changed.
1489
+ __ movq(rbx, Operand(rsp, kPointerSize));
1490
+ __ Cmp(FieldOperand(rbx, HeapObject::kMapOffset),
1491
+ Handle<Map>(object->map()));
1492
+ __ j(not_equal, &miss);
1493
+
1494
+ // Store the value in the cell.
1495
+ __ Move(rcx, Handle<JSGlobalPropertyCell>(cell));
1496
+ __ movq(FieldOperand(rcx, JSGlobalPropertyCell::kValueOffset), rax);
1497
+
1498
+ // Return the value (register rax).
1499
+ __ IncrementCounter(&Counters::named_store_global_inline, 1);
1500
+ __ ret(0);
1501
+
1502
+ // Handle store cache miss.
1503
+ __ bind(&miss);
1504
+ __ IncrementCounter(&Counters::named_store_global_inline_miss, 1);
1505
+ Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
1506
+ __ Jump(ic, RelocInfo::CODE_TARGET);
1507
+
1508
+ // Return the generated code.
1509
+ return GetCode(NORMAL, name);
1510
+ }
1511
+
1512
+
1513
+ Object* KeyedLoadStubCompiler::CompileLoadField(String* name,
1514
+ JSObject* receiver,
1515
+ JSObject* holder,
1516
+ int index) {
1517
+ // ----------- S t a t e -------------
1518
+ // -- rsp[0] : return address
1519
+ // -- rsp[8] : name
1520
+ // -- rsp[16] : receiver
1521
+ // -----------------------------------
1522
+ Label miss;
1523
+
1524
+ __ movq(rax, Operand(rsp, kPointerSize));
1525
+ __ movq(rcx, Operand(rsp, 2 * kPointerSize));
1526
+ __ IncrementCounter(&Counters::keyed_load_field, 1);
1527
+
1528
+ // Check that the name has not changed.
1529
+ __ Cmp(rax, Handle<String>(name));
1530
+ __ j(not_equal, &miss);
1531
+
1532
+ GenerateLoadField(receiver, holder, rcx, rbx, rdx, index, name, &miss);
1533
+
1534
+ __ bind(&miss);
1535
+ __ DecrementCounter(&Counters::keyed_load_field, 1);
1536
+ GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1537
+
1538
+ // Return the generated code.
1539
+ return GetCode(FIELD, name);
1540
+ }
1541
+
1542
+
1543
+ Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
1544
+ int index,
1545
+ Map* transition,
1546
+ String* name) {
1547
+ // ----------- S t a t e -------------
1548
+ // -- rax : value
1549
+ // -- rsp[0] : return address
1550
+ // -- rsp[8] : key
1551
+ // -- rsp[16] : receiver
1552
+ // -----------------------------------
1553
+ Label miss;
1554
+
1555
+ __ IncrementCounter(&Counters::keyed_store_field, 1);
1556
+
1557
+ // Get the name from the stack.
1558
+ __ movq(rcx, Operand(rsp, 1 * kPointerSize));
1559
+ // Check that the name has not changed.
1560
+ __ Cmp(rcx, Handle<String>(name));
1561
+ __ j(not_equal, &miss);
1562
+
1563
+ // Get the object from the stack.
1564
+ __ movq(rbx, Operand(rsp, 2 * kPointerSize));
1565
+
1566
+ // Generate store field code. Trashes the name register.
1567
+ GenerateStoreField(masm(),
1568
+ Builtins::KeyedStoreIC_ExtendStorage,
1569
+ object,
1570
+ index,
1571
+ transition,
1572
+ rbx, rcx, rdx,
1573
+ &miss);
1574
+
1575
+ // Handle store cache miss.
1576
+ __ bind(&miss);
1577
+ __ DecrementCounter(&Counters::keyed_store_field, 1);
1578
+ Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss));
1579
+ __ Jump(ic, RelocInfo::CODE_TARGET);
1580
+
1581
+ // Return the generated code.
1582
+ return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name);
1583
+ }
1584
+
1585
+
1586
+ // TODO(1241006): Avoid having lazy compile stubs specialized by the
1587
+ // number of arguments. It is not needed anymore.
1588
+ Object* StubCompiler::CompileLazyCompile(Code::Flags flags) {
1589
+ // Enter an internal frame.
1590
+ __ EnterInternalFrame();
1591
+
1592
+ // Push a copy of the function onto the stack.
1593
+ __ push(rdi);
1594
+
1595
+ __ push(rdi); // function is also the parameter to the runtime call
1596
+ __ CallRuntime(Runtime::kLazyCompile, 1);
1597
+ __ pop(rdi);
1598
+
1599
+ // Tear down temporary frame.
1600
+ __ LeaveInternalFrame();
1601
+
1602
+ // Do a tail-call of the compiled function.
1603
+ __ lea(rcx, FieldOperand(rax, Code::kHeaderSize));
1604
+ __ jmp(rcx);
1605
+
1606
+ return GetCodeWithFlags(flags, "LazyCompileStub");
1607
+ }
1608
+
1609
+
1610
+
1611
+ void StubCompiler::GenerateLoadInterceptor(JSObject* object,
1612
+ JSObject* holder,
1613
+ LookupResult* lookup,
1614
+ Register receiver,
1615
+ Register name_reg,
1616
+ Register scratch1,
1617
+ Register scratch2,
1618
+ String* name,
1619
+ Label* miss) {
1620
+ LoadInterceptorCompiler compiler(name_reg);
1621
+ CompileLoadInterceptor(&compiler,
1622
+ this,
1623
+ masm(),
1624
+ object,
1625
+ holder,
1626
+ name,
1627
+ lookup,
1628
+ receiver,
1629
+ scratch1,
1630
+ scratch2,
1631
+ miss);
1632
+ }
1633
+
1634
+
1635
+ bool StubCompiler::GenerateLoadCallback(JSObject* object,
1636
+ JSObject* holder,
1637
+ Register receiver,
1638
+ Register name_reg,
1639
+ Register scratch1,
1640
+ Register scratch2,
1641
+ AccessorInfo* callback,
1642
+ String* name,
1643
+ Label* miss,
1644
+ Failure** failure) {
1645
+ // Check that the receiver isn't a smi.
1646
+ __ JumpIfSmi(receiver, miss);
1647
+
1648
+ // Check that the maps haven't changed.
1649
+ Register reg =
1650
+ CheckPrototypes(object, receiver, holder,
1651
+ scratch1, scratch2, name, miss);
1652
+
1653
+ // Push the arguments on the JS stack of the caller.
1654
+ __ pop(scratch2); // remove return address
1655
+ __ push(receiver); // receiver
1656
+ __ push(reg); // holder
1657
+ __ Move(reg, Handle<AccessorInfo>(callback)); // callback data
1658
+ __ push(reg);
1659
+ __ push(FieldOperand(reg, AccessorInfo::kDataOffset));
1660
+ __ push(name_reg); // name
1661
+ __ push(scratch2); // restore return address
1662
+
1663
+ // Do tail-call to the runtime system.
1664
+ ExternalReference load_callback_property =
1665
+ ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
1666
+ __ TailCallRuntime(load_callback_property, 5, 1);
1667
+
1668
+ return true;
1669
+ }
1670
+
1671
+
1672
+ Register StubCompiler::CheckPrototypes(JSObject* object,
1673
+ Register object_reg,
1674
+ JSObject* holder,
1675
+ Register holder_reg,
1676
+ Register scratch,
1677
+ String* name,
1678
+ Label* miss) {
1679
+ // Check that the maps haven't changed.
1680
+ Register result =
1681
+ __ CheckMaps(object, object_reg, holder, holder_reg, scratch, miss);
1682
+
1683
+ // If we've skipped any global objects, it's not enough to verify
1684
+ // that their maps haven't changed.
1685
+ while (object != holder) {
1686
+ if (object->IsGlobalObject()) {
1687
+ GlobalObject* global = GlobalObject::cast(object);
1688
+ Object* probe = global->EnsurePropertyCell(name);
1689
+ if (probe->IsFailure()) {
1690
+ set_failure(Failure::cast(probe));
1691
+ return result;
1692
+ }
1693
+ JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(probe);
1694
+ ASSERT(cell->value()->IsTheHole());
1695
+ __ Move(scratch, Handle<Object>(cell));
1696
+ __ Cmp(FieldOperand(scratch, JSGlobalPropertyCell::kValueOffset),
1697
+ Factory::the_hole_value());
1698
+ __ j(not_equal, miss);
1699
+ }
1700
+ object = JSObject::cast(object->GetPrototype());
1701
+ }
1702
+
1703
+ // Return the register containing the holder.
1704
+ return result;
1705
+ }
1706
+
1707
+
1708
+ void StubCompiler::GenerateLoadField(JSObject* object,
1709
+ JSObject* holder,
1710
+ Register receiver,
1711
+ Register scratch1,
1712
+ Register scratch2,
1713
+ int index,
1714
+ String* name,
1715
+ Label* miss) {
1716
+ // Check that the receiver isn't a smi.
1717
+ __ JumpIfSmi(receiver, miss);
1718
+
1719
+ // Check the prototype chain.
1720
+ Register reg =
1721
+ CheckPrototypes(object, receiver, holder,
1722
+ scratch1, scratch2, name, miss);
1723
+
1724
+ // Get the value from the properties.
1725
+ GenerateFastPropertyLoad(masm(), rax, reg, holder, index);
1726
+ __ ret(0);
1727
+ }
1728
+
1729
+
1730
+ void StubCompiler::GenerateLoadConstant(JSObject* object,
1731
+ JSObject* holder,
1732
+ Register receiver,
1733
+ Register scratch1,
1734
+ Register scratch2,
1735
+ Object* value,
1736
+ String* name,
1737
+ Label* miss) {
1738
+ // Check that the receiver isn't a smi.
1739
+ __ JumpIfSmi(receiver, miss);
1740
+
1741
+ // Check that the maps haven't changed.
1742
+ Register reg =
1743
+ CheckPrototypes(object, receiver, holder,
1744
+ scratch1, scratch2, name, miss);
1745
+
1746
+ // Return the constant value.
1747
+ __ Move(rax, Handle<Object>(value));
1748
+ __ ret(0);
1749
+ }
1750
+
1751
+
1752
+ // Specialized stub for constructing objects from functions which only have only
1753
+ // simple assignments of the form this.x = ...; in their body.
1754
+ Object* ConstructStubCompiler::CompileConstructStub(
1755
+ SharedFunctionInfo* shared) {
1756
+ // ----------- S t a t e -------------
1757
+ // -- rax : argc
1758
+ // -- rdi : constructor
1759
+ // -- rsp[0] : return address
1760
+ // -- rsp[4] : last argument
1761
+ // -----------------------------------
1762
+ Label generic_stub_call;
1763
+
1764
+ // Use r8 for holding undefined which is used in several places below.
1765
+ __ Move(r8, Factory::undefined_value());
1766
+
1767
+ #ifdef ENABLE_DEBUGGER_SUPPORT
1768
+ // Check to see whether there are any break points in the function code. If
1769
+ // there are jump to the generic constructor stub which calls the actual
1770
+ // code for the function thereby hitting the break points.
1771
+ __ movq(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
1772
+ __ movq(rbx, FieldOperand(rbx, SharedFunctionInfo::kDebugInfoOffset));
1773
+ __ cmpq(rbx, r8);
1774
+ __ j(not_equal, &generic_stub_call);
1775
+ #endif
1776
+
1777
+ // Load the initial map and verify that it is in fact a map.
1778
+ __ movq(rbx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
1779
+ // Will both indicate a NULL and a Smi.
1780
+ ASSERT(kSmiTag == 0);
1781
+ __ JumpIfSmi(rbx, &generic_stub_call);
1782
+ __ CmpObjectType(rbx, MAP_TYPE, rcx);
1783
+ __ j(not_equal, &generic_stub_call);
1784
+
1785
+ #ifdef DEBUG
1786
+ // Cannot construct functions this way.
1787
+ // rdi: constructor
1788
+ // rbx: initial map
1789
+ __ CmpInstanceType(rbx, JS_FUNCTION_TYPE);
1790
+ __ Assert(not_equal, "Function constructed by construct stub.");
1791
+ #endif
1792
+
1793
+ // Now allocate the JSObject in new space.
1794
+ // rdi: constructor
1795
+ // rbx: initial map
1796
+ __ movzxbq(rcx, FieldOperand(rbx, Map::kInstanceSizeOffset));
1797
+ __ shl(rcx, Immediate(kPointerSizeLog2));
1798
+ __ AllocateInNewSpace(rcx,
1799
+ rdx,
1800
+ rcx,
1801
+ no_reg,
1802
+ &generic_stub_call,
1803
+ NO_ALLOCATION_FLAGS);
1804
+
1805
+ // Allocated the JSObject, now initialize the fields and add the heap tag.
1806
+ // rbx: initial map
1807
+ // rdx: JSObject (untagged)
1808
+ __ movq(Operand(rdx, JSObject::kMapOffset), rbx);
1809
+ __ Move(rbx, Factory::empty_fixed_array());
1810
+ __ movq(Operand(rdx, JSObject::kPropertiesOffset), rbx);
1811
+ __ movq(Operand(rdx, JSObject::kElementsOffset), rbx);
1812
+
1813
+ // rax: argc
1814
+ // rdx: JSObject (untagged)
1815
+ // Load the address of the first in-object property into r9.
1816
+ __ lea(r9, Operand(rdx, JSObject::kHeaderSize));
1817
+ // Calculate the location of the first argument. The stack contains only the
1818
+ // return address on top of the argc arguments.
1819
+ __ lea(rcx, Operand(rsp, rax, times_pointer_size, 0));
1820
+
1821
+ // rax: argc
1822
+ // rcx: first argument
1823
+ // rdx: JSObject (untagged)
1824
+ // r8: undefined
1825
+ // r9: first in-object property of the JSObject
1826
+ // Fill the initialized properties with a constant value or a passed argument
1827
+ // depending on the this.x = ...; assignment in the function.
1828
+ for (int i = 0; i < shared->this_property_assignments_count(); i++) {
1829
+ if (shared->IsThisPropertyAssignmentArgument(i)) {
1830
+ // Check if the argument assigned to the property is actually passed.
1831
+ // If argument is not passed the property is set to undefined,
1832
+ // otherwise find it on the stack.
1833
+ int arg_number = shared->GetThisPropertyAssignmentArgument(i);
1834
+ __ movq(rbx, r8);
1835
+ __ cmpq(rax, Immediate(arg_number));
1836
+ __ cmovq(above, rbx, Operand(rcx, arg_number * -kPointerSize));
1837
+ // Store value in the property.
1838
+ __ movq(Operand(r9, i * kPointerSize), rbx);
1839
+ } else {
1840
+ // Set the property to the constant value.
1841
+ Handle<Object> constant(shared->GetThisPropertyAssignmentConstant(i));
1842
+ __ Move(Operand(r9, i * kPointerSize), constant);
1843
+ }
1844
+ }
1845
+
1846
+ // Fill the unused in-object property fields with undefined.
1847
+ for (int i = shared->this_property_assignments_count();
1848
+ i < shared->CalculateInObjectProperties();
1849
+ i++) {
1850
+ __ movq(Operand(r9, i * kPointerSize), r8);
1851
+ }
1852
+
1853
+ // rax: argc
1854
+ // rdx: JSObject (untagged)
1855
+ // Move argc to rbx and the JSObject to return to rax and tag it.
1856
+ __ movq(rbx, rax);
1857
+ __ movq(rax, rdx);
1858
+ __ or_(rax, Immediate(kHeapObjectTag));
1859
+
1860
+ // rax: JSObject
1861
+ // rbx: argc
1862
+ // Remove caller arguments and receiver from the stack and return.
1863
+ __ pop(rcx);
1864
+ __ lea(rsp, Operand(rsp, rbx, times_pointer_size, 1 * kPointerSize));
1865
+ __ push(rcx);
1866
+ __ IncrementCounter(&Counters::constructed_objects, 1);
1867
+ __ IncrementCounter(&Counters::constructed_objects_stub, 1);
1868
+ __ ret(0);
1869
+
1870
+ // Jump to the generic stub in case the specialized code cannot handle the
1871
+ // construction.
1872
+ __ bind(&generic_stub_call);
1873
+ Code* code = Builtins::builtin(Builtins::JSConstructStubGeneric);
1874
+ Handle<Code> generic_construct_stub(code);
1875
+ __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET);
1876
+
1877
+ // Return the generated code.
1878
+ return GetCode();
1879
+ }
1880
+
1881
+
1882
+ #undef __
1883
+
1884
+ } } // namespace v8::internal