therubyracer 0.7.4 → 0.7.5

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 (482) hide show
  1. data/History.txt +11 -0
  2. data/Rakefile +1 -1
  3. data/ext/v8/extconf.rb +0 -18
  4. data/ext/v8/rr.cpp +2 -2
  5. data/ext/v8/upstream/{2.1.10 → 2.3.3}/AUTHORS +1 -0
  6. data/ext/v8/upstream/{2.1.10 → 2.3.3}/ChangeLog +239 -0
  7. data/ext/v8/upstream/{2.1.10 → 2.3.3}/LICENSE +0 -0
  8. data/ext/v8/upstream/{2.1.10 → 2.3.3}/SConstruct +29 -17
  9. data/ext/v8/upstream/{2.1.10 → 2.3.3}/include/v8-debug.h +61 -3
  10. data/ext/v8/upstream/{2.1.10 → 2.3.3}/include/v8-profiler.h +182 -5
  11. data/ext/v8/upstream/{2.1.10 → 2.3.3}/include/v8.h +458 -257
  12. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/SConscript +2 -5
  13. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/accessors.cc +2 -2
  14. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/accessors.h +0 -0
  15. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/allocation.cc +0 -0
  16. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/allocation.h +0 -0
  17. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/api.cc +574 -30
  18. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/api.h +12 -10
  19. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/apinatives.js +0 -0
  20. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/apiutils.h +0 -0
  21. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arguments.h +0 -0
  22. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/assembler-arm-inl.h +38 -15
  23. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/assembler-arm.cc +646 -101
  24. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/assembler-arm.h +174 -15
  25. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/builtins-arm.cc +56 -47
  26. data/ext/v8/upstream/2.3.3/src/arm/codegen-arm-inl.h +48 -0
  27. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/codegen-arm.cc +2957 -1448
  28. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/codegen-arm.h +230 -74
  29. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/constants-arm.cc +25 -1
  30. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/constants-arm.h +16 -1
  31. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/cpu-arm.cc +4 -0
  32. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/debug-arm.cc +76 -6
  33. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/disasm-arm.cc +168 -20
  34. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/fast-codegen-arm.cc +5 -2
  35. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/frames-arm.cc +4 -4
  36. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/frames-arm.h +0 -0
  37. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/full-codegen-arm.cc +1558 -248
  38. data/ext/v8/upstream/2.3.3/src/arm/ic-arm.cc +2258 -0
  39. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/jump-target-arm.cc +55 -103
  40. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/macro-assembler-arm.cc +358 -185
  41. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/macro-assembler-arm.h +136 -41
  42. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/regexp-macro-assembler-arm.cc +26 -5
  43. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/regexp-macro-assembler-arm.h +0 -0
  44. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/register-allocator-arm-inl.h +0 -0
  45. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/register-allocator-arm.cc +4 -0
  46. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/register-allocator-arm.h +0 -0
  47. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/simulator-arm.cc +203 -22
  48. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/simulator-arm.h +7 -0
  49. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/stub-cache-arm.cc +531 -324
  50. data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm-inl.h +59 -0
  51. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/virtual-frame-arm.cc +247 -81
  52. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/arm/virtual-frame-arm.h +99 -83
  53. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/array.js +2 -2
  54. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/assembler.cc +6 -13
  55. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/assembler.h +36 -10
  56. data/ext/v8/upstream/2.3.3/src/ast-inl.h +81 -0
  57. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ast.cc +14 -0
  58. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ast.h +20 -35
  59. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/bootstrapper.cc +32 -1
  60. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/bootstrapper.h +0 -4
  61. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/builtins.cc +50 -33
  62. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/builtins.h +2 -0
  63. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/bytecodes-irregexp.h +0 -0
  64. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/cached-powers.h +0 -0
  65. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/char-predicates-inl.h +0 -0
  66. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/char-predicates.h +0 -0
  67. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/checks.cc +0 -0
  68. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/checks.h +8 -6
  69. data/ext/v8/upstream/2.3.3/src/circular-queue-inl.h +53 -0
  70. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/circular-queue.cc +0 -0
  71. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/circular-queue.h +0 -26
  72. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/code-stubs.cc +2 -4
  73. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/code-stubs.h +1 -0
  74. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/code.h +0 -0
  75. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/codegen-inl.h +0 -0
  76. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/codegen.cc +44 -13
  77. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/codegen.h +310 -31
  78. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/compilation-cache.cc +28 -0
  79. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/compilation-cache.h +3 -0
  80. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/compiler.cc +45 -14
  81. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/compiler.h +0 -0
  82. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/contexts.cc +11 -11
  83. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/contexts.h +0 -0
  84. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/conversions-inl.h +0 -0
  85. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/conversions.cc +25 -11
  86. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/conversions.h +0 -0
  87. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/counters.cc +0 -0
  88. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/counters.h +0 -0
  89. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/cpu-profiler-inl.h +2 -1
  90. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/cpu-profiler.cc +68 -24
  91. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/cpu-profiler.h +19 -11
  92. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/cpu.h +0 -0
  93. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8-debug.cc +0 -0
  94. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8-debug.h +0 -0
  95. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8-posix.cc +0 -0
  96. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8-readline.cc +0 -0
  97. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8-windows.cc +0 -0
  98. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8.cc +3 -0
  99. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8.h +0 -0
  100. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/d8.js +55 -2
  101. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/data-flow.cc +3 -0
  102. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/data-flow.h +0 -0
  103. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/date.js +68 -137
  104. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/dateparser-inl.h +0 -0
  105. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/dateparser.cc +2 -8
  106. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/dateparser.h +0 -0
  107. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/debug-agent.cc +3 -3
  108. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/debug-agent.h +0 -0
  109. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/debug-debugger.js +81 -23
  110. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/debug.cc +275 -81
  111. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/debug.h +85 -6
  112. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/disasm.h +0 -0
  113. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/disassembler.cc +1 -1
  114. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/disassembler.h +0 -0
  115. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/diy-fp.cc +0 -0
  116. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/diy-fp.h +0 -0
  117. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/double.h +0 -0
  118. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/dtoa-config.c +0 -0
  119. data/ext/v8/upstream/2.3.3/src/dtoa.cc +77 -0
  120. data/ext/v8/upstream/2.3.3/src/dtoa.h +81 -0
  121. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/execution.cc +111 -3
  122. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/execution.h +12 -1
  123. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/factory.cc +25 -3
  124. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/factory.h +16 -9
  125. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/fast-codegen.cc +0 -0
  126. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/fast-codegen.h +0 -0
  127. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/fast-dtoa.cc +2 -9
  128. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/fast-dtoa.h +1 -2
  129. data/ext/v8/upstream/2.3.3/src/fixed-dtoa.cc +405 -0
  130. data/ext/v8/upstream/{2.1.10/src/jump-target-light.cc → 2.3.3/src/fixed-dtoa.h} +22 -53
  131. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/flag-definitions.h +14 -6
  132. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/flags.cc +5 -9
  133. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/flags.h +0 -0
  134. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/flow-graph.cc +0 -0
  135. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/flow-graph.h +0 -0
  136. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/frame-element.cc +0 -0
  137. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/frame-element.h +0 -0
  138. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/frames-inl.h +0 -0
  139. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/frames.cc +5 -2
  140. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/frames.h +1 -0
  141. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/full-codegen.cc +387 -20
  142. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/full-codegen.h +102 -5
  143. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/func-name-inferrer.cc +0 -0
  144. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/func-name-inferrer.h +0 -0
  145. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/global-handles.cc +8 -4
  146. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/global-handles.h +0 -0
  147. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/globals.h +44 -7
  148. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/handles-inl.h +0 -0
  149. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/handles.cc +19 -0
  150. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/handles.h +8 -0
  151. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/hashmap.cc +0 -0
  152. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/hashmap.h +0 -0
  153. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/heap-inl.h +56 -14
  154. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/heap-profiler.cc +85 -1
  155. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/heap-profiler.h +45 -1
  156. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/heap.cc +994 -396
  157. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/heap.h +220 -65
  158. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/assembler-ia32-inl.h +41 -12
  159. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/assembler-ia32.cc +94 -24
  160. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/assembler-ia32.h +32 -4
  161. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/builtins-ia32.cc +42 -30
  162. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/codegen-ia32-inl.h +0 -0
  163. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/codegen-ia32.cc +1758 -916
  164. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/codegen-ia32.h +67 -74
  165. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/cpu-ia32.cc +4 -0
  166. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/debug-ia32.cc +46 -0
  167. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/disasm-ia32.cc +37 -6
  168. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/fast-codegen-ia32.cc +4 -0
  169. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/fast-codegen-ia32.h +0 -0
  170. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/frames-ia32.cc +4 -0
  171. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/frames-ia32.h +0 -0
  172. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/full-codegen-ia32.cc +1465 -198
  173. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/ic-ia32.cc +688 -367
  174. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/jump-target-ia32.cc +4 -0
  175. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/macro-assembler-ia32.cc +82 -180
  176. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/macro-assembler-ia32.h +41 -25
  177. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/regexp-macro-assembler-ia32.cc +68 -24
  178. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/regexp-macro-assembler-ia32.h +1 -2
  179. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/register-allocator-ia32-inl.h +0 -0
  180. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/register-allocator-ia32.cc +4 -0
  181. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/register-allocator-ia32.h +0 -0
  182. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/simulator-ia32.cc +0 -0
  183. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/simulator-ia32.h +0 -0
  184. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/stub-cache-ia32.cc +649 -302
  185. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/virtual-frame-ia32.cc +23 -1
  186. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ia32/virtual-frame-ia32.h +18 -27
  187. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ic-inl.h +30 -3
  188. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ic.cc +384 -66
  189. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/ic.h +65 -24
  190. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/interpreter-irregexp.cc +0 -0
  191. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/interpreter-irregexp.h +0 -0
  192. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/json.js +3 -3
  193. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/jsregexp.cc +20 -4
  194. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/jsregexp.h +0 -0
  195. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/jump-target-heavy-inl.h +0 -0
  196. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/jump-target-heavy.cc +79 -13
  197. data/ext/v8/upstream/{2.1.10/src/jump-target.h → 2.3.3/src/jump-target-heavy.h} +5 -47
  198. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/jump-target-inl.h +0 -0
  199. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/jump-target-light-inl.h +16 -2
  200. data/ext/v8/upstream/2.3.3/src/jump-target-light.cc +110 -0
  201. data/ext/v8/upstream/2.3.3/src/jump-target-light.h +192 -0
  202. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/jump-target.cc +0 -64
  203. data/ext/v8/upstream/2.3.3/src/jump-target.h +90 -0
  204. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/list-inl.h +0 -0
  205. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/list.h +0 -0
  206. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/liveedit-debugger.js +141 -28
  207. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/liveedit.cc +19 -7
  208. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/liveedit.h +0 -0
  209. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/log-inl.h +0 -0
  210. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/log-utils.cc +0 -0
  211. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/log-utils.h +0 -0
  212. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/log.cc +12 -11
  213. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/log.h +12 -0
  214. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/macro-assembler.h +0 -16
  215. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/macros.py +21 -0
  216. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mark-compact.cc +120 -109
  217. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mark-compact.h +25 -37
  218. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/math.js +0 -0
  219. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/memory.h +0 -0
  220. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/messages.cc +8 -3
  221. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/messages.h +2 -1
  222. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/messages.js +15 -7
  223. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/assembler-mips-inl.h +0 -0
  224. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/assembler-mips.cc +12 -1
  225. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/assembler-mips.h +4 -1
  226. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/builtins-mips.cc +3 -0
  227. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/codegen-mips-inl.h +0 -0
  228. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/codegen-mips.cc +9 -0
  229. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/codegen-mips.h +1 -0
  230. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/constants-mips.cc +5 -0
  231. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/constants-mips.h +0 -0
  232. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/cpu-mips.cc +4 -0
  233. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/debug-mips.cc +3 -0
  234. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/disasm-mips.cc +3 -0
  235. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/fast-codegen-mips.cc +3 -0
  236. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/frames-mips.cc +3 -0
  237. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/frames-mips.h +0 -0
  238. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/full-codegen-mips.cc +5 -1
  239. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/ic-mips.cc +3 -0
  240. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/jump-target-mips.cc +3 -0
  241. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/macro-assembler-mips.cc +3 -0
  242. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/macro-assembler-mips.h +0 -0
  243. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/register-allocator-mips-inl.h +0 -0
  244. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/register-allocator-mips.cc +3 -0
  245. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/register-allocator-mips.h +0 -0
  246. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/simulator-mips.cc +3 -0
  247. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/simulator-mips.h +0 -0
  248. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/stub-cache-mips.cc +3 -0
  249. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/virtual-frame-mips.cc +3 -0
  250. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mips/virtual-frame-mips.h +0 -0
  251. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mirror-debugger.js +46 -4
  252. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/mksnapshot.cc +0 -0
  253. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/natives.h +0 -0
  254. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/objects-debug.cc +8 -1
  255. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/objects-inl.h +235 -62
  256. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/objects.cc +497 -231
  257. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/objects.h +355 -149
  258. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/oprofile-agent.cc +0 -0
  259. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/oprofile-agent.h +0 -0
  260. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/parser.cc +31 -6
  261. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/parser.h +1 -1
  262. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-freebsd.cc +9 -6
  263. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-linux.cc +26 -6
  264. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-macos.cc +11 -6
  265. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-nullos.cc +0 -0
  266. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-openbsd.cc +6 -0
  267. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-posix.cc +0 -0
  268. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-solaris.cc +69 -23
  269. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform-win32.cc +15 -11
  270. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/platform.h +10 -6
  271. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/powers-ten.h +0 -0
  272. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/prettyprinter.cc +0 -0
  273. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/prettyprinter.h +0 -0
  274. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/profile-generator-inl.h +26 -2
  275. data/ext/v8/upstream/2.3.3/src/profile-generator.cc +1830 -0
  276. data/ext/v8/upstream/2.3.3/src/profile-generator.h +853 -0
  277. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/property.cc +0 -0
  278. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/property.h +0 -0
  279. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
  280. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-macro-assembler-irregexp.cc +0 -0
  281. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-macro-assembler-irregexp.h +0 -0
  282. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-macro-assembler-tracer.cc +0 -0
  283. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-macro-assembler-tracer.h +0 -0
  284. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-macro-assembler.cc +1 -3
  285. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-macro-assembler.h +0 -0
  286. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-stack.cc +0 -0
  287. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp-stack.h +0 -0
  288. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/regexp.js +25 -4
  289. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/register-allocator-inl.h +0 -0
  290. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/register-allocator.cc +4 -3
  291. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/register-allocator.h +0 -0
  292. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/rewriter.cc +85 -8
  293. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/rewriter.h +0 -0
  294. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/runtime.cc +547 -221
  295. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/runtime.h +5 -1
  296. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/runtime.js +23 -31
  297. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/scanner.cc +12 -6
  298. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/scanner.h +60 -53
  299. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/scopeinfo.cc +156 -168
  300. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/scopeinfo.h +58 -62
  301. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/scopes.cc +0 -0
  302. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/scopes.h +0 -0
  303. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/serialize.cc +320 -242
  304. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/serialize.h +81 -48
  305. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/shell.h +0 -0
  306. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/simulator.h +0 -0
  307. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/smart-pointer.h +0 -0
  308. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/snapshot-common.cc +0 -0
  309. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/snapshot-empty.cc +0 -0
  310. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/snapshot.h +0 -0
  311. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/spaces-inl.h +177 -74
  312. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/spaces.cc +138 -315
  313. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/spaces.h +155 -124
  314. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/splay-tree-inl.h +0 -0
  315. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/splay-tree.h +0 -0
  316. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/string-stream.cc +0 -0
  317. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/string-stream.h +0 -0
  318. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/string.js +113 -119
  319. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/stub-cache.cc +242 -97
  320. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/stub-cache.h +118 -55
  321. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/third_party/dtoa/COPYING +0 -0
  322. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/third_party/dtoa/dtoa.c +4 -0
  323. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/third_party/valgrind/valgrind.h +0 -0
  324. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/token.cc +0 -0
  325. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/token.h +0 -0
  326. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/top.cc +107 -26
  327. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/top.h +9 -4
  328. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/type-info.cc +0 -0
  329. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/type-info.h +2 -2
  330. data/ext/v8/upstream/2.3.3/src/unbound-queue-inl.h +95 -0
  331. data/ext/v8/upstream/2.3.3/src/unbound-queue.h +67 -0
  332. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/unicode-inl.h +0 -0
  333. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/unicode.cc +0 -0
  334. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/unicode.h +0 -0
  335. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/uri.js +0 -0
  336. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/utils.cc +0 -0
  337. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/utils.h +83 -1
  338. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/v8-counters.cc +0 -0
  339. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/v8-counters.h +20 -0
  340. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/v8.cc +5 -1
  341. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/v8.h +0 -0
  342. data/ext/v8/upstream/2.3.3/src/v8dll-main.cc +39 -0
  343. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/v8natives.js +210 -33
  344. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/v8threads.cc +1 -1
  345. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/v8threads.h +1 -1
  346. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/variables.cc +0 -0
  347. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/variables.h +0 -0
  348. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/version.cc +3 -3
  349. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/version.h +0 -0
  350. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/virtual-frame-heavy-inl.h +40 -0
  351. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/virtual-frame-heavy.cc +0 -0
  352. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/virtual-frame-inl.h +0 -0
  353. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/virtual-frame-light-inl.h +106 -5
  354. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/virtual-frame-light.cc +4 -1
  355. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/virtual-frame.cc +0 -0
  356. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/virtual-frame.h +0 -0
  357. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/vm-state-inl.h +6 -3
  358. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/vm-state.cc +1 -1
  359. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/vm-state.h +6 -4
  360. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/assembler-x64-inl.h +42 -5
  361. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/assembler-x64.cc +285 -53
  362. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/assembler-x64.h +54 -18
  363. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/builtins-x64.cc +31 -33
  364. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/codegen-x64-inl.h +0 -0
  365. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/codegen-x64.cc +9787 -8722
  366. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/codegen-x64.h +82 -47
  367. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/cpu-x64.cc +4 -0
  368. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/debug-x64.cc +55 -6
  369. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/disasm-x64.cc +42 -19
  370. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/fast-codegen-x64.cc +4 -0
  371. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/frames-x64.cc +4 -0
  372. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/frames-x64.h +4 -0
  373. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/full-codegen-x64.cc +1487 -210
  374. data/ext/v8/upstream/2.3.3/src/x64/ic-x64.cc +1907 -0
  375. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/jump-target-x64.cc +4 -0
  376. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/macro-assembler-x64.cc +366 -338
  377. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/macro-assembler-x64.h +83 -38
  378. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/regexp-macro-assembler-x64.cc +82 -23
  379. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/regexp-macro-assembler-x64.h +1 -2
  380. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/register-allocator-x64-inl.h +6 -5
  381. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/register-allocator-x64.cc +4 -0
  382. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/register-allocator-x64.h +1 -1
  383. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/simulator-x64.cc +0 -0
  384. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/simulator-x64.h +0 -0
  385. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/stub-cache-x64.cc +556 -377
  386. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/virtual-frame-x64.cc +197 -98
  387. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/x64/virtual-frame-x64.h +37 -28
  388. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/zone-inl.h +0 -0
  389. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/zone.cc +0 -0
  390. data/ext/v8/upstream/{2.1.10 → 2.3.3}/src/zone.h +0 -0
  391. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/codemap.js +0 -0
  392. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/consarray.js +0 -0
  393. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/csvparser.js +0 -0
  394. data/ext/v8/upstream/2.3.3/tools/gc-nvp-trace-processor.py +317 -0
  395. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/generate-ten-powers.scm +0 -0
  396. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/gyp/v8.gyp +87 -20
  397. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/js2c.py +19 -15
  398. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/jsmin.py +0 -0
  399. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/linux-tick-processor +0 -0
  400. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/linux-tick-processor.py +0 -0
  401. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/logreader.js +0 -0
  402. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/mac-nm +0 -0
  403. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/mac-tick-processor +0 -0
  404. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/annotate +0 -0
  405. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/common +0 -0
  406. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/dump +0 -0
  407. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/report +0 -0
  408. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/reset +0 -0
  409. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/run +0 -0
  410. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/shutdown +0 -0
  411. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/oprofile/start +0 -0
  412. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/presubmit.py +0 -0
  413. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/process-heap-prof.py +0 -0
  414. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/profile.js +0 -0
  415. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/profile_view.js +0 -0
  416. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/run-valgrind.py +0 -0
  417. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/splaytree.js +0 -0
  418. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/splaytree.py +0 -0
  419. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/stats-viewer.py +25 -13
  420. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/test.py +0 -0
  421. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/tickprocessor-driver.js +0 -0
  422. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/tickprocessor.js +0 -0
  423. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/tickprocessor.py +0 -0
  424. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/utils.py +0 -0
  425. data/ext/v8/upstream/2.3.3/tools/v8.xcodeproj/project.pbxproj +1855 -0
  426. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/README.txt +0 -0
  427. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/arm.vsprops +0 -0
  428. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/common.vsprops +0 -0
  429. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/d8.vcproj +0 -0
  430. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/d8_arm.vcproj +0 -0
  431. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/d8_x64.vcproj +0 -0
  432. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/d8js2c.cmd +0 -0
  433. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/debug.vsprops +0 -0
  434. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/ia32.vsprops +0 -0
  435. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/js2c.cmd +0 -0
  436. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/release.vsprops +0 -0
  437. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8.sln +0 -0
  438. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8.vcproj +0 -0
  439. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_arm.sln +0 -0
  440. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_arm.vcproj +0 -0
  441. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_base.vcproj +40 -0
  442. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_base_arm.vcproj +20 -0
  443. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_base_x64.vcproj +16 -0
  444. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_cctest.vcproj +4 -0
  445. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
  446. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
  447. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
  448. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
  449. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_process_sample.vcproj +0 -0
  450. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
  451. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
  452. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_shell_sample.vcproj +0 -0
  453. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -0
  454. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -0
  455. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_snapshot.vcproj +0 -0
  456. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
  457. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
  458. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
  459. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_x64.sln +0 -0
  460. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/v8_x64.vcproj +0 -0
  461. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/visual_studio/x64.vsprops +0 -0
  462. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/windows-tick-processor.bat +0 -0
  463. data/ext/v8/upstream/{2.1.10 → 2.3.3}/tools/windows-tick-processor.py +0 -0
  464. data/ext/v8/upstream/Makefile +1 -1
  465. data/ext/v8/v8_template.cpp +94 -2
  466. data/ext/v8/v8_try_catch.cpp +2 -2
  467. data/lib/v8.rb +1 -1
  468. data/lib/v8/access.rb +93 -40
  469. data/lib/v8/cli.rb +1 -1
  470. data/lib/v8/function.rb +14 -2
  471. data/spec/redjs/jsapi_spec.rb +231 -42
  472. data/therubyracer.gemspec +3 -3
  473. metadata +463 -453
  474. data/ext/v8/upstream/2.1.10/src/arm/assembler-thumb2-inl.h +0 -263
  475. data/ext/v8/upstream/2.1.10/src/arm/assembler-thumb2.cc +0 -1878
  476. data/ext/v8/upstream/2.1.10/src/arm/assembler-thumb2.h +0 -1036
  477. data/ext/v8/upstream/2.1.10/src/arm/codegen-arm-inl.h +0 -72
  478. data/ext/v8/upstream/2.1.10/src/arm/ic-arm.cc +0 -1833
  479. data/ext/v8/upstream/2.1.10/src/circular-queue-inl.h +0 -101
  480. data/ext/v8/upstream/2.1.10/src/profile-generator.cc +0 -583
  481. data/ext/v8/upstream/2.1.10/src/profile-generator.h +0 -364
  482. data/ext/v8/upstream/2.1.10/src/x64/ic-x64.cc +0 -1621
