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
@@ -63,8 +63,8 @@ class SimulatorStack : public v8::internal::AllStatic {
63
63
 
64
64
  // Call the generated regexp code directly. The entry function pointer should
65
65
  // expect eight int/pointer sized arguments and return an int.
66
- #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \
67
- entry(p0, p1, p2, p3, p4, p5, p6, p7)
66
+ #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
67
+ entry(p0, p1, p2, p3, p4, p5, p6)
68
68
 
69
69
  #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
70
70
  reinterpret_cast<TryCatch*>(try_catch_address)
@@ -79,9 +79,9 @@ class SimulatorStack : public v8::internal::AllStatic {
79
79
  assembler::arm::Simulator::current()->Call(FUNCTION_ADDR(entry), 5, \
80
80
  p0, p1, p2, p3, p4))
81
81
 
82
- #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \
82
+ #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
83
83
  assembler::arm::Simulator::current()->Call( \
84
- FUNCTION_ADDR(entry), 8, p0, p1, p2, p3, p4, p5, p6, p7)
84
+ FUNCTION_ADDR(entry), 7, p0, p1, p2, p3, p4, p5, p6)
85
85
 
86
86
  #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
87
87
  try_catch_address == NULL ? \
@@ -89,11 +89,43 @@ class SimulatorStack : public v8::internal::AllStatic {
89
89
 
90
90
 
91
91
  #include "constants-arm.h"
92
+ #include "hashmap.h"
92
93
 
93
94
 
94
95
  namespace assembler {
95
96
  namespace arm {
96
97
 
98
+ class CachePage {
99
+ public:
100
+ static const int LINE_VALID = 0;
101
+ static const int LINE_INVALID = 1;
102
+
103
+ static const int kPageShift = 12;
104
+ static const int kPageSize = 1 << kPageShift;
105
+ static const int kPageMask = kPageSize - 1;
106
+ static const int kLineShift = 2; // The cache line is only 4 bytes right now.
107
+ static const int kLineLength = 1 << kLineShift;
108
+ static const int kLineMask = kLineLength - 1;
109
+
110
+ CachePage() {
111
+ memset(&validity_map_, LINE_INVALID, sizeof(validity_map_));
112
+ }
113
+
114
+ char* ValidityByte(int offset) {
115
+ return &validity_map_[offset >> kLineShift];
116
+ }
117
+
118
+ char* CachedData(int offset) {
119
+ return &data_[offset];
120
+ }
121
+
122
+ private:
123
+ char data_[kPageSize]; // The cached data.
124
+ static const int kValidityMapSize = kPageSize >> kLineShift;
125
+ char validity_map_[kValidityMapSize]; // One byte per line.
126
+ };
127
+
128
+
97
129
  class Simulator {
98
130
  public:
99
131
  friend class Debugger;
@@ -162,6 +194,9 @@ class Simulator {
162
194
  // Pop an address from the JS stack.
163
195
  uintptr_t PopAddress();
164
196
 
197
+ // ICache checking.
198
+ static void FlushICache(void* start, size_t size);
199
+
165
200
  private:
166
201
  enum special_values {
167
202
  // Known bad pc value to ensure that the simulator does not execute
@@ -231,9 +266,19 @@ class Simulator {
231
266
  void DecodeTypeVFP(Instr* instr);
232
267
  void DecodeType6CoprocessorIns(Instr* instr);
233
268
 
269
+ void DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(Instr* instr);
270
+ void DecodeVCMP(Instr* instr);
271
+ void DecodeVCVTBetweenDoubleAndSingle(Instr* instr);
272
+ void DecodeVCVTBetweenFloatingPointAndInteger(Instr* instr);
273
+
234
274
  // Executes one instruction.
235
275
  void InstructionDecode(Instr* instr);
236
276
 
277
+ // ICache.
278
+ static void CheckICache(Instr* instr);
279
+ static void FlushOnePage(intptr_t start, int size);
280
+ static CachePage* GetCachePage(void* page);
281
+
237
282
  // Runtime call support.
238
283
  static void* RedirectExternalReference(void* external_function,
239
284
  bool fp_return);
@@ -271,6 +316,9 @@ class Simulator {
271
316
  int icount_;
272
317
  static bool initialized_;
273
318
 
319
+ // Icache simulation
320
+ static v8::internal::HashMap* i_cache_;
321
+
274
322
  // Registered breakpoints.
275
323
  Instr* break_pc_;
276
324
  instr_t break_instr_;
@@ -53,7 +53,7 @@ static void ProbeTable(MacroAssembler* masm,
53
53
  // Check that the key in the entry matches the name.
54
54
  __ mov(ip, Operand(key_offset));
55
55
  __ ldr(ip, MemOperand(ip, offset, LSL, 1));
56
- __ cmp(name, Operand(ip));
56
+ __ cmp(name, ip);
57
57
  __ b(ne, &miss);
58
58
 
59
59
  // Get the code entry from the cache.
@@ -189,8 +189,9 @@ void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm,
189
189
  }
190
190
 
191
191
 
192
- // Generate code to check if an object is a string. If the object is
193
- // a string, the map's instance type is left in the scratch1 register.
192
+ // Generate code to check if an object is a string. If the object is a
193
+ // heap object, its map's instance type is left in the scratch1 register.
194
+ // If this is not needed, scratch1 and scratch2 may be the same register.
194
195
  static void GenerateStringCheck(MacroAssembler* masm,
195
196
  Register receiver,
196
197
  Register scratch1,
@@ -215,22 +216,19 @@ static void GenerateStringCheck(MacroAssembler* masm,
215
216
  // If the receiver object is not a string or a wrapped string object the
216
217
  // execution continues at the miss label. The register containing the
217
218
  // receiver is potentially clobbered.
218
- void StubCompiler::GenerateLoadStringLength2(MacroAssembler* masm,
219
- Register receiver,
220
- Register scratch1,
221
- Register scratch2,
222
- Label* miss) {
223
- Label check_string, check_wrapper;
224
-
225
- __ bind(&check_string);
219
+ void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm,
220
+ Register receiver,
221
+ Register scratch1,
222
+ Register scratch2,
223
+ Label* miss) {
224
+ Label check_wrapper;
225
+
226
226
  // Check if the object is a string leaving the instance type in the
227
227
  // scratch1 register.
228
- GenerateStringCheck(masm, receiver, scratch1, scratch2,
229
- miss, &check_wrapper);
228
+ GenerateStringCheck(masm, receiver, scratch1, scratch2, miss, &check_wrapper);
230
229
 
231
230
  // Load length directly from the string.
232
231
  __ ldr(r0, FieldMemOperand(receiver, String::kLengthOffset));
233
- __ mov(r0, Operand(r0, LSL, kSmiTagSize));
234
232
  __ Ret();
235
233
 
236
234
  // Check if the object is a JSValue wrapper.
@@ -238,9 +236,11 @@ void StubCompiler::GenerateLoadStringLength2(MacroAssembler* masm,
238
236
  __ cmp(scratch1, Operand(JS_VALUE_TYPE));
239
237
  __ b(ne, miss);
240
238
 
241
- // Unwrap the value in place and check if the wrapped value is a string.
242
- __ ldr(receiver, FieldMemOperand(receiver, JSValue::kValueOffset));
243
- __ b(&check_string);
239
+ // Unwrap the value and check if the wrapped value is a string.
240
+ __ ldr(scratch1, FieldMemOperand(receiver, JSValue::kValueOffset));
241
+ GenerateStringCheck(masm, scratch1, scratch2, scratch2, miss, miss);
242
+ __ ldr(r0, FieldMemOperand(scratch1, String::kLengthOffset));
243
+ __ Ret();
244
244
  }
245
245
 
246
246
 
@@ -256,10 +256,10 @@ void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm,
256
256
 
257
257
 
258
258
  // Generate StoreField code, value is passed in r0 register.
259
- // After executing generated code, the receiver_reg and name_reg
260
- // may be clobbered.
259
+ // When leaving generated code after success, the receiver_reg and name_reg
260
+ // may be clobbered. Upon branch to miss_label, the receiver and name
261
+ // registers have their original values.
261
262
  void StubCompiler::GenerateStoreField(MacroAssembler* masm,
262
- Builtins::Name storage_extend,
263
263
  JSObject* object,
264
264
  int index,
265
265
  Map* transition,
@@ -292,11 +292,12 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
292
292
  if ((transition != NULL) && (object->map()->unused_property_fields() == 0)) {
293
293
  // The properties must be extended before we can store the value.
294
294
  // We jump to a runtime call that extends the properties array.
295
+ __ push(receiver_reg);
295
296
  __ mov(r2, Operand(Handle<Map>(transition)));
296
- // Please note, if we implement keyed store for arm we need
297
- // to call the Builtins::KeyedStoreIC_ExtendStorage.
298
- Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_ExtendStorage));
299
- __ Jump(ic, RelocInfo::CODE_TARGET);
297
+ __ Push(r2, r0);
298
+ __ TailCallExternalReference(
299
+ ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage)),
300
+ 3, 1);
300
301
  return;
301
302
  }
302
303
 
@@ -362,6 +363,512 @@ void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) {
362
363
  }
363
364
 
364
365
 
366
+ static void GenerateCallFunction(MacroAssembler* masm,
367
+ Object* object,
368
+ const ParameterCount& arguments,
369
+ Label* miss) {
370
+ // ----------- S t a t e -------------
371
+ // -- r0: receiver
372
+ // -- r1: function to call
373
+ // -----------------------------------
374
+
375
+ // Check that the function really is a function.
376
+ __ BranchOnSmi(r1, miss);
377
+ __ CompareObjectType(r1, r3, r3, JS_FUNCTION_TYPE);
378
+ __ b(ne, miss);
379
+
380
+ // Patch the receiver on the stack with the global proxy if
381
+ // necessary.
382
+ if (object->IsGlobalObject()) {
383
+ __ ldr(r3, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset));
384
+ __ str(r3, MemOperand(sp, arguments.immediate() * kPointerSize));
385
+ }
386
+
387
+ // Invoke the function.
388
+ __ InvokeFunction(r1, arguments, JUMP_FUNCTION);
389
+ }
390
+
391
+
392
+ static void PushInterceptorArguments(MacroAssembler* masm,
393
+ Register receiver,
394
+ Register holder,
395
+ Register name,
396
+ JSObject* holder_obj) {
397
+ __ push(name);
398
+ InterceptorInfo* interceptor = holder_obj->GetNamedInterceptor();
399
+ ASSERT(!Heap::InNewSpace(interceptor));
400
+ Register scratch = name;
401
+ __ mov(scratch, Operand(Handle<Object>(interceptor)));
402
+ __ push(scratch);
403
+ __ push(receiver);
404
+ __ push(holder);
405
+ __ ldr(scratch, FieldMemOperand(scratch, InterceptorInfo::kDataOffset));
406
+ __ push(scratch);
407
+ }
408
+
409
+
410
+ static void CompileCallLoadPropertyWithInterceptor(MacroAssembler* masm,
411
+ Register receiver,
412
+ Register holder,
413
+ Register name,
414
+ JSObject* holder_obj) {
415
+ PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
416
+
417
+ ExternalReference ref =
418
+ ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly));
419
+ __ mov(r0, Operand(5));
420
+ __ mov(r1, Operand(ref));
421
+
422
+ CEntryStub stub(1);
423
+ __ CallStub(&stub);
424
+ }
425
+
426
+
427
+ class LoadInterceptorCompiler BASE_EMBEDDED {
428
+ public:
429
+ explicit LoadInterceptorCompiler(Register name) : name_(name) {}
430
+
431
+ void CompileCacheable(MacroAssembler* masm,
432
+ StubCompiler* stub_compiler,
433
+ Register receiver,
434
+ Register holder,
435
+ Register scratch1,
436
+ Register scratch2,
437
+ JSObject* holder_obj,
438
+ LookupResult* lookup,
439
+ String* name,
440
+ Label* miss_label) {
441
+ AccessorInfo* callback = NULL;
442
+ bool optimize = false;
443
+ // So far the most popular follow ups for interceptor loads are FIELD
444
+ // and CALLBACKS, so inline only them, other cases may be added
445
+ // later.
446
+ if (lookup->type() == FIELD) {
447
+ optimize = true;
448
+ } else if (lookup->type() == CALLBACKS) {
449
+ Object* callback_object = lookup->GetCallbackObject();
450
+ if (callback_object->IsAccessorInfo()) {
451
+ callback = AccessorInfo::cast(callback_object);
452
+ optimize = callback->getter() != NULL;
453
+ }
454
+ }
455
+
456
+ if (!optimize) {
457
+ CompileRegular(masm, receiver, holder, scratch2, holder_obj, miss_label);
458
+ return;
459
+ }
460
+
461
+ // Note: starting a frame here makes GC aware of pointers pushed below.
462
+ __ EnterInternalFrame();
463
+
464
+ __ push(receiver);
465
+ __ Push(holder, name_);
466
+
467
+ CompileCallLoadPropertyWithInterceptor(masm,
468
+ receiver,
469
+ holder,
470
+ name_,
471
+ holder_obj);
472
+
473
+ Label interceptor_failed;
474
+ // Compare with no_interceptor_result_sentinel.
475
+ __ LoadRoot(scratch1, Heap::kNoInterceptorResultSentinelRootIndex);
476
+ __ cmp(r0, scratch1);
477
+ __ b(eq, &interceptor_failed);
478
+ __ LeaveInternalFrame();
479
+ __ Ret();
480
+
481
+ __ bind(&interceptor_failed);
482
+ __ pop(name_);
483
+ __ pop(holder);
484
+ __ pop(receiver);
485
+
486
+ __ LeaveInternalFrame();
487
+
488
+ if (lookup->type() == FIELD) {
489
+ holder = stub_compiler->CheckPrototypes(holder_obj,
490
+ holder,
491
+ lookup->holder(),
492
+ scratch1,
493
+ scratch2,
494
+ name,
495
+ miss_label);
496
+ stub_compiler->GenerateFastPropertyLoad(masm,
497
+ r0,
498
+ holder,
499
+ lookup->holder(),
500
+ lookup->GetFieldIndex());
501
+ __ Ret();
502
+ } else {
503
+ ASSERT(lookup->type() == CALLBACKS);
504
+ ASSERT(lookup->GetCallbackObject()->IsAccessorInfo());
505
+ ASSERT(callback != NULL);
506
+ ASSERT(callback->getter() != NULL);
507
+
508
+ Label cleanup;
509
+ __ pop(scratch2);
510
+ __ Push(receiver, scratch2);
511
+
512
+ holder = stub_compiler->CheckPrototypes(holder_obj, holder,
513
+ lookup->holder(), scratch1,
514
+ scratch2,
515
+ name,
516
+ &cleanup);
517
+
518
+ __ push(holder);
519
+ __ Move(holder, Handle<AccessorInfo>(callback));
520
+ __ push(holder);
521
+ __ ldr(scratch1, FieldMemOperand(holder, AccessorInfo::kDataOffset));
522
+ __ Push(scratch1, name_);
523
+
524
+ ExternalReference ref =
525
+ ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
526
+ __ TailCallExternalReference(ref, 5, 1);
527
+
528
+ __ bind(&cleanup);
529
+ __ pop(scratch1);
530
+ __ pop(scratch2);
531
+ __ push(scratch1);
532
+ }
533
+ }
534
+
535
+
536
+ void CompileRegular(MacroAssembler* masm,
537
+ Register receiver,
538
+ Register holder,
539
+ Register scratch,
540
+ JSObject* holder_obj,
541
+ Label* miss_label) {
542
+ PushInterceptorArguments(masm, receiver, holder, name_, holder_obj);
543
+
544
+ ExternalReference ref = ExternalReference(
545
+ IC_Utility(IC::kLoadPropertyWithInterceptorForLoad));
546
+ __ TailCallExternalReference(ref, 5, 1);
547
+ }
548
+
549
+ private:
550
+ Register name_;
551
+ };
552
+
553
+
554
+ static void CompileLoadInterceptor(LoadInterceptorCompiler* compiler,
555
+ StubCompiler* stub_compiler,
556
+ MacroAssembler* masm,
557
+ JSObject* object,
558
+ JSObject* holder,
559
+ String* name,
560
+ LookupResult* lookup,
561
+ Register receiver,
562
+ Register scratch1,
563
+ Register scratch2,
564
+ Label* miss) {
565
+ ASSERT(holder->HasNamedInterceptor());
566
+ ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
567
+
568
+ // Check that the receiver isn't a smi.
569
+ __ BranchOnSmi(receiver, miss);
570
+
571
+ // Check that the maps haven't changed.
572
+ Register reg =
573
+ stub_compiler->CheckPrototypes(object, receiver, holder,
574
+ scratch1, scratch2, name, miss);
575
+
576
+ if (lookup->IsProperty() && lookup->IsCacheable()) {
577
+ compiler->CompileCacheable(masm,
578
+ stub_compiler,
579
+ receiver,
580
+ reg,
581
+ scratch1,
582
+ scratch2,
583
+ holder,
584
+ lookup,
585
+ name,
586
+ miss);
587
+ } else {
588
+ compiler->CompileRegular(masm,
589
+ receiver,
590
+ reg,
591
+ scratch2,
592
+ holder,
593
+ miss);
594
+ }
595
+ }
596
+
597
+
598
+ // Reserves space for the extra arguments to FastHandleApiCall in the
599
+ // caller's frame.
600
+ //
601
+ // These arguments are set by CheckPrototypes and GenerateFastApiCall.
602
+ static void ReserveSpaceForFastApiCall(MacroAssembler* masm,
603
+ Register scratch) {
604
+ __ mov(scratch, Operand(Smi::FromInt(0)));
605
+ __ push(scratch);
606
+ __ push(scratch);
607
+ __ push(scratch);
608
+ __ push(scratch);
609
+ }
610
+
611
+
612
+ // Undoes the effects of ReserveSpaceForFastApiCall.
613
+ static void FreeSpaceForFastApiCall(MacroAssembler* masm) {
614
+ __ Drop(4);
615
+ }
616
+
617
+
618
+ // Generates call to FastHandleApiCall builtin.
619
+ static void GenerateFastApiCall(MacroAssembler* masm,
620
+ const CallOptimization& optimization,
621
+ int argc) {
622
+ // Get the function and setup the context.
623
+ JSFunction* function = optimization.constant_function();
624
+ __ mov(r7, Operand(Handle<JSFunction>(function)));
625
+ __ ldr(cp, FieldMemOperand(r7, JSFunction::kContextOffset));
626
+
627
+ // Pass the additional arguments FastHandleApiCall expects.
628
+ bool info_loaded = false;
629
+ Object* callback = optimization.api_call_info()->callback();
630
+ if (Heap::InNewSpace(callback)) {
631
+ info_loaded = true;
632
+ __ Move(r0, Handle<CallHandlerInfo>(optimization.api_call_info()));
633
+ __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kCallbackOffset));
634
+ } else {
635
+ __ Move(r6, Handle<Object>(callback));
636
+ }
637
+ Object* call_data = optimization.api_call_info()->data();
638
+ if (Heap::InNewSpace(call_data)) {
639
+ if (!info_loaded) {
640
+ __ Move(r0, Handle<CallHandlerInfo>(optimization.api_call_info()));
641
+ }
642
+ __ ldr(r5, FieldMemOperand(r0, CallHandlerInfo::kDataOffset));
643
+ } else {
644
+ __ Move(r5, Handle<Object>(call_data));
645
+ }
646
+
647
+ __ add(sp, sp, Operand(1 * kPointerSize));
648
+ __ stm(ia, sp, r5.bit() | r6.bit() | r7.bit());
649
+ __ sub(sp, sp, Operand(1 * kPointerSize));
650
+
651
+ // Set the number of arguments.
652
+ __ mov(r0, Operand(argc + 4));
653
+
654
+ // Jump to the fast api call builtin (tail call).
655
+ Handle<Code> code = Handle<Code>(
656
+ Builtins::builtin(Builtins::FastHandleApiCall));
657
+ ParameterCount expected(0);
658
+ __ InvokeCode(code, expected, expected,
659
+ RelocInfo::CODE_TARGET, JUMP_FUNCTION);
660
+ }
661
+
662
+
663
+ class CallInterceptorCompiler BASE_EMBEDDED {
664
+ public:
665
+ CallInterceptorCompiler(StubCompiler* stub_compiler,
666
+ const ParameterCount& arguments,
667
+ Register name)
668
+ : stub_compiler_(stub_compiler),
669
+ arguments_(arguments),
670
+ name_(name) {}
671
+
672
+ void Compile(MacroAssembler* masm,
673
+ JSObject* object,
674
+ JSObject* holder,
675
+ String* name,
676
+ LookupResult* lookup,
677
+ Register receiver,
678
+ Register scratch1,
679
+ Register scratch2,
680
+ Label* miss) {
681
+ ASSERT(holder->HasNamedInterceptor());
682
+ ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
683
+
684
+ // Check that the receiver isn't a smi.
685
+ __ BranchOnSmi(receiver, miss);
686
+
687
+ CallOptimization optimization(lookup);
688
+
689
+ if (optimization.is_constant_call()) {
690
+ CompileCacheable(masm,
691
+ object,
692
+ receiver,
693
+ scratch1,
694
+ scratch2,
695
+ holder,
696
+ lookup,
697
+ name,
698
+ optimization,
699
+ miss);
700
+ } else {
701
+ CompileRegular(masm,
702
+ object,
703
+ receiver,
704
+ scratch1,
705
+ scratch2,
706
+ name,
707
+ holder,
708
+ miss);
709
+ }
710
+ }
711
+
712
+ private:
713
+ void CompileCacheable(MacroAssembler* masm,
714
+ JSObject* object,
715
+ Register receiver,
716
+ Register scratch1,
717
+ Register scratch2,
718
+ JSObject* holder_obj,
719
+ LookupResult* lookup,
720
+ String* name,
721
+ const CallOptimization& optimization,
722
+ Label* miss_label) {
723
+ ASSERT(optimization.is_constant_call());
724
+ ASSERT(!lookup->holder()->IsGlobalObject());
725
+
726
+ int depth1 = kInvalidProtoDepth;
727
+ int depth2 = kInvalidProtoDepth;
728
+ bool can_do_fast_api_call = false;
729
+ if (optimization.is_simple_api_call() &&
730
+ !lookup->holder()->IsGlobalObject()) {
731
+ depth1 = optimization.GetPrototypeDepthOfExpectedType(object, holder_obj);
732
+ if (depth1 == kInvalidProtoDepth) {
733
+ depth2 = optimization.GetPrototypeDepthOfExpectedType(holder_obj,
734
+ lookup->holder());
735
+ }
736
+ can_do_fast_api_call = (depth1 != kInvalidProtoDepth) ||
737
+ (depth2 != kInvalidProtoDepth);
738
+ }
739
+
740
+ __ IncrementCounter(&Counters::call_const_interceptor, 1,
741
+ scratch1, scratch2);
742
+
743
+ if (can_do_fast_api_call) {
744
+ __ IncrementCounter(&Counters::call_const_interceptor_fast_api, 1,
745
+ scratch1, scratch2);
746
+ ReserveSpaceForFastApiCall(masm, scratch1);
747
+ }
748
+
749
+ Label miss_cleanup;
750
+ Label* miss = can_do_fast_api_call ? &miss_cleanup : miss_label;
751
+ Register holder =
752
+ stub_compiler_->CheckPrototypes(object, receiver, holder_obj, scratch1,
753
+ scratch2, name, depth1, miss);
754
+
755
+ Label regular_invoke;
756
+ LoadWithInterceptor(masm, receiver, holder, holder_obj, scratch2,
757
+ &regular_invoke);
758
+
759
+ // Generate code for the failed interceptor case.
760
+
761
+ // Check the lookup is still valid.
762
+ stub_compiler_->CheckPrototypes(holder_obj, receiver,
763
+ lookup->holder(), scratch1,
764
+ scratch2, name, depth2, miss);
765
+
766
+ if (can_do_fast_api_call) {
767
+ GenerateFastApiCall(masm, optimization, arguments_.immediate());
768
+ } else {
769
+ __ InvokeFunction(optimization.constant_function(), arguments_,
770
+ JUMP_FUNCTION);
771
+ }
772
+
773
+ if (can_do_fast_api_call) {
774
+ __ bind(&miss_cleanup);
775
+ FreeSpaceForFastApiCall(masm);
776
+ __ b(miss_label);
777
+ }
778
+
779
+ __ bind(&regular_invoke);
780
+ if (can_do_fast_api_call) {
781
+ FreeSpaceForFastApiCall(masm);
782
+ }
783
+ }
784
+
785
+ void CompileRegular(MacroAssembler* masm,
786
+ JSObject* object,
787
+ Register receiver,
788
+ Register scratch1,
789
+ Register scratch2,
790
+ String* name,
791
+ JSObject* holder_obj,
792
+ Label* miss_label) {
793
+ Register holder =
794
+ stub_compiler_->CheckPrototypes(object, receiver, holder_obj,
795
+ scratch1, scratch2, name,
796
+ miss_label);
797
+
798
+ // Call a runtime function to load the interceptor property.
799
+ __ EnterInternalFrame();
800
+ // Save the name_ register across the call.
801
+ __ push(name_);
802
+
803
+ PushInterceptorArguments(masm,
804
+ receiver,
805
+ holder,
806
+ name_,
807
+ holder_obj);
808
+
809
+ __ CallExternalReference(
810
+ ExternalReference(
811
+ IC_Utility(IC::kLoadPropertyWithInterceptorForCall)),
812
+ 5);
813
+
814
+ // Restore the name_ register.
815
+ __ pop(name_);
816
+ __ LeaveInternalFrame();
817
+ }
818
+
819
+ void LoadWithInterceptor(MacroAssembler* masm,
820
+ Register receiver,
821
+ Register holder,
822
+ JSObject* holder_obj,
823
+ Register scratch,
824
+ Label* interceptor_succeeded) {
825
+ __ EnterInternalFrame();
826
+ __ Push(holder, name_);
827
+
828
+ CompileCallLoadPropertyWithInterceptor(masm,
829
+ receiver,
830
+ holder,
831
+ name_,
832
+ holder_obj);
833
+
834
+ __ pop(name_); // Restore the name.
835
+ __ pop(receiver); // Restore the holder.
836
+ __ LeaveInternalFrame();
837
+
838
+ // If interceptor returns no-result sentinel, call the constant function.
839
+ __ LoadRoot(scratch, Heap::kNoInterceptorResultSentinelRootIndex);
840
+ __ cmp(r0, scratch);
841
+ __ b(ne, interceptor_succeeded);
842
+ }
843
+
844
+ StubCompiler* stub_compiler_;
845
+ const ParameterCount& arguments_;
846
+ Register name_;
847
+ };
848
+
849
+
850
+ // Generate code to check that a global property cell is empty. Create
851
+ // the property cell at compilation time if no cell exists for the
852
+ // property.
853
+ static Object* GenerateCheckPropertyCell(MacroAssembler* masm,
854
+ GlobalObject* global,
855
+ String* name,
856
+ Register scratch,
857
+ Label* miss) {
858
+ Object* probe = global->EnsurePropertyCell(name);
859
+ if (probe->IsFailure()) return probe;
860
+ JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(probe);
861
+ ASSERT(cell->value()->IsTheHole());
862
+ __ mov(scratch, Operand(Handle<Object>(cell)));
863
+ __ ldr(scratch,
864
+ FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset));
865
+ __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
866
+ __ cmp(scratch, ip);
867
+ __ b(ne, miss);
868
+ return cell;
869
+ }
870
+
871
+
365
872
  #undef __
366
873
  #define __ ACCESS_MASM(masm())
367
874
 
@@ -372,34 +879,32 @@ Register StubCompiler::CheckPrototypes(JSObject* object,
372
879
  Register holder_reg,
373
880
  Register scratch,
374
881
  String* name,
882
+ int save_at_depth,
375
883
  Label* miss) {
376
884
  // Check that the maps haven't changed.
377
885
  Register result =
378
- masm()->CheckMaps(object, object_reg, holder, holder_reg, scratch, miss);
886
+ masm()->CheckMaps(object, object_reg, holder, holder_reg, scratch,
887
+ save_at_depth, miss);
379
888
 
380
889
  // If we've skipped any global objects, it's not enough to verify
381
- // that their maps haven't changed.
890
+ // that their maps haven't changed. We also need to check that the
891
+ // property cell for the property is still empty.
382
892
  while (object != holder) {
383
893
  if (object->IsGlobalObject()) {
384
- GlobalObject* global = GlobalObject::cast(object);
385
- Object* probe = global->EnsurePropertyCell(name);
386
- if (probe->IsFailure()) {
387
- set_failure(Failure::cast(probe));
894
+ Object* cell = GenerateCheckPropertyCell(masm(),
895
+ GlobalObject::cast(object),
896
+ name,
897
+ scratch,
898
+ miss);
899
+ if (cell->IsFailure()) {
900
+ set_failure(Failure::cast(cell));
388
901
  return result;
389
902
  }
390
- JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(probe);
391
- ASSERT(cell->value()->IsTheHole());
392
- __ mov(scratch, Operand(Handle<Object>(cell)));
393
- __ ldr(scratch,
394
- FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset));
395
- __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
396
- __ cmp(scratch, ip);
397
- __ b(ne, miss);
398
903
  }
399
904
  object = JSObject::cast(object->GetPrototype());
400
905
  }
401
906
 
402
- // Return the register containin the holder.
907
+ // Return the register containing the holder.
403
908
  return result;
404
909
  }
405
910
 
@@ -465,18 +970,16 @@ bool StubCompiler::GenerateLoadCallback(JSObject* object,
465
970
  CheckPrototypes(object, receiver, holder, scratch1, scratch2, name, miss);
466
971
 
467
972
  // Push the arguments on the JS stack of the caller.
468
- __ push(receiver); // receiver
469
- __ push(reg); // holder
973
+ __ push(receiver); // Receiver.
974
+ __ push(reg); // Holder.
470
975
  __ mov(ip, Operand(Handle<AccessorInfo>(callback))); // callback data
471
- __ push(ip);
472
976
  __ ldr(reg, FieldMemOperand(ip, AccessorInfo::kDataOffset));
473
- __ push(reg);
474
- __ push(name_reg); // name
977
+ __ Push(ip, reg, name_reg);
475
978
 
476
979
  // Do tail-call to the runtime system.
477
980
  ExternalReference load_callback_property =
478
981
  ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
479
- __ TailCallRuntime(load_callback_property, 5, 1);
982
+ __ TailCallExternalReference(load_callback_property, 5, 1);
480
983
 
481
984
  return true;
482
985
  }
@@ -491,30 +994,18 @@ void StubCompiler::GenerateLoadInterceptor(JSObject* object,
491
994
  Register scratch2,
492
995
  String* name,
493
996
  Label* miss) {
494
- // Check that the receiver isn't a smi.
495
- __ tst(receiver, Operand(kSmiTagMask));
496
- __ b(eq, miss);
497
-
498
- // Check that the maps haven't changed.
499
- Register reg =
500
- CheckPrototypes(object, receiver, holder, scratch1, scratch2, name, miss);
501
-
502
- // Push the arguments on the JS stack of the caller.
503
- __ push(receiver); // receiver
504
- __ push(reg); // holder
505
- __ push(name_reg); // name
506
-
507
- InterceptorInfo* interceptor = holder->GetNamedInterceptor();
508
- ASSERT(!Heap::InNewSpace(interceptor));
509
- __ mov(scratch1, Operand(Handle<Object>(interceptor)));
510
- __ push(scratch1);
511
- __ ldr(scratch2, FieldMemOperand(scratch1, InterceptorInfo::kDataOffset));
512
- __ push(scratch2);
513
-
514
- // Do tail-call to the runtime system.
515
- ExternalReference load_ic_property =
516
- ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorForLoad));
517
- __ TailCallRuntime(load_ic_property, 5, 1);
997
+ LoadInterceptorCompiler compiler(name_reg);
998
+ CompileLoadInterceptor(&compiler,
999
+ this,
1000
+ masm(),
1001
+ object,
1002
+ holder,
1003
+ name,
1004
+ lookup,
1005
+ receiver,
1006
+ scratch1,
1007
+ scratch2,
1008
+ miss);
518
1009
  }
