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
@@ -1,4 +1,4 @@
1
- // Copyright 2009 the V8 project authors. All rights reserved.
1
+ // Copyright 2010 the V8 project authors. All rights reserved.
2
2
  // Redistribution and use in source and binary forms, with or without
3
3
  // modification, are permitted provided that the following conditions are
4
4
  // met:
@@ -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,87 +52,98 @@ namespace internal {
51
52
  //
52
53
  // The function builds a JS frame. Please see JavaScriptFrameConstants in
53
54
  // frames-x64.h for its layout.
54
- void FastCodeGenerator::Generate(FunctionLiteral* fun) {
55
- function_ = fun;
56
- SetFunctionPosition(fun);
57
-
58
- __ push(rbp); // Caller's frame pointer.
59
- __ movq(rbp, rsp);
60
- __ push(rsi); // Callee's context.
61
- __ push(rdi); // Callee's JS Function.
62
-
63
- { Comment cmnt(masm_, "[ Allocate locals");
64
- int locals_count = fun->scope()->num_stack_slots();
65
- if (locals_count == 1) {
66
- __ PushRoot(Heap::kUndefinedValueRootIndex);
67
- } else if (locals_count > 1) {
68
- __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
69
- for (int i = 0; i < locals_count; i++) {
70
- __ push(rdx);
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(rbp); // Caller's frame pointer.
63
+ __ movq(rbp, rsp);
64
+ __ push(rsi); // Callee's context.
65
+ __ push(rdi); // 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
+ __ PushRoot(Heap::kUndefinedValueRootIndex);
71
+ } else if (locals_count > 1) {
72
+ __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
73
+ for (int i = 0; i < locals_count; i++) {
74
+ __ push(rdx);
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 rdi.
81
- __ push(rdi);
82
- __ CallRuntime(Runtime::kNewContext, 1);
83
- function_in_register = false;
84
- // Context is returned in both rax and rsi. It replaces the context
85
- // passed to us. It's saved in the stack and kept live in rsi.
86
- __ movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi);
87
-
88
- // Copy any necessary parameters into the context.
89
- int num_parameters = fun->scope()->num_parameters();
90
- for (int i = 0; i < num_parameters; i++) {
91
- Slot* slot = fun->scope()->parameter(i)->slot();
92
- if (slot != NULL && slot->type() == Slot::CONTEXT) {
93
- int parameter_offset = StandardFrameConstants::kCallerSPOffset +
94
- (num_parameters - 1 - i) * kPointerSize;
95
- // Load parameter from stack.
96
- __ movq(rax, Operand(rbp, parameter_offset));
97
- // Store it in the context
98
- __ movq(Operand(rsi, Context::SlotOffset(slot->index())), rax);
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 rdi.
85
+ __ push(rdi);
86
+ __ CallRuntime(Runtime::kNewContext, 1);
87
+ function_in_register = false;
88
+ // Context is returned in both rax and rsi. It replaces the context
89
+ // passed to us. It's saved in the stack and kept live in rsi.
90
+ __ movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi);
91
+
92
+ // Copy any necessary parameters into the context.
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
+ __ movq(rax, Operand(rbp, parameter_offset));
101
+ // Store it in the context.
102
+ int context_offset = Context::SlotOffset(slot->index());
103
+ __ movq(Operand(rsi, context_offset), rax);
104
+ // Update the write barrier. This clobbers all involved
105
+ // registers, so we have use a third register to avoid
106
+ // clobbering rsi.
107
+ __ movq(rcx, rsi);
108
+ __ RecordWrite(rcx, context_offset, rax, rbx);
109
+ }
99
110
  }
100
111
  }
101
- }
102
112
 
103
- // Possibly allocate an arguments object.
104
- Variable* arguments = fun->scope()->arguments()->AsVariable();
105
- if (arguments != NULL) {
106
- // Arguments object must be allocated after the context object, in
107
- // case the "arguments" or ".arguments" variables are in the context.
108
- Comment cmnt(masm_, "[ Allocate arguments object");
109
- if (function_in_register) {
110
- __ push(rdi);
111
- } else {
112
- __ push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
113
+ // Possibly allocate an arguments object.
114
+ Variable* arguments = scope()->arguments()->AsVariable();
115
+ if (arguments != NULL) {
116
+ // Arguments object must be allocated after the context object, in
117
+ // case the "arguments" or ".arguments" variables are in the context.
118
+ Comment cmnt(masm_, "[ Allocate arguments object");
119
+ if (function_in_register) {
120
+ __ push(rdi);
121
+ } else {
122
+ __ push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
123
+ }
124
+ // The receiver is just before the parameters on the caller's stack.
125
+ int offset = scope()->num_parameters() * kPointerSize;
126
+ __ lea(rdx,
127
+ Operand(rbp, StandardFrameConstants::kCallerSPOffset + offset));
128
+ __ push(rdx);
129
+ __ Push(Smi::FromInt(scope()->num_parameters()));
130
+ // Arguments to ArgumentsAccessStub:
131
+ // function, receiver address, parameter count.
132
+ // The stub will rewrite receiver and parameter count if the previous
133
+ // stack frame was an arguments adapter frame.
134
+ ArgumentsAccessStub stub(ArgumentsAccessStub::NEW_OBJECT);
135
+ __ CallStub(&stub);
136
+ // Store new arguments object in both "arguments" and ".arguments" slots.
137
+ __ movq(rcx, rax);
138
+ Move(arguments->slot(), rax, rbx, rdx);
139
+ Slot* dot_arguments_slot =
140
+ scope()->arguments_shadow()->AsVariable()->slot();
141
+ Move(dot_arguments_slot, rcx, rbx, rdx);
113
142
  }
114
- // The receiver is just before the parameters on the caller's stack.
115
- __ lea(rdx, Operand(rbp, StandardFrameConstants::kCallerSPOffset +
116
- fun->num_parameters() * kPointerSize));
117
- __ push(rdx);
118
- __ Push(Smi::FromInt(fun->num_parameters()));
119
- // Arguments to ArgumentsAccessStub:
120
- // function, receiver address, parameter count.
121
- // The stub will rewrite receiver and parameter count if the previous
122
- // stack frame was an arguments adapter frame.
123
- ArgumentsAccessStub stub(ArgumentsAccessStub::NEW_OBJECT);
124
- __ CallStub(&stub);
125
- // Store new arguments object in both "arguments" and ".arguments" slots.
126
- __ movq(rcx, rax);
127
- Move(arguments->slot(), rax, rbx, rdx);
128
- Slot* dot_arguments_slot =
129
- fun->scope()->arguments_shadow()->AsVariable()->slot();
130
- Move(dot_arguments_slot, rcx, rbx, rdx);
131
143
  }
132
144
 
133
145
  { Comment cmnt(masm_, "[ Declarations");
134
- VisitDeclarations(fun->scope()->declarations());
146
+ VisitDeclarations(scope()->declarations());
135
147
  }
136
148
 
137
149
  { Comment cmnt(masm_, "[ Stack check");
@@ -149,19 +161,19 @@ void FastCodeGenerator::Generate(FunctionLiteral* fun) {
149
161
 
150
162
  { Comment cmnt(masm_, "[ Body");
151
163
  ASSERT(loop_depth() == 0);
152
- VisitStatements(fun->body());
164
+ VisitStatements(function()->body());
153
165
  ASSERT(loop_depth() == 0);
154
166
  }
155
167
 
156
168
  { Comment cmnt(masm_, "[ return <undefined>;");
157
169
  // Emit a 'return undefined' in case control fell off the end of the body.
158
170
  __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
159
- EmitReturnSequence(function_->end_position());
171
+ EmitReturnSequence(function()->end_position());
160
172
  }
161
173
  }
162
174
 
163
175
 
164
- void FastCodeGenerator::EmitReturnSequence(int position) {
176
+ void FullCodeGenerator::EmitReturnSequence(int position) {
165
177
  Comment cmnt(masm_, "[ Return sequence");
166
178
  if (return_label_.is_bound()) {
167
179
  __ jmp(&return_label_);
@@ -182,7 +194,7 @@ void FastCodeGenerator::EmitReturnSequence(int position) {
182
194
  // patch with the code required by the debugger.
183
195
  __ movq(rsp, rbp);
184
196
  __ pop(rbp);
185
- __ ret((function_->scope()->num_parameters() + 1) * kPointerSize);
197
+ __ ret((scope()->num_parameters() + 1) * kPointerSize);
186
198
  #ifdef ENABLE_DEBUGGER_SUPPORT
187
199
  // Add padding that will be overwritten by a debugger breakpoint. We
188
200
  // have just generated "movq rsp, rbp; pop rbp; ret k" with length 7
@@ -200,7 +212,7 @@ void FastCodeGenerator::EmitReturnSequence(int position) {
200
212
  }
201
213
 
202
214
 
203
- void FastCodeGenerator::Apply(Expression::Context context, Register reg) {
215
+ void FullCodeGenerator::Apply(Expression::Context context, Register reg) {
204
216
  switch (context) {
205
217
  case Expression::kUninitialized:
206
218
  UNREACHABLE();
@@ -243,7 +255,7 @@ void FastCodeGenerator::Apply(Expression::Context context, Register reg) {
243
255
  }
244
256
 
245
257
 
246
- void FastCodeGenerator::Apply(Expression::Context context, Slot* slot) {
258
+ void FullCodeGenerator::Apply(Expression::Context context, Slot* slot) {
247
259
  switch (context) {
248
260
  case Expression::kUninitialized:
249
261
  UNREACHABLE();
@@ -285,7 +297,7 @@ void FastCodeGenerator::Apply(Expression::Context context, Slot* slot) {
285
297
  }
286
298
 
287
299
 
288
- void FastCodeGenerator::Apply(Expression::Context context, Literal* lit) {
300
+ void FullCodeGenerator::Apply(Expression::Context context, Literal* lit) {
289
301
  switch (context) {
290
302
  case Expression::kUninitialized:
291
303
  UNREACHABLE();
@@ -324,7 +336,7 @@ void FastCodeGenerator::Apply(Expression::Context context, Literal* lit) {
324
336
  }
325
337
 
326
338
 
327
- void FastCodeGenerator::ApplyTOS(Expression::Context context) {
339
+ void FullCodeGenerator::ApplyTOS(Expression::Context context) {
328
340
  switch (context) {
329
341
  case Expression::kUninitialized:
330
342
  UNREACHABLE();
@@ -364,7 +376,7 @@ void FastCodeGenerator::ApplyTOS(Expression::Context context) {
364
376
  }
365
377
 
366
378
 
367
- void FastCodeGenerator::DropAndApply(int count,
379
+ void FullCodeGenerator::DropAndApply(int count,
368
380
  Expression::Context context,
369
381
  Register reg) {
370
382
  ASSERT(count > 0);
@@ -415,7 +427,7 @@ void FastCodeGenerator::DropAndApply(int count,
415
427
  }
416
428
 
417
429
 
418
- void FastCodeGenerator::Apply(Expression::Context context,
430
+ void FullCodeGenerator::Apply(Expression::Context context,
419
431
  Label* materialize_true,
420
432
  Label* materialize_false) {
421
433
  switch (context) {
@@ -480,7 +492,7 @@ void FastCodeGenerator::Apply(Expression::Context context,
480
492
  }
481
493
 
482
494
 
483
- void FastCodeGenerator::DoTest(Expression::Context context) {
495
+ void FullCodeGenerator::DoTest(Expression::Context context) {
484
496
  // The value to test is in the accumulator. If the value might be needed
485
497
  // on the stack (value/test and test/value contexts with a stack location
486
498
  // desired), then the value is already duplicated on the stack.
@@ -614,14 +626,14 @@ void FastCodeGenerator::DoTest(Expression::Context context) {
614
626
  }
615
627
 
616
628
 
617
- MemOperand FastCodeGenerator::EmitSlotSearch(Slot* slot, Register scratch) {
629
+ MemOperand FullCodeGenerator::EmitSlotSearch(Slot* slot, Register scratch) {
618
630
  switch (slot->type()) {
619
631
  case Slot::PARAMETER:
620
632
  case Slot::LOCAL:
621
633
  return Operand(rbp, SlotOffset(slot));
622
634
  case Slot::CONTEXT: {
623
635
  int context_chain_length =
624
- function_->scope()->ContextChainLength(slot->var()->scope());
636
+ scope()->ContextChainLength(slot->var()->scope());
625
637
  __ LoadContext(scratch, context_chain_length);
626
638
  return CodeGenerator::ContextOperand(scratch, slot->index());
627
639
  }
@@ -633,13 +645,13 @@ MemOperand FastCodeGenerator::EmitSlotSearch(Slot* slot, Register scratch) {
633
645
  }
634
646
 
635
647
 
636
- void FastCodeGenerator::Move(Register destination, Slot* source) {
648
+ void FullCodeGenerator::Move(Register destination, Slot* source) {
637
649
  MemOperand location = EmitSlotSearch(source, destination);
638
650
  __ movq(destination, location);
639
651
  }
640
652
 
641
653
 
642
- void FastCodeGenerator::Move(Slot* dst,
654
+ void FullCodeGenerator::Move(Slot* dst,
643
655
  Register src,
644
656
  Register scratch1,
645
657
  Register scratch2) {
@@ -655,7 +667,7 @@ void FastCodeGenerator::Move(Slot* dst,
655
667
  }
656
668
 
657
669
 
658
- void FastCodeGenerator::VisitDeclaration(Declaration* decl) {
670
+ void FullCodeGenerator::VisitDeclaration(Declaration* decl) {
659
671
  Comment cmnt(masm_, "[ Declaration");
660
672
  Variable* var = decl->proxy()->var();
661
673
  ASSERT(var != NULL); // Must have been resolved.
@@ -680,7 +692,7 @@ void FastCodeGenerator::VisitDeclaration(Declaration* decl) {
680
692
  // this specific context.
681
693
 
682
694
  // The variable in the decl always resides in the current context.
683
- ASSERT_EQ(0, function_->scope()->ContextChainLength(var->scope()));
695
+ ASSERT_EQ(0, scope()->ContextChainLength(var->scope()));
684
696
  if (FLAG_debug_code) {
685
697
  // Check if we have the correct context pointer.
686
698
  __ movq(rbx,
@@ -698,7 +710,8 @@ void FastCodeGenerator::VisitDeclaration(Declaration* decl) {
698
710
  __ movq(CodeGenerator::ContextOperand(rsi, slot->index()),
699
711
  result_register());
700
712
  int offset = Context::SlotOffset(slot->index());
701
- __ RecordWrite(rsi, offset, result_register(), rcx);
713
+ __ movq(rbx, rsi);
714
+ __ RecordWrite(rbx, offset, result_register(), rcx);
702
715
  }
703
716
  break;
704
717
 
@@ -754,45 +767,48 @@ void FastCodeGenerator::VisitDeclaration(Declaration* decl) {
754
767
  }
755
768
 
756
769
 
757
- void FastCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
770
+ void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
758
771
  // Call the runtime to declare the globals.
759
772
  __ push(rsi); // The context is the first argument.
760
773
  __ Push(pairs);
761
- __ Push(Smi::FromInt(is_eval_ ? 1 : 0));
774
+ __ Push(Smi::FromInt(is_eval() ? 1 : 0));
762
775
  __ CallRuntime(Runtime::kDeclareGlobals, 3);
763
776
  // Return value is ignored.
764
777
  }
765
778
 
766
779
 
767
- void FastCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
780
+ void FullCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
768
781
  Comment cmnt(masm_, "[ FunctionLiteral");
769
782
 
770
- // Build the function boilerplate and instantiate it.
771
- Handle<JSFunction> boilerplate =
772
- Compiler::BuildBoilerplate(expr, script_, this);
783
+ // Build the shared function info and instantiate the function based
784
+ // on it.
785
+ Handle<SharedFunctionInfo> function_info =
786
+ Compiler::BuildFunctionInfo(expr, script(), this);
773
787
  if (HasStackOverflow()) return;
774
788
 
775
- ASSERT(boilerplate->IsBoilerplate());
776
-
777
789
  // Create a new closure.
778
790
  __ push(rsi);
779
- __ Push(boilerplate);
791
+ __ Push(function_info);
780
792
  __ CallRuntime(Runtime::kNewClosure, 2);
781
- Apply(expr->context(), rax);
793
+ Apply(context_, rax);
782
794
  }
783
795
 
784
796
 
785
- void FastCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
797
+ void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
786
798
  Comment cmnt(masm_, "[ VariableProxy");
787
- EmitVariableLoad(expr->var(), expr->context());
799
+ EmitVariableLoad(expr->var(), context_);
788
800
  }
789
801
 
790
802
 
791
- void FastCodeGenerator::EmitVariableLoad(Variable* var,
803
+ void FullCodeGenerator::EmitVariableLoad(Variable* var,
792
804
  Expression::Context context) {
793
- Expression* rewrite = var->rewrite();
794
- if (rewrite == NULL) {
795
- ASSERT(var->is_global());
805
+ // Four cases: non-this global variables, lookup slots, all other
806
+ // types of slots, and parameters that rewrite to explicit property
807
+ // accesses on the arguments object.
808
+ Slot* slot = var->slot();
809
+ Property* property = var->AsProperty();
810
+
811
+ if (var->is_global() && !var->is_this()) {
796
812
  Comment cmnt(masm_, "Global variable");
797
813
  // Use inline caching. Variable name is passed in rcx and the global
798
814
  // object on the stack.
@@ -805,34 +821,24 @@ void FastCodeGenerator::EmitVariableLoad(Variable* var,
805
821
  // is no test rax instruction here.
806
822
  __ nop();
807
823
  DropAndApply(1, context, rax);
808
- } else if (rewrite->AsSlot() != NULL) {
809
- Slot* slot = rewrite->AsSlot();
810
- if (FLAG_debug_code) {
811
- switch (slot->type()) {
812
- case Slot::PARAMETER:
813
- case Slot::LOCAL: {
814
- Comment cmnt(masm_, "Stack slot");
815
- break;
816
- }
817
- case Slot::CONTEXT: {
818
- Comment cmnt(masm_, "Context slot");
819
- break;
820
- }
821
- case Slot::LOOKUP:
822
- UNIMPLEMENTED();
823
- break;
824
- }
825
- }
824
+
825
+ } else if (slot != NULL && slot->type() == Slot::LOOKUP) {
826
+ Comment cmnt(masm_, "Lookup slot");
827
+ __ push(rsi); // Context.
828
+ __ Push(var->name());
829
+ __ CallRuntime(Runtime::kLoadContextSlot, 2);
830
+ Apply(context, rax);
831
+
832
+ } else if (slot != NULL) {
833
+ Comment cmnt(masm_, (slot->type() == Slot::CONTEXT)
834
+ ? "Context slot"
835
+ : "Stack slot");
826
836
  Apply(context, slot);
837
+
827
838
  } else {
828
- Comment cmnt(masm_, "Variable rewritten to property");
829
- // A variable has been rewritten into an explicit access to an object
830
- // property.
831
- Property* property = rewrite->AsProperty();
839
+ Comment cmnt(masm_, "Rewritten parameter");
832
840
  ASSERT_NOT_NULL(property);
833
-
834
- // The only property expressions that can occur are of the form
835
- // "slot[literal]".
841
+ // Rewritten parameter accesses are of the form "slot[literal]".
836
842
 
837
843
  // Assert that the object is in a slot.
838
844
  Variable* object_var = property->obj()->AsVariableProxy()->AsVariable();
@@ -864,7 +870,7 @@ void FastCodeGenerator::EmitVariableLoad(Variable* var,
864
870
  }
865
871
 
866
872
 
867
- void FastCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
873
+ void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
868
874
  Comment cmnt(masm_, "[ RegExpLiteral");
869
875
  Label done;
870
876
  // Registers will be used as follows:
@@ -886,20 +892,21 @@ void FastCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
886
892
  __ Push(expr->flags());
887
893
  __ CallRuntime(Runtime::kMaterializeRegExpLiteral, 4);
888
894
  __ bind(&done);
889
- Apply(expr->context(), rax);
895
+ Apply(context_, rax);
890
896
  }
891
897
 
892
898
 
893
- void FastCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
899
+ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
894
900
  Comment cmnt(masm_, "[ ObjectLiteral");
895
901
  __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
896
902
  __ push(FieldOperand(rdi, JSFunction::kLiteralsOffset));
897
903
  __ Push(Smi::FromInt(expr->literal_index()));
898
904
  __ Push(expr->constant_properties());
905
+ __ Push(Smi::FromInt(expr->fast_elements() ? 1 : 0));
899
906
  if (expr->depth() > 1) {
900
- __ CallRuntime(Runtime::kCreateObjectLiteral, 3);
907
+ __ CallRuntime(Runtime::kCreateObjectLiteral, 4);
901
908
  } else {
902
- __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 3);
909
+ __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4);
903
910
  }
904
911
 
905
912
  // If result_saved is true the result is on top of the stack. If
@@ -926,10 +933,10 @@ void FastCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
926
933
  if (key->handle()->IsSymbol()) {
927
934
  VisitForValue(value, kAccumulator);
928
935
  __ Move(rcx, key->handle());
936
+ __ movq(rdx, Operand(rsp, 0));
929
937
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
930
938
  __ call(ic, RelocInfo::CODE_TARGET);
931
939
  __ nop();
932
- // StoreIC leaves the receiver on the stack.
933
940
  break;
934
941
  }
935
942
  // Fall through.
@@ -953,14 +960,14 @@ void FastCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
953
960
  }
954
961
 
955
962
  if (result_saved) {
956
- ApplyTOS(expr->context());
963
+ ApplyTOS(context_);
957
964
  } else {
958
- Apply(expr->context(), rax);
965
+ Apply(context_, rax);
959
966
  }
960
967
  }
961
968
 
962
969
 
963
- void FastCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
970
+ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
964
971
  Comment cmnt(masm_, "[ ArrayLiteral");
965
972
  __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
966
973
  __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset));
@@ -1003,14 +1010,100 @@ void FastCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
1003
1010
  }
1004
1011
 
1005
1012
  if (result_saved) {
1006
- ApplyTOS(expr->context());
1013
+ ApplyTOS(context_);
1007
1014
  } else {
1008
- Apply(expr->context(), rax);
1015
+ Apply(context_, rax);
1009
1016
  }
1010
1017
  }
1011
1018
 
1012
1019
 
1013
- void FastCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
1020
+ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
1021
+ Comment cmnt(masm_, "[ Assignment");
1022
+ ASSERT(expr->op() != Token::INIT_CONST);
1023
+ // Left-hand side can only be a property, a global or a (parameter or local)
1024
+ // slot. Variables with rewrite to .arguments are treated as KEYED_PROPERTY.
1025
+ enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY };
1026
+ LhsKind assign_type = VARIABLE;
1027
+ Property* prop = expr->target()->AsProperty();
1028
+ if (prop != NULL) {
1029
+ assign_type =
1030
+ (prop->key()->IsPropertyName()) ? NAMED_PROPERTY : KEYED_PROPERTY;
1031
+ }
1032
+
1033
+ // Evaluate LHS expression.
1034
+ switch (assign_type) {
1035
+ case VARIABLE:
1036
+ // Nothing to do here.
1037
+ break;
1038
+ case NAMED_PROPERTY:
1039
+ if (expr->is_compound()) {
1040
+ // We need the receiver both on the stack and in the accumulator.
1041
+ VisitForValue(prop->obj(), kAccumulator);
1042
+ __ push(result_register());
1043
+ } else {
1044
+ VisitForValue(prop->obj(), kStack);
1045
+ }
1046
+ break;
1047
+ case KEYED_PROPERTY:
1048
+ VisitForValue(prop->obj(), kStack);
1049
+ VisitForValue(prop->key(), kStack);
1050
+ break;
1051
+ }
1052
+
1053
+ // If we have a compound assignment: Get value of LHS expression and
1054
+ // store in on top of the stack.
1055
+ if (expr->is_compound()) {
1056
+ Location saved_location = location_;
1057
+ location_ = kStack;
1058
+ switch (assign_type) {
1059
+ case VARIABLE:
1060
+ EmitVariableLoad(expr->target()->AsVariableProxy()->var(),
1061
+ Expression::kValue);
1062
+ break;
1063
+ case NAMED_PROPERTY:
1064
+ EmitNamedPropertyLoad(prop);
1065
+ __ push(result_register());
1066
+ break;
1067
+ case KEYED_PROPERTY:
1068
+ EmitKeyedPropertyLoad(prop);
1069
+ __ push(result_register());
1070
+ break;
1071
+ }
1072
+ location_ = saved_location;
1073
+ }
1074
+
1075
+ // Evaluate RHS expression.
1076
+ Expression* rhs = expr->value();
1077
+ VisitForValue(rhs, kAccumulator);
1078
+
1079
+ // If we have a compound assignment: Apply operator.
1080
+ if (expr->is_compound()) {
1081
+ Location saved_location = location_;
1082
+ location_ = kAccumulator;
1083
+ EmitBinaryOp(expr->binary_op(), Expression::kValue);
1084
+ location_ = saved_location;
1085
+ }
1086
+
1087
+ // Record source position before possible IC call.
1088
+ SetSourcePosition(expr->position());
1089
+
1090
+ // Store the value.
1091
+ switch (assign_type) {
1092
+ case VARIABLE:
1093
+ EmitVariableAssignment(expr->target()->AsVariableProxy()->var(),
1094
+ context_);
1095
+ break;
1096
+ case NAMED_PROPERTY:
1097
+ EmitNamedPropertyAssignment(expr);
1098
+ break;
1099
+ case KEYED_PROPERTY:
1100
+ EmitKeyedPropertyAssignment(expr);
1101
+ break;
1102
+ }
1103
+ }
1104
+
1105
+
1106
+ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
1014
1107
  SetSourcePosition(prop->position());
1015
1108
  Literal* key = prop->key()->AsLiteral();
1016
1109
  __ Move(rcx, key->handle());
@@ -1020,7 +1113,7 @@ void FastCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
1020
1113
  }
1021
1114
 
1022
1115
 
1023
- void FastCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
1116
+ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
1024
1117
  SetSourcePosition(prop->position());
1025
1118
  Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
1026
1119
  __ Call(ic, RelocInfo::CODE_TARGET);
@@ -1028,7 +1121,7 @@ void FastCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
1028
1121
  }
1029
1122
 
1030
1123
 
1031
- void FastCodeGenerator::EmitBinaryOp(Token::Value op,
1124
+ void FullCodeGenerator::EmitBinaryOp(Token::Value op,
1032
1125
  Expression::Context context) {
1033
1126
  __ push(result_register());
1034
1127
  GenericBinaryOpStub stub(op,
@@ -1039,23 +1132,33 @@ void FastCodeGenerator::EmitBinaryOp(Token::Value op,
1039
1132
  }
1040
1133
 
1041
1134
 
1042
- void FastCodeGenerator::EmitVariableAssignment(Variable* var,
1135
+ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
1043
1136
  Expression::Context context) {
1137
+ // Three main cases: non-this global variables, lookup slots, and
1138
+ // all other types of slots. Left-hand-side parameters that rewrite
1139
+ // to explicit property accesses do not reach here.
1044
1140
  ASSERT(var != NULL);
1045
1141
  ASSERT(var->is_global() || var->slot() != NULL);
1142
+ Slot* slot = var->slot();
1046
1143
  if (var->is_global()) {
1144
+ ASSERT(!var->is_this());
1047
1145
  // Assignment to a global variable. Use inline caching for the
1048
1146
  // assignment. Right-hand-side value is passed in rax, variable name in
1049
- // rcx, and the global object on the stack.
1147
+ // rcx, and the global object in rdx.
1050
1148
  __ Move(rcx, var->name());
1051
- __ push(CodeGenerator::GlobalObject());
1149
+ __ movq(rdx, CodeGenerator::GlobalObject());
1052
1150
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
1053
1151
  __ Call(ic, RelocInfo::CODE_TARGET);
1054
- // Overwrite the global object on the stack with the result if needed.
1055
- DropAndApply(1, context, rax);
1152
+ Apply(context, rax);
1153
+
1154
+ } else if (slot != NULL && slot->type() == Slot::LOOKUP) {
1155
+ __ push(result_register()); // Value.
1156
+ __ push(rsi); // Context.
1157
+ __ Push(var->name());
1158
+ __ CallRuntime(Runtime::kStoreContextSlot, 3);
1159
+ Apply(context, rax);
1056
1160
 
1057
1161
  } else if (var->slot() != NULL) {
1058
- Slot* slot = var->slot();
1059
1162
  switch (slot->type()) {
1060
1163
  case Slot::LOCAL:
1061
1164
  case Slot::PARAMETER:
@@ -1078,6 +1181,7 @@ void FastCodeGenerator::EmitVariableAssignment(Variable* var,
1078
1181
  break;
1079
1182
  }
1080
1183
  Apply(context, result_register());
1184
+
1081
1185
  } else {
1082
1186
  // Variables rewritten as properties are not treated as variables in
1083
1187
  // assignments.
@@ -1086,7 +1190,7 @@ void FastCodeGenerator::EmitVariableAssignment(Variable* var,
1086
1190
  }
1087
1191
 
1088
1192
 
1089
- void FastCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
1193
+ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
1090
1194
  // Assignment to a property, using a named store IC.
1091
1195
  Property* prop = expr->target()->AsProperty();
1092
1196
  ASSERT(prop != NULL);
@@ -1105,6 +1209,11 @@ void FastCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
1105
1209
  // Record source code position before IC call.
1106
1210
  SetSourcePosition(expr->position());
1107
1211
  __ Move(rcx, prop->key()->AsLiteral()->handle());
1212
+ if (expr->ends_initialization_block()) {
1213
+ __ movq(rdx, Operand(rsp, 0));
1214
+ } else {
1215
+ __ pop(rdx);
1216
+ }
1108
1217
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
1109
1218
  __ Call(ic, RelocInfo::CODE_TARGET);
1110
1219
  __ nop();
@@ -1115,13 +1224,14 @@ void FastCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
1115
1224
  __ push(Operand(rsp, kPointerSize)); // Receiver is under value.
1116
1225
  __ CallRuntime(Runtime::kToFastProperties, 1);
1117
1226
  __ pop(rax);
1227
+ DropAndApply(1, context_, rax);
1228
+ } else {
1229
+ Apply(context_, rax);
1118
1230
  }
1119
-
1120
- DropAndApply(1, expr->context(), rax);
1121
1231
  }
1122
1232
 
1123
1233
 
1124
- void FastCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
1234
+ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
1125
1235
  // Assignment to a property, using a keyed store IC.
1126
1236
 
1127
1237
  // If the assignment starts a block of assignments to the same object,
@@ -1153,11 +1263,11 @@ void FastCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
1153
1263
  }
1154
1264
 
1155
1265
  // Receiver and key are still on stack.
1156
- DropAndApply(2, expr->context(), rax);
1266
+ DropAndApply(2, context_, rax);
1157
1267
  }
1158
1268
 
1159
1269
 
1160
- void FastCodeGenerator::VisitProperty(Property* expr) {
1270
+ void FullCodeGenerator::VisitProperty(Property* expr) {
1161
1271
  Comment cmnt(masm_, "[ Property");
1162
1272
  Expression* key = expr->key();
1163
1273
 
@@ -1167,18 +1277,18 @@ void FastCodeGenerator::VisitProperty(Property* expr) {
1167
1277
  if (key->IsPropertyName()) {
1168
1278
  EmitNamedPropertyLoad(expr);
1169
1279
  // Drop receiver left on the stack by IC.
1170
- DropAndApply(1, expr->context(), rax);
1280
+ DropAndApply(1, context_, rax);
1171
1281
  } else {
1172
1282
  VisitForValue(expr->key(), kStack);
1173
1283
  EmitKeyedPropertyLoad(expr);
1174
1284
  // Drop key and receiver left on the stack by IC.
1175
- DropAndApply(2, expr->context(), rax);
1285
+ DropAndApply(2, context_, rax);
1176
1286
  }
1177
1287
  }
1178
1288
 
1179
1289
 
1180
- void FastCodeGenerator::EmitCallWithIC(Call* expr,
1181
- Handle<Object> ignored,
1290
+ void FullCodeGenerator::EmitCallWithIC(Call* expr,
1291
+ Handle<Object> name,
1182
1292
  RelocInfo::Mode mode) {
1183
1293
  // Code common for calls using the IC.
1184
1294
  ZoneList<Expression*>* args = expr->arguments();
@@ -1186,6 +1296,7 @@ void FastCodeGenerator::EmitCallWithIC(Call* expr,
1186
1296
  for (int i = 0; i < arg_count; i++) {
1187
1297
  VisitForValue(args->at(i), kStack);
1188
1298
  }
1299
+ __ Move(rcx, name);
1189
1300
  // Record source position for debugger.
1190
1301
  SetSourcePosition(expr->position());
1191
1302
  // Call the IC initialization code.
@@ -1195,12 +1306,11 @@ void FastCodeGenerator::EmitCallWithIC(Call* expr,
1195
1306
  __ Call(ic, mode);
1196
1307
  // Restore context register.
1197
1308
  __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
1198
- // Discard the function left on TOS.
1199
- DropAndApply(1, expr->context(), rax);
1309
+ Apply(context_, rax);
1200
1310
  }
1201
1311
 
1202
1312
 
1203
- void FastCodeGenerator::EmitCallWithStub(Call* expr) {
1313
+ void FullCodeGenerator::EmitCallWithStub(Call* expr) {
1204
1314
  // Code common for calls using the call stub.
1205
1315
  ZoneList<Expression*>* args = expr->arguments();
1206
1316
  int arg_count = args->length();
@@ -1209,16 +1319,16 @@ void FastCodeGenerator::EmitCallWithStub(Call* expr) {
1209
1319
  }
1210
1320
  // Record source position for debugger.
1211
1321
  SetSourcePosition(expr->position());
1212
- CallFunctionStub stub(arg_count, NOT_IN_LOOP);
1322
+ CallFunctionStub stub(arg_count, NOT_IN_LOOP, RECEIVER_MIGHT_BE_VALUE);
1213
1323
  __ CallStub(&stub);
1214
1324
  // Restore context register.
1215
1325
  __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
1216
1326
  // Discard the function left on TOS.
1217
- DropAndApply(1, expr->context(), rax);
1327
+ DropAndApply(1, context_, rax);
1218
1328
  }
1219
1329
 
1220
1330
 
1221
- void FastCodeGenerator::VisitCall(Call* expr) {
1331
+ void FullCodeGenerator::VisitCall(Call* expr) {
1222
1332
  Comment cmnt(masm_, "[ Call");
1223
1333
  Expression* fun = expr->expression();
1224
1334
  Variable* var = fun->AsVariableProxy()->AsVariable();
@@ -1228,7 +1338,6 @@ void FastCodeGenerator::VisitCall(Call* expr) {
1228
1338
  UNREACHABLE();
1229
1339
  } else if (var != NULL && !var->is_this() && var->is_global()) {
1230
1340
  // Call to a global variable.
1231
- __ Push(var->name());
1232
1341
  // Push global object as receiver for the call IC lookup.
1233
1342
  __ push(CodeGenerator::GlobalObject());
1234
1343
  EmitCallWithIC(expr, var->name(), RelocInfo::CODE_TARGET_CONTEXT);
@@ -1242,7 +1351,6 @@ void FastCodeGenerator::VisitCall(Call* expr) {
1242
1351
  Literal* key = prop->key()->AsLiteral();
1243
1352
  if (key != NULL && key->handle()->IsSymbol()) {
1244
1353
  // Call to a named property, use call IC.
1245
- __ Push(key->handle());
1246
1354
  VisitForValue(prop->obj(), kStack);
1247
1355
  EmitCallWithIC(expr, key->handle(), RelocInfo::CODE_TARGET);
1248
1356
  } else {
@@ -1280,7 +1388,7 @@ void FastCodeGenerator::VisitCall(Call* expr) {
1280
1388
  if (lit != NULL &&
1281
1389
  lit->name()->Equals(Heap::empty_string()) &&
1282
1390
  loop_depth() == 0) {
1283
- lit->set_try_fast_codegen(true);
1391
+ lit->set_try_full_codegen(true);
1284
1392
  }
1285
1393
  VisitForValue(fun, kStack);
1286
1394
  // Load global receiver object.
@@ -1292,7 +1400,7 @@ void FastCodeGenerator::VisitCall(Call* expr) {
1292
1400
  }
1293
1401
 
1294
1402
 
1295
- void FastCodeGenerator::VisitCallNew(CallNew* expr) {
1403
+ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
1296
1404
  Comment cmnt(masm_, "[ CallNew");
1297
1405
  // According to ECMA-262, section 11.2.2, page 44, the function
1298
1406
  // expression in new calls must be evaluated before the
@@ -1323,17 +1431,16 @@ void FastCodeGenerator::VisitCallNew(CallNew* expr) {
1323
1431
  __ Call(construct_builtin, RelocInfo::CONSTRUCT_CALL);
1324
1432
 
1325
1433
  // Replace function on TOS with result in rax, or pop it.
1326
- DropAndApply(1, expr->context(), rax);
1434
+ DropAndApply(1, context_, rax);
1327
1435
  }
1328
1436
 
1329
1437
 
1330
- void FastCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
1438
+ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
1331
1439
  Comment cmnt(masm_, "[ CallRuntime");
1332
1440
  ZoneList<Expression*>* args = expr->arguments();
1333
1441
 
1334
1442
  if (expr->is_jsruntime()) {
1335
1443
  // Prepare for calling JS runtime function.
1336
- __ Push(expr->name());
1337
1444
  __ movq(rax, CodeGenerator::GlobalObject());
1338
1445
  __ push(FieldOperand(rax, GlobalObject::kBuiltinsOffset));
1339
1446
  }
@@ -1345,28 +1452,26 @@ void FastCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
1345
1452
  }
1346
1453
 
1347
1454
  if (expr->is_jsruntime()) {
1348
- // Call the JS runtime function.
1349
- Handle<Code> ic = CodeGenerator::ComputeCallInitialize(arg_count,
1350
- NOT_IN_LOOP);
1455
+ // Call the JS runtime function using a call IC.
1456
+ __ Move(rcx, expr->name());
1457
+ InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
1458
+ Handle<Code> ic = CodeGenerator::ComputeCallInitialize(arg_count, in_loop);
1351
1459
  __ call(ic, RelocInfo::CODE_TARGET);
1352
1460
  // Restore context register.
1353
1461
  __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
1354
- // Discard the function left on TOS.
1355
- DropAndApply(1, expr->context(), rax);
1356
1462
  } else {
1357
1463
  __ CallRuntime(expr->function(), arg_count);
1358
- Apply(expr->context(), rax);
1359
1464
  }
1465
+ Apply(context_, rax);
1360
1466
  }
1361
1467
 
1362
1468
 
1363
- void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
1469
+ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
1364
1470
  switch (expr->op()) {
1365
1471
  case Token::VOID: {
1366
1472
  Comment cmnt(masm_, "[ UnaryOperation (VOID)");
1367
- ASSERT_EQ(Expression::kEffect, expr->expression()->context());
1368
- Visit(expr->expression());
1369
- switch (expr->context()) {
1473
+ VisitForEffect(expr->expression());
1474
+ switch (context_) {
1370
1475
  case Expression::kUninitialized:
1371
1476
  UNREACHABLE();
1372
1477
  break;
@@ -1403,14 +1508,12 @@ void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
1403
1508
 
1404
1509
  case Token::NOT: {
1405
1510
  Comment cmnt(masm_, "[ UnaryOperation (NOT)");
1406
- ASSERT_EQ(Expression::kTest, expr->expression()->context());
1407
-
1408
1511
  Label materialize_true, materialize_false, done;
1409
1512
  // Initially assume a pure test context. Notice that the labels are
1410
1513
  // swapped.
1411
1514
  Label* if_true = false_label_;
1412
1515
  Label* if_false = true_label_;
1413
- switch (expr->context()) {
1516
+ switch (context_) {
1414
1517
  case Expression::kUninitialized:
1415
1518
  UNREACHABLE();
1416
1519
  break;
@@ -1432,14 +1535,12 @@ void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
1432
1535
  break;
1433
1536
  }
1434
1537
  VisitForControl(expr->expression(), if_true, if_false);
1435
- Apply(expr->context(), if_false, if_true); // Labels swapped.
1538
+ Apply(context_, if_false, if_true); // Labels swapped.
1436
1539
  break;
1437
1540
  }
1438
1541
 
1439
1542
  case Token::TYPEOF: {
1440
1543
  Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)");
1441
- ASSERT_EQ(Expression::kValue, expr->expression()->context());
1442
-
1443
1544
  VariableProxy* proxy = expr->expression()->AsVariableProxy();
1444
1545
  if (proxy != NULL &&
1445
1546
  !proxy->var()->is_this() &&
@@ -1465,7 +1566,58 @@ void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
1465
1566
  }
1466
1567
 
1467
1568
  __ CallRuntime(Runtime::kTypeof, 1);
1468
- Apply(expr->context(), rax);
1569
+ Apply(context_, rax);
1570
+ break;
1571
+ }
1572
+
1573
+ case Token::ADD: {
1574
+ Comment cmt(masm_, "[ UnaryOperation (ADD)");
1575
+ VisitForValue(expr->expression(), kAccumulator);
1576
+ Label no_conversion;
1577
+ Condition is_smi = masm_->CheckSmi(result_register());
1578
+ __ j(is_smi, &no_conversion);
1579
+ __ push(result_register());
1580
+ __ InvokeBuiltin(Builtins::TO_NUMBER, CALL_FUNCTION);
1581
+ __ bind(&no_conversion);
1582
+ Apply(context_, result_register());
1583
+ break;
1584
+ }
1585
+
1586
+ case Token::SUB: {
1587
+ Comment cmt(masm_, "[ UnaryOperation (SUB)");
1588
+ bool overwrite =
1589
+ (expr->expression()->AsBinaryOperation() != NULL &&
1590
+ expr->expression()->AsBinaryOperation()->ResultOverwriteAllowed());
1591
+ GenericUnaryOpStub stub(Token::SUB, overwrite);
1592
+ // GenericUnaryOpStub expects the argument to be in the
1593
+ // accumulator register rax.
1594
+ VisitForValue(expr->expression(), kAccumulator);
1595
+ __ CallStub(&stub);
1596
+ Apply(context_, rax);
1597
+ break;
1598
+ }
1599
+
1600
+ case Token::BIT_NOT: {
1601
+ Comment cmt(masm_, "[ UnaryOperation (BIT_NOT)");
1602
+ bool overwrite =
1603
+ (expr->expression()->AsBinaryOperation() != NULL &&
1604
+ expr->expression()->AsBinaryOperation()->ResultOverwriteAllowed());
1605
+ GenericUnaryOpStub stub(Token::BIT_NOT, overwrite);
1606
+ // GenericUnaryOpStub expects the argument to be in the
1607
+ // accumulator register rax.
1608
+ VisitForValue(expr->expression(), kAccumulator);
1609
+ // Avoid calling the stub for Smis.
1610
+ Label smi, done;
1611
+ Condition is_smi = masm_->CheckSmi(result_register());
1612
+ __ j(is_smi, &smi);
1613
+ // Non-smi: call stub leaving result in accumulator register.
1614
+ __ CallStub(&stub);
1615
+ __ jmp(&done);
1616
+ // Perform operation directly on Smis.
1617
+ __ bind(&smi);
1618
+ __ SmiNot(result_register(), result_register());
1619
+ __ bind(&done);
1620
+ Apply(context_, result_register());
1469
1621
  break;
1470
1622
  }
1471
1623
 
@@ -1475,7 +1627,7 @@ void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
1475
1627
  }
1476
1628
 
1477
1629
 
1478
- void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
1630
+ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
1479
1631
  Comment cmnt(masm_, "[ CountOperation");
1480
1632
 
1481
1633
  // Expression can only be a property, a global or a (parameter or local)
@@ -1486,23 +1638,21 @@ void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
1486
1638
  // In case of a property we use the uninitialized expression context
1487
1639
  // of the key to detect a named property.
1488
1640
  if (prop != NULL) {
1489
- assign_type = (prop->key()->context() == Expression::kUninitialized)
1490
- ? NAMED_PROPERTY
1491
- : KEYED_PROPERTY;
1641
+ assign_type =
1642
+ (prop->key()->IsPropertyName()) ? NAMED_PROPERTY : KEYED_PROPERTY;
1492
1643
  }
1493
1644
 
1494
1645
  // Evaluate expression and get value.
1495
1646
  if (assign_type == VARIABLE) {
1496
1647
  ASSERT(expr->expression()->AsVariableProxy()->var() != NULL);
1497
1648
  Location saved_location = location_;
1498
- location_ = kStack;
1649
+ location_ = kAccumulator;
1499
1650
  EmitVariableLoad(expr->expression()->AsVariableProxy()->var(),
1500
1651
  Expression::kValue);
1501
1652
  location_ = saved_location;
1502
1653
  } else {
1503
1654
  // Reserve space for result of postfix operation.
1504
- if (expr->is_postfix() && expr->context() != Expression::kEffect) {
1505
- ASSERT(expr->context() != Expression::kUninitialized);
1655
+ if (expr->is_postfix() && context_ != Expression::kEffect) {
1506
1656
  __ Push(Smi::FromInt(0));
1507
1657
  }
1508
1658
  VisitForValue(prop->obj(), kStack);
@@ -1512,15 +1662,20 @@ void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
1512
1662
  VisitForValue(prop->key(), kStack);
1513
1663
  EmitKeyedPropertyLoad(prop);
1514
1664
  }
1515
- __ push(rax);
1516
1665
  }
1517
1666
 
1518
- // Convert to number.
1667
+ // Call ToNumber only if operand is not a smi.
1668
+ Label no_conversion;
1669
+ Condition is_smi;
1670
+ is_smi = masm_->CheckSmi(rax);
1671
+ __ j(is_smi, &no_conversion);
1672
+ __ push(rax);
1519
1673
  __ InvokeBuiltin(Builtins::TO_NUMBER, CALL_FUNCTION);
1674
+ __ bind(&no_conversion);
1520
1675
 
1521
1676
  // Save result for postfix expressions.
1522
1677
  if (expr->is_postfix()) {
1523
- switch (expr->context()) {
1678
+ switch (context_) {
1524
1679
  case Expression::kUninitialized:
1525
1680
  UNREACHABLE();
1526
1681
  case Expression::kEffect:
@@ -1548,13 +1703,33 @@ void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
1548
1703
  }
1549
1704
  }
1550
1705
 
1706
+ // Inline smi case if we are in a loop.
1707
+ Label stub_call, done;
1708
+ if (loop_depth() > 0) {
1709
+ if (expr->op() == Token::INC) {
1710
+ __ SmiAddConstant(rax, rax, Smi::FromInt(1));
1711
+ } else {
1712
+ __ SmiSubConstant(rax, rax, Smi::FromInt(1));
1713
+ }
1714
+ __ j(overflow, &stub_call);
1715
+ // We could eliminate this smi check if we split the code at
1716
+ // the first smi check before calling ToNumber.
1717
+ is_smi = masm_->CheckSmi(rax);
1718
+ __ j(is_smi, &done);
1719
+ __ bind(&stub_call);
1720
+ // Call stub. Undo operation first.
1721
+ if (expr->op() == Token::INC) {
1722
+ __ SmiSubConstant(rax, rax, Smi::FromInt(1));
1723
+ } else {
1724
+ __ SmiAddConstant(rax, rax, Smi::FromInt(1));
1725
+ }
1726
+ }
1551
1727
  // Call stub for +1/-1.
1552
- __ push(rax);
1553
- __ Push(Smi::FromInt(1));
1554
1728
  GenericBinaryOpStub stub(expr->binary_op(),
1555
1729
  NO_OVERWRITE,
1556
1730
  NO_GENERIC_BINARY_FLAGS);
1557
- __ CallStub(&stub);
1731
+ stub.GenerateCall(masm_, rax, Smi::FromInt(1));
1732
+ __ bind(&done);
1558
1733
 
1559
1734
  // Store the value returned in rax.
1560
1735
  switch (assign_type) {
@@ -1564,28 +1739,28 @@ void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
1564
1739
  Expression::kEffect);
1565
1740
  // For all contexts except kEffect: We have the result on
1566
1741
  // top of the stack.
1567
- if (expr->context() != Expression::kEffect) {
1568
- ApplyTOS(expr->context());
1742
+ if (context_ != Expression::kEffect) {
1743
+ ApplyTOS(context_);
1569
1744
  }
1570
1745
  } else {
1571
1746
  EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
1572
- expr->context());
1747
+ context_);
1573
1748
  }
1574
1749
  break;
1575
1750
  case NAMED_PROPERTY: {
1576
1751
  __ Move(rcx, prop->key()->AsLiteral()->handle());
1752
+ __ pop(rdx);
1577
1753
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
1578
1754
  __ call(ic, RelocInfo::CODE_TARGET);
1579
1755
  // This nop signals to the IC that there is no inlined code at the call
1580
1756
  // site for it to patch.
1581
1757
  __ nop();
1582
1758
  if (expr->is_postfix()) {
1583
- __ Drop(1); // Result is on the stack under the receiver.
1584
- if (expr->context() != Expression::kEffect) {
1585
- ApplyTOS(expr->context());
1759
+ if (context_ != Expression::kEffect) {
1760
+ ApplyTOS(context_);
1586
1761
  }
1587
1762
  } else {
1588
- DropAndApply(1, expr->context(), rax);
1763
+ Apply(context_, rax);
1589
1764
  }
1590
1765
  break;
1591
1766
  }
@@ -1597,24 +1772,22 @@ void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
1597
1772
  __ nop();
1598
1773
  if (expr->is_postfix()) {
1599
1774
  __ Drop(2); // Result is on the stack under the key and the receiver.
1600
- if (expr->context() != Expression::kEffect) {
1601
- ApplyTOS(expr->context());
1775
+ if (context_ != Expression::kEffect) {
1776
+ ApplyTOS(context_);
1602
1777
  }
1603
1778
  } else {
1604
- DropAndApply(2, expr->context(), rax);
1779
+ DropAndApply(2, context_, rax);
1605
1780
  }
1606
1781
  break;
1607
1782
  }
1608
1783
  }
1609
1784
  }
1610
1785
 
1611
- void FastCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
1786
+ void FullCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
1612
1787
  Comment cmnt(masm_, "[ BinaryOperation");
1613
1788
  switch (expr->op()) {
1614
1789
  case Token::COMMA:
1615
- ASSERT_EQ(Expression::kEffect, expr->left()->context());
1616
- ASSERT_EQ(expr->context(), expr->right()->context());
1617
- Visit(expr->left());
1790
+ VisitForEffect(expr->left());
1618
1791
  Visit(expr->right());
1619
1792
  break;
1620
1793
 
@@ -1636,7 +1809,7 @@ void FastCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
1636
1809
  case Token::SAR:
1637
1810
  VisitForValue(expr->left(), kStack);
1638
1811
  VisitForValue(expr->right(), kAccumulator);
1639
- EmitBinaryOp(expr->op(), expr->context());
1812
+ EmitBinaryOp(expr->op(), context_);
1640
1813
  break;
1641
1814
 
1642
1815
  default:
@@ -1645,7 +1818,7 @@ void FastCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
1645
1818
  }
1646
1819
 
1647
1820
 
1648
- void FastCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
1821
+ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
1649
1822
  Comment cmnt(masm_, "[ CompareOperation");
1650
1823
 
1651
1824
  // Always perform the comparison for its control flow. Pack the result
@@ -1654,7 +1827,7 @@ void FastCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
1654
1827
  // Initially assume we are in a test context.
1655
1828
  Label* if_true = true_label_;
1656
1829
  Label* if_false = false_label_;
1657
- switch (expr->context()) {
1830
+ switch (context_) {
1658
1831
  case Expression::kUninitialized:
1659
1832
  UNREACHABLE();
1660
1833
  break;
@@ -1753,29 +1926,29 @@ void FastCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
1753
1926
 
1754
1927
  // Convert the result of the comparison into one expected for this
1755
1928
  // expression's context.
1756
- Apply(expr->context(), if_true, if_false);
1929
+ Apply(context_, if_true, if_false);
1757
1930
  }
1758
1931
 
1759
1932
 
1760
- void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) {
1933
+ void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) {
1761
1934
  __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
1762
- Apply(expr->context(), rax);
1935
+ Apply(context_, rax);
1763
1936
  }
1764
1937
 
1765
1938
 
1766
- Register FastCodeGenerator::result_register() { return rax; }
1939
+ Register FullCodeGenerator::result_register() { return rax; }
1767
1940
 
1768
1941
 
1769
- Register FastCodeGenerator::context_register() { return rsi; }
1942
+ Register FullCodeGenerator::context_register() { return rsi; }
1770
1943
 
1771
1944
 
1772
- void FastCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
1945
+ void FullCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
1773
1946
  ASSERT(IsAligned(frame_offset, kPointerSize));
1774
1947
  __ movq(Operand(rbp, frame_offset), value);
1775
1948
  }
1776
1949
 
1777
1950
 
1778
- void FastCodeGenerator::LoadContextField(Register dst, int context_index) {
1951
+ void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
1779
1952
  __ movq(dst, CodeGenerator::ContextOperand(rsi, context_index));
1780
1953
  }
1781
1954
 
@@ -1784,7 +1957,7 @@ void FastCodeGenerator::LoadContextField(Register dst, int context_index) {
1784
1957
  // Non-local control flow support.
1785
1958
 
1786
1959
 
1787
- void FastCodeGenerator::EnterFinallyBlock() {
1960
+ void FullCodeGenerator::EnterFinallyBlock() {
1788
1961
  ASSERT(!result_register().is(rdx));
1789
1962
  ASSERT(!result_register().is(rcx));
1790
1963
  // Cook return address on top of stack (smi encoded Code* delta)
@@ -1798,7 +1971,7 @@ void FastCodeGenerator::EnterFinallyBlock() {
1798
1971
  }
1799
1972
 
1800
1973
 
1801
- void FastCodeGenerator::ExitFinallyBlock() {
1974
+ void FullCodeGenerator::ExitFinallyBlock() {
1802
1975
  ASSERT(!result_register().is(rdx));
1803
1976
  ASSERT(!result_register().is(rcx));
1804
1977
  // Restore result register from stack.