@@ -27,6 +27,8 @@
27
27
 
28
28
  #include "v8.h"
29
29
 
30
+ #if defined(V8_TARGET_ARCH_X64)
31
+
30
32
  #include "codegen-inl.h"
31
33
  #include "register-allocator-inl.h"
32
34
  #include "virtual-frame-inl.h"
@@ -85,3 +87,5 @@ Result RegisterAllocator::AllocateByteRegisterWithoutSpilling() {
85
87
 
86
88
 
87
89
  } } // namespace v8::internal
90
+
91
+ #endif // V8_TARGET_ARCH_X64
@@ -33,7 +33,7 @@ namespace internal {
33
33
 
34
34
  class RegisterAllocatorConstants : public AllStatic {
35
35
  public:
36
- static const int kNumRegisters = 11;
36
+ static const int kNumRegisters = 10;
37
37
  static const int kInvalidRegister = -1;
38
38
  };
39
39
 
@@ -28,6 +28,8 @@
28
28
 
29
29
  #include "v8.h"
30
30
 
31
+ #if defined(V8_TARGET_ARCH_X64)
32
+
31
33
  #include "ic-inl.h"
32
34
  #include "codegen-inl.h"
33
35
  #include "stub-cache.h"
@@ -79,6 +81,106 @@ static void ProbeTable(MacroAssembler* masm,
79
81
  }
80
82
 
81
83
 
84
+ // Helper function used to check that the dictionary doesn't contain
85
+ // the property. This function may return false negatives, so miss_label
86
+ // must always call a backup property check that is complete.
87
+ // This function is safe to call if the receiver has fast properties.
88
+ // Name must be a symbol and receiver must be a heap object.
89
+ static void GenerateDictionaryNegativeLookup(MacroAssembler* masm,
90
+ Label* miss_label,
91
+ Register receiver,
92
+ String* name,
93
+ Register r0,
94
+ Register r1) {
95
+ ASSERT(name->IsSymbol());
96
+ __ IncrementCounter(&Counters::negative_lookups, 1);
97
+ __ IncrementCounter(&Counters::negative_lookups_miss, 1);
98
+
99
+ Label done;
100
+ __ movq(r0, FieldOperand(receiver, HeapObject::kMapOffset));
101
+
102
+ const int kInterceptorOrAccessCheckNeededMask =
103
+ (1 << Map::kHasNamedInterceptor) | (1 << Map::kIsAccessCheckNeeded);
104
+
105
+ // Bail out if the receiver has a named interceptor or requires access checks.
106
+ __ testb(FieldOperand(r0, Map::kBitFieldOffset),
107
+ Immediate(kInterceptorOrAccessCheckNeededMask));
108
+ __ j(not_zero, miss_label);
109
+
110
+ // Check that receiver is a JSObject.
111
+ __ CmpInstanceType(r0, FIRST_JS_OBJECT_TYPE);
112
+ __ j(below, miss_label);
113
+
114
+ // Load properties array.
115
+ Register properties = r0;
116
+ __ movq(properties, FieldOperand(receiver, JSObject::kPropertiesOffset));
117
+
118
+ // Check that the properties array is a dictionary.
119
+ __ CompareRoot(FieldOperand(properties, HeapObject::kMapOffset),
120
+ Heap::kHashTableMapRootIndex);
121
+ __ j(not_equal, miss_label);
122
+
123
+ // Compute the capacity mask.
124
+ const int kCapacityOffset =
125
+ StringDictionary::kHeaderSize +
126
+ StringDictionary::kCapacityIndex * kPointerSize;
127
+
128
+ // Generate an unrolled loop that performs a few probes before
129
+ // giving up.
130
+ static const int kProbes = 4;
131
+ const int kElementsStartOffset =
132
+ StringDictionary::kHeaderSize +
133
+ StringDictionary::kElementsStartIndex * kPointerSize;
134
+
135
+ // If names of slots in range from 1 to kProbes - 1 for the hash value are
136
+ // not equal to the name and kProbes-th slot is not used (its name is the
137
+ // undefined value), it guarantees the hash table doesn't contain the
138
+ // property. It's true even if some slots represent deleted properties
139
+ // (their names are the null value).
140
+ for (int i = 0; i < kProbes; i++) {
141
+ // r0 points to properties hash.
142
+ // Compute the masked index: (hash + i + i * i) & mask.
143
+ Register index = r1;
144
+ // Capacity is smi 2^n.
145
+ __ SmiToInteger32(index, FieldOperand(properties, kCapacityOffset));
146
+ __ decl(index);
147
+ __ and_(index,
148
+ Immediate(name->Hash() + StringDictionary::GetProbeOffset(i)));
149
+
150
+ // Scale the index by multiplying by the entry size.
151
+ ASSERT(StringDictionary::kEntrySize == 3);
152
+ __ lea(index, Operand(index, index, times_2, 0)); // index *= 3.
153
+
154
+ Register entity_name = r1;
155
+ // Having undefined at this place means the name is not contained.
156
+ ASSERT_EQ(kSmiTagSize, 1);
157
+ __ movq(entity_name, Operand(properties, index, times_pointer_size,
158
+ kElementsStartOffset - kHeapObjectTag));
159
+ __ Cmp(entity_name, Factory::undefined_value());
160
+ // __ jmp(miss_label);
161
+ if (i != kProbes - 1) {
162
+ __ j(equal, &done);
163
+
164
+ // Stop if found the property.
165
+ __ Cmp(entity_name, Handle<String>(name));
166
+ __ j(equal, miss_label);
167
+
168
+ // Check if the entry name is not a symbol.
169
+ __ movq(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset));
170
+ __ testb(FieldOperand(entity_name, Map::kInstanceTypeOffset),
171
+ Immediate(kIsSymbolMask));
172
+ __ j(zero, miss_label);
173
+ } else {
174
+ // Give up probing if still not found the undefined value.
175
+ __ j(not_equal, miss_label);
176
+ }
177
+ }
178
+
179
+ __ bind(&done);
180
+ __ DecrementCounter(&Counters::negative_lookups_miss, 1);
181
+ }
182
+
183
+
82
184
  void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) {
83
185
  ASSERT(kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC);
84
186
  Code* code = NULL;
@@ -112,6 +214,17 @@ void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
112
214
  }
