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,130 +0,0 @@
1
- // Copyright 2006-2008 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #ifndef V8_IC_INL_H_
29
- #define V8_IC_INL_H_
30
-
31
- #include "ic.h"
32
- #include "debug.h"
33
- #include "macro-assembler.h"
34
-
35
- namespace v8 {
36
- namespace internal {
37
-
38
-
39
- Address IC::address() {
40
- // Get the address of the call.
41
- Address result = pc() - Assembler::kCallTargetAddressOffset;
42
-
43
- #ifdef ENABLE_DEBUGGER_SUPPORT
44
- Debug* debug = Isolate::Current()->debug();
45
- // First check if any break points are active if not just return the address
46
- // of the call.
47
- if (!debug->has_break_points()) return result;
48
-
49
- // At least one break point is active perform additional test to ensure that
50
- // break point locations are updated correctly.
51
- if (debug->IsDebugBreak(Assembler::target_address_at(result))) {
52
- // If the call site is a call to debug break then return the address in
53
- // the original code instead of the address in the running code. This will
54
- // cause the original code to be updated and keeps the breakpoint active in
55
- // the running code.
56
- return OriginalCodeAddress();
57
- } else {
58
- // No break point here just return the address of the call.
59
- return result;
60
- }
61
- #else
62
- return result;
63
- #endif
64
- }
65
-
66
-
67
- Code* IC::GetTargetAtAddress(Address address) {
68
- // Get the target address of the IC.
69
- Address target = Assembler::target_address_at(address);
70
- // Convert target address to the code object. Code::GetCodeFromTargetAddress
71
- // is safe for use during GC where the map might be marked.
72
- Code* result = Code::GetCodeFromTargetAddress(target);
73
- ASSERT(result->is_inline_cache_stub());
74
- return result;
75
- }
76
-
77
-
78
- void IC::SetTargetAtAddress(Address address, Code* target) {
79
- ASSERT(target->is_inline_cache_stub() || target->is_compare_ic_stub());
80
- #ifdef DEBUG
81
- // STORE_IC and KEYED_STORE_IC use Code::extra_ic_state() to mark
82
- // ICs as strict mode. The strict-ness of the IC must be preserved.
83
- Code* old_target = GetTargetAtAddress(address);
84
- if (old_target->kind() == Code::STORE_IC ||
85
- old_target->kind() == Code::KEYED_STORE_IC) {
86
- ASSERT(old_target->extra_ic_state() == target->extra_ic_state());
87
- }
88
- #endif
89
- Assembler::set_target_address_at(address, target->instruction_start());
90
- }
91
-
92
-
93
- InlineCacheHolderFlag IC::GetCodeCacheForObject(Object* object,
94
- JSObject* holder) {
95
- if (object->IsJSObject()) {
96
- return GetCodeCacheForObject(JSObject::cast(object), holder);
97
- }
98
- // If the object is a value, we use the prototype map for the cache.
99
- ASSERT(object->IsString() || object->IsNumber() || object->IsBoolean());
100
- return PROTOTYPE_MAP;
101
- }
102
-
103
-
104
- InlineCacheHolderFlag IC::GetCodeCacheForObject(JSObject* object,
105
- JSObject* holder) {
106
- // Fast-properties and global objects store stubs in their own maps.
107
- // Slow properties objects use prototype's map (unless the property is its own
108
- // when holder == object). It works because slow properties objects having
109
- // the same prototype (or a prototype with the same map) and not having
110
- // the property are interchangeable for such a stub.
111
- if (holder != object &&
112
- !object->HasFastProperties() &&
113
- !object->IsJSGlobalProxy() &&
114
- !object->IsJSGlobalObject()) {
115
- return PROTOTYPE_MAP;
116
- }
117
- return OWN_MAP;
118
- }
119
-
120
-
121
- JSObject* IC::GetCodeCacheHolder(Object* object, InlineCacheHolderFlag holder) {
122
- Object* map_owner = (holder == OWN_MAP ? object : object->GetPrototype());
123
- ASSERT(map_owner->IsJSObject());
124
- return JSObject::cast(map_owner);
125
- }
126
-
127
-
128
- } } // namespace v8::internal
129
-
130
- #endif // V8_IC_INL_H_
@@ -1,2389 +0,0 @@
1
- // Copyright 2006-2009 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #include "v8.h"
29
-
30
- #include "accessors.h"
31
- #include "api.h"
32
- #include "arguments.h"
33
- #include "codegen.h"
34
- #include "execution.h"
35
- #include "ic-inl.h"
36
- #include "runtime.h"
37
- #include "stub-cache.h"
38
-
39
- namespace v8 {
40
- namespace internal {
41
-
42
- #ifdef DEBUG
43
- static char TransitionMarkFromState(IC::State state) {
44
- switch (state) {
45
- case UNINITIALIZED: return '0';
46
- case PREMONOMORPHIC: return 'P';
47
- case MONOMORPHIC: return '1';
48
- case MONOMORPHIC_PROTOTYPE_FAILURE: return '^';
49
- case MEGAMORPHIC: return 'N';
50
-
51
- // We never see the debugger states here, because the state is
52
- // computed from the original code - not the patched code. Let
53
- // these cases fall through to the unreachable code below.
54
- case DEBUG_BREAK: break;
55
- case DEBUG_PREPARE_STEP_IN: break;
56
- }
57
- UNREACHABLE();
58
- return 0;
59
- }
60
-
61
- void IC::TraceIC(const char* type,
62
- Handle<Object> name,
63
- State old_state,
64
- Code* new_target,
65
- const char* extra_info) {
66
- if (FLAG_trace_ic) {
67
- State new_state = StateFrom(new_target,
68
- HEAP->undefined_value(),
69
- HEAP->undefined_value());
70
- PrintF("[%s (%c->%c)%s", type,
71
- TransitionMarkFromState(old_state),
72
- TransitionMarkFromState(new_state),
73
- extra_info);
74
- name->Print();
75
- PrintF("]\n");
76
- }
77
- }
78
- #endif
79
-
80
-
81
- IC::IC(FrameDepth depth, Isolate* isolate) : isolate_(isolate) {
82
- ASSERT(isolate == Isolate::Current());
83
- // To improve the performance of the (much used) IC code, we unfold
84
- // a few levels of the stack frame iteration code. This yields a
85
- // ~35% speedup when running DeltaBlue with the '--nouse-ic' flag.
86
- const Address entry =
87
- Isolate::c_entry_fp(isolate->thread_local_top());
88
- Address* pc_address =
89
- reinterpret_cast<Address*>(entry + ExitFrameConstants::kCallerPCOffset);
90
- Address fp = Memory::Address_at(entry + ExitFrameConstants::kCallerFPOffset);
91
- // If there's another JavaScript frame on the stack, we need to look
92
- // one frame further down the stack to find the frame pointer and
93
- // the return address stack slot.
94
- if (depth == EXTRA_CALL_FRAME) {
95
- const int kCallerPCOffset = StandardFrameConstants::kCallerPCOffset;
96
- pc_address = reinterpret_cast<Address*>(fp + kCallerPCOffset);
97
- fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset);
98
- }
99
- #ifdef DEBUG
100
- StackFrameIterator it;
101
- for (int i = 0; i < depth + 1; i++) it.Advance();
102
- StackFrame* frame = it.frame();
103
- ASSERT(fp == frame->fp() && pc_address == frame->pc_address());
104
- #endif
105
- fp_ = fp;
106
- pc_address_ = pc_address;
107
- }
108
-
109
-
110
- #ifdef ENABLE_DEBUGGER_SUPPORT
111
- Address IC::OriginalCodeAddress() {
112
- HandleScope scope;
113
- // Compute the JavaScript frame for the frame pointer of this IC
114
- // structure. We need this to be able to find the function
115
- // corresponding to the frame.
116
- StackFrameIterator it;
117
- while (it.frame()->fp() != this->fp()) it.Advance();
118
- JavaScriptFrame* frame = JavaScriptFrame::cast(it.frame());
119
- // Find the function on the stack and both the active code for the
120
- // function and the original code.
121
- JSFunction* function = JSFunction::cast(frame->function());
122
- Handle<SharedFunctionInfo> shared(function->shared());
123
- Code* code = shared->code();
124
- ASSERT(Debug::HasDebugInfo(shared));
125
- Code* original_code = Debug::GetDebugInfo(shared)->original_code();
126
- ASSERT(original_code->IsCode());
127
- // Get the address of the call site in the active code. This is the
128
- // place where the call to DebugBreakXXX is and where the IC
129
- // normally would be.
130
- Address addr = pc() - Assembler::kCallTargetAddressOffset;
131
- // Return the address in the original code. This is the place where
132
- // the call which has been overwritten by the DebugBreakXXX resides
133
- // and the place where the inline cache system should look.
134
- intptr_t delta =
135
- original_code->instruction_start() - code->instruction_start();
136
- return addr + delta;
137
- }
138
- #endif
139
-
140
-
141
- static bool HasNormalObjectsInPrototypeChain(Isolate* isolate,
142
- LookupResult* lookup,
143
- Object* receiver) {
144
- Object* end = lookup->IsProperty()
145
- ? lookup->holder() : isolate->heap()->null_value();
146
- for (Object* current = receiver;
147
- current != end;
148
- current = current->GetPrototype()) {
149
- if (current->IsJSObject() &&
150
- !JSObject::cast(current)->HasFastProperties() &&
151
- !current->IsJSGlobalProxy() &&
152
- !current->IsJSGlobalObject()) {
153
- return true;
154
- }
155
- }
156
-
157
- return false;
158
- }
159
-
160
-
161
- static bool TryRemoveInvalidPrototypeDependentStub(Code* target,
162
- Object* receiver,
163
- Object* name) {
164
- InlineCacheHolderFlag cache_holder =
165
- Code::ExtractCacheHolderFromFlags(target->flags());
166
-
167
- if (cache_holder == OWN_MAP && !receiver->IsJSObject()) {
168
- // The stub was generated for JSObject but called for non-JSObject.
169
- // IC::GetCodeCacheHolder is not applicable.
170
- return false;
171
- } else if (cache_holder == PROTOTYPE_MAP &&
172
- receiver->GetPrototype()->IsNull()) {
173
- // IC::GetCodeCacheHolder is not applicable.
174
- return false;
175
- }
176
- Map* map = IC::GetCodeCacheHolder(receiver, cache_holder)->map();
177
-
178
- // Decide whether the inline cache failed because of changes to the
179
- // receiver itself or changes to one of its prototypes.
180
- //
181
- // If there are changes to the receiver itself, the map of the
182
- // receiver will have changed and the current target will not be in
183
- // the receiver map's code cache. Therefore, if the current target
184
- // is in the receiver map's code cache, the inline cache failed due
185
- // to prototype check failure.
186
- int index = map->IndexInCodeCache(name, target);
187
- if (index >= 0) {
188
- map->RemoveFromCodeCache(String::cast(name), target, index);
189
- return true;
190
- }
191
-
192
- return false;
193
- }
194
-
195
-
196
- IC::State IC::StateFrom(Code* target, Object* receiver, Object* name) {
197
- IC::State state = target->ic_state();
198
-
199
- if (state != MONOMORPHIC || !name->IsString()) return state;
200
- if (receiver->IsUndefined() || receiver->IsNull()) return state;
201
-
202
- // For keyed load/store/call, the most likely cause of cache failure is
203
- // that the key has changed. We do not distinguish between
204
- // prototype and non-prototype failures for keyed access.
205
- Code::Kind kind = target->kind();
206
- if (kind == Code::KEYED_LOAD_IC ||
207
- kind == Code::KEYED_STORE_IC ||
208
- kind == Code::KEYED_CALL_IC) {
209
- return MONOMORPHIC;
210
- }
211
-
212
- // Remove the target from the code cache if it became invalid
213
- // because of changes in the prototype chain to avoid hitting it
214
- // again.
215
- // Call stubs handle this later to allow extra IC state
216
- // transitions.
217
- if (kind != Code::CALL_IC &&
218
- TryRemoveInvalidPrototypeDependentStub(target, receiver, name)) {
219
- return MONOMORPHIC_PROTOTYPE_FAILURE;
220
- }
221
-
222
- // The builtins object is special. It only changes when JavaScript
223
- // builtins are loaded lazily. It is important to keep inline
224
- // caches for the builtins object monomorphic. Therefore, if we get
225
- // an inline cache miss for the builtins object after lazily loading
226
- // JavaScript builtins, we return uninitialized as the state to
227
- // force the inline cache back to monomorphic state.
228
- if (receiver->IsJSBuiltinsObject()) {
229
- return UNINITIALIZED;
230
- }
231
-
232
- return MONOMORPHIC;
233
- }
234
-
235
-
236
- RelocInfo::Mode IC::ComputeMode() {
237
- Address addr = address();
238
- Code* code = Code::cast(isolate()->heap()->FindCodeObject(addr));
239
- for (RelocIterator it(code, RelocInfo::kCodeTargetMask);
240
- !it.done(); it.next()) {
241
- RelocInfo* info = it.rinfo();
242
- if (info->pc() == addr) return info->rmode();
243
- }
244
- UNREACHABLE();
245
- return RelocInfo::NONE;
246
- }
247
-
248
-
249
- Failure* IC::TypeError(const char* type,
250
- Handle<Object> object,
251
- Handle<Object> key) {
252
- HandleScope scope(isolate());
253
- Handle<Object> args[2] = { key, object };
254
- Handle<Object> error = isolate()->factory()->NewTypeError(
255
- type, HandleVector(args, 2));
256
- return isolate()->Throw(*error);
257
- }
258
-
259
-
260
- Failure* IC::ReferenceError(const char* type, Handle<String> name) {
261
- HandleScope scope(isolate());
262
- Handle<Object> error = isolate()->factory()->NewReferenceError(
263
- type, HandleVector(&name, 1));
264
- return isolate()->Throw(*error);
265
- }
266
-
267
-
268
- void IC::Clear(Address address) {
269
- Code* target = GetTargetAtAddress(address);
270
-
271
- // Don't clear debug break inline cache as it will remove the break point.
272
- if (target->ic_state() == DEBUG_BREAK) return;
273
-
274
- switch (target->kind()) {
275
- case Code::LOAD_IC: return LoadIC::Clear(address, target);
276
- case Code::KEYED_LOAD_IC:
277
- case Code::KEYED_EXTERNAL_ARRAY_LOAD_IC:
278
- return KeyedLoadIC::Clear(address, target);
279
- case Code::STORE_IC: return StoreIC::Clear(address, target);
280
- case Code::KEYED_STORE_IC:
281
- case Code::KEYED_EXTERNAL_ARRAY_STORE_IC:
282
- return KeyedStoreIC::Clear(address, target);
283
- case Code::CALL_IC: return CallIC::Clear(address, target);
284
- case Code::KEYED_CALL_IC: return KeyedCallIC::Clear(address, target);
285
- case Code::BINARY_OP_IC:
286
- case Code::TYPE_RECORDING_BINARY_OP_IC:
287
- case Code::COMPARE_IC:
288
- // Clearing these is tricky and does not
289
- // make any performance difference.
290
- return;
291
- default: UNREACHABLE();
292
- }
293
- }
294
-
295
-
296
- void CallICBase::Clear(Address address, Code* target) {
297
- State state = target->ic_state();
298
- if (state == UNINITIALIZED) return;
299
- Code* code =
300
- Isolate::Current()->stub_cache()->FindCallInitialize(
301
- target->arguments_count(),
302
- target->ic_in_loop(),
303
- target->kind());
304
- SetTargetAtAddress(address, code);
305
- }
306
-
307
-
308
- void KeyedLoadIC::ClearInlinedVersion(Address address) {
309
- // Insert null as the map to check for to make sure the map check fails
310
- // sending control flow to the IC instead of the inlined version.
311
- PatchInlinedLoad(address, HEAP->null_value());
312
- }
313
-
314
-
315
- void KeyedLoadIC::Clear(Address address, Code* target) {
316
- if (target->ic_state() == UNINITIALIZED) return;
317
- // Make sure to also clear the map used in inline fast cases. If we
318
- // do not clear these maps, cached code can keep objects alive
319
- // through the embedded maps.
320
- ClearInlinedVersion(address);
321
- SetTargetAtAddress(address, initialize_stub());
322
- }
323
-
324
-
325
- void LoadIC::ClearInlinedVersion(Address address) {
326
- // Reset the map check of the inlined inobject property load (if
327
- // present) to guarantee failure by holding an invalid map (the null
328
- // value). The offset can be patched to anything.
329
- Heap* heap = HEAP;
330
- PatchInlinedLoad(address, heap->null_value(), 0);
331
- PatchInlinedContextualLoad(address,
332
- heap->null_value(),
333
- heap->null_value(),
334
- true);
335
- }
336
-
337
-
338
- void LoadIC::Clear(Address address, Code* target) {
339
- if (target->ic_state() == UNINITIALIZED) return;
340
- ClearInlinedVersion(address);
341
- SetTargetAtAddress(address, initialize_stub());
342
- }
343
-
344
-
345
- void StoreIC::ClearInlinedVersion(Address address) {
346
- // Reset the map check of the inlined inobject property store (if
347
- // present) to guarantee failure by holding an invalid map (the null
348
- // value). The offset can be patched to anything.
349
- PatchInlinedStore(address, HEAP->null_value(), 0);
350
- }
351
-
352
-
353
- void StoreIC::Clear(Address address, Code* target) {
354
- if (target->ic_state() == UNINITIALIZED) return;
355
- ClearInlinedVersion(address);
356
- SetTargetAtAddress(address,
357
- (target->extra_ic_state() == kStrictMode)
358
- ? initialize_stub_strict()
359
- : initialize_stub());
360
- }
361
-
362
-
363
- void KeyedStoreIC::ClearInlinedVersion(Address address) {
364
- // Insert null as the elements map to check for. This will make
365
- // sure that the elements fast-case map check fails so that control
366
- // flows to the IC instead of the inlined version.
367
- PatchInlinedStore(address, HEAP->null_value());
368
- }
369
-
370
-
371
- void KeyedStoreIC::RestoreInlinedVersion(Address address) {
372
- // Restore the fast-case elements map check so that the inlined
373
- // version can be used again.
374
- PatchInlinedStore(address, HEAP->fixed_array_map());
375
- }
376
-
377
-
378
- void KeyedStoreIC::Clear(Address address, Code* target) {
379
- if (target->ic_state() == UNINITIALIZED) return;
380
- SetTargetAtAddress(address,
381
- (target->extra_ic_state() == kStrictMode)
382
- ? initialize_stub_strict()
383
- : initialize_stub());
384
- }
385
-
386
-
387
- static bool HasInterceptorGetter(JSObject* object) {
388
- return !object->GetNamedInterceptor()->getter()->IsUndefined();
389
- }
390
-
391
-
392
- static void LookupForRead(Object* object,
393
- String* name,
394
- LookupResult* lookup) {
395
- AssertNoAllocation no_gc; // pointers must stay valid
396
-
397
- // Skip all the objects with named interceptors, but
398
- // without actual getter.
399
- while (true) {
400
- object->Lookup(name, lookup);
401
- // Besides normal conditions (property not found or it's not
402
- // an interceptor), bail out if lookup is not cacheable: we won't
403
- // be able to IC it anyway and regular lookup should work fine.
404
- if (!lookup->IsFound()
405
- || (lookup->type() != INTERCEPTOR)
406
- || !lookup->IsCacheable()) {
407
- return;
408
- }
409
-
410
- JSObject* holder = lookup->holder();
411
- if (HasInterceptorGetter(holder)) {
412
- return;
413
- }
414
-
415
- holder->LocalLookupRealNamedProperty(name, lookup);
416
- if (lookup->IsProperty()) {
417
- ASSERT(lookup->type() != INTERCEPTOR);
418
- return;
419
- }
420
-
421
- Object* proto = holder->GetPrototype();
422
- if (proto->IsNull()) {
423
- lookup->NotFound();
424
- return;
425
- }
426
-
427
- object = proto;
428
- }
429
- }
430
-
431
-
432
- Object* CallICBase::TryCallAsFunction(Object* object) {
433
- HandleScope scope(isolate());
434
- Handle<Object> target(object, isolate());
435
- Handle<Object> delegate = Execution::GetFunctionDelegate(target);
436
-
437
- if (delegate->IsJSFunction()) {
438
- // Patch the receiver and use the delegate as the function to
439
- // invoke. This is used for invoking objects as if they were
440
- // functions.
441
- const int argc = this->target()->arguments_count();
442
- StackFrameLocator locator;
443
- JavaScriptFrame* frame = locator.FindJavaScriptFrame(0);
444
- int index = frame->ComputeExpressionsCount() - (argc + 1);
445
- frame->SetExpression(index, *target);
446
- }
447
-
448
- return *delegate;
449
- }
450
-
451
-
452
- void CallICBase::ReceiverToObjectIfRequired(Handle<Object> callee,
453
- Handle<Object> object) {
454
- if (callee->IsJSFunction()) {
455
- Handle<JSFunction> function = Handle<JSFunction>::cast(callee);
456
- if (function->shared()->strict_mode() || function->IsBuiltin()) {
457
- // Do not wrap receiver for strict mode functions or for builtins.
458
- return;
459
- }
460
- }
461
-
462
- // And only wrap string, number or boolean.
463
- if (object->IsString() || object->IsNumber() || object->IsBoolean()) {
464
- // Change the receiver to the result of calling ToObject on it.
465
- const int argc = this->target()->arguments_count();
466
- StackFrameLocator locator;
467
- JavaScriptFrame* frame = locator.FindJavaScriptFrame(0);
468
- int index = frame->ComputeExpressionsCount() - (argc + 1);
469
- frame->SetExpression(index, *isolate()->factory()->ToObject(object));
470
- }
471
- }
472
-
473
-
474
- MaybeObject* CallICBase::LoadFunction(State state,
475
- Code::ExtraICState extra_ic_state,
476
- Handle<Object> object,
477
- Handle<String> name) {
478
- // If the object is undefined or null it's illegal to try to get any
479
- // of its properties; throw a TypeError in that case.
480
- if (object->IsUndefined() || object->IsNull()) {
481
- return TypeError("non_object_property_call", object, name);
482
- }
483
-
484
- // Check if the name is trivially convertible to an index and get
485
- // the element if so.
486
- uint32_t index;
487
- if (name->AsArrayIndex(&index)) {
488
- Object* result;
489
- { MaybeObject* maybe_result = object->GetElement(index);
490
- if (!maybe_result->ToObject(&result)) return maybe_result;
491
- }
492
-
493
- if (result->IsJSFunction()) return result;
494
-
495
- // Try to find a suitable function delegate for the object at hand.
496
- result = TryCallAsFunction(result);
497
- if (result->IsJSFunction()) return result;
498
-
499
- // Otherwise, it will fail in the lookup step.
500
- }
501
-
502
- // Lookup the property in the object.
503
- LookupResult lookup;
504
- LookupForRead(*object, *name, &lookup);
505
-
506
- if (!lookup.IsProperty()) {
507
- // If the object does not have the requested property, check which
508
- // exception we need to throw.
509
- if (IsContextual(object)) {
510
- return ReferenceError("not_defined", name);
511
- }
512
- return TypeError("undefined_method", object, name);
513
- }
514
-
515
- // Lookup is valid: Update inline cache and stub cache.
516
- if (FLAG_use_ic) {
517
- UpdateCaches(&lookup, state, extra_ic_state, object, name);
518
- }
519
-
520
- // Get the property.
521
- PropertyAttributes attr;
522
- Object* result;
523
- { MaybeObject* maybe_result =
524
- object->GetProperty(*object, &lookup, *name, &attr);
525
- if (!maybe_result->ToObject(&result)) return maybe_result;
526
- }
527
-
528
- if (lookup.type() == INTERCEPTOR) {
529
- // If the object does not have the requested property, check which
530
- // exception we need to throw.
531
- if (attr == ABSENT) {
532
- if (IsContextual(object)) {
533
- return ReferenceError("not_defined", name);
534
- }
535
- return TypeError("undefined_method", object, name);
536
- }
537
- }
538
-
539
- ASSERT(!result->IsTheHole());
540
-
541
- HandleScope scope(isolate());
542
- // Wrap result in a handle because ReceiverToObjectIfRequired may allocate
543
- // new object and cause GC.
544
- Handle<Object> result_handle(result);
545
- // Make receiver an object if the callee requires it. Strict mode or builtin
546
- // functions do not wrap the receiver, non-strict functions and objects
547
- // called as functions do.
548
- ReceiverToObjectIfRequired(result_handle, object);
549
-
550
- if (result_handle->IsJSFunction()) {
551
- #ifdef ENABLE_DEBUGGER_SUPPORT
552
- // Handle stepping into a function if step into is active.
553
- Debug* debug = isolate()->debug();
554
- if (debug->StepInActive()) {
555
- // Protect the result in a handle as the debugger can allocate and might
556
- // cause GC.
557
- Handle<JSFunction> function(JSFunction::cast(*result_handle), isolate());
558
- debug->HandleStepIn(function, object, fp(), false);
559
- return *function;
560
- }
561
- #endif
562
-
563
- return *result_handle;
564
- }
565
-
566
- // Try to find a suitable function delegate for the object at hand.
567
- result_handle = Handle<Object>(TryCallAsFunction(*result_handle));
568
- if (result_handle->IsJSFunction()) return *result_handle;
569
-
570
- return TypeError("property_not_function", object, name);
571
- }
572
-
573
-
574
- bool CallICBase::TryUpdateExtraICState(LookupResult* lookup,
575
- Handle<Object> object,
576
- Code::ExtraICState* extra_ic_state) {
577
- ASSERT(kind_ == Code::CALL_IC);
578
- if (lookup->type() != CONSTANT_FUNCTION) return false;
579
- JSFunction* function = lookup->GetConstantFunction();
580
- if (!function->shared()->HasBuiltinFunctionId()) return false;
581
-
582
- // Fetch the arguments passed to the called function.
583
- const int argc = target()->arguments_count();
584
- Address entry = isolate()->c_entry_fp(isolate()->thread_local_top());
585
- Address fp = Memory::Address_at(entry + ExitFrameConstants::kCallerFPOffset);
586
- Arguments args(argc + 1,
587
- &Memory::Object_at(fp +
588
- StandardFrameConstants::kCallerSPOffset +
589
- argc * kPointerSize));
590
- switch (function->shared()->builtin_function_id()) {
591
- case kStringCharCodeAt:
592
- case kStringCharAt:
593
- if (object->IsString()) {
594
- String* string = String::cast(*object);
595
- // Check there's the right string value or wrapper in the receiver slot.
596
- ASSERT(string == args[0] || string == JSValue::cast(args[0])->value());
597
- // If we're in the default (fastest) state and the index is
598
- // out of bounds, update the state to record this fact.
599
- if (*extra_ic_state == DEFAULT_STRING_STUB &&
600
- argc >= 1 && args[1]->IsNumber()) {
601
- double index;
602
- if (args[1]->IsSmi()) {
603
- index = Smi::cast(args[1])->value();
604
- } else {
605
- ASSERT(args[1]->IsHeapNumber());
606
- index = DoubleToInteger(HeapNumber::cast(args[1])->value());
607
- }
608
- if (index < 0 || index >= string->length()) {
609
- *extra_ic_state = STRING_INDEX_OUT_OF_BOUNDS;
610
- return true;
611
- }
612
- }
613
- }
614
- break;
615
- default:
616
- return false;
617
- }
618
- return false;
619
- }
620
-
621
-
622
- MaybeObject* CallICBase::ComputeMonomorphicStub(
623
- LookupResult* lookup,
624
- State state,
625
- Code::ExtraICState extra_ic_state,
626
- Handle<Object> object,
627
- Handle<String> name) {
628
- int argc = target()->arguments_count();
629
- InLoopFlag in_loop = target()->ic_in_loop();
630
- MaybeObject* maybe_code = NULL;
631
- switch (lookup->type()) {
632
- case FIELD: {
633
- int index = lookup->GetFieldIndex();
634
- maybe_code = isolate()->stub_cache()->ComputeCallField(argc,
635
- in_loop,
636
- kind_,
637
- *name,
638
- *object,
639
- lookup->holder(),
640
- index);
641
- break;
642
- }
643
- case CONSTANT_FUNCTION: {
644
- // Get the constant function and compute the code stub for this
645
- // call; used for rewriting to monomorphic state and making sure
646
- // that the code stub is in the stub cache.
647
- JSFunction* function = lookup->GetConstantFunction();
648
- maybe_code =
649
- isolate()->stub_cache()->ComputeCallConstant(argc,
650
- in_loop,
651
- kind_,
652
- extra_ic_state,
653
- *name,
654
- *object,
655
- lookup->holder(),
656
- function);
657
- break;
658
- }
659
- case NORMAL: {
660
- if (!object->IsJSObject()) return NULL;
661
- Handle<JSObject> receiver = Handle<JSObject>::cast(object);
662
-
663
- if (lookup->holder()->IsGlobalObject()) {
664
- GlobalObject* global = GlobalObject::cast(lookup->holder());
665
- JSGlobalPropertyCell* cell =
666
- JSGlobalPropertyCell::cast(global->GetPropertyCell(lookup));
667
- if (!cell->value()->IsJSFunction()) return NULL;
668
- JSFunction* function = JSFunction::cast(cell->value());
669
- maybe_code = isolate()->stub_cache()->ComputeCallGlobal(argc,
670
- in_loop,
671
- kind_,
672
- *name,
673
- *receiver,
674
- global,
675
- cell,
676
- function);
677
- } else {
678
- // There is only one shared stub for calling normalized
679
- // properties. It does not traverse the prototype chain, so the
680
- // property must be found in the receiver for the stub to be
681
- // applicable.
682
- if (lookup->holder() != *receiver) return NULL;
683
- maybe_code = isolate()->stub_cache()->ComputeCallNormal(argc,
684
- in_loop,
685
- kind_,
686
- *name,
687
- *receiver);
688
- }
689
- break;
690
- }
691
- case INTERCEPTOR: {
692
- ASSERT(HasInterceptorGetter(lookup->holder()));
693
- maybe_code = isolate()->stub_cache()->ComputeCallInterceptor(
694
- argc,
695
- kind_,
696
- *name,
697
- *object,
698
- lookup->holder());
699
- break;
700
- }
701
- default:
702
- maybe_code = NULL;
703
- break;
704
- }
705
- return maybe_code;
706
- }
707
-
708
-
709
- void CallICBase::UpdateCaches(LookupResult* lookup,
710
- State state,
711
- Code::ExtraICState extra_ic_state,
712
- Handle<Object> object,
713
- Handle<String> name) {
714
- // Bail out if we didn't find a result.
715
- if (!lookup->IsProperty() || !lookup->IsCacheable()) return;
716
-
717
- if (lookup->holder() != *object &&
718
- HasNormalObjectsInPrototypeChain(
719
- isolate(), lookup, object->GetPrototype())) {
720
- // Suppress optimization for prototype chains with slow properties objects
721
- // in the middle.
722
- return;
723
- }
724
-
725
- // Compute the number of arguments.
726
- int argc = target()->arguments_count();
727
- InLoopFlag in_loop = target()->ic_in_loop();
728
- MaybeObject* maybe_code = NULL;
729
- bool had_proto_failure = false;
730
- if (state == UNINITIALIZED) {
731
- // This is the first time we execute this inline cache.
732
- // Set the target to the pre monomorphic stub to delay
733
- // setting the monomorphic state.
734
- maybe_code = isolate()->stub_cache()->ComputeCallPreMonomorphic(argc,
735
- in_loop,
736
- kind_);
737
- } else if (state == MONOMORPHIC) {
738
- if (kind_ == Code::CALL_IC &&
739
- TryUpdateExtraICState(lookup, object, &extra_ic_state)) {
740
- maybe_code = ComputeMonomorphicStub(lookup,
741
- state,
742
- extra_ic_state,
743
- object,
744
- name);
745
- } else if (kind_ == Code::CALL_IC &&
746
- TryRemoveInvalidPrototypeDependentStub(target(),
747
- *object,
748
- *name)) {
749
- had_proto_failure = true;
750
- maybe_code = ComputeMonomorphicStub(lookup,
751
- state,
752
- extra_ic_state,
753
- object,
754
- name);
755
- } else {
756
- maybe_code = isolate()->stub_cache()->ComputeCallMegamorphic(argc,
757
- in_loop,
758
- kind_);
759
- }
760
- } else {
761
- maybe_code = ComputeMonomorphicStub(lookup,
762
- state,
763
- extra_ic_state,
764
- object,
765
- name);
766
- }
767
-
768
- // If we're unable to compute the stub (not enough memory left), we
769
- // simply avoid updating the caches.
770
- Object* code;
771
- if (maybe_code == NULL || !maybe_code->ToObject(&code)) return;
772
-
773
- // Patch the call site depending on the state of the cache.
774
- if (state == UNINITIALIZED ||
775
- state == PREMONOMORPHIC ||
776
- state == MONOMORPHIC ||
777
- state == MONOMORPHIC_PROTOTYPE_FAILURE) {
778
- set_target(Code::cast(code));
779
- } else if (state == MEGAMORPHIC) {
780
- // Cache code holding map should be consistent with
781
- // GenerateMonomorphicCacheProbe. It is not the map which holds the stub.
782
- Map* map = JSObject::cast(object->IsJSObject() ? *object :
783
- object->GetPrototype())->map();
784
-
785
- // Update the stub cache.
786
- isolate()->stub_cache()->Set(*name, map, Code::cast(code));
787
- }
788
-
789
- USE(had_proto_failure);
790
- #ifdef DEBUG
791
- if (had_proto_failure) state = MONOMORPHIC_PROTOTYPE_FAILURE;
792
- TraceIC(kind_ == Code::CALL_IC ? "CallIC" : "KeyedCallIC",
793
- name, state, target(), in_loop ? " (in-loop)" : "");
794
- #endif
795
- }
796
-
797
-
798
- MaybeObject* KeyedCallIC::LoadFunction(State state,
799
- Handle<Object> object,
800
- Handle<Object> key) {
801
- if (key->IsSymbol()) {
802
- return CallICBase::LoadFunction(state,
803
- Code::kNoExtraICState,
804
- object,
805
- Handle<String>::cast(key));
806
- }
807
-
808
- if (object->IsUndefined() || object->IsNull()) {
809
- return TypeError("non_object_property_call", object, key);
810
- }
811
-
812
- if (FLAG_use_ic && state != MEGAMORPHIC && !object->IsAccessCheckNeeded()) {
813
- int argc = target()->arguments_count();
814
- InLoopFlag in_loop = target()->ic_in_loop();
815
- MaybeObject* maybe_code = isolate()->stub_cache()->ComputeCallMegamorphic(
816
- argc, in_loop, Code::KEYED_CALL_IC);
817
- Object* code;
818
- if (maybe_code->ToObject(&code)) {
819
- set_target(Code::cast(code));
820
- #ifdef DEBUG
821
- TraceIC(
822
- "KeyedCallIC", key, state, target(), in_loop ? " (in-loop)" : "");
823
- #endif
824
- }
825
- }
826
-
827
- HandleScope scope(isolate());
828
- Handle<Object> result = GetProperty(object, key);
829
- RETURN_IF_EMPTY_HANDLE(isolate(), result);
830
-
831
- // Make receiver an object if the callee requires it. Strict mode or builtin
832
- // functions do not wrap the receiver, non-strict functions and objects
833
- // called as functions do.
834
- ReceiverToObjectIfRequired(result, object);
835
-
836
- if (result->IsJSFunction()) return *result;
837
- result = Handle<Object>(TryCallAsFunction(*result));
838
- if (result->IsJSFunction()) return *result;
839
-
840
- return TypeError("property_not_function", object, key);
841
- }
842
-
843
-
844
- #ifdef DEBUG
845
- #define TRACE_IC_NAMED(msg, name) \
846
- if (FLAG_trace_ic) PrintF(msg, *(name)->ToCString())
847
- #else
848
- #define TRACE_IC_NAMED(msg, name)
849
- #endif
850
-
851
-
852
- MaybeObject* LoadIC::Load(State state,
853
- Handle<Object> object,
854
- Handle<String> name) {
855
- // If the object is undefined or null it's illegal to try to get any
856
- // of its properties; throw a TypeError in that case.
857
- if (object->IsUndefined() || object->IsNull()) {
858
- return TypeError("non_object_property_load", object, name);
859
- }
860
-
861
- if (FLAG_use_ic) {
862
- Code* non_monomorphic_stub =
863
- (state == UNINITIALIZED) ? pre_monomorphic_stub() : megamorphic_stub();
864
-
865
- // Use specialized code for getting the length of strings and
866
- // string wrapper objects. The length property of string wrapper
867
- // objects is read-only and therefore always returns the length of
868
- // the underlying string value. See ECMA-262 15.5.5.1.
869
- if ((object->IsString() || object->IsStringWrapper()) &&
870
- name->Equals(isolate()->heap()->length_symbol())) {
871
- HandleScope scope(isolate());
872
- #ifdef DEBUG
873
- if (FLAG_trace_ic) PrintF("[LoadIC : +#length /string]\n");
874
- #endif
875
- if (state == PREMONOMORPHIC) {
876
- if (object->IsString()) {
877
- Map* map = HeapObject::cast(*object)->map();
878
- const int offset = String::kLengthOffset;
879
- PatchInlinedLoad(address(), map, offset);
880
- set_target(isolate()->builtins()->builtin(
881
- Builtins::kLoadIC_StringLength));
882
- } else {
883
- set_target(isolate()->builtins()->builtin(
884
- Builtins::kLoadIC_StringWrapperLength));
885
- }
886
- } else if (state == MONOMORPHIC && object->IsStringWrapper()) {
887
- set_target(isolate()->builtins()->builtin(
888
- Builtins::kLoadIC_StringWrapperLength));
889
- } else {
890
- set_target(non_monomorphic_stub);
891
- }
892
- // Get the string if we have a string wrapper object.
893
- if (object->IsJSValue()) {
894
- object = Handle<Object>(Handle<JSValue>::cast(object)->value(),
895
- isolate());
896
- }
897
- return Smi::FromInt(String::cast(*object)->length());
898
- }
899
-
900
- // Use specialized code for getting the length of arrays.
901
- if (object->IsJSArray() &&
902
- name->Equals(isolate()->heap()->length_symbol())) {
903
- #ifdef DEBUG
904
- if (FLAG_trace_ic) PrintF("[LoadIC : +#length /array]\n");
905
- #endif
906
- if (state == PREMONOMORPHIC) {
907
- Map* map = HeapObject::cast(*object)->map();
908
- const int offset = JSArray::kLengthOffset;
909
- PatchInlinedLoad(address(), map, offset);
910
- set_target(isolate()->builtins()->builtin(
911
- Builtins::kLoadIC_ArrayLength));
912
- } else {
913
- set_target(non_monomorphic_stub);
914
- }
915
- return JSArray::cast(*object)->length();
916
- }
917
-
918
- // Use specialized code for getting prototype of functions.
919
- if (object->IsJSFunction() &&
920
- name->Equals(isolate()->heap()->prototype_symbol()) &&
921
- JSFunction::cast(*object)->should_have_prototype()) {
922
- #ifdef DEBUG
923
- if (FLAG_trace_ic) PrintF("[LoadIC : +#prototype /function]\n");
924
- #endif
925
- if (state == PREMONOMORPHIC) {
926
- set_target(isolate()->builtins()->builtin(
927
- Builtins::kLoadIC_FunctionPrototype));
928
- } else {
929
- set_target(non_monomorphic_stub);
930
- }
931
- return Accessors::FunctionGetPrototype(*object, 0);
932
- }
933
- }
934
-
935
- // Check if the name is trivially convertible to an index and get
936
- // the element if so.
937
- uint32_t index;
938
- if (name->AsArrayIndex(&index)) return object->GetElement(index);
939
-
940
- // Named lookup in the object.
941
- LookupResult lookup;
942
- LookupForRead(*object, *name, &lookup);
943
-
944
- // If we did not find a property, check if we need to throw an exception.
945
- if (!lookup.IsProperty()) {
946
- if (FLAG_strict || IsContextual(object)) {
947
- return ReferenceError("not_defined", name);
948
- }
949
- LOG(isolate(), SuspectReadEvent(*name, *object));
950
- }
951
-
952
- bool can_be_inlined_precheck =
953
- FLAG_use_ic &&
954
- lookup.IsProperty() &&
955
- lookup.IsCacheable() &&
956
- lookup.holder() == *object &&
957
- !object->IsAccessCheckNeeded();
958
-
959
- bool can_be_inlined =
960
- can_be_inlined_precheck &&
961
- state == PREMONOMORPHIC &&
962
- lookup.type() == FIELD;
963
-
964
- bool can_be_inlined_contextual =
965
- can_be_inlined_precheck &&
966
- state == UNINITIALIZED &&
967
- lookup.holder()->IsGlobalObject() &&
968
- lookup.type() == NORMAL;
969
-
970
- if (can_be_inlined) {
971
- Map* map = lookup.holder()->map();
972
- // Property's index in the properties array. If negative we have
973
- // an inobject property.
974
- int index = lookup.GetFieldIndex() - map->inobject_properties();
975
- if (index < 0) {
976
- // Index is an offset from the end of the object.
977
- int offset = map->instance_size() + (index * kPointerSize);
978
- if (PatchInlinedLoad(address(), map, offset)) {
979
- set_target(megamorphic_stub());
980
- TRACE_IC_NAMED("[LoadIC : inline patch %s]\n", name);
981
- return lookup.holder()->FastPropertyAt(lookup.GetFieldIndex());
982
- } else {
983
- TRACE_IC_NAMED("[LoadIC : no inline patch %s (patching failed)]\n",
984
- name);
985
- }
986
- } else {
987
- TRACE_IC_NAMED("[LoadIC : no inline patch %s (not inobject)]\n", name);
988
- }
989
- } else if (can_be_inlined_contextual) {
990
- Map* map = lookup.holder()->map();
991
- JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(
992
- lookup.holder()->property_dictionary()->ValueAt(
993
- lookup.GetDictionaryEntry()));
994
- if (PatchInlinedContextualLoad(address(),
995
- map,
996
- cell,
997
- lookup.IsDontDelete())) {
998
- set_target(megamorphic_stub());
999
- TRACE_IC_NAMED("[LoadIC : inline contextual patch %s]\n", name);
1000
- ASSERT(cell->value() != isolate()->heap()->the_hole_value());
1001
- return cell->value();
1002
- }
1003
- } else {
1004
- if (FLAG_use_ic && state == PREMONOMORPHIC) {
1005
- TRACE_IC_NAMED("[LoadIC : no inline patch %s (not inlinable)]\n", name);
1006
- }
1007
- }
1008
-
1009
- // Update inline cache and stub cache.
1010
- if (FLAG_use_ic) {
1011
- UpdateCaches(&lookup, state, object, name);
1012
- }
1013
-
1014
- PropertyAttributes attr;
1015
- if (lookup.IsProperty() && lookup.type() == INTERCEPTOR) {
1016
- // Get the property.
1017
- Object* result;
1018
- { MaybeObject* maybe_result =
1019
- object->GetProperty(*object, &lookup, *name, &attr);
1020
- if (!maybe_result->ToObject(&result)) return maybe_result;
1021
- }
1022
- // If the property is not present, check if we need to throw an
1023
- // exception.
1024
- if (attr == ABSENT && IsContextual(object)) {
1025
- return ReferenceError("not_defined", name);
1026
- }
1027
- return result;
1028
- }
1029
-
1030
- // Get the property.
1031
- return object->GetProperty(*object, &lookup, *name, &attr);
1032
- }
1033
-
1034
-
1035
- void LoadIC::UpdateCaches(LookupResult* lookup,
1036
- State state,
1037
- Handle<Object> object,
1038
- Handle<String> name) {
1039
- // Bail out if the result is not cacheable.
1040
- if (!lookup->IsCacheable()) return;
1041
-
1042
- // Loading properties from values is not common, so don't try to
1043
- // deal with non-JS objects here.
1044
- if (!object->IsJSObject()) return;
1045
- Handle<JSObject> receiver = Handle<JSObject>::cast(object);
1046
-
1047
- if (HasNormalObjectsInPrototypeChain(isolate(), lookup, *object)) return;
1048
-
1049
- // Compute the code stub for this load.
1050
- MaybeObject* maybe_code = NULL;
1051
- Object* code;
1052
- if (state == UNINITIALIZED) {
1053
- // This is the first time we execute this inline cache.
1054
- // Set the target to the pre monomorphic stub to delay
1055
- // setting the monomorphic state.
1056
- maybe_code = pre_monomorphic_stub();
1057
- } else if (!lookup->IsProperty()) {
1058
- // Nonexistent property. The result is undefined.
1059
- maybe_code = isolate()->stub_cache()->ComputeLoadNonexistent(*name,
1060
- *receiver);
1061
- } else {
1062
- // Compute monomorphic stub.
1063
- switch (lookup->type()) {
1064
- case FIELD: {
1065
- maybe_code = isolate()->stub_cache()->ComputeLoadField(
1066
- *name,
1067
- *receiver,
1068
- lookup->holder(),
1069
- lookup->GetFieldIndex());
1070
- break;
1071
- }
1072
- case CONSTANT_FUNCTION: {
1073
- Object* constant = lookup->GetConstantFunction();
1074
- maybe_code = isolate()->stub_cache()->ComputeLoadConstant(
1075
- *name, *receiver, lookup->holder(), constant);
1076
- break;
1077
- }
1078
- case NORMAL: {
1079
- if (lookup->holder()->IsGlobalObject()) {
1080
- GlobalObject* global = GlobalObject::cast(lookup->holder());
1081
- JSGlobalPropertyCell* cell =
1082
- JSGlobalPropertyCell::cast(global->GetPropertyCell(lookup));
1083
- maybe_code = isolate()->stub_cache()->ComputeLoadGlobal(*name,
1084
- *receiver,
1085
- global,
1086
- cell,
1087
- lookup->IsDontDelete());
1088
- } else {
1089
- // There is only one shared stub for loading normalized
1090
- // properties. It does not traverse the prototype chain, so the
1091
- // property must be found in the receiver for the stub to be
1092
- // applicable.
1093
- if (lookup->holder() != *receiver) return;
1094
- maybe_code = isolate()->stub_cache()->ComputeLoadNormal();
1095
- }
1096
- break;
1097
- }
1098
- case CALLBACKS: {
1099
- if (!lookup->GetCallbackObject()->IsAccessorInfo()) return;
1100
- AccessorInfo* callback =
1101
- AccessorInfo::cast(lookup->GetCallbackObject());
1102
- if (v8::ToCData<Address>(callback->getter()) == 0) return;
1103
- maybe_code = isolate()->stub_cache()->ComputeLoadCallback(
1104
- *name, *receiver, lookup->holder(), callback);
1105
- break;
1106
- }
1107
- case INTERCEPTOR: {
1108
- ASSERT(HasInterceptorGetter(lookup->holder()));
1109
- maybe_code = isolate()->stub_cache()->ComputeLoadInterceptor(
1110
- *name, *receiver, lookup->holder());
1111
- break;
1112
- }
1113
- default:
1114
- return;
1115
- }
1116
- }
1117
-
1118
- // If we're unable to compute the stub (not enough memory left), we
1119
- // simply avoid updating the caches.
1120
- if (maybe_code == NULL || !maybe_code->ToObject(&code)) return;
1121
-
1122
- // Patch the call site depending on the state of the cache.
1123
- if (state == UNINITIALIZED || state == PREMONOMORPHIC ||
1124
- state == MONOMORPHIC_PROTOTYPE_FAILURE) {
1125
- set_target(Code::cast(code));
1126
- } else if (state == MONOMORPHIC) {
1127
- set_target(megamorphic_stub());
1128
- } else if (state == MEGAMORPHIC) {
1129
- // Cache code holding map should be consistent with
1130
- // GenerateMonomorphicCacheProbe.
1131
- Map* map = JSObject::cast(object->IsJSObject() ? *object :
1132
- object->GetPrototype())->map();
1133
-
1134
- isolate()->stub_cache()->Set(*name, map, Code::cast(code));
1135
- }
1136
-
1137
- #ifdef DEBUG
1138
- TraceIC("LoadIC", name, state, target());
1139
- #endif
1140
- }
1141
-
1142
-
1143
- MaybeObject* KeyedLoadIC::Load(State state,
1144
- Handle<Object> object,
1145
- Handle<Object> key) {
1146
- // Check for values that can be converted into a symbol.
1147
- // TODO(1295): Remove this code.
1148
- HandleScope scope(isolate());
1149
- if (key->IsHeapNumber() &&
1150
- isnan(HeapNumber::cast(*key)->value())) {
1151
- key = isolate()->factory()->nan_symbol();
1152
- } else if (key->IsUndefined()) {
1153
- key = isolate()->factory()->undefined_symbol();
1154
- }
1155
-
1156
- if (key->IsSymbol()) {
1157
- Handle<String> name = Handle<String>::cast(key);
1158
-
1159
- // If the object is undefined or null it's illegal to try to get any
1160
- // of its properties; throw a TypeError in that case.
1161
- if (object->IsUndefined() || object->IsNull()) {
1162
- return TypeError("non_object_property_load", object, name);
1163
- }
1164
-
1165
- if (FLAG_use_ic) {
1166
- // TODO(1073): don't ignore the current stub state.
1167
-
1168
- // Use specialized code for getting the length of strings.
1169
- if (object->IsString() &&
1170
- name->Equals(isolate()->heap()->length_symbol())) {
1171
- Handle<String> string = Handle<String>::cast(object);
1172
- Object* code = NULL;
1173
- { MaybeObject* maybe_code =
1174
- isolate()->stub_cache()->ComputeKeyedLoadStringLength(*name,
1175
- *string);
1176
- if (!maybe_code->ToObject(&code)) return maybe_code;
1177
- }
1178
- set_target(Code::cast(code));
1179
- #ifdef DEBUG
1180
- TraceIC("KeyedLoadIC", name, state, target());
1181
- #endif // DEBUG
1182
- return Smi::FromInt(string->length());
1183
- }
1184
-
1185
- // Use specialized code for getting the length of arrays.
1186
- if (object->IsJSArray() &&
1187
- name->Equals(isolate()->heap()->length_symbol())) {
1188
- Handle<JSArray> array = Handle<JSArray>::cast(object);
1189
- Object* code;
1190
- { MaybeObject* maybe_code =
1191
- isolate()->stub_cache()->ComputeKeyedLoadArrayLength(*name,
1192
- *array);
1193
- if (!maybe_code->ToObject(&code)) return maybe_code;
1194
- }
1195
- set_target(Code::cast(code));
1196
- #ifdef DEBUG
1197
- TraceIC("KeyedLoadIC", name, state, target());
1198
- #endif // DEBUG
1199
- return JSArray::cast(*object)->length();
1200
- }
1201
-
1202
- // Use specialized code for getting prototype of functions.
1203
- if (object->IsJSFunction() &&
1204
- name->Equals(isolate()->heap()->prototype_symbol()) &&
1205
- JSFunction::cast(*object)->should_have_prototype()) {
1206
- Handle<JSFunction> function = Handle<JSFunction>::cast(object);
1207
- Object* code;
1208
- { MaybeObject* maybe_code =
1209
- isolate()->stub_cache()->ComputeKeyedLoadFunctionPrototype(
1210
- *name, *function);
1211
- if (!maybe_code->ToObject(&code)) return maybe_code;
1212
- }
1213
- set_target(Code::cast(code));
1214
- #ifdef DEBUG
1215
- TraceIC("KeyedLoadIC", name, state, target());
1216
- #endif // DEBUG
1217
- return Accessors::FunctionGetPrototype(*object, 0);
1218
- }
1219
- }
1220
-
1221
- // Check if the name is trivially convertible to an index and get
1222
- // the element or char if so.
1223
- uint32_t index = 0;
1224
- if (name->AsArrayIndex(&index)) {
1225
- HandleScope scope(isolate());
1226
- // Rewrite to the generic keyed load stub.
1227
- if (FLAG_use_ic) set_target(generic_stub());
1228
- return Runtime::GetElementOrCharAt(isolate(), object, index);
1229
- }
1230
-
1231
- // Named lookup.
1232
- LookupResult lookup;
1233
- LookupForRead(*object, *name, &lookup);
1234
-
1235
- // If we did not find a property, check if we need to throw an exception.
1236
- if (!lookup.IsProperty()) {
1237
- if (FLAG_strict || IsContextual(object)) {
1238
- return ReferenceError("not_defined", name);
1239
- }
1240
- }
1241
-
1242
- if (FLAG_use_ic) {
1243
- UpdateCaches(&lookup, state, object, name);
1244
- }
1245
-
1246
- PropertyAttributes attr;
1247
- if (lookup.IsProperty() && lookup.type() == INTERCEPTOR) {
1248
- // Get the property.
1249
- Object* result;
1250
- { MaybeObject* maybe_result =
1251
- object->GetProperty(*object, &lookup, *name, &attr);
1252
- if (!maybe_result->ToObject(&result)) return maybe_result;
1253
- }
1254
- // If the property is not present, check if we need to throw an
1255
- // exception.
1256
- if (attr == ABSENT && IsContextual(object)) {
1257
- return ReferenceError("not_defined", name);
1258
- }
1259
- return result;
1260
- }
1261
-
1262
- return object->GetProperty(*object, &lookup, *name, &attr);
1263
- }
1264
-
1265
- // Do not use ICs for objects that require access checks (including
1266
- // the global object).
1267
- bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded();
1268
-
1269
- if (use_ic) {
1270
- Code* stub = generic_stub();
1271
- if (state == UNINITIALIZED) {
1272
- if (object->IsString() && key->IsNumber()) {
1273
- stub = string_stub();
1274
- } else if (object->IsJSObject()) {
1275
- Handle<JSObject> receiver = Handle<JSObject>::cast(object);
1276
- if (receiver->HasExternalArrayElements()) {
1277
- MaybeObject* probe =
1278
- isolate()->stub_cache()->ComputeKeyedLoadOrStoreExternalArray(
1279
- *receiver, false, kNonStrictMode);
1280
- stub = probe->IsFailure() ?
1281
- NULL : Code::cast(probe->ToObjectUnchecked());
1282
- } else if (receiver->HasIndexedInterceptor()) {
1283
- stub = indexed_interceptor_stub();
1284
- } else if (key->IsSmi() &&
1285
- receiver->map()->has_fast_elements()) {
1286
- MaybeObject* probe =
1287
- isolate()->stub_cache()->ComputeKeyedLoadSpecialized(*receiver);
1288
- stub = probe->IsFailure() ?
1289
- NULL : Code::cast(probe->ToObjectUnchecked());
1290
- }
1291
- }
1292
- }
1293
- if (stub != NULL) set_target(stub);
1294
-
1295
- #ifdef DEBUG
1296
- TraceIC("KeyedLoadIC", key, state, target());
1297
- #endif // DEBUG
1298
-
1299
- // For JSObjects with fast elements that are not value wrappers
1300
- // and that do not have indexed interceptors, we initialize the
1301
- // inlined fast case (if present) by patching the inlined map
1302
- // check.
1303
- if (object->IsJSObject() &&
1304
- !object->IsJSValue() &&
1305
- !JSObject::cast(*object)->HasIndexedInterceptor() &&
1306
- JSObject::cast(*object)->HasFastElements()) {
1307
- Map* map = JSObject::cast(*object)->map();
1308
- PatchInlinedLoad(address(), map);
1309
- }
1310
- }
1311
-
1312
- // Get the property.
1313
- return Runtime::GetObjectProperty(isolate(), object, key);
1314
- }
1315
-
1316
-
1317
- void KeyedLoadIC::UpdateCaches(LookupResult* lookup, State state,
1318
- Handle<Object> object, Handle<String> name) {
1319
- // Bail out if we didn't find a result.
1320
- if (!lookup->IsProperty() || !lookup->IsCacheable()) return;
1321
-
1322
- if (!object->IsJSObject()) return;
1323
- Handle<JSObject> receiver = Handle<JSObject>::cast(object);
1324
-
1325
- if (HasNormalObjectsInPrototypeChain(isolate(), lookup, *object)) return;
1326
-
1327
- // Compute the code stub for this load.
1328
- MaybeObject* maybe_code = NULL;
1329
- Object* code;
1330
-
1331
- if (state == UNINITIALIZED) {
1332
- // This is the first time we execute this inline cache.
1333
- // Set the target to the pre monomorphic stub to delay
1334
- // setting the monomorphic state.
1335
- maybe_code = pre_monomorphic_stub();
1336
- } else {
1337
- // Compute a monomorphic stub.
1338
- switch (lookup->type()) {
1339
- case FIELD: {
1340
- maybe_code = isolate()->stub_cache()->ComputeKeyedLoadField(
1341
- *name, *receiver, lookup->holder(), lookup->GetFieldIndex());
1342
- break;
1343
- }
1344
- case CONSTANT_FUNCTION: {
1345
- Object* constant = lookup->GetConstantFunction();
1346
- maybe_code = isolate()->stub_cache()->ComputeKeyedLoadConstant(
1347
- *name, *receiver, lookup->holder(), constant);
1348
- break;
1349
- }
1350
- case CALLBACKS: {
1351
- if (!lookup->GetCallbackObject()->IsAccessorInfo()) return;
1352
- AccessorInfo* callback =
1353
- AccessorInfo::cast(lookup->GetCallbackObject());
1354
- if (v8::ToCData<Address>(callback->getter()) == 0) return;
1355
- maybe_code = isolate()->stub_cache()->ComputeKeyedLoadCallback(
1356
- *name, *receiver, lookup->holder(), callback);
1357
- break;
1358
- }
1359
- case INTERCEPTOR: {
1360
- ASSERT(HasInterceptorGetter(lookup->holder()));
1361
- maybe_code = isolate()->stub_cache()->ComputeKeyedLoadInterceptor(
1362
- *name, *receiver, lookup->holder());
1363
- break;
1364
- }
1365
- default: {
1366
- // Always rewrite to the generic case so that we do not
1367
- // repeatedly try to rewrite.
1368
- maybe_code = generic_stub();
1369
- break;
1370
- }
1371
- }
1372
- }
1373
-
1374
- // If we're unable to compute the stub (not enough memory left), we
1375
- // simply avoid updating the caches.
1376
- if (maybe_code == NULL || !maybe_code->ToObject(&code)) return;
1377
-
1378
- // Patch the call site depending on the state of the cache. Make
1379
- // sure to always rewrite from monomorphic to megamorphic.
1380
- ASSERT(state != MONOMORPHIC_PROTOTYPE_FAILURE);
1381
- if (state == UNINITIALIZED || state == PREMONOMORPHIC) {
1382
- set_target(Code::cast(code));
1383
- } else if (state == MONOMORPHIC) {
1384
- set_target(megamorphic_stub());
1385
- }
1386
-
1387
- #ifdef DEBUG
1388
- TraceIC("KeyedLoadIC", name, state, target());
1389
- #endif
1390
- }
1391
-
1392
-
1393
- static bool StoreICableLookup(LookupResult* lookup) {
1394
- // Bail out if we didn't find a result.
1395
- if (!lookup->IsPropertyOrTransition() || !lookup->IsCacheable()) return false;
1396
-
1397
- // If the property is read-only, we leave the IC in its current
1398
- // state.
1399
- if (lookup->IsReadOnly()) return false;
1400
-
1401
- return true;
1402
- }
1403
-
1404
-
1405
- static bool LookupForWrite(JSObject* object,
1406
- String* name,
1407
- LookupResult* lookup) {
1408
- object->LocalLookup(name, lookup);
1409
- if (!StoreICableLookup(lookup)) {
1410
- return false;
1411
- }
1412
-
1413
- if (lookup->type() == INTERCEPTOR) {
1414
- if (object->GetNamedInterceptor()->setter()->IsUndefined()) {
1415
- object->LocalLookupRealNamedProperty(name, lookup);
1416
- return StoreICableLookup(lookup);
1417
- }
1418
- }
1419
-
1420
- return true;
1421
- }
1422
-
1423
-
1424
- MaybeObject* StoreIC::Store(State state,
1425
- StrictModeFlag strict_mode,
1426
- Handle<Object> object,
1427
- Handle<String> name,
1428
- Handle<Object> value) {
1429
- // If the object is undefined or null it's illegal to try to set any
1430
- // properties on it; throw a TypeError in that case.
1431
- if (object->IsUndefined() || object->IsNull()) {
1432
- return TypeError("non_object_property_store", object, name);
1433
- }
1434
-
1435
- if (!object->IsJSObject()) {
1436
- // The length property of string values is read-only. Throw in strict mode.
1437
- if (strict_mode == kStrictMode && object->IsString() &&
1438
- name->Equals(isolate()->heap()->length_symbol())) {
1439
- return TypeError("strict_read_only_property", object, name);
1440
- }
1441
- // Ignore stores where the receiver is not a JSObject.
1442
- return *value;
1443
- }
1444
-
1445
- Handle<JSObject> receiver = Handle<JSObject>::cast(object);
1446
-
1447
- // Check if the given name is an array index.
1448
- uint32_t index;
1449
- if (name->AsArrayIndex(&index)) {
1450
- HandleScope scope(isolate());
1451
- Handle<Object> result = SetElement(receiver, index, value, strict_mode);
1452
- if (result.is_null()) return Failure::Exception();
1453
- return *value;
1454
- }
1455
-
1456
- // Use specialized code for setting the length of arrays.
1457
- if (receiver->IsJSArray()
1458
- && name->Equals(isolate()->heap()->length_symbol())
1459
- && receiver->AllowsSetElementsLength()) {
1460
- #ifdef DEBUG
1461
- if (FLAG_trace_ic) PrintF("[StoreIC : +#length /array]\n");
1462
- #endif
1463
- Builtins::Name target = (strict_mode == kStrictMode)
1464
- ? Builtins::kStoreIC_ArrayLength_Strict
1465
- : Builtins::kStoreIC_ArrayLength;
1466
- set_target(isolate()->builtins()->builtin(target));
1467
- return receiver->SetProperty(*name, *value, NONE, strict_mode);
1468
- }
1469
-
1470
- // Lookup the property locally in the receiver.
1471
- if (FLAG_use_ic && !receiver->IsJSGlobalProxy()) {
1472
- LookupResult lookup;
1473
-
1474
- if (LookupForWrite(*receiver, *name, &lookup)) {
1475
- bool can_be_inlined =
1476
- state == UNINITIALIZED &&
1477
- lookup.IsProperty() &&
1478
- lookup.holder() == *receiver &&
1479
- lookup.type() == FIELD &&
1480
- !receiver->IsAccessCheckNeeded();
1481
-
1482
- if (can_be_inlined) {
1483
- Map* map = lookup.holder()->map();
1484
- // Property's index in the properties array. If negative we have
1485
- // an inobject property.
1486
- int index = lookup.GetFieldIndex() - map->inobject_properties();
1487
- if (index < 0) {
1488
- // Index is an offset from the end of the object.
1489
- int offset = map->instance_size() + (index * kPointerSize);
1490
- if (PatchInlinedStore(address(), map, offset)) {
1491
- set_target((strict_mode == kStrictMode)
1492
- ? megamorphic_stub_strict()
1493
- : megamorphic_stub());
1494
- #ifdef DEBUG
1495
- if (FLAG_trace_ic) {
1496
- PrintF("[StoreIC : inline patch %s]\n", *name->ToCString());
1497
- }
1498
- #endif
1499
- return receiver->SetProperty(*name, *value, NONE, strict_mode);
1500
- #ifdef DEBUG
1501
-
1502
- } else {
1503
- if (FLAG_trace_ic) {
1504
- PrintF("[StoreIC : no inline patch %s (patching failed)]\n",
1505
- *name->ToCString());
1506
- }
1507
- }
1508
- } else {
1509
- if (FLAG_trace_ic) {
1510
- PrintF("[StoreIC : no inline patch %s (not inobject)]\n",
1511
- *name->ToCString());
1512
- }
1513
- }
1514
- } else {
1515
- if (state == PREMONOMORPHIC) {
1516
- if (FLAG_trace_ic) {
1517
- PrintF("[StoreIC : no inline patch %s (not inlinable)]\n",
1518
- *name->ToCString());
1519
- #endif
1520
- }
1521
- }
1522
- }
1523
-
1524
- // If no inlined store ic was patched, generate a stub for this
1525
- // store.
1526
- UpdateCaches(&lookup, state, strict_mode, receiver, name, value);
1527
- } else {
1528
- // Strict mode doesn't allow setting non-existent global property
1529
- // or an assignment to a read only property.
1530
- if (strict_mode == kStrictMode) {
1531
- if (lookup.IsFound() && lookup.IsReadOnly()) {
1532
- return TypeError("strict_read_only_property", object, name);
1533
- } else if (IsContextual(object)) {
1534
- return ReferenceError("not_defined", name);
1535
- }
1536
- }
1537
- }
1538
- }
1539
-
1540
- if (receiver->IsJSGlobalProxy()) {
1541
- // Generate a generic stub that goes to the runtime when we see a global
1542
- // proxy as receiver.
1543
- Code* stub = (strict_mode == kStrictMode)
1544
- ? global_proxy_stub_strict()
1545
- : global_proxy_stub();
1546
- if (target() != stub) {
1547
- set_target(stub);
1548
- #ifdef DEBUG
1549
- TraceIC("StoreIC", name, state, target());
1550
- #endif
1551
- }
1552
- }
1553
-
1554
- // Set the property.
1555
- return receiver->SetProperty(*name, *value, NONE, strict_mode);
1556
- }
1557
-
1558
-
1559
- void StoreIC::UpdateCaches(LookupResult* lookup,
1560
- State state,
1561
- StrictModeFlag strict_mode,
1562
- Handle<JSObject> receiver,
1563
- Handle<String> name,
1564
- Handle<Object> value) {
1565
- // Skip JSGlobalProxy.
1566
- ASSERT(!receiver->IsJSGlobalProxy());
1567
-
1568
- ASSERT(StoreICableLookup(lookup));
1569
-
1570
- // If the property has a non-field type allowing map transitions
1571
- // where there is extra room in the object, we leave the IC in its
1572
- // current state.
1573
- PropertyType type = lookup->type();
1574
-
1575
- // Compute the code stub for this store; used for rewriting to
1576
- // monomorphic state and making sure that the code stub is in the
1577
- // stub cache.
1578
- MaybeObject* maybe_code = NULL;
1579
- Object* code = NULL;
1580
- switch (type) {
1581
- case FIELD: {
1582
- maybe_code = isolate()->stub_cache()->ComputeStoreField(
1583
- *name, *receiver, lookup->GetFieldIndex(), NULL, strict_mode);
1584
- break;
1585
- }
1586
- case MAP_TRANSITION: {
1587
- if (lookup->GetAttributes() != NONE) return;
1588
- HandleScope scope(isolate());
1589
- ASSERT(type == MAP_TRANSITION);
1590
- Handle<Map> transition(lookup->GetTransitionMap());
1591
- int index = transition->PropertyIndexFor(*name);
1592
- maybe_code = isolate()->stub_cache()->ComputeStoreField(
1593
- *name, *receiver, index, *transition, strict_mode);
1594
- break;
1595
- }
1596
- case NORMAL: {
1597
- if (receiver->IsGlobalObject()) {
1598
- // The stub generated for the global object picks the value directly
1599
- // from the property cell. So the property must be directly on the
1600
- // global object.
1601
- Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver);
1602
- JSGlobalPropertyCell* cell =
1603
- JSGlobalPropertyCell::cast(global->GetPropertyCell(lookup));
1604
- maybe_code = isolate()->stub_cache()->ComputeStoreGlobal(
1605
- *name, *global, cell, strict_mode);
1606
- } else {
1607
- if (lookup->holder() != *receiver) return;
1608
- maybe_code = isolate()->stub_cache()->ComputeStoreNormal(strict_mode);
1609
- }
1610
- break;
1611
- }
1612
- case CALLBACKS: {
1613
- if (!lookup->GetCallbackObject()->IsAccessorInfo()) return;
1614
- AccessorInfo* callback = AccessorInfo::cast(lookup->GetCallbackObject());
1615
- if (v8::ToCData<Address>(callback->setter()) == 0) return;
1616
- maybe_code = isolate()->stub_cache()->ComputeStoreCallback(
1617
- *name, *receiver, callback, strict_mode);
1618
- break;
1619
- }
1620
- case INTERCEPTOR: {
1621
- ASSERT(!receiver->GetNamedInterceptor()->setter()->IsUndefined());
1622
- maybe_code = isolate()->stub_cache()->ComputeStoreInterceptor(
1623
- *name, *receiver, strict_mode);
1624
- break;
1625
- }
1626
- default:
1627
- return;
1628
- }
1629
-
1630
- // If we're unable to compute the stub (not enough memory left), we
1631
- // simply avoid updating the caches.
1632
- if (maybe_code == NULL || !maybe_code->ToObject(&code)) return;
1633
-
1634
- // Patch the call site depending on the state of the cache.
1635
- if (state == UNINITIALIZED || state == MONOMORPHIC_PROTOTYPE_FAILURE) {
1636
- set_target(Code::cast(code));
1637
- } else if (state == MONOMORPHIC) {
1638
- // Only move to megamorphic if the target changes.
1639
- if (target() != Code::cast(code)) {
1640
- set_target((strict_mode == kStrictMode)
1641
- ? megamorphic_stub_strict()
1642
- : megamorphic_stub());
1643
- }
1644
- } else if (state == MEGAMORPHIC) {
1645
- // Update the stub cache.
1646
- isolate()->stub_cache()->Set(*name,
1647
- receiver->map(),
1648
- Code::cast(code));
1649
- }
1650
-
1651
- #ifdef DEBUG
1652
- TraceIC("StoreIC", name, state, target());
1653
- #endif
1654
- }
1655
-
1656
-
1657
- MaybeObject* KeyedStoreIC::Store(State state,
1658
- StrictModeFlag strict_mode,
1659
- Handle<Object> object,
1660
- Handle<Object> key,
1661
- Handle<Object> value) {
1662
- if (key->IsSymbol()) {
1663
- Handle<String> name = Handle<String>::cast(key);
1664
-
1665
- // If the object is undefined or null it's illegal to try to set any
1666
- // properties on it; throw a TypeError in that case.
1667
- if (object->IsUndefined() || object->IsNull()) {
1668
- return TypeError("non_object_property_store", object, name);
1669
- }
1670
-
1671
- // Ignore stores where the receiver is not a JSObject.
1672
- if (!object->IsJSObject()) return *value;
1673
- Handle<JSObject> receiver = Handle<JSObject>::cast(object);
1674
-
1675
- // Check if the given name is an array index.
1676
- uint32_t index;
1677
- if (name->AsArrayIndex(&index)) {
1678
- HandleScope scope(isolate());
1679
- Handle<Object> result = SetElement(receiver, index, value, strict_mode);
1680
- if (result.is_null()) return Failure::Exception();
1681
- return *value;
1682
- }
1683
-
1684
- // Lookup the property locally in the receiver.
1685
- LookupResult lookup;
1686
- receiver->LocalLookup(*name, &lookup);
1687
-
1688
- // Update inline cache and stub cache.
1689
- if (FLAG_use_ic) {
1690
- UpdateCaches(&lookup, state, strict_mode, receiver, name, value);
1691
- }
1692
-
1693
- // Set the property.
1694
- return receiver->SetProperty(*name, *value, NONE, strict_mode);
1695
- }
1696
-
1697
- // Do not use ICs for objects that require access checks (including
1698
- // the global object).
1699
- bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded();
1700
- ASSERT(!(use_ic && object->IsJSGlobalProxy()));
1701
-
1702
- if (use_ic) {
1703
- Code* stub =
1704
- (strict_mode == kStrictMode) ? generic_stub_strict() : generic_stub();
1705
- if (state == UNINITIALIZED) {
1706
- if (object->IsJSObject()) {
1707
- Handle<JSObject> receiver = Handle<JSObject>::cast(object);
1708
- if (receiver->HasExternalArrayElements()) {
1709
- MaybeObject* probe =
1710
- isolate()->stub_cache()->ComputeKeyedLoadOrStoreExternalArray(
1711
- *receiver, true, strict_mode);
1712
- stub = probe->IsFailure() ?
1713
- NULL : Code::cast(probe->ToObjectUnchecked());
1714
- } else if (key->IsSmi() && receiver->map()->has_fast_elements()) {
1715
- MaybeObject* probe =
1716
- isolate()->stub_cache()->ComputeKeyedStoreSpecialized(
1717
- *receiver, strict_mode);
1718
- stub = probe->IsFailure() ?
1719
- NULL : Code::cast(probe->ToObjectUnchecked());
1720
- }
1721
- }
1722
- }
1723
- if (stub != NULL) set_target(stub);
1724
- }
1725
-
1726
- // Set the property.
1727
- return Runtime::SetObjectProperty(
1728
- isolate(), object , key, value, NONE, strict_mode);
1729
- }
1730
-
1731
-
1732
- void KeyedStoreIC::UpdateCaches(LookupResult* lookup,
1733
- State state,
1734
- StrictModeFlag strict_mode,
1735
- Handle<JSObject> receiver,
1736
- Handle<String> name,
1737
- Handle<Object> value) {
1738
- // Skip JSGlobalProxy.
1739
- if (receiver->IsJSGlobalProxy()) return;
1740
-
1741
- // Bail out if we didn't find a result.
1742
- if (!lookup->IsPropertyOrTransition() || !lookup->IsCacheable()) return;
1743
-
1744
- // If the property is read-only, we leave the IC in its current
1745
- // state.
1746
- if (lookup->IsReadOnly()) return;
1747
-
1748
- // If the property has a non-field type allowing map transitions
1749
- // where there is extra room in the object, we leave the IC in its
1750
- // current state.
1751
- PropertyType type = lookup->type();
1752
-
1753
- // Compute the code stub for this store; used for rewriting to
1754
- // monomorphic state and making sure that the code stub is in the
1755
- // stub cache.
1756
- MaybeObject* maybe_code = NULL;
1757
- Object* code = NULL;
1758
-
1759
- switch (type) {
1760
- case FIELD: {
1761
- maybe_code = isolate()->stub_cache()->ComputeKeyedStoreField(
1762
- *name, *receiver, lookup->GetFieldIndex(), NULL, strict_mode);
1763
- break;
1764
- }
1765
- case MAP_TRANSITION: {
1766
- if (lookup->GetAttributes() == NONE) {
1767
- HandleScope scope(isolate());
1768
- ASSERT(type == MAP_TRANSITION);
1769
- Handle<Map> transition(lookup->GetTransitionMap());
1770
- int index = transition->PropertyIndexFor(*name);
1771
- maybe_code = isolate()->stub_cache()->ComputeKeyedStoreField(
1772
- *name, *receiver, index, *transition, strict_mode);
1773
- break;
1774
- }
1775
- // fall through.
1776
- }
1777
- default: {
1778
- // Always rewrite to the generic case so that we do not
1779
- // repeatedly try to rewrite.
1780
- maybe_code = (strict_mode == kStrictMode)
1781
- ? generic_stub_strict()
1782
- : generic_stub();
1783
- break;
1784
- }
1785
- }
1786
-
1787
- // If we're unable to compute the stub (not enough memory left), we
1788
- // simply avoid updating the caches.
1789
- if (maybe_code == NULL || !maybe_code->ToObject(&code)) return;
1790
-
1791
- // Patch the call site depending on the state of the cache. Make
1792
- // sure to always rewrite from monomorphic to megamorphic.
1793
- ASSERT(state != MONOMORPHIC_PROTOTYPE_FAILURE);
1794
- if (state == UNINITIALIZED || state == PREMONOMORPHIC) {
1795
- set_target(Code::cast(code));
1796
- } else if (state == MONOMORPHIC) {
1797
- set_target((strict_mode == kStrictMode)
1798
- ? megamorphic_stub_strict()
1799
- : megamorphic_stub());
1800
- }
1801
-
1802
- #ifdef DEBUG
1803
- TraceIC("KeyedStoreIC", name, state, target());
1804
- #endif
1805
- }
1806
-
1807
-
1808
- // ----------------------------------------------------------------------------
1809
- // Static IC stub generators.
1810
- //
1811
-
1812
- static JSFunction* CompileFunction(Isolate* isolate,
1813
- JSFunction* function,
1814
- InLoopFlag in_loop) {
1815
- // Compile now with optimization.
1816
- HandleScope scope(isolate);
1817
- Handle<JSFunction> function_handle(function, isolate);
1818
- if (in_loop == IN_LOOP) {
1819
- CompileLazyInLoop(function_handle, CLEAR_EXCEPTION);
1820
- } else {
1821
- CompileLazy(function_handle, CLEAR_EXCEPTION);
1822
- }
1823
- return *function_handle;
1824
- }
1825
-
1826
-
1827
- // Used from ic-<arch>.cc.
1828
- RUNTIME_FUNCTION(MaybeObject*, CallIC_Miss) {
1829
- NoHandleAllocation na;
1830
- ASSERT(args.length() == 2);
1831
- CallIC ic(isolate);
1832
- IC::State state = IC::StateFrom(ic.target(), args[0], args[1]);
1833
- Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
1834
- MaybeObject* maybe_result = ic.LoadFunction(state,
1835
- extra_ic_state,
1836
- args.at<Object>(0),
1837
- args.at<String>(1));
1838
- Object* result;
1839
- if (!maybe_result->ToObject(&result)) return maybe_result;
1840
-
1841
- // The first time the inline cache is updated may be the first time the
1842
- // function it references gets called. If the function was lazily compiled
1843
- // then the first call will trigger a compilation. We check for this case
1844
- // and we do the compilation immediately, instead of waiting for the stub
1845
- // currently attached to the JSFunction object to trigger compilation. We
1846
- // do this in the case where we know that the inline cache is inside a loop,
1847
- // because then we know that we want to optimize the function.
1848
- if (!result->IsJSFunction() || JSFunction::cast(result)->is_compiled()) {
1849
- return result;
1850
- }
1851
- return CompileFunction(isolate,
1852
- JSFunction::cast(result),
1853
- ic.target()->ic_in_loop());
1854
- }
1855
-
1856
-
1857
- // Used from ic-<arch>.cc.
1858
- RUNTIME_FUNCTION(MaybeObject*, KeyedCallIC_Miss) {
1859
- NoHandleAllocation na;
1860
- ASSERT(args.length() == 2);
1861
- KeyedCallIC ic(isolate);
1862
- IC::State state = IC::StateFrom(ic.target(), args[0], args[1]);
1863
- Object* result;
1864
- { MaybeObject* maybe_result =
1865
- ic.LoadFunction(state, args.at<Object>(0), args.at<Object>(1));
1866
- if (!maybe_result->ToObject(&result)) return maybe_result;
1867
- }
1868
-
1869
- if (!result->IsJSFunction() || JSFunction::cast(result)->is_compiled()) {
1870
- return result;
1871
- }
1872
- return CompileFunction(isolate,
1873
- JSFunction::cast(result),
1874
- ic.target()->ic_in_loop());
1875
- }
1876
-
1877
-
1878
- // Used from ic-<arch>.cc.
1879
- RUNTIME_FUNCTION(MaybeObject*, LoadIC_Miss) {
1880
- NoHandleAllocation na;
1881
- ASSERT(args.length() == 2);
1882
- LoadIC ic(isolate);
1883
- IC::State state = IC::StateFrom(ic.target(), args[0], args[1]);
1884
- return ic.Load(state, args.at<Object>(0), args.at<String>(1));
1885
- }
1886
-
1887
-
1888
- // Used from ic-<arch>.cc
1889
- RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_Miss) {
1890
- NoHandleAllocation na;
1891
- ASSERT(args.length() == 2);
1892
- KeyedLoadIC ic(isolate);
1893
- IC::State state = IC::StateFrom(ic.target(), args[0], args[1]);
1894
- return ic.Load(state, args.at<Object>(0), args.at<Object>(1));
1895
- }
1896
-
1897
-
1898
- // Used from ic-<arch>.cc.
1899
- RUNTIME_FUNCTION(MaybeObject*, StoreIC_Miss) {
1900
- NoHandleAllocation na;
1901
- ASSERT(args.length() == 3);
1902
- StoreIC ic(isolate);
1903
- IC::State state = IC::StateFrom(ic.target(), args[0], args[1]);
1904
- Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
1905
- return ic.Store(state,
1906
- static_cast<StrictModeFlag>(extra_ic_state & kStrictMode),
1907
- args.at<Object>(0),
1908
- args.at<String>(1),
1909
- args.at<Object>(2));
1910
- }
1911
-
1912
-
1913
- RUNTIME_FUNCTION(MaybeObject*, StoreIC_ArrayLength) {
1914
- NoHandleAllocation nha;
1915
-
1916
- ASSERT(args.length() == 2);
1917
- JSObject* receiver = JSObject::cast(args[0]);
1918
- Object* len = args[1];
1919
-
1920
- // The generated code should filter out non-Smis before we get here.
1921
- ASSERT(len->IsSmi());
1922
-
1923
- Object* result;
1924
- { MaybeObject* maybe_result = receiver->SetElementsLength(len);
1925
- if (!maybe_result->ToObject(&result)) return maybe_result;
1926
- }
1927
- return len;
1928
- }
1929
-
1930
-
1931
- // Extend storage is called in a store inline cache when
1932
- // it is necessary to extend the properties array of a
1933
- // JSObject.
1934
- RUNTIME_FUNCTION(MaybeObject*, SharedStoreIC_ExtendStorage) {
1935
- NoHandleAllocation na;
1936
- ASSERT(args.length() == 3);
1937
-
1938
- // Convert the parameters
1939
- JSObject* object = JSObject::cast(args[0]);
1940
- Map* transition = Map::cast(args[1]);
1941
- Object* value = args[2];
1942
-
1943
- // Check the object has run out out property space.
1944
- ASSERT(object->HasFastProperties());
1945
- ASSERT(object->map()->unused_property_fields() == 0);
1946
-
1947
- // Expand the properties array.
1948
- FixedArray* old_storage = object->properties();
1949
- int new_unused = transition->unused_property_fields();
1950
- int new_size = old_storage->length() + new_unused + 1;
1951
- Object* result;
1952
- { MaybeObject* maybe_result = old_storage->CopySize(new_size);
1953
- if (!maybe_result->ToObject(&result)) return maybe_result;
1954
- }
1955
- FixedArray* new_storage = FixedArray::cast(result);
1956
- new_storage->set(old_storage->length(), value);
1957
-
1958
- // Set the new property value and do the map transition.
1959
- object->set_properties(new_storage);
1960
- object->set_map(transition);
1961
-
1962
- // Return the stored value.
1963
- return value;
1964
- }
1965
-
1966
-
1967
- // Used from ic-<arch>.cc.
1968
- RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_Miss) {
1969
- NoHandleAllocation na;
1970
- ASSERT(args.length() == 3);
1971
- KeyedStoreIC ic(isolate);
1972
- IC::State state = IC::StateFrom(ic.target(), args[0], args[1]);
1973
- Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
1974
- return ic.Store(state,
1975
- static_cast<StrictModeFlag>(extra_ic_state & kStrictMode),
1976
- args.at<Object>(0),
1977
- args.at<Object>(1),
1978
- args.at<Object>(2));
1979
- }
1980
-
1981
-
1982
- void BinaryOpIC::patch(Code* code) {
1983
- set_target(code);
1984
- }
1985
-
1986
-
1987
- const char* BinaryOpIC::GetName(TypeInfo type_info) {
1988
- switch (type_info) {
1989
- case UNINIT_OR_SMI: return "UninitOrSmi";
1990
- case DEFAULT: return "Default";
1991
- case GENERIC: return "Generic";
1992
- case HEAP_NUMBERS: return "HeapNumbers";
1993
- case STRINGS: return "Strings";
1994
- default: return "Invalid";
1995
- }
1996
- }
1997
-
1998
-
1999
- BinaryOpIC::State BinaryOpIC::ToState(TypeInfo type_info) {
2000
- switch (type_info) {
2001
- case UNINIT_OR_SMI:
2002
- return UNINITIALIZED;
2003
- case DEFAULT:
2004
- case HEAP_NUMBERS:
2005
- case STRINGS:
2006
- return MONOMORPHIC;
2007
- case GENERIC:
2008
- return MEGAMORPHIC;
2009
- }
2010
- UNREACHABLE();
2011
- return UNINITIALIZED;
2012
- }
2013
-
2014
-
2015
- BinaryOpIC::TypeInfo BinaryOpIC::GetTypeInfo(Object* left,
2016
- Object* right) {
2017
- if (left->IsSmi() && right->IsSmi()) {
2018
- // If we have two smi inputs we can reach here because
2019
- // of an overflow. Enter default state.
2020
- return DEFAULT;
2021
- }
2022
-
2023
- if (left->IsNumber() && right->IsNumber()) {
2024
- return HEAP_NUMBERS;
2025
- }
2026
-
2027
- if (left->IsString() || right->IsString()) {
2028
- // Patching for fast string ADD makes sense even if only one of the
2029
- // arguments is a string.
2030
- return STRINGS;
2031
- }
2032
-
2033
- return GENERIC;
2034
- }
2035
-
2036
-
2037
- // defined in code-stubs-<arch>.cc
2038
- Handle<Code> GetBinaryOpStub(int key, BinaryOpIC::TypeInfo type_info);
2039
-
2040
-
2041
- RUNTIME_FUNCTION(MaybeObject*, BinaryOp_Patch) {
2042
- ASSERT(args.length() == 5);
2043
-
2044
- HandleScope scope(isolate);
2045
- Handle<Object> left = args.at<Object>(0);
2046
- Handle<Object> right = args.at<Object>(1);
2047
- int key = Smi::cast(args[2])->value();
2048
- Token::Value op = static_cast<Token::Value>(Smi::cast(args[3])->value());
2049
- BinaryOpIC::TypeInfo previous_type =
2050
- static_cast<BinaryOpIC::TypeInfo>(Smi::cast(args[4])->value());
2051
-
2052
- BinaryOpIC::TypeInfo type = BinaryOpIC::GetTypeInfo(*left, *right);
2053
- Handle<Code> code = GetBinaryOpStub(key, type);
2054
- if (!code.is_null()) {
2055
- BinaryOpIC ic(isolate);
2056
- ic.patch(*code);
2057
- if (FLAG_trace_ic) {
2058
- PrintF("[BinaryOpIC (%s->%s)#%s]\n",
2059
- BinaryOpIC::GetName(previous_type),
2060
- BinaryOpIC::GetName(type),
2061
- Token::Name(op));
2062
- }
2063
- }
2064
-
2065
- Handle<JSBuiltinsObject> builtins = Handle<JSBuiltinsObject>(
2066
- isolate->thread_local_top()->context_->builtins(), isolate);
2067
- Object* builtin = NULL; // Initialization calms down the compiler.
2068
- switch (op) {
2069
- case Token::ADD:
2070
- builtin = builtins->javascript_builtin(Builtins::ADD);
2071
- break;
2072
- case Token::SUB:
2073
- builtin = builtins->javascript_builtin(Builtins::SUB);
2074
- break;
2075
- case Token::MUL:
2076
- builtin = builtins->javascript_builtin(Builtins::MUL);
2077
- break;
2078
- case Token::DIV:
2079
- builtin = builtins->javascript_builtin(Builtins::DIV);
2080
- break;
2081
- case Token::MOD:
2082
- builtin = builtins->javascript_builtin(Builtins::MOD);
2083
- break;
2084
- case Token::BIT_AND:
2085
- builtin = builtins->javascript_builtin(Builtins::BIT_AND);
2086
- break;
2087
- case Token::BIT_OR:
2088
- builtin = builtins->javascript_builtin(Builtins::BIT_OR);
2089
- break;
2090
- case Token::BIT_XOR:
2091
- builtin = builtins->javascript_builtin(Builtins::BIT_XOR);
2092
- break;
2093
- case Token::SHR:
2094
- builtin = builtins->javascript_builtin(Builtins::SHR);
2095
- break;
2096
- case Token::SAR:
2097
- builtin = builtins->javascript_builtin(Builtins::SAR);
2098
- break;
2099
- case Token::SHL:
2100
- builtin = builtins->javascript_builtin(Builtins::SHL);
2101
- break;
2102
- default:
2103
- UNREACHABLE();
2104
- }
2105
-
2106
- Handle<JSFunction> builtin_function(JSFunction::cast(builtin),
2107
- isolate);
2108
-
2109
- bool caught_exception;
2110
- Object** builtin_args[] = { right.location() };
2111
- Handle<Object> result = Execution::Call(builtin_function,
2112
- left,
2113
- ARRAY_SIZE(builtin_args),
2114
- builtin_args,
2115
- &caught_exception);
2116
- if (caught_exception) {
2117
- return Failure::Exception();
2118
- }
2119
- return *result;
2120
- }
2121
-
2122
-
2123
- void TRBinaryOpIC::patch(Code* code) {
2124
- set_target(code);
2125
- }
2126
-
2127
-
2128
- const char* TRBinaryOpIC::GetName(TypeInfo type_info) {
2129
- switch (type_info) {
2130
- case UNINITIALIZED: return "Uninitialized";
2131
- case SMI: return "SMI";
2132
- case INT32: return "Int32s";
2133
- case HEAP_NUMBER: return "HeapNumbers";
2134
- case ODDBALL: return "Oddball";
2135
- case STRING: return "Strings";
2136
- case GENERIC: return "Generic";
2137
- default: return "Invalid";
2138
- }
2139
- }
2140
-
2141
-
2142
- TRBinaryOpIC::State TRBinaryOpIC::ToState(TypeInfo type_info) {
2143
- switch (type_info) {
2144
- case UNINITIALIZED:
2145
- return ::v8::internal::UNINITIALIZED;
2146
- case SMI:
2147
- case INT32:
2148
- case HEAP_NUMBER:
2149
- case ODDBALL:
2150
- case STRING:
2151
- return MONOMORPHIC;
2152
- case GENERIC:
2153
- return MEGAMORPHIC;
2154
- }
2155
- UNREACHABLE();
2156
- return ::v8::internal::UNINITIALIZED;
2157
- }
2158
-
2159
-
2160
- TRBinaryOpIC::TypeInfo TRBinaryOpIC::JoinTypes(TRBinaryOpIC::TypeInfo x,
2161
- TRBinaryOpIC::TypeInfo y) {
2162
- if (x == UNINITIALIZED) return y;
2163
- if (y == UNINITIALIZED) return x;
2164
- if (x == STRING && y == STRING) return STRING;
2165
- if (x == STRING || y == STRING) return GENERIC;
2166
- if (x >= y) return x;
2167
- return y;
2168
- }
2169
-
2170
- TRBinaryOpIC::TypeInfo TRBinaryOpIC::GetTypeInfo(Handle<Object> left,
2171
- Handle<Object> right) {
2172
- ::v8::internal::TypeInfo left_type =
2173
- ::v8::internal::TypeInfo::TypeFromValue(left);
2174
- ::v8::internal::TypeInfo right_type =
2175
- ::v8::internal::TypeInfo::TypeFromValue(right);
2176
-
2177
- if (left_type.IsSmi() && right_type.IsSmi()) {
2178
- return SMI;
2179
- }
2180
-
2181
- if (left_type.IsInteger32() && right_type.IsInteger32()) {
2182
- // Platforms with 32-bit Smis have no distinct INT32 type.
2183
- if (kSmiValueSize == 32) return SMI;
2184
- return INT32;
2185
- }
2186
-
2187
- if (left_type.IsNumber() && right_type.IsNumber()) {
2188
- return HEAP_NUMBER;
2189
- }
2190
-
2191
- if (left_type.IsString() || right_type.IsString()) {
2192
- // Patching for fast string ADD makes sense even if only one of the
2193
- // arguments is a string.
2194
- return STRING;
2195
- }
2196
-
2197
- // Check for oddball objects.
2198
- if (left->IsUndefined() && right->IsNumber()) return ODDBALL;
2199
- if (left->IsNumber() && right->IsUndefined()) return ODDBALL;
2200
-
2201
- return GENERIC;
2202
- }
2203
-
2204
-
2205
- // defined in code-stubs-<arch>.cc
2206
- // Only needed to remove dependency of ic.cc on code-stubs-<arch>.h.
2207
- Handle<Code> GetTypeRecordingBinaryOpStub(int key,
2208
- TRBinaryOpIC::TypeInfo type_info,
2209
- TRBinaryOpIC::TypeInfo result_type);
2210
-
2211
-
2212
- RUNTIME_FUNCTION(MaybeObject*, TypeRecordingBinaryOp_Patch) {
2213
- ASSERT(args.length() == 5);
2214
-
2215
- HandleScope scope(isolate);
2216
- Handle<Object> left = args.at<Object>(0);
2217
- Handle<Object> right = args.at<Object>(1);
2218
- int key = Smi::cast(args[2])->value();
2219
- Token::Value op = static_cast<Token::Value>(Smi::cast(args[3])->value());
2220
- TRBinaryOpIC::TypeInfo previous_type =
2221
- static_cast<TRBinaryOpIC::TypeInfo>(Smi::cast(args[4])->value());
2222
-
2223
- TRBinaryOpIC::TypeInfo type = TRBinaryOpIC::GetTypeInfo(left, right);
2224
- type = TRBinaryOpIC::JoinTypes(type, previous_type);
2225
- TRBinaryOpIC::TypeInfo result_type = TRBinaryOpIC::UNINITIALIZED;
2226
- if (type == TRBinaryOpIC::STRING && op != Token::ADD) {
2227
- type = TRBinaryOpIC::GENERIC;
2228
- }
2229
- if (type == TRBinaryOpIC::SMI &&
2230
- previous_type == TRBinaryOpIC::SMI) {
2231
- if (op == Token::DIV || op == Token::MUL || kSmiValueSize == 32) {
2232
- // Arithmetic on two Smi inputs has yielded a heap number.
2233
- // That is the only way to get here from the Smi stub.
2234
- // With 32-bit Smis, all overflows give heap numbers, but with
2235
- // 31-bit Smis, most operations overflow to int32 results.
2236
- result_type = TRBinaryOpIC::HEAP_NUMBER;
2237
- } else {
2238
- // Other operations on SMIs that overflow yield int32s.
2239
- result_type = TRBinaryOpIC::INT32;
2240
- }
2241
- }
2242
- if (type == TRBinaryOpIC::INT32 &&
2243
- previous_type == TRBinaryOpIC::INT32) {
2244
- // We must be here because an operation on two INT32 types overflowed.
2245
- result_type = TRBinaryOpIC::HEAP_NUMBER;
2246
- }
2247
-
2248
- Handle<Code> code = GetTypeRecordingBinaryOpStub(key, type, result_type);
2249
- if (!code.is_null()) {
2250
- if (FLAG_trace_ic) {
2251
- PrintF("[TypeRecordingBinaryOpIC (%s->(%s->%s))#%s]\n",
2252
- TRBinaryOpIC::GetName(previous_type),
2253
- TRBinaryOpIC::GetName(type),
2254
- TRBinaryOpIC::GetName(result_type),
2255
- Token::Name(op));
2256
- }
2257
- TRBinaryOpIC ic(isolate);
2258
- ic.patch(*code);
2259
-
2260
- // Activate inlined smi code.
2261
- if (previous_type == TRBinaryOpIC::UNINITIALIZED) {
2262
- PatchInlinedSmiCode(ic.address());
2263
- }
2264
- }
2265
-
2266
- Handle<JSBuiltinsObject> builtins = Handle<JSBuiltinsObject>(
2267
- isolate->thread_local_top()->context_->builtins(), isolate);
2268
- Object* builtin = NULL; // Initialization calms down the compiler.
2269
- switch (op) {
2270
- case Token::ADD:
2271
- builtin = builtins->javascript_builtin(Builtins::ADD);
2272
- break;
2273
- case Token::SUB:
2274
- builtin = builtins->javascript_builtin(Builtins::SUB);
2275
- break;
2276
- case Token::MUL:
2277
- builtin = builtins->javascript_builtin(Builtins::MUL);
2278
- break;
2279
- case Token::DIV:
2280
- builtin = builtins->javascript_builtin(Builtins::DIV);
2281
- break;
2282
- case Token::MOD:
2283
- builtin = builtins->javascript_builtin(Builtins::MOD);
2284
- break;
2285
- case Token::BIT_AND:
2286
- builtin = builtins->javascript_builtin(Builtins::BIT_AND);
2287
- break;
2288
- case Token::BIT_OR:
2289
- builtin = builtins->javascript_builtin(Builtins::BIT_OR);
2290
- break;
2291
- case Token::BIT_XOR:
2292
- builtin = builtins->javascript_builtin(Builtins::BIT_XOR);
2293
- break;
2294
- case Token::SHR:
2295
- builtin = builtins->javascript_builtin(Builtins::SHR);
2296
- break;
2297
- case Token::SAR:
2298
- builtin = builtins->javascript_builtin(Builtins::SAR);
2299
- break;
2300
- case Token::SHL:
2301
- builtin = builtins->javascript_builtin(Builtins::SHL);
2302
- break;
2303
- default:
2304
- UNREACHABLE();
2305
- }
2306
-
2307
- Handle<JSFunction> builtin_function(JSFunction::cast(builtin), isolate);
2308
-
2309
- bool caught_exception;
2310
- Object** builtin_args[] = { right.location() };
2311
- Handle<Object> result = Execution::Call(builtin_function,
2312
- left,
2313
- ARRAY_SIZE(builtin_args),
2314
- builtin_args,
2315
- &caught_exception);
2316
- if (caught_exception) {
2317
- return Failure::Exception();
2318
- }
2319
- return *result;
2320
- }
2321
-
2322
-
2323
- Handle<Code> CompareIC::GetUninitialized(Token::Value op) {
2324
- ICCompareStub stub(op, UNINITIALIZED);
2325
- return stub.GetCode();
2326
- }
2327
-
2328
-
2329
- CompareIC::State CompareIC::ComputeState(Code* target) {
2330
- int key = target->major_key();
2331
- if (key == CodeStub::Compare) return GENERIC;
2332
- ASSERT(key == CodeStub::CompareIC);
2333
- return static_cast<State>(target->compare_state());
2334
- }
2335
-
2336
-
2337
- const char* CompareIC::GetStateName(State state) {
2338
- switch (state) {
2339
- case UNINITIALIZED: return "UNINITIALIZED";
2340
- case SMIS: return "SMIS";
2341
- case HEAP_NUMBERS: return "HEAP_NUMBERS";
2342
- case OBJECTS: return "OBJECTS";
2343
- case GENERIC: return "GENERIC";
2344
- default:
2345
- UNREACHABLE();
2346
- return NULL;
2347
- }
2348
- }
2349
-
2350
-
2351
- CompareIC::State CompareIC::TargetState(State state,
2352
- bool has_inlined_smi_code,
2353
- Handle<Object> x,
2354
- Handle<Object> y) {
2355
- if (!has_inlined_smi_code && state != UNINITIALIZED) return GENERIC;
2356
- if (state == UNINITIALIZED && x->IsSmi() && y->IsSmi()) return SMIS;
2357
- if ((state == UNINITIALIZED || (state == SMIS && has_inlined_smi_code)) &&
2358
- x->IsNumber() && y->IsNumber()) return HEAP_NUMBERS;
2359
- if (op_ != Token::EQ && op_ != Token::EQ_STRICT) return GENERIC;
2360
- if (state == UNINITIALIZED &&
2361
- x->IsJSObject() && y->IsJSObject()) return OBJECTS;
2362
- return GENERIC;
2363
- }
2364
-
2365
-
2366
- // Used from ic_<arch>.cc.
2367
- RUNTIME_FUNCTION(Code*, CompareIC_Miss) {
2368
- NoHandleAllocation na;
2369
- ASSERT(args.length() == 3);
2370
- CompareIC ic(isolate, static_cast<Token::Value>(Smi::cast(args[2])->value()));
2371
- ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1));
2372
- return ic.target();
2373
- }
2374
-
2375
-
2376
- static const Address IC_utilities[] = {
2377
- #define ADDR(name) FUNCTION_ADDR(name),
2378
- IC_UTIL_LIST(ADDR)
2379
- NULL
2380
- #undef ADDR
2381
- };
2382
-
2383
-
2384
- Address IC::AddressFromUtilityId(IC::UtilityId id) {
2385
- return IC_utilities[id];
2386
- }
2387
-
2388
-
2389
- } } // namespace v8::internal