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
@@ -87,35 +87,14 @@ class CompressionHelper;
87
87
  #define LOG(Call) ((void) 0)
88
88
  #endif
89
89
 
90
-
91
- class VMState BASE_EMBEDDED {
92
- #ifdef ENABLE_LOGGING_AND_PROFILING
93
- public:
94
- inline VMState(StateTag state);
95
- inline ~VMState();
96
-
97
- StateTag state() { return state_; }
98
- Address external_callback() { return external_callback_; }
99
- void set_external_callback(Address external_callback) {
100
- external_callback_ = external_callback;
101
- }
102
-
103
- private:
104
- bool disabled_;
105
- StateTag state_;
106
- VMState* previous_;
107
- Address external_callback_;
108
- #else
109
- public:
110
- explicit VMState(StateTag state) {}
111
- #endif
112
- };
113
-
114
-
115
90
  #define LOG_EVENTS_AND_TAGS_LIST(V) \
116
91
  V(CODE_CREATION_EVENT, "code-creation", "cc") \
117
92
  V(CODE_MOVE_EVENT, "code-move", "cm") \
118
93
  V(CODE_DELETE_EVENT, "code-delete", "cd") \
94
+ V(FUNCTION_CREATION_EVENT, "function-creation", "fc") \
95
+ V(FUNCTION_MOVE_EVENT, "function-move", "fm") \
96
+ V(FUNCTION_DELETE_EVENT, "function-delete", "fd") \
97
+ V(SNAPSHOT_POSITION_EVENT, "snapshot-pos", "sp") \
119
98
  V(TICK_EVENT, "tick", "t") \
120
99
  V(REPEAT_META_EVENT, "repeat", "r") \
121
100
  V(BUILTIN_TAG, "Builtin", "bi") \
@@ -137,7 +116,13 @@ class VMState BASE_EMBEDDED {
137
116
  V(REG_EXP_TAG, "RegExp", "re") \
138
117
  V(SCRIPT_TAG, "Script", "sc") \
139
118
  V(STORE_IC_TAG, "StoreIC", "sic") \
140
- V(STUB_TAG, "Stub", "s")
119
+ V(STUB_TAG, "Stub", "s") \
120
+ V(NATIVE_FUNCTION_TAG, "Function", "f") \
121
+ V(NATIVE_LAZY_COMPILE_TAG, "LazyCompile", "lc") \
122
+ V(NATIVE_SCRIPT_TAG, "Script", "sc")
123
+ // Note that 'NATIVE_' cases for functions and scripts are mapped onto
124
+ // original tags when writing to the log.
125
+
141
126
 
142
127
  class Logger {
143
128
  public:
@@ -157,12 +142,6 @@ class Logger {
157
142
  // Enable the computation of a sliding window of states.
158
143
  static void EnableSlidingStateWindow();
159
144
 
160
- // Write a raw string to the log to be used as a preamble.
161
- // No check is made that the 'preamble' is actually at the beginning
162
- // of the log. The preample is used to write code events saved in the
163
- // snapshot.
164
- static void Preamble(const char* content);
165
-
166
145
  // Emits an event with a string value -> (name, value).
167
146
  static void StringEvent(const char* name, const char* value);
168
147
 
@@ -223,6 +202,14 @@ class Logger {
223
202
  static void CodeMoveEvent(Address from, Address to);
224
203
  // Emits a code delete event.
225
204
  static void CodeDeleteEvent(Address from);
205
+ // Emits a function object create event.
206
+ static void FunctionCreateEvent(JSFunction* function);
207
+ // Emits a function move event.
208
+ static void FunctionMoveEvent(Address from, Address to);
209
+ // Emits a function delete event.
210
+ static void FunctionDeleteEvent(Address from);
211
+
212
+ static void SnapshotPositionEvent(Address addr, int pos);
226
213
 
227
214
  // ==== Events logged by --log-gc. ====
228
215
  // Heap sampling events: start, end, and individual types.
@@ -254,19 +241,15 @@ class Logger {
254
241
  static void LogRuntime(Vector<const char> format, JSArray* args);
255
242
 
256
243
  #ifdef ENABLE_LOGGING_AND_PROFILING
257
- static StateTag state() {
258
- return current_state_ ? current_state_->state() : OTHER;
259
- }
260
-
261
244
  static bool is_logging() {
262
- return is_logging_;
245
+ return logging_nesting_ > 0;
263
246
  }
264
247
 
265
248
  // Pause/Resume collection of profiling data.
266
249
  // When data collection is paused, CPU Tick events are discarded until
267
250
  // data collection is Resumed.
268
- static void PauseProfiler(int flags);
269
- static void ResumeProfiler(int flags);
251
+ static void PauseProfiler(int flags, int tag);
252
+ static void ResumeProfiler(int flags, int tag);
270
253
  static int GetActiveProfilerModules();
271
254
 
272
255
  // If logging is performed into a memory buffer, allows to
@@ -275,16 +258,21 @@ class Logger {
275
258
 
276
259
  // Logs all compiled functions found in the heap.
277
260
  static void LogCompiledFunctions();
261
+ // Logs all compiled JSFunction objects found in the heap.
262
+ static void LogFunctionObjects();
278
263
  // Logs all accessor callbacks found in the heap.
279
264
  static void LogAccessorCallbacks();
280
265
  // Used for logging stubs found in the snapshot.
281
- static void LogCodeObject(Object* code_object);
266
+ static void LogCodeObjects();
282
267
 
283
- private:
268
+ // Converts tag to a corresponding NATIVE_... if the script is native.
269
+ INLINE(static LogEventsAndTags ToNativeByScript(LogEventsAndTags, Script*));
284
270
 
285
271
  // Profiler's sampling interval (in milliseconds).
286
272
  static const int kSamplingIntervalMs = 1;
287
273
 
274
+ private:
275
+
288
276
  // Size of window used for log records compression.
289
277
  static const int kCompressionWindowSize = 4;
290
278
 
@@ -296,12 +284,24 @@ class Logger {
296
284
  const char* name,
297
285
  Address entry_point);
298
286
 
287
+ // Internal configurable move event.
288
+ static void MoveEventInternal(LogEventsAndTags event,
289
+ Address from,
290
+ Address to);
291
+
292
+ // Internal configurable move event.
293
+ static void DeleteEventInternal(LogEventsAndTags event,
294
+ Address from);
295
+
299
296
  // Emits aliases for compressed messages.
300
297
  static void LogAliases();
301
298
 
302
299
  // Emits the source code of a regexp. Used by regexp events.
303
300
  static void LogRegExpSource(Handle<JSRegExp> regexp);
304
301
 
302
+ // Used for logging stubs found in the snapshot.
303
+ static void LogCodeObject(Object* code_object);
304
+
305
305
  // Emits a profiler tick event. Used by the profiler thread.
306
306
  static void TickEvent(TickSample* sample, bool overflow);
307
307
 
@@ -310,6 +310,9 @@ class Logger {
310
310
  // Logs a StringEvent regardless of whether FLAG_log is true.
311
311
  static void UncheckedStringEvent(const char* name, const char* value);
312
312
 
313
+ // Logs an IntEvent regardless of whether FLAG_log is true.
314
+ static void UncheckedIntEvent(const char* name, int value);
315
+
313
316
  // Stops logging and profiling in case of insufficient resources.
314
317
  static void StopLoggingAndProfiling();
315
318
 
@@ -324,12 +327,6 @@ class Logger {
324
327
  // of samples.
325
328
  static Profiler* profiler_;
326
329
 
327
- // A stack of VM states.
328
- static VMState* current_state_;
329
-
330
- // Singleton bottom or default vm state.
331
- static VMState bottom_state_;
332
-
333
330
  // SlidingStateWindow instance keeping a sliding window of the most
334
331
  // recent VM states.
335
332
  static SlidingStateWindow* sliding_state_window_;
@@ -352,7 +349,11 @@ class Logger {
352
349
 
353
350
  friend class LoggerTestHelper;
354
351
 
355
- static bool is_logging_;
352
+ static int logging_nesting_;
353
+ static int cpu_profiler_nesting_;
354
+ static int heap_profiler_nesting_;
355
+
356
+ friend class CpuProfiler;
356
357
  #else
357
358
  static bool is_logging() { return false; }
358
359
  #endif
@@ -365,7 +366,7 @@ class StackTracer : public AllStatic {
365
366
  static void Trace(TickSample* sample);
366
367
  };
367
368
 
368
-
369
369
  } } // namespace v8::internal
370
370
 
371
+
371
372
  #endif // V8_LOG_H_
@@ -61,6 +61,8 @@ enum AllocationFlags {
61
61
  RESULT_CONTAINS_TOP = 1 << 1
62
62
  };
63
63
 
64
+ // Invalid depth in prototype chain.
65
+ const int kInvalidProtoDepth = -1;
64
66
 
65
67
  #if V8_TARGET_ARCH_IA32
66
68
  #include "assembler.h"
@@ -86,6 +88,13 @@ enum AllocationFlags {
86
88
  #endif
87
89
  #include "code.h" // must be after assembler_*.h
88
90
  #include "arm/macro-assembler-arm.h"
91
+ #elif V8_TARGET_ARCH_MIPS
92
+ #include "mips/constants-mips.h"
93
+ #include "assembler.h"
94
+ #include "mips/assembler-mips.h"
95
+ #include "mips/assembler-mips-inl.h"
96
+ #include "code.h" // must be after assembler_*.h
97
+ #include "mips/macro-assembler-mips.h"
89
98
  #else
90
99
  #error Unsupported target architecture.
91
100
  #endif
@@ -73,7 +73,24 @@ const kDayMask = 0x01f;
73
73
  const kYearShift = 9;
74
74
  const kMonthShift = 5;
75
75
 
76
+ # Limits for parts of the date, so that we support all the dates that
77
+ # ECMA 262 - 15.9.1.1 requires us to, but at the same time be sure that
78
+ # the date (days since 1970) is in SMI range.
79
+ const kMinYear = -1000000;
80
+ const kMaxYear = 1000000;
81
+ const kMinMonth = -10000000;
82
+ const kMaxMonth = 10000000;
83
+ const kMinDate = -100000000;
84
+ const kMaxDate = 100000000;
85
+
86
+ # Native cache ids.
87
+ const STRING_TO_REGEXP_CACHE_ID = 0;
88
+
76
89
  # Type query macros.
90
+ #
91
+ # Note: We have special support for typeof(foo) === 'bar' in the compiler.
92
+ # It will *not* generate a runtime typeof call for the most important
93
+ # values of 'bar'.
77
94
  macro IS_NULL(arg) = (arg === null);
78
95
  macro IS_NULL_OR_UNDEFINED(arg) = (arg == null);
79
96
  macro IS_UNDEFINED(arg) = (typeof(arg) === 'undefined');
@@ -83,7 +100,7 @@ macro IS_BOOLEAN(arg) = (typeof(arg) === 'boolean');
83
100
  macro IS_OBJECT(arg) = (%_IsObject(arg));
84
101
  macro IS_ARRAY(arg) = (%_IsArray(arg));
85
102
  macro IS_FUNCTION(arg) = (%_IsFunction(arg));
86
- macro IS_REGEXP(arg) = (%_ClassOf(arg) === 'RegExp');
103
+ macro IS_REGEXP(arg) = (%_IsRegExp(arg));
87
104
  macro IS_DATE(arg) = (%_ClassOf(arg) === 'Date');
88
105
  macro IS_NUMBER_WRAPPER(arg) = (%_ClassOf(arg) === 'Number');
89
106
  macro IS_STRING_WRAPPER(arg) = (%_ClassOf(arg) === 'String');
@@ -92,21 +109,20 @@ macro IS_ERROR(arg) = (%_ClassOf(arg) === 'Error');
92
109
  macro IS_SCRIPT(arg) = (%_ClassOf(arg) === 'Script');
93
110
  macro IS_ARGUMENTS(arg) = (%_ClassOf(arg) === 'Arguments');
94
111
  macro IS_GLOBAL(arg) = (%_ClassOf(arg) === 'global');
112
+ macro IS_UNDETECTABLE(arg) = (%_IsUndetectableObject(arg));
95
113
  macro FLOOR(arg) = $floor(arg);
96
114
 
97
115
  # Inline macros. Use %IS_VAR to make sure arg is evaluated only once.
98
116
  macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg));
99
- macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToInteger(arg));
100
- macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0));
101
- macro TO_UINT32(arg) = (arg >>> 0);
117
+ macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToInteger(arg));
118
+ macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0));
119
+ macro TO_UINT32(arg) = (arg >>> 0);
120
+ macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString(arg));
121
+
102
122
 