113
215
 
114
216
 
217
+ void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
218
+ MacroAssembler* masm, int index, Register prototype) {
219
+ // Get the global function with the given index.
220
+ JSFunction* function = JSFunction::cast(Top::global_context()->get(index));
221
+ // Load its initial map. The global functions all have initial maps.
222
+ __ Move(prototype, Handle<Map>(function->initial_map()));
223
+ // Load the prototype from the initial map.
224
+ __ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
225
+ }
226
+
227
+
115
228
  // Load a fast property out of a holder object (src). In-object properties
116
229
  // are loaded directly otherwise the property is loaded from the properties
117
230
  // fixed array.
@@ -373,186 +486,6 @@ void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm,
373
486
  }
374
487
 
375
488
 
376
- template <class Compiler>
377
- static void CompileLoadInterceptor(Compiler* compiler,
378
- StubCompiler* stub_compiler,
379
- MacroAssembler* masm,
380
- JSObject* object,
381
- JSObject* holder,
382
- String* name,
383
- LookupResult* lookup,
384
- Register receiver,
385
- Register scratch1,
386
- Register scratch2,
387
- Label* miss) {
388
- ASSERT(holder->HasNamedInterceptor());
389
- ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
390
-
391
- // Check that the receiver isn't a smi.
392
- __ JumpIfSmi(receiver, miss);
393
-
394
- // Check that the maps haven't changed.
395
- Register reg =
396
- stub_compiler->CheckPrototypes(object, receiver, holder,
397
- scratch1, scratch2, name, miss);
398
-
399
- if (lookup->IsProperty() && lookup->IsCacheable()) {
400
- compiler->CompileCacheable(masm,
401
- stub_compiler,
402
- receiver,
403
- reg,
404
- scratch1,
405
- scratch2,
406
- holder,
407
- lookup,
408
- name,
409
- miss);
410
- } else {
411
- compiler->CompileRegular(masm,
412
- receiver,
413
- reg,
414
- scratch2,
415
- holder,
416
- miss);
417
- }
418
- }
419
-
420
-
421
- class LoadInterceptorCompiler BASE_EMBEDDED {
422
- public:
423
- explicit LoadInterceptorCompiler(Register name) : name_(name) {}
424
-
425
- void CompileCacheable(MacroAssembler* masm,
426
- StubCompiler* stub_compiler,
427
- Register receiver,
428
- Register holder,
429
- Register scratch1,
430
- Register scratch2,
431
- JSObject* holder_obj,
432
- LookupResult* lookup,
433
- String* name,
434
- Label* miss_label) {
435
- AccessorInfo* callback = NULL;
436
- bool optimize = false;
437
- // So far the most popular follow ups for interceptor loads are FIELD
438
- // and CALLBACKS, so inline only them, other cases may be added
439
- // later.
440
- if (lookup->type() == FIELD) {
441
- optimize = true;
442
- } else if (lookup->type() == CALLBACKS) {
443
- Object* callback_object = lookup->GetCallbackObject();
444
- if (callback_object->IsAccessorInfo()) {
445
- callback = AccessorInfo::cast(callback_object);
446
- optimize = callback->getter() != NULL;
447
- }
448
- }
449
-
450
- if (!optimize) {
451
- CompileRegular(masm, receiver, holder, scratch2, holder_obj, miss_label);
452
- return;
453
- }
454
-
455
- // Note: starting a frame here makes GC aware of pointers pushed below.
456
- __ EnterInternalFrame();
457
-
458
- if (lookup->type() == CALLBACKS) {
459
- __ push(receiver);
460
- }
461
- __ push(holder);
462
- __ push(name_);
463
-
464
- CompileCallLoadPropertyWithInterceptor(masm,
465
- receiver,
466
- holder,
467
- name_,
468
- holder_obj);
469
-
470
- Label interceptor_failed;
471
- __ CompareRoot(rax, Heap::kNoInterceptorResultSentinelRootIndex);
472
- __ j(equal, &interceptor_failed);
473
- __ LeaveInternalFrame();
474
- __ ret(0);
475
-
476
- __ bind(&interceptor_failed);
477
- __ pop(name_);
478
- __ pop(holder);
479
- if (lookup->type() == CALLBACKS) {
480
- __ pop(receiver);
481
- }
482
-
483
- __ LeaveInternalFrame();
484
-
485
- if (lookup->type() == FIELD) {
486
- holder = stub_compiler->CheckPrototypes(holder_obj,
487
- holder,
488
- lookup->holder(),
489
- scratch1,
490
- scratch2,
491
- name,
492
- miss_label);
493
- stub_compiler->GenerateFastPropertyLoad(masm,
494
- rax,
495
- holder,
496
- lookup->holder(),
497
- lookup->GetFieldIndex());
498
- __ ret(0);
499
- } else {
500
- ASSERT(lookup->type() == CALLBACKS);
501
- ASSERT(lookup->GetCallbackObject()->IsAccessorInfo());
502
- ASSERT(callback != NULL);
503
- ASSERT(callback->getter() != NULL);
504
-
505
- Label cleanup;
506
- __ pop(scratch2);
507
- __ push(receiver);
508
- __ push(scratch2);
509
-
510
- holder = stub_compiler->CheckPrototypes(holder_obj, holder,
511
- lookup->holder(), scratch1,
512
- scratch2,
513
- name,
514
- &cleanup);
515
-
516
- __ pop(scratch2); // save old return address
517
- __ push(holder);
518
- __ Move(holder, Handle<AccessorInfo>(callback));
519
- __ push(holder);
520
- __ push(FieldOperand(holder, AccessorInfo::kDataOffset));
521
- __ push(name_);
522
- __ push(scratch2); // restore old return address
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
- __ pop(scratch); // save old return address
543
- PushInterceptorArguments(masm, receiver, holder, name_, holder_obj);
544
- __ push(scratch); // restore old return address
545
-
546
- ExternalReference ref = ExternalReference(
547
- IC_Utility(IC::kLoadPropertyWithInterceptorForLoad));
548
- __ TailCallExternalReference(ref, 5, 1);
549
- }
550
-
551
- private:
552
- Register name_;
553
- };
554
-
555
-
556
489
  // Reserves space for the extra arguments to FastHandleApiCall in the
557
490
  // caller's frame.
558
491
  //
@@ -664,6 +597,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
664
597
  Register receiver,
665
598
  Register scratch1,
666
599
  Register scratch2,
600
+ Register scratch3,
667
601
  Label* miss) {
668
602
  ASSERT(holder->HasNamedInterceptor());
669
603
  ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
@@ -679,6 +613,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
679
613
  receiver,
680
614
  scratch1,
681
615
  scratch2,
616
+ scratch3,
682
617
  holder,
683
618
  lookup,
684
619
  name,
@@ -690,6 +625,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
690
625
  receiver,
691
626
  scratch1,
692
627
  scratch2,
628
+ scratch3,
693
629
  name,
694
630
  holder,
695
631
  miss);
