therubyracer 0.5.0-x86-linux → 0.11.0beta5-x86-linux

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 (721) hide show
  1. data/.gitignore +23 -11
  2. data/.travis.yml +10 -0
  3. data/Changelog.md +242 -0
  4. data/Gemfile +16 -0
  5. data/README.md +185 -0
  6. data/Rakefile +42 -51
  7. data/benchmarks.rb +217 -0
  8. data/ext/v8/accessor.cc +181 -0
  9. data/ext/v8/array.cc +26 -0
  10. data/ext/v8/backref.cc +56 -0
  11. data/ext/v8/build.rb +52 -0
  12. data/ext/v8/constants.cc +34 -0
  13. data/ext/v8/constraints.cc +52 -0
  14. data/ext/v8/context.cc +130 -0
  15. data/ext/v8/date.cc +18 -0
  16. data/ext/v8/exception.cc +38 -0
  17. data/ext/v8/extconf.rb +16 -29
  18. data/ext/v8/external.cc +43 -0
  19. data/ext/v8/function.cc +58 -0
  20. data/ext/v8/gc.cc +43 -0
  21. data/ext/v8/handles.cc +34 -0
  22. data/ext/v8/heap.cc +31 -0
  23. data/ext/v8/init.cc +39 -0
  24. data/ext/v8/init.so +0 -0
  25. data/ext/v8/invocation.cc +86 -0
  26. data/ext/v8/locker.cc +77 -0
  27. data/ext/v8/message.cc +51 -0
  28. data/ext/v8/object.cc +334 -0
  29. data/ext/v8/primitive.cc +8 -0
  30. data/ext/v8/rr.cc +83 -0
  31. data/ext/v8/rr.h +883 -0
  32. data/ext/v8/script.cc +80 -0
  33. data/ext/v8/signature.cc +18 -0
  34. data/ext/v8/stack.cc +75 -0
  35. data/ext/v8/string.cc +47 -0
  36. data/ext/v8/template.cc +175 -0
  37. data/ext/v8/trycatch.cc +86 -0
  38. data/ext/v8/v8.cc +87 -0
  39. data/ext/v8/value.cc +239 -0
  40. data/lib/v8.rb +30 -9
  41. data/lib/v8/access.rb +5 -0
  42. data/lib/v8/access/indices.rb +40 -0
  43. data/lib/v8/access/invocation.rb +47 -0
  44. data/lib/v8/access/names.rb +65 -0
  45. data/lib/v8/array.rb +26 -0
  46. data/lib/v8/context.rb +217 -75
  47. data/lib/v8/conversion.rb +35 -0
  48. data/lib/v8/conversion/array.rb +11 -0
  49. data/lib/v8/conversion/class.rb +120 -0
  50. data/lib/v8/conversion/code.rb +38 -0
  51. data/lib/v8/conversion/fundamental.rb +11 -0
  52. data/lib/v8/conversion/hash.rb +11 -0
  53. data/lib/v8/conversion/indentity.rb +31 -0
  54. data/lib/v8/conversion/method.rb +26 -0
  55. data/lib/v8/conversion/object.rb +28 -0
  56. data/lib/v8/conversion/primitive.rb +7 -0
  57. data/lib/v8/conversion/proc.rb +5 -0
  58. data/lib/v8/conversion/reference.rb +16 -0
  59. data/lib/v8/conversion/string.rb +12 -0
  60. data/lib/v8/conversion/symbol.rb +7 -0
  61. data/lib/v8/conversion/time.rb +13 -0
  62. data/lib/v8/error.rb +25 -0
  63. data/lib/v8/error/protect.rb +20 -0
  64. data/lib/v8/error/try.rb +15 -0
  65. data/lib/v8/function.rb +28 -0
  66. data/lib/v8/object.rb +69 -28
  67. data/lib/v8/util/weakcell.rb +29 -0
  68. data/lib/v8/version.rb +3 -0
  69. data/spec/c/array_spec.rb +17 -0
  70. data/spec/c/constants_spec.rb +20 -0
  71. data/spec/c/exception_spec.rb +26 -0
  72. data/spec/c/external_spec.rb +9 -0
  73. data/spec/c/function_spec.rb +46 -0
  74. data/spec/c/handles_spec.rb +35 -0
  75. data/spec/c/locker_spec.rb +38 -0
  76. data/spec/c/object_spec.rb +46 -0
  77. data/spec/c/script_spec.rb +28 -0
  78. data/spec/c/string_spec.rb +16 -0
  79. data/spec/c/template_spec.rb +30 -0
  80. data/spec/c/trycatch_spec.rb +51 -0
  81. data/spec/mem/blunt_spec.rb +42 -0
  82. data/spec/redjs_spec.rb +10 -0
  83. data/spec/spec_helper.rb +43 -12
  84. data/spec/threading_spec.rb +52 -0
  85. data/spec/v8/context_spec.rb +19 -0
  86. data/spec/v8/conversion_spec.rb +9 -0
  87. data/spec/v8/error_spec.rb +21 -0
  88. data/spec/v8/function_spec.rb +9 -0
  89. data/spec/v8/object_spec.rb +15 -0
  90. data/thefrontside.png +0 -0
  91. data/therubyracer.gemspec +15 -676
  92. metadata +146 -680
  93. data/.gitmodules +0 -3
  94. data/Doxyfile +0 -1514
  95. data/History.txt +0 -51
  96. data/README.rdoc +0 -158
  97. data/docs/data_conversion.txt +0 -18
  98. data/ext/v8/callbacks.cpp +0 -160
  99. data/ext/v8/callbacks.h +0 -14
  100. data/ext/v8/convert_ruby.cpp +0 -8
  101. data/ext/v8/convert_ruby.h +0 -99
  102. data/ext/v8/convert_string.cpp +0 -10
  103. data/ext/v8/convert_string.h +0 -73
  104. data/ext/v8/convert_v8.cpp +0 -9
  105. data/ext/v8/convert_v8.h +0 -121
  106. data/ext/v8/converters.cpp +0 -83
  107. data/ext/v8/converters.h +0 -23
  108. data/ext/v8/upstream/2.0.6/.gitignore +0 -26
  109. data/ext/v8/upstream/2.0.6/AUTHORS +0 -23
  110. data/ext/v8/upstream/2.0.6/ChangeLog +0 -1479
  111. data/ext/v8/upstream/2.0.6/LICENSE +0 -55
  112. data/ext/v8/upstream/2.0.6/SConstruct +0 -1028
  113. data/ext/v8/upstream/2.0.6/include/v8-debug.h +0 -275
  114. data/ext/v8/upstream/2.0.6/include/v8.h +0 -3236
  115. data/ext/v8/upstream/2.0.6/src/SConscript +0 -283
  116. data/ext/v8/upstream/2.0.6/src/accessors.cc +0 -695
  117. data/ext/v8/upstream/2.0.6/src/accessors.h +0 -114
  118. data/ext/v8/upstream/2.0.6/src/allocation.cc +0 -198
  119. data/ext/v8/upstream/2.0.6/src/allocation.h +0 -169
  120. data/ext/v8/upstream/2.0.6/src/api.cc +0 -3831
  121. data/ext/v8/upstream/2.0.6/src/api.h +0 -479
  122. data/ext/v8/upstream/2.0.6/src/apinatives.js +0 -110
  123. data/ext/v8/upstream/2.0.6/src/apiutils.h +0 -69
  124. data/ext/v8/upstream/2.0.6/src/arguments.h +0 -97
  125. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm-inl.h +0 -277
  126. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.cc +0 -1821
  127. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.h +0 -1027
  128. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2-inl.h +0 -267
  129. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.cc +0 -1821
  130. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.h +0 -1027
  131. data/ext/v8/upstream/2.0.6/src/arm/builtins-arm.cc +0 -1271
  132. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm-inl.h +0 -74
  133. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.cc +0 -6682
  134. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.h +0 -535
  135. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.cc +0 -112
  136. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.h +0 -347
  137. data/ext/v8/upstream/2.0.6/src/arm/cpu-arm.cc +0 -132
  138. data/ext/v8/upstream/2.0.6/src/arm/debug-arm.cc +0 -213
  139. data/ext/v8/upstream/2.0.6/src/arm/disasm-arm.cc +0 -1166
  140. data/ext/v8/upstream/2.0.6/src/arm/fast-codegen-arm.cc +0 -1698
  141. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.cc +0 -123
  142. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.h +0 -162
  143. data/ext/v8/upstream/2.0.6/src/arm/ic-arm.cc +0 -849
  144. data/ext/v8/upstream/2.0.6/src/arm/jump-target-arm.cc +0 -238
  145. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.cc +0 -1259
  146. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.h +0 -423
  147. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.cc +0 -1266
  148. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.h +0 -282
  149. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm-inl.h +0 -103
  150. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.cc +0 -59
  151. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.h +0 -43
  152. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.cc +0 -2264
  153. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.h +0 -306
  154. data/ext/v8/upstream/2.0.6/src/arm/stub-cache-arm.cc +0 -1516
  155. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.cc +0 -412
  156. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.h +0 -532
  157. data/ext/v8/upstream/2.0.6/src/array.js +0 -1154
  158. data/ext/v8/upstream/2.0.6/src/assembler.cc +0 -772
  159. data/ext/v8/upstream/2.0.6/src/assembler.h +0 -525
  160. data/ext/v8/upstream/2.0.6/src/ast.cc +0 -512
  161. data/ext/v8/upstream/2.0.6/src/ast.h +0 -1820
  162. data/ext/v8/upstream/2.0.6/src/bootstrapper.cc +0 -1680
  163. data/ext/v8/upstream/2.0.6/src/bootstrapper.h +0 -103
  164. data/ext/v8/upstream/2.0.6/src/builtins.cc +0 -851
  165. data/ext/v8/upstream/2.0.6/src/builtins.h +0 -245
  166. data/ext/v8/upstream/2.0.6/src/bytecodes-irregexp.h +0 -104
  167. data/ext/v8/upstream/2.0.6/src/char-predicates-inl.h +0 -86
  168. data/ext/v8/upstream/2.0.6/src/char-predicates.h +0 -65
  169. data/ext/v8/upstream/2.0.6/src/checks.cc +0 -100
  170. data/ext/v8/upstream/2.0.6/src/checks.h +0 -284
  171. data/ext/v8/upstream/2.0.6/src/code-stubs.cc +0 -164
  172. data/ext/v8/upstream/2.0.6/src/code-stubs.h +0 -164
  173. data/ext/v8/upstream/2.0.6/src/code.h +0 -68
  174. data/ext/v8/upstream/2.0.6/src/codegen-inl.h +0 -88
  175. data/ext/v8/upstream/2.0.6/src/codegen.cc +0 -504
  176. data/ext/v8/upstream/2.0.6/src/codegen.h +0 -522
  177. data/ext/v8/upstream/2.0.6/src/compilation-cache.cc +0 -490
  178. data/ext/v8/upstream/2.0.6/src/compilation-cache.h +0 -98
  179. data/ext/v8/upstream/2.0.6/src/compiler.cc +0 -1132
  180. data/ext/v8/upstream/2.0.6/src/compiler.h +0 -107
  181. data/ext/v8/upstream/2.0.6/src/contexts.cc +0 -256
  182. data/ext/v8/upstream/2.0.6/src/contexts.h +0 -345
  183. data/ext/v8/upstream/2.0.6/src/conversions-inl.h +0 -95
  184. data/ext/v8/upstream/2.0.6/src/conversions.cc +0 -709
  185. data/ext/v8/upstream/2.0.6/src/conversions.h +0 -118
  186. data/ext/v8/upstream/2.0.6/src/counters.cc +0 -78
  187. data/ext/v8/upstream/2.0.6/src/counters.h +0 -239
  188. data/ext/v8/upstream/2.0.6/src/cpu.h +0 -65
  189. data/ext/v8/upstream/2.0.6/src/d8-debug.cc +0 -345
  190. data/ext/v8/upstream/2.0.6/src/d8-debug.h +0 -155
  191. data/ext/v8/upstream/2.0.6/src/d8-posix.cc +0 -675
  192. data/ext/v8/upstream/2.0.6/src/d8-readline.cc +0 -128
  193. data/ext/v8/upstream/2.0.6/src/d8-windows.cc +0 -42
  194. data/ext/v8/upstream/2.0.6/src/d8.cc +0 -776
  195. data/ext/v8/upstream/2.0.6/src/d8.h +0 -225
  196. data/ext/v8/upstream/2.0.6/src/d8.js +0 -1625
  197. data/ext/v8/upstream/2.0.6/src/date-delay.js +0 -1138
  198. data/ext/v8/upstream/2.0.6/src/dateparser-inl.h +0 -114
  199. data/ext/v8/upstream/2.0.6/src/dateparser.cc +0 -186
  200. data/ext/v8/upstream/2.0.6/src/dateparser.h +0 -240
  201. data/ext/v8/upstream/2.0.6/src/debug-agent.cc +0 -425
  202. data/ext/v8/upstream/2.0.6/src/debug-agent.h +0 -129
  203. data/ext/v8/upstream/2.0.6/src/debug-delay.js +0 -2073
  204. data/ext/v8/upstream/2.0.6/src/debug.cc +0 -2751
  205. data/ext/v8/upstream/2.0.6/src/debug.h +0 -866
  206. data/ext/v8/upstream/2.0.6/src/disasm.h +0 -77
  207. data/ext/v8/upstream/2.0.6/src/disassembler.cc +0 -318
  208. data/ext/v8/upstream/2.0.6/src/disassembler.h +0 -56
  209. data/ext/v8/upstream/2.0.6/src/dtoa-config.c +0 -91
  210. data/ext/v8/upstream/2.0.6/src/execution.cc +0 -701
  211. data/ext/v8/upstream/2.0.6/src/execution.h +0 -312
  212. data/ext/v8/upstream/2.0.6/src/factory.cc +0 -957
  213. data/ext/v8/upstream/2.0.6/src/factory.h +0 -393
  214. data/ext/v8/upstream/2.0.6/src/fast-codegen.cc +0 -725
  215. data/ext/v8/upstream/2.0.6/src/fast-codegen.h +0 -371
  216. data/ext/v8/upstream/2.0.6/src/flag-definitions.h +0 -426
  217. data/ext/v8/upstream/2.0.6/src/flags.cc +0 -555
  218. data/ext/v8/upstream/2.0.6/src/flags.h +0 -81
  219. data/ext/v8/upstream/2.0.6/src/frame-element.cc +0 -45
  220. data/ext/v8/upstream/2.0.6/src/frame-element.h +0 -235
  221. data/ext/v8/upstream/2.0.6/src/frames-inl.h +0 -215
  222. data/ext/v8/upstream/2.0.6/src/frames.cc +0 -749
  223. data/ext/v8/upstream/2.0.6/src/frames.h +0 -659
  224. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.cc +0 -76
  225. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.h +0 -135
  226. data/ext/v8/upstream/2.0.6/src/global-handles.cc +0 -516
  227. data/ext/v8/upstream/2.0.6/src/global-handles.h +0 -180
  228. data/ext/v8/upstream/2.0.6/src/globals.h +0 -608
  229. data/ext/v8/upstream/2.0.6/src/handles-inl.h +0 -76
  230. data/ext/v8/upstream/2.0.6/src/handles.cc +0 -811
  231. data/ext/v8/upstream/2.0.6/src/handles.h +0 -367
  232. data/ext/v8/upstream/2.0.6/src/hashmap.cc +0 -226
  233. data/ext/v8/upstream/2.0.6/src/hashmap.h +0 -120
  234. data/ext/v8/upstream/2.0.6/src/heap-inl.h +0 -407
  235. data/ext/v8/upstream/2.0.6/src/heap-profiler.cc +0 -695
  236. data/ext/v8/upstream/2.0.6/src/heap-profiler.h +0 -277
  237. data/ext/v8/upstream/2.0.6/src/heap.cc +0 -4204
  238. data/ext/v8/upstream/2.0.6/src/heap.h +0 -1704
  239. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32-inl.h +0 -325
  240. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.cc +0 -2375
  241. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.h +0 -914
  242. data/ext/v8/upstream/2.0.6/src/ia32/builtins-ia32.cc +0 -1222
  243. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32-inl.h +0 -46
  244. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.cc +0 -9770
  245. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.h +0 -834
  246. data/ext/v8/upstream/2.0.6/src/ia32/cpu-ia32.cc +0 -79
  247. data/ext/v8/upstream/2.0.6/src/ia32/debug-ia32.cc +0 -208
  248. data/ext/v8/upstream/2.0.6/src/ia32/disasm-ia32.cc +0 -1357
  249. data/ext/v8/upstream/2.0.6/src/ia32/fast-codegen-ia32.cc +0 -1813
  250. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.cc +0 -111
  251. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.h +0 -135
  252. data/ext/v8/upstream/2.0.6/src/ia32/ic-ia32.cc +0 -1490
  253. data/ext/v8/upstream/2.0.6/src/ia32/jump-target-ia32.cc +0 -432
  254. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.cc +0 -1517
  255. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.h +0 -528
  256. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.cc +0 -1219
  257. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.h +0 -230
  258. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32-inl.h +0 -82
  259. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.cc +0 -99
  260. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.h +0 -43
  261. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.cc +0 -30
  262. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.h +0 -62
  263. data/ext/v8/upstream/2.0.6/src/ia32/stub-cache-ia32.cc +0 -1961
  264. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.cc +0 -1105
  265. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.h +0 -580
  266. data/ext/v8/upstream/2.0.6/src/ic-inl.h +0 -93
  267. data/ext/v8/upstream/2.0.6/src/ic.cc +0 -1426
  268. data/ext/v8/upstream/2.0.6/src/ic.h +0 -443
  269. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.cc +0 -646
  270. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.h +0 -48
  271. data/ext/v8/upstream/2.0.6/src/json-delay.js +0 -254
  272. data/ext/v8/upstream/2.0.6/src/jsregexp.cc +0 -5234
  273. data/ext/v8/upstream/2.0.6/src/jsregexp.h +0 -1439
  274. data/ext/v8/upstream/2.0.6/src/jump-target-inl.h +0 -49
  275. data/ext/v8/upstream/2.0.6/src/jump-target.cc +0 -383
  276. data/ext/v8/upstream/2.0.6/src/jump-target.h +0 -280
  277. data/ext/v8/upstream/2.0.6/src/list-inl.h +0 -166
  278. data/ext/v8/upstream/2.0.6/src/list.h +0 -158
  279. data/ext/v8/upstream/2.0.6/src/log-inl.h +0 -126
  280. data/ext/v8/upstream/2.0.6/src/log-utils.cc +0 -503
  281. data/ext/v8/upstream/2.0.6/src/log-utils.h +0 -292
  282. data/ext/v8/upstream/2.0.6/src/log.cc +0 -1457
  283. data/ext/v8/upstream/2.0.6/src/log.h +0 -371
  284. data/ext/v8/upstream/2.0.6/src/macro-assembler.h +0 -93
  285. data/ext/v8/upstream/2.0.6/src/macros.py +0 -137
  286. data/ext/v8/upstream/2.0.6/src/mark-compact.cc +0 -2007
  287. data/ext/v8/upstream/2.0.6/src/mark-compact.h +0 -442
  288. data/ext/v8/upstream/2.0.6/src/math.js +0 -263
  289. data/ext/v8/upstream/2.0.6/src/memory.h +0 -74
  290. data/ext/v8/upstream/2.0.6/src/messages.cc +0 -177
  291. data/ext/v8/upstream/2.0.6/src/messages.h +0 -112
  292. data/ext/v8/upstream/2.0.6/src/messages.js +0 -937
  293. data/ext/v8/upstream/2.0.6/src/mirror-delay.js +0 -2332
  294. data/ext/v8/upstream/2.0.6/src/mksnapshot.cc +0 -169
  295. data/ext/v8/upstream/2.0.6/src/natives.h +0 -63
  296. data/ext/v8/upstream/2.0.6/src/objects-debug.cc +0 -1317
  297. data/ext/v8/upstream/2.0.6/src/objects-inl.h +0 -3044
  298. data/ext/v8/upstream/2.0.6/src/objects.cc +0 -8306
  299. data/ext/v8/upstream/2.0.6/src/objects.h +0 -4960
  300. data/ext/v8/upstream/2.0.6/src/oprofile-agent.cc +0 -116
  301. data/ext/v8/upstream/2.0.6/src/oprofile-agent.h +0 -69
  302. data/ext/v8/upstream/2.0.6/src/parser.cc +0 -4810
  303. data/ext/v8/upstream/2.0.6/src/parser.h +0 -195
  304. data/ext/v8/upstream/2.0.6/src/platform-freebsd.cc +0 -645
  305. data/ext/v8/upstream/2.0.6/src/platform-linux.cc +0 -808
  306. data/ext/v8/upstream/2.0.6/src/platform-macos.cc +0 -643
  307. data/ext/v8/upstream/2.0.6/src/platform-nullos.cc +0 -454
  308. data/ext/v8/upstream/2.0.6/src/platform-openbsd.cc +0 -597
  309. data/ext/v8/upstream/2.0.6/src/platform-posix.cc +0 -380
  310. data/ext/v8/upstream/2.0.6/src/platform-win32.cc +0 -1908
  311. data/ext/v8/upstream/2.0.6/src/platform.h +0 -556
  312. data/ext/v8/upstream/2.0.6/src/prettyprinter.cc +0 -1511
  313. data/ext/v8/upstream/2.0.6/src/prettyprinter.h +0 -219
  314. data/ext/v8/upstream/2.0.6/src/property.cc +0 -96
  315. data/ext/v8/upstream/2.0.6/src/property.h +0 -327
  316. data/ext/v8/upstream/2.0.6/src/regexp-delay.js +0 -406
  317. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp-inl.h +0 -78
  318. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.cc +0 -464
  319. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.h +0 -141
  320. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.cc +0 -356
  321. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.h +0 -103
  322. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.cc +0 -240
  323. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.h +0 -220
  324. data/ext/v8/upstream/2.0.6/src/regexp-stack.cc +0 -103
  325. data/ext/v8/upstream/2.0.6/src/regexp-stack.h +0 -123
  326. data/ext/v8/upstream/2.0.6/src/register-allocator-inl.h +0 -74
  327. data/ext/v8/upstream/2.0.6/src/register-allocator.cc +0 -100
  328. data/ext/v8/upstream/2.0.6/src/register-allocator.h +0 -295
  329. data/ext/v8/upstream/2.0.6/src/rewriter.cc +0 -855
  330. data/ext/v8/upstream/2.0.6/src/rewriter.h +0 -54
  331. data/ext/v8/upstream/2.0.6/src/runtime.cc +0 -8163
  332. data/ext/v8/upstream/2.0.6/src/runtime.h +0 -432
  333. data/ext/v8/upstream/2.0.6/src/runtime.js +0 -626
  334. data/ext/v8/upstream/2.0.6/src/scanner.cc +0 -1098
  335. data/ext/v8/upstream/2.0.6/src/scanner.h +0 -425
  336. data/ext/v8/upstream/2.0.6/src/scopeinfo.cc +0 -649
  337. data/ext/v8/upstream/2.0.6/src/scopeinfo.h +0 -236
  338. data/ext/v8/upstream/2.0.6/src/scopes.cc +0 -963
  339. data/ext/v8/upstream/2.0.6/src/scopes.h +0 -401
  340. data/ext/v8/upstream/2.0.6/src/serialize.cc +0 -1260
  341. data/ext/v8/upstream/2.0.6/src/serialize.h +0 -404
  342. data/ext/v8/upstream/2.0.6/src/shell.h +0 -55
  343. data/ext/v8/upstream/2.0.6/src/simulator.h +0 -41
  344. data/ext/v8/upstream/2.0.6/src/smart-pointer.h +0 -109
  345. data/ext/v8/upstream/2.0.6/src/snapshot-common.cc +0 -97
  346. data/ext/v8/upstream/2.0.6/src/snapshot-empty.cc +0 -40
  347. data/ext/v8/upstream/2.0.6/src/snapshot.h +0 -59
  348. data/ext/v8/upstream/2.0.6/src/spaces-inl.h +0 -372
  349. data/ext/v8/upstream/2.0.6/src/spaces.cc +0 -2864
  350. data/ext/v8/upstream/2.0.6/src/spaces.h +0 -2072
  351. data/ext/v8/upstream/2.0.6/src/string-stream.cc +0 -584
  352. data/ext/v8/upstream/2.0.6/src/string-stream.h +0 -189
  353. data/ext/v8/upstream/2.0.6/src/string.js +0 -901
  354. data/ext/v8/upstream/2.0.6/src/stub-cache.cc +0 -1108
  355. data/ext/v8/upstream/2.0.6/src/stub-cache.h +0 -578
  356. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/COPYING +0 -15
  357. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/dtoa.c +0 -3330
  358. data/ext/v8/upstream/2.0.6/src/third_party/valgrind/valgrind.h +0 -3925
  359. data/ext/v8/upstream/2.0.6/src/token.cc +0 -56
  360. data/ext/v8/upstream/2.0.6/src/token.h +0 -270
  361. data/ext/v8/upstream/2.0.6/src/top.cc +0 -991
  362. data/ext/v8/upstream/2.0.6/src/top.h +0 -459
  363. data/ext/v8/upstream/2.0.6/src/unicode-inl.h +0 -238
  364. data/ext/v8/upstream/2.0.6/src/unicode.cc +0 -749
  365. data/ext/v8/upstream/2.0.6/src/unicode.h +0 -279
  366. data/ext/v8/upstream/2.0.6/src/uri.js +0 -415
  367. data/ext/v8/upstream/2.0.6/src/usage-analyzer.cc +0 -426
  368. data/ext/v8/upstream/2.0.6/src/usage-analyzer.h +0 -40
  369. data/ext/v8/upstream/2.0.6/src/utils.cc +0 -322
  370. data/ext/v8/upstream/2.0.6/src/utils.h +0 -592
  371. data/ext/v8/upstream/2.0.6/src/v8-counters.cc +0 -55
  372. data/ext/v8/upstream/2.0.6/src/v8-counters.h +0 -198
  373. data/ext/v8/upstream/2.0.6/src/v8.cc +0 -193
  374. data/ext/v8/upstream/2.0.6/src/v8.h +0 -119
  375. data/ext/v8/upstream/2.0.6/src/v8natives.js +0 -846
  376. data/ext/v8/upstream/2.0.6/src/v8threads.cc +0 -450
  377. data/ext/v8/upstream/2.0.6/src/v8threads.h +0 -144
  378. data/ext/v8/upstream/2.0.6/src/variables.cc +0 -163
  379. data/ext/v8/upstream/2.0.6/src/variables.h +0 -235
  380. data/ext/v8/upstream/2.0.6/src/version.cc +0 -88
  381. data/ext/v8/upstream/2.0.6/src/version.h +0 -64
  382. data/ext/v8/upstream/2.0.6/src/virtual-frame.cc +0 -381
  383. data/ext/v8/upstream/2.0.6/src/virtual-frame.h +0 -44
  384. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64-inl.h +0 -352
  385. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.cc +0 -2539
  386. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.h +0 -1399
  387. data/ext/v8/upstream/2.0.6/src/x64/builtins-x64.cc +0 -1255
  388. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64-inl.h +0 -46
  389. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.cc +0 -8223
  390. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.h +0 -785
  391. data/ext/v8/upstream/2.0.6/src/x64/cpu-x64.cc +0 -79
  392. data/ext/v8/upstream/2.0.6/src/x64/debug-x64.cc +0 -202
  393. data/ext/v8/upstream/2.0.6/src/x64/disasm-x64.cc +0 -1596
  394. data/ext/v8/upstream/2.0.6/src/x64/fast-codegen-x64.cc +0 -1820
  395. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.cc +0 -109
  396. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.h +0 -121
  397. data/ext/v8/upstream/2.0.6/src/x64/ic-x64.cc +0 -1392
  398. data/ext/v8/upstream/2.0.6/src/x64/jump-target-x64.cc +0 -432
  399. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.cc +0 -2409
  400. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.h +0 -765
  401. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.cc +0 -1337
  402. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.h +0 -295
  403. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64-inl.h +0 -86
  404. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.cc +0 -84
  405. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.h +0 -43
  406. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.cc +0 -27
  407. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.h +0 -63
  408. data/ext/v8/upstream/2.0.6/src/x64/stub-cache-x64.cc +0 -1884
  409. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.cc +0 -1089
  410. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.h +0 -560
  411. data/ext/v8/upstream/2.0.6/src/zone-inl.h +0 -297
  412. data/ext/v8/upstream/2.0.6/src/zone.cc +0 -193
  413. data/ext/v8/upstream/2.0.6/src/zone.h +0 -305
  414. data/ext/v8/upstream/2.0.6/tools/codemap.js +0 -258
  415. data/ext/v8/upstream/2.0.6/tools/consarray.js +0 -93
  416. data/ext/v8/upstream/2.0.6/tools/csvparser.js +0 -98
  417. data/ext/v8/upstream/2.0.6/tools/gyp/v8.gyp +0 -620
  418. data/ext/v8/upstream/2.0.6/tools/js2c.py +0 -376
  419. data/ext/v8/upstream/2.0.6/tools/jsmin.py +0 -280
  420. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor +0 -24
  421. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor.py +0 -78
  422. data/ext/v8/upstream/2.0.6/tools/logreader.js +0 -320
  423. data/ext/v8/upstream/2.0.6/tools/mac-nm +0 -18
  424. data/ext/v8/upstream/2.0.6/tools/mac-tick-processor +0 -6
  425. data/ext/v8/upstream/2.0.6/tools/oprofile/annotate +0 -7
  426. data/ext/v8/upstream/2.0.6/tools/oprofile/common +0 -19
  427. data/ext/v8/upstream/2.0.6/tools/oprofile/dump +0 -7
  428. data/ext/v8/upstream/2.0.6/tools/oprofile/report +0 -7
  429. data/ext/v8/upstream/2.0.6/tools/oprofile/reset +0 -7
  430. data/ext/v8/upstream/2.0.6/tools/oprofile/run +0 -14
  431. data/ext/v8/upstream/2.0.6/tools/oprofile/shutdown +0 -7
  432. data/ext/v8/upstream/2.0.6/tools/oprofile/start +0 -7
  433. data/ext/v8/upstream/2.0.6/tools/presubmit.py +0 -299
  434. data/ext/v8/upstream/2.0.6/tools/process-heap-prof.py +0 -120
  435. data/ext/v8/upstream/2.0.6/tools/profile.js +0 -621
  436. data/ext/v8/upstream/2.0.6/tools/profile_view.js +0 -224
  437. data/ext/v8/upstream/2.0.6/tools/run-valgrind.py +0 -77
  438. data/ext/v8/upstream/2.0.6/tools/splaytree.js +0 -322
  439. data/ext/v8/upstream/2.0.6/tools/splaytree.py +0 -226
  440. data/ext/v8/upstream/2.0.6/tools/stats-viewer.py +0 -456
  441. data/ext/v8/upstream/2.0.6/tools/test.py +0 -1370
  442. data/ext/v8/upstream/2.0.6/tools/tickprocessor-driver.js +0 -53
  443. data/ext/v8/upstream/2.0.6/tools/tickprocessor.js +0 -731
  444. data/ext/v8/upstream/2.0.6/tools/tickprocessor.py +0 -535
  445. data/ext/v8/upstream/2.0.6/tools/utils.py +0 -82
  446. data/ext/v8/upstream/2.0.6/tools/visual_studio/README.txt +0 -71
  447. data/ext/v8/upstream/2.0.6/tools/visual_studio/arm.vsprops +0 -14
  448. data/ext/v8/upstream/2.0.6/tools/visual_studio/common.vsprops +0 -35
  449. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8.vcproj +0 -199
  450. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_arm.vcproj +0 -199
  451. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_x64.vcproj +0 -201
  452. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8js2c.cmd +0 -6
  453. data/ext/v8/upstream/2.0.6/tools/visual_studio/debug.vsprops +0 -17
  454. data/ext/v8/upstream/2.0.6/tools/visual_studio/ia32.vsprops +0 -13
  455. data/ext/v8/upstream/2.0.6/tools/visual_studio/js2c.cmd +0 -6
  456. data/ext/v8/upstream/2.0.6/tools/visual_studio/release.vsprops +0 -24
  457. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.sln +0 -101
  458. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.vcproj +0 -223
  459. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.sln +0 -74
  460. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.vcproj +0 -223
  461. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base.vcproj +0 -971
  462. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_arm.vcproj +0 -983
  463. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_x64.vcproj +0 -959
  464. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest.vcproj +0 -255
  465. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_arm.vcproj +0 -243
  466. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_x64.vcproj +0 -257
  467. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot.vcproj +0 -151
  468. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -151
  469. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample.vcproj +0 -151
  470. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_arm.vcproj +0 -151
  471. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_x64.vcproj +0 -151
  472. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample.vcproj +0 -151
  473. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -151
  474. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -153
  475. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot.vcproj +0 -142
  476. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc.vcproj +0 -92
  477. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -92
  478. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_x64.vcproj +0 -142
  479. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.sln +0 -101
  480. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.vcproj +0 -223
  481. data/ext/v8/upstream/2.0.6/tools/visual_studio/x64.vsprops +0 -13
  482. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.bat +0 -5
  483. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.py +0 -137
  484. data/ext/v8/upstream/Makefile +0 -32
  485. data/ext/v8/upstream/fpic-on-linux-amd64.patch +0 -13
  486. data/ext/v8/upstream/no-strict-aliasing.patch +0 -13
  487. data/ext/v8/upstream/scons/CHANGES.txt +0 -5183
  488. data/ext/v8/upstream/scons/LICENSE.txt +0 -20
  489. data/ext/v8/upstream/scons/MANIFEST +0 -202
  490. data/ext/v8/upstream/scons/PKG-INFO +0 -13
  491. data/ext/v8/upstream/scons/README.txt +0 -273
  492. data/ext/v8/upstream/scons/RELEASE.txt +0 -1040
  493. data/ext/v8/upstream/scons/engine/SCons/Action.py +0 -1256
  494. data/ext/v8/upstream/scons/engine/SCons/Builder.py +0 -868
  495. data/ext/v8/upstream/scons/engine/SCons/CacheDir.py +0 -217
  496. data/ext/v8/upstream/scons/engine/SCons/Conftest.py +0 -794
  497. data/ext/v8/upstream/scons/engine/SCons/Debug.py +0 -237
  498. data/ext/v8/upstream/scons/engine/SCons/Defaults.py +0 -485
  499. data/ext/v8/upstream/scons/engine/SCons/Environment.py +0 -2327
  500. data/ext/v8/upstream/scons/engine/SCons/Errors.py +0 -207
  501. data/ext/v8/upstream/scons/engine/SCons/Executor.py +0 -636
  502. data/ext/v8/upstream/scons/engine/SCons/Job.py +0 -435
  503. data/ext/v8/upstream/scons/engine/SCons/Memoize.py +0 -292
  504. data/ext/v8/upstream/scons/engine/SCons/Node/Alias.py +0 -153
  505. data/ext/v8/upstream/scons/engine/SCons/Node/FS.py +0 -3220
  506. data/ext/v8/upstream/scons/engine/SCons/Node/Python.py +0 -128
  507. data/ext/v8/upstream/scons/engine/SCons/Node/__init__.py +0 -1341
  508. data/ext/v8/upstream/scons/engine/SCons/Options/BoolOption.py +0 -50
  509. data/ext/v8/upstream/scons/engine/SCons/Options/EnumOption.py +0 -50
  510. data/ext/v8/upstream/scons/engine/SCons/Options/ListOption.py +0 -50
  511. data/ext/v8/upstream/scons/engine/SCons/Options/PackageOption.py +0 -50
  512. data/ext/v8/upstream/scons/engine/SCons/Options/PathOption.py +0 -76
  513. data/ext/v8/upstream/scons/engine/SCons/Options/__init__.py +0 -74
  514. data/ext/v8/upstream/scons/engine/SCons/PathList.py +0 -232
  515. data/ext/v8/upstream/scons/engine/SCons/Platform/__init__.py +0 -236
  516. data/ext/v8/upstream/scons/engine/SCons/Platform/aix.py +0 -70
  517. data/ext/v8/upstream/scons/engine/SCons/Platform/cygwin.py +0 -55
  518. data/ext/v8/upstream/scons/engine/SCons/Platform/darwin.py +0 -46
  519. data/ext/v8/upstream/scons/engine/SCons/Platform/hpux.py +0 -46
  520. data/ext/v8/upstream/scons/engine/SCons/Platform/irix.py +0 -44
  521. data/ext/v8/upstream/scons/engine/SCons/Platform/os2.py +0 -58
  522. data/ext/v8/upstream/scons/engine/SCons/Platform/posix.py +0 -264
  523. data/ext/v8/upstream/scons/engine/SCons/Platform/sunos.py +0 -50
  524. data/ext/v8/upstream/scons/engine/SCons/Platform/win32.py +0 -386
  525. data/ext/v8/upstream/scons/engine/SCons/SConf.py +0 -1038
  526. data/ext/v8/upstream/scons/engine/SCons/SConsign.py +0 -381
  527. data/ext/v8/upstream/scons/engine/SCons/Scanner/C.py +0 -132
  528. data/ext/v8/upstream/scons/engine/SCons/Scanner/D.py +0 -74
  529. data/ext/v8/upstream/scons/engine/SCons/Scanner/Dir.py +0 -111
  530. data/ext/v8/upstream/scons/engine/SCons/Scanner/Fortran.py +0 -320
  531. data/ext/v8/upstream/scons/engine/SCons/Scanner/IDL.py +0 -48
  532. data/ext/v8/upstream/scons/engine/SCons/Scanner/LaTeX.py +0 -378
  533. data/ext/v8/upstream/scons/engine/SCons/Scanner/Prog.py +0 -103
  534. data/ext/v8/upstream/scons/engine/SCons/Scanner/RC.py +0 -55
  535. data/ext/v8/upstream/scons/engine/SCons/Scanner/__init__.py +0 -415
  536. data/ext/v8/upstream/scons/engine/SCons/Script/Interactive.py +0 -386
  537. data/ext/v8/upstream/scons/engine/SCons/Script/Main.py +0 -1360
  538. data/ext/v8/upstream/scons/engine/SCons/Script/SConsOptions.py +0 -944
  539. data/ext/v8/upstream/scons/engine/SCons/Script/SConscript.py +0 -642
  540. data/ext/v8/upstream/scons/engine/SCons/Script/__init__.py +0 -414
  541. data/ext/v8/upstream/scons/engine/SCons/Sig.py +0 -63
  542. data/ext/v8/upstream/scons/engine/SCons/Subst.py +0 -911
  543. data/ext/v8/upstream/scons/engine/SCons/Taskmaster.py +0 -1030
  544. data/ext/v8/upstream/scons/engine/SCons/Tool/386asm.py +0 -61
  545. data/ext/v8/upstream/scons/engine/SCons/Tool/BitKeeper.py +0 -65
  546. data/ext/v8/upstream/scons/engine/SCons/Tool/CVS.py +0 -73
  547. data/ext/v8/upstream/scons/engine/SCons/Tool/FortranCommon.py +0 -247
  548. data/ext/v8/upstream/scons/engine/SCons/Tool/JavaCommon.py +0 -324
  549. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/__init__.py +0 -56
  550. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/arch.py +0 -61
  551. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/common.py +0 -210
  552. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/netframework.py +0 -84
  553. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/sdk.py +0 -321
  554. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vc.py +0 -367
  555. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vs.py +0 -497
  556. data/ext/v8/upstream/scons/engine/SCons/Tool/Perforce.py +0 -104
  557. data/ext/v8/upstream/scons/engine/SCons/Tool/PharLapCommon.py +0 -138
  558. data/ext/v8/upstream/scons/engine/SCons/Tool/RCS.py +0 -64
  559. data/ext/v8/upstream/scons/engine/SCons/Tool/SCCS.py +0 -64
  560. data/ext/v8/upstream/scons/engine/SCons/Tool/Subversion.py +0 -71
  561. data/ext/v8/upstream/scons/engine/SCons/Tool/__init__.py +0 -675
  562. data/ext/v8/upstream/scons/engine/SCons/Tool/aixc++.py +0 -82
  563. data/ext/v8/upstream/scons/engine/SCons/Tool/aixcc.py +0 -74
  564. data/ext/v8/upstream/scons/engine/SCons/Tool/aixf77.py +0 -80
  565. data/ext/v8/upstream/scons/engine/SCons/Tool/aixlink.py +0 -76
  566. data/ext/v8/upstream/scons/engine/SCons/Tool/applelink.py +0 -71
  567. data/ext/v8/upstream/scons/engine/SCons/Tool/ar.py +0 -63
  568. data/ext/v8/upstream/scons/engine/SCons/Tool/as.py +0 -78
  569. data/ext/v8/upstream/scons/engine/SCons/Tool/bcc32.py +0 -82
  570. data/ext/v8/upstream/scons/engine/SCons/Tool/c++.py +0 -99
  571. data/ext/v8/upstream/scons/engine/SCons/Tool/cc.py +0 -114
  572. data/ext/v8/upstream/scons/engine/SCons/Tool/cvf.py +0 -58
  573. data/ext/v8/upstream/scons/engine/SCons/Tool/default.py +0 -50
  574. data/ext/v8/upstream/scons/engine/SCons/Tool/dmd.py +0 -224
  575. data/ext/v8/upstream/scons/engine/SCons/Tool/dvi.py +0 -64
  576. data/ext/v8/upstream/scons/engine/SCons/Tool/dvipdf.py +0 -125
  577. data/ext/v8/upstream/scons/engine/SCons/Tool/dvips.py +0 -94
  578. data/ext/v8/upstream/scons/engine/SCons/Tool/f77.py +0 -62
  579. data/ext/v8/upstream/scons/engine/SCons/Tool/f90.py +0 -62
  580. data/ext/v8/upstream/scons/engine/SCons/Tool/f95.py +0 -63
  581. data/ext/v8/upstream/scons/engine/SCons/Tool/filesystem.py +0 -98
  582. data/ext/v8/upstream/scons/engine/SCons/Tool/fortran.py +0 -63
  583. data/ext/v8/upstream/scons/engine/SCons/Tool/g++.py +0 -90
  584. data/ext/v8/upstream/scons/engine/SCons/Tool/g77.py +0 -73
  585. data/ext/v8/upstream/scons/engine/SCons/Tool/gas.py +0 -53
  586. data/ext/v8/upstream/scons/engine/SCons/Tool/gcc.py +0 -80
  587. data/ext/v8/upstream/scons/engine/SCons/Tool/gfortran.py +0 -64
  588. data/ext/v8/upstream/scons/engine/SCons/Tool/gnulink.py +0 -63
  589. data/ext/v8/upstream/scons/engine/SCons/Tool/gs.py +0 -81
  590. data/ext/v8/upstream/scons/engine/SCons/Tool/hpc++.py +0 -85
  591. data/ext/v8/upstream/scons/engine/SCons/Tool/hpcc.py +0 -53
  592. data/ext/v8/upstream/scons/engine/SCons/Tool/hplink.py +0 -77
  593. data/ext/v8/upstream/scons/engine/SCons/Tool/icc.py +0 -59
  594. data/ext/v8/upstream/scons/engine/SCons/Tool/icl.py +0 -52
  595. data/ext/v8/upstream/scons/engine/SCons/Tool/ifl.py +0 -72
  596. data/ext/v8/upstream/scons/engine/SCons/Tool/ifort.py +0 -90
  597. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink.py +0 -59
  598. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink32.py +0 -60
  599. data/ext/v8/upstream/scons/engine/SCons/Tool/install.py +0 -229
  600. data/ext/v8/upstream/scons/engine/SCons/Tool/intelc.py +0 -490
  601. data/ext/v8/upstream/scons/engine/SCons/Tool/ipkg.py +0 -71
  602. data/ext/v8/upstream/scons/engine/SCons/Tool/jar.py +0 -110
  603. data/ext/v8/upstream/scons/engine/SCons/Tool/javac.py +0 -234
  604. data/ext/v8/upstream/scons/engine/SCons/Tool/javah.py +0 -138
  605. data/ext/v8/upstream/scons/engine/SCons/Tool/latex.py +0 -79
  606. data/ext/v8/upstream/scons/engine/SCons/Tool/lex.py +0 -99
  607. data/ext/v8/upstream/scons/engine/SCons/Tool/link.py +0 -121
  608. data/ext/v8/upstream/scons/engine/SCons/Tool/linkloc.py +0 -112
  609. data/ext/v8/upstream/scons/engine/SCons/Tool/m4.py +0 -63
  610. data/ext/v8/upstream/scons/engine/SCons/Tool/masm.py +0 -77
  611. data/ext/v8/upstream/scons/engine/SCons/Tool/midl.py +0 -90
  612. data/ext/v8/upstream/scons/engine/SCons/Tool/mingw.py +0 -159
  613. data/ext/v8/upstream/scons/engine/SCons/Tool/mslib.py +0 -64
  614. data/ext/v8/upstream/scons/engine/SCons/Tool/mslink.py +0 -266
  615. data/ext/v8/upstream/scons/engine/SCons/Tool/mssdk.py +0 -50
  616. data/ext/v8/upstream/scons/engine/SCons/Tool/msvc.py +0 -269
  617. data/ext/v8/upstream/scons/engine/SCons/Tool/msvs.py +0 -1439
  618. data/ext/v8/upstream/scons/engine/SCons/Tool/mwcc.py +0 -208
  619. data/ext/v8/upstream/scons/engine/SCons/Tool/mwld.py +0 -107
  620. data/ext/v8/upstream/scons/engine/SCons/Tool/nasm.py +0 -72
  621. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/__init__.py +0 -314
  622. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/ipk.py +0 -185
  623. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/msi.py +0 -526
  624. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/rpm.py +0 -367
  625. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_tarbz2.py +0 -43
  626. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_targz.py +0 -43
  627. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_zip.py +0 -43
  628. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/tarbz2.py +0 -44
  629. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/targz.py +0 -44
  630. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/zip.py +0 -44
  631. data/ext/v8/upstream/scons/engine/SCons/Tool/pdf.py +0 -78
  632. data/ext/v8/upstream/scons/engine/SCons/Tool/pdflatex.py +0 -83
  633. data/ext/v8/upstream/scons/engine/SCons/Tool/pdftex.py +0 -108
  634. data/ext/v8/upstream/scons/engine/SCons/Tool/qt.py +0 -336
  635. data/ext/v8/upstream/scons/engine/SCons/Tool/rmic.py +0 -121
  636. data/ext/v8/upstream/scons/engine/SCons/Tool/rpcgen.py +0 -70
  637. data/ext/v8/upstream/scons/engine/SCons/Tool/rpm.py +0 -132
  638. data/ext/v8/upstream/scons/engine/SCons/Tool/sgiar.py +0 -68
  639. data/ext/v8/upstream/scons/engine/SCons/Tool/sgic++.py +0 -58
  640. data/ext/v8/upstream/scons/engine/SCons/Tool/sgicc.py +0 -53
  641. data/ext/v8/upstream/scons/engine/SCons/Tool/sgilink.py +0 -63
  642. data/ext/v8/upstream/scons/engine/SCons/Tool/sunar.py +0 -67
  643. data/ext/v8/upstream/scons/engine/SCons/Tool/sunc++.py +0 -142
  644. data/ext/v8/upstream/scons/engine/SCons/Tool/suncc.py +0 -58
  645. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf77.py +0 -63
  646. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf90.py +0 -64
  647. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf95.py +0 -64
  648. data/ext/v8/upstream/scons/engine/SCons/Tool/sunlink.py +0 -77
  649. data/ext/v8/upstream/scons/engine/SCons/Tool/swig.py +0 -186
  650. data/ext/v8/upstream/scons/engine/SCons/Tool/tar.py +0 -73
  651. data/ext/v8/upstream/scons/engine/SCons/Tool/tex.py +0 -805
  652. data/ext/v8/upstream/scons/engine/SCons/Tool/textfile.py +0 -175
  653. data/ext/v8/upstream/scons/engine/SCons/Tool/tlib.py +0 -53
  654. data/ext/v8/upstream/scons/engine/SCons/Tool/wix.py +0 -100
  655. data/ext/v8/upstream/scons/engine/SCons/Tool/yacc.py +0 -131
  656. data/ext/v8/upstream/scons/engine/SCons/Tool/zip.py +0 -100
  657. data/ext/v8/upstream/scons/engine/SCons/Util.py +0 -1645
  658. data/ext/v8/upstream/scons/engine/SCons/Variables/BoolVariable.py +0 -91
  659. data/ext/v8/upstream/scons/engine/SCons/Variables/EnumVariable.py +0 -107
  660. data/ext/v8/upstream/scons/engine/SCons/Variables/ListVariable.py +0 -139
  661. data/ext/v8/upstream/scons/engine/SCons/Variables/PackageVariable.py +0 -109
  662. data/ext/v8/upstream/scons/engine/SCons/Variables/PathVariable.py +0 -147
  663. data/ext/v8/upstream/scons/engine/SCons/Variables/__init__.py +0 -317
  664. data/ext/v8/upstream/scons/engine/SCons/Warnings.py +0 -228
  665. data/ext/v8/upstream/scons/engine/SCons/__init__.py +0 -49
  666. data/ext/v8/upstream/scons/engine/SCons/compat/__init__.py +0 -302
  667. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_UserString.py +0 -98
  668. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_hashlib.py +0 -91
  669. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_itertools.py +0 -124
  670. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_optparse.py +0 -1725
  671. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets.py +0 -583
  672. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets15.py +0 -176
  673. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_shlex.py +0 -325
  674. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_subprocess.py +0 -1296
  675. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_textwrap.py +0 -382
  676. data/ext/v8/upstream/scons/engine/SCons/compat/builtins.py +0 -187
  677. data/ext/v8/upstream/scons/engine/SCons/cpp.py +0 -598
  678. data/ext/v8/upstream/scons/engine/SCons/dblite.py +0 -248
  679. data/ext/v8/upstream/scons/engine/SCons/exitfuncs.py +0 -77
  680. data/ext/v8/upstream/scons/os_spawnv_fix.diff +0 -83
  681. data/ext/v8/upstream/scons/scons-time.1 +0 -1017
  682. data/ext/v8/upstream/scons/scons.1 +0 -15179
  683. data/ext/v8/upstream/scons/sconsign.1 +0 -208
  684. data/ext/v8/upstream/scons/script/scons +0 -184
  685. data/ext/v8/upstream/scons/script/scons-time +0 -1529
  686. data/ext/v8/upstream/scons/script/scons.bat +0 -31
  687. data/ext/v8/upstream/scons/script/sconsign +0 -508
  688. data/ext/v8/upstream/scons/setup.cfg +0 -6
  689. data/ext/v8/upstream/scons/setup.py +0 -427
  690. data/ext/v8/v8.cpp +0 -89
  691. data/ext/v8/v8_cxt.cpp +0 -92
  692. data/ext/v8/v8_cxt.h +0 -20
  693. data/ext/v8/v8_func.cpp +0 -10
  694. data/ext/v8/v8_func.h +0 -11
  695. data/ext/v8/v8_msg.cpp +0 -54
  696. data/ext/v8/v8_msg.h +0 -18
  697. data/ext/v8/v8_obj.cpp +0 -52
  698. data/ext/v8/v8_obj.h +0 -13
  699. data/ext/v8/v8_ref.cpp +0 -26
  700. data/ext/v8/v8_ref.h +0 -31
  701. data/ext/v8/v8_script.cpp +0 -20
  702. data/ext/v8/v8_script.h +0 -8
  703. data/ext/v8/v8_standalone.cpp +0 -69
  704. data/ext/v8/v8_standalone.h +0 -31
  705. data/ext/v8/v8_str.cpp +0 -17
  706. data/ext/v8/v8_str.h +0 -9
  707. data/ext/v8/v8_template.cpp +0 -53
  708. data/ext/v8/v8_template.h +0 -13
  709. data/lib/v8/to.rb +0 -33
  710. data/lib/v8/v8.so +0 -0
  711. data/script/console +0 -10
  712. data/script/destroy +0 -14
  713. data/script/generate +0 -14
  714. data/spec/ext/cxt_spec.rb +0 -25
  715. data/spec/ext/obj_spec.rb +0 -13
  716. data/spec/redjs/jsapi_spec.rb +0 -405
  717. data/spec/redjs/tap.rb +0 -8
  718. data/spec/redjs_helper.rb +0 -3
  719. data/spec/spec.opts +0 -1
  720. data/spec/v8/to_spec.rb +0 -15
  721. data/tasks/rspec.rake +0 -21
