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
@@ -132,9 +132,8 @@ class RegExpMacroAssemblerIA32: public NativeRegExpMacroAssembler {
132
132
  static const int kBackup_edi = kBackup_esi - kPointerSize;
133
133
  static const int kBackup_ebx = kBackup_edi - kPointerSize;
134
134
  static const int kInputStartMinusOne = kBackup_ebx - kPointerSize;
135
- static const int kAtStart = kInputStartMinusOne - kPointerSize;
136
135
  // First register address. Following registers are below it on the stack.
137
- static const int kRegisterZero = kAtStart - kPointerSize;
136
+ static const int kRegisterZero = kInputStartMinusOne - kPointerSize;
138
137
 
139
138
  // Initial size of code buffer.
140
139
  static const size_t kRegExpCodeSize = 1024;
@@ -27,6 +27,8 @@
27
27
 
28
28
  #include "v8.h"
29
29
 
30
+ #if defined(V8_TARGET_ARCH_IA32)
31
+
30
32
  #include "codegen-inl.h"
31
33
  #include "register-allocator-inl.h"
32
34
  #include "virtual-frame-inl.h"
@@ -151,3 +153,5 @@ Result RegisterAllocator::AllocateByteRegisterWithoutSpilling() {
151
153
 
152
154
 
153
155
  } } // namespace v8::internal
156
+
157
+ #endif // V8_TARGET_ARCH_IA32
@@ -27,6 +27,8 @@
27
27
 
28
28
  #include "v8.h"
29
29
 
30
+ #if defined(V8_TARGET_ARCH_IA32)
31
+
30
32
  #include "ic-inl.h"
31
33
  #include "codegen-inl.h"
32
34
  #include "stub-cache.h"
@@ -99,6 +101,106 @@ static void ProbeTable(MacroAssembler* masm,
99
101
  }
100
102
 
101
103
 
104
+ // Helper function used to check that the dictionary doesn't contain
105
+ // the property. This function may return false negatives, so miss_label
106
+ // must always call a backup property check that is complete.
107
+ // This function is safe to call if the receiver has fast properties.
108
+ // Name must be a symbol and receiver must be a heap object.
109
+ static void GenerateDictionaryNegativeLookup(MacroAssembler* masm,
110
+ Label* miss_label,
111
+ Register receiver,
112
+ String* name,
113
+ Register r0,
114
+ Register r1) {
115
+ ASSERT(name->IsSymbol());
116
+ __ IncrementCounter(&Counters::negative_lookups, 1);
117
+ __ IncrementCounter(&Counters::negative_lookups_miss, 1);
118
+
119
+ Label done;
120
+ __ mov(r0, FieldOperand(receiver, HeapObject::kMapOffset));
121
+
122
+ const int kInterceptorOrAccessCheckNeededMask =
123
+ (1 << Map::kHasNamedInterceptor) | (1 << Map::kIsAccessCheckNeeded);
124
+
125
+ // Bail out if the receiver has a named interceptor or requires access checks.
126
+ __ test_b(FieldOperand(r0, Map::kBitFieldOffset),
127
+ kInterceptorOrAccessCheckNeededMask);
128
+ __ j(not_zero, miss_label, not_taken);
129
+
130
+ // Check that receiver is a JSObject.
131
+ __ CmpInstanceType(r0, FIRST_JS_OBJECT_TYPE);
132
+ __ j(below, miss_label, not_taken);
133
+
134
+ // Load properties array.
135
+ Register properties = r0;
136
+ __ mov(properties, FieldOperand(receiver, JSObject::kPropertiesOffset));
137
+
138
+ // Check that the properties array is a dictionary.
139
+ __ cmp(FieldOperand(properties, HeapObject::kMapOffset),
140
+ Immediate(Factory::hash_table_map()));
141
+ __ j(not_equal, miss_label);
142
+
143
+ // Compute the capacity mask.
144
+ const int kCapacityOffset =
145
+ StringDictionary::kHeaderSize +
146
+ StringDictionary::kCapacityIndex * kPointerSize;
147
+
148
+ // Generate an unrolled loop that performs a few probes before
149
+ // giving up.
150
+ static const int kProbes = 4;
151
+ const int kElementsStartOffset =
152
+ StringDictionary::kHeaderSize +
153
+ StringDictionary::kElementsStartIndex * kPointerSize;
154
+
155
+ // If names of slots in range from 1 to kProbes - 1 for the hash value are
156
+ // not equal to the name and kProbes-th slot is not used (its name is the
157
+ // undefined value), it guarantees the hash table doesn't contain the
158
+ // property. It's true even if some slots represent deleted properties
159
+ // (their names are the null value).
160
+ for (int i = 0; i < kProbes; i++) {
161
+ // r0 points to properties hash.
162
+ // Compute the masked index: (hash + i + i * i) & mask.
163
+ Register index = r1;
164
+ // Capacity is smi 2^n.
165
+ __ mov(index, FieldOperand(properties, kCapacityOffset));
166
+ __ dec(index);
167
+ __ and_(Operand(index),
168
+ Immediate(Smi::FromInt(name->Hash() +
169
+ StringDictionary::GetProbeOffset(i))));
170
+
171
+ // Scale the index by multiplying by the entry size.
172
+ ASSERT(StringDictionary::kEntrySize == 3);
173
+ __ lea(index, Operand(index, index, times_2, 0)); // index *= 3.
174
+
175
+ Register entity_name = r1;
176
+ // Having undefined at this place means the name is not contained.
177
+ ASSERT_EQ(kSmiTagSize, 1);
178
+ __ mov(entity_name, Operand(properties, index, times_half_pointer_size,
179
+ kElementsStartOffset - kHeapObjectTag));
180
+ __ cmp(entity_name, Factory::undefined_value());
181
+ if (i != kProbes - 1) {
182
+ __ j(equal, &done, taken);
183
+
184
+ // Stop if found the property.
185
+ __ cmp(entity_name, Handle<String>(name));
186
+ __ j(equal, miss_label, not_taken);
187
+
188
+ // Check if the entry name is not a symbol.
189
+ __ mov(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset));
190
+ __ test_b(FieldOperand(entity_name, Map::kInstanceTypeOffset),
191
+ kIsSymbolMask);
192
+ __ j(zero, miss_label, not_taken);
193
+ } else {
194
+ // Give up probing if still not found the undefined value.
195
+ __ j(not_equal, miss_label, not_taken);
196
+ }
197
+ }
198
+
199
+ __ bind(&done);
200
+ __ DecrementCounter(&Counters::negative_lookups_miss, 1);
201
+ }
202
+
203
+
102
204
  void StubCache::GenerateProbe(MacroAssembler* masm,
103
205
  Code::Flags flags,
104
206
  Register receiver,
@@ -170,6 +272,17 @@ void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
170
272
  }
171
273
 
172
274
 