@@ -702,7 +638,8 @@ class CallInterceptorCompiler BASE_EMBEDDED {
702
638
  Register receiver,
703
639
  Register scratch1,
704
640
  Register scratch2,
705
- JSObject* holder_obj,
641
+ Register scratch3,
642
+ JSObject* interceptor_holder,
706
643
  LookupResult* lookup,
707
644
  String* name,
708
645
  const CallOptimization& optimization,
@@ -715,10 +652,13 @@ class CallInterceptorCompiler BASE_EMBEDDED {
715
652
  bool can_do_fast_api_call = false;
716
653
  if (optimization.is_simple_api_call() &&
717
654
  !lookup->holder()->IsGlobalObject()) {
718
- depth1 = optimization.GetPrototypeDepthOfExpectedType(object, holder_obj);
655
+ depth1 =
656
+ optimization.GetPrototypeDepthOfExpectedType(object,
657
+ interceptor_holder);
719
658
  if (depth1 == kInvalidProtoDepth) {
720
- depth2 = optimization.GetPrototypeDepthOfExpectedType(holder_obj,
721
- lookup->holder());
659
+ depth2 =
660
+ optimization.GetPrototypeDepthOfExpectedType(interceptor_holder,
661
+ lookup->holder());
722
662
  }
723
663
  can_do_fast_api_call = (depth1 != kInvalidProtoDepth) ||
724
664
  (depth2 != kInvalidProtoDepth);
@@ -731,24 +671,39 @@ class CallInterceptorCompiler BASE_EMBEDDED {
731
671
  ReserveSpaceForFastApiCall(masm, scratch1);
732
672
  }
733
673
 
674
+ // Check that the maps from receiver to interceptor's holder
675
+ // haven't changed and thus we can invoke interceptor.
734
676
  Label miss_cleanup;
735
677
  Label* miss = can_do_fast_api_call ? &miss_cleanup : miss_label;
736
678
  Register holder =
737
- stub_compiler_->CheckPrototypes(object, receiver, holder_obj,
738
- scratch1, scratch2, name,
739
- depth1, miss);
679
+ stub_compiler_->CheckPrototypes(object, receiver,
680
+ interceptor_holder, scratch1,
681
+ scratch2, scratch3, name, depth1, miss);
740
682
 
683
+ // Invoke an interceptor and if it provides a value,
684
+ // branch to |regular_invoke|.
741
685
  Label regular_invoke;
742
- LoadWithInterceptor(masm, receiver, holder, holder_obj, &regular_invoke);
743
-
744
- // Generate code for the failed interceptor case.
745
-
746
- // Check the lookup is still valid.
747
- stub_compiler_->CheckPrototypes(holder_obj, receiver,
748
- lookup->holder(),
749
- scratch1, scratch2, name,
750
- depth2, miss);
686
+ LoadWithInterceptor(masm, receiver, holder, interceptor_holder,
687
+ &regular_invoke);
688
+
689
+ // Interceptor returned nothing for this property. Try to use cached
690
+ // constant function.
691
+
692
+ // Check that the maps from interceptor's holder to constant function's
693
+ // holder haven't changed and thus we can use cached constant function.
694
+ if (interceptor_holder != lookup->holder()) {
695
+ stub_compiler_->CheckPrototypes(interceptor_holder, receiver,
696
+ lookup->holder(), scratch1,
697
+ scratch2, scratch3, name, depth2, miss);
698
+ } else {
699
+ // CheckPrototypes has a side effect of fetching a 'holder'
700
+ // for API (object which is instanceof for the signature). It's
701
+ // safe to omit it here, as if present, it should be fetched
702
+ // by the previous CheckPrototypes.
703
+ ASSERT(depth2 == kInvalidProtoDepth);
704
+ }
751
705
 
706
+ // Invoke function.
752
707
  if (can_do_fast_api_call) {
753
708
  GenerateFastApiCall(masm, optimization, arguments_.immediate());
754
709
  } else {
@@ -756,12 +711,14 @@ class CallInterceptorCompiler BASE_EMBEDDED {
756
711
  JUMP_FUNCTION);
757
712
  }
758
713
 
714
+ // Deferred code for fast API call case---clean preallocated space.
759
715
  if (can_do_fast_api_call) {
760
716
  __ bind(&miss_cleanup);
761
717
  FreeSpaceForFastApiCall(masm, scratch1);
762
718
  __ jmp(miss_label);
763
719
  }
764
720
 
721
+ // Invoke a regular function.
765
722
  __ bind(&regular_invoke);
766
723
  if (can_do_fast_api_call) {
767
724
  FreeSpaceForFastApiCall(masm, scratch1);
@@ -773,12 +730,13 @@ class CallInterceptorCompiler BASE_EMBEDDED {
773
730
  Register receiver,
774
731
  Register scratch1,
775
732
  Register scratch2,
733
+ Register scratch3,
776
734
  String* name,
777
- JSObject* holder_obj,
735
+ JSObject* interceptor_holder,
778
736
  Label* miss_label) {
779
737
  Register holder =
780
- stub_compiler_->CheckPrototypes(object, receiver, holder_obj,
781
- scratch1, scratch2, name,
738
+ stub_compiler_->CheckPrototypes(object, receiver, interceptor_holder,
739
+ scratch1, scratch2, scratch3, name,
782
740
  miss_label);
783
741
 
784
742
  __ EnterInternalFrame();
@@ -789,7 +747,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
789
747
  receiver,
790
748
  holder,
791
749
  name_,
792
- holder_obj);
750
+ interceptor_holder);
793
751
 
794
752
  __ CallExternalReference(
795
753
  ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorForCall)),
@@ -853,6 +811,21 @@ static Object* GenerateCheckPropertyCell(MacroAssembler* masm,
853
811
 
854
812
  #define __ ACCESS_MASM((masm()))
855
813
 
814
+
815
+ void CallStubCompiler::GenerateNameCheck(String* name, Label* miss) {
816
+ if (kind_ == Code::KEYED_CALL_IC) {
817
+ __ Cmp(rcx, Handle<String>(name));
818
+ __ j(not_equal, miss);
819
+ }
820
+ }
821
+
822
+
823
+ void CallStubCompiler::GenerateMissBranch() {
824
+ Handle<Code> ic = ComputeCallMiss(arguments().immediate(), kind_);
825
+ __ Jump(ic, RelocInfo::CODE_TARGET);
826
+ }
827
+
828
+
856
829
  Object* CallStubCompiler::CompileCallConstant(Object* object,
857
830
  JSObject* holder,
858
831
  JSFunction* function,
@@ -870,9 +843,9 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
870
843
 
871
844
  SharedFunctionInfo* function_info = function->shared();
872
845
  if (function_info->HasCustomCallGenerator()) {
873
- CustomCallGenerator generator =
874
- ToCData<CustomCallGenerator>(function_info->function_data());
875
- Object* result = generator(this, object, holder, function, name, check);
846
+ const int id = function_info->custom_call_generator_id();
847
+ Object* result =
848
+ CompileCustomCall(id, object, holder, function, name, check);
876
849
  // undefined means bail out to regular compiler.
877
850
  if (!result->IsUndefined()) {
878
851
  return result;
@@ -881,6 +854,8 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
881
854
 
882
855
  Label miss_in_smi_check;
883
856
 
857
+ GenerateNameCheck(name, &miss_in_smi_check);
858
+
884
859
  // Get the receiver from the stack.
885
860
  const int argc = arguments().immediate();
886
861
  __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
@@ -914,7 +889,7 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
914
889
 
915
890
  // Check that the maps haven't changed.
916
891
  CheckPrototypes(JSObject::cast(object), rdx, holder,
917
- rbx, rax, name, depth, &miss);
892
+ rbx, rax, rdi, name, depth, &miss);
918
893
 
919
894
  // Patch the receiver on the stack with the global proxy if
920
895
  // necessary.
@@ -934,11 +909,10 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
934
909
  __ CmpObjectType(rdx, FIRST_NONSTRING_TYPE, rax);
935
910
  __ j(above_equal, &miss);
936
911
  // Check that the maps starting from the prototype haven't changed.
937
- GenerateLoadGlobalFunctionPrototype(masm(),
938
- Context::STRING_FUNCTION_INDEX,
939
- rax);
912
+ GenerateDirectLoadGlobalFunctionPrototype(
913
+ masm(), Context::STRING_FUNCTION_INDEX, rax);
940
914
  CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder,
941
- rbx, rdx, name, &miss);
915
+ rbx, rdx, rdi, name, &miss);
942
916
  }
943
917
  break;
944
918
 
@@ -954,11 +928,10 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
954
928
  __ j(not_equal, &miss);
955
929
  __ bind(&fast);
956
930
  // Check that the maps starting from the prototype haven't changed.
957
- GenerateLoadGlobalFunctionPrototype(masm(),
958
- Context::NUMBER_FUNCTION_INDEX,
959
- rax);
931
+ GenerateDirectLoadGlobalFunctionPrototype(
932
+ masm(), Context::NUMBER_FUNCTION_INDEX, rax);
960
933
  CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder,
961
- rbx, rdx, name, &miss);
934
+ rbx, rdx, rdi, name, &miss);
962
935
  }
963
936
  break;
964
937
  }
@@ -976,11 +949,10 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
976
949
  __ j(not_equal, &miss);
977
950
  __ bind(&fast);
978
951
  // Check that the maps starting from the prototype haven't changed.
979
- GenerateLoadGlobalFunctionPrototype(masm(),
980
- Context::BOOLEAN_FUNCTION_INDEX,
981
- rax);
952
+ GenerateDirectLoadGlobalFunctionPrototype(
953
+ masm(), Context::BOOLEAN_FUNCTION_INDEX, rax);
982
954
  CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder,
983
- rbx, rdx, name, &miss);
955
+ rbx, rdx, rdi, name, &miss);
984
956
  }
985
957
  break;
986
958
  }
@@ -1003,15 +975,10 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
1003
975
 
1004
976
  // Handle call cache miss.
1005
977
  __ bind(&miss_in_smi_check);
1006
- Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1007
- __ Jump(ic, RelocInfo::CODE_TARGET);
978
+ GenerateMissBranch();
1008
979
 
1009
980
  // Return the generated code.