@@ -1,312 +0,0 @@
1
- // Copyright 2006-2008 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #ifndef V8_EXECUTION_H_
29
- #define V8_EXECUTION_H_
30
-
31
- namespace v8 {
32
- namespace internal {
33
-
34
-
35
- // Flag used to set the interrupt causes.
36
- enum InterruptFlag {
37
- INTERRUPT = 1 << 0,
38
- DEBUGBREAK = 1 << 1,
39
- DEBUGCOMMAND = 1 << 2,
40
- PREEMPT = 1 << 3,
41
- TERMINATE = 1 << 4
42
- };
43
-
44
- class Execution : public AllStatic {
45
- public:
46
- // Call a function, the caller supplies a receiver and an array
47
- // of arguments. Arguments are Object* type. After function returns,
48
- // pointers in 'args' might be invalid.
49
- //
50
- // *pending_exception tells whether the invoke resulted in
51
- // a pending exception.
52
- //
53
- static Handle<Object> Call(Handle<JSFunction> func,
54
- Handle<Object> receiver,
55
- int argc,
56
- Object*** args,
57
- bool* pending_exception);
58
-
59
- // Construct object from function, the caller supplies an array of
60
- // arguments. Arguments are Object* type. After function returns,
61
- // pointers in 'args' might be invalid.
62
- //
63
- // *pending_exception tells whether the invoke resulted in
64
- // a pending exception.
65
- //
66
- static Handle<Object> New(Handle<JSFunction> func,
67
- int argc,
68
- Object*** args,
69
- bool* pending_exception);
70
-
71
- // Call a function, just like Call(), but make sure to silently catch
72
- // any thrown exceptions. The return value is either the result of
73
- // calling the function (if caught exception is false) or the exception
74
- // that occurred (if caught exception is true).
75
- static Handle<Object> TryCall(Handle<JSFunction> func,
76
- Handle<Object> receiver,
77
- int argc,
78
- Object*** args,
79
- bool* caught_exception);
80
-
81
- // ECMA-262 9.2
82
- static Handle<Object> ToBoolean(Handle<Object> obj);
83
-
84
- // ECMA-262 9.3
85
- static Handle<Object> ToNumber(Handle<Object> obj, bool* exc);
86
-
87
- // ECMA-262 9.4
88
- static Handle<Object> ToInteger(Handle<Object> obj, bool* exc);
89
-
90
- // ECMA-262 9.5
91
- static Handle<Object> ToInt32(Handle<Object> obj, bool* exc);
92
-
93
- // ECMA-262 9.6
94
- static Handle<Object> ToUint32(Handle<Object> obj, bool* exc);
95
-
96
- // ECMA-262 9.8
97
- static Handle<Object> ToString(Handle<Object> obj, bool* exc);
98
-
99
- // ECMA-262 9.8
100
- static Handle<Object> ToDetailString(Handle<Object> obj, bool* exc);
101
-
102
- // ECMA-262 9.9
103
- static Handle<Object> ToObject(Handle<Object> obj, bool* exc);
104
-
105
- // Create a new date object from 'time'.
106
- static Handle<Object> NewDate(double time, bool* exc);
107
-
108
- // Used to implement [] notation on strings (calls JS code)
109
- static Handle<Object> CharAt(Handle<String> str, uint32_t index);
110
-
111
- static Handle<Object> GetFunctionFor();
112
- static Handle<JSFunction> InstantiateFunction(
113
- Handle<FunctionTemplateInfo> data, bool* exc);
114
- static Handle<JSObject> InstantiateObject(Handle<ObjectTemplateInfo> data,
115
- bool* exc);
116
- static void ConfigureInstance(Handle<Object> instance,
117
- Handle<Object> data,
118
- bool* exc);
119
- static Handle<String> GetStackTraceLine(Handle<Object> recv,
120
- Handle<JSFunction> fun,
121
- Handle<Object> pos,
122
- Handle<Object> is_global);
123
- #ifdef ENABLE_DEBUGGER_SUPPORT
124
- static Object* DebugBreakHelper();
125
- #endif
126
-
127
- // If the stack guard is triggered, but it is not an actual
128
- // stack overflow, then handle the interruption accordingly.
129
- static Object* HandleStackGuardInterrupt();
130
-
131
- // Get a function delegate (or undefined) for the given non-function
132
- // object. Used for support calling objects as functions.
133
- static Handle<Object> GetFunctionDelegate(Handle<Object> object);
134
-
135
- // Get a function delegate (or undefined) for the given non-function
136
- // object. Used for support calling objects as constructors.
137
- static Handle<Object> GetConstructorDelegate(Handle<Object> object);
138
- };
139
-
140
-
141
- class ExecutionAccess;
142
-
143
-
144
- // StackGuard contains the handling of the limits that are used to limit the
145
- // number of nested invocations of JavaScript and the stack size used in each
146
- // invocation.
147
- class StackGuard : public AllStatic {
148
- public:
149
- // Pass the address beyond which the stack should not grow. The stack
150
- // is assumed to grow downwards.
151
- static void SetStackLimit(uintptr_t limit);
152
-
153
- // Threading support.
154
- static char* ArchiveStackGuard(char* to);
155
- static char* RestoreStackGuard(char* from);
156
- static int ArchiveSpacePerThread();
157
- static void FreeThreadResources();
158
- // Sets up the default stack guard for this thread if it has not
159
- // already been set up.
160
- static void InitThread(const ExecutionAccess& lock);
161
- // Clears the stack guard for this thread so it does not look as if
162
- // it has been set up.
163
- static void ClearThread(const ExecutionAccess& lock);
164
-
165
- static bool IsStackOverflow();
166
- static bool IsPreempted();
167
- static void Preempt();
168
- static bool IsInterrupted();
169
- static void Interrupt();
170
- static bool IsTerminateExecution();
171
- static void TerminateExecution();
172
- #ifdef ENABLE_DEBUGGER_SUPPORT
173
- static bool IsDebugBreak();
174
- static void DebugBreak();
175
- static bool IsDebugCommand();
176
- static void DebugCommand();
177
- #endif
178
- static void Continue(InterruptFlag after_what);
179
-
180
- // This provides an asynchronous read of the stack limits for the current
181
- // thread. There are no locks protecting this, but it is assumed that you
182
- // have the global V8 lock if you are using multiple V8 threads.
183
- static uintptr_t climit() {
184
- return thread_local_.climit_;
185
- }
186
- static uintptr_t jslimit() {
187
- return thread_local_.jslimit_;
188
- }
189
- static uintptr_t real_jslimit() {
190
- return thread_local_.real_jslimit_;
191
- }
192
- static Address address_of_jslimit() {
193
- return reinterpret_cast<Address>(&thread_local_.jslimit_);
194
- }
195
- static Address address_of_real_jslimit() {
196
- return reinterpret_cast<Address>(&thread_local_.real_jslimit_);
197
- }
198
-
199
- private:
200
- // You should hold the ExecutionAccess lock when calling this method.
201
- static bool IsSet(const ExecutionAccess& lock);
202
-
203
- // You should hold the ExecutionAccess lock when calling this method.
204
- static void set_limits(uintptr_t value, const ExecutionAccess& lock) {
205
- thread_local_.jslimit_ = value;
206
- thread_local_.climit_ = value;
207
- Heap::SetStackLimits();
208
- }
209
-
210
- // Reset limits to actual values. For example after handling interrupt.
211
- // You should hold the ExecutionAccess lock when calling this method.
212
- static void reset_limits(const ExecutionAccess& lock) {
213
- thread_local_.jslimit_ = thread_local_.real_jslimit_;
214
- thread_local_.climit_ = thread_local_.real_climit_;
215
- Heap::SetStackLimits();
216
- }
217
-
218
- // Enable or disable interrupts.
219
- static void EnableInterrupts();
220
- static void DisableInterrupts();
221
-
222
- static const uintptr_t kLimitSize = kPointerSize * 128 * KB;
223
-
224
- #ifdef V8_TARGET_ARCH_X64
225
- static const uintptr_t kInterruptLimit = V8_UINT64_C(0xfffffffffffffffe);
226
- static const uintptr_t kIllegalLimit = V8_UINT64_C(0xfffffffffffffff8);
227
- #else
228
- static const uintptr_t kInterruptLimit = 0xfffffffe;
229
- static const uintptr_t kIllegalLimit = 0xfffffff8;
230
- #endif
231
-
232
- class ThreadLocal {
233
- public:
234
- ThreadLocal() { Clear(); }
235
- // You should hold the ExecutionAccess lock when you call Initialize or
236
- // Clear.
237
- void Initialize();
238
- void Clear();
239
-
240
- // The stack limit is split into a JavaScript and a C++ stack limit. These
241
- // two are the same except when running on a simulator where the C++ and
242
- // JavaScript stacks are separate. Each of the two stack limits have two
243
- // values. The one eith the real_ prefix is the actual stack limit
244
- // set for the VM. The one without the real_ prefix has the same value as
245
- // the actual stack limit except when there is an interruption (e.g. debug
246
- // break or preemption) in which case it is lowered to make stack checks
247
- // fail. Both the generated code and the runtime system check against the
248
- // one without the real_ prefix.
249
- uintptr_t real_jslimit_; // Actual JavaScript stack limit set for the VM.
250
- uintptr_t jslimit_;
251
- uintptr_t real_climit_; // Actual C++ stack limit set for the VM.
252
- uintptr_t climit_;
253
-
254
- int nesting_;
255
- int postpone_interrupts_nesting_;
256
- int interrupt_flags_;
257
- };
258
-
259
- static ThreadLocal thread_local_;
260
-
261
- friend class StackLimitCheck;
262
- friend class PostponeInterruptsScope;
263
- };
264
-
265
-
266
- // Support for checking for stack-overflows in C++ code.
267
- class StackLimitCheck BASE_EMBEDDED {
268
- public:
269
- bool HasOverflowed() const {
270
- // Stack has overflowed in C++ code only if stack pointer exceeds the C++
271
- // stack guard and the limits are not set to interrupt values.
272
- // TODO(214): Stack overflows are ignored if a interrupt is pending. This
273
- // code should probably always use the initial C++ limit.
274
- return (reinterpret_cast<uintptr_t>(this) < StackGuard::climit()) &&
275
- StackGuard::IsStackOverflow();
276
- }
277
- };
278
-
279
-
280
- // Support for temporarily postponing interrupts. When the outermost
281
- // postpone scope is left the interrupts will be re-enabled and any
282
- // interrupts that occurred while in the scope will be taken into
283
- // account.
284
- class PostponeInterruptsScope BASE_EMBEDDED {
285
- public:
286
- PostponeInterruptsScope() {
287
- StackGuard::thread_local_.postpone_interrupts_nesting_++;
288
- StackGuard::DisableInterrupts();
289
- }
290
-
291
- ~PostponeInterruptsScope() {
292
- if (--StackGuard::thread_local_.postpone_interrupts_nesting_ == 0) {
293
- StackGuard::EnableInterrupts();
294
- }
295
- }
296
- };
297
-
298
-
299
- class GCExtension : public v8::Extension {
300
- public:
301
- GCExtension() : v8::Extension("v8/gc", kSource) {}
302
- virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
303
- v8::Handle<v8::String> name);
304
- static v8::Handle<v8::Value> GC(const v8::Arguments& args);
305
- private:
306
- static const char* kSource;
307
- };
308
-
309
-
310
- } } // namespace v8::internal
311
-
312
- #endif // V8_EXECUTION_H_
@@ -1,957 +0,0 @@
1
- // Copyright 2006-2008 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #include "v8.h"
29
-
30
- #include "api.h"
31
- #include "debug.h"
32
- #include "execution.h"
33
- #include "factory.h"
34
- #include "macro-assembler.h"
35
-
36
- namespace v8 {
37
- namespace internal {
38
-
39
-
40
- Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) {
41
- ASSERT(0 <= size);
42
- CALL_HEAP_FUNCTION(Heap::AllocateFixedArray(size, pretenure), FixedArray);
43
- }
44
-
45
-
46
- Handle<FixedArray> Factory::NewFixedArrayWithHoles(int size) {
47
- ASSERT(0 <= size);
48
- CALL_HEAP_FUNCTION(Heap::AllocateFixedArrayWithHoles(size), FixedArray);
49
- }
50
-
51
-
52
- Handle<StringDictionary> Factory::NewStringDictionary(int at_least_space_for) {
53
- ASSERT(0 <= at_least_space_for);
54
- CALL_HEAP_FUNCTION(StringDictionary::Allocate(at_least_space_for),
55
- StringDictionary);
56
- }
57
-
58
-
59
- Handle<NumberDictionary> Factory::NewNumberDictionary(int at_least_space_for) {
60
- ASSERT(0 <= at_least_space_for);
61
- CALL_HEAP_FUNCTION(NumberDictionary::Allocate(at_least_space_for),
62
- NumberDictionary);
63
- }
64
-
65
-
66
- Handle<DescriptorArray> Factory::NewDescriptorArray(int number_of_descriptors) {
67
- ASSERT(0 <= number_of_descriptors);
68
- CALL_HEAP_FUNCTION(DescriptorArray::Allocate(number_of_descriptors),
69
- DescriptorArray);
70
- }
71
-
72
-
73
- // Symbols are created in the old generation (data space).
74
- Handle<String> Factory::LookupSymbol(Vector<const char> string) {
75
- CALL_HEAP_FUNCTION(Heap::LookupSymbol(string), String);
76
- }
77
-
78
-
79
- Handle<String> Factory::NewStringFromAscii(Vector<const char> string,
80
- PretenureFlag pretenure) {
81
- CALL_HEAP_FUNCTION(Heap::AllocateStringFromAscii(string, pretenure), String);
82
- }
83
-
84
- Handle<String> Factory::NewStringFromUtf8(Vector<const char> string,
85
- PretenureFlag pretenure) {
86
- CALL_HEAP_FUNCTION(Heap::AllocateStringFromUtf8(string, pretenure), String);
87
- }
88
-
89
-
90
- Handle<String> Factory::NewStringFromTwoByte(Vector<const uc16> string,
91
- PretenureFlag pretenure) {
92
- CALL_HEAP_FUNCTION(Heap::AllocateStringFromTwoByte(string, pretenure),
93
- String);
94
- }
95
-
96
-
97
- Handle<String> Factory::NewRawTwoByteString(int length,
98
- PretenureFlag pretenure) {
99
- CALL_HEAP_FUNCTION(Heap::AllocateRawTwoByteString(length, pretenure), String);
100
- }
101
-
102
-
103
- Handle<String> Factory::NewConsString(Handle<String> first,
104
- Handle<String> second) {
105
- CALL_HEAP_FUNCTION(Heap::AllocateConsString(*first, *second), String);
106
- }
107
-
108
-
109
- Handle<String> Factory::NewSubString(Handle<String> str,
110
- int begin,
111
- int end) {
112
- CALL_HEAP_FUNCTION(str->SubString(begin, end), String);
113
- }
114
-
115
-
116
- Handle<String> Factory::NewExternalStringFromAscii(
117
- ExternalAsciiString::Resource* resource) {
118
- CALL_HEAP_FUNCTION(Heap::AllocateExternalStringFromAscii(resource), String);
119
- }
120
-
121
-
122
- Handle<String> Factory::NewExternalStringFromTwoByte(
123
- ExternalTwoByteString::Resource* resource) {
124
- CALL_HEAP_FUNCTION(Heap::AllocateExternalStringFromTwoByte(resource), String);
125
- }
126
-
127
-
128
- Handle<Context> Factory::NewGlobalContext() {
129
- CALL_HEAP_FUNCTION(Heap::AllocateGlobalContext(), Context);
130
- }
131
-
132
-
133
- Handle<Context> Factory::NewFunctionContext(int length,
134
- Handle<JSFunction> closure) {
135
- CALL_HEAP_FUNCTION(Heap::AllocateFunctionContext(length, *closure), Context);
136
- }
137
-
138
-
139
- Handle<Context> Factory::NewWithContext(Handle<Context> previous,
140
- Handle<JSObject> extension,
141
- bool is_catch_context) {
142
- CALL_HEAP_FUNCTION(Heap::AllocateWithContext(*previous,
143
- *extension,
144
- is_catch_context),
145
- Context);
146
- }
147
-
148
-
149
- Handle<Struct> Factory::NewStruct(InstanceType type) {
150
- CALL_HEAP_FUNCTION(Heap::AllocateStruct(type), Struct);
151
- }
152
-
153
-
154
- Handle<AccessorInfo> Factory::NewAccessorInfo() {
155
- Handle<AccessorInfo> info =
156
- Handle<AccessorInfo>::cast(NewStruct(ACCESSOR_INFO_TYPE));
157
- info->set_flag(0); // Must clear the flag, it was initialized as undefined.
158
- return info;
159
- }
160
-
161
-
162
- Handle<Script> Factory::NewScript(Handle<String> source) {
163
- // Generate id for this script.
164
- int id;
165
- if (Heap::last_script_id()->IsUndefined()) {
166
- // Script ids start from one.
167
- id = 1;
168
- } else {
169
- // Increment id, wrap when positive smi is exhausted.
170
- id = Smi::cast(Heap::last_script_id())->value();
171
- id++;
172
- if (!Smi::IsValid(id)) {
173
- id = 0;
174
- }
175
- }
176
- Heap::SetLastScriptId(Smi::FromInt(id));
177
-
178
- // Create and initialize script object.
179
- Handle<Proxy> wrapper = Factory::NewProxy(0, TENURED);
180
- Handle<Script> script = Handle<Script>::cast(NewStruct(SCRIPT_TYPE));
181
- script->set_source(*source);
182
- script->set_name(Heap::undefined_value());
183
- script->set_id(Heap::last_script_id());
184
- script->set_line_offset(Smi::FromInt(0));
185
- script->set_column_offset(Smi::FromInt(0));
186
- script->set_data(Heap::undefined_value());
187
- script->set_context_data(Heap::undefined_value());
188
- script->set_type(Smi::FromInt(Script::TYPE_NORMAL));
189
- script->set_compilation_type(Smi::FromInt(Script::COMPILATION_TYPE_HOST));
190
- script->set_wrapper(*wrapper);
191
- script->set_line_ends(Heap::undefined_value());
192
- script->set_eval_from_shared(Heap::undefined_value());
193
- script->set_eval_from_instructions_offset(Smi::FromInt(0));
194
-
195
- return script;
196
- }
197
-
198
-
199
- Handle<Proxy> Factory::NewProxy(Address addr, PretenureFlag pretenure) {
200
- CALL_HEAP_FUNCTION(Heap::AllocateProxy(addr, pretenure), Proxy);
201
- }
202
-
203
-
204
- Handle<Proxy> Factory::NewProxy(const AccessorDescriptor* desc) {
205
- return NewProxy((Address) desc, TENURED);
206
- }
207
-
208
-
209
- Handle<ByteArray> Factory::NewByteArray(int length, PretenureFlag pretenure) {
210
- ASSERT(0 <= length);
211
- CALL_HEAP_FUNCTION(Heap::AllocateByteArray(length, pretenure), ByteArray);
212
- }
213
-
214
-
215
- Handle<PixelArray> Factory::NewPixelArray(int length,
216
- uint8_t* external_pointer,
217
- PretenureFlag pretenure) {
218
- ASSERT(0 <= length);
219
- CALL_HEAP_FUNCTION(Heap::AllocatePixelArray(length,
220
- external_pointer,
221
- pretenure), PixelArray);
222
- }
223
-
224
-
225
- Handle<ExternalArray> Factory::NewExternalArray(int length,
226
- ExternalArrayType array_type,
227
- void* external_pointer,
228
- PretenureFlag pretenure) {
229
- ASSERT(0 <= length);
230
- CALL_HEAP_FUNCTION(Heap::AllocateExternalArray(length,
231
- array_type,
232
- external_pointer,
233
- pretenure), ExternalArray);
234
- }
235
-
236
-
237
- Handle<Map> Factory::NewMap(InstanceType type, int instance_size) {
238
- CALL_HEAP_FUNCTION(Heap::AllocateMap(type, instance_size), Map);
239
- }
240
-
241
-
242
- Handle<JSObject> Factory::NewFunctionPrototype(Handle<JSFunction> function) {
243
- CALL_HEAP_FUNCTION(Heap::AllocateFunctionPrototype(*function), JSObject);
244
- }
245
-
246
-
247
- Handle<Map> Factory::CopyMapDropDescriptors(Handle<Map> src) {
248
- CALL_HEAP_FUNCTION(src->CopyDropDescriptors(), Map);
249
- }
250
-
251
-
252
- Handle<Map> Factory::CopyMap(Handle<Map> src,
253
- int extra_inobject_properties) {
254
- Handle<Map> copy = CopyMapDropDescriptors(src);
255
- // Check that we do not overflow the instance size when adding the
256
- // extra inobject properties.
257
- int instance_size_delta = extra_inobject_properties * kPointerSize;
258
- int max_instance_size_delta =
259
- JSObject::kMaxInstanceSize - copy->instance_size();
260
- if (instance_size_delta > max_instance_size_delta) {
261
- // If the instance size overflows, we allocate as many properties
262
- // as we can as inobject properties.
263
- instance_size_delta = max_instance_size_delta;
264
- extra_inobject_properties = max_instance_size_delta >> kPointerSizeLog2;
265
- }
266
- // Adjust the map with the extra inobject properties.
267
- int inobject_properties =
268
- copy->inobject_properties() + extra_inobject_properties;
269
- copy->set_inobject_properties(inobject_properties);
270
- copy->set_unused_property_fields(inobject_properties);
271
- copy->set_instance_size(copy->instance_size() + instance_size_delta);
272
- return copy;
273
- }
274
-
275
- Handle<Map> Factory::CopyMapDropTransitions(Handle<Map> src) {
276
- CALL_HEAP_FUNCTION(src->CopyDropTransitions(), Map);
277
- }
278
-
279
-
280
- Handle<FixedArray> Factory::CopyFixedArray(Handle<FixedArray> array) {
281
- CALL_HEAP_FUNCTION(array->Copy(), FixedArray);
282
- }
283
-
284
-
285
- Handle<JSFunction> Factory::BaseNewFunctionFromBoilerplate(
286
- Handle<JSFunction> boilerplate,
287
- Handle<Map> function_map,
288
- PretenureFlag pretenure) {
289
- ASSERT(boilerplate->IsBoilerplate());
290
- ASSERT(!boilerplate->has_initial_map());
291
- ASSERT(!boilerplate->has_prototype());
292
- ASSERT(boilerplate->properties() == Heap::empty_fixed_array());
293
- ASSERT(boilerplate->elements() == Heap::empty_fixed_array());
294
- CALL_HEAP_FUNCTION(Heap::AllocateFunction(*function_map,
295
- boilerplate->shared(),
296
- Heap::the_hole_value(),
297
- pretenure),
298
- JSFunction);
299
- }
300
-
301
-
302
- Handle<JSFunction> Factory::NewFunctionFromBoilerplate(
303
- Handle<JSFunction> boilerplate,
304
- Handle<Context> context,
305
- PretenureFlag pretenure) {
306
- Handle<JSFunction> result = BaseNewFunctionFromBoilerplate(
307
- boilerplate, Top::function_map(), pretenure);
308
- result->set_context(*context);
309
- int number_of_literals = boilerplate->NumberOfLiterals();
310
- Handle<FixedArray> literals =
311
- Factory::NewFixedArray(number_of_literals, pretenure);
312
- if (number_of_literals > 0) {
313
- // Store the object, regexp and array functions in the literals
314
- // array prefix. These functions will be used when creating
315
- // object, regexp and array literals in this function.
316
- literals->set(JSFunction::kLiteralGlobalContextIndex,
317
- context->global_context());
318
- }
319
- result->set_literals(*literals);
320
- ASSERT(!result->IsBoilerplate());
321
- return result;
322
- }
323
-
324
-
325
- Handle<Object> Factory::NewNumber(double value,
326
- PretenureFlag pretenure) {
327
- CALL_HEAP_FUNCTION(Heap::NumberFromDouble(value, pretenure), Object);
328
- }
329
-
330
-
331
- Handle<Object> Factory::NewNumberFromInt(int value) {
332
- CALL_HEAP_FUNCTION(Heap::NumberFromInt32(value), Object);
333
- }
334
-
335
-
336
- Handle<Object> Factory::NewNumberFromUint(uint32_t value) {
337
- CALL_HEAP_FUNCTION(Heap::NumberFromUint32(value), Object);
338
- }
339
-
340
-
341
- Handle<JSObject> Factory::NewNeanderObject() {
342
- CALL_HEAP_FUNCTION(Heap::AllocateJSObjectFromMap(Heap::neander_map()),
343
- JSObject);
344
- }
345
-
346
-
347
- Handle<Object> Factory::NewTypeError(const char* type,
348
- Vector< Handle<Object> > args) {
349
- return NewError("MakeTypeError", type, args);
350
- }
351
-
352
-
353
- Handle<Object> Factory::NewTypeError(Handle<String> message) {
354
- return NewError("$TypeError", message);
355
- }
356
-
357
-
358
- Handle<Object> Factory::NewRangeError(const char* type,
359
- Vector< Handle<Object> > args) {
360
- return NewError("MakeRangeError", type, args);
361
- }
362
-
363
-
364
- Handle<Object> Factory::NewRangeError(Handle<String> message) {
365
- return NewError("$RangeError", message);
366
- }
367
-
368
-
369
- Handle<Object> Factory::NewSyntaxError(const char* type, Handle<JSArray> args) {
370
- return NewError("MakeSyntaxError", type, args);
371
- }
372
-
373
-
374
- Handle<Object> Factory::NewSyntaxError(Handle<String> message) {
375
- return NewError("$SyntaxError", message);
376
- }
377
-
378
-
379
- Handle<Object> Factory::NewReferenceError(const char* type,
380
- Vector< Handle<Object> > args) {
381
- return NewError("MakeReferenceError", type, args);
382
- }
383
-
384
-
385
- Handle<Object> Factory::NewReferenceError(Handle<String> message) {
386
- return NewError("$ReferenceError", message);
387
- }
388
-
389
-
390
- Handle<Object> Factory::NewError(const char* maker, const char* type,
391
- Vector< Handle<Object> > args) {
392
- v8::HandleScope scope; // Instantiate a closeable HandleScope for EscapeFrom.
393
- Handle<FixedArray> array = Factory::NewFixedArray(args.length());
394
- for (int i = 0; i < args.length(); i++) {
395
- array->set(i, *args[i]);
396
- }
397
- Handle<JSArray> object = Factory::NewJSArrayWithElements(array);
398
- Handle<Object> result = NewError(maker, type, object);
399
- return result.EscapeFrom(&scope);
400
- }
401
-
402
-
403
- Handle<Object> Factory::NewEvalError(const char* type,
404
- Vector< Handle<Object> > args) {
405
- return NewError("MakeEvalError", type, args);
406
- }
407
-
408
-
409
- Handle<Object> Factory::NewError(const char* type,
410
- Vector< Handle<Object> > args) {
411
- return NewError("MakeError", type, args);
412
- }
413
-
414
-
415
- Handle<Object> Factory::NewError(const char* maker,
416
- const char* type,
417
- Handle<JSArray> args) {
418
- Handle<String> make_str = Factory::LookupAsciiSymbol(maker);
419
- Handle<Object> fun_obj(Top::builtins()->GetProperty(*make_str));
420
- // If the builtins haven't been properly configured yet this error
421
- // constructor may not have been defined. Bail out.
422
- if (!fun_obj->IsJSFunction())
423
- return Factory::undefined_value();
424
- Handle<JSFunction> fun = Handle<JSFunction>::cast(fun_obj);
425
- Handle<Object> type_obj = Factory::LookupAsciiSymbol(type);
426
- Object** argv[2] = { type_obj.location(),
427
- Handle<Object>::cast(args).location() };
428
-
429
- // Invoke the JavaScript factory method. If an exception is thrown while
430
- // running the factory method, use the exception as the result.
431
- bool caught_exception;
432
- Handle<Object> result = Execution::TryCall(fun,
433
- Top::builtins(),
434
- 2,
435
- argv,
436
- &caught_exception);
437
- return result;
438
- }
439
-
440
-
441
- Handle<Object> Factory::NewError(Handle<String> message) {
442
- return NewError("$Error", message);
443
- }
444
-
445
-
446
- Handle<Object> Factory::NewError(const char* constructor,
447
- Handle<String> message) {
448
- Handle<String> constr = Factory::LookupAsciiSymbol(constructor);
449
- Handle<JSFunction> fun =
450
- Handle<JSFunction>(
451
- JSFunction::cast(
452
- Top::builtins()->GetProperty(*constr)));
453
- Object** argv[1] = { Handle<Object>::cast(message).location() };
454
-
455
- // Invoke the JavaScript factory method. If an exception is thrown while
456
- // running the factory method, use the exception as the result.
457
- bool caught_exception;
458
- Handle<Object> result = Execution::TryCall(fun,
459
- Top::builtins(),
460
- 1,
461
- argv,
462
- &caught_exception);
463
- return result;
464
- }
465
-
466
-
467
- Handle<JSFunction> Factory::NewFunction(Handle<String> name,
468
- InstanceType type,
469
- int instance_size,
470
- Handle<Code> code,
471
- bool force_initial_map) {
472
- // Allocate the function
473
- Handle<JSFunction> function = NewFunction(name, the_hole_value());
474
- function->set_code(*code);
475
-
476
- if (force_initial_map ||
477
- type != JS_OBJECT_TYPE ||
478
- instance_size != JSObject::kHeaderSize) {
479
- Handle<Map> initial_map = NewMap(type, instance_size);
480
- Handle<JSObject> prototype = NewFunctionPrototype(function);
481
- initial_map->set_prototype(*prototype);
482
- function->set_initial_map(*initial_map);
483
- initial_map->set_constructor(*function);
484
- } else {
485
- ASSERT(!function->has_initial_map());
486
- ASSERT(!function->has_prototype());
487
- }
488
-
489
- return function;
490
- }
491
-
492
-
493
- Handle<JSFunction> Factory::NewFunctionBoilerplate(Handle<String> name,
494
- int number_of_literals,
495
- Handle<Code> code) {
496
- Handle<JSFunction> function = NewFunctionBoilerplate(name);
497
- function->set_code(*code);
498
- int literals_array_size = number_of_literals;
499
- // If the function contains object, regexp or array literals,
500
- // allocate extra space for a literals array prefix containing the
501
- // object, regexp and array constructor functions.
502
- if (number_of_literals > 0) {
503
- literals_array_size += JSFunction::kLiteralsPrefixSize;
504
- }
505
- Handle<FixedArray> literals =
506
- Factory::NewFixedArray(literals_array_size, TENURED);
507
- function->set_literals(*literals);
508
- ASSERT(!function->has_initial_map());
509
- ASSERT(!function->has_prototype());
510
- return function;
511
- }
512
-
513
-
514
- Handle<JSFunction> Factory::NewFunctionBoilerplate(Handle<String> name) {
515
- Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name);
516
- CALL_HEAP_FUNCTION(Heap::AllocateFunction(Heap::boilerplate_function_map(),
517
- *shared,
518
- Heap::the_hole_value()),
519
- JSFunction);
520
- }
521
-
522
-
523
- Handle<JSFunction> Factory::NewFunctionWithPrototype(Handle<String> name,
524
- InstanceType type,
525
- int instance_size,
526
- Handle<JSObject> prototype,
527
- Handle<Code> code,
528
- bool force_initial_map) {
529
- // Allocate the function
530
- Handle<JSFunction> function = NewFunction(name, prototype);
531
-
532
- function->set_code(*code);
533
-
534
- if (force_initial_map ||
535
- type != JS_OBJECT_TYPE ||
536
- instance_size != JSObject::kHeaderSize) {
537
- Handle<Map> initial_map = NewMap(type, instance_size);
538
- function->set_initial_map(*initial_map);
539
- initial_map->set_constructor(*function);
540
- }
541
-
542
- // Set function.prototype and give the prototype a constructor
543
- // property that refers to the function.
544
- SetPrototypeProperty(function, prototype);
545
- SetProperty(prototype, Factory::constructor_symbol(), function, DONT_ENUM);
546
- return function;
547
- }
548
-
549
-
550
- Handle<Code> Factory::NewCode(const CodeDesc& desc,
551
- ZoneScopeInfo* sinfo,
552
- Code::Flags flags,
553
- Handle<Object> self_ref) {
554
- CALL_HEAP_FUNCTION(Heap::CreateCode(desc, sinfo, flags, self_ref), Code);
555
- }
556
-
557
-
558
- Handle<Code> Factory::CopyCode(Handle<Code> code) {
559
- CALL_HEAP_FUNCTION(Heap::CopyCode(*code), Code);
560
- }
561
-
562
-
563
- static inline Object* DoCopyInsert(DescriptorArray* array,
564
- String* key,
565
- Object* value,
566
- PropertyAttributes attributes) {
567
- CallbacksDescriptor desc(key, value, attributes);
568
- Object* obj = array->CopyInsert(&desc, REMOVE_TRANSITIONS);
569
- return obj;
570
- }
571
-
572
-
573
- // Allocate the new array.
574
- Handle<DescriptorArray> Factory::CopyAppendProxyDescriptor(
575
- Handle<DescriptorArray> array,
576
- Handle<String> key,
577
- Handle<Object> value,
578
- PropertyAttributes attributes) {
579
- CALL_HEAP_FUNCTION(DoCopyInsert(*array, *key, *value, attributes),
580
- DescriptorArray);
581
- }
582
-
583
-
584
- Handle<String> Factory::SymbolFromString(Handle<String> value) {
585
- CALL_HEAP_FUNCTION(Heap::LookupSymbol(*value), String);
586
- }
587
-
588
-
589
- Handle<DescriptorArray> Factory::CopyAppendCallbackDescriptors(
590
- Handle<DescriptorArray> array,
591
- Handle<Object> descriptors) {
592
- v8::NeanderArray callbacks(descriptors);
593
- int nof_callbacks = callbacks.length();
594
- Handle<DescriptorArray> result =
595
- NewDescriptorArray(array->number_of_descriptors() + nof_callbacks);
596
-
597
- // Number of descriptors added to the result so far.
598
- int descriptor_count = 0;
599
-
600
- // Copy the descriptors from the array.
601
- for (int i = 0; i < array->number_of_descriptors(); i++) {
602
- if (array->GetType(i) != NULL_DESCRIPTOR) {
603
- result->CopyFrom(descriptor_count++, *array, i);
604
- }
605
- }
606
-
607
- // Number of duplicates detected.
608
- int duplicates = 0;
609
-
610
- // Fill in new callback descriptors. Process the callbacks from
611
- // back to front so that the last callback with a given name takes
612
- // precedence over previously added callbacks with that name.
613
- for (int i = nof_callbacks - 1; i >= 0; i--) {
614
- Handle<AccessorInfo> entry =
615
- Handle<AccessorInfo>(AccessorInfo::cast(callbacks.get(i)));
616
- // Ensure the key is a symbol before writing into the instance descriptor.
617
- Handle<String> key =
618
- SymbolFromString(Handle<String>(String::cast(entry->name())));
619
- // Check if a descriptor with this name already exists before writing.
620
- if (result->LinearSearch(*key, descriptor_count) ==
621
- DescriptorArray::kNotFound) {
622
- CallbacksDescriptor desc(*key, *entry, entry->property_attributes());
623
- result->Set(descriptor_count, &desc);
624
- descriptor_count++;
625
- } else {
626
- duplicates++;
627
- }
628
- }
629
-
630
- // If duplicates were detected, allocate a result of the right size
631
- // and transfer the elements.
632
- if (duplicates > 0) {
633
- int number_of_descriptors = result->number_of_descriptors() - duplicates;
634
- Handle<DescriptorArray> new_result =
635
- NewDescriptorArray(number_of_descriptors);
636
- for (int i = 0; i < number_of_descriptors; i++) {
637
- new_result->CopyFrom(i, *result, i);
638
- }
639
- result = new_result;
640
- }
641
-
642
- // Sort the result before returning.
643
- result->Sort();
644
- return result;
645
- }
646
-
647
-
648
- Handle<JSObject> Factory::NewJSObject(Handle<JSFunction> constructor,
649
- PretenureFlag pretenure) {
650
- CALL_HEAP_FUNCTION(Heap::AllocateJSObject(*constructor, pretenure), JSObject);
651
- }
652
-
653
-
654
- Handle<GlobalObject> Factory::NewGlobalObject(
655
- Handle<JSFunction> constructor) {
656
- CALL_HEAP_FUNCTION(Heap::AllocateGlobalObject(*constructor),
657
- GlobalObject);
658
- }
659
-
660
-
661
-
662
- Handle<JSObject> Factory::NewJSObjectFromMap(Handle<Map> map) {
663
- CALL_HEAP_FUNCTION(Heap::AllocateJSObjectFromMap(*map, NOT_TENURED),
664
- JSObject);
665
- }
666
-
667
-
668
- Handle<JSArray> Factory::NewJSArray(int length,
669
- PretenureFlag pretenure) {
670
- Handle<JSObject> obj = NewJSObject(Top::array_function(), pretenure);
671
- CALL_HEAP_FUNCTION(Handle<JSArray>::cast(obj)->Initialize(length), JSArray);
672
- }
673
-
674
-
675
- Handle<JSArray> Factory::NewJSArrayWithElements(Handle<FixedArray> elements,
676
- PretenureFlag pretenure) {
677
- Handle<JSArray> result =
678
- Handle<JSArray>::cast(NewJSObject(Top::array_function(), pretenure));
679
- result->SetContent(*elements);
680
- return result;
681
- }
682
-
683
-
684
- Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(Handle<String> name) {
685
- CALL_HEAP_FUNCTION(Heap::AllocateSharedFunctionInfo(*name),
686
- SharedFunctionInfo);
687
- }
688
-
689
-
690
- Handle<String> Factory::NumberToString(Handle<Object> number) {
691
- CALL_HEAP_FUNCTION(Heap::NumberToString(*number), String);
692
- }
693
-
694
-
695
- Handle<NumberDictionary> Factory::DictionaryAtNumberPut(
696
- Handle<NumberDictionary> dictionary,
697
- uint32_t key,
698
- Handle<Object> value) {
699
- CALL_HEAP_FUNCTION(dictionary->AtNumberPut(key, *value), NumberDictionary);
700
- }
701
-
702
-
703
- Handle<JSFunction> Factory::NewFunctionHelper(Handle<String> name,
704
- Handle<Object> prototype) {
705
- Handle<SharedFunctionInfo> function_share = NewSharedFunctionInfo(name);
706
- CALL_HEAP_FUNCTION(Heap::AllocateFunction(*Top::function_map(),
707
- *function_share,
708
- *prototype),
709
- JSFunction);
710
- }
711
-
712
-
713
- Handle<JSFunction> Factory::NewFunction(Handle<String> name,
714
- Handle<Object> prototype) {
715
- Handle<JSFunction> fun = NewFunctionHelper(name, prototype);
716
- fun->set_context(Top::context()->global_context());
717
- return fun;
718
- }
719
-
720
-
721
- Handle<Object> Factory::ToObject(Handle<Object> object,
722
- Handle<Context> global_context) {
723
- CALL_HEAP_FUNCTION(object->ToObject(*global_context), Object);
724
- }
725
-
726
-
727
- #ifdef ENABLE_DEBUGGER_SUPPORT
728
- Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
729
- // Get the original code of the function.
730
- Handle<Code> code(shared->code());
731
-
732
- // Create a copy of the code before allocating the debug info object to avoid
733
- // allocation while setting up the debug info object.
734
- Handle<Code> original_code(*Factory::CopyCode(code));
735
-
736
- // Allocate initial fixed array for active break points before allocating the
737
- // debug info object to avoid allocation while setting up the debug info
738
- // object.
739
- Handle<FixedArray> break_points(
740
- Factory::NewFixedArray(Debug::kEstimatedNofBreakPointsInFunction));
741
-
742
- // Create and set up the debug info object. Debug info contains function, a
743
- // copy of the original code, the executing code and initial fixed array for
744
- // active break points.
745
- Handle<DebugInfo> debug_info =
746
- Handle<DebugInfo>::cast(Factory::NewStruct(DEBUG_INFO_TYPE));
747
- debug_info->set_shared(*shared);
748
- debug_info->set_original_code(*original_code);
749
- debug_info->set_code(*code);
750
- debug_info->set_break_points(*break_points);
751
-
752
- // Link debug info to function.
753
- shared->set_debug_info(*debug_info);
754
-
755
- return debug_info;
756
- }
757
- #endif
758
-
759
-
760
- Handle<JSObject> Factory::NewArgumentsObject(Handle<Object> callee,
761
- int length) {
762
- CALL_HEAP_FUNCTION(Heap::AllocateArgumentsObject(*callee, length), JSObject);
763
- }
764
-
765
-
766
- Handle<JSFunction> Factory::CreateApiFunction(
767
- Handle<FunctionTemplateInfo> obj, ApiInstanceType instance_type) {
768
- Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::HandleApiCall));
769
-
770
- int internal_field_count = 0;
771
- if (!obj->instance_template()->IsUndefined()) {
772
- Handle<ObjectTemplateInfo> instance_template =
773
- Handle<ObjectTemplateInfo>(
774
- ObjectTemplateInfo::cast(obj->instance_template()));
775
- internal_field_count =
776
- Smi::cast(instance_template->internal_field_count())->value();
777
- }
778
-
779
- int instance_size = kPointerSize * internal_field_count;
780
- InstanceType type = INVALID_TYPE;
781
- switch (instance_type) {
782
- case JavaScriptObject:
783
- type = JS_OBJECT_TYPE;
784
- instance_size += JSObject::kHeaderSize;
785
- break;
786
- case InnerGlobalObject:
787
- type = JS_GLOBAL_OBJECT_TYPE;
788
- instance_size += JSGlobalObject::kSize;
789
- break;
790
- case OuterGlobalObject:
791
- type = JS_GLOBAL_PROXY_TYPE;
792
- instance_size += JSGlobalProxy::kSize;
793
- break;
794
- default:
795
- break;
796
- }
797
- ASSERT(type != INVALID_TYPE);
798
-
799
- Handle<JSFunction> result =
800
- Factory::NewFunction(Factory::empty_symbol(),
801
- type,
802
- instance_size,
803
- code,
804
- true);
805
- // Set class name.
806
- Handle<Object> class_name = Handle<Object>(obj->class_name());
807
- if (class_name->IsString()) {
808
- result->shared()->set_instance_class_name(*class_name);
809
- result->shared()->set_name(*class_name);
810
- }
811
-
812
- Handle<Map> map = Handle<Map>(result->initial_map());
813
-
814
- // Mark as undetectable if needed.
815
- if (obj->undetectable()) {
816
- map->set_is_undetectable();
817
- }
818
-
819
- // Mark as hidden for the __proto__ accessor if needed.
820
- if (obj->hidden_prototype()) {
821
- map->set_is_hidden_prototype();
822
- }
823
-
824
- // Mark as needs_access_check if needed.
825
- if (obj->needs_access_check()) {
826
- map->set_is_access_check_needed(true);
827
- }
828
-
829
- // Set interceptor information in the map.
830
- if (!obj->named_property_handler()->IsUndefined()) {
831
- map->set_has_named_interceptor();
832
- }
833
- if (!obj->indexed_property_handler()->IsUndefined()) {
834
- map->set_has_indexed_interceptor();
835
- }
836
-
837
- // Set instance call-as-function information in the map.
838
- if (!obj->instance_call_handler()->IsUndefined()) {
839
- map->set_has_instance_call_handler();
840
- }
841
-
842
- result->shared()->set_function_data(*obj);
843
- result->shared()->DontAdaptArguments();
844
-
845
- // Recursively copy parent templates' accessors, 'data' may be modified.
846
- Handle<DescriptorArray> array =
847
- Handle<DescriptorArray>(map->instance_descriptors());
848
- while (true) {
849
- Handle<Object> props = Handle<Object>(obj->property_accessors());
850
- if (!props->IsUndefined()) {
851
- array = Factory::CopyAppendCallbackDescriptors(array, props);
852
- }
853
- Handle<Object> parent = Handle<Object>(obj->parent_template());
854
- if (parent->IsUndefined()) break;
855
- obj = Handle<FunctionTemplateInfo>::cast(parent);
856
- }
857
- if (!array->IsEmpty()) {
858
- map->set_instance_descriptors(*array);
859
- }
860
-
861
- return result;
862
- }
863
-
864
-
865
- Handle<MapCache> Factory::NewMapCache(int at_least_space_for) {
866
- CALL_HEAP_FUNCTION(MapCache::Allocate(at_least_space_for), MapCache);
867
- }
868
-
869
-
870
- static Object* UpdateMapCacheWith(Context* context,
871
- FixedArray* keys,
872
- Map* map) {
873
- Object* result = MapCache::cast(context->map_cache())->Put(keys, map);
874
- if (!result->IsFailure()) context->set_map_cache(MapCache::cast(result));
875
- return result;
876
- }
877
-
878
-
879
- Handle<MapCache> Factory::AddToMapCache(Handle<Context> context,
880
- Handle<FixedArray> keys,
881
- Handle<Map> map) {
882
- CALL_HEAP_FUNCTION(UpdateMapCacheWith(*context, *keys, *map), MapCache);
883
- }
884
-
885
-
886
- Handle<Map> Factory::ObjectLiteralMapFromCache(Handle<Context> context,
887
- Handle<FixedArray> keys) {
888
- if (context->map_cache()->IsUndefined()) {
889
- // Allocate the new map cache for the global context.
890
- Handle<MapCache> new_cache = NewMapCache(24);
891
- context->set_map_cache(*new_cache);
892
- }
893
- // Check to see whether there is a matching element in the cache.
894
- Handle<MapCache> cache =
895
- Handle<MapCache>(MapCache::cast(context->map_cache()));
896
- Handle<Object> result = Handle<Object>(cache->Lookup(*keys));
897
- if (result->IsMap()) return Handle<Map>::cast(result);
898
- // Create a new map and add it to the cache.
899
- Handle<Map> map =
900
- CopyMap(Handle<Map>(context->object_function()->initial_map()),
901
- keys->length());
902
- AddToMapCache(context, keys, map);
903
- return Handle<Map>(map);
904
- }
905
-
906
-
907
- void Factory::SetRegExpAtomData(Handle<JSRegExp> regexp,
908
- JSRegExp::Type type,
909
- Handle<String> source,
910
- JSRegExp::Flags flags,
911
- Handle<Object> data) {
912
- Handle<FixedArray> store = NewFixedArray(JSRegExp::kAtomDataSize);
913
-
914
- store->set(JSRegExp::kTagIndex, Smi::FromInt(type));
915
- store->set(JSRegExp::kSourceIndex, *source);
916
- store->set(JSRegExp::kFlagsIndex, Smi::FromInt(flags.value()));
917
- store->set(JSRegExp::kAtomPatternIndex, *data);
918
- regexp->set_data(*store);
919
- }
920
-
921
- void Factory::SetRegExpIrregexpData(Handle<JSRegExp> regexp,
922
- JSRegExp::Type type,
923
- Handle<String> source,
924
- JSRegExp::Flags flags,
925
- int capture_count) {
926
- Handle<FixedArray> store = NewFixedArray(JSRegExp::kIrregexpDataSize);
927
-
928
- store->set(JSRegExp::kTagIndex, Smi::FromInt(type));
929
- store->set(JSRegExp::kSourceIndex, *source);
930
- store->set(JSRegExp::kFlagsIndex, Smi::FromInt(flags.value()));
931
- store->set(JSRegExp::kIrregexpASCIICodeIndex, Heap::the_hole_value());
932
- store->set(JSRegExp::kIrregexpUC16CodeIndex, Heap::the_hole_value());
933
- store->set(JSRegExp::kIrregexpMaxRegisterCountIndex, Smi::FromInt(0));
934
- store->set(JSRegExp::kIrregexpCaptureCountIndex,
935
- Smi::FromInt(capture_count));
936
- regexp->set_data(*store);
937
- }
938
-
939
-
940
-
941
- void Factory::ConfigureInstance(Handle<FunctionTemplateInfo> desc,
942
- Handle<JSObject> instance,
943
- bool* pending_exception) {
944
- // Configure the instance by adding the properties specified by the
945
- // instance template.
946
- Handle<Object> instance_template = Handle<Object>(desc->instance_template());
947
- if (!instance_template->IsUndefined()) {
948
- Execution::ConfigureInstance(instance,
949
- instance_template,
950
- pending_exception);
951
- } else {
952
- *pending_exception = false;
953
- }
954
- }
955
-
956
-
957
- } } // namespace v8::internal