libv8-sgonyea 3.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (500) hide show
  1. data/.gitignore +8 -0
  2. data/.gitmodules +3 -0
  3. data/Gemfile +4 -0
  4. data/README.md +76 -0
  5. data/Rakefile +113 -0
  6. data/ext/libv8/extconf.rb +28 -0
  7. data/lib/libv8.rb +15 -0
  8. data/lib/libv8/Makefile +30 -0
  9. data/lib/libv8/detect_cpu.rb +27 -0
  10. data/lib/libv8/fpic-on-linux-amd64.patch +13 -0
  11. data/lib/libv8/v8/.gitignore +35 -0
  12. data/lib/libv8/v8/AUTHORS +44 -0
  13. data/lib/libv8/v8/ChangeLog +2839 -0
  14. data/lib/libv8/v8/LICENSE +52 -0
  15. data/lib/libv8/v8/LICENSE.strongtalk +29 -0
  16. data/lib/libv8/v8/LICENSE.v8 +26 -0
  17. data/lib/libv8/v8/LICENSE.valgrind +45 -0
  18. data/lib/libv8/v8/SConstruct +1478 -0
  19. data/lib/libv8/v8/build/README.txt +49 -0
  20. data/lib/libv8/v8/build/all.gyp +18 -0
  21. data/lib/libv8/v8/build/armu.gypi +32 -0
  22. data/lib/libv8/v8/build/common.gypi +144 -0
  23. data/lib/libv8/v8/build/gyp_v8 +145 -0
  24. data/lib/libv8/v8/include/v8-debug.h +395 -0
  25. data/lib/libv8/v8/include/v8-preparser.h +117 -0
  26. data/lib/libv8/v8/include/v8-profiler.h +505 -0
  27. data/lib/libv8/v8/include/v8-testing.h +104 -0
  28. data/lib/libv8/v8/include/v8.h +4124 -0
  29. data/lib/libv8/v8/include/v8stdint.h +53 -0
  30. data/lib/libv8/v8/preparser/SConscript +38 -0
  31. data/lib/libv8/v8/preparser/preparser-process.cc +379 -0
  32. data/lib/libv8/v8/src/SConscript +368 -0
  33. data/lib/libv8/v8/src/accessors.cc +767 -0
  34. data/lib/libv8/v8/src/accessors.h +123 -0
  35. data/lib/libv8/v8/src/allocation-inl.h +49 -0
  36. data/lib/libv8/v8/src/allocation.cc +122 -0
  37. data/lib/libv8/v8/src/allocation.h +143 -0
  38. data/lib/libv8/v8/src/api.cc +5845 -0
  39. data/lib/libv8/v8/src/api.h +574 -0
  40. data/lib/libv8/v8/src/apinatives.js +110 -0
  41. data/lib/libv8/v8/src/apiutils.h +73 -0
  42. data/lib/libv8/v8/src/arguments.h +118 -0
  43. data/lib/libv8/v8/src/arm/assembler-arm-inl.h +353 -0
  44. data/lib/libv8/v8/src/arm/assembler-arm.cc +2661 -0
  45. data/lib/libv8/v8/src/arm/assembler-arm.h +1375 -0
  46. data/lib/libv8/v8/src/arm/builtins-arm.cc +1658 -0
  47. data/lib/libv8/v8/src/arm/code-stubs-arm.cc +6398 -0
  48. data/lib/libv8/v8/src/arm/code-stubs-arm.h +673 -0
  49. data/lib/libv8/v8/src/arm/codegen-arm.cc +52 -0
  50. data/lib/libv8/v8/src/arm/codegen-arm.h +91 -0
  51. data/lib/libv8/v8/src/arm/constants-arm.cc +152 -0
  52. data/lib/libv8/v8/src/arm/constants-arm.h +775 -0
  53. data/lib/libv8/v8/src/arm/cpu-arm.cc +120 -0
  54. data/lib/libv8/v8/src/arm/debug-arm.cc +317 -0
  55. data/lib/libv8/v8/src/arm/deoptimizer-arm.cc +754 -0
  56. data/lib/libv8/v8/src/arm/disasm-arm.cc +1506 -0
  57. data/lib/libv8/v8/src/arm/frames-arm.cc +45 -0
  58. data/lib/libv8/v8/src/arm/frames-arm.h +168 -0
  59. data/lib/libv8/v8/src/arm/full-codegen-arm.cc +4375 -0
  60. data/lib/libv8/v8/src/arm/ic-arm.cc +1562 -0
  61. data/lib/libv8/v8/src/arm/lithium-arm.cc +2206 -0
  62. data/lib/libv8/v8/src/arm/lithium-arm.h +2348 -0
  63. data/lib/libv8/v8/src/arm/lithium-codegen-arm.cc +4526 -0
  64. data/lib/libv8/v8/src/arm/lithium-codegen-arm.h +403 -0
  65. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.cc +305 -0
  66. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.h +84 -0
  67. data/lib/libv8/v8/src/arm/macro-assembler-arm.cc +3163 -0
  68. data/lib/libv8/v8/src/arm/macro-assembler-arm.h +1126 -0
  69. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.cc +1287 -0
  70. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.h +253 -0
  71. data/lib/libv8/v8/src/arm/simulator-arm.cc +3424 -0
  72. data/lib/libv8/v8/src/arm/simulator-arm.h +431 -0
  73. data/lib/libv8/v8/src/arm/stub-cache-arm.cc +4243 -0
  74. data/lib/libv8/v8/src/array.js +1366 -0
  75. data/lib/libv8/v8/src/assembler.cc +1207 -0
  76. data/lib/libv8/v8/src/assembler.h +858 -0
  77. data/lib/libv8/v8/src/ast-inl.h +112 -0
  78. data/lib/libv8/v8/src/ast.cc +1146 -0
  79. data/lib/libv8/v8/src/ast.h +2188 -0
  80. data/lib/libv8/v8/src/atomicops.h +167 -0
  81. data/lib/libv8/v8/src/atomicops_internals_arm_gcc.h +145 -0
  82. data/lib/libv8/v8/src/atomicops_internals_mips_gcc.h +169 -0
  83. data/lib/libv8/v8/src/atomicops_internals_x86_gcc.cc +133 -0
  84. data/lib/libv8/v8/src/atomicops_internals_x86_gcc.h +287 -0
  85. data/lib/libv8/v8/src/atomicops_internals_x86_macosx.h +301 -0
  86. data/lib/libv8/v8/src/atomicops_internals_x86_msvc.h +203 -0
  87. data/lib/libv8/v8/src/bignum-dtoa.cc +655 -0
  88. data/lib/libv8/v8/src/bignum-dtoa.h +81 -0
  89. data/lib/libv8/v8/src/bignum.cc +768 -0
  90. data/lib/libv8/v8/src/bignum.h +140 -0
  91. data/lib/libv8/v8/src/bootstrapper.cc +2184 -0
  92. data/lib/libv8/v8/src/bootstrapper.h +188 -0
  93. data/lib/libv8/v8/src/builtins.cc +1707 -0
  94. data/lib/libv8/v8/src/builtins.h +371 -0
  95. data/lib/libv8/v8/src/bytecodes-irregexp.h +105 -0
  96. data/lib/libv8/v8/src/cached-powers.cc +177 -0
  97. data/lib/libv8/v8/src/cached-powers.h +65 -0
  98. data/lib/libv8/v8/src/char-predicates-inl.h +94 -0
  99. data/lib/libv8/v8/src/char-predicates.h +67 -0
  100. data/lib/libv8/v8/src/checks.cc +110 -0
  101. data/lib/libv8/v8/src/checks.h +296 -0
  102. data/lib/libv8/v8/src/circular-queue-inl.h +53 -0
  103. data/lib/libv8/v8/src/circular-queue.cc +122 -0
  104. data/lib/libv8/v8/src/circular-queue.h +103 -0
  105. data/lib/libv8/v8/src/code-stubs.cc +267 -0
  106. data/lib/libv8/v8/src/code-stubs.h +1011 -0
  107. data/lib/libv8/v8/src/code.h +70 -0
  108. data/lib/libv8/v8/src/codegen.cc +231 -0
  109. data/lib/libv8/v8/src/codegen.h +84 -0
  110. data/lib/libv8/v8/src/compilation-cache.cc +540 -0
  111. data/lib/libv8/v8/src/compilation-cache.h +287 -0
  112. data/lib/libv8/v8/src/compiler.cc +786 -0
  113. data/lib/libv8/v8/src/compiler.h +312 -0
  114. data/lib/libv8/v8/src/contexts.cc +347 -0
  115. data/lib/libv8/v8/src/contexts.h +391 -0
  116. data/lib/libv8/v8/src/conversions-inl.h +106 -0
  117. data/lib/libv8/v8/src/conversions.cc +1131 -0
  118. data/lib/libv8/v8/src/conversions.h +135 -0
  119. data/lib/libv8/v8/src/counters.cc +93 -0
  120. data/lib/libv8/v8/src/counters.h +254 -0
  121. data/lib/libv8/v8/src/cpu-profiler-inl.h +101 -0
  122. data/lib/libv8/v8/src/cpu-profiler.cc +609 -0
  123. data/lib/libv8/v8/src/cpu-profiler.h +302 -0
  124. data/lib/libv8/v8/src/cpu.h +69 -0
  125. data/lib/libv8/v8/src/d8-debug.cc +367 -0
  126. data/lib/libv8/v8/src/d8-debug.h +158 -0
  127. data/lib/libv8/v8/src/d8-posix.cc +695 -0
  128. data/lib/libv8/v8/src/d8-readline.cc +130 -0
  129. data/lib/libv8/v8/src/d8-windows.cc +42 -0
  130. data/lib/libv8/v8/src/d8.cc +803 -0
  131. data/lib/libv8/v8/src/d8.gyp +91 -0
  132. data/lib/libv8/v8/src/d8.h +235 -0
  133. data/lib/libv8/v8/src/d8.js +2798 -0
  134. data/lib/libv8/v8/src/data-flow.cc +66 -0
  135. data/lib/libv8/v8/src/data-flow.h +205 -0
  136. data/lib/libv8/v8/src/date.js +1103 -0
  137. data/lib/libv8/v8/src/dateparser-inl.h +127 -0
  138. data/lib/libv8/v8/src/dateparser.cc +178 -0
  139. data/lib/libv8/v8/src/dateparser.h +266 -0
  140. data/lib/libv8/v8/src/debug-agent.cc +447 -0
  141. data/lib/libv8/v8/src/debug-agent.h +129 -0
  142. data/lib/libv8/v8/src/debug-debugger.js +2569 -0
  143. data/lib/libv8/v8/src/debug.cc +3165 -0
  144. data/lib/libv8/v8/src/debug.h +1057 -0
  145. data/lib/libv8/v8/src/deoptimizer.cc +1256 -0
  146. data/lib/libv8/v8/src/deoptimizer.h +602 -0
  147. data/lib/libv8/v8/src/disasm.h +80 -0
  148. data/lib/libv8/v8/src/disassembler.cc +343 -0
  149. data/lib/libv8/v8/src/disassembler.h +58 -0
  150. data/lib/libv8/v8/src/diy-fp.cc +58 -0
  151. data/lib/libv8/v8/src/diy-fp.h +117 -0
  152. data/lib/libv8/v8/src/double.h +238 -0
  153. data/lib/libv8/v8/src/dtoa.cc +103 -0
  154. data/lib/libv8/v8/src/dtoa.h +85 -0
  155. data/lib/libv8/v8/src/execution.cc +849 -0
  156. data/lib/libv8/v8/src/execution.h +297 -0
  157. data/lib/libv8/v8/src/extensions/experimental/break-iterator.cc +250 -0
  158. data/lib/libv8/v8/src/extensions/experimental/break-iterator.h +89 -0
  159. data/lib/libv8/v8/src/extensions/experimental/collator.cc +218 -0
  160. data/lib/libv8/v8/src/extensions/experimental/collator.h +69 -0
  161. data/lib/libv8/v8/src/extensions/experimental/experimental.gyp +94 -0
  162. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.cc +78 -0
  163. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.h +54 -0
  164. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.cc +112 -0
  165. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.h +60 -0
  166. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.cc +43 -0
  167. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.h +49 -0
  168. data/lib/libv8/v8/src/extensions/experimental/i18n.js +180 -0
  169. data/lib/libv8/v8/src/extensions/experimental/language-matcher.cc +251 -0
  170. data/lib/libv8/v8/src/extensions/experimental/language-matcher.h +95 -0
  171. data/lib/libv8/v8/src/extensions/externalize-string-extension.cc +141 -0
  172. data/lib/libv8/v8/src/extensions/externalize-string-extension.h +50 -0
  173. data/lib/libv8/v8/src/extensions/gc-extension.cc +58 -0
  174. data/lib/libv8/v8/src/extensions/gc-extension.h +49 -0
  175. data/lib/libv8/v8/src/factory.cc +1222 -0
  176. data/lib/libv8/v8/src/factory.h +442 -0
  177. data/lib/libv8/v8/src/fast-dtoa.cc +736 -0
  178. data/lib/libv8/v8/src/fast-dtoa.h +83 -0
  179. data/lib/libv8/v8/src/fixed-dtoa.cc +405 -0
  180. data/lib/libv8/v8/src/fixed-dtoa.h +55 -0
  181. data/lib/libv8/v8/src/flag-definitions.h +560 -0
  182. data/lib/libv8/v8/src/flags.cc +551 -0
  183. data/lib/libv8/v8/src/flags.h +79 -0
  184. data/lib/libv8/v8/src/frames-inl.h +247 -0
  185. data/lib/libv8/v8/src/frames.cc +1243 -0
  186. data/lib/libv8/v8/src/frames.h +870 -0
  187. data/lib/libv8/v8/src/full-codegen.cc +1374 -0
  188. data/lib/libv8/v8/src/full-codegen.h +771 -0
  189. data/lib/libv8/v8/src/func-name-inferrer.cc +92 -0
  190. data/lib/libv8/v8/src/func-name-inferrer.h +111 -0
  191. data/lib/libv8/v8/src/gdb-jit.cc +1555 -0
  192. data/lib/libv8/v8/src/gdb-jit.h +143 -0
  193. data/lib/libv8/v8/src/global-handles.cc +665 -0
  194. data/lib/libv8/v8/src/global-handles.h +284 -0
  195. data/lib/libv8/v8/src/globals.h +325 -0
  196. data/lib/libv8/v8/src/handles-inl.h +177 -0
  197. data/lib/libv8/v8/src/handles.cc +987 -0
  198. data/lib/libv8/v8/src/handles.h +382 -0
  199. data/lib/libv8/v8/src/hashmap.cc +230 -0
  200. data/lib/libv8/v8/src/hashmap.h +123 -0
  201. data/lib/libv8/v8/src/heap-inl.h +704 -0
  202. data/lib/libv8/v8/src/heap-profiler.cc +1173 -0
  203. data/lib/libv8/v8/src/heap-profiler.h +397 -0
  204. data/lib/libv8/v8/src/heap.cc +5930 -0
  205. data/lib/libv8/v8/src/heap.h +2268 -0
  206. data/lib/libv8/v8/src/hydrogen-instructions.cc +1769 -0
  207. data/lib/libv8/v8/src/hydrogen-instructions.h +3971 -0
  208. data/lib/libv8/v8/src/hydrogen.cc +6239 -0
  209. data/lib/libv8/v8/src/hydrogen.h +1202 -0
  210. data/lib/libv8/v8/src/ia32/assembler-ia32-inl.h +446 -0
  211. data/lib/libv8/v8/src/ia32/assembler-ia32.cc +2487 -0
  212. data/lib/libv8/v8/src/ia32/assembler-ia32.h +1144 -0
  213. data/lib/libv8/v8/src/ia32/builtins-ia32.cc +1621 -0
  214. data/lib/libv8/v8/src/ia32/code-stubs-ia32.cc +6198 -0
  215. data/lib/libv8/v8/src/ia32/code-stubs-ia32.h +517 -0
  216. data/lib/libv8/v8/src/ia32/codegen-ia32.cc +265 -0
  217. data/lib/libv8/v8/src/ia32/codegen-ia32.h +79 -0
  218. data/lib/libv8/v8/src/ia32/cpu-ia32.cc +88 -0
  219. data/lib/libv8/v8/src/ia32/debug-ia32.cc +312 -0
  220. data/lib/libv8/v8/src/ia32/deoptimizer-ia32.cc +774 -0
  221. data/lib/libv8/v8/src/ia32/disasm-ia32.cc +1628 -0
  222. data/lib/libv8/v8/src/ia32/frames-ia32.cc +45 -0
  223. data/lib/libv8/v8/src/ia32/frames-ia32.h +142 -0
  224. data/lib/libv8/v8/src/ia32/full-codegen-ia32.cc +4338 -0
  225. data/lib/libv8/v8/src/ia32/ic-ia32.cc +1597 -0
  226. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.cc +4461 -0
  227. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.h +375 -0
  228. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.cc +475 -0
  229. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
  230. data/lib/libv8/v8/src/ia32/lithium-ia32.cc +2261 -0
  231. data/lib/libv8/v8/src/ia32/lithium-ia32.h +2396 -0
  232. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.cc +2136 -0
  233. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.h +775 -0
  234. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.cc +1263 -0
  235. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.h +216 -0
  236. data/lib/libv8/v8/src/ia32/simulator-ia32.cc +30 -0
  237. data/lib/libv8/v8/src/ia32/simulator-ia32.h +74 -0
  238. data/lib/libv8/v8/src/ia32/stub-cache-ia32.cc +3847 -0
  239. data/lib/libv8/v8/src/ic-inl.h +130 -0
  240. data/lib/libv8/v8/src/ic.cc +2577 -0
  241. data/lib/libv8/v8/src/ic.h +736 -0
  242. data/lib/libv8/v8/src/inspector.cc +63 -0
  243. data/lib/libv8/v8/src/inspector.h +62 -0
  244. data/lib/libv8/v8/src/interpreter-irregexp.cc +659 -0
  245. data/lib/libv8/v8/src/interpreter-irregexp.h +49 -0
  246. data/lib/libv8/v8/src/isolate-inl.h +50 -0
  247. data/lib/libv8/v8/src/isolate.cc +1869 -0
  248. data/lib/libv8/v8/src/isolate.h +1382 -0
  249. data/lib/libv8/v8/src/json-parser.cc +504 -0
  250. data/lib/libv8/v8/src/json-parser.h +161 -0
  251. data/lib/libv8/v8/src/json.js +342 -0
  252. data/lib/libv8/v8/src/jsregexp.cc +5385 -0
  253. data/lib/libv8/v8/src/jsregexp.h +1492 -0
  254. data/lib/libv8/v8/src/list-inl.h +212 -0
  255. data/lib/libv8/v8/src/list.h +174 -0
  256. data/lib/libv8/v8/src/lithium-allocator-inl.h +142 -0
  257. data/lib/libv8/v8/src/lithium-allocator.cc +2123 -0
  258. data/lib/libv8/v8/src/lithium-allocator.h +630 -0
  259. data/lib/libv8/v8/src/lithium.cc +190 -0
  260. data/lib/libv8/v8/src/lithium.h +597 -0
  261. data/lib/libv8/v8/src/liveedit-debugger.js +1082 -0
  262. data/lib/libv8/v8/src/liveedit.cc +1691 -0
  263. data/lib/libv8/v8/src/liveedit.h +180 -0
  264. data/lib/libv8/v8/src/liveobjectlist-inl.h +126 -0
  265. data/lib/libv8/v8/src/liveobjectlist.cc +2589 -0
  266. data/lib/libv8/v8/src/liveobjectlist.h +322 -0
  267. data/lib/libv8/v8/src/log-inl.h +59 -0
  268. data/lib/libv8/v8/src/log-utils.cc +428 -0
  269. data/lib/libv8/v8/src/log-utils.h +231 -0
  270. data/lib/libv8/v8/src/log.cc +1993 -0
  271. data/lib/libv8/v8/src/log.h +476 -0
  272. data/lib/libv8/v8/src/macro-assembler.h +120 -0
  273. data/lib/libv8/v8/src/macros.py +178 -0
  274. data/lib/libv8/v8/src/mark-compact.cc +3143 -0
  275. data/lib/libv8/v8/src/mark-compact.h +506 -0
  276. data/lib/libv8/v8/src/math.js +264 -0
  277. data/lib/libv8/v8/src/messages.cc +179 -0
  278. data/lib/libv8/v8/src/messages.h +113 -0
  279. data/lib/libv8/v8/src/messages.js +1096 -0
  280. data/lib/libv8/v8/src/mips/assembler-mips-inl.h +312 -0
  281. data/lib/libv8/v8/src/mips/assembler-mips.cc +1960 -0
  282. data/lib/libv8/v8/src/mips/assembler-mips.h +1138 -0
  283. data/lib/libv8/v8/src/mips/builtins-mips.cc +1628 -0
  284. data/lib/libv8/v8/src/mips/code-stubs-mips.cc +6656 -0
  285. data/lib/libv8/v8/src/mips/code-stubs-mips.h +682 -0
  286. data/lib/libv8/v8/src/mips/codegen-mips.cc +52 -0
  287. data/lib/libv8/v8/src/mips/codegen-mips.h +98 -0
  288. data/lib/libv8/v8/src/mips/constants-mips.cc +352 -0
  289. data/lib/libv8/v8/src/mips/constants-mips.h +739 -0
  290. data/lib/libv8/v8/src/mips/cpu-mips.cc +96 -0
  291. data/lib/libv8/v8/src/mips/debug-mips.cc +308 -0
  292. data/lib/libv8/v8/src/mips/deoptimizer-mips.cc +91 -0
  293. data/lib/libv8/v8/src/mips/disasm-mips.cc +1050 -0
  294. data/lib/libv8/v8/src/mips/frames-mips.cc +47 -0
  295. data/lib/libv8/v8/src/mips/frames-mips.h +219 -0
  296. data/lib/libv8/v8/src/mips/full-codegen-mips.cc +4388 -0
  297. data/lib/libv8/v8/src/mips/ic-mips.cc +1580 -0
  298. data/lib/libv8/v8/src/mips/lithium-codegen-mips.h +65 -0
  299. data/lib/libv8/v8/src/mips/lithium-mips.h +307 -0
  300. data/lib/libv8/v8/src/mips/macro-assembler-mips.cc +4056 -0
  301. data/lib/libv8/v8/src/mips/macro-assembler-mips.h +1214 -0
  302. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.cc +1251 -0
  303. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.h +252 -0
  304. data/lib/libv8/v8/src/mips/simulator-mips.cc +2621 -0
  305. data/lib/libv8/v8/src/mips/simulator-mips.h +401 -0
  306. data/lib/libv8/v8/src/mips/stub-cache-mips.cc +4285 -0
  307. data/lib/libv8/v8/src/mirror-debugger.js +2382 -0
  308. data/lib/libv8/v8/src/mksnapshot.cc +328 -0
  309. data/lib/libv8/v8/src/natives.h +64 -0
  310. data/lib/libv8/v8/src/objects-debug.cc +738 -0
  311. data/lib/libv8/v8/src/objects-inl.h +4323 -0
  312. data/lib/libv8/v8/src/objects-printer.cc +829 -0
  313. data/lib/libv8/v8/src/objects-visiting.cc +148 -0
  314. data/lib/libv8/v8/src/objects-visiting.h +424 -0
  315. data/lib/libv8/v8/src/objects.cc +10585 -0
  316. data/lib/libv8/v8/src/objects.h +6838 -0
  317. data/lib/libv8/v8/src/parser.cc +4997 -0
  318. data/lib/libv8/v8/src/parser.h +765 -0
  319. data/lib/libv8/v8/src/platform-cygwin.cc +779 -0
  320. data/lib/libv8/v8/src/platform-freebsd.cc +826 -0
  321. data/lib/libv8/v8/src/platform-linux.cc +1149 -0
  322. data/lib/libv8/v8/src/platform-macos.cc +830 -0
  323. data/lib/libv8/v8/src/platform-nullos.cc +479 -0
  324. data/lib/libv8/v8/src/platform-openbsd.cc +640 -0
  325. data/lib/libv8/v8/src/platform-posix.cc +424 -0
  326. data/lib/libv8/v8/src/platform-solaris.cc +762 -0
  327. data/lib/libv8/v8/src/platform-tls-mac.h +62 -0
  328. data/lib/libv8/v8/src/platform-tls-win32.h +62 -0
  329. data/lib/libv8/v8/src/platform-tls.h +50 -0
  330. data/lib/libv8/v8/src/platform-win32.cc +2021 -0
  331. data/lib/libv8/v8/src/platform.h +667 -0
  332. data/lib/libv8/v8/src/preparse-data-format.h +62 -0
  333. data/lib/libv8/v8/src/preparse-data.cc +183 -0
  334. data/lib/libv8/v8/src/preparse-data.h +225 -0
  335. data/lib/libv8/v8/src/preparser-api.cc +220 -0
  336. data/lib/libv8/v8/src/preparser.cc +1450 -0
  337. data/lib/libv8/v8/src/preparser.h +493 -0
  338. data/lib/libv8/v8/src/prettyprinter.cc +1493 -0
  339. data/lib/libv8/v8/src/prettyprinter.h +223 -0
  340. data/lib/libv8/v8/src/profile-generator-inl.h +128 -0
  341. data/lib/libv8/v8/src/profile-generator.cc +3098 -0
  342. data/lib/libv8/v8/src/profile-generator.h +1126 -0
  343. data/lib/libv8/v8/src/property.cc +105 -0
  344. data/lib/libv8/v8/src/property.h +365 -0
  345. data/lib/libv8/v8/src/proxy.js +83 -0
  346. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp-inl.h +78 -0
  347. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.cc +471 -0
  348. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.h +142 -0
  349. data/lib/libv8/v8/src/regexp-macro-assembler-tracer.cc +373 -0
  350. data/lib/libv8/v8/src/regexp-macro-assembler-tracer.h +104 -0
  351. data/lib/libv8/v8/src/regexp-macro-assembler.cc +267 -0
  352. data/lib/libv8/v8/src/regexp-macro-assembler.h +243 -0
  353. data/lib/libv8/v8/src/regexp-stack.cc +111 -0
  354. data/lib/libv8/v8/src/regexp-stack.h +147 -0
  355. data/lib/libv8/v8/src/regexp.js +483 -0
  356. data/lib/libv8/v8/src/rewriter.cc +360 -0
  357. data/lib/libv8/v8/src/rewriter.h +50 -0
  358. data/lib/libv8/v8/src/runtime-profiler.cc +489 -0
  359. data/lib/libv8/v8/src/runtime-profiler.h +201 -0
  360. data/lib/libv8/v8/src/runtime.cc +12227 -0
  361. data/lib/libv8/v8/src/runtime.h +652 -0
  362. data/lib/libv8/v8/src/runtime.js +649 -0
  363. data/lib/libv8/v8/src/safepoint-table.cc +256 -0
  364. data/lib/libv8/v8/src/safepoint-table.h +270 -0
  365. data/lib/libv8/v8/src/scanner-base.cc +952 -0
  366. data/lib/libv8/v8/src/scanner-base.h +670 -0
  367. data/lib/libv8/v8/src/scanner.cc +345 -0
  368. data/lib/libv8/v8/src/scanner.h +146 -0
  369. data/lib/libv8/v8/src/scopeinfo.cc +646 -0
  370. data/lib/libv8/v8/src/scopeinfo.h +254 -0
  371. data/lib/libv8/v8/src/scopes.cc +1150 -0
  372. data/lib/libv8/v8/src/scopes.h +507 -0
  373. data/lib/libv8/v8/src/serialize.cc +1574 -0
  374. data/lib/libv8/v8/src/serialize.h +589 -0
  375. data/lib/libv8/v8/src/shell.h +55 -0
  376. data/lib/libv8/v8/src/simulator.h +43 -0
  377. data/lib/libv8/v8/src/small-pointer-list.h +163 -0
  378. data/lib/libv8/v8/src/smart-pointer.h +109 -0
  379. data/lib/libv8/v8/src/snapshot-common.cc +83 -0
  380. data/lib/libv8/v8/src/snapshot-empty.cc +54 -0
  381. data/lib/libv8/v8/src/snapshot.h +91 -0
  382. data/lib/libv8/v8/src/spaces-inl.h +529 -0
  383. data/lib/libv8/v8/src/spaces.cc +3145 -0
  384. data/lib/libv8/v8/src/spaces.h +2369 -0
  385. data/lib/libv8/v8/src/splay-tree-inl.h +310 -0
  386. data/lib/libv8/v8/src/splay-tree.h +205 -0
  387. data/lib/libv8/v8/src/string-search.cc +41 -0
  388. data/lib/libv8/v8/src/string-search.h +568 -0
  389. data/lib/libv8/v8/src/string-stream.cc +592 -0
  390. data/lib/libv8/v8/src/string-stream.h +191 -0
  391. data/lib/libv8/v8/src/string.js +994 -0
  392. data/lib/libv8/v8/src/strtod.cc +440 -0
  393. data/lib/libv8/v8/src/strtod.h +40 -0
  394. data/lib/libv8/v8/src/stub-cache.cc +1965 -0
  395. data/lib/libv8/v8/src/stub-cache.h +924 -0
  396. data/lib/libv8/v8/src/third_party/valgrind/valgrind.h +3925 -0
  397. data/lib/libv8/v8/src/token.cc +63 -0
  398. data/lib/libv8/v8/src/token.h +288 -0
  399. data/lib/libv8/v8/src/type-info.cc +507 -0
  400. data/lib/libv8/v8/src/type-info.h +272 -0
  401. data/lib/libv8/v8/src/unbound-queue-inl.h +95 -0
  402. data/lib/libv8/v8/src/unbound-queue.h +69 -0
  403. data/lib/libv8/v8/src/unicode-inl.h +238 -0
  404. data/lib/libv8/v8/src/unicode.cc +1624 -0
  405. data/lib/libv8/v8/src/unicode.h +280 -0
  406. data/lib/libv8/v8/src/uri.js +408 -0
  407. data/lib/libv8/v8/src/utils-inl.h +48 -0
  408. data/lib/libv8/v8/src/utils.cc +371 -0
  409. data/lib/libv8/v8/src/utils.h +800 -0
  410. data/lib/libv8/v8/src/v8-counters.cc +62 -0
  411. data/lib/libv8/v8/src/v8-counters.h +314 -0
  412. data/lib/libv8/v8/src/v8.cc +213 -0
  413. data/lib/libv8/v8/src/v8.h +131 -0
  414. data/lib/libv8/v8/src/v8checks.h +64 -0
  415. data/lib/libv8/v8/src/v8dll-main.cc +44 -0
  416. data/lib/libv8/v8/src/v8globals.h +512 -0
  417. data/lib/libv8/v8/src/v8memory.h +82 -0
  418. data/lib/libv8/v8/src/v8natives.js +1310 -0
  419. data/lib/libv8/v8/src/v8preparserdll-main.cc +39 -0
  420. data/lib/libv8/v8/src/v8threads.cc +464 -0
  421. data/lib/libv8/v8/src/v8threads.h +165 -0
  422. data/lib/libv8/v8/src/v8utils.h +319 -0
  423. data/lib/libv8/v8/src/variables.cc +114 -0
  424. data/lib/libv8/v8/src/variables.h +167 -0
  425. data/lib/libv8/v8/src/version.cc +116 -0
  426. data/lib/libv8/v8/src/version.h +68 -0
  427. data/lib/libv8/v8/src/vm-state-inl.h +138 -0
  428. data/lib/libv8/v8/src/vm-state.h +71 -0
  429. data/lib/libv8/v8/src/win32-headers.h +96 -0
  430. data/lib/libv8/v8/src/x64/assembler-x64-inl.h +462 -0
  431. data/lib/libv8/v8/src/x64/assembler-x64.cc +3027 -0
  432. data/lib/libv8/v8/src/x64/assembler-x64.h +1633 -0
  433. data/lib/libv8/v8/src/x64/builtins-x64.cc +1520 -0
  434. data/lib/libv8/v8/src/x64/code-stubs-x64.cc +5132 -0
  435. data/lib/libv8/v8/src/x64/code-stubs-x64.h +514 -0
  436. data/lib/libv8/v8/src/x64/codegen-x64.cc +146 -0
  437. data/lib/libv8/v8/src/x64/codegen-x64.h +76 -0
  438. data/lib/libv8/v8/src/x64/cpu-x64.cc +88 -0
  439. data/lib/libv8/v8/src/x64/debug-x64.cc +319 -0
  440. data/lib/libv8/v8/src/x64/deoptimizer-x64.cc +815 -0
  441. data/lib/libv8/v8/src/x64/disasm-x64.cc +1832 -0
  442. data/lib/libv8/v8/src/x64/frames-x64.cc +45 -0
  443. data/lib/libv8/v8/src/x64/frames-x64.h +130 -0
  444. data/lib/libv8/v8/src/x64/full-codegen-x64.cc +4318 -0
  445. data/lib/libv8/v8/src/x64/ic-x64.cc +1608 -0
  446. data/lib/libv8/v8/src/x64/lithium-codegen-x64.cc +4267 -0
  447. data/lib/libv8/v8/src/x64/lithium-codegen-x64.h +367 -0
  448. data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.cc +320 -0
  449. data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.h +74 -0
  450. data/lib/libv8/v8/src/x64/lithium-x64.cc +2202 -0
  451. data/lib/libv8/v8/src/x64/lithium-x64.h +2333 -0
  452. data/lib/libv8/v8/src/x64/macro-assembler-x64.cc +3745 -0
  453. data/lib/libv8/v8/src/x64/macro-assembler-x64.h +1290 -0
  454. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.cc +1398 -0
  455. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.h +282 -0
  456. data/lib/libv8/v8/src/x64/simulator-x64.cc +27 -0
  457. data/lib/libv8/v8/src/x64/simulator-x64.h +72 -0
  458. data/lib/libv8/v8/src/x64/stub-cache-x64.cc +3610 -0
  459. data/lib/libv8/v8/src/zone-inl.h +140 -0
  460. data/lib/libv8/v8/src/zone.cc +196 -0
  461. data/lib/libv8/v8/src/zone.h +240 -0
  462. data/lib/libv8/v8/tools/codemap.js +265 -0
  463. data/lib/libv8/v8/tools/consarray.js +93 -0
  464. data/lib/libv8/v8/tools/csvparser.js +78 -0
  465. data/lib/libv8/v8/tools/disasm.py +92 -0
  466. data/lib/libv8/v8/tools/freebsd-tick-processor +10 -0
  467. data/lib/libv8/v8/tools/gc-nvp-trace-processor.py +342 -0
  468. data/lib/libv8/v8/tools/gcmole/README +62 -0
  469. data/lib/libv8/v8/tools/gcmole/gccause.lua +60 -0
  470. data/lib/libv8/v8/tools/gcmole/gcmole.cc +1261 -0
  471. data/lib/libv8/v8/tools/gcmole/gcmole.lua +378 -0
  472. data/lib/libv8/v8/tools/generate-ten-powers.scm +286 -0
  473. data/lib/libv8/v8/tools/grokdump.py +841 -0
  474. data/lib/libv8/v8/tools/gyp/v8.gyp +995 -0
  475. data/lib/libv8/v8/tools/js2c.py +364 -0
  476. data/lib/libv8/v8/tools/jsmin.py +280 -0
  477. data/lib/libv8/v8/tools/linux-tick-processor +35 -0
  478. data/lib/libv8/v8/tools/ll_prof.py +942 -0
  479. data/lib/libv8/v8/tools/logreader.js +185 -0
  480. data/lib/libv8/v8/tools/mac-nm +18 -0
  481. data/lib/libv8/v8/tools/mac-tick-processor +6 -0
  482. data/lib/libv8/v8/tools/oom_dump/README +31 -0
  483. data/lib/libv8/v8/tools/oom_dump/SConstruct +42 -0
  484. data/lib/libv8/v8/tools/oom_dump/oom_dump.cc +288 -0
  485. data/lib/libv8/v8/tools/presubmit.py +305 -0
  486. data/lib/libv8/v8/tools/process-heap-prof.py +120 -0
  487. data/lib/libv8/v8/tools/profile.js +751 -0
  488. data/lib/libv8/v8/tools/profile_view.js +219 -0
  489. data/lib/libv8/v8/tools/run-valgrind.py +77 -0
  490. data/lib/libv8/v8/tools/splaytree.js +316 -0
  491. data/lib/libv8/v8/tools/stats-viewer.py +468 -0
  492. data/lib/libv8/v8/tools/test.py +1510 -0
  493. data/lib/libv8/v8/tools/tickprocessor-driver.js +59 -0
  494. data/lib/libv8/v8/tools/tickprocessor.js +877 -0
  495. data/lib/libv8/v8/tools/utils.py +96 -0
  496. data/lib/libv8/v8/tools/visual_studio/README.txt +12 -0
  497. data/lib/libv8/v8/tools/windows-tick-processor.bat +30 -0
  498. data/lib/libv8/version.rb +5 -0
  499. data/libv8.gemspec +36 -0
  500. metadata +578 -0
