therubyracer 0.6.3 → 0.7.0.pre

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of therubyracer might be problematic. Click here for more details.

Files changed (520) hide show
  1. data/Rakefile +10 -9
  2. data/ext/v8/callbacks.cpp +15 -8
  3. data/ext/v8/converters.cpp +7 -8
  4. data/ext/v8/converters.h +0 -2
  5. data/ext/v8/extconf.rb +2 -0
  6. data/ext/v8/rr.cpp +169 -0
  7. data/ext/v8/rr.h +34 -0
  8. data/ext/v8/upstream/{2.0.6 → 2.1.10}/AUTHORS +8 -1
  9. data/ext/v8/upstream/{2.0.6 → 2.1.10}/ChangeLog +198 -0
  10. data/ext/v8/upstream/{2.0.6 → 2.1.10}/LICENSE +0 -0
  11. data/ext/v8/upstream/{2.0.6 → 2.1.10}/SConstruct +152 -38
  12. data/ext/v8/upstream/{2.0.6 → 2.1.10}/include/v8-debug.h +52 -4
  13. data/ext/v8/upstream/2.1.10/include/v8-profiler.h +176 -0
  14. data/ext/v8/upstream/{2.0.6 → 2.1.10}/include/v8.h +227 -48
  15. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/SConscript +60 -10
  16. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/accessors.cc +5 -39
  17. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/accessors.h +0 -0
  18. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/allocation.cc +0 -0
  19. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/allocation.h +0 -0
  20. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/api.cc +477 -57
  21. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/api.h +8 -4
  22. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/apinatives.js +1 -1
  23. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/apiutils.h +0 -0
  24. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arguments.h +5 -6
  25. data/ext/v8/upstream/{2.0.6/src/arm/assembler-thumb2-inl.h → 2.1.10/src/arm/assembler-arm-inl.h} +42 -27
  26. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/assembler-arm.cc +430 -216
  27. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/assembler-arm.h +199 -110
  28. data/ext/v8/upstream/{2.0.6/src/arm/assembler-arm-inl.h → 2.1.10/src/arm/assembler-thumb2-inl.h} +4 -18
  29. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/assembler-thumb2.cc +142 -85
  30. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/assembler-thumb2.h +18 -9
  31. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/builtins-arm.cc +127 -87
  32. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/codegen-arm-inl.h +3 -5
  33. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/codegen-arm.cc +4634 -1427
  34. data/ext/v8/upstream/2.1.10/src/arm/codegen-arm.h +946 -0
  35. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/constants-arm.cc +21 -3
  36. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/constants-arm.h +39 -13
  37. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/cpu-arm.cc +9 -3
  38. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/debug-arm.cc +34 -8
  39. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/disasm-arm.cc +262 -117
  40. data/ext/v8/upstream/2.1.10/src/arm/fast-codegen-arm.cc +238 -0
  41. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/frames-arm.cc +0 -0
  42. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/frames-arm.h +0 -0
  43. data/ext/v8/upstream/{2.0.6/src/arm/fast-codegen-arm.cc → 2.1.10/src/arm/full-codegen-arm.cc} +453 -283
  44. data/ext/v8/upstream/2.1.10/src/arm/ic-arm.cc +1833 -0
  45. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/jump-target-arm.cc +3 -29
  46. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/macro-assembler-arm.cc +564 -104
  47. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/macro-assembler-arm.h +255 -46
  48. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/regexp-macro-assembler-arm.cc +78 -104
  49. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/regexp-macro-assembler-arm.h +6 -22
  50. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/register-allocator-arm-inl.h +0 -3
  51. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/register-allocator-arm.cc +0 -0
  52. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/register-allocator-arm.h +2 -1
  53. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/simulator-arm.cc +557 -180
  54. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/simulator-arm.h +52 -4
  55. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/stub-cache-arm.cc +904 -240
  56. data/ext/v8/upstream/2.1.10/src/arm/virtual-frame-arm.cc +668 -0
  57. data/ext/v8/upstream/2.1.10/src/arm/virtual-frame-arm.h +503 -0
  58. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/array.js +82 -109
  59. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/assembler.cc +49 -13
  60. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/assembler.h +27 -5
  61. data/ext/v8/upstream/2.1.10/src/ast.cc +1138 -0
  62. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ast.h +354 -53
  63. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/bootstrapper.cc +609 -501
  64. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/bootstrapper.h +27 -8
  65. data/ext/v8/upstream/2.1.10/src/builtins.cc +1512 -0
  66. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/builtins.h +41 -25
  67. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/bytecodes-irregexp.h +0 -0
  68. data/ext/v8/upstream/2.1.10/src/cached-powers.h +119 -0
  69. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/char-predicates-inl.h +0 -0
  70. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/char-predicates.h +0 -0
  71. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/checks.cc +0 -0
  72. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/checks.h +25 -1
  73. data/ext/v8/upstream/2.1.10/src/circular-queue-inl.h +101 -0
  74. data/ext/v8/upstream/2.1.10/src/circular-queue.cc +121 -0
  75. data/ext/v8/upstream/2.1.10/src/circular-queue.h +129 -0
  76. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/code-stubs.cc +23 -8
  77. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/code-stubs.h +16 -4
  78. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/code.h +0 -0
  79. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/codegen-inl.h +6 -34
  80. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/codegen.cc +73 -92
  81. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/codegen.h +164 -68
  82. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/compilation-cache.cc +117 -73
  83. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/compilation-cache.h +18 -17
  84. data/ext/v8/upstream/2.1.10/src/compiler.cc +623 -0
  85. data/ext/v8/upstream/2.1.10/src/compiler.h +299 -0
  86. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/contexts.cc +0 -0
  87. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/contexts.h +8 -11
  88. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/conversions-inl.h +28 -13
  89. data/ext/v8/upstream/2.1.10/src/conversions.cc +1105 -0
  90. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/conversions.h +9 -4
  91. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/counters.cc +0 -0
  92. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/counters.h +1 -1
  93. data/ext/v8/upstream/2.1.10/src/cpu-profiler-inl.h +99 -0
  94. data/ext/v8/upstream/2.1.10/src/cpu-profiler.cc +494 -0
  95. data/ext/v8/upstream/2.1.10/src/cpu-profiler.h +277 -0
  96. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/cpu.h +0 -0
  97. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-debug.cc +15 -4
  98. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-debug.h +0 -0
  99. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-posix.cc +18 -0
  100. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-readline.cc +2 -2
  101. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-windows.cc +0 -0
  102. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8.cc +10 -6
  103. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8.h +2 -0
  104. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8.js +43 -38
  105. data/ext/v8/upstream/2.1.10/src/data-flow.cc +755 -0
  106. data/ext/v8/upstream/2.1.10/src/data-flow.h +278 -0
  107. data/ext/v8/upstream/{2.0.6/src/date-delay.js → 2.1.10/src/date.js} +100 -110
  108. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/dateparser-inl.h +11 -2
  109. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/dateparser.cc +24 -26
  110. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/dateparser.h +8 -4
  111. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/debug-agent.cc +3 -1
  112. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/debug-agent.h +0 -0
  113. data/ext/v8/upstream/{2.0.6/src/debug-delay.js → 2.1.10/src/debug-debugger.js} +111 -15
  114. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/debug.cc +156 -96
  115. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/debug.h +53 -5
  116. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/disasm.h +0 -0
  117. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/disassembler.cc +2 -8
  118. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/disassembler.h +0 -0
  119. data/ext/v8/upstream/2.1.10/src/diy-fp.cc +58 -0
  120. data/ext/v8/upstream/2.1.10/src/diy-fp.h +117 -0
  121. data/ext/v8/upstream/2.1.10/src/double.h +169 -0
  122. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/dtoa-config.c +4 -3
  123. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/execution.cc +22 -22
  124. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/execution.h +17 -4
  125. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/factory.cc +70 -46
  126. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/factory.h +27 -17
  127. data/ext/v8/upstream/2.1.10/src/fast-codegen.cc +746 -0
  128. data/ext/v8/upstream/2.1.10/src/fast-codegen.h +161 -0
  129. data/ext/v8/upstream/2.1.10/src/fast-dtoa.cc +512 -0
  130. data/ext/v8/upstream/2.1.10/src/fast-dtoa.h +59 -0
  131. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/flag-definitions.h +32 -11
  132. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/flags.cc +0 -0
  133. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/flags.h +0 -0
  134. data/ext/v8/upstream/2.1.10/src/flow-graph.cc +763 -0
  135. data/ext/v8/upstream/2.1.10/src/flow-graph.h +180 -0
  136. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frame-element.cc +1 -4
  137. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frame-element.h +49 -11
  138. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frames-inl.h +2 -0
  139. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frames.cc +91 -17
  140. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frames.h +24 -2
  141. data/ext/v8/upstream/{2.0.6/src/fast-codegen.cc → 2.1.10/src/full-codegen.cc} +549 -198
  142. data/ext/v8/upstream/{2.0.6/src/fast-codegen.h → 2.1.10/src/full-codegen.h} +109 -29
  143. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/func-name-inferrer.cc +0 -0
  144. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/func-name-inferrer.h +0 -0
  145. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/global-handles.cc +0 -0
  146. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/global-handles.h +0 -0
  147. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/globals.h +67 -43
  148. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/handles-inl.h +0 -0
  149. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/handles.cc +124 -129
  150. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/handles.h +33 -15
  151. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/hashmap.cc +0 -0
  152. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/hashmap.h +0 -0
  153. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap-inl.h +56 -12
  154. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap-profiler.cc +2 -2
  155. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap-profiler.h +2 -0
  156. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap.cc +413 -221
  157. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap.h +192 -67
  158. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/assembler-ia32-inl.h +6 -0
  159. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/assembler-ia32.cc +187 -32
  160. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/assembler-ia32.h +31 -4
  161. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/builtins-ia32.cc +160 -133
  162. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/codegen-ia32-inl.h +0 -0
  163. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/codegen-ia32.cc +5533 -2177
  164. data/ext/v8/upstream/{2.0.6/src/x64/codegen-x64.h → 2.1.10/src/ia32/codegen-ia32.h} +453 -134
  165. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/cpu-ia32.cc +0 -0
  166. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/debug-ia32.cc +63 -8
  167. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/disasm-ia32.cc +99 -16
  168. data/ext/v8/upstream/2.1.10/src/ia32/fast-codegen-ia32.cc +950 -0
  169. data/ext/v8/upstream/2.1.10/src/ia32/fast-codegen-ia32.h +155 -0
  170. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/frames-ia32.cc +0 -0
  171. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/frames-ia32.h +0 -0
  172. data/ext/v8/upstream/{2.0.6/src/ia32/fast-codegen-ia32.cc → 2.1.10/src/ia32/full-codegen-ia32.cc} +454 -253
  173. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/ic-ia32.cc +545 -390
  174. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/jump-target-ia32.cc +1 -0
  175. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/macro-assembler-ia32.cc +330 -139
  176. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/macro-assembler-ia32.h +96 -30
  177. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/regexp-macro-assembler-ia32.cc +73 -89
  178. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/regexp-macro-assembler-ia32.h +6 -21
  179. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/register-allocator-ia32-inl.h +0 -0
  180. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/register-allocator-ia32.cc +59 -5
  181. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/register-allocator-ia32.h +0 -0
  182. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/simulator-ia32.cc +0 -0
  183. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/simulator-ia32.h +2 -2
  184. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/stub-cache-ia32.cc +745 -303
  185. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/virtual-frame-ia32.cc +278 -71
  186. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/virtual-frame-ia32.h +78 -22
  187. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ic-inl.h +0 -0
  188. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ic.cc +172 -89
  189. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ic.h +51 -20
  190. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/interpreter-irregexp.cc +0 -0
  191. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/interpreter-irregexp.h +0 -0
  192. data/ext/v8/upstream/{2.0.6/src/json-delay.js → 2.1.10/src/json.js} +26 -12
  193. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/jsregexp.cc +151 -118
  194. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/jsregexp.h +31 -7
  195. data/ext/v8/upstream/2.1.10/src/jump-target-heavy-inl.h +51 -0
  196. data/ext/v8/upstream/{2.0.6/src/jump-target.cc → 2.1.10/src/jump-target-heavy.cc} +164 -184
  197. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/jump-target-inl.h +8 -9
  198. data/ext/v8/upstream/{2.0.6/src/usage-analyzer.h → 2.1.10/src/jump-target-light-inl.h} +9 -7
  199. data/ext/v8/upstream/2.1.10/src/jump-target-light.cc +86 -0
  200. data/ext/v8/upstream/2.1.10/src/jump-target.cc +155 -0
  201. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/jump-target.h +6 -0
  202. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/list-inl.h +0 -0
  203. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/list.h +2 -1
  204. data/ext/v8/upstream/2.1.10/src/liveedit-debugger.js +944 -0
  205. data/ext/v8/upstream/2.1.10/src/liveedit.cc +1468 -0
  206. data/ext/v8/upstream/2.1.10/src/liveedit.h +170 -0
  207. data/ext/v8/upstream/2.1.10/src/log-inl.h +59 -0
  208. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/log-utils.cc +3 -9
  209. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/log-utils.h +1 -4
  210. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/log.cc +198 -95
  211. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/log.h +50 -49
  212. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/macro-assembler.h +9 -0
  213. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/macros.py +30 -11
  214. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/mark-compact.cc +464 -152
  215. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/mark-compact.h +41 -20
  216. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/math.js +9 -8
  217. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/memory.h +0 -0
  218. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/messages.cc +1 -0
  219. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/messages.h +0 -0
  220. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/messages.js +46 -9
  221. data/ext/v8/upstream/2.1.10/src/mips/assembler-mips-inl.h +215 -0
  222. data/ext/v8/upstream/2.1.10/src/mips/assembler-mips.cc +1208 -0
  223. data/ext/v8/upstream/2.1.10/src/mips/assembler-mips.h +665 -0
  224. data/ext/v8/upstream/2.1.10/src/mips/builtins-mips.cc +202 -0
  225. data/ext/v8/upstream/2.1.10/src/mips/codegen-mips-inl.h +70 -0
  226. data/ext/v8/upstream/2.1.10/src/mips/codegen-mips.cc +1428 -0
  227. data/ext/v8/upstream/{2.0.6/src/arm/codegen-arm.h → 2.1.10/src/mips/codegen-mips.h} +103 -205
  228. data/ext/v8/upstream/2.1.10/src/mips/constants-mips.cc +323 -0
  229. data/ext/v8/upstream/2.1.10/src/mips/constants-mips.h +525 -0
  230. data/ext/v8/upstream/2.1.10/src/mips/cpu-mips.cc +69 -0
  231. data/ext/v8/upstream/2.1.10/src/mips/debug-mips.cc +128 -0
  232. data/ext/v8/upstream/2.1.10/src/mips/disasm-mips.cc +784 -0
  233. data/ext/v8/upstream/2.1.10/src/mips/fast-codegen-mips.cc +74 -0
  234. data/ext/v8/upstream/2.1.10/src/mips/frames-mips.cc +99 -0
  235. data/ext/v8/upstream/2.1.10/src/mips/frames-mips.h +164 -0
  236. data/ext/v8/upstream/2.1.10/src/mips/full-codegen-mips.cc +273 -0
  237. data/ext/v8/upstream/2.1.10/src/mips/ic-mips.cc +217 -0
  238. data/ext/v8/upstream/2.1.10/src/mips/jump-target-mips.cc +172 -0
  239. data/ext/v8/upstream/2.1.10/src/mips/macro-assembler-mips.cc +1323 -0
  240. data/ext/v8/upstream/2.1.10/src/mips/macro-assembler-mips.h +461 -0
  241. data/ext/v8/upstream/2.1.10/src/mips/register-allocator-mips-inl.h +137 -0
  242. data/ext/v8/upstream/2.1.10/src/mips/register-allocator-mips.cc +60 -0
  243. data/ext/v8/upstream/2.1.10/src/mips/register-allocator-mips.h +46 -0
  244. data/ext/v8/upstream/2.1.10/src/mips/simulator-mips.cc +1648 -0
  245. data/ext/v8/upstream/2.1.10/src/mips/simulator-mips.h +311 -0
  246. data/ext/v8/upstream/2.1.10/src/mips/stub-cache-mips.cc +400 -0
  247. data/ext/v8/upstream/2.1.10/src/mips/virtual-frame-mips.cc +316 -0
  248. data/ext/v8/upstream/{2.0.6/src/arm/virtual-frame-arm.h → 2.1.10/src/mips/virtual-frame-mips.h} +87 -71
  249. data/ext/v8/upstream/{2.0.6/src/mirror-delay.js → 2.1.10/src/mirror-debugger.js} +51 -45
  250. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/mksnapshot.cc +97 -10
  251. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/natives.h +6 -6
  252. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/objects-debug.cc +47 -5
  253. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/objects-inl.h +154 -38
  254. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/objects.cc +528 -280
  255. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/objects.h +302 -95
  256. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/oprofile-agent.cc +25 -33
  257. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/oprofile-agent.h +9 -1
  258. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/parser.cc +444 -72
  259. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/parser.h +4 -2
  260. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-freebsd.cc +32 -13
  261. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-linux.cc +59 -25
  262. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-macos.cc +30 -13
  263. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-nullos.cc +0 -0
  264. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-openbsd.cc +21 -2
  265. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-posix.cc +0 -18
  266. data/ext/v8/upstream/2.1.10/src/platform-solaris.cc +607 -0
  267. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-win32.cc +16 -17
  268. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform.h +25 -8
  269. data/ext/v8/upstream/2.1.10/src/powers-ten.h +2461 -0
  270. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/prettyprinter.cc +49 -29
  271. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/prettyprinter.h +3 -1
  272. data/ext/v8/upstream/2.1.10/src/profile-generator-inl.h +124 -0
  273. data/ext/v8/upstream/2.1.10/src/profile-generator.cc +583 -0
  274. data/ext/v8/upstream/2.1.10/src/profile-generator.h +364 -0
  275. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/property.cc +1 -1
  276. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/property.h +12 -24
  277. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-irregexp-inl.h +2 -2
  278. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-irregexp.cc +2 -2
  279. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-irregexp.h +2 -2
  280. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-tracer.cc +2 -2
  281. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-tracer.h +0 -0
  282. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler.cc +33 -10
  283. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler.h +12 -4
  284. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-stack.cc +0 -0
  285. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-stack.h +0 -0
  286. data/ext/v8/upstream/{2.0.6/src/regexp-delay.js → 2.1.10/src/regexp.js} +180 -58
  287. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/register-allocator-inl.h +68 -1
  288. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/register-allocator.cc +5 -2
  289. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/register-allocator.h +42 -17
  290. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/rewriter.cc +110 -4
  291. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/rewriter.h +0 -0
  292. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/runtime.cc +2733 -623
  293. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/runtime.h +43 -20
  294. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/runtime.js +46 -35
  295. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scanner.cc +278 -36
  296. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scanner.h +97 -26
  297. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scopeinfo.cc +3 -3
  298. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scopeinfo.h +1 -0
  299. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scopes.cc +11 -12
  300. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scopes.h +0 -1
  301. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/serialize.cc +298 -175
  302. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/serialize.h +184 -40
  303. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/shell.h +0 -0
  304. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/simulator.h +2 -0
  305. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/smart-pointer.h +0 -0
  306. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/snapshot-common.cc +16 -31
  307. data/ext/v8/upstream/2.1.10/src/snapshot-empty.cc +50 -0
  308. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/snapshot.h +13 -1
  309. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/spaces-inl.h +35 -27
  310. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/spaces.cc +256 -42
  311. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/spaces.h +136 -42
  312. data/ext/v8/upstream/{2.0.6/src/zone-inl.h → 2.1.10/src/splay-tree-inl.h} +102 -89
  313. data/ext/v8/upstream/2.1.10/src/splay-tree.h +203 -0
  314. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/string-stream.cc +0 -0
  315. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/string-stream.h +0 -0
  316. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/string.js +260 -149
  317. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/stub-cache.cc +195 -69
  318. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/stub-cache.h +127 -12
  319. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/third_party/dtoa/COPYING +0 -0
  320. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/third_party/dtoa/dtoa.c +0 -0
  321. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/third_party/valgrind/valgrind.h +0 -0
  322. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/token.cc +0 -0
  323. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/token.h +0 -0
  324. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/top.cc +26 -31
  325. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/top.h +3 -4
  326. data/ext/v8/upstream/2.1.10/src/type-info.cc +53 -0
  327. data/ext/v8/upstream/2.1.10/src/type-info.h +244 -0
  328. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/unicode-inl.h +0 -0
  329. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/unicode.cc +0 -0
  330. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/unicode.h +0 -0
  331. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/uri.js +6 -6
  332. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/utils.cc +0 -37
  333. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/utils.h +121 -50
  334. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8-counters.cc +0 -0
  335. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8-counters.h +130 -98
  336. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8.cc +42 -11
  337. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8.h +4 -2
  338. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8natives.js +202 -37
  339. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8threads.cc +11 -0
  340. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8threads.h +15 -0
  341. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/variables.cc +7 -51
  342. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/variables.h +5 -35
  343. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/version.cc +3 -3
  344. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/version.h +0 -0
  345. data/ext/v8/upstream/2.1.10/src/virtual-frame-heavy-inl.h +152 -0
  346. data/ext/v8/upstream/{2.0.6/src/virtual-frame.cc → 2.1.10/src/virtual-frame-heavy.cc} +107 -176
  347. data/ext/v8/upstream/2.1.10/src/virtual-frame-inl.h +39 -0
  348. data/ext/v8/upstream/2.1.10/src/virtual-frame-light-inl.h +69 -0
  349. data/ext/v8/upstream/2.1.10/src/virtual-frame-light.cc +49 -0
  350. data/ext/v8/upstream/2.1.10/src/virtual-frame.cc +49 -0
  351. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/virtual-frame.h +2 -0
  352. data/ext/v8/upstream/{2.0.6/src/log-inl.h → 2.1.10/src/vm-state-inl.h} +28 -20
  353. data/ext/v8/upstream/{2.0.6/src/snapshot-empty.cc → 2.1.10/src/vm-state.cc} +5 -6
  354. data/ext/v8/upstream/2.1.10/src/vm-state.h +75 -0
  355. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/assembler-x64-inl.h +11 -0
  356. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/assembler-x64.cc +285 -93
  357. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/assembler-x64.h +81 -78
  358. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/builtins-x64.cc +130 -87
  359. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/codegen-x64-inl.h +0 -0
  360. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/codegen-x64.cc +4520 -1317
  361. data/ext/v8/upstream/{2.0.6/src/ia32/codegen-ia32.h → 2.1.10/src/x64/codegen-x64.h} +362 -141
  362. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/cpu-x64.cc +0 -0
  363. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/debug-x64.cc +20 -4
  364. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/disasm-x64.cc +121 -44
  365. data/ext/v8/upstream/2.1.10/src/x64/fast-codegen-x64.cc +246 -0
  366. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/frames-x64.cc +0 -0
  367. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/frames-x64.h +0 -0
  368. data/ext/v8/upstream/{2.0.6/src/x64/fast-codegen-x64.cc → 2.1.10/src/x64/full-codegen-x64.cc} +404 -231
  369. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/ic-x64.cc +346 -117
  370. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/jump-target-x64.cc +1 -0
  371. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/macro-assembler-x64.cc +537 -181
  372. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/macro-assembler-x64.h +140 -34
  373. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/regexp-macro-assembler-x64.cc +74 -96
  374. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/regexp-macro-assembler-x64.h +8 -25
  375. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/register-allocator-x64-inl.h +1 -1
  376. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/register-allocator-x64.cc +3 -0
  377. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/register-allocator-x64.h +0 -0
  378. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/simulator-x64.cc +0 -0
  379. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/simulator-x64.h +2 -2
  380. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/stub-cache-x64.cc +785 -288
  381. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/virtual-frame-x64.cc +128 -52
  382. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/virtual-frame-x64.h +40 -19
  383. data/ext/v8/upstream/2.1.10/src/zone-inl.h +82 -0
  384. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/zone.cc +1 -0
  385. data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/zone.h +6 -90
  386. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/codemap.js +12 -0
  387. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/consarray.js +0 -0
  388. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/csvparser.js +22 -37
  389. data/ext/v8/upstream/2.1.10/tools/generate-ten-powers.scm +286 -0
  390. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/gyp/v8.gyp +86 -24
  391. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/js2c.py +22 -22
  392. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/jsmin.py +0 -0
  393. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/linux-tick-processor +10 -1
  394. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/linux-tick-processor.py +0 -0
  395. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/logreader.js +34 -16
  396. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/mac-nm +0 -0
  397. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/mac-tick-processor +0 -0
  398. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/annotate +0 -0
  399. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/common +0 -0
  400. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/dump +0 -0
  401. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/report +0 -0
  402. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/reset +0 -0
  403. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/run +0 -0
  404. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/shutdown +0 -0
  405. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/start +0 -0
  406. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/presubmit.py +0 -0
  407. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/process-heap-prof.py +0 -0
  408. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/profile.js +70 -0
  409. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/profile_view.js +0 -0
  410. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/run-valgrind.py +0 -0
  411. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/splaytree.js +0 -0
  412. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/splaytree.py +0 -0
  413. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/stats-viewer.py +0 -0
  414. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/test.py +7 -7
  415. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/tickprocessor-driver.js +7 -1
  416. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/tickprocessor.js +140 -9
  417. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/tickprocessor.py +40 -4
  418. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/utils.py +6 -0
  419. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/README.txt +0 -0
  420. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/arm.vsprops +1 -1
  421. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/common.vsprops +1 -2
  422. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/d8.vcproj +0 -6
  423. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/d8_arm.vcproj +193 -199
  424. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/d8_x64.vcproj +16 -8
  425. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/d8js2c.cmd +0 -0
  426. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/debug.vsprops +0 -0
  427. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/ia32.vsprops +5 -1
  428. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/js2c.cmd +1 -1
  429. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/release.vsprops +0 -0
  430. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8.sln +0 -0
  431. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8.vcproj +11 -7
  432. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_arm.sln +0 -0
  433. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_arm.vcproj +227 -223
  434. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_base.vcproj +137 -5
  435. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_base_arm.vcproj +116 -4
  436. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_base_x64.vcproj +125 -4
  437. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_cctest.vcproj +12 -6
  438. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_cctest_arm.vcproj +12 -6
  439. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_cctest_x64.vcproj +11 -11
  440. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_mksnapshot.vcproj +0 -6
  441. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -6
  442. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_process_sample.vcproj +0 -6
  443. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_process_sample_arm.vcproj +145 -151
  444. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_process_sample_x64.vcproj +16 -6
  445. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_shell_sample.vcproj +0 -6
  446. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_shell_sample_arm.vcproj +145 -151
  447. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_shell_sample_x64.vcproj +16 -8
  448. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_snapshot.vcproj +0 -0
  449. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
  450. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
  451. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
  452. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_x64.sln +0 -0
  453. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_x64.vcproj +11 -7
  454. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/x64.vsprops +5 -1
  455. data/ext/v8/upstream/2.1.10/tools/windows-tick-processor.bat +29 -0
  456. data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/windows-tick-processor.py +0 -0
  457. data/ext/v8/upstream/Makefile +8 -2
  458. data/ext/v8/v8.cpp +21 -73
  459. data/ext/v8/v8_array.cpp +56 -0
  460. data/ext/v8/v8_array.h +8 -0
  461. data/ext/v8/v8_callbacks.cpp +121 -0
  462. data/ext/v8/v8_callbacks.h +8 -0
  463. data/ext/v8/v8_cxt.cpp +74 -77
  464. data/ext/v8/v8_cxt.h +2 -9
  465. data/ext/v8/v8_date.cpp +26 -0
  466. data/ext/v8/v8_date.h +6 -0
  467. data/ext/v8/v8_exception.cpp +55 -0
  468. data/ext/v8/v8_exception.h +6 -0
  469. data/ext/v8/v8_external.cpp +50 -0
  470. data/ext/v8/v8_external.h +8 -0
  471. data/ext/v8/v8_func.cpp +76 -18
  472. data/ext/v8/v8_func.h +5 -4
  473. data/ext/v8/v8_msg.cpp +55 -46
  474. data/ext/v8/v8_msg.h +3 -11
  475. data/ext/v8/v8_obj.cpp +67 -36
  476. data/ext/v8/v8_obj.h +6 -8
  477. data/ext/v8/v8_ref.cpp +25 -9
  478. data/ext/v8/v8_ref.h +3 -5
  479. data/ext/v8/v8_script.cpp +17 -10
  480. data/ext/v8/v8_script.h +3 -3
  481. data/ext/v8/v8_str.cpp +34 -6
  482. data/ext/v8/v8_str.h +4 -2
  483. data/ext/v8/v8_template.cpp +195 -33
  484. data/ext/v8/v8_template.h +4 -5
  485. data/ext/v8/v8_try_catch.cpp +99 -0
  486. data/ext/v8/v8_try_catch.h +5 -0
  487. data/ext/v8/v8_value.cpp +164 -0
  488. data/ext/v8/v8_value.h +10 -0
  489. data/lib/v8.rb +3 -1
  490. data/lib/v8/access.rb +60 -0
  491. data/lib/v8/array.rb +15 -0
  492. data/lib/v8/callbacks.rb +88 -0
  493. data/lib/v8/cli.rb +1 -1
  494. data/lib/v8/context.rb +55 -66
  495. data/lib/v8/function.rb +20 -2
  496. data/lib/v8/object.rb +14 -12
  497. data/lib/v8/ruby_error.rb +3 -0
  498. data/lib/v8/to.rb +59 -7
  499. data/spec/ext/cxt_spec.rb +2 -15
  500. data/spec/ext/func_spec.rb +17 -10
  501. data/spec/ext/try_catch_spec.rb +32 -0
  502. data/spec/foo.rb +17 -0
  503. data/spec/redjs/jsapi_spec.rb +173 -96
  504. data/spec/spec_helper.rb +7 -0
  505. data/spec/v8/to_spec.rb +0 -1
  506. data/therubyracer.gemspec +6 -6
  507. metadata +493 -386
  508. data/ext/v8/upstream/2.0.6/src/arm/ic-arm.cc +0 -849
  509. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.cc +0 -412
  510. data/ext/v8/upstream/2.0.6/src/ast.cc +0 -512
  511. data/ext/v8/upstream/2.0.6/src/builtins.cc +0 -851
  512. data/ext/v8/upstream/2.0.6/src/compiler.cc +0 -1132
  513. data/ext/v8/upstream/2.0.6/src/compiler.h +0 -107
  514. data/ext/v8/upstream/2.0.6/src/conversions.cc +0 -709
  515. data/ext/v8/upstream/2.0.6/src/usage-analyzer.cc +0 -426
  516. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.bat +0 -5
  517. data/ext/v8/upstream/no-strict-aliasing.patch +0 -13
  518. data/ext/v8/v8_standalone.cpp +0 -69
  519. data/ext/v8/v8_standalone.h +0 -31
  520. data/spec/ext/obj_spec.rb +0 -13