1010
- String* function_name = NULL;
1011
- if (function->shared()->name()->IsString()) {
1012
- function_name = String::cast(function->shared()->name());
1013
- }
1014
- return GetCode(CONSTANT_FUNCTION, function_name);
981
+ return GetCode(function);
1015
982
  }
1016
983
 
1017
984
 
@@ -1030,6 +997,8 @@ Object* CallStubCompiler::CompileCallField(JSObject* object,
1030
997
  // -----------------------------------
1031
998
  Label miss;
1032
999
 
1000
+ GenerateNameCheck(name, &miss);
1001
+
1033
1002
  // Get the receiver from the stack.
1034
1003
  const int argc = arguments().immediate();
1035
1004
  __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
@@ -1038,7 +1007,8 @@ Object* CallStubCompiler::CompileCallField(JSObject* object,
1038
1007
  __ JumpIfSmi(rdx, &miss);
1039
1008
 
1040
1009
  // Do the right check and compute the holder register.
1041
- Register reg = CheckPrototypes(object, rdx, holder, rbx, rax, name, &miss);
1010
+ Register reg = CheckPrototypes(object, rdx, holder, rbx, rax, rdi,
1011
+ name, &miss);
1042
1012
 
1043
1013
  GenerateFastPropertyLoad(masm(), rdi, reg, holder, index);
1044
1014
 
@@ -1059,8 +1029,7 @@ Object* CallStubCompiler::CompileCallField(JSObject* object,
1059
1029
 
1060
1030
  // Handle call cache miss.
1061
1031
  __ bind(&miss);
1062
- Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1063
- __ Jump(ic, RelocInfo::CODE_TARGET);
1032
+ GenerateMissBranch();
1064
1033
 
1065
1034
  // Return the generated code.
1066
1035
  return GetCode(FIELD, name);
@@ -1088,6 +1057,8 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1088
1057
 
1089
1058
  Label miss;
1090
1059
 
1060
+ GenerateNameCheck(name, &miss);
1061
+
1091
1062
  // Get the receiver from the stack.
1092
1063
  const int argc = arguments().immediate();
1093
1064
  __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
@@ -1100,6 +1071,7 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1100
1071
  holder,
1101
1072
  rbx,
1102
1073
  rax,
1074
+ rdi,
1103
1075
  name,
1104
1076
  &miss);
1105
1077
 
@@ -1117,45 +1089,45 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1117
1089
  __ j(not_equal, &miss);
1118
1090
 
1119
1091
  if (argc == 1) { // Otherwise fall through to call builtin.
1120
- Label call_builtin, exit, with_rset_update, attempt_to_grow_elements;
1092
+ Label call_builtin, exit, with_write_barrier, attempt_to_grow_elements;
1121
1093
 
1122
1094
  // Get the array's length into rax and calculate new length.
1123
- __ movq(rax, FieldOperand(rdx, JSArray::kLengthOffset));
1095
+ __ SmiToInteger32(rax, FieldOperand(rdx, JSArray::kLengthOffset));
1124
1096
  STATIC_ASSERT(FixedArray::kMaxLength < Smi::kMaxValue);
1125
- __ SmiAddConstant(rax, rax, Smi::FromInt(argc));
1097
+ __ addl(rax, Immediate(argc));
1126
1098
 
1127
1099
  // Get the element's length into rcx.
1128
- __ movl(rcx, FieldOperand(rbx, FixedArray::kLengthOffset));
1129
- __ Integer32ToSmi(rcx, rcx);
1100
+ __ SmiToInteger32(rcx, FieldOperand(rbx, FixedArray::kLengthOffset));
1130
1101
 
1131
1102
  // Check if we could survive without allocation.
1132
- __ SmiCompare(rax, rcx);
1103
+ __ cmpl(rax, rcx);
1133
1104
  __ j(greater, &attempt_to_grow_elements);
1134
1105
 
1135
1106
  // Save new length.
1136
- __ movq(FieldOperand(rdx, JSArray::kLengthOffset), rax);
1107
+ __ Integer32ToSmiField(FieldOperand(rdx, JSArray::kLengthOffset), rax);
1137
1108
 
1138
1109
  // Push the element.
1139
1110
  __ movq(rcx, Operand(rsp, argc * kPointerSize));
1140
- SmiIndex index =
1141
- masm()->SmiToIndex(kScratchRegister, rax, times_pointer_size);
1142
1111
  __ lea(rdx, FieldOperand(rbx,
1143
- index.reg, index.scale,
1112
+ rax, times_pointer_size,
1144
1113
  FixedArray::kHeaderSize - argc * kPointerSize));
1145
1114
  __ movq(Operand(rdx, 0), rcx);
1146
1115
 
1147
1116
  // Check if value is a smi.
1148
- __ JumpIfNotSmi(rcx, &with_rset_update);
1117
+ __ Integer32ToSmi(rax, rax); // Return new length as smi.
1118
+
1119
+ __ JumpIfNotSmi(rcx, &with_write_barrier);
1149
1120
 
1150
1121
  __ bind(&exit);
1151
1122
  __ ret((argc + 1) * kPointerSize);
1152
1123
 
1153
- __ bind(&with_rset_update);
1124
+ __ bind(&with_write_barrier);
1154
1125
 
1155
1126
  __ InNewSpace(rbx, rcx, equal, &exit);
1156
1127
 
1157
1128
  RecordWriteStub stub(rbx, rdx, rcx);
1158
1129
  __ CallStub(&stub);
1130
+
1159
1131
  __ ret((argc + 1) * kPointerSize);
1160
1132
 
1161
1133
  __ bind(&attempt_to_grow_elements);
@@ -1170,9 +1142,8 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1170
1142
  __ movq(rcx, Operand(rcx, 0));
1171
1143
 
1172
1144
  // Check if it's the end of elements.
1173
- index = masm()->SmiToIndex(kScratchRegister, rax, times_pointer_size);
1174
1145
  __ lea(rdx, FieldOperand(rbx,
1175
- index.reg, index.scale,
1146
+ rax, times_pointer_size,
1176
1147
  FixedArray::kHeaderSize - argc * kPointerSize));
1177
1148
  __ cmpq(rdx, rcx);
1178
1149
  __ j(not_equal, &call_builtin);
@@ -1198,11 +1169,12 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1198
1169
  __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
1199
1170
 
1200
1171
  // Increment element's and array's sizes.
1201
- __ addq(FieldOperand(rbx, FixedArray::kLengthOffset),
1202
- Immediate(kAllocationDelta));
1172
+ __ SmiAddConstant(FieldOperand(rbx, FixedArray::kLengthOffset),
1173
+ Smi::FromInt(kAllocationDelta));
1174
+ // Make new length a smi before returning it.
1175
+ __ Integer32ToSmi(rax, rax);
1203
1176
  __ movq(FieldOperand(rdx, JSArray::kLengthOffset), rax);
1204
-
1205
- // Elements are in new space, so no remembered set updates are necessary.
1177
+ // Elements are in new space, so write barrier is not required.
1206
1178
  __ ret((argc + 1) * kPointerSize);
1207
1179
 
1208
1180
  __ bind(&call_builtin);
@@ -1215,15 +1187,10 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1215
1187
 
1216
1188
  __ bind(&miss);
1217
1189
 
1218
- Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1219
- __ jmp(ic, RelocInfo::CODE_TARGET);
1190
+ GenerateMissBranch();
1220
1191
 
1221
1192
  // Return the generated code.
1222
- String* function_name = NULL;
1223
- if (function->shared()->name()->IsString()) {
1224
- function_name = String::cast(function->shared()->name());
1225
- }
1226
- return GetCode(CONSTANT_FUNCTION, function_name);
1193
+ return GetCode(function);
1227
1194
  }
1228
1195
 
1229
1196
 
@@ -1248,6 +1215,8 @@ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
1248
1215
 
1249
1216
  Label miss, return_undefined, call_builtin;
1250
1217
 
1218
+ GenerateNameCheck(name, &miss);
1219
+
1251
1220
  // Get the receiver from the stack.
1252
1221
  const int argc = arguments().immediate();
1253
1222
  __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
@@ -1257,7 +1226,7 @@ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
1257
1226
 
1258
1227
  CheckPrototypes(JSObject::cast(object), rdx,
1259
1228
  holder, rbx,
1260
- rax, name, &miss);
1229
+ rax, rdi, name, &miss);
1261
1230
 
1262
1231
  // Get the elements array of the object.
1263
1232
  __ movq(rbx, FieldOperand(rdx, JSArray::kElementsOffset));
@@ -1267,28 +1236,26 @@ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
1267
1236
  __ j(not_equal, &miss);
1268
1237
 
1269
1238
  // Get the array's length into rcx and calculate new length.
1270
- __ movq(rcx, FieldOperand(rdx, JSArray::kLengthOffset));
1271
- __ SmiSubConstant(rcx, rcx, Smi::FromInt(1));
1272
- __ SmiTest(rcx);
1239
+ __ SmiToInteger32(rcx, FieldOperand(rdx, JSArray::kLengthOffset));
1240
+ __ subl(rcx, Immediate(1));
1273
1241
  __ j(negative, &return_undefined);
1274
1242
 
1275
1243
  // Get the last element.
1276
1244
  __ Move(r9, Factory::the_hole_value());
1277
- SmiIndex index =
1278
- masm()->SmiToIndex(r8, rcx, times_pointer_size);
1279
1245
  __ movq(rax, FieldOperand(rbx,
1280
- index.reg, index.scale,
1246
+ rcx, times_pointer_size,
1281
1247
  FixedArray::kHeaderSize));
1282
1248
  // Check if element is already the hole.
1283
1249
  __ cmpq(rax, r9);
1250
+ // If so, call slow-case to also check prototypes for value.
1284
1251
  __ j(equal, &call_builtin);
1285
1252
 
1286
1253
  // Set the array's length.
1287
- __ movq(FieldOperand(rdx, JSArray::kLengthOffset), rcx);
1254
+ __ Integer32ToSmiField(FieldOperand(rdx, JSArray::kLengthOffset), rcx);
1288
1255
 
1289
- // Fill with the hole and return original value..
1256
+ // Fill with the hole and return original value.
1290
1257
  __ movq(FieldOperand(rbx,
1291
- index.reg, index.scale,
1258
+ rcx, times_pointer_size,
1292
1259
  FixedArray::kHeaderSize),
1293
1260
  r9);
1294
1261
  __ ret((argc + 1) * kPointerSize);
@@ -1304,18 +1271,32 @@ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
1304
1271
  1);
1305
1272
  __ bind(&miss);
1306
1273
 
1307
- Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1308
- __ jmp(ic, RelocInfo::CODE_TARGET);
1274
+ GenerateMissBranch();
1309
1275
 
1310
1276
  // Return the generated code.
1311
- String* function_name = NULL;
1312
- if (function->shared()->name()->IsString()) {
1313
- function_name = String::cast(function->shared()->name());
1314
- }
1315
- return GetCode(CONSTANT_FUNCTION, function_name);
1277
+ return GetCode(function);
1316
1278
  }
1317
1279
 
1318
1280
 
1281
+ Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
1282
+ JSObject* holder,
1283
+ JSFunction* function,
1284
+ String* name,
1285
+ CheckType check) {
1286
+ // TODO(722): implement this.
1287
+ return Heap::undefined_value();
1288
+ }
1289
+
1290
+
1291
+ Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
1292
+ JSObject* holder,
1293
+ JSFunction* function,
1294
+ String* name,
1295
+ CheckType check) {
1296
+ // TODO(722): implement this.
1297
+ return Heap::undefined_value();
1298
+ }
1299
+
1319
1300
 
1320
1301
 
1321
1302
  Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
@@ -1332,6 +1313,8 @@ Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
1332
1313
  // -----------------------------------
1333
1314
  Label miss;
1334
1315
 
1316
+ GenerateNameCheck(name, &miss);
1317
+
1335
1318
  // Get the number of arguments.
1336
1319
  const int argc = arguments().immediate();
1337
1320
 
