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
@@ -31,7 +31,7 @@
31
31
  namespace v8 {
32
32
  namespace internal {
33
33
 
34
- #ifdef V8_NATIVE_REGEXP
34
+ #ifndef V8_INTERPRETED_REGEXP
35
35
 
36
36
  class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler {
37
37
  public:
@@ -138,9 +138,7 @@ class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler {
138
138
  static const int kInputStart = kStartIndex + kPointerSize;
139
139
  static const int kInputEnd = kInputStart + kPointerSize;
140
140
  static const int kRegisterOutput = kInputEnd + kPointerSize;
141
- // AtStart is passed as 32 bit int (values 0 or 1).
142
- static const int kAtStart = kRegisterOutput + kPointerSize;
143
- static const int kStackHighEnd = kAtStart + kPointerSize;
141
+ static const int kStackHighEnd = kRegisterOutput + kPointerSize;
144
142
  // DirectCall is passed as 32 bit int (values 0 or 1).
145
143
  static const int kDirectCall = kStackHighEnd + kPointerSize;
146
144
  #else
@@ -152,9 +150,8 @@ class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler {
152
150
  static const int kInputStart = kStartIndex - kPointerSize;
153
151
  static const int kInputEnd = kInputStart - kPointerSize;
154
152
  static const int kRegisterOutput = kInputEnd - kPointerSize;
155
- static const int kAtStart = kRegisterOutput - kPointerSize;
156
- static const int kStackHighEnd = kFrameAlign;
157
- static const int kDirectCall = kStackHighEnd + kPointerSize;
153
+ static const int kStackHighEnd = kRegisterOutput - kPointerSize;
154
+ static const int kDirectCall = kFrameAlign;
158
155
  #endif
159
156
 
160
157
  #ifdef _WIN64
@@ -168,7 +165,7 @@ class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler {
168
165
  // AMD64 Calling Convention has only one callee-save register that
169
166
  // we use. We push this after the frame pointer (and after the
170
167
  // parameters).
171
- static const int kBackup_rbx = kAtStart - kPointerSize;
168
+ static const int kBackup_rbx = kStackHighEnd - kPointerSize;
172
169
  static const int kLastCalleeSaveRegister = kBackup_rbx;
173
170
  #endif
174
171
 
@@ -176,9 +173,10 @@ class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler {
176
173
  // the frame in GetCode.
177
174
  static const int kInputStartMinusOne =
178
175
  kLastCalleeSaveRegister - kPointerSize;
176
+ static const int kAtStart = kInputStartMinusOne - kPointerSize;
179
177
 
180
178
  // First register address. Following registers are below it on the stack.
181
- static const int kRegisterZero = kInputStartMinusOne - kPointerSize;
179
+ static const int kRegisterZero = kAtStart - kPointerSize;
182
180
 
183
181
  // Initial size of code buffer.
184
182
  static const size_t kRegExpCodeSize = 1024;
@@ -249,21 +247,6 @@ class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler {
249
247
  // Increments the stack pointer (rcx) by a word size.
250
248
  inline void Drop();
251
249
 
252
- // Before calling a C-function from generated code, align arguments on stack.
253
- // After aligning the frame, arguments must be stored in esp[0], esp[4],
254
- // etc., not pushed. The argument count assumes all arguments are word sized.
255
- // Some compilers/platforms require the stack to be aligned when calling
256
- // C++ code.
257
- // Needs a scratch register to do some arithmetic. This register will be
258
- // trashed.
259
- inline void FrameAlign(int num_arguments);
260
-
261
- // Calls a C function and cleans up the space for arguments allocated
262
- // by FrameAlign. The called function is not allowed to trigger a garbage
263
- // collection, since that might move the code and invalidate the return
264
- // address (unless this is somehow accounted for by the called function).
265
- inline void CallCFunction(ExternalReference function, int num_arguments);
266
-
267
250
  MacroAssembler* masm_;
268
251
 
269
252
  ZoneList<int> code_relative_fixup_positions_;
@@ -288,7 +271,7 @@ class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler {
288
271
  Label stack_overflow_label_;
289
272
  };
290
273
 
291
- #endif // V8_NATIVE_REGEXP
274
+ #endif // V8_INTERPRETED_REGEXP
292
275
 
293
276
  }} // namespace v8::internal
294
277
 
@@ -38,7 +38,7 @@ namespace internal {
38
38
 
39
39
  bool RegisterAllocator::IsReserved(Register reg) {
40
40
  return reg.is(rsp) || reg.is(rbp) || reg.is(rsi) ||
41
- reg.is(kScratchRegister);
41
+ reg.is(kScratchRegister) || reg.is(kRootRegister);
42
42
  }
43
43
 
44
44
 
@@ -29,6 +29,7 @@
29
29
 
30
30
  #include "codegen-inl.h"
31
31
  #include "register-allocator-inl.h"
32
+ #include "virtual-frame-inl.h"
32
33
 
33
34
  namespace v8 {
34
35
  namespace internal {
@@ -43,6 +44,7 @@ void Result::ToRegister() {
43
44
  ASSERT(fresh.is_valid());
44
45
  CodeGeneratorScope::Current()->masm()->Move(fresh.reg(), handle());
45
46
  // This result becomes a copy of the fresh one.
47
+ fresh.set_type_info(type_info());
46
48
  *this = fresh;
47
49
  }
48
50
  ASSERT(is_register());
@@ -60,6 +62,7 @@ void Result::ToRegister(Register target) {
60
62
  ASSERT(is_constant());
61
63
  CodeGeneratorScope::Current()->masm()->Move(fresh.reg(), handle());
62
64
  }
65
+ fresh.set_type_info(type_info());
63
66
  *this = fresh;
64
67
  } else if (is_register() && reg().is(target)) {
65
68
  ASSERT(CodeGeneratorScope::Current()->has_valid_frame());
@@ -54,8 +54,8 @@ class SimulatorStack : public v8::internal::AllStatic {
54
54
 
55
55
  // Call the generated regexp code directly. The entry function pointer should
56
56
  // expect eight int/pointer sized arguments and return an int.
57
- #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \
58
- entry(p0, p1, p2, p3, p4, p5, p6, p7)
57
+ #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
58
+ entry(p0, p1, p2, p3, p4, p5, p6)
59
59
 
60
60
  #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
61
61
  reinterpret_cast<TryCatch*>(try_catch_address)
@@ -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:
@@ -133,19 +133,18 @@ void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm,
133
133
  }
134
134
 
135
135
 
136
- template <typename Pushable>
137
136
  static void PushInterceptorArguments(MacroAssembler* masm,
138
137
  Register receiver,
139
138
  Register holder,
140
- Pushable name,
139
+ Register name,
141
140
  JSObject* holder_obj) {
142
- __ push(receiver);
143
- __ push(holder);
144
141
  __ push(name);
145
142
  InterceptorInfo* interceptor = holder_obj->GetNamedInterceptor();
146
- __ movq(kScratchRegister, Handle<Object>(interceptor),
147
- RelocInfo::EMBEDDED_OBJECT);
143
+ ASSERT(!Heap::InNewSpace(interceptor));
144
+ __ Move(kScratchRegister, Handle<Object>(interceptor));
148
145
  __ push(kScratchRegister);
146
+ __ push(receiver);
147
+ __ push(holder);
149
148
  __ push(FieldOperand(kScratchRegister, InterceptorInfo::kDataOffset));
150
149
  }
151
150
 
@@ -200,8 +199,9 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
200
199
  }
201
200
 
202
201
 
202
+ // Both name_reg and receiver_reg are preserved on jumps to miss_label,
203
+ // but may be destroyed if store is successful.
203
204
  void StubCompiler::GenerateStoreField(MacroAssembler* masm,
204
- Builtins::Name storage_extend,
205
205
  JSObject* object,
206
206
  int index,
207
207
  Map* transition,
@@ -230,9 +230,13 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
230
230
  if ((transition != NULL) && (object->map()->unused_property_fields() == 0)) {
231
231
  // The properties must be extended before we can store the value.
232
232
  // We jump to a runtime call that extends the properties array.
233
- __ Move(rcx, Handle<Map>(transition));
234
- Handle<Code> ic(Builtins::builtin(storage_extend));
235
- __ Jump(ic, RelocInfo::CODE_TARGET);
233
+ __ pop(scratch); // Return address.
234
+ __ push(receiver_reg);
235
+ __ Push(Handle<Map>(transition));
236
+ __ push(rax);
237
+ __ push(scratch);
238
+ __ TailCallExternalReference(
239
+ ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage)), 3, 1);
236
240
  return;
237
241
  }
238
242
 
@@ -313,38 +317,37 @@ static void GenerateStringCheck(MacroAssembler* masm,
313
317
 
314
318
  void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm,
315
319
  Register receiver,
316
- Register scratch,
320
+ Register scratch1,
321
+ Register scratch2,
317
322
  Label* miss) {
318
- Label load_length, check_wrapper;
323
+ Label check_wrapper;
319
324
 
320
325
  // Check if the object is a string leaving the instance type in the
321
326
  // scratch register.
322
- GenerateStringCheck(masm, receiver, scratch, miss, &check_wrapper);
327
+ GenerateStringCheck(masm, receiver, scratch1, miss, &check_wrapper);
323
328
 
324
329
  // Load length directly from the string.
325
- __ bind(&load_length);
326
- __ movl(rax, FieldOperand(receiver, String::kLengthOffset));
327
- __ Integer32ToSmi(rax, rax);
330
+ __ movq(rax, FieldOperand(receiver, String::kLengthOffset));
328
331
  __ ret(0);
329
332
 
330
333
  // Check if the object is a JSValue wrapper.
331
334
  __ bind(&check_wrapper);
332
- __ cmpl(scratch, Immediate(JS_VALUE_TYPE));
335
+ __ cmpl(scratch1, Immediate(JS_VALUE_TYPE));
333
336
  __ j(not_equal, miss);
334
337
 
335
338
  // Check if the wrapped value is a string and load the length
336
339
  // directly if it is.
337
- __ movq(receiver, FieldOperand(receiver, JSValue::kValueOffset));
338
- GenerateStringCheck(masm, receiver, scratch, miss, miss);
339
- __ jmp(&load_length);
340
+ __ movq(scratch2, FieldOperand(receiver, JSValue::kValueOffset));
341
+ GenerateStringCheck(masm, scratch2, scratch1, miss, miss);
342
+ __ movq(rax, FieldOperand(scratch2, String::kLengthOffset));
343
+ __ ret(0);
340
344
  }
341
345
 
342
346
 
343
- template <class Pushable>
344
347
  static void CompileCallLoadPropertyWithInterceptor(MacroAssembler* masm,
345
348
  Register receiver,
346
349
  Register holder,
347
- Pushable name,
350
+ Register name,
348
351
  JSObject* holder_obj) {
349
352
  PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
350
353
 
@@ -370,15 +373,47 @@ void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm,
370
373
  }
371
374
 
372
375
 
373
- static void LookupPostInterceptor(JSObject* holder,
374
- String* name,
375
- LookupResult* lookup) {
376
- holder->LocalLookupRealNamedProperty(name, lookup);
377
- if (lookup->IsNotFound()) {
378
- Object* proto = holder->GetPrototype();
379
- if (proto != Heap::null_value()) {
380
- proto->Lookup(name, lookup);
381
- }
376
+ template <class Compiler>
377
+ static void CompileLoadInterceptor(Compiler* compiler,
378
+ StubCompiler* stub_compiler,
379
+ MacroAssembler* masm,
380
+ JSObject* object,
381
+ JSObject* holder,
382
+ String* name,
383
+ LookupResult* lookup,
384
+ Register receiver,
385
+ Register scratch1,
386
+ Register scratch2,
387
+ Label* miss) {
388
+ ASSERT(holder->HasNamedInterceptor());
389
+ ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
390
+
391
+ // Check that the receiver isn't a smi.
392
+ __ JumpIfSmi(receiver, miss);
393
+
394
+ // Check that the maps haven't changed.
395
+ Register reg =
396
+ stub_compiler->CheckPrototypes(object, receiver, holder,
397
+ scratch1, scratch2, name, miss);
398
+
399
+ if (lookup->IsProperty() && lookup->IsCacheable()) {
400
+ compiler->CompileCacheable(masm,
401
+ stub_compiler,
402
+ receiver,
403
+ reg,
404
+ scratch1,
405
+ scratch2,
406
+ holder,
407
+ lookup,
408
+ name,
409
+ miss);
410
+ } else {
411
+ compiler->CompileRegular(masm,
412
+ receiver,
413
+ reg,
414
+ scratch2,
415
+ holder,
416
+ miss);
382
417
  }
383
418
  }
384
419
 
@@ -397,7 +432,7 @@ class LoadInterceptorCompiler BASE_EMBEDDED {
397
432
  LookupResult* lookup,
398
433
  String* name,
399
434
  Label* miss_label) {
400
- AccessorInfo* callback = 0;
435
+ AccessorInfo* callback = NULL;
401
436
  bool optimize = false;
402
437
  // So far the most popular follow ups for interceptor loads are FIELD
403
438
  // and CALLBACKS, so inline only them, other cases may be added
@@ -488,7 +523,7 @@ class LoadInterceptorCompiler BASE_EMBEDDED {
488
523
 
489
524
  ExternalReference ref =
490
525
  ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
491
- __ TailCallRuntime(ref, 5, 1);
526
+ __ TailCallExternalReference(ref, 5, 1);
492
527
 
493
528
  __ bind(&cleanup);
494
529
  __ pop(scratch1);
@@ -510,7 +545,7 @@ class LoadInterceptorCompiler BASE_EMBEDDED {
510
545
 
511
546
  ExternalReference ref = ExternalReference(
512
547
  IC_Utility(IC::kLoadPropertyWithInterceptorForLoad));
513
- __ TailCallRuntime(ref, 5, 1);
548
+ __ TailCallExternalReference(ref, 5, 1);
514
549
  }
515
550
 
516
551
  private:
@@ -518,180 +553,333 @@ class LoadInterceptorCompiler BASE_EMBEDDED {
518
553
  };
519
554
 
520
555
 
521
- template <class Compiler>
522
- static void CompileLoadInterceptor(Compiler* compiler,
523
- StubCompiler* stub_compiler,
524
- MacroAssembler* masm,
525
- JSObject* object,
526
- JSObject* holder,
527
- String* name,
528
- LookupResult* lookup,
529
- Register receiver,
530
- Register scratch1,
531
- Register scratch2,
532
- Label* miss) {
533
- ASSERT(holder->HasNamedInterceptor());
534
- ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
556
+ // Reserves space for the extra arguments to FastHandleApiCall in the
557
+ // caller's frame.
558
+ //
559
+ // These arguments are set by CheckPrototypes and GenerateFastApiCall.
560
+ static void ReserveSpaceForFastApiCall(MacroAssembler* masm, Register scratch) {
561
+ // ----------- S t a t e -------------
562
+ // -- rsp[0] : return address
563
+ // -- rsp[8] : last argument in the internal frame of the caller
564
+ // -----------------------------------
565
+ __ movq(scratch, Operand(rsp, 0));
566
+ __ subq(rsp, Immediate(4 * kPointerSize));
567
+ __ movq(Operand(rsp, 0), scratch);
568
+ __ Move(scratch, Smi::FromInt(0));
569
+ __ movq(Operand(rsp, 1 * kPointerSize), scratch);
570
+ __ movq(Operand(rsp, 2 * kPointerSize), scratch);
571
+ __ movq(Operand(rsp, 3 * kPointerSize), scratch);
572
+ __ movq(Operand(rsp, 4 * kPointerSize), scratch);
573
+ }
535
574
 
536
- // Check that the receiver isn't a smi.
537
- __ JumpIfSmi(receiver, miss);
538
575
 
539
- // Check that the maps haven't changed.
540
- Register reg =
541
- stub_compiler->CheckPrototypes(object, receiver, holder,
542
- scratch1, scratch2, name, miss);
576
+ // Undoes the effects of ReserveSpaceForFastApiCall.
577
+ static void FreeSpaceForFastApiCall(MacroAssembler* masm, Register scratch) {
578
+ // ----------- S t a t e -------------
579
+ // -- rsp[0] : return address
580
+ // -- rsp[8] : last fast api call extra argument
581
+ // -- ...
582
+ // -- rsp[32] : first fast api call extra argument
583
+ // -- rsp[40] : last argument in the internal frame
584
+ // -----------------------------------
585
+ __ movq(scratch, Operand(rsp, 0));
586
+ __ movq(Operand(rsp, 4 * kPointerSize), scratch);
587
+ __ addq(rsp, Immediate(kPointerSize * 4));
588
+ }
543
589
 
544
- if (lookup->IsValid() && lookup->IsCacheable()) {
545
- compiler->CompileCacheable(masm,
546
- stub_compiler,
547
- receiver,
548
- reg,
549
- scratch1,
550
- scratch2,
551
- holder,
552
- lookup,
553
- name,
554
- miss);
590
+
591
+ // Generates call to FastHandleApiCall builtin.
592
+ static void GenerateFastApiCall(MacroAssembler* masm,
593
+ const CallOptimization& optimization,
594
+ int argc) {
595
+ // ----------- S t a t e -------------
596
+ // -- rsp[0] : return address
597
+ // -- rsp[8] : object passing the type check
598
+ // (last fast api call extra argument,
599
+ // set by CheckPrototypes)
600
+ // -- rsp[16] : api call data
601
+ // -- rsp[24] : api callback
602
+ // -- rsp[32] : api function
603
+ // (first fast api call extra argument)
604
+ // -- rsp[40] : last argument
605
+ // -- ...
606
+ // -- rsp[(argc + 5) * 8] : first argument
607
+ // -- rsp[(argc + 6) * 8] : receiver
608
+ // -----------------------------------
609
+
610
+ // Get the function and setup the context.
611
+ JSFunction* function = optimization.constant_function();
612
+ __ Move(rdi, Handle<JSFunction>(function));
613
+ __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
614
+
615
+ // Pass the additional arguments FastHandleApiCall expects.
616
+ __ movq(Operand(rsp, 4 * kPointerSize), rdi);
617
+ bool info_loaded = false;
618
+ Object* callback = optimization.api_call_info()->callback();
619
+ if (Heap::InNewSpace(callback)) {
620
+ info_loaded = true;
621
+ __ Move(rcx, Handle<CallHandlerInfo>(optimization.api_call_info()));
622
+ __ movq(rbx, FieldOperand(rcx, CallHandlerInfo::kCallbackOffset));
623
+ __ movq(Operand(rsp, 3 * kPointerSize), rbx);
555
624
  } else {
556
- compiler->CompileRegular(masm,
557
- receiver,
558
- reg,
559
- scratch2,
560
- holder,
561
- miss);
625
+ __ Move(Operand(rsp, 3 * kPointerSize), Handle<Object>(callback));
626
+ }
627
+ Object* call_data = optimization.api_call_info()->data();
628
+ if (Heap::InNewSpace(call_data)) {
629
+ if (!info_loaded) {
630
+ __ Move(rcx, Handle<CallHandlerInfo>(optimization.api_call_info()));
631
+ }
632
+ __ movq(rbx, FieldOperand(rcx, CallHandlerInfo::kDataOffset));
633
+ __ movq(Operand(rsp, 2 * kPointerSize), rbx);
634
+ } else {
635
+ __ Move(Operand(rsp, 2 * kPointerSize), Handle<Object>(call_data));
562
636
  }
637
+
638
+ // Set the number of arguments.
639
+ __ movq(rax, Immediate(argc + 4));
640
+
641
+ // Jump to the fast api call builtin (tail call).
642
+ Handle<Code> code = Handle<Code>(
643
+ Builtins::builtin(Builtins::FastHandleApiCall));
644
+ ParameterCount expected(0);
645
+ __ InvokeCode(code, expected, expected,
646
+ RelocInfo::CODE_TARGET, JUMP_FUNCTION);
563
647
  }
564
648
 
565
649
 
566
650
  class CallInterceptorCompiler BASE_EMBEDDED {
567
651
  public:
568
- explicit CallInterceptorCompiler(const ParameterCount& arguments)
569
- : arguments_(arguments), argc_(arguments.immediate()) {}
652
+ CallInterceptorCompiler(StubCompiler* stub_compiler,
653
+ const ParameterCount& arguments,
654
+ Register name)
655
+ : stub_compiler_(stub_compiler),
656
+ arguments_(arguments),
657
+ name_(name) {}
658
+
659
+ void Compile(MacroAssembler* masm,
660
+ JSObject* object,
661
+ JSObject* holder,
662
+ String* name,
663
+ LookupResult* lookup,
664
+ Register receiver,
665
+ Register scratch1,
666
+ Register scratch2,
667
+ Label* miss) {
668
+ ASSERT(holder->HasNamedInterceptor());
669
+ ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
670
+
671
+ // Check that the receiver isn't a smi.
672
+ __ JumpIfSmi(receiver, miss);
673
+
674
+ CallOptimization optimization(lookup);
675
+
676
+ if (optimization.is_constant_call()) {
677
+ CompileCacheable(masm,
678
+ object,
679
+ receiver,
680
+ scratch1,
681
+ scratch2,
682
+ holder,
683
+ lookup,
684
+ name,
685
+ optimization,
686
+ miss);
687
+ } else {
688
+ CompileRegular(masm,
689
+ object,
690
+ receiver,
691
+ scratch1,
692
+ scratch2,
693
+ name,
694
+ holder,
695
+ miss);
696
+ }
697
+ }
570
698
 
699
+ private:
571
700
  void CompileCacheable(MacroAssembler* masm,
572
- StubCompiler* stub_compiler,
701
+ JSObject* object,
573
702
  Register receiver,
574
- Register holder,
575
703
  Register scratch1,
576
704
  Register scratch2,
577
705
  JSObject* holder_obj,
578
706
  LookupResult* lookup,
579
707
  String* name,
708
+ const CallOptimization& optimization,
580
709
  Label* miss_label) {
581
- JSFunction* function = 0;
582
- bool optimize = false;
583
- // So far the most popular case for failed interceptor is
584
- // CONSTANT_FUNCTION sitting below.
585
- if (lookup->type() == CONSTANT_FUNCTION) {
586
- function = lookup->GetConstantFunction();
587
- // JSArray holder is a special case for call constant function
588
- // (see the corresponding code).
589
- if (function->is_compiled() && !holder_obj->IsJSArray()) {
590
- optimize = true;
710
+ ASSERT(optimization.is_constant_call());
711
+ ASSERT(!lookup->holder()->IsGlobalObject());
712
+
713
+ int depth1 = kInvalidProtoDepth;
714
+ int depth2 = kInvalidProtoDepth;
715
+ bool can_do_fast_api_call = false;
716
+ if (optimization.is_simple_api_call() &&
717
+ !lookup->holder()->IsGlobalObject()) {
718
+ depth1 = optimization.GetPrototypeDepthOfExpectedType(object, holder_obj);
719
+ if (depth1 == kInvalidProtoDepth) {
720
+ depth2 = optimization.GetPrototypeDepthOfExpectedType(holder_obj,
721
+ lookup->holder());
591
722
  }
723
+ can_do_fast_api_call = (depth1 != kInvalidProtoDepth) ||
724
+ (depth2 != kInvalidProtoDepth);
592
725
  }
593
726
 
594
- if (!optimize) {
595
- CompileRegular(masm, receiver, holder, scratch2, holder_obj, miss_label);
596
- return;
727
+ __ IncrementCounter(&Counters::call_const_interceptor, 1);
728
+
729
+ if (can_do_fast_api_call) {
730
+ __ IncrementCounter(&Counters::call_const_interceptor_fast_api, 1);
731
+ ReserveSpaceForFastApiCall(masm, scratch1);
597
732
  }
598
733
 
599
- __ EnterInternalFrame();
600
- __ push(holder); // save the holder
734
+ Label miss_cleanup;
735
+ Label* miss = can_do_fast_api_call ? &miss_cleanup : miss_label;
736
+ Register holder =
737
+ stub_compiler_->CheckPrototypes(object, receiver, holder_obj,
738
+ scratch1, scratch2, name,
739
+ depth1, miss);
601
740
 
602
- CompileCallLoadPropertyWithInterceptor(
603
- masm,
604
- receiver,
605
- holder,
606
- // Under EnterInternalFrame this refers to name.
607
- Operand(rbp, (argc_ + 3) * kPointerSize),
608
- holder_obj);
741
+ Label regular_invoke;
742
+ LoadWithInterceptor(masm, receiver, holder, holder_obj, &regular_invoke);
609
743
 
610
- __ pop(receiver); // restore holder
611
- __ LeaveInternalFrame();
744
+ // Generate code for the failed interceptor case.
612
745
 
613
- __ CompareRoot(rax, Heap::kNoInterceptorResultSentinelRootIndex);
614
- Label invoke;
615
- __ j(not_equal, &invoke);
616
-
617
- stub_compiler->CheckPrototypes(holder_obj, receiver,
618
- lookup->holder(), scratch1,
619
- scratch2,
620
- name,
621
- miss_label);
622
- if (lookup->holder()->IsGlobalObject()) {
623
- __ movq(rdx, Operand(rsp, (argc_ + 1) * kPointerSize));
624
- __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset));
625
- __ movq(Operand(rsp, (argc_ + 1) * kPointerSize), rdx);
626
- }
746
+ // Check the lookup is still valid.
747
+ stub_compiler_->CheckPrototypes(holder_obj, receiver,
748
+ lookup->holder(),
749
+ scratch1, scratch2, name,
750
+ depth2, miss);
627
751
 
628
- ASSERT(function->is_compiled());
629
- // Get the function and setup the context.
630
- __ Move(rdi, Handle<JSFunction>(function));
631
- __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
752
+ if (can_do_fast_api_call) {
753
+ GenerateFastApiCall(masm, optimization, arguments_.immediate());
754
+ } else {
755
+ __ InvokeFunction(optimization.constant_function(), arguments_,
756
+ JUMP_FUNCTION);
757
+ }
632
758
 
633
- // Jump to the cached code (tail call).
634
- ASSERT(function->is_compiled());
635
- Handle<Code> code(function->code());
636
- ParameterCount expected(function->shared()->formal_parameter_count());
637
- __ InvokeCode(code, expected, arguments_,
638
- RelocInfo::CODE_TARGET, JUMP_FUNCTION);
759
+ if (can_do_fast_api_call) {
760
+ __ bind(&miss_cleanup);
761
+ FreeSpaceForFastApiCall(masm, scratch1);
762
+ __ jmp(miss_label);
763
+ }
639
764
 
640
- __ bind(&invoke);
765
+ __ bind(&regular_invoke);
766
+ if (can_do_fast_api_call) {
767
+ FreeSpaceForFastApiCall(masm, scratch1);
768
+ }
641
769
  }
642
770
 
643
771
  void CompileRegular(MacroAssembler* masm,
772
+ JSObject* object,
644
773
  Register receiver,
645
- Register holder,
646
- Register scratch,
774
+ Register scratch1,
775
+ Register scratch2,
776
+ String* name,
647
777
  JSObject* holder_obj,
648
778
  Label* miss_label) {
779
+ Register holder =
780
+ stub_compiler_->CheckPrototypes(object, receiver, holder_obj,
781
+ scratch1, scratch2, name,
782
+ miss_label);
783
+
649
784
  __ EnterInternalFrame();
785
+ // Save the name_ register across the call.
786
+ __ push(name_);
650
787
 
651
788
  PushInterceptorArguments(masm,
652
789
  receiver,
653
790
  holder,
654
- Operand(rbp, (argc_ + 3) * kPointerSize),
791
+ name_,
655
792
  holder_obj);
656
793
 
657
- ExternalReference ref = ExternalReference(
658
- IC_Utility(IC::kLoadPropertyWithInterceptorForCall));
659
- __ movq(rax, Immediate(5));
660
- __ movq(rbx, ref);
794
+ __ CallExternalReference(
795
+ ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorForCall)),
796
+ 5);
797
+
798
+ // Restore the name_ register.
799
+ __ pop(name_);
800
+ __ LeaveInternalFrame();
801
+ }
802
+
803
+ void LoadWithInterceptor(MacroAssembler* masm,
804
+ Register receiver,
805
+ Register holder,
806
+ JSObject* holder_obj,
807
+ Label* interceptor_succeeded) {
808
+ __ EnterInternalFrame();
809
+ __ push(holder); // Save the holder.
810
+ __ push(name_); // Save the name.
661
811
 
662
- CEntryStub stub(1);
663
- __ CallStub(&stub);
812
+ CompileCallLoadPropertyWithInterceptor(masm,
813
+ receiver,
814
+ holder,
815
+ name_,
816
+ holder_obj);
664
817
 
818
+ __ pop(name_); // Restore the name.
819
+ __ pop(receiver); // Restore the holder.
665
820
  __ LeaveInternalFrame();
821
+
822
+ __ CompareRoot(rax, Heap::kNoInterceptorResultSentinelRootIndex);
823
+ __ j(not_equal, interceptor_succeeded);
666
824
  }
667
825
 
668
- private:
826
+ StubCompiler* stub_compiler_;
669
827
  const ParameterCount& arguments_;
670
- int argc_;
828
+ Register name_;
671
829
  };
672
830
 
673
831
 
832
+ // Generate code to check that a global property cell is empty. Create
833
+ // the property cell at compilation time if no cell exists for the
834
+ // property.
835
+ static Object* GenerateCheckPropertyCell(MacroAssembler* masm,
836
+ GlobalObject* global,
837
+ String* name,
838
+ Register scratch,
839
+ Label* miss) {
840
+ Object* probe = global->EnsurePropertyCell(name);
841
+ if (probe->IsFailure()) return probe;
842
+ JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(probe);
843
+ ASSERT(cell->value()->IsTheHole());
844
+ __ Move(scratch, Handle<Object>(cell));
845
+ __ Cmp(FieldOperand(scratch, JSGlobalPropertyCell::kValueOffset),
846
+ Factory::the_hole_value());
847
+ __ j(not_equal, miss);
848
+ return cell;
849
+ }
850
+
851
+
674
852
  #undef __
675
853
 
676
854
  #define __ ACCESS_MASM((masm()))
677
855
 
678
-
679
856
  Object* CallStubCompiler::CompileCallConstant(Object* object,
680
857
  JSObject* holder,
681
858
  JSFunction* function,
682
859
  String* name,
683
860
  StubCompiler::CheckType check) {
684
861
  // ----------- S t a t e -------------
685
- // -----------------------------------
686
- // rsp[0] return address
687
- // rsp[8] argument argc
688
- // rsp[16] argument argc - 1
862
+ // rcx : function name
863
+ // rsp[0] : return address
864
+ // rsp[8] : argument argc
865
+ // rsp[16] : argument argc - 1
689
866
  // ...
690
- // rsp[argc * 8] argument 1
691
- // rsp[(argc + 1) * 8] argument 0 = reciever
692
- // rsp[(argc + 2) * 8] function name
867
+ // rsp[argc * 8] : argument 1
868
+ // rsp[(argc + 1) * 8] : argument 0 = receiver
869
+ // -----------------------------------
693
870
 
694
- Label miss;
871
+ SharedFunctionInfo* function_info = function->shared();
872
+ if (function_info->HasCustomCallGenerator()) {
873
+ CustomCallGenerator generator =
874
+ ToCData<CustomCallGenerator>(function_info->function_data());
875
+ Object* result = generator(this, object, holder, function, name, check);
876
+ // undefined means bail out to regular compiler.
877
+ if (!result->IsUndefined()) {
878
+ return result;
879
+ }
880
+ }
881
+
882
+ Label miss_in_smi_check;
695
883
 
696
884
  // Get the receiver from the stack.
697
885
  const int argc = arguments().immediate();
@@ -699,101 +887,122 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
699
887
 
700
888
  // Check that the receiver isn't a smi.
701
889
  if (check != NUMBER_CHECK) {
702
- __ JumpIfSmi(rdx, &miss);
890
+ __ JumpIfSmi(rdx, &miss_in_smi_check);
703
891
  }
704
892
 
705
893
  // Make sure that it's okay not to patch the on stack receiver
706
894
  // unless we're doing a receiver map check.
707
895
  ASSERT(!object->IsGlobalObject() || check == RECEIVER_MAP_CHECK);
708
896
 
897
+ CallOptimization optimization(function);
898
+ int depth = kInvalidProtoDepth;
899
+ Label miss;
900
+
709
901
  switch (check) {
710
902
  case RECEIVER_MAP_CHECK:
903
+ __ IncrementCounter(&Counters::call_const, 1);
904
+
905
+ if (optimization.is_simple_api_call() && !object->IsGlobalObject()) {
906
+ depth = optimization.GetPrototypeDepthOfExpectedType(
907
+ JSObject::cast(object), holder);
908
+ }
909
+
910
+ if (depth != kInvalidProtoDepth) {
911
+ __ IncrementCounter(&Counters::call_const_fast_api, 1);
912
+ ReserveSpaceForFastApiCall(masm(), rax);
913
+ }
914
+
711
915
  // Check that the maps haven't changed.
712
916
  CheckPrototypes(JSObject::cast(object), rdx, holder,
713
- rbx, rcx, name, &miss);
917
+ rbx, rax, name, depth, &miss);
714
918
 
715
919
  // Patch the receiver on the stack with the global proxy if
716
920
  // necessary.
717
921
  if (object->IsGlobalObject()) {
922
+ ASSERT(depth == kInvalidProtoDepth);
718
923
  __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset));
719
924
  __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx);
720
925
  }
721
926
  break;
722
927
 
723
928
  case STRING_CHECK:
724
- // Check that the object is a two-byte string or a symbol.
725
- __ CmpObjectType(rdx, FIRST_NONSTRING_TYPE, rcx);
726
- __ j(above_equal, &miss);
727
- // Check that the maps starting from the prototype haven't changed.
728
- GenerateLoadGlobalFunctionPrototype(masm(),
729
- Context::STRING_FUNCTION_INDEX,
730
- rcx);
731
- CheckPrototypes(JSObject::cast(object->GetPrototype()), rcx, holder,
732
- rbx, rdx, name, &miss);
929
+ if (!function->IsBuiltin()) {
930
+ // Calling non-builtins with a value as receiver requires boxing.
931
+ __ jmp(&miss);
932
+ } else {
933
+ // Check that the object is a two-byte string or a symbol.
934
+ __ CmpObjectType(rdx, FIRST_NONSTRING_TYPE, rax);
935
+ __ j(above_equal, &miss);
936
+ // Check that the maps starting from the prototype haven't changed.
937
+ GenerateLoadGlobalFunctionPrototype(masm(),
938
+ Context::STRING_FUNCTION_INDEX,
939
+ rax);
940
+ CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder,
941
+ rbx, rdx, name, &miss);
942
+ }
733
943
  break;
734
944
 
735
945
  case NUMBER_CHECK: {
736
- Label fast;
737
- // Check that the object is a smi or a heap number.
738
- __ JumpIfSmi(rdx, &fast);
739
- __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rcx);
740
- __ j(not_equal, &miss);
741
- __ bind(&fast);
742
- // Check that the maps starting from the prototype haven't changed.
743
- GenerateLoadGlobalFunctionPrototype(masm(),
744
- Context::NUMBER_FUNCTION_INDEX,
745
- rcx);
746
- CheckPrototypes(JSObject::cast(object->GetPrototype()), rcx, holder,
747
- rbx, rdx, name, &miss);
946
+ if (!function->IsBuiltin()) {
947
+ // Calling non-builtins with a value as receiver requires boxing.
948
+ __ jmp(&miss);
949
+ } else {
950
+ Label fast;
951
+ // Check that the object is a smi or a heap number.
952
+ __ JumpIfSmi(rdx, &fast);
953
+ __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rax);
954
+ __ j(not_equal, &miss);
955
+ __ bind(&fast);
956
+ // Check that the maps starting from the prototype haven't changed.
957
+ GenerateLoadGlobalFunctionPrototype(masm(),
958
+ Context::NUMBER_FUNCTION_INDEX,
959
+ rax);
960
+ CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder,
961
+ rbx, rdx, name, &miss);
962
+ }
748
963
  break;
749
964
  }
750
965
 
751
966
  case BOOLEAN_CHECK: {
752
- Label fast;
753
- // Check that the object is a boolean.
754
- __ CompareRoot(rdx, Heap::kTrueValueRootIndex);
755
- __ j(equal, &fast);
756
- __ CompareRoot(rdx, Heap::kFalseValueRootIndex);
757
- __ j(not_equal, &miss);
758
- __ bind(&fast);
759
- // Check that the maps starting from the prototype haven't changed.
760
- GenerateLoadGlobalFunctionPrototype(masm(),
761
- Context::BOOLEAN_FUNCTION_INDEX,
762
- rcx);
763
- CheckPrototypes(JSObject::cast(object->GetPrototype()), rcx, holder,
764
- rbx, rdx, name, &miss);
967
+ if (!function->IsBuiltin()) {
968
+ // Calling non-builtins with a value as receiver requires boxing.
969
+ __ jmp(&miss);
970
+ } else {
971
+ Label fast;
972
+ // Check that the object is a boolean.
973
+ __ CompareRoot(rdx, Heap::kTrueValueRootIndex);
974
+ __ j(equal, &fast);
975
+ __ CompareRoot(rdx, Heap::kFalseValueRootIndex);
976
+ __ j(not_equal, &miss);
977
+ __ bind(&fast);
978
+ // Check that the maps starting from the prototype haven't changed.
979
+ GenerateLoadGlobalFunctionPrototype(masm(),
980
+ Context::BOOLEAN_FUNCTION_INDEX,
981
+ rax);
982
+ CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder,
983
+ rbx, rdx, name, &miss);
984
+ }
765
985
  break;
766
986
  }
767
987
 
768
- case JSARRAY_HAS_FAST_ELEMENTS_CHECK:
769
- CheckPrototypes(JSObject::cast(object), rdx, holder,
770
- rbx, rcx, name, &miss);
771
- // Make sure object->HasFastElements().
772
- // Get the elements array of the object.
773
- __ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset));
774
- // Check that the object is in fast mode (not dictionary).
775
- __ Cmp(FieldOperand(rbx, HeapObject::kMapOffset),
776
- Factory::fixed_array_map());
777
- __ j(not_equal, &miss);
778
- break;
779
-
780
988
  default:
781
989
  UNREACHABLE();
782
990
  }
783
991
 
784
- // Get the function and setup the context.
785
- __ Move(rdi, Handle<JSFunction>(function));
786
- __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
787
-
788
- // Jump to the cached code (tail call).
789
- ASSERT(function->is_compiled());
790
- Handle<Code> code(function->code());
791
- ParameterCount expected(function->shared()->formal_parameter_count());
792
- __ InvokeCode(code, expected, arguments(),
793
- RelocInfo::CODE_TARGET, JUMP_FUNCTION);
992
+ if (depth != kInvalidProtoDepth) {
993
+ GenerateFastApiCall(masm(), optimization, argc);
994
+ } else {
995
+ __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
996
+ }
794
997
 
795
998
  // Handle call cache miss.
796
999
  __ bind(&miss);
1000
+ if (depth != kInvalidProtoDepth) {
1001
+ FreeSpaceForFastApiCall(masm(), rax);
1002
+ }
1003
+
1004
+ // Handle call cache miss.
1005
+ __ bind(&miss_in_smi_check);
797
1006
  Handle<Code> ic = ComputeCallMiss(arguments().immediate());
798
1007
  __ Jump(ic, RelocInfo::CODE_TARGET);
799
1008
 
@@ -806,19 +1015,19 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
806
1015
  }
807
1016
 
808
1017
 
809
- Object* CallStubCompiler::CompileCallField(Object* object,
1018
+ Object* CallStubCompiler::CompileCallField(JSObject* object,
810
1019
  JSObject* holder,
811
1020
  int index,
812
1021
  String* name) {
813
1022
  // ----------- S t a t e -------------
814
- // -----------------------------------
815
- // rsp[0] return address
816
- // rsp[8] argument argc
817
- // rsp[16] argument argc - 1
1023
+ // rcx : function name
1024
+ // rsp[0] : return address
1025
+ // rsp[8] : argument argc
1026
+ // rsp[16] : argument argc - 1
818
1027
  // ...
819
- // rsp[argc * 8] argument 1
820
- // rsp[(argc + 1) * 8] argument 0 = receiver
821
- // rsp[(argc + 2) * 8] function name
1028
+ // rsp[argc * 8] : argument 1
1029
+ // rsp[(argc + 1) * 8] : argument 0 = receiver
1030
+ // -----------------------------------
822
1031
  Label miss;
823
1032
 
824
1033
  // Get the receiver from the stack.
@@ -829,9 +1038,7 @@ Object* CallStubCompiler::CompileCallField(Object* object,
829
1038
  __ JumpIfSmi(rdx, &miss);
830
1039
 
831
1040
  // Do the right check and compute the holder register.
832
- Register reg =
833
- CheckPrototypes(JSObject::cast(object), rdx, holder,
834
- rbx, rcx, name, &miss);
1041
+ Register reg = CheckPrototypes(object, rdx, holder, rbx, rax, name, &miss);
835
1042
 
836
1043
  GenerateFastPropertyLoad(masm(), rdi, reg, holder, index);
837
1044
 
@@ -860,10 +1067,268 @@ Object* CallStubCompiler::CompileCallField(Object* object,
860
1067
  }
861
1068
 
862
1069
 
863
- Object* CallStubCompiler::CompileCallInterceptor(Object* object,
1070
+ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1071
+ JSObject* holder,
1072
+ JSFunction* function,
1073
+ String* name,
1074
+ CheckType check) {
1075
+ // ----------- S t a t e -------------
1076
+ // -- rcx : name
1077
+ // -- rsp[0] : return address
1078
+ // -- rsp[(argc - n) * 8] : arg[n] (zero-based)
1079
+ // -- ...
1080
+ // -- rsp[(argc + 1) * 8] : receiver
1081
+ // -----------------------------------
1082
+ ASSERT(check == RECEIVER_MAP_CHECK);
1083
+
1084
+ // If object is not an array, bail out to regular call.
1085
+ if (!object->IsJSArray()) {
1086
+ return Heap::undefined_value();
1087
+ }
1088
+
1089
+ Label miss;
1090
+
1091
+ // Get the receiver from the stack.
1092
+ const int argc = arguments().immediate();
1093
+ __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
1094
+
1095
+ // Check that the receiver isn't a smi.
1096
+ __ JumpIfSmi(rdx, &miss);
1097
+
1098
+ CheckPrototypes(JSObject::cast(object),
1099
+ rdx,
1100
+ holder,
1101
+ rbx,
1102
+ rax,
1103
+ name,
1104
+ &miss);
1105
+
1106
+ if (argc == 0) {
1107
+ // Noop, return the length.
1108
+ __ movq(rax, FieldOperand(rdx, JSArray::kLengthOffset));
1109
+ __ ret((argc + 1) * kPointerSize);
1110
+ } else {
1111
+ // Get the elements array of the object.
1112
+ __ movq(rbx, FieldOperand(rdx, JSArray::kElementsOffset));
1113
+
1114
+ // Check that the elements are in fast mode (not dictionary).
1115
+ __ Cmp(FieldOperand(rbx, HeapObject::kMapOffset),
1116
+ Factory::fixed_array_map());
1117
+ __ j(not_equal, &miss);
1118
+
1119
+ if (argc == 1) { // Otherwise fall through to call builtin.
1120
+ Label call_builtin, exit, with_rset_update, attempt_to_grow_elements;
1121
+
1122
+ // Get the array's length into rax and calculate new length.
1123
+ __ movq(rax, FieldOperand(rdx, JSArray::kLengthOffset));
1124
+ STATIC_ASSERT(FixedArray::kMaxLength < Smi::kMaxValue);
1125
+ __ SmiAddConstant(rax, rax, Smi::FromInt(argc));
1126
+
1127
+ // Get the element's length into rcx.
1128
+ __ movl(rcx, FieldOperand(rbx, FixedArray::kLengthOffset));
1129
+ __ Integer32ToSmi(rcx, rcx);
1130
+
1131
+ // Check if we could survive without allocation.
1132
+ __ SmiCompare(rax, rcx);
1133
+ __ j(greater, &attempt_to_grow_elements);
1134
+
1135
+ // Save new length.
1136
+ __ movq(FieldOperand(rdx, JSArray::kLengthOffset), rax);
1137
+
1138
+ // Push the element.
1139
+ __ movq(rcx, Operand(rsp, argc * kPointerSize));
1140
+ SmiIndex index =
1141
+ masm()->SmiToIndex(kScratchRegister, rax, times_pointer_size);
1142
+ __ lea(rdx, FieldOperand(rbx,
1143
+ index.reg, index.scale,
1144
+ FixedArray::kHeaderSize - argc * kPointerSize));
1145
+ __ movq(Operand(rdx, 0), rcx);
1146
+
1147
+ // Check if value is a smi.
1148
+ __ JumpIfNotSmi(rcx, &with_rset_update);
1149
+
1150
+ __ bind(&exit);
1151
+ __ ret((argc + 1) * kPointerSize);
1152
+
1153
+ __ bind(&with_rset_update);
1154
+
1155
+ __ InNewSpace(rbx, rcx, equal, &exit);
1156
+
1157
+ RecordWriteStub stub(rbx, rdx, rcx);
1158
+ __ CallStub(&stub);
1159
+ __ ret((argc + 1) * kPointerSize);
1160
+
1161
+ __ bind(&attempt_to_grow_elements);
1162
+ ExternalReference new_space_allocation_top =
1163
+ ExternalReference::new_space_allocation_top_address();
1164
+ ExternalReference new_space_allocation_limit =
1165
+ ExternalReference::new_space_allocation_limit_address();
1166
+
1167
+ const int kAllocationDelta = 4;
1168
+ // Load top.
1169
+ __ movq(rcx, new_space_allocation_top);
1170
+ __ movq(rcx, Operand(rcx, 0));
1171
+
1172
+ // Check if it's the end of elements.
1173
+ index = masm()->SmiToIndex(kScratchRegister, rax, times_pointer_size);
1174
+ __ lea(rdx, FieldOperand(rbx,
1175
+ index.reg, index.scale,
1176
+ FixedArray::kHeaderSize - argc * kPointerSize));
1177
+ __ cmpq(rdx, rcx);
1178
+ __ j(not_equal, &call_builtin);
1179
+ __ addq(rcx, Immediate(kAllocationDelta * kPointerSize));
1180
+ __ movq(kScratchRegister, new_space_allocation_limit);
1181
+ __ cmpq(rcx, Operand(kScratchRegister, 0));
1182
+ __ j(above, &call_builtin);
1183
+
1184
+ // We fit and could grow elements.
1185
+ __ movq(kScratchRegister, new_space_allocation_top);
1186
+ __ movq(Operand(kScratchRegister, 0), rcx);
1187
+ __ movq(rcx, Operand(rsp, argc * kPointerSize));
1188
+
1189
+ // Push the argument...
1190
+ __ movq(Operand(rdx, 0), rcx);
1191
+ // ... and fill the rest with holes.
1192
+ __ Move(kScratchRegister, Factory::the_hole_value());
1193
+ for (int i = 1; i < kAllocationDelta; i++) {
1194
+ __ movq(Operand(rdx, i * kPointerSize), kScratchRegister);
1195
+ }
1196
+
1197
+ // Restore receiver to rdx as finish sequence assumes it's here.
1198
+ __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
1199
+
1200
+ // Increment element's and array's sizes.
1201
+ __ addq(FieldOperand(rbx, FixedArray::kLengthOffset),
1202
+ Immediate(kAllocationDelta));
1203
+ __ movq(FieldOperand(rdx, JSArray::kLengthOffset), rax);
1204
+
1205
+ // Elements are in new space, so no remembered set updates are necessary.
1206
+ __ ret((argc + 1) * kPointerSize);
1207
+
1208
+ __ bind(&call_builtin);
1209
+ }
1210
+
1211
+ __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush),
1212
+ argc + 1,
1213
+ 1);
1214
+ }
1215
+
1216
+ __ bind(&miss);
1217
+
1218
+ Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1219
+ __ jmp(ic, RelocInfo::CODE_TARGET);
1220
+
1221
+ // Return the generated code.
1222
+ String* function_name = NULL;
1223
+ if (function->shared()->name()->IsString()) {
1224
+ function_name = String::cast(function->shared()->name());
1225
+ }
1226
+ return GetCode(CONSTANT_FUNCTION, function_name);
1227
+ }
1228
+
1229
+
1230
+ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
1231
+ JSObject* holder,
1232
+ JSFunction* function,
1233
+ String* name,
1234
+ CheckType check) {
1235
+ // ----------- S t a t e -------------
1236
+ // -- ecx : name
1237
+ // -- esp[0] : return address
1238
+ // -- esp[(argc - n) * 4] : arg[n] (zero-based)
1239
+ // -- ...
1240
+ // -- esp[(argc + 1) * 4] : receiver
1241
+ // -----------------------------------
1242
+ ASSERT(check == RECEIVER_MAP_CHECK);
1243
+
1244
+ // If object is not an array, bail out to regular call.
1245
+ if (!object->IsJSArray()) {
1246
+ return Heap::undefined_value();
1247
+ }
1248
+
1249
+ Label miss, return_undefined, call_builtin;
1250
+
1251
+ // Get the receiver from the stack.
1252
+ const int argc = arguments().immediate();
1253
+ __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
1254
+
1255
+ // Check that the receiver isn't a smi.
1256
+ __ JumpIfSmi(rdx, &miss);
1257
+
1258
+ CheckPrototypes(JSObject::cast(object), rdx,
1259
+ holder, rbx,
1260
+ rax, name, &miss);
1261
+
1262
+ // Get the elements array of the object.
1263
+ __ movq(rbx, FieldOperand(rdx, JSArray::kElementsOffset));
1264
+
1265
+ // Check that the elements are in fast mode (not dictionary).
1266
+ __ Cmp(FieldOperand(rbx, HeapObject::kMapOffset), Factory::fixed_array_map());
1267
+ __ j(not_equal, &miss);
1268
+
1269
+ // Get the array's length into rcx and calculate new length.
1270
+ __ movq(rcx, FieldOperand(rdx, JSArray::kLengthOffset));
1271
+ __ SmiSubConstant(rcx, rcx, Smi::FromInt(1));
1272
+ __ SmiTest(rcx);
1273
+ __ j(negative, &return_undefined);
1274
+
1275
+ // Get the last element.
1276
+ __ Move(r9, Factory::the_hole_value());
1277
+ SmiIndex index =
1278
+ masm()->SmiToIndex(r8, rcx, times_pointer_size);
1279
+ __ movq(rax, FieldOperand(rbx,
1280
+ index.reg, index.scale,
1281
+ FixedArray::kHeaderSize));
1282
+ // Check if element is already the hole.
1283
+ __ cmpq(rax, r9);
1284
+ __ j(equal, &call_builtin);
1285
+
1286
+ // Set the array's length.
1287
+ __ movq(FieldOperand(rdx, JSArray::kLengthOffset), rcx);
1288
+
1289
+ // Fill with the hole and return original value..
1290
+ __ movq(FieldOperand(rbx,
1291
+ index.reg, index.scale,
1292
+ FixedArray::kHeaderSize),
1293
+ r9);
1294
+ __ ret((argc + 1) * kPointerSize);
1295
+
1296
+ __ bind(&return_undefined);
1297
+
1298
+ __ Move(rax, Factory::undefined_value());
1299
+ __ ret((argc + 1) * kPointerSize);
1300
+
1301
+ __ bind(&call_builtin);
1302
+ __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPop),
1303
+ argc + 1,
1304
+ 1);
1305
+ __ bind(&miss);
1306
+
1307
+ Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1308
+ __ jmp(ic, RelocInfo::CODE_TARGET);
1309
+
1310
+ // Return the generated code.
1311
+ String* function_name = NULL;
1312
+ if (function->shared()->name()->IsString()) {
1313
+ function_name = String::cast(function->shared()->name());
1314
+ }
1315
+ return GetCode(CONSTANT_FUNCTION, function_name);
1316
+ }
1317
+
1318
+
1319
+
1320
+
1321
+ Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
864
1322
  JSObject* holder,