@@ -1,4 +1,4 @@
1
- // Copyright 2006-2008 the V8 project authors. All rights reserved.
1
+ // Copyright 2010 the V8 project authors. All rights reserved.
2
2
  // Redistribution and use in source and binary forms, with or without
3
3
  // modification, are permitted provided that the following conditions are
4
4
  // met:
@@ -94,7 +94,7 @@ static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
94
94
  __ Set(eax, Immediate(0)); // no arguments
95
95
  __ mov(ebx, Immediate(ExternalReference::debug_break()));
96
96
 
97
- CEntryDebugBreakStub ceb;
97
+ CEntryStub ceb(1, ExitFrame::MODE_DEBUG);
98
98
  __ CallStub(&ceb);
99
99
 
100
100
  // Restore the register values containing object pointers from the expression
@@ -125,28 +125,31 @@ static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
125
125
  void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) {
126
126
  // Register state for IC load call (from ic-ia32.cc).
127
127
  // ----------- S t a t e -------------
128
+ // -- eax : receiver
128
129
  // -- ecx : name
129
130
  // -----------------------------------
130
- Generate_DebugBreakCallHelper(masm, ecx.bit(), false);
131
+ Generate_DebugBreakCallHelper(masm, eax.bit() | ecx.bit(), false);
131
132
  }