275
+ void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
276
+ MacroAssembler* masm, int index, Register prototype) {
277
+ // Get the global function with the given index.
278
+ JSFunction* function = JSFunction::cast(Top::global_context()->get(index));
279
+ // Load its initial map. The global functions all have initial maps.
280
+ __ Set(prototype, Immediate(Handle<Map>(function->initial_map())));
281
+ // Load the prototype from the initial map.
282
+ __ mov(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
283
+ }
284
+
285
+
173
286
  void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm,
174
287
  Register receiver,
175
288
  Register scratch,
@@ -298,183 +411,6 @@ static void CompileCallLoadPropertyWithInterceptor(MacroAssembler* masm,
298
411
  }
299
412
 
300
413
 
301
- template <class Compiler>
302
- static void CompileLoadInterceptor(Compiler* compiler,
303
- StubCompiler* stub_compiler,
304
- MacroAssembler* masm,
305
- JSObject* object,
306
- JSObject* holder,
307
- String* name,
308
- LookupResult* lookup,
309
- Register receiver,
310
- Register scratch1,
311
- Register scratch2,
312
- Label* miss) {
313
- ASSERT(holder->HasNamedInterceptor());
314
- ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
315
-
316
- // Check that the receiver isn't a smi.
317
- __ test(receiver, Immediate(kSmiTagMask));
318
- __ j(zero, miss, not_taken);
319
-
320
- // Check that the maps haven't changed.
321
- Register reg =
322
- stub_compiler->CheckPrototypes(object, receiver, holder,
323
- scratch1, scratch2, name, miss);
324
-
325
- if (lookup->IsProperty() && lookup->IsCacheable()) {
326
- compiler->CompileCacheable(masm,
327
- stub_compiler,
328
- receiver,
329
- reg,
330
- scratch1,
331
- scratch2,
332
- holder,
333
- lookup,
334
- name,
335
- miss);
336
- } else {
337
- compiler->CompileRegular(masm,
338
- receiver,
339
- reg,
340
- scratch2,
341
- holder,
342
- miss);
343
- }
344
- }
345
-
346
-
347
- class LoadInterceptorCompiler BASE_EMBEDDED {
348
- public:
349
- explicit LoadInterceptorCompiler(Register name) : name_(name) {}
350
-
351
- void CompileCacheable(MacroAssembler* masm,
352
- StubCompiler* stub_compiler,
353
- Register receiver,
354
- Register holder,
355
- Register scratch1,
356
- Register scratch2,
357
- JSObject* holder_obj,
358
- LookupResult* lookup,
359
- String* name,
360
- Label* miss_label) {
361
- AccessorInfo* callback = NULL;
362
- bool optimize = false;
363
- // So far the most popular follow ups for interceptor loads are FIELD
364
- // and CALLBACKS, so inline only them, other cases may be added
365
- // later.
366
- if (lookup->type() == FIELD) {
367
- optimize = true;
368
- } else if (lookup->type() == CALLBACKS) {
369
- Object* callback_object = lookup->GetCallbackObject();
370
- if (callback_object->IsAccessorInfo()) {
371
- callback = AccessorInfo::cast(callback_object);
372
- optimize = callback->getter() != NULL;
373
- }
374
- }
375
-
376
- if (!optimize) {
377
- CompileRegular(masm, receiver, holder, scratch2, holder_obj, miss_label);
378
- return;
379
- }
380
-
381
- // Note: starting a frame here makes GC aware of pointers pushed below.
382
- __ EnterInternalFrame();
383
-
384
- if (lookup->type() == CALLBACKS) {
385
- __ push(receiver);
386
- }
387
- __ push(holder);
388
- __ push(name_);
389
-
390
- CompileCallLoadPropertyWithInterceptor(masm,
391
- receiver,
392
- holder,
393
- name_,
394
- holder_obj);
395
-
396
- Label interceptor_failed;
397
- __ cmp(eax, Factory::no_interceptor_result_sentinel());
398
- __ j(equal, &interceptor_failed);
399
- __ LeaveInternalFrame();
400
- __ ret(0);
401
-
402
- __ bind(&interceptor_failed);
403
- __ pop(name_);
404
- __ pop(holder);
405
- if (lookup->type() == CALLBACKS) {
406
- __ pop(receiver);
407
- }
408
-
409
- __ LeaveInternalFrame();
410
-
411
- if (lookup->type() == FIELD) {
412
- holder = stub_compiler->CheckPrototypes(holder_obj, holder,
413
- lookup->holder(), scratch1,
414
- scratch2,
415
- name,
416
- miss_label);
417
- stub_compiler->GenerateFastPropertyLoad(masm, eax,
418
- holder, lookup->holder(),
419
- lookup->GetFieldIndex());
420
- __ ret(0);
421
- } else {
422
- ASSERT(lookup->type() == CALLBACKS);
423
- ASSERT(lookup->GetCallbackObject()->IsAccessorInfo());
424
- ASSERT(callback != NULL);
425
- ASSERT(callback->getter() != NULL);
426
-
427
- Label cleanup;
428
- __ pop(scratch2);
429
- __ push(receiver);
430
- __ push(scratch2);
431
-
432
- holder = stub_compiler->CheckPrototypes(holder_obj, holder,
433
- lookup->holder(), scratch1,
434
- scratch2,
435
- name,
436
- &cleanup);
437
-
438
- __ pop(scratch2); // save old return address
439
- __ push(holder);
440
- __ mov(holder, Immediate(Handle<AccessorInfo>(callback)));
441
- __ push(holder);
442
- __ push(FieldOperand(holder, AccessorInfo::kDataOffset));
443
- __ push(name_);
444
- __ push(scratch2); // restore old return address
445
-
446
- ExternalReference ref =
447
- ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
448
- __ TailCallExternalReference(ref, 5, 1);
449
-
450
- __ bind(&cleanup);
451
- __ pop(scratch1);
452
- __ pop(scratch2);
453
- __ push(scratch1);
454
- }
455
- }
456
-
457
-
458
- void CompileRegular(MacroAssembler* masm,
459
- Register receiver,
460
- Register holder,
461
- Register scratch,
462
- JSObject* holder_obj,
463
- Label* miss_label) {
464
- __ pop(scratch); // save old return address
465
- PushInterceptorArguments(masm, receiver, holder, name_, holder_obj);
466
- __ push(scratch); // restore old return address
467
-
468
- ExternalReference ref = ExternalReference(
469
- IC_Utility(IC::kLoadPropertyWithInterceptorForLoad));
470
- __ TailCallExternalReference(ref, 5, 1);
471
- }
472
-
473
- private:
474
- Register name_;
475
- };
476
-
477
-
478
414
  // Reserves space for the extra arguments to FastHandleApiCall in the
479
415
  // caller's frame.
480
416
  //
@@ -585,6 +521,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
585
521
  Register receiver,
586
522
  Register scratch1,
587
523
  Register scratch2,
524
+ Register scratch3,
588
525
  Label* miss) {
589
526
  ASSERT(holder->HasNamedInterceptor());
590
527
  ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
@@ -601,6 +538,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
601
538
  receiver,
602
539
  scratch1,
603
540
  scratch2,
541
+ scratch3,
604
542
  holder,
605
543
  lookup,
606
544
  name,
@@ -612,6 +550,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
612
550
  receiver,
613
551
  scratch1,
614
552
  scratch2,
553
+ scratch3,
615
554
  name,
616
555
  holder,
617
556
  miss);