865
1323
  String* name) {
866
1324
  // ----------- S t a t e -------------
1325
+ // rcx : function name
1326
+ // rsp[0] : return address
1327
+ // rsp[8] : argument argc
1328
+ // rsp[16] : argument argc - 1
1329
+ // ...
1330
+ // rsp[argc * 8] : argument 1
1331
+ // rsp[(argc + 1) * 8] : argument 0 = receiver
867
1332
  // -----------------------------------
868
1333
  Label miss;
869
1334
 
@@ -876,18 +1341,16 @@ Object* CallStubCompiler::CompileCallInterceptor(Object* object,
876
1341
  // Get the receiver from the stack.
877
1342
  __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
878
1343
 
879
- CallInterceptorCompiler compiler(arguments());
880
- CompileLoadInterceptor(&compiler,
881
- this,
882
- masm(),
883
- JSObject::cast(object),
884
- holder,
885
- name,
886
- &lookup,
887
- rdx,
888
- rbx,
889
- rcx,
890
- &miss);
1344
+ CallInterceptorCompiler compiler(this, arguments(), rcx);
1345
+ compiler.Compile(masm(),
1346
+ object,
1347
+ holder,
1348
+ name,
1349
+ &lookup,
1350
+ rdx,
1351
+ rbx,
1352
+ rdi,
1353
+ &miss);
891
1354
 
892
1355
  // Restore receiver.
893
1356
  __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
@@ -918,7 +1381,6 @@ Object* CallStubCompiler::CompileCallInterceptor(Object* object,
918
1381
  }
919
1382
 
920
1383
 
921
-
922
1384
  Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
923
1385
  GlobalObject* holder,
924
1386
  JSGlobalPropertyCell* cell,
@@ -926,13 +1388,13 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
926
1388
  String* name) {
927
1389
  // ----------- S t a t e -------------
928
1390
  // -----------------------------------
929
- // rsp[0] return address
930
- // rsp[8] argument argc
931
- // rsp[16] argument argc - 1
1391
+ // rcx : function name
1392
+ // rsp[0] : return address
1393
+ // rsp[8] : argument argc
1394
+ // rsp[16] : argument argc - 1
932
1395
  // ...
933
- // rsp[argc * 8] argument 1
934
- // rsp[(argc + 1) * 8] argument 0 = receiver
935
- // rsp[(argc + 2) * 8] function name
1396
+ // rsp[argc * 8] : argument 1
1397
+ // rsp[(argc + 1) * 8] : argument 0 = receiver
936
1398
  Label miss;
937
1399
 
938
1400
  // Get the number of arguments.
@@ -949,7 +1411,7 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
949
1411
  }
950
1412
 
951
1413
  // Check that the maps haven't changed.
952
- CheckPrototypes(object, rdx, holder, rbx, rcx, name, &miss);
1414
+ CheckPrototypes(object, rdx, holder, rbx, rax, name, &miss);
953
1415
 
954
1416
  // Get the value from the cell.
955
1417
  __ Move(rdi, Handle<JSGlobalPropertyCell>(cell));
@@ -963,12 +1425,12 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
963
1425
  // function can all use this call IC. Before we load through the
964
1426
  // function, we have to verify that it still is a function.
965
1427
  __ JumpIfSmi(rdi, &miss);
966
- __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx);
1428
+ __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rax);
967
1429
  __ j(not_equal, &miss);
