therubyracer 0.6.3 → 0.7.0.pre

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 (520) hide show
  1. data/Rakefile +10 -9
  2. data/ext/v8/callbacks.cpp +15 -8
  3. data/ext/v8/converters.cpp +7 -8
  4. data/ext/v8/converters.h +0 -2
  5. data/ext/v8/extconf.rb +2 -0
  6. data/ext/v8/rr.cpp +169 -0
  7. data/ext/v8/rr.h +34 -0
  8. data/ext/v8/upstream/{2.0.6 → 2.1.10}/AUTHORS +8 -1
  9. data/ext/v8/upstream/{2.0.6 → 2.1.10}/ChangeLog +198 -0
  10. data/ext/v8/upstream/{2.0.6 → 2.1.10}/LICENSE +0 -0
  11. data/ext/v8/upstream/{2.0.6 → 2.1.10}/SConstruct +152 -38
  12. data/ext/v8/upstream/{2.0.6 → 2.1.10}/include/v8-debug.h +52 -4
  13. data/ext/v8/upstream/2.1.10/include/v8-profiler.h +176 -0
  14. data/ext/v8/upstream/{2.0.6 → 2.1.10}/include/v8.h +227 -48
  15. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/SConscript +60 -10
  16. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/accessors.cc +5 -39
  17. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/accessors.h +0 -0
  18. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/allocation.cc +0 -0
  19. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/allocation.h +0 -0
  20. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/api.cc +477 -57
  21. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/api.h +8 -4
  22. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/apinatives.js +1 -1
  23. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/apiutils.h +0 -0
  24. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arguments.h +5 -6
  25. data/ext/v8/upstream/{2.0.6/src/arm/assembler-thumb2-inl.h → 2.1.10/src/arm/assembler-arm-inl.h} +42 -27
  26. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/assembler-arm.cc +430 -216
  27. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/assembler-arm.h +199 -110
  28. data/ext/v8/upstream/{2.0.6/src/arm/assembler-arm-inl.h → 2.1.10/src/arm/assembler-thumb2-inl.h} +4 -18
  29. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/assembler-thumb2.cc +142 -85
  30. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/assembler-thumb2.h +18 -9
  31. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/builtins-arm.cc +127 -87
  32. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/codegen-arm-inl.h +3 -5
  33. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/codegen-arm.cc +4634 -1427
  34. data/ext/v8/upstream/2.1.10/src/arm/codegen-arm.h +946 -0
  35. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/constants-arm.cc +21 -3
  36. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/constants-arm.h +39 -13
  37. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/cpu-arm.cc +9 -3
  38. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/debug-arm.cc +34 -8
  39. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/disasm-arm.cc +262 -117
  40. data/ext/v8/upstream/2.1.10/src/arm/fast-codegen-arm.cc +238 -0
  41. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/frames-arm.cc +0 -0
  42. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/frames-arm.h +0 -0
  43. data/ext/v8/upstream/{2.0.6/src/arm/fast-codegen-arm.cc → 2.1.10/src/arm/full-codegen-arm.cc} +453 -283
  44. data/ext/v8/upstream/2.1.10/src/arm/ic-arm.cc +1833 -0
  45. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/jump-target-arm.cc +3 -29
  46. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/macro-assembler-arm.cc +564 -104
  47. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/macro-assembler-arm.h +255 -46
  48. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/regexp-macro-assembler-arm.cc +78 -104
  49. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/regexp-macro-assembler-arm.h +6 -22
  50. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/register-allocator-arm-inl.h +0 -3
  51. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/register-allocator-arm.cc +0 -0
  52. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/register-allocator-arm.h +2 -1
  53. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/simulator-arm.cc +557 -180
  54. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/simulator-arm.h +52 -4
  55. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/stub-cache-arm.cc +904 -240
  56. data/ext/v8/upstream/2.1.10/src/arm/virtual-frame-arm.cc +668 -0
  57. data/ext/v8/upstream/2.1.10/src/arm/virtual-frame-arm.h +503 -0
  58. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/array.js +82 -109
  59. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/assembler.cc +49 -13
  60. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/assembler.h +27 -5
  61. data/ext/v8/upstream/2.1.10/src/ast.cc +1138 -0
  62. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ast.h +354 -53
  63. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/bootstrapper.cc +609 -501
  64. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/bootstrapper.h +27 -8
  65. data/ext/v8/upstream/2.1.10/src/builtins.cc +1512 -0
  66. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/builtins.h +41 -25
  67. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/bytecodes-irregexp.h +0 -0
  68. data/ext/v8/upstream/2.1.10/src/cached-powers.h +119 -0
  69. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/char-predicates-inl.h +0 -0
  70. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/char-predicates.h +0 -0
  71. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/checks.cc +0 -0
  72. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/checks.h +25 -1
  73. data/ext/v8/upstream/2.1.10/src/circular-queue-inl.h +101 -0
  74. data/ext/v8/upstream/2.1.10/src/circular-queue.cc +121 -0
  75. data/ext/v8/upstream/2.1.10/src/circular-queue.h +129 -0
  76. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/code-stubs.cc +23 -8
  77. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/code-stubs.h +16 -4
  78. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/code.h +0 -0
  79. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/codegen-inl.h +6 -34
  80. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/codegen.cc +73 -92
  81. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/codegen.h +164 -68
  82. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/compilation-cache.cc +117 -73
  83. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/compilation-cache.h +18 -17
  84. data/ext/v8/upstream/2.1.10/src/compiler.cc +623 -0
  85. data/ext/v8/upstream/2.1.10/src/compiler.h +299 -0
  86. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/contexts.cc +0 -0
  87. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/contexts.h +8 -11
  88. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/conversions-inl.h +28 -13
  89. data/ext/v8/upstream/2.1.10/src/conversions.cc +1105 -0
  90. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/conversions.h +9 -4
  91. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/counters.cc +0 -0
  92. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/counters.h +1 -1
  93. data/ext/v8/upstream/2.1.10/src/cpu-profiler-inl.h +99 -0
  94. data/ext/v8/upstream/2.1.10/src/cpu-profiler.cc +494 -0
  95. data/ext/v8/upstream/2.1.10/src/cpu-profiler.h +277 -0
  96. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/cpu.h +0 -0
  97. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-debug.cc +15 -4
  98. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-debug.h +0 -0
  99. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-posix.cc +18 -0
  100. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-readline.cc +2 -2
  101. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-windows.cc +0 -0
  102. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8.cc +10 -6
  103. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8.h +2 -0
  104. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8.js +43 -38
  105. data/ext/v8/upstream/2.1.10/src/data-flow.cc +755 -0
  106. data/ext/v8/upstream/2.1.10/src/data-flow.h +278 -0
  107. data/ext/v8/upstream/{2.0.6/src/date-delay.js → 2.1.10/src/date.js} +100 -110
  108. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/dateparser-inl.h +11 -2
  109. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/dateparser.cc +24 -26
  110. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/dateparser.h +8 -4
  111. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/debug-agent.cc +3 -1
  112. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/debug-agent.h +0 -0
  113. data/ext/v8/upstream/{2.0.6/src/debug-delay.js → 2.1.10/src/debug-debugger.js} +111 -15
  114. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/debug.cc +156 -96
  115. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/debug.h +53 -5
  116. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/disasm.h +0 -0
  117. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/disassembler.cc +2 -8
  118. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/disassembler.h +0 -0
  119. data/ext/v8/upstream/2.1.10/src/diy-fp.cc +58 -0
  120. data/ext/v8/upstream/2.1.10/src/diy-fp.h +117 -0
  121. data/ext/v8/upstream/2.1.10/src/double.h +169 -0
  122. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/dtoa-config.c +4 -3
  123. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/execution.cc +22 -22
  124. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/execution.h +17 -4
  125. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/factory.cc +70 -46
  126. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/factory.h +27 -17
  127. data/ext/v8/upstream/2.1.10/src/fast-codegen.cc +746 -0
  128. data/ext/v8/upstream/2.1.10/src/fast-codegen.h +161 -0
  129. data/ext/v8/upstream/2.1.10/src/fast-dtoa.cc +512 -0
  130. data/ext/v8/upstream/2.1.10/src/fast-dtoa.h +59 -0
  131. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/flag-definitions.h +32 -11
  132. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/flags.cc +0 -0
  133. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/flags.h +0 -0
  134. data/ext/v8/upstream/2.1.10/src/flow-graph.cc +763 -0
  135. data/ext/v8/upstream/2.1.10/src/flow-graph.h +180 -0
  136. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frame-element.cc +1 -4
  137. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frame-element.h +49 -11
  138. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frames-inl.h +2 -0
  139. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frames.cc +91 -17
  140. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frames.h +24 -2
  141. data/ext/v8/upstream/{2.0.6/src/fast-codegen.cc → 2.1.10/src/full-codegen.cc} +549 -198
  142. data/ext/v8/upstream/{2.0.6/src/fast-codegen.h → 2.1.10/src/full-codegen.h} +109 -29
  143. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/func-name-inferrer.cc +0 -0
  144. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/func-name-inferrer.h +0 -0
  145. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/global-handles.cc +0 -0
  146. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/global-handles.h +0 -0
  147. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/globals.h +67 -43
  148. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/handles-inl.h +0 -0
  149. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/handles.cc +124 -129
  150. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/handles.h +33 -15
  151. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/hashmap.cc +0 -0
  152. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/hashmap.h +0 -0
  153. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap-inl.h +56 -12
  154. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap-profiler.cc +2 -2
  155. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap-profiler.h +2 -0
  156. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap.cc +413 -221
  157. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap.h +192 -67
  158. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/assembler-ia32-inl.h +6 -0
  159. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/assembler-ia32.cc +187 -32
  160. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/assembler-ia32.h +31 -4
  161. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/builtins-ia32.cc +160 -133
  162. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/codegen-ia32-inl.h +0 -0
  163. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/codegen-ia32.cc +5533 -2177
  164. data/ext/v8/upstream/{2.0.6/src/x64/codegen-x64.h → 2.1.10/src/ia32/codegen-ia32.h} +453 -134
  165. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/cpu-ia32.cc +0 -0
  166. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/debug-ia32.cc +63 -8
  167. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/disasm-ia32.cc +99 -16
  168. data/ext/v8/upstream/2.1.10/src/ia32/fast-codegen-ia32.cc +950 -0
  169. data/ext/v8/upstream/2.1.10/src/ia32/fast-codegen-ia32.h +155 -0
  170. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/frames-ia32.cc +0 -0
  171. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/frames-ia32.h +0 -0
  172. data/ext/v8/upstream/{2.0.6/src/ia32/fast-codegen-ia32.cc → 2.1.10/src/ia32/full-codegen-ia32.cc} +454 -253
  173. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/ic-ia32.cc +545 -390
  174. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/jump-target-ia32.cc +1 -0
  175. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/macro-assembler-ia32.cc +330 -139
  176. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/macro-assembler-ia32.h +96 -30
  177. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/regexp-macro-assembler-ia32.cc +73 -89
  178. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/regexp-macro-assembler-ia32.h +6 -21
  179. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/register-allocator-ia32-inl.h +0 -0
  180. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/register-allocator-ia32.cc +59 -5
  181. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/register-allocator-ia32.h +0 -0
  182. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/simulator-ia32.cc +0 -0
  183. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/simulator-ia32.h +2 -2
  184. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/stub-cache-ia32.cc +745 -303
  185. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/virtual-frame-ia32.cc +278 -71
  186. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/virtual-frame-ia32.h +78 -22
  187. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ic-inl.h +0 -0
  188. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ic.cc +172 -89
  189. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ic.h +51 -20
  190. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/interpreter-irregexp.cc +0 -0
  191. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/interpreter-irregexp.h +0 -0
  192. data/ext/v8/upstream/{2.0.6/src/json-delay.js → 2.1.10/src/json.js} +26 -12
  193. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/jsregexp.cc +151 -118
  194. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/jsregexp.h +31 -7
  195. data/ext/v8/upstream/2.1.10/src/jump-target-heavy-inl.h +51 -0
  196. data/ext/v8/upstream/{2.0.6/src/jump-target.cc → 2.1.10/src/jump-target-heavy.cc} +164 -184
  197. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/jump-target-inl.h +8 -9
  198. data/ext/v8/upstream/{2.0.6/src/usage-analyzer.h → 2.1.10/src/jump-target-light-inl.h} +9 -7
  199. data/ext/v8/upstream/2.1.10/src/jump-target-light.cc +86 -0
  200. data/ext/v8/upstream/2.1.10/src/jump-target.cc +155 -0
  201. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/jump-target.h +6 -0
  202. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/list-inl.h +0 -0
  203. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/list.h +2 -1
  204. data/ext/v8/upstream/2.1.10/src/liveedit-debugger.js +944 -0
  205. data/ext/v8/upstream/2.1.10/src/liveedit.cc +1468 -0
  206. data/ext/v8/upstream/2.1.10/src/liveedit.h +170 -0
  207. data/ext/v8/upstream/2.1.10/src/log-inl.h +59 -0
  208. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/log-utils.cc +3 -9
  209. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/log-utils.h +1 -4
  210. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/log.cc +198 -95
  211. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/log.h +50 -49
  212. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/macro-assembler.h +9 -0
  213. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/macros.py +30 -11
  214. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/mark-compact.cc +464 -152
  215. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/mark-compact.h +41 -20
  216. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/math.js +9 -8
  217. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/memory.h +0 -0
  218. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/messages.cc +1 -0
  219. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/messages.h +0 -0
  220. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/messages.js +46 -9
  221. data/ext/v8/upstream/2.1.10/src/mips/assembler-mips-inl.h +215 -0
  222. data/ext/v8/upstream/2.1.10/src/mips/assembler-mips.cc +1208 -0
  223. data/ext/v8/upstream/2.1.10/src/mips/assembler-mips.h +665 -0
  224. data/ext/v8/upstream/2.1.10/src/mips/builtins-mips.cc +202 -0
  225. data/ext/v8/upstream/2.1.10/src/mips/codegen-mips-inl.h +70 -0
  226. data/ext/v8/upstream/2.1.10/src/mips/codegen-mips.cc +1428 -0
  227. data/ext/v8/upstream/{2.0.6/src/arm/codegen-arm.h → 2.1.10/src/mips/codegen-mips.h} +103 -205
  228. data/ext/v8/upstream/2.1.10/src/mips/constants-mips.cc +323 -0
  229. data/ext/v8/upstream/2.1.10/src/mips/constants-mips.h +525 -0
  230. data/ext/v8/upstream/2.1.10/src/mips/cpu-mips.cc +69 -0
  231. data/ext/v8/upstream/2.1.10/src/mips/debug-mips.cc +128 -0
  232. data/ext/v8/upstream/2.1.10/src/mips/disasm-mips.cc +784 -0
  233. data/ext/v8/upstream/2.1.10/src/mips/fast-codegen-mips.cc +74 -0
  234. data/ext/v8/upstream/2.1.10/src/mips/frames-mips.cc +99 -0
  235. data/ext/v8/upstream/2.1.10/src/mips/frames-mips.h +164 -0
  236. data/ext/v8/upstream/2.1.10/src/mips/full-codegen-mips.cc +273 -0
  237. data/ext/v8/upstream/2.1.10/src/mips/ic-mips.cc +217 -0
  238. data/ext/v8/upstream/2.1.10/src/mips/jump-target-mips.cc +172 -0
  239. data/ext/v8/upstream/2.1.10/src/mips/macro-assembler-mips.cc +1323 -0
  240. data/ext/v8/upstream/2.1.10/src/mips/macro-assembler-mips.h +461 -0
  241. data/ext/v8/upstream/2.1.10/src/mips/register-allocator-mips-inl.h +137 -0
  242. data/ext/v8/upstream/2.1.10/src/mips/register-allocator-mips.cc +60 -0
  243. data/ext/v8/upstream/2.1.10/src/mips/register-allocator-mips.h +46 -0
  244. data/ext/v8/upstream/2.1.10/src/mips/simulator-mips.cc +1648 -0
  245. data/ext/v8/upstream/2.1.10/src/mips/simulator-mips.h +311 -0
  246. data/ext/v8/upstream/2.1.10/src/mips/stub-cache-mips.cc +400 -0
  247. data/ext/v8/upstream/2.1.10/src/mips/virtual-frame-mips.cc +316 -0
  248. data/ext/v8/upstream/{2.0.6/src/arm/virtual-frame-arm.h → 2.1.10/src/mips/virtual-frame-mips.h} +87 -71
  249. data/ext/v8/upstream/{2.0.6/src/mirror-delay.js → 2.1.10/src/mirror-debugger.js} +51 -45
  250. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/mksnapshot.cc +97 -10
  251. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/natives.h +6 -6
  252. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/objects-debug.cc +47 -5
  253. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/objects-inl.h +154 -38
  254. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/objects.cc +528 -280
  255. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/objects.h +302 -95
  256. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/oprofile-agent.cc +25 -33
  257. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/oprofile-agent.h +9 -1
  258. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/parser.cc +444 -72
  259. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/parser.h +4 -2
  260. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-freebsd.cc +32 -13
  261. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-linux.cc +59 -25
  262. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-macos.cc +30 -13
  263. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-nullos.cc +0 -0
  264. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-openbsd.cc +21 -2
  265. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-posix.cc +0 -18
  266. data/ext/v8/upstream/2.1.10/src/platform-solaris.cc +607 -0
  267. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-win32.cc +16 -17
  268. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform.h +25 -8
  269. data/ext/v8/upstream/2.1.10/src/powers-ten.h +2461 -0
  270. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/prettyprinter.cc +49 -29
  271. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/prettyprinter.h +3 -1
  272. data/ext/v8/upstream/2.1.10/src/profile-generator-inl.h +124 -0
  273. data/ext/v8/upstream/2.1.10/src/profile-generator.cc +583 -0
  274. data/ext/v8/upstream/2.1.10/src/profile-generator.h +364 -0
  275. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/property.cc +1 -1
  276. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/property.h +12 -24
  277. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-irregexp-inl.h +2 -2
  278. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-irregexp.cc +2 -2
  279. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-irregexp.h +2 -2
  280. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-tracer.cc +2 -2
  281. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-tracer.h +0 -0
  282. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler.cc +33 -10
  283. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler.h +12 -4
  284. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-stack.cc +0 -0
  285. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-stack.h +0 -0
  286. data/ext/v8/upstream/{2.0.6/src/regexp-delay.js → 2.1.10/src/regexp.js} +180 -58
  287. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/register-allocator-inl.h +68 -1
  288. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/register-allocator.cc +5 -2
  289. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/register-allocator.h +42 -17
  290. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/rewriter.cc +110 -4
  291. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/rewriter.h +0 -0
  292. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/runtime.cc +2733 -623
  293. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/runtime.h +43 -20
  294. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/runtime.js +46 -35
  295. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scanner.cc +278 -36
  296. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scanner.h +97 -26
  297. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scopeinfo.cc +3 -3
  298. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scopeinfo.h +1 -0
  299. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scopes.cc +11 -12
  300. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scopes.h +0 -1
  301. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/serialize.cc +298 -175
  302. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/serialize.h +184 -40
  303. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/shell.h +0 -0
  304. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/simulator.h +2 -0
  305. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/smart-pointer.h +0 -0
  306. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/snapshot-common.cc +16 -31
  307. data/ext/v8/upstream/2.1.10/src/snapshot-empty.cc +50 -0
  308. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/snapshot.h +13 -1
  309. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/spaces-inl.h +35 -27
  310. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/spaces.cc +256 -42
  311. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/spaces.h +136 -42
  312. data/ext/v8/upstream/{2.0.6/src/zone-inl.h → 2.1.10/src/splay-tree-inl.h} +102 -89
  313. data/ext/v8/upstream/2.1.10/src/splay-tree.h +203 -0
  314. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/string-stream.cc +0 -0
  315. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/string-stream.h +0 -0
  316. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/string.js +260 -149
  317. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/stub-cache.cc +195 -69
  318. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/stub-cache.h +127 -12
  319. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/third_party/dtoa/COPYING +0 -0
  320. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/third_party/dtoa/dtoa.c +0 -0
  321. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/third_party/valgrind/valgrind.h +0 -0
  322. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/token.cc +0 -0
  323. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/token.h +0 -0
  324. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/top.cc +26 -31
  325. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/top.h +3 -4
  326. data/ext/v8/upstream/2.1.10/src/type-info.cc +53 -0
  327. data/ext/v8/upstream/2.1.10/src/type-info.h +244 -0
  328. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/unicode-inl.h +0 -0
  329. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/unicode.cc +0 -0
  330. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/unicode.h +0 -0
  331. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/uri.js +6 -6
  332. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/utils.cc +0 -37
  333. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/utils.h +121 -50
  334. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8-counters.cc +0 -0
  335. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8-counters.h +130 -98
  336. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8.cc +42 -11
  337. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8.h +4 -2
  338. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8natives.js +202 -37
  339. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8threads.cc +11 -0
  340. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8threads.h +15 -0
  341. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/variables.cc +7 -51
  342. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/variables.h +5 -35
  343. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/version.cc +3 -3
  344. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/version.h +0 -0
  345. data/ext/v8/upstream/2.1.10/src/virtual-frame-heavy-inl.h +152 -0
  346. data/ext/v8/upstream/{2.0.6/src/virtual-frame.cc → 2.1.10/src/virtual-frame-heavy.cc} +107 -176
  347. data/ext/v8/upstream/2.1.10/src/virtual-frame-inl.h +39 -0
  348. data/ext/v8/upstream/2.1.10/src/virtual-frame-light-inl.h +69 -0
  349. data/ext/v8/upstream/2.1.10/src/virtual-frame-light.cc +49 -0
  350. data/ext/v8/upstream/2.1.10/src/virtual-frame.cc +49 -0
  351. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/virtual-frame.h +2 -0
  352. data/ext/v8/upstream/{2.0.6/src/log-inl.h → 2.1.10/src/vm-state-inl.h} +28 -20
  353. data/ext/v8/upstream/{2.0.6/src/snapshot-empty.cc → 2.1.10/src/vm-state.cc} +5 -6
  354. data/ext/v8/upstream/2.1.10/src/vm-state.h +75 -0
  355. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/assembler-x64-inl.h +11 -0
  356. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/assembler-x64.cc +285 -93
  357. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/assembler-x64.h +81 -78
  358. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/builtins-x64.cc +130 -87
  359. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/codegen-x64-inl.h +0 -0
  360. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/codegen-x64.cc +4520 -1317
  361. data/ext/v8/upstream/{2.0.6/src/ia32/codegen-ia32.h → 2.1.10/src/x64/codegen-x64.h} +362 -141
  362. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/cpu-x64.cc +0 -0
  363. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/debug-x64.cc +20 -4
  364. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/disasm-x64.cc +121 -44
  365. data/ext/v8/upstream/2.1.10/src/x64/fast-codegen-x64.cc +246 -0
  366. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/frames-x64.cc +0 -0
  367. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/frames-x64.h +0 -0
  368. data/ext/v8/upstream/{2.0.6/src/x64/fast-codegen-x64.cc → 2.1.10/src/x64/full-codegen-x64.cc} +404 -231
  369. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/ic-x64.cc +346 -117
  370. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/jump-target-x64.cc +1 -0
  371. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/macro-assembler-x64.cc +537 -181
  372. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/macro-assembler-x64.h +140 -34
  373. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/regexp-macro-assembler-x64.cc +74 -96
  374. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/regexp-macro-assembler-x64.h +8 -25
  375. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/register-allocator-x64-inl.h +1 -1
  376. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/register-allocator-x64.cc +3 -0
  377. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/register-allocator-x64.h +0 -0
  378. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/simulator-x64.cc +0 -0
  379. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/simulator-x64.h +2 -2
  380. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/stub-cache-x64.cc +785 -288
  381. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/virtual-frame-x64.cc +128 -52
  382. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/virtual-frame-x64.h +40 -19
  383. data/ext/v8/upstream/2.1.10/src/zone-inl.h +82 -0
  384. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/zone.cc +1 -0
  385. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/zone.h +6 -90
  386. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/codemap.js +12 -0
  387. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/consarray.js +0 -0
  388. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/csvparser.js +22 -37
  389. data/ext/v8/upstream/2.1.10/tools/generate-ten-powers.scm +286 -0
  390. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/gyp/v8.gyp +86 -24
  391. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/js2c.py +22 -22
  392. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/jsmin.py +0 -0
  393. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/linux-tick-processor +10 -1
  394. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/linux-tick-processor.py +0 -0
  395. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/logreader.js +34 -16
  396. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/mac-nm +0 -0
  397. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/mac-tick-processor +0 -0
  398. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/annotate +0 -0
  399. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/common +0 -0
  400. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/dump +0 -0
  401. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/report +0 -0
  402. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/reset +0 -0
  403. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/run +0 -0
  404. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/shutdown +0 -0
  405. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/start +0 -0
  406. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/presubmit.py +0 -0
  407. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/process-heap-prof.py +0 -0
  408. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/profile.js +70 -0
  409. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/profile_view.js +0 -0
  410. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/run-valgrind.py +0 -0
  411. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/splaytree.js +0 -0
  412. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/splaytree.py +0 -0
  413. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/stats-viewer.py +0 -0
  414. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/test.py +7 -7
  415. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/tickprocessor-driver.js +7 -1
  416. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/tickprocessor.js +140 -9
  417. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/tickprocessor.py +40 -4
  418. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/utils.py +6 -0
  419. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/README.txt +0 -0
  420. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/arm.vsprops +1 -1
  421. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/common.vsprops +1 -2
  422. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/d8.vcproj +0 -6
  423. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/d8_arm.vcproj +193 -199
  424. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/d8_x64.vcproj +16 -8
  425. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/d8js2c.cmd +0 -0
  426. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/debug.vsprops +0 -0
  427. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/ia32.vsprops +5 -1
  428. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/js2c.cmd +1 -1
  429. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/release.vsprops +0 -0
  430. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8.sln +0 -0
  431. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8.vcproj +11 -7
  432. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_arm.sln +0 -0
  433. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_arm.vcproj +227 -223
  434. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_base.vcproj +137 -5
  435. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_base_arm.vcproj +116 -4
  436. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_base_x64.vcproj +125 -4
  437. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_cctest.vcproj +12 -6
  438. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_cctest_arm.vcproj +12 -6
  439. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_cctest_x64.vcproj +11 -11
  440. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_mksnapshot.vcproj +0 -6
  441. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -6
  442. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_process_sample.vcproj +0 -6
  443. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_process_sample_arm.vcproj +145 -151
  444. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_process_sample_x64.vcproj +16 -6
  445. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_shell_sample.vcproj +0 -6
  446. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_shell_sample_arm.vcproj +145 -151
  447. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_shell_sample_x64.vcproj +16 -8
  448. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_snapshot.vcproj +0 -0
  449. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
  450. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
  451. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
  452. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_x64.sln +0 -0
  453. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_x64.vcproj +11 -7
  454. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/x64.vsprops +5 -1
  455. data/ext/v8/upstream/2.1.10/tools/windows-tick-processor.bat +29 -0
  456. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/windows-tick-processor.py +0 -0
  457. data/ext/v8/upstream/Makefile +8 -2
  458. data/ext/v8/v8.cpp +21 -73
  459. data/ext/v8/v8_array.cpp +56 -0
  460. data/ext/v8/v8_array.h +8 -0
  461. data/ext/v8/v8_callbacks.cpp +121 -0
  462. data/ext/v8/v8_callbacks.h +8 -0
  463. data/ext/v8/v8_cxt.cpp +74 -77
  464. data/ext/v8/v8_cxt.h +2 -9
  465. data/ext/v8/v8_date.cpp +26 -0
  466. data/ext/v8/v8_date.h +6 -0
  467. data/ext/v8/v8_exception.cpp +55 -0
  468. data/ext/v8/v8_exception.h +6 -0
  469. data/ext/v8/v8_external.cpp +50 -0
  470. data/ext/v8/v8_external.h +8 -0
  471. data/ext/v8/v8_func.cpp +76 -18
  472. data/ext/v8/v8_func.h +5 -4
  473. data/ext/v8/v8_msg.cpp +55 -46
  474. data/ext/v8/v8_msg.h +3 -11
  475. data/ext/v8/v8_obj.cpp +67 -36
  476. data/ext/v8/v8_obj.h +6 -8
  477. data/ext/v8/v8_ref.cpp +25 -9
  478. data/ext/v8/v8_ref.h +3 -5
  479. data/ext/v8/v8_script.cpp +17 -10
  480. data/ext/v8/v8_script.h +3 -3
  481. data/ext/v8/v8_str.cpp +34 -6
  482. data/ext/v8/v8_str.h +4 -2
  483. data/ext/v8/v8_template.cpp +195 -33
  484. data/ext/v8/v8_template.h +4 -5
  485. data/ext/v8/v8_try_catch.cpp +99 -0
  486. data/ext/v8/v8_try_catch.h +5 -0
  487. data/ext/v8/v8_value.cpp +164 -0
  488. data/ext/v8/v8_value.h +10 -0
  489. data/lib/v8.rb +3 -1
  490. data/lib/v8/access.rb +60 -0
  491. data/lib/v8/array.rb +15 -0
  492. data/lib/v8/callbacks.rb +88 -0
  493. data/lib/v8/cli.rb +1 -1
  494. data/lib/v8/context.rb +55 -66
  495. data/lib/v8/function.rb +20 -2
  496. data/lib/v8/object.rb +14 -12
  497. data/lib/v8/ruby_error.rb +3 -0
  498. data/lib/v8/to.rb +59 -7
  499. data/spec/ext/cxt_spec.rb +2 -15
  500. data/spec/ext/func_spec.rb +17 -10
  501. data/spec/ext/try_catch_spec.rb +32 -0
  502. data/spec/foo.rb +17 -0
  503. data/spec/redjs/jsapi_spec.rb +173 -96
  504. data/spec/spec_helper.rb +7 -0
  505. data/spec/v8/to_spec.rb +0 -1
  506. data/therubyracer.gemspec +6 -6
  507. metadata +493 -386
  508. data/ext/v8/upstream/2.0.6/src/arm/ic-arm.cc +0 -849
  509. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.cc +0 -412
  510. data/ext/v8/upstream/2.0.6/src/ast.cc +0 -512
  511. data/ext/v8/upstream/2.0.6/src/builtins.cc +0 -851
  512. data/ext/v8/upstream/2.0.6/src/compiler.cc +0 -1132
  513. data/ext/v8/upstream/2.0.6/src/compiler.h +0 -107
  514. data/ext/v8/upstream/2.0.6/src/conversions.cc +0 -709
  515. data/ext/v8/upstream/2.0.6/src/usage-analyzer.cc +0 -426
  516. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.bat +0 -5
  517. data/ext/v8/upstream/no-strict-aliasing.patch +0 -13
  518. data/ext/v8/v8_standalone.cpp +0 -69
  519. data/ext/v8/v8_standalone.h +0 -31
  520. data/spec/ext/obj_spec.rb +0 -13