@@ -624,7 +563,8 @@ class CallInterceptorCompiler BASE_EMBEDDED {
624
563
  Register receiver,
625
564
  Register scratch1,
626
565
  Register scratch2,
627
- JSObject* holder_obj,
566
+ Register scratch3,
567
+ JSObject* interceptor_holder,
628
568
  LookupResult* lookup,
629
569
  String* name,
630
570
  const CallOptimization& optimization,
@@ -637,10 +577,13 @@ class CallInterceptorCompiler BASE_EMBEDDED {
637
577
  bool can_do_fast_api_call = false;
638
578
  if (optimization.is_simple_api_call() &&
639
579
  !lookup->holder()->IsGlobalObject()) {
640
- depth1 = optimization.GetPrototypeDepthOfExpectedType(object, holder_obj);
580
+ depth1 =
581
+ optimization.GetPrototypeDepthOfExpectedType(object,
582
+ interceptor_holder);
641
583
  if (depth1 == kInvalidProtoDepth) {
642
- depth2 = optimization.GetPrototypeDepthOfExpectedType(holder_obj,
643
- lookup->holder());
584
+ depth2 =
585
+ optimization.GetPrototypeDepthOfExpectedType(interceptor_holder,
586
+ lookup->holder());
644
587
  }
645
588
  can_do_fast_api_call = (depth1 != kInvalidProtoDepth) ||
646
589
  (depth2 != kInvalidProtoDepth);
@@ -653,24 +596,39 @@ class CallInterceptorCompiler BASE_EMBEDDED {
653
596
  ReserveSpaceForFastApiCall(masm, scratch1);
654
597
  }
655
598
 
599
+ // Check that the maps from receiver to interceptor's holder
600
+ // haven't changed and thus we can invoke interceptor.
656
601
  Label miss_cleanup;
657
602
  Label* miss = can_do_fast_api_call ? &miss_cleanup : miss_label;
658
603
  Register holder =
659
- stub_compiler_->CheckPrototypes(object, receiver, holder_obj,
660
- scratch1, scratch2, name,
661
- depth1, miss);
604
+ stub_compiler_->CheckPrototypes(object, receiver,
605
+ interceptor_holder, scratch1,
606
+ scratch2, scratch3, name, depth1, miss);
662
607
 
608
+ // Invoke an interceptor and if it provides a value,
609
+ // branch to |regular_invoke|.
663
610
  Label regular_invoke;
664
- LoadWithInterceptor(masm, receiver, holder, holder_obj, &regular_invoke);
665
-
666
- // Generate code for the failed interceptor case.
667
-
668
- // Check the lookup is still valid.
669
- stub_compiler_->CheckPrototypes(holder_obj, receiver,
670
- lookup->holder(),
671
- scratch1, scratch2, name,
672
- depth2, miss);
611
+ LoadWithInterceptor(masm, receiver, holder, interceptor_holder,
612
+ &regular_invoke);
613
+
614
+ // Interceptor returned nothing for this property. Try to use cached
615
+ // constant function.
616
+
617
+ // Check that the maps from interceptor's holder to constant function's
618
+ // holder haven't changed and thus we can use cached constant function.
619
+ if (interceptor_holder != lookup->holder()) {
620
+ stub_compiler_->CheckPrototypes(interceptor_holder, receiver,
621
+ lookup->holder(), scratch1,
622
+ scratch2, scratch3, name, depth2, miss);
623
+ } else {
624
+ // CheckPrototypes has a side effect of fetching a 'holder'
625
+ // for API (object which is instanceof for the signature). It's
626
+ // safe to omit it here, as if present, it should be fetched
627
+ // by the previous CheckPrototypes.
628
+ ASSERT(depth2 == kInvalidProtoDepth);
629
+ }
673
630
 
631
+ // Invoke function.
674
632
  if (can_do_fast_api_call) {
675
633
  GenerateFastApiCall(masm, optimization, arguments_.immediate());
676
634
  } else {
@@ -678,12 +636,14 @@ class CallInterceptorCompiler BASE_EMBEDDED {
678
636
  JUMP_FUNCTION);
679
637
  }
680
638
 
639
+ // Deferred code for fast API call case---clean preallocated space.
681
640
  if (can_do_fast_api_call) {
682
641
  __ bind(&miss_cleanup);
683
642
  FreeSpaceForFastApiCall(masm, scratch1);
684
643
  __ jmp(miss_label);
685
644
  }
686
645
 
646
+ // Invoke a regular function.
687
647
  __ bind(&regular_invoke);
688
648
  if (can_do_fast_api_call) {
689
649
  FreeSpaceForFastApiCall(masm, scratch1);
@@ -695,12 +655,13 @@ class CallInterceptorCompiler BASE_EMBEDDED {
695
655
  Register receiver,
696
656
  Register scratch1,
697
657
  Register scratch2,
658
+ Register scratch3,
698
659
  String* name,
699
- JSObject* holder_obj,
660
+ JSObject* interceptor_holder,
700
661
  Label* miss_label) {
701
662
  Register holder =
702
- stub_compiler_->CheckPrototypes(object, receiver, holder_obj,
703
- scratch1, scratch2, name,
663
+ stub_compiler_->CheckPrototypes(object, receiver, interceptor_holder,
664
+ scratch1, scratch2, scratch3, name,
704
665
  miss_label);
705
666
 
706
667
  __ EnterInternalFrame();
@@ -711,7 +672,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
711
672
  receiver,
712
673
  holder,
713
674
  name_,
714
- holder_obj);
675
+ interceptor_holder);
715
676
 
716
677
  __ CallExternalReference(
717
678
  ExternalReference(
@@ -867,6 +828,33 @@ static Object* GenerateCheckPropertyCell(MacroAssembler* masm,
867
828
  }
868
829
 
869
830
 
831
+ // Calls GenerateCheckPropertyCell for each global object in the prototype chain
832
+ // from object to (but not including) holder.
833
+ static Object* GenerateCheckPropertyCells(MacroAssembler* masm,
834
+ JSObject* object,
835
+ JSObject* holder,
836
+ String* name,
837
+ Register scratch,
838
+ Label* miss) {
839
+ JSObject* current = object;
840
+ while (current != holder) {
841
+ if (current->IsGlobalObject()) {
842
+ Object* cell = GenerateCheckPropertyCell(masm,
843
+ GlobalObject::cast(current),
844
+ name,
845
+ scratch,
846
+ miss);
847
+ if (cell->IsFailure()) {
848
+ return cell;
849
+ }
850
+ }
851
+ ASSERT(current->IsJSObject());
852
+ current = JSObject::cast(current->GetPrototype());
853
+ }
854
+ return NULL;
855
+ }
856
+
857
+
870
858
  #undef __
871
859
  #define __ ACCESS_MASM(masm())
872
860
 
@@ -875,35 +863,132 @@ Register StubCompiler::CheckPrototypes(JSObject* object,
875
863
  Register object_reg,
876
864
  JSObject* holder,
877
865
  Register holder_reg,
878
- Register scratch,
866
+ Register scratch1,
867
+ Register scratch2,
879
868
  String* name,
880
- int push_at_depth,
869
+ int save_at_depth,
881
870
  Label* miss) {
882
- // Check that the maps haven't changed.
883
- Register result =
884
- masm()->CheckMaps(object, object_reg, holder, holder_reg, scratch,
885
- push_at_depth, miss);
871
+ // Make sure there's no overlap between holder and object registers.
872
+ ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg));
873
+ ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg)
874
+ && !scratch2.is(scratch1));
875
+ // Keep track of the current object in register reg.
876
+ Register reg = object_reg;
877
+ JSObject* current = object;
878
+ int depth = 0;
879
+
880
+ if (save_at_depth == depth) {
881
+ __ mov(Operand(esp, kPointerSize), reg);
882
+ }
886
883
 
887
- // If we've skipped any global objects, it's not enough to verify
888
- // that their maps haven't changed. We also need to check that the
889
- // property cell for the property is still empty.
890
- while (object != holder) {
891
- if (object->IsGlobalObject()) {
892
- Object* cell = GenerateCheckPropertyCell(masm(),
893
- GlobalObject::cast(object),
894
- name,
895
- scratch,
896
- miss);
897
- if (cell->IsFailure()) {
898
- set_failure(Failure::cast(cell));
899
- return result;
884
+ // Traverse the prototype chain and check the maps in the prototype chain for
885
+ // fast and global objects or do negative lookup for normal objects.
886
+ while (current != holder) {
887
+ depth++;
888
+
889
+ // Only global objects and objects that do not require access
890
+ // checks are allowed in stubs.
891
+ ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded());
892
+
893
+ ASSERT(current->GetPrototype()->IsJSObject());
894
+ JSObject* prototype = JSObject::cast(current->GetPrototype());
895
+ if (!current->HasFastProperties() &&
896
+ !current->IsJSGlobalObject() &&
897
+ !current->IsJSGlobalProxy()) {
898
+ if (!name->IsSymbol()) {
899
+ Object* lookup_result = Heap::LookupSymbol(name);
900
+ if (lookup_result->IsFailure()) {
901
+ set_failure(Failure::cast(lookup_result));
902
+ return reg;
903
+ } else {
904
+ name = String::cast(lookup_result);
905
+ }
906
+ }
907
+ ASSERT(current->property_dictionary()->FindEntry(name) ==
908
+ StringDictionary::kNotFound);
909
+
910
+ GenerateDictionaryNegativeLookup(masm(),
911
+ miss,
912
+ reg,
913
+ name,
914
+ scratch1,
915
+ scratch2);
916
+ __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
917
+ reg = holder_reg; // from now the object is in holder_reg
918
+ __ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
919
+ } else if (Heap::InNewSpace(prototype)) {
920
+ // Get the map of the current object.
921
+ __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
922
+ __ cmp(Operand(scratch1), Immediate(Handle<Map>(current->map())));
923
+ // Branch on the result of the map check.
924
+ __ j(not_equal, miss, not_taken);
925
+ // Check access rights to the global object. This has to happen
926
+ // after the map check so that we know that the object is
927
+ // actually a global object.
928
+ if (current->IsJSGlobalProxy()) {
929
+ __ CheckAccessGlobalProxy(reg, scratch1, miss);
930
+
931
+ // Restore scratch register to be the map of the object.
932
+ // We load the prototype from the map in the scratch register.
933
+ __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
900
934
  }
935
+ // The prototype is in new space; we cannot store a reference
936
+ // to it in the code. Load it from the map.
937
+ reg = holder_reg; // from now the object is in holder_reg
938
+ __ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
939
+ } else {
940
+ // Check the map of the current object.
941
+ __ cmp(FieldOperand(reg, HeapObject::kMapOffset),
942
+ Immediate(Handle<Map>(current->map())));
943
+ // Branch on the result of the map check.
944
+ __ j(not_equal, miss, not_taken);
945
+ // Check access rights to the global object. This has to happen
946
+ // after the map check so that we know that the object is
947
+ // actually a global object.
948
+ if (current->IsJSGlobalProxy()) {
949
+ __ CheckAccessGlobalProxy(reg, scratch1, miss);
950
+ }
951
+ // The prototype is in old space; load it directly.
952
+ reg = holder_reg; // from now the object is in holder_reg
953
+ __ mov(reg, Handle<JSObject>(prototype));
954
+ }
955
+
956
+ if (save_at_depth == depth) {
957
+ __ mov(Operand(esp, kPointerSize), reg);
901
958
  }
902
- object = JSObject::cast(object->GetPrototype());
959
+
960
+ // Go to the next object in the prototype chain.
961
+ current = prototype;
903
962
  }
963
+ ASSERT(current == holder);
964
+
965
+ // Log the check depth.
966
+ LOG(IntEvent("check-maps-depth", depth + 1));
967
+
968
+ // Check the holder map.
969
+ __ cmp(FieldOperand(reg, HeapObject::kMapOffset),
970
+ Immediate(Handle<Map>(holder->map())));
971
+ __ j(not_equal, miss, not_taken);
972
+
973
+ // Perform security check for access to the global object.
974
+ ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
975
+ if (holder->IsJSGlobalProxy()) {
976
+ __ CheckAccessGlobalProxy(reg, scratch1, miss);
977
+ };
978
+
979
+ // If we've skipped any global objects, it's not enough to verify
980
+ // that their maps haven't changed. We also need to check that the
981
+ // property cell for the property is still empty.
982
+ Object* result = GenerateCheckPropertyCells(masm(),
983
+ object,
984
+ holder,
985
+ name,
986
+ scratch1,
987
+ miss);
988
+ if (result->IsFailure()) set_failure(Failure::cast(result));
904
989
 
905
990
  // Return the register containing the holder.
906
- return result;
991
+ return reg;
907
992
  }
908
993
 
909
994
 
@@ -912,6 +997,7 @@ void StubCompiler::GenerateLoadField(JSObject* object,
912
997
  Register receiver,
913
998
  Register scratch1,
914
999
  Register scratch2,
1000
+ Register scratch3,
915
1001
  int index,
916
1002
  String* name,
917
1003
  Label* miss) {
@@ -922,7 +1008,7 @@ void StubCompiler::GenerateLoadField(JSObject* object,
922
1008
  // Check the prototype chain.
923
1009
  Register reg =
924
1010
  CheckPrototypes(object, receiver, holder,
925
- scratch1, scratch2, name, miss);
1011
+ scratch1, scratch2, scratch3, name, miss);
926
1012
 
927
1013
  // Get the value from the properties.
928
1014
  GenerateFastPropertyLoad(masm(), eax, reg, holder, index);
@@ -936,6 +1022,7 @@ bool StubCompiler::GenerateLoadCallback(JSObject* object,
936
1022
  Register name_reg,
937
1023
  Register scratch1,
938
1024
  Register scratch2,
1025
+ Register scratch3,
939
1026
  AccessorInfo* callback,
940
1027
  String* name,
941
1028
  Label* miss,
@@ -947,7 +1034,7 @@ bool StubCompiler::GenerateLoadCallback(JSObject* object,
947
1034
  // Check that the maps haven't changed.
948
1035
  Register reg =
949
1036
  CheckPrototypes(object, receiver, holder,
950
- scratch1, scratch2, name, miss);
1037
+ scratch1, scratch2, scratch3, name, miss);
951
1038
 
952
1039
  Handle<AccessorInfo> callback_handle(callback);
953
1040
 
@@ -960,8 +1047,13 @@ bool StubCompiler::GenerateLoadCallback(JSObject* object,
960
1047
  __ push(other);
961
1048
  __ push(receiver); // receiver
962
1049
  __ push(reg); // holder
963
- __ mov(other, Immediate(callback_handle));
964
- __ push(FieldOperand(other, AccessorInfo::kDataOffset)); // data
1050
+ // Push data from AccessorInfo.
1051
+ if (Heap::InNewSpace(callback_handle->data())) {
1052
+ __ mov(other, Immediate(callback_handle));
1053
+ __ push(FieldOperand(other, AccessorInfo::kDataOffset));
1054
+ } else {
1055
+ __ push(Immediate(Handle<Object>(callback_handle->data())));
1056
+ }
965
1057
  __ push(name_reg); // name
966
1058
  // Save a pointer to where we pushed the arguments pointer.
967
1059
  // This will be passed as the const AccessorInfo& to the C++ callback.
@@ -1006,6 +1098,7 @@ void StubCompiler::GenerateLoadConstant(JSObject* object,
1006
1098
  Register receiver,
1007
1099
  Register scratch1,
1008
1100
  Register scratch2,
1101
+ Register scratch3,
1009
1102
  Object* value,
1010
1103
  String* name,
1011
1104
  Label* miss) {
@@ -1016,7 +1109,7 @@ void StubCompiler::GenerateLoadConstant(JSObject* object,
1016
1109
  // Check that the maps haven't changed.
1017
1110
  Register reg =
1018
1111
  CheckPrototypes(object, receiver, holder,
1019
- scratch1, scratch2, name, miss);
1112
+ scratch1, scratch2, scratch3, name, miss);
1020
1113
 
1021
1114
  // Return the constant value.
1022
1115
  __ mov(eax, Handle<Object>(value));
@@ -1025,26 +1118,141 @@ void StubCompiler::GenerateLoadConstant(JSObject* object,
1025
1118
 
1026
1119
 
1027
1120
  void StubCompiler::GenerateLoadInterceptor(JSObject* object,
1028
- JSObject* holder,
1121
+ JSObject* interceptor_holder,
1029
1122
  LookupResult* lookup,
1030
1123
  Register receiver,
1031
1124
  Register name_reg,
1032
1125
  Register scratch1,
1033
1126
  Register scratch2,
1127
+ Register scratch3,
1034
1128
  String* name,
1035
1129
  Label* miss) {
1036
- LoadInterceptorCompiler compiler(name_reg);
1037
- CompileLoadInterceptor(&compiler,
1038
- this,
1039
- masm(),
1040
- object,
1041
- holder,
1042
- name,
1043
- lookup,
1044
- receiver,
1045
- scratch1,
1046
- scratch2,
1047
- miss);
1130
+ ASSERT(interceptor_holder->HasNamedInterceptor());
1131
+ ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined());
1132
+
1133
+ // Check that the receiver isn't a smi.
1134
+ __ test(receiver, Immediate(kSmiTagMask));
1135
+ __ j(zero, miss, not_taken);
1136
+
1137
+ // So far the most popular follow ups for interceptor loads are FIELD
1138
+ // and CALLBACKS, so inline only them, other cases may be added
1139
+ // later.
1140
+ bool compile_followup_inline = false;
1141
+ if (lookup->IsProperty() && lookup->IsCacheable()) {
1142
+ if (lookup->type() == FIELD) {
1143
+ compile_followup_inline = true;
1144
+ } else if (lookup->type() == CALLBACKS &&
1145
+ lookup->GetCallbackObject()->IsAccessorInfo() &&
1146
+ AccessorInfo::cast(lookup->GetCallbackObject())->getter() != NULL) {
1147
+ compile_followup_inline = true;
1148
+ }
1149
+ }
1150
+
1151
+ if (compile_followup_inline) {
1152
+ // Compile the interceptor call, followed by inline code to load the
1153
+ // property from further up the prototype chain if the call fails.
1154
+ // Check that the maps haven't changed.
1155
+ Register holder_reg = CheckPrototypes(object, receiver, interceptor_holder,
1156
+ scratch1, scratch2, scratch3,
1157
+ name, miss);
1158
+ ASSERT(holder_reg.is(receiver) || holder_reg.is(scratch1));
1159
+
1160
+ // Save necessary data before invoking an interceptor.
1161
+ // Requires a frame to make GC aware of pushed pointers.
1162
+ __ EnterInternalFrame();
1163
+
1164
+ if (lookup->type() == CALLBACKS && !receiver.is(holder_reg)) {
1165
+ // CALLBACKS case needs a receiver to be passed into C++ callback.
1166
+ __ push(receiver);
1167
+ }
1168
+ __ push(holder_reg);
1169
+ __ push(name_reg);
1170
+
1171
+ // Invoke an interceptor. Note: map checks from receiver to
1172
+ // interceptor's holder has been compiled before (see a caller
1173
+ // of this method.)
1174
+ CompileCallLoadPropertyWithInterceptor(masm(),
1175
+ receiver,
1176
+ holder_reg,
1177
+ name_reg,
1178
+ interceptor_holder);
1179
+
1180
+ // Check if interceptor provided a value for property. If it's
1181
+ // the case, return immediately.
1182
+ Label interceptor_failed;
1183
+ __ cmp(eax, Factory::no_interceptor_result_sentinel());
1184
+ __ j(equal, &interceptor_failed);
1185
+ __ LeaveInternalFrame();
1186
+ __ ret(0);
1187
+
1188
+ __ bind(&interceptor_failed);
1189
+ __ pop(name_reg);
1190
+ __ pop(holder_reg);
1191
+ if (lookup->type() == CALLBACKS && !receiver.is(holder_reg)) {
1192
+ __ pop(receiver);
1193
+ }
1194
+
1195
+ __ LeaveInternalFrame();
1196
+
1197
+ // Check that the maps from interceptor's holder to lookup's holder
1198
+ // haven't changed. And load lookup's holder into holder_reg.
1199
+ if (interceptor_holder != lookup->holder()) {
1200
+ holder_reg = CheckPrototypes(interceptor_holder,
1201
+ holder_reg,
1202
+ lookup->holder(),
1203
+ scratch1,
1204
+ scratch2,
1205
+ scratch3,
1206
+ name,
1207
+ miss);
1208
+ }
1209
+
1210
+ if (lookup->type() == FIELD) {
1211
+ // We found FIELD property in prototype chain of interceptor's holder.
1212
+ // Retrieve a field from field's holder.
1213
+ GenerateFastPropertyLoad(masm(), eax, holder_reg,
1214
+ lookup->holder(), lookup->GetFieldIndex());
1215
+ __ ret(0);
1216
+ } else {
1217
+ // We found CALLBACKS property in prototype chain of interceptor's
1218
+ // holder.
1219
+ ASSERT(lookup->type() == CALLBACKS);
1220
+ ASSERT(lookup->GetCallbackObject()->IsAccessorInfo());
1221
+ AccessorInfo* callback = AccessorInfo::cast(lookup->GetCallbackObject());
1222
+ ASSERT(callback != NULL);
1223
+ ASSERT(callback->getter() != NULL);
1224
+
1225
+ // Tail call to runtime.
1226
+ // Important invariant in CALLBACKS case: the code above must be
1227
+ // structured to never clobber |receiver| register.
1228
+ __ pop(scratch2); // return address
1229
+ __ push(receiver);
1230
+ __ push(holder_reg);
1231
+ __ mov(holder_reg, Immediate(Handle<AccessorInfo>(callback)));
1232
+ __ push(holder_reg);
1233
+ __ push(FieldOperand(holder_reg, AccessorInfo::kDataOffset));
1234
+ __ push(name_reg);
1235
+ __ push(scratch2); // restore return address
1236
+
1237
+ ExternalReference ref =
1238
+ ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
1239
+ __ TailCallExternalReference(ref, 5, 1);
1240
+ }
1241
+ } else { // !compile_followup_inline
1242
+ // Call the runtime system to load the interceptor.
1243
+ // Check that the maps haven't changed.
1244
+ Register holder_reg =
1245
+ CheckPrototypes(object, receiver, interceptor_holder,
1246
+ scratch1, scratch2, scratch3, name, miss);
1247
+ __ pop(scratch2); // save old return address
1248
+ PushInterceptorArguments(masm(), receiver, holder_reg,
1249
+ name_reg, interceptor_holder);
1250
+ __ push(scratch2); // restore old return address
1251
+
1252
+ ExternalReference ref = ExternalReference(
1253
+ IC_Utility(IC::kLoadPropertyWithInterceptorForLoad));
1254
+ __ TailCallExternalReference(ref, 5, 1);
1255
+ }
1048
1256
  }
1049
1257
 
1050
1258
 
@@ -1072,6 +1280,20 @@ Object* StubCompiler::CompileLazyCompile(Code::Flags flags) {
1072
1280
  }
1073
1281
 
1074
1282
 
1283
+ void CallStubCompiler::GenerateNameCheck(String* name, Label* miss) {
1284
+ if (kind_ == Code::KEYED_CALL_IC) {
1285
+ __ cmp(Operand(ecx), Immediate(Handle<String>(name)));
1286
+ __ j(not_equal, miss, not_taken);
1287
+ }
1288
+ }
1289
+
1290
+
1291
+ void CallStubCompiler::GenerateMissBranch() {
1292
+ Handle<Code> ic = ComputeCallMiss(arguments().immediate(), kind_);
1293
+ __ jmp(ic, RelocInfo::CODE_TARGET);
1294
+ }
1295
+
1296
+
1075
1297
  Object* CallStubCompiler::CompileCallField(JSObject* object,
1076
1298
  JSObject* holder,
1077
1299
  int index,
@@ -1085,6 +1307,8 @@ Object* CallStubCompiler::CompileCallField(JSObject* object,
1085
1307
  // -----------------------------------
1086
1308
  Label miss;
1087
1309
 
1310
+ GenerateNameCheck(name, &miss);
1311
+
1088
1312
  // Get the receiver from the stack.
1089
1313
  const int argc = arguments().immediate();
1090
1314
  __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
@@ -1094,7 +1318,8 @@ Object* CallStubCompiler::CompileCallField(JSObject* object,
1094
1318
  __ j(zero, &miss, not_taken);
1095
1319
 
1096
1320
  // Do the right check and compute the holder register.
1097
- Register reg = CheckPrototypes(object, edx, holder, ebx, eax, name, &miss);
1321
+ Register reg = CheckPrototypes(object, edx, holder, ebx, eax, edi,
1322
+ name, &miss);
1098
1323
 
1099
1324
  GenerateFastPropertyLoad(masm(), edi, reg, holder, index);
1100
1325
 
@@ -1116,8 +1341,7 @@ Object* CallStubCompiler::CompileCallField(JSObject* object,
1116
1341
 
1117
1342
  // Handle call cache miss.
1118
1343
  __ bind(&miss);
1119
- Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1120
- __ jmp(ic, RelocInfo::CODE_TARGET);
1344
+ GenerateMissBranch();
1121
1345
 
1122
1346
  // Return the generated code.
1123
1347
  return GetCode(FIELD, name);
@@ -1145,6 +1369,8 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1145
1369
 
1146
1370
  Label miss;
1147
1371
 
1372
+ GenerateNameCheck(name, &miss);
1373
+
1148
1374
  // Get the receiver from the stack.
1149
1375
  const int argc = arguments().immediate();
1150
1376
  __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
@@ -1155,7 +1381,7 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1155
1381
 
1156
1382
  CheckPrototypes(JSObject::cast(object), edx,
1157
1383
  holder, ebx,
1158
- eax, name, &miss);
1384
+ eax, edi, name, &miss);
1159
1385
 
1160
1386
  if (argc == 0) {
1161
1387
  // Noop, return the length.
@@ -1171,7 +1397,7 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1171
1397
  __ j(not_equal, &miss);
1172
1398
 
1173
1399
  if (argc == 1) { // Otherwise fall through to call builtin.
1174
- Label call_builtin, exit, with_rset_update, attempt_to_grow_elements;
1400
+ Label call_builtin, exit, with_write_barrier, attempt_to_grow_elements;
1175
1401
 
1176
1402
  // Get the array's length into eax and calculate new length.
1177
1403
  __ mov(eax, FieldOperand(edx, JSArray::kLengthOffset));
@@ -1181,7 +1407,6 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1181
1407
 
1182
1408
  // Get the element's length into ecx.
1183
1409
  __ mov(ecx, FieldOperand(ebx, FixedArray::kLengthOffset));
1184
- __ SmiTag(ecx);
1185
1410
 
1186
1411
  // Check if we could survive without allocation.
1187
1412
  __ cmp(eax, Operand(ecx));
@@ -1199,17 +1424,16 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1199
1424
 
1200
1425
  // Check if value is a smi.
1201
1426
  __ test(ecx, Immediate(kSmiTagMask));
1202
- __ j(not_zero, &with_rset_update);
1427
+ __ j(not_zero, &with_write_barrier);
1203
1428
 
1204
1429
  __ bind(&exit);
1205
1430
  __ ret((argc + 1) * kPointerSize);
1206
1431
 
1207
- __ bind(&with_rset_update);
1432
+ __ bind(&with_write_barrier);
1208
1433
 
1209
1434
  __ InNewSpace(ebx, ecx, equal, &exit);
1210
1435
 
1211
- RecordWriteStub stub(ebx, edx, ecx);
1212
- __ CallStub(&stub);
1436
+ __ RecordWriteHelper(ebx, edx, ecx);
1213
1437
  __ ret((argc + 1) * kPointerSize);
1214
1438
 
1215
1439
  __ bind(&attempt_to_grow_elements);
@@ -1249,10 +1473,10 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1249
1473
 
1250
1474
  // Increment element's and array's sizes.
1251
1475
  __ add(FieldOperand(ebx, FixedArray::kLengthOffset),
1252
- Immediate(kAllocationDelta));
1476
+ Immediate(Smi::FromInt(kAllocationDelta)));
1253
1477
  __ mov(FieldOperand(edx, JSArray::kLengthOffset), eax);
1254
1478
 
1255
- // Elements are in new space, so no remembered set updates are necessary.
1479
+ // Elements are in new space, so write barrier is not required.
1256
1480
  __ ret((argc + 1) * kPointerSize);
1257
1481
 
1258
1482
  __ bind(&call_builtin);
@@ -1264,16 +1488,10 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1264
1488
  }
1265
1489
 
1266
1490
  __ bind(&miss);
1267
-
1268
- Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1269
- __ jmp(ic, RelocInfo::CODE_TARGET);
1491
+ GenerateMissBranch();
1270
1492
 
1271
1493
  // Return the generated code.
1272
- String* function_name = NULL;
1273
- if (function->shared()->name()->IsString()) {
1274
- function_name = String::cast(function->shared()->name());
1275
- }
1276
- return GetCode(CONSTANT_FUNCTION, function_name);
1494
+ return GetCode(function);
1277
1495
  }
1278
1496
 
1279
1497
 
@@ -1298,6 +1516,8 @@ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
1298
1516
 
1299
1517
  Label miss, return_undefined, call_builtin;
1300
1518
 
1519
+ GenerateNameCheck(name, &miss);
1520
+
1301
1521
  // Get the receiver from the stack.
1302
1522
  const int argc = arguments().immediate();
1303
1523
  __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
@@ -1307,7 +1527,7 @@ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
1307
1527
  __ j(zero, &miss);
1308
1528
  CheckPrototypes(JSObject::cast(object), edx,
1309
1529
  holder, ebx,
1310
- eax, name, &miss);
1530
+ eax, edi, name, &miss);
1311
1531
 
1312
1532
  // Get the elements array of the object.
1313
1533
  __ mov(ebx, FieldOperand(edx, JSArray::kElementsOffset));
@@ -1351,16 +1571,142 @@ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
1351
1571
  1);
1352
1572
 
1353
1573
  __ bind(&miss);
1574
+ GenerateMissBranch();
1354
1575
 
1355
- Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1356
- __ jmp(ic, RelocInfo::CODE_TARGET);
1576
+ // Return the generated code.
1577
+ return GetCode(function);
1578
+ }
1579
+
1580
+
1581
+ Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
1582
+ JSObject* holder,
1583
+ JSFunction* function,
1584
+ String* name,
1585
+ CheckType check) {
1586
+ // ----------- S t a t e -------------
1587
+ // -- ecx : function name
1588
+ // -- esp[0] : return address
1589
+ // -- esp[(argc - n) * 4] : arg[n] (zero-based)
1590
+ // -- ...
1591
+ // -- esp[(argc + 1) * 4] : receiver
1592
+ // -----------------------------------
1593
+
1594
+ const int argc = arguments().immediate();
1595
+
1596
+ Label miss;
1597
+ Label index_out_of_range;
1598
+ GenerateNameCheck(name, &miss);
1599
+
1600
+ // Check that the maps starting from the prototype haven't changed.
1601
+ GenerateDirectLoadGlobalFunctionPrototype(masm(),
1602
+ Context::STRING_FUNCTION_INDEX,
1603
+ eax);
1604
+ CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder,
1605
+ ebx, edx, edi, name, &miss);
1606
+
1607
+ Register receiver = ebx;
1608
+ Register index = edi;
1609
+ Register scratch = edx;
1610
+ Register result = eax;
1611
+ __ mov(receiver, Operand(esp, (argc + 1) * kPointerSize));
1612
+ if (argc > 0) {
1613
+ __ mov(index, Operand(esp, (argc - 0) * kPointerSize));
1614
+ } else {
1615
+ __ Set(index, Immediate(Factory::undefined_value()));
1616
+ }
1617
+
1618
+ StringCharCodeAtGenerator char_code_at_generator(receiver,
1619
+ index,
1620
+ scratch,
1621
+ result,
1622
+ &miss, // When not a string.
1623
+ &miss, // When not a number.
1624
+ &index_out_of_range,
1625
+ STRING_INDEX_IS_NUMBER);
1626
+ char_code_at_generator.GenerateFast(masm());
1627
+ __ ret((argc + 1) * kPointerSize);
1628
+
1629
+ ICRuntimeCallHelper call_helper;
1630
+ char_code_at_generator.GenerateSlow(masm(), call_helper);
1631
+
1632
+ __ bind(&index_out_of_range);
1633
+ __ Set(eax, Immediate(Factory::nan_value()));
1634
+ __ ret((argc + 1) * kPointerSize);
1635
+
1636
+ __ bind(&miss);
1637
+
1638
+ GenerateMissBranch();
1357
1639
 
1358
1640
  // Return the generated code.
1359
- String* function_name = NULL;
1360
- if (function->shared()->name()->IsString()) {
1361
- function_name = String::cast(function->shared()->name());
1641
+ return GetCode(function);
1642
+ }
1643
+
1644
+
1645
+ Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
1646
+ JSObject* holder,
1647
+ JSFunction* function,
1648
+ String* name,
1649
+ CheckType check) {
1650
+ // ----------- S t a t e -------------
1651
+ // -- ecx : function name
1652
+ // -- esp[0] : return address
1653
+ // -- esp[(argc - n) * 4] : arg[n] (zero-based)
1654
+ // -- ...
1655
+ // -- esp[(argc + 1) * 4] : receiver
1656
+ // -----------------------------------
1657
+
1658
+ const int argc = arguments().immediate();
1659
+
1660
+ Label miss;
1661
+ Label index_out_of_range;
1662
+
1663
+ GenerateNameCheck(name, &miss);
1664
+
1665
+ // Check that the maps starting from the prototype haven't changed.
1666
+ GenerateDirectLoadGlobalFunctionPrototype(masm(),
1667
+ Context::STRING_FUNCTION_INDEX,
1668
+ eax);
1669
+ CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder,
1670
+ ebx, edx, edi, name, &miss);
1671
+
1672
+ Register receiver = eax;
1673
+ Register index = edi;
1674
+ Register scratch1 = ebx;
1675
+ Register scratch2 = edx;
1676
+ Register result = eax;
1677
+ __ mov(receiver, Operand(esp, (argc + 1) * kPointerSize));
1678
+ if (argc > 0) {
1679
+ __ mov(index, Operand(esp, (argc - 0) * kPointerSize));
1680
+ } else {
1681
+ __ Set(index, Immediate(Factory::undefined_value()));
1362
1682
  }
1363
- return GetCode(CONSTANT_FUNCTION, function_name);
1683
+
1684
+ StringCharAtGenerator char_at_generator(receiver,
1685
+ index,
1686
+ scratch1,
1687
+ scratch2,
1688
+ result,
1689
+ &miss, // When not a string.
1690
+ &miss, // When not a number.
1691
+ &index_out_of_range,
1692
+ STRING_INDEX_IS_NUMBER);
1693
+ char_at_generator.GenerateFast(masm());
1694
+ __ ret((argc + 1) * kPointerSize);
1695
+
1696
+ ICRuntimeCallHelper call_helper;
1697
+ char_at_generator.GenerateSlow(masm(), call_helper);
1698
+
1699
+ __ bind(&index_out_of_range);
1700
+ __ Set(eax, Immediate(Factory::empty_string()));
1701
+ __ ret((argc + 1) * kPointerSize);
1702
+
1703
+ __ bind(&miss);
1704
+ // Restore function name in ecx.
1705
+
1706
+ GenerateMissBranch();
1707
+
1708
+ // Return the generated code.
1709
+ return GetCode(function);
1364
1710
  }
1365
1711
 
1366
1712
 
@@ -1379,9 +1725,9 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
1379
1725
 
1380
1726
  SharedFunctionInfo* function_info = function->shared();
1381
1727
  if (function_info->HasCustomCallGenerator()) {
1382
- CustomCallGenerator generator =
1383
- ToCData<CustomCallGenerator>(function_info->function_data());
1384
- Object* result = generator(this, object, holder, function, name, check);
1728
+ const int id = function_info->custom_call_generator_id();
1729
+ Object* result =
1730
+ CompileCustomCall(id, object, holder, function, name, check);
1385
1731
  // undefined means bail out to regular compiler.
1386
1732
  if (!result->IsUndefined()) {
1387
1733
  return result;
@@ -1390,6 +1736,8 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
1390
1736
 
1391
1737
  Label miss_in_smi_check;
1392
1738
 
1739
+ GenerateNameCheck(name, &miss_in_smi_check);
1740
+
1393
1741
  // Get the receiver from the stack.
1394
1742
  const int argc = arguments().immediate();
1395
1743
  __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
@@ -1424,7 +1772,7 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
1424
1772
 
1425
1773
  // Check that the maps haven't changed.
1426
1774
  CheckPrototypes(JSObject::cast(object), edx, holder,
1427
- ebx, eax, name, depth, &miss);
1775
+ ebx, eax, edi, name, depth, &miss);
1428
1776
 
1429
1777
  // Patch the receiver on the stack with the global proxy if
1430
1778
  // necessary.
@@ -1441,16 +1789,13 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
1441
1789
  __ jmp(&miss);
1442
1790
  } else {
1443
1791
  // Check that the object is a string or a symbol.
1444
- __ mov(eax, FieldOperand(edx, HeapObject::kMapOffset));
1445
- __ movzx_b(eax, FieldOperand(eax, Map::kInstanceTypeOffset));
1446
- __ cmp(eax, FIRST_NONSTRING_TYPE);
1792
+ __ CmpObjectType(edx, FIRST_NONSTRING_TYPE, eax);
1447
1793
  __ j(above_equal, &miss, not_taken);
1448
1794
  // Check that the maps starting from the prototype haven't changed.
1449
- GenerateLoadGlobalFunctionPrototype(masm(),
1450
- Context::STRING_FUNCTION_INDEX,
1451
- eax);
1795
+ GenerateDirectLoadGlobalFunctionPrototype(
1796
+ masm(), Context::STRING_FUNCTION_INDEX, eax);
1452
1797
  CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder,
1453
- ebx, edx, name, &miss);
1798
+ ebx, edx, edi, name, &miss);
1454
1799
  }
1455
1800
  break;
1456
1801
 
@@ -1467,11 +1812,10 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
1467
1812
  __ j(not_equal, &miss, not_taken);
1468
1813
  __ bind(&fast);
1469
1814
  // Check that the maps starting from the prototype haven't changed.
1470
- GenerateLoadGlobalFunctionPrototype(masm(),
1471
- Context::NUMBER_FUNCTION_INDEX,
1472
- eax);
1815
+ GenerateDirectLoadGlobalFunctionPrototype(
1816
+ masm(), Context::NUMBER_FUNCTION_INDEX, eax);
1473
1817
  CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder,
1474
- ebx, edx, name, &miss);
1818
+ ebx, edx, edi, name, &miss);
1475
1819
  }