968
1430
 
969
1431
  // Check the shared function info. Make sure it hasn't changed.
970
- __ Move(rcx, Handle<SharedFunctionInfo>(function->shared()));
971
- __ cmpq(FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset), rcx);
1432
+ __ Move(rax, Handle<SharedFunctionInfo>(function->shared()));
1433
+ __ cmpq(FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset), rax);
972
1434
  __ j(not_equal, &miss);
973
1435
  } else {
974
1436
  __ Cmp(rdi, Handle<JSFunction>(function));
@@ -1049,6 +1511,51 @@ Object* LoadStubCompiler::CompileLoadConstant(JSObject* object,
1049
1511
  }
1050
1512
 
1051
1513
 
1514
+ Object* LoadStubCompiler::CompileLoadNonexistent(String* name,
1515
+ JSObject* object,
1516
+ JSObject* last) {
1517
+ // ----------- S t a t e -------------
1518
+ // -- rcx : name
1519
+ // -- rsp[0] : return address
1520
+ // -- rsp[8] : receiver
1521
+ // -----------------------------------
1522
+ Label miss;
1523
+
1524
+ // Load receiver.
1525
+ __ movq(rax, Operand(rsp, kPointerSize));
1526
+
1527
+ // Chech that receiver is not a smi.
1528
+ __ JumpIfSmi(rax, &miss);
1529
+
1530
+ // Check the maps of the full prototype chain. Also check that
1531
+ // global property cells up to (but not including) the last object
1532
+ // in the prototype chain are empty.
1533
+ CheckPrototypes(object, rax, last, rbx, rdx, name, &miss);
1534
+
1535
+ // If the last object in the prototype chain is a global object,
1536
+ // check that the global property cell is empty.
1537
+ if (last->IsGlobalObject()) {
1538
+ Object* cell = GenerateCheckPropertyCell(masm(),
1539
+ GlobalObject::cast(last),
1540
+ name,
1541
+ rdx,
1542
+ &miss);
1543
+ if (cell->IsFailure()) return cell;
1544
+ }
1545
+
1546
+ // Return undefined if maps of the full prototype chain are still the
1547
+ // same and no global property with this name contains a value.
1548
+ __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
1549
+ __ ret(0);
1550
+
1551
+ __ bind(&miss);
1552
+ GenerateLoadMiss(masm(), Code::LOAD_IC);
1553
+
1554
+ // Return the generated code.
1555
+ return GetCode(NONEXISTENT, Heap::empty_string());
1556
+ }
1557
+
1558
+
1052
1559
  Object* LoadStubCompiler::CompileLoadField(JSObject* object,
1053
1560
  JSObject* holder,
1054
1561
  int index,
@@ -1323,7 +1830,7 @@ Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
1323
1830
  __ Cmp(rax, Handle<String>(name));
1324
1831
  __ j(not_equal, &miss);
1325
1832
 
1326
- GenerateLoadStringLength(masm(), rcx, rdx, &miss);
1833
+ GenerateLoadStringLength(masm(), rcx, rdx, rbx, &miss);
1327
1834
  __ bind(&miss);
1328
1835
  __ DecrementCounter(&Counters::keyed_load_string_length, 1);
1329
1836
  GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
@@ -1339,25 +1846,22 @@ Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
1339
1846
  // ----------- S t a t e -------------
1340
1847
  // -- rax : value
1341
1848
  // -- rcx : name
1849
+ // -- rdx : receiver
1342
1850
  // -- rsp[0] : return address
1343
- // -- rsp[8] : receiver
1344
1851
  // -----------------------------------
1345
1852
  Label miss;
1346
1853
 
1347
- // Get the object from the stack.
1348
- __ movq(rbx, Operand(rsp, 1 * kPointerSize));
1349
-
1350
1854
  // Check that the object isn't a smi.
1351
- __ JumpIfSmi(rbx, &miss);
1855
+ __ JumpIfSmi(rdx, &miss);
1352
1856
 
1353
1857
  // Check that the map of the object hasn't changed.
1354
- __ Cmp(FieldOperand(rbx, HeapObject::kMapOffset),
1858
+ __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset),
1355
1859
  Handle<Map>(object->map()));
1356
1860
  __ j(not_equal, &miss);
1357
1861
 
1358
1862
  // Perform global security token check if needed.
1359
1863
  if (object->IsJSGlobalProxy()) {
1360
- __ CheckAccessGlobalProxy(rbx, rdx, &miss);
1864
+ __ CheckAccessGlobalProxy(rdx, rbx, &miss);
1361
1865
  }
1362
1866
 
1363
1867
  // Stub never generated for non-global objects that require access
@@ -1365,7 +1869,7 @@ Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
1365
1869
  ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
1366
1870
 
1367
1871
  __ pop(rbx); // remove the return address
1368
- __ push(Operand(rsp, 0)); // receiver
1872
+ __ push(rdx); // receiver
1369
1873
  __ Push(Handle<AccessorInfo>(callback)); // callback info
1370
1874
  __ push(rcx); // name
1371
1875
  __ push(rax); // value
@@ -1374,11 +1878,10 @@ Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
1374
1878
  // Do tail-call to the runtime system.
1375
1879
  ExternalReference store_callback_property =
1376
1880
  ExternalReference(IC_Utility(IC::kStoreCallbackProperty));
1377
- __ TailCallRuntime(store_callback_property, 4, 1);
1881
+ __ TailCallExternalReference(store_callback_property, 4, 1);
1378
1882
 
1379
1883
  // Handle store cache miss.
1380
1884
  __ bind(&miss);
1381
- __ Move(rcx, Handle<String>(name)); // restore name
1382
1885
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
1383
1886
  __ Jump(ic, RelocInfo::CODE_TARGET);
1384
1887
 
@@ -1394,26 +1897,21 @@ Object* StoreStubCompiler::CompileStoreField(JSObject* object,
1394
1897
  // ----------- S t a t e -------------
1395
1898
  // -- rax : value
1396
1899
  // -- rcx : name
1900
+ // -- rdx : receiver
1397
1901
  // -- rsp[0] : return address
1398
- // -- rsp[8] : receiver
1399
1902
  // -----------------------------------
1400
1903
  Label miss;
1401
1904
 
1402
- // Get the object from the stack.
1403
- __ movq(rbx, Operand(rsp, 1 * kPointerSize));
1404
-
1405
- // Generate store field code. Trashes the name register.
1905
+ // Generate store field code. Preserves receiver and name on jump to miss.
1406
1906
  GenerateStoreField(masm(),
1407
- Builtins::StoreIC_ExtendStorage,
1408
1907
  object,
1409
1908
  index,
1410
1909
  transition,
1411
- rbx, rcx, rdx,
1910
+ rdx, rcx, rbx,
1412
1911
  &miss);
1413
1912
 
1414
1913
  // Handle store cache miss.
1415
1914
  __ bind(&miss);
1416
- __ Move(rcx, Handle<String>(name)); // restore name
1417
1915
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
1418
1916
  __ Jump(ic, RelocInfo::CODE_TARGET);
1419
1917
 
@@ -1427,25 +1925,22 @@ Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
1427
1925
  // ----------- S t a t e -------------
1428
1926
  // -- rax : value
1429
1927
  // -- rcx : name
1928
+ // -- rdx : receiver
1430
1929
  // -- rsp[0] : return address
1431
- // -- rsp[8] : receiver
1432
1930
  // -----------------------------------
1433
1931
  Label miss;
1434
1932
 
1435
- // Get the object from the stack.
1436
- __ movq(rbx, Operand(rsp, 1 * kPointerSize));
1437
-
1438
1933
  // Check that the object isn't a smi.
1439
- __ JumpIfSmi(rbx, &miss);
1934
+ __ JumpIfSmi(rdx, &miss);
1440
1935
 
1441
1936
  // Check that the map of the object hasn't changed.
1442
- __ Cmp(FieldOperand(rbx, HeapObject::kMapOffset),
1937
+ __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset),
1443
1938
  Handle<Map>(receiver->map()));
1444
1939
  __ j(not_equal, &miss);
1445
1940
 
1446
1941
  // Perform global security token check if needed.
1447
1942
  if (receiver->IsJSGlobalProxy()) {
1448
- __ CheckAccessGlobalProxy(rbx, rdx, &miss);
1943
+ __ CheckAccessGlobalProxy(rdx, rbx, &miss);
1449
1944
  }
1450
1945
 
1451
1946
  // Stub never generated for non-global objects that require access
@@ -1453,7 +1948,7 @@ Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
1453
1948
  ASSERT(receiver->IsJSGlobalProxy() || !receiver->IsAccessCheckNeeded());
1454
1949
 
1455
1950
  __ pop(rbx); // remove the return address
1456
- __ push(Operand(rsp, 0)); // receiver
1951
+ __ push(rdx); // receiver
1457
1952
  __ push(rcx); // name
1458
1953
  __ push(rax); // value
1459
1954
  __ push(rbx); // restore return address
@@ -1461,11 +1956,10 @@ Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
1461
1956
  // Do tail-call to the runtime system.
1462
1957
  ExternalReference store_ic_property =
1463
1958
  ExternalReference(IC_Utility(IC::kStoreInterceptorProperty));
1464
- __ TailCallRuntime(store_ic_property, 3, 1);
1959
+ __ TailCallExternalReference(store_ic_property, 3, 1);
1465
1960
 
1466
1961
  // Handle store cache miss.
1467
1962
  __ bind(&miss);
1468
- __ Move(rcx, Handle<String>(name)); // restore name
1469
1963
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
1470
1964
  __ Jump(ic, RelocInfo::CODE_TARGET);
1471
1965
 
@@ -1480,14 +1974,13 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
1480
1974
  // ----------- S t a t e -------------
1481
1975
  // -- rax : value
1482
1976
  // -- rcx : name
1977
+ // -- rdx : receiver
1483
1978
  // -- rsp[0] : return address
1484
- // -- rsp[8] : receiver
1485
1979
  // -----------------------------------
1486
1980
  Label miss;
1487
1981
 
1488
1982
  // Check that the map of the global has not changed.
1489
- __ movq(rbx, Operand(rsp, kPointerSize));
1490
- __ Cmp(FieldOperand(rbx, HeapObject::kMapOffset),
1983
+ __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset),
1491
1984
  Handle<Map>(object->map()));