@@ -0,0 +1,155 @@
1
+ // Copyright 2010 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #ifndef V8_FAST_CODEGEN_IA32_H_
29
+ #define V8_FAST_CODEGEN_IA32_H_
30
+
31
+ #include "v8.h"
32
+
33
+ #include "ast.h"
34
+ #include "compiler.h"
35
+ #include "list.h"
36
+
37
+ namespace v8 {
38
+ namespace internal {
39
+
40
+ class FastCodeGenSyntaxChecker: public AstVisitor {
41
+ public:
42
+ explicit FastCodeGenSyntaxChecker()
43
+ : info_(NULL), has_supported_syntax_(true) {
44
+ }
45
+
46
+ void Check(CompilationInfo* info);
47
+
48
+ CompilationInfo* info() { return info_; }
49
+ bool has_supported_syntax() { return has_supported_syntax_; }
50
+
51
+ private:
52
+ void VisitDeclarations(ZoneList<Declaration*>* decls);
53
+ void VisitStatements(ZoneList<Statement*>* stmts);
54
+
55
+ // AST node visit functions.
56
+ #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
57
+ AST_NODE_LIST(DECLARE_VISIT)
58
+ #undef DECLARE_VISIT
59
+
60
+ CompilationInfo* info_;
61
+ bool has_supported_syntax_;
62
+
63
+ DISALLOW_COPY_AND_ASSIGN(FastCodeGenSyntaxChecker);
64
+ };
65
+
66
+
67
+ class FastCodeGenerator: public AstVisitor {
68
+ public:
69
+ explicit FastCodeGenerator(MacroAssembler* masm)
70
+ : masm_(masm), info_(NULL), destination_(no_reg), smi_bits_(0) {
71
+ }
72
+
73
+ static Handle<Code> MakeCode(CompilationInfo* info);
74
+
75
+ void Generate(CompilationInfo* compilation_info);
76
+
77
+ private:
78
+ MacroAssembler* masm() { return masm_; }
79
+ CompilationInfo* info() { return info_; }
80
+
81
+ Register destination() { return destination_; }
82
+ void set_destination(Register reg) { destination_ = reg; }
83
+
84
+ FunctionLiteral* function() { return info_->function(); }
85
+ Scope* scope() { return info_->scope(); }
86
+
87
+ // Platform-specific fixed registers, all guaranteed distinct.
88
+ Register accumulator0();
89
+ Register accumulator1();
90
+ Register scratch0();
91
+ Register scratch1();
92
+ Register receiver_reg();
93
+ Register context_reg();
94
+
95
+ Register other_accumulator(Register reg) {
96
+ ASSERT(reg.is(accumulator0()) || reg.is(accumulator1()));
97
+ return (reg.is(accumulator0())) ? accumulator1() : accumulator0();
98
+ }
99
+
100
+ // Flags are true if the respective register is statically known to hold a
101
+ // smi. We do not track every register, only the accumulator registers.
102
+ bool is_smi(Register reg) {
103
+ ASSERT(!reg.is(no_reg));
104
+ return (smi_bits_ & reg.bit()) != 0;
105
+ }
106
+ void set_as_smi(Register reg) {
107
+ ASSERT(!reg.is(no_reg));
108
+ smi_bits_ = smi_bits_ | reg.bit();
109
+ }
110
+ void clear_as_smi(Register reg) {
111
+ ASSERT(!reg.is(no_reg));
112
+ smi_bits_ = smi_bits_ & ~reg.bit();
113
+ }
114
+
115
+ // AST node visit functions.
116
+ #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
117
+ AST_NODE_LIST(DECLARE_VISIT)
118
+ #undef DECLARE_VISIT
119
+
120
+ // Emit code to load the receiver from the stack into receiver_reg.
121
+ void EmitLoadReceiver();
122
+
123
+ // Emit code to load a global variable directly from a global property
124
+ // cell into the destination register.
125
+ void EmitGlobalVariableLoad(Handle<Object> cell);
126
+
127
+ // Emit a store to an own property of this. The stored value is expected
128
+ // in accumulator0 and the receiver in receiver_reg. The receiver
129
+ // register is preserved and the result (the stored value) is left in the
130
+ // destination register.
131
+ void EmitThisPropertyStore(Handle<String> name);
132
+
133
+ // Emit a load from an own property of this. The receiver is expected in
134
+ // receiver_reg. The receiver register is preserved and the result is
135
+ // left in the destination register.
136
+ void EmitThisPropertyLoad(Handle<String> name);
137
+
138
+ // Emit a bitwise or operation. The left operand is in accumulator1 and
139
+ // the right is in accumulator0. The result should be left in the
140
+ // destination register.
141
+ void EmitBitOr();
142
+
143
+ MacroAssembler* masm_;
144
+ CompilationInfo* info_;
145
+
146
+ Register destination_;
147
+ uint32_t smi_bits_;
148
+
149
+ DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator);
150
+ };
151
+
152
+
153
+ } } // namespace v8::internal
154
+
155
+ #endif // V8_FAST_CODEGEN_IA32_H_
@@ -30,8 +30,9 @@
30
30
  #include "codegen-inl.h"