@@ -1350,6 +1333,7 @@ Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
1350
1333
  rdx,
1351
1334
  rbx,
1352
1335
  rdi,
1336
+ rax,
1353
1337
  &miss);
1354
1338
 
1355
1339
  // Restore receiver.
@@ -1373,8 +1357,7 @@ Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
1373
1357
 
1374
1358
  // Handle load cache miss.
1375
1359
  __ bind(&miss);
1376
- Handle<Code> ic = ComputeCallMiss(argc);
1377
- __ Jump(ic, RelocInfo::CODE_TARGET);
1360
+ GenerateMissBranch();
1378
1361
 
1379
1362
  // Return the generated code.
1380
1363
  return GetCode(INTERCEPTOR, name);
@@ -1397,6 +1380,8 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
1397
1380
  // rsp[(argc + 1) * 8] : argument 0 = receiver
1398
1381
  Label miss;
1399
1382
 
1383
+ GenerateNameCheck(name, &miss);
1384
+
1400
1385
  // Get the number of arguments.
1401
1386
  const int argc = arguments().immediate();
1402
1387
 
@@ -1411,7 +1396,7 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
1411
1396
  }
1412
1397
 
1413
1398
  // Check that the maps haven't changed.
1414
- CheckPrototypes(object, rdx, holder, rbx, rax, name, &miss);
1399
+ CheckPrototypes(object, rdx, holder, rbx, rax, rdi, name, &miss);
1415
1400
 
1416
1401
  // Get the value from the cell.
1417
1402
  __ Move(rdi, Handle<JSGlobalPropertyCell>(cell));
@@ -1457,8 +1442,7 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
1457
1442
  // Handle call cache miss.
1458
1443
  __ bind(&miss);
1459
1444
  __ IncrementCounter(&Counters::call_global_inline_miss, 1);
1460
- Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1461
- __ Jump(ic, RelocInfo::CODE_TARGET);
1445
+ GenerateMissBranch();
1462
1446
 
1463
1447
  // Return the generated code.
1464
1448
  return GetCode(NORMAL, name);
