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
@@ -1,364 +0,0 @@
1
- // Copyright 2010 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #ifndef V8_PROFILE_GENERATOR_H_
29
- #define V8_PROFILE_GENERATOR_H_
30
-
31
- #ifdef ENABLE_LOGGING_AND_PROFILING
32
-
33
- #include "hashmap.h"
34
-
35
- namespace v8 {
36
- namespace internal {
37
-
38
- class CodeEntry {
39
- public:
40
- // CodeEntry doesn't own name strings, just references them.
41
- INLINE(CodeEntry(Logger::LogEventsAndTags tag,
42
- const char* name_prefix,
43
- const char* name,
44
- const char* resource_name,
45
- int line_number));
46
-
47
- INLINE(bool is_js_function() const) { return is_js_function_tag(tag_); }
48
- INLINE(const char* name_prefix() const) { return name_prefix_; }
49
- INLINE(bool has_name_prefix() const) { return name_prefix_[0] != '\0'; }
50
- INLINE(const char* name() const) { return name_; }
51
- INLINE(const char* resource_name() const) { return resource_name_; }
52
- INLINE(int line_number() const) { return line_number_; }
53
- INLINE(unsigned call_uid() const) { return call_uid_; }
54
-
55
- INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag));
56
-
57
- static const char* kEmptyNamePrefix;
58
-
59
- private:
60
- const unsigned call_uid_;
61
- Logger::LogEventsAndTags tag_;
62
- const char* name_prefix_;
63
- const char* name_;
64
- const char* resource_name_;
65
- int line_number_;
66
-
67
- static unsigned next_call_uid_;
68
-
69
- DISALLOW_COPY_AND_ASSIGN(CodeEntry);
70
- };
71
-
72
-
73
- class ProfileTree;
74
-
75
- class ProfileNode {
76
- public:
77
- INLINE(ProfileNode(ProfileTree* tree, CodeEntry* entry));
78
-
79
- ProfileNode* FindChild(CodeEntry* entry);
80
- ProfileNode* FindOrAddChild(CodeEntry* entry);
81
- INLINE(void IncrementSelfTicks()) { ++self_ticks_; }
82
- INLINE(void IncreaseTotalTicks(unsigned amount)) { total_ticks_ += amount; }
83
-
84
- INLINE(CodeEntry* entry() const) { return entry_; }
85
- INLINE(unsigned self_ticks() const) { return self_ticks_; }
86
- INLINE(unsigned total_ticks() const) { return total_ticks_; }
87
- INLINE(const List<ProfileNode*>* children() const) { return &children_list_; }
88
- double GetSelfMillis() const;
89
- double GetTotalMillis() const;
90
-
91
- void Print(int indent);
92
-
93
- private:
94
- INLINE(static bool CodeEntriesMatch(void* entry1, void* entry2)) {
95
- return entry1 == entry2;
96
- }
97
-
98
- INLINE(static uint32_t CodeEntryHash(CodeEntry* entry)) {
99
- return static_cast<int32_t>(reinterpret_cast<intptr_t>(entry));
100
- }
101
-
102
- ProfileTree* tree_;
103
- CodeEntry* entry_;
104
- unsigned total_ticks_;
105
- unsigned self_ticks_;
106
- // CodeEntry* -> ProfileNode*
107
- HashMap children_;
108
- List<ProfileNode*> children_list_;
109
-
110
- DISALLOW_COPY_AND_ASSIGN(ProfileNode);
111
- };
112
-
113
-
114
- class ProfileTree {
115
- public:
116
- ProfileTree();
117
- ~ProfileTree();
118
-
119
- void AddPathFromEnd(const Vector<CodeEntry*>& path);
120
- void AddPathFromStart(const Vector<CodeEntry*>& path);
121
- void CalculateTotalTicks();
122
-
123
- double TicksToMillis(unsigned ticks) const {
124
- return ticks * ms_to_ticks_scale_;
125
- }
126
- ProfileNode* root() const { return root_; }
127
- void SetTickRatePerMs(double ticks_per_ms);
128
-
129
- void ShortPrint();
130
- void Print() {
131
- root_->Print(0);
132
- }
133
-
134
- private:
135
- template <typename Callback>
136
- void TraverseDepthFirstPostOrder(Callback* callback);
137
-
138
- CodeEntry root_entry_;
139
- ProfileNode* root_;
140
- double ms_to_ticks_scale_;
141
-
142
- DISALLOW_COPY_AND_ASSIGN(ProfileTree);
143
- };
144
-
145
-
146
- class CpuProfile {
147
- public:
148
- CpuProfile(const char* title, unsigned uid)
149
- : title_(title), uid_(uid) { }
150
-
151
- // Add pc -> ... -> main() call path to the profile.
152
- void AddPath(const Vector<CodeEntry*>& path);
153
- void CalculateTotalTicks();
154
- void SetActualSamplingRate(double actual_sampling_rate);
155
-
156
- INLINE(const char* title() const) { return title_; }
157
- INLINE(unsigned uid() const) { return uid_; }
158
- INLINE(const ProfileTree* top_down() const) { return &top_down_; }
159
- INLINE(const ProfileTree* bottom_up() const) { return &bottom_up_; }
160
-
161
- void UpdateTicksScale();
162
-
163
- void ShortPrint();
164
- void Print();
165
-
166
- private:
167
- const char* title_;
168
- unsigned uid_;
169
- ProfileTree top_down_;
170
- ProfileTree bottom_up_;
171
-
172
- DISALLOW_COPY_AND_ASSIGN(CpuProfile);
173
- };
174
-
175
-
176
- class CodeMap {
177
- public:
178
- CodeMap() { }
179
- INLINE(void AddCode(Address addr, CodeEntry* entry, unsigned size));
180
- INLINE(void MoveCode(Address from, Address to));
181
- INLINE(void DeleteCode(Address addr));
182
- void AddAlias(Address alias, Address addr);
183
- CodeEntry* FindEntry(Address addr);
184
-
185
- void Print();
186
-
187
- private:
188
- struct CodeEntryInfo {
189
- CodeEntryInfo(CodeEntry* an_entry, unsigned a_size)
190
- : entry(an_entry), size(a_size) { }
191
- CodeEntry* entry;
192
- unsigned size;
193
- };
194
-
195
- struct CodeTreeConfig {
196
- typedef Address Key;
197
- typedef CodeEntryInfo Value;
198
- static const Key kNoKey;
199
- static const Value kNoValue;
200
- static int Compare(const Key& a, const Key& b) {
201
- return a < b ? -1 : (a > b ? 1 : 0);
202
- }
203
- };
204
- typedef SplayTree<CodeTreeConfig> CodeTree;
205
-
206
- class CodeTreePrinter {
207
- public:
208
- void Call(const Address& key, const CodeEntryInfo& value);
209
- };
210
-
211
- CodeTree tree_;
212
-
213
- DISALLOW_COPY_AND_ASSIGN(CodeMap);
214
- };
215
-
216
-
217
- class CpuProfilesCollection {
218
- public:
219
- CpuProfilesCollection();
220
- ~CpuProfilesCollection();
221
-
222
- bool StartProfiling(const char* title, unsigned uid);
223
- bool StartProfiling(String* title, unsigned uid);
224
- CpuProfile* StopProfiling(const char* title, double actual_sampling_rate);
225
- CpuProfile* StopProfiling(String* title, double actual_sampling_rate);
226
- INLINE(List<CpuProfile*>* profiles()) { return &profiles_; }
227
- CpuProfile* GetProfile(unsigned uid);
228
- inline bool is_last_profile();
229
-
230
- CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag,
231
- String* name, String* resource_name, int line_number);
232
- CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, const char* name);
233
- CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag,
234
- const char* name_prefix, String* name);
235
- CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, int args_count);
236
-
237
- // Called from profile generator thread.
238
- void AddPathToCurrentProfiles(const Vector<CodeEntry*>& path);
239
-
240
- private:
241
- INLINE(const char* GetFunctionName(String* name));
242
- INLINE(const char* GetFunctionName(const char* name));
243
- const char* GetName(String* name);
244
- const char* GetName(int args_count);
245
-
246
- INLINE(static bool StringsMatch(void* key1, void* key2)) {
247
- return strcmp(reinterpret_cast<char*>(key1),
248
- reinterpret_cast<char*>(key2)) == 0;
249
- }
250
-
251
- INLINE(static bool CpuProfilesMatch(void* key1, void* key2)) {
252
- return key1 == key2;
253
- }
254
-
255
- // String::Hash -> const char*
256
- HashMap function_and_resource_names_;
257
- // args_count -> char*
258
- List<char*> args_count_names_;
259
- List<CodeEntry*> code_entries_;
260
- List<CpuProfile*> profiles_;
261
- // uid -> CpuProfile*
262
- HashMap profiles_uids_;
263
-
264
- // Accessed by VM thread and profile generator thread.
265
- List<CpuProfile*> current_profiles_;
266
- Semaphore* current_profiles_semaphore_;
267
-
268
- DISALLOW_COPY_AND_ASSIGN(CpuProfilesCollection);
269
- };
270
-
271
-
272
- class SampleRateCalculator {
273
- public:
274
- SampleRateCalculator()
275
- : result_(Logger::kSamplingIntervalMs * kResultScale),
276
- ticks_per_ms_(Logger::kSamplingIntervalMs),
277
- measurements_count_(0),
278
- wall_time_query_countdown_(1) {
279
- }
280
-
281
- double ticks_per_ms() {
282
- return result_ / static_cast<double>(kResultScale);
283
- }
284
- void Tick();
285
- void UpdateMeasurements(double current_time);
286
-
287
- // Instead of querying current wall time each tick,
288
- // we use this constant to control query intervals.
289
- static const unsigned kWallTimeQueryIntervalMs = 100;
290
-
291
- private:
292
- // As the result needs to be accessed from a different thread, we
293
- // use type that guarantees atomic writes to memory. There should
294
- // be <= 1000 ticks per second, thus storing a value of a 10 ** 5
295
- // order should provide enough precision while keeping away from a
296
- // potential overflow.
297
- static const int kResultScale = 100000;
298
-
299
- AtomicWord result_;
300
- // All other fields are accessed only from the sampler thread.
301
- double ticks_per_ms_;
302
- unsigned measurements_count_;
303
- unsigned wall_time_query_countdown_;
304
- double last_wall_time_;
305
- };
306
-
307
-
308
- class ProfileGenerator {
309
- public:
310
- explicit ProfileGenerator(CpuProfilesCollection* profiles);
311
-
312
- INLINE(CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag,
313
- String* name,
314
- String* resource_name,
315
- int line_number)) {
316
- return profiles_->NewCodeEntry(tag, name, resource_name, line_number);
317
- }
318
-
319
- INLINE(CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag,
320
- const char* name)) {
321
- return profiles_->NewCodeEntry(tag, name);
322
- }
323
-
324
- INLINE(CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag,
325
- const char* name_prefix,
326
- String* name)) {
327
- return profiles_->NewCodeEntry(tag, name_prefix, name);
328
- }
329
-
330
- INLINE(CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag,
331
- int args_count)) {
332
- return profiles_->NewCodeEntry(tag, args_count);
333
- }
334
-
335
- void RecordTickSample(const TickSample& sample);
336
-
337
- INLINE(CodeMap* code_map()) { return &code_map_; }
338
-
339
- INLINE(void Tick()) { sample_rate_calc_.Tick(); }
340
- INLINE(double actual_sampling_rate()) {
341
- return sample_rate_calc_.ticks_per_ms();
342
- }
343
-
344
- static const char* kAnonymousFunctionName;
345
- static const char* kProgramEntryName;
346
- static const char* kGarbageCollectorEntryName;
347
-
348
- private:
349
- INLINE(CodeEntry* EntryForVMState(StateTag tag));
350
-
351
- CpuProfilesCollection* profiles_;
352
- CodeMap code_map_;
353
- CodeEntry* program_entry_;
354
- CodeEntry* gc_entry_;
355
- SampleRateCalculator sample_rate_calc_;
356
-
357
- DISALLOW_COPY_AND_ASSIGN(ProfileGenerator);
358
- };
359
-
360
- } } // namespace v8::internal
361
-
362
- #endif // ENABLE_LOGGING_AND_PROFILING
363
-
364
- #endif // V8_PROFILE_GENERATOR_H_
@@ -1,1621 +0,0 @@
1
- // Copyright 2010 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #include "v8.h"
29
-
30
- #include "codegen-inl.h"
31
- #include "ic-inl.h"
32
- #include "runtime.h"
33
- #include "stub-cache.h"
34
- #include "utils.h"
35
-
36
- namespace v8 {
37
- namespace internal {
38
-
39
- // ----------------------------------------------------------------------------
40
- // Static IC stub generators.
41
- //
42
-
43
- #define __ ACCESS_MASM(masm)
44
-
45
-
46
- // Helper function used to load a property from a dictionary backing storage.
47
- // This function may return false negatives, so miss_label
48
- // must always call a backup property load that is complete.
49
- // This function is safe to call if the receiver has fast properties,
50
- // or if name is not a symbol, and will jump to the miss_label in that case.
51
- static void GenerateDictionaryLoad(MacroAssembler* masm,
52
- Label* miss_label,
53
- Register r0,
54
- Register r1,
55
- Register r2,
56
- Register name,
57
- DictionaryCheck check_dictionary) {
58
- // Register use:
59
- //
60
- // r0 - used to hold the property dictionary.
61
- //
62
- // r1 - initially the receiver
63
- // - used for the index into the property dictionary
64
- // - holds the result on exit.
65
- //
66
- // r2 - used to hold the capacity of the property dictionary.
67
- //
68
- // name - holds the name of the property and is unchanged.
69
-
70
- Label done;
71
-
72
- // Check for the absence of an interceptor.
73
- // Load the map into r0.
74
- __ movq(r0, FieldOperand(r1, JSObject::kMapOffset));
75
-
76
- // Bail out if the receiver has a named interceptor.
77
- __ testl(FieldOperand(r0, Map::kBitFieldOffset),
78
- Immediate(1 << Map::kHasNamedInterceptor));
79
- __ j(not_zero, miss_label);
80
-
81
- // Bail out if we have a JS global proxy object.
82
- __ movzxbq(r0, FieldOperand(r0, Map::kInstanceTypeOffset));
83
- __ cmpb(r0, Immediate(JS_GLOBAL_PROXY_TYPE));
84
- __ j(equal, miss_label);
85
-
86
- // Possible work-around for http://crbug.com/16276.
87
- __ cmpb(r0, Immediate(JS_GLOBAL_OBJECT_TYPE));
88
- __ j(equal, miss_label);
89
- __ cmpb(r0, Immediate(JS_BUILTINS_OBJECT_TYPE));
90
- __ j(equal, miss_label);
91
-
92
- // Load properties array.
93
- __ movq(r0, FieldOperand(r1, JSObject::kPropertiesOffset));
94
-
95
- if (check_dictionary == CHECK_DICTIONARY) {
96
- // Check that the properties array is a dictionary.
97
- __ Cmp(FieldOperand(r0, HeapObject::kMapOffset), Factory::hash_table_map());
98
- __ j(not_equal, miss_label);
99
- }
100
-
101
- // Compute the capacity mask.
102
- const int kCapacityOffset =
103
- StringDictionary::kHeaderSize +
104
- StringDictionary::kCapacityIndex * kPointerSize;
105
- __ movq(r2, FieldOperand(r0, kCapacityOffset));
106
- __ SmiToInteger32(r2, r2);
107
- __ decl(r2);
108
-
109
- // Generate an unrolled loop that performs a few probes before
110
- // giving up. Measurements done on Gmail indicate that 2 probes
111
- // cover ~93% of loads from dictionaries.
112
- static const int kProbes = 4;
113
- const int kElementsStartOffset =
114
- StringDictionary::kHeaderSize +
115
- StringDictionary::kElementsStartIndex * kPointerSize;
116
- for (int i = 0; i < kProbes; i++) {
117
- // Compute the masked index: (hash + i + i * i) & mask.
118
- __ movl(r1, FieldOperand(name, String::kHashFieldOffset));
119
- __ shrl(r1, Immediate(String::kHashShift));
120
- if (i > 0) {
121
- __ addl(r1, Immediate(StringDictionary::GetProbeOffset(i)));
122
- }
123
- __ and_(r1, r2);
124
-
125
- // Scale the index by multiplying by the entry size.
126
- ASSERT(StringDictionary::kEntrySize == 3);
127
- __ lea(r1, Operand(r1, r1, times_2, 0)); // r1 = r1 * 3
128
-
129
- // Check if the key is identical to the name.
130
- __ cmpq(name, Operand(r0, r1, times_pointer_size,
131
- kElementsStartOffset - kHeapObjectTag));
132
- if (i != kProbes - 1) {
133
- __ j(equal, &done);
134
- } else {
135
- __ j(not_equal, miss_label);
136
- }
137
- }
138
-
139
- // Check that the value is a normal property.
140
- __ bind(&done);
141
- const int kDetailsOffset = kElementsStartOffset + 2 * kPointerSize;
142
- __ Test(Operand(r0, r1, times_pointer_size, kDetailsOffset - kHeapObjectTag),
143
- Smi::FromInt(PropertyDetails::TypeField::mask()));
144
- __ j(not_zero, miss_label);
145
-
146
- // Get the value at the masked, scaled index.
147
- const int kValueOffset = kElementsStartOffset + kPointerSize;
148
- __ movq(r1,
149
- Operand(r0, r1, times_pointer_size, kValueOffset - kHeapObjectTag));
150
- }
151
-
152
-
153
- static void GenerateNumberDictionaryLoad(MacroAssembler* masm,
154
- Label* miss,
155
- Register elements,
156
- Register key,
157
- Register r0,
158
- Register r1,
159
- Register r2) {
160
- // Register use:
161
- //
162
- // elements - holds the slow-case elements of the receiver and is unchanged.
163
- //
164
- // key - holds the smi key on entry and is unchanged if a branch is
165
- // performed to the miss label.
166
- //
167
- // Scratch registers:
168
- //
169
- // r0 - holds the untagged key on entry and holds the hash once computed.
170
- // Holds the result on exit if the load succeeded.
171
- //
172
- // r1 - used to hold the capacity mask of the dictionary
173
- //
174
- // r2 - used for the index into the dictionary.
175
- Label done;
176
-
177
- // Compute the hash code from the untagged key. This must be kept in sync
178
- // with ComputeIntegerHash in utils.h.
179
- //
180
- // hash = ~hash + (hash << 15);
181
- __ movl(r1, r0);
182
- __ notl(r0);
183
- __ shll(r1, Immediate(15));
184
- __ addl(r0, r1);
185
- // hash = hash ^ (hash >> 12);
186
- __ movl(r1, r0);
187
- __ shrl(r1, Immediate(12));
188
- __ xorl(r0, r1);
189
- // hash = hash + (hash << 2);
190
- __ leal(r0, Operand(r0, r0, times_4, 0));
191
- // hash = hash ^ (hash >> 4);
192
- __ movl(r1, r0);
193
- __ shrl(r1, Immediate(4));
194
- __ xorl(r0, r1);
195
- // hash = hash * 2057;
196
- __ imull(r0, r0, Immediate(2057));
197
- // hash = hash ^ (hash >> 16);
198
- __ movl(r1, r0);
199
- __ shrl(r1, Immediate(16));
200
- __ xorl(r0, r1);
201
-
202
- // Compute capacity mask.
203
- __ movq(r1, FieldOperand(elements, NumberDictionary::kCapacityOffset));
204
- __ SmiToInteger32(r1, r1);
205
- __ decl(r1);
206
-
207
- // Generate an unrolled loop that performs a few probes before giving up.
208
- const int kProbes = 4;
209
- for (int i = 0; i < kProbes; i++) {
210
- // Use r2 for index calculations and keep the hash intact in r0.
211
- __ movq(r2, r0);
212
- // Compute the masked index: (hash + i + i * i) & mask.
213
- if (i > 0) {
214
- __ addl(r2, Immediate(NumberDictionary::GetProbeOffset(i)));
215
- }
216
- __ and_(r2, r1);
217
-
218
- // Scale the index by multiplying by the entry size.
219
- ASSERT(NumberDictionary::kEntrySize == 3);
220
- __ lea(r2, Operand(r2, r2, times_2, 0)); // r2 = r2 * 3
221
-
222
- // Check if the key matches.
223
- __ cmpq(key, FieldOperand(elements,
224
- r2,
225
- times_pointer_size,
226
- NumberDictionary::kElementsStartOffset));
227
- if (i != (kProbes - 1)) {
228
- __ j(equal, &done);
229
- } else {
230
- __ j(not_equal, miss);
231
- }
232
- }
233
-
234
- __ bind(&done);
235
- // Check that the value is a normal propety.
236
- const int kDetailsOffset =
237
- NumberDictionary::kElementsStartOffset + 2 * kPointerSize;
238
- ASSERT_EQ(NORMAL, 0);
239
- __ Test(FieldOperand(elements, r2, times_pointer_size, kDetailsOffset),
240
- Smi::FromInt(PropertyDetails::TypeField::mask()));
241
- __ j(not_zero, miss);
242
-
243
- // Get the value at the masked, scaled index.
244
- const int kValueOffset =
245
- NumberDictionary::kElementsStartOffset + kPointerSize;
246
- __ movq(r0, FieldOperand(elements, r2, times_pointer_size, kValueOffset));
247
- }
248
-
249
-
250
- // One byte opcode for test eax,0xXXXXXXXX.
251
- static const byte kTestEaxByte = 0xA9;
252
-
253
-
254
- static bool PatchInlinedMapCheck(Address address, Object* map) {
255
- // Arguments are address of start of call sequence that called
256
- // the IC,
257
- Address test_instruction_address =
258
- address + Assembler::kCallTargetAddressOffset;
259
- // The keyed load has a fast inlined case if the IC call instruction
260
- // is immediately followed by a test instruction.
261
- if (*test_instruction_address != kTestEaxByte) return false;
262
-
263
- // Fetch the offset from the test instruction to the map compare
264
- // instructions (starting with the 64-bit immediate mov of the map
265
- // address). This offset is stored in the last 4 bytes of the 5
266
- // byte test instruction.
267
- Address delta_address = test_instruction_address + 1;
268
- int delta = *reinterpret_cast<int*>(delta_address);
269
- // Compute the map address. The map address is in the last 8 bytes
270
- // of the 10-byte immediate mov instruction (incl. REX prefix), so we add 2
271
- // to the offset to get the map address.
272
- Address map_address = test_instruction_address + delta + 2;
273
- // Patch the map check.
274
- *(reinterpret_cast<Object**>(map_address)) = map;
275
- return true;
276
- }
277
-
278
-
279
- bool KeyedLoadIC::PatchInlinedLoad(Address address, Object* map) {
280
- return PatchInlinedMapCheck(address, map);
281
- }
282
-
283
-
284
- bool KeyedStoreIC::PatchInlinedStore(Address address, Object* map) {
285
- return PatchInlinedMapCheck(address, map);
286
- }
287
-
288
-
289
- void KeyedLoadIC::ClearInlinedVersion(Address address) {
290
- // Insert null as the map to check for to make sure the map check fails
291
- // sending control flow to the IC instead of the inlined version.
292
- PatchInlinedLoad(address, Heap::null_value());
293
- }
294
-
295
-
296
- void KeyedStoreIC::ClearInlinedVersion(Address address) {
297
- // Insert null as the elements map to check for. This will make
298
- // sure that the elements fast-case map check fails so that control
299
- // flows to the IC instead of the inlined version.
300
- PatchInlinedStore(address, Heap::null_value());
301
- }
302
-
303
-
304
- void KeyedStoreIC::RestoreInlinedVersion(Address address) {
305
- // Restore the fast-case elements map check so that the inlined
306
- // version can be used again.
307
- PatchInlinedStore(address, Heap::fixed_array_map());
308
- }
309
-
310
-
311
- void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
312
- // ----------- S t a t e -------------
313
- // -- rsp[0] : return address
314
- // -- rsp[8] : name
315
- // -- rsp[16] : receiver
316
- // -----------------------------------
317
-
318
- __ pop(rbx);
319
- __ push(Operand(rsp, 1 * kPointerSize)); // receiver
320
- __ push(Operand(rsp, 1 * kPointerSize)); // name
321
- __ push(rbx); // return address
322
-
323
- // Perform tail call to the entry.
324
- ExternalReference ref = ExternalReference(IC_Utility(kKeyedLoadIC_Miss));
325
- __ TailCallExternalReference(ref, 2, 1);
326
- }
327
-
328
-
329
- void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
330
- // ----------- S t a t e -------------
331
- // -- rsp[0] : return address
332
- // -- rsp[8] : name
333
- // -- rsp[16] : receiver
334
- // -----------------------------------
335
-
336
- __ pop(rbx);
337
- __ push(Operand(rsp, 1 * kPointerSize)); // receiver
338
- __ push(Operand(rsp, 1 * kPointerSize)); // name
339
- __ push(rbx); // return address
340
-
341
- // Perform tail call to the entry.
342
- __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1);
343
- }
344
-
345
-
346
- void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) {
347
- // ----------- S t a t e -------------
348
- // -- rsp[0] : return address
349
- // -- rsp[8] : name
350
- // -- rsp[16] : receiver
351
- // -----------------------------------
352
- Label slow, check_string, index_int, index_string;
353
- Label check_pixel_array, probe_dictionary;
354
- Label check_number_dictionary;
355
-
356
- // Load name and receiver.
357
- __ movq(rax, Operand(rsp, kPointerSize));
358
- __ movq(rcx, Operand(rsp, 2 * kPointerSize));
359
-
360
- // Check that the object isn't a smi.
361
- __ JumpIfSmi(rcx, &slow);
362
-
363
- // Check that the object is some kind of JS object EXCEPT JS Value type.
364
- // In the case that the object is a value-wrapper object,
365
- // we enter the runtime system to make sure that indexing
366
- // into string objects work as intended.
367
- ASSERT(JS_OBJECT_TYPE > JS_VALUE_TYPE);
368
- __ CmpObjectType(rcx, JS_OBJECT_TYPE, rdx);
369
- __ j(below, &slow);
370
-
371
- // Check bit field.
372
- __ testb(FieldOperand(rdx, Map::kBitFieldOffset),
373
- Immediate(kSlowCaseBitFieldMask));
374
- __ j(not_zero, &slow);
375
-
376
- // Check that the key is a smi.
377
- __ JumpIfNotSmi(rax, &check_string);
378
- // Save key in rbx in case we want it for the number dictionary
379
- // case.
380
- __ movq(rbx, rax);
381
- __ SmiToInteger32(rax, rax);
382
- // Get the elements array of the object.
383
- __ bind(&index_int);
384
- __ movq(rcx, FieldOperand(rcx, JSObject::kElementsOffset));
385
- // Check that the object is in fast mode (not dictionary).
386
- __ CompareRoot(FieldOperand(rcx, HeapObject::kMapOffset),
387
- Heap::kFixedArrayMapRootIndex);
388
- __ j(not_equal, &check_pixel_array);
389
- // Check that the key (index) is within bounds.
390
- __ cmpl(rax, FieldOperand(rcx, FixedArray::kLengthOffset));
391
- __ j(above_equal, &slow); // Unsigned comparison rejects negative indices.
392
- // Fast case: Do the load.
393
- __ movq(rax, Operand(rcx, rax, times_pointer_size,
394
- FixedArray::kHeaderSize - kHeapObjectTag));
395
- __ CompareRoot(rax, Heap::kTheHoleValueRootIndex);
396
- // In case the loaded value is the_hole we have to consult GetProperty
397
- // to ensure the prototype chain is searched.
398
- __ j(equal, &slow);
399
- __ IncrementCounter(&Counters::keyed_load_generic_smi, 1);
400
- __ ret(0);
401
-
402
- // Check whether the elements is a pixel array.
403
- // rax: untagged index
404
- // rcx: elements array
405
- __ bind(&check_pixel_array);
406
- __ CompareRoot(FieldOperand(rcx, HeapObject::kMapOffset),
407
- Heap::kPixelArrayMapRootIndex);
408
- __ j(not_equal, &check_number_dictionary);
409
- __ cmpl(rax, FieldOperand(rcx, PixelArray::kLengthOffset));
410
- __ j(above_equal, &slow);
411
- __ movq(rcx, FieldOperand(rcx, PixelArray::kExternalPointerOffset));
412
- __ movzxbq(rax, Operand(rcx, rax, times_1, 0));
413
- __ Integer32ToSmi(rax, rax);
414
- __ ret(0);
415
-
416
- __ bind(&check_number_dictionary);
417
- // Check whether the elements is a number dictionary.
418
- // rax: untagged index
419
- // rbx: key
420
- // rcx: elements
421
- __ CompareRoot(FieldOperand(rcx, HeapObject::kMapOffset),
422
- Heap::kHashTableMapRootIndex);
423
- __ j(not_equal, &slow);
424
- GenerateNumberDictionaryLoad(masm, &slow, rcx, rbx, rax, rdx, rdi);
425
- __ ret(0);
426
-
427
- // Slow case: Load name and receiver from stack and jump to runtime.
428
- __ bind(&slow);
429
- __ IncrementCounter(&Counters::keyed_load_generic_slow, 1);
430
- GenerateRuntimeGetProperty(masm);
431
- __ bind(&check_string);
432
- // The key is not a smi.
433
- // Is it a string?
434
- __ CmpObjectType(rax, FIRST_NONSTRING_TYPE, rdx);
435
- __ j(above_equal, &slow);
436
- // Is the string an array index, with cached numeric value?
437
- __ movl(rbx, FieldOperand(rax, String::kHashFieldOffset));
438
- __ testl(rbx, Immediate(String::kIsArrayIndexMask));
439
-
440
- // Is the string a symbol?
441
- __ j(not_zero, &index_string); // The value in rbx is used at jump target.
442
- ASSERT(kSymbolTag != 0);
443
- __ testb(FieldOperand(rdx, Map::kInstanceTypeOffset),
444
- Immediate(kIsSymbolMask));
445
- __ j(zero, &slow);
446
-
447
- // If the receiver is a fast-case object, check the keyed lookup
448
- // cache. Otherwise probe the dictionary leaving result in rcx.
449
- __ movq(rbx, FieldOperand(rcx, JSObject::kPropertiesOffset));
450
- __ Cmp(FieldOperand(rbx, HeapObject::kMapOffset), Factory::hash_table_map());
451
- __ j(equal, &probe_dictionary);
452
-
453
- // Load the map of the receiver, compute the keyed lookup cache hash
454
- // based on 32 bits of the map pointer and the string hash.
455
- __ movq(rbx, FieldOperand(rcx, HeapObject::kMapOffset));
456
- __ movl(rdx, rbx);
457
- __ shr(rdx, Immediate(KeyedLookupCache::kMapHashShift));
458
- __ movl(rax, FieldOperand(rax, String::kHashFieldOffset));
459
- __ shr(rax, Immediate(String::kHashShift));
460
- __ xor_(rdx, rax);
461
- __ and_(rdx, Immediate(KeyedLookupCache::kCapacityMask));
462
-
463
- // Load the key (consisting of map and symbol) from the cache and
464
- // check for match.
465
- ExternalReference cache_keys
466
- = ExternalReference::keyed_lookup_cache_keys();
467
- __ movq(rdi, rdx);
468
- __ shl(rdi, Immediate(kPointerSizeLog2 + 1));
469
- __ movq(kScratchRegister, cache_keys);
470
- __ cmpq(rbx, Operand(kScratchRegister, rdi, times_1, 0));
471
- __ j(not_equal, &slow);
472
- __ movq(rdi, Operand(kScratchRegister, rdi, times_1, kPointerSize));
473
- __ cmpq(Operand(rsp, kPointerSize), rdi);
474
- __ j(not_equal, &slow);
475
-
476
- // Get field offset which is a 32-bit integer and check that it is
477
- // an in-object property.
478
- ExternalReference cache_field_offsets
479
- = ExternalReference::keyed_lookup_cache_field_offsets();
480
- __ movq(kScratchRegister, cache_field_offsets);
481
- __ movl(rax, Operand(kScratchRegister, rdx, times_4, 0));
482
- __ movzxbq(rdx, FieldOperand(rbx, Map::kInObjectPropertiesOffset));
483
- __ cmpq(rax, rdx);
484
- __ j(above_equal, &slow);
485
-
486
- // Load in-object property.
487
- __ subq(rax, rdx);
488
- __ movzxbq(rdx, FieldOperand(rbx, Map::kInstanceSizeOffset));
489
- __ addq(rax, rdx);
490
- __ movq(rax, FieldOperand(rcx, rax, times_pointer_size, 0));
491
- __ ret(0);
492
-
493
- // Do a quick inline probe of the receiver's dictionary, if it
494
- // exists.
495
- __ bind(&probe_dictionary);
496
- GenerateDictionaryLoad(masm,
497
- &slow,
498
- rbx,
499
- rcx,
500
- rdx,
501
- rax,
502
- DICTIONARY_CHECK_DONE);
503
- __ movq(rax, rcx);
504
- __ IncrementCounter(&Counters::keyed_load_generic_symbol, 1);
505
- __ ret(0);
506
- // If the hash field contains an array index pick it out. The assert checks
507
- // that the constants for the maximum number of digits for an array index
508
- // cached in the hash field and the number of bits reserved for it does not
509
- // conflict.
510
- ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) <
511
- (1 << String::kArrayIndexValueBits));
512
- __ bind(&index_string);
513
- __ movl(rax, rbx);
514
- __ and_(rax, Immediate(String::kArrayIndexHashMask));
515
- __ shrl(rax, Immediate(String::kHashShift));
516
- __ jmp(&index_int);
517
- }
518
-
519
-
520
- void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
521
- // ----------- S t a t e -------------
522
- // -- rsp[0] : return address
523
- // -- rsp[8] : name
524
- // -- rsp[16] : receiver
525
- // -----------------------------------
526
- Label miss;
527
- Label index_not_smi;
528
- Label index_out_of_range;
529
- Label slow_char_code;
530
- Label got_char_code;
531
-
532
- Register receiver = rdx;
533
- Register index = rax;
534
- Register code = rbx;
535
- Register scratch = rcx;
536
-
537
- __ movq(index, Operand(rsp, 1 * kPointerSize));
538
- __ movq(receiver, Operand(rsp, 2 * kPointerSize));
539
-
540
- StringHelper::GenerateFastCharCodeAt(masm,
541
- receiver,
542
- index,
543
- scratch,
544
- code,
545
- &miss, // When not a string.
546
- &index_not_smi,
547
- &index_out_of_range,
548
- &slow_char_code);
549
- // If we didn't bail out, code register contains smi tagged char
550
- // code.
551
- __ bind(&got_char_code);
552
- StringHelper::GenerateCharFromCode(masm, code, rax, scratch, JUMP_FUNCTION);
553
- #ifdef DEBUG
554
- __ Abort("Unexpected fall-through from char from code tail call");
555
- #endif
556
-
557
- // Check if key is a heap number.
558
- __ bind(&index_not_smi);
559
- __ CompareRoot(FieldOperand(index, HeapObject::kMapOffset),
560
- Heap::kHeapNumberMapRootIndex);
561
- __ j(not_equal, &miss);
562
-
563
- // Push receiver and key on the stack (now that we know they are a
564
- // string and a number), and call runtime.
565
- __ bind(&slow_char_code);
566
- __ EnterInternalFrame();
567
- __ push(receiver);
568
- __ push(index);
569
- __ CallRuntime(Runtime::kStringCharCodeAt, 2);
570
- ASSERT(!code.is(rax));
571
- __ movq(code, rax);
572
- __ LeaveInternalFrame();
573
-
574
- // Check if the runtime call returned NaN char code. If yes, return
575
- // undefined. Otherwise, we can continue.
576
- if (FLAG_debug_code) {
577
- ASSERT(kSmiTag == 0);
578
- __ JumpIfSmi(code, &got_char_code);
579
- __ CompareRoot(FieldOperand(code, HeapObject::kMapOffset),
580
- Heap::kHeapNumberMapRootIndex);
581
- __ Assert(equal, "StringCharCodeAt must return smi or heap number");
582
- }
583
- __ CompareRoot(code, Heap::kNanValueRootIndex);
584
- __ j(not_equal, &got_char_code);
585
-
586
- __ bind(&index_out_of_range);
587
- __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
588
- __ ret(0);
589
-
590
- __ bind(&miss);
591
- GenerateMiss(masm);
592
- }
593
-
594
-
595
- void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm,
596
- ExternalArrayType array_type) {
597
- // ----------- S t a t e -------------
598
- // -- rsp[0] : return address
599
- // -- rsp[8] : name
600
- // -- rsp[16] : receiver
601
- // -----------------------------------
602
- Label slow, failed_allocation;
603
-
604
- // Load name and receiver.
605
- __ movq(rax, Operand(rsp, kPointerSize));
606
- __ movq(rcx, Operand(rsp, 2 * kPointerSize));
607
-
608
- // Check that the object isn't a smi.
609
- __ JumpIfSmi(rcx, &slow);
610
-
611
- // Check that the key is a smi.
612
- __ JumpIfNotSmi(rax, &slow);
613
-
614
- // Check that the object is a JS object.
615
- __ CmpObjectType(rcx, JS_OBJECT_TYPE, rdx);
616
- __ j(not_equal, &slow);
617
- // Check that the receiver does not require access checks. We need
618
- // to check this explicitly since this generic stub does not perform
619
- // map checks. The map is already in rdx.
620
- __ testb(FieldOperand(rdx, Map::kBitFieldOffset),
621
- Immediate(1 << Map::kIsAccessCheckNeeded));
622
- __ j(not_zero, &slow);
623
-
624
- // Check that the elements array is the appropriate type of
625
- // ExternalArray.
626
- // rax: index (as a smi)
627
- // rcx: JSObject
628
- __ movq(rcx, FieldOperand(rcx, JSObject::kElementsOffset));
629
- __ CompareRoot(FieldOperand(rcx, HeapObject::kMapOffset),
630
- Heap::RootIndexForExternalArrayType(array_type));
631
- __ j(not_equal, &slow);
632
-
633
- // Check that the index is in range.
634
- __ SmiToInteger32(rax, rax);
635
- __ cmpl(rax, FieldOperand(rcx, ExternalArray::kLengthOffset));
636
- // Unsigned comparison catches both negative and too-large values.
637
- __ j(above_equal, &slow);
638
-
639
- // rax: untagged index
640
- // rcx: elements array
641
- __ movq(rcx, FieldOperand(rcx, ExternalArray::kExternalPointerOffset));
642
- // rcx: base pointer of external storage
643
- switch (array_type) {
644
- case kExternalByteArray:
645
- __ movsxbq(rax, Operand(rcx, rax, times_1, 0));
646
- break;
647
- case kExternalUnsignedByteArray:
648
- __ movzxbq(rax, Operand(rcx, rax, times_1, 0));
649
- break;
650
- case kExternalShortArray:
651
- __ movsxwq(rax, Operand(rcx, rax, times_2, 0));
652
- break;
653
- case kExternalUnsignedShortArray:
654
- __ movzxwq(rax, Operand(rcx, rax, times_2, 0));
655
- break;
656
- case kExternalIntArray:
657
- __ movsxlq(rax, Operand(rcx, rax, times_4, 0));
658
- break;
659
- case kExternalUnsignedIntArray:
660
- __ movl(rax, Operand(rcx, rax, times_4, 0));
661
- break;
662
- case kExternalFloatArray:
663
- __ fld_s(Operand(rcx, rax, times_4, 0));
664
- break;
665
- default:
666
- UNREACHABLE();
667
- break;
668
- }
669
-
670
- // For integer array types:
671
- // rax: value
672
- // For floating-point array type:
673
- // FP(0): value
674
-
675
- if (array_type == kExternalIntArray ||
676
- array_type == kExternalUnsignedIntArray) {
677
- // For the Int and UnsignedInt array types, we need to see whether
678
- // the value can be represented in a Smi. If not, we need to convert
679
- // it to a HeapNumber.
680
- Label box_int;
681
- if (array_type == kExternalIntArray) {
682
- __ JumpIfNotValidSmiValue(rax, &box_int);
683
- } else {
684
- ASSERT_EQ(array_type, kExternalUnsignedIntArray);
685
- __ JumpIfUIntNotValidSmiValue(rax, &box_int);
686
- }
687
-
688
- __ Integer32ToSmi(rax, rax);
689
- __ ret(0);
690
-
691
- __ bind(&box_int);
692
-
693
- // Allocate a HeapNumber for the int and perform int-to-double
694
- // conversion.
695
- __ push(rax);
696
- if (array_type == kExternalIntArray) {
697
- __ fild_s(Operand(rsp, 0));
698
- } else {
699
- ASSERT(array_type == kExternalUnsignedIntArray);
700
- // Need to zero-extend the value.
701
- __ fild_d(Operand(rsp, 0));
702
- }
703
- __ pop(rax);
704
- // FP(0): value
705
- __ AllocateHeapNumber(rax, rbx, &failed_allocation);
706
- // Set the value.
707
- __ fstp_d(FieldOperand(rax, HeapNumber::kValueOffset));
708
- __ ret(0);
709
- } else if (array_type == kExternalFloatArray) {
710
- // For the floating-point array type, we need to always allocate a
711
- // HeapNumber.
712
- __ AllocateHeapNumber(rax, rbx, &failed_allocation);
713
- // Set the value.
714
- __ fstp_d(FieldOperand(rax, HeapNumber::kValueOffset));
715
- __ ret(0);
716
- } else {
717
- __ Integer32ToSmi(rax, rax);
718
- __ ret(0);
719
- }
720
-
721
- // If we fail allocation of the HeapNumber, we still have a value on
722
- // top of the FPU stack. Remove it.
723
- __ bind(&failed_allocation);
724
- __ ffree();
725
- __ fincstp();
726
- // Fall through to slow case.
727
-
728
- // Slow case: Load name and receiver from stack and jump to runtime.
729
- __ bind(&slow);
730
- __ IncrementCounter(&Counters::keyed_load_external_array_slow, 1);
731
- GenerateRuntimeGetProperty(masm);
732
- }
733
-
734
-
735
- void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
736
- // ----------- S t a t e -------------
737
- // -- rsp[0] : return address
738
- // -- rsp[8] : key
739
- // -- rsp[16] : receiver
740
- // -----------------------------------
741
- Label slow;
742
-
743
- // Load key and receiver.
744
- __ movq(rax, Operand(rsp, kPointerSize));
745
- __ movq(rcx, Operand(rsp, 2 * kPointerSize));
746
-
747
- // Check that the receiver isn't a smi.
748
- __ JumpIfSmi(rcx, &slow);
749
-
750
- // Check that the key is a smi.
751
- __ JumpIfNotSmi(rax, &slow);
752
-
753
- // Get the map of the receiver.
754
- __ movq(rdx, FieldOperand(rcx, HeapObject::kMapOffset));
755
-
756
- // Check that it has indexed interceptor and access checks
757
- // are not enabled for this object.
758
- __ movb(rdx, FieldOperand(rdx, Map::kBitFieldOffset));
759
- __ andb(rdx, Immediate(kSlowCaseBitFieldMask));
760
- __ cmpb(rdx, Immediate(1 << Map::kHasIndexedInterceptor));
761
- __ j(not_zero, &slow);
762
-
763
- // Everything is fine, call runtime.
764
- __ pop(rdx);
765
- __ push(rcx); // receiver
766
- __ push(rax); // key
767
- __ push(rdx); // return address
768
-
769
- // Perform tail call to the entry.
770
- __ TailCallExternalReference(ExternalReference(
771
- IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1);
772
-
773
- __ bind(&slow);
774
- GenerateMiss(masm);
775
- }
776
-
777
-
778
- void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
779
- // ----------- S t a t e -------------
780
- // -- rax : value
781
- // -- rsp[0] : return address
782
- // -- rsp[8] : key
783
- // -- rsp[16] : receiver
784
- // -----------------------------------
785
-
786
- __ pop(rcx);
787
- __ push(Operand(rsp, 1 * kPointerSize)); // receiver
788
- __ push(Operand(rsp, 1 * kPointerSize)); // key
789
- __ push(rax); // value
790
- __ push(rcx); // return address
791
-
792
- // Do tail-call to runtime routine.
793
- ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss));
794
- __ TailCallExternalReference(ref, 3, 1);
795
- }
796
-
797
-
798
- void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) {
799
- // ----------- S t a t e -------------
800
- // -- rax : value
801
- // -- rsp[0] : return address
802
- // -- rsp[8] : key
803
- // -- rsp[16] : receiver
804
- // -----------------------------------
805
-
806
- __ pop(rcx);
807
- __ push(Operand(rsp, 1 * kPointerSize)); // receiver
808
- __ push(Operand(rsp, 1 * kPointerSize)); // key
809
- __ push(rax); // value
810
- __ push(rcx); // return address
811
-
812
- // Do tail-call to runtime routine.
813
- __ TailCallRuntime(Runtime::kSetProperty, 3, 1);
814
- }
815
-
816
-
817
- void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
818
- // ----------- S t a t e -------------
819
- // -- rax : value
820
- // -- rsp[0] : return address
821
- // -- rsp[8] : key
822
- // -- rsp[16] : receiver
823
- // -----------------------------------
824
- Label slow, fast, array, extra, check_pixel_array;
825
-
826
- // Get the receiver from the stack.
827
- __ movq(rdx, Operand(rsp, 2 * kPointerSize)); // 2 ~ return address, key
828
- // Check that the object isn't a smi.
829
- __ JumpIfSmi(rdx, &slow);
830
- // Get the map from the receiver.
831
- __ movq(rcx, FieldOperand(rdx, HeapObject::kMapOffset));
832
- // Check that the receiver does not require access checks. We need
833
- // to do this because this generic stub does not perform map checks.
834
- __ testb(FieldOperand(rcx, Map::kBitFieldOffset),
835
- Immediate(1 << Map::kIsAccessCheckNeeded));
836
- __ j(not_zero, &slow);
837
- // Get the key from the stack.
838
- __ movq(rbx, Operand(rsp, 1 * kPointerSize)); // 1 ~ return address
839
- // Check that the key is a smi.
840
- __ JumpIfNotSmi(rbx, &slow);
841
-
842
- __ CmpInstanceType(rcx, JS_ARRAY_TYPE);
843
- __ j(equal, &array);
844
- // Check that the object is some kind of JS object.
845
- __ CmpInstanceType(rcx, FIRST_JS_OBJECT_TYPE);
846
- __ j(below, &slow);
847
-
848
- // Object case: Check key against length in the elements array.
849
- // rax: value
850
- // rdx: JSObject
851
- // rbx: index (as a smi)
852
- __ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
853
- // Check that the object is in fast mode (not dictionary).
854
- __ CompareRoot(FieldOperand(rcx, HeapObject::kMapOffset),
855
- Heap::kFixedArrayMapRootIndex);
856
- __ j(not_equal, &check_pixel_array);
857
- // Untag the key (for checking against untagged length in the fixed array).
858
- __ SmiToInteger32(rdx, rbx);
859
- __ cmpl(rdx, FieldOperand(rcx, Array::kLengthOffset));
860
- // rax: value
861
- // rcx: FixedArray
862
- // rbx: index (as a smi)
863
- __ j(below, &fast);
864
-
865
- // Slow case: call runtime.
866
- __ bind(&slow);
867
- GenerateRuntimeSetProperty(masm);
868
-
869
- // Check whether the elements is a pixel array.
870
- // rax: value
871
- // rcx: elements array
872
- // rbx: index (as a smi), zero-extended.
873
- __ bind(&check_pixel_array);
874
- __ CompareRoot(FieldOperand(rcx, HeapObject::kMapOffset),
875
- Heap::kPixelArrayMapRootIndex);
876
- __ j(not_equal, &slow);
877
- // Check that the value is a smi. If a conversion is needed call into the
878
- // runtime to convert and clamp.
879
- __ JumpIfNotSmi(rax, &slow);
880
- __ SmiToInteger32(rbx, rbx);
881
- __ cmpl(rbx, FieldOperand(rcx, PixelArray::kLengthOffset));
882
- __ j(above_equal, &slow);
883
- __ movq(rdx, rax); // Save the value.
884
- __ SmiToInteger32(rax, rax);
885
- { // Clamp the value to [0..255].
886
- Label done;
887
- __ testl(rax, Immediate(0xFFFFFF00));
888
- __ j(zero, &done);
889
- __ setcc(negative, rax); // 1 if negative, 0 if positive.
890
- __ decb(rax); // 0 if negative, 255 if positive.
891
- __ bind(&done);
892
- }
893
- __ movq(rcx, FieldOperand(rcx, PixelArray::kExternalPointerOffset));
894
- __ movb(Operand(rcx, rbx, times_1, 0), rax);
895
- __ movq(rax, rdx); // Return the original value.
896
- __ ret(0);
897
-
898
- // Extra capacity case: Check if there is extra capacity to
899
- // perform the store and update the length. Used for adding one
900
- // element to the array by writing to array[array.length].
901
- __ bind(&extra);
902
- // rax: value
903
- // rdx: JSArray
904
- // rcx: FixedArray
905
- // rbx: index (as a smi)
906
- // flags: smicompare (rdx.length(), rbx)
907
- __ j(not_equal, &slow); // do not leave holes in the array
908
- __ SmiToInteger64(rbx, rbx);
909
- __ cmpl(rbx, FieldOperand(rcx, FixedArray::kLengthOffset));
910
- __ j(above_equal, &slow);
911
- // Increment and restore smi-tag.
912
- __ Integer64PlusConstantToSmi(rbx, rbx, 1);
913
- __ movq(FieldOperand(rdx, JSArray::kLengthOffset), rbx);
914
- __ SmiSubConstant(rbx, rbx, Smi::FromInt(1));
915
- __ jmp(&fast);
916
-
917
- // Array case: Get the length and the elements array from the JS
918
- // array. Check that the array is in fast mode; if it is the
919
- // length is always a smi.
920
- __ bind(&array);
921
- // rax: value
922
- // rdx: JSArray
923
- // rbx: index (as a smi)
924
- __ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
925
- __ CompareRoot(FieldOperand(rcx, HeapObject::kMapOffset),
926
- Heap::kFixedArrayMapRootIndex);
927
- __ j(not_equal, &slow);
928
-
929
- // Check the key against the length in the array, compute the
930
- // address to store into and fall through to fast case.
931
- __ SmiCompare(FieldOperand(rdx, JSArray::kLengthOffset), rbx);
932
- __ j(below_equal, &extra);
933
-
934
- // Fast case: Do the store.
935
- __ bind(&fast);
936
- // rax: value
937
- // rcx: FixedArray
938
- // rbx: index (as a smi)
939
- Label non_smi_value;
940
- __ JumpIfNotSmi(rax, &non_smi_value);
941
- SmiIndex index = masm->SmiToIndex(rbx, rbx, kPointerSizeLog2);
942
- __ movq(Operand(rcx, index.reg, index.scale,
943
- FixedArray::kHeaderSize - kHeapObjectTag),
944
- rax);
945
- __ ret(0);
946
- __ bind(&non_smi_value);
947
- // Slow case that needs to retain rbx for use by RecordWrite.
948
- // Update write barrier for the elements array address.
949
- SmiIndex index2 = masm->SmiToIndex(kScratchRegister, rbx, kPointerSizeLog2);
950
- __ movq(Operand(rcx, index2.reg, index2.scale,
951
- FixedArray::kHeaderSize - kHeapObjectTag),
952
- rax);
953
- __ movq(rdx, rax);
954
- __ RecordWriteNonSmi(rcx, 0, rdx, rbx);
955
- __ ret(0);
956
- }
957
-
958
-
959
- void KeyedStoreIC::GenerateExternalArray(MacroAssembler* masm,
960
- ExternalArrayType array_type) {
961
- // ----------- S t a t e -------------
962
- // -- rax : value
963
- // -- rsp[0] : return address
964
- // -- rsp[8] : key
965
- // -- rsp[16] : receiver
966
- // -----------------------------------
967
- Label slow, check_heap_number;
968
-
969
- // Get the receiver from the stack.
970
- __ movq(rdx, Operand(rsp, 2 * kPointerSize));
971
- // Check that the object isn't a smi.
972
- __ JumpIfSmi(rdx, &slow);
973
- // Get the map from the receiver.
974
- __ movq(rcx, FieldOperand(rdx, HeapObject::kMapOffset));
975
- // Check that the receiver does not require access checks. We need
976
- // to do this because this generic stub does not perform map checks.
977
- __ testb(FieldOperand(rcx, Map::kBitFieldOffset),
978
- Immediate(1 << Map::kIsAccessCheckNeeded));
979
- __ j(not_zero, &slow);
980
- // Get the key from the stack.
981
- __ movq(rbx, Operand(rsp, 1 * kPointerSize)); // 1 ~ return address
982
- // Check that the key is a smi.
983
- __ JumpIfNotSmi(rbx, &slow);
984
-
985
- // Check that the object is a JS object.
986
- __ CmpInstanceType(rcx, JS_OBJECT_TYPE);
987
- __ j(not_equal, &slow);
988
-
989
- // Check that the elements array is the appropriate type of
990
- // ExternalArray.
991
- // rax: value
992
- // rdx: JSObject
993
- // rbx: index (as a smi)
994
- __ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
995
- __ CompareRoot(FieldOperand(rcx, HeapObject::kMapOffset),
996
- Heap::RootIndexForExternalArrayType(array_type));
997
- __ j(not_equal, &slow);
998
-
999
- // Check that the index is in range.
1000
- __ SmiToInteger32(rbx, rbx); // Untag the index.
1001
- __ cmpl(rbx, FieldOperand(rcx, ExternalArray::kLengthOffset));
1002
- // Unsigned comparison catches both negative and too-large values.
1003
- __ j(above_equal, &slow);
1004
-
1005
- // Handle both smis and HeapNumbers in the fast path. Go to the
1006
- // runtime for all other kinds of values.
1007
- // rax: value
1008
- // rcx: elements array
1009
- // rbx: untagged index
1010
- __ JumpIfNotSmi(rax, &check_heap_number);
1011
- __ movq(rdx, rax); // Save the value.
1012
- __ SmiToInteger32(rax, rax);
1013
- __ movq(rcx, FieldOperand(rcx, ExternalArray::kExternalPointerOffset));
1014
- // rcx: base pointer of external storage
1015
- switch (array_type) {
1016
- case kExternalByteArray:
1017
- case kExternalUnsignedByteArray:
1018
- __ movb(Operand(rcx, rbx, times_1, 0), rax);
1019
- break;
1020
- case kExternalShortArray:
1021
- case kExternalUnsignedShortArray:
1022
- __ movw(Operand(rcx, rbx, times_2, 0), rax);
1023
- break;
1024
- case kExternalIntArray:
1025
- case kExternalUnsignedIntArray:
1026
- __ movl(Operand(rcx, rbx, times_4, 0), rax);
1027
- break;
1028
- case kExternalFloatArray:
1029
- // Need to perform int-to-float conversion.
1030
- __ push(rax);
1031
- __ fild_s(Operand(rsp, 0));
1032
- __ pop(rax);
1033
- __ fstp_s(Operand(rcx, rbx, times_4, 0));
1034
- break;
1035
- default:
1036
- UNREACHABLE();
1037
- break;
1038
- }
1039
- __ movq(rax, rdx); // Return the original value.
1040
- __ ret(0);
1041
-
1042
- __ bind(&check_heap_number);
1043
- __ CmpObjectType(rax, HEAP_NUMBER_TYPE, rdx);
1044
- __ j(not_equal, &slow);
1045
-
1046
- // The WebGL specification leaves the behavior of storing NaN and
1047
- // +/-Infinity into integer arrays basically undefined. For more
1048
- // reproducible behavior, convert these to zero.
1049
- __ fld_d(FieldOperand(rax, HeapNumber::kValueOffset));
1050
- __ movq(rdx, rax); // Save the value.
1051
- __ movq(rcx, FieldOperand(rcx, ExternalArray::kExternalPointerOffset));
1052
- // rbx: untagged index
1053
- // rcx: base pointer of external storage
1054
- // top of FPU stack: value
1055
- if (array_type == kExternalFloatArray) {
1056
- __ fstp_s(Operand(rcx, rbx, times_4, 0));
1057
- __ movq(rax, rdx); // Return the original value.
1058
- __ ret(0);
1059
- } else {
1060
- // Need to perform float-to-int conversion.
1061
- // Test the top of the FP stack for NaN.
1062
- Label is_nan;
1063
- __ fucomi(0);
1064
- __ j(parity_even, &is_nan);
1065
-
1066
- __ push(rax); // Make room on stack
1067
- __ fistp_d(Operand(rsp, 0));
1068
- __ pop(rax);
1069
- // rax: untagged integer value
1070
- switch (array_type) {
1071
- case kExternalByteArray:
1072
- case kExternalUnsignedByteArray:
1073
- __ movb(Operand(rcx, rbx, times_1, 0), rax);
1074
- break;
1075
- case kExternalShortArray:
1076
- case kExternalUnsignedShortArray:
1077
- __ movw(Operand(rcx, rbx, times_2, 0), rax);
1078
- break;
1079
- case kExternalIntArray:
1080
- case kExternalUnsignedIntArray: {
1081
- // We also need to explicitly check for +/-Infinity. These are
1082
- // converted to MIN_INT, but we need to be careful not to
1083
- // confuse with legal uses of MIN_INT.
1084
- Label not_infinity;
1085
- // This test would apparently detect both NaN and Infinity,
1086
- // but we've already checked for NaN using the FPU hardware
1087
- // above.
1088
- __ movzxwq(rdi, FieldOperand(rdx, HeapNumber::kValueOffset + 6));
1089
- __ and_(rdi, Immediate(0x7FF0));
1090
- __ cmpw(rdi, Immediate(0x7FF0));
1091
- __ j(not_equal, &not_infinity);
1092
- __ movq(rax, Immediate(0));
1093
- __ bind(&not_infinity);
1094
- __ movl(Operand(rcx, rbx, times_4, 0), rax);
1095
- break;
1096
- }
1097
- default:
1098
- UNREACHABLE();
1099
- break;
1100
- }
1101
- __ movq(rax, rdx); // Return the original value.
1102
- __ ret(0);
1103
-
1104
- __ bind(&is_nan);
1105
- __ ffree();
1106
- __ fincstp();
1107
- __ movq(rax, Immediate(0));
1108
- switch (array_type) {
1109
- case kExternalByteArray:
1110
- case kExternalUnsignedByteArray:
1111
- __ movb(Operand(rcx, rbx, times_1, 0), rax);
1112
- break;
1113
- case kExternalShortArray:
1114
- case kExternalUnsignedShortArray:
1115
- __ movw(Operand(rcx, rbx, times_2, 0), rax);
1116
- break;
1117
- case kExternalIntArray:
1118
- case kExternalUnsignedIntArray:
1119
- __ movl(Operand(rcx, rbx, times_4, 0), rax);
1120
- break;
1121
- default:
1122
- UNREACHABLE();
1123
- break;
1124
- }
1125
- __ movq(rax, rdx); // Return the original value.
1126
- __ ret(0);
1127
- }
1128
-
1129
- // Slow case: call runtime.
1130
- __ bind(&slow);
1131
- GenerateRuntimeSetProperty(masm);
1132
- }
1133
-
1134
-
1135
- void CallIC::GenerateMiss(MacroAssembler* masm, int argc) {
1136
- // ----------- S t a t e -------------
1137
- // rcx : function name
1138
- // rsp[0] : return address
1139
- // rsp[8] : argument argc
1140
- // rsp[16] : argument argc - 1
1141
- // ...
1142
- // rsp[argc * 8] : argument 1
1143
- // rsp[(argc + 1) * 8] : argument 0 = receiver
1144
- // -----------------------------------
1145
- // Get the receiver of the function from the stack; 1 ~ return address.
1146
- __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
1147
-
1148
- // Enter an internal frame.
1149
- __ EnterInternalFrame();
1150
-
1151
- // Push the receiver and the name of the function.
1152
- __ push(rdx);
1153
- __ push(rcx);
1154
-
1155
- // Call the entry.
1156
- CEntryStub stub(1);
1157
- __ movq(rax, Immediate(2));
1158
- __ movq(rbx, ExternalReference(IC_Utility(kCallIC_Miss)));
1159
- __ CallStub(&stub);
1160
-
1161
- // Move result to rdi and exit the internal frame.
1162
- __ movq(rdi, rax);
1163
- __ LeaveInternalFrame();
1164
-
1165
- // Check if the receiver is a global object of some sort.
1166
- Label invoke, global;
1167
- __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); // receiver
1168
- __ JumpIfSmi(rdx, &invoke);
1169
- __ CmpObjectType(rdx, JS_GLOBAL_OBJECT_TYPE, rcx);
1170
- __ j(equal, &global);
1171
- __ CmpInstanceType(rcx, JS_BUILTINS_OBJECT_TYPE);
1172
- __ j(not_equal, &invoke);
1173
-
1174
- // Patch the receiver on the stack.
1175
- __ bind(&global);
1176
- __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset));
1177
- __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx);
1178
-
1179
- // Invoke the function.
1180
- ParameterCount actual(argc);
1181
- __ bind(&invoke);
1182
- __ InvokeFunction(rdi, actual, JUMP_FUNCTION);
1183
- }
1184
-
1185
-
1186
- // Defined in ic.cc.
1187
- Object* CallIC_Miss(Arguments args);
1188
-
1189
- void CallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) {
1190
- // ----------- S t a t e -------------
1191
- // rcx : function name
1192
- // rsp[0] : return address
1193
- // rsp[8] : argument argc
1194
- // rsp[16] : argument argc - 1
1195
- // ...
1196
- // rsp[argc * 8] : argument 1
1197
- // rsp[(argc + 1) * 8] : argument 0 = receiver
1198
- // -----------------------------------
1199
- Label number, non_number, non_string, boolean, probe, miss;
1200
-
1201
- // Get the receiver of the function from the stack; 1 ~ return address.
1202
- __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
1203
-
1204
- // Probe the stub cache.
1205
- Code::Flags flags =
1206
- Code::ComputeFlags(Code::CALL_IC, NOT_IN_LOOP, MONOMORPHIC, NORMAL, argc);
1207
- StubCache::GenerateProbe(masm, flags, rdx, rcx, rbx, rax);
1208
-
1209
- // If the stub cache probing failed, the receiver might be a value.
1210
- // For value objects, we use the map of the prototype objects for
1211
- // the corresponding JSValue for the cache and that is what we need
1212
- // to probe.
1213
- //
1214
- // Check for number.
1215
- __ JumpIfSmi(rdx, &number);
1216
- __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rbx);
1217
- __ j(not_equal, &non_number);
1218
- __ bind(&number);
1219
- StubCompiler::GenerateLoadGlobalFunctionPrototype(
1220
- masm, Context::NUMBER_FUNCTION_INDEX, rdx);
1221
- __ jmp(&probe);
1222
-
1223
- // Check for string.
1224
- __ bind(&non_number);
1225
- __ CmpInstanceType(rbx, FIRST_NONSTRING_TYPE);
1226
- __ j(above_equal, &non_string);
1227
- StubCompiler::GenerateLoadGlobalFunctionPrototype(
1228
- masm, Context::STRING_FUNCTION_INDEX, rdx);
1229
- __ jmp(&probe);
1230
-
1231
- // Check for boolean.
1232
- __ bind(&non_string);
1233
- __ CompareRoot(rdx, Heap::kTrueValueRootIndex);
1234
- __ j(equal, &boolean);
1235
- __ CompareRoot(rdx, Heap::kFalseValueRootIndex);
1236
- __ j(not_equal, &miss);
1237
- __ bind(&boolean);
1238
- StubCompiler::GenerateLoadGlobalFunctionPrototype(
1239
- masm, Context::BOOLEAN_FUNCTION_INDEX, rdx);
1240
-
1241
- // Probe the stub cache for the value object.
1242
- __ bind(&probe);
1243
- StubCache::GenerateProbe(masm, flags, rdx, rcx, rbx, no_reg);
1244
-
1245
- // Cache miss: Jump to runtime.
1246
- __ bind(&miss);
1247
- GenerateMiss(masm, argc);
1248
- }
1249
-
1250
-
1251
- static void GenerateNormalHelper(MacroAssembler* masm,
1252
- int argc,
1253
- bool is_global_object,
1254
- Label* miss) {
1255
- // ----------- S t a t e -------------
1256
- // rcx : function name
1257
- // rdx : receiver
1258
- // rsp[0] : return address
1259
- // rsp[8] : argument argc
1260
- // rsp[16] : argument argc - 1
1261
- // ...
1262
- // rsp[argc * 8] : argument 1
1263
- // rsp[(argc + 1) * 8] : argument 0 = receiver
1264
- // -----------------------------------
1265
- // Search dictionary - put result in register rdx.
1266
- GenerateDictionaryLoad(masm, miss, rax, rdx, rbx, rcx, CHECK_DICTIONARY);
1267
-
1268
- // Move the result to register rdi and check that it isn't a smi.
1269
- __ movq(rdi, rdx);
1270
- __ JumpIfSmi(rdx, miss);
1271
-
1272
- // Check that the value is a JavaScript function.
1273
- __ CmpObjectType(rdx, JS_FUNCTION_TYPE, rdx);
1274
- __ j(not_equal, miss);
1275
-
1276
- // Patch the receiver with the global proxy if necessary.
1277
- if (is_global_object) {
1278
- __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
1279
- __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset));
1280
- __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx);
1281
- }
1282
-
1283
- // Invoke the function.
1284
- ParameterCount actual(argc);
1285
- __ InvokeFunction(rdi, actual, JUMP_FUNCTION);
1286
- }
1287
-
1288
-
1289
- void CallIC::GenerateNormal(MacroAssembler* masm, int argc) {
1290
- // ----------- S t a t e -------------
1291
- // rcx : function name
1292
- // rsp[0] : return address
1293
- // rsp[8] : argument argc
1294
- // rsp[16] : argument argc - 1
1295
- // ...
1296
- // rsp[argc * 8] : argument 1
1297
- // rsp[(argc + 1) * 8] : argument 0 = receiver
1298
- // -----------------------------------
1299
- Label miss, global_object, non_global_object;
1300
-
1301
- // Get the receiver of the function from the stack.
1302
- __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
1303
-
1304
- // Check that the receiver isn't a smi.
1305
- __ JumpIfSmi(rdx, &miss);
1306
-
1307
- // Check that the receiver is a valid JS object.
1308
- // Because there are so many map checks and type checks, do not
1309
- // use CmpObjectType, but load map and type into registers.
1310
- __ movq(rbx, FieldOperand(rdx, HeapObject::kMapOffset));
1311
- __ movb(rax, FieldOperand(rbx, Map::kInstanceTypeOffset));
1312
- __ cmpb(rax, Immediate(FIRST_JS_OBJECT_TYPE));
1313
- __ j(below, &miss);
1314
-
1315
- // If this assert fails, we have to check upper bound too.
1316
- ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
1317
-
1318
- // Check for access to global object.
1319
- __ cmpb(rax, Immediate(JS_GLOBAL_OBJECT_TYPE));
1320
- __ j(equal, &global_object);
1321
- __ cmpb(rax, Immediate(JS_BUILTINS_OBJECT_TYPE));
1322
- __ j(not_equal, &non_global_object);
1323
-
1324
- // Accessing global object: Load and invoke.
1325
- __ bind(&global_object);
1326
- // Check that the global object does not require access checks.
1327
- __ movb(rbx, FieldOperand(rbx, Map::kBitFieldOffset));
1328
- __ testb(rbx, Immediate(1 << Map::kIsAccessCheckNeeded));
1329
- __ j(not_equal, &miss);
1330
- GenerateNormalHelper(masm, argc, true, &miss);
1331
-
1332
- // Accessing non-global object: Check for access to global proxy.
1333
- Label global_proxy, invoke;
1334
- __ bind(&non_global_object);
1335
- __ cmpb(rax, Immediate(JS_GLOBAL_PROXY_TYPE));
1336
- __ j(equal, &global_proxy);
1337
- // Check that the non-global, non-global-proxy object does not
1338
- // require access checks.
1339
- __ movb(rbx, FieldOperand(rbx, Map::kBitFieldOffset));
1340
- __ testb(rbx, Immediate(1 << Map::kIsAccessCheckNeeded));
1341
- __ j(not_equal, &miss);
1342
- __ bind(&invoke);
1343
- GenerateNormalHelper(masm, argc, false, &miss);
1344
-
1345
- // Global object proxy access: Check access rights.
1346
- __ bind(&global_proxy);
1347
- __ CheckAccessGlobalProxy(rdx, rax, &miss);
1348
- __ jmp(&invoke);
1349
-
1350
- // Cache miss: Jump to runtime.
1351
- __ bind(&miss);
1352
- GenerateMiss(masm, argc);
1353
- }
1354
-
1355
-
1356
- // The offset from the inlined patch site to the start of the
1357
- // inlined load instruction.
1358
- const int LoadIC::kOffsetToLoadInstruction = 20;
1359
-
1360
-
1361
- void LoadIC::ClearInlinedVersion(Address address) {
1362
- // Reset the map check of the inlined inobject property load (if
1363
- // present) to guarantee failure by holding an invalid map (the null
1364
- // value). The offset can be patched to anything.
1365
- PatchInlinedLoad(address, Heap::null_value(), kMaxInt);
1366
- }
1367
-
1368
-
1369
- void LoadIC::GenerateMiss(MacroAssembler* masm) {
1370
- // ----------- S t a t e -------------
1371
- // -- rcx : name
1372
- // -- rsp[0] : return address
1373
- // -- rsp[8] : receiver
1374
- // -----------------------------------
1375
-
1376
- __ pop(rbx);
1377
- __ push(Operand(rsp, 0)); // receiver
1378
- __ push(rcx); // name
1379
- __ push(rbx); // return address
1380
-
1381
- // Perform tail call to the entry.
1382
- ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss));
1383
- __ TailCallExternalReference(ref, 2, 1);
1384
- }
1385
-
1386
-
1387
- void LoadIC::GenerateArrayLength(MacroAssembler* masm) {
1388
- // ----------- S t a t e -------------
1389
- // -- rcx : name
1390
- // -- rsp[0] : return address
1391
- // -- rsp[8] : receiver
1392
- // -----------------------------------
1393
- Label miss;
1394
-
1395
- __ movq(rax, Operand(rsp, kPointerSize));
1396
-
1397
- StubCompiler::GenerateLoadArrayLength(masm, rax, rdx, &miss);
1398
- __ bind(&miss);
1399
- StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC);
1400
- }
1401
-
1402
-
1403
- void LoadIC::GenerateFunctionPrototype(MacroAssembler* masm) {
1404
- // ----------- S t a t e -------------
1405
- // -- rcx : name
1406
- // -- rsp[0] : return address
1407
- // -- rsp[8] : receiver
1408
- // -----------------------------------
1409
- Label miss;
1410
-
1411
- __ movq(rax, Operand(rsp, kPointerSize));
1412
-
1413
- StubCompiler::GenerateLoadFunctionPrototype(masm, rax, rdx, rbx, &miss);
1414
- __ bind(&miss);
1415
- StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC);
1416
- }
1417
-
1418
-
1419
- void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
1420
- // ----------- S t a t e -------------
1421
- // -- rcx : name
1422
- // -- rsp[0] : return address
1423
- // -- rsp[8] : receiver
1424
- // -----------------------------------
1425
-
1426
- __ movq(rax, Operand(rsp, kPointerSize));
1427
-
1428
- // Probe the stub cache.
1429
- Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC,
1430
- NOT_IN_LOOP,
1431
- MONOMORPHIC);
1432
- StubCache::GenerateProbe(masm, flags, rax, rcx, rbx, rdx);
1433
-
1434
- // Cache miss: Jump to runtime.
1435
- StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC);
1436
- }
1437
-
1438
-
1439
- void LoadIC::GenerateNormal(MacroAssembler* masm) {
1440
- // ----------- S t a t e -------------
1441
- // -- rcx : name
1442
- // -- rsp[0] : return address
1443
- // -- rsp[8] : receiver
1444
- // -----------------------------------
1445
- Label miss, probe, global;
1446
-
1447
- __ movq(rax, Operand(rsp, kPointerSize));
1448
-
1449
- // Check that the receiver isn't a smi.
1450
- __ JumpIfSmi(rax, &miss);
1451
-
1452
- // Check that the receiver is a valid JS object.
1453
- __ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rbx);
1454
- __ j(below, &miss);
1455
-
1456
- // If this assert fails, we have to check upper bound too.
1457
- ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
1458
-
1459
- // Check for access to global object (unlikely).
1460
- __ CmpInstanceType(rbx, JS_GLOBAL_PROXY_TYPE);
1461
- __ j(equal, &global);
1462
-
1463
- // Check for non-global object that requires access check.
1464
- __ testl(FieldOperand(rbx, Map::kBitFieldOffset),
1465
- Immediate(1 << Map::kIsAccessCheckNeeded));
1466
- __ j(not_zero, &miss);
1467
-
1468
- // Search the dictionary placing the result in rax.
1469
- __ bind(&probe);
1470
- GenerateDictionaryLoad(masm, &miss, rdx, rax, rbx, rcx, CHECK_DICTIONARY);
1471
- __ ret(0);
1472
-
1473
- // Global object access: Check access rights.
1474
- __ bind(&global);
1475
- __ CheckAccessGlobalProxy(rax, rdx, &miss);
1476
- __ jmp(&probe);
1477
-
1478
- // Cache miss: Restore receiver from stack and jump to runtime.
1479
- __ bind(&miss);
1480
- __ movq(rax, Operand(rsp, 1 * kPointerSize));
1481
- GenerateMiss(masm);
1482
- }
1483
-
1484
-
1485
- void LoadIC::GenerateStringLength(MacroAssembler* masm) {
1486
- // ----------- S t a t e -------------
1487
- // -- rcx : name
1488
- // -- rsp[0] : return address
1489
- // -- rsp[8] : receiver
1490
- // -----------------------------------
1491
- Label miss;
1492
-
1493
- __ movq(rax, Operand(rsp, kPointerSize));
1494
-
1495
- StubCompiler::GenerateLoadStringLength(masm, rax, rdx, rbx, &miss);
1496
- __ bind(&miss);
1497
- StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC);
1498
- }
1499
-
1500
-
1501
- bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) {
1502
- // The address of the instruction following the call.
1503
- Address test_instruction_address =
1504
- address + Assembler::kCallTargetAddressOffset;
1505
- // If the instruction following the call is not a test eax, nothing
1506
- // was inlined.
1507
- if (*test_instruction_address != kTestEaxByte) return false;
1508
-
1509
- Address delta_address = test_instruction_address + 1;
1510
- // The delta to the start of the map check instruction.
1511
- int delta = *reinterpret_cast<int*>(delta_address);
1512
-
1513
- // The map address is the last 8 bytes of the 10-byte
1514
- // immediate move instruction, so we add 2 to get the
1515
- // offset to the last 8 bytes.
1516
- Address map_address = test_instruction_address + delta + 2;
1517
- *(reinterpret_cast<Object**>(map_address)) = map;
1518
-
1519
- // The offset is in the 32-bit displacement of a seven byte
1520
- // memory-to-register move instruction (REX.W 0x88 ModR/M disp32),
1521
- // so we add 3 to get the offset of the displacement.
1522
- Address offset_address =
1523
- test_instruction_address + delta + kOffsetToLoadInstruction + 3;
1524
- *reinterpret_cast<int*>(offset_address) = offset - kHeapObjectTag;
1525
- return true;
1526
- }
1527
-
1528
-
1529
- void StoreIC::GenerateMiss(MacroAssembler* masm) {
1530
- // ----------- S t a t e -------------
1531
- // -- rax : value
1532
- // -- rcx : name
1533
- // -- rdx : receiver
1534
- // -- rsp[0] : return address
1535
- // -----------------------------------
1536
-
1537
- __ pop(rbx);
1538
- __ push(rdx); // receiver
1539
- __ push(rcx); // name
1540
- __ push(rax); // value
1541
- __ push(rbx); // return address
1542
-
1543
- // Perform tail call to the entry.
1544
- ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_Miss));
1545
- __ TailCallExternalReference(ref, 3, 1);
1546
- }
1547
-
1548
-
1549
- void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
1550
- // ----------- S t a t e -------------
1551
- // -- rax : value
1552
- // -- rcx : name
1553
- // -- rdx : receiver
1554
- // -- rsp[0] : return address
1555
- // -----------------------------------
1556
-
1557
- // Get the receiver from the stack and probe the stub cache.
1558
- Code::Flags flags = Code::ComputeFlags(Code::STORE_IC,
1559
- NOT_IN_LOOP,
1560
- MONOMORPHIC);
1561
- StubCache::GenerateProbe(masm, flags, rdx, rcx, rbx, no_reg);
1562
-
1563
- // Cache miss: Jump to runtime.
1564
- GenerateMiss(masm);
1565
- }
1566
-
1567
-
1568
- void StoreIC::GenerateArrayLength(MacroAssembler* masm) {
1569
- // ----------- S t a t e -------------
1570
- // -- rax : value
1571
- // -- rcx : name
1572
- // -- rdx : receiver
1573
- // -- rsp[0] : return address
1574
- // -----------------------------------
1575
- //
1576
- // This accepts as a receiver anything JSObject::SetElementsLength accepts
1577
- // (currently anything except for external and pixel arrays which means
1578
- // anything with elements of FixedArray type.), but currently is restricted
1579
- // to JSArray.
1580
- // Value must be a number, but only smis are accepted as the most common case.
1581
-
1582
- Label miss;
1583
-
1584
- Register receiver = rdx;
1585
- Register value = rax;
1586
- Register scratch = rbx;
1587
-
1588
- // Check that the receiver isn't a smi.
1589
- __ JumpIfSmi(receiver, &miss);
1590
-
1591
- // Check that the object is a JS array.
1592
- __ CmpObjectType(receiver, JS_ARRAY_TYPE, scratch);
1593
- __ j(not_equal, &miss);
1594
-
1595
- // Check that elements are FixedArray.
1596
- __ movq(scratch, FieldOperand(receiver, JSArray::kElementsOffset));
1597
- __ CmpObjectType(scratch, FIXED_ARRAY_TYPE, scratch);
1598
- __ j(not_equal, &miss);
1599
-
1600
- // Check that value is a smi.
1601
- __ JumpIfNotSmi(value, &miss);
1602
-
1603
- // Prepare tail call to StoreIC_ArrayLength.
1604
- __ pop(scratch);
1605
- __ push(receiver);
1606
- __ push(value);
1607
- __ push(scratch); // return address
1608
-
1609
- ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_ArrayLength));
1610
- __ TailCallExternalReference(ref, 2, 1);
1611
-
1612
- __ bind(&miss);
1613
-
1614
- GenerateMiss(masm);
1615
- }
1616
-
1617
-
1618
- #undef __
1619
-
1620
-
1621
- } } // namespace v8::internal