519
1010
 
520
1011
 
@@ -550,12 +1041,13 @@ Object* StubCompiler::CompileLazyCompile(Code::Flags flags) {
550
1041
  }
551
1042
 
552
1043
 
553
- Object* CallStubCompiler::CompileCallField(Object* object,
1044
+ Object* CallStubCompiler::CompileCallField(JSObject* object,
554
1045
  JSObject* holder,
555
1046
  int index,
556
1047
  String* name) {
557
1048
  // ----------- S t a t e -------------
558
- // -- lr: return address
1049
+ // -- r2 : name
1050
+ // -- lr : return address
559
1051
  // -----------------------------------
560
1052
  Label miss;
561
1053
 
@@ -568,26 +1060,60 @@ Object* CallStubCompiler::CompileCallField(Object* object,
568
1060
  __ b(eq, &miss);
569
1061
 
570
1062
  // Do the right check and compute the holder register.
571
- Register reg =
572
- CheckPrototypes(JSObject::cast(object), r0, holder, r3, r2, name, &miss);
1063
+ Register reg = CheckPrototypes(object, r0, holder, r1, r3, name, &miss);
573
1064
  GenerateFastPropertyLoad(masm(), r1, reg, holder, index);
574
1065
 
575
- // Check that the function really is a function.
1066
+ GenerateCallFunction(masm(), object, arguments(), &miss);
1067
+
1068
+ // Handle call cache miss.
1069
+ __ bind(&miss);
1070
+ Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1071
+ __ Jump(ic, RelocInfo::CODE_TARGET);
1072
+
1073
+ // Return the generated code.
1074
+ return GetCode(FIELD, name);
1075
+ }
1076
+
1077
+
1078
+ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1079
+ JSObject* holder,
1080
+ JSFunction* function,
1081
+ String* name,
1082
+ CheckType check) {
1083
+ // ----------- S t a t e -------------
1084
+ // -- r2 : name
1085
+ // -- lr : return address
1086
+ // -----------------------------------
1087
+
1088
+ // If object is not an array, bail out to regular call.
1089
+ if (!object->IsJSArray()) {
1090
+ return Heap::undefined_value();
1091
+ }
1092
+
1093
+ // TODO(639): faster implementation.
1094
+ ASSERT(check == RECEIVER_MAP_CHECK);
1095
+
1096
+ Label miss;
1097
+
1098
+ // Get the receiver from the stack
1099
+ const int argc = arguments().immediate();
1100
+ __ ldr(r1, MemOperand(sp, argc * kPointerSize));
1101
+
1102
+ // Check that the receiver isn't a smi.
576
1103
  __ tst(r1, Operand(kSmiTagMask));
577
1104
  __ b(eq, &miss);
578
- // Get the map.
579
- __ CompareObjectType(r1, r2, r2, JS_FUNCTION_TYPE);
580
- __ b(ne, &miss);
581
1105
 
582
- // Patch the receiver on the stack with the global proxy if
583
- // necessary.
1106
+ // Check that the maps haven't changed.
1107
+ CheckPrototypes(JSObject::cast(object), r1, holder, r3, r0, name, &miss);
1108
+
584
1109
  if (object->IsGlobalObject()) {
585
- __ ldr(r3, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset));
1110
+ __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
586
1111
  __ str(r3, MemOperand(sp, argc * kPointerSize));
587
1112
  }
588
1113
 
589
- // Invoke the function.
590
- __ InvokeFunction(r1, arguments(), JUMP_FUNCTION);
1114
+ __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush),
1115
+ argc + 1,
1116
+ 1);
591
1117
 
