therubyracer 0.8.1.pre2 → 0.8.1

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 (877) hide show
  1. data/Changelog.md +2 -1
  2. data/README.md +6 -3
  3. data/ext/v8/upstream/3.1.8/.gitignore +31 -0
  4. data/ext/v8/upstream/3.1.8/AUTHORS +40 -0
  5. data/ext/v8/upstream/3.1.8/ChangeLog +2566 -0
  6. data/ext/v8/upstream/3.1.8/LICENSE +52 -0
  7. data/ext/v8/upstream/3.1.8/LICENSE.strongtalk +29 -0
  8. data/ext/v8/upstream/3.1.8/LICENSE.v8 +26 -0
  9. data/ext/v8/upstream/3.1.8/LICENSE.valgrind +45 -0
  10. data/ext/v8/upstream/3.1.8/SConstruct +1192 -0
  11. data/ext/v8/upstream/3.1.8/build/README.txt +25 -0
  12. data/ext/v8/upstream/3.1.8/build/all.gyp +18 -0
  13. data/ext/v8/upstream/3.1.8/build/armu.gypi +32 -0
  14. data/ext/v8/upstream/3.1.8/build/common.gypi +82 -0
  15. data/ext/v8/upstream/3.1.8/build/gyp_v8 +145 -0
  16. data/ext/v8/upstream/3.1.8/include/v8-debug.h +384 -0
  17. data/ext/v8/upstream/3.1.8/include/v8-preparser.h +116 -0
  18. data/ext/v8/upstream/3.1.8/include/v8-profiler.h +426 -0
  19. data/ext/v8/upstream/3.1.8/include/v8-testing.h +99 -0
  20. data/ext/v8/upstream/3.1.8/include/v8.h +3846 -0
  21. data/ext/v8/upstream/3.1.8/include/v8stdint.h +53 -0
  22. data/ext/v8/upstream/3.1.8/preparser/preparser-process.cc +206 -0
  23. data/ext/v8/upstream/3.1.8/src/SConscript +356 -0
  24. data/ext/v8/upstream/3.1.8/src/accessors.cc +907 -0
  25. data/ext/v8/upstream/3.1.8/src/accessors.h +121 -0
  26. data/ext/v8/upstream/3.1.8/src/allocation.cc +204 -0
  27. data/ext/v8/upstream/3.1.8/src/allocation.h +176 -0
  28. data/ext/v8/upstream/3.1.8/src/api.cc +5191 -0
  29. data/ext/v8/upstream/3.1.8/src/api.h +508 -0
  30. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/apinatives.js +0 -0
  31. data/ext/v8/upstream/3.1.8/src/apiutils.h +80 -0
  32. data/ext/v8/upstream/3.1.8/src/arguments.h +105 -0
  33. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm-inl.h +352 -0
  34. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.cc +2756 -0
  35. data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.h +1294 -0
  36. data/ext/v8/upstream/3.1.8/src/arm/builtins-arm.cc +1628 -0
  37. data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.cc +6783 -0
  38. data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.h +657 -0
  39. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm-inl.h +48 -0
  40. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.cc +7403 -0
  41. data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.h +595 -0
  42. data/ext/v8/upstream/3.1.8/src/arm/constants-arm.cc +152 -0
  43. data/ext/v8/upstream/3.1.8/src/arm/constants-arm.h +769 -0
  44. data/ext/v8/upstream/3.1.8/src/arm/cpu-arm.cc +147 -0
  45. data/ext/v8/upstream/3.1.8/src/arm/debug-arm.cc +315 -0
  46. data/ext/v8/upstream/3.1.8/src/arm/deoptimizer-arm.cc +700 -0
  47. data/ext/v8/upstream/3.1.8/src/arm/disasm-arm.cc +1439 -0
  48. data/ext/v8/upstream/3.1.8/src/arm/frames-arm.cc +45 -0
  49. data/ext/v8/upstream/3.1.8/src/arm/frames-arm.h +168 -0
  50. data/ext/v8/upstream/3.1.8/src/arm/full-codegen-arm.cc +4230 -0
  51. data/ext/v8/upstream/3.1.8/src/arm/ic-arm.cc +1799 -0
  52. data/ext/v8/upstream/3.1.8/src/arm/jump-target-arm.cc +174 -0
  53. data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.cc +2041 -0
  54. data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.h +2046 -0
  55. data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.cc +3822 -0
  56. data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.h +312 -0
  57. data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.cc +303 -0
  58. data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.h +84 -0
  59. data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.cc +2701 -0
  60. data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.h +1015 -0
  61. data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.cc +1280 -0
  62. data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.h +252 -0
  63. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm-inl.h +0 -0
  64. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm.cc +0 -0
  65. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm.h +0 -0
  66. data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.cc +3165 -0
  67. data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.h +402 -0
  68. data/ext/v8/upstream/3.1.8/src/arm/stub-cache-arm.cc +4077 -0
  69. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/virtual-frame-arm-inl.h +0 -0
  70. data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.cc +843 -0
  71. data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.h +520 -0
  72. data/ext/v8/upstream/3.1.8/src/array.js +1231 -0
  73. data/ext/v8/upstream/3.1.8/src/assembler.cc +973 -0
  74. data/ext/v8/upstream/3.1.8/src/assembler.h +787 -0
  75. data/ext/v8/upstream/3.1.8/src/ast-inl.h +107 -0
  76. data/ext/v8/upstream/3.1.8/src/ast.cc +1067 -0
  77. data/ext/v8/upstream/3.1.8/src/ast.h +2177 -0
  78. data/ext/v8/upstream/3.1.8/src/atomicops.h +165 -0
  79. data/ext/v8/upstream/3.1.8/src/atomicops_internals_arm_gcc.h +145 -0
  80. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_gcc.cc +126 -0
  81. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_gcc.h +287 -0
  82. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_macosx.h +301 -0
  83. data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_msvc.h +203 -0
  84. data/ext/v8/upstream/3.1.8/src/bignum-dtoa.cc +655 -0
  85. data/ext/v8/upstream/3.1.8/src/bignum-dtoa.h +81 -0
  86. data/ext/v8/upstream/3.1.8/src/bignum.cc +768 -0
  87. data/ext/v8/upstream/3.1.8/src/bignum.h +140 -0
  88. data/ext/v8/upstream/3.1.8/src/bootstrapper.cc +1888 -0
  89. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/bootstrapper.h +0 -0
  90. data/ext/v8/upstream/3.1.8/src/builtins.cc +1586 -0
  91. data/ext/v8/upstream/3.1.8/src/builtins.h +339 -0
  92. data/ext/v8/upstream/3.1.8/src/bytecodes-irregexp.h +105 -0
  93. data/ext/v8/upstream/3.1.8/src/cached-powers.cc +177 -0
  94. data/ext/v8/upstream/3.1.8/src/cached-powers.h +65 -0
  95. data/ext/v8/upstream/3.1.8/src/char-predicates-inl.h +94 -0
  96. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/char-predicates.h +0 -0
  97. data/ext/v8/upstream/3.1.8/src/checks.cc +110 -0
  98. data/ext/v8/upstream/3.1.8/src/checks.h +292 -0
  99. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/circular-queue-inl.h +0 -0
  100. data/ext/v8/upstream/3.1.8/src/circular-queue.cc +122 -0
  101. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/circular-queue.h +0 -0
  102. data/ext/v8/upstream/3.1.8/src/code-stubs.cc +230 -0
  103. data/ext/v8/upstream/3.1.8/src/code-stubs.h +950 -0
  104. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/code.h +0 -0
  105. data/ext/v8/upstream/3.1.8/src/codegen-inl.h +64 -0
  106. data/ext/v8/upstream/3.1.8/src/codegen.cc +495 -0
  107. data/ext/v8/upstream/3.1.8/src/codegen.h +245 -0
  108. data/ext/v8/upstream/3.1.8/src/compilation-cache.cc +654 -0
  109. data/ext/v8/upstream/3.1.8/src/compilation-cache.h +112 -0
  110. data/ext/v8/upstream/3.1.8/src/compiler.cc +806 -0
  111. data/ext/v8/upstream/3.1.8/src/compiler.h +290 -0
  112. data/ext/v8/upstream/3.1.8/src/contexts.cc +320 -0
  113. data/ext/v8/upstream/3.1.8/src/contexts.h +376 -0
  114. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/conversions-inl.h +0 -0
  115. data/ext/v8/upstream/3.1.8/src/conversions.cc +1069 -0
  116. data/ext/v8/upstream/3.1.8/src/conversions.h +122 -0
  117. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/counters.cc +0 -0
  118. data/ext/v8/upstream/3.1.8/src/counters.h +242 -0
  119. data/ext/v8/upstream/3.1.8/src/cpu-profiler-inl.h +100 -0
  120. data/ext/v8/upstream/3.1.8/src/cpu-profiler.cc +554 -0
  121. data/ext/v8/upstream/3.1.8/src/cpu-profiler.h +291 -0
  122. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/cpu.h +0 -0
  123. data/ext/v8/upstream/3.1.8/src/d8-debug.cc +367 -0
  124. data/ext/v8/upstream/3.1.8/src/d8-debug.h +157 -0
  125. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-posix.cc +0 -0
  126. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-readline.cc +0 -0
  127. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-windows.cc +0 -0
  128. data/ext/v8/upstream/3.1.8/src/d8.cc +792 -0
  129. data/ext/v8/upstream/3.1.8/src/d8.gyp +85 -0
  130. data/ext/v8/upstream/3.1.8/src/d8.h +231 -0
  131. data/ext/v8/upstream/3.1.8/src/d8.js +2798 -0
  132. data/ext/v8/upstream/3.1.8/src/data-flow.cc +545 -0
  133. data/ext/v8/upstream/3.1.8/src/data-flow.h +379 -0
  134. data/ext/v8/upstream/3.1.8/src/date.js +1103 -0
  135. data/ext/v8/upstream/3.1.8/src/dateparser-inl.h +125 -0
  136. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/dateparser.cc +0 -0
  137. data/ext/v8/upstream/3.1.8/src/dateparser.h +263 -0
  138. data/ext/v8/upstream/3.1.8/src/debug-agent.cc +446 -0
  139. data/ext/v8/upstream/3.1.8/src/debug-agent.h +131 -0
  140. data/ext/v8/upstream/3.1.8/src/debug-debugger.js +2569 -0
  141. data/ext/v8/upstream/3.1.8/src/debug.cc +3085 -0
  142. data/ext/v8/upstream/3.1.8/src/debug.h +1025 -0
  143. data/ext/v8/upstream/3.1.8/src/deoptimizer.cc +1185 -0
  144. data/ext/v8/upstream/3.1.8/src/deoptimizer.h +529 -0
  145. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/disasm.h +0 -0
  146. data/ext/v8/upstream/3.1.8/src/disassembler.cc +338 -0
  147. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/disassembler.h +0 -0
  148. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/diy-fp.cc +0 -0
  149. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/diy-fp.h +0 -0
  150. data/ext/v8/upstream/3.1.8/src/double.h +238 -0
  151. data/ext/v8/upstream/3.1.8/src/dtoa.cc +103 -0
  152. data/ext/v8/upstream/3.1.8/src/dtoa.h +85 -0
  153. data/ext/v8/upstream/3.1.8/src/execution.cc +735 -0
  154. data/ext/v8/upstream/3.1.8/src/execution.h +322 -0
  155. data/ext/v8/upstream/3.1.8/src/extensions/experimental/experimental.gyp +53 -0
  156. data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.cc +264 -0
  157. data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.h +64 -0
  158. data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.cc +141 -0
  159. data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.h +50 -0
  160. data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.cc +58 -0
  161. data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.h +49 -0
  162. data/ext/v8/upstream/3.1.8/src/factory.cc +1087 -0
  163. data/ext/v8/upstream/3.1.8/src/factory.h +432 -0
  164. data/ext/v8/upstream/3.1.8/src/fast-dtoa.cc +736 -0
  165. data/ext/v8/upstream/3.1.8/src/fast-dtoa.h +83 -0
  166. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/fixed-dtoa.cc +0 -0
  167. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/fixed-dtoa.h +0 -0
  168. data/ext/v8/upstream/3.1.8/src/flag-definitions.h +552 -0
  169. data/ext/v8/upstream/3.1.8/src/flags.cc +551 -0
  170. data/ext/v8/upstream/3.1.8/src/flags.h +79 -0
  171. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/frame-element.cc +0 -0
  172. data/ext/v8/upstream/3.1.8/src/frame-element.h +277 -0
  173. data/ext/v8/upstream/3.1.8/src/frames-inl.h +210 -0
  174. data/ext/v8/upstream/3.1.8/src/frames.cc +1232 -0
  175. data/ext/v8/upstream/3.1.8/src/frames.h +826 -0
  176. data/ext/v8/upstream/3.1.8/src/full-codegen.cc +1382 -0
  177. data/ext/v8/upstream/3.1.8/src/full-codegen.h +751 -0
  178. data/ext/v8/upstream/3.1.8/src/func-name-inferrer.cc +90 -0
  179. data/ext/v8/upstream/3.1.8/src/func-name-inferrer.h +111 -0
  180. data/ext/v8/upstream/3.1.8/src/gdb-jit.cc +1547 -0
  181. data/ext/v8/upstream/3.1.8/src/gdb-jit.h +138 -0
  182. data/ext/v8/upstream/3.1.8/src/global-handles.cc +534 -0
  183. data/ext/v8/upstream/3.1.8/src/global-handles.h +181 -0
  184. data/ext/v8/upstream/3.1.8/src/globals.h +325 -0
  185. data/ext/v8/upstream/3.1.8/src/handles-inl.h +80 -0
  186. data/ext/v8/upstream/3.1.8/src/handles.cc +910 -0
  187. data/ext/v8/upstream/3.1.8/src/handles.h +424 -0
  188. data/ext/v8/upstream/3.1.8/src/hashmap.cc +230 -0
  189. data/ext/v8/upstream/3.1.8/src/hashmap.h +121 -0
  190. data/ext/v8/upstream/3.1.8/src/heap-inl.h +587 -0
  191. data/ext/v8/upstream/3.1.8/src/heap-profiler.cc +1128 -0
  192. data/ext/v8/upstream/3.1.8/src/heap-profiler.h +381 -0
  193. data/ext/v8/upstream/3.1.8/src/heap.cc +5610 -0
  194. data/ext/v8/upstream/3.1.8/src/heap.h +2218 -0
  195. data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.cc +1490 -0
  196. data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.h +3493 -0
  197. data/ext/v8/upstream/3.1.8/src/hydrogen.cc +6056 -0
  198. data/ext/v8/upstream/3.1.8/src/hydrogen.h +1091 -0
  199. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32-inl.h +429 -0
  200. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.cc +2800 -0
  201. data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.h +1093 -0
  202. data/ext/v8/upstream/3.1.8/src/ia32/builtins-ia32.cc +1590 -0
  203. data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.cc +6624 -0
  204. data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.h +536 -0
  205. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/codegen-ia32-inl.h +0 -0
  206. data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.cc +10354 -0
  207. data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.h +798 -0
  208. data/ext/v8/upstream/3.1.8/src/ia32/cpu-ia32.cc +87 -0
  209. data/ext/v8/upstream/3.1.8/src/ia32/debug-ia32.cc +309 -0
  210. data/ext/v8/upstream/3.1.8/src/ia32/deoptimizer-ia32.cc +664 -0
  211. data/ext/v8/upstream/3.1.8/src/ia32/disasm-ia32.cc +1597 -0
  212. data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.cc +45 -0
  213. data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.h +140 -0
  214. data/ext/v8/upstream/3.1.8/src/ia32/full-codegen-ia32.cc +4278 -0
  215. data/ext/v8/upstream/3.1.8/src/ia32/ic-ia32.cc +1786 -0
  216. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/jump-target-ia32.cc +0 -0
  217. data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.cc +3880 -0
  218. data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.h +309 -0
  219. data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.cc +460 -0
  220. data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
  221. data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.cc +2095 -0
  222. data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.h +2127 -0
  223. data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.cc +2031 -0
  224. data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.h +798 -0
  225. data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.cc +1253 -0
  226. data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.h +215 -0
  227. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32-inl.h +0 -0
  228. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32.cc +0 -0
  229. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32.h +0 -0
  230. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/simulator-ia32.cc +0 -0
  231. data/ext/v8/upstream/3.1.8/src/ia32/simulator-ia32.h +72 -0
  232. data/ext/v8/upstream/3.1.8/src/ia32/stub-cache-ia32.cc +3732 -0
  233. data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.cc +1360 -0
  234. data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.h +646 -0
  235. data/ext/v8/upstream/3.1.8/src/ic-inl.h +129 -0
  236. data/ext/v8/upstream/3.1.8/src/ic.cc +2333 -0
  237. data/ext/v8/upstream/3.1.8/src/ic.h +639 -0
  238. data/ext/v8/upstream/3.1.8/src/inspector.cc +63 -0
  239. data/ext/v8/upstream/3.1.8/src/inspector.h +62 -0
  240. data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.cc +655 -0
  241. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/interpreter-irregexp.h +0 -0
  242. data/ext/v8/upstream/3.1.8/src/json.js +342 -0
  243. data/ext/v8/upstream/3.1.8/src/jsregexp.cc +5340 -0
  244. data/ext/v8/upstream/3.1.8/src/jsregexp.h +1484 -0
  245. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-heavy-inl.h +0 -0
  246. data/ext/v8/upstream/3.1.8/src/jump-target-heavy.cc +430 -0
  247. data/ext/v8/upstream/3.1.8/src/jump-target-heavy.h +244 -0
  248. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-inl.h +0 -0
  249. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-light-inl.h +0 -0
  250. data/ext/v8/upstream/3.1.8/src/jump-target-light.cc +111 -0
  251. data/ext/v8/upstream/3.1.8/src/jump-target-light.h +193 -0
  252. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target.cc +0 -0
  253. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target.h +0 -0
  254. data/ext/v8/upstream/3.1.8/src/list-inl.h +206 -0
  255. data/ext/v8/upstream/3.1.8/src/list.h +164 -0
  256. data/ext/v8/upstream/3.1.8/src/lithium-allocator-inl.h +140 -0
  257. data/ext/v8/upstream/3.1.8/src/lithium-allocator.cc +2093 -0
  258. data/ext/v8/upstream/3.1.8/src/lithium-allocator.h +644 -0
  259. data/ext/v8/upstream/3.1.8/src/lithium.cc +168 -0
  260. data/ext/v8/upstream/3.1.8/src/lithium.h +592 -0
  261. data/ext/v8/upstream/3.1.8/src/liveedit-debugger.js +1082 -0
  262. data/ext/v8/upstream/3.1.8/src/liveedit.cc +1650 -0
  263. data/ext/v8/upstream/3.1.8/src/liveedit.h +174 -0
  264. data/ext/v8/upstream/3.1.8/src/liveobjectlist-inl.h +126 -0
  265. data/ext/v8/upstream/3.1.8/src/liveobjectlist.cc +2527 -0
  266. data/ext/v8/upstream/3.1.8/src/liveobjectlist.h +322 -0
  267. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/log-inl.h +0 -0
  268. data/ext/v8/upstream/3.1.8/src/log-utils.cc +336 -0
  269. data/ext/v8/upstream/3.1.8/src/log-utils.h +232 -0
  270. data/ext/v8/upstream/3.1.8/src/log.cc +1608 -0
  271. data/ext/v8/upstream/3.1.8/src/log.h +379 -0
  272. data/ext/v8/upstream/3.1.8/src/macro-assembler.h +120 -0
  273. data/ext/v8/upstream/3.1.8/src/macros.py +178 -0
  274. data/ext/v8/upstream/3.1.8/src/mark-compact.cc +2957 -0
  275. data/ext/v8/upstream/3.1.8/src/mark-compact.h +433 -0
  276. data/ext/v8/upstream/3.1.8/src/math.js +264 -0
  277. data/ext/v8/upstream/3.1.8/src/memory.h +82 -0
  278. data/ext/v8/upstream/3.1.8/src/messages.cc +164 -0
  279. data/ext/v8/upstream/3.1.8/src/messages.h +114 -0
  280. data/ext/v8/upstream/3.1.8/src/messages.js +1071 -0
  281. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/assembler-mips-inl.h +0 -0
  282. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/assembler-mips.cc +0 -0
  283. data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.h +667 -0
  284. data/ext/v8/upstream/3.1.8/src/mips/builtins-mips.cc +205 -0
  285. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/codegen-mips-inl.h +0 -0
  286. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/codegen-mips.cc +0 -0
  287. data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.h +431 -0
  288. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/constants-mips.cc +0 -0
  289. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/constants-mips.h +0 -0
  290. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/cpu-mips.cc +0 -0
  291. data/ext/v8/upstream/3.1.8/src/mips/debug-mips.cc +127 -0
  292. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/disasm-mips.cc +0 -0
  293. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/fast-codegen-mips.cc +0 -0
  294. data/ext/v8/upstream/3.1.8/src/mips/frames-mips.cc +96 -0
  295. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/frames-mips.h +0 -0
  296. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/full-codegen-mips.cc +0 -0
  297. data/ext/v8/upstream/3.1.8/src/mips/ic-mips.cc +208 -0
  298. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/jump-target-mips.cc +0 -0
  299. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/macro-assembler-mips.cc +0 -0
  300. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/macro-assembler-mips.h +0 -0
  301. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips-inl.h +0 -0
  302. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips.cc +0 -0
  303. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips.h +0 -0
  304. data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.cc +1650 -0
  305. data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.h +311 -0
  306. data/ext/v8/upstream/3.1.8/src/mips/stub-cache-mips.cc +418 -0
  307. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/virtual-frame-mips.cc +0 -0
  308. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/virtual-frame-mips.h +0 -0
  309. data/ext/v8/upstream/3.1.8/src/mirror-debugger.js +2380 -0
  310. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mksnapshot.cc +0 -0
  311. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/natives.h +0 -0
  312. data/ext/v8/upstream/3.1.8/src/objects-debug.cc +722 -0
  313. data/ext/v8/upstream/3.1.8/src/objects-inl.h +3946 -0
  314. data/ext/v8/upstream/3.1.8/src/objects-printer.cc +801 -0
  315. data/ext/v8/upstream/3.1.8/src/objects-visiting.cc +142 -0
  316. data/ext/v8/upstream/3.1.8/src/objects-visiting.h +401 -0
  317. data/ext/v8/upstream/3.1.8/src/objects.cc +10044 -0
  318. data/ext/v8/upstream/3.1.8/src/objects.h +6571 -0
  319. data/ext/v8/upstream/3.1.8/src/parser.cc +5165 -0
  320. data/ext/v8/upstream/3.1.8/src/parser.h +802 -0
  321. data/ext/v8/upstream/3.1.8/src/platform-cygwin.cc +745 -0
  322. data/ext/v8/upstream/3.1.8/src/platform-freebsd.cc +702 -0
  323. data/ext/v8/upstream/3.1.8/src/platform-linux.cc +981 -0
  324. data/ext/v8/upstream/3.1.8/src/platform-macos.cc +732 -0
  325. data/ext/v8/upstream/3.1.8/src/platform-nullos.cc +498 -0
  326. data/ext/v8/upstream/3.1.8/src/platform-openbsd.cc +657 -0
  327. data/ext/v8/upstream/3.1.8/src/platform-posix.cc +399 -0
  328. data/ext/v8/upstream/3.1.8/src/platform-solaris.cc +714 -0
  329. data/ext/v8/upstream/3.1.8/src/platform-win32.cc +1974 -0
  330. data/ext/v8/upstream/3.1.8/src/platform.h +636 -0
  331. data/ext/v8/upstream/3.1.8/src/preparse-data.cc +183 -0
  332. data/ext/v8/upstream/3.1.8/src/preparse-data.h +249 -0
  333. data/ext/v8/upstream/3.1.8/src/preparser-api.cc +213 -0
  334. data/ext/v8/upstream/3.1.8/src/preparser.cc +1205 -0
  335. data/ext/v8/upstream/3.1.8/src/preparser.h +278 -0
  336. data/ext/v8/upstream/3.1.8/src/prettyprinter.cc +1539 -0
  337. data/ext/v8/upstream/3.1.8/src/prettyprinter.h +223 -0
  338. data/ext/v8/upstream/3.1.8/src/profile-generator-inl.h +128 -0
  339. data/ext/v8/upstream/3.1.8/src/profile-generator.cc +2899 -0
  340. data/ext/v8/upstream/3.1.8/src/profile-generator.h +1151 -0
  341. data/ext/v8/upstream/3.1.8/src/property.cc +96 -0
  342. data/ext/v8/upstream/3.1.8/src/property.h +337 -0
  343. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
  344. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.cc +470 -0
  345. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.h +142 -0
  346. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-tracer.cc +373 -0
  347. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-tracer.h +104 -0
  348. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.cc +257 -0
  349. data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.h +231 -0
  350. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-stack.cc +0 -0
  351. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-stack.h +0 -0
  352. data/ext/v8/upstream/3.1.8/src/regexp.js +483 -0
  353. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator-inl.h +0 -0
  354. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator.cc +0 -0
  355. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator.h +0 -0
  356. data/ext/v8/upstream/3.1.8/src/rewriter.cc +1023 -0
  357. data/ext/v8/upstream/3.1.8/src/rewriter.h +59 -0
  358. data/ext/v8/upstream/3.1.8/src/runtime-profiler.cc +443 -0
  359. data/ext/v8/upstream/3.1.8/src/runtime-profiler.h +77 -0
  360. data/ext/v8/upstream/3.1.8/src/runtime.cc +11592 -0
  361. data/ext/v8/upstream/3.1.8/src/runtime.h +582 -0
  362. data/ext/v8/upstream/3.1.8/src/runtime.js +643 -0
  363. data/ext/v8/upstream/3.1.8/src/safepoint-table.cc +253 -0
  364. data/ext/v8/upstream/3.1.8/src/safepoint-table.h +263 -0
  365. data/ext/v8/upstream/3.1.8/src/scanner-base.cc +971 -0
  366. data/ext/v8/upstream/3.1.8/src/scanner-base.h +653 -0
  367. data/ext/v8/upstream/3.1.8/src/scanner.cc +586 -0
  368. data/ext/v8/upstream/3.1.8/src/scanner.h +194 -0
  369. data/ext/v8/upstream/3.1.8/src/scopeinfo.cc +636 -0
  370. data/ext/v8/upstream/3.1.8/src/scopeinfo.h +238 -0
  371. data/ext/v8/upstream/3.1.8/src/scopes.cc +1063 -0
  372. data/ext/v8/upstream/3.1.8/src/scopes.h +494 -0
  373. data/ext/v8/upstream/3.1.8/src/serialize.cc +1535 -0
  374. data/ext/v8/upstream/3.1.8/src/serialize.h +584 -0
  375. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/shell.h +0 -0
  376. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/simulator.h +0 -0
  377. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/smart-pointer.h +0 -0
  378. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot-common.cc +0 -0
  379. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot-empty.cc +0 -0
  380. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot.h +0 -0
  381. data/ext/v8/upstream/3.1.8/src/spaces-inl.h +524 -0
  382. data/ext/v8/upstream/3.1.8/src/spaces.cc +3254 -0
  383. data/ext/v8/upstream/3.1.8/src/spaces.h +2362 -0
  384. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/splay-tree-inl.h +0 -0
  385. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/splay-tree.h +0 -0
  386. data/ext/v8/upstream/3.1.8/src/string-search.cc +40 -0
  387. data/ext/v8/upstream/3.1.8/src/string-search.h +567 -0
  388. data/ext/v8/upstream/3.1.8/src/string-stream.cc +584 -0
  389. data/ext/v8/upstream/3.1.8/src/string-stream.h +191 -0
  390. data/ext/v8/upstream/3.1.8/src/string.js +915 -0
  391. data/ext/v8/upstream/3.1.8/src/strtod.cc +440 -0
  392. data/ext/v8/upstream/3.1.8/src/strtod.h +40 -0
  393. data/ext/v8/upstream/3.1.8/src/stub-cache.cc +1878 -0
  394. data/ext/v8/upstream/3.1.8/src/stub-cache.h +849 -0
  395. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/third_party/valgrind/valgrind.h +0 -0
  396. data/ext/v8/upstream/3.1.8/src/token.cc +63 -0
  397. data/ext/v8/upstream/3.1.8/src/token.h +288 -0
  398. data/ext/v8/upstream/3.1.8/src/top.cc +1152 -0
  399. data/ext/v8/upstream/3.1.8/src/top.h +608 -0
  400. data/ext/v8/upstream/3.1.8/src/type-info.cc +406 -0
  401. data/ext/v8/upstream/3.1.8/src/type-info.h +283 -0
  402. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/unbound-queue-inl.h +0 -0
  403. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/unbound-queue.h +0 -0
  404. data/ext/v8/upstream/3.1.8/src/unicode-inl.h +238 -0
  405. data/ext/v8/upstream/3.1.8/src/unicode.cc +1624 -0
  406. data/ext/v8/upstream/3.1.8/src/unicode.h +280 -0
  407. data/ext/v8/upstream/3.1.8/src/uri.js +402 -0
  408. data/ext/v8/upstream/3.1.8/src/utils.cc +371 -0
  409. data/ext/v8/upstream/3.1.8/src/utils.h +793 -0
  410. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/v8-counters.cc +0 -0
  411. data/ext/v8/upstream/3.1.8/src/v8-counters.h +290 -0
  412. data/ext/v8/upstream/3.1.8/src/v8.cc +270 -0
  413. data/ext/v8/upstream/3.1.8/src/v8.h +127 -0
  414. data/ext/v8/upstream/3.1.8/src/v8checks.h +64 -0
  415. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/v8dll-main.cc +0 -0
  416. data/ext/v8/upstream/3.1.8/src/v8globals.h +480 -0
  417. data/ext/v8/upstream/3.1.8/src/v8natives.js +1252 -0
  418. data/ext/v8/upstream/3.1.8/src/v8preparserdll-main.cc +39 -0
  419. data/ext/v8/upstream/3.1.8/src/v8threads.cc +440 -0
  420. data/ext/v8/upstream/3.1.8/src/v8threads.h +157 -0
  421. data/ext/v8/upstream/3.1.8/src/v8utils.h +354 -0
  422. data/ext/v8/upstream/3.1.8/src/variables.cc +132 -0
  423. data/ext/v8/upstream/3.1.8/src/variables.h +212 -0
  424. data/ext/v8/upstream/3.1.8/src/version.cc +95 -0
  425. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/version.h +0 -0
  426. data/ext/v8/upstream/3.1.8/src/virtual-frame-heavy-inl.h +190 -0
  427. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-heavy.cc +0 -0
  428. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-inl.h +0 -0
  429. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-light-inl.h +0 -0
  430. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-light.cc +0 -0
  431. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame.cc +0 -0
  432. data/ext/v8/upstream/3.1.8/src/virtual-frame.h +59 -0
  433. data/ext/v8/upstream/3.1.8/src/vm-state-inl.h +134 -0
  434. data/ext/v8/upstream/3.1.8/src/vm-state.h +68 -0
  435. data/ext/v8/upstream/3.1.8/src/win32-headers.h +95 -0
  436. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64-inl.h +455 -0
  437. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.cc +3162 -0
  438. data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.h +1584 -0
  439. data/ext/v8/upstream/3.1.8/src/x64/builtins-x64.cc +1492 -0
  440. data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.cc +5150 -0
  441. data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.h +519 -0
  442. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64-inl.h +46 -0
  443. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.cc +8835 -0
  444. data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.h +750 -0
  445. data/ext/v8/upstream/3.1.8/src/x64/cpu-x64.cc +86 -0
  446. data/ext/v8/upstream/3.1.8/src/x64/debug-x64.cc +316 -0
  447. data/ext/v8/upstream/3.1.8/src/x64/deoptimizer-x64.cc +781 -0
  448. data/ext/v8/upstream/3.1.8/src/x64/disasm-x64.cc +1737 -0
  449. data/ext/v8/upstream/3.1.8/src/x64/frames-x64.cc +45 -0
  450. data/ext/v8/upstream/3.1.8/src/x64/frames-x64.h +130 -0
  451. data/ext/v8/upstream/3.1.8/src/x64/full-codegen-x64.cc +3984 -0
  452. data/ext/v8/upstream/3.1.8/src/x64/ic-x64.cc +1761 -0
  453. data/ext/v8/upstream/3.1.8/src/x64/jump-target-x64.cc +437 -0
  454. data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.cc +3639 -0
  455. data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.h +305 -0
  456. data/ext/v8/upstream/3.1.8/src/x64/lithium-gap-resolver-x64.cc +320 -0
  457. data/ext/v8/upstream/3.1.8/src/x64/lithium-gap-resolver-x64.h +74 -0
  458. data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.cc +2044 -0
  459. data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.h +2052 -0
  460. data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.cc +2660 -0
  461. data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.h +1852 -0
  462. data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.cc +1382 -0
  463. data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.h +278 -0
  464. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64-inl.h +0 -0
  465. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64.cc +0 -0
  466. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64.h +0 -0
  467. data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/simulator-x64.cc +0 -0
  468. data/ext/v8/upstream/3.1.8/src/x64/simulator-x64.h +71 -0
  469. data/ext/v8/upstream/3.1.8/src/x64/stub-cache-x64.cc +3509 -0
  470. data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.cc +1292 -0
  471. data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.h +593 -0
  472. data/ext/v8/upstream/3.1.8/src/zone-inl.h +83 -0
  473. data/ext/v8/upstream/3.1.8/src/zone.cc +195 -0
  474. data/ext/v8/upstream/3.1.8/src/zone.h +233 -0
  475. data/ext/v8/upstream/3.1.8/tools/codemap.js +265 -0
  476. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/consarray.js +0 -0
  477. data/ext/v8/upstream/3.1.8/tools/csvparser.js +78 -0
  478. data/ext/v8/upstream/3.1.8/tools/disasm.py +92 -0
  479. data/ext/v8/upstream/3.1.8/tools/gc-nvp-trace-processor.py +328 -0
  480. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/generate-ten-powers.scm +0 -0
  481. data/ext/v8/upstream/3.1.8/tools/grokdump.py +840 -0
  482. data/ext/v8/upstream/3.1.8/tools/gyp/v8.gyp +869 -0
  483. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/js2c.py +0 -0
  484. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/jsmin.py +0 -0
  485. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/linux-tick-processor +0 -0
  486. data/ext/v8/upstream/3.1.8/tools/ll_prof.py +919 -0
  487. data/ext/v8/upstream/3.1.8/tools/logreader.js +185 -0
  488. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/mac-nm +0 -0
  489. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/mac-tick-processor +0 -0
  490. data/ext/v8/upstream/3.1.8/tools/oom_dump/README +31 -0
  491. data/ext/v8/upstream/3.1.8/tools/oom_dump/SConstruct +42 -0
  492. data/ext/v8/upstream/3.1.8/tools/oom_dump/oom_dump.cc +288 -0
  493. data/ext/v8/upstream/3.1.8/tools/presubmit.py +305 -0
  494. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/process-heap-prof.py +0 -0
  495. data/ext/v8/upstream/3.1.8/tools/profile.js +751 -0
  496. data/ext/v8/upstream/3.1.8/tools/profile_view.js +219 -0
  497. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/run-valgrind.py +0 -0
  498. data/ext/v8/upstream/3.1.8/tools/splaytree.js +316 -0
  499. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/stats-viewer.py +0 -0
  500. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/tickprocessor-driver.js +0 -0
  501. data/ext/v8/upstream/3.1.8/tools/tickprocessor.js +863 -0
  502. data/ext/v8/upstream/3.1.8/tools/utils.py +96 -0
  503. data/ext/v8/upstream/3.1.8/tools/visual_studio/README.txt +70 -0
  504. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/arm.vsprops +0 -0
  505. data/ext/v8/upstream/3.1.8/tools/visual_studio/common.vsprops +34 -0
  506. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8.vcproj +0 -0
  507. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8_arm.vcproj +0 -0
  508. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8_x64.vcproj +0 -0
  509. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8js2c.cmd +0 -0
  510. data/ext/v8/upstream/3.1.8/tools/visual_studio/debug.vsprops +17 -0
  511. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/ia32.vsprops +0 -0
  512. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/js2c.cmd +0 -0
  513. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/release.vsprops +0 -0
  514. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8.sln +0 -0
  515. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8.vcproj +0 -0
  516. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_arm.sln +0 -0
  517. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_arm.vcproj +0 -0
  518. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base.vcproj +1296 -0
  519. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_arm.vcproj +1234 -0
  520. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_x64.vcproj +1296 -0
  521. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest.vcproj +0 -0
  522. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
  523. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
  524. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
  525. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
  526. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample.vcproj +0 -0
  527. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
  528. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
  529. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample.vcproj +147 -0
  530. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample_arm.vcproj +147 -0
  531. data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample_x64.vcproj +163 -0
  532. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot.vcproj +0 -0
  533. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
  534. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
  535. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
  536. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_x64.sln +0 -0
  537. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_x64.vcproj +0 -0
  538. data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/x64.vsprops +0 -0
  539. data/ext/v8/upstream/3.1.8/tools/windows-tick-processor.bat +30 -0
  540. data/ext/v8/upstream/Makefile +2 -1
  541. data/ext/v8/v8_template.cpp +2 -2
  542. data/lib/v8/version.rb +1 -1
  543. data/spec/redjs/jsapi_spec.rb +2 -2
  544. metadata +552 -490
  545. data/ext/v8/upstream/2.3.3/.gitignore +0 -26
  546. data/ext/v8/upstream/2.3.3/AUTHORS +0 -31
  547. data/ext/v8/upstream/2.3.3/ChangeLog +0 -1916
  548. data/ext/v8/upstream/2.3.3/LICENSE +0 -55
  549. data/ext/v8/upstream/2.3.3/SConstruct +0 -1154
  550. data/ext/v8/upstream/2.3.3/include/v8-debug.h +0 -381
  551. data/ext/v8/upstream/2.3.3/include/v8-profiler.h +0 -353
  552. data/ext/v8/upstream/2.3.3/include/v8.h +0 -3616
  553. data/ext/v8/upstream/2.3.3/src/SConscript +0 -330
  554. data/ext/v8/upstream/2.3.3/src/accessors.cc +0 -661
  555. data/ext/v8/upstream/2.3.3/src/accessors.h +0 -114
  556. data/ext/v8/upstream/2.3.3/src/allocation.cc +0 -198
  557. data/ext/v8/upstream/2.3.3/src/allocation.h +0 -169
  558. data/ext/v8/upstream/2.3.3/src/api.cc +0 -4795
  559. data/ext/v8/upstream/2.3.3/src/api.h +0 -485
  560. data/ext/v8/upstream/2.3.3/src/apiutils.h +0 -69
  561. data/ext/v8/upstream/2.3.3/src/arguments.h +0 -96
  562. data/ext/v8/upstream/2.3.3/src/arm/assembler-arm-inl.h +0 -305
  563. data/ext/v8/upstream/2.3.3/src/arm/assembler-arm.cc +0 -2580
  564. data/ext/v8/upstream/2.3.3/src/arm/assembler-arm.h +0 -1275
  565. data/ext/v8/upstream/2.3.3/src/arm/builtins-arm.cc +0 -1320
  566. data/ext/v8/upstream/2.3.3/src/arm/codegen-arm-inl.h +0 -48
  567. data/ext/v8/upstream/2.3.3/src/arm/codegen-arm.cc +0 -11398
  568. data/ext/v8/upstream/2.3.3/src/arm/codegen-arm.h +0 -1102
  569. data/ext/v8/upstream/2.3.3/src/arm/constants-arm.cc +0 -154
  570. data/ext/v8/upstream/2.3.3/src/arm/constants-arm.h +0 -388
  571. data/ext/v8/upstream/2.3.3/src/arm/cpu-arm.cc +0 -142
  572. data/ext/v8/upstream/2.3.3/src/arm/debug-arm.cc +0 -309
  573. data/ext/v8/upstream/2.3.3/src/arm/disasm-arm.cc +0 -1459
  574. data/ext/v8/upstream/2.3.3/src/arm/fast-codegen-arm.cc +0 -241
  575. data/ext/v8/upstream/2.3.3/src/arm/frames-arm.cc +0 -123
  576. data/ext/v8/upstream/2.3.3/src/arm/frames-arm.h +0 -162
  577. data/ext/v8/upstream/2.3.3/src/arm/full-codegen-arm.cc +0 -3178
  578. data/ext/v8/upstream/2.3.3/src/arm/ic-arm.cc +0 -2258
  579. data/ext/v8/upstream/2.3.3/src/arm/jump-target-arm.cc +0 -164
  580. data/ext/v8/upstream/2.3.3/src/arm/macro-assembler-arm.cc +0 -1892
  581. data/ext/v8/upstream/2.3.3/src/arm/macro-assembler-arm.h +0 -727
  582. data/ext/v8/upstream/2.3.3/src/arm/regexp-macro-assembler-arm.cc +0 -1261
  583. data/ext/v8/upstream/2.3.3/src/arm/regexp-macro-assembler-arm.h +0 -266
  584. data/ext/v8/upstream/2.3.3/src/arm/simulator-arm.cc +0 -2822
  585. data/ext/v8/upstream/2.3.3/src/arm/simulator-arm.h +0 -361
  586. data/ext/v8/upstream/2.3.3/src/arm/stub-cache-arm.cc +0 -2387
  587. data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm.cc +0 -834
  588. data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm.h +0 -519
  589. data/ext/v8/upstream/2.3.3/src/array.js +0 -1127
  590. data/ext/v8/upstream/2.3.3/src/assembler.cc +0 -801
  591. data/ext/v8/upstream/2.3.3/src/assembler.h +0 -573
  592. data/ext/v8/upstream/2.3.3/src/ast-inl.h +0 -81
  593. data/ext/v8/upstream/2.3.3/src/ast.cc +0 -1152
  594. data/ext/v8/upstream/2.3.3/src/ast.h +0 -2106
  595. data/ext/v8/upstream/2.3.3/src/bootstrapper.cc +0 -1819
  596. data/ext/v8/upstream/2.3.3/src/builtins.cc +0 -1529
  597. data/ext/v8/upstream/2.3.3/src/builtins.h +0 -263
  598. data/ext/v8/upstream/2.3.3/src/bytecodes-irregexp.h +0 -104
  599. data/ext/v8/upstream/2.3.3/src/cached-powers.h +0 -119
  600. data/ext/v8/upstream/2.3.3/src/char-predicates-inl.h +0 -86
  601. data/ext/v8/upstream/2.3.3/src/checks.cc +0 -100
  602. data/ext/v8/upstream/2.3.3/src/checks.h +0 -310
  603. data/ext/v8/upstream/2.3.3/src/circular-queue.cc +0 -121
  604. data/ext/v8/upstream/2.3.3/src/code-stubs.cc +0 -177
  605. data/ext/v8/upstream/2.3.3/src/code-stubs.h +0 -177
  606. data/ext/v8/upstream/2.3.3/src/codegen-inl.h +0 -60
  607. data/ext/v8/upstream/2.3.3/src/codegen.cc +0 -516
  608. data/ext/v8/upstream/2.3.3/src/codegen.h +0 -897
  609. data/ext/v8/upstream/2.3.3/src/compilation-cache.cc +0 -562
  610. data/ext/v8/upstream/2.3.3/src/compilation-cache.h +0 -102
  611. data/ext/v8/upstream/2.3.3/src/compiler.cc +0 -654
  612. data/ext/v8/upstream/2.3.3/src/compiler.h +0 -299
  613. data/ext/v8/upstream/2.3.3/src/contexts.cc +0 -256
  614. data/ext/v8/upstream/2.3.3/src/contexts.h +0 -342
  615. data/ext/v8/upstream/2.3.3/src/conversions.cc +0 -1119
  616. data/ext/v8/upstream/2.3.3/src/conversions.h +0 -123
  617. data/ext/v8/upstream/2.3.3/src/counters.h +0 -239
  618. data/ext/v8/upstream/2.3.3/src/cpu-profiler-inl.h +0 -100
  619. data/ext/v8/upstream/2.3.3/src/cpu-profiler.cc +0 -538
  620. data/ext/v8/upstream/2.3.3/src/cpu-profiler.h +0 -285
  621. data/ext/v8/upstream/2.3.3/src/d8-debug.cc +0 -356
  622. data/ext/v8/upstream/2.3.3/src/d8-debug.h +0 -155
  623. data/ext/v8/upstream/2.3.3/src/d8.cc +0 -783
  624. data/ext/v8/upstream/2.3.3/src/d8.h +0 -227
  625. data/ext/v8/upstream/2.3.3/src/d8.js +0 -1683
  626. data/ext/v8/upstream/2.3.3/src/data-flow.cc +0 -758
  627. data/ext/v8/upstream/2.3.3/src/data-flow.h +0 -278
  628. data/ext/v8/upstream/2.3.3/src/date.js +0 -1059
  629. data/ext/v8/upstream/2.3.3/src/dateparser-inl.h +0 -123
  630. data/ext/v8/upstream/2.3.3/src/dateparser.h +0 -244
  631. data/ext/v8/upstream/2.3.3/src/debug-agent.cc +0 -427
  632. data/ext/v8/upstream/2.3.3/src/debug-agent.h +0 -129
  633. data/ext/v8/upstream/2.3.3/src/debug-debugger.js +0 -2227
  634. data/ext/v8/upstream/2.3.3/src/debug.cc +0 -3005
  635. data/ext/v8/upstream/2.3.3/src/debug.h +0 -993
  636. data/ext/v8/upstream/2.3.3/src/disassembler.cc +0 -312
  637. data/ext/v8/upstream/2.3.3/src/double.h +0 -169
  638. data/ext/v8/upstream/2.3.3/src/dtoa-config.c +0 -92
  639. data/ext/v8/upstream/2.3.3/src/dtoa.cc +0 -77
  640. data/ext/v8/upstream/2.3.3/src/dtoa.h +0 -81
  641. data/ext/v8/upstream/2.3.3/src/execution.cc +0 -809
  642. data/ext/v8/upstream/2.3.3/src/execution.h +0 -336
  643. data/ext/v8/upstream/2.3.3/src/factory.cc +0 -1003
  644. data/ext/v8/upstream/2.3.3/src/factory.h +0 -410
  645. data/ext/v8/upstream/2.3.3/src/fast-codegen.cc +0 -746
  646. data/ext/v8/upstream/2.3.3/src/fast-codegen.h +0 -161
  647. data/ext/v8/upstream/2.3.3/src/fast-dtoa.cc +0 -505
  648. data/ext/v8/upstream/2.3.3/src/fast-dtoa.h +0 -58
  649. data/ext/v8/upstream/2.3.3/src/flag-definitions.h +0 -455
  650. data/ext/v8/upstream/2.3.3/src/flags.cc +0 -551
  651. data/ext/v8/upstream/2.3.3/src/flags.h +0 -81
  652. data/ext/v8/upstream/2.3.3/src/flow-graph.cc +0 -763
  653. data/ext/v8/upstream/2.3.3/src/flow-graph.h +0 -180
  654. data/ext/v8/upstream/2.3.3/src/frame-element.h +0 -273
  655. data/ext/v8/upstream/2.3.3/src/frames-inl.h +0 -217
  656. data/ext/v8/upstream/2.3.3/src/frames.cc +0 -826
  657. data/ext/v8/upstream/2.3.3/src/frames.h +0 -682
  658. data/ext/v8/upstream/2.3.3/src/full-codegen.cc +0 -1443
  659. data/ext/v8/upstream/2.3.3/src/full-codegen.h +0 -548
  660. data/ext/v8/upstream/2.3.3/src/func-name-inferrer.cc +0 -76
  661. data/ext/v8/upstream/2.3.3/src/func-name-inferrer.h +0 -135
  662. data/ext/v8/upstream/2.3.3/src/global-handles.cc +0 -520
  663. data/ext/v8/upstream/2.3.3/src/global-handles.h +0 -180
  664. data/ext/v8/upstream/2.3.3/src/globals.h +0 -669
  665. data/ext/v8/upstream/2.3.3/src/handles-inl.h +0 -76
  666. data/ext/v8/upstream/2.3.3/src/handles.cc +0 -825
  667. data/ext/v8/upstream/2.3.3/src/handles.h +0 -393
  668. data/ext/v8/upstream/2.3.3/src/hashmap.cc +0 -226
  669. data/ext/v8/upstream/2.3.3/src/hashmap.h +0 -120
  670. data/ext/v8/upstream/2.3.3/src/heap-inl.h +0 -493
  671. data/ext/v8/upstream/2.3.3/src/heap-profiler.cc +0 -779
  672. data/ext/v8/upstream/2.3.3/src/heap-profiler.h +0 -323
  673. data/ext/v8/upstream/2.3.3/src/heap.cc +0 -4994
  674. data/ext/v8/upstream/2.3.3/src/heap.h +0 -1984
  675. data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32-inl.h +0 -360
  676. data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32.cc +0 -2600
  677. data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32.h +0 -969
  678. data/ext/v8/upstream/2.3.3/src/ia32/builtins-ia32.cc +0 -1261
  679. data/ext/v8/upstream/2.3.3/src/ia32/codegen-ia32.cc +0 -13968
  680. data/ext/v8/upstream/2.3.3/src/ia32/codegen-ia32.h +0 -1097
  681. data/ext/v8/upstream/2.3.3/src/ia32/cpu-ia32.cc +0 -83
  682. data/ext/v8/upstream/2.3.3/src/ia32/debug-ia32.cc +0 -309
  683. data/ext/v8/upstream/2.3.3/src/ia32/disasm-ia32.cc +0 -1471
  684. data/ext/v8/upstream/2.3.3/src/ia32/fast-codegen-ia32.cc +0 -954
  685. data/ext/v8/upstream/2.3.3/src/ia32/fast-codegen-ia32.h +0 -155
  686. data/ext/v8/upstream/2.3.3/src/ia32/frames-ia32.cc +0 -115
  687. data/ext/v8/upstream/2.3.3/src/ia32/frames-ia32.h +0 -135
  688. data/ext/v8/upstream/2.3.3/src/ia32/full-codegen-ia32.cc +0 -3281
  689. data/ext/v8/upstream/2.3.3/src/ia32/ic-ia32.cc +0 -1966
  690. data/ext/v8/upstream/2.3.3/src/ia32/macro-assembler-ia32.cc +0 -1610
  691. data/ext/v8/upstream/2.3.3/src/ia32/macro-assembler-ia32.h +0 -610
  692. data/ext/v8/upstream/2.3.3/src/ia32/regexp-macro-assembler-ia32.cc +0 -1247
  693. data/ext/v8/upstream/2.3.3/src/ia32/regexp-macro-assembler-ia32.h +0 -214
  694. data/ext/v8/upstream/2.3.3/src/ia32/simulator-ia32.h +0 -62
  695. data/ext/v8/upstream/2.3.3/src/ia32/stub-cache-ia32.cc +0 -2750
  696. data/ext/v8/upstream/2.3.3/src/ia32/virtual-frame-ia32.cc +0 -1334
  697. data/ext/v8/upstream/2.3.3/src/ia32/virtual-frame-ia32.h +0 -627
  698. data/ext/v8/upstream/2.3.3/src/ic-inl.h +0 -120
  699. data/ext/v8/upstream/2.3.3/src/ic.cc +0 -1827
  700. data/ext/v8/upstream/2.3.3/src/ic.h +0 -515
  701. data/ext/v8/upstream/2.3.3/src/interpreter-irregexp.cc +0 -646
  702. data/ext/v8/upstream/2.3.3/src/json.js +0 -268
  703. data/ext/v8/upstream/2.3.3/src/jsregexp.cc +0 -5283
  704. data/ext/v8/upstream/2.3.3/src/jsregexp.h +0 -1463
  705. data/ext/v8/upstream/2.3.3/src/jump-target-heavy.cc +0 -429
  706. data/ext/v8/upstream/2.3.3/src/jump-target-heavy.h +0 -244
  707. data/ext/v8/upstream/2.3.3/src/jump-target-light.cc +0 -110
  708. data/ext/v8/upstream/2.3.3/src/jump-target-light.h +0 -192
  709. data/ext/v8/upstream/2.3.3/src/list-inl.h +0 -166
  710. data/ext/v8/upstream/2.3.3/src/list.h +0 -159
  711. data/ext/v8/upstream/2.3.3/src/liveedit-debugger.js +0 -1057
  712. data/ext/v8/upstream/2.3.3/src/liveedit.cc +0 -1480
  713. data/ext/v8/upstream/2.3.3/src/liveedit.h +0 -170
  714. data/ext/v8/upstream/2.3.3/src/log-utils.cc +0 -497
  715. data/ext/v8/upstream/2.3.3/src/log-utils.h +0 -289
  716. data/ext/v8/upstream/2.3.3/src/log.cc +0 -1561
  717. data/ext/v8/upstream/2.3.3/src/log.h +0 -384
  718. data/ext/v8/upstream/2.3.3/src/macro-assembler.h +0 -86
  719. data/ext/v8/upstream/2.3.3/src/macros.py +0 -177
  720. data/ext/v8/upstream/2.3.3/src/mark-compact.cc +0 -2330
  721. data/ext/v8/upstream/2.3.3/src/mark-compact.h +0 -451
  722. data/ext/v8/upstream/2.3.3/src/math.js +0 -264
  723. data/ext/v8/upstream/2.3.3/src/memory.h +0 -74
  724. data/ext/v8/upstream/2.3.3/src/messages.cc +0 -183
  725. data/ext/v8/upstream/2.3.3/src/messages.h +0 -113
  726. data/ext/v8/upstream/2.3.3/src/messages.js +0 -982
  727. data/ext/v8/upstream/2.3.3/src/mips/assembler-mips.h +0 -668
  728. data/ext/v8/upstream/2.3.3/src/mips/builtins-mips.cc +0 -205
  729. data/ext/v8/upstream/2.3.3/src/mips/codegen-mips.h +0 -434
  730. data/ext/v8/upstream/2.3.3/src/mips/debug-mips.cc +0 -131
  731. data/ext/v8/upstream/2.3.3/src/mips/frames-mips.cc +0 -102
  732. data/ext/v8/upstream/2.3.3/src/mips/ic-mips.cc +0 -220
  733. data/ext/v8/upstream/2.3.3/src/mips/simulator-mips.cc +0 -1651
  734. data/ext/v8/upstream/2.3.3/src/mips/simulator-mips.h +0 -311
  735. data/ext/v8/upstream/2.3.3/src/mips/stub-cache-mips.cc +0 -403
  736. data/ext/v8/upstream/2.3.3/src/mirror-debugger.js +0 -2380
  737. data/ext/v8/upstream/2.3.3/src/objects-debug.cc +0 -1366
  738. data/ext/v8/upstream/2.3.3/src/objects-inl.h +0 -3333
  739. data/ext/v8/upstream/2.3.3/src/objects.cc +0 -8820
  740. data/ext/v8/upstream/2.3.3/src/objects.h +0 -5373
  741. data/ext/v8/upstream/2.3.3/src/oprofile-agent.cc +0 -108
  742. data/ext/v8/upstream/2.3.3/src/oprofile-agent.h +0 -77
  743. data/ext/v8/upstream/2.3.3/src/parser.cc +0 -5207
  744. data/ext/v8/upstream/2.3.3/src/parser.h +0 -197
  745. data/ext/v8/upstream/2.3.3/src/platform-freebsd.cc +0 -667
  746. data/ext/v8/upstream/2.3.3/src/platform-linux.cc +0 -862
  747. data/ext/v8/upstream/2.3.3/src/platform-macos.cc +0 -665
  748. data/ext/v8/upstream/2.3.3/src/platform-nullos.cc +0 -454
  749. data/ext/v8/upstream/2.3.3/src/platform-openbsd.cc +0 -622
  750. data/ext/v8/upstream/2.3.3/src/platform-posix.cc +0 -362
  751. data/ext/v8/upstream/2.3.3/src/platform-solaris.cc +0 -653
  752. data/ext/v8/upstream/2.3.3/src/platform-win32.cc +0 -1911
  753. data/ext/v8/upstream/2.3.3/src/platform.h +0 -577
  754. data/ext/v8/upstream/2.3.3/src/powers-ten.h +0 -2461
  755. data/ext/v8/upstream/2.3.3/src/prettyprinter.cc +0 -1531
  756. data/ext/v8/upstream/2.3.3/src/prettyprinter.h +0 -221
  757. data/ext/v8/upstream/2.3.3/src/profile-generator-inl.h +0 -148
  758. data/ext/v8/upstream/2.3.3/src/profile-generator.cc +0 -1830
  759. data/ext/v8/upstream/2.3.3/src/profile-generator.h +0 -853
  760. data/ext/v8/upstream/2.3.3/src/property.cc +0 -96
  761. data/ext/v8/upstream/2.3.3/src/property.h +0 -315
  762. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-irregexp.cc +0 -464
  763. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-irregexp.h +0 -141
  764. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-tracer.cc +0 -356
  765. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-tracer.h +0 -103
  766. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler.cc +0 -261
  767. data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler.h +0 -228
  768. data/ext/v8/upstream/2.3.3/src/regexp.js +0 -549
  769. data/ext/v8/upstream/2.3.3/src/rewriter.cc +0 -1038
  770. data/ext/v8/upstream/2.3.3/src/rewriter.h +0 -54
  771. data/ext/v8/upstream/2.3.3/src/runtime.cc +0 -10599
  772. data/ext/v8/upstream/2.3.3/src/runtime.h +0 -459
  773. data/ext/v8/upstream/2.3.3/src/runtime.js +0 -629
  774. data/ext/v8/upstream/2.3.3/src/scanner.cc +0 -1346
  775. data/ext/v8/upstream/2.3.3/src/scanner.h +0 -503
  776. data/ext/v8/upstream/2.3.3/src/scopeinfo.cc +0 -637
  777. data/ext/v8/upstream/2.3.3/src/scopeinfo.h +0 -233
  778. data/ext/v8/upstream/2.3.3/src/scopes.cc +0 -962
  779. data/ext/v8/upstream/2.3.3/src/scopes.h +0 -400
  780. data/ext/v8/upstream/2.3.3/src/serialize.cc +0 -1461
  781. data/ext/v8/upstream/2.3.3/src/serialize.h +0 -581
  782. data/ext/v8/upstream/2.3.3/src/spaces-inl.h +0 -483
  783. data/ext/v8/upstream/2.3.3/src/spaces.cc +0 -2901
  784. data/ext/v8/upstream/2.3.3/src/spaces.h +0 -2197
  785. data/ext/v8/upstream/2.3.3/src/string-stream.cc +0 -584
  786. data/ext/v8/upstream/2.3.3/src/string-stream.h +0 -189
  787. data/ext/v8/upstream/2.3.3/src/string.js +0 -1006
  788. data/ext/v8/upstream/2.3.3/src/stub-cache.cc +0 -1379
  789. data/ext/v8/upstream/2.3.3/src/stub-cache.h +0 -756
  790. data/ext/v8/upstream/2.3.3/src/third_party/dtoa/COPYING +0 -15
  791. data/ext/v8/upstream/2.3.3/src/third_party/dtoa/dtoa.c +0 -3334
  792. data/ext/v8/upstream/2.3.3/src/token.cc +0 -56
  793. data/ext/v8/upstream/2.3.3/src/token.h +0 -270
  794. data/ext/v8/upstream/2.3.3/src/top.cc +0 -1067
  795. data/ext/v8/upstream/2.3.3/src/top.h +0 -463
  796. data/ext/v8/upstream/2.3.3/src/type-info.cc +0 -53
  797. data/ext/v8/upstream/2.3.3/src/type-info.h +0 -244
  798. data/ext/v8/upstream/2.3.3/src/unicode-inl.h +0 -238
  799. data/ext/v8/upstream/2.3.3/src/unicode.cc +0 -749
  800. data/ext/v8/upstream/2.3.3/src/unicode.h +0 -279
  801. data/ext/v8/upstream/2.3.3/src/uri.js +0 -415
  802. data/ext/v8/upstream/2.3.3/src/utils.cc +0 -285
  803. data/ext/v8/upstream/2.3.3/src/utils.h +0 -745
  804. data/ext/v8/upstream/2.3.3/src/v8-counters.h +0 -250
  805. data/ext/v8/upstream/2.3.3/src/v8.cc +0 -228
  806. data/ext/v8/upstream/2.3.3/src/v8.h +0 -121
  807. data/ext/v8/upstream/2.3.3/src/v8natives.js +0 -1188
  808. data/ext/v8/upstream/2.3.3/src/v8threads.cc +0 -461
  809. data/ext/v8/upstream/2.3.3/src/v8threads.h +0 -159
  810. data/ext/v8/upstream/2.3.3/src/variables.cc +0 -119
  811. data/ext/v8/upstream/2.3.3/src/variables.h +0 -205
  812. data/ext/v8/upstream/2.3.3/src/version.cc +0 -88
  813. data/ext/v8/upstream/2.3.3/src/virtual-frame-heavy-inl.h +0 -192
  814. data/ext/v8/upstream/2.3.3/src/virtual-frame.h +0 -46
  815. data/ext/v8/upstream/2.3.3/src/vm-state-inl.h +0 -137
  816. data/ext/v8/upstream/2.3.3/src/vm-state.cc +0 -39
  817. data/ext/v8/upstream/2.3.3/src/vm-state.h +0 -77
  818. data/ext/v8/upstream/2.3.3/src/x64/assembler-x64-inl.h +0 -400
  819. data/ext/v8/upstream/2.3.3/src/x64/assembler-x64.cc +0 -2963
  820. data/ext/v8/upstream/2.3.3/src/x64/assembler-x64.h +0 -1438
  821. data/ext/v8/upstream/2.3.3/src/x64/builtins-x64.cc +0 -1296
  822. data/ext/v8/upstream/2.3.3/src/x64/codegen-x64-inl.h +0 -46
  823. data/ext/v8/upstream/2.3.3/src/x64/codegen-x64.cc +0 -12491
  824. data/ext/v8/upstream/2.3.3/src/x64/codegen-x64.h +0 -1090
  825. data/ext/v8/upstream/2.3.3/src/x64/cpu-x64.cc +0 -83
  826. data/ext/v8/upstream/2.3.3/src/x64/debug-x64.cc +0 -267
  827. data/ext/v8/upstream/2.3.3/src/x64/disasm-x64.cc +0 -1696
  828. data/ext/v8/upstream/2.3.3/src/x64/fast-codegen-x64.cc +0 -250
  829. data/ext/v8/upstream/2.3.3/src/x64/frames-x64.cc +0 -113
  830. data/ext/v8/upstream/2.3.3/src/x64/frames-x64.h +0 -125
  831. data/ext/v8/upstream/2.3.3/src/x64/full-codegen-x64.cc +0 -3270
  832. data/ext/v8/upstream/2.3.3/src/x64/ic-x64.cc +0 -1907
  833. data/ext/v8/upstream/2.3.3/src/x64/jump-target-x64.cc +0 -437
  834. data/ext/v8/upstream/2.3.3/src/x64/macro-assembler-x64.cc +0 -2793
  835. data/ext/v8/upstream/2.3.3/src/x64/macro-assembler-x64.h +0 -916
  836. data/ext/v8/upstream/2.3.3/src/x64/regexp-macro-assembler-x64.cc +0 -1374
  837. data/ext/v8/upstream/2.3.3/src/x64/regexp-macro-assembler-x64.h +0 -277
  838. data/ext/v8/upstream/2.3.3/src/x64/simulator-x64.h +0 -63
  839. data/ext/v8/upstream/2.3.3/src/x64/stub-cache-x64.cc +0 -2560
  840. data/ext/v8/upstream/2.3.3/src/x64/virtual-frame-x64.cc +0 -1264
  841. data/ext/v8/upstream/2.3.3/src/x64/virtual-frame-x64.h +0 -590
  842. data/ext/v8/upstream/2.3.3/src/zone-inl.h +0 -82
  843. data/ext/v8/upstream/2.3.3/src/zone.cc +0 -194
  844. data/ext/v8/upstream/2.3.3/src/zone.h +0 -221
  845. data/ext/v8/upstream/2.3.3/tools/codemap.js +0 -270
  846. data/ext/v8/upstream/2.3.3/tools/csvparser.js +0 -83
  847. data/ext/v8/upstream/2.3.3/tools/gc-nvp-trace-processor.py +0 -317
  848. data/ext/v8/upstream/2.3.3/tools/gyp/v8.gyp +0 -749
  849. data/ext/v8/upstream/2.3.3/tools/linux-tick-processor.py +0 -78
  850. data/ext/v8/upstream/2.3.3/tools/logreader.js +0 -338
  851. data/ext/v8/upstream/2.3.3/tools/oprofile/annotate +0 -7
  852. data/ext/v8/upstream/2.3.3/tools/oprofile/common +0 -19
  853. data/ext/v8/upstream/2.3.3/tools/oprofile/dump +0 -7
  854. data/ext/v8/upstream/2.3.3/tools/oprofile/report +0 -7
  855. data/ext/v8/upstream/2.3.3/tools/oprofile/reset +0 -7
  856. data/ext/v8/upstream/2.3.3/tools/oprofile/run +0 -14
  857. data/ext/v8/upstream/2.3.3/tools/oprofile/shutdown +0 -7
  858. data/ext/v8/upstream/2.3.3/tools/oprofile/start +0 -7
  859. data/ext/v8/upstream/2.3.3/tools/presubmit.py +0 -299
  860. data/ext/v8/upstream/2.3.3/tools/profile.js +0 -691
  861. data/ext/v8/upstream/2.3.3/tools/profile_view.js +0 -224
  862. data/ext/v8/upstream/2.3.3/tools/splaytree.js +0 -322
  863. data/ext/v8/upstream/2.3.3/tools/splaytree.py +0 -226
  864. data/ext/v8/upstream/2.3.3/tools/tickprocessor.js +0 -862
  865. data/ext/v8/upstream/2.3.3/tools/tickprocessor.py +0 -571
  866. data/ext/v8/upstream/2.3.3/tools/utils.py +0 -88
  867. data/ext/v8/upstream/2.3.3/tools/visual_studio/README.txt +0 -71
  868. data/ext/v8/upstream/2.3.3/tools/visual_studio/common.vsprops +0 -34
  869. data/ext/v8/upstream/2.3.3/tools/visual_studio/debug.vsprops +0 -17
  870. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base.vcproj +0 -1143
  871. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base_arm.vcproj +0 -1115
  872. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base_x64.vcproj +0 -1096
  873. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample.vcproj +0 -145
  874. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -145
  875. data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -161
  876. data/ext/v8/upstream/2.3.3/tools/windows-tick-processor.bat +0 -29
  877. data/ext/v8/upstream/2.3.3/tools/windows-tick-processor.py +0 -137