103
123
  # Macros implemented in Python.
104
124
  python macro CHAR_CODE(str) = ord(str[1]);
105
125
 
106
- # Accessors for original global properties that ensure they have been loaded.
107
- const ORIGINAL_REGEXP = (global.RegExp, $RegExp);
108
- const ORIGINAL_DATE = (global.Date, $Date);
109
-
110
126
  # Constants used on an array to implement the properties of the RegExp object.
111
127
  const REGEXP_NUMBER_OF_CAPTURES = 0;
112
128
  const REGEXP_FIRST_CAPTURE = 3;
@@ -115,13 +131,16 @@ const REGEXP_FIRST_CAPTURE = 3;
115
131
  # REGEXP_NUMBER_OF_CAPTURES
116
132
  macro NUMBER_OF_CAPTURES(array) = ((array)[0]);
117
133
 
134
+ # Limit according to ECMA 262 15.9.1.1
135
+ const MAX_TIME_MS = 8640000000000000;
136
+
118
137
  # Gets the value of a Date object. If arg is not a Date object
119
138
  # a type error is thrown.
120
139
  macro DATE_VALUE(arg) = (%_ClassOf(arg) === 'Date' ? %_ValueOf(arg) : ThrowDateTypeError());
121
140
  macro DAY(time) = ($floor(time / 86400000));
122
- macro MONTH_FROM_TIME(time) = (FromJulianDay(($floor(time / 86400000)) + 2440588).month);
123
- macro DATE_FROM_TIME(time) = (FromJulianDay(($floor(time / 86400000)) + 2440588).date);
124
- macro YEAR_FROM_TIME(time) = (FromJulianDay(($floor(time / 86400000)) + 2440588).year);
141
+ macro MONTH_FROM_TIME(time) = (MonthFromTime(time));
142
+ macro DATE_FROM_TIME(time) = (DateFromTime(time));
143
+ macro YEAR_FROM_TIME(time) = (YearFromTime(time));
125
144
  macro HOUR_FROM_TIME(time) = (Modulo($floor(time / 3600000), 24));
126
145
  macro MIN_FROM_TIME(time) = (Modulo($floor(time / 60000), 60));
127
146
  macro SEC_FROM_TIME(time) = (Modulo($floor(time / 1000), 60));
@@ -53,13 +53,13 @@ MarkCompactCollector::CollectorState MarkCompactCollector::state_ = IDLE;
53
53
  // Counters used for debugging the marking phase of mark-compact or mark-sweep
54
54
  // collection.
55
55
  int MarkCompactCollector::live_bytes_ = 0;