592
1118
  // Handle call cache miss.
593
1119
  __ bind(&miss);
@@ -595,124 +1121,215 @@ Object* CallStubCompiler::CompileCallField(Object* object,
595
1121
  __ Jump(ic, RelocInfo::CODE_TARGET);
596
1122
 
597
1123
  // Return the generated code.
598
- return GetCode(FIELD, name);
1124
+ String* function_name = NULL;
1125
+ if (function->shared()->name()->IsString()) {
1126
+ function_name = String::cast(function->shared()->name());
1127
+ }
1128
+ return GetCode(CONSTANT_FUNCTION, function_name);
599
1129
  }
600
1130
 
601
1131
 
602
- Object* CallStubCompiler::CompileCallConstant(Object* object,
1132
+ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
603
1133
  JSObject* holder,
604
1134
  JSFunction* function,
605
1135
  String* name,
606
1136
  CheckType check) {
607
1137
  // ----------- S t a t e -------------
608
- // -- lr: return address
1138
+ // -- r2 : name
1139
+ // -- lr : return address
609
1140
  // -----------------------------------
1141
+
1142
+ // If object is not an array, bail out to regular call.
1143
+ if (!object->IsJSArray()) {
1144
+ return Heap::undefined_value();
1145
+ }
1146
+
1147
+ // TODO(642): faster implementation.
1148
+ ASSERT(check == RECEIVER_MAP_CHECK);
1149
+
610
1150
  Label miss;
611
1151
 
612
1152
  // Get the receiver from the stack
613
1153
  const int argc = arguments().immediate();
614
1154
  __ ldr(r1, MemOperand(sp, argc * kPointerSize));
615
1155
 
1156
+ // Check that the receiver isn't a smi.
1157
+ __ tst(r1, Operand(kSmiTagMask));
1158
+ __ b(eq, &miss);
1159
+
1160
+ // Check that the maps haven't changed.
1161
+ CheckPrototypes(JSObject::cast(object), r1, holder, r3, r0, name, &miss);
1162
+
1163
+ if (object->IsGlobalObject()) {
1164
+ __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
1165
+ __ str(r3, MemOperand(sp, argc * kPointerSize));
1166
+ }
1167
+
1168
+ __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPop),
1169
+ argc + 1,
1170
+ 1);
1171
+
1172
+ // Handle call cache miss.
1173
+ __ bind(&miss);
1174
+ Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1175
+ __ Jump(ic, RelocInfo::CODE_TARGET);
1176
+
1177
+ // Return the generated code.
1178
+ String* function_name = NULL;
1179
+ if (function->shared()->name()->IsString()) {
1180
+ function_name = String::cast(function->shared()->name());
1181
+ }
1182
+ return GetCode(CONSTANT_FUNCTION, function_name);
1183
+ }
1184
+
1185
+
1186
+ Object* CallStubCompiler::CompileCallConstant(Object* object,
1187
+ JSObject* holder,
1188
+ JSFunction* function,
1189
+ String* name,
1190
+ CheckType check) {
1191
+ // ----------- S t a t e -------------
1192
+ // -- r2 : name
1193
+ // -- lr : return address
1194
+ // -----------------------------------
1195
+ SharedFunctionInfo* function_info = function->shared();
1196
+ if (function_info->HasCustomCallGenerator()) {
1197
+ CustomCallGenerator generator =
1198
+ ToCData<CustomCallGenerator>(function_info->function_data());
1199
+ Object* result = generator(this, object, holder, function, name, check);
1200
+ // undefined means bail out to regular compiler.
1201
+ if (!result->IsUndefined()) {
1202
+ return result;
1203
+ }
1204
+ }
1205
+
1206
+ Label miss_in_smi_check;
1207
+
1208
+ // Get the receiver from the stack
1209
+ const int argc = arguments().immediate();
1210
+ __ ldr(r1, MemOperand(sp, argc * kPointerSize));
1211
+
616
1212
  // Check that the receiver isn't a smi.
617
1213
  if (check != NUMBER_CHECK) {
618
1214
  __ tst(r1, Operand(kSmiTagMask));
619
- __ b(eq, &miss);
1215
+ __ b(eq, &miss_in_smi_check);
620
1216
  }
621
1217
 
622
1218
  // Make sure that it's okay not to patch the on stack receiver
623
1219
  // unless we're doing a receiver map check.
624
1220
  ASSERT(!object->IsGlobalObject() || check == RECEIVER_MAP_CHECK);
625
1221
 
1222
+ CallOptimization optimization(function);
1223
+ int depth = kInvalidProtoDepth;
1224
+ Label miss;
1225
+
626
1226
  switch (check) {
627
1227
  case RECEIVER_MAP_CHECK:
1228
+ __ IncrementCounter(&Counters::call_const, 1, r0, r3);
1229
+
1230
+ if (optimization.is_simple_api_call() && !object->IsGlobalObject()) {
1231
+ depth = optimization.GetPrototypeDepthOfExpectedType(
1232
+ JSObject::cast(object), holder);
1233
+ }
1234
+
1235
+ if (depth != kInvalidProtoDepth) {
1236
+ __ IncrementCounter(&Counters::call_const_fast_api, 1, r0, r3);
1237
+ ReserveSpaceForFastApiCall(masm(), r0);
1238
+ }
1239
+
628
1240
  // Check that the maps haven't changed.
629
- CheckPrototypes(JSObject::cast(object), r1, holder, r3, r2, name, &miss);
1241
+ CheckPrototypes(JSObject::cast(object), r1, holder, r0, r3, name,
1242
+ depth, &miss);
630
1243
 
631
1244
  // Patch the receiver on the stack with the global proxy if
632
1245
  // necessary.
633
1246
  if (object->IsGlobalObject()) {
1247
+ ASSERT(depth == kInvalidProtoDepth);
634
1248
  __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
635
1249
  __ str(r3, MemOperand(sp, argc * kPointerSize));
636
1250
  }
637
1251
  break;
638
1252
 
639
1253
  case STRING_CHECK:
640
- // Check that the object is a two-byte string or a symbol.
641
- __ CompareObjectType(r1, r2, r2, FIRST_NONSTRING_TYPE);
642
- __ b(hs, &miss);
643
- // Check that the maps starting from the prototype haven't changed.
644
- GenerateLoadGlobalFunctionPrototype(masm(),
645
- Context::STRING_FUNCTION_INDEX,
646
- r2);
647
- CheckPrototypes(JSObject::cast(object->GetPrototype()), r2, holder, r3,
648
- r1, name, &miss);
1254
+ if (!function->IsBuiltin()) {
1255
+ // Calling non-builtins with a value as receiver requires boxing.
1256
+ __ jmp(&miss);
1257
+ } else {
1258
+ // Check that the object is a two-byte string or a symbol.
1259
+ __ CompareObjectType(r1, r3, r3, FIRST_NONSTRING_TYPE);
1260
+ __ b(hs, &miss);
1261
+ // Check that the maps starting from the prototype haven't changed.
1262
+ GenerateLoadGlobalFunctionPrototype(masm(),
1263
+ Context::STRING_FUNCTION_INDEX,
1264
+ r0);
1265
+ CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder, r3,
1266
+ r1, name, &miss);
1267
+ }
649
1268
  break;
650
1269
 
651
1270
  case NUMBER_CHECK: {
652
- Label fast;
653
- // Check that the object is a smi or a heap number.
654
- __ tst(r1, Operand(kSmiTagMask));
655
- __ b(eq, &fast);
656
- __ CompareObjectType(r1, r2, r2, HEAP_NUMBER_TYPE);
657
- __ b(ne, &miss);
658
- __ bind(&fast);
659
- // Check that the maps starting from the prototype haven't changed.
660
- GenerateLoadGlobalFunctionPrototype(masm(),
661
- Context::NUMBER_FUNCTION_INDEX,
662
- r2);
663
- CheckPrototypes(JSObject::cast(object->GetPrototype()), r2, holder, r3,
664
- r1, name, &miss);
1271
+ if (!function->IsBuiltin()) {
1272
+ // Calling non-builtins with a value as receiver requires boxing.
1273
+ __ jmp(&miss);
1274
+ } else {
1275
+ Label fast;
1276
+ // Check that the object is a smi or a heap number.
1277
+ __ tst(r1, Operand(kSmiTagMask));
1278
+ __ b(eq, &fast);
1279
+ __ CompareObjectType(r1, r0, r0, HEAP_NUMBER_TYPE);
1280
+ __ b(ne, &miss);
1281
+ __ bind(&fast);
1282
+ // Check that the maps starting from the prototype haven't changed.
1283
+ GenerateLoadGlobalFunctionPrototype(masm(),
1284
+ Context::NUMBER_FUNCTION_INDEX,
1285
+ r0);
1286
+ CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder, r3,
1287
+ r1, name, &miss);
1288
+ }
665
1289
  break;
666
1290
  }