@@ -0,0 +1,1878 @@
1
+ // Copyright 2006-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
+ #include "v8.h"
29
+
30
+ #include "api.h"
31
+ #include "arguments.h"
32
+ #include "gdb-jit.h"
33
+ #include "ic-inl.h"
34
+ #include "stub-cache.h"
35
+ #include "vm-state-inl.h"
36
+
37
+ namespace v8 {
38
+ namespace internal {
39
+
40
+ // -----------------------------------------------------------------------
41
+ // StubCache implementation.
42
+
43
+
44
+ StubCache::Entry StubCache::primary_[StubCache::kPrimaryTableSize];
45
+ StubCache::Entry StubCache::secondary_[StubCache::kSecondaryTableSize];
46
+
47
+ void StubCache::Initialize(bool create_heap_objects) {
48
+ ASSERT(IsPowerOf2(kPrimaryTableSize));
49
+ ASSERT(IsPowerOf2(kSecondaryTableSize));
50
+ if (create_heap_objects) {
51
+ HandleScope scope;
52
+ Clear();
53
+ }
54
+ }
55
+
56
+
57
+ Code* StubCache::Set(String* name, Map* map, Code* code) {
58
+ // Get the flags from the code.
59
+ Code::Flags flags = Code::RemoveTypeFromFlags(code->flags());
60
+
61
+ // Validate that the name does not move on scavenge, and that we
62
+ // can use identity checks instead of string equality checks.
63
+ ASSERT(!Heap::InNewSpace(name));
64
+ ASSERT(name->IsSymbol());
65
+
66
+ // The state bits are not important to the hash function because
67
+ // the stub cache only contains monomorphic stubs. Make sure that
68
+ // the bits are the least significant so they will be the ones
69
+ // masked out.
70
+ ASSERT(Code::ExtractICStateFromFlags(flags) == MONOMORPHIC);
71
+ ASSERT(Code::kFlagsICStateShift == 0);
72
+
73
+ // Make sure that the code type is not included in the hash.
74
+ ASSERT(Code::ExtractTypeFromFlags(flags) == 0);
75
+
76
+ // Compute the primary entry.
77
+ int primary_offset = PrimaryOffset(name, flags, map);
78
+ Entry* primary = entry(primary_, primary_offset);
79
+ Code* hit = primary->value;
80
+
81
+ // If the primary entry has useful data in it, we retire it to the
82
+ // secondary cache before overwriting it.
83
+ if (hit != Builtins::builtin(Builtins::Illegal)) {
84
+ Code::Flags primary_flags = Code::RemoveTypeFromFlags(hit->flags());
85
+ int secondary_offset =
86
+ SecondaryOffset(primary->key, primary_flags, primary_offset);
87
+ Entry* secondary = entry(secondary_, secondary_offset);
88
+ *secondary = *primary;
89
+ }
90
+
91
+ // Update primary cache.
92
+ primary->key = name;
93
+ primary->value = code;
94
+ return code;
95
+ }
96
+
97
+
98
+ MaybeObject* StubCache::ComputeLoadNonexistent(String* name,
99
+ JSObject* receiver) {
100
+ ASSERT(receiver->IsGlobalObject() || receiver->HasFastProperties());
101
+ // If no global objects are present in the prototype chain, the load
102
+ // nonexistent IC stub can be shared for all names for a given map
103
+ // and we use the empty string for the map cache in that case. If
104
+ // there are global objects involved, we need to check global
105
+ // property cells in the stub and therefore the stub will be
106
+ // specific to the name.
107
+ String* cache_name = Heap::empty_string();
108
+ if (receiver->IsGlobalObject()) cache_name = name;
109
+ JSObject* last = receiver;
110
+ while (last->GetPrototype() != Heap::null_value()) {
111
+ last = JSObject::cast(last->GetPrototype());
112
+ if (last->IsGlobalObject()) cache_name = name;
113
+ }
114
+ // Compile the stub that is either shared for all names or
115
+ // name specific if there are global objects involved.
116
+ Code::Flags flags =
117
+ Code::ComputeMonomorphicFlags(Code::LOAD_IC, NONEXISTENT);
118
+ Object* code = receiver->map()->FindInCodeCache(cache_name, flags);
119
+ if (code->IsUndefined()) {
120
+ LoadStubCompiler compiler;
121
+ { MaybeObject* maybe_code =
122
+ compiler.CompileLoadNonexistent(cache_name, receiver, last);
123
+ if (!maybe_code->ToObject(&code)) return maybe_code;
124
+ }
125
+ PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), cache_name));
126
+ GDBJIT(AddCode(GDBJITInterface::LOAD_IC, cache_name, Code::cast(code)));
127
+ Object* result;
128
+ { MaybeObject* maybe_result =
129
+ receiver->UpdateMapCodeCache(cache_name, Code::cast(code));
130
+ if (!maybe_result->ToObject(&result)) return maybe_result;
131
+ }
132
+ }
133
+ return code;
134
+ }
135
+
136
+
137
+ MaybeObject* StubCache::ComputeLoadField(String* name,
138
+ JSObject* receiver,
139
+ JSObject* holder,
140
+ int field_index) {
141
+ ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
142
+ Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, FIELD);
143
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
144
+ if (code->IsUndefined()) {
145
+ LoadStubCompiler compiler;
146
+ { MaybeObject* maybe_code =
147
+ compiler.CompileLoadField(receiver, holder, field_index, name);
148
+ if (!maybe_code->ToObject(&code)) return maybe_code;
149
+ }
150
+ PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
151
+ GDBJIT(AddCode(GDBJITInterface::LOAD_IC, name, Code::cast(code)));
152
+ Object* result;
153
+ { MaybeObject* maybe_result =
154
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
155
+ if (!maybe_result->ToObject(&result)) return maybe_result;
156
+ }
157
+ }
158
+ return code;
159
+ }
160
+
161
+
162
+ MaybeObject* StubCache::ComputeLoadCallback(String* name,
163
+ JSObject* receiver,
164
+ JSObject* holder,
165
+ AccessorInfo* callback) {
166
+ ASSERT(v8::ToCData<Address>(callback->getter()) != 0);
167
+ ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
168
+ Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, CALLBACKS);
169
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
170
+ if (code->IsUndefined()) {
171
+ LoadStubCompiler compiler;
172
+ { MaybeObject* maybe_code =
173
+ compiler.CompileLoadCallback(name, receiver, holder, callback);
174
+ if (!maybe_code->ToObject(&code)) return maybe_code;
175
+ }
176
+ PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
177
+ GDBJIT(AddCode(GDBJITInterface::LOAD_IC, name, Code::cast(code)));
178
+ Object* result;
179
+ { MaybeObject* maybe_result =
180
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
181
+ if (!maybe_result->ToObject(&result)) return maybe_result;
182
+ }
183
+ }
184
+ return code;
185
+ }
186
+
187
+
188
+ MaybeObject* StubCache::ComputeLoadConstant(String* name,
189
+ JSObject* receiver,
190
+ JSObject* holder,
191
+ Object* value) {
192
+ ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
193
+ Code::Flags flags =
194
+ Code::ComputeMonomorphicFlags(Code::LOAD_IC, CONSTANT_FUNCTION);
195
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
196
+ if (code->IsUndefined()) {
197
+ LoadStubCompiler compiler;
198
+ { MaybeObject* maybe_code =
199
+ compiler.CompileLoadConstant(receiver, holder, value, name);
200
+ if (!maybe_code->ToObject(&code)) return maybe_code;
201
+ }
202
+ PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
203
+ GDBJIT(AddCode(GDBJITInterface::LOAD_IC, name, Code::cast(code)));
204
+ Object* result;
205
+ { MaybeObject* maybe_result =
206
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
207
+ if (!maybe_result->ToObject(&result)) return maybe_result;
208
+ }
209
+ }
210
+ return code;
211
+ }
212
+
213
+
214
+ MaybeObject* StubCache::ComputeLoadInterceptor(String* name,
215
+ JSObject* receiver,
216
+ JSObject* holder) {
217
+ ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
218
+ Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, INTERCEPTOR);
219
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
220
+ if (code->IsUndefined()) {
221
+ LoadStubCompiler compiler;
222
+ { MaybeObject* maybe_code =
223
+ compiler.CompileLoadInterceptor(receiver, holder, name);
224
+ if (!maybe_code->ToObject(&code)) return maybe_code;
225
+ }
226
+ PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
227
+ GDBJIT(AddCode(GDBJITInterface::LOAD_IC, name, Code::cast(code)));
228
+ Object* result;
229
+ { MaybeObject* maybe_result =
230
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
231
+ if (!maybe_result->ToObject(&result)) return maybe_result;
232
+ }
233
+ }
234
+ return code;
235
+ }
236
+
237
+
238
+ MaybeObject* StubCache::ComputeLoadNormal() {
239
+ return Builtins::builtin(Builtins::LoadIC_Normal);
240
+ }
241
+
242
+
243
+ MaybeObject* StubCache::ComputeLoadGlobal(String* name,
244
+ JSObject* receiver,
245
+ GlobalObject* holder,
246
+ JSGlobalPropertyCell* cell,
247
+ bool is_dont_delete) {
248
+ ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
249
+ Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, NORMAL);
250
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
251
+ if (code->IsUndefined()) {
252
+ LoadStubCompiler compiler;
253
+ { MaybeObject* maybe_code = compiler.CompileLoadGlobal(receiver,
254
+ holder,
255
+ cell,
256
+ name,
257
+ is_dont_delete);
258
+ if (!maybe_code->ToObject(&code)) return maybe_code;
259
+ }
260
+ PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
261
+ GDBJIT(AddCode(GDBJITInterface::LOAD_IC, name, Code::cast(code)));
262
+ Object* result;
263
+ { MaybeObject* maybe_result =
264
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
265
+ if (!maybe_result->ToObject(&result)) return maybe_result;
266
+ }
267
+ }
268
+ return code;
269
+ }
270
+
271
+
272
+ MaybeObject* StubCache::ComputeKeyedLoadField(String* name,
273
+ JSObject* receiver,
274
+ JSObject* holder,
275
+ int field_index) {
276
+ ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
277
+ Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, FIELD);
278
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
279
+ if (code->IsUndefined()) {
280
+ KeyedLoadStubCompiler compiler;
281
+ { MaybeObject* maybe_code =
282
+ compiler.CompileLoadField(name, receiver, holder, field_index);
283
+ if (!maybe_code->ToObject(&code)) return maybe_code;
284
+ }
285
+ PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), name));
286
+ GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, name, Code::cast(code)));
287
+ Object* result;
288
+ { MaybeObject* maybe_result =
289
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
290
+ if (!maybe_result->ToObject(&result)) return maybe_result;
291
+ }
292
+ }
293
+ return code;
294
+ }
295
+
296
+
297
+ MaybeObject* StubCache::ComputeKeyedLoadConstant(String* name,
298
+ JSObject* receiver,
299
+ JSObject* holder,
300
+ Object* value) {
301
+ ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
302
+ Code::Flags flags =
303
+ Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CONSTANT_FUNCTION);
304
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
305
+ if (code->IsUndefined()) {
306
+ KeyedLoadStubCompiler compiler;
307
+ { MaybeObject* maybe_code =
308
+ compiler.CompileLoadConstant(name, receiver, holder, value);
309
+ if (!maybe_code->ToObject(&code)) return maybe_code;
310
+ }
311
+ PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), name));
312
+ GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, name, Code::cast(code)));
313
+ Object* result;
314
+ { MaybeObject* maybe_result =
315
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
316
+ if (!maybe_result->ToObject(&result)) return maybe_result;
317
+ }
318
+ }
319
+ return code;
320
+ }
321
+
322
+
323
+ MaybeObject* StubCache::ComputeKeyedLoadInterceptor(String* name,
324
+ JSObject* receiver,
325
+ JSObject* holder) {
326
+ ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
327
+ Code::Flags flags =
328
+ Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, INTERCEPTOR);
329
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
330
+ if (code->IsUndefined()) {
331
+ KeyedLoadStubCompiler compiler;
332
+ { MaybeObject* maybe_code =
333
+ compiler.CompileLoadInterceptor(receiver, holder, name);
334
+ if (!maybe_code->ToObject(&code)) return maybe_code;
335
+ }
336
+ PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), name));
337
+ GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, name, Code::cast(code)));
338
+ Object* result;
339
+ { MaybeObject* maybe_result =
340
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
341
+ if (!maybe_result->ToObject(&result)) return maybe_result;
342
+ }
343
+ }
344
+ return code;
345
+ }
346
+
347
+
348
+ MaybeObject* StubCache::ComputeKeyedLoadCallback(String* name,
349
+ JSObject* receiver,
350
+ JSObject* holder,
351
+ AccessorInfo* callback) {
352
+ ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
353
+ Code::Flags flags =
354
+ Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CALLBACKS);
355
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
356
+ if (code->IsUndefined()) {
357
+ KeyedLoadStubCompiler compiler;
358
+ { MaybeObject* maybe_code =
359
+ compiler.CompileLoadCallback(name, receiver, holder, callback);
360
+ if (!maybe_code->ToObject(&code)) return maybe_code;
361
+ }
362
+ PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), name));
363
+ GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, name, Code::cast(code)));
364
+ Object* result;
365
+ { MaybeObject* maybe_result =
366
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
367
+ if (!maybe_result->ToObject(&result)) return maybe_result;
368
+ }
369
+ }
370
+ return code;
371
+ }
372
+
373
+
374
+
375
+ MaybeObject* StubCache::ComputeKeyedLoadArrayLength(String* name,
376
+ JSArray* receiver) {
377
+ Code::Flags flags =
378
+ Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CALLBACKS);
379
+ ASSERT(receiver->IsJSObject());
380
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
381
+ if (code->IsUndefined()) {
382
+ KeyedLoadStubCompiler compiler;
383
+ { MaybeObject* maybe_code = compiler.CompileLoadArrayLength(name);
384
+ if (!maybe_code->ToObject(&code)) return maybe_code;
385
+ }
386
+ PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), name));
387
+ GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, name, Code::cast(code)));
388
+ Object* result;
389
+ { MaybeObject* maybe_result =
390
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
391
+ if (!maybe_result->ToObject(&result)) return maybe_result;
392
+ }
393
+ }
394
+ return code;
395
+ }
396
+
397
+
398
+ MaybeObject* StubCache::ComputeKeyedLoadStringLength(String* name,
399
+ String* receiver) {
400
+ Code::Flags flags =
401
+ Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CALLBACKS);
402
+ Map* map = receiver->map();
403
+ Object* code = map->FindInCodeCache(name, flags);
404
+ if (code->IsUndefined()) {
405
+ KeyedLoadStubCompiler compiler;
406
+ { MaybeObject* maybe_code = compiler.CompileLoadStringLength(name);
407
+ if (!maybe_code->ToObject(&code)) return maybe_code;
408
+ }
409
+ PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), name));
410
+ GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, name, Code::cast(code)));
411
+ Object* result;
412
+ { MaybeObject* maybe_result = map->UpdateCodeCache(name, Code::cast(code));
413
+ if (!maybe_result->ToObject(&result)) return maybe_result;
414
+ }
415
+ }
416
+ return code;
417
+ }
418
+
419
+
420
+ MaybeObject* StubCache::ComputeKeyedLoadFunctionPrototype(
421
+ String* name,
422
+ JSFunction* receiver) {
423
+ Code::Flags flags =
424
+ Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CALLBACKS);
425
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
426
+ if (code->IsUndefined()) {
427
+ KeyedLoadStubCompiler compiler;
428
+ { MaybeObject* maybe_code = compiler.CompileLoadFunctionPrototype(name);
429
+ if (!maybe_code->ToObject(&code)) return maybe_code;
430
+ }
431
+ PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), name));
432
+ GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, name, Code::cast(code)));
433
+ Object* result;
434
+ { MaybeObject* maybe_result =
435
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
436
+ if (!maybe_result->ToObject(&result)) return maybe_result;
437
+ }
438
+ }
439
+ return code;
440
+ }
441
+
442
+
443
+ MaybeObject* StubCache::ComputeKeyedLoadSpecialized(JSObject* receiver) {
444
+ // Using NORMAL as the PropertyType for array element loads is a misuse. The
445
+ // generated stub always accesses fast elements, not slow-mode fields, but
446
+ // some property type is required for the stub lookup. Note that overloading
447
+ // the NORMAL PropertyType is only safe as long as no stubs are generated for
448
+ // other keyed field loads. This is guaranteed to be the case since all field
449
+ // keyed loads that are not array elements go through a generic builtin stub.
450
+ Code::Flags flags =
451
+ Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, NORMAL);
452
+ String* name = Heap::KeyedLoadSpecialized_symbol();
453
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
454
+ if (code->IsUndefined()) {
455
+ KeyedLoadStubCompiler compiler;
456
+ { MaybeObject* maybe_code = compiler.CompileLoadSpecialized(receiver);
457
+ if (!maybe_code->ToObject(&code)) return maybe_code;
458
+ }
459
+ PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), 0));
460
+ Object* result;
461
+ { MaybeObject* maybe_result =
462
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
463
+ if (!maybe_result->ToObject(&result)) return maybe_result;
464
+ }
465
+ }
466
+ return code;
467
+ }
468
+
469
+
470
+ MaybeObject* StubCache::ComputeKeyedLoadPixelArray(JSObject* receiver) {
471
+ // Using NORMAL as the PropertyType for array element loads is a misuse. The
472
+ // generated stub always accesses fast elements, not slow-mode fields, but
473
+ // some property type is required for the stub lookup. Note that overloading
474
+ // the NORMAL PropertyType is only safe as long as no stubs are generated for
475
+ // other keyed field loads. This is guaranteed to be the case since all field
476
+ // keyed loads that are not array elements go through a generic builtin stub.
477
+ Code::Flags flags =
478
+ Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, NORMAL);
479
+ String* name = Heap::KeyedLoadPixelArray_symbol();
480
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
481
+ if (code->IsUndefined()) {
482
+ KeyedLoadStubCompiler compiler;
483
+ { MaybeObject* maybe_code = compiler.CompileLoadPixelArray(receiver);
484
+ if (!maybe_code->ToObject(&code)) return maybe_code;
485
+ }
486
+ PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), 0));
487
+ Object* result;
488
+ { MaybeObject* maybe_result =
489
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
490
+ if (!maybe_result->ToObject(&result)) return maybe_result;
491
+ }
492
+ }
493
+ return code;
494
+ }
495
+
496
+
497
+ MaybeObject* StubCache::ComputeStoreField(String* name,
498
+ JSObject* receiver,
499
+ int field_index,
500
+ Map* transition,
501
+ StrictModeFlag strict_mode) {
502
+ PropertyType type = (transition == NULL) ? FIELD : MAP_TRANSITION;
503
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
504
+ Code::STORE_IC, type, strict_mode);
505
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
506
+ if (code->IsUndefined()) {
507
+ StoreStubCompiler compiler(strict_mode);
508
+ { MaybeObject* maybe_code =
509
+ compiler.CompileStoreField(receiver, field_index, transition, name);
510
+ if (!maybe_code->ToObject(&code)) return maybe_code;
511
+ }
512
+ PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG, Code::cast(code), name));
513
+ GDBJIT(AddCode(GDBJITInterface::STORE_IC, name, Code::cast(code)));
514
+ Object* result;
515
+ { MaybeObject* maybe_result =
516
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
517
+ if (!maybe_result->ToObject(&result)) return maybe_result;
518
+ }
519
+ }
520
+ return code;
521
+ }
522
+
523
+
524
+ MaybeObject* StubCache::ComputeKeyedStoreSpecialized(
525
+ JSObject* receiver,
526
+ StrictModeFlag strict_mode) {
527
+ Code::Flags flags =
528
+ Code::ComputeMonomorphicFlags(Code::KEYED_STORE_IC, NORMAL, strict_mode);
529
+ String* name = Heap::KeyedStoreSpecialized_symbol();
530
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
531
+ if (code->IsUndefined()) {
532
+ KeyedStoreStubCompiler compiler(strict_mode);
533
+ { MaybeObject* maybe_code = compiler.CompileStoreSpecialized(receiver);
534
+ if (!maybe_code->ToObject(&code)) return maybe_code;
535
+ }
536
+ PROFILE(CodeCreateEvent(Logger::KEYED_STORE_IC_TAG, Code::cast(code), 0));
537
+ Object* result;
538
+ { MaybeObject* maybe_result =
539
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
540
+ if (!maybe_result->ToObject(&result)) return maybe_result;
541
+ }
542
+ }
543
+ return code;
544
+ }
545
+
546
+
547
+ MaybeObject* StubCache::ComputeKeyedStorePixelArray(
548
+ JSObject* receiver,
549
+ StrictModeFlag strict_mode) {
550
+ // Using NORMAL as the PropertyType for array element stores is a misuse. The
551
+ // generated stub always accesses fast elements, not slow-mode fields, but
552
+ // some property type is required for the stub lookup. Note that overloading
553
+ // the NORMAL PropertyType is only safe as long as no stubs are generated for
554
+ // other keyed field stores. This is guaranteed to be the case since all field
555
+ // keyed stores that are not array elements go through a generic builtin stub.
556
+ Code::Flags flags =
557
+ Code::ComputeMonomorphicFlags(Code::KEYED_STORE_IC, NORMAL, strict_mode);
558
+ String* name = Heap::KeyedStorePixelArray_symbol();
559
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
560
+ if (code->IsUndefined()) {
561
+ KeyedStoreStubCompiler compiler(strict_mode);
562
+ { MaybeObject* maybe_code = compiler.CompileStorePixelArray(receiver);
563
+ if (!maybe_code->ToObject(&code)) return maybe_code;
564
+ }
565
+ PROFILE(CodeCreateEvent(Logger::KEYED_STORE_IC_TAG, Code::cast(code), 0));
566
+ Object* result;
567
+ { MaybeObject* maybe_result =
568
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
569
+ if (!maybe_result->ToObject(&result)) return maybe_result;
570
+ }
571
+ }
572
+ return code;
573
+ }
574
+
575
+
576
+ namespace {
577
+
578
+ ExternalArrayType ElementsKindToExternalArrayType(JSObject::ElementsKind kind) {
579
+ switch (kind) {
580
+ case JSObject::EXTERNAL_BYTE_ELEMENTS:
581
+ return kExternalByteArray;
582
+ case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
583
+ return kExternalUnsignedByteArray;
584
+ case JSObject::EXTERNAL_SHORT_ELEMENTS:
585
+ return kExternalShortArray;
586
+ case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
587
+ return kExternalUnsignedShortArray;
588
+ case JSObject::EXTERNAL_INT_ELEMENTS:
589
+ return kExternalIntArray;
590
+ case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS:
591
+ return kExternalUnsignedIntArray;
592
+ case JSObject::EXTERNAL_FLOAT_ELEMENTS:
593
+ return kExternalFloatArray;
594
+ default:
595
+ UNREACHABLE();
596
+ return static_cast<ExternalArrayType>(0);
597
+ }
598
+ }
599
+
600
+ } // anonymous namespace
601
+
602
+
603
+ MaybeObject* StubCache::ComputeKeyedLoadOrStoreExternalArray(
604
+ JSObject* receiver,
605
+ bool is_store,
606
+ StrictModeFlag strict_mode) {
607
+ Code::Flags flags =
608
+ Code::ComputeMonomorphicFlags(
609
+ is_store ? Code::KEYED_STORE_IC : Code::KEYED_LOAD_IC,
610
+ NORMAL,
611
+ strict_mode);
612
+ ExternalArrayType array_type =
613
+ ElementsKindToExternalArrayType(receiver->GetElementsKind());
614
+ String* name =
615
+ is_store ? Heap::KeyedStoreExternalArray_symbol()
616
+ : Heap::KeyedLoadExternalArray_symbol();
617
+ // Use the global maps for the particular external array types,
618
+ // rather than the receiver's map, when looking up the cached code,
619
+ // so that we actually canonicalize these stubs.
620
+ Map* map = Heap::MapForExternalArrayType(array_type);
621
+ Object* code = map->FindInCodeCache(name, flags);
622
+ if (code->IsUndefined()) {
623
+ ExternalArrayStubCompiler compiler;
624
+ { MaybeObject* maybe_code = is_store
625
+ ? compiler.CompileKeyedStoreStub(array_type, flags)
626
+ : compiler.CompileKeyedLoadStub(array_type, flags);
627
+ if (!maybe_code->ToObject(&code)) return maybe_code;
628
+ }
629
+ if (is_store) {
630
+ PROFILE(
631
+ CodeCreateEvent(Logger::KEYED_STORE_IC_TAG, Code::cast(code), 0));
632
+ } else {
633
+ PROFILE(
634
+ CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), 0));
635
+ }
636
+ Object* result;
637
+ { MaybeObject* maybe_result =
638
+ map->UpdateCodeCache(name, Code::cast(code));
639
+ if (!maybe_result->ToObject(&result)) return maybe_result;
640
+ }
641
+ }
642
+ return code;
643
+ }
644
+
645
+
646
+ MaybeObject* StubCache::ComputeStoreNormal(StrictModeFlag strict_mode) {
647
+ return Builtins::builtin((strict_mode == kStrictMode)
648
+ ? Builtins::StoreIC_Normal_Strict
649
+ : Builtins::StoreIC_Normal);
650
+ }
651
+
652
+
653
+ MaybeObject* StubCache::ComputeStoreGlobal(String* name,
654
+ GlobalObject* receiver,
655
+ JSGlobalPropertyCell* cell,
656
+ StrictModeFlag strict_mode) {
657
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
658
+ Code::STORE_IC, NORMAL, strict_mode);
659
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
660
+ if (code->IsUndefined()) {
661
+ StoreStubCompiler compiler(strict_mode);
662
+ { MaybeObject* maybe_code =
663
+ compiler.CompileStoreGlobal(receiver, cell, name);
664
+ if (!maybe_code->ToObject(&code)) return maybe_code;
665
+ }
666
+ PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG, Code::cast(code), name));
667
+ GDBJIT(AddCode(GDBJITInterface::STORE_IC, name, Code::cast(code)));
668
+ Object* result;
669
+ { MaybeObject* maybe_result =
670
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
671
+ if (!maybe_result->ToObject(&result)) return maybe_result;
672
+ }
673
+ }
674
+ return code;
675
+ }
676
+
677
+
678
+ MaybeObject* StubCache::ComputeStoreCallback(
679
+ String* name,
680
+ JSObject* receiver,
681
+ AccessorInfo* callback,
682
+ StrictModeFlag strict_mode) {
683
+ ASSERT(v8::ToCData<Address>(callback->setter()) != 0);
684
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
685
+ Code::STORE_IC, CALLBACKS, strict_mode);
686
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
687
+ if (code->IsUndefined()) {
688
+ StoreStubCompiler compiler(strict_mode);
689
+ { MaybeObject* maybe_code =
690
+ compiler.CompileStoreCallback(receiver, callback, name);
691
+ if (!maybe_code->ToObject(&code)) return maybe_code;
692
+ }
693
+ PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG, Code::cast(code), name));
694
+ GDBJIT(AddCode(GDBJITInterface::STORE_IC, name, Code::cast(code)));
695
+ Object* result;
696
+ { MaybeObject* maybe_result =
697
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
698
+ if (!maybe_result->ToObject(&result)) return maybe_result;
699
+ }
700
+ }
701
+ return code;
702
+ }
703
+
704
+
705
+ MaybeObject* StubCache::ComputeStoreInterceptor(
706
+ String* name,
707
+ JSObject* receiver,
708
+ StrictModeFlag strict_mode) {
709
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
710
+ Code::STORE_IC, INTERCEPTOR, strict_mode);
711
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
712
+ if (code->IsUndefined()) {
713
+ StoreStubCompiler compiler(strict_mode);
714
+ { MaybeObject* maybe_code =
715
+ compiler.CompileStoreInterceptor(receiver, name);
716
+ if (!maybe_code->ToObject(&code)) return maybe_code;
717
+ }
718
+ PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG, Code::cast(code), name));
719
+ GDBJIT(AddCode(GDBJITInterface::STORE_IC, name, Code::cast(code)));
720
+ Object* result;
721
+ { MaybeObject* maybe_result =
722
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
723
+ if (!maybe_result->ToObject(&result)) return maybe_result;
724
+ }
725
+ }
726
+ return code;
727
+ }
728
+
729
+
730
+ MaybeObject* StubCache::ComputeKeyedStoreField(String* name,
731
+ JSObject* receiver,
732
+ int field_index,
733
+ Map* transition,
734
+ StrictModeFlag strict_mode) {
735
+ PropertyType type = (transition == NULL) ? FIELD : MAP_TRANSITION;
736
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
737
+ Code::KEYED_STORE_IC, type, strict_mode);
738
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
739
+ if (code->IsUndefined()) {
740
+ KeyedStoreStubCompiler compiler(strict_mode);
741
+ { MaybeObject* maybe_code =
742
+ compiler.CompileStoreField(receiver, field_index, transition, name);
743
+ if (!maybe_code->ToObject(&code)) return maybe_code;
744
+ }
745
+ PROFILE(CodeCreateEvent(
746
+ Logger::KEYED_STORE_IC_TAG, Code::cast(code), name));
747
+ GDBJIT(AddCode(GDBJITInterface::KEYED_STORE_IC, name, Code::cast(code)));
748
+ Object* result;
749
+ { MaybeObject* maybe_result =
750
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
751
+ if (!maybe_result->ToObject(&result)) return maybe_result;
752
+ }
753
+ }
754
+ return code;
755
+ }
756
+
757
+ #define CALL_LOGGER_TAG(kind, type) \
758
+ (kind == Code::CALL_IC ? Logger::type : Logger::KEYED_##type)
759
+
760
+ MaybeObject* StubCache::ComputeCallConstant(int argc,
761
+ InLoopFlag in_loop,
762
+ Code::Kind kind,
763
+ Code::ExtraICState extra_ic_state,
764
+ String* name,
765
+ Object* object,
766
+ JSObject* holder,
767
+ JSFunction* function) {
768
+ // Compute the check type and the map.
769
+ InlineCacheHolderFlag cache_holder =
770
+ IC::GetCodeCacheForObject(object, holder);
771
+ JSObject* map_holder = IC::GetCodeCacheHolder(object, cache_holder);
772
+
773
+ // Compute check type based on receiver/holder.
774
+ CheckType check = RECEIVER_MAP_CHECK;
775
+ if (object->IsString()) {
776
+ check = STRING_CHECK;
777
+ } else if (object->IsNumber()) {
778
+ check = NUMBER_CHECK;
779
+ } else if (object->IsBoolean()) {
780
+ check = BOOLEAN_CHECK;
781
+ }
782
+
783
+ Code::Flags flags = Code::ComputeMonomorphicFlags(kind,
784
+ CONSTANT_FUNCTION,
785
+ extra_ic_state,
786
+ cache_holder,
787
+ in_loop,
788
+ argc);
789
+ Object* code = map_holder->map()->FindInCodeCache(name, flags);
790
+ if (code->IsUndefined()) {
791
+ // If the function hasn't been compiled yet, we cannot do it now
792
+ // because it may cause GC. To avoid this issue, we return an
793
+ // internal error which will make sure we do not update any
794
+ // caches.
795
+ if (!function->is_compiled()) return Failure::InternalError();
796
+ // Compile the stub - only create stubs for fully compiled functions.
797
+ CallStubCompiler compiler(
798
+ argc, in_loop, kind, extra_ic_state, cache_holder);
799
+ { MaybeObject* maybe_code =
800
+ compiler.CompileCallConstant(object, holder, function, name, check);
801
+ if (!maybe_code->ToObject(&code)) return maybe_code;
802
+ }
803
+ Code::cast(code)->set_check_type(check);
804
+ ASSERT_EQ(flags, Code::cast(code)->flags());
805
+ PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG),
806
+ Code::cast(code), name));
807
+ GDBJIT(AddCode(GDBJITInterface::CALL_IC, name, Code::cast(code)));
808
+ Object* result;
809
+ { MaybeObject* maybe_result =
810
+ map_holder->UpdateMapCodeCache(name, Code::cast(code));
811
+ if (!maybe_result->ToObject(&result)) return maybe_result;
812
+ }
813
+ }
814
+ return code;
815
+ }
816
+
817
+
818
+ MaybeObject* StubCache::ComputeCallField(int argc,
819
+ InLoopFlag in_loop,
820
+ Code::Kind kind,
821
+ String* name,
822
+ Object* object,
823
+ JSObject* holder,
824
+ int index) {
825
+ // Compute the check type and the map.
826
+ InlineCacheHolderFlag cache_holder =
827
+ IC::GetCodeCacheForObject(object, holder);
828
+ JSObject* map_holder = IC::GetCodeCacheHolder(object, cache_holder);
829
+
830
+ // TODO(1233596): We cannot do receiver map check for non-JS objects
831
+ // because they may be represented as immediates without a
832
+ // map. Instead, we check against the map in the holder.
833
+ if (object->IsNumber() || object->IsBoolean() || object->IsString()) {
834
+ object = holder;
835
+ }
836
+
837
+ Code::Flags flags = Code::ComputeMonomorphicFlags(kind,
838
+ FIELD,
839
+ Code::kNoExtraICState,
840
+ cache_holder,
841
+ in_loop,
842
+ argc);
843
+ Object* code = map_holder->map()->FindInCodeCache(name, flags);
844
+ if (code->IsUndefined()) {
845
+ CallStubCompiler compiler(
846
+ argc, in_loop, kind, Code::kNoExtraICState, cache_holder);
847
+ { MaybeObject* maybe_code =
848
+ compiler.CompileCallField(JSObject::cast(object),
849
+ holder,
850
+ index,
851
+ name);
852
+ if (!maybe_code->ToObject(&code)) return maybe_code;
853
+ }
854
+ ASSERT_EQ(flags, Code::cast(code)->flags());
855
+ PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG),
856
+ Code::cast(code), name));
857
+ GDBJIT(AddCode(GDBJITInterface::CALL_IC, name, Code::cast(code)));
858
+ Object* result;
859
+ { MaybeObject* maybe_result =
860
+ map_holder->UpdateMapCodeCache(name, Code::cast(code));
861
+ if (!maybe_result->ToObject(&result)) return maybe_result;
862
+ }
863
+ }
864
+ return code;
865
+ }
866
+
867
+
868
+ MaybeObject* StubCache::ComputeCallInterceptor(int argc,
869
+ Code::Kind kind,
870
+ String* name,
871
+ Object* object,
872
+ JSObject* holder) {
873
+ // Compute the check type and the map.
874
+ InlineCacheHolderFlag cache_holder =
875
+ IC::GetCodeCacheForObject(object, holder);
876
+ JSObject* map_holder = IC::GetCodeCacheHolder(object, cache_holder);
877
+
878
+ // TODO(1233596): We cannot do receiver map check for non-JS objects
879
+ // because they may be represented as immediates without a
880
+ // map. Instead, we check against the map in the holder.
881
+ if (object->IsNumber() || object->IsBoolean() || object->IsString()) {
882
+ object = holder;
883
+ }
884
+
885
+ Code::Flags flags = Code::ComputeMonomorphicFlags(kind,
886
+ INTERCEPTOR,
887
+ Code::kNoExtraICState,
888
+ cache_holder,
889
+ NOT_IN_LOOP,
890
+ argc);
891
+ Object* code = map_holder->map()->FindInCodeCache(name, flags);
892
+ if (code->IsUndefined()) {
893
+ CallStubCompiler compiler(
894
+ argc, NOT_IN_LOOP, kind, Code::kNoExtraICState, cache_holder);
895
+ { MaybeObject* maybe_code =
896
+ compiler.CompileCallInterceptor(JSObject::cast(object), holder, name);
897
+ if (!maybe_code->ToObject(&code)) return maybe_code;
898
+ }
899
+ ASSERT_EQ(flags, Code::cast(code)->flags());
900
+ PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG),
901
+ Code::cast(code), name));
902
+ GDBJIT(AddCode(GDBJITInterface::CALL_IC, name, Code::cast(code)));
903
+ Object* result;
904
+ { MaybeObject* maybe_result =
905
+ map_holder->UpdateMapCodeCache(name, Code::cast(code));
906
+ if (!maybe_result->ToObject(&result)) return maybe_result;
907
+ }
908
+ }
909
+ return code;
910
+ }
911
+
912
+
913
+ MaybeObject* StubCache::ComputeCallNormal(int argc,
914
+ InLoopFlag in_loop,
915
+ Code::Kind kind,
916
+ String* name,
917
+ JSObject* receiver) {
918
+ Object* code;
919
+ { MaybeObject* maybe_code = ComputeCallNormal(argc, in_loop, kind);
920
+ if (!maybe_code->ToObject(&code)) return maybe_code;
921
+ }
922
+ return code;
923
+ }
924
+
925
+
926
+ MaybeObject* StubCache::ComputeCallGlobal(int argc,
927
+ InLoopFlag in_loop,
928
+ Code::Kind kind,
929
+ String* name,
930
+ JSObject* receiver,
931
+ GlobalObject* holder,
932
+ JSGlobalPropertyCell* cell,
933
+ JSFunction* function) {
934
+ InlineCacheHolderFlag cache_holder =
935
+ IC::GetCodeCacheForObject(receiver, holder);
936
+ JSObject* map_holder = IC::GetCodeCacheHolder(receiver, cache_holder);
937
+ Code::Flags flags = Code::ComputeMonomorphicFlags(kind,
938
+ NORMAL,
939
+ Code::kNoExtraICState,
940
+ cache_holder,
941
+ in_loop,
942
+ argc);
943
+ Object* code = map_holder->map()->FindInCodeCache(name, flags);
944
+ if (code->IsUndefined()) {
945
+ // If the function hasn't been compiled yet, we cannot do it now
946
+ // because it may cause GC. To avoid this issue, we return an
947
+ // internal error which will make sure we do not update any
948
+ // caches.
949
+ if (!function->is_compiled()) return Failure::InternalError();
950
+ CallStubCompiler compiler(
951
+ argc, in_loop, kind, Code::kNoExtraICState, cache_holder);
952
+ { MaybeObject* maybe_code =
953
+ compiler.CompileCallGlobal(receiver, holder, cell, function, name);
954
+ if (!maybe_code->ToObject(&code)) return maybe_code;
955
+ }
956
+ ASSERT_EQ(flags, Code::cast(code)->flags());
957
+ PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG),
958
+ Code::cast(code), name));
959
+ GDBJIT(AddCode(GDBJITInterface::CALL_IC, name, Code::cast(code)));
960
+ Object* result;
961
+ { MaybeObject* maybe_result =
962
+ map_holder->UpdateMapCodeCache(name, Code::cast(code));
963
+ if (!maybe_result->ToObject(&result)) return maybe_result;
964
+ }
965
+ }
966
+ return code;
967
+ }
968
+
969
+
970
+ static Object* GetProbeValue(Code::Flags flags) {
971
+ // Use raw_unchecked... so we don't get assert failures during GC.
972
+ NumberDictionary* dictionary = Heap::raw_unchecked_non_monomorphic_cache();
973
+ int entry = dictionary->FindEntry(flags);
974
+ if (entry != -1) return dictionary->ValueAt(entry);
975
+ return Heap::raw_unchecked_undefined_value();
976
+ }
977
+
978
+
979
+ MUST_USE_RESULT static MaybeObject* ProbeCache(Code::Flags flags) {
980
+ Object* probe = GetProbeValue(flags);
981
+ if (probe != Heap::undefined_value()) return probe;
982
+ // Seed the cache with an undefined value to make sure that any
983
+ // generated code object can always be inserted into the cache
984
+ // without causing allocation failures.
985
+ Object* result;
986
+ { MaybeObject* maybe_result =
987
+ Heap::non_monomorphic_cache()->AtNumberPut(flags,
988
+ Heap::undefined_value());
989
+ if (!maybe_result->ToObject(&result)) return maybe_result;
990
+ }
991
+ Heap::public_set_non_monomorphic_cache(NumberDictionary::cast(result));
992
+ return probe;
993
+ }
994
+
995
+
996
+ static MaybeObject* FillCache(MaybeObject* maybe_code) {
997
+ Object* code;
998
+ if (maybe_code->ToObject(&code)) {
999
+ if (code->IsCode()) {
1000
+ int entry =
1001
+ Heap::non_monomorphic_cache()->FindEntry(
1002
+ Code::cast(code)->flags());
1003
+ // The entry must be present see comment in ProbeCache.
1004
+ ASSERT(entry != -1);
1005
+ ASSERT(Heap::non_monomorphic_cache()->ValueAt(entry) ==
1006
+ Heap::undefined_value());
1007
+ Heap::non_monomorphic_cache()->ValueAtPut(entry, code);
1008
+ CHECK(GetProbeValue(Code::cast(code)->flags()) == code);
1009
+ }
1010
+ }
1011
+ return maybe_code;
1012
+ }
1013
+
1014
+
1015
+ Code* StubCache::FindCallInitialize(int argc,
1016
+ InLoopFlag in_loop,
1017
+ Code::Kind kind) {
1018
+ Code::Flags flags = Code::ComputeFlags(kind,
1019
+ in_loop,
1020
+ UNINITIALIZED,
1021
+ Code::kNoExtraICState,
1022
+ NORMAL,
1023
+ argc);
1024
+ Object* result = ProbeCache(flags)->ToObjectUnchecked();
1025
+ ASSERT(!result->IsUndefined());
1026
+ // This might be called during the marking phase of the collector
1027
+ // hence the unchecked cast.
1028
+ return reinterpret_cast<Code*>(result);
1029
+ }
1030
+
1031
+
1032
+ MaybeObject* StubCache::ComputeCallInitialize(int argc,
1033
+ InLoopFlag in_loop,
1034
+ Code::Kind kind) {
1035
+ Code::Flags flags = Code::ComputeFlags(kind,
1036
+ in_loop,
1037
+ UNINITIALIZED,
1038
+ Code::kNoExtraICState,
1039
+ NORMAL,
1040
+ argc);
1041
+ Object* probe;
1042
+ { MaybeObject* maybe_probe = ProbeCache(flags);
1043
+ if (!maybe_probe->ToObject(&probe)) return maybe_probe;
1044
+ }
1045
+ if (!probe->IsUndefined()) return probe;
1046
+ StubCompiler compiler;
1047
+ return FillCache(compiler.CompileCallInitialize(flags));
1048
+ }
1049
+
1050
+
1051
+ Handle<Code> StubCache::ComputeCallInitialize(int argc, InLoopFlag in_loop) {
1052
+ if (in_loop == IN_LOOP) {
1053
+ // Force the creation of the corresponding stub outside loops,
1054
+ // because it may be used when clearing the ICs later - it is
1055
+ // possible for a series of IC transitions to lose the in-loop
1056
+ // information, and the IC clearing code can't generate a stub
1057
+ // that it needs so we need to ensure it is generated already.
1058
+ ComputeCallInitialize(argc, NOT_IN_LOOP);
1059
+ }
1060
+ CALL_HEAP_FUNCTION(ComputeCallInitialize(argc, in_loop, Code::CALL_IC), Code);
1061
+ }
1062
+
1063
+
1064
+ Handle<Code> StubCache::ComputeKeyedCallInitialize(int argc,
1065
+ InLoopFlag in_loop) {
1066
+ if (in_loop == IN_LOOP) {
1067
+ // Force the creation of the corresponding stub outside loops,
1068
+ // because it may be used when clearing the ICs later - it is
1069
+ // possible for a series of IC transitions to lose the in-loop
1070
+ // information, and the IC clearing code can't generate a stub
1071
+ // that it needs so we need to ensure it is generated already.
1072
+ ComputeKeyedCallInitialize(argc, NOT_IN_LOOP);
1073
+ }
1074
+ CALL_HEAP_FUNCTION(
1075
+ ComputeCallInitialize(argc, in_loop, Code::KEYED_CALL_IC), Code);
1076
+ }
1077
+
1078
+
1079
+ MaybeObject* StubCache::ComputeCallPreMonomorphic(int argc,
1080
+ InLoopFlag in_loop,
1081
+ Code::Kind kind) {
1082
+ Code::Flags flags = Code::ComputeFlags(kind,
1083
+ in_loop,
1084
+ PREMONOMORPHIC,
1085
+ Code::kNoExtraICState,
1086
+ NORMAL,
1087
+ argc);
1088
+ Object* probe;
1089
+ { MaybeObject* maybe_probe = ProbeCache(flags);
1090
+ if (!maybe_probe->ToObject(&probe)) return maybe_probe;
1091
+ }
1092
+ if (!probe->IsUndefined()) return probe;
1093
+ StubCompiler compiler;
1094
+ return FillCache(compiler.CompileCallPreMonomorphic(flags));
1095
+ }
1096
+
1097
+
1098
+ MaybeObject* StubCache::ComputeCallNormal(int argc,
1099
+ InLoopFlag in_loop,
1100
+ Code::Kind kind) {
1101
+ Code::Flags flags = Code::ComputeFlags(kind,
1102
+ in_loop,
1103
+ MONOMORPHIC,
1104
+ Code::kNoExtraICState,
1105
+ NORMAL,
1106
+ argc);
1107
+ Object* probe;
1108
+ { MaybeObject* maybe_probe = ProbeCache(flags);
1109
+ if (!maybe_probe->ToObject(&probe)) return maybe_probe;
1110
+ }
1111
+ if (!probe->IsUndefined()) return probe;
1112
+ StubCompiler compiler;
1113
+ return FillCache(compiler.CompileCallNormal(flags));
1114
+ }
1115
+
1116
+
1117
+ MaybeObject* StubCache::ComputeCallMegamorphic(int argc,
1118
+ InLoopFlag in_loop,
1119
+ Code::Kind kind) {
1120
+ Code::Flags flags = Code::ComputeFlags(kind,
1121
+ in_loop,
1122
+ MEGAMORPHIC,
1123
+ Code::kNoExtraICState,
1124
+ NORMAL,
1125
+ argc);
1126
+ Object* probe;
1127
+ { MaybeObject* maybe_probe = ProbeCache(flags);
1128
+ if (!maybe_probe->ToObject(&probe)) return maybe_probe;
1129
+ }
1130
+ if (!probe->IsUndefined()) return probe;
1131
+ StubCompiler compiler;
1132
+ return FillCache(compiler.CompileCallMegamorphic(flags));
1133
+ }
1134
+
1135
+
1136
+ MaybeObject* StubCache::ComputeCallMiss(int argc, Code::Kind kind) {
1137
+ // MONOMORPHIC_PROTOTYPE_FAILURE state is used to make sure that miss stubs
1138
+ // and monomorphic stubs are not mixed up together in the stub cache.
1139
+ Code::Flags flags = Code::ComputeFlags(kind,
1140
+ NOT_IN_LOOP,
1141
+ MONOMORPHIC_PROTOTYPE_FAILURE,
1142
+ Code::kNoExtraICState,
1143
+ NORMAL,
1144
+ argc,
1145
+ OWN_MAP);
1146
+ Object* probe;
1147
+ { MaybeObject* maybe_probe = ProbeCache(flags);
1148
+ if (!maybe_probe->ToObject(&probe)) return maybe_probe;
1149
+ }
1150
+ if (!probe->IsUndefined()) return probe;
1151
+ StubCompiler compiler;
1152
+ return FillCache(compiler.CompileCallMiss(flags));
1153
+ }
1154
+
1155
+
1156
+ #ifdef ENABLE_DEBUGGER_SUPPORT
1157
+ MaybeObject* StubCache::ComputeCallDebugBreak(int argc, Code::Kind kind) {
1158
+ Code::Flags flags = Code::ComputeFlags(kind,
1159
+ NOT_IN_LOOP,
1160
+ DEBUG_BREAK,
1161
+ Code::kNoExtraICState,
1162
+ NORMAL,
1163
+ argc);
1164
+ Object* probe;
1165
+ { MaybeObject* maybe_probe = ProbeCache(flags);
1166
+ if (!maybe_probe->ToObject(&probe)) return maybe_probe;
1167
+ }
1168
+ if (!probe->IsUndefined()) return probe;
1169
+ StubCompiler compiler;
1170
+ return FillCache(compiler.CompileCallDebugBreak(flags));
1171
+ }
1172
+
1173
+
1174
+ MaybeObject* StubCache::ComputeCallDebugPrepareStepIn(int argc,
1175
+ Code::Kind kind) {
1176
+ Code::Flags flags = Code::ComputeFlags(kind,
1177
+ NOT_IN_LOOP,
1178
+ DEBUG_PREPARE_STEP_IN,
1179
+ Code::kNoExtraICState,
1180
+ NORMAL,
1181
+ argc);
1182
+ Object* probe;
1183
+ { MaybeObject* maybe_probe = ProbeCache(flags);
1184
+ if (!maybe_probe->ToObject(&probe)) return maybe_probe;
1185
+ }
1186
+ if (!probe->IsUndefined()) return probe;
1187
+ StubCompiler compiler;
1188
+ return FillCache(compiler.CompileCallDebugPrepareStepIn(flags));
1189
+ }
1190
+ #endif
1191
+
1192
+
1193
+ void StubCache::Clear() {
1194
+ for (int i = 0; i < kPrimaryTableSize; i++) {
1195
+ primary_[i].key = Heap::empty_string();
1196
+ primary_[i].value = Builtins::builtin(Builtins::Illegal);
1197
+ }
1198
+ for (int j = 0; j < kSecondaryTableSize; j++) {
1199
+ secondary_[j].key = Heap::empty_string();
1200
+ secondary_[j].value = Builtins::builtin(Builtins::Illegal);
1201
+ }
1202
+ }
1203
+
1204
+
1205
+ void StubCache::CollectMatchingMaps(ZoneMapList* types,
1206
+ String* name,
1207
+ Code::Flags flags) {
1208
+ for (int i = 0; i < kPrimaryTableSize; i++) {
1209
+ if (primary_[i].key == name) {
1210
+ Map* map = primary_[i].value->FindFirstMap();
1211
+ // Map can be NULL, if the stub is constant function call
1212
+ // with a primitive receiver.
1213
+ if (map == NULL) continue;
1214
+
1215
+ int offset = PrimaryOffset(name, flags, map);
1216
+ if (entry(primary_, offset) == &primary_[i]) {
1217
+ types->Add(Handle<Map>(map));
1218
+ }
1219
+ }
1220
+ }
1221
+
1222
+ for (int i = 0; i < kSecondaryTableSize; i++) {
1223
+ if (secondary_[i].key == name) {
1224
+ Map* map = secondary_[i].value->FindFirstMap();
1225
+ // Map can be NULL, if the stub is constant function call
1226
+ // with a primitive receiver.
1227
+ if (map == NULL) continue;
1228
+
1229
+ // Lookup in primary table and skip duplicates.
1230
+ int primary_offset = PrimaryOffset(name, flags, map);
1231
+ Entry* primary_entry = entry(primary_, primary_offset);
1232
+ if (primary_entry->key == name) {
1233
+ Map* primary_map = primary_entry->value->FindFirstMap();
1234
+ if (map == primary_map) continue;
1235
+ }
1236
+
1237
+ // Lookup in secondary table and add matches.
1238
+ int offset = SecondaryOffset(name, flags, primary_offset);
1239
+ if (entry(secondary_, offset) == &secondary_[i]) {
1240
+ types->Add(Handle<Map>(map));
1241
+ }
1242
+ }
1243
+ }
1244
+ }
1245
+
1246
+
1247
+ // ------------------------------------------------------------------------
1248
+ // StubCompiler implementation.
1249
+
1250
+
1251
+ MaybeObject* LoadCallbackProperty(Arguments args) {
1252
+ ASSERT(args[0]->IsJSObject());
1253
+ ASSERT(args[1]->IsJSObject());
1254
+ AccessorInfo* callback = AccessorInfo::cast(args[3]);
1255
+ Address getter_address = v8::ToCData<Address>(callback->getter());
1256
+ v8::AccessorGetter fun = FUNCTION_CAST<v8::AccessorGetter>(getter_address);
1257
+ ASSERT(fun != NULL);
1258
+ v8::AccessorInfo info(&args[0]);
1259
+ HandleScope scope;
1260
+ v8::Handle<v8::Value> result;
1261
+ {
1262
+ // Leaving JavaScript.
1263
+ VMState state(EXTERNAL);
1264
+ ExternalCallbackScope call_scope(getter_address);
1265
+ result = fun(v8::Utils::ToLocal(args.at<String>(4)), info);
1266
+ }
1267
+ RETURN_IF_SCHEDULED_EXCEPTION();
1268
+ if (result.IsEmpty()) return Heap::undefined_value();
1269
+ return *v8::Utils::OpenHandle(*result);
1270
+ }
1271
+
1272
+
1273
+ MaybeObject* StoreCallbackProperty(Arguments args) {
1274
+ JSObject* recv = JSObject::cast(args[0]);
1275
+ AccessorInfo* callback = AccessorInfo::cast(args[1]);
1276
+ Address setter_address = v8::ToCData<Address>(callback->setter());
1277
+ v8::AccessorSetter fun = FUNCTION_CAST<v8::AccessorSetter>(setter_address);
1278
+ ASSERT(fun != NULL);
1279
+ Handle<String> name = args.at<String>(2);
1280
+ Handle<Object> value = args.at<Object>(3);
1281
+ HandleScope scope;
1282
+ LOG(ApiNamedPropertyAccess("store", recv, *name));
1283
+ CustomArguments custom_args(callback->data(), recv, recv);
1284
+ v8::AccessorInfo info(custom_args.end());
1285
+ {
1286
+ // Leaving JavaScript.
1287
+ VMState state(EXTERNAL);
1288
+ ExternalCallbackScope call_scope(setter_address);
1289
+ fun(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info);
1290
+ }
1291
+ RETURN_IF_SCHEDULED_EXCEPTION();
1292
+ return *value;
1293
+ }
1294
+
1295
+
1296
+ static const int kAccessorInfoOffsetInInterceptorArgs = 2;
1297
+
1298
+
1299
+ /**
1300
+ * Attempts to load a property with an interceptor (which must be present),
1301
+ * but doesn't search the prototype chain.
1302
+ *
1303
+ * Returns |Heap::no_interceptor_result_sentinel()| if interceptor doesn't
1304
+ * provide any value for the given name.
1305
+ */
1306
+ MaybeObject* LoadPropertyWithInterceptorOnly(Arguments args) {
1307
+ Handle<String> name_handle = args.at<String>(0);
1308
+ Handle<InterceptorInfo> interceptor_info = args.at<InterceptorInfo>(1);
1309
+ ASSERT(kAccessorInfoOffsetInInterceptorArgs == 2);
1310
+ ASSERT(args[2]->IsJSObject()); // Receiver.
1311
+ ASSERT(args[3]->IsJSObject()); // Holder.
1312
+ ASSERT(args.length() == 5); // Last arg is data object.
1313
+
1314
+ Address getter_address = v8::ToCData<Address>(interceptor_info->getter());
1315
+ v8::NamedPropertyGetter getter =
1316
+ FUNCTION_CAST<v8::NamedPropertyGetter>(getter_address);
1317
+ ASSERT(getter != NULL);
1318
+
1319
+ {
1320
+ // Use the interceptor getter.
1321
+ v8::AccessorInfo info(args.arguments() -
1322
+ kAccessorInfoOffsetInInterceptorArgs);
1323
+ HandleScope scope;
1324
+ v8::Handle<v8::Value> r;
1325
+ {
1326
+ // Leaving JavaScript.
1327
+ VMState state(EXTERNAL);
1328
+ r = getter(v8::Utils::ToLocal(name_handle), info);
1329
+ }
1330
+ RETURN_IF_SCHEDULED_EXCEPTION();
1331
+ if (!r.IsEmpty()) {
1332
+ return *v8::Utils::OpenHandle(*r);
1333
+ }
1334
+ }
1335
+
1336
+ return Heap::no_interceptor_result_sentinel();
1337
+ }
1338
+
1339
+
1340
+ static MaybeObject* ThrowReferenceError(String* name) {
1341
+ // If the load is non-contextual, just return the undefined result.
1342
+ // Note that both keyed and non-keyed loads may end up here, so we
1343
+ // can't use either LoadIC or KeyedLoadIC constructors.
1344
+ IC ic(IC::NO_EXTRA_FRAME);
1345
+ ASSERT(ic.target()->is_load_stub() || ic.target()->is_keyed_load_stub());
1346
+ if (!ic.SlowIsContextual()) return Heap::undefined_value();
1347
+
1348
+ // Throw a reference error.
1349
+ HandleScope scope;
1350
+ Handle<String> name_handle(name);
1351
+ Handle<Object> error =
1352
+ Factory::NewReferenceError("not_defined",
1353
+ HandleVector(&name_handle, 1));
1354
+ return Top::Throw(*error);
1355
+ }
1356
+
1357
+
1358
+ static MaybeObject* LoadWithInterceptor(Arguments* args,
1359
+ PropertyAttributes* attrs) {
1360
+ Handle<String> name_handle = args->at<String>(0);
1361
+ Handle<InterceptorInfo> interceptor_info = args->at<InterceptorInfo>(1);
1362
+ ASSERT(kAccessorInfoOffsetInInterceptorArgs == 2);
1363
+ Handle<JSObject> receiver_handle = args->at<JSObject>(2);
1364
+ Handle<JSObject> holder_handle = args->at<JSObject>(3);
1365
+ ASSERT(args->length() == 5); // Last arg is data object.
1366
+
1367
+ Address getter_address = v8::ToCData<Address>(interceptor_info->getter());
1368
+ v8::NamedPropertyGetter getter =
1369
+ FUNCTION_CAST<v8::NamedPropertyGetter>(getter_address);
1370
+ ASSERT(getter != NULL);
1371
+
1372
+ {
1373
+ // Use the interceptor getter.
1374
+ v8::AccessorInfo info(args->arguments() -
1375
+ kAccessorInfoOffsetInInterceptorArgs);
1376
+ HandleScope scope;
1377
+ v8::Handle<v8::Value> r;
1378
+ {
1379
+ // Leaving JavaScript.
1380
+ VMState state(EXTERNAL);
1381
+ r = getter(v8::Utils::ToLocal(name_handle), info);
1382
+ }
1383
+ RETURN_IF_SCHEDULED_EXCEPTION();
1384
+ if (!r.IsEmpty()) {
1385
+ *attrs = NONE;
1386
+ return *v8::Utils::OpenHandle(*r);
1387
+ }
1388
+ }
1389
+
1390
+ MaybeObject* result = holder_handle->GetPropertyPostInterceptor(
1391
+ *receiver_handle,
1392
+ *name_handle,
1393
+ attrs);
1394
+ RETURN_IF_SCHEDULED_EXCEPTION();
1395
+ return result;
1396
+ }
1397
+
1398
+
1399
+ /**
1400
+ * Loads a property with an interceptor performing post interceptor
1401
+ * lookup if interceptor failed.
1402
+ */
1403
+ MaybeObject* LoadPropertyWithInterceptorForLoad(Arguments args) {
1404
+ PropertyAttributes attr = NONE;
1405
+ Object* result;
1406
+ { MaybeObject* maybe_result = LoadWithInterceptor(&args, &attr);
1407
+ if (!maybe_result->ToObject(&result)) return maybe_result;
1408
+ }
1409
+
1410
+ // If the property is present, return it.
1411
+ if (attr != ABSENT) return result;
1412
+ return ThrowReferenceError(String::cast(args[0]));
1413
+ }
1414
+
1415
+
1416
+ MaybeObject* LoadPropertyWithInterceptorForCall(Arguments args) {
1417
+ PropertyAttributes attr;
1418
+ MaybeObject* result = LoadWithInterceptor(&args, &attr);
1419
+ RETURN_IF_SCHEDULED_EXCEPTION();
1420
+ // This is call IC. In this case, we simply return the undefined result which
1421
+ // will lead to an exception when trying to invoke the result as a
1422
+ // function.
1423
+ return result;
1424
+ }
1425
+
1426
+
1427
+ MaybeObject* StoreInterceptorProperty(Arguments args) {
1428
+ ASSERT(args.length() == 4);
1429
+ JSObject* recv = JSObject::cast(args[0]);
1430
+ String* name = String::cast(args[1]);
1431
+ Object* value = args[2];
1432
+ StrictModeFlag strict =
1433
+ static_cast<StrictModeFlag>(Smi::cast(args[3])->value());
1434
+ ASSERT(strict == kStrictMode || strict == kNonStrictMode);
1435
+ ASSERT(recv->HasNamedInterceptor());
1436
+ PropertyAttributes attr = NONE;
1437
+ MaybeObject* result = recv->SetPropertyWithInterceptor(
1438
+ name, value, attr, strict);
1439
+ return result;
1440
+ }
1441
+
1442
+
1443
+ MaybeObject* KeyedLoadPropertyWithInterceptor(Arguments args) {
1444
+ JSObject* receiver = JSObject::cast(args[0]);
1445
+ ASSERT(Smi::cast(args[1])->value() >= 0);
1446
+ uint32_t index = Smi::cast(args[1])->value();
1447
+ return receiver->GetElementWithInterceptor(receiver, index);
1448
+ }
1449
+
1450
+
1451
+ MaybeObject* StubCompiler::CompileCallInitialize(Code::Flags flags) {
1452
+ HandleScope scope;
1453
+ int argc = Code::ExtractArgumentsCountFromFlags(flags);
1454
+ Code::Kind kind = Code::ExtractKindFromFlags(flags);
1455
+ if (kind == Code::CALL_IC) {
1456
+ CallIC::GenerateInitialize(masm(), argc);
1457
+ } else {
1458
+ KeyedCallIC::GenerateInitialize(masm(), argc);
1459
+ }
1460
+ Object* result;
1461
+ { MaybeObject* maybe_result =
1462
+ GetCodeWithFlags(flags, "CompileCallInitialize");
1463
+ if (!maybe_result->ToObject(&result)) return maybe_result;
1464
+ }
1465
+ Counters::call_initialize_stubs.Increment();
1466
+ Code* code = Code::cast(result);
1467
+ USE(code);
1468
+ PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_INITIALIZE_TAG),
1469
+ code, code->arguments_count()));
1470
+ GDBJIT(AddCode(GDBJITInterface::CALL_INITIALIZE, Code::cast(code)));
1471
+ return result;
1472
+ }
1473
+
1474
+
1475
+ MaybeObject* StubCompiler::CompileCallPreMonomorphic(Code::Flags flags) {
1476
+ HandleScope scope;
1477
+ int argc = Code::ExtractArgumentsCountFromFlags(flags);
1478
+ // The code of the PreMonomorphic stub is the same as the code
1479
+ // of the Initialized stub. They just differ on the code object flags.
1480
+ Code::Kind kind = Code::ExtractKindFromFlags(flags);
1481
+ if (kind == Code::CALL_IC) {
1482
+ CallIC::GenerateInitialize(masm(), argc);
1483
+ } else {
1484
+ KeyedCallIC::GenerateInitialize(masm(), argc);
1485
+ }
1486
+ Object* result;
1487
+ { MaybeObject* maybe_result =
1488
+ GetCodeWithFlags(flags, "CompileCallPreMonomorphic");
1489
+ if (!maybe_result->ToObject(&result)) return maybe_result;
1490
+ }
1491
+ Counters::call_premonomorphic_stubs.Increment();
1492
+ Code* code = Code::cast(result);
1493
+ USE(code);
1494
+ PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_PRE_MONOMORPHIC_TAG),
1495
+ code, code->arguments_count()));
1496
+ GDBJIT(AddCode(GDBJITInterface::CALL_PRE_MONOMORPHIC, Code::cast(code)));
1497
+ return result;
1498
+ }
1499
+
1500
+
1501
+ MaybeObject* StubCompiler::CompileCallNormal(Code::Flags flags) {
1502
+ HandleScope scope;
1503
+ int argc = Code::ExtractArgumentsCountFromFlags(flags);
1504
+ Code::Kind kind = Code::ExtractKindFromFlags(flags);
1505
+ if (kind == Code::CALL_IC) {
1506
+ CallIC::GenerateNormal(masm(), argc);
1507
+ } else {
1508
+ KeyedCallIC::GenerateNormal(masm(), argc);
1509
+ }
1510
+ Object* result;
1511
+ { MaybeObject* maybe_result = GetCodeWithFlags(flags, "CompileCallNormal");
1512
+ if (!maybe_result->ToObject(&result)) return maybe_result;
1513
+ }
1514
+ Counters::call_normal_stubs.Increment();
1515
+ Code* code = Code::cast(result);
1516
+ USE(code);
1517
+ PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_NORMAL_TAG),
1518
+ code, code->arguments_count()));
1519
+ GDBJIT(AddCode(GDBJITInterface::CALL_NORMAL, Code::cast(code)));
1520
+ return result;
1521
+ }
1522
+
1523
+
1524
+ MaybeObject* StubCompiler::CompileCallMegamorphic(Code::Flags flags) {
1525
+ HandleScope scope;
1526
+ int argc = Code::ExtractArgumentsCountFromFlags(flags);
1527
+ Code::Kind kind = Code::ExtractKindFromFlags(flags);
1528
+ if (kind == Code::CALL_IC) {
1529
+ CallIC::GenerateMegamorphic(masm(), argc);
1530
+ } else {
1531
+ KeyedCallIC::GenerateMegamorphic(masm(), argc);
1532
+ }
1533
+
1534
+ Object* result;
1535
+ { MaybeObject* maybe_result =
1536
+ GetCodeWithFlags(flags, "CompileCallMegamorphic");
1537
+ if (!maybe_result->ToObject(&result)) return maybe_result;
1538
+ }
1539
+ Counters::call_megamorphic_stubs.Increment();
1540
+ Code* code = Code::cast(result);
1541
+ USE(code);
1542
+ PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MEGAMORPHIC_TAG),
1543
+ code, code->arguments_count()));
1544
+ GDBJIT(AddCode(GDBJITInterface::CALL_MEGAMORPHIC, Code::cast(code)));
1545
+ return result;
1546
+ }
1547
+
1548
+
1549
+ MaybeObject* StubCompiler::CompileCallMiss(Code::Flags flags) {
1550
+ HandleScope scope;
1551
+ int argc = Code::ExtractArgumentsCountFromFlags(flags);
1552
+ Code::Kind kind = Code::ExtractKindFromFlags(flags);
1553
+ if (kind == Code::CALL_IC) {
1554
+ CallIC::GenerateMiss(masm(), argc);
1555
+ } else {
1556
+ KeyedCallIC::GenerateMiss(masm(), argc);
1557
+ }
1558
+ Object* result;
1559
+ { MaybeObject* maybe_result = GetCodeWithFlags(flags, "CompileCallMiss");
1560
+ if (!maybe_result->ToObject(&result)) return maybe_result;
1561
+ }
1562
+ Counters::call_megamorphic_stubs.Increment();
1563
+ Code* code = Code::cast(result);
1564
+ USE(code);
1565
+ PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MISS_TAG),
1566
+ code, code->arguments_count()));
1567
+ GDBJIT(AddCode(GDBJITInterface::CALL_MISS, Code::cast(code)));
1568
+ return result;
1569
+ }
1570
+
1571
+
1572
+ #ifdef ENABLE_DEBUGGER_SUPPORT
1573
+ MaybeObject* StubCompiler::CompileCallDebugBreak(Code::Flags flags) {
1574
+ HandleScope scope;
1575
+ Debug::GenerateCallICDebugBreak(masm());
1576
+ Object* result;
1577
+ { MaybeObject* maybe_result =
1578
+ GetCodeWithFlags(flags, "CompileCallDebugBreak");
1579
+ if (!maybe_result->ToObject(&result)) return maybe_result;
1580
+ }
1581
+ Code* code = Code::cast(result);
1582
+ USE(code);
1583
+ Code::Kind kind = Code::ExtractKindFromFlags(flags);
1584
+ USE(kind);
1585
+ PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_DEBUG_BREAK_TAG),
1586
+ code, code->arguments_count()));
1587
+ return result;
1588
+ }
1589
+
1590
+
1591
+ MaybeObject* StubCompiler::CompileCallDebugPrepareStepIn(Code::Flags flags) {
1592
+ HandleScope scope;
1593
+ // Use the same code for the the step in preparations as we do for
1594
+ // the miss case.
1595
+ int argc = Code::ExtractArgumentsCountFromFlags(flags);
1596
+ Code::Kind kind = Code::ExtractKindFromFlags(flags);
1597
+ if (kind == Code::CALL_IC) {
1598
+ CallIC::GenerateMiss(masm(), argc);
1599
+ } else {
1600
+ KeyedCallIC::GenerateMiss(masm(), argc);
1601
+ }
1602
+ Object* result;
1603
+ { MaybeObject* maybe_result =
1604
+ GetCodeWithFlags(flags, "CompileCallDebugPrepareStepIn");
1605
+ if (!maybe_result->ToObject(&result)) return maybe_result;
1606
+ }
1607
+ Code* code = Code::cast(result);
1608
+ USE(code);
1609
+ PROFILE(CodeCreateEvent(
1610
+ CALL_LOGGER_TAG(kind, CALL_DEBUG_PREPARE_STEP_IN_TAG),
1611
+ code,
1612
+ code->arguments_count()));
1613
+ return result;
1614
+ }
1615
+ #endif
1616
+
1617
+ #undef CALL_LOGGER_TAG
1618
+
1619
+ MaybeObject* StubCompiler::GetCodeWithFlags(Code::Flags flags,
1620
+ const char* name) {
1621
+ // Check for allocation failures during stub compilation.
1622
+ if (failure_->IsFailure()) return failure_;
1623
+
1624
+ // Create code object in the heap.
1625
+ CodeDesc desc;
1626
+ masm_.GetCode(&desc);
1627
+ MaybeObject* result = Heap::CreateCode(desc, flags, masm_.CodeObject());
1628
+ #ifdef ENABLE_DISASSEMBLER
1629
+ if (FLAG_print_code_stubs && !result->IsFailure()) {
1630
+ Code::cast(result->ToObjectUnchecked())->Disassemble(name);
1631
+ }
1632
+ #endif
1633
+ return result;
1634
+ }
1635
+
1636
+
1637
+ MaybeObject* StubCompiler::GetCodeWithFlags(Code::Flags flags, String* name) {
1638
+ if (FLAG_print_code_stubs && (name != NULL)) {
1639
+ return GetCodeWithFlags(flags, *name->ToCString());
1640
+ }
1641
+ return GetCodeWithFlags(flags, reinterpret_cast<char*>(NULL));
1642
+ }
1643
+
1644
+
1645
+ void StubCompiler::LookupPostInterceptor(JSObject* holder,
1646
+ String* name,
1647
+ LookupResult* lookup) {
1648
+ holder->LocalLookupRealNamedProperty(name, lookup);
1649
+ if (!lookup->IsProperty()) {
1650
+ lookup->NotFound();
1651
+ Object* proto = holder->GetPrototype();
1652
+ if (proto != Heap::null_value()) {
1653
+ proto->Lookup(name, lookup);
1654
+ }
1655
+ }
1656
+ }
1657
+
1658
+
1659
+
1660
+ MaybeObject* LoadStubCompiler::GetCode(PropertyType type, String* name) {
1661
+ Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, type);
1662
+ MaybeObject* result = GetCodeWithFlags(flags, name);
1663
+ if (!result->IsFailure()) {
1664
+ PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG,
1665
+ Code::cast(result->ToObjectUnchecked()),
1666
+ name));
1667
+ GDBJIT(AddCode(GDBJITInterface::LOAD_IC,
1668
+ name,
1669
+ Code::cast(result->ToObjectUnchecked())));
1670
+ }
1671
+ return result;
1672
+ }
1673
+
1674
+
1675
+ MaybeObject* KeyedLoadStubCompiler::GetCode(PropertyType type, String* name) {
1676
+ Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, type);
1677
+ MaybeObject* result = GetCodeWithFlags(flags, name);
1678
+ if (!result->IsFailure()) {
1679
+ PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG,
1680
+ Code::cast(result->ToObjectUnchecked()),
1681
+ name));
1682
+ GDBJIT(AddCode(GDBJITInterface::LOAD_IC,
1683
+ name,
1684
+ Code::cast(result->ToObjectUnchecked())));
1685
+ }
1686
+ return result;
1687
+ }
1688
+
1689
+
1690
+ MaybeObject* StoreStubCompiler::GetCode(PropertyType type, String* name) {
1691
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
1692
+ Code::STORE_IC, type, strict_mode_);
1693
+ MaybeObject* result = GetCodeWithFlags(flags, name);
1694
+ if (!result->IsFailure()) {
1695
+ PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG,
1696
+ Code::cast(result->ToObjectUnchecked()),
1697
+ name));
1698
+ GDBJIT(AddCode(GDBJITInterface::STORE_IC,
1699
+ name,
1700
+ Code::cast(result->ToObjectUnchecked())));
1701
+ }
1702
+ return result;
1703
+ }
1704
+
1705
+
1706
+ MaybeObject* KeyedStoreStubCompiler::GetCode(PropertyType type, String* name) {
1707
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
1708
+ Code::KEYED_STORE_IC, type, strict_mode_);
1709
+ MaybeObject* result = GetCodeWithFlags(flags, name);
1710
+ if (!result->IsFailure()) {
1711
+ PROFILE(CodeCreateEvent(Logger::KEYED_STORE_IC_TAG,
1712
+ Code::cast(result->ToObjectUnchecked()),
1713
+ name));
1714
+ GDBJIT(AddCode(GDBJITInterface::KEYED_STORE_IC,
1715
+ name,
1716
+ Code::cast(result->ToObjectUnchecked())));
1717
+ }
1718
+ return result;
1719
+ }
1720
+
1721
+
1722
+ CallStubCompiler::CallStubCompiler(int argc,
1723
+ InLoopFlag in_loop,
1724
+ Code::Kind kind,
1725
+ Code::ExtraICState extra_ic_state,
1726
+ InlineCacheHolderFlag cache_holder)
1727
+ : arguments_(argc),
1728
+ in_loop_(in_loop),
1729
+ kind_(kind),
1730
+ extra_ic_state_(extra_ic_state),
1731
+ cache_holder_(cache_holder) {
1732
+ }
1733
+
1734
+
1735
+ bool CallStubCompiler::HasCustomCallGenerator(BuiltinFunctionId id) {
1736
+ #define CALL_GENERATOR_CASE(name) if (id == k##name) return true;
1737
+ CUSTOM_CALL_IC_GENERATORS(CALL_GENERATOR_CASE)
1738
+ #undef CALL_GENERATOR_CASE
1739
+ return false;
1740
+ }
1741
+
1742
+
1743
+ MaybeObject* CallStubCompiler::CompileCustomCall(BuiltinFunctionId id,
1744
+ Object* object,
1745
+ JSObject* holder,
1746
+ JSGlobalPropertyCell* cell,
1747
+ JSFunction* function,
1748
+ String* fname) {
1749
+ #define CALL_GENERATOR_CASE(name) \
1750
+ if (id == k##name) { \
1751
+ return CallStubCompiler::Compile##name##Call(object, \
1752
+ holder, \
1753
+ cell, \
1754
+ function, \
1755
+ fname); \
1756
+ }
1757
+ CUSTOM_CALL_IC_GENERATORS(CALL_GENERATOR_CASE)
1758
+ #undef CALL_GENERATOR_CASE
1759
+ ASSERT(!HasCustomCallGenerator(id));
1760
+ return Heap::undefined_value();
1761
+ }
1762
+
1763
+
1764
+ MaybeObject* CallStubCompiler::GetCode(PropertyType type, String* name) {
1765
+ int argc = arguments_.immediate();
1766
+ Code::Flags flags = Code::ComputeMonomorphicFlags(kind_,
1767
+ type,
1768
+ extra_ic_state_,
1769
+ cache_holder_,
1770
+ in_loop_,
1771
+ argc);
1772
+ return GetCodeWithFlags(flags, name);
1773
+ }
1774
+
1775
+
1776
+ MaybeObject* CallStubCompiler::GetCode(JSFunction* function) {
1777
+ String* function_name = NULL;
1778
+ if (function->shared()->name()->IsString()) {
1779
+ function_name = String::cast(function->shared()->name());
1780
+ }
1781
+ return GetCode(CONSTANT_FUNCTION, function_name);
1782
+ }
1783
+
1784
+
1785
+ MaybeObject* ConstructStubCompiler::GetCode() {
1786
+ Code::Flags flags = Code::ComputeFlags(Code::STUB);
1787
+ Object* result;
1788
+ { MaybeObject* maybe_result = GetCodeWithFlags(flags, "ConstructStub");
1789
+ if (!maybe_result->ToObject(&result)) return maybe_result;
1790
+ }
1791
+ Code* code = Code::cast(result);
1792
+ USE(code);
1793
+ PROFILE(CodeCreateEvent(Logger::STUB_TAG, code, "ConstructStub"));
1794
+ GDBJIT(AddCode(GDBJITInterface::STUB, "ConstructStub", Code::cast(code)));
1795
+ return result;
1796
+ }
1797
+
1798
+
1799
+ CallOptimization::CallOptimization(LookupResult* lookup) {
1800
+ if (!lookup->IsProperty() || !lookup->IsCacheable() ||
1801
+ lookup->type() != CONSTANT_FUNCTION) {
1802
+ Initialize(NULL);
1803
+ } else {
1804
+ // We only optimize constant function calls.
1805
+ Initialize(lookup->GetConstantFunction());
1806
+ }
1807
+ }
1808
+
1809
+ CallOptimization::CallOptimization(JSFunction* function) {
1810
+ Initialize(function);
1811
+ }
1812
+
1813
+
1814
+ int CallOptimization::GetPrototypeDepthOfExpectedType(JSObject* object,
1815
+ JSObject* holder) const {
1816
+ ASSERT(is_simple_api_call_);
1817
+ if (expected_receiver_type_ == NULL) return 0;
1818
+ int depth = 0;
1819
+ while (object != holder) {
1820
+ if (object->IsInstanceOf(expected_receiver_type_)) return depth;
1821
+ object = JSObject::cast(object->GetPrototype());
1822
+ ++depth;
1823
+ }
1824
+ if (holder->IsInstanceOf(expected_receiver_type_)) return depth;
1825
+ return kInvalidProtoDepth;
1826
+ }
1827
+
1828
+
1829
+ void CallOptimization::Initialize(JSFunction* function) {
1830
+ constant_function_ = NULL;
1831
+ is_simple_api_call_ = false;
1832
+ expected_receiver_type_ = NULL;
1833
+ api_call_info_ = NULL;
1834
+
1835
+ if (function == NULL || !function->is_compiled()) return;
1836
+
1837
+ constant_function_ = function;
1838
+ AnalyzePossibleApiFunction(function);
1839
+ }
1840
+
1841
+
1842
+ void CallOptimization::AnalyzePossibleApiFunction(JSFunction* function) {
1843
+ SharedFunctionInfo* sfi = function->shared();
1844
+ if (!sfi->IsApiFunction()) return;
1845
+ FunctionTemplateInfo* info = sfi->get_api_func_data();
1846
+
1847
+ // Require a C++ callback.
1848
+ if (info->call_code()->IsUndefined()) return;
1849
+ api_call_info_ = CallHandlerInfo::cast(info->call_code());
1850
+
1851
+ // Accept signatures that either have no restrictions at all or
1852
+ // only have restrictions on the receiver.
1853
+ if (!info->signature()->IsUndefined()) {
1854
+ SignatureInfo* signature = SignatureInfo::cast(info->signature());
1855
+ if (!signature->args()->IsUndefined()) return;
1856
+ if (!signature->receiver()->IsUndefined()) {
1857
+ expected_receiver_type_ =
1858
+ FunctionTemplateInfo::cast(signature->receiver());
1859
+ }
1860
+ }
1861
+
1862
+ is_simple_api_call_ = true;
1863
+ }
1864
+
1865
+
1866
+ MaybeObject* ExternalArrayStubCompiler::GetCode(Code::Flags flags) {
1867
+ Object* result;
1868
+ { MaybeObject* maybe_result = GetCodeWithFlags(flags, "ExternalArrayStub");
1869
+ if (!maybe_result->ToObject(&result)) return maybe_result;
1870
+ }
1871
+ Code* code = Code::cast(result);
1872
+ USE(code);
1873
+ PROFILE(CodeCreateEvent(Logger::STUB_TAG, code, "ExternalArrayStub"));
1874
+ return result;
1875
+ }
1876
+
1877
+
1878
+ } } // namespace v8::internal