1476
1820
  break;
1477
1821
  }
@@ -1489,11 +1833,10 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
1489
1833
  __ j(not_equal, &miss, not_taken);
1490
1834
  __ bind(&fast);
1491
1835
  // Check that the maps starting from the prototype haven't changed.
1492
- GenerateLoadGlobalFunctionPrototype(masm(),
1493
- Context::BOOLEAN_FUNCTION_INDEX,
1494
- eax);
1836
+ GenerateDirectLoadGlobalFunctionPrototype(
1837
+ masm(), Context::BOOLEAN_FUNCTION_INDEX, eax);
1495
1838
  CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder,
1496
- ebx, edx, name, &miss);
1839
+ ebx, edx, edi, name, &miss);
1497
1840
  }
1498
1841
  break;
1499
1842
  }
@@ -1514,15 +1857,10 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
1514
1857
  FreeSpaceForFastApiCall(masm(), eax);
1515
1858
  }
1516
1859
  __ bind(&miss_in_smi_check);
1517
- Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1518
- __ jmp(ic, RelocInfo::CODE_TARGET);
1860
+ GenerateMissBranch();
1519
1861
 
1520
1862
  // Return the generated code.
1521
- String* function_name = NULL;
1522
- if (function->shared()->name()->IsString()) {
1523
- function_name = String::cast(function->shared()->name());
1524
- }
1525
- return GetCode(CONSTANT_FUNCTION, function_name);
1863
+ return GetCode(function);
1526
1864
  }