@@ -1470,15 +1454,14 @@ Object* LoadStubCompiler::CompileLoadCallback(String* name,
1470
1454
  JSObject* holder,
1471
1455
  AccessorInfo* callback) {
1472
1456
  // ----------- S t a t e -------------
1457
+ // -- rax : receiver
1473
1458
  // -- rcx : name
1474
1459
  // -- rsp[0] : return address
1475
- // -- rsp[8] : receiver
1476
1460
  // -----------------------------------
1477
1461
  Label miss;
1478
1462
 
1479
- __ movq(rax, Operand(rsp, kPointerSize));
1480
1463
  Failure* failure = Failure::InternalError();
1481
- bool success = GenerateLoadCallback(object, holder, rax, rcx, rbx, rdx,
1464
+ bool success = GenerateLoadCallback(object, holder, rax, rcx, rbx, rdx, rdi,
1482
1465
  callback, name, &miss, &failure);
1483
1466
  if (!success) return failure;
1484
1467
 
@@ -1495,14 +1478,13 @@ Object* LoadStubCompiler::CompileLoadConstant(JSObject* object,
1495
1478
  Object* value,
1496
1479
  String* name) {
1497
1480
  // ----------- S t a t e -------------
1481
+ // -- rax : receiver
1498
1482
  // -- rcx : name
1499
1483
  // -- rsp[0] : return address
1500
- // -- rsp[8] : receiver
1501
1484
  // -----------------------------------
1502
1485
  Label miss;
1503
1486
 
1504
- __ movq(rax, Operand(rsp, kPointerSize));
1505
- GenerateLoadConstant(object, holder, rax, rbx, rdx, value, name, &miss);
1487
+ GenerateLoadConstant(object, holder, rax, rbx, rdx, rdi, value, name, &miss);
1506
1488
  __ bind(&miss);
1507
1489
  GenerateLoadMiss(masm(), Code::LOAD_IC);
1508
1490
 
@@ -1515,22 +1497,19 @@ Object* LoadStubCompiler::CompileLoadNonexistent(String* name,
1515
1497
  JSObject* object,
1516
1498
  JSObject* last) {
1517
1499
  // ----------- S t a t e -------------
1500
+ // -- rax : receiver
1518
1501
  // -- rcx : name
1519
1502
  // -- rsp[0] : return address
1520
- // -- rsp[8] : receiver
1521
1503
  // -----------------------------------
1522
1504
  Label miss;
1523
1505
 
1524
- // Load receiver.
1525
- __ movq(rax, Operand(rsp, kPointerSize));
1526
-
1527
1506
  // Chech that receiver is not a smi.
1528
1507
  __ JumpIfSmi(rax, &miss);
1529
1508
 
1530
1509
  // Check the maps of the full prototype chain. Also check that
1531
1510
  // global property cells up to (but not including) the last object
1532
1511
  // in the prototype chain are empty.
1533
- CheckPrototypes(object, rax, last, rbx, rdx, name, &miss);
1512
+ CheckPrototypes(object, rax, last, rbx, rdx, rdi, name, &miss);
1534
1513
 
1535
1514
  // If the last object in the prototype chain is a global object,
1536
1515
  // check that the global property cell is empty.
@@ -1561,14 +1540,13 @@ Object* LoadStubCompiler::CompileLoadField(JSObject* object,
1561
1540
  int index,
1562
1541
  String* name) {
1563
1542
  // ----------- S t a t e -------------
1543
+ // -- rax : receiver
1564
1544
  // -- rcx : name
1565
1545
  // -- rsp[0] : return address
1566
- // -- rsp[8] : receiver
1567
1546
  // -----------------------------------
1568
1547
  Label miss;
1569
1548
 
1570
- __ movq(rax, Operand(rsp, kPointerSize));
1571
- GenerateLoadField(object, holder, rax, rbx, rdx, index, name, &miss);
1549
+ GenerateLoadField(object, holder, rax, rbx, rdx, rdi, index, name, &miss);
1572
1550
  __ bind(&miss);
1573
1551
  GenerateLoadMiss(masm(), Code::LOAD_IC);
1574
1552
 
@@ -1581,16 +1559,15 @@ Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
1581
1559
  JSObject* holder,
1582
1560
  String* name) {
1583
1561
  // ----------- S t a t e -------------
1562
+ // -- rax : receiver
1584
1563
  // -- rcx : name
1585
1564
  // -- rsp[0] : return address
1586
- // -- rsp[8] : receiver
1587
1565
  // -----------------------------------
1588
1566
  Label miss;
1589
1567
 
1590
1568
  LookupResult lookup;
1591
1569
  LookupPostInterceptor(holder, name, &lookup);
1592
1570
 
1593
- __ movq(rax, Operand(rsp, kPointerSize));
1594
1571
  // TODO(368): Compile in the whole chain: all the interceptors in
1595
1572
  // prototypes and ultimate answer.
1596
1573
  GenerateLoadInterceptor(receiver,
@@ -1600,6 +1577,7 @@ Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
1600
1577
  rcx,
1601
1578
  rdx,
1602
1579
  rbx,
1580
+ rdi,
1603
1581
  name,
1604
1582
  &miss);
1605
1583
 
@@ -1617,15 +1595,12 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
1617
1595
  String* name,
1618
1596
  bool is_dont_delete) {
1619
1597
  // ----------- S t a t e -------------
1598
+ // -- rax : receiver
1620
1599
  // -- rcx : name
1621
1600
  // -- rsp[0] : return address
1622
- // -- rsp[8] : receiver
1623
1601
  // -----------------------------------
1624
1602
  Label miss;
1625
1603
 
1626
- // Get the receiver from the stack.
1627
- __ movq(rax, Operand(rsp, kPointerSize));
1628
-
1629
1604
  // If the object is the holder then we know that it's a global
1630
1605
  // object which can only happen for contextual loads. In this case,
1631
1606
  // the receiver cannot be a smi.
@@ -1634,22 +1609,23 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
1634
1609
  }
1635
1610
 
1636
1611
  // Check that the maps haven't changed.
1637
- CheckPrototypes(object, rax, holder, rbx, rdx, name, &miss);
1612
+ CheckPrototypes(object, rax, holder, rbx, rdx, rdi, name, &miss);
1638
1613
 
1639
1614
  // Get the value from the cell.
1640
- __ Move(rax, Handle<JSGlobalPropertyCell>(cell));
1641
- __ movq(rax, FieldOperand(rax, JSGlobalPropertyCell::kValueOffset));
1615
+ __ Move(rbx, Handle<JSGlobalPropertyCell>(cell));
1616
+ __ movq(rbx, FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset));
1642
1617
 
1643
1618
  // Check for deleted property if property can actually be deleted.
1644
1619
  if (!is_dont_delete) {
1645
- __ CompareRoot(rax, Heap::kTheHoleValueRootIndex);
1620
+ __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex);
1646
1621
  __ j(equal, &miss);
1647
1622
  } else if (FLAG_debug_code) {
1648
- __ CompareRoot(rax, Heap::kTheHoleValueRootIndex);
1623
+ __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex);
1649
1624
  __ Check(not_equal, "DontDelete cells can't contain the hole");
1650
1625
  }
1651
1626
 
1652
1627
  __ IncrementCounter(&Counters::named_load_global_inline, 1);
1628
+ __ movq(rax, rbx);
1653
1629
  __ ret(0);
1654
1630
 
1655
1631
  __ bind(&miss);
@@ -1666,14 +1642,12 @@ Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
1666
1642
  JSObject* holder,
1667
1643
  AccessorInfo* callback) {
1668
1644
  // ----------- S t a t e -------------
1645
+ // -- rax : key
1646
+ // -- rdx : receiver
1669
1647
  // -- rsp[0] : return address
1670
- // -- rsp[8] : name
1671
- // -- rsp[16] : receiver
1672
1648
  // -----------------------------------
1673
1649
  Label miss;
1674
1650
 
1675
- __ movq(rax, Operand(rsp, kPointerSize));
1676
- __ movq(rcx, Operand(rsp, 2 * kPointerSize));
1677
1651
  __ IncrementCounter(&Counters::keyed_load_callback, 1);
1678
1652
 
1679
1653
  // Check that the name has not changed.
@@ -1681,7 +1655,7 @@ Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
1681
1655
  __ j(not_equal, &miss);
1682
1656
 
1683
1657
  Failure* failure = Failure::InternalError();
1684
- bool success = GenerateLoadCallback(receiver, holder, rcx, rax, rbx, rdx,
1658
+ bool success = GenerateLoadCallback(receiver, holder, rdx, rax, rbx, rcx, rdi,
1685
1659
  callback, name, &miss, &failure);
1686
1660
  if (!success) return failure;
1687
1661
 
@@ -1696,21 +1670,19 @@ Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
1696
1670
 
1697
1671
  Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
1698
1672
  // ----------- S t a t e -------------
1673
+ // -- rax : key
1674
+ // -- rdx : receiver
1699
1675
  // -- rsp[0] : return address
1700
- // -- rsp[8] : name
1701
- // -- rsp[16] : receiver
1702
1676
  // -----------------------------------
1703
1677
  Label miss;
1704
1678
 
1705
- __ movq(rax, Operand(rsp, kPointerSize));
1706
- __ movq(rcx, Operand(rsp, 2 * kPointerSize));
1707
1679
  __ IncrementCounter(&Counters::keyed_load_array_length, 1);
1708
1680
 
1709
1681
  // Check that the name has not changed.
1710
1682
  __ Cmp(rax, Handle<String>(name));
1711
1683
  __ j(not_equal, &miss);
1712
1684
 
1713
- GenerateLoadArrayLength(masm(), rcx, rdx, &miss);
1685
+ GenerateLoadArrayLength(masm(), rdx, rcx, &miss);
1714
1686
  __ bind(&miss);
1715
1687
  __ DecrementCounter(&Counters::keyed_load_array_length, 1);
1716
1688
  GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
@@ -1725,21 +1697,19 @@ Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
1725
1697
  JSObject* holder,
1726
1698
  Object* value) {
1727
1699
  // ----------- S t a t e -------------
1700
+ // -- rax : key
1701
+ // -- rdx : receiver
1728
1702
  // -- rsp[0] : return address
1729
- // -- rsp[8] : name
1730
- // -- rsp[16] : receiver
1731
1703
  // -----------------------------------
1732
1704
  Label miss;
1733
1705
 
1734
- __ movq(rax, Operand(rsp, kPointerSize));
1735
- __ movq(rcx, Operand(rsp, 2 * kPointerSize));
1736
1706
  __ IncrementCounter(&Counters::keyed_load_constant_function, 1);
1737
1707
 
1738
1708
  // Check that the name has not changed.
1739
1709
  __ Cmp(rax, Handle<String>(name));
1740
1710
  __ j(not_equal, &miss);
1741
1711
 
1742
- GenerateLoadConstant(receiver, holder, rcx, rbx, rdx,
1712
+ GenerateLoadConstant(receiver, holder, rdx, rbx, rcx, rdi,
1743
1713
  value, name, &miss);
1744
1714
  __ bind(&miss);
1745
1715
  __ DecrementCounter(&Counters::keyed_load_constant_function, 1);
@@ -1752,21 +1722,19 @@ Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
1752
1722
 
1753
1723
  Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
1754
1724
  // ----------- S t a t e -------------
1725
+ // -- rax : key
1726
+ // -- rdx : receiver
1755
1727
  // -- rsp[0] : return address
1756
- // -- rsp[8] : name
1757
- // -- rsp[16] : receiver
1758
1728
  // -----------------------------------
1759
1729
  Label miss;
1760
1730
 
1761
- __ movq(rax, Operand(rsp, kPointerSize));
1762
- __ movq(rcx, Operand(rsp, 2 * kPointerSize));
1763
1731
  __ IncrementCounter(&Counters::keyed_load_function_prototype, 1);
1764
1732
 
1765
1733
  // Check that the name has not changed.
1766
1734
  __ Cmp(rax, Handle<String>(name));
1767
1735
  __ j(not_equal, &miss);
1768
1736
 
1769
- GenerateLoadFunctionPrototype(masm(), rcx, rdx, rbx, &miss);
1737
+ GenerateLoadFunctionPrototype(masm(), rdx, rcx, rbx, &miss);
1770
1738
  __ bind(&miss);
1771
1739
  __ DecrementCounter(&Counters::keyed_load_function_prototype, 1);
1772
1740
  GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
@@ -1780,14 +1748,12 @@ Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
1780
1748
  JSObject* holder,
1781
1749
  String* name) {
1782
1750
  // ----------- S t a t e -------------
1751
+ // -- rax : key
1752
+ // -- rdx : receiver
1783
1753
  // -- rsp[0] : return address
1784
- // -- rsp[8] : name
1785
- // -- rsp[16] : receiver
1786
1754
  // -----------------------------------
1787
1755
  Label miss;
1788
1756
 
1789
- __ movq(rax, Operand(rsp, kPointerSize));
1790
- __ movq(rcx, Operand(rsp, 2 * kPointerSize));
1791
1757
  __ IncrementCounter(&Counters::keyed_load_interceptor, 1);
1792
1758
 
1793
1759
  // Check that the name has not changed.
@@ -1799,10 +1765,11 @@ Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
1799
1765
  GenerateLoadInterceptor(receiver,
1800
1766
  holder,
1801
1767
  &lookup,
1802
- rcx,
1803
- rax,
1804
1768
  rdx,
1769
+ rax,
1770
+ rcx,
1805
1771
  rbx,
1772
+ rdi,
1806
1773
  name,
1807
1774
  &miss);
1808
1775
  __ bind(&miss);
@@ -1816,21 +1783,19 @@ Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
1816
1783
 
1817
1784
  Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
1818
1785
  // ----------- S t a t e -------------
1819
- // -- rsp[0] : return address
1820
- // -- rsp[8] : name
1821
- // -- rsp[16] : receiver
1786
+ // -- rax : key
1787
+ // -- rdx : receiver
1788
+ // -- rsp[0] : return address
1822
1789
  // -----------------------------------
1823
1790
  Label miss;
1824
1791
 
1825
- __ movq(rax, Operand(rsp, kPointerSize));
1826
- __ movq(rcx, Operand(rsp, 2 * kPointerSize));
1827
1792
  __ IncrementCounter(&Counters::keyed_load_string_length, 1);
1828
1793
 
1829
1794
  // Check that the name has not changed.
1830
1795
  __ Cmp(rax, Handle<String>(name));
1831
1796
  __ j(not_equal, &miss);
1832
1797
 
1833
- GenerateLoadStringLength(masm(), rcx, rdx, rbx, &miss);
1798
+ GenerateLoadStringLength(masm(), rdx, rcx, rbx, &miss);
1834
1799
  __ bind(&miss);
1835
1800
  __ DecrementCounter(&Counters::keyed_load_string_length, 1);
1836
1801
  GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
@@ -2008,21 +1973,19 @@ Object* KeyedLoadStubCompiler::CompileLoadField(String* name,
2008
1973
  JSObject* holder,
2009
1974
  int index) {
2010
1975
  // ----------- S t a t e -------------
2011
- // -- rsp[0] : return address
2012
- // -- rsp[8] : name
2013
- // -- rsp[16] : receiver
1976
+ // -- rax : key
1977
+ // -- rdx : receiver
1978
+ // -- rsp[0] : return address
2014
1979
  // -----------------------------------
2015
1980
  Label miss;
2016
1981
 
2017
- __ movq(rax, Operand(rsp, kPointerSize));
2018
- __ movq(rcx, Operand(rsp, 2 * kPointerSize));
2019
1982
  __ IncrementCounter(&Counters::keyed_load_field, 1);
2020
1983
 
2021
1984
  // Check that the name has not changed.
2022
1985
  __ Cmp(rax, Handle<String>(name));
2023
1986
  __ j(not_equal, &miss);
2024
1987
 
2025
- GenerateLoadField(receiver, holder, rcx, rbx, rdx, index, name, &miss);
1988
+ GenerateLoadField(receiver, holder, rdx, rbx, rcx, rdi, index, name, &miss);
2026
1989
 
2027
1990
  __ bind(&miss);
2028
1991
  __ DecrementCounter(&Counters::keyed_load_field, 1);
@@ -2039,23 +2002,18 @@ Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
2039
2002
  String* name) {
2040
2003
  // ----------- S t a t e -------------
2041
2004
  // -- rax : value
2005
+ // -- rcx : key
2006
+ // -- rdx : receiver
2042
2007
  // -- rsp[0] : return address
2043
- // -- rsp[8] : key
2044
- // -- rsp[16] : receiver
2045
2008
  // -----------------------------------
2046
2009
  Label miss;
2047
2010
 
2048
2011
  __ IncrementCounter(&Counters::keyed_store_field, 1);
2049
2012
 
2050
- // Get the name from the stack.
2051
- __ movq(rcx, Operand(rsp, 1 * kPointerSize));
2052
2013
  // Check that the name has not changed.
2053
2014
  __ Cmp(rcx, Handle<String>(name));
2054
2015
  __ j(not_equal, &miss);
2055
2016
 
2056
- // Get the receiver from the stack.
2057
- __ movq(rdx, Operand(rsp, 2 * kPointerSize));
2058
-
2059
2017
  // Generate store field code. Preserves receiver and name on jump to miss.
2060
2018
  GenerateStoreField(masm(),
2061
2019
  object,
@@ -2099,28 +2057,141 @@ Object* StubCompiler::CompileLazyCompile(Code::Flags flags) {
2099
2057
  }
2100
2058
 
2101
2059
 
2102
-
2103
2060
  void StubCompiler::GenerateLoadInterceptor(JSObject* object,
2104
- JSObject* holder,
2061
+ JSObject* interceptor_holder,
2105
2062
  LookupResult* lookup,
2106
2063
  Register receiver,
2107
2064
  Register name_reg,
2108
2065
  Register scratch1,
2109
2066
  Register scratch2,
2067
+ Register scratch3,
2110
2068
  String* name,
2111
2069
  Label* miss) {
2112
- LoadInterceptorCompiler compiler(name_reg);
2113
- CompileLoadInterceptor(&compiler,
2114
- this,
2115
- masm(),
2116
- object,
2117
- holder,
2118
- name,
2119
- lookup,
2120
- receiver,
2121
- scratch1,
2122
- scratch2,
2123
- miss);
2070
+ ASSERT(interceptor_holder->HasNamedInterceptor());
2071
+ ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined());
2072
+
2073
+ // Check that the receiver isn't a smi.
2074
+ __ JumpIfSmi(receiver, miss);
2075
+
2076
+ // So far the most popular follow ups for interceptor loads are FIELD
2077
+ // and CALLBACKS, so inline only them, other cases may be added
2078
+ // later.
2079
+ bool compile_followup_inline = false;
2080
+ if (lookup->IsProperty() && lookup->IsCacheable()) {
2081
+ if (lookup->type() == FIELD) {
2082
+ compile_followup_inline = true;
2083
+ } else if (lookup->type() == CALLBACKS &&
2084
+ lookup->GetCallbackObject()->IsAccessorInfo() &&
2085
+ AccessorInfo::cast(lookup->GetCallbackObject())->getter() != NULL) {
2086
+ compile_followup_inline = true;
2087
+ }
2088
+ }
2089
+
2090
+ if (compile_followup_inline) {
2091
+ // Compile the interceptor call, followed by inline code to load the
2092
+ // property from further up the prototype chain if the call fails.
2093
+ // Check that the maps haven't changed.
2094
+ Register holder_reg = CheckPrototypes(object, receiver, interceptor_holder,
2095
+ scratch1, scratch2, scratch3,
2096
+ name, miss);
2097
+ ASSERT(holder_reg.is(receiver) || holder_reg.is(scratch1));
2098
+
2099
+ // Save necessary data before invoking an interceptor.
2100
+ // Requires a frame to make GC aware of pushed pointers.
2101
+ __ EnterInternalFrame();
2102
+
2103
+ if (lookup->type() == CALLBACKS && !receiver.is(holder_reg)) {
2104
+ // CALLBACKS case needs a receiver to be passed into C++ callback.
2105
+ __ push(receiver);
2106
+ }
2107
+ __ push(holder_reg);
2108
+ __ push(name_reg);
2109
+
2110
+ // Invoke an interceptor. Note: map checks from receiver to
2111
+ // interceptor's holder has been compiled before (see a caller
2112
+ // of this method.)
2113
+ CompileCallLoadPropertyWithInterceptor(masm(),
2114
+ receiver,
2115
+ holder_reg,
2116
+ name_reg,
2117
+ interceptor_holder);
2118
+
2119
+ // Check if interceptor provided a value for property. If it's
2120
+ // the case, return immediately.
2121
+ Label interceptor_failed;
2122
+ __ CompareRoot(rax, Heap::kNoInterceptorResultSentinelRootIndex);
2123
+ __ j(equal, &interceptor_failed);
2124
+ __ LeaveInternalFrame();
2125
+ __ ret(0);
2126
+
2127
+ __ bind(&interceptor_failed);
2128
+ __ pop(name_reg);
2129
+ __ pop(holder_reg);
2130
+ if (lookup->type() == CALLBACKS && !receiver.is(holder_reg)) {
2131
+ __ pop(receiver);
2132
+ }
2133
+
2134
+ __ LeaveInternalFrame();
2135
+
2136
+ // Check that the maps from interceptor's holder to lookup's holder
2137
+ // haven't changed. And load lookup's holder into |holder| register.
2138
+ if (interceptor_holder != lookup->holder()) {
2139
+ holder_reg = CheckPrototypes(interceptor_holder,
2140
+ holder_reg,
2141
+ lookup->holder(),
2142
+ scratch1,
2143
+ scratch2,
2144
+ scratch3,
2145
+ name,
2146
+ miss);
2147
+ }
2148
+
2149
+ if (lookup->type() == FIELD) {
2150
+ // We found FIELD property in prototype chain of interceptor's holder.
2151
+ // Retrieve a field from field's holder.
2152
+ GenerateFastPropertyLoad(masm(), rax, holder_reg,
2153
+ lookup->holder(), lookup->GetFieldIndex());
2154
+ __ ret(0);
2155
+ } else {
2156
+ // We found CALLBACKS property in prototype chain of interceptor's
2157
+ // holder.
2158
+ ASSERT(lookup->type() == CALLBACKS);
2159
+ ASSERT(lookup->GetCallbackObject()->IsAccessorInfo());
2160
+ AccessorInfo* callback = AccessorInfo::cast(lookup->GetCallbackObject());
2161
+ ASSERT(callback != NULL);
2162
+ ASSERT(callback->getter() != NULL);
2163
+
2164
+ // Tail call to runtime.
2165
+ // Important invariant in CALLBACKS case: the code above must be
2166
+ // structured to never clobber |receiver| register.
2167
+ __ pop(scratch2); // return address
2168
+ __ push(receiver);
2169
+ __ push(holder_reg);
2170
+ __ Move(holder_reg, Handle<AccessorInfo>(callback));
2171
+ __ push(holder_reg);
2172
+ __ push(FieldOperand(holder_reg, AccessorInfo::kDataOffset));
2173
+ __ push(name_reg);
2174
+ __ push(scratch2); // restore return address
2175
+
2176
+ ExternalReference ref =
2177
+ ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
2178
+ __ TailCallExternalReference(ref, 5, 1);
2179
+ }
2180
+ } else { // !compile_followup_inline
2181
+ // Call the runtime system to load the interceptor.
2182
+ // Check that the maps haven't changed.
2183
+ Register holder_reg = CheckPrototypes(object, receiver, interceptor_holder,
2184
+ scratch1, scratch2, scratch3,
2185
+ name, miss);
2186
+ __ pop(scratch2); // save old return address
2187
+ PushInterceptorArguments(masm(), receiver, holder_reg,
2188
+ name_reg, interceptor_holder);
2189
+ __ push(scratch2); // restore old return address
2190
+
2191
+ ExternalReference ref = ExternalReference(
2192
+ IC_Utility(IC::kLoadPropertyWithInterceptorForLoad));
2193
+ __ TailCallExternalReference(ref, 5, 1);
2194
+ }
2124
2195
  }
2125
2196
 
2126
2197
 
@@ -2130,6 +2201,7 @@ bool StubCompiler::GenerateLoadCallback(JSObject* object,
2130
2201
  Register name_reg,
2131
2202
  Register scratch1,
2132
2203
  Register scratch2,
2204
+ Register scratch3,
2133
2205
  AccessorInfo* callback,
2134
2206
  String* name,
2135
2207
  Label* miss,
@@ -2140,7 +2212,7 @@ bool StubCompiler::GenerateLoadCallback(JSObject* object,
2140
2212
  // Check that the maps haven't changed.
2141
2213
  Register reg =
2142
2214
  CheckPrototypes(object, receiver, holder,
2143
- scratch1, scratch2, name, miss);
2215
+ scratch1, scratch2, scratch3, name, miss);
2144
2216
 
2145
2217
  // Push the arguments on the JS stack of the caller.
2146
2218
  __ pop(scratch2); // remove return address
@@ -2165,40 +2237,143 @@ Register StubCompiler::CheckPrototypes(JSObject* object,
2165
2237
  Register object_reg,
2166
2238
  JSObject* holder,
2167
2239
  Register holder_reg,
2168
- Register scratch,
2240
+ Register scratch1,
2241
+ Register scratch2,
2169
2242
  String* name,
2170
2243
  int save_at_depth,
2171
2244
  Label* miss) {
2172
- // Check that the maps haven't changed.
2173
- Register result =
2174
- masm()->CheckMaps(object,
2175
- object_reg,
2176
- holder,
2177
- holder_reg,
2178
- scratch,
2179
- save_at_depth,
2180
- miss);
2245
+ // Make sure there's no overlap between holder and object registers.
2246
+ ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg));
2247
+ ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg)
2248
+ && !scratch2.is(scratch1));
2249
+
2250
+ // Keep track of the current object in register reg. On the first
2251
+ // iteration, reg is an alias for object_reg, on later iterations,
2252
+ // it is an alias for holder_reg.
2253
+ Register reg = object_reg;
2254
+ int depth = 0;
2255
+
2256
+ if (save_at_depth == depth) {
2257
+ __ movq(Operand(rsp, kPointerSize), object_reg);
2258
+ }
2259
+
2260
+ // Check the maps in the prototype chain.
2261
+ // Traverse the prototype chain from the object and do map checks.
2262
+ JSObject* current = object;
2263
+ while (current != holder) {
2264
+ depth++;
2265
+
2266
+ // Only global objects and objects that do not require access
2267
+ // checks are allowed in stubs.
2268
+ ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded());
2269
+
2270
+ JSObject* prototype = JSObject::cast(current->GetPrototype());
2271
+ if (!current->HasFastProperties() &&
2272
+ !current->IsJSGlobalObject() &&
2273
+ !current->IsJSGlobalProxy()) {
2274
+ if (!name->IsSymbol()) {
2275
+ Object* lookup_result = Heap::LookupSymbol(name);
2276
+ if (lookup_result->IsFailure()) {
2277
+ set_failure(Failure::cast(lookup_result));
2278
+ return reg;
2279
+ } else {
2280
+ name = String::cast(lookup_result);
2281
+ }
2282
+ }
2283
+ ASSERT(current->property_dictionary()->FindEntry(name) ==
2284
+ StringDictionary::kNotFound);
2285
+
2286
+ GenerateDictionaryNegativeLookup(masm(),
2287
+ miss,
2288
+ reg,
2289
+ name,
2290
+ scratch1,
2291
+ scratch2);
2292
+ __ movq(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
2293
+ reg = holder_reg; // from now the object is in holder_reg
2294
+ __ movq(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
2295
+ } else if (Heap::InNewSpace(prototype)) {
2296
+ // Get the map of the current object.
2297
+ __ movq(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
2298
+ __ Cmp(scratch1, Handle<Map>(current->map()));
2299
+ // Branch on the result of the map check.
2300
+ __ j(not_equal, miss);
2301
+ // Check access rights to the global object. This has to happen
2302
+ // after the map check so that we know that the object is
2303
+ // actually a global object.
2304
+ if (current->IsJSGlobalProxy()) {
2305
+ __ CheckAccessGlobalProxy(reg, scratch1, miss);
2306
+
2307
+ // Restore scratch register to be the map of the object.
2308
+ // We load the prototype from the map in the scratch register.
2309
+ __ movq(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
2310
+ }
2311
+ // The prototype is in new space; we cannot store a reference
2312
+ // to it in the code. Load it from the map.
2313
+ reg = holder_reg; // from now the object is in holder_reg
2314
+ __ movq(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
2315
+
2316
+ } else {
2317
+ // Check the map of the current object.
2318
+ __ Cmp(FieldOperand(reg, HeapObject::kMapOffset),
2319
+ Handle<Map>(current->map()));
2320
+ // Branch on the result of the map check.
2321
+ __ j(not_equal, miss);
2322
+ // Check access rights to the global object. This has to happen
2323
+ // after the map check so that we know that the object is
2324
+ // actually a global object.
2325
+ if (current->IsJSGlobalProxy()) {
2326
+ __ CheckAccessGlobalProxy(reg, scratch1, miss);
2327
+ }
2328
+ // The prototype is in old space; load it directly.
2329
+ reg = holder_reg; // from now the object is in holder_reg
2330
+ __ Move(reg, Handle<JSObject>(prototype));
2331
+ }
2332
+
2333
+ if (save_at_depth == depth) {
2334
+ __ movq(Operand(rsp, kPointerSize), reg);
2335
+ }
2336
+
2337
+ // Go to the next object in the prototype chain.
2338
+ current = prototype;
2339
+ }
2340
+
2341
+ // Check the holder map.
2342
+ __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), Handle<Map>(holder->map()));
2343
+ __ j(not_equal, miss);
2344
+
2345
+ // Log the check depth.
2346
+ LOG(IntEvent("check-maps-depth", depth + 1));
2347
+
2348
+ // Perform security check for access to the global object and return
2349
+ // the holder register.
2350
+ ASSERT(current == holder);
2351
+ ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded());
2352
+ if (current->IsJSGlobalProxy()) {
2353
+ __ CheckAccessGlobalProxy(reg, scratch1, miss);
2354
+ }
2181
2355
 
2182
2356
  // If we've skipped any global objects, it's not enough to verify
2183
2357
  // that their maps haven't changed. We also need to check that the
2184
2358
  // property cell for the property is still empty.
2185
- while (object != holder) {
2186
- if (object->IsGlobalObject()) {
2359
+ current = object;
2360
+ while (current != holder) {
2361
+ if (current->IsGlobalObject()) {
2187
2362
  Object* cell = GenerateCheckPropertyCell(masm(),
2188
- GlobalObject::cast(object),
2363
+ GlobalObject::cast(current),
2189
2364
  name,
2190
- scratch,
2365
+ scratch1,
2191
2366
  miss);
2192
2367
  if (cell->IsFailure()) {
2193
2368
  set_failure(Failure::cast(cell));
2194
- return result;
2369
+ return reg;
2195
2370
  }
2196
2371
  }
2197
- object = JSObject::cast(object->GetPrototype());
2372
+ current = JSObject::cast(current->GetPrototype());
2198
2373
  }
2199
2374
 
2200
2375
  // Return the register containing the holder.
2201
- return result;
2376
+ return reg;
2202
2377
  }
2203
2378
 
2204
2379
 
@@ -2207,6 +2382,7 @@ void StubCompiler::GenerateLoadField(JSObject* object,
2207
2382
  Register receiver,
2208
2383
  Register scratch1,
2209
2384
  Register scratch2,
2385
+ Register scratch3,
2210
2386
  int index,
2211
2387
  String* name,
2212
2388
  Label* miss) {
@@ -2216,7 +2392,7 @@ void StubCompiler::GenerateLoadField(JSObject* object,
2216
2392
  // Check the prototype chain.
2217
2393
  Register reg =
2218
2394
  CheckPrototypes(object, receiver, holder,
2219
- scratch1, scratch2, name, miss);
2395
+ scratch1, scratch2, scratch3, name, miss);
2220
2396
 
2221
2397
  // Get the value from the properties.
2222
2398
  GenerateFastPropertyLoad(masm(), rax, reg, holder, index);
@@ -2229,6 +2405,7 @@ void StubCompiler::GenerateLoadConstant(JSObject* object,
2229
2405
  Register receiver,
2230
2406
  Register scratch1,
2231
2407
  Register scratch2,
2408
+ Register scratch3,
2232
2409
  Object* value,
2233
2410
  String* name,
2234
2411
  Label* miss) {
@@ -2238,7 +2415,7 @@ void StubCompiler::GenerateLoadConstant(JSObject* object,
2238
2415
  // Check that the maps haven't changed.
2239
2416
  Register reg =
2240
2417
  CheckPrototypes(object, receiver, holder,
2241
- scratch1, scratch2, name, miss);
2418
+ scratch1, scratch2, scratch3, name, miss);
2242
2419
 
2243
2420
  // Return the constant value.
2244
2421
  __ Move(rax, Handle<Object>(value));
@@ -2379,3 +2556,5 @@ Object* ConstructStubCompiler::CompileConstructStub(
2379
2556
  #undef __
2380
2557
 
2381
2558
  } } // namespace v8::internal
2559
+
2560
+ #endif // V8_TARGET_ARCH_X64