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
@@ -0,0 +1,217 @@
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
+
29
+
30
+ #include "v8.h"
31
+
32
+ #include "codegen-inl.h"
33
+ #include "ic-inl.h"
34
+ #include "runtime.h"
35
+ #include "stub-cache.h"
36
+
37
+ namespace v8 {
38
+ namespace internal {
39
+
40
+
41
+ // ----------------------------------------------------------------------------
42
+ // Static IC stub generators.
43
+ //
44
+
45
+ #define __ ACCESS_MASM(masm)
46
+
47
+
48
+ void LoadIC::GenerateArrayLength(MacroAssembler* masm) {
49
+ UNIMPLEMENTED_MIPS();
50
+ }
51
+
52
+
53
+ void LoadIC::GenerateStringLength(MacroAssembler* masm) {
54
+ UNIMPLEMENTED_MIPS();
55
+ }
56
+
57
+
58
+ void LoadIC::GenerateFunctionPrototype(MacroAssembler* masm) {
59
+ UNIMPLEMENTED_MIPS();
60
+ }
61
+
62
+
63
+ // Defined in ic.cc.
64
+ Object* CallIC_Miss(Arguments args);
65
+
66
+ void CallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) {
67
+ UNIMPLEMENTED_MIPS();
68
+ }
69
+
70
+
71
+ void CallIC::GenerateNormal(MacroAssembler* masm, int argc) {
72
+ UNIMPLEMENTED_MIPS();
73
+ }
74
+
75
+ void CallIC::GenerateMiss(MacroAssembler* masm, int argc) {
76
+ UNIMPLEMENTED_MIPS();
77
+ // Registers:
78
+ // a2: name
79
+ // ra: return address
80
+
81
+ // Get the receiver of the function from the stack.
82
+ __ lw(a3, MemOperand(sp, argc*kPointerSize));
83
+
84
+ __ EnterInternalFrame();
85
+
86
+ // Push the receiver and the name of the function.
87
+ __ MultiPush(a2.bit() | a3.bit());
88
+
89
+ // Call the entry.
90
+ __ li(a0, Operand(2));
91
+ __ li(a1, Operand(ExternalReference(IC_Utility(kCallIC_Miss))));
92
+
93
+ CEntryStub stub(1);
94
+ __ CallStub(&stub);
95
+
96
+ // Move result to r1 and leave the internal frame.
97
+ __ mov(a1, v0);
98
+ __ LeaveInternalFrame();
99
+
100
+ // Check if the receiver is a global object of some sort.
101
+ Label invoke, global;
102
+ __ lw(a2, MemOperand(sp, argc * kPointerSize));
103
+ __ andi(t0, a2, kSmiTagMask);
104
+ __ Branch(eq, &invoke, t0, Operand(zero_reg));
105
+ __ GetObjectType(a2, a3, a3);
106
+ __ Branch(eq, &global, a3, Operand(JS_GLOBAL_OBJECT_TYPE));
107
+ __ Branch(ne, &invoke, a3, Operand(JS_BUILTINS_OBJECT_TYPE));
108
+
109
+ // Patch the receiver on the stack.
110
+ __ bind(&global);
111
+ __ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalReceiverOffset));
112
+ __ sw(a2, MemOperand(sp, argc * kPointerSize));
113
+
114
+ // Invoke the function.
115
+ ParameterCount actual(argc);
116
+ __ bind(&invoke);
117
+ __ InvokeFunction(a1, actual, JUMP_FUNCTION);
118
+ }
119
+
120
+ // Defined in ic.cc.
121
+ Object* LoadIC_Miss(Arguments args);
122
+
123
+ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
124
+ UNIMPLEMENTED_MIPS();
125
+ }
126
+
127
+
128
+ void LoadIC::GenerateNormal(MacroAssembler* masm) {
129
+ UNIMPLEMENTED_MIPS();
130
+ }
131
+
132
+
133
+ void LoadIC::GenerateMiss(MacroAssembler* masm) {
134
+ UNIMPLEMENTED_MIPS();
135
+ }
136
+
137
+
138
+ void LoadIC::ClearInlinedVersion(Address address) {}
139
+ bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) {
140
+ return false;
141
+ }
142
+
143
+ void KeyedLoadIC::ClearInlinedVersion(Address address) {}
144
+ bool KeyedLoadIC::PatchInlinedLoad(Address address, Object* map) {
145
+ return false;
146
+ }
147
+
148
+ void KeyedStoreIC::ClearInlinedVersion(Address address) {}
149
+ void KeyedStoreIC::RestoreInlinedVersion(Address address) {}
150
+ bool KeyedStoreIC::PatchInlinedStore(Address address, Object* map) {
151
+ return false;
152
+ }
153
+
154
+
155
+ Object* KeyedLoadIC_Miss(Arguments args);
156
+
157
+
158
+ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
159
+ UNIMPLEMENTED_MIPS();
160
+ }
161
+
162
+
163
+ void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) {
164
+ UNIMPLEMENTED_MIPS();
165
+ }
166
+
167
+
168
+ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
169
+ UNIMPLEMENTED_MIPS();
170
+ }
171
+
172
+
173
+ void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm,
174
+ ExternalArrayType array_type) {
175
+ UNIMPLEMENTED_MIPS();
176
+ }
177
+
178
+
179
+ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
180
+ UNIMPLEMENTED_MIPS();
181
+ }
182
+
183
+
184
+ void KeyedStoreIC::GenerateExternalArray(MacroAssembler* masm,
185
+ ExternalArrayType array_type) {
186
+ UNIMPLEMENTED_MIPS();
187
+ }
188
+
189
+
190
+ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
191
+ UNIMPLEMENTED_MIPS();
192
+ }
193
+
194
+
195
+ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
196
+ UNIMPLEMENTED_MIPS();
197
+ }
198
+
199
+
200
+ void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
201
+ UNIMPLEMENTED_MIPS();
202
+ }
203
+
204
+
205
+ void StoreIC::GenerateMiss(MacroAssembler* masm) {
206
+ UNIMPLEMENTED_MIPS();
207
+ }
208
+
209
+
210
+ void StoreIC::GenerateArrayLength(MacroAssembler* masm) {
211
+ UNIMPLEMENTED_MIPS();
212
+ }
213
+
214
+ #undef __
215
+
216
+ } } // namespace v8::internal
217
+
@@ -0,0 +1,172 @@
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
+
29
+ #include "v8.h"
30
+
31
+ #include "codegen-inl.h"
32
+ #include "jump-target-inl.h"
33
+ #include "register-allocator-inl.h"
34
+ #include "virtual-frame-inl.h"
35
+
36
+ namespace v8 {
37
+ namespace internal {
38
+
39
+ // -------------------------------------------------------------------------
40
+ // JumpTarget implementation.
41
+
42
+ #define __ ACCESS_MASM(cgen()->masm())
43
+
44
+ void JumpTarget::DoJump() {
45
+ ASSERT(cgen()->has_valid_frame());
46
+ // Live non-frame registers are not allowed at unconditional jumps
47
+ // because we have no way of invalidating the corresponding results
48
+ // which are still live in the C++ code.
49
+ ASSERT(cgen()->HasValidEntryRegisters());
50
+
51
+ if (is_bound()) {
52
+ // Backward jump. There already a frame expectation at the target.
53
+ ASSERT(direction_ == BIDIRECTIONAL);
54
+ cgen()->frame()->MergeTo(entry_frame_);
55
+ cgen()->DeleteFrame();
56
+ } else {
57
+ // Use the current frame as the expected one at the target if necessary.
58
+ if (entry_frame_ == NULL) {
59
+ entry_frame_ = cgen()->frame();
60
+ RegisterFile empty;
61
+ cgen()->SetFrame(NULL, &empty);
62
+ } else {
63
+ cgen()->frame()->MergeTo(entry_frame_);
64
+ cgen()->DeleteFrame();
65
+ }
66
+
67
+ // The predicate is_linked() should be made true. Its implementation
68
+ // detects the presence of a frame pointer in the reaching_frames_ list.
69
+ if (!is_linked()) {
70
+ reaching_frames_.Add(NULL);
71
+ ASSERT(is_linked());
72
+ }
73
+ }
74
+ __ b(&entry_label_);
75
+ __ nop(); // Branch delay slot nop.
76
+ }
77
+
78
+
79
+ void JumpTarget::DoBranch(Condition cc, Hint ignored) {
80
+ UNIMPLEMENTED_MIPS();
81
+ }
82
+
83
+
84
+ void JumpTarget::Call() {
85
+ UNIMPLEMENTED_MIPS();
86
+ }
87
+
88
+
89
+ void JumpTarget::DoBind() {
90
+ ASSERT(!is_bound());
91
+
92
+ // Live non-frame registers are not allowed at the start of a basic
93
+ // block.
94
+ ASSERT(!cgen()->has_valid_frame() || cgen()->HasValidEntryRegisters());
95
+
96
+ if (cgen()->has_valid_frame()) {
97
+ // If there is a current frame we can use it on the fall through.
98
+ if (entry_frame_ == NULL) {
99
+ entry_frame_ = new VirtualFrame(cgen()->frame());
100
+ } else {
101
+ ASSERT(cgen()->frame()->Equals(entry_frame_));
102
+ }
103
+ } else {
104
+ // If there is no current frame we must have an entry frame which we can
105
+ // copy.
106
+ ASSERT(entry_frame_ != NULL);
107
+ RegisterFile empty;
108
+ cgen()->SetFrame(new VirtualFrame(entry_frame_), &empty);
109
+ }
110
+
111
+ // The predicate is_linked() should be made false. Its implementation
112
+ // detects the presence (or absence) of frame pointers in the
113
+ // reaching_frames_ list. If we inserted a bogus frame to make
114
+ // is_linked() true, remove it now.
115
+ if (is_linked()) {
116
+ reaching_frames_.Clear();
117
+ }
118
+
119
+ __ bind(&entry_label_);
120
+ }
121
+
122
+
123
+ void BreakTarget::Jump() {
124
+ // On ARM we do not currently emit merge code for jumps, so we need to do
125
+ // it explicitly here. The only merging necessary is to drop extra
126
+ // statement state from the stack.
127
+ ASSERT(cgen()->has_valid_frame());
128
+ int count = cgen()->frame()->height() - expected_height_;
129
+ cgen()->frame()->Drop(count);
130
+ DoJump();
131
+ }
132
+
133
+
134
+ void BreakTarget::Jump(Result* arg) {
135
+ UNIMPLEMENTED_MIPS();
136
+ }
137
+
138
+
139
+ void BreakTarget::Bind() {
140
+ #ifdef DEBUG
141
+ // All the forward-reaching frames should have been adjusted at the
142
+ // jumps to this target.
143
+ for (int i = 0; i < reaching_frames_.length(); i++) {
144
+ ASSERT(reaching_frames_[i] == NULL ||
145
+ reaching_frames_[i]->height() == expected_height_);
146
+ }
147
+ #endif
148
+ // Drop leftover statement state from the frame before merging, even
149
+ // on the fall through. This is so we can bind the return target
150
+ // with state on the frame.
151
+ if (cgen()->has_valid_frame()) {
152
+ int count = cgen()->frame()->height() - expected_height_;
153
+ // On ARM we do not currently emit merge code at binding sites, so we need
154
+ // to do it explicitly here. The only merging necessary is to drop extra
155
+ // statement state from the stack.
156
+ cgen()->frame()->Drop(count);
157
+ }
158
+
159
+ DoBind();
160
+ }
161
+
162
+
163
+ void BreakTarget::Bind(Result* arg) {
164
+ UNIMPLEMENTED_MIPS();
165
+ }
166
+
167
+
168
+ #undef __
169
+
170
+
171
+ } } // namespace v8::internal
172
+
@@ -0,0 +1,1323 @@
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
+
29
+
30
+ #include "v8.h"
31
+
32
+ #include "bootstrapper.h"
33
+ #include "codegen-inl.h"
34
+ #include "debug.h"
35
+ #include "runtime.h"
36
+
37
+ namespace v8 {
38
+ namespace internal {
39
+
40
+ MacroAssembler::MacroAssembler(void* buffer, int size)
41
+ : Assembler(buffer, size),
42
+ unresolved_(0),
43
+ generating_stub_(false),
44
+ allow_stub_calls_(true),
45
+ code_object_(Heap::undefined_value()) {
46
+ }
47
+
48
+
49
+
50
+ void MacroAssembler::Jump(Register target, Condition cond,
51
+ Register r1, const Operand& r2) {
52
+ Jump(Operand(target), cond, r1, r2);
53
+ }
54
+
55
+
56
+ void MacroAssembler::Jump(intptr_t target, RelocInfo::Mode rmode,
57
+ Condition cond, Register r1, const Operand& r2) {
58
+ Jump(Operand(target, rmode), cond, r1, r2);
59
+ }
60
+
61
+
62
+ void MacroAssembler::Jump(byte* target, RelocInfo::Mode rmode,
63
+ Condition cond, Register r1, const Operand& r2) {
64
+ ASSERT(!RelocInfo::IsCodeTarget(rmode));
65
+ Jump(reinterpret_cast<intptr_t>(target), rmode, cond, r1, r2);
66
+ }
67
+
68
+
69
+ void MacroAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
70
+ Condition cond, Register r1, const Operand& r2) {
71
+ ASSERT(RelocInfo::IsCodeTarget(rmode));
72
+ Jump(reinterpret_cast<intptr_t>(code.location()), rmode, cond);
73
+ }
74
+
75
+
76
+ void MacroAssembler::Call(Register target,
77
+ Condition cond, Register r1, const Operand& r2) {
78
+ Call(Operand(target), cond, r1, r2);
79
+ }
80
+
81
+
82
+ void MacroAssembler::Call(intptr_t target, RelocInfo::Mode rmode,
83
+ Condition cond, Register r1, const Operand& r2) {
84
+ Call(Operand(target, rmode), cond, r1, r2);
85
+ }
86
+
87
+
88
+ void MacroAssembler::Call(byte* target, RelocInfo::Mode rmode,
89
+ Condition cond, Register r1, const Operand& r2) {
90
+ ASSERT(!RelocInfo::IsCodeTarget(rmode));
91
+ Call(reinterpret_cast<intptr_t>(target), rmode, cond, r1, r2);
92
+ }
93
+
94
+
95
+ void MacroAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode,
96
+ Condition cond, Register r1, const Operand& r2) {
97
+ ASSERT(RelocInfo::IsCodeTarget(rmode));
98
+ Call(reinterpret_cast<intptr_t>(code.location()), rmode, cond, r1, r2);
99
+ }
100
+
101
+
102
+ void MacroAssembler::Ret(Condition cond, Register r1, const Operand& r2) {
103
+ Jump(Operand(ra), cond, r1, r2);
104
+ }
105
+
106
+
107
+ void MacroAssembler::LoadRoot(Register destination,
108
+ Heap::RootListIndex index) {
109
+ lw(destination, MemOperand(s6, index << kPointerSizeLog2));
110
+ }
111
+
112
+ void MacroAssembler::LoadRoot(Register destination,
113
+ Heap::RootListIndex index,
114
+ Condition cond,
115
+ Register src1, const Operand& src2) {
116
+ Branch(NegateCondition(cond), 2, src1, src2);
117
+ lw(destination, MemOperand(s6, index << kPointerSizeLog2));
118
+ }
119
+
120
+
121
+ void MacroAssembler::RecordWrite(Register object, Register offset,
122
+ Register scratch) {
123
+ UNIMPLEMENTED_MIPS();
124
+ }
125
+
126
+
127
+ // ---------------------------------------------------------------------------
128
+ // Instruction macros
129
+
130
+ void MacroAssembler::Add(Register rd, Register rs, const Operand& rt) {
131
+ if (rt.is_reg()) {
132
+ add(rd, rs, rt.rm());
133
+ } else {
134
+ if (is_int16(rt.imm32_) && !MustUseAt(rt.rmode_)) {
135
+ addi(rd, rs, rt.imm32_);
136
+ } else {
137
+ // li handles the relocation.
138
+ ASSERT(!rs.is(at));
139
+ li(at, rt);
140
+ add(rd, rs, at);
141
+ }
142
+ }
143
+ }
144
+
145
+
146
+ void MacroAssembler::Addu(Register rd, Register rs, const Operand& rt) {
147
+ if (rt.is_reg()) {
148
+ addu(rd, rs, rt.rm());
149
+ } else {
150
+ if (is_int16(rt.imm32_) && !MustUseAt(rt.rmode_)) {
151
+ addiu(rd, rs, rt.imm32_);
152
+ } else {
153
+ // li handles the relocation.
154
+ ASSERT(!rs.is(at));
155
+ li(at, rt);
156
+ addu(rd, rs, at);
157
+ }
158
+ }
159
+ }
160
+
161
+
162
+ void MacroAssembler::Mul(Register rd, Register rs, const Operand& rt) {
163
+ if (rt.is_reg()) {
164
+ mul(rd, rs, rt.rm());
165
+ } else {
166
+ // li handles the relocation.
167
+ ASSERT(!rs.is(at));
168
+ li(at, rt);
169
+ mul(rd, rs, at);
170
+ }
171
+ }
172
+
173
+
174
+ void MacroAssembler::Mult(Register rs, const Operand& rt) {
175
+ if (rt.is_reg()) {
176
+ mult(rs, rt.rm());
177
+ } else {
178
+ // li handles the relocation.
179
+ ASSERT(!rs.is(at));
180
+ li(at, rt);
181
+ mult(rs, at);
182
+ }
183
+ }
184
+
185
+
186
+ void MacroAssembler::Multu(Register rs, const Operand& rt) {
187
+ if (rt.is_reg()) {
188
+ multu(rs, rt.rm());
189
+ } else {
190
+ // li handles the relocation.
191
+ ASSERT(!rs.is(at));
192
+ li(at, rt);
193
+ multu(rs, at);
194
+ }
195
+ }
196
+
197
+
198
+ void MacroAssembler::Div(Register rs, const Operand& rt) {
199
+ if (rt.is_reg()) {
200
+ div(rs, rt.rm());
201
+ } else {
202
+ // li handles the relocation.
203
+ ASSERT(!rs.is(at));
204
+ li(at, rt);
205
+ div(rs, at);
206
+ }
207
+ }
208
+
209
+
210
+ void MacroAssembler::Divu(Register rs, const Operand& rt) {
211
+ if (rt.is_reg()) {
212
+ divu(rs, rt.rm());
213
+ } else {
214
+ // li handles the relocation.
215
+ ASSERT(!rs.is(at));
216
+ li(at, rt);
217
+ divu(rs, at);
218
+ }
219
+ }
220
+
221
+
222
+ void MacroAssembler::And(Register rd, Register rs, const Operand& rt) {
223
+ if (rt.is_reg()) {
224
+ and_(rd, rs, rt.rm());
225
+ } else {
226
+ if (is_int16(rt.imm32_) && !MustUseAt(rt.rmode_)) {
227
+ andi(rd, rs, rt.imm32_);
228
+ } else {
229
+ // li handles the relocation.
230
+ ASSERT(!rs.is(at));
231
+ li(at, rt);
232
+ and_(rd, rs, at);
233
+ }
234
+ }
235
+ }
236
+
237
+
238
+ void MacroAssembler::Or(Register rd, Register rs, const Operand& rt) {
239
+ if (rt.is_reg()) {
240
+ or_(rd, rs, rt.rm());
241
+ } else {
242
+ if (is_int16(rt.imm32_) && !MustUseAt(rt.rmode_)) {
243
+ ori(rd, rs, rt.imm32_);
244
+ } else {
245
+ // li handles the relocation.
246
+ ASSERT(!rs.is(at));
247
+ li(at, rt);
248
+ or_(rd, rs, at);
249
+ }
250
+ }
251
+ }
252
+
253
+
254
+ void MacroAssembler::Xor(Register rd, Register rs, const Operand& rt) {
255
+ if (rt.is_reg()) {
256
+ xor_(rd, rs, rt.rm());
257
+ } else {
258
+ if (is_int16(rt.imm32_) && !MustUseAt(rt.rmode_)) {
259
+ xori(rd, rs, rt.imm32_);
260
+ } else {
261
+ // li handles the relocation.
262
+ ASSERT(!rs.is(at));
263
+ li(at, rt);
264
+ xor_(rd, rs, at);
265
+ }
266
+ }
267
+ }
268
+
269
+
270
+ void MacroAssembler::Nor(Register rd, Register rs, const Operand& rt) {
271
+ if (rt.is_reg()) {
272
+ nor(rd, rs, rt.rm());
273
+ } else {
274
+ // li handles the relocation.
275
+ ASSERT(!rs.is(at));
276
+ li(at, rt);
277
+ nor(rd, rs, at);
278
+ }
279
+ }
280
+
281
+
282
+ void MacroAssembler::Slt(Register rd, Register rs, const Operand& rt) {
283
+ if (rt.is_reg()) {
284
+ slt(rd, rs, rt.rm());
285
+ } else {
286
+ if (is_int16(rt.imm32_) && !MustUseAt(rt.rmode_)) {
287
+ slti(rd, rs, rt.imm32_);
288
+ } else {
289
+ // li handles the relocation.
290
+ ASSERT(!rs.is(at));
291
+ li(at, rt);
292
+ slt(rd, rs, at);
293
+ }
294
+ }
295
+ }
296
+
297
+
298
+ void MacroAssembler::Sltu(Register rd, Register rs, const Operand& rt) {
299
+ if (rt.is_reg()) {
300
+ sltu(rd, rs, rt.rm());
301
+ } else {
302
+ if (is_int16(rt.imm32_) && !MustUseAt(rt.rmode_)) {
303
+ sltiu(rd, rs, rt.imm32_);
304
+ } else {
305
+ // li handles the relocation.
306
+ ASSERT(!rs.is(at));
307
+ li(at, rt);
308
+ sltu(rd, rs, at);
309
+ }
310
+ }
311
+ }
312
+
313
+
314
+ //------------Pseudo-instructions-------------
315
+
316
+ void MacroAssembler::movn(Register rd, Register rt) {
317
+ addiu(at, zero_reg, -1); // Fill at with ones.
318
+ xor_(rd, rt, at);
319
+ }
320
+
321
+
322
+ void MacroAssembler::li(Register rd, Operand j, bool gen2instr) {
323
+ ASSERT(!j.is_reg());
324
+
325
+ if (!MustUseAt(j.rmode_) && !gen2instr) {
326
+ // Normal load of an immediate value which does not need Relocation Info.
327
+ if (is_int16(j.imm32_)) {
328
+ addiu(rd, zero_reg, j.imm32_);
329
+ } else if (!(j.imm32_ & HIMask)) {
330
+ ori(rd, zero_reg, j.imm32_);
331
+ } else if (!(j.imm32_ & LOMask)) {
332
+ lui(rd, (HIMask & j.imm32_) >> 16);
333
+ } else {
334
+ lui(rd, (HIMask & j.imm32_) >> 16);
335
+ ori(rd, rd, (LOMask & j.imm32_));
336
+ }
337
+ } else if (MustUseAt(j.rmode_) || gen2instr) {
338
+ if (MustUseAt(j.rmode_)) {
339
+ RecordRelocInfo(j.rmode_, j.imm32_);
340
+ }
341
+ // We need always the same number of instructions as we may need to patch
342
+ // this code to load another value which may need 2 instructions to load.
343
+ if (is_int16(j.imm32_)) {
344
+ nop();
345
+ addiu(rd, zero_reg, j.imm32_);
346
+ } else if (!(j.imm32_ & HIMask)) {
347
+ nop();
348
+ ori(rd, zero_reg, j.imm32_);
349
+ } else if (!(j.imm32_ & LOMask)) {
350
+ nop();
351
+ lui(rd, (HIMask & j.imm32_) >> 16);
352
+ } else {
353
+ lui(rd, (HIMask & j.imm32_) >> 16);
354
+ ori(rd, rd, (LOMask & j.imm32_));
355
+ }
356
+ }
357
+ }
358
+
359
+
360
+ // Exception-generating instructions and debugging support
361
+ void MacroAssembler::stop(const char* msg) {
362
+ // TO_UPGRADE: Just a break for now. Maybe we could upgrade it.
363
+ // We use the 0x54321 value to be able to find it easily when reading memory.
364
+ break_(0x54321);
365
+ }
366
+
367
+
368
+ void MacroAssembler::MultiPush(RegList regs) {
369
+ int16_t NumSaved = 0;
370
+ int16_t NumToPush = NumberOfBitsSet(regs);
371
+
372
+ addiu(sp, sp, -4 * NumToPush);
373
+ for (int16_t i = kNumRegisters; i > 0; i--) {
374
+ if ((regs & (1 << i)) != 0) {
375
+ sw(ToRegister(i), MemOperand(sp, 4 * (NumToPush - ++NumSaved)));
376
+ }
377
+ }
378
+ }
379
+
380
+
381
+ void MacroAssembler::MultiPushReversed(RegList regs) {
382
+ int16_t NumSaved = 0;
383
+ int16_t NumToPush = NumberOfBitsSet(regs);
384
+
385
+ addiu(sp, sp, -4 * NumToPush);
386
+ for (int16_t i = 0; i < kNumRegisters; i++) {
387
+ if ((regs & (1 << i)) != 0) {
388
+ sw(ToRegister(i), MemOperand(sp, 4 * (NumToPush - ++NumSaved)));
389
+ }
390
+ }
391
+ }
392
+
393
+
394
+ void MacroAssembler::MultiPop(RegList regs) {
395
+ int16_t NumSaved = 0;
396
+
397
+ for (int16_t i = 0; i < kNumRegisters; i++) {
398
+ if ((regs & (1 << i)) != 0) {
399
+ lw(ToRegister(i), MemOperand(sp, 4 * (NumSaved++)));
400
+ }
401
+ }
402
+ addiu(sp, sp, 4 * NumSaved);
403
+ }
404
+
405
+
406
+ void MacroAssembler::MultiPopReversed(RegList regs) {
407
+ int16_t NumSaved = 0;
408
+
409
+ for (int16_t i = kNumRegisters; i > 0; i--) {
410
+ if ((regs & (1 << i)) != 0) {
411
+ lw(ToRegister(i), MemOperand(sp, 4 * (NumSaved++)));
412
+ }
413
+ }
414
+ addiu(sp, sp, 4 * NumSaved);
415
+ }
416
+
417
+
418
+ // Emulated condtional branches do not emit a nop in the branch delay slot.
419
+
420
+ // Trashes the at register if no scratch register is provided.
421
+ void MacroAssembler::Branch(Condition cond, int16_t offset, Register rs,
422
+ const Operand& rt, Register scratch) {
423
+ Register r2 = no_reg;
424
+ if (rt.is_reg()) {
425
+ // We don't want any other register but scratch clobbered.
426
+ ASSERT(!scratch.is(rs) && !scratch.is(rt.rm_));
427
+ r2 = rt.rm_;
428
+ } else if (cond != cc_always) {
429
+ // We don't want any other register but scratch clobbered.
430
+ ASSERT(!scratch.is(rs));
431
+ r2 = scratch;
432
+ li(r2, rt);
433
+ }
434
+
435
+ switch (cond) {
436
+ case cc_always:
437
+ b(offset);
438
+ break;
439
+ case eq:
440
+ beq(rs, r2, offset);
441
+ break;
442
+ case ne:
443
+ bne(rs, r2, offset);
444
+ break;
445
+
446
+ // Signed comparison
447
+ case greater:
448
+ slt(scratch, r2, rs);
449
+ bne(scratch, zero_reg, offset);
450
+ break;
451
+ case greater_equal:
452
+ slt(scratch, rs, r2);
453
+ beq(scratch, zero_reg, offset);
454
+ break;
455
+ case less:
456
+ slt(scratch, rs, r2);
457
+ bne(scratch, zero_reg, offset);
458
+ break;
459
+ case less_equal:
460
+ slt(scratch, r2, rs);
461
+ beq(scratch, zero_reg, offset);
462
+ break;
463
+
464
+ // Unsigned comparison.
465
+ case Ugreater:
466
+ sltu(scratch, r2, rs);
467
+ bne(scratch, zero_reg, offset);
468
+ break;
469
+ case Ugreater_equal:
470
+ sltu(scratch, rs, r2);
471
+ beq(scratch, zero_reg, offset);
472
+ break;
473
+ case Uless:
474
+ sltu(scratch, rs, r2);
475
+ bne(scratch, zero_reg, offset);
476
+ break;
477
+ case Uless_equal:
478
+ sltu(scratch, r2, rs);
479
+ beq(scratch, zero_reg, offset);
480
+ break;
481
+
482
+ default:
483
+ UNREACHABLE();
484
+ }
485
+ // Emit a nop in the branch delay slot.
486
+ nop();
487
+ }
488
+
489
+
490
+ void MacroAssembler::Branch(Condition cond, Label* L, Register rs,
491
+ const Operand& rt, Register scratch) {
492
+ Register r2 = no_reg;
493
+ if (rt.is_reg()) {
494
+ r2 = rt.rm_;
495
+ } else if (cond != cc_always) {
496
+ r2 = scratch;
497
+ li(r2, rt);
498
+ }
499
+
500
+ // We use branch_offset as an argument for the branch instructions to be sure
501
+ // it is called just before generating the branch instruction, as needed.
502
+
503
+ switch (cond) {
504
+ case cc_always:
505
+ b(shifted_branch_offset(L, false));
506
+ break;
507
+ case eq:
508
+ beq(rs, r2, shifted_branch_offset(L, false));
509
+ break;
510
+ case ne:
511
+ bne(rs, r2, shifted_branch_offset(L, false));
512
+ break;
513
+
514
+ // Signed comparison
515
+ case greater:
516
+ slt(scratch, r2, rs);
517
+ bne(scratch, zero_reg, shifted_branch_offset(L, false));
518
+ break;
519
+ case greater_equal:
520
+ slt(scratch, rs, r2);
521
+ beq(scratch, zero_reg, shifted_branch_offset(L, false));
522
+ break;
523
+ case less:
524
+ slt(scratch, rs, r2);
525
+ bne(scratch, zero_reg, shifted_branch_offset(L, false));
526
+ break;
527
+ case less_equal:
528
+ slt(scratch, r2, rs);
529
+ beq(scratch, zero_reg, shifted_branch_offset(L, false));
530
+ break;
531
+
532
+ // Unsigned comparison.
533
+ case Ugreater:
534
+ sltu(scratch, r2, rs);
535
+ bne(scratch, zero_reg, shifted_branch_offset(L, false));
536
+ break;
537
+ case Ugreater_equal:
538
+ sltu(scratch, rs, r2);
539
+ beq(scratch, zero_reg, shifted_branch_offset(L, false));
540
+ break;
541
+ case Uless:
542
+ sltu(scratch, rs, r2);
543
+ bne(scratch, zero_reg, shifted_branch_offset(L, false));
544
+ break;
545
+ case Uless_equal:
546
+ sltu(scratch, r2, rs);
547
+ beq(scratch, zero_reg, shifted_branch_offset(L, false));
548
+ break;
549
+
550
+ default:
551
+ UNREACHABLE();
552
+ }
553
+ // Emit a nop in the branch delay slot.
554
+ nop();
555
+ }
556
+
557
+
558
+ // Trashes the at register if no scratch register is provided.
559
+ // We need to use a bgezal or bltzal, but they can't be used directly with the
560
+ // slt instructions. We could use sub or add instead but we would miss overflow
561
+ // cases, so we keep slt and add an intermediate third instruction.
562
+ void MacroAssembler::BranchAndLink(Condition cond, int16_t offset, Register rs,
563
+ const Operand& rt, Register scratch) {
564
+ Register r2 = no_reg;
565
+ if (rt.is_reg()) {
566
+ r2 = rt.rm_;
567
+ } else if (cond != cc_always) {
568
+ r2 = scratch;
569
+ li(r2, rt);
570
+ }
571
+
572
+ switch (cond) {
573
+ case cc_always:
574
+ bal(offset);
575
+ break;
576
+ case eq:
577
+ bne(rs, r2, 2);
578
+ nop();
579
+ bal(offset);
580
+ break;
581
+ case ne:
582
+ beq(rs, r2, 2);
583
+ nop();
584
+ bal(offset);
585
+ break;
586
+
587
+ // Signed comparison
588
+ case greater:
589
+ slt(scratch, r2, rs);
590
+ addiu(scratch, scratch, -1);
591
+ bgezal(scratch, offset);
592
+ break;
593
+ case greater_equal:
594
+ slt(scratch, rs, r2);
595
+ addiu(scratch, scratch, -1);
596
+ bltzal(scratch, offset);
597
+ break;
598
+ case less:
599
+ slt(scratch, rs, r2);
600
+ addiu(scratch, scratch, -1);
601
+ bgezal(scratch, offset);
602
+ break;
603
+ case less_equal:
604
+ slt(scratch, r2, rs);
605
+ addiu(scratch, scratch, -1);
606
+ bltzal(scratch, offset);
607
+ break;
608
+
609
+ // Unsigned comparison.
610
+ case Ugreater:
611
+ sltu(scratch, r2, rs);
612
+ addiu(scratch, scratch, -1);
613
+ bgezal(scratch, offset);
614
+ break;
615
+ case Ugreater_equal:
616
+ sltu(scratch, rs, r2);
617
+ addiu(scratch, scratch, -1);
618
+ bltzal(scratch, offset);
619
+ break;
620
+ case Uless:
621
+ sltu(scratch, rs, r2);
622
+ addiu(scratch, scratch, -1);
623
+ bgezal(scratch, offset);
624
+ break;
625
+ case Uless_equal:
626
+ sltu(scratch, r2, rs);
627
+ addiu(scratch, scratch, -1);
628
+ bltzal(scratch, offset);
629
+ break;
630
+
631
+ default:
632
+ UNREACHABLE();
633
+ }
634
+ // Emit a nop in the branch delay slot.
635
+ nop();
636
+ }
637
+
638
+
639
+ void MacroAssembler::BranchAndLink(Condition cond, Label* L, Register rs,
640
+ const Operand& rt, Register scratch) {
641
+ Register r2 = no_reg;
642
+ if (rt.is_reg()) {
643
+ r2 = rt.rm_;
644
+ } else if (cond != cc_always) {
645
+ r2 = scratch;
646
+ li(r2, rt);
647
+ }
648
+
649
+ switch (cond) {
650
+ case cc_always:
651
+ bal(shifted_branch_offset(L, false));
652
+ break;
653
+ case eq:
654
+ bne(rs, r2, 2);
655
+ nop();
656
+ bal(shifted_branch_offset(L, false));
657
+ break;
658
+ case ne:
659
+ beq(rs, r2, 2);
660
+ nop();
661
+ bal(shifted_branch_offset(L, false));
662
+ break;
663
+
664
+ // Signed comparison
665
+ case greater:
666
+ slt(scratch, r2, rs);
667
+ addiu(scratch, scratch, -1);
668
+ bgezal(scratch, shifted_branch_offset(L, false));
669
+ break;
670
+ case greater_equal:
671
+ slt(scratch, rs, r2);
672
+ addiu(scratch, scratch, -1);
673
+ bltzal(scratch, shifted_branch_offset(L, false));
674
+ break;
675
+ case less:
676
+ slt(scratch, rs, r2);
677
+ addiu(scratch, scratch, -1);
678
+ bgezal(scratch, shifted_branch_offset(L, false));
679
+ break;
680
+ case less_equal:
681
+ slt(scratch, r2, rs);
682
+ addiu(scratch, scratch, -1);
683
+ bltzal(scratch, shifted_branch_offset(L, false));
684
+ break;
685
+
686
+ // Unsigned comparison.
687
+ case Ugreater:
688
+ sltu(scratch, r2, rs);
689
+ addiu(scratch, scratch, -1);
690
+ bgezal(scratch, shifted_branch_offset(L, false));
691
+ break;
692
+ case Ugreater_equal:
693
+ sltu(scratch, rs, r2);
694
+ addiu(scratch, scratch, -1);
695
+ bltzal(scratch, shifted_branch_offset(L, false));
696
+ break;
697
+ case Uless:
698
+ sltu(scratch, rs, r2);
699
+ addiu(scratch, scratch, -1);
700
+ bgezal(scratch, shifted_branch_offset(L, false));
701
+ break;
702
+ case Uless_equal:
703
+ sltu(scratch, r2, rs);
704
+ addiu(scratch, scratch, -1);
705
+ bltzal(scratch, shifted_branch_offset(L, false));
706
+ break;
707
+
708
+ default:
709
+ UNREACHABLE();
710
+ }
711
+ // Emit a nop in the branch delay slot.
712
+ nop();
713
+ }
714
+
715
+
716
+ void MacroAssembler::Jump(const Operand& target,
717
+ Condition cond, Register rs, const Operand& rt) {
718
+ if (target.is_reg()) {
719
+ if (cond == cc_always) {
720
+ jr(target.rm());
721
+ } else {
722
+ Branch(NegateCondition(cond), 2, rs, rt);
723
+ jr(target.rm());
724
+ }
725
+ } else { // !target.is_reg()
726
+ if (!MustUseAt(target.rmode_)) {
727
+ if (cond == cc_always) {
728
+ j(target.imm32_);
729
+ } else {
730
+ Branch(NegateCondition(cond), 2, rs, rt);
731
+ j(target.imm32_); // Will generate only one instruction.
732
+ }
733
+ } else { // MustUseAt(target)
734
+ li(at, target);
735
+ if (cond == cc_always) {
736
+ jr(at);
737
+ } else {
738
+ Branch(NegateCondition(cond), 2, rs, rt);
739
+ jr(at); // Will generate only one instruction.
740
+ }
741
+ }
742
+ }
743
+ // Emit a nop in the branch delay slot.
744
+ nop();
745
+ }
746
+
747
+
748
+ void MacroAssembler::Call(const Operand& target,
749
+ Condition cond, Register rs, const Operand& rt) {
750
+ if (target.is_reg()) {
751
+ if (cond == cc_always) {
752
+ jalr(target.rm());
753
+ } else {
754
+ Branch(NegateCondition(cond), 2, rs, rt);
755
+ jalr(target.rm());
756
+ }
757
+ } else { // !target.is_reg()
758
+ if (!MustUseAt(target.rmode_)) {
759
+ if (cond == cc_always) {
760
+ jal(target.imm32_);
761
+ } else {
762
+ Branch(NegateCondition(cond), 2, rs, rt);
763
+ jal(target.imm32_); // Will generate only one instruction.
764
+ }
765
+ } else { // MustUseAt(target)
766
+ li(at, target);
767
+ if (cond == cc_always) {
768
+ jalr(at);
769
+ } else {
770
+ Branch(NegateCondition(cond), 2, rs, rt);
771
+ jalr(at); // Will generate only one instruction.
772
+ }
773
+ }
774
+ }
775
+ // Emit a nop in the branch delay slot.
776
+ nop();
777
+ }
778
+
779
+ void MacroAssembler::StackLimitCheck(Label* on_stack_overflow) {
780
+ UNIMPLEMENTED_MIPS();
781
+ }
782
+
783
+
784
+ void MacroAssembler::Drop(int count, Condition cond) {
785
+ UNIMPLEMENTED_MIPS();
786
+ }
787
+
788
+
789
+ void MacroAssembler::Call(Label* target) {
790
+ UNIMPLEMENTED_MIPS();
791
+ }
792
+
793
+
794
+ #ifdef ENABLE_DEBUGGER_SUPPORT
795
+ // ---------------------------------------------------------------------------
796
+ // Debugger Support
797
+
798
+ void MacroAssembler::DebugBreak() {
799
+ UNIMPLEMENTED_MIPS();
800
+ }
801
+ #endif
802
+
803
+
804
+ // ---------------------------------------------------------------------------
805
+ // Exception handling
806
+
807
+ void MacroAssembler::PushTryHandler(CodeLocation try_location,
808
+ HandlerType type) {
809
+ // Adjust this code if not the case.
810
+ ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
811
+ // The return address is passed in register ra.
812
+ if (try_location == IN_JAVASCRIPT) {
813
+ if (type == TRY_CATCH_HANDLER) {
814
+ li(t0, Operand(StackHandler::TRY_CATCH));
815
+ } else {
816
+ li(t0, Operand(StackHandler::TRY_FINALLY));
817
+ }
818
+ ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize
819
+ && StackHandlerConstants::kFPOffset == 2 * kPointerSize
820
+ && StackHandlerConstants::kPCOffset == 3 * kPointerSize
821
+ && StackHandlerConstants::kNextOffset == 0 * kPointerSize);
822
+ // Save the current handler as the next handler.
823
+ LoadExternalReference(t2, ExternalReference(Top::k_handler_address));
824
+ lw(t1, MemOperand(t2));
825
+
826
+ addiu(sp, sp, -StackHandlerConstants::kSize);
827
+ sw(ra, MemOperand(sp, 12));
828
+ sw(fp, MemOperand(sp, 8));
829
+ sw(t0, MemOperand(sp, 4));
830
+ sw(t1, MemOperand(sp, 0));
831
+
832
+ // Link this handler as the new current one.
833
+ sw(sp, MemOperand(t2));
834
+
835
+ } else {
836
+ // Must preserve a0-a3, and s0 (argv).
837
+ ASSERT(try_location == IN_JS_ENTRY);
838
+ ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize
839
+ && StackHandlerConstants::kFPOffset == 2 * kPointerSize
840
+ && StackHandlerConstants::kPCOffset == 3 * kPointerSize
841
+ && StackHandlerConstants::kNextOffset == 0 * kPointerSize);
842
+
843
+ // The frame pointer does not point to a JS frame so we save NULL
844
+ // for fp. We expect the code throwing an exception to check fp
845
+ // before dereferencing it to restore the context.
846
+ li(t0, Operand(StackHandler::ENTRY));
847
+
848
+ // Save the current handler as the next handler.
849
+ LoadExternalReference(t2, ExternalReference(Top::k_handler_address));
850
+ lw(t1, MemOperand(t2));
851
+
852
+ addiu(sp, sp, -StackHandlerConstants::kSize);
853
+ sw(ra, MemOperand(sp, 12));
854
+ sw(zero_reg, MemOperand(sp, 8));
855
+ sw(t0, MemOperand(sp, 4));
856
+ sw(t1, MemOperand(sp, 0));
857
+
858
+ // Link this handler as the new current one.
859
+ sw(sp, MemOperand(t2));
860
+ }
861
+ }
862
+
863
+
864
+ void MacroAssembler::PopTryHandler() {
865
+ UNIMPLEMENTED_MIPS();
866
+ }
867
+
868
+
869
+
870
+ // -----------------------------------------------------------------------------
871
+ // Activation frames
872
+
873
+ void MacroAssembler::SetupAlignedCall(Register scratch, int arg_count) {
874
+ Label extra_push, end;
875
+
876
+ andi(scratch, sp, 7);
877
+
878
+ // We check for args and receiver size on the stack, all of them word sized.
879
+ // We add one for sp, that we also want to store on the stack.
880
+ if (((arg_count + 1) % kPointerSizeLog2) == 0) {
881
+ Branch(ne, &extra_push, at, Operand(zero_reg));
882
+ } else { // ((arg_count + 1) % 2) == 1
883
+ Branch(eq, &extra_push, at, Operand(zero_reg));
884
+ }
885
+
886
+ // Save sp on the stack.
887
+ mov(scratch, sp);
888
+ Push(scratch);
889
+ b(&end);
890
+
891
+ // Align before saving sp on the stack.
892
+ bind(&extra_push);
893
+ mov(scratch, sp);
894
+ addiu(sp, sp, -8);
895
+ sw(scratch, MemOperand(sp));
896
+
897
+ // The stack is aligned and sp is stored on the top.
898
+ bind(&end);
899
+ }
900
+
901
+
902
+ void MacroAssembler::ReturnFromAlignedCall() {
903
+ lw(sp, MemOperand(sp));
904
+ }
905
+
906
+
907
+ // -----------------------------------------------------------------------------
908
+ // JavaScript invokes
909
+
910
+ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
911
+ const ParameterCount& actual,
912
+ Handle<Code> code_constant,
913
+ Register code_reg,
914
+ Label* done,
915
+ InvokeFlag flag) {
916
+ bool definitely_matches = false;
917
+ Label regular_invoke;
918
+
919
+ // Check whether the expected and actual arguments count match. If not,
920
+ // setup registers according to contract with ArgumentsAdaptorTrampoline:
921
+ // a0: actual arguments count
922
+ // a1: function (passed through to callee)
923
+ // a2: expected arguments count
924
+ // a3: callee code entry
925
+
926
+ // The code below is made a lot easier because the calling code already sets
927
+ // up actual and expected registers according to the contract if values are
928
+ // passed in registers.
929
+ ASSERT(actual.is_immediate() || actual.reg().is(a0));
930
+ ASSERT(expected.is_immediate() || expected.reg().is(a2));
931
+ ASSERT((!code_constant.is_null() && code_reg.is(no_reg)) || code_reg.is(a3));
932
+
933
+ if (expected.is_immediate()) {
934
+ ASSERT(actual.is_immediate());
935
+ if (expected.immediate() == actual.immediate()) {
936
+ definitely_matches = true;
937
+ } else {
938
+ li(a0, Operand(actual.immediate()));
939
+ const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel;
940
+ if (expected.immediate() == sentinel) {
941
+ // Don't worry about adapting arguments for builtins that
942
+ // don't want that done. Skip adaption code by making it look
943
+ // like we have a match between expected and actual number of
944
+ // arguments.
945
+ definitely_matches = true;
946
+ } else {
947
+ li(a2, Operand(expected.immediate()));
948
+ }
949
+ }
950
+ } else if (actual.is_immediate()) {
951
+ Branch(eq, &regular_invoke, expected.reg(), Operand(actual.immediate()));
952
+ li(a0, Operand(actual.immediate()));
953
+ } else {
954
+ Branch(eq, &regular_invoke, expected.reg(), Operand(actual.reg()));
955
+ }
956
+
957
+ if (!definitely_matches) {
958
+ if (!code_constant.is_null()) {
959
+ li(a3, Operand(code_constant));
960
+ addiu(a3, a3, Code::kHeaderSize - kHeapObjectTag);
961
+ }
962
+
963
+ ExternalReference adaptor(Builtins::ArgumentsAdaptorTrampoline);
964
+ if (flag == CALL_FUNCTION) {
965
+ CallBuiltin(adaptor);
966
+ b(done);
967
+ nop();
968
+ } else {
969
+ JumpToBuiltin(adaptor);
970
+ }
971
+ bind(&regular_invoke);
972
+ }
973
+ }
974
+
975
+ void MacroAssembler::InvokeCode(Register code,
976
+ const ParameterCount& expected,
977
+ const ParameterCount& actual,
978
+ InvokeFlag flag) {
979
+ Label done;
980
+
981
+ InvokePrologue(expected, actual, Handle<Code>::null(), code, &done, flag);
982
+ if (flag == CALL_FUNCTION) {
983
+ Call(code);
984
+ } else {
985
+ ASSERT(flag == JUMP_FUNCTION);
986
+ Jump(code);
987
+ }
988
+ // Continue here if InvokePrologue does handle the invocation due to
989
+ // mismatched parameter counts.
990
+ bind(&done);
991
+ }
992
+
993
+
994
+ void MacroAssembler::InvokeCode(Handle<Code> code,
995
+ const ParameterCount& expected,
996
+ const ParameterCount& actual,
997
+ RelocInfo::Mode rmode,
998
+ InvokeFlag flag) {
999
+ Label done;
1000
+
1001
+ InvokePrologue(expected, actual, code, no_reg, &done, flag);
1002
+ if (flag == CALL_FUNCTION) {
1003
+ Call(code, rmode);
1004
+ } else {
1005
+ Jump(code, rmode);
1006
+ }
1007
+ // Continue here if InvokePrologue does handle the invocation due to
1008
+ // mismatched parameter counts.
1009
+ bind(&done);
1010
+ }
1011
+
1012
+
1013
+ void MacroAssembler::InvokeFunction(Register function,
1014
+ const ParameterCount& actual,
1015
+ InvokeFlag flag) {
1016
+ // Contract with called JS functions requires that function is passed in a1.
1017
+ ASSERT(function.is(a1));
1018
+ Register expected_reg = a2;
1019
+ Register code_reg = a3;
1020
+
1021
+ lw(code_reg, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
1022
+ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
1023
+ lw(expected_reg,
1024
+ FieldMemOperand(code_reg,
1025
+ SharedFunctionInfo::kFormalParameterCountOffset));
1026
+ lw(code_reg,
1027
+ MemOperand(code_reg, SharedFunctionInfo::kCodeOffset - kHeapObjectTag));
1028
+ addiu(code_reg, code_reg, Code::kHeaderSize - kHeapObjectTag);
1029
+
1030
+ ParameterCount expected(expected_reg);
1031
+ InvokeCode(code_reg, expected, actual, flag);
1032
+ }
1033
+
1034
+
1035
+ // ---------------------------------------------------------------------------
1036
+ // Support functions.
1037
+
1038
+ void MacroAssembler::GetObjectType(Register function,
1039
+ Register map,
1040
+ Register type_reg) {
1041
+ lw(map, FieldMemOperand(function, HeapObject::kMapOffset));
1042
+ lbu(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset));
1043
+ }
1044
+
1045
+
1046
+ void MacroAssembler::CallBuiltin(ExternalReference builtin_entry) {
1047
+ // Load builtin address.
1048
+ LoadExternalReference(t9, builtin_entry);
1049
+ lw(t9, MemOperand(t9)); // Deref address.
1050
+ addiu(t9, t9, Code::kHeaderSize - kHeapObjectTag);
1051
+ // Call and allocate arguments slots.
1052
+ jalr(t9);
1053
+ // Use the branch delay slot to allocated argument slots.
1054
+ addiu(sp, sp, -StandardFrameConstants::kRArgsSlotsSize);
1055
+ addiu(sp, sp, StandardFrameConstants::kRArgsSlotsSize);
1056
+ }
1057
+
1058
+
1059
+ void MacroAssembler::CallBuiltin(Register target) {
1060
+ // Target already holds target address.
1061
+ // Call and allocate arguments slots.
1062
+ jalr(target);
1063
+ // Use the branch delay slot to allocated argument slots.
1064
+ addiu(sp, sp, -StandardFrameConstants::kRArgsSlotsSize);
1065
+ addiu(sp, sp, StandardFrameConstants::kRArgsSlotsSize);
1066
+ }
1067
+
1068
+
1069
+ void MacroAssembler::JumpToBuiltin(ExternalReference builtin_entry) {
1070
+ // Load builtin address.
1071
+ LoadExternalReference(t9, builtin_entry);
1072
+ lw(t9, MemOperand(t9)); // Deref address.
1073
+ addiu(t9, t9, Code::kHeaderSize - kHeapObjectTag);
1074
+ // Call and allocate arguments slots.
1075
+ jr(t9);
1076
+ // Use the branch delay slot to allocated argument slots.
1077
+ addiu(sp, sp, -StandardFrameConstants::kRArgsSlotsSize);
1078
+ }
1079
+
1080
+
1081
+ void MacroAssembler::JumpToBuiltin(Register target) {
1082
+ // t9 already holds target address.
1083
+ // Call and allocate arguments slots.
1084
+ jr(t9);
1085
+ // Use the branch delay slot to allocated argument slots.
1086
+ addiu(sp, sp, -StandardFrameConstants::kRArgsSlotsSize);
1087
+ }
1088
+
1089
+
1090
+ // -----------------------------------------------------------------------------
1091
+ // Runtime calls
1092
+
1093
+ void MacroAssembler::CallStub(CodeStub* stub, Condition cond,
1094
+ Register r1, const Operand& r2) {
1095
+ ASSERT(allow_stub_calls()); // Stub calls are not allowed in some stubs.
1096
+ Call(stub->GetCode(), RelocInfo::CODE_TARGET, cond, r1, r2);
1097
+ }
1098
+
1099
+
1100
+ void MacroAssembler::StubReturn(int argc) {
1101
+ UNIMPLEMENTED_MIPS();
1102
+ }
1103
+
1104
+
1105
+ void MacroAssembler::IllegalOperation(int num_arguments) {
1106
+ if (num_arguments > 0) {
1107
+ addiu(sp, sp, num_arguments * kPointerSize);
1108
+ }
1109
+ LoadRoot(v0, Heap::kUndefinedValueRootIndex);
1110
+ }
1111
+
1112
+
1113
+ void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) {
1114
+ // All parameters are on the stack. v0 has the return value after call.
1115
+
1116
+ // If the expected number of arguments of the runtime function is
1117
+ // constant, we check that the actual number of arguments match the
1118
+ // expectation.
1119
+ if (f->nargs >= 0 && f->nargs != num_arguments) {
1120
+ IllegalOperation(num_arguments);
1121
+ return;
1122
+ }
1123
+
1124
+ // TODO(1236192): Most runtime routines don't need the number of
1125
+ // arguments passed in because it is constant. At some point we
1126
+ // should remove this need and make the runtime routine entry code
1127
+ // smarter.
1128
+ li(a0, num_arguments);
1129
+ LoadExternalReference(a1, ExternalReference(f));
1130
+ CEntryStub stub(1);
1131
+ CallStub(&stub);
1132
+ }
1133
+
1134
+
1135
+ void MacroAssembler::CallRuntime(Runtime::FunctionId fid, int num_arguments) {
1136
+ CallRuntime(Runtime::FunctionForId(fid), num_arguments);
1137
+ }
1138
+
1139
+
1140
+ void MacroAssembler::TailCallExternalReference(const ExternalReference& ext,
1141
+ int num_arguments,
1142
+ int result_size) {
1143
+ UNIMPLEMENTED_MIPS();
1144
+ }
1145
+
1146
+
1147
+ void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
1148
+ int num_arguments,
1149
+ int result_size) {
1150
+ TailCallExternalReference(ExternalReference(fid), num_arguments, result_size);
1151
+ }
1152
+
1153
+
1154
+ void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) {
1155
+ UNIMPLEMENTED_MIPS();
1156
+ }
1157
+
1158
+
1159
+ Handle<Code> MacroAssembler::ResolveBuiltin(Builtins::JavaScript id,
1160
+ bool* resolved) {
1161
+ UNIMPLEMENTED_MIPS();
1162
+ return Handle<Code>(reinterpret_cast<Code*>(NULL)); // UNIMPLEMENTED RETURN
1163
+ }
1164
+
1165
+
1166
+ void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
1167
+ InvokeJSFlags flags) {
1168
+ UNIMPLEMENTED_MIPS();
1169
+ }
1170
+
1171
+
1172
+ void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) {
1173
+ UNIMPLEMENTED_MIPS();
1174
+ }
1175
+
1176
+
1177
+ void MacroAssembler::SetCounter(StatsCounter* counter, int value,
1178
+ Register scratch1, Register scratch2) {
1179
+ UNIMPLEMENTED_MIPS();
1180
+ }
1181
+
1182
+
1183
+ void MacroAssembler::IncrementCounter(StatsCounter* counter, int value,
1184
+ Register scratch1, Register scratch2) {
1185
+ UNIMPLEMENTED_MIPS();
1186
+ }
1187
+
1188
+
1189
+ void MacroAssembler::DecrementCounter(StatsCounter* counter, int value,
1190
+ Register scratch1, Register scratch2) {
1191
+ UNIMPLEMENTED_MIPS();
1192
+ }
1193
+
1194
+
1195
+ // -----------------------------------------------------------------------------
1196
+ // Debugging
1197
+
1198
+ void MacroAssembler::Assert(Condition cc, const char* msg,
1199
+ Register rs, Operand rt) {
1200
+ UNIMPLEMENTED_MIPS();
1201
+ }
1202
+
1203
+
1204
+ void MacroAssembler::Check(Condition cc, const char* msg,
1205
+ Register rs, Operand rt) {
1206
+ UNIMPLEMENTED_MIPS();
1207
+ }
1208
+
1209
+
1210
+ void MacroAssembler::Abort(const char* msg) {
1211
+ UNIMPLEMENTED_MIPS();
1212
+ }
1213
+
1214
+
1215
+ void MacroAssembler::EnterFrame(StackFrame::Type type) {
1216
+ addiu(sp, sp, -5 * kPointerSize);
1217
+ li(t0, Operand(Smi::FromInt(type)));
1218
+ li(t1, Operand(CodeObject()));
1219
+ sw(ra, MemOperand(sp, 4 * kPointerSize));
1220
+ sw(fp, MemOperand(sp, 3 * kPointerSize));
1221
+ sw(cp, MemOperand(sp, 2 * kPointerSize));
1222
+ sw(t0, MemOperand(sp, 1 * kPointerSize));
1223
+ sw(t1, MemOperand(sp, 0 * kPointerSize));
1224
+ addiu(fp, sp, 3 * kPointerSize);
1225
+ }
1226
+
1227
+
1228
+ void MacroAssembler::LeaveFrame(StackFrame::Type type) {
1229
+ mov(sp, fp);
1230
+ lw(fp, MemOperand(sp, 0 * kPointerSize));
1231
+ lw(ra, MemOperand(sp, 1 * kPointerSize));
1232
+ addiu(sp, sp, 2 * kPointerSize);
1233
+ }
1234
+
1235
+
1236
+ void MacroAssembler::EnterExitFrame(ExitFrame::Mode mode,
1237
+ Register hold_argc,
1238
+ Register hold_argv,
1239
+ Register hold_function) {
1240
+ // Compute the argv pointer and keep it in a callee-saved register.
1241
+ // a0 is argc.
1242
+ sll(t0, a0, kPointerSizeLog2);
1243
+ add(hold_argv, sp, t0);
1244
+ addi(hold_argv, hold_argv, -kPointerSize);
1245
+
1246
+ // Compute callee's stack pointer before making changes and save it as
1247
+ // t1 register so that it is restored as sp register on exit, thereby
1248
+ // popping the args.
1249
+ // t1 = sp + kPointerSize * #args
1250
+ add(t1, sp, t0);
1251
+
1252
+ // Align the stack at this point.
1253
+ AlignStack(0);
1254
+
1255
+ // Save registers.
1256
+ addiu(sp, sp, -12);
1257
+ sw(t1, MemOperand(sp, 8));
1258
+ sw(ra, MemOperand(sp, 4));
1259
+ sw(fp, MemOperand(sp, 0));
1260
+ mov(fp, sp); // Setup new frame pointer.
1261
+
1262
+ // Push debug marker.
1263
+ if (mode == ExitFrame::MODE_DEBUG) {
1264
+ Push(zero_reg);
1265
+ } else {
1266
+ li(t0, Operand(CodeObject()));
1267
+ Push(t0);
1268
+ }
1269
+
1270
+ // Save the frame pointer and the context in top.
1271
+ LoadExternalReference(t0, ExternalReference(Top::k_c_entry_fp_address));
1272
+ sw(fp, MemOperand(t0));
1273
+ LoadExternalReference(t0, ExternalReference(Top::k_context_address));
1274
+ sw(cp, MemOperand(t0));
1275
+
1276
+ // Setup argc and the builtin function in callee-saved registers.
1277
+ mov(hold_argc, a0);
1278
+ mov(hold_function, a1);
1279
+ }
1280
+
1281
+
1282
+ void MacroAssembler::LeaveExitFrame(ExitFrame::Mode mode) {
1283
+ // Clear top frame.
1284
+ LoadExternalReference(t0, ExternalReference(Top::k_c_entry_fp_address));
1285
+ sw(zero_reg, MemOperand(t0));
1286
+
1287
+ // Restore current context from top and clear it in debug mode.
1288
+ LoadExternalReference(t0, ExternalReference(Top::k_context_address));
1289
+ lw(cp, MemOperand(t0));
1290
+ #ifdef DEBUG
1291
+ sw(a3, MemOperand(t0));
1292
+ #endif
1293
+
1294
+ // Pop the arguments, restore registers, and return.
1295
+ mov(sp, fp); // Respect ABI stack constraint.
1296
+ lw(fp, MemOperand(sp, 0));
1297
+ lw(ra, MemOperand(sp, 4));
1298
+ lw(sp, MemOperand(sp, 8));
1299
+ jr(ra);
1300
+ nop(); // Branch delay slot nop.
1301
+ }
1302
+
1303
+
1304
+ void MacroAssembler::AlignStack(int offset) {
1305
+ // On MIPS an offset of 0 aligns to 0 modulo 8 bytes,
1306
+ // and an offset of 1 aligns to 4 modulo 8 bytes.
1307
+ int activation_frame_alignment = OS::ActivationFrameAlignment();
1308
+ if (activation_frame_alignment != kPointerSize) {
1309
+ // This code needs to be made more general if this assert doesn't hold.
1310
+ ASSERT(activation_frame_alignment == 2 * kPointerSize);
1311
+ if (offset == 0) {
1312
+ andi(t0, sp, activation_frame_alignment - 1);
1313
+ Push(zero_reg, eq, t0, zero_reg);
1314
+ } else {
1315
+ andi(t0, sp, activation_frame_alignment - 1);
1316
+ addiu(t0, t0, -4);
1317
+ Push(zero_reg, eq, t0, zero_reg);
1318
+ }
1319
+ }
1320
+ }
1321
+
1322
+ } } // namespace v8::internal
1323
+