1527
1865
 
1528
1866
 
@@ -1538,6 +1876,8 @@ Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
1538
1876
  // -----------------------------------
1539
1877
  Label miss;
1540
1878
 
1879
+ GenerateNameCheck(name, &miss);
1880
+
1541
1881
  // Get the number of arguments.
1542
1882
  const int argc = arguments().immediate();
1543
1883
 
@@ -1556,6 +1896,7 @@ Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
1556
1896
  edx,
1557
1897
  ebx,
1558
1898
  edi,
1899
+ eax,
1559
1900
  &miss);
1560
1901
 
1561
1902
  // Restore receiver.
@@ -1580,8 +1921,7 @@ Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
1580
1921
 
1581
1922
  // Handle load cache miss.
1582
1923
  __ bind(&miss);
1583
- Handle<Code> ic = ComputeCallMiss(argc);
1584
- __ jmp(ic, RelocInfo::CODE_TARGET);
1924
+ GenerateMissBranch();
1585
1925
 
1586
1926
  // Return the generated code.
1587
1927
  return GetCode(INTERCEPTOR, name);
@@ -1602,6 +1942,8 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
1602
1942
  // -----------------------------------
1603
1943
  Label miss;
1604
1944
 
1945
+ GenerateNameCheck(name, &miss);
1946
+
1605
1947
  // Get the number of arguments.
