therubyracer 0.5.0-x86-linux → 0.11.0beta5-x86-linux

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

Potentially problematic release.


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

Files changed (721) hide show
  1. data/.gitignore +23 -11
  2. data/.travis.yml +10 -0
  3. data/Changelog.md +242 -0
  4. data/Gemfile +16 -0
  5. data/README.md +185 -0
  6. data/Rakefile +42 -51
  7. data/benchmarks.rb +217 -0
  8. data/ext/v8/accessor.cc +181 -0
  9. data/ext/v8/array.cc +26 -0
  10. data/ext/v8/backref.cc +56 -0
  11. data/ext/v8/build.rb +52 -0
  12. data/ext/v8/constants.cc +34 -0
  13. data/ext/v8/constraints.cc +52 -0
  14. data/ext/v8/context.cc +130 -0
  15. data/ext/v8/date.cc +18 -0
  16. data/ext/v8/exception.cc +38 -0
  17. data/ext/v8/extconf.rb +16 -29
  18. data/ext/v8/external.cc +43 -0
  19. data/ext/v8/function.cc +58 -0
  20. data/ext/v8/gc.cc +43 -0
  21. data/ext/v8/handles.cc +34 -0
  22. data/ext/v8/heap.cc +31 -0
  23. data/ext/v8/init.cc +39 -0
  24. data/ext/v8/init.so +0 -0
  25. data/ext/v8/invocation.cc +86 -0
  26. data/ext/v8/locker.cc +77 -0
  27. data/ext/v8/message.cc +51 -0
  28. data/ext/v8/object.cc +334 -0
  29. data/ext/v8/primitive.cc +8 -0
  30. data/ext/v8/rr.cc +83 -0
  31. data/ext/v8/rr.h +883 -0
  32. data/ext/v8/script.cc +80 -0
  33. data/ext/v8/signature.cc +18 -0
  34. data/ext/v8/stack.cc +75 -0
  35. data/ext/v8/string.cc +47 -0
  36. data/ext/v8/template.cc +175 -0
  37. data/ext/v8/trycatch.cc +86 -0
  38. data/ext/v8/v8.cc +87 -0
  39. data/ext/v8/value.cc +239 -0
  40. data/lib/v8.rb +30 -9
  41. data/lib/v8/access.rb +5 -0
  42. data/lib/v8/access/indices.rb +40 -0
  43. data/lib/v8/access/invocation.rb +47 -0
  44. data/lib/v8/access/names.rb +65 -0
  45. data/lib/v8/array.rb +26 -0
  46. data/lib/v8/context.rb +217 -75
  47. data/lib/v8/conversion.rb +35 -0
  48. data/lib/v8/conversion/array.rb +11 -0
  49. data/lib/v8/conversion/class.rb +120 -0
  50. data/lib/v8/conversion/code.rb +38 -0
  51. data/lib/v8/conversion/fundamental.rb +11 -0
  52. data/lib/v8/conversion/hash.rb +11 -0
  53. data/lib/v8/conversion/indentity.rb +31 -0
  54. data/lib/v8/conversion/method.rb +26 -0
  55. data/lib/v8/conversion/object.rb +28 -0
  56. data/lib/v8/conversion/primitive.rb +7 -0
  57. data/lib/v8/conversion/proc.rb +5 -0
  58. data/lib/v8/conversion/reference.rb +16 -0
  59. data/lib/v8/conversion/string.rb +12 -0
  60. data/lib/v8/conversion/symbol.rb +7 -0
  61. data/lib/v8/conversion/time.rb +13 -0
  62. data/lib/v8/error.rb +25 -0
  63. data/lib/v8/error/protect.rb +20 -0
  64. data/lib/v8/error/try.rb +15 -0
  65. data/lib/v8/function.rb +28 -0
  66. data/lib/v8/object.rb +69 -28
  67. data/lib/v8/util/weakcell.rb +29 -0
  68. data/lib/v8/version.rb +3 -0
  69. data/spec/c/array_spec.rb +17 -0
  70. data/spec/c/constants_spec.rb +20 -0
  71. data/spec/c/exception_spec.rb +26 -0
  72. data/spec/c/external_spec.rb +9 -0
  73. data/spec/c/function_spec.rb +46 -0
  74. data/spec/c/handles_spec.rb +35 -0
  75. data/spec/c/locker_spec.rb +38 -0
  76. data/spec/c/object_spec.rb +46 -0
  77. data/spec/c/script_spec.rb +28 -0
  78. data/spec/c/string_spec.rb +16 -0
  79. data/spec/c/template_spec.rb +30 -0
  80. data/spec/c/trycatch_spec.rb +51 -0
  81. data/spec/mem/blunt_spec.rb +42 -0
  82. data/spec/redjs_spec.rb +10 -0
  83. data/spec/spec_helper.rb +43 -12
  84. data/spec/threading_spec.rb +52 -0
  85. data/spec/v8/context_spec.rb +19 -0
  86. data/spec/v8/conversion_spec.rb +9 -0
  87. data/spec/v8/error_spec.rb +21 -0
  88. data/spec/v8/function_spec.rb +9 -0
  89. data/spec/v8/object_spec.rb +15 -0
  90. data/thefrontside.png +0 -0
  91. data/therubyracer.gemspec +15 -676
  92. metadata +146 -680
  93. data/.gitmodules +0 -3
  94. data/Doxyfile +0 -1514
  95. data/History.txt +0 -51
  96. data/README.rdoc +0 -158
  97. data/docs/data_conversion.txt +0 -18
  98. data/ext/v8/callbacks.cpp +0 -160
  99. data/ext/v8/callbacks.h +0 -14
  100. data/ext/v8/convert_ruby.cpp +0 -8
  101. data/ext/v8/convert_ruby.h +0 -99
  102. data/ext/v8/convert_string.cpp +0 -10
  103. data/ext/v8/convert_string.h +0 -73
  104. data/ext/v8/convert_v8.cpp +0 -9
  105. data/ext/v8/convert_v8.h +0 -121
  106. data/ext/v8/converters.cpp +0 -83
  107. data/ext/v8/converters.h +0 -23
  108. data/ext/v8/upstream/2.0.6/.gitignore +0 -26
  109. data/ext/v8/upstream/2.0.6/AUTHORS +0 -23
  110. data/ext/v8/upstream/2.0.6/ChangeLog +0 -1479
  111. data/ext/v8/upstream/2.0.6/LICENSE +0 -55
  112. data/ext/v8/upstream/2.0.6/SConstruct +0 -1028
  113. data/ext/v8/upstream/2.0.6/include/v8-debug.h +0 -275
  114. data/ext/v8/upstream/2.0.6/include/v8.h +0 -3236
  115. data/ext/v8/upstream/2.0.6/src/SConscript +0 -283
  116. data/ext/v8/upstream/2.0.6/src/accessors.cc +0 -695
  117. data/ext/v8/upstream/2.0.6/src/accessors.h +0 -114
  118. data/ext/v8/upstream/2.0.6/src/allocation.cc +0 -198
  119. data/ext/v8/upstream/2.0.6/src/allocation.h +0 -169
  120. data/ext/v8/upstream/2.0.6/src/api.cc +0 -3831
  121. data/ext/v8/upstream/2.0.6/src/api.h +0 -479
  122. data/ext/v8/upstream/2.0.6/src/apinatives.js +0 -110
  123. data/ext/v8/upstream/2.0.6/src/apiutils.h +0 -69
  124. data/ext/v8/upstream/2.0.6/src/arguments.h +0 -97
  125. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm-inl.h +0 -277
  126. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.cc +0 -1821
  127. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.h +0 -1027
  128. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2-inl.h +0 -267
  129. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.cc +0 -1821
  130. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.h +0 -1027
  131. data/ext/v8/upstream/2.0.6/src/arm/builtins-arm.cc +0 -1271
  132. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm-inl.h +0 -74
  133. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.cc +0 -6682
  134. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.h +0 -535
  135. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.cc +0 -112
  136. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.h +0 -347
  137. data/ext/v8/upstream/2.0.6/src/arm/cpu-arm.cc +0 -132
  138. data/ext/v8/upstream/2.0.6/src/arm/debug-arm.cc +0 -213
  139. data/ext/v8/upstream/2.0.6/src/arm/disasm-arm.cc +0 -1166
  140. data/ext/v8/upstream/2.0.6/src/arm/fast-codegen-arm.cc +0 -1698
  141. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.cc +0 -123
  142. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.h +0 -162
  143. data/ext/v8/upstream/2.0.6/src/arm/ic-arm.cc +0 -849
  144. data/ext/v8/upstream/2.0.6/src/arm/jump-target-arm.cc +0 -238
  145. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.cc +0 -1259
  146. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.h +0 -423
  147. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.cc +0 -1266
  148. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.h +0 -282
  149. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm-inl.h +0 -103
  150. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.cc +0 -59
  151. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.h +0 -43
  152. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.cc +0 -2264
  153. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.h +0 -306
  154. data/ext/v8/upstream/2.0.6/src/arm/stub-cache-arm.cc +0 -1516
  155. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.cc +0 -412
  156. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.h +0 -532
  157. data/ext/v8/upstream/2.0.6/src/array.js +0 -1154
  158. data/ext/v8/upstream/2.0.6/src/assembler.cc +0 -772
  159. data/ext/v8/upstream/2.0.6/src/assembler.h +0 -525
  160. data/ext/v8/upstream/2.0.6/src/ast.cc +0 -512
  161. data/ext/v8/upstream/2.0.6/src/ast.h +0 -1820
  162. data/ext/v8/upstream/2.0.6/src/bootstrapper.cc +0 -1680
  163. data/ext/v8/upstream/2.0.6/src/bootstrapper.h +0 -103
  164. data/ext/v8/upstream/2.0.6/src/builtins.cc +0 -851
  165. data/ext/v8/upstream/2.0.6/src/builtins.h +0 -245
  166. data/ext/v8/upstream/2.0.6/src/bytecodes-irregexp.h +0 -104
  167. data/ext/v8/upstream/2.0.6/src/char-predicates-inl.h +0 -86
  168. data/ext/v8/upstream/2.0.6/src/char-predicates.h +0 -65
  169. data/ext/v8/upstream/2.0.6/src/checks.cc +0 -100
  170. data/ext/v8/upstream/2.0.6/src/checks.h +0 -284
  171. data/ext/v8/upstream/2.0.6/src/code-stubs.cc +0 -164
  172. data/ext/v8/upstream/2.0.6/src/code-stubs.h +0 -164
  173. data/ext/v8/upstream/2.0.6/src/code.h +0 -68
  174. data/ext/v8/upstream/2.0.6/src/codegen-inl.h +0 -88
  175. data/ext/v8/upstream/2.0.6/src/codegen.cc +0 -504
  176. data/ext/v8/upstream/2.0.6/src/codegen.h +0 -522
  177. data/ext/v8/upstream/2.0.6/src/compilation-cache.cc +0 -490
  178. data/ext/v8/upstream/2.0.6/src/compilation-cache.h +0 -98
  179. data/ext/v8/upstream/2.0.6/src/compiler.cc +0 -1132
  180. data/ext/v8/upstream/2.0.6/src/compiler.h +0 -107
  181. data/ext/v8/upstream/2.0.6/src/contexts.cc +0 -256
  182. data/ext/v8/upstream/2.0.6/src/contexts.h +0 -345
  183. data/ext/v8/upstream/2.0.6/src/conversions-inl.h +0 -95
  184. data/ext/v8/upstream/2.0.6/src/conversions.cc +0 -709
  185. data/ext/v8/upstream/2.0.6/src/conversions.h +0 -118
  186. data/ext/v8/upstream/2.0.6/src/counters.cc +0 -78
  187. data/ext/v8/upstream/2.0.6/src/counters.h +0 -239
  188. data/ext/v8/upstream/2.0.6/src/cpu.h +0 -65
  189. data/ext/v8/upstream/2.0.6/src/d8-debug.cc +0 -345
  190. data/ext/v8/upstream/2.0.6/src/d8-debug.h +0 -155
  191. data/ext/v8/upstream/2.0.6/src/d8-posix.cc +0 -675
  192. data/ext/v8/upstream/2.0.6/src/d8-readline.cc +0 -128
  193. data/ext/v8/upstream/2.0.6/src/d8-windows.cc +0 -42
  194. data/ext/v8/upstream/2.0.6/src/d8.cc +0 -776
  195. data/ext/v8/upstream/2.0.6/src/d8.h +0 -225
  196. data/ext/v8/upstream/2.0.6/src/d8.js +0 -1625
  197. data/ext/v8/upstream/2.0.6/src/date-delay.js +0 -1138
  198. data/ext/v8/upstream/2.0.6/src/dateparser-inl.h +0 -114
  199. data/ext/v8/upstream/2.0.6/src/dateparser.cc +0 -186
  200. data/ext/v8/upstream/2.0.6/src/dateparser.h +0 -240
  201. data/ext/v8/upstream/2.0.6/src/debug-agent.cc +0 -425
  202. data/ext/v8/upstream/2.0.6/src/debug-agent.h +0 -129
  203. data/ext/v8/upstream/2.0.6/src/debug-delay.js +0 -2073
  204. data/ext/v8/upstream/2.0.6/src/debug.cc +0 -2751
  205. data/ext/v8/upstream/2.0.6/src/debug.h +0 -866
  206. data/ext/v8/upstream/2.0.6/src/disasm.h +0 -77
  207. data/ext/v8/upstream/2.0.6/src/disassembler.cc +0 -318
  208. data/ext/v8/upstream/2.0.6/src/disassembler.h +0 -56
  209. data/ext/v8/upstream/2.0.6/src/dtoa-config.c +0 -91
  210. data/ext/v8/upstream/2.0.6/src/execution.cc +0 -701
  211. data/ext/v8/upstream/2.0.6/src/execution.h +0 -312
  212. data/ext/v8/upstream/2.0.6/src/factory.cc +0 -957
  213. data/ext/v8/upstream/2.0.6/src/factory.h +0 -393
  214. data/ext/v8/upstream/2.0.6/src/fast-codegen.cc +0 -725
  215. data/ext/v8/upstream/2.0.6/src/fast-codegen.h +0 -371
  216. data/ext/v8/upstream/2.0.6/src/flag-definitions.h +0 -426
  217. data/ext/v8/upstream/2.0.6/src/flags.cc +0 -555
  218. data/ext/v8/upstream/2.0.6/src/flags.h +0 -81
  219. data/ext/v8/upstream/2.0.6/src/frame-element.cc +0 -45
  220. data/ext/v8/upstream/2.0.6/src/frame-element.h +0 -235
  221. data/ext/v8/upstream/2.0.6/src/frames-inl.h +0 -215
  222. data/ext/v8/upstream/2.0.6/src/frames.cc +0 -749
  223. data/ext/v8/upstream/2.0.6/src/frames.h +0 -659
  224. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.cc +0 -76
  225. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.h +0 -135
  226. data/ext/v8/upstream/2.0.6/src/global-handles.cc +0 -516
  227. data/ext/v8/upstream/2.0.6/src/global-handles.h +0 -180
  228. data/ext/v8/upstream/2.0.6/src/globals.h +0 -608
  229. data/ext/v8/upstream/2.0.6/src/handles-inl.h +0 -76
  230. data/ext/v8/upstream/2.0.6/src/handles.cc +0 -811
  231. data/ext/v8/upstream/2.0.6/src/handles.h +0 -367
  232. data/ext/v8/upstream/2.0.6/src/hashmap.cc +0 -226
  233. data/ext/v8/upstream/2.0.6/src/hashmap.h +0 -120
  234. data/ext/v8/upstream/2.0.6/src/heap-inl.h +0 -407
  235. data/ext/v8/upstream/2.0.6/src/heap-profiler.cc +0 -695
  236. data/ext/v8/upstream/2.0.6/src/heap-profiler.h +0 -277
  237. data/ext/v8/upstream/2.0.6/src/heap.cc +0 -4204
  238. data/ext/v8/upstream/2.0.6/src/heap.h +0 -1704
  239. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32-inl.h +0 -325
  240. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.cc +0 -2375
  241. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.h +0 -914
  242. data/ext/v8/upstream/2.0.6/src/ia32/builtins-ia32.cc +0 -1222
  243. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32-inl.h +0 -46
  244. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.cc +0 -9770
  245. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.h +0 -834
  246. data/ext/v8/upstream/2.0.6/src/ia32/cpu-ia32.cc +0 -79
  247. data/ext/v8/upstream/2.0.6/src/ia32/debug-ia32.cc +0 -208
  248. data/ext/v8/upstream/2.0.6/src/ia32/disasm-ia32.cc +0 -1357
  249. data/ext/v8/upstream/2.0.6/src/ia32/fast-codegen-ia32.cc +0 -1813
  250. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.cc +0 -111
  251. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.h +0 -135
  252. data/ext/v8/upstream/2.0.6/src/ia32/ic-ia32.cc +0 -1490
  253. data/ext/v8/upstream/2.0.6/src/ia32/jump-target-ia32.cc +0 -432
  254. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.cc +0 -1517
  255. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.h +0 -528
  256. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.cc +0 -1219
  257. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.h +0 -230
  258. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32-inl.h +0 -82
  259. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.cc +0 -99
  260. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.h +0 -43
  261. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.cc +0 -30
  262. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.h +0 -62
  263. data/ext/v8/upstream/2.0.6/src/ia32/stub-cache-ia32.cc +0 -1961
  264. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.cc +0 -1105
  265. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.h +0 -580
  266. data/ext/v8/upstream/2.0.6/src/ic-inl.h +0 -93
  267. data/ext/v8/upstream/2.0.6/src/ic.cc +0 -1426
  268. data/ext/v8/upstream/2.0.6/src/ic.h +0 -443
  269. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.cc +0 -646
  270. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.h +0 -48
  271. data/ext/v8/upstream/2.0.6/src/json-delay.js +0 -254
  272. data/ext/v8/upstream/2.0.6/src/jsregexp.cc +0 -5234
  273. data/ext/v8/upstream/2.0.6/src/jsregexp.h +0 -1439
  274. data/ext/v8/upstream/2.0.6/src/jump-target-inl.h +0 -49
  275. data/ext/v8/upstream/2.0.6/src/jump-target.cc +0 -383
  276. data/ext/v8/upstream/2.0.6/src/jump-target.h +0 -280
  277. data/ext/v8/upstream/2.0.6/src/list-inl.h +0 -166
  278. data/ext/v8/upstream/2.0.6/src/list.h +0 -158
  279. data/ext/v8/upstream/2.0.6/src/log-inl.h +0 -126
  280. data/ext/v8/upstream/2.0.6/src/log-utils.cc +0 -503
  281. data/ext/v8/upstream/2.0.6/src/log-utils.h +0 -292
  282. data/ext/v8/upstream/2.0.6/src/log.cc +0 -1457
  283. data/ext/v8/upstream/2.0.6/src/log.h +0 -371
  284. data/ext/v8/upstream/2.0.6/src/macro-assembler.h +0 -93
  285. data/ext/v8/upstream/2.0.6/src/macros.py +0 -137
  286. data/ext/v8/upstream/2.0.6/src/mark-compact.cc +0 -2007
  287. data/ext/v8/upstream/2.0.6/src/mark-compact.h +0 -442
  288. data/ext/v8/upstream/2.0.6/src/math.js +0 -263
  289. data/ext/v8/upstream/2.0.6/src/memory.h +0 -74
  290. data/ext/v8/upstream/2.0.6/src/messages.cc +0 -177
  291. data/ext/v8/upstream/2.0.6/src/messages.h +0 -112
  292. data/ext/v8/upstream/2.0.6/src/messages.js +0 -937
  293. data/ext/v8/upstream/2.0.6/src/mirror-delay.js +0 -2332
  294. data/ext/v8/upstream/2.0.6/src/mksnapshot.cc +0 -169
  295. data/ext/v8/upstream/2.0.6/src/natives.h +0 -63
  296. data/ext/v8/upstream/2.0.6/src/objects-debug.cc +0 -1317
  297. data/ext/v8/upstream/2.0.6/src/objects-inl.h +0 -3044
  298. data/ext/v8/upstream/2.0.6/src/objects.cc +0 -8306
  299. data/ext/v8/upstream/2.0.6/src/objects.h +0 -4960
  300. data/ext/v8/upstream/2.0.6/src/oprofile-agent.cc +0 -116
  301. data/ext/v8/upstream/2.0.6/src/oprofile-agent.h +0 -69
  302. data/ext/v8/upstream/2.0.6/src/parser.cc +0 -4810
  303. data/ext/v8/upstream/2.0.6/src/parser.h +0 -195
  304. data/ext/v8/upstream/2.0.6/src/platform-freebsd.cc +0 -645
  305. data/ext/v8/upstream/2.0.6/src/platform-linux.cc +0 -808
  306. data/ext/v8/upstream/2.0.6/src/platform-macos.cc +0 -643
  307. data/ext/v8/upstream/2.0.6/src/platform-nullos.cc +0 -454
  308. data/ext/v8/upstream/2.0.6/src/platform-openbsd.cc +0 -597
  309. data/ext/v8/upstream/2.0.6/src/platform-posix.cc +0 -380
  310. data/ext/v8/upstream/2.0.6/src/platform-win32.cc +0 -1908
  311. data/ext/v8/upstream/2.0.6/src/platform.h +0 -556
  312. data/ext/v8/upstream/2.0.6/src/prettyprinter.cc +0 -1511
  313. data/ext/v8/upstream/2.0.6/src/prettyprinter.h +0 -219
  314. data/ext/v8/upstream/2.0.6/src/property.cc +0 -96
  315. data/ext/v8/upstream/2.0.6/src/property.h +0 -327
  316. data/ext/v8/upstream/2.0.6/src/regexp-delay.js +0 -406
  317. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp-inl.h +0 -78
  318. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.cc +0 -464
  319. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.h +0 -141
  320. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.cc +0 -356
  321. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.h +0 -103
  322. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.cc +0 -240
  323. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.h +0 -220
  324. data/ext/v8/upstream/2.0.6/src/regexp-stack.cc +0 -103
  325. data/ext/v8/upstream/2.0.6/src/regexp-stack.h +0 -123
  326. data/ext/v8/upstream/2.0.6/src/register-allocator-inl.h +0 -74
  327. data/ext/v8/upstream/2.0.6/src/register-allocator.cc +0 -100
  328. data/ext/v8/upstream/2.0.6/src/register-allocator.h +0 -295
  329. data/ext/v8/upstream/2.0.6/src/rewriter.cc +0 -855
  330. data/ext/v8/upstream/2.0.6/src/rewriter.h +0 -54
  331. data/ext/v8/upstream/2.0.6/src/runtime.cc +0 -8163
  332. data/ext/v8/upstream/2.0.6/src/runtime.h +0 -432
  333. data/ext/v8/upstream/2.0.6/src/runtime.js +0 -626
  334. data/ext/v8/upstream/2.0.6/src/scanner.cc +0 -1098
  335. data/ext/v8/upstream/2.0.6/src/scanner.h +0 -425
  336. data/ext/v8/upstream/2.0.6/src/scopeinfo.cc +0 -649
  337. data/ext/v8/upstream/2.0.6/src/scopeinfo.h +0 -236
  338. data/ext/v8/upstream/2.0.6/src/scopes.cc +0 -963
  339. data/ext/v8/upstream/2.0.6/src/scopes.h +0 -401
  340. data/ext/v8/upstream/2.0.6/src/serialize.cc +0 -1260
  341. data/ext/v8/upstream/2.0.6/src/serialize.h +0 -404
  342. data/ext/v8/upstream/2.0.6/src/shell.h +0 -55
  343. data/ext/v8/upstream/2.0.6/src/simulator.h +0 -41
  344. data/ext/v8/upstream/2.0.6/src/smart-pointer.h +0 -109
  345. data/ext/v8/upstream/2.0.6/src/snapshot-common.cc +0 -97
  346. data/ext/v8/upstream/2.0.6/src/snapshot-empty.cc +0 -40
  347. data/ext/v8/upstream/2.0.6/src/snapshot.h +0 -59
  348. data/ext/v8/upstream/2.0.6/src/spaces-inl.h +0 -372
  349. data/ext/v8/upstream/2.0.6/src/spaces.cc +0 -2864
  350. data/ext/v8/upstream/2.0.6/src/spaces.h +0 -2072
  351. data/ext/v8/upstream/2.0.6/src/string-stream.cc +0 -584
  352. data/ext/v8/upstream/2.0.6/src/string-stream.h +0 -189
  353. data/ext/v8/upstream/2.0.6/src/string.js +0 -901
  354. data/ext/v8/upstream/2.0.6/src/stub-cache.cc +0 -1108
  355. data/ext/v8/upstream/2.0.6/src/stub-cache.h +0 -578
  356. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/COPYING +0 -15
  357. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/dtoa.c +0 -3330
  358. data/ext/v8/upstream/2.0.6/src/third_party/valgrind/valgrind.h +0 -3925
  359. data/ext/v8/upstream/2.0.6/src/token.cc +0 -56
  360. data/ext/v8/upstream/2.0.6/src/token.h +0 -270
  361. data/ext/v8/upstream/2.0.6/src/top.cc +0 -991
  362. data/ext/v8/upstream/2.0.6/src/top.h +0 -459
  363. data/ext/v8/upstream/2.0.6/src/unicode-inl.h +0 -238
  364. data/ext/v8/upstream/2.0.6/src/unicode.cc +0 -749
  365. data/ext/v8/upstream/2.0.6/src/unicode.h +0 -279
  366. data/ext/v8/upstream/2.0.6/src/uri.js +0 -415
  367. data/ext/v8/upstream/2.0.6/src/usage-analyzer.cc +0 -426
  368. data/ext/v8/upstream/2.0.6/src/usage-analyzer.h +0 -40
  369. data/ext/v8/upstream/2.0.6/src/utils.cc +0 -322
  370. data/ext/v8/upstream/2.0.6/src/utils.h +0 -592
  371. data/ext/v8/upstream/2.0.6/src/v8-counters.cc +0 -55
  372. data/ext/v8/upstream/2.0.6/src/v8-counters.h +0 -198
  373. data/ext/v8/upstream/2.0.6/src/v8.cc +0 -193
  374. data/ext/v8/upstream/2.0.6/src/v8.h +0 -119
  375. data/ext/v8/upstream/2.0.6/src/v8natives.js +0 -846
  376. data/ext/v8/upstream/2.0.6/src/v8threads.cc +0 -450
  377. data/ext/v8/upstream/2.0.6/src/v8threads.h +0 -144
  378. data/ext/v8/upstream/2.0.6/src/variables.cc +0 -163
  379. data/ext/v8/upstream/2.0.6/src/variables.h +0 -235
  380. data/ext/v8/upstream/2.0.6/src/version.cc +0 -88
  381. data/ext/v8/upstream/2.0.6/src/version.h +0 -64
  382. data/ext/v8/upstream/2.0.6/src/virtual-frame.cc +0 -381
  383. data/ext/v8/upstream/2.0.6/src/virtual-frame.h +0 -44
  384. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64-inl.h +0 -352
  385. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.cc +0 -2539
  386. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.h +0 -1399
  387. data/ext/v8/upstream/2.0.6/src/x64/builtins-x64.cc +0 -1255
  388. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64-inl.h +0 -46
  389. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.cc +0 -8223
  390. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.h +0 -785
  391. data/ext/v8/upstream/2.0.6/src/x64/cpu-x64.cc +0 -79
  392. data/ext/v8/upstream/2.0.6/src/x64/debug-x64.cc +0 -202
  393. data/ext/v8/upstream/2.0.6/src/x64/disasm-x64.cc +0 -1596
  394. data/ext/v8/upstream/2.0.6/src/x64/fast-codegen-x64.cc +0 -1820
  395. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.cc +0 -109
  396. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.h +0 -121
  397. data/ext/v8/upstream/2.0.6/src/x64/ic-x64.cc +0 -1392
  398. data/ext/v8/upstream/2.0.6/src/x64/jump-target-x64.cc +0 -432
  399. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.cc +0 -2409
  400. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.h +0 -765
  401. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.cc +0 -1337
  402. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.h +0 -295
  403. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64-inl.h +0 -86
  404. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.cc +0 -84
  405. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.h +0 -43
  406. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.cc +0 -27
  407. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.h +0 -63
  408. data/ext/v8/upstream/2.0.6/src/x64/stub-cache-x64.cc +0 -1884
  409. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.cc +0 -1089
  410. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.h +0 -560
  411. data/ext/v8/upstream/2.0.6/src/zone-inl.h +0 -297
  412. data/ext/v8/upstream/2.0.6/src/zone.cc +0 -193
  413. data/ext/v8/upstream/2.0.6/src/zone.h +0 -305
  414. data/ext/v8/upstream/2.0.6/tools/codemap.js +0 -258
  415. data/ext/v8/upstream/2.0.6/tools/consarray.js +0 -93
  416. data/ext/v8/upstream/2.0.6/tools/csvparser.js +0 -98
  417. data/ext/v8/upstream/2.0.6/tools/gyp/v8.gyp +0 -620
  418. data/ext/v8/upstream/2.0.6/tools/js2c.py +0 -376
  419. data/ext/v8/upstream/2.0.6/tools/jsmin.py +0 -280
  420. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor +0 -24
  421. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor.py +0 -78
  422. data/ext/v8/upstream/2.0.6/tools/logreader.js +0 -320
  423. data/ext/v8/upstream/2.0.6/tools/mac-nm +0 -18
  424. data/ext/v8/upstream/2.0.6/tools/mac-tick-processor +0 -6
  425. data/ext/v8/upstream/2.0.6/tools/oprofile/annotate +0 -7
  426. data/ext/v8/upstream/2.0.6/tools/oprofile/common +0 -19
  427. data/ext/v8/upstream/2.0.6/tools/oprofile/dump +0 -7
  428. data/ext/v8/upstream/2.0.6/tools/oprofile/report +0 -7
  429. data/ext/v8/upstream/2.0.6/tools/oprofile/reset +0 -7
  430. data/ext/v8/upstream/2.0.6/tools/oprofile/run +0 -14
  431. data/ext/v8/upstream/2.0.6/tools/oprofile/shutdown +0 -7
  432. data/ext/v8/upstream/2.0.6/tools/oprofile/start +0 -7
  433. data/ext/v8/upstream/2.0.6/tools/presubmit.py +0 -299
  434. data/ext/v8/upstream/2.0.6/tools/process-heap-prof.py +0 -120
  435. data/ext/v8/upstream/2.0.6/tools/profile.js +0 -621
  436. data/ext/v8/upstream/2.0.6/tools/profile_view.js +0 -224
  437. data/ext/v8/upstream/2.0.6/tools/run-valgrind.py +0 -77
  438. data/ext/v8/upstream/2.0.6/tools/splaytree.js +0 -322
  439. data/ext/v8/upstream/2.0.6/tools/splaytree.py +0 -226
  440. data/ext/v8/upstream/2.0.6/tools/stats-viewer.py +0 -456
  441. data/ext/v8/upstream/2.0.6/tools/test.py +0 -1370
  442. data/ext/v8/upstream/2.0.6/tools/tickprocessor-driver.js +0 -53
  443. data/ext/v8/upstream/2.0.6/tools/tickprocessor.js +0 -731
  444. data/ext/v8/upstream/2.0.6/tools/tickprocessor.py +0 -535
  445. data/ext/v8/upstream/2.0.6/tools/utils.py +0 -82
  446. data/ext/v8/upstream/2.0.6/tools/visual_studio/README.txt +0 -71
  447. data/ext/v8/upstream/2.0.6/tools/visual_studio/arm.vsprops +0 -14
  448. data/ext/v8/upstream/2.0.6/tools/visual_studio/common.vsprops +0 -35
  449. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8.vcproj +0 -199
  450. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_arm.vcproj +0 -199
  451. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_x64.vcproj +0 -201
  452. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8js2c.cmd +0 -6
  453. data/ext/v8/upstream/2.0.6/tools/visual_studio/debug.vsprops +0 -17
  454. data/ext/v8/upstream/2.0.6/tools/visual_studio/ia32.vsprops +0 -13
  455. data/ext/v8/upstream/2.0.6/tools/visual_studio/js2c.cmd +0 -6
  456. data/ext/v8/upstream/2.0.6/tools/visual_studio/release.vsprops +0 -24
  457. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.sln +0 -101
  458. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.vcproj +0 -223
  459. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.sln +0 -74
  460. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.vcproj +0 -223
  461. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base.vcproj +0 -971
  462. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_arm.vcproj +0 -983
  463. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_x64.vcproj +0 -959
  464. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest.vcproj +0 -255
  465. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_arm.vcproj +0 -243
  466. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_x64.vcproj +0 -257
  467. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot.vcproj +0 -151
  468. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -151
  469. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample.vcproj +0 -151
  470. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_arm.vcproj +0 -151
  471. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_x64.vcproj +0 -151
  472. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample.vcproj +0 -151
  473. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -151
  474. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -153
  475. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot.vcproj +0 -142
  476. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc.vcproj +0 -92
  477. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -92
  478. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_x64.vcproj +0 -142
  479. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.sln +0 -101
  480. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.vcproj +0 -223
  481. data/ext/v8/upstream/2.0.6/tools/visual_studio/x64.vsprops +0 -13
  482. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.bat +0 -5
  483. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.py +0 -137
  484. data/ext/v8/upstream/Makefile +0 -32
  485. data/ext/v8/upstream/fpic-on-linux-amd64.patch +0 -13
  486. data/ext/v8/upstream/no-strict-aliasing.patch +0 -13
  487. data/ext/v8/upstream/scons/CHANGES.txt +0 -5183
  488. data/ext/v8/upstream/scons/LICENSE.txt +0 -20
  489. data/ext/v8/upstream/scons/MANIFEST +0 -202
  490. data/ext/v8/upstream/scons/PKG-INFO +0 -13
  491. data/ext/v8/upstream/scons/README.txt +0 -273
  492. data/ext/v8/upstream/scons/RELEASE.txt +0 -1040
  493. data/ext/v8/upstream/scons/engine/SCons/Action.py +0 -1256
  494. data/ext/v8/upstream/scons/engine/SCons/Builder.py +0 -868
  495. data/ext/v8/upstream/scons/engine/SCons/CacheDir.py +0 -217
  496. data/ext/v8/upstream/scons/engine/SCons/Conftest.py +0 -794
  497. data/ext/v8/upstream/scons/engine/SCons/Debug.py +0 -237
  498. data/ext/v8/upstream/scons/engine/SCons/Defaults.py +0 -485
  499. data/ext/v8/upstream/scons/engine/SCons/Environment.py +0 -2327
  500. data/ext/v8/upstream/scons/engine/SCons/Errors.py +0 -207
  501. data/ext/v8/upstream/scons/engine/SCons/Executor.py +0 -636
  502. data/ext/v8/upstream/scons/engine/SCons/Job.py +0 -435
  503. data/ext/v8/upstream/scons/engine/SCons/Memoize.py +0 -292
  504. data/ext/v8/upstream/scons/engine/SCons/Node/Alias.py +0 -153
  505. data/ext/v8/upstream/scons/engine/SCons/Node/FS.py +0 -3220
  506. data/ext/v8/upstream/scons/engine/SCons/Node/Python.py +0 -128
  507. data/ext/v8/upstream/scons/engine/SCons/Node/__init__.py +0 -1341
  508. data/ext/v8/upstream/scons/engine/SCons/Options/BoolOption.py +0 -50
  509. data/ext/v8/upstream/scons/engine/SCons/Options/EnumOption.py +0 -50
  510. data/ext/v8/upstream/scons/engine/SCons/Options/ListOption.py +0 -50
  511. data/ext/v8/upstream/scons/engine/SCons/Options/PackageOption.py +0 -50
  512. data/ext/v8/upstream/scons/engine/SCons/Options/PathOption.py +0 -76
  513. data/ext/v8/upstream/scons/engine/SCons/Options/__init__.py +0 -74
  514. data/ext/v8/upstream/scons/engine/SCons/PathList.py +0 -232
  515. data/ext/v8/upstream/scons/engine/SCons/Platform/__init__.py +0 -236
  516. data/ext/v8/upstream/scons/engine/SCons/Platform/aix.py +0 -70
  517. data/ext/v8/upstream/scons/engine/SCons/Platform/cygwin.py +0 -55
  518. data/ext/v8/upstream/scons/engine/SCons/Platform/darwin.py +0 -46
  519. data/ext/v8/upstream/scons/engine/SCons/Platform/hpux.py +0 -46
  520. data/ext/v8/upstream/scons/engine/SCons/Platform/irix.py +0 -44
  521. data/ext/v8/upstream/scons/engine/SCons/Platform/os2.py +0 -58
  522. data/ext/v8/upstream/scons/engine/SCons/Platform/posix.py +0 -264
  523. data/ext/v8/upstream/scons/engine/SCons/Platform/sunos.py +0 -50
  524. data/ext/v8/upstream/scons/engine/SCons/Platform/win32.py +0 -386
  525. data/ext/v8/upstream/scons/engine/SCons/SConf.py +0 -1038
  526. data/ext/v8/upstream/scons/engine/SCons/SConsign.py +0 -381
  527. data/ext/v8/upstream/scons/engine/SCons/Scanner/C.py +0 -132
  528. data/ext/v8/upstream/scons/engine/SCons/Scanner/D.py +0 -74
  529. data/ext/v8/upstream/scons/engine/SCons/Scanner/Dir.py +0 -111
  530. data/ext/v8/upstream/scons/engine/SCons/Scanner/Fortran.py +0 -320
  531. data/ext/v8/upstream/scons/engine/SCons/Scanner/IDL.py +0 -48
  532. data/ext/v8/upstream/scons/engine/SCons/Scanner/LaTeX.py +0 -378
  533. data/ext/v8/upstream/scons/engine/SCons/Scanner/Prog.py +0 -103
  534. data/ext/v8/upstream/scons/engine/SCons/Scanner/RC.py +0 -55
  535. data/ext/v8/upstream/scons/engine/SCons/Scanner/__init__.py +0 -415
  536. data/ext/v8/upstream/scons/engine/SCons/Script/Interactive.py +0 -386
  537. data/ext/v8/upstream/scons/engine/SCons/Script/Main.py +0 -1360
  538. data/ext/v8/upstream/scons/engine/SCons/Script/SConsOptions.py +0 -944
  539. data/ext/v8/upstream/scons/engine/SCons/Script/SConscript.py +0 -642
  540. data/ext/v8/upstream/scons/engine/SCons/Script/__init__.py +0 -414
  541. data/ext/v8/upstream/scons/engine/SCons/Sig.py +0 -63
  542. data/ext/v8/upstream/scons/engine/SCons/Subst.py +0 -911
  543. data/ext/v8/upstream/scons/engine/SCons/Taskmaster.py +0 -1030
  544. data/ext/v8/upstream/scons/engine/SCons/Tool/386asm.py +0 -61
  545. data/ext/v8/upstream/scons/engine/SCons/Tool/BitKeeper.py +0 -65
  546. data/ext/v8/upstream/scons/engine/SCons/Tool/CVS.py +0 -73
  547. data/ext/v8/upstream/scons/engine/SCons/Tool/FortranCommon.py +0 -247
  548. data/ext/v8/upstream/scons/engine/SCons/Tool/JavaCommon.py +0 -324
  549. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/__init__.py +0 -56
  550. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/arch.py +0 -61
  551. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/common.py +0 -210
  552. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/netframework.py +0 -84
  553. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/sdk.py +0 -321
  554. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vc.py +0 -367
  555. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vs.py +0 -497
  556. data/ext/v8/upstream/scons/engine/SCons/Tool/Perforce.py +0 -104
  557. data/ext/v8/upstream/scons/engine/SCons/Tool/PharLapCommon.py +0 -138
  558. data/ext/v8/upstream/scons/engine/SCons/Tool/RCS.py +0 -64
  559. data/ext/v8/upstream/scons/engine/SCons/Tool/SCCS.py +0 -64
  560. data/ext/v8/upstream/scons/engine/SCons/Tool/Subversion.py +0 -71
  561. data/ext/v8/upstream/scons/engine/SCons/Tool/__init__.py +0 -675
  562. data/ext/v8/upstream/scons/engine/SCons/Tool/aixc++.py +0 -82
  563. data/ext/v8/upstream/scons/engine/SCons/Tool/aixcc.py +0 -74
  564. data/ext/v8/upstream/scons/engine/SCons/Tool/aixf77.py +0 -80
  565. data/ext/v8/upstream/scons/engine/SCons/Tool/aixlink.py +0 -76
  566. data/ext/v8/upstream/scons/engine/SCons/Tool/applelink.py +0 -71
  567. data/ext/v8/upstream/scons/engine/SCons/Tool/ar.py +0 -63
  568. data/ext/v8/upstream/scons/engine/SCons/Tool/as.py +0 -78
  569. data/ext/v8/upstream/scons/engine/SCons/Tool/bcc32.py +0 -82
  570. data/ext/v8/upstream/scons/engine/SCons/Tool/c++.py +0 -99
  571. data/ext/v8/upstream/scons/engine/SCons/Tool/cc.py +0 -114
  572. data/ext/v8/upstream/scons/engine/SCons/Tool/cvf.py +0 -58
  573. data/ext/v8/upstream/scons/engine/SCons/Tool/default.py +0 -50
  574. data/ext/v8/upstream/scons/engine/SCons/Tool/dmd.py +0 -224
  575. data/ext/v8/upstream/scons/engine/SCons/Tool/dvi.py +0 -64
  576. data/ext/v8/upstream/scons/engine/SCons/Tool/dvipdf.py +0 -125
  577. data/ext/v8/upstream/scons/engine/SCons/Tool/dvips.py +0 -94
  578. data/ext/v8/upstream/scons/engine/SCons/Tool/f77.py +0 -62
  579. data/ext/v8/upstream/scons/engine/SCons/Tool/f90.py +0 -62
  580. data/ext/v8/upstream/scons/engine/SCons/Tool/f95.py +0 -63
  581. data/ext/v8/upstream/scons/engine/SCons/Tool/filesystem.py +0 -98
  582. data/ext/v8/upstream/scons/engine/SCons/Tool/fortran.py +0 -63
  583. data/ext/v8/upstream/scons/engine/SCons/Tool/g++.py +0 -90
  584. data/ext/v8/upstream/scons/engine/SCons/Tool/g77.py +0 -73
  585. data/ext/v8/upstream/scons/engine/SCons/Tool/gas.py +0 -53
  586. data/ext/v8/upstream/scons/engine/SCons/Tool/gcc.py +0 -80
  587. data/ext/v8/upstream/scons/engine/SCons/Tool/gfortran.py +0 -64
  588. data/ext/v8/upstream/scons/engine/SCons/Tool/gnulink.py +0 -63
  589. data/ext/v8/upstream/scons/engine/SCons/Tool/gs.py +0 -81
  590. data/ext/v8/upstream/scons/engine/SCons/Tool/hpc++.py +0 -85
  591. data/ext/v8/upstream/scons/engine/SCons/Tool/hpcc.py +0 -53
  592. data/ext/v8/upstream/scons/engine/SCons/Tool/hplink.py +0 -77
  593. data/ext/v8/upstream/scons/engine/SCons/Tool/icc.py +0 -59
  594. data/ext/v8/upstream/scons/engine/SCons/Tool/icl.py +0 -52
  595. data/ext/v8/upstream/scons/engine/SCons/Tool/ifl.py +0 -72
  596. data/ext/v8/upstream/scons/engine/SCons/Tool/ifort.py +0 -90
  597. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink.py +0 -59
  598. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink32.py +0 -60
  599. data/ext/v8/upstream/scons/engine/SCons/Tool/install.py +0 -229
  600. data/ext/v8/upstream/scons/engine/SCons/Tool/intelc.py +0 -490
  601. data/ext/v8/upstream/scons/engine/SCons/Tool/ipkg.py +0 -71
  602. data/ext/v8/upstream/scons/engine/SCons/Tool/jar.py +0 -110
  603. data/ext/v8/upstream/scons/engine/SCons/Tool/javac.py +0 -234
  604. data/ext/v8/upstream/scons/engine/SCons/Tool/javah.py +0 -138
  605. data/ext/v8/upstream/scons/engine/SCons/Tool/latex.py +0 -79
  606. data/ext/v8/upstream/scons/engine/SCons/Tool/lex.py +0 -99
  607. data/ext/v8/upstream/scons/engine/SCons/Tool/link.py +0 -121
  608. data/ext/v8/upstream/scons/engine/SCons/Tool/linkloc.py +0 -112
  609. data/ext/v8/upstream/scons/engine/SCons/Tool/m4.py +0 -63
  610. data/ext/v8/upstream/scons/engine/SCons/Tool/masm.py +0 -77
  611. data/ext/v8/upstream/scons/engine/SCons/Tool/midl.py +0 -90
  612. data/ext/v8/upstream/scons/engine/SCons/Tool/mingw.py +0 -159
  613. data/ext/v8/upstream/scons/engine/SCons/Tool/mslib.py +0 -64
  614. data/ext/v8/upstream/scons/engine/SCons/Tool/mslink.py +0 -266
  615. data/ext/v8/upstream/scons/engine/SCons/Tool/mssdk.py +0 -50
  616. data/ext/v8/upstream/scons/engine/SCons/Tool/msvc.py +0 -269
  617. data/ext/v8/upstream/scons/engine/SCons/Tool/msvs.py +0 -1439
  618. data/ext/v8/upstream/scons/engine/SCons/Tool/mwcc.py +0 -208
  619. data/ext/v8/upstream/scons/engine/SCons/Tool/mwld.py +0 -107
  620. data/ext/v8/upstream/scons/engine/SCons/Tool/nasm.py +0 -72
  621. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/__init__.py +0 -314
  622. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/ipk.py +0 -185
  623. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/msi.py +0 -526
  624. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/rpm.py +0 -367
  625. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_tarbz2.py +0 -43
  626. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_targz.py +0 -43
  627. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_zip.py +0 -43
  628. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/tarbz2.py +0 -44
  629. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/targz.py +0 -44
  630. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/zip.py +0 -44
  631. data/ext/v8/upstream/scons/engine/SCons/Tool/pdf.py +0 -78
  632. data/ext/v8/upstream/scons/engine/SCons/Tool/pdflatex.py +0 -83
  633. data/ext/v8/upstream/scons/engine/SCons/Tool/pdftex.py +0 -108
  634. data/ext/v8/upstream/scons/engine/SCons/Tool/qt.py +0 -336
  635. data/ext/v8/upstream/scons/engine/SCons/Tool/rmic.py +0 -121
  636. data/ext/v8/upstream/scons/engine/SCons/Tool/rpcgen.py +0 -70
  637. data/ext/v8/upstream/scons/engine/SCons/Tool/rpm.py +0 -132
  638. data/ext/v8/upstream/scons/engine/SCons/Tool/sgiar.py +0 -68
  639. data/ext/v8/upstream/scons/engine/SCons/Tool/sgic++.py +0 -58
  640. data/ext/v8/upstream/scons/engine/SCons/Tool/sgicc.py +0 -53
  641. data/ext/v8/upstream/scons/engine/SCons/Tool/sgilink.py +0 -63
  642. data/ext/v8/upstream/scons/engine/SCons/Tool/sunar.py +0 -67
  643. data/ext/v8/upstream/scons/engine/SCons/Tool/sunc++.py +0 -142
  644. data/ext/v8/upstream/scons/engine/SCons/Tool/suncc.py +0 -58
  645. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf77.py +0 -63
  646. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf90.py +0 -64
  647. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf95.py +0 -64
  648. data/ext/v8/upstream/scons/engine/SCons/Tool/sunlink.py +0 -77
  649. data/ext/v8/upstream/scons/engine/SCons/Tool/swig.py +0 -186
  650. data/ext/v8/upstream/scons/engine/SCons/Tool/tar.py +0 -73
  651. data/ext/v8/upstream/scons/engine/SCons/Tool/tex.py +0 -805
  652. data/ext/v8/upstream/scons/engine/SCons/Tool/textfile.py +0 -175
  653. data/ext/v8/upstream/scons/engine/SCons/Tool/tlib.py +0 -53
  654. data/ext/v8/upstream/scons/engine/SCons/Tool/wix.py +0 -100
  655. data/ext/v8/upstream/scons/engine/SCons/Tool/yacc.py +0 -131
  656. data/ext/v8/upstream/scons/engine/SCons/Tool/zip.py +0 -100
  657. data/ext/v8/upstream/scons/engine/SCons/Util.py +0 -1645
  658. data/ext/v8/upstream/scons/engine/SCons/Variables/BoolVariable.py +0 -91
  659. data/ext/v8/upstream/scons/engine/SCons/Variables/EnumVariable.py +0 -107
  660. data/ext/v8/upstream/scons/engine/SCons/Variables/ListVariable.py +0 -139
  661. data/ext/v8/upstream/scons/engine/SCons/Variables/PackageVariable.py +0 -109
  662. data/ext/v8/upstream/scons/engine/SCons/Variables/PathVariable.py +0 -147
  663. data/ext/v8/upstream/scons/engine/SCons/Variables/__init__.py +0 -317
  664. data/ext/v8/upstream/scons/engine/SCons/Warnings.py +0 -228
  665. data/ext/v8/upstream/scons/engine/SCons/__init__.py +0 -49
  666. data/ext/v8/upstream/scons/engine/SCons/compat/__init__.py +0 -302
  667. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_UserString.py +0 -98
  668. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_hashlib.py +0 -91
  669. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_itertools.py +0 -124
  670. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_optparse.py +0 -1725
  671. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets.py +0 -583
  672. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets15.py +0 -176
  673. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_shlex.py +0 -325
  674. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_subprocess.py +0 -1296
  675. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_textwrap.py +0 -382
  676. data/ext/v8/upstream/scons/engine/SCons/compat/builtins.py +0 -187
  677. data/ext/v8/upstream/scons/engine/SCons/cpp.py +0 -598
  678. data/ext/v8/upstream/scons/engine/SCons/dblite.py +0 -248
  679. data/ext/v8/upstream/scons/engine/SCons/exitfuncs.py +0 -77
  680. data/ext/v8/upstream/scons/os_spawnv_fix.diff +0 -83
  681. data/ext/v8/upstream/scons/scons-time.1 +0 -1017
  682. data/ext/v8/upstream/scons/scons.1 +0 -15179
  683. data/ext/v8/upstream/scons/sconsign.1 +0 -208
  684. data/ext/v8/upstream/scons/script/scons +0 -184
  685. data/ext/v8/upstream/scons/script/scons-time +0 -1529
  686. data/ext/v8/upstream/scons/script/scons.bat +0 -31
  687. data/ext/v8/upstream/scons/script/sconsign +0 -508
  688. data/ext/v8/upstream/scons/setup.cfg +0 -6
  689. data/ext/v8/upstream/scons/setup.py +0 -427
  690. data/ext/v8/v8.cpp +0 -89
  691. data/ext/v8/v8_cxt.cpp +0 -92
  692. data/ext/v8/v8_cxt.h +0 -20
  693. data/ext/v8/v8_func.cpp +0 -10
  694. data/ext/v8/v8_func.h +0 -11
  695. data/ext/v8/v8_msg.cpp +0 -54
  696. data/ext/v8/v8_msg.h +0 -18
  697. data/ext/v8/v8_obj.cpp +0 -52
  698. data/ext/v8/v8_obj.h +0 -13
  699. data/ext/v8/v8_ref.cpp +0 -26
  700. data/ext/v8/v8_ref.h +0 -31
  701. data/ext/v8/v8_script.cpp +0 -20
  702. data/ext/v8/v8_script.h +0 -8
  703. data/ext/v8/v8_standalone.cpp +0 -69
  704. data/ext/v8/v8_standalone.h +0 -31
  705. data/ext/v8/v8_str.cpp +0 -17
  706. data/ext/v8/v8_str.h +0 -9
  707. data/ext/v8/v8_template.cpp +0 -53
  708. data/ext/v8/v8_template.h +0 -13
  709. data/lib/v8/to.rb +0 -33
  710. data/lib/v8/v8.so +0 -0
  711. data/script/console +0 -10
  712. data/script/destroy +0 -14
  713. data/script/generate +0 -14
  714. data/spec/ext/cxt_spec.rb +0 -25
  715. data/spec/ext/obj_spec.rb +0 -13
  716. data/spec/redjs/jsapi_spec.rb +0 -405
  717. data/spec/redjs/tap.rb +0 -8
  718. data/spec/redjs_helper.rb +0 -3
  719. data/spec/spec.opts +0 -1
  720. data/spec/v8/to_spec.rb +0 -15
  721. data/tasks/rspec.rake +0 -21