1492
1985
  __ j(not_equal, &miss);
1493
1986
 
@@ -1560,16 +2053,15 @@ Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
1560
2053
  __ Cmp(rcx, Handle<String>(name));
1561
2054
  __ j(not_equal, &miss);
1562
2055
 
1563
- // Get the object from the stack.
1564
- __ movq(rbx, Operand(rsp, 2 * kPointerSize));
2056
+ // Get the receiver from the stack.
2057
+ __ movq(rdx, Operand(rsp, 2 * kPointerSize));
1565
2058
 
1566
- // Generate store field code. Trashes the name register.
2059
+ // Generate store field code. Preserves receiver and name on jump to miss.
1567
2060
  GenerateStoreField(masm(),
1568
- Builtins::KeyedStoreIC_ExtendStorage,
1569
2061
  object,
1570
2062
  index,
1571
2063
  transition,
1572
- rbx, rcx, rdx,
2064
+ rdx, rcx, rbx,
1573
2065
  &miss);
1574
2066
 
1575
2067
  // Handle store cache miss.
@@ -1663,7 +2155,7 @@ bool StubCompiler::GenerateLoadCallback(JSObject* object,
1663
2155
  // Do tail-call to the runtime system.
1664
2156
  ExternalReference load_callback_property =
1665
2157
  ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
1666
- __ TailCallRuntime(load_callback_property, 5, 1);
2158
+ __ TailCallExternalReference(load_callback_property, 5, 1);
1667
2159
 
1668
2160
  return true;
1669
2161
  }
