therubyracer 0.9.0beta4 → 0.9.0beta5

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 (771) hide show
  1. data/.gitignore +1 -0
  2. data/Rakefile +0 -11
  3. data/ext/v8/extconf.rb +9 -9
  4. data/ext/v8/v8_external.cpp +40 -10
  5. data/lib/v8/cli.rb +2 -1
  6. data/lib/v8/version.rb +1 -1
  7. data/spec/redjs/.gitignore +1 -0
  8. data/therubyracer.gemspec +2 -3
  9. metadata +33 -779
  10. data/ext/v8/upstream/Makefile +0 -38
  11. data/ext/v8/upstream/detect_cpu.rb +0 -27
  12. data/ext/v8/upstream/fpic-on-linux-amd64.patch +0 -13
  13. data/ext/v8/upstream/scons/CHANGES.txt +0 -5183
  14. data/ext/v8/upstream/scons/LICENSE.txt +0 -20
  15. data/ext/v8/upstream/scons/MANIFEST +0 -202
  16. data/ext/v8/upstream/scons/PKG-INFO +0 -13
  17. data/ext/v8/upstream/scons/README.txt +0 -273
  18. data/ext/v8/upstream/scons/RELEASE.txt +0 -1040
  19. data/ext/v8/upstream/scons/engine/SCons/Action.py +0 -1256
  20. data/ext/v8/upstream/scons/engine/SCons/Builder.py +0 -868
  21. data/ext/v8/upstream/scons/engine/SCons/CacheDir.py +0 -217
  22. data/ext/v8/upstream/scons/engine/SCons/Conftest.py +0 -794
  23. data/ext/v8/upstream/scons/engine/SCons/Debug.py +0 -237
  24. data/ext/v8/upstream/scons/engine/SCons/Defaults.py +0 -485
  25. data/ext/v8/upstream/scons/engine/SCons/Environment.py +0 -2327
  26. data/ext/v8/upstream/scons/engine/SCons/Errors.py +0 -207
  27. data/ext/v8/upstream/scons/engine/SCons/Executor.py +0 -636
  28. data/ext/v8/upstream/scons/engine/SCons/Job.py +0 -435
  29. data/ext/v8/upstream/scons/engine/SCons/Memoize.py +0 -292
  30. data/ext/v8/upstream/scons/engine/SCons/Node/Alias.py +0 -153
  31. data/ext/v8/upstream/scons/engine/SCons/Node/FS.py +0 -3220
  32. data/ext/v8/upstream/scons/engine/SCons/Node/Python.py +0 -128
  33. data/ext/v8/upstream/scons/engine/SCons/Node/__init__.py +0 -1341
  34. data/ext/v8/upstream/scons/engine/SCons/Options/BoolOption.py +0 -50
  35. data/ext/v8/upstream/scons/engine/SCons/Options/EnumOption.py +0 -50
  36. data/ext/v8/upstream/scons/engine/SCons/Options/ListOption.py +0 -50
  37. data/ext/v8/upstream/scons/engine/SCons/Options/PackageOption.py +0 -50
  38. data/ext/v8/upstream/scons/engine/SCons/Options/PathOption.py +0 -76
  39. data/ext/v8/upstream/scons/engine/SCons/Options/__init__.py +0 -74
  40. data/ext/v8/upstream/scons/engine/SCons/PathList.py +0 -232
  41. data/ext/v8/upstream/scons/engine/SCons/Platform/__init__.py +0 -236
  42. data/ext/v8/upstream/scons/engine/SCons/Platform/aix.py +0 -70
  43. data/ext/v8/upstream/scons/engine/SCons/Platform/cygwin.py +0 -55
  44. data/ext/v8/upstream/scons/engine/SCons/Platform/darwin.py +0 -46
  45. data/ext/v8/upstream/scons/engine/SCons/Platform/hpux.py +0 -46
  46. data/ext/v8/upstream/scons/engine/SCons/Platform/irix.py +0 -44
  47. data/ext/v8/upstream/scons/engine/SCons/Platform/os2.py +0 -58
  48. data/ext/v8/upstream/scons/engine/SCons/Platform/posix.py +0 -264
  49. data/ext/v8/upstream/scons/engine/SCons/Platform/sunos.py +0 -50
  50. data/ext/v8/upstream/scons/engine/SCons/Platform/win32.py +0 -386
  51. data/ext/v8/upstream/scons/engine/SCons/SConf.py +0 -1038
  52. data/ext/v8/upstream/scons/engine/SCons/SConsign.py +0 -381
  53. data/ext/v8/upstream/scons/engine/SCons/Scanner/C.py +0 -132
  54. data/ext/v8/upstream/scons/engine/SCons/Scanner/D.py +0 -74
  55. data/ext/v8/upstream/scons/engine/SCons/Scanner/Dir.py +0 -111
  56. data/ext/v8/upstream/scons/engine/SCons/Scanner/Fortran.py +0 -320
  57. data/ext/v8/upstream/scons/engine/SCons/Scanner/IDL.py +0 -48
  58. data/ext/v8/upstream/scons/engine/SCons/Scanner/LaTeX.py +0 -378
  59. data/ext/v8/upstream/scons/engine/SCons/Scanner/Prog.py +0 -103
  60. data/ext/v8/upstream/scons/engine/SCons/Scanner/RC.py +0 -55
  61. data/ext/v8/upstream/scons/engine/SCons/Scanner/__init__.py +0 -415
  62. data/ext/v8/upstream/scons/engine/SCons/Script/Interactive.py +0 -386
  63. data/ext/v8/upstream/scons/engine/SCons/Script/Main.py +0 -1360
  64. data/ext/v8/upstream/scons/engine/SCons/Script/SConsOptions.py +0 -944
  65. data/ext/v8/upstream/scons/engine/SCons/Script/SConscript.py +0 -642
  66. data/ext/v8/upstream/scons/engine/SCons/Script/__init__.py +0 -414
  67. data/ext/v8/upstream/scons/engine/SCons/Sig.py +0 -63
  68. data/ext/v8/upstream/scons/engine/SCons/Subst.py +0 -911
  69. data/ext/v8/upstream/scons/engine/SCons/Taskmaster.py +0 -1030
  70. data/ext/v8/upstream/scons/engine/SCons/Tool/386asm.py +0 -61
  71. data/ext/v8/upstream/scons/engine/SCons/Tool/BitKeeper.py +0 -65
  72. data/ext/v8/upstream/scons/engine/SCons/Tool/CVS.py +0 -73
  73. data/ext/v8/upstream/scons/engine/SCons/Tool/FortranCommon.py +0 -247
  74. data/ext/v8/upstream/scons/engine/SCons/Tool/JavaCommon.py +0 -324
  75. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/__init__.py +0 -56
  76. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/arch.py +0 -61
  77. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/common.py +0 -210
  78. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/netframework.py +0 -84
  79. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/sdk.py +0 -321
  80. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vc.py +0 -367
  81. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vs.py +0 -497
  82. data/ext/v8/upstream/scons/engine/SCons/Tool/Perforce.py +0 -104
  83. data/ext/v8/upstream/scons/engine/SCons/Tool/PharLapCommon.py +0 -138
  84. data/ext/v8/upstream/scons/engine/SCons/Tool/RCS.py +0 -64
  85. data/ext/v8/upstream/scons/engine/SCons/Tool/SCCS.py +0 -64
  86. data/ext/v8/upstream/scons/engine/SCons/Tool/Subversion.py +0 -71
  87. data/ext/v8/upstream/scons/engine/SCons/Tool/__init__.py +0 -675
  88. data/ext/v8/upstream/scons/engine/SCons/Tool/aixc++.py +0 -82
  89. data/ext/v8/upstream/scons/engine/SCons/Tool/aixcc.py +0 -74
  90. data/ext/v8/upstream/scons/engine/SCons/Tool/aixf77.py +0 -80
  91. data/ext/v8/upstream/scons/engine/SCons/Tool/aixlink.py +0 -76
  92. data/ext/v8/upstream/scons/engine/SCons/Tool/applelink.py +0 -71
  93. data/ext/v8/upstream/scons/engine/SCons/Tool/ar.py +0 -63
  94. data/ext/v8/upstream/scons/engine/SCons/Tool/as.py +0 -78
  95. data/ext/v8/upstream/scons/engine/SCons/Tool/bcc32.py +0 -82
  96. data/ext/v8/upstream/scons/engine/SCons/Tool/c++.py +0 -99
  97. data/ext/v8/upstream/scons/engine/SCons/Tool/cc.py +0 -114
  98. data/ext/v8/upstream/scons/engine/SCons/Tool/cvf.py +0 -58
  99. data/ext/v8/upstream/scons/engine/SCons/Tool/default.py +0 -50
  100. data/ext/v8/upstream/scons/engine/SCons/Tool/dmd.py +0 -224
  101. data/ext/v8/upstream/scons/engine/SCons/Tool/dvi.py +0 -64
  102. data/ext/v8/upstream/scons/engine/SCons/Tool/dvipdf.py +0 -125
  103. data/ext/v8/upstream/scons/engine/SCons/Tool/dvips.py +0 -94
  104. data/ext/v8/upstream/scons/engine/SCons/Tool/f77.py +0 -62
  105. data/ext/v8/upstream/scons/engine/SCons/Tool/f90.py +0 -62
  106. data/ext/v8/upstream/scons/engine/SCons/Tool/f95.py +0 -63
  107. data/ext/v8/upstream/scons/engine/SCons/Tool/filesystem.py +0 -98
  108. data/ext/v8/upstream/scons/engine/SCons/Tool/fortran.py +0 -63
  109. data/ext/v8/upstream/scons/engine/SCons/Tool/g++.py +0 -90
  110. data/ext/v8/upstream/scons/engine/SCons/Tool/g77.py +0 -73
  111. data/ext/v8/upstream/scons/engine/SCons/Tool/gas.py +0 -53
  112. data/ext/v8/upstream/scons/engine/SCons/Tool/gcc.py +0 -80
  113. data/ext/v8/upstream/scons/engine/SCons/Tool/gfortran.py +0 -64
  114. data/ext/v8/upstream/scons/engine/SCons/Tool/gnulink.py +0 -63
  115. data/ext/v8/upstream/scons/engine/SCons/Tool/gs.py +0 -81
  116. data/ext/v8/upstream/scons/engine/SCons/Tool/hpc++.py +0 -85
  117. data/ext/v8/upstream/scons/engine/SCons/Tool/hpcc.py +0 -53
  118. data/ext/v8/upstream/scons/engine/SCons/Tool/hplink.py +0 -77
  119. data/ext/v8/upstream/scons/engine/SCons/Tool/icc.py +0 -59
  120. data/ext/v8/upstream/scons/engine/SCons/Tool/icl.py +0 -52
  121. data/ext/v8/upstream/scons/engine/SCons/Tool/ifl.py +0 -72
  122. data/ext/v8/upstream/scons/engine/SCons/Tool/ifort.py +0 -90
  123. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink.py +0 -59
  124. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink32.py +0 -60
  125. data/ext/v8/upstream/scons/engine/SCons/Tool/install.py +0 -229
  126. data/ext/v8/upstream/scons/engine/SCons/Tool/intelc.py +0 -490
  127. data/ext/v8/upstream/scons/engine/SCons/Tool/ipkg.py +0 -71
  128. data/ext/v8/upstream/scons/engine/SCons/Tool/jar.py +0 -110
  129. data/ext/v8/upstream/scons/engine/SCons/Tool/javac.py +0 -234
  130. data/ext/v8/upstream/scons/engine/SCons/Tool/javah.py +0 -138
  131. data/ext/v8/upstream/scons/engine/SCons/Tool/latex.py +0 -79
  132. data/ext/v8/upstream/scons/engine/SCons/Tool/lex.py +0 -99
  133. data/ext/v8/upstream/scons/engine/SCons/Tool/link.py +0 -121
  134. data/ext/v8/upstream/scons/engine/SCons/Tool/linkloc.py +0 -112
  135. data/ext/v8/upstream/scons/engine/SCons/Tool/m4.py +0 -63
  136. data/ext/v8/upstream/scons/engine/SCons/Tool/masm.py +0 -77
  137. data/ext/v8/upstream/scons/engine/SCons/Tool/midl.py +0 -90
  138. data/ext/v8/upstream/scons/engine/SCons/Tool/mingw.py +0 -159
  139. data/ext/v8/upstream/scons/engine/SCons/Tool/mslib.py +0 -64
  140. data/ext/v8/upstream/scons/engine/SCons/Tool/mslink.py +0 -266
  141. data/ext/v8/upstream/scons/engine/SCons/Tool/mssdk.py +0 -50
  142. data/ext/v8/upstream/scons/engine/SCons/Tool/msvc.py +0 -269
  143. data/ext/v8/upstream/scons/engine/SCons/Tool/msvs.py +0 -1439
  144. data/ext/v8/upstream/scons/engine/SCons/Tool/mwcc.py +0 -208
  145. data/ext/v8/upstream/scons/engine/SCons/Tool/mwld.py +0 -107
  146. data/ext/v8/upstream/scons/engine/SCons/Tool/nasm.py +0 -72
  147. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/__init__.py +0 -314
  148. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/ipk.py +0 -185
  149. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/msi.py +0 -526
  150. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/rpm.py +0 -367
  151. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_tarbz2.py +0 -43
  152. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_targz.py +0 -43
  153. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_zip.py +0 -43
  154. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/tarbz2.py +0 -44
  155. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/targz.py +0 -44
  156. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/zip.py +0 -44
  157. data/ext/v8/upstream/scons/engine/SCons/Tool/pdf.py +0 -78
  158. data/ext/v8/upstream/scons/engine/SCons/Tool/pdflatex.py +0 -83
  159. data/ext/v8/upstream/scons/engine/SCons/Tool/pdftex.py +0 -108
  160. data/ext/v8/upstream/scons/engine/SCons/Tool/qt.py +0 -336
  161. data/ext/v8/upstream/scons/engine/SCons/Tool/rmic.py +0 -121
  162. data/ext/v8/upstream/scons/engine/SCons/Tool/rpcgen.py +0 -70
  163. data/ext/v8/upstream/scons/engine/SCons/Tool/rpm.py +0 -132
  164. data/ext/v8/upstream/scons/engine/SCons/Tool/sgiar.py +0 -68
  165. data/ext/v8/upstream/scons/engine/SCons/Tool/sgic++.py +0 -58
  166. data/ext/v8/upstream/scons/engine/SCons/Tool/sgicc.py +0 -53
  167. data/ext/v8/upstream/scons/engine/SCons/Tool/sgilink.py +0 -63
  168. data/ext/v8/upstream/scons/engine/SCons/Tool/sunar.py +0 -67
  169. data/ext/v8/upstream/scons/engine/SCons/Tool/sunc++.py +0 -142
  170. data/ext/v8/upstream/scons/engine/SCons/Tool/suncc.py +0 -58
  171. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf77.py +0 -63
  172. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf90.py +0 -64
  173. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf95.py +0 -64
  174. data/ext/v8/upstream/scons/engine/SCons/Tool/sunlink.py +0 -77
  175. data/ext/v8/upstream/scons/engine/SCons/Tool/swig.py +0 -186
  176. data/ext/v8/upstream/scons/engine/SCons/Tool/tar.py +0 -73
  177. data/ext/v8/upstream/scons/engine/SCons/Tool/tex.py +0 -805
  178. data/ext/v8/upstream/scons/engine/SCons/Tool/textfile.py +0 -175
  179. data/ext/v8/upstream/scons/engine/SCons/Tool/tlib.py +0 -53
  180. data/ext/v8/upstream/scons/engine/SCons/Tool/wix.py +0 -100
  181. data/ext/v8/upstream/scons/engine/SCons/Tool/yacc.py +0 -131
  182. data/ext/v8/upstream/scons/engine/SCons/Tool/zip.py +0 -100
  183. data/ext/v8/upstream/scons/engine/SCons/Util.py +0 -1645
  184. data/ext/v8/upstream/scons/engine/SCons/Variables/BoolVariable.py +0 -91
  185. data/ext/v8/upstream/scons/engine/SCons/Variables/EnumVariable.py +0 -107
  186. data/ext/v8/upstream/scons/engine/SCons/Variables/ListVariable.py +0 -139
  187. data/ext/v8/upstream/scons/engine/SCons/Variables/PackageVariable.py +0 -109
  188. data/ext/v8/upstream/scons/engine/SCons/Variables/PathVariable.py +0 -147
  189. data/ext/v8/upstream/scons/engine/SCons/Variables/__init__.py +0 -317
  190. data/ext/v8/upstream/scons/engine/SCons/Warnings.py +0 -228
  191. data/ext/v8/upstream/scons/engine/SCons/__init__.py +0 -49
  192. data/ext/v8/upstream/scons/engine/SCons/compat/__init__.py +0 -302
  193. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_UserString.py +0 -98
  194. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_hashlib.py +0 -91
  195. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_itertools.py +0 -124
  196. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_optparse.py +0 -1725
  197. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets.py +0 -583
  198. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets15.py +0 -176
  199. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_shlex.py +0 -325
  200. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_subprocess.py +0 -1296
  201. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_textwrap.py +0 -382
  202. data/ext/v8/upstream/scons/engine/SCons/compat/builtins.py +0 -187
  203. data/ext/v8/upstream/scons/engine/SCons/cpp.py +0 -598
  204. data/ext/v8/upstream/scons/engine/SCons/dblite.py +0 -248
  205. data/ext/v8/upstream/scons/engine/SCons/exitfuncs.py +0 -77
  206. data/ext/v8/upstream/scons/os_spawnv_fix.diff +0 -83
  207. data/ext/v8/upstream/scons/scons-time.1 +0 -1017
  208. data/ext/v8/upstream/scons/scons.1 +0 -15179
  209. data/ext/v8/upstream/scons/sconsign.1 +0 -208
  210. data/ext/v8/upstream/scons/script/scons +0 -184
  211. data/ext/v8/upstream/scons/script/scons-time +0 -1529
  212. data/ext/v8/upstream/scons/script/scons.bat +0 -31
  213. data/ext/v8/upstream/scons/script/sconsign +0 -508
  214. data/ext/v8/upstream/scons/setup.cfg +0 -6
  215. data/ext/v8/upstream/scons/setup.py +0 -427
  216. data/ext/v8/upstream/v8/.gitignore +0 -33
  217. data/ext/v8/upstream/v8/AUTHORS +0 -42
  218. data/ext/v8/upstream/v8/ChangeLog +0 -2663
  219. data/ext/v8/upstream/v8/LICENSE +0 -52
  220. data/ext/v8/upstream/v8/LICENSE.strongtalk +0 -29
  221. data/ext/v8/upstream/v8/LICENSE.v8 +0 -26
  222. data/ext/v8/upstream/v8/LICENSE.valgrind +0 -45
  223. data/ext/v8/upstream/v8/SConstruct +0 -1473
  224. data/ext/v8/upstream/v8/build/README.txt +0 -25
  225. data/ext/v8/upstream/v8/build/all.gyp +0 -18
  226. data/ext/v8/upstream/v8/build/armu.gypi +0 -32
  227. data/ext/v8/upstream/v8/build/common.gypi +0 -82
  228. data/ext/v8/upstream/v8/build/gyp_v8 +0 -145
  229. data/ext/v8/upstream/v8/include/v8-debug.h +0 -394
  230. data/ext/v8/upstream/v8/include/v8-preparser.h +0 -116
  231. data/ext/v8/upstream/v8/include/v8-profiler.h +0 -505
  232. data/ext/v8/upstream/v8/include/v8-testing.h +0 -104
  233. data/ext/v8/upstream/v8/include/v8.h +0 -4000
  234. data/ext/v8/upstream/v8/include/v8stdint.h +0 -53
  235. data/ext/v8/upstream/v8/preparser/SConscript +0 -38
  236. data/ext/v8/upstream/v8/preparser/preparser-process.cc +0 -169
  237. data/ext/v8/upstream/v8/src/SConscript +0 -380
  238. data/ext/v8/upstream/v8/src/accessors.cc +0 -766
  239. data/ext/v8/upstream/v8/src/accessors.h +0 -121
  240. data/ext/v8/upstream/v8/src/allocation-inl.h +0 -49
  241. data/ext/v8/upstream/v8/src/allocation.cc +0 -122
  242. data/ext/v8/upstream/v8/src/allocation.h +0 -143
  243. data/ext/v8/upstream/v8/src/api.cc +0 -5678
  244. data/ext/v8/upstream/v8/src/api.h +0 -572
  245. data/ext/v8/upstream/v8/src/apinatives.js +0 -110
  246. data/ext/v8/upstream/v8/src/apiutils.h +0 -73
  247. data/ext/v8/upstream/v8/src/arguments.h +0 -116
  248. data/ext/v8/upstream/v8/src/arm/assembler-arm-inl.h +0 -353
  249. data/ext/v8/upstream/v8/src/arm/assembler-arm.cc +0 -2877
  250. data/ext/v8/upstream/v8/src/arm/assembler-arm.h +0 -1382
  251. data/ext/v8/upstream/v8/src/arm/builtins-arm.cc +0 -1634
  252. data/ext/v8/upstream/v8/src/arm/code-stubs-arm.cc +0 -6917
  253. data/ext/v8/upstream/v8/src/arm/code-stubs-arm.h +0 -623
  254. data/ext/v8/upstream/v8/src/arm/codegen-arm-inl.h +0 -48
  255. data/ext/v8/upstream/v8/src/arm/codegen-arm.cc +0 -7437
  256. data/ext/v8/upstream/v8/src/arm/codegen-arm.h +0 -595
  257. data/ext/v8/upstream/v8/src/arm/constants-arm.cc +0 -152
  258. data/ext/v8/upstream/v8/src/arm/constants-arm.h +0 -778
  259. data/ext/v8/upstream/v8/src/arm/cpu-arm.cc +0 -149
  260. data/ext/v8/upstream/v8/src/arm/debug-arm.cc +0 -317
  261. data/ext/v8/upstream/v8/src/arm/deoptimizer-arm.cc +0 -737
  262. data/ext/v8/upstream/v8/src/arm/disasm-arm.cc +0 -1503
  263. data/ext/v8/upstream/v8/src/arm/frames-arm.cc +0 -45
  264. data/ext/v8/upstream/v8/src/arm/frames-arm.h +0 -168
  265. data/ext/v8/upstream/v8/src/arm/full-codegen-arm.cc +0 -4374
  266. data/ext/v8/upstream/v8/src/arm/ic-arm.cc +0 -1793
  267. data/ext/v8/upstream/v8/src/arm/jump-target-arm.cc +0 -174
  268. data/ext/v8/upstream/v8/src/arm/lithium-arm.cc +0 -2120
  269. data/ext/v8/upstream/v8/src/arm/lithium-arm.h +0 -2179
  270. data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.cc +0 -4132
  271. data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.h +0 -329
  272. data/ext/v8/upstream/v8/src/arm/lithium-gap-resolver-arm.cc +0 -305
  273. data/ext/v8/upstream/v8/src/arm/lithium-gap-resolver-arm.h +0 -84
  274. data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.cc +0 -2939
  275. data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.h +0 -1071
  276. data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.cc +0 -1287
  277. data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.h +0 -253
  278. data/ext/v8/upstream/v8/src/arm/register-allocator-arm-inl.h +0 -100
  279. data/ext/v8/upstream/v8/src/arm/register-allocator-arm.cc +0 -63
  280. data/ext/v8/upstream/v8/src/arm/register-allocator-arm.h +0 -44
  281. data/ext/v8/upstream/v8/src/arm/simulator-arm.cc +0 -3288
  282. data/ext/v8/upstream/v8/src/arm/simulator-arm.h +0 -413
  283. data/ext/v8/upstream/v8/src/arm/stub-cache-arm.cc +0 -4034
  284. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm-inl.h +0 -59
  285. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.cc +0 -843
  286. data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.h +0 -523
  287. data/ext/v8/upstream/v8/src/array.js +0 -1249
  288. data/ext/v8/upstream/v8/src/assembler.cc +0 -1067
  289. data/ext/v8/upstream/v8/src/assembler.h +0 -823
  290. data/ext/v8/upstream/v8/src/ast-inl.h +0 -112
  291. data/ext/v8/upstream/v8/src/ast.cc +0 -1078
  292. data/ext/v8/upstream/v8/src/ast.h +0 -2234
  293. data/ext/v8/upstream/v8/src/atomicops.h +0 -167
  294. data/ext/v8/upstream/v8/src/atomicops_internals_arm_gcc.h +0 -145
  295. data/ext/v8/upstream/v8/src/atomicops_internals_mips_gcc.h +0 -169
  296. data/ext/v8/upstream/v8/src/atomicops_internals_x86_gcc.cc +0 -126
  297. data/ext/v8/upstream/v8/src/atomicops_internals_x86_gcc.h +0 -287
  298. data/ext/v8/upstream/v8/src/atomicops_internals_x86_macosx.h +0 -301
  299. data/ext/v8/upstream/v8/src/atomicops_internals_x86_msvc.h +0 -203
  300. data/ext/v8/upstream/v8/src/bignum-dtoa.cc +0 -655
  301. data/ext/v8/upstream/v8/src/bignum-dtoa.h +0 -81
  302. data/ext/v8/upstream/v8/src/bignum.cc +0 -768
  303. data/ext/v8/upstream/v8/src/bignum.h +0 -140
  304. data/ext/v8/upstream/v8/src/bootstrapper.cc +0 -2138
  305. data/ext/v8/upstream/v8/src/bootstrapper.h +0 -185
  306. data/ext/v8/upstream/v8/src/builtins.cc +0 -1708
  307. data/ext/v8/upstream/v8/src/builtins.h +0 -368
  308. data/ext/v8/upstream/v8/src/bytecodes-irregexp.h +0 -105
  309. data/ext/v8/upstream/v8/src/cached-powers.cc +0 -177
  310. data/ext/v8/upstream/v8/src/cached-powers.h +0 -65
  311. data/ext/v8/upstream/v8/src/char-predicates-inl.h +0 -94
  312. data/ext/v8/upstream/v8/src/char-predicates.h +0 -65
  313. data/ext/v8/upstream/v8/src/checks.cc +0 -110
  314. data/ext/v8/upstream/v8/src/checks.h +0 -296
  315. data/ext/v8/upstream/v8/src/circular-queue-inl.h +0 -53
  316. data/ext/v8/upstream/v8/src/circular-queue.cc +0 -122
  317. data/ext/v8/upstream/v8/src/circular-queue.h +0 -103
  318. data/ext/v8/upstream/v8/src/code-stubs.cc +0 -240
  319. data/ext/v8/upstream/v8/src/code-stubs.h +0 -971
  320. data/ext/v8/upstream/v8/src/code.h +0 -68
  321. data/ext/v8/upstream/v8/src/codegen-inl.h +0 -68
  322. data/ext/v8/upstream/v8/src/codegen.cc +0 -505
  323. data/ext/v8/upstream/v8/src/codegen.h +0 -245
  324. data/ext/v8/upstream/v8/src/compilation-cache.cc +0 -540
  325. data/ext/v8/upstream/v8/src/compilation-cache.h +0 -287
  326. data/ext/v8/upstream/v8/src/compiler.cc +0 -792
  327. data/ext/v8/upstream/v8/src/compiler.h +0 -307
  328. data/ext/v8/upstream/v8/src/contexts.cc +0 -327
  329. data/ext/v8/upstream/v8/src/contexts.h +0 -382
  330. data/ext/v8/upstream/v8/src/conversions-inl.h +0 -110
  331. data/ext/v8/upstream/v8/src/conversions.cc +0 -1125
  332. data/ext/v8/upstream/v8/src/conversions.h +0 -122
  333. data/ext/v8/upstream/v8/src/counters.cc +0 -93
  334. data/ext/v8/upstream/v8/src/counters.h +0 -254
  335. data/ext/v8/upstream/v8/src/cpu-profiler-inl.h +0 -101
  336. data/ext/v8/upstream/v8/src/cpu-profiler.cc +0 -606
  337. data/ext/v8/upstream/v8/src/cpu-profiler.h +0 -305
  338. data/ext/v8/upstream/v8/src/cpu.h +0 -67
  339. data/ext/v8/upstream/v8/src/d8-debug.cc +0 -367
  340. data/ext/v8/upstream/v8/src/d8-debug.h +0 -158
  341. data/ext/v8/upstream/v8/src/d8-posix.cc +0 -695
  342. data/ext/v8/upstream/v8/src/d8-readline.cc +0 -128
  343. data/ext/v8/upstream/v8/src/d8-windows.cc +0 -42
  344. data/ext/v8/upstream/v8/src/d8.cc +0 -796
  345. data/ext/v8/upstream/v8/src/d8.gyp +0 -88
  346. data/ext/v8/upstream/v8/src/d8.h +0 -231
  347. data/ext/v8/upstream/v8/src/d8.js +0 -2798
  348. data/ext/v8/upstream/v8/src/data-flow.cc +0 -545
  349. data/ext/v8/upstream/v8/src/data-flow.h +0 -379
  350. data/ext/v8/upstream/v8/src/date.js +0 -1103
  351. data/ext/v8/upstream/v8/src/dateparser-inl.h +0 -125
  352. data/ext/v8/upstream/v8/src/dateparser.cc +0 -178
  353. data/ext/v8/upstream/v8/src/dateparser.h +0 -265
  354. data/ext/v8/upstream/v8/src/debug-agent.cc +0 -447
  355. data/ext/v8/upstream/v8/src/debug-agent.h +0 -129
  356. data/ext/v8/upstream/v8/src/debug-debugger.js +0 -2569
  357. data/ext/v8/upstream/v8/src/debug.cc +0 -3188
  358. data/ext/v8/upstream/v8/src/debug.h +0 -1055
  359. data/ext/v8/upstream/v8/src/deoptimizer.cc +0 -1296
  360. data/ext/v8/upstream/v8/src/deoptimizer.h +0 -629
  361. data/ext/v8/upstream/v8/src/disasm.h +0 -80
  362. data/ext/v8/upstream/v8/src/disassembler.cc +0 -339
  363. data/ext/v8/upstream/v8/src/disassembler.h +0 -56
  364. data/ext/v8/upstream/v8/src/diy-fp.cc +0 -58
  365. data/ext/v8/upstream/v8/src/diy-fp.h +0 -117
  366. data/ext/v8/upstream/v8/src/double.h +0 -238
  367. data/ext/v8/upstream/v8/src/dtoa.cc +0 -103
  368. data/ext/v8/upstream/v8/src/dtoa.h +0 -85
  369. data/ext/v8/upstream/v8/src/execution.cc +0 -791
  370. data/ext/v8/upstream/v8/src/execution.h +0 -291
  371. data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.cc +0 -250
  372. data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.h +0 -89
  373. data/ext/v8/upstream/v8/src/extensions/experimental/experimental.gyp +0 -55
  374. data/ext/v8/upstream/v8/src/extensions/experimental/i18n-extension.cc +0 -284
  375. data/ext/v8/upstream/v8/src/extensions/experimental/i18n-extension.h +0 -64
  376. data/ext/v8/upstream/v8/src/extensions/externalize-string-extension.cc +0 -141
  377. data/ext/v8/upstream/v8/src/extensions/externalize-string-extension.h +0 -50
  378. data/ext/v8/upstream/v8/src/extensions/gc-extension.cc +0 -58
  379. data/ext/v8/upstream/v8/src/extensions/gc-extension.h +0 -49
  380. data/ext/v8/upstream/v8/src/factory.cc +0 -1194
  381. data/ext/v8/upstream/v8/src/factory.h +0 -436
  382. data/ext/v8/upstream/v8/src/fast-dtoa.cc +0 -736
  383. data/ext/v8/upstream/v8/src/fast-dtoa.h +0 -83
  384. data/ext/v8/upstream/v8/src/fixed-dtoa.cc +0 -405
  385. data/ext/v8/upstream/v8/src/fixed-dtoa.h +0 -55
  386. data/ext/v8/upstream/v8/src/flag-definitions.h +0 -556
  387. data/ext/v8/upstream/v8/src/flags.cc +0 -551
  388. data/ext/v8/upstream/v8/src/flags.h +0 -79
  389. data/ext/v8/upstream/v8/src/frame-element.cc +0 -37
  390. data/ext/v8/upstream/v8/src/frame-element.h +0 -269
  391. data/ext/v8/upstream/v8/src/frames-inl.h +0 -236
  392. data/ext/v8/upstream/v8/src/frames.cc +0 -1273
  393. data/ext/v8/upstream/v8/src/frames.h +0 -854
  394. data/ext/v8/upstream/v8/src/full-codegen.cc +0 -1385
  395. data/ext/v8/upstream/v8/src/full-codegen.h +0 -753
  396. data/ext/v8/upstream/v8/src/func-name-inferrer.cc +0 -91
  397. data/ext/v8/upstream/v8/src/func-name-inferrer.h +0 -111
  398. data/ext/v8/upstream/v8/src/gdb-jit.cc +0 -1548
  399. data/ext/v8/upstream/v8/src/gdb-jit.h +0 -138
  400. data/ext/v8/upstream/v8/src/global-handles.cc +0 -596
  401. data/ext/v8/upstream/v8/src/global-handles.h +0 -239
  402. data/ext/v8/upstream/v8/src/globals.h +0 -325
  403. data/ext/v8/upstream/v8/src/handles-inl.h +0 -177
  404. data/ext/v8/upstream/v8/src/handles.cc +0 -965
  405. data/ext/v8/upstream/v8/src/handles.h +0 -372
  406. data/ext/v8/upstream/v8/src/hashmap.cc +0 -230
  407. data/ext/v8/upstream/v8/src/hashmap.h +0 -121
  408. data/ext/v8/upstream/v8/src/heap-inl.h +0 -703
  409. data/ext/v8/upstream/v8/src/heap-profiler.cc +0 -1173
  410. data/ext/v8/upstream/v8/src/heap-profiler.h +0 -396
  411. data/ext/v8/upstream/v8/src/heap.cc +0 -5856
  412. data/ext/v8/upstream/v8/src/heap.h +0 -2264
  413. data/ext/v8/upstream/v8/src/hydrogen-instructions.cc +0 -1639
  414. data/ext/v8/upstream/v8/src/hydrogen-instructions.h +0 -3657
  415. data/ext/v8/upstream/v8/src/hydrogen.cc +0 -6011
  416. data/ext/v8/upstream/v8/src/hydrogen.h +0 -1137
  417. data/ext/v8/upstream/v8/src/ia32/assembler-ia32-inl.h +0 -430
  418. data/ext/v8/upstream/v8/src/ia32/assembler-ia32.cc +0 -2846
  419. data/ext/v8/upstream/v8/src/ia32/assembler-ia32.h +0 -1159
  420. data/ext/v8/upstream/v8/src/ia32/builtins-ia32.cc +0 -1596
  421. data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.cc +0 -6549
  422. data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.h +0 -495
  423. data/ext/v8/upstream/v8/src/ia32/codegen-ia32-inl.h +0 -46
  424. data/ext/v8/upstream/v8/src/ia32/codegen-ia32.cc +0 -10385
  425. data/ext/v8/upstream/v8/src/ia32/codegen-ia32.h +0 -801
  426. data/ext/v8/upstream/v8/src/ia32/cpu-ia32.cc +0 -88
  427. data/ext/v8/upstream/v8/src/ia32/debug-ia32.cc +0 -312
  428. data/ext/v8/upstream/v8/src/ia32/deoptimizer-ia32.cc +0 -774
  429. data/ext/v8/upstream/v8/src/ia32/disasm-ia32.cc +0 -1620
  430. data/ext/v8/upstream/v8/src/ia32/frames-ia32.cc +0 -45
  431. data/ext/v8/upstream/v8/src/ia32/frames-ia32.h +0 -140
  432. data/ext/v8/upstream/v8/src/ia32/full-codegen-ia32.cc +0 -4357
  433. data/ext/v8/upstream/v8/src/ia32/ic-ia32.cc +0 -1779
  434. data/ext/v8/upstream/v8/src/ia32/jump-target-ia32.cc +0 -437
  435. data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.cc +0 -4158
  436. data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.h +0 -318
  437. data/ext/v8/upstream/v8/src/ia32/lithium-gap-resolver-ia32.cc +0 -466
  438. data/ext/v8/upstream/v8/src/ia32/lithium-gap-resolver-ia32.h +0 -110
  439. data/ext/v8/upstream/v8/src/ia32/lithium-ia32.cc +0 -2181
  440. data/ext/v8/upstream/v8/src/ia32/lithium-ia32.h +0 -2235
  441. data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.cc +0 -2056
  442. data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.h +0 -807
  443. data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.cc +0 -1264
  444. data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.h +0 -216
  445. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32-inl.h +0 -82
  446. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32.cc +0 -157
  447. data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32.h +0 -43
  448. data/ext/v8/upstream/v8/src/ia32/simulator-ia32.cc +0 -30
  449. data/ext/v8/upstream/v8/src/ia32/simulator-ia32.h +0 -72
  450. data/ext/v8/upstream/v8/src/ia32/stub-cache-ia32.cc +0 -3711
  451. data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.cc +0 -1366
  452. data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.h +0 -650
  453. data/ext/v8/upstream/v8/src/ic-inl.h +0 -130
  454. data/ext/v8/upstream/v8/src/ic.cc +0 -2389
  455. data/ext/v8/upstream/v8/src/ic.h +0 -675
  456. data/ext/v8/upstream/v8/src/inspector.cc +0 -63
  457. data/ext/v8/upstream/v8/src/inspector.h +0 -62
  458. data/ext/v8/upstream/v8/src/interpreter-irregexp.cc +0 -659
  459. data/ext/v8/upstream/v8/src/interpreter-irregexp.h +0 -49
  460. data/ext/v8/upstream/v8/src/isolate.cc +0 -883
  461. data/ext/v8/upstream/v8/src/isolate.h +0 -1306
  462. data/ext/v8/upstream/v8/src/json.js +0 -342
  463. data/ext/v8/upstream/v8/src/jsregexp.cc +0 -5371
  464. data/ext/v8/upstream/v8/src/jsregexp.h +0 -1483
  465. data/ext/v8/upstream/v8/src/jump-target-heavy-inl.h +0 -51
  466. data/ext/v8/upstream/v8/src/jump-target-heavy.cc +0 -427
  467. data/ext/v8/upstream/v8/src/jump-target-heavy.h +0 -238
  468. data/ext/v8/upstream/v8/src/jump-target-inl.h +0 -48
  469. data/ext/v8/upstream/v8/src/jump-target-light-inl.h +0 -56
  470. data/ext/v8/upstream/v8/src/jump-target-light.cc +0 -111
  471. data/ext/v8/upstream/v8/src/jump-target-light.h +0 -193
  472. data/ext/v8/upstream/v8/src/jump-target.cc +0 -91
  473. data/ext/v8/upstream/v8/src/jump-target.h +0 -90
  474. data/ext/v8/upstream/v8/src/list-inl.h +0 -206
  475. data/ext/v8/upstream/v8/src/list.h +0 -164
  476. data/ext/v8/upstream/v8/src/lithium-allocator-inl.h +0 -142
  477. data/ext/v8/upstream/v8/src/lithium-allocator.cc +0 -2105
  478. data/ext/v8/upstream/v8/src/lithium-allocator.h +0 -630
  479. data/ext/v8/upstream/v8/src/lithium.cc +0 -169
  480. data/ext/v8/upstream/v8/src/lithium.h +0 -592
  481. data/ext/v8/upstream/v8/src/liveedit-debugger.js +0 -1082
  482. data/ext/v8/upstream/v8/src/liveedit.cc +0 -1693
  483. data/ext/v8/upstream/v8/src/liveedit.h +0 -179
  484. data/ext/v8/upstream/v8/src/liveobjectlist-inl.h +0 -126
  485. data/ext/v8/upstream/v8/src/liveobjectlist.cc +0 -2589
  486. data/ext/v8/upstream/v8/src/liveobjectlist.h +0 -322
  487. data/ext/v8/upstream/v8/src/log-inl.h +0 -59
  488. data/ext/v8/upstream/v8/src/log-utils.cc +0 -423
  489. data/ext/v8/upstream/v8/src/log-utils.h +0 -229
  490. data/ext/v8/upstream/v8/src/log.cc +0 -1666
  491. data/ext/v8/upstream/v8/src/log.h +0 -446
  492. data/ext/v8/upstream/v8/src/macro-assembler.h +0 -120
  493. data/ext/v8/upstream/v8/src/macros.py +0 -178
  494. data/ext/v8/upstream/v8/src/mark-compact.cc +0 -3092
  495. data/ext/v8/upstream/v8/src/mark-compact.h +0 -506
  496. data/ext/v8/upstream/v8/src/math.js +0 -264
  497. data/ext/v8/upstream/v8/src/messages.cc +0 -166
  498. data/ext/v8/upstream/v8/src/messages.h +0 -114
  499. data/ext/v8/upstream/v8/src/messages.js +0 -1090
  500. data/ext/v8/upstream/v8/src/mips/assembler-mips-inl.h +0 -335
  501. data/ext/v8/upstream/v8/src/mips/assembler-mips.cc +0 -2093
  502. data/ext/v8/upstream/v8/src/mips/assembler-mips.h +0 -1066
  503. data/ext/v8/upstream/v8/src/mips/builtins-mips.cc +0 -148
  504. data/ext/v8/upstream/v8/src/mips/code-stubs-mips.cc +0 -752
  505. data/ext/v8/upstream/v8/src/mips/code-stubs-mips.h +0 -511
  506. data/ext/v8/upstream/v8/src/mips/codegen-mips-inl.h +0 -64
  507. data/ext/v8/upstream/v8/src/mips/codegen-mips.cc +0 -1213
  508. data/ext/v8/upstream/v8/src/mips/codegen-mips.h +0 -633
  509. data/ext/v8/upstream/v8/src/mips/constants-mips.cc +0 -352
  510. data/ext/v8/upstream/v8/src/mips/constants-mips.h +0 -723
  511. data/ext/v8/upstream/v8/src/mips/cpu-mips.cc +0 -90
  512. data/ext/v8/upstream/v8/src/mips/debug-mips.cc +0 -155
  513. data/ext/v8/upstream/v8/src/mips/deoptimizer-mips.cc +0 -91
  514. data/ext/v8/upstream/v8/src/mips/disasm-mips.cc +0 -1023
  515. data/ext/v8/upstream/v8/src/mips/frames-mips.cc +0 -48
  516. data/ext/v8/upstream/v8/src/mips/frames-mips.h +0 -179
  517. data/ext/v8/upstream/v8/src/mips/full-codegen-mips.cc +0 -727
  518. data/ext/v8/upstream/v8/src/mips/ic-mips.cc +0 -244
  519. data/ext/v8/upstream/v8/src/mips/jump-target-mips.cc +0 -80
  520. data/ext/v8/upstream/v8/src/mips/lithium-codegen-mips.h +0 -65
  521. data/ext/v8/upstream/v8/src/mips/lithium-mips.h +0 -304
  522. data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.cc +0 -3327
  523. data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.h +0 -1058
  524. data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.cc +0 -478
  525. data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.h +0 -250
  526. data/ext/v8/upstream/v8/src/mips/register-allocator-mips-inl.h +0 -134
  527. data/ext/v8/upstream/v8/src/mips/register-allocator-mips.cc +0 -63
  528. data/ext/v8/upstream/v8/src/mips/register-allocator-mips.h +0 -47
  529. data/ext/v8/upstream/v8/src/mips/simulator-mips.cc +0 -2438
  530. data/ext/v8/upstream/v8/src/mips/simulator-mips.h +0 -394
  531. data/ext/v8/upstream/v8/src/mips/stub-cache-mips.cc +0 -601
  532. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips-inl.h +0 -58
  533. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.cc +0 -307
  534. data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.h +0 -530
  535. data/ext/v8/upstream/v8/src/mirror-debugger.js +0 -2381
  536. data/ext/v8/upstream/v8/src/mksnapshot.cc +0 -256
  537. data/ext/v8/upstream/v8/src/natives.h +0 -63
  538. data/ext/v8/upstream/v8/src/objects-debug.cc +0 -722
  539. data/ext/v8/upstream/v8/src/objects-inl.h +0 -4166
  540. data/ext/v8/upstream/v8/src/objects-printer.cc +0 -801
  541. data/ext/v8/upstream/v8/src/objects-visiting.cc +0 -142
  542. data/ext/v8/upstream/v8/src/objects-visiting.h +0 -422
  543. data/ext/v8/upstream/v8/src/objects.cc +0 -10296
  544. data/ext/v8/upstream/v8/src/objects.h +0 -6662
  545. data/ext/v8/upstream/v8/src/parser.cc +0 -5168
  546. data/ext/v8/upstream/v8/src/parser.h +0 -823
  547. data/ext/v8/upstream/v8/src/platform-cygwin.cc +0 -811
  548. data/ext/v8/upstream/v8/src/platform-freebsd.cc +0 -854
  549. data/ext/v8/upstream/v8/src/platform-linux.cc +0 -1120
  550. data/ext/v8/upstream/v8/src/platform-macos.cc +0 -865
  551. data/ext/v8/upstream/v8/src/platform-nullos.cc +0 -504
  552. data/ext/v8/upstream/v8/src/platform-openbsd.cc +0 -672
  553. data/ext/v8/upstream/v8/src/platform-posix.cc +0 -424
  554. data/ext/v8/upstream/v8/src/platform-solaris.cc +0 -796
  555. data/ext/v8/upstream/v8/src/platform-tls-mac.h +0 -62
  556. data/ext/v8/upstream/v8/src/platform-tls-win32.h +0 -62
  557. data/ext/v8/upstream/v8/src/platform-tls.h +0 -50
  558. data/ext/v8/upstream/v8/src/platform-win32.cc +0 -2072
  559. data/ext/v8/upstream/v8/src/platform.h +0 -693
  560. data/ext/v8/upstream/v8/src/preparse-data.cc +0 -185
  561. data/ext/v8/upstream/v8/src/preparse-data.h +0 -249
  562. data/ext/v8/upstream/v8/src/preparser-api.cc +0 -219
  563. data/ext/v8/upstream/v8/src/preparser.cc +0 -1205
  564. data/ext/v8/upstream/v8/src/preparser.h +0 -278
  565. data/ext/v8/upstream/v8/src/prettyprinter.cc +0 -1530
  566. data/ext/v8/upstream/v8/src/prettyprinter.h +0 -223
  567. data/ext/v8/upstream/v8/src/profile-generator-inl.h +0 -128
  568. data/ext/v8/upstream/v8/src/profile-generator.cc +0 -3095
  569. data/ext/v8/upstream/v8/src/profile-generator.h +0 -1125
  570. data/ext/v8/upstream/v8/src/property.cc +0 -102
  571. data/ext/v8/upstream/v8/src/property.h +0 -348
  572. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp-inl.h +0 -78
  573. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp.cc +0 -470
  574. data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp.h +0 -142
  575. data/ext/v8/upstream/v8/src/regexp-macro-assembler-tracer.cc +0 -373
  576. data/ext/v8/upstream/v8/src/regexp-macro-assembler-tracer.h +0 -104
  577. data/ext/v8/upstream/v8/src/regexp-macro-assembler.cc +0 -266
  578. data/ext/v8/upstream/v8/src/regexp-macro-assembler.h +0 -236
  579. data/ext/v8/upstream/v8/src/regexp-stack.cc +0 -111
  580. data/ext/v8/upstream/v8/src/regexp-stack.h +0 -147
  581. data/ext/v8/upstream/v8/src/regexp.js +0 -483
  582. data/ext/v8/upstream/v8/src/register-allocator-inl.h +0 -141
  583. data/ext/v8/upstream/v8/src/register-allocator.cc +0 -98
  584. data/ext/v8/upstream/v8/src/register-allocator.h +0 -310
  585. data/ext/v8/upstream/v8/src/rewriter.cc +0 -1024
  586. data/ext/v8/upstream/v8/src/rewriter.h +0 -59
  587. data/ext/v8/upstream/v8/src/runtime-profiler.cc +0 -478
  588. data/ext/v8/upstream/v8/src/runtime-profiler.h +0 -192
  589. data/ext/v8/upstream/v8/src/runtime.cc +0 -11949
  590. data/ext/v8/upstream/v8/src/runtime.h +0 -643
  591. data/ext/v8/upstream/v8/src/runtime.js +0 -643
  592. data/ext/v8/upstream/v8/src/safepoint-table.cc +0 -256
  593. data/ext/v8/upstream/v8/src/safepoint-table.h +0 -269
  594. data/ext/v8/upstream/v8/src/scanner-base.cc +0 -964
  595. data/ext/v8/upstream/v8/src/scanner-base.h +0 -664
  596. data/ext/v8/upstream/v8/src/scanner.cc +0 -584
  597. data/ext/v8/upstream/v8/src/scanner.h +0 -196
  598. data/ext/v8/upstream/v8/src/scopeinfo.cc +0 -631
  599. data/ext/v8/upstream/v8/src/scopeinfo.h +0 -249
  600. data/ext/v8/upstream/v8/src/scopes.cc +0 -1093
  601. data/ext/v8/upstream/v8/src/scopes.h +0 -508
  602. data/ext/v8/upstream/v8/src/serialize.cc +0 -1574
  603. data/ext/v8/upstream/v8/src/serialize.h +0 -589
  604. data/ext/v8/upstream/v8/src/shell.h +0 -55
  605. data/ext/v8/upstream/v8/src/simulator.h +0 -43
  606. data/ext/v8/upstream/v8/src/small-pointer-list.h +0 -163
  607. data/ext/v8/upstream/v8/src/smart-pointer.h +0 -109
  608. data/ext/v8/upstream/v8/src/snapshot-common.cc +0 -82
  609. data/ext/v8/upstream/v8/src/snapshot-empty.cc +0 -50
  610. data/ext/v8/upstream/v8/src/snapshot.h +0 -73
  611. data/ext/v8/upstream/v8/src/spaces-inl.h +0 -529
  612. data/ext/v8/upstream/v8/src/spaces.cc +0 -3147
  613. data/ext/v8/upstream/v8/src/spaces.h +0 -2368
  614. data/ext/v8/upstream/v8/src/splay-tree-inl.h +0 -310
  615. data/ext/v8/upstream/v8/src/splay-tree.h +0 -203
  616. data/ext/v8/upstream/v8/src/string-search.cc +0 -41
  617. data/ext/v8/upstream/v8/src/string-search.h +0 -568
  618. data/ext/v8/upstream/v8/src/string-stream.cc +0 -592
  619. data/ext/v8/upstream/v8/src/string-stream.h +0 -191
  620. data/ext/v8/upstream/v8/src/string.js +0 -915
  621. data/ext/v8/upstream/v8/src/strtod.cc +0 -440
  622. data/ext/v8/upstream/v8/src/strtod.h +0 -40
  623. data/ext/v8/upstream/v8/src/stub-cache.cc +0 -1940
  624. data/ext/v8/upstream/v8/src/stub-cache.h +0 -866
  625. data/ext/v8/upstream/v8/src/third_party/valgrind/valgrind.h +0 -3925
  626. data/ext/v8/upstream/v8/src/token.cc +0 -63
  627. data/ext/v8/upstream/v8/src/token.h +0 -288
  628. data/ext/v8/upstream/v8/src/top.cc +0 -983
  629. data/ext/v8/upstream/v8/src/type-info.cc +0 -472
  630. data/ext/v8/upstream/v8/src/type-info.h +0 -290
  631. data/ext/v8/upstream/v8/src/unbound-queue-inl.h +0 -95
  632. data/ext/v8/upstream/v8/src/unbound-queue.h +0 -67
  633. data/ext/v8/upstream/v8/src/unicode-inl.h +0 -238
  634. data/ext/v8/upstream/v8/src/unicode.cc +0 -1624
  635. data/ext/v8/upstream/v8/src/unicode.h +0 -280
  636. data/ext/v8/upstream/v8/src/uri.js +0 -402
  637. data/ext/v8/upstream/v8/src/utils.cc +0 -371
  638. data/ext/v8/upstream/v8/src/utils.h +0 -796
  639. data/ext/v8/upstream/v8/src/v8-counters.cc +0 -62
  640. data/ext/v8/upstream/v8/src/v8-counters.h +0 -311
  641. data/ext/v8/upstream/v8/src/v8.cc +0 -215
  642. data/ext/v8/upstream/v8/src/v8.h +0 -130
  643. data/ext/v8/upstream/v8/src/v8checks.h +0 -64
  644. data/ext/v8/upstream/v8/src/v8dll-main.cc +0 -39
  645. data/ext/v8/upstream/v8/src/v8globals.h +0 -486
  646. data/ext/v8/upstream/v8/src/v8memory.h +0 -82
  647. data/ext/v8/upstream/v8/src/v8natives.js +0 -1293
  648. data/ext/v8/upstream/v8/src/v8preparserdll-main.cc +0 -39
  649. data/ext/v8/upstream/v8/src/v8threads.cc +0 -453
  650. data/ext/v8/upstream/v8/src/v8threads.h +0 -164
  651. data/ext/v8/upstream/v8/src/v8utils.h +0 -317
  652. data/ext/v8/upstream/v8/src/variables.cc +0 -132
  653. data/ext/v8/upstream/v8/src/variables.h +0 -212
  654. data/ext/v8/upstream/v8/src/version.cc +0 -116
  655. data/ext/v8/upstream/v8/src/version.h +0 -68
  656. data/ext/v8/upstream/v8/src/virtual-frame-heavy-inl.h +0 -190
  657. data/ext/v8/upstream/v8/src/virtual-frame-heavy.cc +0 -312
  658. data/ext/v8/upstream/v8/src/virtual-frame-inl.h +0 -39
  659. data/ext/v8/upstream/v8/src/virtual-frame-light-inl.h +0 -171
  660. data/ext/v8/upstream/v8/src/virtual-frame-light.cc +0 -52
  661. data/ext/v8/upstream/v8/src/virtual-frame.cc +0 -49
  662. data/ext/v8/upstream/v8/src/virtual-frame.h +0 -59
  663. data/ext/v8/upstream/v8/src/vm-state-inl.h +0 -138
  664. data/ext/v8/upstream/v8/src/vm-state.h +0 -70
  665. data/ext/v8/upstream/v8/src/win32-headers.h +0 -96
  666. data/ext/v8/upstream/v8/src/x64/assembler-x64-inl.h +0 -456
  667. data/ext/v8/upstream/v8/src/x64/assembler-x64.cc +0 -2954
  668. data/ext/v8/upstream/v8/src/x64/assembler-x64.h +0 -1630
  669. data/ext/v8/upstream/v8/src/x64/builtins-x64.cc +0 -1493
  670. data/ext/v8/upstream/v8/src/x64/code-stubs-x64.cc +0 -5132
  671. data/ext/v8/upstream/v8/src/x64/code-stubs-x64.h +0 -477
  672. data/ext/v8/upstream/v8/src/x64/codegen-x64-inl.h +0 -46
  673. data/ext/v8/upstream/v8/src/x64/codegen-x64.cc +0 -8843
  674. data/ext/v8/upstream/v8/src/x64/codegen-x64.h +0 -753
  675. data/ext/v8/upstream/v8/src/x64/cpu-x64.cc +0 -88
  676. data/ext/v8/upstream/v8/src/x64/debug-x64.cc +0 -318
  677. data/ext/v8/upstream/v8/src/x64/deoptimizer-x64.cc +0 -815
  678. data/ext/v8/upstream/v8/src/x64/disasm-x64.cc +0 -1752
  679. data/ext/v8/upstream/v8/src/x64/frames-x64.cc +0 -45
  680. data/ext/v8/upstream/v8/src/x64/frames-x64.h +0 -130
  681. data/ext/v8/upstream/v8/src/x64/full-codegen-x64.cc +0 -4339
  682. data/ext/v8/upstream/v8/src/x64/ic-x64.cc +0 -1752
  683. data/ext/v8/upstream/v8/src/x64/jump-target-x64.cc +0 -437
  684. data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.cc +0 -3970
  685. data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.h +0 -318
  686. data/ext/v8/upstream/v8/src/x64/lithium-gap-resolver-x64.cc +0 -320
  687. data/ext/v8/upstream/v8/src/x64/lithium-gap-resolver-x64.h +0 -74
  688. data/ext/v8/upstream/v8/src/x64/lithium-x64.cc +0 -2115
  689. data/ext/v8/upstream/v8/src/x64/lithium-x64.h +0 -2161
  690. data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.cc +0 -2911
  691. data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.h +0 -1984
  692. data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.cc +0 -1398
  693. data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.h +0 -282
  694. data/ext/v8/upstream/v8/src/x64/register-allocator-x64-inl.h +0 -87
  695. data/ext/v8/upstream/v8/src/x64/register-allocator-x64.cc +0 -95
  696. data/ext/v8/upstream/v8/src/x64/register-allocator-x64.h +0 -43
  697. data/ext/v8/upstream/v8/src/x64/simulator-x64.cc +0 -27
  698. data/ext/v8/upstream/v8/src/x64/simulator-x64.h +0 -71
  699. data/ext/v8/upstream/v8/src/x64/stub-cache-x64.cc +0 -3460
  700. data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.cc +0 -1296
  701. data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.h +0 -597
  702. data/ext/v8/upstream/v8/src/zone-inl.h +0 -129
  703. data/ext/v8/upstream/v8/src/zone.cc +0 -196
  704. data/ext/v8/upstream/v8/src/zone.h +0 -236
  705. data/ext/v8/upstream/v8/tools/codemap.js +0 -265
  706. data/ext/v8/upstream/v8/tools/consarray.js +0 -93
  707. data/ext/v8/upstream/v8/tools/csvparser.js +0 -78
  708. data/ext/v8/upstream/v8/tools/disasm.py +0 -92
  709. data/ext/v8/upstream/v8/tools/freebsd-tick-processor +0 -10
  710. data/ext/v8/upstream/v8/tools/gc-nvp-trace-processor.py +0 -328
  711. data/ext/v8/upstream/v8/tools/generate-ten-powers.scm +0 -286
  712. data/ext/v8/upstream/v8/tools/grokdump.py +0 -840
  713. data/ext/v8/upstream/v8/tools/gyp/v8.gyp +0 -844
  714. data/ext/v8/upstream/v8/tools/js2c.py +0 -380
  715. data/ext/v8/upstream/v8/tools/jsmin.py +0 -280
  716. data/ext/v8/upstream/v8/tools/linux-tick-processor +0 -35
  717. data/ext/v8/upstream/v8/tools/ll_prof.py +0 -919
  718. data/ext/v8/upstream/v8/tools/logreader.js +0 -185
  719. data/ext/v8/upstream/v8/tools/mac-nm +0 -18
  720. data/ext/v8/upstream/v8/tools/mac-tick-processor +0 -6
  721. data/ext/v8/upstream/v8/tools/oom_dump/README +0 -31
  722. data/ext/v8/upstream/v8/tools/oom_dump/SConstruct +0 -42
  723. data/ext/v8/upstream/v8/tools/oom_dump/oom_dump.cc +0 -288
  724. data/ext/v8/upstream/v8/tools/presubmit.py +0 -305
  725. data/ext/v8/upstream/v8/tools/process-heap-prof.py +0 -120
  726. data/ext/v8/upstream/v8/tools/profile.js +0 -751
  727. data/ext/v8/upstream/v8/tools/profile_view.js +0 -219
  728. data/ext/v8/upstream/v8/tools/run-valgrind.py +0 -77
  729. data/ext/v8/upstream/v8/tools/splaytree.js +0 -316
  730. data/ext/v8/upstream/v8/tools/stats-viewer.py +0 -468
  731. data/ext/v8/upstream/v8/tools/test.py +0 -1490
  732. data/ext/v8/upstream/v8/tools/tickprocessor-driver.js +0 -59
  733. data/ext/v8/upstream/v8/tools/tickprocessor.js +0 -877
  734. data/ext/v8/upstream/v8/tools/utils.py +0 -96
  735. data/ext/v8/upstream/v8/tools/visual_studio/README.txt +0 -70
  736. data/ext/v8/upstream/v8/tools/visual_studio/arm.vsprops +0 -14
  737. data/ext/v8/upstream/v8/tools/visual_studio/common.vsprops +0 -34
  738. data/ext/v8/upstream/v8/tools/visual_studio/d8.vcproj +0 -193
  739. data/ext/v8/upstream/v8/tools/visual_studio/d8_arm.vcproj +0 -193
  740. data/ext/v8/upstream/v8/tools/visual_studio/d8_x64.vcproj +0 -209
  741. data/ext/v8/upstream/v8/tools/visual_studio/d8js2c.cmd +0 -6
  742. data/ext/v8/upstream/v8/tools/visual_studio/debug.vsprops +0 -17
  743. data/ext/v8/upstream/v8/tools/visual_studio/ia32.vsprops +0 -17
  744. data/ext/v8/upstream/v8/tools/visual_studio/js2c.cmd +0 -6
  745. data/ext/v8/upstream/v8/tools/visual_studio/release.vsprops +0 -24
  746. data/ext/v8/upstream/v8/tools/visual_studio/v8.sln +0 -101
  747. data/ext/v8/upstream/v8/tools/visual_studio/v8.vcproj +0 -227
  748. data/ext/v8/upstream/v8/tools/visual_studio/v8_arm.sln +0 -74
  749. data/ext/v8/upstream/v8/tools/visual_studio/v8_arm.vcproj +0 -227
  750. data/ext/v8/upstream/v8/tools/visual_studio/v8_base.vcproj +0 -1308
  751. data/ext/v8/upstream/v8/tools/visual_studio/v8_base_arm.vcproj +0 -1238
  752. data/ext/v8/upstream/v8/tools/visual_studio/v8_base_x64.vcproj +0 -1300
  753. data/ext/v8/upstream/v8/tools/visual_studio/v8_cctest.vcproj +0 -265
  754. data/ext/v8/upstream/v8/tools/visual_studio/v8_cctest_arm.vcproj +0 -249
  755. data/ext/v8/upstream/v8/tools/visual_studio/v8_cctest_x64.vcproj +0 -257
  756. data/ext/v8/upstream/v8/tools/visual_studio/v8_mksnapshot.vcproj +0 -145
  757. data/ext/v8/upstream/v8/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -145
  758. data/ext/v8/upstream/v8/tools/visual_studio/v8_process_sample.vcproj +0 -145
  759. data/ext/v8/upstream/v8/tools/visual_studio/v8_process_sample_arm.vcproj +0 -145
  760. data/ext/v8/upstream/v8/tools/visual_studio/v8_process_sample_x64.vcproj +0 -161
  761. data/ext/v8/upstream/v8/tools/visual_studio/v8_shell_sample.vcproj +0 -147
  762. data/ext/v8/upstream/v8/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -147
  763. data/ext/v8/upstream/v8/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -163
  764. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot.vcproj +0 -142
  765. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot_cc.vcproj +0 -92
  766. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -92
  767. data/ext/v8/upstream/v8/tools/visual_studio/v8_snapshot_x64.vcproj +0 -142
  768. data/ext/v8/upstream/v8/tools/visual_studio/v8_x64.sln +0 -101
  769. data/ext/v8/upstream/v8/tools/visual_studio/v8_x64.vcproj +0 -227
  770. data/ext/v8/upstream/v8/tools/visual_studio/x64.vsprops +0 -18
  771. data/ext/v8/upstream/v8/tools/windows-tick-processor.bat +0 -30