667
1291
 
668
1292
  case BOOLEAN_CHECK: {
669
- Label fast;
670
- // Check that the object is a boolean.
671
- __ LoadRoot(ip, Heap::kTrueValueRootIndex);
672
- __ cmp(r1, ip);
673
- __ b(eq, &fast);
674
- __ LoadRoot(ip, Heap::kFalseValueRootIndex);
675
- __ cmp(r1, ip);
676
- __ b(ne, &miss);
677
- __ bind(&fast);
678
- // Check that the maps starting from the prototype haven't changed.
679
- GenerateLoadGlobalFunctionPrototype(masm(),
680
- Context::BOOLEAN_FUNCTION_INDEX,
681
- r2);
682
- CheckPrototypes(JSObject::cast(object->GetPrototype()), r2, holder, r3,
683
- r1, name, &miss);
1293
+ if (!function->IsBuiltin()) {
1294
+ // Calling non-builtins with a value as receiver requires boxing.
1295
+ __ jmp(&miss);
1296
+ } else {
1297
+ Label fast;
1298
+ // Check that the object is a boolean.
1299
+ __ LoadRoot(ip, Heap::kTrueValueRootIndex);
1300
+ __ cmp(r1, ip);
1301
+ __ b(eq, &fast);
1302
+ __ LoadRoot(ip, Heap::kFalseValueRootIndex);
1303
+ __ cmp(r1, ip);
1304
+ __ b(ne, &miss);
1305
+ __ bind(&fast);
1306
+ // Check that the maps starting from the prototype haven't changed.
1307
+ GenerateLoadGlobalFunctionPrototype(masm(),
1308
+ Context::BOOLEAN_FUNCTION_INDEX,
1309
+ r0);
1310
+ CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder, r3,
1311
+ r1, name, &miss);
1312
+ }
684
1313
  break;