31
31
  #include "compiler.h"
32
32
  #include "debug.h"
33
- #include "fast-codegen.h"
33
+ #include "full-codegen.h"
34
34
  #include "parser.h"
35
+ #include "scopes.h"
35
36
 
36
37
  namespace v8 {
37
38
  namespace internal {
@@ -51,84 +52,95 @@ namespace internal {
51
52
  //
52
53
  // The function builds a JS frame. Please see JavaScriptFrameConstants in
53
54
  // frames-ia32.h for its layout.
54
- void FastCodeGenerator::Generate(FunctionLiteral* fun) {
55
- function_ = fun;
56
- SetFunctionPosition(fun);
57
-
58
- __ push(ebp); // Caller's frame pointer.
59
- __ mov(ebp, esp);
60
- __ push(esi); // Callee's context.
61
- __ push(edi); // 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
- __ push(Immediate(Factory::undefined_value()));
67
- } else if (locals_count > 1) {
68
- __ mov(eax, Immediate(Factory::undefined_value()));
69
- for (int i = 0; i < locals_count; i++) {
70
- __ push(eax);
55
+ void FullCodeGenerator::Generate(CompilationInfo* info, Mode mode) {
56
+ ASSERT(info_ == NULL);
57
+ info_ = info;
58
+ SetFunctionPosition(function());
59
+ Comment cmnt(masm_, "[ function compiled by full code generator");
60
+
61
+ if (mode == PRIMARY) {
62
+ __ push(ebp); // Caller's frame pointer.
63
+ __ mov(ebp, esp);
64
+ __ push(esi); // Callee's context.
65
+ __ push(edi); // Callee's JS Function.
66
+
67
+ { Comment cmnt(masm_, "[ Allocate locals");
68
+ int locals_count = scope()->num_stack_slots();
69
+ if (locals_count == 1) {
70
+ __ push(Immediate(Factory::undefined_value()));
71
+ } else if (locals_count > 1) {
72
+ __ mov(eax, Immediate(Factory::undefined_value()));
73
+ for (int i = 0; i < locals_count; i++) {
74
+ __ push(eax);
75
+ }
71
76
  }
72
77
  }
73
- }
74
78
 
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 edi.
81
- __ push(edi);
82
- __ CallRuntime(Runtime::kNewContext, 1);
83
- function_in_register = false;
84
- // Context is returned in both eax and esi. It replaces the context
85
- // passed to us. It's saved in the stack and kept live in esi.
86
- __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi);
87
-
88
- // Copy parameters into context if necessary.
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
- __ mov(eax, Operand(ebp, parameter_offset));
97
- // Store it in the context
98
- __ mov(Operand(esi, Context::SlotOffset(slot->index())), eax);
79
+ bool function_in_register = true;
80
+
81
+ // Possibly allocate a local context.
82
+ if (scope()->num_heap_slots() > 0) {
83
+ Comment cmnt(masm_, "[ Allocate local context");
84
+ // Argument to NewContext is the function, which is still in edi.
85
+ __ push(edi);
86
+ __ CallRuntime(Runtime::kNewContext, 1);
87
+ function_in_register = false;
88
+ // Context is returned in both eax and esi. It replaces the context
89
+ // passed to us. It's saved in the stack and kept live in esi.
90
+ __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi);
91
+
92
+ // Copy parameters into context if necessary.
93
+ int num_parameters = scope()->num_parameters();
94
+ for (int i = 0; i < num_parameters; i++) {
95
+ Slot* slot = scope()->parameter(i)->slot();
96
+ if (slot != NULL && slot->type() == Slot::CONTEXT) {
97
+ int parameter_offset = StandardFrameConstants::kCallerSPOffset +
98
+ (num_parameters - 1 - i) * kPointerSize;
99
+ // Load parameter from stack.
100
+ __ mov(eax, Operand(ebp, parameter_offset));
101
+ // Store it in the context.
102
+ int context_offset = Context::SlotOffset(slot->index());
103
+ __ mov(Operand(esi, context_offset), eax);
104
+ // Update the write barrier. This clobbers all involved
105
+ // registers, so we have use a third register to avoid
106
+ // clobbering esi.
107
+ __ mov(ecx, esi);
108
+ __ RecordWrite(ecx, context_offset, eax, ebx);
109
+ }
99
110
  }
100
111
  }
101
- }
102
112
 
103
- Variable* arguments = fun->scope()->arguments()->AsVariable();
104
- if (arguments != NULL) {
105
- // Function uses arguments object.
106
- Comment cmnt(masm_, "[ Allocate arguments object");
107
- if (function_in_register) {
108
- __ push(edi);
109
- } else {
110
- __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
113
+ Variable* arguments = scope()->arguments()->AsVariable();
114
+ if (arguments != NULL) {
115
+ // Function uses arguments object.
116
+ Comment cmnt(masm_, "[ Allocate arguments object");
117
+ if (function_in_register) {
118
+ __ push(edi);
119
+ } else {
120
+ __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
121
+ }
122
+ // Receiver is just before the parameters on the caller's stack.
123
+ int offset = scope()->num_parameters() * kPointerSize;
124
+ __ lea(edx,
125
+ Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset));
126
+ __ push(edx);
127
+ __ push(Immediate(Smi::FromInt(scope()->num_parameters())));
128
+ // Arguments to ArgumentsAccessStub:
129
+ // function, receiver address, parameter count.
130
+ // The stub will rewrite receiver and parameter count if the previous
131
+ // stack frame was an arguments adapter frame.
132
+ ArgumentsAccessStub stub(ArgumentsAccessStub::NEW_OBJECT);
133
+ __ CallStub(&stub);
134
+ __ mov(ecx, eax); // Duplicate result.
135
+ Move(arguments->slot(), eax, ebx, edx);
136
+ Slot* dot_arguments_slot =
137
+ scope()->arguments_shadow()->AsVariable()->slot();
138
+ Move(dot_arguments_slot, ecx, ebx, edx);
111
139
  }
112
- // Receiver is just before the parameters on the caller's stack.
113
- __ lea(edx, Operand(ebp, StandardFrameConstants::kCallerSPOffset +
114
- fun->num_parameters() * kPointerSize));
115
- __ push(edx);
116
- __ push(Immediate(Smi::FromInt(fun->num_parameters())));
117
- // Arguments to ArgumentsAccessStub:
118
- // function, receiver address, parameter count.
119
- // The stub will rewrite receiver and parameter count if the previous
120
- // stack frame was an arguments adapter frame.
121
- ArgumentsAccessStub stub(ArgumentsAccessStub::NEW_OBJECT);
122
- __ CallStub(&stub);
123
- __ mov(ecx, eax); // Duplicate result.
124
- Move(arguments->slot(), eax, ebx, edx);
125
- Slot* dot_arguments_slot =
126
- fun->scope()->arguments_shadow()->AsVariable()->slot();
127
- Move(dot_arguments_slot, ecx, ebx, edx);
128
140
  }
129
141
 
130
142
  { Comment cmnt(masm_, "[ Declarations");
131
- VisitDeclarations(fun->scope()->declarations());
143
+ VisitDeclarations(scope()->declarations());
132
144
  }
133
145
 
134
146
  { Comment cmnt(masm_, "[ Stack check");
@@ -148,19 +160,19 @@ void FastCodeGenerator::Generate(FunctionLiteral* fun) {
148
160
 
149
161
  { Comment cmnt(masm_, "[ Body");
150
162
  ASSERT(loop_depth() == 0);
151
- VisitStatements(fun->body());
163
+ VisitStatements(function()->body());
152
164
  ASSERT(loop_depth() == 0);
153
165
  }
154
166
 
155
167
  { Comment cmnt(masm_, "[ return <undefined>;");
156
168
  // Emit a 'return undefined' in case control fell off the end of the body.
157
169
  __ mov(eax, Factory::undefined_value());
158
- EmitReturnSequence(function_->end_position());
170
+ EmitReturnSequence(function()->end_position());
159
171
  }
160
172
  }
161
173
 
162
174
 
163
- void FastCodeGenerator::EmitReturnSequence(int position) {
175
+ void FullCodeGenerator::EmitReturnSequence(int position) {
164
176
  Comment cmnt(masm_, "[ Return sequence");
165
177
  if (return_label_.is_bound()) {
166
178
  __ jmp(&return_label_);
@@ -182,7 +194,7 @@ void FastCodeGenerator::EmitReturnSequence(int position) {
182
194
  // patch with the code required by the debugger.
183
195
  __ mov(esp, ebp);
184
196
  __ pop(ebp);
185
- __ ret((function_->scope()->num_parameters() + 1) * kPointerSize);
197
+ __ ret((scope()->num_parameters() + 1) * kPointerSize);
186
198
  #ifdef ENABLE_DEBUGGER_SUPPORT
187
199
  // Check that the size of the code used for returning matches what is
188
200
  // expected by the debugger.
@@ -193,7 +205,7 @@ void FastCodeGenerator::EmitReturnSequence(int position) {
193
205
  }
194
206
 
195
207
 
196
- void FastCodeGenerator::Apply(Expression::Context context, Register reg) {
208
+ void FullCodeGenerator::Apply(Expression::Context context, Register reg) {
197
209
  switch (context) {
198
210
  case Expression::kUninitialized:
199
211
  UNREACHABLE();
@@ -236,7 +248,7 @@ void FastCodeGenerator::Apply(Expression::Context context, Register reg) {
236
248
  }
237
249
 
238
250
 
239
- void FastCodeGenerator::Apply(Expression::Context context, Slot* slot) {
251
+ void FullCodeGenerator::Apply(Expression::Context context, Slot* slot) {
240
252
  switch (context) {
241
253
  case Expression::kUninitialized:
242
254
  UNREACHABLE();
@@ -279,7 +291,7 @@ void FastCodeGenerator::Apply(Expression::Context context, Slot* slot) {
279
291
  }
280
292
 
281
293
 
282
- void FastCodeGenerator::Apply(Expression::Context context, Literal* lit) {
294
+ void FullCodeGenerator::Apply(Expression::Context context, Literal* lit) {
283
295
  switch (context) {
284
296
  case Expression::kUninitialized:
285
297
  UNREACHABLE();
@@ -320,7 +332,7 @@ void FastCodeGenerator::Apply(Expression::Context context, Literal* lit) {
320
332
  }
321
333
 
322
334
 
323
- void FastCodeGenerator::ApplyTOS(Expression::Context context) {
335
+ void FullCodeGenerator::ApplyTOS(Expression::Context context) {
324
336
  switch (context) {
325
337
  case Expression::kUninitialized:
326
338
  UNREACHABLE();
@@ -361,7 +373,7 @@ void FastCodeGenerator::ApplyTOS(Expression::Context context) {
361
373
  }
362
374
 
363
375
 
364
- void FastCodeGenerator::DropAndApply(int count,
376
+ void FullCodeGenerator::DropAndApply(int count,
365
377
  Expression::Context context,
366
378
  Register reg) {
367
379
  ASSERT(count > 0);
@@ -413,7 +425,7 @@ void FastCodeGenerator::DropAndApply(int count,
413
425
  }
414
426
 
415
427
 
416
- void FastCodeGenerator::Apply(Expression::Context context,
428
+ void FullCodeGenerator::Apply(Expression::Context context,
417
429
  Label* materialize_true,
418
430
  Label* materialize_false) {
419
431
  switch (context) {
@@ -478,7 +490,7 @@ void FastCodeGenerator::Apply(Expression::Context context,
478
490
  }
479
491
 
480
492
 
481
- void FastCodeGenerator::DoTest(Expression::Context context) {
493
+ void FullCodeGenerator::DoTest(Expression::Context context) {
482
494
  // The value to test is in the accumulator. If the value might be needed
483
495
  // on the stack (value/test and test/value contexts with a stack location
484
496
  // desired), then the value is already duplicated on the stack.
@@ -612,14 +624,14 @@ void FastCodeGenerator::DoTest(Expression::Context context) {
612
624
  }
613
625
 
614
626
 
615
- MemOperand FastCodeGenerator::EmitSlotSearch(Slot* slot, Register scratch) {
627
+ MemOperand FullCodeGenerator::EmitSlotSearch(Slot* slot, Register scratch) {
616
628
  switch (slot->type()) {
617
629
  case Slot::PARAMETER:
618
630
  case Slot::LOCAL:
619
631
  return Operand(ebp, SlotOffset(slot));
620
632
  case Slot::CONTEXT: {
621
633
  int context_chain_length =
622
- function_->scope()->ContextChainLength(slot->var()->scope());
634
+ scope()->ContextChainLength(slot->var()->scope());
623
635
  __ LoadContext(scratch, context_chain_length);
624
636
  return CodeGenerator::ContextOperand(scratch, slot->index());
625
637
  }
@@ -631,13 +643,13 @@ MemOperand FastCodeGenerator::EmitSlotSearch(Slot* slot, Register scratch) {
631
643
  }
632
644
 
633
645
 
634
- void FastCodeGenerator::Move(Register destination, Slot* source) {
646
+ void FullCodeGenerator::Move(Register destination, Slot* source) {
635
647
  MemOperand location = EmitSlotSearch(source, destination);
636
648
  __ mov(destination, location);
637
649
  }
638
650
 
639
651
 
640
- void FastCodeGenerator::Move(Slot* dst,
652
+ void FullCodeGenerator::Move(Slot* dst,
641
653
  Register src,
642
654
  Register scratch1,
643
655
  Register scratch2) {
@@ -653,7 +665,7 @@ void FastCodeGenerator::Move(Slot* dst,
653
665
  }
654
666
 
655
667
 
656
- void FastCodeGenerator::VisitDeclaration(Declaration* decl) {
668
+ void FullCodeGenerator::VisitDeclaration(Declaration* decl) {
657
669
  Comment cmnt(masm_, "[ Declaration");
658
670
  Variable* var = decl->proxy()->var();
659
671
  ASSERT(var != NULL); // Must have been resolved.
@@ -678,7 +690,7 @@ void FastCodeGenerator::VisitDeclaration(Declaration* decl) {
678
690
  // this specific context.
679
691
 
680
692
  // The variable in the decl always resides in the current context.
681
- ASSERT_EQ(0, function_->scope()->ContextChainLength(var->scope()));
693
+ ASSERT_EQ(0, scope()->ContextChainLength(var->scope()));
682
694
  if (FLAG_debug_code) {
683
695
  // Check if we have the correct context pointer.
684
696
  __ mov(ebx,
@@ -695,7 +707,8 @@ void FastCodeGenerator::VisitDeclaration(Declaration* decl) {
695
707
  __ mov(CodeGenerator::ContextOperand(esi, slot->index()),
696
708
  result_register());
697
709
  int offset = Context::SlotOffset(slot->index());
698
- __ RecordWrite(esi, offset, result_register(), ecx);
710
+ __ mov(ebx, esi);
711
+ __ RecordWrite(ebx, offset, result_register(), ecx);
699
712
  }
700
713
  break;
701
714
 
@@ -729,71 +742,73 @@ void FastCodeGenerator::VisitDeclaration(Declaration* decl) {
729
742
  // We are declaring a function or constant that rewrites to a
730
743
  // property. Use (keyed) IC to set the initial value.
731
744
  VisitForValue(prop->obj(), kStack);
732
- VisitForValue(prop->key(), kStack);
733
-
734
745
  if (decl->fun() != NULL) {
746
+ VisitForValue(prop->key(), kStack);
735
747
  VisitForValue(decl->fun(), kAccumulator);
748
+ __ pop(ecx);
736
749
  } else {
750
+ VisitForValue(prop->key(), kAccumulator);
751
+ __ mov(ecx, result_register());
737
752
  __ mov(result_register(), Factory::the_hole_value());
738
753
  }
754
+ __ pop(edx);
739
755
 
740
756
  Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
741
757
  __ call(ic, RelocInfo::CODE_TARGET);
742
758
  // Absence of a test eax instruction following the call
743
759
  // indicates that none of the load was inlined.
744
760
  __ nop();
745
-
746
- // Value in eax is ignored (declarations are statements). Receiver
747
- // and key on stack are discarded.
748
- __ Drop(2);
749
761
  }
750
762
  }
751
763
  }
752
764
 
753
765
 
754
- void FastCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
766
+ void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
755
767
  // Call the runtime to declare the globals.
756
768
  __ push(esi); // The context is the first argument.
757
769
  __ push(Immediate(pairs));
758
- __ push(Immediate(Smi::FromInt(is_eval_ ? 1 : 0)));
770
+ __ push(Immediate(Smi::FromInt(is_eval() ? 1 : 0)));
759
771
  __ CallRuntime(Runtime::kDeclareGlobals, 3);
760
772
  // Return value is ignored.
761
773
  }
762
774
 
763
775
 
764
- void FastCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
776
+ void FullCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
765
777
  Comment cmnt(masm_, "[ FunctionLiteral");
766
778
 
767
- // Build the function boilerplate and instantiate it.
768
- Handle<JSFunction> boilerplate =
769
- Compiler::BuildBoilerplate(expr, script_, this);
779
+ // Build the shared function info and instantiate the function based
780
+ // on it.
781
+ Handle<SharedFunctionInfo> function_info =
782
+ Compiler::BuildFunctionInfo(expr, script(), this);
770
783
  if (HasStackOverflow()) return;
771
784
 
772
- ASSERT(boilerplate->IsBoilerplate());
773
-
774
785
  // Create a new closure.
775
786
  __ push(esi);
776
- __ push(Immediate(boilerplate));
787
+ __ push(Immediate(function_info));
777
788
  __ CallRuntime(Runtime::kNewClosure, 2);
778
- Apply(expr->context(), eax);
789
+ Apply(context_, eax);
779
790
  }
780
791
 
781
792
 
782
- void FastCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
793
+ void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
783
794
  Comment cmnt(masm_, "[ VariableProxy");
784
- EmitVariableLoad(expr->var(), expr->context());
795
+ EmitVariableLoad(expr->var(), context_);
785
796
  }
786
797
 
787
798
 
788
- void FastCodeGenerator::EmitVariableLoad(Variable* var,
799
+ void FullCodeGenerator::EmitVariableLoad(Variable* var,
789
800
  Expression::Context context) {
790
- Expression* rewrite = var->rewrite();
791
- if (rewrite == NULL) {
792
- ASSERT(var->is_global());
801
+ // Four cases: non-this global variables, lookup slots, all other
802
+ // types of slots, and parameters that rewrite to explicit property
803
+ // accesses on the arguments object.
804
+ Slot* slot = var->slot();
805
+ Property* property = var->AsProperty();
806
+
807
+ if (var->is_global() && !var->is_this()) {
793
808
  Comment cmnt(masm_, "Global variable");
794
809
  // Use inline caching. Variable name is passed in ecx and the global
795
810
  // object on the stack.
796
- __ push(CodeGenerator::GlobalObject());
811
+ __ mov(eax, CodeGenerator::GlobalObject());
797
812
  __ mov(ecx, var->name());
798
813
  Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
799
814
  __ call(ic, RelocInfo::CODE_TARGET_CONTEXT);
@@ -802,35 +817,25 @@ void FastCodeGenerator::EmitVariableLoad(Variable* var,
802
817
  // Remember that the assembler may choose to do peephole optimization
803
818
  // (eg, push/pop elimination).
804
819
  __ nop();
805
- DropAndApply(1, context, eax);
806
- } else if (rewrite->AsSlot() != NULL) {
807
- Slot* slot = rewrite->AsSlot();
808
- if (FLAG_debug_code) {
809
- switch (slot->type()) {
810
- case Slot::PARAMETER:
811
- case Slot::LOCAL: {
812
- Comment cmnt(masm_, "Stack slot");
813
- break;
814
- }
815
- case Slot::CONTEXT: {
816
- Comment cmnt(masm_, "Context slot");
817
- break;
818
- }
819
- case Slot::LOOKUP:
820
- UNIMPLEMENTED();
821
- break;
822
- }
823
- }
820
+ Apply(context, eax);
821
+
822
+ } else if (slot != NULL && slot->type() == Slot::LOOKUP) {
823
+ Comment cmnt(masm_, "Lookup slot");
824
+ __ push(esi); // Context.
825
+ __ push(Immediate(var->name()));
826
+ __ CallRuntime(Runtime::kLoadContextSlot, 2);
827
+ Apply(context, eax);
828
+
829
+ } else if (slot != NULL) {
830
+ Comment cmnt(masm_, (slot->type() == Slot::CONTEXT)
831
+ ? "Context slot"
832
+ : "Stack slot");
824
833
  Apply(context, slot);
834
+
825
835
  } else {
826
- Comment cmnt(masm_, "Variable rewritten to property");
827
- // A variable has been rewritten into an explicit access to an object
828
- // property.
829
- Property* property = rewrite->AsProperty();
836
+ Comment cmnt(masm_, "Rewritten parameter");
830
837
  ASSERT_NOT_NULL(property);
831
-
832
- // The only property expressions that can occur are of the form
833
- // "slot[literal]".
838
+ // Rewritten parameter accesses are of the form "slot[literal]".
834
839
 
835
840
  // Assert that the object is in a slot.
836
841
  Variable* object_var = property->obj()->AsVariableProxy()->AsVariable();
@@ -840,7 +845,7 @@ void FastCodeGenerator::EmitVariableLoad(Variable* var,
840
845
 
841
846
  // Load the object.
842
847
  MemOperand object_loc = EmitSlotSearch(object_slot, eax);
843
- __ push(object_loc);
848
+ __ mov(edx, object_loc);
844
849
 
845
850
  // Assert that the key is a smi.
846
851
  Literal* key_literal = property->key()->AsLiteral();
@@ -848,7 +853,7 @@ void FastCodeGenerator::EmitVariableLoad(Variable* var,
848
853
  ASSERT(key_literal->handle()->IsSmi());
849
854
 
850
855
  // Load the key.
851
- __ push(Immediate(key_literal->handle()));
856
+ __ mov(eax, Immediate(key_literal->handle()));
852
857
 
853
858
  // Do a keyed property load.
854
859
  Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
@@ -857,12 +862,12 @@ void FastCodeGenerator::EmitVariableLoad(Variable* var,
857
862
  // call. It is treated specially by the LoadIC code.
858
863
  __ nop();
859
864
  // Drop key and object left on the stack by IC.
860
- DropAndApply(2, context, eax);
865
+ Apply(context, eax);
861
866
  }
862
867
  }
863
868
 
864
869
 
865
- void FastCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
870
+ void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
866
871
  Comment cmnt(masm_, "[ RegExpLiteral");
867
872
  Label done;
868
873
  // Registers will be used as follows:
@@ -885,20 +890,21 @@ void FastCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
885
890
  __ CallRuntime(Runtime::kMaterializeRegExpLiteral, 4);
886
891
  // Label done:
887
892
  __ bind(&done);
888
- Apply(expr->context(), eax);
893
+ Apply(context_, eax);
889
894
  }
890
895
 
891
896
 
892
- void FastCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
897
+ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
893
898
  Comment cmnt(masm_, "[ ObjectLiteral");
894
899
  __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
895
900
  __ push(FieldOperand(edi, JSFunction::kLiteralsOffset));
896
901
  __ push(Immediate(Smi::FromInt(expr->literal_index())));
897
902
  __ push(Immediate(expr->constant_properties()));
903
+ __ push(Immediate(Smi::FromInt(expr->fast_elements() ? 1 : 0)));
898
904
  if (expr->depth() > 1) {
899
- __ CallRuntime(Runtime::kCreateObjectLiteral, 3);
905
+ __ CallRuntime(Runtime::kCreateObjectLiteral, 4);
900
906
  } else {
901
- __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 3);
907
+ __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4);
902
908
  }
903
909
 
904
910
  // If result_saved is true the result is on top of the stack. If
@@ -923,10 +929,10 @@ void FastCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
923
929
  if (key->handle()->IsSymbol()) {
924
930
  VisitForValue(value, kAccumulator);
925
931
  __ mov(ecx, Immediate(key->handle()));
932
+ __ mov(edx, Operand(esp, 0));
926
933
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
927
934
  __ call(ic, RelocInfo::CODE_TARGET);
928
935
  __ nop();
929
- // StoreIC leaves the receiver on the stack.
930
936
  break;
931
937
  }
932
938
  // Fall through.
@@ -951,14 +957,14 @@ void FastCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
951
957
  }
952
958
 
953
959
  if (result_saved) {
954
- ApplyTOS(expr->context());
960
+ ApplyTOS(context_);
955
961
  } else {
956
- Apply(expr->context(), eax);
962
+ Apply(context_, eax);
957
963
  }
958
964
  }
959
965
 
960
966
 
961
- void FastCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
967
+ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
962
968
  Comment cmnt(masm_, "[ ArrayLiteral");
963
969
  __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
964
970
  __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset));
@@ -1001,14 +1007,107 @@ void FastCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
1001
1007
  }
1002
1008
 
1003
1009
  if (result_saved) {
1004
- ApplyTOS(expr->context());
1010
+ ApplyTOS(context_);
1005
1011
  } else {
1006
- Apply(expr->context(), eax);
1012
+ Apply(context_, eax);
1013
+ }
1014
+ }
1015
+
1016
+
1017
+ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
1018
+ Comment cmnt(masm_, "[ Assignment");
1019
+ ASSERT(expr->op() != Token::INIT_CONST);
1020
+ // Left-hand side can only be a property, a global or a (parameter or local)
1021
+ // slot. Variables with rewrite to .arguments are treated as KEYED_PROPERTY.
1022
+ enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY };
1023
+ LhsKind assign_type = VARIABLE;
1024
+ Property* prop = expr->target()->AsProperty();
1025
+ if (prop != NULL) {
1026
+ assign_type =
1027
+ (prop->key()->IsPropertyName()) ? NAMED_PROPERTY : KEYED_PROPERTY;
1028
+ }
1029
+
1030
+ // Evaluate LHS expression.
1031
+ switch (assign_type) {
1032
+ case VARIABLE:
1033
+ // Nothing to do here.
1034
+ break;
1035
+ case NAMED_PROPERTY:
1036
+ if (expr->is_compound()) {
1037
+ // We need the receiver both on the stack and in the accumulator.
1038
+ VisitForValue(prop->obj(), kAccumulator);
1039
+ __ push(result_register());
1040
+ } else {
1041
+ VisitForValue(prop->obj(), kStack);
1042
+ }
1043
+ break;
1044
+ case KEYED_PROPERTY:
1045
+ if (expr->is_compound()) {
1046
+ VisitForValue(prop->obj(), kStack);
1047
+ VisitForValue(prop->key(), kAccumulator);
1048
+ __ mov(edx, Operand(esp, 0));
1049
+ __ push(eax);
1050
+ } else {
1051
+ VisitForValue(prop->obj(), kStack);
1052
+ VisitForValue(prop->key(), kStack);
1053
+ }
1054
+ break;
1055
+ }
1056
+
1057
+ // If we have a compound assignment: Get value of LHS expression and
1058
+ // store in on top of the stack.
1059
+ if (expr->is_compound()) {
1060
+ Location saved_location = location_;
1061
+ location_ = kStack;
1062
+ switch (assign_type) {
1063
+ case VARIABLE:
1064
+ EmitVariableLoad(expr->target()->AsVariableProxy()->var(),
1065
+ Expression::kValue);
1066
+ break;
1067
+ case NAMED_PROPERTY:
1068
+ EmitNamedPropertyLoad(prop);
1069
+ __ push(result_register());
1070
+ break;
1071
+ case KEYED_PROPERTY:
1072
+ EmitKeyedPropertyLoad(prop);
1073
+ __ push(result_register());
1074
+ break;
1075
+ }
1076
+ location_ = saved_location;
1077
+ }
1078
+
1079
+ // Evaluate RHS expression.
1080
+ Expression* rhs = expr->value();
1081
+ VisitForValue(rhs, kAccumulator);
1082
+
1083
+ // If we have a compound assignment: Apply operator.
1084
+ if (expr->is_compound()) {
1085
+ Location saved_location = location_;
1086
+ location_ = kAccumulator;
1087
+ EmitBinaryOp(expr->binary_op(), Expression::kValue);
1088
+ location_ = saved_location;
1089
+ }
1090
+
1091
+ // Record source position before possible IC call.
1092
+ SetSourcePosition(expr->position());
1093
+
1094
+ // Store the value.
1095
+ switch (assign_type) {
1096
+ case VARIABLE:
1097
+ EmitVariableAssignment(expr->target()->AsVariableProxy()->var(),
1098
+ context_);
1099
+ break;
1100
+ case NAMED_PROPERTY:
1101
+ EmitNamedPropertyAssignment(expr);
1102
+ break;
1103
+ case KEYED_PROPERTY:
1104
+ EmitKeyedPropertyAssignment(expr);
1105
+ break;
1007
1106
  }
1008
1107
  }
1009
1108
 
1010
1109
 
1011
- void FastCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
1110
+ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
1012
1111
  SetSourcePosition(prop->position());
1013
1112
  Literal* key = prop->key()->AsLiteral();
1014
1113
  __ mov(ecx, Immediate(key->handle()));
@@ -1018,7 +1117,7 @@ void FastCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
1018
1117
  }
1019
1118
 
1020
1119
 
1021
- void FastCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
1120
+ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
1022
1121
  SetSourcePosition(prop->position());
1023
1122
  Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
1024
1123
  __ call(ic, RelocInfo::CODE_TARGET);
@@ -1026,35 +1125,47 @@ void FastCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
1026
1125
  }
1027
1126
 
1028
1127
 
1029
- void FastCodeGenerator::EmitBinaryOp(Token::Value op,
1128
+ void FullCodeGenerator::EmitBinaryOp(Token::Value op,
1030
1129
  Expression::Context context) {
1031
1130
  __ push(result_register());
1032
1131
  GenericBinaryOpStub stub(op,
1033
1132
  NO_OVERWRITE,
1034
- NO_GENERIC_BINARY_FLAGS);
1133
+ NO_GENERIC_BINARY_FLAGS,
1134
+ TypeInfo::Unknown());
1035
1135
  __ CallStub(&stub);
1036
1136
  Apply(context, eax);
1037
1137
  }
1038
1138
 
1039
1139
 
1040
- void FastCodeGenerator::EmitVariableAssignment(Variable* var,
1140
+ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
1041
1141
  Expression::Context context) {
1142
+ // Three main cases: global variables, lookup slots, and all other
1143
+ // types of slots. Left-hand-side parameters that rewrite to
1144
+ // explicit property accesses do not reach here.
1042
1145
  ASSERT(var != NULL);
1043
1146
  ASSERT(var->is_global() || var->slot() != NULL);
1147
+
1148
+ Slot* slot = var->slot();
1044
1149
  if (var->is_global()) {
1150
+ ASSERT(!var->is_this());
1045
1151
  // Assignment to a global variable. Use inline caching for the
1046
1152
  // assignment. Right-hand-side value is passed in eax, variable name in
1047
1153
  // ecx, and the global object on the stack.
1048
1154
  __ mov(ecx, var->name());
1049
- __ push(CodeGenerator::GlobalObject());
1155
+ __ mov(edx, CodeGenerator::GlobalObject());
1050
1156
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
1051
1157
  __ call(ic, RelocInfo::CODE_TARGET);
1052
1158
  __ nop();
1053
- // Overwrite the receiver on the stack with the result if needed.
1054
- DropAndApply(1, context, eax);
1159
+ Apply(context, eax);
1055
1160
 
1056
- } else if (var->slot() != NULL) {
1057
- Slot* slot = var->slot();
1161
+ } else if (slot != NULL && slot->type() == Slot::LOOKUP) {
1162
+ __ push(result_register()); // Value.
1163
+ __ push(esi); // Context.
1164
+ __ push(Immediate(var->name()));
1165
+ __ CallRuntime(Runtime::kStoreContextSlot, 3);
1166
+ Apply(context, eax);
1167
+
1168
+ } else if (slot != NULL) {
1058
1169
  switch (slot->type()) {
1059
1170
  case Slot::LOCAL:
1060
1171
  case Slot::PARAMETER:
@@ -1086,7 +1197,7 @@ void FastCodeGenerator::EmitVariableAssignment(Variable* var,
1086
1197
  }
1087
1198
 
1088
1199
 
1089
- void FastCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
1200
+ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
1090
1201
  // Assignment to a property, using a named store IC.
1091
1202
  Property* prop = expr->target()->AsProperty();
1092
1203
  ASSERT(prop != NULL);
@@ -1105,6 +1216,11 @@ void FastCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
1105
1216
  // Record source code position before IC call.
1106
1217
  SetSourcePosition(expr->position());
1107
1218
  __ mov(ecx, prop->key()->AsLiteral()->handle());
1219
+ if (expr->ends_initialization_block()) {
1220
+ __ mov(edx, Operand(esp, 0));
1221
+ } else {
1222
+ __ pop(edx);
1223
+ }
1108
1224
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
1109
1225
  __ call(ic, RelocInfo::CODE_TARGET);
1110
1226
  __ nop();
@@ -1115,13 +1231,14 @@ void FastCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
1115
1231
  __ push(Operand(esp, kPointerSize)); // Receiver is under value.
1116
1232
  __ CallRuntime(Runtime::kToFastProperties, 1);
1117
1233
  __ pop(eax);
1234
+ DropAndApply(1, context_, eax);
1235
+ } else {
1236
+ Apply(context_, eax);
1118
1237
  }
1119
-
1120
- DropAndApply(1, expr->context(), eax);
1121
1238
  }
1122
1239
 
1123
1240
 
1124
- void FastCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
1241
+ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
1125
1242
  // Assignment to a property, using a keyed store IC.
1126
1243
 
1127
1244
  // If the assignment starts a block of assignments to the same object,
@@ -1135,6 +1252,12 @@ void FastCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
1135
1252
  __ pop(result_register());
1136
1253
  }
1137
1254
 
1255
+ __ pop(ecx);
1256
+ if (expr->ends_initialization_block()) {
1257
+ __ mov(edx, Operand(esp, 0)); // Leave receiver on the stack for later.
1258
+ } else {
1259
+ __ pop(edx);
1260
+ }
1138
1261
  // Record source code position before IC call.
1139
1262
  SetSourcePosition(expr->position());
1140
1263
  Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
@@ -1145,39 +1268,36 @@ void FastCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
1145
1268
 
1146
1269
  // If the assignment ends an initialization block, revert to fast case.
1147
1270
  if (expr->ends_initialization_block()) {
1271
+ __ pop(edx);
1148
1272
  __ push(eax); // Result of assignment, saved even if not needed.
1149
- // Receiver is under the key and value.
1150
- __ push(Operand(esp, 2 * kPointerSize));
1273
+ __ push(edx);
1151
1274
  __ CallRuntime(Runtime::kToFastProperties, 1);
1152
1275
  __ pop(eax);
1153
1276
  }
1154
1277
 
1155
- // Receiver and key are still on stack.
1156
- DropAndApply(2, expr->context(), eax);
1278
+ Apply(context_, eax);
1157
1279
  }
1158
1280
 
1159
1281
 
1160
- void FastCodeGenerator::VisitProperty(Property* expr) {
1282
+ void FullCodeGenerator::VisitProperty(Property* expr) {
1161
1283
  Comment cmnt(masm_, "[ Property");
1162
1284
  Expression* key = expr->key();
1163
1285
 
1164
- // Evaluate the receiver.
1165
- VisitForValue(expr->obj(), kStack);
1166
-
1167
1286
  if (key->IsPropertyName()) {
1287
+ VisitForValue(expr->obj(), kAccumulator);
1168
1288
  EmitNamedPropertyLoad(expr);
1169
- // Drop receiver left on the stack by IC.
1170
- DropAndApply(1, expr->context(), eax);
1289
+ Apply(context_, eax);
1171
1290
  } else {
1172
- VisitForValue(expr->key(), kStack);
1291
+ VisitForValue(expr->obj(), kStack);
1292
+ VisitForValue(expr->key(), kAccumulator);
1293
+ __ pop(edx);
1173
1294
  EmitKeyedPropertyLoad(expr);
1174
- // Drop key and receiver left on the stack by IC.
1175
- DropAndApply(2, expr->context(), eax);
1295
+ Apply(context_, eax);
1176
1296
  }
1177
1297
  }
1178
1298
 
1179
1299
 
1180
- void FastCodeGenerator::EmitCallWithIC(Call* expr,
1300
+ void FullCodeGenerator::EmitCallWithIC(Call* expr,
1181
1301
  Handle<Object> name,
1182
1302
  RelocInfo::Mode mode) {
1183
1303
  // Code common for calls using the IC.
@@ -1194,11 +1314,11 @@ void FastCodeGenerator::EmitCallWithIC(Call* expr,
1194
1314
  __ call(ic, mode);
1195
1315
  // Restore context register.
1196
1316
  __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
1197
- Apply(expr->context(), eax);
1317
+ Apply(context_, eax);
1198
1318
  }
1199
1319
 
1200
1320
 
1201
- void FastCodeGenerator::EmitCallWithStub(Call* expr) {
1321
+ void FullCodeGenerator::EmitCallWithStub(Call* expr) {
1202
1322
  // Code common for calls using the call stub.
1203
1323
  ZoneList<Expression*>* args = expr->arguments();
1204
1324
  int arg_count = args->length();
@@ -1207,15 +1327,15 @@ void FastCodeGenerator::EmitCallWithStub(Call* expr) {
1207
1327
  }
1208
1328
  // Record source position for debugger.
1209
1329
  SetSourcePosition(expr->position());
1210
- CallFunctionStub stub(arg_count, NOT_IN_LOOP);
1330
+ CallFunctionStub stub(arg_count, NOT_IN_LOOP, RECEIVER_MIGHT_BE_VALUE);
1211
1331
  __ CallStub(&stub);
1212
1332
  // Restore context register.
1213
1333
  __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
1214
- DropAndApply(1, expr->context(), eax);
1334
+ DropAndApply(1, context_, eax);
1215
1335
  }
1216
1336
 
1217
1337
 
1218
- void FastCodeGenerator::VisitCall(Call* expr) {
1338
+ void FullCodeGenerator::VisitCall(Call* expr) {
1219
1339
  Comment cmnt(masm_, "[ Call");
1220
1340
  Expression* fun = expr->expression();
1221
1341
  Variable* var = fun->AsVariableProxy()->AsVariable();
@@ -1243,25 +1363,31 @@ void FastCodeGenerator::VisitCall(Call* expr) {
1243
1363
  // Call to a keyed property, use keyed load IC followed by function
1244
1364
  // call.
1245
1365
  VisitForValue(prop->obj(), kStack);
1246
- VisitForValue(prop->key(), kStack);
1366
+ VisitForValue(prop->key(), kAccumulator);
1247
1367
  // Record source code position for IC call.
1248
1368
  SetSourcePosition(prop->position());
1369
+ if (prop->is_synthetic()) {
1370
+ __ pop(edx); // We do not need to keep the receiver.
1371
+ } else {
1372
+ __ mov(edx, Operand(esp, 0)); // Keep receiver, to call function on.
1373
+ }
1374
+
1249
1375
  Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
1250
1376
  __ call(ic, RelocInfo::CODE_TARGET);
1251
1377
  // By emitting a nop we make sure that we do not have a "test eax,..."
1252
1378
  // instruction after the call it is treated specially by the LoadIC code.
1253
1379
  __ nop();
1254
- // Drop key left on the stack by IC.
1255
- __ Drop(1);
1256
- // Pop receiver.
1257
- __ pop(ebx);
1258
- // Push result (function).
1259
- __ push(eax);
1260
- // Push receiver object on stack.
1261
1380
  if (prop->is_synthetic()) {
1381
+ // Push result (function).
1382
+ __ push(eax);
1383
+ // Push Global receiver.
1262
1384
  __ mov(ecx, CodeGenerator::GlobalObject());
1263
1385
  __ push(FieldOperand(ecx, GlobalObject::kGlobalReceiverOffset));
1264
1386
  } else {
1387
+ // Pop receiver.
1388
+ __ pop(ebx);
1389
+ // Push result (function).
1390
+ __ push(eax);
1265
1391
  __ push(ebx);
1266
1392
  }
1267
1393
  EmitCallWithStub(expr);
@@ -1269,12 +1395,12 @@ void FastCodeGenerator::VisitCall(Call* expr) {
1269
1395
  } else {
1270
1396
  // Call to some other expression. If the expression is an anonymous
1271
1397
  // function literal not called in a loop, mark it as one that should
1272
- // also use the fast code generator.
1398
+ // also use the full code generator.
1273
1399
  FunctionLiteral* lit = fun->AsFunctionLiteral();
1274
1400
  if (lit != NULL &&
1275
1401
  lit->name()->Equals(Heap::empty_string()) &&
1276
1402
  loop_depth() == 0) {
1277
- lit->set_try_fast_codegen(true);
1403
+ lit->set_try_full_codegen(true);
1278
1404
  }
1279
1405
  VisitForValue(fun, kStack);
1280
1406
  // Load global receiver object.
@@ -1286,7 +1412,7 @@ void FastCodeGenerator::VisitCall(Call* expr) {
1286
1412
  }
1287
1413
 
1288
1414
 
1289
- void FastCodeGenerator::VisitCallNew(CallNew* expr) {
1415
+ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
1290
1416
  Comment cmnt(masm_, "[ CallNew");
1291
1417
  // According to ECMA-262, section 11.2.2, page 44, the function
1292
1418
  // expression in new calls must be evaluated before the
@@ -1317,11 +1443,11 @@ void FastCodeGenerator::VisitCallNew(CallNew* expr) {
1317
1443
  __ call(construct_builtin, RelocInfo::CONSTRUCT_CALL);
1318
1444
 
1319
1445
  // Replace function on TOS with result in eax, or pop it.
1320
- DropAndApply(1, expr->context(), eax);
1446
+ DropAndApply(1, context_, eax);
1321
1447
  }
1322
1448
 
1323
1449
 
1324
- void FastCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
1450
+ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
1325
1451
  Comment cmnt(masm_, "[ CallRuntime");
1326
1452
  ZoneList<Expression*>* args = expr->arguments();
1327
1453
 
@@ -1349,17 +1475,16 @@ void FastCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
1349
1475
  // Call the C runtime function.
1350
1476
  __ CallRuntime(expr->function(), arg_count);
1351
1477
  }
1352
- Apply(expr->context(), eax);
1478
+ Apply(context_, eax);
1353
1479
  }
1354
1480
 
1355
1481
 
1356
- void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
1482
+ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
1357
1483
  switch (expr->op()) {
1358
1484
  case Token::VOID: {
1359
1485
  Comment cmnt(masm_, "[ UnaryOperation (VOID)");
1360
- ASSERT_EQ(Expression::kEffect, expr->expression()->context());
1361
- Visit(expr->expression());
1362
- switch (expr->context()) {
1486
+ VisitForEffect(expr->expression());
1487
+ switch (context_) {
1363
1488
  case Expression::kUninitialized:
1364
1489
  UNREACHABLE();
1365
1490
  break;
@@ -1396,14 +1521,12 @@ void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
1396
1521
 
1397
1522
  case Token::NOT: {
1398
1523
  Comment cmnt(masm_, "[ UnaryOperation (NOT)");
1399
- ASSERT_EQ(Expression::kTest, expr->expression()->context());
1400
-
1401
1524
  Label materialize_true, materialize_false, done;
1402
1525
  // Initially assume a pure test context. Notice that the labels are
1403
1526
  // swapped.
1404
1527
  Label* if_true = false_label_;
1405
1528
  Label* if_false = true_label_;
1406
- switch (expr->context()) {
1529
+ switch (context_) {
1407
1530
  case Expression::kUninitialized:
1408
1531
  UNREACHABLE();
1409
1532
  break;
@@ -1425,26 +1548,24 @@ void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
1425
1548
  break;
1426
1549
  }
1427
1550
  VisitForControl(expr->expression(), if_true, if_false);
1428
- Apply(expr->context(), if_false, if_true); // Labels swapped.
1551
+ Apply(context_, if_false, if_true); // Labels swapped.
1429
1552
  break;
1430
1553
  }
1431
1554
 
1432
1555
  case Token::TYPEOF: {
1433
1556
  Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)");
1434
- ASSERT_EQ(Expression::kValue, expr->expression()->context());
1435
-
1436
1557
  VariableProxy* proxy = expr->expression()->AsVariableProxy();
1437
1558
  if (proxy != NULL &&
1438
1559
  !proxy->var()->is_this() &&
1439
1560
  proxy->var()->is_global()) {
1440
1561
  Comment cmnt(masm_, "Global variable");
1441
- __ push(CodeGenerator::GlobalObject());
1562
+ __ mov(eax, CodeGenerator::GlobalObject());
1442
1563
  __ mov(ecx, Immediate(proxy->name()));
1443
1564
  Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
1444
1565
  // Use a regular load, not a contextual load, to avoid a reference
1445
1566
  // error.
1446
1567
  __ call(ic, RelocInfo::CODE_TARGET);
1447
- __ mov(Operand(esp, 0), eax);
1568
+ __ push(eax);
1448
1569
  } else if (proxy != NULL &&
1449
1570
  proxy->var()->slot() != NULL &&
1450
1571
  proxy->var()->slot()->type() == Slot::LOOKUP) {
@@ -1458,7 +1579,59 @@ void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
1458
1579
  }
1459
1580
 
1460
1581
  __ CallRuntime(Runtime::kTypeof, 1);
1461
- Apply(expr->context(), eax);
1582
+ Apply(context_, eax);
1583
+ break;
1584
+ }
1585
+
1586
+ case Token::ADD: {
1587
+ Comment cmt(masm_, "[ UnaryOperation (ADD)");
1588
+ VisitForValue(expr->expression(), kAccumulator);
1589
+ Label no_conversion;
1590
+ __ test(result_register(), Immediate(kSmiTagMask));
1591
+ __ j(zero, &no_conversion);
1592
+ __ push(result_register());
1593
+ __ InvokeBuiltin(Builtins::TO_NUMBER, CALL_FUNCTION);
1594
+ __ bind(&no_conversion);
1595
+ Apply(context_, result_register());
1596
+ break;
1597
+ }
1598
+
1599
+ case Token::SUB: {
1600
+ Comment cmt(masm_, "[ UnaryOperation (SUB)");
1601
+ bool overwrite =
1602
+ (expr->expression()->AsBinaryOperation() != NULL &&
1603
+ expr->expression()->AsBinaryOperation()->ResultOverwriteAllowed());
1604
+ GenericUnaryOpStub stub(Token::SUB, overwrite);
1605
+ // GenericUnaryOpStub expects the argument to be in the
1606
+ // accumulator register eax.
1607
+ VisitForValue(expr->expression(), kAccumulator);
1608
+ __ CallStub(&stub);
1609
+ Apply(context_, eax);
1610
+ break;
1611
+ }
1612
+
1613
+ case Token::BIT_NOT: {
1614
+ Comment cmt(masm_, "[ UnaryOperation (BIT_NOT)");
1615
+ bool overwrite =
1616
+ (expr->expression()->AsBinaryOperation() != NULL &&
1617
+ expr->expression()->AsBinaryOperation()->ResultOverwriteAllowed());
1618
+ GenericUnaryOpStub stub(Token::BIT_NOT, overwrite);
1619
+ // GenericUnaryOpStub expects the argument to be in the
1620
+ // accumulator register eax.
1621
+ VisitForValue(expr->expression(), kAccumulator);
1622
+ // Avoid calling the stub for Smis.
1623
+ Label smi, done;
1624
+ __ test(result_register(), Immediate(kSmiTagMask));
1625
+ __ j(zero, &smi);
1626
+ // Non-smi: call stub leaving result in accumulator register.
1627
+ __ CallStub(&stub);
1628
+ __ jmp(&done);
1629
+ // Perform operation directly on Smis.
1630
+ __ bind(&smi);
1631
+ __ not_(result_register());
1632
+ __ and_(result_register(), ~kSmiTagMask); // Remove inverted smi-tag.
1633
+ __ bind(&done);
1634
+ Apply(context_, result_register());
1462
1635
  break;
1463
1636
  }
1464
1637
 
@@ -1468,7 +1641,7 @@ void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
1468
1641
  }
1469
1642
 
1470
1643
 
1471
- void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
1644
+ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
1472
1645
  Comment cmnt(masm_, "[ CountOperation");
1473
1646
 
1474
1647
  // Expression can only be a property, a global or a (parameter or local)
@@ -1479,41 +1652,48 @@ void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
1479
1652
  // In case of a property we use the uninitialized expression context
1480
1653
  // of the key to detect a named property.
1481
1654
  if (prop != NULL) {
1482
- assign_type = (prop->key()->context() == Expression::kUninitialized)
1483
- ? NAMED_PROPERTY
1484
- : KEYED_PROPERTY;
1655
+ assign_type =
1656
+ (prop->key()->IsPropertyName()) ? NAMED_PROPERTY : KEYED_PROPERTY;
1485
1657
  }
1486
1658
 
1487
1659
  // Evaluate expression and get value.
1488
1660
  if (assign_type == VARIABLE) {
1489
1661
  ASSERT(expr->expression()->AsVariableProxy()->var() != NULL);
1490
1662
  Location saved_location = location_;
1491
- location_ = kStack;
1663
+ location_ = kAccumulator;
1492
1664
  EmitVariableLoad(expr->expression()->AsVariableProxy()->var(),
1493
1665
  Expression::kValue);
1494
1666
  location_ = saved_location;
1495
1667
  } else {
1496
1668
  // Reserve space for result of postfix operation.
1497
- if (expr->is_postfix() && expr->context() != Expression::kEffect) {
1498
- ASSERT(expr->context() != Expression::kUninitialized);
1669
+ if (expr->is_postfix() && context_ != Expression::kEffect) {
1499
1670
  __ push(Immediate(Smi::FromInt(0)));
1500
1671
  }
1501
- VisitForValue(prop->obj(), kStack);
1502
1672
  if (assign_type == NAMED_PROPERTY) {
1673
+ // Put the object both on the stack and in the accumulator.
1674
+ VisitForValue(prop->obj(), kAccumulator);
1675
+ __ push(eax);
1503
1676
  EmitNamedPropertyLoad(prop);
1504
1677
  } else {
1505
- VisitForValue(prop->key(), kStack);
1678
+ VisitForValue(prop->obj(), kStack);
1679
+ VisitForValue(prop->key(), kAccumulator);
1680
+ __ mov(edx, Operand(esp, 0));
1681
+ __ push(eax);
1506
1682
  EmitKeyedPropertyLoad(prop);
1507
1683
  }
1508
- __ push(eax);
1509
1684
  }
1510
1685
 
1511
- // Convert to number.
1686
+ // Call ToNumber only if operand is not a smi.
1687
+ Label no_conversion;
1688
+ __ test(eax, Immediate(kSmiTagMask));
1689
+ __ j(zero, &no_conversion);
1690
+ __ push(eax);
1512
1691
  __ InvokeBuiltin(Builtins::TO_NUMBER, CALL_FUNCTION);
1692
+ __ bind(&no_conversion);
1513
1693
 
1514
1694
  // Save result for postfix expressions.
1515
1695
  if (expr->is_postfix()) {
1516
- switch (expr->context()) {
1696
+ switch (context_) {
1517
1697
  case Expression::kUninitialized:
1518
1698
  UNREACHABLE();
1519
1699
  case Expression::kEffect:
@@ -1541,13 +1721,34 @@ void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
1541
1721
  }
1542
1722
  }
1543
1723
 
1724
+ // Inline smi case if we are in a loop.
1725
+ Label stub_call, done;
1726
+ if (loop_depth() > 0) {
1727
+ if (expr->op() == Token::INC) {
1728
+ __ add(Operand(eax), Immediate(Smi::FromInt(1)));
1729
+ } else {
1730
+ __ sub(Operand(eax), Immediate(Smi::FromInt(1)));
1731
+ }
1732
+ __ j(overflow, &stub_call);
1733
+ // We could eliminate this smi check if we split the code at
1734
+ // the first smi check before calling ToNumber.
1735
+ __ test(eax, Immediate(kSmiTagMask));
1736
+ __ j(zero, &done);
1737
+ __ bind(&stub_call);
1738
+ // Call stub. Undo operation first.
1739
+ if (expr->op() == Token::INC) {
1740
+ __ sub(Operand(eax), Immediate(Smi::FromInt(1)));
1741
+ } else {
1742
+ __ add(Operand(eax), Immediate(Smi::FromInt(1)));
1743
+ }
1744
+ }
1544
1745
  // Call stub for +1/-1.
1545
- __ push(eax);
1546
- __ push(Immediate(Smi::FromInt(1)));
1547
1746
  GenericBinaryOpStub stub(expr->binary_op(),
1548
1747
  NO_OVERWRITE,
1549
- NO_GENERIC_BINARY_FLAGS);
1550
- __ CallStub(&stub);
1748
+ NO_GENERIC_BINARY_FLAGS,
1749
+ TypeInfo::Unknown());
1750
+ stub.GenerateCall(masm(), eax, Smi::FromInt(1));
1751
+ __ bind(&done);
1551
1752
 
1552
1753
  // Store the value returned in eax.
1553
1754
  switch (assign_type) {
@@ -1557,44 +1758,46 @@ void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
1557
1758
  Expression::kEffect);
1558
1759
  // For all contexts except kEffect: We have the result on
1559
1760
  // top of the stack.
1560
- if (expr->context() != Expression::kEffect) {
1561
- ApplyTOS(expr->context());
1761
+ if (context_ != Expression::kEffect) {
1762
+ ApplyTOS(context_);
1562
1763
  }
1563
1764
  } else {
1564
1765
  EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
1565
- expr->context());
1766
+ context_);
1566
1767
  }
1567
1768
  break;
1568
1769
  case NAMED_PROPERTY: {
1569
1770
  __ mov(ecx, prop->key()->AsLiteral()->handle());
1771
+ __ pop(edx);
1570
1772
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
1571
1773
  __ call(ic, RelocInfo::CODE_TARGET);
1572
1774
  // This nop signals to the IC that there is no inlined code at the call
1573
1775
  // site for it to patch.
1574
1776
  __ nop();
1575
1777
  if (expr->is_postfix()) {
1576
- __ Drop(1); // Result is on the stack under the receiver.
1577
- if (expr->context() != Expression::kEffect) {
1578
- ApplyTOS(expr->context());
1778
+ if (context_ != Expression::kEffect) {
1779
+ ApplyTOS(context_);
1579
1780
  }
1580
1781
  } else {
1581
- DropAndApply(1, expr->context(), eax);
1782
+ Apply(context_, eax);
1582
1783
  }
1583
1784
  break;
1584
1785
  }
1585
1786
  case KEYED_PROPERTY: {
1787
+ __ pop(ecx);
1788
+ __ pop(edx);
1586
1789
  Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
1587
1790
  __ call(ic, RelocInfo::CODE_TARGET);
1588
1791
  // This nop signals to the IC that there is no inlined code at the call
1589
1792
  // site for it to patch.
1590
1793
  __ nop();
1591
1794
  if (expr->is_postfix()) {
1592
- __ Drop(2); // Result is on the stack under the key and the receiver.
1593
- if (expr->context() != Expression::kEffect) {
1594
- ApplyTOS(expr->context());
1795
+ // Result is on the stack
1796
+ if (context_ != Expression::kEffect) {
1797
+ ApplyTOS(context_);
1595
1798
  }
1596
1799
  } else {
1597
- DropAndApply(2, expr->context(), eax);
1800
+ Apply(context_, eax);
1598
1801
  }
1599
1802
  break;
1600
1803
  }
@@ -1602,13 +1805,11 @@ void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
1602
1805
  }
1603
1806
 
1604
1807
 
1605
- void FastCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
1808
+ void FullCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
1606
1809
  Comment cmnt(masm_, "[ BinaryOperation");
1607
1810
  switch (expr->op()) {
1608
1811
  case Token::COMMA:
1609
- ASSERT_EQ(Expression::kEffect, expr->left()->context());
1610
- ASSERT_EQ(expr->context(), expr->right()->context());
1611
- Visit(expr->left());
1812
+ VisitForEffect(expr->left());
1612
1813
  Visit(expr->right());
1613
1814
  break;
1614
1815
 
@@ -1630,7 +1831,7 @@ void FastCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
1630
1831
  case Token::SAR:
1631
1832
  VisitForValue(expr->left(), kStack);
1632
1833
  VisitForValue(expr->right(), kAccumulator);
1633
- EmitBinaryOp(expr->op(), expr->context());
1834
+ EmitBinaryOp(expr->op(), context_);
1634
1835
  break;
1635
1836
 
1636
1837
  default:
@@ -1639,7 +1840,7 @@ void FastCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
1639
1840
  }
1640
1841
 
1641
1842
 
1642
- void FastCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
1843
+ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
1643
1844
  Comment cmnt(masm_, "[ CompareOperation");
1644
1845
 
1645
1846
  // Always perform the comparison for its control flow. Pack the result
@@ -1648,7 +1849,7 @@ void FastCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
1648
1849
  // Initially assume we are in a test context.
1649
1850
  Label* if_true = true_label_;
1650
1851
  Label* if_false = false_label_;
1651
- switch (expr->context()) {
1852
+ switch (context_) {
1652
1853
  case Expression::kUninitialized:
1653
1854
  UNREACHABLE();
1654
1855
  break;
@@ -1750,29 +1951,29 @@ void FastCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
1750
1951
 
1751
1952
  // Convert the result of the comparison into one expected for this
1752
1953
  // expression's context.
1753
- Apply(expr->context(), if_true, if_false);
1954
+ Apply(context_, if_true, if_false);
1754
1955
  }
1755
1956
 
1756
1957
 
1757
- void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) {
1958
+ void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) {
1758
1959
  __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
1759
- Apply(expr->context(), eax);
1960
+ Apply(context_, eax);
1760
1961
  }
1761
1962
 
1762
1963
 
1763
- Register FastCodeGenerator::result_register() { return eax; }
1964
+ Register FullCodeGenerator::result_register() { return eax; }
1764
1965
 
1765
1966
 
1766
- Register FastCodeGenerator::context_register() { return esi; }
1967
+ Register FullCodeGenerator::context_register() { return esi; }
1767
1968
 
1768
1969
 
1769
- void FastCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
1970
+ void FullCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
1770
1971
  ASSERT_EQ(POINTER_SIZE_ALIGN(frame_offset), frame_offset);
1771
1972
  __ mov(Operand(ebp, frame_offset), value);
1772
1973
  }
1773
1974
 
1774
1975
 
1775
- void FastCodeGenerator::LoadContextField(Register dst, int context_index) {
1976
+ void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
1776
1977
  __ mov(dst, CodeGenerator::ContextOperand(esi, context_index));
1777
1978
  }
1778
1979
 
@@ -1780,7 +1981,7 @@ void FastCodeGenerator::LoadContextField(Register dst, int context_index) {
1780
1981
  // ----------------------------------------------------------------------------
1781
1982
  // Non-local control flow support.
1782
1983
 
1783
- void FastCodeGenerator::EnterFinallyBlock() {
1984
+ void FullCodeGenerator::EnterFinallyBlock() {
1784
1985
  // Cook return address on top of stack (smi encoded Code* delta)
1785
1986
  ASSERT(!result_register().is(edx));
1786
1987
  __ mov(edx, Operand(esp, 0));
@@ -1794,7 +1995,7 @@ void FastCodeGenerator::EnterFinallyBlock() {
1794
1995
  }
1795
1996
 
1796
1997
 
1797
- void FastCodeGenerator::ExitFinallyBlock() {
1998
+ void FullCodeGenerator::ExitFinallyBlock() {
1798
1999
  ASSERT(!result_register().is(edx));
1799
2000
  // Restore result register from stack.
1800
2001
  __ pop(result_register());