@@ -1,1820 +0,0 @@
1
- // Copyright 2009 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #include "v8.h"
29
-
30
- #include "codegen-inl.h"
31
- #include "compiler.h"
32
- #include "debug.h"
33
- #include "fast-codegen.h"
34
- #include "parser.h"
35
-
36
- namespace v8 {
37
- namespace internal {
38
-
39
- #define __ ACCESS_MASM(masm_)
40
-
41
- // Generate code for a JS function. On entry to the function the receiver
42
- // and arguments have been pushed on the stack left to right, with the
43
- // return address on top of them. The actual argument count matches the
44
- // formal parameter count expected by the function.
45
- //
46
- // The live registers are:
47
- // o rdi: the JS function object being called (ie, ourselves)
48
- // o rsi: our context
49
- // o rbp: our caller's frame pointer
50
- // o rsp: stack pointer (pointing to return address)
51
- //
52
- // The function builds a JS frame. Please see JavaScriptFrameConstants in
53
- // frames-x64.h for its layout.
54
- void FastCodeGenerator::Generate(FunctionLiteral* fun) {
55
- function_ = fun;
56
- SetFunctionPosition(fun);
57
-
58
- __ push(rbp); // Caller's frame pointer.
59
- __ movq(rbp, rsp);
60
- __ push(rsi); // Callee's context.
61
- __ push(rdi); // Callee's JS Function.
62
-
63
- { Comment cmnt(masm_, "[ Allocate locals");
64
- int locals_count = fun->scope()->num_stack_slots();
65
- if (locals_count == 1) {
66
- __ PushRoot(Heap::kUndefinedValueRootIndex);
67
- } else if (locals_count > 1) {
68
- __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
69
- for (int i = 0; i < locals_count; i++) {
70
- __ push(rdx);
71
- }
72
- }
73
- }
74
-
75
- bool function_in_register = true;
76
-
77
- // Possibly allocate a local context.
78
- if (fun->scope()->num_heap_slots() > 0) {
79
- Comment cmnt(masm_, "[ Allocate local context");
80
- // Argument to NewContext is the function, which is still in rdi.
81
- __ push(rdi);
82
- __ CallRuntime(Runtime::kNewContext, 1);
83
- function_in_register = false;
84
- // Context is returned in both rax and rsi. It replaces the context
85
- // passed to us. It's saved in the stack and kept live in rsi.
86
- __ movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi);
87
-
88
- // Copy any necessary parameters into the context.
89
- int num_parameters = fun->scope()->num_parameters();
90
- for (int i = 0; i < num_parameters; i++) {
91
- Slot* slot = fun->scope()->parameter(i)->slot();
92
- if (slot != NULL && slot->type() == Slot::CONTEXT) {
93
- int parameter_offset = StandardFrameConstants::kCallerSPOffset +
94
- (num_parameters - 1 - i) * kPointerSize;
95
- // Load parameter from stack.
96
- __ movq(rax, Operand(rbp, parameter_offset));
97
- // Store it in the context
98
- __ movq(Operand(rsi, Context::SlotOffset(slot->index())), rax);
99
- }
100
- }
101
- }
102
-
103
- // Possibly allocate an arguments object.
104
- Variable* arguments = fun->scope()->arguments()->AsVariable();
105
- if (arguments != NULL) {
106
- // Arguments object must be allocated after the context object, in
107
- // case the "arguments" or ".arguments" variables are in the context.
108
- Comment cmnt(masm_, "[ Allocate arguments object");
109
- if (function_in_register) {
110
- __ push(rdi);
111
- } else {
112
- __ push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
113
- }
114
- // The receiver is just before the parameters on the caller's stack.
115
- __ lea(rdx, Operand(rbp, StandardFrameConstants::kCallerSPOffset +
116
- fun->num_parameters() * kPointerSize));
117
- __ push(rdx);
118
- __ Push(Smi::FromInt(fun->num_parameters()));
119
- // Arguments to ArgumentsAccessStub:
120
- // function, receiver address, parameter count.
121
- // The stub will rewrite receiver and parameter count if the previous
122
- // stack frame was an arguments adapter frame.
123
- ArgumentsAccessStub stub(ArgumentsAccessStub::NEW_OBJECT);
124
- __ CallStub(&stub);
125
- // Store new arguments object in both "arguments" and ".arguments" slots.
126
- __ movq(rcx, rax);
127
- Move(arguments->slot(), rax, rbx, rdx);
128
- Slot* dot_arguments_slot =
129
- fun->scope()->arguments_shadow()->AsVariable()->slot();
130
- Move(dot_arguments_slot, rcx, rbx, rdx);
131
- }
132
-
133
- { Comment cmnt(masm_, "[ Declarations");
134
- VisitDeclarations(fun->scope()->declarations());
135
- }
136
-
137
- { Comment cmnt(masm_, "[ Stack check");
138
- Label ok;
139
- __ CompareRoot(rsp, Heap::kStackLimitRootIndex);
140
- __ j(above_equal, &ok);
141
- StackCheckStub stub;
142
- __ CallStub(&stub);
143
- __ bind(&ok);
144
- }
145
-
146
- if (FLAG_trace) {
147
- __ CallRuntime(Runtime::kTraceEnter, 0);
148
- }
149
-
150
- { Comment cmnt(masm_, "[ Body");
151
- ASSERT(loop_depth() == 0);
152
- VisitStatements(fun->body());
153
- ASSERT(loop_depth() == 0);
154
- }
155
-
156
- { Comment cmnt(masm_, "[ return <undefined>;");
157
- // Emit a 'return undefined' in case control fell off the end of the body.
158
- __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
159
- EmitReturnSequence(function_->end_position());
160
- }
161
- }
162
-
163
-
164
- void FastCodeGenerator::EmitReturnSequence(int position) {
165
- Comment cmnt(masm_, "[ Return sequence");
166
- if (return_label_.is_bound()) {
167
- __ jmp(&return_label_);
168
- } else {
169
- __ bind(&return_label_);
170
- if (FLAG_trace) {
171
- __ push(rax);
172
- __ CallRuntime(Runtime::kTraceExit, 1);
173
- }
174
- #ifdef DEBUG
175
- // Add a label for checking the size of the code used for returning.
176
- Label check_exit_codesize;
177
- masm_->bind(&check_exit_codesize);
178
- #endif
179
- CodeGenerator::RecordPositions(masm_, position);
180
- __ RecordJSReturn();
181
- // Do not use the leave instruction here because it is too short to
182
- // patch with the code required by the debugger.
183
- __ movq(rsp, rbp);
184
- __ pop(rbp);
185
- __ ret((function_->scope()->num_parameters() + 1) * kPointerSize);
186
- #ifdef ENABLE_DEBUGGER_SUPPORT
187
- // Add padding that will be overwritten by a debugger breakpoint. We
188
- // have just generated "movq rsp, rbp; pop rbp; ret k" with length 7
189
- // (3 + 1 + 3).
190
- const int kPadding = Assembler::kJSReturnSequenceLength - 7;
191
- for (int i = 0; i < kPadding; ++i) {
192
- masm_->int3();
193
- }
194
- // Check that the size of the code used for returning matches what is
195
- // expected by the debugger.
196
- ASSERT_EQ(Assembler::kJSReturnSequenceLength,
197
- masm_->SizeOfCodeGeneratedSince(&check_exit_codesize));
198
- #endif
199
- }
200
- }
201
-
202
-
203
- void FastCodeGenerator::Apply(Expression::Context context, Register reg) {
204
- switch (context) {
205
- case Expression::kUninitialized:
206
- UNREACHABLE();
207
-
208
- case Expression::kEffect:
209
- // Nothing to do.
210
- break;
211
-
212
- case Expression::kValue:
213
- // Move value into place.
214
- switch (location_) {
215
- case kAccumulator:
216
- if (!reg.is(result_register())) __ movq(result_register(), reg);
217
- break;
218
- case kStack:
219
- __ push(reg);
220
- break;
221
- }
222
- break;
223
-
224
- case Expression::kTest:
225
- // For simplicity we always test the accumulator register.
226
- if (!reg.is(result_register())) __ movq(result_register(), reg);
227
- DoTest(context);
228
- break;
229
-
230
- case Expression::kValueTest:
231
- case Expression::kTestValue:
232
- if (!reg.is(result_register())) __ movq(result_register(), reg);
233
- switch (location_) {
234
- case kAccumulator:
235
- break;
236
- case kStack:
237
- __ push(result_register());
238
- break;
239
- }
240
- DoTest(context);
241
- break;
242
- }
243
- }
244
-
245
-
246
- void FastCodeGenerator::Apply(Expression::Context context, Slot* slot) {
247
- switch (context) {
248
- case Expression::kUninitialized:
249
- UNREACHABLE();
250
- case Expression::kEffect:
251
- // Nothing to do.
252
- break;
253
- case Expression::kValue: {
254
- MemOperand slot_operand = EmitSlotSearch(slot, result_register());
255
- switch (location_) {
256
- case kAccumulator:
257
- __ movq(result_register(), slot_operand);
258
- break;
259
- case kStack:
260
- // Memory operands can be pushed directly.
261
- __ push(slot_operand);
262
- break;
263
- }
264
- break;
265
- }
266
-
267
- case Expression::kTest:
268
- Move(result_register(), slot);
269
- DoTest(context);
270
- break;
271
-
272
- case Expression::kValueTest:
273
- case Expression::kTestValue:
274
- Move(result_register(), slot);
275
- switch (location_) {
276
- case kAccumulator:
277
- break;
278
- case kStack:
279
- __ push(result_register());
280
- break;
281
- }
282
- DoTest(context);
283
- break;
284
- }
285
- }
286
-
287
-
288
- void FastCodeGenerator::Apply(Expression::Context context, Literal* lit) {
289
- switch (context) {
290
- case Expression::kUninitialized:
291
- UNREACHABLE();
292
- case Expression::kEffect:
293
- // Nothing to do.
294
- break;
295
- case Expression::kValue:
296
- switch (location_) {
297
- case kAccumulator:
298
- __ Move(result_register(), lit->handle());
299
- break;
300
- case kStack:
301
- __ Push(lit->handle());
302
- break;
303
- }
304
- break;
305
-
306
- case Expression::kTest:
307
- __ Move(result_register(), lit->handle());
308
- DoTest(context);
309
- break;
310
-
311
- case Expression::kValueTest:
312
- case Expression::kTestValue:
313
- __ Move(result_register(), lit->handle());
314
- switch (location_) {
315
- case kAccumulator:
316
- break;
317
- case kStack:
318
- __ push(result_register());
319
- break;
320
- }
321
- DoTest(context);
322
- break;
323
- }
324
- }
325
-
326
-
327
- void FastCodeGenerator::ApplyTOS(Expression::Context context) {
328
- switch (context) {
329
- case Expression::kUninitialized:
330
- UNREACHABLE();
331
-
332
- case Expression::kEffect:
333
- __ Drop(1);
334
- break;
335
-
336
- case Expression::kValue:
337
- switch (location_) {
338
- case kAccumulator:
339
- __ pop(result_register());
340
- break;
341
- case kStack:
342
- break;
343
- }
344
- break;
345
-
346
- case Expression::kTest:
347
- __ pop(result_register());
348
- DoTest(context);
349
- break;
350
-
351
- case Expression::kValueTest:
352
- case Expression::kTestValue:
353
- switch (location_) {
354
- case kAccumulator:
355
- __ pop(result_register());
356
- break;
357
- case kStack:
358
- __ movq(result_register(), Operand(rsp, 0));
359
- break;
360
- }
361
- DoTest(context);
362
- break;
363
- }
364
- }
365
-
366
-
367
- void FastCodeGenerator::DropAndApply(int count,
368
- Expression::Context context,
369
- Register reg) {
370
- ASSERT(count > 0);
371
- ASSERT(!reg.is(rsp));
372
- switch (context) {
373
- case Expression::kUninitialized:
374
- UNREACHABLE();
375
-
376
- case Expression::kEffect:
377
- __ Drop(count);
378
- break;
379
-
380
- case Expression::kValue:
381
- switch (location_) {
382
- case kAccumulator:
383
- __ Drop(count);
384
- if (!reg.is(result_register())) __ movq(result_register(), reg);
385
- break;
386
- case kStack:
387
- if (count > 1) __ Drop(count - 1);
388
- __ movq(Operand(rsp, 0), reg);
389
- break;
390
- }
391
- break;
392
-
393
- case Expression::kTest:
394
- __ Drop(count);
395
- if (!reg.is(result_register())) __ movq(result_register(), reg);
396
- DoTest(context);
397
- break;
398
-
399
- case Expression::kValueTest:
400
- case Expression::kTestValue:
401
- switch (location_) {
402
- case kAccumulator:
403
- __ Drop(count);
404
- if (!reg.is(result_register())) __ movq(result_register(), reg);
405
- break;
406
- case kStack:
407
- if (count > 1) __ Drop(count - 1);
408
- __ movq(result_register(), reg);
409
- __ movq(Operand(rsp, 0), result_register());
410
- break;
411
- }
412
- DoTest(context);
413
- break;
414
- }
415
- }
416
-
417
-
418
- void FastCodeGenerator::Apply(Expression::Context context,
419
- Label* materialize_true,
420
- Label* materialize_false) {
421
- switch (context) {
422
- case Expression::kUninitialized:
423
-
424
- case Expression::kEffect:
425
- ASSERT_EQ(materialize_true, materialize_false);
426
- __ bind(materialize_true);
427
- break;
428
-
429
- case Expression::kValue: {
430
- Label done;
431
- switch (location_) {
432
- case kAccumulator:
433
- __ bind(materialize_true);
434
- __ Move(result_register(), Factory::true_value());
435
- __ jmp(&done);
436
- __ bind(materialize_false);
437
- __ Move(result_register(), Factory::false_value());
438
- break;
439
- case kStack:
440
- __ bind(materialize_true);
441
- __ Push(Factory::true_value());
442
- __ jmp(&done);
443
- __ bind(materialize_false);
444
- __ Push(Factory::false_value());
445
- break;
446
- }
447
- __ bind(&done);
448
- break;
449
- }
450
-
451
- case Expression::kTest:
452
- break;
453
-
454
- case Expression::kValueTest:
455
- __ bind(materialize_true);
456
- switch (location_) {
457
- case kAccumulator:
458
- __ Move(result_register(), Factory::true_value());
459
- break;
460
- case kStack:
461
- __ Push(Factory::true_value());
462
- break;
463
- }
464
- __ jmp(true_label_);
465
- break;
466
-
467
- case Expression::kTestValue:
468
- __ bind(materialize_false);
469
- switch (location_) {
470
- case kAccumulator:
471
- __ Move(result_register(), Factory::false_value());
472
- break;
473
- case kStack:
474
- __ Push(Factory::false_value());
475
- break;
476
- }
477
- __ jmp(false_label_);
478
- break;
479
- }
480
- }
481
-
482
-
483
- void FastCodeGenerator::DoTest(Expression::Context context) {
484
- // The value to test is in the accumulator. If the value might be needed
485
- // on the stack (value/test and test/value contexts with a stack location
486
- // desired), then the value is already duplicated on the stack.
487
- ASSERT_NE(NULL, true_label_);
488
- ASSERT_NE(NULL, false_label_);
489
-
490
- // In value/test and test/value expression contexts with stack as the
491
- // desired location, there is already an extra value on the stack. Use a
492
- // label to discard it if unneeded.
493
- Label discard;
494
- Label* if_true = true_label_;
495
- Label* if_false = false_label_;
496
- switch (context) {
497
- case Expression::kUninitialized:
498
- case Expression::kEffect:
499
- case Expression::kValue:
500
- UNREACHABLE();
501
- case Expression::kTest:
502
- break;
503
- case Expression::kValueTest:
504
- switch (location_) {
505
- case kAccumulator:
506
- break;
507
- case kStack:
508
- if_false = &discard;
509
- break;
510
- }
511
- break;
512
- case Expression::kTestValue:
513
- switch (location_) {
514
- case kAccumulator:
515
- break;
516
- case kStack:
517
- if_true = &discard;
518
- break;
519
- }
520
- break;
521
- }
522
-
523
- // Emit the inlined tests assumed by the stub.
524
- __ CompareRoot(result_register(), Heap::kUndefinedValueRootIndex);
525
- __ j(equal, if_false);
526
- __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
527
- __ j(equal, if_true);
528
- __ CompareRoot(result_register(), Heap::kFalseValueRootIndex);
529
- __ j(equal, if_false);
530
- ASSERT_EQ(0, kSmiTag);
531
- __ SmiCompare(result_register(), Smi::FromInt(0));
532
- __ j(equal, if_false);
533
- Condition is_smi = masm_->CheckSmi(result_register());
534
- __ j(is_smi, if_true);
535
-
536
- // Save a copy of the value if it may be needed and isn't already saved.
537
- switch (context) {
538
- case Expression::kUninitialized:
539
- case Expression::kEffect:
540
- case Expression::kValue:
541
- UNREACHABLE();
542
- case Expression::kTest:
543
- break;
544
- case Expression::kValueTest:
545
- switch (location_) {
546
- case kAccumulator:
547
- __ push(result_register());
548
- break;
549
- case kStack:
550
- break;
551
- }
552
- break;
553
- case Expression::kTestValue:
554
- switch (location_) {
555
- case kAccumulator:
556
- __ push(result_register());
557
- break;
558
- case kStack:
559
- break;
560
- }
561
- break;
562
- }
563
-
564
- // Call the ToBoolean stub for all other cases.
565
- ToBooleanStub stub;
566
- __ push(result_register());
567
- __ CallStub(&stub);
568
- __ testq(rax, rax);
569
-
570
- // The stub returns nonzero for true. Complete based on the context.
571
- switch (context) {
572
- case Expression::kUninitialized:
573
- case Expression::kEffect:
574
- case Expression::kValue:
575
- UNREACHABLE();
576
-
577
- case Expression::kTest:
578
- __ j(not_zero, true_label_);
579
- __ jmp(false_label_);
580
- break;
581
-
582
- case Expression::kValueTest:
583
- switch (location_) {
584
- case kAccumulator:
585
- __ j(zero, &discard);
586
- __ pop(result_register());
587
- __ jmp(true_label_);
588
- break;
589
- case kStack:
590
- __ j(not_zero, true_label_);
591
- break;
592
- }
593
- __ bind(&discard);
594
- __ Drop(1);
595
- __ jmp(false_label_);
596
- break;
597
-
598
- case Expression::kTestValue:
599
- switch (location_) {
600
- case kAccumulator:
601
- __ j(not_zero, &discard);
602
- __ pop(result_register());
603
- __ jmp(false_label_);
604
- break;
605
- case kStack:
606
- __ j(zero, false_label_);
607
- break;
608
- }
609
- __ bind(&discard);
610
- __ Drop(1);
611
- __ jmp(true_label_);
612
- break;
613
- }
614
- }
615
-
616
-
617
- MemOperand FastCodeGenerator::EmitSlotSearch(Slot* slot, Register scratch) {
618
- switch (slot->type()) {
619
- case Slot::PARAMETER:
620
- case Slot::LOCAL:
621
- return Operand(rbp, SlotOffset(slot));
622
- case Slot::CONTEXT: {
623
- int context_chain_length =
624
- function_->scope()->ContextChainLength(slot->var()->scope());
625
- __ LoadContext(scratch, context_chain_length);
626
- return CodeGenerator::ContextOperand(scratch, slot->index());
627
- }
628
- case Slot::LOOKUP:
629
- UNREACHABLE();
630
- }
631
- UNREACHABLE();
632
- return Operand(rax, 0);
633
- }
634
-
635
-
636
- void FastCodeGenerator::Move(Register destination, Slot* source) {
637
- MemOperand location = EmitSlotSearch(source, destination);
638
- __ movq(destination, location);
639
- }
640
-
641
-
642
- void FastCodeGenerator::Move(Slot* dst,
643
- Register src,
644
- Register scratch1,
645
- Register scratch2) {
646
- ASSERT(dst->type() != Slot::LOOKUP); // Not yet implemented.
647
- ASSERT(!scratch1.is(src) && !scratch2.is(src));
648
- MemOperand location = EmitSlotSearch(dst, scratch1);
649
- __ movq(location, src);
650
- // Emit the write barrier code if the location is in the heap.
651
- if (dst->type() == Slot::CONTEXT) {
652
- int offset = FixedArray::kHeaderSize + dst->index() * kPointerSize;
653
- __ RecordWrite(scratch1, offset, src, scratch2);
654
- }
655
- }
656
-
657
-
658
- void FastCodeGenerator::VisitDeclaration(Declaration* decl) {
659
- Comment cmnt(masm_, "[ Declaration");
660
- Variable* var = decl->proxy()->var();
661
- ASSERT(var != NULL); // Must have been resolved.
662
- Slot* slot = var->slot();
663
- Property* prop = var->AsProperty();
664
-
665
- if (slot != NULL) {
666
- switch (slot->type()) {
667
- case Slot::PARAMETER:
668
- case Slot::LOCAL:
669
- if (decl->mode() == Variable::CONST) {
670
- __ LoadRoot(kScratchRegister, Heap::kTheHoleValueRootIndex);
671
- __ movq(Operand(rbp, SlotOffset(slot)), kScratchRegister);
672
- } else if (decl->fun() != NULL) {
673
- VisitForValue(decl->fun(), kAccumulator);
674
- __ movq(Operand(rbp, SlotOffset(slot)), result_register());
675
- }
676
- break;
677
-
678
- case Slot::CONTEXT:
679
- // We bypass the general EmitSlotSearch because we know more about
680
- // this specific context.
681
-
682
- // The variable in the decl always resides in the current context.
683
- ASSERT_EQ(0, function_->scope()->ContextChainLength(var->scope()));
684
- if (FLAG_debug_code) {
685
- // Check if we have the correct context pointer.
686
- __ movq(rbx,
687
- CodeGenerator::ContextOperand(rsi, Context::FCONTEXT_INDEX));
688
- __ cmpq(rbx, rsi);
689
- __ Check(equal, "Unexpected declaration in current context.");
690
- }
691
- if (decl->mode() == Variable::CONST) {
692
- __ LoadRoot(kScratchRegister, Heap::kTheHoleValueRootIndex);
693
- __ movq(CodeGenerator::ContextOperand(rsi, slot->index()),
694
- kScratchRegister);
695
- // No write barrier since the hole value is in old space.
696
- } else if (decl->fun() != NULL) {
697
- VisitForValue(decl->fun(), kAccumulator);
698
- __ movq(CodeGenerator::ContextOperand(rsi, slot->index()),
699
- result_register());
700
- int offset = Context::SlotOffset(slot->index());
701
- __ RecordWrite(rsi, offset, result_register(), rcx);
702
- }
703
- break;
704
-
705
- case Slot::LOOKUP: {
706
- __ push(rsi);
707
- __ Push(var->name());
708
- // Declaration nodes are always introduced in one of two modes.
709
- ASSERT(decl->mode() == Variable::VAR ||
710
- decl->mode() == Variable::CONST);
711
- PropertyAttributes attr =
712
- (decl->mode() == Variable::VAR) ? NONE : READ_ONLY;
713
- __ Push(Smi::FromInt(attr));
714
- // Push initial value, if any.
715
- // Note: For variables we must not push an initial value (such as
716
- // 'undefined') because we may have a (legal) redeclaration and we
717
- // must not destroy the current value.
718
- if (decl->mode() == Variable::CONST) {
719
- __ PushRoot(Heap::kTheHoleValueRootIndex);
720
- } else if (decl->fun() != NULL) {
721
- VisitForValue(decl->fun(), kStack);
722
- } else {
723
- __ Push(Smi::FromInt(0)); // no initial value!
724
- }
725
- __ CallRuntime(Runtime::kDeclareContextSlot, 4);
726
- break;
727
- }
728
- }
729
-
730
- } else if (prop != NULL) {
731
- if (decl->fun() != NULL || decl->mode() == Variable::CONST) {
732
- // We are declaring a function or constant that rewrites to a
733
- // property. Use (keyed) IC to set the initial value.
734
- VisitForValue(prop->obj(), kStack);
735
- VisitForValue(prop->key(), kStack);
736
-
737
- if (decl->fun() != NULL) {
738
- VisitForValue(decl->fun(), kAccumulator);
739
- } else {
740
- __ LoadRoot(result_register(), Heap::kTheHoleValueRootIndex);
741
- }
742
-
743
- Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
744
- __ call(ic, RelocInfo::CODE_TARGET);
745
- // Absence of a test rax instruction following the call
746
- // indicates that none of the load was inlined.
747
- __ nop();
748
-
749
- // Value in rax is ignored (declarations are statements). Receiver
750
- // and key on stack are discarded.
751
- __ Drop(2);
752
- }
753
- }
754
- }
755
-
756
-
757
- void FastCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
758
- // Call the runtime to declare the globals.
759
- __ push(rsi); // The context is the first argument.
760
- __ Push(pairs);
761
- __ Push(Smi::FromInt(is_eval_ ? 1 : 0));
762
- __ CallRuntime(Runtime::kDeclareGlobals, 3);
763
- // Return value is ignored.
764
- }
765
-
766
-
767
- void FastCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
768
- Comment cmnt(masm_, "[ FunctionLiteral");
769
-
770
- // Build the function boilerplate and instantiate it.
771
- Handle<JSFunction> boilerplate =
772
- Compiler::BuildBoilerplate(expr, script_, this);
773
- if (HasStackOverflow()) return;
774
-
775
- ASSERT(boilerplate->IsBoilerplate());
776
-
777
- // Create a new closure.
778
- __ push(rsi);
779
- __ Push(boilerplate);
780
- __ CallRuntime(Runtime::kNewClosure, 2);
781
- Apply(expr->context(), rax);
782
- }
783
-
784
-
785
- void FastCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
786
- Comment cmnt(masm_, "[ VariableProxy");
787
- EmitVariableLoad(expr->var(), expr->context());
788
- }
789
-
790
-
791
- void FastCodeGenerator::EmitVariableLoad(Variable* var,
792
- Expression::Context context) {
793
- Expression* rewrite = var->rewrite();
794
- if (rewrite == NULL) {
795
- ASSERT(var->is_global());
796
- Comment cmnt(masm_, "Global variable");
797
- // Use inline caching. Variable name is passed in rcx and the global
798
- // object on the stack.
799
- __ push(CodeGenerator::GlobalObject());
800
- __ Move(rcx, var->name());
801
- Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
802
- __ Call(ic, RelocInfo::CODE_TARGET_CONTEXT);
803
- // A test rax instruction following the call is used by the IC to
804
- // indicate that the inobject property case was inlined. Ensure there
805
- // is no test rax instruction here.
806
- __ nop();
807
- DropAndApply(1, context, rax);
808
- } else if (rewrite->AsSlot() != NULL) {
809
- Slot* slot = rewrite->AsSlot();
810
- if (FLAG_debug_code) {
811
- switch (slot->type()) {
812
- case Slot::PARAMETER:
813
- case Slot::LOCAL: {
814
- Comment cmnt(masm_, "Stack slot");
815
- break;
816
- }
817
- case Slot::CONTEXT: {
818
- Comment cmnt(masm_, "Context slot");
819
- break;
820
- }
821
- case Slot::LOOKUP:
822
- UNIMPLEMENTED();
823
- break;
824
- }
825
- }
826
- Apply(context, slot);
827
- } else {
828
- Comment cmnt(masm_, "Variable rewritten to property");
829
- // A variable has been rewritten into an explicit access to an object
830
- // property.
831
- Property* property = rewrite->AsProperty();
832
- ASSERT_NOT_NULL(property);
833
-
834
- // The only property expressions that can occur are of the form
835
- // "slot[literal]".
836
-
837
- // Assert that the object is in a slot.
838
- Variable* object_var = property->obj()->AsVariableProxy()->AsVariable();
839
- ASSERT_NOT_NULL(object_var);
840
- Slot* object_slot = object_var->slot();
841
- ASSERT_NOT_NULL(object_slot);
842
-
843
- // Load the object.
844
- MemOperand object_loc = EmitSlotSearch(object_slot, rax);
845
- __ push(object_loc);
846
-
847
- // Assert that the key is a smi.
848
- Literal* key_literal = property->key()->AsLiteral();
849
- ASSERT_NOT_NULL(key_literal);
850
- ASSERT(key_literal->handle()->IsSmi());
851
-
852
- // Load the key.
853
- __ Push(key_literal->handle());
854
-
855
- // Do a keyed property load.
856
- Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
857
- __ call(ic, RelocInfo::CODE_TARGET);
858
- // Notice: We must not have a "test rax, ..." instruction after the
859
- // call. It is treated specially by the LoadIC code.
860
- __ nop();
861
- // Drop key and object left on the stack by IC, and push the result.
862
- DropAndApply(2, context, rax);
863
- }
864
- }
865
-
866
-
867
- void FastCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
868
- Comment cmnt(masm_, "[ RegExpLiteral");
869
- Label done;
870
- // Registers will be used as follows:
871
- // rdi = JS function.
872
- // rbx = literals array.
873
- // rax = regexp literal.
874
- __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
875
- __ movq(rbx, FieldOperand(rdi, JSFunction::kLiteralsOffset));
876
- int literal_offset =
877
- FixedArray::kHeaderSize + expr->literal_index() * kPointerSize;
878
- __ movq(rax, FieldOperand(rbx, literal_offset));
879
- __ CompareRoot(rax, Heap::kUndefinedValueRootIndex);
880
- __ j(not_equal, &done);
881
- // Create regexp literal using runtime function
882
- // Result will be in rax.
883
- __ push(rbx);
884
- __ Push(Smi::FromInt(expr->literal_index()));
885
- __ Push(expr->pattern());
886
- __ Push(expr->flags());
887
- __ CallRuntime(Runtime::kMaterializeRegExpLiteral, 4);
888
- __ bind(&done);
889
- Apply(expr->context(), rax);
890
- }
891
-
892
-
893
- void FastCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
894
- Comment cmnt(masm_, "[ ObjectLiteral");
895
- __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
896
- __ push(FieldOperand(rdi, JSFunction::kLiteralsOffset));
897
- __ Push(Smi::FromInt(expr->literal_index()));
898
- __ Push(expr->constant_properties());
899
- if (expr->depth() > 1) {
900
- __ CallRuntime(Runtime::kCreateObjectLiteral, 3);
901
- } else {
902
- __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 3);
903
- }
904
-
905
- // If result_saved is true the result is on top of the stack. If
906
- // result_saved is false the result is in rax.
907
- bool result_saved = false;
908
-
909
- for (int i = 0; i < expr->properties()->length(); i++) {
910
- ObjectLiteral::Property* property = expr->properties()->at(i);
911
- if (property->IsCompileTimeValue()) continue;
912
-
913
- Literal* key = property->key();
914
- Expression* value = property->value();
915
- if (!result_saved) {
916
- __ push(rax); // Save result on the stack
917
- result_saved = true;
918
- }
919
- switch (property->kind()) {
920
- case ObjectLiteral::Property::CONSTANT:
921
- UNREACHABLE();
922
- case ObjectLiteral::Property::MATERIALIZED_LITERAL:
923
- ASSERT(!CompileTimeValue::IsCompileTimeValue(value));
924
- // Fall through.
925
- case ObjectLiteral::Property::COMPUTED:
926
- if (key->handle()->IsSymbol()) {
927
- VisitForValue(value, kAccumulator);
928
- __ Move(rcx, key->handle());
929
- Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
930
- __ call(ic, RelocInfo::CODE_TARGET);
931
- __ nop();
932
- // StoreIC leaves the receiver on the stack.
933
- break;
934
- }
935
- // Fall through.
936
- case ObjectLiteral::Property::PROTOTYPE:
937
- __ push(Operand(rsp, 0)); // Duplicate receiver.
938
- VisitForValue(key, kStack);
939
- VisitForValue(value, kStack);
940
- __ CallRuntime(Runtime::kSetProperty, 3);
941
- break;
942
- case ObjectLiteral::Property::SETTER:
943
- case ObjectLiteral::Property::GETTER:
944
- __ push(Operand(rsp, 0)); // Duplicate receiver.
945
- VisitForValue(key, kStack);
946
- __ Push(property->kind() == ObjectLiteral::Property::SETTER ?
947
- Smi::FromInt(1) :
948
- Smi::FromInt(0));
949
- VisitForValue(value, kStack);
950
- __ CallRuntime(Runtime::kDefineAccessor, 4);
951
- break;
952
- }
953
- }
954
-
955
- if (result_saved) {
956
- ApplyTOS(expr->context());
957
- } else {
958
- Apply(expr->context(), rax);
959
- }
960
- }
961
-
962
-
963
- void FastCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
964
- Comment cmnt(masm_, "[ ArrayLiteral");
965
- __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
966
- __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset));
967
- __ Push(Smi::FromInt(expr->literal_index()));
968
- __ Push(expr->constant_elements());
969
- if (expr->depth() > 1) {
970
- __ CallRuntime(Runtime::kCreateArrayLiteral, 3);
971
- } else {
972
- __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3);
973
- }
974
-
975
- bool result_saved = false; // Is the result saved to the stack?
976
-
977
- // Emit code to evaluate all the non-constant subexpressions and to store
978
- // them into the newly cloned array.
979
- ZoneList<Expression*>* subexprs = expr->values();
980
- for (int i = 0, len = subexprs->length(); i < len; i++) {
981
- Expression* subexpr = subexprs->at(i);
982
- // If the subexpression is a literal or a simple materialized literal it
983
- // is already set in the cloned array.
984
- if (subexpr->AsLiteral() != NULL ||
985
- CompileTimeValue::IsCompileTimeValue(subexpr)) {
986
- continue;
987
- }
988
-
989
- if (!result_saved) {
990
- __ push(rax);
991
- result_saved = true;
992
- }
993
- VisitForValue(subexpr, kAccumulator);
994
-
995
- // Store the subexpression value in the array's elements.
996
- __ movq(rbx, Operand(rsp, 0)); // Copy of array literal.
997
- __ movq(rbx, FieldOperand(rbx, JSObject::kElementsOffset));
998
- int offset = FixedArray::kHeaderSize + (i * kPointerSize);
999
- __ movq(FieldOperand(rbx, offset), result_register());
1000
-
1001
- // Update the write barrier for the array store.
1002
- __ RecordWrite(rbx, offset, result_register(), rcx);
1003
- }
1004
-
1005
- if (result_saved) {
1006
- ApplyTOS(expr->context());
1007
- } else {
1008
- Apply(expr->context(), rax);
1009
- }
1010
- }
1011
-
1012
-
1013
- void FastCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
1014
- SetSourcePosition(prop->position());
1015
- Literal* key = prop->key()->AsLiteral();
1016
- __ Move(rcx, key->handle());
1017
- Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
1018
- __ Call(ic, RelocInfo::CODE_TARGET);
1019
- __ nop();
1020
- }
1021
-
1022
-
1023
- void FastCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
1024
- SetSourcePosition(prop->position());
1025
- Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
1026
- __ Call(ic, RelocInfo::CODE_TARGET);
1027
- __ nop();
1028
- }
1029
-
1030
-
1031
- void FastCodeGenerator::EmitBinaryOp(Token::Value op,
1032
- Expression::Context context) {
1033
- __ push(result_register());
1034
- GenericBinaryOpStub stub(op,
1035
- NO_OVERWRITE,
1036
- NO_GENERIC_BINARY_FLAGS);
1037
- __ CallStub(&stub);
1038
- Apply(context, rax);
1039
- }
1040
-
1041
-
1042
- void FastCodeGenerator::EmitVariableAssignment(Variable* var,
1043
- Expression::Context context) {
1044
- ASSERT(var != NULL);
1045
- ASSERT(var->is_global() || var->slot() != NULL);
1046
- if (var->is_global()) {
1047
- // Assignment to a global variable. Use inline caching for the
1048
- // assignment. Right-hand-side value is passed in rax, variable name in
1049
- // rcx, and the global object on the stack.
1050
- __ Move(rcx, var->name());
1051
- __ push(CodeGenerator::GlobalObject());
1052
- Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
1053
- __ Call(ic, RelocInfo::CODE_TARGET);
1054
- // Overwrite the global object on the stack with the result if needed.
1055
- DropAndApply(1, context, rax);
1056
-
1057
- } else if (var->slot() != NULL) {
1058
- Slot* slot = var->slot();
1059
- switch (slot->type()) {
1060
- case Slot::LOCAL:
1061
- case Slot::PARAMETER:
1062
- __ movq(Operand(rbp, SlotOffset(slot)), result_register());
1063
- break;
1064
-
1065
- case Slot::CONTEXT: {
1066
- MemOperand target = EmitSlotSearch(slot, rcx);
1067
- __ movq(target, result_register());
1068
-
1069
- // RecordWrite may destroy all its register arguments.
1070
- __ movq(rdx, result_register());
1071
- int offset = FixedArray::kHeaderSize + slot->index() * kPointerSize;
1072
- __ RecordWrite(rcx, offset, rdx, rbx);
1073
- break;
1074
- }
1075
-
1076
- case Slot::LOOKUP:
1077
- UNREACHABLE();
1078
- break;
1079
- }
1080
- Apply(context, result_register());
1081
- } else {
1082
- // Variables rewritten as properties are not treated as variables in
1083
- // assignments.
1084
- UNREACHABLE();
1085
- }
1086
- }
1087
-
1088
-
1089
- void FastCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
1090
- // Assignment to a property, using a named store IC.
1091
- Property* prop = expr->target()->AsProperty();
1092
- ASSERT(prop != NULL);
1093
- ASSERT(prop->key()->AsLiteral() != NULL);
1094
-
1095
- // If the assignment starts a block of assignments to the same object,
1096
- // change to slow case to avoid the quadratic behavior of repeatedly
1097
- // adding fast properties.
1098
- if (expr->starts_initialization_block()) {
1099
- __ push(result_register());
1100
- __ push(Operand(rsp, kPointerSize)); // Receiver is now under value.
1101
- __ CallRuntime(Runtime::kToSlowProperties, 1);
1102
- __ pop(result_register());
1103
- }
1104
-
1105
- // Record source code position before IC call.
1106
- SetSourcePosition(expr->position());
1107
- __ Move(rcx, prop->key()->AsLiteral()->handle());
1108
- Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
1109
- __ Call(ic, RelocInfo::CODE_TARGET);
1110
- __ nop();
1111
-
1112
- // If the assignment ends an initialization block, revert to fast case.
1113
- if (expr->ends_initialization_block()) {
1114
- __ push(rax); // Result of assignment, saved even if not needed.
1115
- __ push(Operand(rsp, kPointerSize)); // Receiver is under value.
1116
- __ CallRuntime(Runtime::kToFastProperties, 1);
1117
- __ pop(rax);
1118
- }
1119
-
1120
- DropAndApply(1, expr->context(), rax);
1121
- }
1122
-
1123
-
1124
- void FastCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
1125
- // Assignment to a property, using a keyed store IC.
1126
-
1127
- // If the assignment starts a block of assignments to the same object,
1128
- // change to slow case to avoid the quadratic behavior of repeatedly
1129
- // adding fast properties.
1130
- if (expr->starts_initialization_block()) {
1131
- __ push(result_register());
1132
- // Receiver is now under the key and value.
1133
- __ push(Operand(rsp, 2 * kPointerSize));
1134
- __ CallRuntime(Runtime::kToSlowProperties, 1);
1135
- __ pop(result_register());
1136
- }
1137
-
1138
- // Record source code position before IC call.
1139
- SetSourcePosition(expr->position());
1140
- Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
1141
- __ Call(ic, RelocInfo::CODE_TARGET);
1142
- // This nop signals to the IC that there is no inlined code at the call
1143
- // site for it to patch.
1144
- __ nop();
1145
-
1146
- // If the assignment ends an initialization block, revert to fast case.
1147
- if (expr->ends_initialization_block()) {
1148
- __ push(rax); // Result of assignment, saved even if not needed.
1149
- // Receiver is under the key and value.
1150
- __ push(Operand(rsp, 2 * kPointerSize));
1151
- __ CallRuntime(Runtime::kToFastProperties, 1);
1152
- __ pop(rax);
1153
- }
1154
-
1155
- // Receiver and key are still on stack.
1156
- DropAndApply(2, expr->context(), rax);
1157
- }
1158
-
1159
-
1160
- void FastCodeGenerator::VisitProperty(Property* expr) {
1161
- Comment cmnt(masm_, "[ Property");
1162
- Expression* key = expr->key();
1163
-
1164
- // Evaluate receiver.
1165
- VisitForValue(expr->obj(), kStack);
1166
-
1167
- if (key->IsPropertyName()) {
1168
- EmitNamedPropertyLoad(expr);
1169
- // Drop receiver left on the stack by IC.
1170
- DropAndApply(1, expr->context(), rax);
1171
- } else {
1172
- VisitForValue(expr->key(), kStack);
1173
- EmitKeyedPropertyLoad(expr);
1174
- // Drop key and receiver left on the stack by IC.
1175
- DropAndApply(2, expr->context(), rax);
1176
- }
1177
- }
1178
-
1179
-
1180
- void FastCodeGenerator::EmitCallWithIC(Call* expr,
1181
- Handle<Object> ignored,
1182
- RelocInfo::Mode mode) {
1183
- // Code common for calls using the IC.
1184
- ZoneList<Expression*>* args = expr->arguments();
1185
- int arg_count = args->length();
1186
- for (int i = 0; i < arg_count; i++) {
1187
- VisitForValue(args->at(i), kStack);
1188
- }
1189
- // Record source position for debugger.
1190
- SetSourcePosition(expr->position());
1191
- // Call the IC initialization code.
1192
- InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
1193
- Handle<Code> ic = CodeGenerator::ComputeCallInitialize(arg_count,
1194
- in_loop);
1195
- __ Call(ic, mode);
1196
- // Restore context register.
1197
- __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
1198
- // Discard the function left on TOS.
1199
- DropAndApply(1, expr->context(), rax);
1200
- }
1201
-
1202
-
1203
- void FastCodeGenerator::EmitCallWithStub(Call* expr) {
1204
- // Code common for calls using the call stub.
1205
- ZoneList<Expression*>* args = expr->arguments();
1206
- int arg_count = args->length();
1207
- for (int i = 0; i < arg_count; i++) {
1208
- VisitForValue(args->at(i), kStack);
1209
- }
1210
- // Record source position for debugger.
1211
- SetSourcePosition(expr->position());
1212
- CallFunctionStub stub(arg_count, NOT_IN_LOOP);
1213
- __ CallStub(&stub);
1214
- // Restore context register.
1215
- __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
1216
- // Discard the function left on TOS.
1217
- DropAndApply(1, expr->context(), rax);
1218
- }
1219
-
1220
-
1221
- void FastCodeGenerator::VisitCall(Call* expr) {
1222
- Comment cmnt(masm_, "[ Call");
1223
- Expression* fun = expr->expression();
1224
- Variable* var = fun->AsVariableProxy()->AsVariable();
1225
-
1226
- if (var != NULL && var->is_possibly_eval()) {
1227
- // Call to the identifier 'eval'.
1228
- UNREACHABLE();
1229
- } else if (var != NULL && !var->is_this() && var->is_global()) {
1230
- // Call to a global variable.
1231
- __ Push(var->name());
1232
- // Push global object as receiver for the call IC lookup.
1233
- __ push(CodeGenerator::GlobalObject());
1234
- EmitCallWithIC(expr, var->name(), RelocInfo::CODE_TARGET_CONTEXT);
1235
- } else if (var != NULL && var->slot() != NULL &&
1236
- var->slot()->type() == Slot::LOOKUP) {
1237
- // Call to a lookup slot.
1238
- UNREACHABLE();
1239
- } else if (fun->AsProperty() != NULL) {
1240
- // Call to an object property.
1241
- Property* prop = fun->AsProperty();
1242
- Literal* key = prop->key()->AsLiteral();
1243
- if (key != NULL && key->handle()->IsSymbol()) {
1244
- // Call to a named property, use call IC.
1245
- __ Push(key->handle());
1246
- VisitForValue(prop->obj(), kStack);
1247
- EmitCallWithIC(expr, key->handle(), RelocInfo::CODE_TARGET);
1248
- } else {
1249
- // Call to a keyed property, use keyed load IC followed by function
1250
- // call.
1251
- VisitForValue(prop->obj(), kStack);
1252
- VisitForValue(prop->key(), kStack);
1253
- // Record source code position for IC call.
1254
- SetSourcePosition(prop->position());
1255
- Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
1256
- __ call(ic, RelocInfo::CODE_TARGET);
1257
- // By emitting a nop we make sure that we do not have a "test rax,..."
1258
- // instruction after the call it is treated specially by the LoadIC code.
1259
- __ nop();
1260
- // Drop key left on the stack by IC.
1261
- __ Drop(1);
1262
- // Pop receiver.
1263
- __ pop(rbx);
1264
- // Push result (function).
1265
- __ push(rax);
1266
- // Push receiver object on stack.
1267
- if (prop->is_synthetic()) {
1268
- __ movq(rcx, CodeGenerator::GlobalObject());
1269
- __ push(FieldOperand(rcx, GlobalObject::kGlobalReceiverOffset));
1270
- } else {
1271
- __ push(rbx);
1272
- }
1273
- EmitCallWithStub(expr);
1274
- }
1275
- } else {
1276
- // Call to some other expression. If the expression is an anonymous
1277
- // function literal not called in a loop, mark it as one that should
1278
- // also use the fast code generator.
1279
- FunctionLiteral* lit = fun->AsFunctionLiteral();
1280
- if (lit != NULL &&
1281
- lit->name()->Equals(Heap::empty_string()) &&
1282
- loop_depth() == 0) {
1283
- lit->set_try_fast_codegen(true);
1284
- }
1285
- VisitForValue(fun, kStack);
1286
- // Load global receiver object.
1287
- __ movq(rbx, CodeGenerator::GlobalObject());
1288
- __ push(FieldOperand(rbx, GlobalObject::kGlobalReceiverOffset));
1289
- // Emit function call.
1290
- EmitCallWithStub(expr);
1291
- }
1292
- }
1293
-
1294
-
1295
- void FastCodeGenerator::VisitCallNew(CallNew* expr) {
1296
- Comment cmnt(masm_, "[ CallNew");
1297
- // According to ECMA-262, section 11.2.2, page 44, the function
1298
- // expression in new calls must be evaluated before the
1299
- // arguments.
1300
- // Push function on the stack.
1301
- VisitForValue(expr->expression(), kStack);
1302
-
1303
- // Push global object (receiver).
1304
- __ push(CodeGenerator::GlobalObject());
1305
-
1306
- // Push the arguments ("left-to-right") on the stack.
1307
- ZoneList<Expression*>* args = expr->arguments();
1308
- int arg_count = args->length();
1309
- for (int i = 0; i < arg_count; i++) {
1310
- VisitForValue(args->at(i), kStack);
1311
- }
1312
-
1313
- // Call the construct call builtin that handles allocation and
1314
- // constructor invocation.
1315
- SetSourcePosition(expr->position());
1316
-
1317
- // Load function, arg_count into rdi and rax.
1318
- __ Set(rax, arg_count);
1319
- // Function is in rsp[arg_count + 1].
1320
- __ movq(rdi, Operand(rsp, rax, times_pointer_size, kPointerSize));
1321
-
1322
- Handle<Code> construct_builtin(Builtins::builtin(Builtins::JSConstructCall));
1323
- __ Call(construct_builtin, RelocInfo::CONSTRUCT_CALL);
1324
-
1325
- // Replace function on TOS with result in rax, or pop it.
1326
- DropAndApply(1, expr->context(), rax);
1327
- }
1328
-
1329
-
1330
- void FastCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
1331
- Comment cmnt(masm_, "[ CallRuntime");
1332
- ZoneList<Expression*>* args = expr->arguments();
1333
-
1334
- if (expr->is_jsruntime()) {
1335
- // Prepare for calling JS runtime function.
1336
- __ Push(expr->name());
1337
- __ movq(rax, CodeGenerator::GlobalObject());
1338
- __ push(FieldOperand(rax, GlobalObject::kBuiltinsOffset));
1339
- }
1340
-
1341
- // Push the arguments ("left-to-right").
1342
- int arg_count = args->length();
1343
- for (int i = 0; i < arg_count; i++) {
1344
- VisitForValue(args->at(i), kStack);
1345
- }
1346
-
1347
- if (expr->is_jsruntime()) {
1348
- // Call the JS runtime function.
1349
- Handle<Code> ic = CodeGenerator::ComputeCallInitialize(arg_count,
1350
- NOT_IN_LOOP);
1351
- __ call(ic, RelocInfo::CODE_TARGET);
1352
- // Restore context register.
1353
- __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
1354
- // Discard the function left on TOS.
1355
- DropAndApply(1, expr->context(), rax);
1356
- } else {
1357
- __ CallRuntime(expr->function(), arg_count);
1358
- Apply(expr->context(), rax);
1359
- }
1360
- }
1361
-
1362
-
1363
- void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
1364
- switch (expr->op()) {
1365
- case Token::VOID: {
1366
- Comment cmnt(masm_, "[ UnaryOperation (VOID)");
1367
- ASSERT_EQ(Expression::kEffect, expr->expression()->context());
1368
- Visit(expr->expression());
1369
- switch (expr->context()) {
1370
- case Expression::kUninitialized:
1371
- UNREACHABLE();
1372
- break;
1373
- case Expression::kEffect:
1374
- break;
1375
- case Expression::kValue:
1376
- switch (location_) {
1377
- case kAccumulator:
1378
- __ LoadRoot(result_register(), Heap::kUndefinedValueRootIndex);
1379
- break;
1380
- case kStack:
1381
- __ PushRoot(Heap::kUndefinedValueRootIndex);
1382
- break;
1383
- }
1384
- break;
1385
- case Expression::kTestValue:
1386
- // Value is false so it's needed.
1387
- switch (location_) {
1388
- case kAccumulator:
1389
- __ LoadRoot(result_register(), Heap::kUndefinedValueRootIndex);
1390
- break;
1391
- case kStack:
1392
- __ PushRoot(Heap::kUndefinedValueRootIndex);
1393
- break;
1394
- }
1395
- // Fall through.
1396
- case Expression::kTest:
1397
- case Expression::kValueTest:
1398
- __ jmp(false_label_);
1399
- break;
1400
- }
1401
- break;
1402
- }
1403
-
1404
- case Token::NOT: {
1405
- Comment cmnt(masm_, "[ UnaryOperation (NOT)");
1406
- ASSERT_EQ(Expression::kTest, expr->expression()->context());
1407
-
1408
- Label materialize_true, materialize_false, done;
1409
- // Initially assume a pure test context. Notice that the labels are
1410
- // swapped.
1411
- Label* if_true = false_label_;
1412
- Label* if_false = true_label_;
1413
- switch (expr->context()) {
1414
- case Expression::kUninitialized:
1415
- UNREACHABLE();
1416
- break;
1417
- case Expression::kEffect:
1418
- if_true = &done;
1419
- if_false = &done;
1420
- break;
1421
- case Expression::kValue:
1422
- if_true = &materialize_false;
1423
- if_false = &materialize_true;
1424
- break;
1425
- case Expression::kTest:
1426
- break;
1427
- case Expression::kValueTest:
1428
- if_false = &materialize_true;
1429
- break;
1430
- case Expression::kTestValue:
1431
- if_true = &materialize_false;
1432
- break;
1433
- }
1434
- VisitForControl(expr->expression(), if_true, if_false);
1435
- Apply(expr->context(), if_false, if_true); // Labels swapped.
1436
- break;
1437
- }
1438
-
1439
- case Token::TYPEOF: {
1440
- Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)");
1441
- ASSERT_EQ(Expression::kValue, expr->expression()->context());
1442
-
1443
- VariableProxy* proxy = expr->expression()->AsVariableProxy();
1444
- if (proxy != NULL &&
1445
- !proxy->var()->is_this() &&
1446
- proxy->var()->is_global()) {
1447
- Comment cmnt(masm_, "Global variable");
1448
- __ push(CodeGenerator::GlobalObject());
1449
- __ Move(rcx, proxy->name());
1450
- Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
1451
- // Use a regular load, not a contextual load, to avoid a reference
1452
- // error.
1453
- __ Call(ic, RelocInfo::CODE_TARGET);
1454
- __ movq(Operand(rsp, 0), rax);
1455
- } else if (proxy != NULL &&
1456
- proxy->var()->slot() != NULL &&
1457
- proxy->var()->slot()->type() == Slot::LOOKUP) {
1458
- __ push(rsi);
1459
- __ Push(proxy->name());
1460
- __ CallRuntime(Runtime::kLoadContextSlotNoReferenceError, 2);
1461
- __ push(rax);
1462
- } else {
1463
- // This expression cannot throw a reference error at the top level.
1464
- VisitForValue(expr->expression(), kStack);
1465
- }
1466
-
1467
- __ CallRuntime(Runtime::kTypeof, 1);
1468
- Apply(expr->context(), rax);
1469
- break;
1470
- }
1471
-
1472
- default:
1473
- UNREACHABLE();
1474
- }
1475
- }
1476
-
1477
-
1478
- void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
1479
- Comment cmnt(masm_, "[ CountOperation");
1480
-
1481
- // Expression can only be a property, a global or a (parameter or local)
1482
- // slot. Variables with rewrite to .arguments are treated as KEYED_PROPERTY.
1483
- enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY };
1484
- LhsKind assign_type = VARIABLE;
1485
- Property* prop = expr->expression()->AsProperty();
1486
- // In case of a property we use the uninitialized expression context
1487
- // of the key to detect a named property.
1488
- if (prop != NULL) {
1489
- assign_type = (prop->key()->context() == Expression::kUninitialized)
1490
- ? NAMED_PROPERTY
1491
- : KEYED_PROPERTY;
1492
- }
1493
-
1494
- // Evaluate expression and get value.
1495
- if (assign_type == VARIABLE) {
1496
- ASSERT(expr->expression()->AsVariableProxy()->var() != NULL);
1497
- Location saved_location = location_;
1498
- location_ = kStack;
1499
- EmitVariableLoad(expr->expression()->AsVariableProxy()->var(),
1500
- Expression::kValue);
1501
- location_ = saved_location;
1502
- } else {
1503
- // Reserve space for result of postfix operation.
1504
- if (expr->is_postfix() && expr->context() != Expression::kEffect) {
1505
- ASSERT(expr->context() != Expression::kUninitialized);
1506
- __ Push(Smi::FromInt(0));
1507
- }
1508
- VisitForValue(prop->obj(), kStack);
1509
- if (assign_type == NAMED_PROPERTY) {
1510
- EmitNamedPropertyLoad(prop);
1511
- } else {
1512
- VisitForValue(prop->key(), kStack);
1513
- EmitKeyedPropertyLoad(prop);
1514
- }
1515
- __ push(rax);
1516
- }
1517
-
1518
- // Convert to number.
1519
- __ InvokeBuiltin(Builtins::TO_NUMBER, CALL_FUNCTION);
1520
-
1521
- // Save result for postfix expressions.
1522
- if (expr->is_postfix()) {
1523
- switch (expr->context()) {
1524
- case Expression::kUninitialized:
1525
- UNREACHABLE();
1526
- case Expression::kEffect:
1527
- // Do not save result.
1528
- break;
1529
- case Expression::kValue:
1530
- case Expression::kTest:
1531
- case Expression::kValueTest:
1532
- case Expression::kTestValue:
1533
- // Save the result on the stack. If we have a named or keyed property
1534
- // we store the result under the receiver that is currently on top
1535
- // of the stack.
1536
- switch (assign_type) {
1537
- case VARIABLE:
1538
- __ push(rax);
1539
- break;
1540
- case NAMED_PROPERTY:
1541
- __ movq(Operand(rsp, kPointerSize), rax);
1542
- break;
1543
- case KEYED_PROPERTY:
1544
- __ movq(Operand(rsp, 2 * kPointerSize), rax);
1545
- break;
1546
- }
1547
- break;
1548
- }
1549
- }
1550
-
1551
- // Call stub for +1/-1.
1552
- __ push(rax);
1553
- __ Push(Smi::FromInt(1));
1554
- GenericBinaryOpStub stub(expr->binary_op(),
1555
- NO_OVERWRITE,
1556
- NO_GENERIC_BINARY_FLAGS);
1557
- __ CallStub(&stub);
1558
-
1559
- // Store the value returned in rax.
1560
- switch (assign_type) {
1561
- case VARIABLE:
1562
- if (expr->is_postfix()) {
1563
- EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
1564
- Expression::kEffect);
1565
- // For all contexts except kEffect: We have the result on
1566
- // top of the stack.
1567
- if (expr->context() != Expression::kEffect) {
1568
- ApplyTOS(expr->context());
1569
- }
1570
- } else {
1571
- EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
1572
- expr->context());
1573
- }
1574
- break;
1575
- case NAMED_PROPERTY: {
1576
- __ Move(rcx, prop->key()->AsLiteral()->handle());
1577
- Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
1578
- __ call(ic, RelocInfo::CODE_TARGET);
1579
- // This nop signals to the IC that there is no inlined code at the call
1580
- // site for it to patch.
1581
- __ nop();
1582
- if (expr->is_postfix()) {
1583
- __ Drop(1); // Result is on the stack under the receiver.
1584
- if (expr->context() != Expression::kEffect) {
1585
- ApplyTOS(expr->context());
1586
- }
1587
- } else {
1588
- DropAndApply(1, expr->context(), rax);
1589
- }
1590
- break;
1591
- }
1592
- case KEYED_PROPERTY: {
1593
- Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
1594
- __ call(ic, RelocInfo::CODE_TARGET);
1595
- // This nop signals to the IC that there is no inlined code at the call
1596
- // site for it to patch.
1597
- __ nop();
1598
- if (expr->is_postfix()) {
1599
- __ Drop(2); // Result is on the stack under the key and the receiver.
1600
- if (expr->context() != Expression::kEffect) {
1601
- ApplyTOS(expr->context());
1602
- }
1603
- } else {
1604
- DropAndApply(2, expr->context(), rax);
1605
- }
1606
- break;
1607
- }
1608
- }
1609
- }
1610
-
1611
- void FastCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
1612
- Comment cmnt(masm_, "[ BinaryOperation");
1613
- switch (expr->op()) {
1614
- case Token::COMMA:
1615
- ASSERT_EQ(Expression::kEffect, expr->left()->context());
1616
- ASSERT_EQ(expr->context(), expr->right()->context());
1617
- Visit(expr->left());
1618
- Visit(expr->right());
1619
- break;
1620
-
1621
- case Token::OR:
1622
- case Token::AND:
1623
- EmitLogicalOperation(expr);
1624
- break;
1625
-
1626
- case Token::ADD:
1627
- case Token::SUB:
1628
- case Token::DIV:
1629
- case Token::MOD:
1630
- case Token::MUL:
1631
- case Token::BIT_OR:
1632
- case Token::BIT_AND:
1633
- case Token::BIT_XOR:
1634
- case Token::SHL:
1635
- case Token::SHR:
1636
- case Token::SAR:
1637
- VisitForValue(expr->left(), kStack);
1638
- VisitForValue(expr->right(), kAccumulator);
1639
- EmitBinaryOp(expr->op(), expr->context());
1640
- break;
1641
-
1642
- default:
1643
- UNREACHABLE();
1644
- }
1645
- }
1646
-
1647
-
1648
- void FastCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
1649
- Comment cmnt(masm_, "[ CompareOperation");
1650
-
1651
- // Always perform the comparison for its control flow. Pack the result
1652
- // into the expression's context after the comparison is performed.
1653
- Label materialize_true, materialize_false, done;
1654
- // Initially assume we are in a test context.
1655
- Label* if_true = true_label_;
1656
- Label* if_false = false_label_;
1657
- switch (expr->context()) {
1658
- case Expression::kUninitialized:
1659
- UNREACHABLE();
1660
- break;
1661
- case Expression::kEffect:
1662
- if_true = &done;
1663
- if_false = &done;
1664
- break;
1665
- case Expression::kValue:
1666
- if_true = &materialize_true;
1667
- if_false = &materialize_false;
1668
- break;
1669
- case Expression::kTest:
1670
- break;
1671
- case Expression::kValueTest:
1672
- if_true = &materialize_true;
1673
- break;
1674
- case Expression::kTestValue:
1675
- if_false = &materialize_false;
1676
- break;
1677
- }
1678
-
1679
- VisitForValue(expr->left(), kStack);
1680
- switch (expr->op()) {
1681
- case Token::IN:
1682
- VisitForValue(expr->right(), kStack);
1683
- __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION);
1684
- __ CompareRoot(rax, Heap::kTrueValueRootIndex);
1685
- __ j(equal, if_true);
1686
- __ jmp(if_false);
1687
- break;
1688
-
1689
- case Token::INSTANCEOF: {
1690
- VisitForValue(expr->right(), kStack);
1691
- InstanceofStub stub;
1692
- __ CallStub(&stub);
1693
- __ testq(rax, rax);
1694
- __ j(zero, if_true); // The stub returns 0 for true.
1695
- __ jmp(if_false);
1696
- break;
1697
- }
1698
-
1699
- default: {
1700
- VisitForValue(expr->right(), kAccumulator);
1701
- Condition cc = no_condition;
1702
- bool strict = false;
1703
- switch (expr->op()) {
1704
- case Token::EQ_STRICT:
1705
- strict = true;
1706
- // Fall through.
1707
- case Token::EQ:
1708
- cc = equal;
1709
- __ pop(rdx);
1710
- break;
1711
- case Token::LT:
1712
- cc = less;
1713
- __ pop(rdx);
1714
- break;
1715
- case Token::GT:
1716
- // Reverse left and right sizes to obtain ECMA-262 conversion order.
1717
- cc = less;
1718
- __ movq(rdx, result_register());
1719
- __ pop(rax);
1720
- break;
1721
- case Token::LTE:
1722
- // Reverse left and right sizes to obtain ECMA-262 conversion order.
1723
- cc = greater_equal;
1724
- __ movq(rdx, result_register());
1725
- __ pop(rax);
1726
- break;
1727
- case Token::GTE:
1728
- cc = greater_equal;
1729
- __ pop(rdx);
1730
- break;
1731
- case Token::IN:
1732
- case Token::INSTANCEOF:
1733
- default:
1734
- UNREACHABLE();
1735
- }
1736
-
1737
- // The comparison stub expects the smi vs. smi case to be handled
1738
- // before it is called.
1739
- Label slow_case;
1740
- __ JumpIfNotBothSmi(rax, rdx, &slow_case);
1741
- __ SmiCompare(rdx, rax);
1742
- __ j(cc, if_true);
1743
- __ jmp(if_false);
1744
-
1745
- __ bind(&slow_case);
1746
- CompareStub stub(cc, strict);
1747
- __ CallStub(&stub);
1748
- __ testq(rax, rax);
1749
- __ j(cc, if_true);
1750
- __ jmp(if_false);
1751
- }
1752
- }
1753
-
1754
- // Convert the result of the comparison into one expected for this
1755
- // expression's context.
1756
- Apply(expr->context(), if_true, if_false);
1757
- }
1758
-
1759
-
1760
- void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) {
1761
- __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
1762
- Apply(expr->context(), rax);
1763
- }
1764
-
1765
-
1766
- Register FastCodeGenerator::result_register() { return rax; }
1767
-
1768
-
1769
- Register FastCodeGenerator::context_register() { return rsi; }
1770
-
1771
-
1772
- void FastCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
1773
- ASSERT(IsAligned(frame_offset, kPointerSize));
1774
- __ movq(Operand(rbp, frame_offset), value);
1775
- }
1776
-
1777
-
1778
- void FastCodeGenerator::LoadContextField(Register dst, int context_index) {
1779
- __ movq(dst, CodeGenerator::ContextOperand(rsi, context_index));
1780
- }
1781
-
1782
-
1783
- // ----------------------------------------------------------------------------
1784
- // Non-local control flow support.
1785
-
1786
-
1787
- void FastCodeGenerator::EnterFinallyBlock() {
1788
- ASSERT(!result_register().is(rdx));
1789
- ASSERT(!result_register().is(rcx));
1790
- // Cook return address on top of stack (smi encoded Code* delta)
1791
- __ movq(rdx, Operand(rsp, 0));
1792
- __ Move(rcx, masm_->CodeObject());
1793
- __ subq(rdx, rcx);
1794
- __ Integer32ToSmi(rdx, rdx);
1795
- __ movq(Operand(rsp, 0), rdx);
1796
- // Store result register while executing finally block.
1797
- __ push(result_register());
1798
- }
1799
-
1800
-
1801
- void FastCodeGenerator::ExitFinallyBlock() {
1802
- ASSERT(!result_register().is(rdx));
1803
- ASSERT(!result_register().is(rcx));
1804
- // Restore result register from stack.
1805
- __ pop(result_register());
1806
- // Uncook return address.
1807
- __ movq(rdx, Operand(rsp, 0));
1808
- __ SmiToInteger32(rdx, rdx);
1809
- __ Move(rcx, masm_->CodeObject());
1810
- __ addq(rdx, rcx);
1811
- __ movq(Operand(rsp, 0), rdx);
1812
- // And return.
1813
- __ ret(0);
1814
- }
1815
-
1816
-
1817
- #undef __
1818
-
1819
-
1820
- } } // namespace v8::internal