685
1314
  }
686
1315
 
687
- case JSARRAY_HAS_FAST_ELEMENTS_CHECK:
688
- CheckPrototypes(JSObject::cast(object), r1, holder, r3, r2, name, &miss);
689
- // Make sure object->HasFastElements().
690
- // Get the elements array of the object.
691
- __ ldr(r3, FieldMemOperand(r1, JSObject::kElementsOffset));
692
- // Check that the object is in fast mode (not dictionary).
693
- __ ldr(r2, FieldMemOperand(r3, HeapObject::kMapOffset));
694
- __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex);
695
- __ cmp(r2, ip);
696
- __ b(ne, &miss);
697
- break;
698
-
699
1316
  default:
700
1317
  UNREACHABLE();
701
1318
  }
702
1319
 
703
- // Get the function and setup the context.
704
- __ mov(r1, Operand(Handle<JSFunction>(function)));
705
- __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
706
-
707
- // Jump to the cached code (tail call).
708
- ASSERT(function->is_compiled());
709
- Handle<Code> code(function->code());
710
- ParameterCount expected(function->shared()->formal_parameter_count());
711
- __ InvokeCode(code, expected, arguments(),
712
- RelocInfo::CODE_TARGET, JUMP_FUNCTION);
1320
+ if (depth != kInvalidProtoDepth) {
1321
+ GenerateFastApiCall(masm(), optimization, argc);
1322
+ } else {
1323
+ __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
1324
+ }
713
1325
 