132
133
 
133
134
 
134
135
  void Debug::GenerateStoreICDebugBreak(MacroAssembler* masm) {
135
- // REgister state for IC store call (from ic-ia32.cc).
136
+ // Register state for IC store call (from ic-ia32.cc).
136
137
  // ----------- S t a t e -------------
137
138
  // -- eax : value
138
139
  // -- ecx : name
140
+ // -- edx : receiver
139
141
  // -----------------------------------
140
- Generate_DebugBreakCallHelper(masm, eax.bit() | ecx.bit(), false);
142
+ Generate_DebugBreakCallHelper(masm, eax.bit() | ecx.bit() | edx.bit(), false);
141
143
  }
142
144
 
143
145
 
144
146
  void Debug::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) {
145
147
  // Register state for keyed IC load call (from ic-ia32.cc).
146
148
  // ----------- S t a t e -------------
147
- // No registers used on entry.
149
+ // -- edx : receiver
150
+ // -- eax : key
148
151
  // -----------------------------------
149
- Generate_DebugBreakCallHelper(masm, 0, false);
152
+ Generate_DebugBreakCallHelper(masm, eax.bit() | edx.bit(), false);
150
153
  }
151
154
 
152
155
 
@@ -154,10 +157,12 @@ void Debug::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) {
154
157
  // Register state for keyed IC load call (from ic-ia32.cc).
155
158
  // ----------- S t a t e -------------
156
159
  // -- eax : value
160
+ // -- ecx : key
161
+ // -- edx : receiver
157
162
  // -----------------------------------
158
163
  // Register eax contains an object that needs to be pushed on the
159
164
  // expression stack of the fake JS frame.
160
- Generate_DebugBreakCallHelper(masm, eax.bit(), false);
165
+ Generate_DebugBreakCallHelper(masm, eax.bit() | ecx.bit() | edx.bit(), false);
161
166
  }
