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,423 +0,0 @@
1
- // Copyright 2006-2009 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_ARM_MACRO_ASSEMBLER_ARM_H_
29
- #define V8_ARM_MACRO_ASSEMBLER_ARM_H_
30
-
31
- #include "assembler.h"
32
-
33
- namespace v8 {
34
- namespace internal {
35
-
36
-
37
- // Give alias names to registers
38
- const Register cp = { 8 }; // JavaScript context pointer
39
-
40
-
41
- enum InvokeJSFlags {
42
- CALL_JS,
43
- JUMP_JS
44
- };
45
-
46
-
47
- // MacroAssembler implements a collection of frequently used macros.
48
- class MacroAssembler: public Assembler {
49
- public:
50
- MacroAssembler(void* buffer, int size);
51
-
52
- // ---------------------------------------------------------------------------
53
- // Low-level helpers for compiler
54
-
55
- // Jump, Call, and Ret pseudo instructions implementing inter-working
56
- private:
57
- void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al);
58
- void Call(intptr_t target, RelocInfo::Mode rmode, Condition cond = al);
59
- public:
60
- void Jump(Register target, Condition cond = al);
61
- void Jump(byte* target, RelocInfo::Mode rmode, Condition cond = al);
62
- void Jump(Handle<Code> code, RelocInfo::Mode rmode, Condition cond = al);
63
- void Call(Register target, Condition cond = al);
64
- void Call(byte* target, RelocInfo::Mode rmode, Condition cond = al);
65
- void Call(Handle<Code> code, RelocInfo::Mode rmode, Condition cond = al);
66
- void Ret(Condition cond = al);
67
-
68
- // Emit code to discard a non-negative number of pointer-sized elements
69
- // from the stack, clobbering only the sp register.
70
- void Drop(int count, Condition cond = al);
71
-
72
- void Call(Label* target);
73
- void Move(Register dst, Handle<Object> value);
74
- // Jumps to the label at the index given by the Smi in "index".
75
- void SmiJumpTable(Register index, Vector<Label*> targets);
76
- // Load an object from the root table.
77
- void LoadRoot(Register destination,
78
- Heap::RootListIndex index,
79
- Condition cond = al);
80
-
81
- // Sets the remembered set bit for [address+offset], where address is the
82
- // address of the heap object 'object'. The address must be in the first 8K
83
- // of an allocated page. The 'scratch' register is used in the
84
- // implementation and all 3 registers are clobbered by the operation, as
85
- // well as the ip register.
86
- void RecordWrite(Register object, Register offset, Register scratch);
87
-
88
- // ---------------------------------------------------------------------------
89
- // Stack limit support
90
-
91
- void StackLimitCheck(Label* on_stack_limit_hit);
92
-
93
- // ---------------------------------------------------------------------------
94
- // Activation frames
95
-
96
- void EnterInternalFrame() { EnterFrame(StackFrame::INTERNAL); }
97
- void LeaveInternalFrame() { LeaveFrame(StackFrame::INTERNAL); }
98
-
99
- void EnterConstructFrame() { EnterFrame(StackFrame::CONSTRUCT); }
100
- void LeaveConstructFrame() { LeaveFrame(StackFrame::CONSTRUCT); }
101
-
102
- // Enter specific kind of exit frame; either normal or debug mode.
103
- // Expects the number of arguments in register r0 and
104
- // the builtin function to call in register r1. Exits with argc in
105
- // r4, argv in r6, and and the builtin function to call in r5.
106
- void EnterExitFrame(ExitFrame::Mode mode);
107
-
108
- // Leave the current exit frame. Expects the return value in r0.
109
- void LeaveExitFrame(ExitFrame::Mode mode);
110
-
111
- // Align the stack by optionally pushing a Smi zero.
112
- void AlignStack(int offset);
113
-
114
- void LoadContext(Register dst, int context_chain_length);
115
-
116
- // ---------------------------------------------------------------------------
117
- // JavaScript invokes
118
-
119
- // Invoke the JavaScript function code by either calling or jumping.
120
- void InvokeCode(Register code,
121
- const ParameterCount& expected,
122
- const ParameterCount& actual,
123
- InvokeFlag flag);
124
-
125
- void InvokeCode(Handle<Code> code,
126
- const ParameterCount& expected,
127
- const ParameterCount& actual,
128
- RelocInfo::Mode rmode,
129
- InvokeFlag flag);
130
-
131
- // Invoke the JavaScript function in the given register. Changes the
132
- // current context to the context in the function before invoking.
133
- void InvokeFunction(Register function,
134
- const ParameterCount& actual,
135
- InvokeFlag flag);
136
-
137
-
138
- #ifdef ENABLE_DEBUGGER_SUPPORT
139
- // ---------------------------------------------------------------------------
140
- // Debugger Support
141
-
142
- void SaveRegistersToMemory(RegList regs);
143
- void RestoreRegistersFromMemory(RegList regs);
144
- void CopyRegistersFromMemoryToStack(Register base, RegList regs);
145
- void CopyRegistersFromStackToMemory(Register base,
146
- Register scratch,
147
- RegList regs);
148
- #endif
149
-
150
- // ---------------------------------------------------------------------------
151
- // Exception handling
152
-
153
- // Push a new try handler and link into try handler chain.
154
- // The return address must be passed in register lr.
155
- // On exit, r0 contains TOS (code slot).
156
- void PushTryHandler(CodeLocation try_location, HandlerType type);
157
-
158
- // Unlink the stack handler on top of the stack from the try handler chain.
159
- // Must preserve the result register.
160
- void PopTryHandler();
161
-
162
- // ---------------------------------------------------------------------------
163
- // Inline caching support
164
-
165
- // Generates code that verifies that the maps of objects in the
166
- // prototype chain of object hasn't changed since the code was
167
- // generated and branches to the miss label if any map has. If
168
- // necessary the function also generates code for security check
169
- // in case of global object holders. The scratch and holder
170
- // registers are always clobbered, but the object register is only
171
- // clobbered if it the same as the holder register. The function
172
- // returns a register containing the holder - either object_reg or
173
- // holder_reg.
174
- Register CheckMaps(JSObject* object, Register object_reg,
175
- JSObject* holder, Register holder_reg,
176
- Register scratch, Label* miss);
177
-
178
- // Generate code for checking access rights - used for security checks
179
- // on access to global objects across environments. The holder register
180
- // is left untouched, whereas both scratch registers are clobbered.
181
- void CheckAccessGlobalProxy(Register holder_reg,
182
- Register scratch,
183
- Label* miss);
184
-
185
-
186
- // ---------------------------------------------------------------------------
187
- // Allocation support
188
-
189
- // Allocate an object in new space. The object_size is specified in words (not
190
- // bytes). If the new space is exhausted control continues at the gc_required
191
- // label. The allocated object is returned in result. If the flag
192
- // tag_allocated_object is true the result is tagged as as a heap object.
193
- void AllocateInNewSpace(int object_size,
194
- Register result,
195
- Register scratch1,
196
- Register scratch2,
197
- Label* gc_required,
198
- AllocationFlags flags);
199
- void AllocateInNewSpace(Register object_size,
200
- Register result,
201
- Register scratch1,
202
- Register scratch2,
203
- Label* gc_required,
204
- AllocationFlags flags);
205
-
206
- // Undo allocation in new space. The object passed and objects allocated after
207
- // it will no longer be allocated. The caller must make sure that no pointers
208
- // are left to the object(s) no longer allocated as they would be invalid when
209
- // allocation is undone.
210
- void UndoAllocationInNewSpace(Register object, Register scratch);
211
-
212
- // ---------------------------------------------------------------------------
213
- // Support functions.
214
-
215
- // Try to get function prototype of a function and puts the value in
216
- // the result register. Checks that the function really is a
217
- // function and jumps to the miss label if the fast checks fail. The
218
- // function register will be untouched; the other registers may be
219
- // clobbered.
220
- void TryGetFunctionPrototype(Register function,
221
- Register result,
222
- Register scratch,
223
- Label* miss);
224
-
225
- // Compare object type for heap object. heap_object contains a non-Smi
226
- // whose object type should be compared with the given type. This both
227
- // sets the flags and leaves the object type in the type_reg register.
228
- // It leaves the map in the map register (unless the type_reg and map register
229
- // are the same register). It leaves the heap object in the heap_object
230
- // register unless the heap_object register is the same register as one of the
231
- // other registers.
232
- void CompareObjectType(Register heap_object,
233
- Register map,
234
- Register type_reg,
235
- InstanceType type);
236
-
237
- // Compare instance type in a map. map contains a valid map object whose
238
- // object type should be compared with the given type. This both
239
- // sets the flags and leaves the object type in the type_reg register. It
240
- // leaves the heap object in the heap_object register unless the heap_object
241
- // register is the same register as type_reg.
242
- void CompareInstanceType(Register map,
243
- Register type_reg,
244
- InstanceType type);
245
-
246
- inline void BranchOnSmi(Register value, Label* smi_label) {
247
- tst(value, Operand(kSmiTagMask));
248
- b(eq, smi_label);
249
- }
250
-
251
- inline void BranchOnNotSmi(Register value, Label* not_smi_label) {
252
- tst(value, Operand(kSmiTagMask));
253
- b(ne, not_smi_label);
254
- }
255
-
256
- // Generates code for reporting that an illegal operation has
257
- // occurred.
258
- void IllegalOperation(int num_arguments);
259
-
260
- // Uses VFP instructions to Convert a Smi to a double.
261
- void IntegerToDoubleConversionWithVFP3(Register inReg,
262
- Register outHighReg,
263
- Register outLowReg);
264
-
265
-
266
- // ---------------------------------------------------------------------------
267
- // Runtime calls
268
-
269
- // Call a code stub.
270
- void CallStub(CodeStub* stub, Condition cond = al);
271
-
272
- // Return from a code stub after popping its arguments.
273
- void StubReturn(int argc);
274
-
275
- // Call a runtime routine.
276
- // Eventually this should be used for all C calls.
277
- void CallRuntime(Runtime::Function* f, int num_arguments);
278
-
279
- // Convenience function: Same as above, but takes the fid instead.
280
- void CallRuntime(Runtime::FunctionId fid, int num_arguments);
281
-
282
- // Tail call of a runtime routine (jump).
283
- // Like JumpToRuntime, but also takes care of passing the number
284
- // of parameters.
285
- void TailCallRuntime(const ExternalReference& ext,
286
- int num_arguments,
287
- int result_size);
288
-
289
- // Jump to a runtime routine.
290
- void JumpToRuntime(const ExternalReference& builtin);
291
-
292
- // Invoke specified builtin JavaScript function. Adds an entry to
293
- // the unresolved list if the name does not resolve.
294
- void InvokeBuiltin(Builtins::JavaScript id, InvokeJSFlags flags);
295
-
296
- // Store the code object for the given builtin in the target register and
297
- // setup the function in r1.
298
- void GetBuiltinEntry(Register target, Builtins::JavaScript id);
299
-
300
- struct Unresolved {
301
- int pc;
302
- uint32_t flags; // see Bootstrapper::FixupFlags decoders/encoders.
303
- const char* name;
304
- };
305
- List<Unresolved>* unresolved() { return &unresolved_; }
306
-
307
- Handle<Object> CodeObject() { return code_object_; }
308
-
309
-
310
- // ---------------------------------------------------------------------------
311
- // StatsCounter support
312
-
313
- void SetCounter(StatsCounter* counter, int value,
314
- Register scratch1, Register scratch2);
315
- void IncrementCounter(StatsCounter* counter, int value,
316
- Register scratch1, Register scratch2);
317
- void DecrementCounter(StatsCounter* counter, int value,
318
- Register scratch1, Register scratch2);
319
-
320
-
321
- // ---------------------------------------------------------------------------
322
- // Debugging
323
-
324
- // Calls Abort(msg) if the condition cc is not satisfied.
325
- // Use --debug_code to enable.
326
- void Assert(Condition cc, const char* msg);
327
-
328
- // Like Assert(), but always enabled.
329
- void Check(Condition cc, const char* msg);
330
-
331
- // Print a message to stdout and abort execution.
332
- void Abort(const char* msg);
333
-
334
- // Verify restrictions about code generated in stubs.
335
- void set_generating_stub(bool value) { generating_stub_ = value; }
336
- bool generating_stub() { return generating_stub_; }
337
- void set_allow_stub_calls(bool value) { allow_stub_calls_ = value; }
338
- bool allow_stub_calls() { return allow_stub_calls_; }
339
-
340
- private:
341
- List<Unresolved> unresolved_;
342
- bool generating_stub_;
343
- bool allow_stub_calls_;
344
- Handle<Object> code_object_; // This handle will be patched with the code
345
- // object on installation.
346
-
347
- // Helper functions for generating invokes.
348
- void InvokePrologue(const ParameterCount& expected,
349
- const ParameterCount& actual,
350
- Handle<Code> code_constant,
351
- Register code_reg,
352
- Label* done,
353
- InvokeFlag flag);
354
-
355
- // Prepares for a call or jump to a builtin by doing two things:
356
- // 1. Emits code that fetches the builtin's function object from the context
357
- // at runtime, and puts it in the register rdi.
358
- // 2. Fetches the builtin's code object, and returns it in a handle, at
359
- // compile time, so that later code can emit instructions to jump or call
360
- // the builtin directly. If the code object has not yet been created, it
361
- // returns the builtin code object for IllegalFunction, and sets the
362
- // output parameter "resolved" to false. Code that uses the return value
363
- // should then add the address and the builtin name to the list of fixups
364
- // called unresolved_, which is fixed up by the bootstrapper.
365
- Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved);
366
-
367
- // Activation support.
368
- void EnterFrame(StackFrame::Type type);
369
- void LeaveFrame(StackFrame::Type type);
370
- };
371
-
372
-
373
- #ifdef ENABLE_DEBUGGER_SUPPORT
374
- // The code patcher is used to patch (typically) small parts of code e.g. for
375
- // debugging and other types of instrumentation. When using the code patcher
376
- // the exact number of bytes specified must be emitted. It is not legal to emit
377
- // relocation information. If any of these constraints are violated it causes
378
- // an assertion to fail.
379
- class CodePatcher {
380
- public:
381
- CodePatcher(byte* address, int instructions);
382
- virtual ~CodePatcher();
383
-
384
- // Macro assembler to emit code.
385
- MacroAssembler* masm() { return &masm_; }
386
-
387
- // Emit an instruction directly.
388
- void Emit(Instr x);
389
-
390
- // Emit an address directly.
391
- void Emit(Address addr);
392
-
393
- private:
394
- byte* address_; // The address of the code being patched.
395
- int instructions_; // Number of instructions of the expected patch size.
396
- int size_; // Number of bytes of the expected patch size.
397
- MacroAssembler masm_; // Macro assembler used to generate the code.
398
- };
399
- #endif // ENABLE_DEBUGGER_SUPPORT
400
-
401
-
402
- // -----------------------------------------------------------------------------
403
- // Static helper functions.
404
-
405
- // Generate a MemOperand for loading a field from an object.
406
- static inline MemOperand FieldMemOperand(Register object, int offset) {
407
- return MemOperand(object, offset - kHeapObjectTag);
408
- }
409
-
410
-
411
- #ifdef GENERATED_CODE_COVERAGE
412
- #define CODE_COVERAGE_STRINGIFY(x) #x
413
- #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x)
414
- #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__)
415
- #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm->
416
- #else
417
- #define ACCESS_MASM(masm) masm->
418
- #endif
419
-
420
-
421
- } } // namespace v8::internal
422
-
423
- #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_
@@ -1,1266 +0,0 @@
1
- // Copyright 2009 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
- #include "unicode.h"
30
- #include "log.h"
31
- #include "ast.h"
32
- #include "code-stubs.h"
33
- #include "regexp-stack.h"
34
- #include "macro-assembler.h"
35
- #include "regexp-macro-assembler.h"
36
- #include "arm/macro-assembler-arm.h"
37
- #include "arm/regexp-macro-assembler-arm.h"
38
-
39
- namespace v8 {
40
- namespace internal {
41
-
42
- #ifdef V8_NATIVE_REGEXP
43
- /*
44
- * This assembler uses the following register assignment convention
45
- * - r5 : Pointer to current code object (Code*) including heap object tag.
46
- * - r6 : Current position in input, as negative offset from end of string.
47
- * Please notice that this is the byte offset, not the character offset!
48
- * - r7 : Currently loaded character. Must be loaded using
49
- * LoadCurrentCharacter before using any of the dispatch methods.
50
- * - r8 : points to tip of backtrack stack
51
- * - r9 : Unused, might be used by C code and expected unchanged.
52
- * - r10 : End of input (points to byte after last character in input).
53
- * - r11 : Frame pointer. Used to access arguments, local variables and
54
- * RegExp registers.
55
- * - r12 : IP register, used by assembler. Very volatile.
56
- * - r13/sp : points to tip of C stack.
57
- *
58
- * The remaining registers are free for computations.
59
- *
60
- * Each call to a public method should retain this convention.
61
- * The stack will have the following structure:
62
- * - direct_call (if 1, direct call from JavaScript code, if 0 call
63
- * through the runtime system)
64
- * - stack_area_base (High end of the memory area to use as
65
- * backtracking stack)
66
- * - at_start (if 1, we are starting at the start of the
67
- * string, otherwise 0)
68
- * - int* capture_array (int[num_saved_registers_], for output).
69
- * --- sp when called ---
70
- * - link address
71
- * - backup of registers r4..r11
72
- * - end of input (Address of end of string)
73
- * - start of input (Address of first character in string)
74
- * - start index (character index of start)
75
- * --- frame pointer ----
76
- * - void* input_string (location of a handle containing the string)
77
- * - Offset of location before start of input (effectively character
78
- * position -1). Used to initialize capture registers to a non-position.
79
- * - register 0 (Only positions must be stored in the first
80
- * - register 1 num_saved_registers_ registers)
81
- * - ...
82
- * - register num_registers-1
83
- * --- sp ---
84
- *
85
- * The first num_saved_registers_ registers are initialized to point to
86
- * "character -1" in the string (i.e., char_size() bytes before the first
87
- * character of the string). The remaining registers start out as garbage.
88
- *
89
- * The data up to the return address must be placed there by the calling
90
- * code, by calling the code entry as cast to a function with the signature:
91
- * int (*match)(String* input_string,
92
- * int start_index,
93
- * Address start,
94
- * Address end,
95
- * int* capture_output_array,
96
- * bool at_start,
97
- * byte* stack_area_base,
98
- * bool direct_call)
99
- * The call is performed by NativeRegExpMacroAssembler::Execute()
100
- * (in regexp-macro-assembler.cc).
101
- */
102
-
103
- #define __ ACCESS_MASM(masm_)
104
-
105
- RegExpMacroAssemblerARM::RegExpMacroAssemblerARM(
106
- Mode mode,
107
- int registers_to_save)
108
- : masm_(new MacroAssembler(NULL, kRegExpCodeSize)),
109
- mode_(mode),
110
- num_registers_(registers_to_save),
111
- num_saved_registers_(registers_to_save),
112
- entry_label_(),
113
- start_label_(),
114
- success_label_(),
115
- backtrack_label_(),
116
- exit_label_() {
117
- ASSERT_EQ(0, registers_to_save % 2);
118
- __ jmp(&entry_label_); // We'll write the entry code later.
119
- EmitBacktrackConstantPool();
120
- __ bind(&start_label_); // And then continue from here.
121
- }
122
-
123
-
124
- RegExpMacroAssemblerARM::~RegExpMacroAssemblerARM() {
125
- delete masm_;
126
- // Unuse labels in case we throw away the assembler without calling GetCode.
127
- entry_label_.Unuse();
128
- start_label_.Unuse();
129
- success_label_.Unuse();
130
- backtrack_label_.Unuse();
131
- exit_label_.Unuse();
132
- check_preempt_label_.Unuse();
133
- stack_overflow_label_.Unuse();
134
- }
135
-
136
-
137
- int RegExpMacroAssemblerARM::stack_limit_slack() {
138
- return RegExpStack::kStackLimitSlack;
139
- }
140
-
141
-
142
- void RegExpMacroAssemblerARM::AdvanceCurrentPosition(int by) {
143
- if (by != 0) {
144
- Label inside_string;
145
- __ add(current_input_offset(),
146
- current_input_offset(), Operand(by * char_size()));
147
- }
148
- }
149
-
150
-
151
- void RegExpMacroAssemblerARM::AdvanceRegister(int reg, int by) {
152
- ASSERT(reg >= 0);
153
- ASSERT(reg < num_registers_);
154
- if (by != 0) {
155
- __ ldr(r0, register_location(reg));
156
- __ add(r0, r0, Operand(by));
157
- __ str(r0, register_location(reg));
158
- }
159
- }
160
-
161
-
162
- void RegExpMacroAssemblerARM::Backtrack() {
163
- CheckPreemption();
164
- // Pop Code* offset from backtrack stack, add Code* and jump to location.
165
- Pop(r0);
166
- __ add(pc, r0, Operand(r5));
167
- }
168
-
169
-
170
- void RegExpMacroAssemblerARM::Bind(Label* label) {
171
- __ bind(label);
172
- }
173
-
174
-
175
- void RegExpMacroAssemblerARM::CheckCharacter(uint32_t c, Label* on_equal) {
176
- __ cmp(current_character(), Operand(c));
177
- BranchOrBacktrack(eq, on_equal);
178
- }
179
-
180
-
181
- void RegExpMacroAssemblerARM::CheckCharacterGT(uc16 limit, Label* on_greater) {
182
- __ cmp(current_character(), Operand(limit));
183
- BranchOrBacktrack(gt, on_greater);
184
- }
185
-
186
-
187
- void RegExpMacroAssemblerARM::CheckAtStart(Label* on_at_start) {
188
- Label not_at_start;
189
- // Did we start the match at the start of the string at all?
190
- __ ldr(r0, MemOperand(frame_pointer(), kAtStart));
191
- __ cmp(r0, Operand(0));
192
- BranchOrBacktrack(eq, &not_at_start);
193
-
194
- // If we did, are we still at the start of the input?
195
- __ ldr(r1, MemOperand(frame_pointer(), kInputStart));
196
- __ add(r0, end_of_input_address(), Operand(current_input_offset()));
197
- __ cmp(r0, r1);
198
- BranchOrBacktrack(eq, on_at_start);
199
- __ bind(&not_at_start);
200
- }
201
-
202
-
203
- void RegExpMacroAssemblerARM::CheckNotAtStart(Label* on_not_at_start) {
204
- // Did we start the match at the start of the string at all?
205
- __ ldr(r0, MemOperand(frame_pointer(), kAtStart));
206
- __ cmp(r0, Operand(0));
207
- BranchOrBacktrack(eq, on_not_at_start);
208
- // If we did, are we still at the start of the input?
209
- __ ldr(r1, MemOperand(frame_pointer(), kInputStart));
210
- __ add(r0, end_of_input_address(), Operand(current_input_offset()));
211
- __ cmp(r0, r1);
212
- BranchOrBacktrack(ne, on_not_at_start);
213
- }
214
-
215
-
216
- void RegExpMacroAssemblerARM::CheckCharacterLT(uc16 limit, Label* on_less) {
217
- __ cmp(current_character(), Operand(limit));
218
- BranchOrBacktrack(lt, on_less);
219
- }
220
-
221
-
222
- void RegExpMacroAssemblerARM::CheckCharacters(Vector<const uc16> str,
223
- int cp_offset,
224
- Label* on_failure,
225
- bool check_end_of_string) {
226
- if (on_failure == NULL) {
227
- // Instead of inlining a backtrack for each test, (re)use the global
228
- // backtrack target.
229
- on_failure = &backtrack_label_;
230
- }
231
-
232
- if (check_end_of_string) {
233
- // Is last character of required match inside string.
234
- CheckPosition(cp_offset + str.length() - 1, on_failure);
235
- }
236
-
237
- __ add(r0, end_of_input_address(), Operand(current_input_offset()));
238
- if (cp_offset != 0) {
239
- int byte_offset = cp_offset * char_size();
240
- __ add(r0, r0, Operand(byte_offset));
241
- }
242
-
243
- // r0 : Address of characters to match against str.
244
- int stored_high_byte = 0;
245
- for (int i = 0; i < str.length(); i++) {
246
- if (mode_ == ASCII) {
247
- __ ldrb(r1, MemOperand(r0, char_size(), PostIndex));
248
- ASSERT(str[i] <= String::kMaxAsciiCharCode);
249
- __ cmp(r1, Operand(str[i]));
250
- } else {
251
- __ ldrh(r1, MemOperand(r0, char_size(), PostIndex));
252
- uc16 match_char = str[i];
253
- int match_high_byte = (match_char >> 8);
254
- if (match_high_byte == 0) {
255
- __ cmp(r1, Operand(str[i]));
256
- } else {
257
- if (match_high_byte != stored_high_byte) {
258
- __ mov(r2, Operand(match_high_byte));
259
- stored_high_byte = match_high_byte;
260
- }
261
- __ add(r3, r2, Operand(match_char & 0xff));
262
- __ cmp(r1, r3);
263
- }
264
- }
265
- BranchOrBacktrack(ne, on_failure);
266
- }
267
- }
268
-
269
-
270
- void RegExpMacroAssemblerARM::CheckGreedyLoop(Label* on_equal) {
271
- __ ldr(r0, MemOperand(backtrack_stackpointer(), 0));
272
- __ cmp(current_input_offset(), r0);
273
- __ add(backtrack_stackpointer(),
274
- backtrack_stackpointer(), Operand(kPointerSize), LeaveCC, eq);
275
- BranchOrBacktrack(eq, on_equal);
276
- }
277
-
278
-
279
- void RegExpMacroAssemblerARM::CheckNotBackReferenceIgnoreCase(
280
- int start_reg,
281
- Label* on_no_match) {
282
- Label fallthrough;
283
- __ ldr(r0, register_location(start_reg)); // Index of start of capture
284
- __ ldr(r1, register_location(start_reg + 1)); // Index of end of capture
285
- __ sub(r1, r1, r0, SetCC); // Length of capture.
286
-
287
- // If length is zero, either the capture is empty or it is not participating.
288
- // In either case succeed immediately.
289
- __ b(eq, &fallthrough);
290
-
291
- // Check that there are enough characters left in the input.
292
- __ cmn(r1, Operand(current_input_offset()));
293
- BranchOrBacktrack(gt, on_no_match);
294
-
295
- if (mode_ == ASCII) {
296
- Label success;
297
- Label fail;
298
- Label loop_check;
299
-
300
- // r0 - offset of start of capture
301
- // r1 - length of capture
302
- __ add(r0, r0, Operand(end_of_input_address()));
303
- __ add(r2, end_of_input_address(), Operand(current_input_offset()));
304
- __ add(r1, r0, Operand(r1));
305
-
306
- // r0 - Address of start of capture.
307
- // r1 - Address of end of capture
308
- // r2 - Address of current input position.
309
-
310
- Label loop;
311
- __ bind(&loop);
312
- __ ldrb(r3, MemOperand(r0, char_size(), PostIndex));
313
- __ ldrb(r4, MemOperand(r2, char_size(), PostIndex));
314
- __ cmp(r4, r3);
315
- __ b(eq, &loop_check);
316
-
317
- // Mismatch, try case-insensitive match (converting letters to lower-case).
318
- __ orr(r3, r3, Operand(0x20)); // Convert capture character to lower-case.
319
- __ orr(r4, r4, Operand(0x20)); // Also convert input character.
320
- __ cmp(r4, r3);
321
- __ b(ne, &fail);
322
- __ sub(r3, r3, Operand('a'));
323
- __ cmp(r3, Operand('z' - 'a')); // Is r3 a lowercase letter?
324
- __ b(hi, &fail);
325
-
326
-
327
- __ bind(&loop_check);
328
- __ cmp(r0, r1);
329
- __ b(lt, &loop);
330
- __ jmp(&success);
331
-
332
- __ bind(&fail);
333
- BranchOrBacktrack(al, on_no_match);
334
-
335
- __ bind(&success);
336
- // Compute new value of character position after the matched part.
337
- __ sub(current_input_offset(), r2, end_of_input_address());
338
- } else {
339
- ASSERT(mode_ == UC16);
340
- int argument_count = 3;
341
- FrameAlign(argument_count, r2);
342
-
343
- // r0 - offset of start of capture
344
- // r1 - length of capture
345
-
346
- // Put arguments into arguments registers.
347
- // Parameters are
348
- // r0: Address byte_offset1 - Address captured substring's start.
349
- // r1: Address byte_offset2 - Address of current character position.
350
- // r2: size_t byte_length - length of capture in bytes(!)
351
-
352
- // Address of start of capture.
353
- __ add(r0, r0, Operand(end_of_input_address()));
354
- // Length of capture.
355
- __ mov(r2, Operand(r1));
356
- // Save length in callee-save register for use on return.
357
- __ mov(r4, Operand(r1));
358
- // Address of current input position.
359
- __ add(r1, current_input_offset(), Operand(end_of_input_address()));
360
-
361
- ExternalReference function =
362
- ExternalReference::re_case_insensitive_compare_uc16();
363
- CallCFunction(function, argument_count);
364
-
365
- // Check if function returned non-zero for success or zero for failure.
366
- __ cmp(r0, Operand(0));
367
- BranchOrBacktrack(eq, on_no_match);
368
- // On success, increment position by length of capture.
369
- __ add(current_input_offset(), current_input_offset(), Operand(r4));
370
- }
371
-
372
- __ bind(&fallthrough);
373
- }
374
-
375
-
376
- void RegExpMacroAssemblerARM::CheckNotBackReference(
377
- int start_reg,
378
- Label* on_no_match) {
379
- Label fallthrough;
380
- Label success;
381
-
382
- // Find length of back-referenced capture.
383
- __ ldr(r0, register_location(start_reg));
384
- __ ldr(r1, register_location(start_reg + 1));
385
- __ sub(r1, r1, r0, SetCC); // Length to check.
386
- // Succeed on empty capture (including no capture).
387
- __ b(eq, &fallthrough);
388
-
389
- // Check that there are enough characters left in the input.
390
- __ cmn(r1, Operand(current_input_offset()));
391
- BranchOrBacktrack(gt, on_no_match);
392
-
393
- // Compute pointers to match string and capture string
394
- __ add(r0, r0, Operand(end_of_input_address()));
395
- __ add(r2, end_of_input_address(), Operand(current_input_offset()));
396
- __ add(r1, r1, Operand(r0));
397
-
398
- Label loop;
399
- __ bind(&loop);
400
- if (mode_ == ASCII) {
401
- __ ldrb(r3, MemOperand(r0, char_size(), PostIndex));
402
- __ ldrb(r4, MemOperand(r2, char_size(), PostIndex));
403
- } else {
404
- ASSERT(mode_ == UC16);
405
- __ ldrh(r3, MemOperand(r0, char_size(), PostIndex));
406
- __ ldrh(r4, MemOperand(r2, char_size(), PostIndex));
407
- }
408
- __ cmp(r3, r4);
409
- BranchOrBacktrack(ne, on_no_match);
410
- __ cmp(r0, r1);
411
- __ b(lt, &loop);
412
-
413
- // Move current character position to position after match.
414
- __ sub(current_input_offset(), r2, end_of_input_address());
415
- __ bind(&fallthrough);
416
- }
417
-
418
-
419
- void RegExpMacroAssemblerARM::CheckNotRegistersEqual(int reg1,
420
- int reg2,
421
- Label* on_not_equal) {
422
- __ ldr(r0, register_location(reg1));
423
- __ ldr(r1, register_location(reg2));
424
- __ cmp(r0, r1);
425
- BranchOrBacktrack(ne, on_not_equal);
426
- }
427
-
428
-
429
- void RegExpMacroAssemblerARM::CheckNotCharacter(uint32_t c,
430
- Label* on_not_equal) {
431
- __ cmp(current_character(), Operand(c));
432
- BranchOrBacktrack(ne, on_not_equal);
433
- }
434
-
435
-
436
- void RegExpMacroAssemblerARM::CheckCharacterAfterAnd(uint32_t c,
437
- uint32_t mask,
438
- Label* on_equal) {
439
- __ and_(r0, current_character(), Operand(mask));
440
- __ cmp(r0, Operand(c));
441
- BranchOrBacktrack(eq, on_equal);
442
- }
443
-
444
-
445
- void RegExpMacroAssemblerARM::CheckNotCharacterAfterAnd(uint32_t c,
446
- uint32_t mask,
447
- Label* on_not_equal) {
448
- __ and_(r0, current_character(), Operand(mask));
449
- __ cmp(r0, Operand(c));
450
- BranchOrBacktrack(ne, on_not_equal);
451
- }
452
-
453
-
454
- void RegExpMacroAssemblerARM::CheckNotCharacterAfterMinusAnd(
455
- uc16 c,
456
- uc16 minus,
457
- uc16 mask,
458
- Label* on_not_equal) {
459
- ASSERT(minus < String::kMaxUC16CharCode);
460
- __ sub(r0, current_character(), Operand(minus));
461
- __ and_(r0, r0, Operand(mask));
462
- __ cmp(r0, Operand(c));
463
- BranchOrBacktrack(ne, on_not_equal);
464
- }
465
-
466
-
467
- bool RegExpMacroAssemblerARM::CheckSpecialCharacterClass(uc16 type,
468
- Label* on_no_match) {
469
- // Range checks (c in min..max) are generally implemented by an unsigned
470
- // (c - min) <= (max - min) check
471
- switch (type) {
472
- case 's':
473
- // Match space-characters
474
- if (mode_ == ASCII) {
475
- // ASCII space characters are '\t'..'\r' and ' '.
476
- Label success;
477
- __ cmp(current_character(), Operand(' '));
478
- __ b(eq, &success);
479
- // Check range 0x09..0x0d
480
- __ sub(r0, current_character(), Operand('\t'));
481
- __ cmp(r0, Operand('\r' - '\t'));
482
- BranchOrBacktrack(hi, on_no_match);
483
- __ bind(&success);
484
- return true;
485
- }
486
- return false;
487
- case 'S':
488
- // Match non-space characters.
489
- if (mode_ == ASCII) {
490
- // ASCII space characters are '\t'..'\r' and ' '.
491
- __ cmp(current_character(), Operand(' '));
492
- BranchOrBacktrack(eq, on_no_match);
493
- __ sub(r0, current_character(), Operand('\t'));
494
- __ cmp(r0, Operand('\r' - '\t'));
495
- BranchOrBacktrack(ls, on_no_match);
496
- return true;
497
- }
498
- return false;
499
- case 'd':
500
- // Match ASCII digits ('0'..'9')
501
- __ sub(r0, current_character(), Operand('0'));
502
- __ cmp(current_character(), Operand('9' - '0'));
503
- BranchOrBacktrack(hi, on_no_match);
504
- return true;
505
- case 'D':
506
- // Match non ASCII-digits
507
- __ sub(r0, current_character(), Operand('0'));
508
- __ cmp(r0, Operand('9' - '0'));
509
- BranchOrBacktrack(ls, on_no_match);
510
- return true;
511
- case '.': {
512
- // Match non-newlines (not 0x0a('\n'), 0x0d('\r'), 0x2028 and 0x2029)
513
- __ eor(r0, current_character(), Operand(0x01));
514
- // See if current character is '\n'^1 or '\r'^1, i.e., 0x0b or 0x0c
515
- __ sub(r0, r0, Operand(0x0b));
516
- __ cmp(r0, Operand(0x0c - 0x0b));
517
- BranchOrBacktrack(ls, on_no_match);
518
- if (mode_ == UC16) {
519
- // Compare original value to 0x2028 and 0x2029, using the already
520
- // computed (current_char ^ 0x01 - 0x0b). I.e., check for
521
- // 0x201d (0x2028 - 0x0b) or 0x201e.
522
- __ sub(r0, r0, Operand(0x2028 - 0x0b));
523
- __ cmp(r0, Operand(1));
524
- BranchOrBacktrack(ls, on_no_match);
525
- }
526
- return true;
527
- }
528
- case 'n': {
529
- // Match newlines (0x0a('\n'), 0x0d('\r'), 0x2028 and 0x2029)
530
- __ eor(r0, current_character(), Operand(0x01));
531
- // See if current character is '\n'^1 or '\r'^1, i.e., 0x0b or 0x0c
532
- __ sub(r0, r0, Operand(0x0b));
533
- __ cmp(r0, Operand(0x0c - 0x0b));
534
- if (mode_ == ASCII) {
535
- BranchOrBacktrack(hi, on_no_match);
536
- } else {
537
- Label done;
538
- __ b(ls, &done);
539
- // Compare original value to 0x2028 and 0x2029, using the already
540
- // computed (current_char ^ 0x01 - 0x0b). I.e., check for
541
- // 0x201d (0x2028 - 0x0b) or 0x201e.
542
- __ sub(r0, r0, Operand(0x2028 - 0x0b));
543
- __ cmp(r0, Operand(1));
544
- BranchOrBacktrack(hi, on_no_match);
545
- __ bind(&done);
546
- }
547
- return true;
548
- }
549
- case 'w': {
550
- // Match word character (0-9, A-Z, a-z and _).
551
- Label digits, done;
552
- __ cmp(current_character(), Operand('9'));
553
- __ b(ls, &digits);
554
- __ cmp(current_character(), Operand('_'));
555
- __ b(eq, &done);
556
- __ orr(r0, current_character(), Operand(0x20));
557
- __ sub(r0, r0, Operand('a'));
558
- __ cmp(r0, Operand('z' - 'a'));
559
- BranchOrBacktrack(hi, on_no_match);
560
- __ jmp(&done);
561
-
562
- __ bind(&digits);
563
- __ cmp(current_character(), Operand('0'));
564
- BranchOrBacktrack(lo, on_no_match);
565
- __ bind(&done);
566
-
567
- return true;
568
- }
569
- case 'W': {
570
- // Match non-word character (not 0-9, A-Z, a-z and _).
571
- Label digits, done;
572
- __ cmp(current_character(), Operand('9'));
573
- __ b(ls, &digits);
574
- __ cmp(current_character(), Operand('_'));
575
- BranchOrBacktrack(eq, on_no_match);
576
- __ orr(r0, current_character(), Operand(0x20));
577
- __ sub(r0, r0, Operand('a'));
578
- __ cmp(r0, Operand('z' - 'a'));
579
- BranchOrBacktrack(ls, on_no_match);
580
- __ jmp(&done);
581
-
582
- __ bind(&digits);
583
- __ cmp(current_character(), Operand('0'));
584
- BranchOrBacktrack(hs, on_no_match);
585
- __ bind(&done);
586
-
587
- return true;
588
- }
589
- case '*':
590
- // Match any character.
591
- return true;
592
- // No custom implementation (yet): s(UC16), S(UC16).
593
- default:
594
- return false;
595
- }
596
- }
597
-
598
-
599
- void RegExpMacroAssemblerARM::Fail() {
600
- __ mov(r0, Operand(FAILURE));
601
- __ jmp(&exit_label_);
602
- }
603
-
604
-
605
- Handle<Object> RegExpMacroAssemblerARM::GetCode(Handle<String> source) {
606
- // Finalize code - write the entry point code now we know how many
607
- // registers we need.
608
-
609
- // Entry code:
610
- __ bind(&entry_label_);
611
- // Push Link register.
612
- // Push arguments
613
- // Save callee-save registers.
614
- // Start new stack frame.
615
- // Order here should correspond to order of offset constants in header file.
616
- RegList registers_to_retain = r4.bit() | r5.bit() | r6.bit() |
617
- r7.bit() | r8.bit() | r9.bit() | r10.bit() | fp.bit();
618
- RegList argument_registers = r0.bit() | r1.bit() | r2.bit() | r3.bit();
619
- __ stm(db_w, sp, argument_registers | registers_to_retain | lr.bit());
620
- // Set frame pointer just above the arguments.
621
- __ add(frame_pointer(), sp, Operand(4 * kPointerSize));
622
- __ push(r0); // Make room for "position - 1" constant (value is irrelevant).
623
-
624
- // Check if we have space on the stack for registers.
625
- Label stack_limit_hit;
626
- Label stack_ok;
627
-
628
- ExternalReference stack_limit =
629
- ExternalReference::address_of_stack_limit();
630
- __ mov(r0, Operand(stack_limit));
631
- __ ldr(r0, MemOperand(r0));
632
- __ sub(r0, sp, r0, SetCC);
633
- // Handle it if the stack pointer is already below the stack limit.
634
- __ b(ls, &stack_limit_hit);
635
- // Check if there is room for the variable number of registers above
636
- // the stack limit.
637
- __ cmp(r0, Operand(num_registers_ * kPointerSize));
638
- __ b(hs, &stack_ok);
639
- // Exit with OutOfMemory exception. There is not enough space on the stack
640
- // for our working registers.
641
- __ mov(r0, Operand(EXCEPTION));
642
- __ jmp(&exit_label_);
643
-
644
- __ bind(&stack_limit_hit);
645
- CallCheckStackGuardState(r0);
646
- __ cmp(r0, Operand(0));
647
- // If returned value is non-zero, we exit with the returned value as result.
648
- __ b(ne, &exit_label_);
649
-
650
- __ bind(&stack_ok);
651
-
652
- // Allocate space on stack for registers.
653
- __ sub(sp, sp, Operand(num_registers_ * kPointerSize));
654
- // Load string end.
655
- __ ldr(end_of_input_address(), MemOperand(frame_pointer(), kInputEnd));
656
- // Load input start.
657
- __ ldr(r0, MemOperand(frame_pointer(), kInputStart));
658
- // Find negative length (offset of start relative to end).
659
- __ sub(current_input_offset(), r0, end_of_input_address());
660
- // Set r0 to address of char before start of input
661
- // (effectively string position -1).
662
- __ sub(r0, current_input_offset(), Operand(char_size()));
663
- // Store this value in a local variable, for use when clearing
664
- // position registers.
665
- __ str(r0, MemOperand(frame_pointer(), kInputStartMinusOne));
666
- if (num_saved_registers_ > 0) { // Always is, if generated from a regexp.
667
- // Fill saved registers with initial value = start offset - 1
668
-
669
- // Address of register 0.
670
- __ add(r1, frame_pointer(), Operand(kRegisterZero));
671
- __ mov(r2, Operand(num_saved_registers_));
672
- Label init_loop;
673
- __ bind(&init_loop);
674
- __ str(r0, MemOperand(r1, kPointerSize, NegPostIndex));
675
- __ sub(r2, r2, Operand(1), SetCC);
676
- __ b(ne, &init_loop);
677
- }
678
-
679
- // Initialize backtrack stack pointer.
680
- __ ldr(backtrack_stackpointer(), MemOperand(frame_pointer(), kStackHighEnd));
681
- // Initialize code pointer register
682
- __ mov(code_pointer(), Operand(masm_->CodeObject()));
683
- // Load previous char as initial value of current character register.
684
- Label at_start;
685
- __ ldr(r0, MemOperand(frame_pointer(), kAtStart));
686
- __ cmp(r0, Operand(0));
687
- __ b(ne, &at_start);
688
- LoadCurrentCharacterUnchecked(-1, 1); // Load previous char.
689
- __ jmp(&start_label_);
690
- __ bind(&at_start);
691
- __ mov(current_character(), Operand('\n'));
692
- __ jmp(&start_label_);
693
-
694
-
695
- // Exit code:
696
- if (success_label_.is_linked()) {
697
- // Save captures when successful.
698
- __ bind(&success_label_);
699
- if (num_saved_registers_ > 0) {
700
- // copy captures to output
701
- __ ldr(r1, MemOperand(frame_pointer(), kInputStart));
702
- __ ldr(r0, MemOperand(frame_pointer(), kRegisterOutput));
703
- __ sub(r1, end_of_input_address(), r1);
704
- // r1 is length of input in bytes.
705
- if (mode_ == UC16) {
706
- __ mov(r1, Operand(r1, LSR, 1));
707
- }
708
- // r1 is length of input in characters.
709
-
710
- ASSERT_EQ(0, num_saved_registers_ % 2);
711
- // Always an even number of capture registers. This allows us to
712
- // unroll the loop once to add an operation between a load of a register
713
- // and the following use of that register.
714
- for (int i = 0; i < num_saved_registers_; i += 2) {
715
- __ ldr(r2, register_location(i));
716
- __ ldr(r3, register_location(i + 1));
717
- if (mode_ == UC16) {
718
- __ add(r2, r1, Operand(r2, ASR, 1));
719
- __ add(r3, r1, Operand(r3, ASR, 1));
720
- } else {
721
- __ add(r2, r1, Operand(r2));
722
- __ add(r3, r1, Operand(r3));
723
- }
724
- __ str(r2, MemOperand(r0, kPointerSize, PostIndex));
725
- __ str(r3, MemOperand(r0, kPointerSize, PostIndex));
726
- }
727
- }
728
- __ mov(r0, Operand(SUCCESS));
729
- }
730
- // Exit and return r0
731
- __ bind(&exit_label_);
732
- // Skip sp past regexp registers and local variables..
733
- __ mov(sp, frame_pointer());
734
- // Restore registers r4..r11 and return (restoring lr to pc).
735
- __ ldm(ia_w, sp, registers_to_retain | pc.bit());
736
-
737
- // Backtrack code (branch target for conditional backtracks).
738
- if (backtrack_label_.is_linked()) {
739
- __ bind(&backtrack_label_);
740
- Backtrack();
741
- }
742
-
743
- Label exit_with_exception;
744
-
745
- // Preempt-code
746
- if (check_preempt_label_.is_linked()) {
747
- SafeCallTarget(&check_preempt_label_);
748
-
749
- CallCheckStackGuardState(r0);
750
- __ cmp(r0, Operand(0));
751
- // If returning non-zero, we should end execution with the given
752
- // result as return value.
753
- __ b(ne, &exit_label_);
754
-
755
- // String might have moved: Reload end of string from frame.
756
- __ ldr(end_of_input_address(), MemOperand(frame_pointer(), kInputEnd));
757
- SafeReturn();
758
- }
759
-
760
- // Backtrack stack overflow code.
761
- if (stack_overflow_label_.is_linked()) {
762
- SafeCallTarget(&stack_overflow_label_);
763
- // Reached if the backtrack-stack limit has been hit.
764
-
765
- Label grow_failed;
766
-
767
- // Call GrowStack(backtrack_stackpointer())
768
- int num_arguments = 2;
769
- FrameAlign(num_arguments, r0);
770
- __ mov(r0, backtrack_stackpointer());
771
- __ add(r1, frame_pointer(), Operand(kStackHighEnd));
772
- ExternalReference grow_stack =
773
- ExternalReference::re_grow_stack();
774
- CallCFunction(grow_stack, num_arguments);
775
- // If return NULL, we have failed to grow the stack, and
776
- // must exit with a stack-overflow exception.
777
- __ cmp(r0, Operand(0));
778
- __ b(eq, &exit_with_exception);
779
- // Otherwise use return value as new stack pointer.
780
- __ mov(backtrack_stackpointer(), r0);
781
- // Restore saved registers and continue.
782
- SafeReturn();
783
- }
784
-
785
- if (exit_with_exception.is_linked()) {
786
- // If any of the code above needed to exit with an exception.
787
- __ bind(&exit_with_exception);
788
- // Exit with Result EXCEPTION(-1) to signal thrown exception.
789
- __ mov(r0, Operand(EXCEPTION));
790
- __ jmp(&exit_label_);
791
- }
792
-
793
- CodeDesc code_desc;
794
- masm_->GetCode(&code_desc);
795
- Handle<Code> code = Factory::NewCode(code_desc,
796
- NULL,
797
- Code::ComputeFlags(Code::REGEXP),
798
- masm_->CodeObject());
799
- LOG(RegExpCodeCreateEvent(*code, *source));
800
- return Handle<Object>::cast(code);
801
- }
802
-
803
-
804
- void RegExpMacroAssemblerARM::GoTo(Label* to) {
805
- BranchOrBacktrack(al, to);
806
- }
807
-
808
-
809
- void RegExpMacroAssemblerARM::IfRegisterGE(int reg,
810
- int comparand,
811
- Label* if_ge) {
812
- __ ldr(r0, register_location(reg));
813
- __ cmp(r0, Operand(comparand));
814
- BranchOrBacktrack(ge, if_ge);
815
- }
816
-
817
-
818
- void RegExpMacroAssemblerARM::IfRegisterLT(int reg,
819
- int comparand,
820
- Label* if_lt) {
821
- __ ldr(r0, register_location(reg));
822
- __ cmp(r0, Operand(comparand));
823
- BranchOrBacktrack(lt, if_lt);
824
- }
825
-
826
-
827
- void RegExpMacroAssemblerARM::IfRegisterEqPos(int reg,
828
- Label* if_eq) {
829
- __ ldr(r0, register_location(reg));
830
- __ cmp(r0, Operand(current_input_offset()));
831
- BranchOrBacktrack(eq, if_eq);
832
- }
833
-
834
-
835
- RegExpMacroAssembler::IrregexpImplementation
836
- RegExpMacroAssemblerARM::Implementation() {
837
- return kARMImplementation;
838
- }
839
-
840
-
841
- void RegExpMacroAssemblerARM::LoadCurrentCharacter(int cp_offset,
842
- Label* on_end_of_input,
843
- bool check_bounds,
844
- int characters) {
845
- ASSERT(cp_offset >= -1); // ^ and \b can look behind one character.
846
- ASSERT(cp_offset < (1<<30)); // Be sane! (And ensure negation works)
847
- if (check_bounds) {
848
- CheckPosition(cp_offset + characters - 1, on_end_of_input);
849
- }
850
- LoadCurrentCharacterUnchecked(cp_offset, characters);
851
- }
852
-
853
-
854
- void RegExpMacroAssemblerARM::PopCurrentPosition() {
855
- Pop(current_input_offset());
856
- }
857
-
858
-
859
- void RegExpMacroAssemblerARM::PopRegister(int register_index) {
860
- Pop(r0);
861
- __ str(r0, register_location(register_index));
862
- }
863
-
864
-
865
- static bool is_valid_memory_offset(int value) {
866
- if (value < 0) value = -value;
867
- return value < (1<<12);
868
- }
869
-
870
-
871
- void RegExpMacroAssemblerARM::PushBacktrack(Label* label) {
872
- if (label->is_bound()) {
873
- int target = label->pos();
874
- __ mov(r0, Operand(target + Code::kHeaderSize - kHeapObjectTag));
875
- } else {
876
- int constant_offset = GetBacktrackConstantPoolEntry();
877
- masm_->label_at_put(label, constant_offset);
878
- // Reading pc-relative is based on the address 8 bytes ahead of
879
- // the current opcode.
880
- unsigned int offset_of_pc_register_read =
881
- masm_->pc_offset() + Assembler::kPcLoadDelta;
882
- int pc_offset_of_constant =
883
- constant_offset - offset_of_pc_register_read;
884
- ASSERT(pc_offset_of_constant < 0);
885
- if (is_valid_memory_offset(pc_offset_of_constant)) {
886
- masm_->BlockConstPoolBefore(masm_->pc_offset() + Assembler::kInstrSize);
887
- __ ldr(r0, MemOperand(pc, pc_offset_of_constant));
888
- } else {
889
- // Not a 12-bit offset, so it needs to be loaded from the constant
890
- // pool.
891
- masm_->BlockConstPoolBefore(
892
- masm_->pc_offset() + 2 * Assembler::kInstrSize);
893
- __ mov(r0, Operand(pc_offset_of_constant + Assembler::kInstrSize));
894
- __ ldr(r0, MemOperand(pc, r0));
895
- }
896
- }
897
- Push(r0);
898
- CheckStackLimit();
899
- }
900
-
901
-
902
- void RegExpMacroAssemblerARM::PushCurrentPosition() {
903
- Push(current_input_offset());
904
- }
905
-
906
-
907
- void RegExpMacroAssemblerARM::PushRegister(int register_index,
908
- StackCheckFlag check_stack_limit) {
909
- __ ldr(r0, register_location(register_index));
910
- Push(r0);
911
- if (check_stack_limit) CheckStackLimit();
912
- }
913
-
914
-
915
- void RegExpMacroAssemblerARM::ReadCurrentPositionFromRegister(int reg) {
916
- __ ldr(current_input_offset(), register_location(reg));
917
- }
918
-
919
-
920
- void RegExpMacroAssemblerARM::ReadStackPointerFromRegister(int reg) {
921
- __ ldr(backtrack_stackpointer(), register_location(reg));
922
- __ ldr(r0, MemOperand(frame_pointer(), kStackHighEnd));
923
- __ add(backtrack_stackpointer(), backtrack_stackpointer(), Operand(r0));
924
- }
925
-
926
-
927
- void RegExpMacroAssemblerARM::SetRegister(int register_index, int to) {
928
- ASSERT(register_index >= num_saved_registers_); // Reserved for positions!
929
- __ mov(r0, Operand(to));
930
- __ str(r0, register_location(register_index));
931
- }
932
-
933
-
934
- void RegExpMacroAssemblerARM::Succeed() {
935
- __ jmp(&success_label_);
936
- }
937
-
938
-
939
- void RegExpMacroAssemblerARM::WriteCurrentPositionToRegister(int reg,
940
- int cp_offset) {
941
- if (cp_offset == 0) {
942
- __ str(current_input_offset(), register_location(reg));
943
- } else {
944
- __ add(r0, current_input_offset(), Operand(cp_offset * char_size()));
945
- __ str(r0, register_location(reg));
946
- }
947
- }
948
-
949
-
950
- void RegExpMacroAssemblerARM::ClearRegisters(int reg_from, int reg_to) {
951
- ASSERT(reg_from <= reg_to);
952
- __ ldr(r0, MemOperand(frame_pointer(), kInputStartMinusOne));
953
- for (int reg = reg_from; reg <= reg_to; reg++) {
954
- __ str(r0, register_location(reg));
955
- }
956
- }
957
-
958
-
959
- void RegExpMacroAssemblerARM::WriteStackPointerToRegister(int reg) {
960
- __ ldr(r1, MemOperand(frame_pointer(), kStackHighEnd));
961
- __ sub(r0, backtrack_stackpointer(), r1);
962
- __ str(r0, register_location(reg));
963
- }
964
-
965
-
966
- // Private methods:
967
-
968
- void RegExpMacroAssemblerARM::CallCheckStackGuardState(Register scratch) {
969
- int num_arguments = 3;
970
- FrameAlign(num_arguments, scratch);
971
- // RegExp code frame pointer.
972
- __ mov(r2, frame_pointer());
973
- // Code* of self.
974
- __ mov(r1, Operand(masm_->CodeObject()));
975
- // r0 becomes return address pointer.
976
- ExternalReference stack_guard_check =
977
- ExternalReference::re_check_stack_guard_state();
978
- CallCFunctionUsingStub(stack_guard_check, num_arguments);
979
- }
980
-
981
-
982
- // Helper function for reading a value out of a stack frame.
983
- template <typename T>
984
- static T& frame_entry(Address re_frame, int frame_offset) {
985
- return reinterpret_cast<T&>(Memory::int32_at(re_frame + frame_offset));
986
- }
987
-
988
-
989
- int RegExpMacroAssemblerARM::CheckStackGuardState(Address* return_address,
990
- Code* re_code,
991
- Address re_frame) {
992
- if (StackGuard::IsStackOverflow()) {
993
- Top::StackOverflow();
994
- return EXCEPTION;
995
- }
996
-
997
- // If not real stack overflow the stack guard was used to interrupt
998
- // execution for another purpose.
999
-
1000
- // Prepare for possible GC.
1001
- HandleScope handles;
1002
- Handle<Code> code_handle(re_code);
1003
-
1004
- Handle<String> subject(frame_entry<String*>(re_frame, kInputString));
1005
- // Current string.
1006
- bool is_ascii = subject->IsAsciiRepresentation();
1007
-
1008
- ASSERT(re_code->instruction_start() <= *return_address);
1009
- ASSERT(*return_address <=
1010
- re_code->instruction_start() + re_code->instruction_size());
1011
-
1012
- Object* result = Execution::HandleStackGuardInterrupt();
1013
-
1014
- if (*code_handle != re_code) { // Return address no longer valid
1015
- int delta = *code_handle - re_code;
1016
- // Overwrite the return address on the stack.
1017
- *return_address += delta;
1018
- }
1019
-
1020
- if (result->IsException()) {
1021
- return EXCEPTION;
1022
- }
1023
-
1024
- // String might have changed.
1025
- if (subject->IsAsciiRepresentation() != is_ascii) {
1026
- // If we changed between an ASCII and an UC16 string, the specialized
1027
- // code cannot be used, and we need to restart regexp matching from
1028
- // scratch (including, potentially, compiling a new version of the code).
1029
- return RETRY;
1030
- }
1031
-
1032
- // Otherwise, the content of the string might have moved. It must still
1033
- // be a sequential or external string with the same content.
1034
- // Update the start and end pointers in the stack frame to the current
1035
- // location (whether it has actually moved or not).
1036
- ASSERT(StringShape(*subject).IsSequential() ||
1037
- StringShape(*subject).IsExternal());
1038
-
1039
- // The original start address of the characters to match.
1040
- const byte* start_address = frame_entry<const byte*>(re_frame, kInputStart);
1041
-
1042
- // Find the current start address of the same character at the current string
1043
- // position.
1044
- int start_index = frame_entry<int>(re_frame, kStartIndex);
1045
- const byte* new_address = StringCharacterPosition(*subject, start_index);
1046
-
1047
- if (start_address != new_address) {
1048
- // If there is a difference, update the object pointer and start and end
1049
- // addresses in the RegExp stack frame to match the new value.
1050
- const byte* end_address = frame_entry<const byte* >(re_frame, kInputEnd);
1051
- int byte_length = end_address - start_address;
1052
- frame_entry<const String*>(re_frame, kInputString) = *subject;
1053
- frame_entry<const byte*>(re_frame, kInputStart) = new_address;
1054
- frame_entry<const byte*>(re_frame, kInputEnd) = new_address + byte_length;
1055
- }
1056
-
1057
- return 0;
1058
- }
1059
-
1060
-
1061
- MemOperand RegExpMacroAssemblerARM::register_location(int register_index) {
1062
- ASSERT(register_index < (1<<30));
1063
- if (num_registers_ <= register_index) {
1064
- num_registers_ = register_index + 1;
1065
- }
1066
- return MemOperand(frame_pointer(),
1067
- kRegisterZero - register_index * kPointerSize);
1068
- }
1069
-
1070
-
1071
- void RegExpMacroAssemblerARM::CheckPosition(int cp_offset,
1072
- Label* on_outside_input) {
1073
- __ cmp(current_input_offset(), Operand(-cp_offset * char_size()));
1074
- BranchOrBacktrack(ge, on_outside_input);
1075
- }
1076
-
1077
-
1078
- void RegExpMacroAssemblerARM::BranchOrBacktrack(Condition condition,
1079
- Label* to) {
1080
- if (condition == al) { // Unconditional.
1081
- if (to == NULL) {
1082
- Backtrack();
1083
- return;
1084
- }
1085
- __ jmp(to);
1086
- return;
1087
- }
1088
- if (to == NULL) {
1089
- __ b(condition, &backtrack_label_);
1090
- return;
1091
- }
1092
- __ b(condition, to);
1093
- }
1094
-
1095
-
1096
- void RegExpMacroAssemblerARM::SafeCall(Label* to, Condition cond) {
1097
- __ bl(to, cond);
1098
- }
1099
-
1100
-
1101
- void RegExpMacroAssemblerARM::SafeReturn() {
1102
- __ pop(lr);
1103
- __ add(pc, lr, Operand(masm_->CodeObject()));
1104
- }
1105
-
1106
-
1107
- void RegExpMacroAssemblerARM::SafeCallTarget(Label* name) {
1108
- __ bind(name);
1109
- __ sub(lr, lr, Operand(masm_->CodeObject()));
1110
- __ push(lr);
1111
- }
1112
-
1113
-
1114
- void RegExpMacroAssemblerARM::Push(Register source) {
1115
- ASSERT(!source.is(backtrack_stackpointer()));
1116
- __ str(source,
1117
- MemOperand(backtrack_stackpointer(), kPointerSize, NegPreIndex));
1118
- }
1119
-
1120
-
1121
- void RegExpMacroAssemblerARM::Pop(Register target) {
1122
- ASSERT(!target.is(backtrack_stackpointer()));
1123
- __ ldr(target,
1124
- MemOperand(backtrack_stackpointer(), kPointerSize, PostIndex));
1125
- }
1126
-
1127
-
1128
- void RegExpMacroAssemblerARM::CheckPreemption() {
1129
- // Check for preemption.
1130
- ExternalReference stack_limit =
1131
- ExternalReference::address_of_stack_limit();
1132
- __ mov(r0, Operand(stack_limit));
1133
- __ ldr(r0, MemOperand(r0));
1134
- __ cmp(sp, r0);
1135
- SafeCall(&check_preempt_label_, ls);
1136
- }
1137
-
1138
-
1139
- void RegExpMacroAssemblerARM::CheckStackLimit() {
1140
- ExternalReference stack_limit =
1141
- ExternalReference::address_of_regexp_stack_limit();
1142
- __ mov(r0, Operand(stack_limit));
1143
- __ ldr(r0, MemOperand(r0));
1144
- __ cmp(backtrack_stackpointer(), Operand(r0));
1145
- SafeCall(&stack_overflow_label_, ls);
1146
- }
1147
-
1148
-
1149
- void RegExpMacroAssemblerARM::EmitBacktrackConstantPool() {
1150
- __ CheckConstPool(false, false);
1151
- __ BlockConstPoolBefore(
1152
- masm_->pc_offset() + kBacktrackConstantPoolSize * Assembler::kInstrSize);
1153
- backtrack_constant_pool_offset_ = masm_->pc_offset();
1154
- for (int i = 0; i < kBacktrackConstantPoolSize; i++) {
1155
- __ emit(0);
1156
- }
1157
-
1158
- backtrack_constant_pool_capacity_ = kBacktrackConstantPoolSize;
1159
- }
1160
-
1161
-
1162
- int RegExpMacroAssemblerARM::GetBacktrackConstantPoolEntry() {
1163
- while (backtrack_constant_pool_capacity_ > 0) {
1164
- int offset = backtrack_constant_pool_offset_;
1165
- backtrack_constant_pool_offset_ += kPointerSize;
1166
- backtrack_constant_pool_capacity_--;
1167
- if (masm_->pc_offset() - offset < 2 * KB) {
1168
- return offset;
1169
- }
1170
- }
1171
- Label new_pool_skip;
1172
- __ jmp(&new_pool_skip);
1173
- EmitBacktrackConstantPool();
1174
- __ bind(&new_pool_skip);
1175
- int offset = backtrack_constant_pool_offset_;
1176
- backtrack_constant_pool_offset_ += kPointerSize;
1177
- backtrack_constant_pool_capacity_--;
1178
- return offset;
1179
- }
1180
-
1181
-
1182
- void RegExpMacroAssemblerARM::FrameAlign(int num_arguments, Register scratch) {
1183
- int frameAlignment = OS::ActivationFrameAlignment();
1184
- // Up to four simple arguments are passed in registers r0..r3.
1185
- int stack_passed_arguments = (num_arguments <= 4) ? 0 : num_arguments - 4;
1186
- if (frameAlignment != 0) {
1187
- // Make stack end at alignment and make room for num_arguments - 4 words
1188
- // and the original value of sp.
1189
- __ mov(scratch, sp);
1190
- __ sub(sp, sp, Operand((stack_passed_arguments + 1) * kPointerSize));
1191
- ASSERT(IsPowerOf2(frameAlignment));
1192
- __ and_(sp, sp, Operand(-frameAlignment));
1193
- __ str(scratch, MemOperand(sp, stack_passed_arguments * kPointerSize));
1194
- } else {
1195
- __ sub(sp, sp, Operand(stack_passed_arguments * kPointerSize));
1196
- }
1197
- }
1198
-
1199
-
1200
- void RegExpMacroAssemblerARM::CallCFunction(ExternalReference function,
1201
- int num_arguments) {
1202
- __ mov(r5, Operand(function));
1203
- // Just call directly. The function called cannot cause a GC, or
1204
- // allow preemption, so the return address in the link register
1205
- // stays correct.
1206
- __ Call(r5);
1207
- int stack_passed_arguments = (num_arguments <= 4) ? 0 : num_arguments - 4;
1208
- if (OS::ActivationFrameAlignment() > kIntSize) {
1209
- __ ldr(sp, MemOperand(sp, stack_passed_arguments * kPointerSize));
1210
- } else {
1211
- __ add(sp, sp, Operand(stack_passed_arguments * sizeof(kPointerSize)));
1212
- }
1213
- __ mov(code_pointer(), Operand(masm_->CodeObject()));
1214
- }
1215
-
1216
-
1217
- void RegExpMacroAssemblerARM::CallCFunctionUsingStub(
1218
- ExternalReference function,
1219
- int num_arguments) {
1220
- // Must pass all arguments in registers. The stub pushes on the stack.
1221
- ASSERT(num_arguments <= 4);
1222
- __ mov(r5, Operand(function));
1223
- RegExpCEntryStub stub;
1224
- __ CallStub(&stub);
1225
- if (OS::ActivationFrameAlignment() != 0) {
1226
- __ ldr(sp, MemOperand(sp, 0));
1227
- }
1228
- __ mov(code_pointer(), Operand(masm_->CodeObject()));
1229
- }
1230
-
1231
-
1232
- void RegExpMacroAssemblerARM::LoadCurrentCharacterUnchecked(int cp_offset,
1233
- int characters) {
1234
- Register offset = current_input_offset();
1235
- if (cp_offset != 0) {
1236
- __ add(r0, current_input_offset(), Operand(cp_offset * char_size()));
1237
- offset = r0;
1238
- }
1239
- // We assume that we cannot do unaligned loads on ARM, so this function
1240
- // must only be used to load a single character at a time.
1241
- ASSERT(characters == 1);
1242
- if (mode_ == ASCII) {
1243
- __ ldrb(current_character(), MemOperand(end_of_input_address(), offset));
1244
- } else {
1245
- ASSERT(mode_ == UC16);
1246
- __ ldrh(current_character(), MemOperand(end_of_input_address(), offset));
1247
- }
1248
- }
1249
-
1250
-
1251
- void RegExpCEntryStub::Generate(MacroAssembler* masm_) {
1252
- int stack_alignment = OS::ActivationFrameAlignment();
1253
- if (stack_alignment < kPointerSize) stack_alignment = kPointerSize;
1254
- // Stack is already aligned for call, so decrement by alignment
1255
- // to make room for storing the link register.
1256
- __ str(lr, MemOperand(sp, stack_alignment, NegPreIndex));
1257
- __ mov(r0, sp);
1258
- __ Call(r5);
1259
- __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex));
1260
- }
1261
-
1262
- #undef __
1263
-
1264
- #endif // V8_NATIVE_REGEXP
1265
-
1266
- }} // namespace v8::internal