714
1326
  // Handle call cache miss.
715
1327
  __ bind(&miss);
1328
+ if (depth != kInvalidProtoDepth) {
1329
+ FreeSpaceForFastApiCall(masm());
1330
+ }
1331
+
1332
+ __ bind(&miss_in_smi_check);
716
1333
  Handle<Code> ic = ComputeCallMiss(arguments().immediate());
717
1334
  __ Jump(ic, RelocInfo::CODE_TARGET);
718
1335
 
@@ -725,15 +1342,42 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
725
1342
  }
726
1343
 
727
1344
 
728
- Object* CallStubCompiler::CompileCallInterceptor(Object* object,
1345
+ Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
729
1346
  JSObject* holder,
730
1347
  String* name) {
731
1348
  // ----------- S t a t e -------------
732
- // -- lr: return address
1349
+ // -- r2 : name
1350
+ // -- lr : return address
733
1351
  // -----------------------------------
1352
+
734
1353
  Label miss;
735
1354
 
736
- // TODO(1224669): Implement.
1355
+ // Get the number of arguments.
1356
+ const int argc = arguments().immediate();
1357
+
1358
+ LookupResult lookup;
1359
+ LookupPostInterceptor(holder, name, &lookup);
1360
+
1361
+ // Get the receiver from the stack.
1362
+ __ ldr(r1, MemOperand(sp, argc * kPointerSize));
1363
+
1364
+ CallInterceptorCompiler compiler(this, arguments(), r2);
1365
+ compiler.Compile(masm(),
1366
+ object,
1367
+ holder,
1368
+ name,
1369
+ &lookup,
1370
+ r1,
1371
+ r3,
1372
+ r4,
1373
+ &miss);
1374
+
1375
+ // Move returned value, the function to call, to r1.
1376
+ __ mov(r1, r0);
1377
+ // Restore receiver.
1378
+ __ ldr(r0, MemOperand(sp, argc * kPointerSize));
1379
+
1380
+ GenerateCallFunction(masm(), object, arguments(), &miss);
737
1381
 
738
1382
  // Handle call cache miss.
739
1383
  __ bind(&miss);
@@ -751,7 +1395,8 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
751
1395
  JSFunction* function,
752
1396
  String* name) {
753
1397
  // ----------- S t a t e -------------
754
- // -- lr: return address
1398
+ // -- r2 : name
1399
+ // -- lr : return address
755
1400
  // -----------------------------------
756
1401
  Label miss;
757
1402
 
@@ -770,7 +1415,7 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
770
1415
  }
771
1416
 
772
1417
  // Check that the maps haven't changed.
773
- CheckPrototypes(object, r0, holder, r3, r2, name, &miss);
1418
+ CheckPrototypes(object, r0, holder, r3, r1, name, &miss);
774
1419
 
775
1420
  // Get the value from the cell.
776
1421
  __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell)));
@@ -790,8 +1435,8 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
790
1435
 
791
1436
  // Check the shared function info. Make sure it hasn't changed.
792
1437
  __ mov(r3, Operand(Handle<SharedFunctionInfo>(function->shared())));