162
167
 
163
168
 
@@ -201,8 +206,58 @@ void Debug::GenerateStubNoRegistersDebugBreak(MacroAssembler* masm) {
201
206
  }
202
207
 
203
208
 
209
+ void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
210
+ masm->ret(0);
211
+ }
212
+
213
+ // FrameDropper is a code replacement for a JavaScript frame with possibly
214
+ // several frames above.
215
+ // There is no calling conventions here, because it never actually gets called,
216
+ // it only gets returned to.
217
+ // Frame structure (conforms InternalFrame structure):
218
+ // -- JSFunction
219
+ // -- code
220
+ // -- SMI maker
221
+ // -- context
222
+ // -- frame base
223
+ void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
224
+ // We do not know our frame height, but set esp based on ebp.
225
+ __ lea(esp, Operand(ebp, -4 * kPointerSize));
226
+
227
+ __ pop(edi); // function
228
+
229
+ // Skip code self-reference and marker.
230
+ __ add(Operand(esp), Immediate(2 * kPointerSize));
231
+
232
+ __ pop(esi); // Context.
233
+ __ pop(ebp);
234
+
235
+ // Get function code.
236
+ __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
237
+ __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset));
238
+ __ lea(edx, FieldOperand(edx, Code::kHeaderSize));
239
+
240
+ // Re-run JSFunction, edi is function, esi is context.
241
+ __ jmp(Operand(edx));
242
+ }
243
+
204
244
  #undef __
205
245
 
246
+
247
+ void Debug::SetUpFrameDropperFrame(StackFrame* bottom_js_frame,
248
+ Handle<Code> code) {
249
+ ASSERT(bottom_js_frame->is_java_script());
250
+
251
+ Address fp = bottom_js_frame->fp();
252
+ Memory::Object_at(fp - 4 * kPointerSize) =
253
+ Memory::Object_at(fp - 2 * kPointerSize); // Move edi (function).
254
+
255
+ Memory::Object_at(fp - 3 * kPointerSize) = *code;
256
+ Memory::Object_at(fp - 2 * kPointerSize) = Smi::FromInt(StackFrame::INTERNAL);
257
+ }
258
+ const int Debug::kFrameDropperFrameSize = 5;
259
+
260
+
206
261
  #endif // ENABLE_DEBUGGER_SUPPORT
207
262
 
208
263
  } } // namespace v8::internal
@@ -53,22 +53,25 @@ struct ByteMnemonic {
53
53
 
54
54
  static ByteMnemonic two_operands_instr[] = {
55
55
  {0x03, "add", REG_OPER_OP_ORDER},
56
- {0x21, "and", OPER_REG_OP_ORDER},
57
- {0x23, "and", REG_OPER_OP_ORDER},
58
- {0x3B, "cmp", REG_OPER_OP_ORDER},
59
- {0x8D, "lea", REG_OPER_OP_ORDER},
60
56
  {0x09, "or", OPER_REG_OP_ORDER},
61
57
  {0x0B, "or", REG_OPER_OP_ORDER},
62
58
  {0x1B, "sbb", REG_OPER_OP_ORDER},
59
+ {0x21, "and", OPER_REG_OP_ORDER},
60
+ {0x23, "and", REG_OPER_OP_ORDER},
63
61
  {0x29, "sub", OPER_REG_OP_ORDER},
64
62
  {0x2A, "subb", REG_OPER_OP_ORDER},
65
63
  {0x2B, "sub", REG_OPER_OP_ORDER},
66
- {0x85, "test", REG_OPER_OP_ORDER},
67
64
  {0x31, "xor", OPER_REG_OP_ORDER},
68
65
  {0x33, "xor", REG_OPER_OP_ORDER},
66
+ {0x38, "cmpb", OPER_REG_OP_ORDER},
67
+ {0x3A, "cmpb", REG_OPER_OP_ORDER},
68
+ {0x3B, "cmp", REG_OPER_OP_ORDER},
69
+ {0x84, "test_b", REG_OPER_OP_ORDER},
70
+ {0x85, "test", REG_OPER_OP_ORDER},
69
71
  {0x87, "xchg", REG_OPER_OP_ORDER},
70
72
  {0x8A, "mov_b", REG_OPER_OP_ORDER},
71
73
  {0x8B, "mov", REG_OPER_OP_ORDER},
74
+ {0x8D, "lea", REG_OPER_OP_ORDER},
72
75
  {-1, "", UNSET_OP_ORDER}
73
76
  };
74
77
 
@@ -86,6 +89,7 @@ static ByteMnemonic zero_operands_instr[] = {
86
89
  {0x9E, "sahf", UNSET_OP_ORDER},
87
90
  {0x99, "cdq", UNSET_OP_ORDER},
88
91
  {0x9B, "fwait", UNSET_OP_ORDER},
92
+ {0xFC, "cld", UNSET_OP_ORDER},
89
93
  {-1, "", UNSET_OP_ORDER}
90
94
  };
91
95
 
@@ -676,6 +680,7 @@ int DisassemblerIA32::MemoryFPUInstruction(int escape_opcode,
676
680
 
677
681
  case 0xDD: switch (regop) {
678
682
  case 0: mnem = "fld_d"; break;
683
+ case 2: mnem = "fstp"; break;
679
684
  case 3: mnem = "fstp_d"; break;
680
685
  default: UnimplementedInstruction();
681
686
  }
@@ -717,6 +722,7 @@ int DisassemblerIA32::RegisterFPUInstruction(int escape_opcode,
717
722
  case 0xE1: mnem = "fabs"; break;
718
723
  case 0xE4: mnem = "ftst"; break;
719
724
  case 0xE8: mnem = "fld1"; break;
725
+ case 0xEB: mnem = "fldpi"; break;
720
726
  case 0xEE: mnem = "fldz"; break;
721
727
  case 0xF5: mnem = "fprem1"; break;
722
728
  case 0xF7: mnem = "fincstp"; break;
@@ -1011,7 +1017,6 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
1011
1017
  int mod, regop, rm;
1012
1018
  get_modrm(*data, &mod, &regop, &rm);
1013
1019
  const char* mnem = NULL;
1014
- printf("%d\n", regop);
1015
1020
  switch (regop) {
1016
1021
  case 5: mnem = "subb"; break;
1017
1022
  case 7: mnem = "cmpb"; break;
@@ -1051,12 +1056,39 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
1051
1056
  AppendToBuffer(",%s", NameOfCPURegister(regop));
1052
1057
  } else if (*data == 0x0F) {
1053
1058
  data++;
1054
- if (*data == 0x2F) {
1059
+ if (*data == 0x38) {
1060
+ data++;
1061
+ if (*data == 0x17) {
1062
+ data++;
1063
+ int mod, regop, rm;
1064
+ get_modrm(*data, &mod, &regop, &rm);
1065
+ AppendToBuffer("ptest %s,%s",
1066
+ NameOfXMMRegister(regop),
1067
+ NameOfXMMRegister(rm));
1068
+ data++;
1069
+ } else {
1070
+ UnimplementedInstruction();
1071
+ }
1072
+ } else if (*data == 0x2E || *data == 0x2F) {
1073
+ const char* mnem = (*data == 0x2E) ? "ucomisd" : "comisd";
1055
1074
  data++;
1056
1075
  int mod, regop, rm;
1057
1076
  get_modrm(*data, &mod, &regop, &rm);
1058
- AppendToBuffer("comisd %s,%s",
1059
- NameOfXMMRegister(regop),
1077
+ if (mod == 0x3) {
1078
+ AppendToBuffer("%s %s,%s", mnem,
1079
+ NameOfXMMRegister(regop),
1080
+ NameOfXMMRegister(rm));
1081
+ data++;
1082
+ } else {
1083
+ AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop));
1084
+ data += PrintRightOperand(data);
1085
+ }
1086
+ } else if (*data == 0x50) {
1087
+ data++;
1088
+ int mod, regop, rm;
1089
+ get_modrm(*data, &mod, &regop, &rm);
1090
+ AppendToBuffer("movmskpd %s,%s",
1091
+ NameOfCPURegister(regop),
1060
1092
  NameOfXMMRegister(rm));
1061
1093
  data++;
1062
1094
  } else if (*data == 0x57) {
@@ -1067,6 +1099,12 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
1067
1099
  NameOfXMMRegister(regop),
1068
1100
  NameOfXMMRegister(rm));
1069
1101
  data++;
1102
+ } else if (*data == 0x6E) {
1103
+ data++;
1104
+ int mod, regop, rm;
1105
+ get_modrm(*data, &mod, &regop, &rm);
1106
+ AppendToBuffer("movd %s,", NameOfXMMRegister(regop));
1107
+ data += PrintRightOperand(data);
1070
1108
  } else if (*data == 0x6F) {
1071
1109
  data++;
1072
1110
  int mod, regop, rm;
@@ -1080,6 +1118,14 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
1080
1118
  get_modrm(*data, &mod, &regop, &rm);
1081
1119
  data += PrintRightOperand(data);
1082
1120
  AppendToBuffer(",%s", NameOfXMMRegister(regop));
1121
+ } else if (*data == 0xEF) {
1122
+ data++;
1123
+ int mod, regop, rm;
1124
+ get_modrm(*data, &mod, &regop, &rm);
1125
+ AppendToBuffer("pxor %s,%s",
1126
+ NameOfXMMRegister(regop),
1127
+ NameOfXMMRegister(rm));
1128
+ data++;
1083
1129
  } else {
1084
1130
  UnimplementedInstruction();
1085
1131
  }
@@ -1166,6 +1212,8 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
1166
1212
  const char* mnem = "?";
1167
1213
  switch (b2) {
1168
1214
  case 0x2A: mnem = "cvtsi2sd"; break;
1215
+ case 0x2C: mnem = "cvttsd2si"; break;
1216
+ case 0x51: mnem = "sqrtsd"; break;
1169
1217
  case 0x58: mnem = "addsd"; break;
1170
1218
  case 0x59: mnem = "mulsd"; break;
1171
1219
  case 0x5C: mnem = "subsd"; break;
@@ -1175,14 +1223,38 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
1175
1223
  int mod, regop, rm;
1176
1224
  get_modrm(*data, &mod, &regop, &rm);
1177
1225
  if (b2 == 0x2A) {
1178
- AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop));
1179
- data += PrintRightOperand(data);
1226
+ if (mod != 0x3) {
1227
+ AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop));
1228
+ data += PrintRightOperand(data);
1229
+ } else {
1230
+ AppendToBuffer("%s %s,%s",
1231
+ mnem,
1232
+ NameOfXMMRegister(regop),
1233
+ NameOfCPURegister(rm));
1234
+ data++;
1235
+ }
1236
+ } else if (b2 == 0x2C) {
1237
+ if (mod != 0x3) {
1238
+ AppendToBuffer("%s %s,", mnem, NameOfCPURegister(regop));
1239
+ data += PrintRightOperand(data);
1240
+ } else {
1241
+ AppendToBuffer("%s %s,%s",
1242
+ mnem,
1243
+ NameOfCPURegister(regop),
1244
+ NameOfXMMRegister(rm));
1245
+ data++;
1246
+ }
1180
1247
  } else {
1181
- AppendToBuffer("%s %s,%s",
1182
- mnem,
1183
- NameOfXMMRegister(regop),
1184
- NameOfXMMRegister(rm));
1185
- data++;
1248
+ if (mod != 0x3) {
1249
+ AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop));
1250
+ data += PrintRightOperand(data);
1251
+ } else {
1252
+ AppendToBuffer("%s %s,%s",
1253
+ mnem,
1254
+ NameOfXMMRegister(regop),
1255
+ NameOfXMMRegister(rm));
1256
+ data++;
1257
+ }
1186
1258
  }