56
- int MarkCompactCollector::live_young_objects_ = 0;
57
- int MarkCompactCollector::live_old_data_objects_ = 0;
58
- int MarkCompactCollector::live_old_pointer_objects_ = 0;
59
- int MarkCompactCollector::live_code_objects_ = 0;
60
- int MarkCompactCollector::live_map_objects_ = 0;
61
- int MarkCompactCollector::live_cell_objects_ = 0;
62
- int MarkCompactCollector::live_lo_objects_ = 0;
56
+ int MarkCompactCollector::live_young_objects_size_ = 0;
57
+ int MarkCompactCollector::live_old_data_objects_size_ = 0;
58
+ int MarkCompactCollector::live_old_pointer_objects_size_ = 0;
59
+ int MarkCompactCollector::live_code_objects_size_ = 0;
60
+ int MarkCompactCollector::live_map_objects_size_ = 0;
61
+ int MarkCompactCollector::live_cell_objects_size_ = 0;
62
+ int MarkCompactCollector::live_lo_objects_size_ = 0;
63
63
  #endif
64
64
 
65
65
  void MarkCompactCollector::CollectGarbage() {
@@ -129,19 +129,20 @@ void MarkCompactCollector::Prepare(GCTracer* tracer) {
129
129
  #endif
130
130
 
131
131
  PagedSpaces spaces;
132
- while (PagedSpace* space = spaces.next()) {
132
+ for (PagedSpace* space = spaces.next();
133
+ space != NULL; space = spaces.next()) {
133
134
  space->PrepareForMarkCompact(compacting_collection_);
134
135
  }
135
136
 
136
137
  #ifdef DEBUG
137
138
  live_bytes_ = 0;
138
- live_young_objects_ = 0;
139
- live_old_pointer_objects_ = 0;
140
- live_old_data_objects_ = 0;
141
- live_code_objects_ = 0;
142
- live_map_objects_ = 0;
143
- live_cell_objects_ = 0;
144
- live_lo_objects_ = 0;
139
+ live_young_objects_size_ = 0;
140
+ live_old_pointer_objects_size_ = 0;
141
+ live_old_data_objects_size_ = 0;
142
+ live_code_objects_size_ = 0;
143
+ live_map_objects_size_ = 0;
144
+ live_cell_objects_size_ = 0;
145
+ live_lo_objects_size_ = 0;
145
146
  #endif
146
147
  }
147
148
 
@@ -172,7 +173,7 @@ void MarkCompactCollector::Finish() {
172
173
  int old_gen_used = 0;
173
174
 
174
175
  OldSpaces spaces;
175
- while (OldSpace* space = spaces.next()) {
176
+ for (OldSpace* space = spaces.next(); space != NULL; space = spaces.next()) {
176
177
  old_gen_recoverable += space->Waste() + space->AvailableFree();
177
178
  old_gen_used += space->Size();
178
179
  }
@@ -475,8 +476,8 @@ void MarkCompactCollector::MarkDescriptorArray(
475
476
 
476
477
  void MarkCompactCollector::CreateBackPointers() {
477
478
  HeapObjectIterator iterator(Heap::map_space());
478
- while (iterator.has_next()) {
479
- Object* next_object = iterator.next();
479
+ for (HeapObject* next_object = iterator.next();
480
+ next_object != NULL; next_object = iterator.next()) {
480
481
  if (next_object->IsMap()) { // Could also be ByteArray on free list.
481
482
  Map* map = Map::cast(next_object);
482
483
  if (map->instance_type() >= FIRST_JS_OBJECT_TYPE &&
@@ -509,8 +510,7 @@ static void ScanOverflowedObjects(T* it) {
509
510
  // so that we don't waste effort pointlessly scanning for objects.
510
511
  ASSERT(!marking_stack.is_full());
511
512
 
512
- while (it->has_next()) {
513
- HeapObject* object = it->next();
513
+ for (HeapObject* object = it->next(); object != NULL; object = it->next()) {
514
514
  if (object->IsOverflowed()) {
515
515
  object->ClearOverflow();
516
516
  ASSERT(object->IsMarked());
@@ -742,21 +742,21 @@ static int CountMarkedCallback(HeapObject* obj) {
742
742
  void MarkCompactCollector::UpdateLiveObjectCount(HeapObject* obj) {
743
743
  live_bytes_ += obj->Size();
744
744
  if (Heap::new_space()->Contains(obj)) {
745
- live_young_objects_++;
745
+ live_young_objects_size_ += obj->Size();
746
746
  } else if (Heap::map_space()->Contains(obj)) {
747
747
  ASSERT(obj->IsMap());
748
- live_map_objects_++;
748
+ live_map_objects_size_ += obj->Size();
749
749
  } else if (Heap::cell_space()->Contains(obj)) {
750
750
  ASSERT(obj->IsJSGlobalPropertyCell());
751
- live_cell_objects_++;
751
+ live_cell_objects_size_ += obj->Size();
752
752
  } else if (Heap::old_pointer_space()->Contains(obj)) {
753
- live_old_pointer_objects_++;
753
+ live_old_pointer_objects_size_ += obj->Size();
754
754
  } else if (Heap::old_data_space()->Contains(obj)) {
755
- live_old_data_objects_++;
755
+ live_old_data_objects_size_ += obj->Size();
756
756
  } else if (Heap::code_space()->Contains(obj)) {
757
- live_code_objects_++;
757
+ live_code_objects_size_ += obj->Size();
758
758
  } else if (Heap::lo_space()->Contains(obj)) {
759
- live_lo_objects_++;
759
+ live_lo_objects_size_ += obj->Size();
760
760
  } else {
761
761
  UNREACHABLE();
762
762
  }
@@ -793,8 +793,9 @@ void MarkCompactCollector::ClearNonLiveTransitions() {
793
793
  // scan the descriptor arrays of those maps, not all maps.
794
794
  // All of these actions are carried out only on maps of JSObjects
795
795
  // and related subtypes.
796
- while (map_iterator.has_next()) {
797
- Map* map = reinterpret_cast<Map*>(map_iterator.next());
796
+ for (HeapObject* obj = map_iterator.next();
797
+ obj != NULL; obj = map_iterator.next()) {
798
+ Map* map = reinterpret_cast<Map*>(obj);
798
799
  if (!map->IsMarked() && map->IsByteArray()) continue;
799
800
 
800
801
  ASSERT(SafeIsMap(map));
@@ -969,12 +970,6 @@ inline void EncodeForwardingAddressInPagedSpace(HeapObject* old_object,
969
970
  inline void IgnoreNonLiveObject(HeapObject* object) {}
970
971
 
971
972
 
972
- // A code deletion event is logged for non-live code objects.
973
- inline void LogNonLiveCodeObject(HeapObject* object) {
974
- if (object->IsCode()) LOG(CodeDeleteEvent(object->address()));
975
- }
976
-
977
-
978
973
  // Function template that, given a range of addresses (eg, a semispace or a
979
974
  // paged space page), iterates through the objects in the range to clear
980
975
  // mark bits and compute and encode forwarding addresses. As a side effect,
@@ -1060,6 +1055,7 @@ void MarkCompactCollector::EncodeForwardingAddressesInPagedSpace(
1060
1055
  PageIterator it(space, PageIterator::PAGES_IN_USE);
1061
1056
  while (it.has_next()) {
1062
1057
  Page* p = it.next();
1058
+
1063
1059
  // The offset of each live object in the page from the first live object
1064
1060
  // in the page.
1065
1061
  int offset = 0;
@@ -1073,36 +1069,238 @@ void MarkCompactCollector::EncodeForwardingAddressesInPagedSpace(
1073
1069
  }
1074
1070
 
1075
1071
 
1076
- static void SweepSpace(NewSpace* space) {
1072
+ // We scavange new space simultaneously with sweeping. This is done in two
1073
+ // passes.
1074
+ // The first pass migrates all alive objects from one semispace to another or
1075
+ // promotes them to old space. Forwading address is written directly into
1076
+ // first word of object without any encoding. If object is dead we are writing
1077
+ // NULL as a forwarding address.
1078
+ // The second pass updates pointers to new space in all spaces. It is possible
1079
+ // to encounter pointers to dead objects during traversal of remembered set for
1080
+ // map space because remembered set bits corresponding to dead maps are cleared
1081
+ // later during map space sweeping.
1082
+ static void MigrateObject(Address dst, Address src, int size) {
1083
+ Heap::CopyBlock(reinterpret_cast<Object**>(dst),
1084
+ reinterpret_cast<Object**>(src),
1085
+ size);
1086
+
1087
+ Memory::Address_at(src) = dst;
1088
+ }
1089
+
1090
+
1091
+ // Visitor for updating pointers from live objects in old spaces to new space.
1092
+ // It does not expect to encounter pointers to dead objects.
1093
+ class PointersToNewGenUpdatingVisitor: public ObjectVisitor {
1094
+ public:
1095
+ void VisitPointer(Object** p) {
1096
+ UpdatePointer(p);
1097
+ }
1098
+
1099
+ void VisitPointers(Object** start, Object** end) {
1100
+ for (Object** p = start; p < end; p++) UpdatePointer(p);
1101
+ }
1102
+
1103
+ void VisitCodeTarget(RelocInfo* rinfo) {
1104
+ ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode()));
1105
+ Object* target = Code::GetCodeFromTargetAddress(rinfo->target_address());
1106
+ VisitPointer(&target);
1107
+ rinfo->set_target_address(Code::cast(target)->instruction_start());
1108
+ }
1109
+
1110
+ void VisitDebugTarget(RelocInfo* rinfo) {
1111
+ ASSERT(RelocInfo::IsJSReturn(rinfo->rmode()) &&
1112
+ rinfo->IsPatchedReturnSequence());
1113
+ Object* target = Code::GetCodeFromTargetAddress(rinfo->call_address());
1114
+ VisitPointer(&target);
1115
+ rinfo->set_call_address(Code::cast(target)->instruction_start());
1116
+ }
1117
+
1118
+ private:
1119
+ void UpdatePointer(Object** p) {
1120
+ if (!(*p)->IsHeapObject()) return;
1121
+
1122
+ HeapObject* obj = HeapObject::cast(*p);
1123
+ Address old_addr = obj->address();
1124
+
1125
+ if (Heap::new_space()->Contains(obj)) {
1126
+ ASSERT(Heap::InFromSpace(*p));
1127
+ *p = HeapObject::FromAddress(Memory::Address_at(old_addr));
1128
+ }
1129
+ }
1130
+ };
1131
+
1132
+ // Visitor for updating pointers from live objects in old spaces to new space.
1133
+ // It can encounter pointers to dead objects in new space when traversing map
1134
+ // space (see comment for MigrateObject).
1135
+ static void UpdatePointerToNewGen(HeapObject** p) {
1136
+ if (!(*p)->IsHeapObject()) return;
1137
+
1138
+ Address old_addr = (*p)->address();
1139
+ ASSERT(Heap::InFromSpace(*p));
1140
+
1141
+ Address new_addr = Memory::Address_at(old_addr);
1142
+
1143
+ // Object pointed by *p is dead. Update is not required.
1144
+ if (new_addr == NULL) return;
1145
+
1146
+ *p = HeapObject::FromAddress(new_addr);
1147
+ }
1148
+
1149
+
1150
+ static String* UpdateNewSpaceReferenceInExternalStringTableEntry(Object **p) {
1151
+ Address old_addr = HeapObject::cast(*p)->address();
1152
+ Address new_addr = Memory::Address_at(old_addr);
1153
+ return String::cast(HeapObject::FromAddress(new_addr));
1154
+ }
1155
+
1156
+
1157
+ static bool TryPromoteObject(HeapObject* object, int object_size) {
1158
+ Object* result;
1159
+
1160
+ if (object_size > Heap::MaxObjectSizeInPagedSpace()) {
1161
+ result = Heap::lo_space()->AllocateRawFixedArray(object_size);
1162
+ if (!result->IsFailure()) {
1163
+ HeapObject* target = HeapObject::cast(result);
1164
+ MigrateObject(target->address(), object->address(), object_size);
1165
+ Heap::UpdateRSet(target);
1166
+ return true;
1167
+ }
1168
+ } else {
1169
+ OldSpace* target_space = Heap::TargetSpace(object);
1170
+
1171
+ ASSERT(target_space == Heap::old_pointer_space() ||
1172
+ target_space == Heap::old_data_space());
1173
+ result = target_space->AllocateRaw(object_size);
1174
+ if (!result->IsFailure()) {
1175
+ HeapObject* target = HeapObject::cast(result);
1176
+ MigrateObject(target->address(), object->address(), object_size);
1177
+ if (target_space == Heap::old_pointer_space()) {
1178
+ Heap::UpdateRSet(target);
1179
+ }
1180
+ return true;
1181
+ }
1182
+ }
1183
+
1184
+ return false;
1185
+ }
1186
+
1187
+
1188
+ static void SweepNewSpace(NewSpace* space) {
1189
+ Heap::CheckNewSpaceExpansionCriteria();
1190
+
1191
+ Address from_bottom = space->bottom();
1192
+ Address from_top = space->top();
1193
+
1194
+ // Flip the semispaces. After flipping, to space is empty, from space has
1195
+ // live objects.
1196
+ space->Flip();
1197
+ space->ResetAllocationInfo();
1198
+
1199
+ int size = 0;
1200
+ int survivors_size = 0;
1201
+
1202
+ // First pass: traverse all objects in inactive semispace, remove marks,
1203
+ // migrate live objects and write forwarding addresses.
1204
+ for (Address current = from_bottom; current < from_top; current += size) {
1205
+ HeapObject* object = HeapObject::FromAddress(current);
1206
+
1207
+ if (object->IsMarked()) {
1208
+ object->ClearMark();
1209
+ MarkCompactCollector::tracer()->decrement_marked_count();
1210
+
1211
+ size = object->Size();
1212
+ survivors_size += size;
1213
+
1214
+ // Aggressively promote young survivors to the old space.
1215
+ if (TryPromoteObject(object, size)) {
1216
+ continue;
1217
+ }
1218
+
1219
+ // Promotion either failed or not required.
1220
+ // Copy the content of the object.
1221
+ Object* target = space->AllocateRaw(size);
1222
+
1223
+ // Allocation cannot fail at this point: semispaces are of equal size.
1224
+ ASSERT(!target->IsFailure());
1225
+
1226
+ MigrateObject(HeapObject::cast(target)->address(), current, size);
1227
+ } else {
1228
+ size = object->Size();
1229
+ Memory::Address_at(current) = NULL;
1230
+ }
1231
+ }
1232
+
1233
+ // Second pass: find pointers to new space and update them.
1234
+ PointersToNewGenUpdatingVisitor updating_visitor;
1235
+
1236
+ // Update pointers in to space.
1077
1237
  HeapObject* object;
1078
1238
  for (Address current = space->bottom();
1079
1239
  current < space->top();
1080
1240
  current += object->Size()) {
1081
1241
  object = HeapObject::FromAddress(current);
1082
- if (object->IsMarked()) {
1083
- object->ClearMark();
1084
- MarkCompactCollector::tracer()->decrement_marked_count();
1085
- } else {
1086
- // We give non-live objects a map that will correctly give their size,
1087
- // since their existing map might not be live after the collection.
1088
- int size = object->Size();
1089
- if (size >= ByteArray::kHeaderSize) {
1090
- object->set_map(Heap::raw_unchecked_byte_array_map());
1091
- ByteArray::cast(object)->set_length(ByteArray::LengthFor(size));
1092
- } else {
1093
- ASSERT(size == kPointerSize);
1094
- object->set_map(Heap::raw_unchecked_one_pointer_filler_map());
1095
- }
1096
- ASSERT(object->Size() == size);
1242
+
1243
+ object->IterateBody(object->map()->instance_type(),
1244
+ object->Size(),
1245
+ &updating_visitor);
1246
+ }
1247
+
1248
+ // Update roots.
1249
+ Heap::IterateRoots(&updating_visitor, VISIT_ALL_IN_SCAVENGE);
1250
+
1251
+ // Update pointers in old spaces.
1252
+ Heap::IterateRSet(Heap::old_pointer_space(), &UpdatePointerToNewGen);
1253
+ Heap::IterateRSet(Heap::map_space(), &UpdatePointerToNewGen);
1254
+ Heap::lo_space()->IterateRSet(&UpdatePointerToNewGen);
1255
+
1256
+ // Update pointers from cells.
1257
+ HeapObjectIterator cell_iterator(Heap::cell_space());
1258
+ for (HeapObject* cell = cell_iterator.next();
1259
+ cell != NULL;
1260
+ cell = cell_iterator.next()) {
1261
+ if (cell->IsJSGlobalPropertyCell()) {
1262
+ Address value_address =
1263
+ reinterpret_cast<Address>(cell) +
1264
+ (JSGlobalPropertyCell::kValueOffset - kHeapObjectTag);
1265
+ updating_visitor.VisitPointer(reinterpret_cast<Object**>(value_address));
1097
1266
  }
1098
- // The object is now unmarked for the call to Size() at the top of the
1099
- // loop.
1100
1267
  }
1268
+
1269
+ // Update pointers from external string table.
1270
+ Heap::UpdateNewSpaceReferencesInExternalStringTable(
1271
+ &UpdateNewSpaceReferenceInExternalStringTableEntry);
1272
+
1273
+ // All pointers were updated. Update auxiliary allocation info.
1274
+ Heap::IncrementYoungSurvivorsCounter(survivors_size);
1275
+ space->set_age_mark(space->top());
1101
1276
  }
1102
1277
 
1103
1278
 
1104
1279
  static void SweepSpace(PagedSpace* space, DeallocateFunction dealloc) {
1105
1280
  PageIterator it(space, PageIterator::PAGES_IN_USE);
1281
+
1282
+ // During sweeping of paged space we are trying to find longest sequences
1283
+ // of pages without live objects and free them (instead of putting them on
1284
+ // the free list).
1285
+
1286
+ // Page preceding current.
1287
+ Page* prev = Page::FromAddress(NULL);
1288
+
1289
+ // First empty page in a sequence.
1290
+ Page* first_empty_page = Page::FromAddress(NULL);
1291
+
1292
+ // Page preceding first empty page.
1293
+ Page* prec_first_empty_page = Page::FromAddress(NULL);
1294
+
1295
+ // If last used page of space ends with a sequence of dead objects
1296
+ // we can adjust allocation top instead of puting this free area into
1297
+ // the free list. Thus during sweeping we keep track of such areas
1298
+ // and defer their deallocation until the sweeping of the next page
1299
+ // is done: if one of the next pages contains live objects we have
1300
+ // to put such area into the free list.
1301
+ Address last_free_start = NULL;
1302
+ int last_free_size = 0;
1303
+
1106
1304
  while (it.has_next()) {
1107
1305
  Page* p = it.next();
1108
1306
 
@@ -1117,15 +1315,13 @@ static void SweepSpace(PagedSpace* space, DeallocateFunction dealloc) {
1117
1315
  if (object->IsMarked()) {
1118
1316
  object->ClearMark();
1119
1317
  MarkCompactCollector::tracer()->decrement_marked_count();
1318
+
1120
1319
  if (!is_previous_alive) { // Transition from free to live.
1121
- dealloc(free_start, static_cast<int>(current - free_start));
1320
+ dealloc(free_start, static_cast<int>(current - free_start), true);
1122
1321
  is_previous_alive = true;
1123
1322
  }
1124
1323
  } else {
1125
- if (object->IsCode()) {
1126
- // Notify the logger that compiled code has been collected.
1127
- LOG(CodeDeleteEvent(Code::cast(object)->address()));
1128
- }
1324
+ MarkCompactCollector::ReportDeleteIfNeeded(object);
1129
1325
  if (is_previous_alive) { // Transition from live to free.
1130
1326
  free_start = current;
1131
1327
  is_previous_alive = false;
@@ -1135,39 +1331,113 @@ static void SweepSpace(PagedSpace* space, DeallocateFunction dealloc) {
1135
1331
  // loop.
1136
1332
  }
1137
1333
 
1138
- // If the last region was not live we need to deallocate from
1139
- // free_start to the allocation top in the page.
1140
- if (!is_previous_alive) {
1141
- int free_size = static_cast<int>(p->AllocationTop() - free_start);
1142
- if (free_size > 0) {
1143
- dealloc(free_start, free_size);
1334
+ bool page_is_empty = (p->ObjectAreaStart() == p->AllocationTop())
1335
+ || (!is_previous_alive && free_start == p->ObjectAreaStart());
1336
+
1337
+ if (page_is_empty) {
1338
+ // This page is empty. Check whether we are in the middle of
1339
+ // sequence of empty pages and start one if not.
1340
+ if (!first_empty_page->is_valid()) {
1341
+ first_empty_page = p;
1342
+ prec_first_empty_page = prev;
1343
+ }
1344
+
1345
+ if (!is_previous_alive) {
1346
+ // There are dead objects on this page. Update space accounting stats
1347
+ // without putting anything into free list.
1348
+ int size_in_bytes = static_cast<int>(p->AllocationTop() - free_start);
1349
+ if (size_in_bytes > 0) {
1350
+ dealloc(free_start, size_in_bytes, false);
1351
+ }
1352
+ }
1353
+ } else {
1354
+ // This page is not empty. Sequence of empty pages ended on the previous
1355
+ // one.
1356
+ if (first_empty_page->is_valid()) {
1357
+ space->FreePages(prec_first_empty_page, prev);
1358
+ prec_first_empty_page = first_empty_page = Page::FromAddress(NULL);
1359
+ }
1360
+
1361
+ // If there is a free ending area on one of the previous pages we have
1362
+ // deallocate that area and put it on the free list.
1363
+ if (last_free_size > 0) {
1364
+ dealloc(last_free_start, last_free_size, true);
1365
+ last_free_start = NULL;
1366
+ last_free_size = 0;
1144
1367
  }
1368
+
1369
+ // If the last region of this page was not live we remember it.
1370
+ if (!is_previous_alive) {
1371
+ ASSERT(last_free_size == 0);
1372
+ last_free_size = static_cast<int>(p->AllocationTop() - free_start);
1373
+ last_free_start = free_start;
1374
+ }
1375
+ }
1376
+
1377
+ prev = p;
1378
+ }
1379
+
1380
+ // We reached end of space. See if we need to adjust allocation top.
1381
+ Address new_allocation_top = NULL;
1382
+
1383
+ if (first_empty_page->is_valid()) {
1384
+ // Last used pages in space are empty. We can move allocation top backwards
1385
+ // to the beginning of first empty page.
1386
+ ASSERT(prev == space->AllocationTopPage());
1387
+
1388
+ new_allocation_top = first_empty_page->ObjectAreaStart();
1389
+ }
1390
+
1391
+ if (last_free_size > 0) {
1392
+ // There was a free ending area on the previous page.
1393
+ // Deallocate it without putting it into freelist and move allocation
1394
+ // top to the beginning of this free area.
1395
+ dealloc(last_free_start, last_free_size, false);
1396
+ new_allocation_top = last_free_start;
1397
+ }
1398
+
1399
+ if (new_allocation_top != NULL) {
1400
+ #ifdef DEBUG
1401
+ Page* new_allocation_top_page = Page::FromAllocationTop(new_allocation_top);
1402
+ if (!first_empty_page->is_valid()) {
1403
+ ASSERT(new_allocation_top_page == space->AllocationTopPage());
1404
+ } else if (last_free_size > 0) {
1405
+ ASSERT(new_allocation_top_page == prec_first_empty_page);
1406
+ } else {
1407
+ ASSERT(new_allocation_top_page == first_empty_page);
1145
1408
  }
1409
+ #endif
1410
+
1411
+ space->SetTop(new_allocation_top);
1146
1412
  }
1147
1413
  }
1148
1414
 
1149
1415
 
1150
1416
  void MarkCompactCollector::DeallocateOldPointerBlock(Address start,
1151
- int size_in_bytes) {
1417
+ int size_in_bytes,
1418
+ bool add_to_freelist) {
1152
1419
  Heap::ClearRSetRange(start, size_in_bytes);
1153
- Heap::old_pointer_space()->Free(start, size_in_bytes);
1420
+ Heap::old_pointer_space()->Free(start, size_in_bytes, add_to_freelist);
1154
1421
  }
1155
1422
 
1156
1423
 
1157
1424
  void MarkCompactCollector::DeallocateOldDataBlock(Address start,
1158
- int size_in_bytes) {
1159
- Heap::old_data_space()->Free(start, size_in_bytes);
1425
+ int size_in_bytes,
1426
+ bool add_to_freelist) {
1427
+ Heap::old_data_space()->Free(start, size_in_bytes, add_to_freelist);
1160
1428
  }
1161
1429
 
1162
1430
 
1163
1431
  void MarkCompactCollector::DeallocateCodeBlock(Address start,
1164
- int size_in_bytes) {
1165
- Heap::code_space()->Free(start, size_in_bytes);
1432
+ int size_in_bytes,
1433
+ bool add_to_freelist) {
1434
+ Heap::code_space()->Free(start, size_in_bytes, add_to_freelist);
1166
1435
  }
1167
1436
 
1168
1437
 
1169
1438
  void MarkCompactCollector::DeallocateMapBlock(Address start,
1170
- int size_in_bytes) {
1439
+ int size_in_bytes,
1440
+ bool add_to_freelist) {
1171
1441
  // Objects in map space are assumed to have size Map::kSize and a
1172
1442
  // valid map in their first word. Thus, we break the free block up into
1173
1443
  // chunks and free them separately.
@@ -1175,13 +1445,14 @@ void MarkCompactCollector::DeallocateMapBlock(Address start,
1175
1445
  Heap::ClearRSetRange(start, size_in_bytes);
1176
1446
  Address end = start + size_in_bytes;
1177
1447
  for (Address a = start; a < end; a += Map::kSize) {
1178
- Heap::map_space()->Free(a);
1448
+ Heap::map_space()->Free(a, add_to_freelist);
1179
1449
  }
1180
1450
  }
1181
1451
 
1182
1452
 
1183
1453
  void MarkCompactCollector::DeallocateCellBlock(Address start,
1184
- int size_in_bytes) {
1454
+ int size_in_bytes,
1455
+ bool add_to_freelist) {
1185
1456
  // Free-list elements in cell space are assumed to have a fixed size.
1186
1457
  // We break the free block into chunks and add them to the free list
1187
1458
  // individually.
@@ -1190,7 +1461,7 @@ void MarkCompactCollector::DeallocateCellBlock(Address start,
1190
1461
  Heap::ClearRSetRange(start, size_in_bytes);
1191
1462
  Address end = start + size_in_bytes;
1192
1463
  for (Address a = start; a < end; a += size) {
1193
- Heap::cell_space()->Free(a);
1464
+ Heap::cell_space()->Free(a, add_to_freelist);
1194
1465
  }
1195
1466
  }
1196
1467
 
@@ -1204,7 +1475,7 @@ void MarkCompactCollector::EncodeForwardingAddresses() {
1204
1475
 
1205
1476
  // Compute the forwarding pointers in each space.
1206
1477
  EncodeForwardingAddressesInPagedSpace<MCAllocateFromOldPointerSpace,
1207
- IgnoreNonLiveObject>(
1478
+ ReportDeleteIfNeeded>(
1208
1479
  Heap::old_pointer_space());
1209
1480
 
1210
1481
  EncodeForwardingAddressesInPagedSpace<MCAllocateFromOldDataSpace,
@@ -1212,7 +1483,7 @@ void MarkCompactCollector::EncodeForwardingAddresses() {
1212
1483
  Heap::old_data_space());
1213
1484
 
1214
1485
  EncodeForwardingAddressesInPagedSpace<MCAllocateFromCodeSpace,
1215
- LogNonLiveCodeObject>(
1486
+ ReportDeleteIfNeeded>(
1216
1487
  Heap::code_space());
1217
1488
 
1218
1489
  EncodeForwardingAddressesInPagedSpace<MCAllocateFromCellSpace,
@@ -1291,8 +1562,7 @@ class MapCompact {
1291
1562
  MapIterator it;
1292
1563
  HeapObject* o = it.next();
1293
1564
  for (; o != first_map_to_evacuate_; o = it.next()) {
1294
- it.has_next(); // Must be called for side-effects, see bug 586.
1295
- ASSERT(it.has_next());
1565
+ ASSERT(o != NULL);
1296
1566
  Map* map = reinterpret_cast<Map*>(o);
1297
1567
  ASSERT(!map->IsMarked());
1298
1568
  ASSERT(!map->IsOverflowed());
@@ -1318,10 +1588,8 @@ class MapCompact {
1318
1588
 
1319
1589
  void UpdateMapPointersInLargeObjectSpace() {
1320
1590
  LargeObjectIterator it(Heap::lo_space());
1321
- while (true) {
1322
- if (!it.has_next()) break;
1323
- UpdateMapPointersInObject(it.next());
1324
- }
1591
+ for (HeapObject* obj = it.next(); obj != NULL; obj = it.next())
1592
+ UpdateMapPointersInObject(obj);
1325
1593
  }
1326
1594
 
1327
1595
  void Finish() {
@@ -1364,9 +1632,8 @@ class MapCompact {
1364
1632
 
1365
1633
  static Map* NextMap(MapIterator* it, HeapObject* last, bool live) {
1366
1634
  while (true) {
1367
- it->has_next(); // Must be called for side-effects, see bug 586.
1368
- ASSERT(it->has_next());
1369
1635
  HeapObject* next = it->next();
1636
+ ASSERT(next != NULL);
1370
1637
  if (next == last)
1371
1638
  return NULL;
1372
1639
  ASSERT(!next->IsOverflowed());
@@ -1394,10 +1661,12 @@ class MapCompact {
1394
1661
  ASSERT(FreeListNode::IsFreeListNode(vacant_map));
1395
1662
  ASSERT(map_to_evacuate->IsMap());
1396
1663
 
1397
- memcpy(
1398
- reinterpret_cast<void*>(vacant_map->address()),
1399
- reinterpret_cast<void*>(map_to_evacuate->address()),
1400
- Map::kSize);
1664
+ ASSERT(Map::kSize % 4 == 0);
1665
+
1666
+ Heap::CopyBlock(reinterpret_cast<Object**>(vacant_map->address()),
1667
+ reinterpret_cast<Object**>(map_to_evacuate->address()),
1668
+ Map::kSize);
1669
+
1401
1670
  ASSERT(vacant_map->IsMap()); // Due to memcpy above.
1402
1671
 
1403
1672
  MapWord forwarding_map_word = MapWord::FromMap(vacant_map);
@@ -1455,8 +1724,9 @@ class MapCompact {
1455
1724
  if (!FLAG_enable_slow_asserts)
1456
1725
  return;
1457
1726
 
1458
- while (map_to_evacuate_it_.has_next())
1459
- ASSERT(FreeListNode::IsFreeListNode(map_to_evacuate_it_.next()));
1727
+ for (HeapObject* obj = map_to_evacuate_it_.next();
1728
+ obj != NULL; obj = map_to_evacuate_it_.next())
1729
+ ASSERT(FreeListNode::IsFreeListNode(obj));
1460
1730
  }
1461
1731
  #endif
1462
1732
  };
@@ -1476,10 +1746,11 @@ void MarkCompactCollector::SweepSpaces() {
1476
1746
  SweepSpace(Heap::old_data_space(), &DeallocateOldDataBlock);
1477
1747
  SweepSpace(Heap::code_space(), &DeallocateCodeBlock);
1478
1748
  SweepSpace(Heap::cell_space(), &DeallocateCellBlock);
1479
- SweepSpace(Heap::new_space());
1749
+ SweepNewSpace(Heap::new_space());
1480
1750
  SweepSpace(Heap::map_space(), &DeallocateMapBlock);
1481
- int live_maps = Heap::map_space()->Size() / Map::kSize;
1482
- ASSERT(live_map_objects_ == live_maps);
1751
+ int live_maps_size = Heap::map_space()->Size();
1752
+ int live_maps = live_maps_size / Map::kSize;
1753
+ ASSERT(live_map_objects_size_ == live_maps_size);
1483
1754
 
1484
1755
  if (Heap::map_space()->NeedsCompaction(live_maps)) {
1485
1756
  MapCompact map_compact(live_maps);
@@ -1489,7 +1760,8 @@ void MarkCompactCollector::SweepSpaces() {
1489
1760
 
1490
1761
  map_compact.FinishMapSpace();
1491
1762
  PagedSpaces spaces;
1492
- while (PagedSpace* space = spaces.next()) {
1763
+ for (PagedSpace* space = spaces.next();
1764
+ space != NULL; space = spaces.next()) {
1493
1765
  if (space == Heap::map_space()) continue;
1494
1766
  map_compact.UpdateMapPointersInPagedSpace(space);
1495
1767
  }
@@ -1510,7 +1782,7 @@ int MarkCompactCollector::IterateLiveObjectsInRange(
1510
1782
  Address start,
1511
1783
  Address end,
1512
1784
  HeapObjectCallback size_func) {
1513
- int live_objects = 0;
1785
+ int live_objects_size = 0;
1514
1786
  Address current = start;
1515
1787
  while (current < end) {
1516
1788
  uint32_t encoded_map = Memory::uint32_at(current);
@@ -1519,11 +1791,12 @@ int MarkCompactCollector::IterateLiveObjectsInRange(
1519
1791
  } else if (encoded_map == kMultiFreeEncoding) {
1520
1792
  current += Memory::int_at(current + kIntSize);
1521
1793
  } else {
1522
- live_objects++;
1523
- current += size_func(HeapObject::FromAddress(current));
1794
+ int size = size_func(HeapObject::FromAddress(current));
1795
+ current += size;
1796
+ live_objects_size += size;
1524
1797
  }
1525
1798
  }
1526
- return live_objects;
1799
+ return live_objects_size;
1527
1800
  }
1528
1801
 
1529
1802
 
@@ -1649,35 +1922,36 @@ void MarkCompactCollector::UpdatePointers() {
1649
1922
  Heap::IterateRoots(&updating_visitor, VISIT_ONLY_STRONG);
1650
1923
  GlobalHandles::IterateWeakRoots(&updating_visitor);
1651
1924
 
1652
- int live_maps = IterateLiveObjects(Heap::map_space(),
1653
- &UpdatePointersInOldObject);
1654
- int live_pointer_olds = IterateLiveObjects(Heap::old_pointer_space(),
1655
- &UpdatePointersInOldObject);
1656
- int live_data_olds = IterateLiveObjects(Heap::old_data_space(),
1925
+ int live_maps_size = IterateLiveObjects(Heap::map_space(),
1657
1926
  &UpdatePointersInOldObject);
1658
- int live_codes = IterateLiveObjects(Heap::code_space(),
1659
- &UpdatePointersInOldObject);
1660
- int live_cells = IterateLiveObjects(Heap::cell_space(),
1661
- &UpdatePointersInOldObject);
1662
- int live_news = IterateLiveObjects(Heap::new_space(),
1663
- &UpdatePointersInNewObject);
1927
+ int live_pointer_olds_size = IterateLiveObjects(Heap::old_pointer_space(),
1928
+ &UpdatePointersInOldObject);
1929
+ int live_data_olds_size = IterateLiveObjects(Heap::old_data_space(),
1930
+ &UpdatePointersInOldObject);
1931
+ int live_codes_size = IterateLiveObjects(Heap::code_space(),
1932
+ &UpdatePointersInOldObject);
1933
+ int live_cells_size = IterateLiveObjects(Heap::cell_space(),
1934
+ &UpdatePointersInOldObject);
1935
+ int live_news_size = IterateLiveObjects(Heap::new_space(),
1936
+ &UpdatePointersInNewObject);
1664
1937
 
1665
1938
  // Large objects do not move, the map word can be updated directly.
1666
1939
  LargeObjectIterator it(Heap::lo_space());
1667
- while (it.has_next()) UpdatePointersInNewObject(it.next());
1668
-
1669
- USE(live_maps);
1670
- USE(live_pointer_olds);
1671
- USE(live_data_olds);
1672
- USE(live_codes);
1673
- USE(live_cells);
1674
- USE(live_news);
1675
- ASSERT(live_maps == live_map_objects_);
1676
- ASSERT(live_data_olds == live_old_data_objects_);
1677
- ASSERT(live_pointer_olds == live_old_pointer_objects_);
1678
- ASSERT(live_codes == live_code_objects_);
1679
- ASSERT(live_cells == live_cell_objects_);
1680
- ASSERT(live_news == live_young_objects_);
1940
+ for (HeapObject* obj = it.next(); obj != NULL; obj = it.next())
1941
+ UpdatePointersInNewObject(obj);
1942
+
1943
+ USE(live_maps_size);
1944
+ USE(live_pointer_olds_size);
1945
+ USE(live_data_olds_size);
1946
+ USE(live_codes_size);
1947
+ USE(live_cells_size);
1948
+ USE(live_news_size);
1949
+ ASSERT(live_maps_size == live_map_objects_size_);
1950
+ ASSERT(live_data_olds_size == live_old_data_objects_size_);
1951
+ ASSERT(live_pointer_olds_size == live_old_pointer_objects_size_);
1952
+ ASSERT(live_codes_size == live_code_objects_size_);
1953
+ ASSERT(live_cells_size == live_cell_objects_size_);
1954
+ ASSERT(live_news_size == live_young_objects_size_);
1681
1955
  }
1682
1956
 
1683
1957
 
@@ -1792,27 +2066,31 @@ void MarkCompactCollector::RelocateObjects() {
1792
2066
  #endif
1793
2067
  // Relocates objects, always relocate map objects first. Relocating
1794
2068
  // objects in other space relies on map objects to get object size.
1795
- int live_maps = IterateLiveObjects(Heap::map_space(), &RelocateMapObject);
1796
- int live_pointer_olds = IterateLiveObjects(Heap::old_pointer_space(),
1797
- &RelocateOldPointerObject);
1798
- int live_data_olds = IterateLiveObjects(Heap::old_data_space(),
1799
- &RelocateOldDataObject);
1800
- int live_codes = IterateLiveObjects(Heap::code_space(), &RelocateCodeObject);
1801
- int live_cells = IterateLiveObjects(Heap::cell_space(), &RelocateCellObject);
1802
- int live_news = IterateLiveObjects(Heap::new_space(), &RelocateNewObject);
1803
-
1804
- USE(live_maps);
1805
- USE(live_data_olds);
1806
- USE(live_pointer_olds);
1807
- USE(live_codes);
1808
- USE(live_cells);
1809
- USE(live_news);
1810
- ASSERT(live_maps == live_map_objects_);
1811
- ASSERT(live_data_olds == live_old_data_objects_);
1812
- ASSERT(live_pointer_olds == live_old_pointer_objects_);
1813
- ASSERT(live_codes == live_code_objects_);
1814
- ASSERT(live_cells == live_cell_objects_);
1815
- ASSERT(live_news == live_young_objects_);
2069
+ int live_maps_size = IterateLiveObjects(Heap::map_space(),
2070
+ &RelocateMapObject);
2071
+ int live_pointer_olds_size = IterateLiveObjects(Heap::old_pointer_space(),
2072
+ &RelocateOldPointerObject);
2073
+ int live_data_olds_size = IterateLiveObjects(Heap::old_data_space(),
2074
+ &RelocateOldDataObject);
2075
+ int live_codes_size = IterateLiveObjects(Heap::code_space(),
2076
+ &RelocateCodeObject);
2077
+ int live_cells_size = IterateLiveObjects(Heap::cell_space(),
2078
+ &RelocateCellObject);
2079
+ int live_news_size = IterateLiveObjects(Heap::new_space(),
2080
+ &RelocateNewObject);
2081
+
2082
+ USE(live_maps_size);
2083
+ USE(live_pointer_olds_size);
2084
+ USE(live_data_olds_size);
2085
+ USE(live_codes_size);
2086
+ USE(live_cells_size);
2087
+ USE(live_news_size);
2088
+ ASSERT(live_maps_size == live_map_objects_size_);
2089
+ ASSERT(live_data_olds_size == live_old_data_objects_size_);
2090
+ ASSERT(live_pointer_olds_size == live_old_pointer_objects_size_);
2091
+ ASSERT(live_codes_size == live_code_objects_size_);
2092
+ ASSERT(live_cells_size == live_cell_objects_size_);
2093
+ ASSERT(live_news_size == live_young_objects_size_);
1816
2094
 
1817
2095
  // Flip from and to spaces
1818
2096
  Heap::new_space()->Flip();
@@ -1828,7 +2106,11 @@ void MarkCompactCollector::RelocateObjects() {
1828
2106
  Page::set_rset_state(Page::IN_USE);
1829
2107
  #endif
1830
2108
  PagedSpaces spaces;
1831
- while (PagedSpace* space = spaces.next()) space->MCCommitRelocationInfo();
2109
+ for (PagedSpace* space = spaces.next(); space != NULL; space = spaces.next())
2110
+ space->MCCommitRelocationInfo();
2111
+
2112
+ Heap::CheckNewSpaceExpansionCriteria();
2113
+ Heap::IncrementYoungSurvivorsCounter(live_news_size);
1832
2114
  }
1833
2115
 
1834
2116
 
@@ -1848,7 +2130,10 @@ int MarkCompactCollector::RelocateMapObject(HeapObject* obj) {
1848
2130
  Address old_addr = obj->address();
1849
2131
 
1850
2132
  if (new_addr != old_addr) {
1851
- memmove(new_addr, old_addr, Map::kSize); // copy contents
2133
+ // Move contents.
2134
+ Heap::MoveBlock(reinterpret_cast<Object**>(new_addr),
2135
+ reinterpret_cast<Object**>(old_addr),
2136
+ Map::kSize);
1852
2137
  }
1853
2138
 
1854
2139
  #ifdef DEBUG
@@ -1904,11 +2189,19 @@ int MarkCompactCollector::RelocateOldNonCodeObject(HeapObject* obj,
1904
2189
  Address old_addr = obj->address();
1905
2190
 
1906
2191
  if (new_addr != old_addr) {
1907
- memmove(new_addr, old_addr, obj_size); // Copy contents
2192
+ // Move contents.
2193
+ Heap::MoveBlock(reinterpret_cast<Object**>(new_addr),
2194
+ reinterpret_cast<Object**>(old_addr),
2195
+ obj_size);
1908
2196
  }
1909
2197
 
1910
2198
  ASSERT(!HeapObject::FromAddress(new_addr)->IsCode());
1911
2199
 
2200
+ HeapObject* copied_to = HeapObject::FromAddress(new_addr);
2201
+ if (copied_to->IsJSFunction()) {
2202
+ PROFILE(FunctionMoveEvent(old_addr, new_addr));
2203
+ }
2204
+
1912
2205
  return obj_size;
1913
2206
  }
1914
2207
 
@@ -1943,7 +2236,10 @@ int MarkCompactCollector::RelocateCodeObject(HeapObject* obj) {
1943
2236
  Address old_addr = obj->address();
1944
2237
 
1945
2238
  if (new_addr != old_addr) {
1946
- memmove(new_addr, old_addr, obj_size); // Copy contents.
2239
+ // Move contents.
2240
+ Heap::MoveBlock(reinterpret_cast<Object**>(new_addr),
2241
+ reinterpret_cast<Object**>(old_addr),
2242
+ obj_size);
1947
2243
  }
1948
2244
 
1949
2245
  HeapObject* copied_to = HeapObject::FromAddress(new_addr);
@@ -1951,7 +2247,7 @@ int MarkCompactCollector::RelocateCodeObject(HeapObject* obj) {
1951
2247
  // May also update inline cache target.
1952
2248
  Code::cast(copied_to)->Relocate(new_addr - old_addr);
1953
2249
  // Notify the logger that compiled code has moved.
1954
- LOG(CodeMoveEvent(old_addr, new_addr));
2250
+ PROFILE(CodeMoveEvent(old_addr, new_addr));
1955
2251
  }
1956
2252
 
1957
2253
  return obj_size;
@@ -1979,9 +2275,9 @@ int MarkCompactCollector::RelocateNewObject(HeapObject* obj) {
1979
2275
  #endif
1980
2276
 
1981
2277
  // New and old addresses cannot overlap.
1982
- memcpy(reinterpret_cast<void*>(new_addr),
1983
- reinterpret_cast<void*>(old_addr),
1984
- obj_size);
2278
+ Heap::CopyBlock(reinterpret_cast<Object**>(new_addr),
2279
+ reinterpret_cast<Object**>(old_addr),
2280
+ obj_size);
1985
2281
 
1986
2282
  #ifdef DEBUG
1987
2283
  if (FLAG_gc_verbose) {
@@ -1989,6 +2285,11 @@ int MarkCompactCollector::RelocateNewObject(HeapObject* obj) {
1989
2285
  }
1990
2286
  #endif
1991
2287
 
2288
+ HeapObject* copied_to = HeapObject::FromAddress(new_addr);
2289
+ if (copied_to->IsJSFunction()) {
2290
+ PROFILE(FunctionMoveEvent(old_addr, new_addr));
2291
+ }
2292
+
1992
2293
  return obj_size;
1993
2294
  }
1994
2295
 
@@ -2004,4 +2305,15 @@ void MarkCompactCollector::RebuildRSets() {
2004
2305
  Heap::RebuildRSets();
2005
2306
  }
2006
2307
 
2308
+
2309
+ void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj) {
2310
+ #ifdef ENABLE_LOGGING_AND_PROFILING
2311
+ if (obj->IsCode()) {
2312
+ PROFILE(CodeDeleteEvent(obj->address()));
2313
+ } else if (obj->IsJSFunction()) {
2314
+ PROFILE(FunctionDeleteEvent(obj->address()));
2315
+ }
2316
+ #endif
2317
+ }
2318
+
2007
2319
  } } // namespace v8::internal