1606
1948
  const int argc = arguments().immediate();
1607
1949
 
@@ -1617,7 +1959,7 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
1617
1959
  }
1618
1960
 
1619
1961
  // Check that the maps haven't changed.
1620
- CheckPrototypes(object, edx, holder, ebx, eax, name, &miss);
1962
+ CheckPrototypes(object, edx, holder, ebx, eax, edi, name, &miss);
1621
1963
 
1622
1964
  // Get the value from the cell.
1623
1965
  __ mov(edi, Immediate(Handle<JSGlobalPropertyCell>(cell)));
@@ -1664,8 +2006,7 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
1664
2006
  // Handle call cache miss.
1665
2007
  __ bind(&miss);
1666
2008
  __ IncrementCounter(&Counters::call_global_inline_miss, 1);
1667
- Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1668
- __ jmp(ic, RelocInfo::CODE_TARGET);
2009
+ GenerateMissBranch();
1669
2010
 
1670
2011
  // Return the generated code.
1671
2012
  return GetCode(NORMAL, name);
@@ -1889,10 +2230,12 @@ Object* LoadStubCompiler::CompileLoadNonexistent(String* name,
1889
2230
  __ test(eax, Immediate(kSmiTagMask));
1890
2231
  __ j(zero, &miss, not_taken);
1891
2232
 
2233
+ ASSERT(last->IsGlobalObject() || last->HasFastProperties());
2234
+
1892
2235
  // Check the maps of the full prototype chain. Also check that
1893
2236
  // global property cells up to (but not including) the last object
1894
2237
  // in the prototype chain are empty.
1895
- CheckPrototypes(object, eax, last, ebx, edx, name, &miss);
2238
+ CheckPrototypes(object, eax, last, ebx, edx, edi, name, &miss);
1896
2239
 
1897
2240
  // If the last object in the prototype chain is a global object,
1898
2241
  // check that the global property cell is empty.
@@ -1929,7 +2272,7 @@ Object* LoadStubCompiler::CompileLoadField(JSObject* object,
1929
2272
  // -----------------------------------
1930
2273
  Label miss;
1931
2274
 
1932
- GenerateLoadField(object, holder, eax, ebx, edx, index, name, &miss);
2275
+ GenerateLoadField(object, holder, eax, ebx, edx, edi, index, name, &miss);
1933
2276
  __ bind(&miss);
1934
2277
  GenerateLoadMiss(masm(), Code::LOAD_IC);
1935
2278
 
@@ -1950,7 +2293,7 @@ Object* LoadStubCompiler::CompileLoadCallback(String* name,
1950
2293
  Label miss;
1951
2294
 
1952
2295
  Failure* failure = Failure::InternalError();
1953
- bool success = GenerateLoadCallback(object, holder, eax, ecx, ebx, edx,
2296
+ bool success = GenerateLoadCallback(object, holder, eax, ecx, ebx, edx, edi,
1954
2297
  callback, name, &miss, &failure);
1955
2298
  if (!success) return failure;
1956
2299
 
@@ -1973,7 +2316,7 @@ Object* LoadStubCompiler::CompileLoadConstant(JSObject* object,
1973
2316
  // -----------------------------------
1974
2317
  Label miss;
1975
2318
 
1976
- GenerateLoadConstant(object, holder, eax, ebx, edx, value, name, &miss);
2319
+ GenerateLoadConstant(object, holder, eax, ebx, edx, edi, value, name, &miss);
1977
2320
  __ bind(&miss);
1978
2321
  GenerateLoadMiss(masm(), Code::LOAD_IC);
1979
2322
 
@@ -2004,6 +2347,7 @@ Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
2004
2347
  ecx,
2005
2348
  edx,
2006
2349
  ebx,
2350
+ edi,
2007
2351
  name,
2008
2352
  &miss);
2009
2353
 
@@ -2036,7 +2380,7 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
2036
2380
  }
2037
2381
 
2038
2382
  // Check that the maps haven't changed.
2039
- CheckPrototypes(object, eax, holder, ebx, edx, name, &miss);
2383
+ CheckPrototypes(object, eax, holder, ebx, edx, edi, name, &miss);
2040
2384
 
2041
2385
  // Get the value from the cell.
2042
2386
  __ mov(ebx, Immediate(Handle<JSGlobalPropertyCell>(cell)));
@@ -2081,7 +2425,7 @@ Object* KeyedLoadStubCompiler::CompileLoadField(String* name,
2081
2425
  __ cmp(Operand(eax), Immediate(Handle<String>(name)));
2082
2426
  __ j(not_equal, &miss, not_taken);
2083
2427
 
2084
- GenerateLoadField(receiver, holder, edx, ebx, ecx, index, name, &miss);
2428
+ GenerateLoadField(receiver, holder, edx, ebx, ecx, edi, index, name, &miss);
2085
2429
 
2086
2430
  __ bind(&miss);
2087
2431
  __ DecrementCounter(&Counters::keyed_load_field, 1);
@@ -2110,7 +2454,7 @@ Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
2110
2454
  __ j(not_equal, &miss, not_taken);
2111
2455
 
2112
2456
  Failure* failure = Failure::InternalError();
2113
- bool success = GenerateLoadCallback(receiver, holder, edx, eax, ebx, ecx,
2457
+ bool success = GenerateLoadCallback(receiver, holder, edx, eax, ebx, ecx, edi,
2114
2458
  callback, name, &miss, &failure);
2115
2459
  if (!success) return failure;
2116
2460
 
@@ -2140,7 +2484,7 @@ Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
2140
2484
  __ cmp(Operand(eax), Immediate(Handle<String>(name)));
2141
2485
  __ j(not_equal, &miss, not_taken);
2142
2486
 
2143
- GenerateLoadConstant(receiver, holder, edx, ebx, ecx,
2487
+ GenerateLoadConstant(receiver, holder, edx, ebx, ecx, edi,
2144
2488
  value, name, &miss);
2145
2489
  __ bind(&miss);
2146
2490
  __ DecrementCounter(&Counters::keyed_load_constant_function, 1);
@@ -2176,6 +2520,7 @@ Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
2176
2520
  eax,
2177
2521
  ecx,
2178
2522
  ebx,
2523
+ edi,
2179
2524
  name,
2180
2525
  &miss);
2181
2526
  __ bind(&miss);
@@ -2401,3 +2746,5 @@ Object* ConstructStubCompiler::CompileConstructStub(
2401
2746
  #undef __
2402
2747
 
2403
2748
  } } // namespace v8::internal
2749
+
2750
+ #endif // V8_TARGET_ARCH_IA32