793
- __ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
794
- __ cmp(r2, r3);
1438
+ __ ldr(r4, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
1439
+ __ cmp(r4, r3);
795
1440
  __ b(ne, &miss);
796
1441
  } else {
797
1442
  __ cmp(r1, Operand(Handle<JSFunction>(function)));
@@ -809,7 +1454,7 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
809
1454
  __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
810
1455
 
811
1456
  // Jump to the cached code (tail call).
812
- __ IncrementCounter(&Counters::call_global_inline, 1, r2, r3);
1457
+ __ IncrementCounter(&Counters::call_global_inline, 1, r3, r4);
813
1458
  ASSERT(function->is_compiled());
814
1459
  Handle<Code> code(function->code());
815
1460
  ParameterCount expected(function->shared()->formal_parameter_count());
@@ -833,25 +1478,19 @@ Object* StoreStubCompiler::CompileStoreField(JSObject* object,
833
1478
  String* name) {
834
1479
  // ----------- S t a t e -------------
835
1480
  // -- r0 : value
1481
+ // -- r1 : receiver
836
1482
  // -- r2 : name
837
1483
  // -- lr : return address
838
- // -- [sp] : receiver
839
1484
  // -----------------------------------
840
1485
  Label miss;
841
1486
 
842
- // Get the receiver from the stack.
843
- __ ldr(r3, MemOperand(sp, 0 * kPointerSize));
844
-
845
- // name register might be clobbered.
846
1487
  GenerateStoreField(masm(),
847
- Builtins::StoreIC_ExtendStorage,
848
1488
  object,
849
1489
  index,
850
1490
  transition,
851
- r3, r2, r1,
1491
+ r1, r2, r3,
852
1492
  &miss);
853
1493
  __ bind(&miss);
854
- __ mov(r2, Operand(Handle<String>(name))); // restore name
855
1494
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
856
1495
  __ Jump(ic, RelocInfo::CODE_TARGET);
857
1496
 
@@ -865,48 +1504,41 @@ Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
865
1504
  String* name) {
866
1505
  // ----------- S t a t e -------------
867
1506
  // -- r0 : value
1507
+ // -- r1 : receiver
868
1508
  // -- r2 : name
869
1509
  // -- lr : return address
870
- // -- [sp] : receiver
871
1510
  // -----------------------------------
872
1511
  Label miss;
873
1512
 
874
- // Get the object from the stack.
875
- __ ldr(r3, MemOperand(sp, 0 * kPointerSize));
876
-
877
1513
  // Check that the object isn't a smi.
878
- __ tst(r3, Operand(kSmiTagMask));
1514
+ __ tst(r1, Operand(kSmiTagMask));
879
1515
  __ b(eq, &miss);
880
1516
 
881
1517
  // Check that the map of the object hasn't changed.
882
- __ ldr(r1, FieldMemOperand(r3, HeapObject::kMapOffset));
883
- __ cmp(r1, Operand(Handle<Map>(object->map())));
1518
+ __ ldr(r3, FieldMemOperand(r1, HeapObject::kMapOffset));
1519
+ __ cmp(r3, Operand(Handle<Map>(object->map())));
884
1520
  __ b(ne, &miss);
885
1521
 
886
1522
  // Perform global security token check if needed.
887
1523
  if (object->IsJSGlobalProxy()) {
888
- __ CheckAccessGlobalProxy(r3, r1, &miss);
1524
+ __ CheckAccessGlobalProxy(r1, r3, &miss);
889
1525
  }
890
1526
 
891
1527
  // Stub never generated for non-global objects that require access
892
1528
  // checks.
893
1529
  ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
894
1530
 
895
- __ ldr(ip, MemOperand(sp)); // receiver
896
- __ push(ip);
1531
+ __ push(r1); // receiver
897
1532
  __ mov(ip, Operand(Handle<AccessorInfo>(callback))); // callback info
898
- __ push(ip);
899
- __ push(r2); // name
900
- __ push(r0); // value
1533
+ __ Push(ip, r2, r0);
901
1534
 
902
1535
  // Do tail-call to the runtime system.
903
1536
  ExternalReference store_callback_property =
904
1537
  ExternalReference(IC_Utility(IC::kStoreCallbackProperty));
905
- __ TailCallRuntime(store_callback_property, 4, 1);
1538
+ __ TailCallExternalReference(store_callback_property, 4, 1);
906
1539
 
907
1540
  // Handle store cache miss.
908
1541
  __ bind(&miss);
909
- __ mov(r2, Operand(Handle<String>(name))); // restore name
910
1542
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
911
1543
  __ Jump(ic, RelocInfo::CODE_TARGET);
912
1544
 
@@ -919,46 +1551,39 @@ Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
919
1551
  String* name) {
920
1552
  // ----------- S t a t e -------------
921
1553
  // -- r0 : value
1554
+ // -- r1 : receiver
922
1555
  // -- r2 : name
923
1556
  // -- lr : return address
924
- // -- [sp] : receiver
925
1557
  // -----------------------------------
926
1558
  Label miss;
927
1559
 
928
- // Get the object from the stack.
929
- __ ldr(r3, MemOperand(sp, 0 * kPointerSize));
930
-
931
1560
  // Check that the object isn't a smi.
932
- __ tst(r3, Operand(kSmiTagMask));
1561
+ __ tst(r1, Operand(kSmiTagMask));
933
1562
  __ b(eq, &miss);
934
1563
 
935
1564
  // Check that the map of the object hasn't changed.
936
- __ ldr(r1, FieldMemOperand(r3, HeapObject::kMapOffset));
937
- __ cmp(r1, Operand(Handle<Map>(receiver->map())));
1565
+ __ ldr(r3, FieldMemOperand(r1, HeapObject::kMapOffset));
1566
+ __ cmp(r3, Operand(Handle<Map>(receiver->map())));
938
1567
  __ b(ne, &miss);
939
1568
 
940
1569
  // Perform global security token check if needed.
941
1570
  if (receiver->IsJSGlobalProxy()) {
942
- __ CheckAccessGlobalProxy(r3, r1, &miss);
1571
+ __ CheckAccessGlobalProxy(r1, r3, &miss);
943
1572
  }
944
1573
 
945
- // Stub never generated for non-global objects that require access
1574
+ // Stub is never generated for non-global objects that require access
946
1575
  // checks.
947
1576
  ASSERT(receiver->IsJSGlobalProxy() || !receiver->IsAccessCheckNeeded());
948
1577
 
949
- __ ldr(ip, MemOperand(sp)); // receiver
950
- __ push(ip);
951
- __ push(r2); // name
952
- __ push(r0); // value
1578
+ __ Push(r1, r2, r0); // Receiver, name, value.
953
1579
 
954
1580
  // Do tail-call to the runtime system.
955
1581
  ExternalReference store_ic_property =
956
1582
  ExternalReference(IC_Utility(IC::kStoreInterceptorProperty));
957
- __ TailCallRuntime(store_ic_property, 3, 1);
1583
+ __ TailCallExternalReference(store_ic_property, 3, 1);
958
1584
 
959
1585
  // Handle store cache miss.
960
1586
  __ bind(&miss);
961
- __ mov(r2, Operand(Handle<String>(name))); // restore name
962
1587
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
963
1588
  __ Jump(ic, RelocInfo::CODE_TARGET);
964
1589
 
@@ -972,14 +1597,13 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
972
1597
  String* name) {
973
1598
  // ----------- S t a t e -------------
974
1599
  // -- r0 : value
1600
+ // -- r1 : receiver
975
1601
  // -- r2 : name
976
1602
  // -- lr : return address
977
- // -- [sp] : receiver
978
1603
  // -----------------------------------
979
1604
  Label miss;
980
1605
 
981
1606
  // Check that the map of the global has not changed.
982
- __ ldr(r1, MemOperand(sp, 0 * kPointerSize));
983
1607
  __ ldr(r3, FieldMemOperand(r1, HeapObject::kMapOffset));
984
1608
  __ cmp(r3, Operand(Handle<Map>(object->map())));
985
1609
  __ b(ne, &miss);
@@ -988,12 +1612,12 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
988
1612
  __ mov(r2, Operand(Handle<JSGlobalPropertyCell>(cell)));
989
1613
  __ str(r0, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset));
990
1614
 
991
- __ IncrementCounter(&Counters::named_store_global_inline, 1, r1, r3);
1615
+ __ IncrementCounter(&Counters::named_store_global_inline, 1, r4, r3);
992
1616
  __ Ret();
993
1617
 
994
1618
  // Handle store cache miss.
995
1619
  __ bind(&miss);
996
- __ IncrementCounter(&Counters::named_store_global_inline_miss, 1, r1, r3);
1620
+ __ IncrementCounter(&Counters::named_store_global_inline_miss, 1, r4, r3);
997
1621
  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
998
1622
  __ Jump(ic, RelocInfo::CODE_TARGET);
999
1623
 
@@ -1002,6 +1626,50 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
1002
1626
  }
1003
1627
 
1004
1628
 
1629
+ Object* LoadStubCompiler::CompileLoadNonexistent(String* name,
1630
+ JSObject* object,
1631
+ JSObject* last) {
1632
+ // ----------- S t a t e -------------
1633
+ // -- r2 : name
1634
+ // -- lr : return address
1635
+ // -- [sp] : receiver
1636
+ // -----------------------------------
1637
+ Label miss;
1638
+
1639
+ // Load receiver.
1640
+ __ ldr(r0, MemOperand(sp, 0));
1641
+
1642
+ // Check that receiver is not a smi.
1643
+ __ tst(r0, Operand(kSmiTagMask));
1644
+ __ b(eq, &miss);
1645
+
1646
+ // Check the maps of the full prototype chain.
1647
+ CheckPrototypes(object, r0, last, r3, r1, name, &miss);
1648
+
1649
+ // If the last object in the prototype chain is a global object,
1650
+ // check that the global property cell is empty.
1651
+ if (last->IsGlobalObject()) {
1652
+ Object* cell = GenerateCheckPropertyCell(masm(),
1653
+ GlobalObject::cast(last),
1654
+ name,
1655
+ r1,
1656
+ &miss);
1657
+ if (cell->IsFailure()) return cell;
1658
+ }
1659
+
1660
+ // Return undefined if maps of the full prototype chain are still the
1661
+ // same and no global property with this name contains a value.
1662
+ __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
1663
+ __ Ret();
1664
+
1665
+ __ bind(&miss);
1666
+ GenerateLoadMiss(masm(), Code::LOAD_IC);
1667
+
1668
+ // Return the generated code.
1669
+ return GetCode(NONEXISTENT, Heap::empty_string());
1670
+ }
1671
+
1672
+
1005
1673
  Object* LoadStubCompiler::CompileLoadField(JSObject* object,
1006
1674
  JSObject* holder,
1007
1675
  int index,
@@ -1084,7 +1752,7 @@ Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* object,
1084
1752
  __ ldr(r0, MemOperand(sp, 0));
1085
1753
 
1086
1754
  LookupResult lookup;
1087
- holder->LocalLookupRealNamedProperty(name, &lookup);
1755
+ LookupPostInterceptor(holder, name, &lookup);
1088
1756
  GenerateLoadInterceptor(object,
1089
1757
  holder,
1090
1758
  &lookup,
@@ -1110,35 +1778,34 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
1110
1778
  // ----------- S t a t e -------------
1111
1779
  // -- r2 : name
1112
1780
  // -- lr : return address
1113
- // -- [sp] : receiver
1781
+ // -- r0 : receiver
1782
+ // -- sp[0] : receiver
1114
1783
  // -----------------------------------
1115
1784
  Label miss;
1116
1785
 
1117
- // Get the receiver from the stack.
1118
- __ ldr(r1, MemOperand(sp, 0 * kPointerSize));
1119
-
1120
1786
  // If the object is the holder then we know that it's a global
1121
1787
  // object which can only happen for contextual calls. In this case,
1122
1788
  // the receiver cannot be a smi.
1123
1789
  if (object != holder) {
1124
- __ tst(r1, Operand(kSmiTagMask));
1790
+ __ tst(r0, Operand(kSmiTagMask));
1125
1791
  __ b(eq, &miss);
1126
1792
  }
1127
1793
 
1128
1794
  // Check that the map of the global has not changed.
1129
- CheckPrototypes(object, r1, holder, r3, r0, name, &miss);
1795
+ CheckPrototypes(object, r0, holder, r3, r4, name, &miss);
1130
1796
 
1131
1797
  // Get the value from the cell.
1132
1798
  __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell)));