@@ -1,185 +0,0 @@
1
- // Copyright 2006-2008 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
-
29
- #ifndef V8_BOOTSTRAPPER_H_
30
- #define V8_BOOTSTRAPPER_H_
31
-
32
- namespace v8 {
33
- namespace internal {
34
-
35
-
36
- // A SourceCodeCache uses a FixedArray to store pairs of
37
- // (AsciiString*, JSFunction*), mapping names of native code files
38
- // (runtime.js, etc.) to precompiled functions. Instead of mapping
39
- // names to functions it might make sense to let the JS2C tool
40
- // generate an index for each native JS file.
41
- class SourceCodeCache BASE_EMBEDDED {
42
- public:
43
- explicit SourceCodeCache(Script::Type type): type_(type), cache_(NULL) { }
44
-
45
- void Initialize(bool create_heap_objects) {
46
- cache_ = create_heap_objects ? HEAP->empty_fixed_array() : NULL;
47
- }
48
-
49
- void Iterate(ObjectVisitor* v) {
50
- v->VisitPointer(BitCast<Object**, FixedArray**>(&cache_));
51
- }
52
-
53
- bool Lookup(Vector<const char> name, Handle<SharedFunctionInfo>* handle) {
54
- for (int i = 0; i < cache_->length(); i+=2) {
55
- SeqAsciiString* str = SeqAsciiString::cast(cache_->get(i));
56
- if (str->IsEqualTo(name)) {
57
- *handle = Handle<SharedFunctionInfo>(
58
- SharedFunctionInfo::cast(cache_->get(i + 1)));
59
- return true;
60
- }
61
- }
62
- return false;
63
- }
64
-
65
- void Add(Vector<const char> name, Handle<SharedFunctionInfo> shared) {
66
- HandleScope scope;
67
- int length = cache_->length();
68
- Handle<FixedArray> new_array =
69
- FACTORY->NewFixedArray(length + 2, TENURED);
70
- cache_->CopyTo(0, *new_array, 0, cache_->length());
71
- cache_ = *new_array;
72
- Handle<String> str = FACTORY->NewStringFromAscii(name, TENURED);
73
- cache_->set(length, *str);
74
- cache_->set(length + 1, *shared);
75
- Script::cast(shared->script())->set_type(Smi::FromInt(type_));
76
- }
77
-
78
- private:
79
- Script::Type type_;
80
- FixedArray* cache_;
81
- DISALLOW_COPY_AND_ASSIGN(SourceCodeCache);
82
- };
83
-
84
-
85
- // The Boostrapper is the public interface for creating a JavaScript global
86
- // context.
87
- class Bootstrapper {
88
- public:
89
- // Requires: Heap::Setup has been called.
90
- void Initialize(bool create_heap_objects);
91
- void TearDown();
92
-
93
- // Creates a JavaScript Global Context with initial object graph.
94
- // The returned value is a global handle casted to V8Environment*.
95
- Handle<Context> CreateEnvironment(
96
- Handle<Object> global_object,
97
- v8::Handle<v8::ObjectTemplate> global_template,
98
- v8::ExtensionConfiguration* extensions);
99
-
100
- // Detach the environment from its outer global object.
101
- void DetachGlobal(Handle<Context> env);
102
-
103
- // Reattach an outer global object to an environment.
104
- void ReattachGlobal(Handle<Context> env, Handle<Object> global_object);
105
-
106
- // Traverses the pointers for memory management.
107
- void Iterate(ObjectVisitor* v);
108
-
109
- // Accessor for the native scripts source code.
110
- Handle<String> NativesSourceLookup(int index);
111
-
112
- // Tells whether bootstrapping is active.
113
- bool IsActive() const { return nesting_ != 0; }
114
-
115
- // Support for thread preemption.
116
- RLYSTC int ArchiveSpacePerThread();
117
- char* ArchiveState(char* to);
118
- char* RestoreState(char* from);
119
- void FreeThreadResources();
120
-
121
- // This will allocate a char array that is deleted when V8 is shut down.
122
- // It should only be used for strictly finite allocations.
123
- char* AllocateAutoDeletedArray(int bytes);
124
-
125
- // Used for new context creation.
126
- bool InstallExtensions(Handle<Context> global_context,
127
- v8::ExtensionConfiguration* extensions);
128
-
129
- SourceCodeCache* extensions_cache() { return &extensions_cache_; }
130
-
131
- private:
132
- typedef int NestingCounterType;
133
- NestingCounterType nesting_;
134
- SourceCodeCache extensions_cache_;
135
- // This is for delete, not delete[].
136
- List<char*>* delete_these_non_arrays_on_tear_down_;
137
- // This is for delete[]
138
- List<char*>* delete_these_arrays_on_tear_down_;
139
-
140
- friend class BootstrapperActive;
141
- friend class Isolate;
142
- friend class NativesExternalStringResource;
143
-
144
- Bootstrapper();
145
-
146
- DISALLOW_COPY_AND_ASSIGN(Bootstrapper);
147
- };
148
-
149
-
150
- class BootstrapperActive BASE_EMBEDDED {
151
- public:
152
- BootstrapperActive() {
153
- ++Isolate::Current()->bootstrapper()->nesting_;
154
- }
155
-
156
- ~BootstrapperActive() {
157
- --Isolate::Current()->bootstrapper()->nesting_;
158
- }
159
-
160
- private:
161
- DISALLOW_COPY_AND_ASSIGN(BootstrapperActive);
162
- };
163
-
164
-
165
- class NativesExternalStringResource
166
- : public v8::String::ExternalAsciiStringResource {
167
- public:
168
- explicit NativesExternalStringResource(Bootstrapper* bootstrapper,
169
- const char* source);
170
-
171
- const char* data() const {
172
- return data_;
173
- }
174
-
175
- size_t length() const {
176
- return length_;
177
- }
178
- private:
179
- const char* data_;
180
- size_t length_;
181
- };
182
-
183
- }} // namespace v8::internal
184
-
185
- #endif // V8_BOOTSTRAPPER_H_
@@ -1,1708 +0,0 @@
1
- // Copyright 2006-2008 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #include "v8.h"
29
-
30
- #include "api.h"
31
- #include "arguments.h"
32
- #include "bootstrapper.h"
33
- #include "builtins.h"
34
- #include "gdb-jit.h"
35
- #include "ic-inl.h"
36
- #include "vm-state-inl.h"
37
-
38
- namespace v8 {
39
- namespace internal {
40
-
41
- namespace {
42
-
43
- // Arguments object passed to C++ builtins.
44
- template <BuiltinExtraArguments extra_args>
45
- class BuiltinArguments : public Arguments {
46
- public:
47
- BuiltinArguments(int length, Object** arguments)
48
- : Arguments(length, arguments) { }
49
-
50
- Object*& operator[] (int index) {
51
- ASSERT(index < length());
52
- return Arguments::operator[](index);
53
- }
54
-
55
- template <class S> Handle<S> at(int index) {
56
- ASSERT(index < length());
57
- return Arguments::at<S>(index);
58
- }
59
-
60
- Handle<Object> receiver() {
61
- return Arguments::at<Object>(0);
62
- }
63
-
64
- Handle<JSFunction> called_function() {
65
- STATIC_ASSERT(extra_args == NEEDS_CALLED_FUNCTION);
66
- return Arguments::at<JSFunction>(Arguments::length() - 1);
67
- }
68
-
69
- // Gets the total number of arguments including the receiver (but
70
- // excluding extra arguments).
71
- int length() const {
72
- STATIC_ASSERT(extra_args == NO_EXTRA_ARGUMENTS);
73
- return Arguments::length();
74
- }
75
-
76
- #ifdef DEBUG
77
- void Verify() {
78
- // Check we have at least the receiver.
79
- ASSERT(Arguments::length() >= 1);
80
- }
81
- #endif
82
- };
83
-
84
-
85
- // Specialize BuiltinArguments for the called function extra argument.
86
-
87
- template <>
88
- int BuiltinArguments<NEEDS_CALLED_FUNCTION>::length() const {
89
- return Arguments::length() - 1;
90
- }
91
-
92
- #ifdef DEBUG
93
- template <>
94
- void BuiltinArguments<NEEDS_CALLED_FUNCTION>::Verify() {
95
- // Check we have at least the receiver and the called function.
96
- ASSERT(Arguments::length() >= 2);
97
- // Make sure cast to JSFunction succeeds.
98
- called_function();
99
- }
100
- #endif
101
-
102
-
103
- #define DEF_ARG_TYPE(name, spec) \
104
- typedef BuiltinArguments<spec> name##ArgumentsType;
105
- BUILTIN_LIST_C(DEF_ARG_TYPE)
106
- #undef DEF_ARG_TYPE
107
-
108
- } // namespace
109
-
110
- // ----------------------------------------------------------------------------
111
- // Support macro for defining builtins in C++.
112
- // ----------------------------------------------------------------------------
113
- //
114
- // A builtin function is defined by writing:
115
- //
116
- // BUILTIN(name) {
117
- // ...
118
- // }
119
- //
120
- // In the body of the builtin function the arguments can be accessed
121
- // through the BuiltinArguments object args.
122
-
123
- #ifdef DEBUG
124
-
125
- #define BUILTIN(name) \
126
- MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name( \
127
- name##ArgumentsType args, Isolate* isolate); \
128
- MUST_USE_RESULT static MaybeObject* Builtin_##name( \
129
- name##ArgumentsType args, Isolate* isolate) { \
130
- ASSERT(isolate == Isolate::Current()); \
131
- args.Verify(); \
132
- return Builtin_Impl_##name(args, isolate); \
133
- } \
134
- MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name( \
135
- name##ArgumentsType args, Isolate* isolate)
136
-
137
- #else // For release mode.
138
-
139
- #define BUILTIN(name) \
140
- static MaybeObject* Builtin_##name(name##ArgumentsType args, Isolate* isolate)
141
-
142
- #endif
143
-
144
-
145
- static inline bool CalledAsConstructor(Isolate* isolate) {
146
- #ifdef DEBUG
147
- // Calculate the result using a full stack frame iterator and check
148
- // that the state of the stack is as we assume it to be in the
149
- // code below.
150
- StackFrameIterator it;
151
- ASSERT(it.frame()->is_exit());
152
- it.Advance();
153
- StackFrame* frame = it.frame();
154
- bool reference_result = frame->is_construct();
155
- #endif
156
- Address fp = Isolate::c_entry_fp(isolate->thread_local_top());
157
- // Because we know fp points to an exit frame we can use the relevant
158
- // part of ExitFrame::ComputeCallerState directly.
159
- const int kCallerOffset = ExitFrameConstants::kCallerFPOffset;
160
- Address caller_fp = Memory::Address_at(fp + kCallerOffset);
161
- // This inlines the part of StackFrame::ComputeType that grabs the
162
- // type of the current frame. Note that StackFrame::ComputeType
163
- // has been specialized for each architecture so if any one of them
164
- // changes this code has to be changed as well.
165
- const int kMarkerOffset = StandardFrameConstants::kMarkerOffset;
166
- const Smi* kConstructMarker = Smi::FromInt(StackFrame::CONSTRUCT);
167
- Object* marker = Memory::Object_at(caller_fp + kMarkerOffset);
168
- bool result = (marker == kConstructMarker);
169
- ASSERT_EQ(result, reference_result);
170
- return result;
171
- }
172
-
173
- // ----------------------------------------------------------------------------
174
-
175
- BUILTIN(Illegal) {
176
- UNREACHABLE();
177
- return isolate->heap()->undefined_value(); // Make compiler happy.
178
- }
179
-
180
-
181
- BUILTIN(EmptyFunction) {
182
- return isolate->heap()->undefined_value();
183
- }
184
-
185
-
186
- BUILTIN(ArrayCodeGeneric) {
187
- Heap* heap = isolate->heap();
188
- isolate->counters()->array_function_runtime()->Increment();
189
-
190
- JSArray* array;
191
- if (CalledAsConstructor(isolate)) {
192
- array = JSArray::cast(*args.receiver());
193
- } else {
194
- // Allocate the JS Array
195
- JSFunction* constructor =
196
- isolate->context()->global_context()->array_function();
197
- Object* obj;
198
- { MaybeObject* maybe_obj = heap->AllocateJSObject(constructor);
199
- if (!maybe_obj->ToObject(&obj)) return maybe_obj;
200
- }
201
- array = JSArray::cast(obj);
202
- }
203
-
204
- // 'array' now contains the JSArray we should initialize.
205
- ASSERT(array->HasFastElements());
206
-
207
- // Optimize the case where there is one argument and the argument is a
208
- // small smi.
209
- if (args.length() == 2) {
210
- Object* obj = args[1];
211
- if (obj->IsSmi()) {
212
- int len = Smi::cast(obj)->value();
213
- if (len >= 0 && len < JSObject::kInitialMaxFastElementArray) {
214
- Object* obj;
215
- { MaybeObject* maybe_obj = heap->AllocateFixedArrayWithHoles(len);
216
- if (!maybe_obj->ToObject(&obj)) return maybe_obj;
217
- }
218
- array->SetContent(FixedArray::cast(obj));
219
- return array;
220
- }
221
- }
222
- // Take the argument as the length.
223
- { MaybeObject* maybe_obj = array->Initialize(0);
224
- if (!maybe_obj->ToObject(&obj)) return maybe_obj;
225
- }
226
- return array->SetElementsLength(args[1]);
227
- }
228
-
229
- // Optimize the case where there are no parameters passed.
230
- if (args.length() == 1) {
231
- return array->Initialize(JSArray::kPreallocatedArrayElements);
232
- }
233
-
234
- // Take the arguments as elements.
235
- int number_of_elements = args.length() - 1;
236
- Smi* len = Smi::FromInt(number_of_elements);
237
- Object* obj;
238
- { MaybeObject* maybe_obj = heap->AllocateFixedArrayWithHoles(len->value());
239
- if (!maybe_obj->ToObject(&obj)) return maybe_obj;
240
- }
241
-
242
- AssertNoAllocation no_gc;
243
- FixedArray* elms = FixedArray::cast(obj);
244
- WriteBarrierMode mode = elms->GetWriteBarrierMode(no_gc);
245
- // Fill in the content
246
- for (int index = 0; index < number_of_elements; index++) {
247
- elms->set(index, args[index+1], mode);
248
- }
249
-
250
- // Set length and elements on the array.
251
- array->set_elements(FixedArray::cast(obj));
252
- array->set_length(len);
253
-
254
- return array;
255
- }
256
-
257
-
258
- MUST_USE_RESULT static MaybeObject* AllocateJSArray(Heap* heap) {
259
- JSFunction* array_function =
260
- heap->isolate()->context()->global_context()->array_function();
261
- Object* result;
262
- { MaybeObject* maybe_result = heap->AllocateJSObject(array_function);
263
- if (!maybe_result->ToObject(&result)) return maybe_result;
264
- }
265
- return result;
266
- }
267
-
268
-
269
- MUST_USE_RESULT static MaybeObject* AllocateEmptyJSArray(Heap* heap) {
270
- Object* result;
271
- { MaybeObject* maybe_result = AllocateJSArray(heap);
272
- if (!maybe_result->ToObject(&result)) return maybe_result;
273
- }
274
- JSArray* result_array = JSArray::cast(result);
275
- result_array->set_length(Smi::FromInt(0));
276
- result_array->set_elements(heap->empty_fixed_array());
277
- return result_array;
278
- }
279
-
280
-
281
- static void CopyElements(Heap* heap,
282
- AssertNoAllocation* no_gc,
283
- FixedArray* dst,
284
- int dst_index,
285
- FixedArray* src,
286
- int src_index,
287
- int len) {
288
- ASSERT(dst != src); // Use MoveElements instead.
289
- ASSERT(dst->map() != HEAP->fixed_cow_array_map());
290
- ASSERT(len > 0);
291
- CopyWords(dst->data_start() + dst_index,
292
- src->data_start() + src_index,
293
- len);
294
- WriteBarrierMode mode = dst->GetWriteBarrierMode(*no_gc);
295
- if (mode == UPDATE_WRITE_BARRIER) {
296
- heap->RecordWrites(dst->address(), dst->OffsetOfElementAt(dst_index), len);
297
- }
298
- }
299
-
300
-
301
- static void MoveElements(Heap* heap,
302
- AssertNoAllocation* no_gc,
303
- FixedArray* dst,
304
- int dst_index,
305
- FixedArray* src,
306
- int src_index,
307
- int len) {
308
- ASSERT(dst->map() != HEAP->fixed_cow_array_map());
309
- memmove(dst->data_start() + dst_index,
310
- src->data_start() + src_index,
311
- len * kPointerSize);
312
- WriteBarrierMode mode = dst->GetWriteBarrierMode(*no_gc);
313
- if (mode == UPDATE_WRITE_BARRIER) {
314
- heap->RecordWrites(dst->address(), dst->OffsetOfElementAt(dst_index), len);
315
- }
316
- }
317
-
318
-
319
- static void FillWithHoles(Heap* heap, FixedArray* dst, int from, int to) {
320
- ASSERT(dst->map() != heap->fixed_cow_array_map());
321
- MemsetPointer(dst->data_start() + from, heap->the_hole_value(), to - from);
322
- }
323
-
324
-
325
- static FixedArray* LeftTrimFixedArray(Heap* heap,
326
- FixedArray* elms,
327
- int to_trim) {
328
- ASSERT(elms->map() != HEAP->fixed_cow_array_map());
329
- // For now this trick is only applied to fixed arrays in new and paged space.
330
- // In large object space the object's start must coincide with chunk
331
- // and thus the trick is just not applicable.
332
- ASSERT(!HEAP->lo_space()->Contains(elms));
333
-
334
- STATIC_ASSERT(FixedArray::kMapOffset == 0);
335
- STATIC_ASSERT(FixedArray::kLengthOffset == kPointerSize);
336
- STATIC_ASSERT(FixedArray::kHeaderSize == 2 * kPointerSize);
337
-
338
- Object** former_start = HeapObject::RawField(elms, 0);
339
-
340
- const int len = elms->length();
341
-
342
- if (to_trim > FixedArray::kHeaderSize / kPointerSize &&
343
- !heap->new_space()->Contains(elms)) {
344
- // If we are doing a big trim in old space then we zap the space that was
345
- // formerly part of the array so that the GC (aided by the card-based
346
- // remembered set) won't find pointers to new-space there.
347
- Object** zap = reinterpret_cast<Object**>(elms->address());
348
- zap++; // Header of filler must be at least one word so skip that.
349
- for (int i = 1; i < to_trim; i++) {
350
- *zap++ = Smi::FromInt(0);
351
- }
352
- }
353
- // Technically in new space this write might be omitted (except for
354
- // debug mode which iterates through the heap), but to play safer
355
- // we still do it.
356
- heap->CreateFillerObjectAt(elms->address(), to_trim * kPointerSize);
357
-
358
- former_start[to_trim] = heap->fixed_array_map();
359
- former_start[to_trim + 1] = Smi::FromInt(len - to_trim);
360
-
361
- return FixedArray::cast(HeapObject::FromAddress(
362
- elms->address() + to_trim * kPointerSize));
363
- }
364
-
365
-
366
- static bool ArrayPrototypeHasNoElements(Heap* heap,
367
- Context* global_context,
368
- JSObject* array_proto) {
369
- // This method depends on non writability of Object and Array prototype
370
- // fields.
371
- if (array_proto->elements() != heap->empty_fixed_array()) return false;
372
- // Hidden prototype
373
- array_proto = JSObject::cast(array_proto->GetPrototype());
374
- ASSERT(array_proto->elements() == heap->empty_fixed_array());
375
- // Object.prototype
376
- Object* proto = array_proto->GetPrototype();
377
- if (proto == heap->null_value()) return false;
378
- array_proto = JSObject::cast(proto);
379
- if (array_proto != global_context->initial_object_prototype()) return false;
380
- if (array_proto->elements() != heap->empty_fixed_array()) return false;
381
- ASSERT(array_proto->GetPrototype()->IsNull());
382
- return true;
383
- }
384
-
385
-
386
- MUST_USE_RESULT
387
- static inline MaybeObject* EnsureJSArrayWithWritableFastElements(
388
- Heap* heap, Object* receiver) {
389
- if (!receiver->IsJSArray()) return NULL;
390
- JSArray* array = JSArray::cast(receiver);
391
- HeapObject* elms = array->elements();
392
- if (elms->map() == heap->fixed_array_map()) return elms;
393
- if (elms->map() == heap->fixed_cow_array_map()) {
394
- return array->EnsureWritableFastElements();
395
- }
396
- return NULL;
397
- }
398
-
399
-
400
- static inline bool IsJSArrayFastElementMovingAllowed(Heap* heap,
401
- JSArray* receiver) {
402
- Context* global_context = heap->isolate()->context()->global_context();
403
- JSObject* array_proto =
404
- JSObject::cast(global_context->array_function()->prototype());
405
- return receiver->GetPrototype() == array_proto &&
406
- ArrayPrototypeHasNoElements(heap, global_context, array_proto);
407
- }
408
-
409
-
410
- MUST_USE_RESULT static MaybeObject* CallJsBuiltin(
411
- Isolate* isolate,
412
- const char* name,
413
- BuiltinArguments<NO_EXTRA_ARGUMENTS> args) {
414
- HandleScope handleScope(isolate);
415
-
416
- Handle<Object> js_builtin =
417
- GetProperty(Handle<JSObject>(
418
- isolate->global_context()->builtins()),
419
- name);
420
- ASSERT(js_builtin->IsJSFunction());
421
- Handle<JSFunction> function(Handle<JSFunction>::cast(js_builtin));
422
- ScopedVector<Object**> argv(args.length() - 1);
423
- int n_args = args.length() - 1;
424
- for (int i = 0; i < n_args; i++) {
425
- argv[i] = args.at<Object>(i + 1).location();
426
- }
427
- bool pending_exception = false;
428
- Handle<Object> result = Execution::Call(function,
429
- args.receiver(),
430
- n_args,
431
- argv.start(),
432
- &pending_exception);
433
- if (pending_exception) return Failure::Exception();
434
- return *result;
435
- }
436
-
437
-
438
- BUILTIN(ArrayPush) {
439
- Heap* heap = isolate->heap();
440
- Object* receiver = *args.receiver();
441
- Object* elms_obj;
442
- { MaybeObject* maybe_elms_obj =
443
- EnsureJSArrayWithWritableFastElements(heap, receiver);
444
- if (maybe_elms_obj == NULL) {
445
- return CallJsBuiltin(isolate, "ArrayPush", args);
446
- }
447
- if (!maybe_elms_obj->ToObject(&elms_obj)) return maybe_elms_obj;
448
- }
449
- FixedArray* elms = FixedArray::cast(elms_obj);
450
- JSArray* array = JSArray::cast(receiver);
451
-
452
- int len = Smi::cast(array->length())->value();
453
- int to_add = args.length() - 1;
454
- if (to_add == 0) {
455
- return Smi::FromInt(len);
456
- }
457
- // Currently fixed arrays cannot grow too big, so
458
- // we should never hit this case.
459
- ASSERT(to_add <= (Smi::kMaxValue - len));
460
-
461
- int new_length = len + to_add;
462
-
463
- if (new_length > elms->length()) {
464
- // New backing storage is needed.
465
- int capacity = new_length + (new_length >> 1) + 16;
466
- Object* obj;
467
- { MaybeObject* maybe_obj = heap->AllocateUninitializedFixedArray(capacity);
468
- if (!maybe_obj->ToObject(&obj)) return maybe_obj;
469
- }
470
- FixedArray* new_elms = FixedArray::cast(obj);
471
-
472
- AssertNoAllocation no_gc;
473
- if (len > 0) {
474
- CopyElements(heap, &no_gc, new_elms, 0, elms, 0, len);
475
- }
476
- FillWithHoles(heap, new_elms, new_length, capacity);
477
-
478
- elms = new_elms;
479
- array->set_elements(elms);
480
- }
481
-
482
- // Add the provided values.
483
- AssertNoAllocation no_gc;
484
- WriteBarrierMode mode = elms->GetWriteBarrierMode(no_gc);
485
- for (int index = 0; index < to_add; index++) {
486
- elms->set(index + len, args[index + 1], mode);
487
- }
488
-
489
- // Set the length.
490
- array->set_length(Smi::FromInt(new_length));
491
- return Smi::FromInt(new_length);
492
- }
493
-
494
-
495
- BUILTIN(ArrayPop) {
496
- Heap* heap = isolate->heap();
497
- Object* receiver = *args.receiver();
498
- Object* elms_obj;
499
- { MaybeObject* maybe_elms_obj =
500
- EnsureJSArrayWithWritableFastElements(heap, receiver);
501
- if (maybe_elms_obj == NULL) return CallJsBuiltin(isolate, "ArrayPop", args);
502
- if (!maybe_elms_obj->ToObject(&elms_obj)) return maybe_elms_obj;
503
- }
504
- FixedArray* elms = FixedArray::cast(elms_obj);
505
- JSArray* array = JSArray::cast(receiver);
506
-
507
- int len = Smi::cast(array->length())->value();
508
- if (len == 0) return heap->undefined_value();
509
-
510
- // Get top element
511
- MaybeObject* top = elms->get(len - 1);
512
-
513
- // Set the length.
514
- array->set_length(Smi::FromInt(len - 1));
515
-
516
- if (!top->IsTheHole()) {
517
- // Delete the top element.
518
- elms->set_the_hole(len - 1);
519
- return top;
520
- }
521
-
522
- top = array->GetPrototype()->GetElement(len - 1);
523
-
524
- return top;
525
- }
526
-
527
-
528
- BUILTIN(ArrayShift) {
529
- Heap* heap = isolate->heap();
530
- Object* receiver = *args.receiver();
531
- Object* elms_obj;
532
- { MaybeObject* maybe_elms_obj =
533
- EnsureJSArrayWithWritableFastElements(heap, receiver);
534
- if (maybe_elms_obj == NULL)
535
- return CallJsBuiltin(isolate, "ArrayShift", args);
536
- if (!maybe_elms_obj->ToObject(&elms_obj)) return maybe_elms_obj;
537
- }
538
- if (!IsJSArrayFastElementMovingAllowed(heap, JSArray::cast(receiver))) {
539
- return CallJsBuiltin(isolate, "ArrayShift", args);
540
- }
541
- FixedArray* elms = FixedArray::cast(elms_obj);
542
- JSArray* array = JSArray::cast(receiver);
543
- ASSERT(array->HasFastElements());
544
-
545
- int len = Smi::cast(array->length())->value();
546
- if (len == 0) return heap->undefined_value();
547
-
548
- // Get first element
549
- Object* first = elms->get(0);
550
- if (first->IsTheHole()) {
551
- first = heap->undefined_value();
552
- }
553
-
554
- if (!heap->lo_space()->Contains(elms)) {
555
- // As elms still in the same space they used to be,
556
- // there is no need to update region dirty mark.
557
- array->set_elements(LeftTrimFixedArray(heap, elms, 1), SKIP_WRITE_BARRIER);
558
- } else {
559
- // Shift the elements.
560
- AssertNoAllocation no_gc;
561
- MoveElements(heap, &no_gc, elms, 0, elms, 1, len - 1);
562
- elms->set(len - 1, heap->the_hole_value());
563
- }
564
-
565
- // Set the length.
566
- array->set_length(Smi::FromInt(len - 1));
567
-
568
- return first;
569
- }
570
-
571
-
572
- BUILTIN(ArrayUnshift) {
573
- Heap* heap = isolate->heap();
574
- Object* receiver = *args.receiver();
575
- Object* elms_obj;
576
- { MaybeObject* maybe_elms_obj =
577
- EnsureJSArrayWithWritableFastElements(heap, receiver);
578
- if (maybe_elms_obj == NULL)
579
- return CallJsBuiltin(isolate, "ArrayUnshift", args);
580
- if (!maybe_elms_obj->ToObject(&elms_obj)) return maybe_elms_obj;
581
- }
582
- if (!IsJSArrayFastElementMovingAllowed(heap, JSArray::cast(receiver))) {
583
- return CallJsBuiltin(isolate, "ArrayUnshift", args);
584
- }
585
- FixedArray* elms = FixedArray::cast(elms_obj);
586
- JSArray* array = JSArray::cast(receiver);
587
- ASSERT(array->HasFastElements());
588
-
589
- int len = Smi::cast(array->length())->value();
590
- int to_add = args.length() - 1;
591
- int new_length = len + to_add;
592
- // Currently fixed arrays cannot grow too big, so
593
- // we should never hit this case.
594
- ASSERT(to_add <= (Smi::kMaxValue - len));
595
-
596
- if (new_length > elms->length()) {
597
- // New backing storage is needed.
598
- int capacity = new_length + (new_length >> 1) + 16;
599
- Object* obj;
600
- { MaybeObject* maybe_obj = heap->AllocateUninitializedFixedArray(capacity);
601
- if (!maybe_obj->ToObject(&obj)) return maybe_obj;
602
- }
603
- FixedArray* new_elms = FixedArray::cast(obj);
604
-
605
- AssertNoAllocation no_gc;
606
- if (len > 0) {
607
- CopyElements(heap, &no_gc, new_elms, to_add, elms, 0, len);
608
- }
609
- FillWithHoles(heap, new_elms, new_length, capacity);
610
-
611
- elms = new_elms;
612
- array->set_elements(elms);
613
- } else {
614
- AssertNoAllocation no_gc;
615
- MoveElements(heap, &no_gc, elms, to_add, elms, 0, len);
616
- }
617
-
618
- // Add the provided values.
619
- AssertNoAllocation no_gc;
620
- WriteBarrierMode mode = elms->GetWriteBarrierMode(no_gc);
621
- for (int i = 0; i < to_add; i++) {
622
- elms->set(i, args[i + 1], mode);
623
- }
624
-
625
- // Set the length.
626
- array->set_length(Smi::FromInt(new_length));
627
- return Smi::FromInt(new_length);
628
- }
629
-
630
-
631
- BUILTIN(ArraySlice) {
632
- Heap* heap = isolate->heap();
633
- Object* receiver = *args.receiver();
634
- FixedArray* elms;
635
- int len = -1;
636
- if (receiver->IsJSArray()) {
637
- JSArray* array = JSArray::cast(receiver);
638
- if (!array->HasFastElements() ||
639
- !IsJSArrayFastElementMovingAllowed(heap, array)) {
640
- return CallJsBuiltin(isolate, "ArraySlice", args);
641
- }
642
-
643
- elms = FixedArray::cast(array->elements());
644
- len = Smi::cast(array->length())->value();
645
- } else {
646
- // Array.slice(arguments, ...) is quite a common idiom (notably more
647
- // than 50% of invocations in Web apps). Treat it in C++ as well.
648
- Map* arguments_map =
649
- isolate->context()->global_context()->arguments_boilerplate()->map();
650
-
651
- bool is_arguments_object_with_fast_elements =
652
- receiver->IsJSObject()
653
- && JSObject::cast(receiver)->map() == arguments_map
654
- && JSObject::cast(receiver)->HasFastElements();
655
- if (!is_arguments_object_with_fast_elements) {
656
- return CallJsBuiltin(isolate, "ArraySlice", args);
657
- }
658
- elms = FixedArray::cast(JSObject::cast(receiver)->elements());
659
- Object* len_obj = JSObject::cast(receiver)
660
- ->InObjectPropertyAt(Heap::kArgumentsLengthIndex);
661
- if (!len_obj->IsSmi()) {
662
- return CallJsBuiltin(isolate, "ArraySlice", args);
663
- }
664
- len = Smi::cast(len_obj)->value();
665
- if (len > elms->length()) {
666
- return CallJsBuiltin(isolate, "ArraySlice", args);
667
- }
668
- for (int i = 0; i < len; i++) {
669
- if (elms->get(i) == heap->the_hole_value()) {
670
- return CallJsBuiltin(isolate, "ArraySlice", args);
671
- }
672
- }
673
- }
674
- ASSERT(len >= 0);
675
- int n_arguments = args.length() - 1;
676
-
677
- // Note carefully choosen defaults---if argument is missing,
678
- // it's undefined which gets converted to 0 for relative_start
679
- // and to len for relative_end.
680
- int relative_start = 0;
681
- int relative_end = len;
682
- if (n_arguments > 0) {
683
- Object* arg1 = args[1];
684
- if (arg1->IsSmi()) {
685
- relative_start = Smi::cast(arg1)->value();
686
- } else if (!arg1->IsUndefined()) {
687
- return CallJsBuiltin(isolate, "ArraySlice", args);
688
- }
689
- if (n_arguments > 1) {
690
- Object* arg2 = args[2];
691
- if (arg2->IsSmi()) {
692
- relative_end = Smi::cast(arg2)->value();
693
- } else if (!arg2->IsUndefined()) {
694
- return CallJsBuiltin(isolate, "ArraySlice", args);
695
- }
696
- }
697
- }
698
-
699
- // ECMAScript 232, 3rd Edition, Section 15.4.4.10, step 6.
700
- int k = (relative_start < 0) ? Max(len + relative_start, 0)
701
- : Min(relative_start, len);
702
-
703
- // ECMAScript 232, 3rd Edition, Section 15.4.4.10, step 8.
704
- int final = (relative_end < 0) ? Max(len + relative_end, 0)
705
- : Min(relative_end, len);
706
-
707
- // Calculate the length of result array.
708
- int result_len = final - k;
709
- if (result_len <= 0) {
710
- return AllocateEmptyJSArray(heap);
711
- }
712
-
713
- Object* result;
714
- { MaybeObject* maybe_result = AllocateJSArray(heap);
715
- if (!maybe_result->ToObject(&result)) return maybe_result;
716
- }
717
- JSArray* result_array = JSArray::cast(result);
718
-
719
- { MaybeObject* maybe_result =
720
- heap->AllocateUninitializedFixedArray(result_len);
721
- if (!maybe_result->ToObject(&result)) return maybe_result;
722
- }
723
- FixedArray* result_elms = FixedArray::cast(result);
724
-
725
- AssertNoAllocation no_gc;
726
- CopyElements(heap, &no_gc, result_elms, 0, elms, k, result_len);
727
-
728
- // Set elements.
729
- result_array->set_elements(result_elms);
730
-
731
- // Set the length.
732
- result_array->set_length(Smi::FromInt(result_len));
733
- return result_array;
734
- }
735
-
736
-
737
- BUILTIN(ArraySplice) {
738
- Heap* heap = isolate->heap();
739
- Object* receiver = *args.receiver();
740
- Object* elms_obj;
741
- { MaybeObject* maybe_elms_obj =
742
- EnsureJSArrayWithWritableFastElements(heap, receiver);
743
- if (maybe_elms_obj == NULL)
744
- return CallJsBuiltin(isolate, "ArraySplice", args);
745
- if (!maybe_elms_obj->ToObject(&elms_obj)) return maybe_elms_obj;
746
- }
747
- if (!IsJSArrayFastElementMovingAllowed(heap, JSArray::cast(receiver))) {
748
- return CallJsBuiltin(isolate, "ArraySplice", args);
749
- }
750
- FixedArray* elms = FixedArray::cast(elms_obj);
751
- JSArray* array = JSArray::cast(receiver);
752
- ASSERT(array->HasFastElements());
753
-
754
- int len = Smi::cast(array->length())->value();
755
-
756
- int n_arguments = args.length() - 1;
757
-
758
- int relative_start = 0;
759
- if (n_arguments > 0) {
760
- Object* arg1 = args[1];
761
- if (arg1->IsSmi()) {
762
- relative_start = Smi::cast(arg1)->value();
763
- } else if (!arg1->IsUndefined()) {
764
- return CallJsBuiltin(isolate, "ArraySplice", args);
765
- }
766
- }
767
- int actual_start = (relative_start < 0) ? Max(len + relative_start, 0)
768
- : Min(relative_start, len);
769
-
770
- // SpiderMonkey, TraceMonkey and JSC treat the case where no delete count is
771
- // given as a request to delete all the elements from the start.
772
- // And it differs from the case of undefined delete count.
773
- // This does not follow ECMA-262, but we do the same for
774
- // compatibility.
775
- int actual_delete_count;
776
- if (n_arguments == 1) {
777
- ASSERT(len - actual_start >= 0);
778
- actual_delete_count = len - actual_start;
779
- } else {
780
- int value = 0; // ToInteger(undefined) == 0
781
- if (n_arguments > 1) {
782
- Object* arg2 = args[2];
783
- if (arg2->IsSmi()) {
784
- value = Smi::cast(arg2)->value();
785
- } else {
786
- return CallJsBuiltin(isolate, "ArraySplice", args);
787
- }
788
- }
789
- actual_delete_count = Min(Max(value, 0), len - actual_start);
790
- }
791
-
792
- JSArray* result_array = NULL;
793
- if (actual_delete_count == 0) {
794
- Object* result;
795
- { MaybeObject* maybe_result = AllocateEmptyJSArray(heap);
796
- if (!maybe_result->ToObject(&result)) return maybe_result;
797
- }
798
- result_array = JSArray::cast(result);
799
- } else {
800
- // Allocate result array.
801
- Object* result;
802
- { MaybeObject* maybe_result = AllocateJSArray(heap);
803
- if (!maybe_result->ToObject(&result)) return maybe_result;
804
- }
805
- result_array = JSArray::cast(result);
806
-
807
- { MaybeObject* maybe_result =
808
- heap->AllocateUninitializedFixedArray(actual_delete_count);
809
- if (!maybe_result->ToObject(&result)) return maybe_result;
810
- }
811
- FixedArray* result_elms = FixedArray::cast(result);
812
-
813
- AssertNoAllocation no_gc;
814
- // Fill newly created array.
815
- CopyElements(heap,
816
- &no_gc,
817
- result_elms, 0,
818
- elms, actual_start,
819
- actual_delete_count);
820
-
821
- // Set elements.
822
- result_array->set_elements(result_elms);
823
-
824
- // Set the length.
825
- result_array->set_length(Smi::FromInt(actual_delete_count));
826
- }
827
-
828
- int item_count = (n_arguments > 1) ? (n_arguments - 2) : 0;
829
-
830
- int new_length = len - actual_delete_count + item_count;
831
-
832
- if (item_count < actual_delete_count) {
833
- // Shrink the array.
834
- const bool trim_array = !heap->lo_space()->Contains(elms) &&
835
- ((actual_start + item_count) <
836
- (len - actual_delete_count - actual_start));
837
- if (trim_array) {
838
- const int delta = actual_delete_count - item_count;
839
-
840
- if (actual_start > 0) {
841
- Object** start = elms->data_start();
842
- memmove(start + delta, start, actual_start * kPointerSize);
843
- }
844
-
845
- elms = LeftTrimFixedArray(heap, elms, delta);
846
- array->set_elements(elms, SKIP_WRITE_BARRIER);
847
- } else {
848
- AssertNoAllocation no_gc;
849
- MoveElements(heap, &no_gc,
850
- elms, actual_start + item_count,
851
- elms, actual_start + actual_delete_count,
852
- (len - actual_delete_count - actual_start));
853
- FillWithHoles(heap, elms, new_length, len);
854
- }
855
- } else if (item_count > actual_delete_count) {
856
- // Currently fixed arrays cannot grow too big, so
857
- // we should never hit this case.
858
- ASSERT((item_count - actual_delete_count) <= (Smi::kMaxValue - len));
859
-
860
- // Check if array need to grow.
861
- if (new_length > elms->length()) {
862
- // New backing storage is needed.
863
- int capacity = new_length + (new_length >> 1) + 16;
864
- Object* obj;
865
- { MaybeObject* maybe_obj =
866
- heap->AllocateUninitializedFixedArray(capacity);
867
- if (!maybe_obj->ToObject(&obj)) return maybe_obj;
868
- }
869
- FixedArray* new_elms = FixedArray::cast(obj);
870
-
871
- AssertNoAllocation no_gc;
872
- // Copy the part before actual_start as is.
873
- if (actual_start > 0) {
874
- CopyElements(heap, &no_gc, new_elms, 0, elms, 0, actual_start);
875
- }
876
- const int to_copy = len - actual_delete_count - actual_start;
877
- if (to_copy > 0) {
878
- CopyElements(heap, &no_gc,
879
- new_elms, actual_start + item_count,
880
- elms, actual_start + actual_delete_count,
881
- to_copy);
882
- }
883
- FillWithHoles(heap, new_elms, new_length, capacity);
884
-
885
- elms = new_elms;
886
- array->set_elements(elms);
887
- } else {
888
- AssertNoAllocation no_gc;
889
- MoveElements(heap, &no_gc,
890
- elms, actual_start + item_count,
891
- elms, actual_start + actual_delete_count,
892
- (len - actual_delete_count - actual_start));
893
- }
894
- }
895
-
896
- AssertNoAllocation no_gc;
897
- WriteBarrierMode mode = elms->GetWriteBarrierMode(no_gc);
898
- for (int k = actual_start; k < actual_start + item_count; k++) {
899
- elms->set(k, args[3 + k - actual_start], mode);
900
- }
901
-
902
- // Set the length.
903
- array->set_length(Smi::FromInt(new_length));
904
-
905
- return result_array;
906
- }
907
-
908
-
909
- BUILTIN(ArrayConcat) {
910
- Heap* heap = isolate->heap();
911
- Context* global_context = isolate->context()->global_context();
912
- JSObject* array_proto =
913
- JSObject::cast(global_context->array_function()->prototype());
914
- if (!ArrayPrototypeHasNoElements(heap, global_context, array_proto)) {
915
- return CallJsBuiltin(isolate, "ArrayConcat", args);
916
- }
917
-
918
- // Iterate through all the arguments performing checks
919
- // and calculating total length.
920
- int n_arguments = args.length();
921
- int result_len = 0;
922
- for (int i = 0; i < n_arguments; i++) {
923
- Object* arg = args[i];
924
- if (!arg->IsJSArray() || !JSArray::cast(arg)->HasFastElements()
925
- || JSArray::cast(arg)->GetPrototype() != array_proto) {
926
- return CallJsBuiltin(isolate, "ArrayConcat", args);
927
- }
928
-
929
- int len = Smi::cast(JSArray::cast(arg)->length())->value();
930
-
931
- // We shouldn't overflow when adding another len.
932
- const int kHalfOfMaxInt = 1 << (kBitsPerInt - 2);
933
- STATIC_ASSERT(FixedArray::kMaxLength < kHalfOfMaxInt);
934
- USE(kHalfOfMaxInt);
935
- result_len += len;
936
- ASSERT(result_len >= 0);
937
-
938
- if (result_len > FixedArray::kMaxLength) {
939
- return CallJsBuiltin(isolate, "ArrayConcat", args);
940
- }
941
- }
942
-
943
- if (result_len == 0) {
944
- return AllocateEmptyJSArray(heap);
945
- }
946
-
947
- // Allocate result.
948
- Object* result;
949
- { MaybeObject* maybe_result = AllocateJSArray(heap);
950
- if (!maybe_result->ToObject(&result)) return maybe_result;
951
- }
952
- JSArray* result_array = JSArray::cast(result);
953
-
954
- { MaybeObject* maybe_result =
955
- heap->AllocateUninitializedFixedArray(result_len);
956
- if (!maybe_result->ToObject(&result)) return maybe_result;
957
- }
958
- FixedArray* result_elms = FixedArray::cast(result);
959
-
960
- // Copy data.
961
- AssertNoAllocation no_gc;
962
- int start_pos = 0;
963
- for (int i = 0; i < n_arguments; i++) {
964
- JSArray* array = JSArray::cast(args[i]);
965
- int len = Smi::cast(array->length())->value();
966
- if (len > 0) {
967
- FixedArray* elms = FixedArray::cast(array->elements());
968
- CopyElements(heap, &no_gc, result_elms, start_pos, elms, 0, len);
969
- start_pos += len;
970
- }
971
- }
972
- ASSERT(start_pos == result_len);
973
-
974
- // Set the length and elements.
975
- result_array->set_length(Smi::FromInt(result_len));
976
- result_array->set_elements(result_elms);
977
-
978
- return result_array;
979
- }
980
-
981
-
982
- // -----------------------------------------------------------------------------
983
- // Strict mode poison pills
984
-
985
-
986
- BUILTIN(StrictArgumentsCallee) {
987
- HandleScope scope;
988
- return isolate->Throw(*isolate->factory()->NewTypeError(
989
- "strict_arguments_callee", HandleVector<Object>(NULL, 0)));
990
- }
991
-
992
-
993
- BUILTIN(StrictArgumentsCaller) {
994
- HandleScope scope;
995
- return isolate->Throw(*isolate->factory()->NewTypeError(
996
- "strict_arguments_caller", HandleVector<Object>(NULL, 0)));
997
- }
998
-
999
-
1000
- BUILTIN(StrictFunctionCaller) {
1001
- HandleScope scope;
1002
- return isolate->Throw(*isolate->factory()->NewTypeError(
1003
- "strict_function_caller", HandleVector<Object>(NULL, 0)));
1004
- }
1005
-
1006
-
1007
- BUILTIN(StrictFunctionArguments) {
1008
- HandleScope scope;
1009
- return isolate->Throw(*isolate->factory()->NewTypeError(
1010
- "strict_function_arguments", HandleVector<Object>(NULL, 0)));
1011
- }
1012
-
1013
-
1014
- // -----------------------------------------------------------------------------
1015
- //
1016
-
1017
-
1018
- // Returns the holder JSObject if the function can legally be called
1019
- // with this receiver. Returns Heap::null_value() if the call is
1020
- // illegal. Any arguments that don't fit the expected type is
1021
- // overwritten with undefined. Arguments that do fit the expected
1022
- // type is overwritten with the object in the prototype chain that
1023
- // actually has that type.
1024
- static inline Object* TypeCheck(Heap* heap,
1025
- int argc,
1026
- Object** argv,
1027
- FunctionTemplateInfo* info) {
1028
- Object* recv = argv[0];
1029
- Object* sig_obj = info->signature();
1030
- if (sig_obj->IsUndefined()) return recv;
1031
- SignatureInfo* sig = SignatureInfo::cast(sig_obj);
1032
- // If necessary, check the receiver
1033
- Object* recv_type = sig->receiver();
1034
-
1035
- Object* holder = recv;
1036
- if (!recv_type->IsUndefined()) {
1037
- for (; holder != heap->null_value(); holder = holder->GetPrototype()) {
1038
- if (holder->IsInstanceOf(FunctionTemplateInfo::cast(recv_type))) {
1039
- break;
1040
- }
1041
- }
1042
- if (holder == heap->null_value()) return holder;
1043
- }
1044
- Object* args_obj = sig->args();
1045
- // If there is no argument signature we're done
1046
- if (args_obj->IsUndefined()) return holder;
1047
- FixedArray* args = FixedArray::cast(args_obj);
1048
- int length = args->length();
1049
- if (argc <= length) length = argc - 1;
1050
- for (int i = 0; i < length; i++) {
1051
- Object* argtype = args->get(i);
1052
- if (argtype->IsUndefined()) continue;
1053
- Object** arg = &argv[-1 - i];
1054
- Object* current = *arg;
1055
- for (; current != heap->null_value(); current = current->GetPrototype()) {
1056
- if (current->IsInstanceOf(FunctionTemplateInfo::cast(argtype))) {
1057
- *arg = current;
1058
- break;
1059
- }
1060
- }
1061
- if (current == heap->null_value()) *arg = heap->undefined_value();
1062
- }
1063
- return holder;
1064
- }
1065
-
1066
-
1067
- template <bool is_construct>
1068
- MUST_USE_RESULT static MaybeObject* HandleApiCallHelper(
1069
- BuiltinArguments<NEEDS_CALLED_FUNCTION> args, Isolate* isolate) {
1070
- ASSERT(is_construct == CalledAsConstructor(isolate));
1071
- Heap* heap = isolate->heap();
1072
-
1073
- HandleScope scope(isolate);
1074
- Handle<JSFunction> function = args.called_function();
1075
- ASSERT(function->shared()->IsApiFunction());
1076
-
1077
- FunctionTemplateInfo* fun_data = function->shared()->get_api_func_data();
1078
- if (is_construct) {
1079
- Handle<FunctionTemplateInfo> desc(fun_data, isolate);
1080
- bool pending_exception = false;
1081
- isolate->factory()->ConfigureInstance(
1082
- desc, Handle<JSObject>::cast(args.receiver()), &pending_exception);
1083
- ASSERT(isolate->has_pending_exception() == pending_exception);
1084
- if (pending_exception) return Failure::Exception();
1085
- fun_data = *desc;
1086
- }
1087
-
1088
- Object* raw_holder = TypeCheck(heap, args.length(), &args[0], fun_data);
1089
-
1090
- if (raw_holder->IsNull()) {
1091
- // This function cannot be called with the given receiver. Abort!
1092
- Handle<Object> obj =
1093
- isolate->factory()->NewTypeError(
1094
- "illegal_invocation", HandleVector(&function, 1));
1095
- return isolate->Throw(*obj);
1096
- }
1097
-
1098
- Object* raw_call_data = fun_data->call_code();
1099
- if (!raw_call_data->IsUndefined()) {
1100
- CallHandlerInfo* call_data = CallHandlerInfo::cast(raw_call_data);
1101
- Object* callback_obj = call_data->callback();
1102
- v8::InvocationCallback callback =
1103
- v8::ToCData<v8::InvocationCallback>(callback_obj);
1104
- Object* data_obj = call_data->data();
1105
- Object* result;
1106
-
1107
- LOG(isolate, ApiObjectAccess("call", JSObject::cast(*args.receiver())));
1108
- ASSERT(raw_holder->IsJSObject());
1109
-
1110
- CustomArguments custom(isolate);
1111
- v8::ImplementationUtilities::PrepareArgumentsData(custom.end(),
1112
- data_obj, *function, raw_holder);
1113
-
1114
- v8::Arguments new_args = v8::ImplementationUtilities::NewArguments(
1115
- custom.end(),
1116
- &args[0] - 1,
1117
- args.length() - 1,
1118
- is_construct);
1119
-
1120
- v8::Handle<v8::Value> value;
1121
- {
1122
- // Leaving JavaScript.
1123
- VMState state(isolate, EXTERNAL);
1124
- ExternalCallbackScope call_scope(isolate,
1125
- v8::ToCData<Address>(callback_obj));
1126
- value = callback(new_args);
1127
- }
1128
- if (value.IsEmpty()) {
1129
- result = heap->undefined_value();
1130
- } else {
1131
- result = *reinterpret_cast<Object**>(*value);
1132
- }
1133
-
1134
- RETURN_IF_SCHEDULED_EXCEPTION(isolate);
1135
- if (!is_construct || result->IsJSObject()) return result;
1136
- }
1137
-
1138
- return *args.receiver();
1139
- }
1140
-
1141
-
1142
- BUILTIN(HandleApiCall) {
1143
- return HandleApiCallHelper<false>(args, isolate);
1144
- }
1145
-
1146
-
1147
- BUILTIN(HandleApiCallConstruct) {
1148
- return HandleApiCallHelper<true>(args, isolate);
1149
- }
1150
-
1151
-
1152
- #ifdef DEBUG
1153
-
1154
- static void VerifyTypeCheck(Handle<JSObject> object,
1155
- Handle<JSFunction> function) {
1156
- ASSERT(function->shared()->IsApiFunction());
1157
- FunctionTemplateInfo* info = function->shared()->get_api_func_data();
1158
- if (info->signature()->IsUndefined()) return;
1159
- SignatureInfo* signature = SignatureInfo::cast(info->signature());
1160
- Object* receiver_type = signature->receiver();
1161
- if (receiver_type->IsUndefined()) return;
1162
- FunctionTemplateInfo* type = FunctionTemplateInfo::cast(receiver_type);
1163
- ASSERT(object->IsInstanceOf(type));
1164
- }
1165
-
1166
- #endif
1167
-
1168
-
1169
- BUILTIN(FastHandleApiCall) {
1170
- ASSERT(!CalledAsConstructor(isolate));
1171
- Heap* heap = isolate->heap();
1172
- const bool is_construct = false;
1173
-
1174
- // We expect four more arguments: callback, function, call data, and holder.
1175
- const int args_length = args.length() - 4;
1176
- ASSERT(args_length >= 0);
1177
-
1178
- Object* callback_obj = args[args_length];
1179
-
1180
- v8::Arguments new_args = v8::ImplementationUtilities::NewArguments(
1181
- &args[args_length + 1],
1182
- &args[0] - 1,
1183
- args_length - 1,
1184
- is_construct);
1185
-
1186
- #ifdef DEBUG
1187
- VerifyTypeCheck(Utils::OpenHandle(*new_args.Holder()),
1188
- Utils::OpenHandle(*new_args.Callee()));
1189
- #endif
1190
- HandleScope scope(isolate);
1191
- Object* result;
1192
- v8::Handle<v8::Value> value;
1193
- {
1194
- // Leaving JavaScript.
1195
- VMState state(isolate, EXTERNAL);
1196
- ExternalCallbackScope call_scope(isolate,
1197
- v8::ToCData<Address>(callback_obj));
1198
- v8::InvocationCallback callback =
1199
- v8::ToCData<v8::InvocationCallback>(callback_obj);
1200
-
1201
- value = callback(new_args);
1202
- }
1203
- if (value.IsEmpty()) {
1204
- result = heap->undefined_value();
1205
- } else {
1206
- result = *reinterpret_cast<Object**>(*value);
1207
- }
1208
-
1209
- RETURN_IF_SCHEDULED_EXCEPTION(isolate);
1210
- return result;
1211
- }
1212
-
1213
-
1214
- // Helper function to handle calls to non-function objects created through the
1215
- // API. The object can be called as either a constructor (using new) or just as
1216
- // a function (without new).
1217
- MUST_USE_RESULT static MaybeObject* HandleApiCallAsFunctionOrConstructor(
1218
- Isolate* isolate,
1219
- bool is_construct_call,
1220
- BuiltinArguments<NO_EXTRA_ARGUMENTS> args) {
1221
- // Non-functions are never called as constructors. Even if this is an object
1222
- // called as a constructor the delegate call is not a construct call.
1223
- ASSERT(!CalledAsConstructor(isolate));
1224
- Heap* heap = isolate->heap();
1225
-
1226
- Handle<Object> receiver = args.at<Object>(0);
1227
-
1228
- // Get the object called.
1229
- JSObject* obj = JSObject::cast(*args.receiver());
1230
-
1231
- // Get the invocation callback from the function descriptor that was
1232
- // used to create the called object.
1233
- ASSERT(obj->map()->has_instance_call_handler());
1234
- JSFunction* constructor = JSFunction::cast(obj->map()->constructor());
1235
- ASSERT(constructor->shared()->IsApiFunction());
1236
- Object* handler =
1237
- constructor->shared()->get_api_func_data()->instance_call_handler();
1238
- ASSERT(!handler->IsUndefined());
1239
- CallHandlerInfo* call_data = CallHandlerInfo::cast(handler);
1240
- Object* callback_obj = call_data->callback();
1241
- v8::InvocationCallback callback =
1242
- v8::ToCData<v8::InvocationCallback>(callback_obj);
1243
-
1244
- // Get the data for the call and perform the callback.
1245
- Object* result;
1246
- {
1247
- HandleScope scope(isolate);
1248
- LOG(isolate, ApiObjectAccess("call non-function", obj));
1249
-
1250
- CustomArguments custom(isolate);
1251
- v8::ImplementationUtilities::PrepareArgumentsData(custom.end(),
1252
- call_data->data(), constructor, obj);
1253
- v8::Arguments new_args = v8::ImplementationUtilities::NewArguments(
1254
- custom.end(),
1255
- &args[0] - 1,
1256
- args.length() - 1,
1257
- is_construct_call);
1258
- v8::Handle<v8::Value> value;
1259
- {
1260
- // Leaving JavaScript.
1261
- VMState state(isolate, EXTERNAL);
1262
- ExternalCallbackScope call_scope(isolate,
1263
- v8::ToCData<Address>(callback_obj));
1264
- value = callback(new_args);
1265
- }
1266
- if (value.IsEmpty()) {
1267
- result = heap->undefined_value();
1268
- } else {
1269
- result = *reinterpret_cast<Object**>(*value);
1270
- }
1271
- }
1272
- // Check for exceptions and return result.
1273
- RETURN_IF_SCHEDULED_EXCEPTION(isolate);
1274
- return result;
1275
- }
1276
-
1277
-
1278
- // Handle calls to non-function objects created through the API. This delegate
1279
- // function is used when the call is a normal function call.
1280
- BUILTIN(HandleApiCallAsFunction) {
1281
- return HandleApiCallAsFunctionOrConstructor(isolate, false, args);
1282
- }
1283
-
1284
-
1285
- // Handle calls to non-function objects created through the API. This delegate
1286
- // function is used when the call is a construct call.
1287
- BUILTIN(HandleApiCallAsConstructor) {
1288
- return HandleApiCallAsFunctionOrConstructor(isolate, true, args);
1289
- }
1290
-
1291
-
1292
- static void Generate_LoadIC_ArrayLength(MacroAssembler* masm) {
1293
- LoadIC::GenerateArrayLength(masm);
1294
- }
1295
-
1296
-
1297
- static void Generate_LoadIC_StringLength(MacroAssembler* masm) {
1298
- LoadIC::GenerateStringLength(masm, false);
1299
- }
1300
-
1301
-
1302
- static void Generate_LoadIC_StringWrapperLength(MacroAssembler* masm) {
1303
- LoadIC::GenerateStringLength(masm, true);
1304
- }
1305
-
1306
-
1307
- static void Generate_LoadIC_FunctionPrototype(MacroAssembler* masm) {
1308
- LoadIC::GenerateFunctionPrototype(masm);
1309
- }
1310
-
1311
-
1312
- static void Generate_LoadIC_Initialize(MacroAssembler* masm) {
1313
- LoadIC::GenerateInitialize(masm);
1314
- }
1315
-
1316
-
1317
- static void Generate_LoadIC_PreMonomorphic(MacroAssembler* masm) {
1318
- LoadIC::GeneratePreMonomorphic(masm);
1319
- }
1320
-
1321
-
1322
- static void Generate_LoadIC_Miss(MacroAssembler* masm) {
1323
- LoadIC::GenerateMiss(masm);
1324
- }
1325
-
1326
-
1327
- static void Generate_LoadIC_Megamorphic(MacroAssembler* masm) {
1328
- LoadIC::GenerateMegamorphic(masm);
1329
- }
1330
-
1331
-
1332
- static void Generate_LoadIC_Normal(MacroAssembler* masm) {
1333
- LoadIC::GenerateNormal(masm);
1334
- }
1335
-
1336
-
1337
- static void Generate_KeyedLoadIC_Initialize(MacroAssembler* masm) {
1338
- KeyedLoadIC::GenerateInitialize(masm);
1339
- }
1340
-
1341
-
1342
- static void Generate_KeyedLoadIC_Miss(MacroAssembler* masm) {
1343
- KeyedLoadIC::GenerateMiss(masm);
1344
- }
1345
-
1346
-
1347
- static void Generate_KeyedLoadIC_Generic(MacroAssembler* masm) {
1348
- KeyedLoadIC::GenerateGeneric(masm);
1349
- }
1350
-
1351
-
1352
- static void Generate_KeyedLoadIC_String(MacroAssembler* masm) {
1353
- KeyedLoadIC::GenerateString(masm);
1354
- }
1355
-
1356
-
1357
- static void Generate_KeyedLoadIC_PreMonomorphic(MacroAssembler* masm) {
1358
- KeyedLoadIC::GeneratePreMonomorphic(masm);
1359
- }
1360
-
1361
- static void Generate_KeyedLoadIC_IndexedInterceptor(MacroAssembler* masm) {
1362
- KeyedLoadIC::GenerateIndexedInterceptor(masm);
1363
- }
1364
-
1365
-
1366
- static void Generate_StoreIC_Initialize(MacroAssembler* masm) {
1367
- StoreIC::GenerateInitialize(masm);
1368
- }
1369
-
1370
-
1371
- static void Generate_StoreIC_Initialize_Strict(MacroAssembler* masm) {
1372
- StoreIC::GenerateInitialize(masm);
1373
- }
1374
-
1375
-
1376
- static void Generate_StoreIC_Miss(MacroAssembler* masm) {
1377
- StoreIC::GenerateMiss(masm);
1378
- }
1379
-
1380
-
1381
- static void Generate_StoreIC_Normal(MacroAssembler* masm) {
1382
- StoreIC::GenerateNormal(masm);
1383
- }
1384
-
1385
-
1386
- static void Generate_StoreIC_Normal_Strict(MacroAssembler* masm) {
1387
- StoreIC::GenerateNormal(masm);
1388
- }
1389
-
1390
-
1391
- static void Generate_StoreIC_Megamorphic(MacroAssembler* masm) {
1392
- StoreIC::GenerateMegamorphic(masm, kNonStrictMode);
1393
- }
1394
-
1395
-
1396
- static void Generate_StoreIC_Megamorphic_Strict(MacroAssembler* masm) {
1397
- StoreIC::GenerateMegamorphic(masm, kStrictMode);
1398
- }
1399
-
1400
-
1401
- static void Generate_StoreIC_ArrayLength(MacroAssembler* masm) {
1402
- StoreIC::GenerateArrayLength(masm);
1403
- }
1404
-
1405
-
1406
- static void Generate_StoreIC_ArrayLength_Strict(MacroAssembler* masm) {
1407
- StoreIC::GenerateArrayLength(masm);
1408
- }
1409
-
1410
-
1411
- static void Generate_StoreIC_GlobalProxy(MacroAssembler* masm) {
1412
- StoreIC::GenerateGlobalProxy(masm, kNonStrictMode);
1413
- }
1414
-
1415
-
1416
- static void Generate_StoreIC_GlobalProxy_Strict(MacroAssembler* masm) {
1417
- StoreIC::GenerateGlobalProxy(masm, kStrictMode);
1418
- }
1419
-
1420
-
1421
- static void Generate_KeyedStoreIC_Generic(MacroAssembler* masm) {
1422
- KeyedStoreIC::GenerateGeneric(masm, kNonStrictMode);
1423
- }
1424
-
1425
-
1426
- static void Generate_KeyedStoreIC_Generic_Strict(MacroAssembler* masm) {
1427
- KeyedStoreIC::GenerateGeneric(masm, kStrictMode);
1428
- }
1429
-
1430
-
1431
- static void Generate_KeyedStoreIC_Miss(MacroAssembler* masm) {
1432
- KeyedStoreIC::GenerateMiss(masm);
1433
- }
1434
-
1435
-
1436
- static void Generate_KeyedStoreIC_Initialize(MacroAssembler* masm) {
1437
- KeyedStoreIC::GenerateInitialize(masm);
1438
- }
1439
-
1440
-
1441
- static void Generate_KeyedStoreIC_Initialize_Strict(MacroAssembler* masm) {
1442
- KeyedStoreIC::GenerateInitialize(masm);
1443
- }
1444
-
1445
-
1446
- #ifdef ENABLE_DEBUGGER_SUPPORT
1447
- static void Generate_LoadIC_DebugBreak(MacroAssembler* masm) {
1448
- Debug::GenerateLoadICDebugBreak(masm);
1449
- }
1450
-
1451
-
1452
- static void Generate_StoreIC_DebugBreak(MacroAssembler* masm) {
1453
- Debug::GenerateStoreICDebugBreak(masm);
1454
- }
1455
-
1456
-
1457
- static void Generate_KeyedLoadIC_DebugBreak(MacroAssembler* masm) {
1458
- Debug::GenerateKeyedLoadICDebugBreak(masm);
1459
- }
1460
-
1461
-
1462
- static void Generate_KeyedStoreIC_DebugBreak(MacroAssembler* masm) {
1463
- Debug::GenerateKeyedStoreICDebugBreak(masm);
1464
- }
1465
-
1466
-
1467
- static void Generate_ConstructCall_DebugBreak(MacroAssembler* masm) {
1468
- Debug::GenerateConstructCallDebugBreak(masm);
1469
- }
1470
-
1471
-
1472
- static void Generate_Return_DebugBreak(MacroAssembler* masm) {
1473
- Debug::GenerateReturnDebugBreak(masm);
1474
- }
1475
-
1476
-
1477
- static void Generate_StubNoRegisters_DebugBreak(MacroAssembler* masm) {
1478
- Debug::GenerateStubNoRegistersDebugBreak(masm);
1479
- }
1480
-
1481
-
1482
- static void Generate_Slot_DebugBreak(MacroAssembler* masm) {
1483
- Debug::GenerateSlotDebugBreak(masm);
1484
- }
1485
-
1486
-
1487
- static void Generate_PlainReturn_LiveEdit(MacroAssembler* masm) {
1488
- Debug::GeneratePlainReturnLiveEdit(masm);
1489
- }
1490
-
1491
-
1492
- static void Generate_FrameDropper_LiveEdit(MacroAssembler* masm) {
1493
- Debug::GenerateFrameDropperLiveEdit(masm);
1494
- }
1495
- #endif
1496
-
1497
-
1498
- Builtins::Builtins() : initialized_(false) {
1499
- memset(builtins_, 0, sizeof(builtins_[0]) * builtin_count);
1500
- memset(names_, 0, sizeof(names_[0]) * builtin_count);
1501
- }
1502
-
1503
-
1504
- Builtins::~Builtins() {
1505
- }
1506
-
1507
-
1508
- #define DEF_ENUM_C(name, ignore) FUNCTION_ADDR(Builtin_##name),
1509
- Address const Builtins::c_functions_[cfunction_count] = {
1510
- BUILTIN_LIST_C(DEF_ENUM_C)
1511
- };
1512
- #undef DEF_ENUM_C
1513
-
1514
- #define DEF_JS_NAME(name, ignore) #name,
1515
- #define DEF_JS_ARGC(ignore, argc) argc,
1516
- const char* const Builtins::javascript_names_[id_count] = {
1517
- BUILTINS_LIST_JS(DEF_JS_NAME)
1518
- };
1519
-
1520
- int const Builtins::javascript_argc_[id_count] = {
1521
- BUILTINS_LIST_JS(DEF_JS_ARGC)
1522
- };
1523
- #undef DEF_JS_NAME
1524
- #undef DEF_JS_ARGC
1525
-
1526
- struct BuiltinDesc {
1527
- byte* generator;
1528
- byte* c_code;
1529
- const char* s_name; // name is only used for generating log information.
1530
- int name;
1531
- Code::Flags flags;
1532
- BuiltinExtraArguments extra_args;
1533
- };
1534
-
1535
- class BuiltinFunctionTable {
1536
- public:
1537
- BuiltinFunctionTable() {
1538
- Builtins::InitBuiltinFunctionTable();
1539
- }
1540
-
1541
- static const BuiltinDesc* functions() { return functions_; }
1542
-
1543
- private:
1544
- static BuiltinDesc functions_[Builtins::builtin_count + 1];
1545
-
1546
- friend class Builtins;
1547
- };
1548
-
1549
- BuiltinDesc BuiltinFunctionTable::functions_[Builtins::builtin_count + 1];
1550
-
1551
- static const BuiltinFunctionTable builtin_function_table_init;
1552
-
1553
- // Define array of pointers to generators and C builtin functions.
1554
- // We do this in a sort of roundabout way so that we can do the initialization
1555
- // within the lexical scope of Builtins:: and within a context where
1556
- // Code::Flags names a non-abstract type.
1557
- void Builtins::InitBuiltinFunctionTable() {
1558
- BuiltinDesc* functions = BuiltinFunctionTable::functions_;
1559
- functions[builtin_count].generator = NULL;
1560
- functions[builtin_count].c_code = NULL;
1561
- functions[builtin_count].s_name = NULL;
1562
- functions[builtin_count].name = builtin_count;
1563
- functions[builtin_count].flags = static_cast<Code::Flags>(0);
1564
- functions[builtin_count].extra_args = NO_EXTRA_ARGUMENTS;
1565
-
1566
- #define DEF_FUNCTION_PTR_C(aname, aextra_args) \
1567
- functions->generator = FUNCTION_ADDR(Generate_Adaptor); \
1568
- functions->c_code = FUNCTION_ADDR(Builtin_##aname); \
1569
- functions->s_name = #aname; \
1570
- functions->name = c_##aname; \
1571
- functions->flags = Code::ComputeFlags(Code::BUILTIN); \
1572
- functions->extra_args = aextra_args; \
1573
- ++functions;
1574
-
1575
- #define DEF_FUNCTION_PTR_A(aname, kind, state, extra) \
1576
- functions->generator = FUNCTION_ADDR(Generate_##aname); \
1577
- functions->c_code = NULL; \
1578
- functions->s_name = #aname; \
1579
- functions->name = k##aname; \
1580
- functions->flags = Code::ComputeFlags(Code::kind, \
1581
- NOT_IN_LOOP, \
1582
- state, \
1583
- extra); \
1584
- functions->extra_args = NO_EXTRA_ARGUMENTS; \
1585
- ++functions;
1586
-
1587
- BUILTIN_LIST_C(DEF_FUNCTION_PTR_C)
1588
- BUILTIN_LIST_A(DEF_FUNCTION_PTR_A)
1589
- BUILTIN_LIST_DEBUG_A(DEF_FUNCTION_PTR_A)
1590
-
1591
- #undef DEF_FUNCTION_PTR_C
1592
- #undef DEF_FUNCTION_PTR_A
1593
- }
1594
-
1595
- void Builtins::Setup(bool create_heap_objects) {
1596
- ASSERT(!initialized_);
1597
- Isolate* isolate = Isolate::Current();
1598
- Heap* heap = isolate->heap();
1599
-
1600
- // Create a scope for the handles in the builtins.
1601
- HandleScope scope(isolate);
1602
-
1603
- const BuiltinDesc* functions = BuiltinFunctionTable::functions();
1604
-
1605
- // For now we generate builtin adaptor code into a stack-allocated
1606
- // buffer, before copying it into individual code objects.
1607
- byte buffer[4*KB];
1608
-
1609
- // Traverse the list of builtins and generate an adaptor in a
1610
- // separate code object for each one.
1611
- for (int i = 0; i < builtin_count; i++) {
1612
- if (create_heap_objects) {
1613
- MacroAssembler masm(isolate, buffer, sizeof buffer);
1614
- // Generate the code/adaptor.
1615
- typedef void (*Generator)(MacroAssembler*, int, BuiltinExtraArguments);
1616
- Generator g = FUNCTION_CAST<Generator>(functions[i].generator);
1617
- // We pass all arguments to the generator, but it may not use all of
1618
- // them. This works because the first arguments are on top of the
1619
- // stack.
1620
- g(&masm, functions[i].name, functions[i].extra_args);
1621
- // Move the code into the object heap.
1622
- CodeDesc desc;
1623
- masm.GetCode(&desc);
1624
- Code::Flags flags = functions[i].flags;
1625
- Object* code = NULL;
1626
- {
1627
- // During startup it's OK to always allocate and defer GC to later.
1628
- // This simplifies things because we don't need to retry.
1629
- AlwaysAllocateScope __scope__;
1630
- { MaybeObject* maybe_code =
1631
- heap->CreateCode(desc, flags, masm.CodeObject());
1632
- if (!maybe_code->ToObject(&code)) {
1633
- v8::internal::V8::FatalProcessOutOfMemory("CreateCode");
1634
- }
1635
- }
1636
- }
1637
- // Log the event and add the code to the builtins array.
1638
- PROFILE(isolate,
1639
- CodeCreateEvent(Logger::BUILTIN_TAG,
1640
- Code::cast(code),
1641
- functions[i].s_name));
1642
- GDBJIT(AddCode(GDBJITInterface::BUILTIN,
1643
- functions[i].s_name,
1644
- Code::cast(code)));
1645
- builtins_[i] = code;
1646
- #ifdef ENABLE_DISASSEMBLER
1647
- if (FLAG_print_builtin_code) {
1648
- PrintF("Builtin: %s\n", functions[i].s_name);
1649
- Code::cast(code)->Disassemble(functions[i].s_name);
1650
- PrintF("\n");
1651
- }
1652
- #endif
1653
- } else {
1654
- // Deserializing. The values will be filled in during IterateBuiltins.
1655
- builtins_[i] = NULL;
1656
- }
1657
- names_[i] = functions[i].s_name;
1658
- }
1659
-
1660
- // Mark as initialized.
1661
- initialized_ = true;
1662
- }
1663
-
1664
-
1665
- void Builtins::TearDown() {
1666
- initialized_ = false;
1667
- }
1668
-
1669
-
1670
- void Builtins::IterateBuiltins(ObjectVisitor* v) {
1671
- v->VisitPointers(&builtins_[0], &builtins_[0] + builtin_count);
1672
- }
1673
-
1674
-
1675
- const char* Builtins::Lookup(byte* pc) {
1676
- // may be called during initialization (disassembler!)
1677
- if (initialized_) {
1678
- for (int i = 0; i < builtin_count; i++) {
1679
- Code* entry = Code::cast(builtins_[i]);
1680
- if (entry->contains(pc)) {
1681
- return names_[i];
1682
- }
1683
- }
1684
- }
1685
- return NULL;
1686
- }
1687
-
1688
-
1689
- #define DEFINE_BUILTIN_ACCESSOR_C(name, ignore) \
1690
- Handle<Code> Builtins::name() { \
1691
- Code** code_address = \
1692
- reinterpret_cast<Code**>(builtin_address(k##name)); \
1693
- return Handle<Code>(code_address); \
1694
- }
1695
- #define DEFINE_BUILTIN_ACCESSOR_A(name, kind, state, extra) \
1696
- Handle<Code> Builtins::name() { \
1697
- Code** code_address = \
1698
- reinterpret_cast<Code**>(builtin_address(k##name)); \
1699
- return Handle<Code>(code_address); \
1700
- }
1701
- BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1702
- BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1703
- BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1704
- #undef DEFINE_BUILTIN_ACCESSOR_C
1705
- #undef DEFINE_BUILTIN_ACCESSOR_A
1706
-
1707
-
1708
- } } // namespace v8::internal