@@ -0,0 +1,265 @@
1
+ // Copyright 2011 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #include "v8.h"
29
+
30
+ #if defined(V8_TARGET_ARCH_IA32)
31
+
32
+ #include "codegen.h"
33
+
34
+ namespace v8 {
35
+ namespace internal {
36
+
37
+
38
+ // -------------------------------------------------------------------------
39
+ // Platform-specific RuntimeCallHelper functions.
40
+
41
+ void StubRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const {
42
+ masm->EnterInternalFrame();
43
+ }
44
+
45
+
46
+ void StubRuntimeCallHelper::AfterCall(MacroAssembler* masm) const {
47
+ masm->LeaveInternalFrame();
48
+ }
49
+
50
+
51
+ #define __ masm.
52
+
53
+ static void MemCopyWrapper(void* dest, const void* src, size_t size) {
54
+ memcpy(dest, src, size);
55
+ }
56
+
57
+
58
+ OS::MemCopyFunction CreateMemCopyFunction() {
59
+ size_t actual_size;
60
+ // Allocate buffer in executable space.
61
+ byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB,
62
+ &actual_size,
63
+ true));
64
+ if (buffer == NULL) return &MemCopyWrapper;
65
+ MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size));
66
+
67
+ // Generated code is put into a fixed, unmovable, buffer, and not into
68
+ // the V8 heap. We can't, and don't, refer to any relocatable addresses
69
+ // (e.g. the JavaScript nan-object).
70
+
71
+ // 32-bit C declaration function calls pass arguments on stack.
72
+
73
+ // Stack layout:
74
+ // esp[12]: Third argument, size.
75
+ // esp[8]: Second argument, source pointer.
76
+ // esp[4]: First argument, destination pointer.
77
+ // esp[0]: return address
78
+
79
+ const int kDestinationOffset = 1 * kPointerSize;
80
+ const int kSourceOffset = 2 * kPointerSize;
81
+ const int kSizeOffset = 3 * kPointerSize;
82
+
83
+ int stack_offset = 0; // Update if we change the stack height.
84
+
85
+ if (FLAG_debug_code) {
86
+ __ cmp(Operand(esp, kSizeOffset + stack_offset),
87
+ Immediate(OS::kMinComplexMemCopy));
88
+ Label ok;
89
+ __ j(greater_equal, &ok);
90
+ __ int3();
91
+ __ bind(&ok);
92
+ }
93
+ if (CpuFeatures::IsSupported(SSE2)) {
94
+ CpuFeatures::Scope enable(SSE2);
95
+ __ push(edi);
96
+ __ push(esi);
97
+ stack_offset += 2 * kPointerSize;
98
+ Register dst = edi;
99
+ Register src = esi;
100
+ Register count = ecx;
101
+ __ mov(dst, Operand(esp, stack_offset + kDestinationOffset));
102
+ __ mov(src, Operand(esp, stack_offset + kSourceOffset));
103
+ __ mov(count, Operand(esp, stack_offset + kSizeOffset));
104
+
105
+
106
+ __ movdqu(xmm0, Operand(src, 0));
107
+ __ movdqu(Operand(dst, 0), xmm0);
108
+ __ mov(edx, dst);
109
+ __ and_(edx, 0xF);
110
+ __ neg(edx);
111
+ __ add(Operand(edx), Immediate(16));
112
+ __ add(dst, Operand(edx));
113
+ __ add(src, Operand(edx));
114
+ __ sub(Operand(count), edx);
115
+
116
+ // edi is now aligned. Check if esi is also aligned.
117
+ Label unaligned_source;
118
+ __ test(Operand(src), Immediate(0x0F));
119
+ __ j(not_zero, &unaligned_source);
120
+ {
121
+ // Copy loop for aligned source and destination.
122
+ __ mov(edx, count);
123
+ Register loop_count = ecx;
124
+ Register count = edx;
125
+ __ shr(loop_count, 5);
126
+ {
127
+ // Main copy loop.
128
+ Label loop;
129
+ __ bind(&loop);
130
+ __ prefetch(Operand(src, 0x20), 1);
131
+ __ movdqa(xmm0, Operand(src, 0x00));
132
+ __ movdqa(xmm1, Operand(src, 0x10));
133
+ __ add(Operand(src), Immediate(0x20));
134
+
135
+ __ movdqa(Operand(dst, 0x00), xmm0);
136
+ __ movdqa(Operand(dst, 0x10), xmm1);
137
+ __ add(Operand(dst), Immediate(0x20));
138
+
139
+ __ dec(loop_count);
140
+ __ j(not_zero, &loop);
141
+ }
142
+
143
+ // At most 31 bytes to copy.
144
+ Label move_less_16;
145
+ __ test(Operand(count), Immediate(0x10));
146
+ __ j(zero, &move_less_16);
147
+ __ movdqa(xmm0, Operand(src, 0));
148
+ __ add(Operand(src), Immediate(0x10));
149
+ __ movdqa(Operand(dst, 0), xmm0);
150
+ __ add(Operand(dst), Immediate(0x10));
151
+ __ bind(&move_less_16);
152
+
153
+ // At most 15 bytes to copy. Copy 16 bytes at end of string.
154
+ __ and_(count, 0xF);
155
+ __ movdqu(xmm0, Operand(src, count, times_1, -0x10));
156
+ __ movdqu(Operand(dst, count, times_1, -0x10), xmm0);
157
+
158
+ __ mov(eax, Operand(esp, stack_offset + kDestinationOffset));
159
+ __ pop(esi);
160
+ __ pop(edi);
161
+ __ ret(0);
162
+ }
163
+ __ Align(16);
164
+ {
165
+ // Copy loop for unaligned source and aligned destination.
166
+ // If source is not aligned, we can't read it as efficiently.
167
+ __ bind(&unaligned_source);
168
+ __ mov(edx, ecx);
169
+ Register loop_count = ecx;
170
+ Register count = edx;
171
+ __ shr(loop_count, 5);
172
+ {
173
+ // Main copy loop
174
+ Label loop;
175
+ __ bind(&loop);
176
+ __ prefetch(Operand(src, 0x20), 1);
177
+ __ movdqu(xmm0, Operand(src, 0x00));
178
+ __ movdqu(xmm1, Operand(src, 0x10));
179
+ __ add(Operand(src), Immediate(0x20));
180
+
181
+ __ movdqa(Operand(dst, 0x00), xmm0);
182
+ __ movdqa(Operand(dst, 0x10), xmm1);
183
+ __ add(Operand(dst), Immediate(0x20));
184
+
185
+ __ dec(loop_count);
186
+ __ j(not_zero, &loop);
187
+ }
188
+
189
+ // At most 31 bytes to copy.
190
+ Label move_less_16;
191
+ __ test(Operand(count), Immediate(0x10));
192
+ __ j(zero, &move_less_16);
193
+ __ movdqu(xmm0, Operand(src, 0));
194
+ __ add(Operand(src), Immediate(0x10));
195
+ __ movdqa(Operand(dst, 0), xmm0);
196
+ __ add(Operand(dst), Immediate(0x10));
197
+ __ bind(&move_less_16);
198
+
199
+ // At most 15 bytes to copy. Copy 16 bytes at end of string.
200
+ __ and_(count, 0x0F);
201
+ __ movdqu(xmm0, Operand(src, count, times_1, -0x10));
202
+ __ movdqu(Operand(dst, count, times_1, -0x10), xmm0);
203
+
204
+ __ mov(eax, Operand(esp, stack_offset + kDestinationOffset));
205
+ __ pop(esi);
206
+ __ pop(edi);
207
+ __ ret(0);
208
+ }
209
+
210
+ } else {
211
+ // SSE2 not supported. Unlikely to happen in practice.
212
+ __ push(edi);
213
+ __ push(esi);
214
+ stack_offset += 2 * kPointerSize;
215
+ __ cld();
216
+ Register dst = edi;
217
+ Register src = esi;
218
+ Register count = ecx;
219
+ __ mov(dst, Operand(esp, stack_offset + kDestinationOffset));
220
+ __ mov(src, Operand(esp, stack_offset + kSourceOffset));
221
+ __ mov(count, Operand(esp, stack_offset + kSizeOffset));
222
+
223
+ // Copy the first word.
224
+ __ mov(eax, Operand(src, 0));
225
+ __ mov(Operand(dst, 0), eax);
226
+
227
+ // Increment src,dstso that dst is aligned.
228
+ __ mov(edx, dst);
229
+ __ and_(edx, 0x03);
230
+ __ neg(edx);
231
+ __ add(Operand(edx), Immediate(4)); // edx = 4 - (dst & 3)
232
+ __ add(dst, Operand(edx));
233
+ __ add(src, Operand(edx));
234
+ __ sub(Operand(count), edx);
235
+ // edi is now aligned, ecx holds number of remaning bytes to copy.
236
+
237
+ __ mov(edx, count);
238
+ count = edx;
239
+ __ shr(ecx, 2); // Make word count instead of byte count.
240
+ __ rep_movs();
241
+
242
+ // At most 3 bytes left to copy. Copy 4 bytes at end of string.
243
+ __ and_(count, 3);
244
+ __ mov(eax, Operand(src, count, times_1, -4));
245
+ __ mov(Operand(dst, count, times_1, -4), eax);
246
+
247
+ __ mov(eax, Operand(esp, stack_offset + kDestinationOffset));
248
+ __ pop(esi);
249
+ __ pop(edi);
250
+ __ ret(0);
251
+ }
252
+
253
+ CodeDesc desc;
254
+ masm.GetCode(&desc);
255
+ ASSERT(desc.reloc_size == 0);
256
+
257
+ CPU::FlushICache(buffer, actual_size);
258
+ return FUNCTION_CAST<OS::MemCopyFunction>(buffer);
259
+ }
260
+
261
+ #undef __
262
+
263
+ } } // namespace v8::internal
264
+
265
+ #endif // V8_TARGET_ARCH_IA32
@@ -0,0 +1,79 @@
1
+ // Copyright 2011 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #ifndef V8_IA32_CODEGEN_IA32_H_
29
+ #define V8_IA32_CODEGEN_IA32_H_
30
+
31
+ #include "ast.h"
32
+ #include "ic-inl.h"
33
+
34
+ namespace v8 {
35
+ namespace internal {
36
+
37
+ // Forward declarations
38
+ class CompilationInfo;
39
+
40
+ // -------------------------------------------------------------------------
41
+ // CodeGenerator
42
+
43
+ class CodeGenerator {
44
+ public:
45
+ // Printing of AST, etc. as requested by flags.
46
+ static void MakeCodePrologue(CompilationInfo* info);
47
+
48
+ // Allocate and install the code.
49
+ static Handle<Code> MakeCodeEpilogue(MacroAssembler* masm,
50
+ Code::Flags flags,
51
+ CompilationInfo* info);
52
+
53
+ // Print the code after compiling it.
54
+ static void PrintCode(Handle<Code> code, CompilationInfo* info);
55
+
56
+ #ifdef ENABLE_LOGGING_AND_PROFILING
57
+ static bool ShouldGenerateLog(Expression* type);
58
+ #endif
59
+
60
+ static bool RecordPositions(MacroAssembler* masm,
61
+ int pos,
62
+ bool right_here = false);
63
+
64
+
65
+ static Operand FixedArrayElementOperand(Register array,
66
+ Register index_as_smi,
67
+ int additional_offset = 0) {
68
+ int offset = FixedArray::kHeaderSize + additional_offset * kPointerSize;
69
+ return FieldOperand(array, index_as_smi, times_half_pointer_size, offset);
70
+ }
71
+
72
+ private:
73
+ DISALLOW_COPY_AND_ASSIGN(CodeGenerator);
74
+ };
75
+
76
+
77
+ } } // namespace v8::internal
78
+
79
+ #endif // V8_IA32_CODEGEN_IA32_H_
@@ -0,0 +1,88 @@
1
+ // Copyright 2006-2008 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
+ // CPU specific code for ia32 independent of OS goes here.
29
+
30
+ #ifdef __GNUC__
31
+ #include "third_party/valgrind/valgrind.h"
32
+ #endif
33
+
34
+ #include "v8.h"
35
+
36
+ #if defined(V8_TARGET_ARCH_IA32)
37
+
38
+ #include "cpu.h"
39
+ #include "macro-assembler.h"
40
+
41
+ namespace v8 {
42
+ namespace internal {
43
+
44
+ void CPU::Setup() {
45
+ CpuFeatures::Probe();
46
+ }
47
+
48
+
49
+ bool CPU::SupportsCrankshaft() {
50
+ return CpuFeatures::IsSupported(SSE2);
51
+ }
52
+
53
+
54
+ void CPU::FlushICache(void* start, size_t size) {
55
+ // No need to flush the instruction cache on Intel. On Intel instruction
56
+ // cache flushing is only necessary when multiple cores running the same
57
+ // code simultaneously. V8 (and JavaScript) is single threaded and when code
58
+ // is patched on an intel CPU the core performing the patching will have its
59
+ // own instruction cache updated automatically.
60
+
61
+ // If flushing of the instruction cache becomes necessary Windows has the
62
+ // API function FlushInstructionCache.
63
+
64
+ // By default, valgrind only checks the stack for writes that might need to
65
+ // invalidate already cached translated code. This leads to random
66
+ // instability when code patches or moves are sometimes unnoticed. One
67
+ // solution is to run valgrind with --smc-check=all, but this comes at a big
68
+ // performance cost. We can notify valgrind to invalidate its cache.
69
+ #ifdef VALGRIND_DISCARD_TRANSLATIONS
70
+ VALGRIND_DISCARD_TRANSLATIONS(start, size);
71
+ #endif
72
+ }
73
+
74
+
75
+ void CPU::DebugBreak() {
76
+ #ifdef _MSC_VER
77
+ // To avoid Visual Studio runtime support the following code can be used
78
+ // instead
79
+ // __asm { int 3 }
80
+ __debugbreak();
81
+ #else
82
+ asm("int $3");
83
+ #endif
84
+ }
85
+
86
+ } } // namespace v8::internal
87
+
88
+ #endif // V8_TARGET_ARCH_IA32
@@ -0,0 +1,312 @@
1
+ // Copyright 2011 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #include "v8.h"
29
+
30
+ #if defined(V8_TARGET_ARCH_IA32)
31
+
32
+ #include "codegen.h"
33
+ #include "debug.h"
34
+
35
+
36
+ namespace v8 {
37
+ namespace internal {
38
+
39
+ #ifdef ENABLE_DEBUGGER_SUPPORT
40
+
41
+ bool BreakLocationIterator::IsDebugBreakAtReturn() {
42
+ return Debug::IsDebugBreakAtReturn(rinfo());
43
+ }
44
+
45
+
46
+ // Patch the JS frame exit code with a debug break call. See
47
+ // CodeGenerator::VisitReturnStatement and VirtualFrame::Exit in codegen-ia32.cc
48
+ // for the precise return instructions sequence.
49
+ void BreakLocationIterator::SetDebugBreakAtReturn() {
50
+ ASSERT(Assembler::kJSReturnSequenceLength >=
51
+ Assembler::kCallInstructionLength);
52
+ Isolate* isolate = Isolate::Current();
53
+ rinfo()->PatchCodeWithCall(isolate->debug()->debug_break_return()->entry(),
54
+ Assembler::kJSReturnSequenceLength - Assembler::kCallInstructionLength);
55
+ }
56
+
57
+
58
+ // Restore the JS frame exit code.
59
+ void BreakLocationIterator::ClearDebugBreakAtReturn() {
60
+ rinfo()->PatchCode(original_rinfo()->pc(),
61
+ Assembler::kJSReturnSequenceLength);
62
+ }
63
+
64
+
65
+ // A debug break in the frame exit code is identified by the JS frame exit code
66
+ // having been patched with a call instruction.
67
+ bool Debug::IsDebugBreakAtReturn(RelocInfo* rinfo) {
68
+ ASSERT(RelocInfo::IsJSReturn(rinfo->rmode()));
69
+ return rinfo->IsPatchedReturnSequence();
70
+ }
71
+
72
+
73
+ bool BreakLocationIterator::IsDebugBreakAtSlot() {
74
+ ASSERT(IsDebugBreakSlot());
75
+ // Check whether the debug break slot instructions have been patched.
76
+ return rinfo()->IsPatchedDebugBreakSlotSequence();
77
+ }
78
+
79
+
80
+ void BreakLocationIterator::SetDebugBreakAtSlot() {
81
+ ASSERT(IsDebugBreakSlot());
82
+ Isolate* isolate = Isolate::Current();
83
+ rinfo()->PatchCodeWithCall(
84
+ isolate->debug()->debug_break_slot()->entry(),
85
+ Assembler::kDebugBreakSlotLength - Assembler::kCallInstructionLength);
86
+ }
87
+
88
+
89
+ void BreakLocationIterator::ClearDebugBreakAtSlot() {
90
+ ASSERT(IsDebugBreakSlot());
91
+ rinfo()->PatchCode(original_rinfo()->pc(), Assembler::kDebugBreakSlotLength);
92
+ }
93
+
94
+
95
+ #define __ ACCESS_MASM(masm)
96
+
97
+
98
+ static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
99
+ RegList object_regs,
100
+ RegList non_object_regs,
101
+ bool convert_call_to_jmp) {
102
+ // Enter an internal frame.
103
+ __ EnterInternalFrame();
104
+
105
+ // Store the registers containing live values on the expression stack to
106
+ // make sure that these are correctly updated during GC. Non object values
107
+ // are stored as a smi causing it to be untouched by GC.
108
+ ASSERT((object_regs & ~kJSCallerSaved) == 0);
109
+ ASSERT((non_object_regs & ~kJSCallerSaved) == 0);
110
+ ASSERT((object_regs & non_object_regs) == 0);
111
+ for (int i = 0; i < kNumJSCallerSaved; i++) {
112
+ int r = JSCallerSavedCode(i);
113
+ Register reg = { r };
114
+ if ((object_regs & (1 << r)) != 0) {
115
+ __ push(reg);
116
+ }
117
+ if ((non_object_regs & (1 << r)) != 0) {
118
+ if (FLAG_debug_code) {
119
+ __ test(reg, Immediate(0xc0000000));
120
+ __ Assert(zero, "Unable to encode value as smi");
121
+ }
122
+ __ SmiTag(reg);
123
+ __ push(reg);
124
+ }
125
+ }
126
+
127
+ #ifdef DEBUG
128
+ __ RecordComment("// Calling from debug break to runtime - come in - over");
129
+ #endif
130
+ __ Set(eax, Immediate(0)); // No arguments.
131
+ __ mov(ebx, Immediate(ExternalReference::debug_break(masm->isolate())));
132
+
133
+ CEntryStub ceb(1);
134
+ __ CallStub(&ceb);
135
+
136
+ // Restore the register values containing object pointers from the expression
137
+ // stack.
138
+ for (int i = kNumJSCallerSaved; --i >= 0;) {
139
+ int r = JSCallerSavedCode(i);
140
+ Register reg = { r };
141
+ if (FLAG_debug_code) {
142
+ __ Set(reg, Immediate(kDebugZapValue));
143
+ }
144
+ if ((object_regs & (1 << r)) != 0) {
145
+ __ pop(reg);
146
+ }
147
+ if ((non_object_regs & (1 << r)) != 0) {
148
+ __ pop(reg);
149
+ __ SmiUntag(reg);
150
+ }
151
+ }
152
+
153
+ // Get rid of the internal frame.
154
+ __ LeaveInternalFrame();
155
+
156
+ // If this call did not replace a call but patched other code then there will
157
+ // be an unwanted return address left on the stack. Here we get rid of that.
158
+ if (convert_call_to_jmp) {
159
+ __ add(Operand(esp), Immediate(kPointerSize));
160
+ }
161
+
162
+ // Now that the break point has been handled, resume normal execution by
163
+ // jumping to the target address intended by the caller and that was
164
+ // overwritten by the address of DebugBreakXXX.
165
+ ExternalReference after_break_target =
166
+ ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate());
167
+ __ jmp(Operand::StaticVariable(after_break_target));
168
+ }
169
+
170
+
171
+ void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) {
172
+ // Register state for IC load call (from ic-ia32.cc).
173
+ // ----------- S t a t e -------------
174
+ // -- eax : receiver
175
+ // -- ecx : name
176
+ // -----------------------------------
177
+ Generate_DebugBreakCallHelper(masm, eax.bit() | ecx.bit(), 0, false);
178
+ }
179
+
180
+
181
+ void Debug::GenerateStoreICDebugBreak(MacroAssembler* masm) {
182
+ // Register state for IC store call (from ic-ia32.cc).
183
+ // ----------- S t a t e -------------
184
+ // -- eax : value
185
+ // -- ecx : name
186
+ // -- edx : receiver
187
+ // -----------------------------------
188
+ Generate_DebugBreakCallHelper(
189
+ masm, eax.bit() | ecx.bit() | edx.bit(), 0, false);
190
+ }
191
+
192
+
193
+ void Debug::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) {
194
+ // Register state for keyed IC load call (from ic-ia32.cc).
195
+ // ----------- S t a t e -------------
196
+ // -- edx : receiver
197
+ // -- eax : key
198
+ // -----------------------------------
199
+ Generate_DebugBreakCallHelper(masm, eax.bit() | edx.bit(), 0, false);
200
+ }
201
+
202
+
203
+ void Debug::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) {
204
+ // Register state for keyed IC load call (from ic-ia32.cc).
205
+ // ----------- S t a t e -------------
206
+ // -- eax : value
207
+ // -- ecx : key
208
+ // -- edx : receiver
209
+ // -----------------------------------
210
+ Generate_DebugBreakCallHelper(
211
+ masm, eax.bit() | ecx.bit() | edx.bit(), 0, false);
212
+ }
213
+
214
+
215
+ void Debug::GenerateCallICDebugBreak(MacroAssembler* masm) {
216
+ // Register state for keyed IC call call (from ic-ia32.cc)
217
+ // ----------- S t a t e -------------
218
+ // -- ecx: name
219
+ // -----------------------------------
220
+ Generate_DebugBreakCallHelper(masm, ecx.bit(), 0, false);
221
+ }
222
+
223
+
224
+ void Debug::GenerateConstructCallDebugBreak(MacroAssembler* masm) {
225
+ // Register state just before return from JS function (from codegen-ia32.cc).
226
+ // eax is the actual number of arguments not encoded as a smi see comment
227
+ // above IC call.
228
+ // ----------- S t a t e -------------
229
+ // -- eax: number of arguments (not smi)
230
+ // -- edi: constructor function
231
+ // -----------------------------------
232
+ // The number of arguments in eax is not smi encoded.
233
+ Generate_DebugBreakCallHelper(masm, edi.bit(), eax.bit(), false);
234
+ }
235
+
236
+
237
+ void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) {
238
+ // Register state just before return from JS function (from codegen-ia32.cc).
239
+ // ----------- S t a t e -------------
240
+ // -- eax: return value
241
+ // -----------------------------------
242
+ Generate_DebugBreakCallHelper(masm, eax.bit(), 0, true);
243
+ }
244
+
245
+
246
+ void Debug::GenerateStubNoRegistersDebugBreak(MacroAssembler* masm) {
247
+ // Register state for stub CallFunction (from CallFunctionStub in ic-ia32.cc).
248
+ // ----------- S t a t e -------------
249
+ // No registers used on entry.
250
+ // -----------------------------------
251
+ Generate_DebugBreakCallHelper(masm, 0, 0, false);
252
+ }
253
+
254
+
255
+ void Debug::GenerateSlot(MacroAssembler* masm) {
256
+ // Generate enough nop's to make space for a call instruction.
257
+ Label check_codesize;
258
+ __ bind(&check_codesize);
259
+ __ RecordDebugBreakSlot();
260
+ for (int i = 0; i < Assembler::kDebugBreakSlotLength; i++) {
261
+ __ nop();
262
+ }
263
+ ASSERT_EQ(Assembler::kDebugBreakSlotLength,
264
+ masm->SizeOfCodeGeneratedSince(&check_codesize));
265
+ }
266
+
267
+
268
+ void Debug::GenerateSlotDebugBreak(MacroAssembler* masm) {
269
+ // In the places where a debug break slot is inserted no registers can contain
270
+ // object pointers.
271
+ Generate_DebugBreakCallHelper(masm, 0, 0, true);
272
+ }
273
+
274
+
275
+ void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
276
+ masm->ret(0);
277
+ }
278
+
279
+
280
+ void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
281
+ ExternalReference restarter_frame_function_slot =
282
+ ExternalReference(Debug_Address::RestarterFrameFunctionPointer(),
283
+ masm->isolate());
284
+ __ mov(Operand::StaticVariable(restarter_frame_function_slot), Immediate(0));
285
+
286
+ // We do not know our frame height, but set esp based on ebp.
287
+ __ lea(esp, Operand(ebp, -1 * kPointerSize));
288
+
289
+ __ pop(edi); // Function.
290
+ __ pop(ebp);
291
+
292
+ // Load context from the function.
293
+ __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
294
+
295
+ // Get function code.
296
+ __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
297
+ __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset));
298
+ __ lea(edx, FieldOperand(edx, Code::kHeaderSize));
299
+
300
+ // Re-run JSFunction, edi is function, esi is context.
301
+ __ jmp(Operand(edx));
302
+ }
303
+
304
+ const bool Debug::kFrameDropperSupported = true;
305
+
306
+ #undef __
307
+
308
+ #endif // ENABLE_DEBUGGER_SUPPORT
309
+
310
+ } } // namespace v8::internal
311
+
312
+ #endif // V8_TARGET_ARCH_IA32