1133
- __ ldr(r0, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset));
1799
+ __ ldr(r4, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset));
1134
1800
 
1135
1801
  // Check for deleted property if property can actually be deleted.
1136
1802
  if (!is_dont_delete) {
1137
1803
  __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
1138
- __ cmp(r0, ip);
1804
+ __ cmp(r4, ip);
1139
1805
  __ b(eq, &miss);
1140
1806
  }
1141
1807
 
1808
+ __ mov(r0, r4);
1142
1809
  __ IncrementCounter(&Counters::named_load_global_inline, 1, r1, r3);
1143
1810
  __ Ret();
1144
1811
 
@@ -1157,18 +1824,18 @@ Object* KeyedLoadStubCompiler::CompileLoadField(String* name,
1157
1824
  int index) {
1158
1825
  // ----------- S t a t e -------------
1159
1826
  // -- lr : return address
1827
+ // -- r0 : key
1160
1828
  // -- sp[0] : key
1161
1829
  // -- sp[4] : receiver
1162
1830
  // -----------------------------------
1163
1831
  Label miss;
1164
1832
 
1165
- __ ldr(r2, MemOperand(sp, 0));
1166
- __ ldr(r0, MemOperand(sp, kPointerSize));
1167
-
1168
- __ cmp(r2, Operand(Handle<String>(name)));
1833
+ // Check the key is the cached one.
1834
+ __ cmp(r0, Operand(Handle<String>(name)));
1169
1835
  __ b(ne, &miss);
1170
1836
 
1171
- GenerateLoadField(receiver, holder, r0, r3, r1, index, name, &miss);
1837
+ __ ldr(r1, MemOperand(sp, kPointerSize)); // Receiver.
1838
+ GenerateLoadField(receiver, holder, r1, r2, r3, index, name, &miss);
1172
1839
  __ bind(&miss);
1173
1840
  GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1174
1841
 
@@ -1182,19 +1849,19 @@ Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
1182
1849
  AccessorInfo* callback) {
1183
1850
  // ----------- S t a t e -------------
1184
1851
  // -- lr : return address
1852
+ // -- r0 : key
1185
1853
  // -- sp[0] : key
1186
1854
  // -- sp[4] : receiver
1187
1855
  // -----------------------------------
1188
1856
  Label miss;
1189
1857
 
1190
- __ ldr(r2, MemOperand(sp, 0));
1191
- __ ldr(r0, MemOperand(sp, kPointerSize));
1192
-
1193
- __ cmp(r2, Operand(Handle<String>(name)));
1858
+ // Check the key is the cached one.
1859
+ __ cmp(r0, Operand(Handle<String>(name)));
1194
1860
  __ b(ne, &miss);
1195
1861
 
1196
1862
  Failure* failure = Failure::InternalError();
1197
- bool success = GenerateLoadCallback(receiver, holder, r0, r2, r3, r1,
1863
+ __ ldr(r1, MemOperand(sp, kPointerSize)); // Receiver.
1864
+ bool success = GenerateLoadCallback(receiver, holder, r1, r0, r2, r3,
1198
1865
  callback, name, &miss, &failure);
1199
1866
  if (!success) return failure;
1200
1867
 
@@ -1211,19 +1878,18 @@ Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
1211
1878
  Object* value) {
1212
1879
  // ----------- S t a t e -------------
1213
1880
  // -- lr : return address
1881
+ // -- r0 : key
1214
1882
  // -- sp[0] : key
1215
1883
  // -- sp[4] : receiver
1216
1884
  // -----------------------------------
1217
1885
  Label miss;
1218
1886
 
1219
- // Check the key is the cached one
1220
- __ ldr(r2, MemOperand(sp, 0));
1221
- __ ldr(r0, MemOperand(sp, kPointerSize));
1222
-
1223
- __ cmp(r2, Operand(Handle<String>(name)));
1887
+ // Check the key is the cached one.
1888
+ __ cmp(r0, Operand(Handle<String>(name)));
1224
1889
  __ b(ne, &miss);
1225
1890
 
1226
- GenerateLoadConstant(receiver, holder, r0, r3, r1, value, name, &miss);
1891
+ __ ldr(r1, MemOperand(sp, kPointerSize)); // Receiver.
1892
+ GenerateLoadConstant(receiver, holder, r1, r2, r3, value, name, &miss);
1227
1893
  __ bind(&miss);
1228
1894
  GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1229
1895
 
@@ -1237,27 +1903,26 @@ Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
1237
1903
  String* name) {
1238
1904
  // ----------- S t a t e -------------
1239
1905
  // -- lr : return address
1906
+ // -- r0 : key
1240
1907
  // -- sp[0] : key
1241
1908
  // -- sp[4] : receiver
1242
1909
  // -----------------------------------
1243
1910
  Label miss;
1244
1911
 
1245
- // Check the key is the cached one
1246
- __ ldr(r2, MemOperand(sp, 0));
1247
- __ ldr(r0, MemOperand(sp, kPointerSize));
1248
-
1249
- __ cmp(r2, Operand(Handle<String>(name)));
1912
+ // Check the key is the cached one.
1913
+ __ cmp(r0, Operand(Handle<String>(name)));
1250
1914
  __ b(ne, &miss);
1251
1915
 
1252
1916
  LookupResult lookup;
1253
- holder->LocalLookupRealNamedProperty(name, &lookup);
1917
+ LookupPostInterceptor(holder, name, &lookup);
1918
+ __ ldr(r1, MemOperand(sp, kPointerSize)); // Receiver.
1254
1919
  GenerateLoadInterceptor(receiver,
1255
1920
  holder,
1256
1921
  &lookup,
1922
+ r1,
1257
1923
  r0,
1258
1924
  r2,
1259
1925
  r3,
1260
- r1,
1261
1926
  name,
1262
1927
  &miss);
1263
1928
  __ bind(&miss);
@@ -1270,19 +1935,18 @@ Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
1270
1935
  Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
1271
1936
  // ----------- S t a t e -------------
1272
1937
  // -- lr : return address
1938
+ // -- r0 : key
1273
1939
  // -- sp[0] : key
1274
1940
  // -- sp[4] : receiver
1275
1941
  // -----------------------------------
1276
1942
  Label miss;
1277
1943
 
1278
- // Check the key is the cached one
1279
- __ ldr(r2, MemOperand(sp, 0));
1280
- __ ldr(r0, MemOperand(sp, kPointerSize));
1281
-
1282
- __ cmp(r2, Operand(Handle<String>(name)));
1944
+ // Check the key is the cached one.
1945
+ __ cmp(r0, Operand(Handle<String>(name)));
1283
1946
  __ b(ne, &miss);
1284
1947
 
1285
- GenerateLoadArrayLength(masm(), r0, r3, &miss);
1948
+ __ ldr(r1, MemOperand(sp, kPointerSize)); // Receiver.
1949
+ GenerateLoadArrayLength(masm(), r1, r2, &miss);
1286
1950
  __ bind(&miss);
1287
1951
  GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1288
1952
 
@@ -1293,19 +1957,19 @@ Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
1293
1957
  Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
1294
1958
  // ----------- S t a t e -------------
1295
1959
  // -- lr : return address
1960
+ // -- r0 : key
1296
1961
  // -- sp[0] : key
1297
1962
  // -- sp[4] : receiver
1298
1963
  // -----------------------------------
1299
1964
  Label miss;
1300
1965
  __ IncrementCounter(&Counters::keyed_load_string_length, 1, r1, r3);
1301
1966
 
1302
- __ ldr(r2, MemOperand(sp));
1303
- __ ldr(r0, MemOperand(sp, kPointerSize)); // receiver
1304
-
1305
- __ cmp(r2, Operand(Handle<String>(name)));
1967
+ // Check the key is the cached one.
1968
+ __ cmp(r0, Operand(Handle<String>(name)));
1306
1969
  __ b(ne, &miss);
1307
1970
 
1308
- GenerateLoadStringLength2(masm(), r0, r1, r3, &miss);
1971
+ __ ldr(r1, MemOperand(sp, kPointerSize)); // Receiver.
1972
+ GenerateLoadStringLength(masm(), r1, r2, r3, &miss);
1309
1973
  __ bind(&miss);
1310
1974
  __ DecrementCounter(&Counters::keyed_load_string_length, 1, r1, r3);
1311
1975
 
@@ -1319,6 +1983,7 @@ Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
1319
1983
  Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
1320
1984
  // ----------- S t a t e -------------
1321
1985
  // -- lr : return address
1986
+ // -- r0 : key
1322
1987
  // -- sp[0] : key
1323
1988
  // -- sp[4] : receiver
1324
1989
  // -----------------------------------
@@ -1350,7 +2015,6 @@ Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
1350
2015
  __ ldr(r3, MemOperand(sp));
1351
2016
  // r1 is used as scratch register, r3 and r2 might be clobbered.
1352
2017
  GenerateStoreField(masm(),
1353
- Builtins::StoreIC_ExtendStorage,
1354
2018
  object,
1355
2019
  index,
1356
2020
  transition,