1187
1259
  }
1188
1260
  } else {
@@ -1195,6 +1267,14 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
1195
1267
  if (*(data+2) == 0x2C) {
1196
1268
  data += 3;
1197
1269
  data += PrintOperands("cvttss2si", REG_OPER_OP_ORDER, data);
1270
+ } else if (*(data+2) == 0x5A) {
1271
+ data += 3;
1272
+ int mod, regop, rm;
1273
+ get_modrm(*data, &mod, &regop, &rm);
1274
+ AppendToBuffer("cvtss2sd %s,%s",
1275
+ NameOfXMMRegister(regop),
1276
+ NameOfXMMRegister(rm));
1277
+ data++;
1198
1278
  } else if (*(data+2) == 0x6F) {
1199
1279
  data += 3;
1200
1280
  int mod, regop, rm;
@@ -1214,6 +1294,9 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
1214
1294
  } else if (*(data+1) == 0xA5) {
1215
1295
  data += 2;
1216
1296
  AppendToBuffer("rep_movs");
1297
+ } else if (*(data+1) == 0xAB) {
1298
+ data += 2;
1299
+ AppendToBuffer("rep_stos");
1217
1300
  } else {
1218
1301
  UnimplementedInstruction();
1219
1302
  }
@@ -0,0 +1,950 @@
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 "fast-codegen.h"
32
+ #include "data-flow.h"
33
+ #include "scopes.h"
34
+
35
+ namespace v8 {
36
+ namespace internal {
37
+
38
+ #define BAILOUT(reason) \
39
+ do { \
40
+ if (FLAG_trace_bailout) { \
41
+ PrintF("%s\n", reason); \
42
+ } \
43
+ has_supported_syntax_ = false; \
44
+ return; \
45
+ } while (false)
46
+
47
+
48
+ #define CHECK_BAILOUT \
49
+ do { \
50
+ if (!has_supported_syntax_) return; \
51
+ } while (false)
52
+
53
+
54
+ void FastCodeGenSyntaxChecker::Check(CompilationInfo* info) {
55
+ info_ = info;
56
+
57
+ // We do not specialize if we do not have a receiver or if it is not a
58
+ // JS object with fast mode properties.
59
+ if (!info->has_receiver()) BAILOUT("No receiver");
60
+ if (!info->receiver()->IsJSObject()) BAILOUT("Receiver is not an object");
61
+ Handle<JSObject> object = Handle<JSObject>::cast(info->receiver());
62
+ if (!object->HasFastProperties()) BAILOUT("Receiver is in dictionary mode");
63
+
64
+ // We do not support stack or heap slots (both of which require
65
+ // allocation).
66
+ Scope* scope = info->scope();
67
+ if (scope->num_stack_slots() > 0) {
68
+ BAILOUT("Function has stack-allocated locals");
69
+ }
70
+ if (scope->num_heap_slots() > 0) {
71
+ BAILOUT("Function has context-allocated locals");
72
+ }
73
+
74
+ VisitDeclarations(scope->declarations());
75
+ CHECK_BAILOUT;
76
+
77
+ // We do not support empty function bodies.
78
+ if (info->function()->body()->is_empty()) {
79
+ BAILOUT("Function has an empty body");
80
+ }
81
+ VisitStatements(info->function()->body());
82
+ }
83
+
84
+
85
+ void FastCodeGenSyntaxChecker::VisitDeclarations(
86
+ ZoneList<Declaration*>* decls) {
87
+ if (!decls->is_empty()) BAILOUT("Function has declarations");
88
+ }
89
+
90
+
91
+ void FastCodeGenSyntaxChecker::VisitStatements(ZoneList<Statement*>* stmts) {
92
+ if (stmts->length() != 1) {
93
+ BAILOUT("Function body is not a singleton statement.");
94
+ }
95
+ Visit(stmts->at(0));
96
+ }
97
+
98
+
99
+ void FastCodeGenSyntaxChecker::VisitDeclaration(Declaration* decl) {
100
+ UNREACHABLE();
101
+ }
102
+
103
+
104
+ void FastCodeGenSyntaxChecker::VisitBlock(Block* stmt) {
105
+ VisitStatements(stmt->statements());
106
+ }
107
+
108
+
109
+ void FastCodeGenSyntaxChecker::VisitExpressionStatement(
110
+ ExpressionStatement* stmt) {
111
+ Visit(stmt->expression());
112
+ }
113
+
114
+
115
+ void FastCodeGenSyntaxChecker::VisitEmptyStatement(EmptyStatement* stmt) {
116
+ // Supported.
117
+ }
118
+
119
+
120
+ void FastCodeGenSyntaxChecker::VisitIfStatement(IfStatement* stmt) {
121
+ BAILOUT("IfStatement");
122
+ }
123
+
124
+
125
+ void FastCodeGenSyntaxChecker::VisitContinueStatement(ContinueStatement* stmt) {
126
+ BAILOUT("Continuestatement");
127
+ }
128
+
129
+
130
+ void FastCodeGenSyntaxChecker::VisitBreakStatement(BreakStatement* stmt) {
131
+ BAILOUT("BreakStatement");
132
+ }
133
+
134
+
135
+ void FastCodeGenSyntaxChecker::VisitReturnStatement(ReturnStatement* stmt) {
136
+ BAILOUT("ReturnStatement");
137
+ }
138
+
139
+
140
+ void FastCodeGenSyntaxChecker::VisitWithEnterStatement(
141
+ WithEnterStatement* stmt) {
142
+ BAILOUT("WithEnterStatement");
143
+ }
144
+
145
+
146
+ void FastCodeGenSyntaxChecker::VisitWithExitStatement(WithExitStatement* stmt) {
147
+ BAILOUT("WithExitStatement");
148
+ }
149
+
150
+
151
+ void FastCodeGenSyntaxChecker::VisitSwitchStatement(SwitchStatement* stmt) {
152
+ BAILOUT("SwitchStatement");
153
+ }
154
+
155
+
156
+ void FastCodeGenSyntaxChecker::VisitDoWhileStatement(DoWhileStatement* stmt) {
157
+ BAILOUT("DoWhileStatement");
158
+ }
159
+
160
+
161
+ void FastCodeGenSyntaxChecker::VisitWhileStatement(WhileStatement* stmt) {
162
+ BAILOUT("WhileStatement");
163
+ }
164
+
165
+
166
+ void FastCodeGenSyntaxChecker::VisitForStatement(ForStatement* stmt) {
167
+ BAILOUT("ForStatement");
168
+ }
169
+
170
+
171
+ void FastCodeGenSyntaxChecker::VisitForInStatement(ForInStatement* stmt) {
172
+ BAILOUT("ForInStatement");
173
+ }
174
+
175
+
176
+ void FastCodeGenSyntaxChecker::VisitTryCatchStatement(TryCatchStatement* stmt) {
177
+ BAILOUT("TryCatchStatement");
178
+ }
179
+
180
+
181
+ void FastCodeGenSyntaxChecker::VisitTryFinallyStatement(
182
+ TryFinallyStatement* stmt) {
183
+ BAILOUT("TryFinallyStatement");
184
+ }
185
+
186
+
187
+ void FastCodeGenSyntaxChecker::VisitDebuggerStatement(
188
+ DebuggerStatement* stmt) {
189
+ BAILOUT("DebuggerStatement");
190
+ }
191
+
192
+
193
+ void FastCodeGenSyntaxChecker::VisitFunctionLiteral(FunctionLiteral* expr) {
194
+ BAILOUT("FunctionLiteral");
195
+ }
196
+
197
+
198
+ void FastCodeGenSyntaxChecker::VisitSharedFunctionInfoLiteral(
199
+ SharedFunctionInfoLiteral* expr) {
200
+ BAILOUT("SharedFunctionInfoLiteral");
201
+ }
202
+
203
+
204
+ void FastCodeGenSyntaxChecker::VisitConditional(Conditional* expr) {
205
+ BAILOUT("Conditional");
206
+ }
207
+
208
+
209
+ void FastCodeGenSyntaxChecker::VisitSlot(Slot* expr) {
210
+ UNREACHABLE();
211
+ }
212
+
213
+
214
+ void FastCodeGenSyntaxChecker::VisitVariableProxy(VariableProxy* expr) {
215
+ // Only global variable references are supported.
216
+ Variable* var = expr->var();
217
+ if (!var->is_global() || var->is_this()) BAILOUT("Non-global variable");
218
+
219
+ // Check if the global variable is existing and non-deletable.
220
+ if (info()->has_global_object()) {
221
+ LookupResult lookup;
222
+ info()->global_object()->Lookup(*expr->name(), &lookup);
223
+ if (!lookup.IsProperty()) {
224
+ BAILOUT("Non-existing global variable");
225
+ }
226
+ // We do not handle global variables with accessors or interceptors.
227
+ if (lookup.type() != NORMAL) {
228
+ BAILOUT("Global variable with accessors or interceptors.");
229
+ }
230
+ // We do not handle deletable global variables.
231
+ if (!lookup.IsDontDelete()) {
232
+ BAILOUT("Deletable global variable");
233
+ }
234
+ }
235
+ }
236
+
237
+
238
+ void FastCodeGenSyntaxChecker::VisitLiteral(Literal* expr) {
239
+ BAILOUT("Literal");
240
+ }
241
+
242
+
243
+ void FastCodeGenSyntaxChecker::VisitRegExpLiteral(RegExpLiteral* expr) {
244
+ BAILOUT("RegExpLiteral");
245
+ }
246
+
247
+
248
+ void FastCodeGenSyntaxChecker::VisitObjectLiteral(ObjectLiteral* expr) {
249
+ BAILOUT("ObjectLiteral");
250
+ }
251
+
252
+
253
+ void FastCodeGenSyntaxChecker::VisitArrayLiteral(ArrayLiteral* expr) {
254
+ BAILOUT("ArrayLiteral");
255
+ }
256
+
257
+
258
+ void FastCodeGenSyntaxChecker::VisitCatchExtensionObject(
259
+ CatchExtensionObject* expr) {
260
+ BAILOUT("CatchExtensionObject");
261
+ }
262
+
263
+
264
+ void FastCodeGenSyntaxChecker::VisitAssignment(Assignment* expr) {
265
+ // Simple assignments to (named) this properties are supported.
266
+ if (expr->op() != Token::ASSIGN) BAILOUT("Non-simple assignment");
267
+
268
+ Property* prop = expr->target()->AsProperty();
269
+ if (prop == NULL) BAILOUT("Non-property assignment");
270
+ VariableProxy* proxy = prop->obj()->AsVariableProxy();
271
+ if (proxy == NULL || !proxy->var()->is_this()) {
272
+ BAILOUT("Non-this-property assignment");
273
+ }
274
+ if (!prop->key()->IsPropertyName()) {
275
+ BAILOUT("Non-named-property assignment");
276
+ }
277
+
278
+ // We will only specialize for fields on the object itself.
279
+ // Expression::IsPropertyName implies that the name is a literal
280
+ // symbol but we do not assume that.
281
+ Literal* key = prop->key()->AsLiteral();
282
+ if (key != NULL && key->handle()->IsString()) {
283
+ Handle<Object> receiver = info()->receiver();
284
+ Handle<String> name = Handle<String>::cast(key->handle());
285
+ LookupResult lookup;
286
+ receiver->Lookup(*name, &lookup);
287
+ if (!lookup.IsProperty()) {
288
+ BAILOUT("Assigned property not found at compile time");
289
+ }
290
+ if (lookup.holder() != *receiver) BAILOUT("Non-own property assignment");
291
+ if (!lookup.type() == FIELD) BAILOUT("Non-field property assignment");
292
+ } else {
293
+ UNREACHABLE();
294
+ BAILOUT("Unexpected non-string-literal property key");
295
+ }
296
+
297
+ Visit(expr->value());
298
+ }
299
+
300
+
301
+ void FastCodeGenSyntaxChecker::VisitThrow(Throw* expr) {
302
+ BAILOUT("Throw");
303
+ }
304
+
305
+
306
+ void FastCodeGenSyntaxChecker::VisitProperty(Property* expr) {
307
+ // We support named this property references.
308
+ VariableProxy* proxy = expr->obj()->AsVariableProxy();
309
+ if (proxy == NULL || !proxy->var()->is_this()) {
310
+ BAILOUT("Non-this-property reference");
311
+ }
312
+ if (!expr->key()->IsPropertyName()) {
313
+ BAILOUT("Non-named-property reference");
314
+ }
315
+
316
+ // We will only specialize for fields on the object itself.
317
+ // Expression::IsPropertyName implies that the name is a literal
318
+ // symbol but we do not assume that.
319
+ Literal* key = expr->key()->AsLiteral();
320
+ if (key != NULL && key->handle()->IsString()) {
321
+ Handle<Object> receiver = info()->receiver();
322
+ Handle<String> name = Handle<String>::cast(key->handle());
323
+ LookupResult lookup;
324
+ receiver->Lookup(*name, &lookup);
325
+ if (!lookup.IsProperty()) {
326
+ BAILOUT("Referenced property not found at compile time");
327
+ }
328
+ if (lookup.holder() != *receiver) BAILOUT("Non-own property reference");
329
+ if (!lookup.type() == FIELD) BAILOUT("Non-field property reference");
330
+ } else {
331
+ UNREACHABLE();
332
+ BAILOUT("Unexpected non-string-literal property key");
333
+ }
334
+ }
335
+
336
+
337
+ void FastCodeGenSyntaxChecker::VisitCall(Call* expr) {
338
+ BAILOUT("Call");
339
+ }
340
+
341
+
342
+ void FastCodeGenSyntaxChecker::VisitCallNew(CallNew* expr) {
343
+ BAILOUT("CallNew");
344
+ }
345
+
346
+
347
+ void FastCodeGenSyntaxChecker::VisitCallRuntime(CallRuntime* expr) {
348
+ BAILOUT("CallRuntime");
349
+ }
350
+
351
+
352
+ void FastCodeGenSyntaxChecker::VisitUnaryOperation(UnaryOperation* expr) {
353
+ BAILOUT("UnaryOperation");
354
+ }
355
+
356
+
357
+ void FastCodeGenSyntaxChecker::VisitCountOperation(CountOperation* expr) {
358
+ BAILOUT("CountOperation");
359
+ }
360
+
361
+
362
+ void FastCodeGenSyntaxChecker::VisitBinaryOperation(BinaryOperation* expr) {
363
+ // We support bitwise OR.
364
+ switch (expr->op()) {
365
+ case Token::COMMA:
366
+ BAILOUT("BinaryOperation COMMA");
367
+ case Token::OR:
368
+ BAILOUT("BinaryOperation OR");
369
+ case Token::AND:
370
+ BAILOUT("BinaryOperation AND");
371
+
372
+ case Token::BIT_OR:
373
+ // We support expressions nested on the left because they only require
374
+ // a pair of registers to keep all intermediate values in registers
375
+ // (i.e., the expression stack has height no more than two).
376
+ if (!expr->right()->IsLeaf()) BAILOUT("expression nested on right");
377
+
378
+ // We do not allow subexpressions with side effects because we
379
+ // (currently) bail out to the beginning of the full function. The
380
+ // only expressions with side effects that we would otherwise handle
381
+ // are assignments.
382
+ if (expr->left()->AsAssignment() != NULL ||
383
+ expr->right()->AsAssignment() != NULL) {
384
+ BAILOUT("subexpression of binary operation has side effects");
385
+ }
386
+
387
+ Visit(expr->left());
388
+ CHECK_BAILOUT;
389
+ Visit(expr->right());
390
+ break;
391
+
392
+ case Token::BIT_XOR:
393
+ BAILOUT("BinaryOperation BIT_XOR");
394
+ case Token::BIT_AND:
395
+ BAILOUT("BinaryOperation BIT_AND");
396
+ case Token::SHL:
397
+ BAILOUT("BinaryOperation SHL");
398
+ case Token::SAR:
399
+ BAILOUT("BinaryOperation SAR");
400
+ case Token::SHR:
401
+ BAILOUT("BinaryOperation SHR");
402
+ case Token::ADD:
403
+ BAILOUT("BinaryOperation ADD");
404
+ case Token::SUB:
405
+ BAILOUT("BinaryOperation SUB");
406
+ case Token::MUL:
407
+ BAILOUT("BinaryOperation MUL");
408
+ case Token::DIV:
409
+ BAILOUT("BinaryOperation DIV");
410
+ case Token::MOD:
411
+ BAILOUT("BinaryOperation MOD");
412
+ default:
413
+ UNREACHABLE();
414
+ }
415
+ }
416
+
417
+
418
+ void FastCodeGenSyntaxChecker::VisitCompareOperation(CompareOperation* expr) {
419
+ BAILOUT("CompareOperation");
420
+ }
421
+
422
+
423
+ void FastCodeGenSyntaxChecker::VisitThisFunction(ThisFunction* expr) {
424
+ BAILOUT("ThisFunction");
425
+ }
426
+
427
+ #undef BAILOUT
428
+ #undef CHECK_BAILOUT
429
+
430
+
431
+ #define __ ACCESS_MASM(masm())
432
+
433
+ Handle<Code> FastCodeGenerator::MakeCode(CompilationInfo* info) {
434
+ // Label the AST before calling MakeCodePrologue, so AST node numbers are
435
+ // printed with the AST.
436
+ AstLabeler labeler;
437
+ labeler.Label(info);
438
+
439
+ CodeGenerator::MakeCodePrologue(info);
440
+
441
+ const int kInitialBufferSize = 4 * KB;
442
+ MacroAssembler masm(NULL, kInitialBufferSize);
443
+
444
+ // Generate the fast-path code.
445
+ FastCodeGenerator fast_cgen(&masm);
446
+ fast_cgen.Generate(info);
447
+ if (fast_cgen.HasStackOverflow()) {
448
+ ASSERT(!Top::has_pending_exception());
449
+ return Handle<Code>::null();
450
+ }
451
+
452
+ // Generate the full code for the function in bailout mode, using the same
453
+ // macro assembler.
454
+ CodeGenerator cgen(&masm);
455
+ CodeGeneratorScope scope(&cgen);
456
+ info->set_mode(CompilationInfo::SECONDARY);
457
+ cgen.Generate(info);
458
+ if (cgen.HasStackOverflow()) {
459
+ ASSERT(!Top::has_pending_exception());
460
+ return Handle<Code>::null();
461
+ }
462
+
463
+ Code::Flags flags = Code::ComputeFlags(Code::FUNCTION, NOT_IN_LOOP);
464
+ return CodeGenerator::MakeCodeEpilogue(&masm, flags, info);
465
+ }
466
+
467
+
468
+ Register FastCodeGenerator::accumulator0() { return eax; }
469
+ Register FastCodeGenerator::accumulator1() { return edx; }
470
+ Register FastCodeGenerator::scratch0() { return ecx; }
471
+ Register FastCodeGenerator::scratch1() { return edi; }
472
+ Register FastCodeGenerator::receiver_reg() { return ebx; }
473
+ Register FastCodeGenerator::context_reg() { return esi; }
474
+
475
+
476
+ void FastCodeGenerator::EmitLoadReceiver() {
477
+ // Offset 2 is due to return address and saved frame pointer.
478
+ int index = 2 + function()->scope()->num_parameters();
479
+ __ mov(receiver_reg(), Operand(ebp, index * kPointerSize));
480
+ }
481
+
482
+
483
+ void FastCodeGenerator::EmitGlobalVariableLoad(Handle<Object> cell) {
484
+ ASSERT(!destination().is(no_reg));
485
+ ASSERT(cell->IsJSGlobalPropertyCell());
486
+
487
+ __ mov(destination(), Immediate(cell));
488
+ __ mov(destination(),
489
+ FieldOperand(destination(), JSGlobalPropertyCell::kValueOffset));
490
+ if (FLAG_debug_code) {
491
+ __ cmp(destination(), Factory::the_hole_value());
492
+ __ Check(not_equal, "DontDelete cells can't contain the hole");
493
+ }
494
+
495
+ // The loaded value is not known to be a smi.
496
+ clear_as_smi(destination());
497
+ }
498
+
499
+
500
+ void FastCodeGenerator::EmitThisPropertyStore(Handle<String> name) {
501
+ LookupResult lookup;
502
+ info()->receiver()->Lookup(*name, &lookup);
503
+
504
+ ASSERT(lookup.holder() == *info()->receiver());
505
+ ASSERT(lookup.type() == FIELD);
506
+ Handle<Map> map(Handle<HeapObject>::cast(info()->receiver())->map());
507
+ int index = lookup.GetFieldIndex() - map->inobject_properties();
508
+ int offset = index * kPointerSize;
509
+
510
+ // We will emit the write barrier unless the stored value is statically
511
+ // known to be a smi.
512
+ bool needs_write_barrier = !is_smi(accumulator0());
513
+
514
+ // Perform the store. Negative offsets are inobject properties.
515
+ if (offset < 0) {
516
+ offset += map->instance_size();
517
+ __ mov(FieldOperand(receiver_reg(), offset), accumulator0());
518
+ if (needs_write_barrier) {
519
+ // Preserve receiver from write barrier.
520
+ __ mov(scratch0(), receiver_reg());
521
+ }
522
+ } else {
523
+ offset += FixedArray::kHeaderSize;
524
+ __ mov(scratch0(),
525
+ FieldOperand(receiver_reg(), JSObject::kPropertiesOffset));
526
+ __ mov(FieldOperand(scratch0(), offset), accumulator0());
527
+ }
528
+
529
+ if (needs_write_barrier) {
530
+ if (destination().is(no_reg)) {
531
+ // After RecordWrite accumulator0 is only accidently a smi, but it is
532
+ // already marked as not known to be one.
533
+ __ RecordWrite(scratch0(), offset, accumulator0(), scratch1());
534
+ } else {
535
+ // Copy the value to the other accumulator to preserve a copy from the
536
+ // write barrier. One of the accumulators is available as a scratch
537
+ // register. Neither is a smi.
538
+ __ mov(accumulator1(), accumulator0());
539
+ clear_as_smi(accumulator1());
540
+ Register value_scratch = other_accumulator(destination());
541
+ __ RecordWrite(scratch0(), offset, value_scratch, scratch1());
542
+ }
543
+ } else if (destination().is(accumulator1())) {
544
+ __ mov(accumulator1(), accumulator0());
545
+ // Is a smi because we do not need the write barrier.
546
+ set_as_smi(accumulator1());
547
+ }
548
+ }
549
+
550
+
551
+ void FastCodeGenerator::EmitThisPropertyLoad(Handle<String> name) {
552
+ ASSERT(!destination().is(no_reg));
553
+ LookupResult lookup;
554
+ info()->receiver()->Lookup(*name, &lookup);
555
+
556
+ ASSERT(lookup.holder() == *info()->receiver());
557
+ ASSERT(lookup.type() == FIELD);
558
+ Handle<Map> map(Handle<HeapObject>::cast(info()->receiver())->map());
559
+ int index = lookup.GetFieldIndex() - map->inobject_properties();
560
+ int offset = index * kPointerSize;
561
+
562
+ // Perform the load. Negative offsets are inobject properties.
563
+ if (offset < 0) {
564
+ offset += map->instance_size();
565
+ __ mov(destination(), FieldOperand(receiver_reg(), offset));
566
+ } else {
567
+ offset += FixedArray::kHeaderSize;
568
+ __ mov(scratch0(),
569
+ FieldOperand(receiver_reg(), JSObject::kPropertiesOffset));
570
+ __ mov(destination(), FieldOperand(scratch0(), offset));
571
+ }
572
+
573
+ // The loaded value is not known to be a smi.
574
+ clear_as_smi(destination());
575
+ }
576
+
577
+
578
+ void FastCodeGenerator::EmitBitOr() {
579
+ if (is_smi(accumulator0()) && is_smi(accumulator1())) {
580
+ // If both operands are known to be a smi then there is no need to check
581
+ // the operands or result. There is no need to perform the operation in
582
+ // an effect context.
583
+ if (!destination().is(no_reg)) {
584
+ // Leave the result in the destination register. Bitwise or is
585
+ // commutative.
586
+ __ or_(destination(), Operand(other_accumulator(destination())));
587
+ }
588
+ } else {
589
+ // Left is in accumulator1, right in accumulator0.
590
+ Label* bailout = NULL;
591
+ if (destination().is(accumulator0())) {
592
+ __ mov(scratch0(), accumulator0());
593
+ __ or_(destination(), Operand(accumulator1())); // Or is commutative.
594
+ __ test(destination(), Immediate(kSmiTagMask));
595
+ bailout = info()->AddBailout(accumulator1(), scratch0()); // Left, right.
596
+ } else if (destination().is(accumulator1())) {
597
+ __ mov(scratch0(), accumulator1());
598
+ __ or_(destination(), Operand(accumulator0()));
599
+ __ test(destination(), Immediate(kSmiTagMask));
600
+ bailout = info()->AddBailout(scratch0(), accumulator0());
601
+ } else {
602
+ ASSERT(destination().is(no_reg));
603
+ __ mov(scratch0(), accumulator1());
604
+ __ or_(scratch0(), Operand(accumulator0()));
605
+ __ test(scratch0(), Immediate(kSmiTagMask));
606
+ bailout = info()->AddBailout(accumulator1(), accumulator0());
607
+ }
608
+ __ j(not_zero, bailout, not_taken);
609
+ }
610
+
611
+ // If we didn't bailout, the result (in fact, both inputs too) is known to
612
+ // be a smi.
613
+ set_as_smi(accumulator0());
614
+ set_as_smi(accumulator1());
615
+ }
616
+
617
+
618
+ void FastCodeGenerator::Generate(CompilationInfo* compilation_info) {
619
+ ASSERT(info_ == NULL);
620
+ info_ = compilation_info;
621
+ Comment cmnt(masm_, "[ function compiled by fast code generator");
622
+
623
+ // Save the caller's frame pointer and set up our own.
624
+ Comment prologue_cmnt(masm(), ";; Prologue");
625
+ __ push(ebp);
626
+ __ mov(ebp, esp);
627
+ __ push(esi); // Context.
628
+ __ push(edi); // Closure.
629
+ // Note that we keep a live register reference to esi (context) at this
630
+ // point.
631
+
632
+ Label* bailout_to_beginning = info()->AddBailout();
633
+ // Receiver (this) is allocated to a fixed register.
634
+ if (info()->has_this_properties()) {
635
+ Comment cmnt(masm(), ";; MapCheck(this)");
636
+ if (FLAG_print_ir) {
637
+ PrintF("#: MapCheck(this)\n");
638
+ }
639
+ ASSERT(info()->has_receiver() && info()->receiver()->IsHeapObject());
640
+ Handle<HeapObject> object = Handle<HeapObject>::cast(info()->receiver());
641
+ Handle<Map> map(object->map());
642
+ EmitLoadReceiver();
643
+ __ CheckMap(receiver_reg(), map, bailout_to_beginning, false);
644
+ }
645
+
646
+ // If there is a global variable access check if the global object is the
647
+ // same as at lazy-compilation time.
648
+ if (info()->has_globals()) {
649
+ Comment cmnt(masm(), ";; MapCheck(GLOBAL)");
650
+ if (FLAG_print_ir) {
651
+ PrintF("#: MapCheck(GLOBAL)\n");
652
+ }
653
+ ASSERT(info()->has_global_object());
654
+ Handle<Map> map(info()->global_object()->map());
655
+ __ mov(scratch0(), CodeGenerator::GlobalObject());
656
+ __ CheckMap(scratch0(), map, bailout_to_beginning, true);
657
+ }
658
+
659
+ VisitStatements(function()->body());
660
+
661
+ Comment return_cmnt(masm(), ";; Return(<undefined>)");
662
+ if (FLAG_print_ir) {
663
+ PrintF("#: Return(<undefined>)\n");
664
+ }
665
+ __ mov(eax, Factory::undefined_value());
666
+ __ mov(esp, ebp);
667
+ __ pop(ebp);
668
+ __ ret((scope()->num_parameters() + 1) * kPointerSize);
669
+ }
670
+
671
+
672
+ void FastCodeGenerator::VisitDeclaration(Declaration* decl) {
673
+ UNREACHABLE();
674
+ }
675
+
676
+
677
+ void FastCodeGenerator::VisitBlock(Block* stmt) {
678
+ VisitStatements(stmt->statements());
679
+ }
680
+
681
+
682
+ void FastCodeGenerator::VisitExpressionStatement(ExpressionStatement* stmt) {
683
+ Visit(stmt->expression());
684
+ }
685
+
686
+
687
+ void FastCodeGenerator::VisitEmptyStatement(EmptyStatement* stmt) {
688
+ // Nothing to do.
689
+ }
690
+
691
+
692
+ void FastCodeGenerator::VisitIfStatement(IfStatement* stmt) {
693
+ UNREACHABLE();
694
+ }
695
+
696
+
697
+ void FastCodeGenerator::VisitContinueStatement(ContinueStatement* stmt) {
698
+ UNREACHABLE();
699
+ }
700
+
701
+
702
+ void FastCodeGenerator::VisitBreakStatement(BreakStatement* stmt) {
703
+ UNREACHABLE();
704
+ }
705
+
706
+
707
+ void FastCodeGenerator::VisitReturnStatement(ReturnStatement* stmt) {
708
+ UNREACHABLE();
709
+ }
710
+
711
+
712
+ void FastCodeGenerator::VisitWithEnterStatement(WithEnterStatement* stmt) {
713
+ UNREACHABLE();
714
+ }
715
+
716
+
717
+ void FastCodeGenerator::VisitWithExitStatement(WithExitStatement* stmt) {
718
+ UNREACHABLE();
719
+ }
720
+
721
+
722
+ void FastCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
723
+ UNREACHABLE();
724
+ }
725
+
726
+
727
+ void FastCodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) {
728
+ UNREACHABLE();
729
+ }
730
+
731
+
732
+ void FastCodeGenerator::VisitWhileStatement(WhileStatement* stmt) {
733
+ UNREACHABLE();
734
+ }
735
+
736
+
737
+ void FastCodeGenerator::VisitForStatement(ForStatement* stmt) {
738
+ UNREACHABLE();
739
+ }
740
+
741
+
742
+ void FastCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
743
+ UNREACHABLE();
744
+ }
745
+
746
+
747
+ void FastCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
748
+ UNREACHABLE();
749
+ }
750
+
751
+
752
+ void FastCodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
753
+ UNREACHABLE();
754
+ }
755
+
756
+
757
+ void FastCodeGenerator::VisitDebuggerStatement(DebuggerStatement* stmt) {
758
+ UNREACHABLE();
759
+ }
760
+
761
+
762
+ void FastCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
763
+ UNREACHABLE();
764
+ }
765
+
766
+
767
+ void FastCodeGenerator::VisitSharedFunctionInfoLiteral(
768
+ SharedFunctionInfoLiteral* expr) {
769
+ UNREACHABLE();
770
+ }
771
+
772
+
773
+ void FastCodeGenerator::VisitConditional(Conditional* expr) {
774
+ UNREACHABLE();
775
+ }
776
+
777
+
778
+ void FastCodeGenerator::VisitSlot(Slot* expr) {
779
+ UNREACHABLE();
780
+ }
781
+
782
+
783
+ void FastCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
784
+ ASSERT(expr->var()->is_global() && !expr->var()->is_this());
785
+ // Check if we can compile a global variable load directly from the cell.
786
+ ASSERT(info()->has_global_object());
787
+ LookupResult lookup;
788
+ info()->global_object()->Lookup(*expr->name(), &lookup);
789
+ // We only support normal (non-accessor/interceptor) DontDelete properties
790
+ // for now.
791
+ ASSERT(lookup.IsProperty());
792
+ ASSERT_EQ(NORMAL, lookup.type());
793
+ ASSERT(lookup.IsDontDelete());
794
+ Handle<Object> cell(info()->global_object()->GetPropertyCell(&lookup));
795
+
796
+ // Global variable lookups do not have side effects, so we do not need to
797
+ // emit code if we are in an effect context.
798
+ if (!destination().is(no_reg)) {
799
+ Comment cmnt(masm(), ";; Global");
800
+ if (FLAG_print_ir) {
801
+ SmartPointer<char> name = expr->name()->ToCString();
802
+ PrintF("%d: t%d = Global(%s)\n", expr->num(),
803
+ expr->num(), *name);
804
+ }
805
+ EmitGlobalVariableLoad(cell);
806
+ }
807
+ }
808
+
809
+
810
+ void FastCodeGenerator::VisitLiteral(Literal* expr) {
811
+ UNREACHABLE();
812
+ }
813
+
814
+
815
+ void FastCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
816
+ UNREACHABLE();
817
+ }
818
+
819
+
820
+ void FastCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
821
+ UNREACHABLE();
822
+ }
823
+
824
+
825
+ void FastCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
826
+ UNREACHABLE();
827
+ }
828
+
829
+
830
+ void FastCodeGenerator::VisitCatchExtensionObject(CatchExtensionObject* expr) {
831
+ UNREACHABLE();
832
+ }
833
+
834
+
835
+ void FastCodeGenerator::VisitAssignment(Assignment* expr) {
836
+ // Known to be a simple this property assignment. Effectively a unary
837
+ // operation.
838
+ { Register my_destination = destination();
839
+ set_destination(accumulator0());
840
+ Visit(expr->value());
841
+ set_destination(my_destination);
842
+ }
843
+
844
+ Property* prop = expr->target()->AsProperty();
845
+ ASSERT_NOT_NULL(prop);
846
+ ASSERT_NOT_NULL(prop->obj()->AsVariableProxy());
847
+ ASSERT(prop->obj()->AsVariableProxy()->var()->is_this());
848
+ ASSERT(prop->key()->IsPropertyName());
849
+ Handle<String> name =
850
+ Handle<String>::cast(prop->key()->AsLiteral()->handle());
851
+
852
+ Comment cmnt(masm(), ";; Store to this");
853
+ if (FLAG_print_ir) {
854
+ SmartPointer<char> name_string = name->ToCString();
855
+ PrintF("%d: ", expr->num());
856
+ if (!destination().is(no_reg)) PrintF("t%d = ", expr->num());
857
+ PrintF("Store(this, \"%s\", t%d)\n", *name_string,
858
+ expr->value()->num());
859
+ }
860
+
861
+ EmitThisPropertyStore(name);
862
+ }
863
+
864
+
865
+ void FastCodeGenerator::VisitThrow(Throw* expr) {
866
+ UNREACHABLE();
867
+ }
868
+
869
+
870
+ void FastCodeGenerator::VisitProperty(Property* expr) {
871
+ ASSERT_NOT_NULL(expr->obj()->AsVariableProxy());
872
+ ASSERT(expr->obj()->AsVariableProxy()->var()->is_this());
873
+ ASSERT(expr->key()->IsPropertyName());
874
+ if (!destination().is(no_reg)) {
875
+ Handle<String> name =
876
+ Handle<String>::cast(expr->key()->AsLiteral()->handle());
877
+
878
+ Comment cmnt(masm(), ";; Load from this");
879
+ if (FLAG_print_ir) {
880
+ SmartPointer<char> name_string = name->ToCString();
881
+ PrintF("%d: t%d = Load(this, \"%s\")\n",
882
+ expr->num(), expr->num(), *name_string);
883
+ }
884
+ EmitThisPropertyLoad(name);
885
+ }
886
+ }
887
+
888
+
889
+ void FastCodeGenerator::VisitCall(Call* expr) {
890
+ UNREACHABLE();
891
+ }
892
+
893
+
894
+ void FastCodeGenerator::VisitCallNew(CallNew* expr) {
895
+ UNREACHABLE();
896
+ }
897
+
898
+
899
+ void FastCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
900
+ UNREACHABLE();
901
+ }
902
+
903
+
904
+ void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
905
+ UNREACHABLE();
906
+ }
907
+
908
+
909
+ void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
910
+ UNREACHABLE();
911
+ }
912
+
913
+
914
+ void FastCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
915
+ // We support limited binary operations: bitwise OR only allowed to be
916
+ // nested on the left.
917
+ ASSERT(expr->op() == Token::BIT_OR);
918
+ ASSERT(expr->right()->IsLeaf());
919
+
920
+ { Register my_destination = destination();
921
+ set_destination(accumulator1());
922
+ Visit(expr->left());
923
+ set_destination(accumulator0());
924
+ Visit(expr->right());
925
+ set_destination(my_destination);
926
+ }
927
+
928
+ Comment cmnt(masm(), ";; BIT_OR");
929
+ if (FLAG_print_ir) {
930
+ PrintF("%d: ", expr->num());
931
+ if (!destination().is(no_reg)) PrintF("t%d = ", expr->num());
932
+ PrintF("BIT_OR(t%d, t%d)\n", expr->left()->num(), expr->right()->num());
933
+ }
934
+ EmitBitOr();
935
+ }
936
+
937
+
938
+ void FastCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
939
+ UNREACHABLE();
940
+ }
941
+
942
+
943
+ void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) {
944
+ UNREACHABLE();
945
+ }
946
+
947
+ #undef __
948
+
949
+
950
+ } } // namespace v8::internal