@@ -1675,27 +2167,32 @@ Register StubCompiler::CheckPrototypes(JSObject* object,
1675
2167
  Register holder_reg,
1676
2168
  Register scratch,
1677
2169
  String* name,
2170
+ int save_at_depth,
1678
2171
  Label* miss) {
1679
2172
  // Check that the maps haven't changed.
1680
2173
  Register result =
1681
- __ CheckMaps(object, object_reg, holder, holder_reg, scratch, miss);
2174
+ masm()->CheckMaps(object,
2175
+ object_reg,
2176
+ holder,
2177
+ holder_reg,
2178
+ scratch,
2179
+ save_at_depth,
2180
+ miss);
1682
2181
 
1683
2182
  // If we've skipped any global objects, it's not enough to verify
1684
- // that their maps haven't changed.
2183
+ // that their maps haven't changed. We also need to check that the
2184
+ // property cell for the property is still empty.
1685
2185
  while (object != holder) {
1686
2186
  if (object->IsGlobalObject()) {
1687
- GlobalObject* global = GlobalObject::cast(object);
1688
- Object* probe = global->EnsurePropertyCell(name);
1689
- if (probe->IsFailure()) {
1690
- set_failure(Failure::cast(probe));
2187
+ Object* cell = GenerateCheckPropertyCell(masm(),
2188
+ GlobalObject::cast(object),
2189
+ name,
2190
+ scratch,
2191
+ miss);
2192
+ if (cell->IsFailure()) {
2193
+ set_failure(Failure::cast(cell));
1691
2194
  return result;
1692
2195
  }
1693
- JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(probe);
1694
- ASSERT(cell->value()->IsTheHole());
1695
- __ Move(scratch, Handle<Object>(cell));
1696
- __ Cmp(FieldOperand(scratch, JSGlobalPropertyCell::kValueOffset),
1697
- Factory::the_hole_value());
1698
- __ j(not_equal, miss);
1699
2196
  }
1700
2197
  object = JSObject::cast(object->GetPrototype());
1701
2198
  }