libv8 3.3.10.4 → 3.5.10.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (538) hide show
  1. data/lib/libv8/scons/CHANGES.txt +24 -231
  2. data/lib/libv8/scons/LICENSE.txt +1 -1
  3. data/lib/libv8/scons/MANIFEST +0 -1
  4. data/lib/libv8/scons/PKG-INFO +1 -1
  5. data/lib/libv8/scons/README.txt +9 -9
  6. data/lib/libv8/scons/RELEASE.txt +75 -77
  7. data/lib/libv8/scons/engine/SCons/Action.py +6 -22
  8. data/lib/libv8/scons/engine/SCons/Builder.py +2 -2
  9. data/lib/libv8/scons/engine/SCons/CacheDir.py +2 -2
  10. data/lib/libv8/scons/engine/SCons/Debug.py +2 -2
  11. data/lib/libv8/scons/engine/SCons/Defaults.py +10 -24
  12. data/lib/libv8/scons/engine/SCons/Environment.py +19 -118
  13. data/lib/libv8/scons/engine/SCons/Errors.py +2 -2
  14. data/lib/libv8/scons/engine/SCons/Executor.py +2 -2
  15. data/lib/libv8/scons/engine/SCons/Job.py +2 -2
  16. data/lib/libv8/scons/engine/SCons/Memoize.py +2 -2
  17. data/lib/libv8/scons/engine/SCons/Node/Alias.py +2 -2
  18. data/lib/libv8/scons/engine/SCons/Node/FS.py +121 -281
  19. data/lib/libv8/scons/engine/SCons/Node/Python.py +2 -2
  20. data/lib/libv8/scons/engine/SCons/Node/__init__.py +5 -6
  21. data/lib/libv8/scons/engine/SCons/Options/BoolOption.py +2 -2
  22. data/lib/libv8/scons/engine/SCons/Options/EnumOption.py +2 -2
  23. data/lib/libv8/scons/engine/SCons/Options/ListOption.py +2 -2
  24. data/lib/libv8/scons/engine/SCons/Options/PackageOption.py +2 -2
  25. data/lib/libv8/scons/engine/SCons/Options/PathOption.py +2 -2
  26. data/lib/libv8/scons/engine/SCons/Options/__init__.py +2 -2
  27. data/lib/libv8/scons/engine/SCons/PathList.py +2 -2
  28. data/lib/libv8/scons/engine/SCons/Platform/__init__.py +2 -2
  29. data/lib/libv8/scons/engine/SCons/Platform/aix.py +2 -2
  30. data/lib/libv8/scons/engine/SCons/Platform/cygwin.py +2 -2
  31. data/lib/libv8/scons/engine/SCons/Platform/darwin.py +3 -27
  32. data/lib/libv8/scons/engine/SCons/Platform/hpux.py +2 -2
  33. data/lib/libv8/scons/engine/SCons/Platform/irix.py +2 -2
  34. data/lib/libv8/scons/engine/SCons/Platform/os2.py +2 -2
  35. data/lib/libv8/scons/engine/SCons/Platform/posix.py +2 -2
  36. data/lib/libv8/scons/engine/SCons/Platform/sunos.py +2 -2
  37. data/lib/libv8/scons/engine/SCons/Platform/win32.py +2 -2
  38. data/lib/libv8/scons/engine/SCons/SConf.py +2 -2
  39. data/lib/libv8/scons/engine/SCons/SConsign.py +3 -9
  40. data/lib/libv8/scons/engine/SCons/Scanner/C.py +2 -2
  41. data/lib/libv8/scons/engine/SCons/Scanner/D.py +2 -2
  42. data/lib/libv8/scons/engine/SCons/Scanner/Dir.py +2 -2
  43. data/lib/libv8/scons/engine/SCons/Scanner/Fortran.py +2 -2
  44. data/lib/libv8/scons/engine/SCons/Scanner/IDL.py +2 -2
  45. data/lib/libv8/scons/engine/SCons/Scanner/LaTeX.py +2 -5
  46. data/lib/libv8/scons/engine/SCons/Scanner/Prog.py +2 -2
  47. data/lib/libv8/scons/engine/SCons/Scanner/RC.py +3 -3
  48. data/lib/libv8/scons/engine/SCons/Scanner/__init__.py +2 -2
  49. data/lib/libv8/scons/engine/SCons/Script/Interactive.py +2 -2
  50. data/lib/libv8/scons/engine/SCons/Script/Main.py +11 -82
  51. data/lib/libv8/scons/engine/SCons/Script/SConsOptions.py +5 -5
  52. data/lib/libv8/scons/engine/SCons/Script/SConscript.py +2 -2
  53. data/lib/libv8/scons/engine/SCons/Script/__init__.py +2 -2
  54. data/lib/libv8/scons/engine/SCons/Sig.py +2 -2
  55. data/lib/libv8/scons/engine/SCons/Subst.py +2 -2
  56. data/lib/libv8/scons/engine/SCons/Taskmaster.py +2 -10
  57. data/lib/libv8/scons/engine/SCons/Tool/386asm.py +2 -2
  58. data/lib/libv8/scons/engine/SCons/Tool/BitKeeper.py +2 -2
  59. data/lib/libv8/scons/engine/SCons/Tool/CVS.py +2 -2
  60. data/lib/libv8/scons/engine/SCons/Tool/FortranCommon.py +2 -19
  61. data/lib/libv8/scons/engine/SCons/Tool/JavaCommon.py +2 -2
  62. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/__init__.py +2 -2
  63. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/arch.py +2 -2
  64. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/common.py +2 -2
  65. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/netframework.py +2 -2
  66. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/sdk.py +2 -2
  67. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vc.py +6 -9
  68. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vs.py +2 -29
  69. data/lib/libv8/scons/engine/SCons/Tool/Perforce.py +2 -2
  70. data/lib/libv8/scons/engine/SCons/Tool/PharLapCommon.py +2 -2
  71. data/lib/libv8/scons/engine/SCons/Tool/RCS.py +2 -2
  72. data/lib/libv8/scons/engine/SCons/Tool/SCCS.py +2 -2
  73. data/lib/libv8/scons/engine/SCons/Tool/Subversion.py +2 -2
  74. data/lib/libv8/scons/engine/SCons/Tool/__init__.py +3 -3
  75. data/lib/libv8/scons/engine/SCons/Tool/aixc++.py +2 -2
  76. data/lib/libv8/scons/engine/SCons/Tool/aixcc.py +2 -2
  77. data/lib/libv8/scons/engine/SCons/Tool/aixf77.py +2 -2
  78. data/lib/libv8/scons/engine/SCons/Tool/aixlink.py +2 -2
  79. data/lib/libv8/scons/engine/SCons/Tool/applelink.py +2 -2
  80. data/lib/libv8/scons/engine/SCons/Tool/ar.py +2 -2
  81. data/lib/libv8/scons/engine/SCons/Tool/as.py +2 -2
  82. data/lib/libv8/scons/engine/SCons/Tool/bcc32.py +2 -2
  83. data/lib/libv8/scons/engine/SCons/Tool/c++.py +2 -2
  84. data/lib/libv8/scons/engine/SCons/Tool/cc.py +2 -2
  85. data/lib/libv8/scons/engine/SCons/Tool/cvf.py +2 -2
  86. data/lib/libv8/scons/engine/SCons/Tool/default.py +2 -2
  87. data/lib/libv8/scons/engine/SCons/Tool/dmd.py +7 -24
  88. data/lib/libv8/scons/engine/SCons/Tool/dvi.py +2 -2
  89. data/lib/libv8/scons/engine/SCons/Tool/dvipdf.py +2 -3
  90. data/lib/libv8/scons/engine/SCons/Tool/dvips.py +2 -3
  91. data/lib/libv8/scons/engine/SCons/Tool/f77.py +2 -2
  92. data/lib/libv8/scons/engine/SCons/Tool/f90.py +2 -2
  93. data/lib/libv8/scons/engine/SCons/Tool/f95.py +2 -2
  94. data/lib/libv8/scons/engine/SCons/Tool/filesystem.py +2 -2
  95. data/lib/libv8/scons/engine/SCons/Tool/fortran.py +2 -2
  96. data/lib/libv8/scons/engine/SCons/Tool/g++.py +2 -2
  97. data/lib/libv8/scons/engine/SCons/Tool/g77.py +2 -2
  98. data/lib/libv8/scons/engine/SCons/Tool/gas.py +2 -2
  99. data/lib/libv8/scons/engine/SCons/Tool/gcc.py +2 -2
  100. data/lib/libv8/scons/engine/SCons/Tool/gfortran.py +3 -3
  101. data/lib/libv8/scons/engine/SCons/Tool/gnulink.py +3 -2
  102. data/lib/libv8/scons/engine/SCons/Tool/gs.py +2 -2
  103. data/lib/libv8/scons/engine/SCons/Tool/hpc++.py +2 -2
  104. data/lib/libv8/scons/engine/SCons/Tool/hpcc.py +2 -2
  105. data/lib/libv8/scons/engine/SCons/Tool/hplink.py +2 -2
  106. data/lib/libv8/scons/engine/SCons/Tool/icc.py +2 -2
  107. data/lib/libv8/scons/engine/SCons/Tool/icl.py +2 -2
  108. data/lib/libv8/scons/engine/SCons/Tool/ifl.py +2 -2
  109. data/lib/libv8/scons/engine/SCons/Tool/ifort.py +2 -2
  110. data/lib/libv8/scons/engine/SCons/Tool/ilink.py +2 -2
  111. data/lib/libv8/scons/engine/SCons/Tool/ilink32.py +2 -2
  112. data/lib/libv8/scons/engine/SCons/Tool/install.py +3 -57
  113. data/lib/libv8/scons/engine/SCons/Tool/intelc.py +25 -65
  114. data/lib/libv8/scons/engine/SCons/Tool/ipkg.py +2 -2
  115. data/lib/libv8/scons/engine/SCons/Tool/jar.py +3 -9
  116. data/lib/libv8/scons/engine/SCons/Tool/javac.py +2 -2
  117. data/lib/libv8/scons/engine/SCons/Tool/javah.py +2 -2
  118. data/lib/libv8/scons/engine/SCons/Tool/latex.py +2 -3
  119. data/lib/libv8/scons/engine/SCons/Tool/lex.py +2 -2
  120. data/lib/libv8/scons/engine/SCons/Tool/link.py +5 -6
  121. data/lib/libv8/scons/engine/SCons/Tool/linkloc.py +2 -2
  122. data/lib/libv8/scons/engine/SCons/Tool/m4.py +2 -2
  123. data/lib/libv8/scons/engine/SCons/Tool/masm.py +2 -2
  124. data/lib/libv8/scons/engine/SCons/Tool/midl.py +2 -2
  125. data/lib/libv8/scons/engine/SCons/Tool/mingw.py +10 -31
  126. data/lib/libv8/scons/engine/SCons/Tool/mslib.py +2 -2
  127. data/lib/libv8/scons/engine/SCons/Tool/mslink.py +9 -61
  128. data/lib/libv8/scons/engine/SCons/Tool/mssdk.py +2 -2
  129. data/lib/libv8/scons/engine/SCons/Tool/msvc.py +11 -21
  130. data/lib/libv8/scons/engine/SCons/Tool/msvs.py +59 -477
  131. data/lib/libv8/scons/engine/SCons/Tool/mwcc.py +2 -2
  132. data/lib/libv8/scons/engine/SCons/Tool/mwld.py +2 -2
  133. data/lib/libv8/scons/engine/SCons/Tool/nasm.py +2 -2
  134. data/lib/libv8/scons/engine/SCons/Tool/packaging/__init__.py +2 -2
  135. data/lib/libv8/scons/engine/SCons/Tool/packaging/ipk.py +2 -2
  136. data/lib/libv8/scons/engine/SCons/Tool/packaging/msi.py +2 -2
  137. data/lib/libv8/scons/engine/SCons/Tool/packaging/rpm.py +2 -2
  138. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_tarbz2.py +2 -2
  139. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_targz.py +2 -2
  140. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_zip.py +2 -2
  141. data/lib/libv8/scons/engine/SCons/Tool/packaging/tarbz2.py +2 -2
  142. data/lib/libv8/scons/engine/SCons/Tool/packaging/targz.py +2 -2
  143. data/lib/libv8/scons/engine/SCons/Tool/packaging/zip.py +2 -2
  144. data/lib/libv8/scons/engine/SCons/Tool/pdf.py +2 -2
  145. data/lib/libv8/scons/engine/SCons/Tool/pdflatex.py +2 -3
  146. data/lib/libv8/scons/engine/SCons/Tool/pdftex.py +2 -3
  147. data/lib/libv8/scons/engine/SCons/Tool/qt.py +2 -2
  148. data/lib/libv8/scons/engine/SCons/Tool/rmic.py +3 -9
  149. data/lib/libv8/scons/engine/SCons/Tool/rpcgen.py +2 -2
  150. data/lib/libv8/scons/engine/SCons/Tool/rpm.py +2 -2
  151. data/lib/libv8/scons/engine/SCons/Tool/sgiar.py +2 -2
  152. data/lib/libv8/scons/engine/SCons/Tool/sgic++.py +2 -2
  153. data/lib/libv8/scons/engine/SCons/Tool/sgicc.py +2 -2
  154. data/lib/libv8/scons/engine/SCons/Tool/sgilink.py +3 -2
  155. data/lib/libv8/scons/engine/SCons/Tool/sunar.py +2 -2
  156. data/lib/libv8/scons/engine/SCons/Tool/sunc++.py +2 -2
  157. data/lib/libv8/scons/engine/SCons/Tool/suncc.py +2 -2
  158. data/lib/libv8/scons/engine/SCons/Tool/sunf77.py +2 -2
  159. data/lib/libv8/scons/engine/SCons/Tool/sunf90.py +2 -2
  160. data/lib/libv8/scons/engine/SCons/Tool/sunf95.py +2 -2
  161. data/lib/libv8/scons/engine/SCons/Tool/sunlink.py +3 -2
  162. data/lib/libv8/scons/engine/SCons/Tool/swig.py +5 -6
  163. data/lib/libv8/scons/engine/SCons/Tool/tar.py +2 -2
  164. data/lib/libv8/scons/engine/SCons/Tool/tex.py +43 -96
  165. data/lib/libv8/scons/engine/SCons/Tool/textfile.py +2 -2
  166. data/lib/libv8/scons/engine/SCons/Tool/tlib.py +2 -2
  167. data/lib/libv8/scons/engine/SCons/Tool/wix.py +2 -2
  168. data/lib/libv8/scons/engine/SCons/Tool/yacc.py +2 -12
  169. data/lib/libv8/scons/engine/SCons/Tool/zip.py +2 -2
  170. data/lib/libv8/scons/engine/SCons/Util.py +3 -3
  171. data/lib/libv8/scons/engine/SCons/Variables/BoolVariable.py +2 -2
  172. data/lib/libv8/scons/engine/SCons/Variables/EnumVariable.py +3 -3
  173. data/lib/libv8/scons/engine/SCons/Variables/ListVariable.py +2 -2
  174. data/lib/libv8/scons/engine/SCons/Variables/PackageVariable.py +2 -2
  175. data/lib/libv8/scons/engine/SCons/Variables/PathVariable.py +2 -2
  176. data/lib/libv8/scons/engine/SCons/Variables/__init__.py +2 -2
  177. data/lib/libv8/scons/engine/SCons/Warnings.py +2 -2
  178. data/lib/libv8/scons/engine/SCons/__init__.py +6 -6
  179. data/lib/libv8/scons/engine/SCons/compat/__init__.py +2 -2
  180. data/lib/libv8/scons/engine/SCons/compat/_scons_builtins.py +2 -2
  181. data/lib/libv8/scons/engine/SCons/compat/_scons_collections.py +2 -2
  182. data/lib/libv8/scons/engine/SCons/compat/_scons_dbm.py +2 -2
  183. data/lib/libv8/scons/engine/SCons/compat/_scons_hashlib.py +2 -2
  184. data/lib/libv8/scons/engine/SCons/compat/_scons_io.py +2 -2
  185. data/lib/libv8/scons/engine/SCons/cpp.py +2 -2
  186. data/lib/libv8/scons/engine/SCons/dblite.py +1 -4
  187. data/lib/libv8/scons/engine/SCons/exitfuncs.py +2 -2
  188. data/lib/libv8/scons/scons-time.1 +3 -3
  189. data/lib/libv8/scons/scons.1 +1164 -1170
  190. data/lib/libv8/scons/sconsign.1 +3 -3
  191. data/lib/libv8/scons/script/scons +22 -22
  192. data/lib/libv8/scons/script/scons-time +2 -2
  193. data/lib/libv8/scons/script/scons.bat +4 -7
  194. data/lib/libv8/scons/script/sconsign +20 -21
  195. data/lib/libv8/scons/setup.cfg +1 -0
  196. data/lib/libv8/scons/setup.py +40 -38
  197. data/lib/libv8/v8/.gitignore +1 -1
  198. data/lib/libv8/v8/AUTHORS +2 -0
  199. data/lib/libv8/v8/ChangeLog +387 -0
  200. data/lib/libv8/v8/Makefile +171 -0
  201. data/lib/libv8/v8/SConstruct +124 -51
  202. data/lib/libv8/v8/build/README.txt +31 -14
  203. data/lib/libv8/v8/build/all.gyp +11 -4
  204. data/lib/libv8/v8/build/armu.gypi +6 -2
  205. data/lib/libv8/v8/build/common.gypi +240 -94
  206. data/lib/libv8/v8/build/gyp_v8 +32 -4
  207. data/lib/libv8/v8/build/standalone.gypi +200 -0
  208. data/lib/libv8/v8/include/v8-debug.h +0 -0
  209. data/lib/libv8/v8/include/v8-profiler.h +8 -11
  210. data/lib/libv8/v8/include/v8.h +191 -108
  211. data/lib/libv8/v8/preparser/SConscript +2 -2
  212. data/lib/libv8/v8/preparser/preparser-process.cc +3 -3
  213. data/lib/libv8/v8/preparser/preparser.gyp +42 -0
  214. data/lib/libv8/v8/src/SConscript +33 -8
  215. data/lib/libv8/v8/src/accessors.cc +77 -43
  216. data/lib/libv8/v8/src/api.cc +393 -191
  217. data/lib/libv8/v8/src/api.h +4 -8
  218. data/lib/libv8/v8/src/apinatives.js +15 -3
  219. data/lib/libv8/v8/src/arguments.h +8 -0
  220. data/lib/libv8/v8/src/arm/assembler-arm.cc +120 -120
  221. data/lib/libv8/v8/src/arm/assembler-arm.h +92 -43
  222. data/lib/libv8/v8/src/arm/builtins-arm.cc +32 -39
  223. data/lib/libv8/v8/src/arm/code-stubs-arm.cc +572 -351
  224. data/lib/libv8/v8/src/arm/code-stubs-arm.h +8 -77
  225. data/lib/libv8/v8/src/arm/codegen-arm.h +0 -2
  226. data/lib/libv8/v8/src/arm/deoptimizer-arm.cc +50 -30
  227. data/lib/libv8/v8/src/arm/disasm-arm.cc +1 -1
  228. data/lib/libv8/v8/src/arm/frames-arm.h +9 -5
  229. data/lib/libv8/v8/src/arm/full-codegen-arm.cc +331 -432
  230. data/lib/libv8/v8/src/arm/ic-arm.cc +192 -124
  231. data/lib/libv8/v8/src/arm/lithium-arm.cc +216 -232
  232. data/lib/libv8/v8/src/arm/lithium-arm.h +106 -259
  233. data/lib/libv8/v8/src/arm/lithium-codegen-arm.cc +633 -642
  234. data/lib/libv8/v8/src/arm/lithium-codegen-arm.h +4 -4
  235. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.cc +1 -3
  236. data/lib/libv8/v8/src/arm/macro-assembler-arm.cc +260 -185
  237. data/lib/libv8/v8/src/arm/macro-assembler-arm.h +45 -25
  238. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.cc +25 -13
  239. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.h +3 -0
  240. data/lib/libv8/v8/src/arm/stub-cache-arm.cc +413 -226
  241. data/lib/libv8/v8/src/array.js +38 -18
  242. data/lib/libv8/v8/src/assembler.cc +12 -5
  243. data/lib/libv8/v8/src/assembler.h +15 -9
  244. data/lib/libv8/v8/src/ast-inl.h +34 -25
  245. data/lib/libv8/v8/src/ast.cc +141 -72
  246. data/lib/libv8/v8/src/ast.h +255 -181
  247. data/lib/libv8/v8/src/bignum.cc +3 -4
  248. data/lib/libv8/v8/src/bootstrapper.cc +55 -11
  249. data/lib/libv8/v8/src/bootstrapper.h +3 -2
  250. data/lib/libv8/v8/src/builtins.cc +8 -2
  251. data/lib/libv8/v8/src/builtins.h +4 -0
  252. data/lib/libv8/v8/src/cached-powers.cc +8 -4
  253. data/lib/libv8/v8/src/checks.h +3 -3
  254. data/lib/libv8/v8/src/code-stubs.cc +173 -28
  255. data/lib/libv8/v8/src/code-stubs.h +104 -148
  256. data/lib/libv8/v8/src/codegen.cc +8 -8
  257. data/lib/libv8/v8/src/compilation-cache.cc +2 -47
  258. data/lib/libv8/v8/src/compilation-cache.h +0 -10
  259. data/lib/libv8/v8/src/compiler.cc +27 -16
  260. data/lib/libv8/v8/src/compiler.h +13 -18
  261. data/lib/libv8/v8/src/contexts.cc +107 -72
  262. data/lib/libv8/v8/src/contexts.h +70 -34
  263. data/lib/libv8/v8/src/conversions-inl.h +572 -14
  264. data/lib/libv8/v8/src/conversions.cc +9 -707
  265. data/lib/libv8/v8/src/conversions.h +23 -12
  266. data/lib/libv8/v8/src/cpu-profiler-inl.h +2 -19
  267. data/lib/libv8/v8/src/cpu-profiler.cc +4 -21
  268. data/lib/libv8/v8/src/cpu-profiler.h +8 -17
  269. data/lib/libv8/v8/src/d8-debug.cc +5 -3
  270. data/lib/libv8/v8/src/d8-debug.h +6 -7
  271. data/lib/libv8/v8/src/d8-posix.cc +1 -10
  272. data/lib/libv8/v8/src/d8.cc +721 -219
  273. data/lib/libv8/v8/src/d8.gyp +37 -12
  274. data/lib/libv8/v8/src/d8.h +141 -19
  275. data/lib/libv8/v8/src/d8.js +17 -8
  276. data/lib/libv8/v8/src/date.js +16 -5
  277. data/lib/libv8/v8/src/dateparser-inl.h +242 -39
  278. data/lib/libv8/v8/src/dateparser.cc +38 -4
  279. data/lib/libv8/v8/src/dateparser.h +170 -28
  280. data/lib/libv8/v8/src/debug-agent.cc +5 -3
  281. data/lib/libv8/v8/src/debug-agent.h +11 -7
  282. data/lib/libv8/v8/src/debug-debugger.js +65 -34
  283. data/lib/libv8/v8/src/debug.cc +30 -60
  284. data/lib/libv8/v8/src/debug.h +5 -3
  285. data/lib/libv8/v8/src/deoptimizer.cc +227 -10
  286. data/lib/libv8/v8/src/deoptimizer.h +133 -9
  287. data/lib/libv8/v8/src/disassembler.cc +22 -14
  288. data/lib/libv8/v8/src/diy-fp.cc +4 -3
  289. data/lib/libv8/v8/src/diy-fp.h +3 -3
  290. data/lib/libv8/v8/src/elements.cc +634 -0
  291. data/lib/libv8/v8/src/elements.h +95 -0
  292. data/lib/libv8/v8/src/execution.cc +5 -21
  293. data/lib/libv8/v8/src/extensions/experimental/break-iterator.cc +3 -1
  294. data/lib/libv8/v8/src/extensions/experimental/break-iterator.h +1 -1
  295. data/lib/libv8/v8/src/extensions/experimental/collator.cc +6 -2
  296. data/lib/libv8/v8/src/extensions/experimental/collator.h +1 -2
  297. data/lib/libv8/v8/src/extensions/experimental/datetime-format.cc +384 -0
  298. data/lib/libv8/v8/src/extensions/experimental/datetime-format.h +83 -0
  299. data/lib/libv8/v8/src/extensions/experimental/experimental.gyp +18 -7
  300. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.cc +12 -16
  301. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.h +1 -1
  302. data/lib/libv8/v8/src/extensions/experimental/i18n-js2c.py +126 -0
  303. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.cc +3 -4
  304. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.h +1 -1
  305. data/lib/libv8/v8/src/{shell.h → extensions/experimental/i18n-natives.h} +8 -20
  306. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.cc +45 -1
  307. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.h +21 -1
  308. data/lib/libv8/v8/src/extensions/experimental/i18n.js +211 -11
  309. data/lib/libv8/v8/src/extensions/experimental/language-matcher.cc +4 -3
  310. data/lib/libv8/v8/src/extensions/experimental/language-matcher.h +1 -1
  311. data/lib/libv8/v8/src/extensions/experimental/number-format.cc +374 -0
  312. data/lib/libv8/v8/src/extensions/experimental/number-format.h +71 -0
  313. data/lib/libv8/v8/src/factory.cc +89 -18
  314. data/lib/libv8/v8/src/factory.h +36 -8
  315. data/lib/libv8/v8/src/flag-definitions.h +11 -44
  316. data/lib/libv8/v8/src/frames-inl.h +8 -1
  317. data/lib/libv8/v8/src/frames.cc +39 -3
  318. data/lib/libv8/v8/src/frames.h +10 -3
  319. data/lib/libv8/v8/src/full-codegen.cc +311 -293
  320. data/lib/libv8/v8/src/full-codegen.h +183 -143
  321. data/lib/libv8/v8/src/func-name-inferrer.cc +29 -15
  322. data/lib/libv8/v8/src/func-name-inferrer.h +19 -9
  323. data/lib/libv8/v8/src/gdb-jit.cc +658 -55
  324. data/lib/libv8/v8/src/gdb-jit.h +6 -2
  325. data/lib/libv8/v8/src/global-handles.cc +368 -312
  326. data/lib/libv8/v8/src/global-handles.h +29 -36
  327. data/lib/libv8/v8/src/globals.h +3 -1
  328. data/lib/libv8/v8/src/handles.cc +43 -69
  329. data/lib/libv8/v8/src/handles.h +21 -16
  330. data/lib/libv8/v8/src/heap-inl.h +11 -13
  331. data/lib/libv8/v8/src/heap-profiler.cc +0 -999
  332. data/lib/libv8/v8/src/heap-profiler.h +0 -303
  333. data/lib/libv8/v8/src/heap.cc +366 -141
  334. data/lib/libv8/v8/src/heap.h +87 -26
  335. data/lib/libv8/v8/src/hydrogen-instructions.cc +192 -81
  336. data/lib/libv8/v8/src/hydrogen-instructions.h +711 -482
  337. data/lib/libv8/v8/src/hydrogen.cc +1146 -629
  338. data/lib/libv8/v8/src/hydrogen.h +100 -64
  339. data/lib/libv8/v8/src/ia32/assembler-ia32.cc +19 -0
  340. data/lib/libv8/v8/src/ia32/assembler-ia32.h +15 -2
  341. data/lib/libv8/v8/src/ia32/builtins-ia32.cc +34 -39
  342. data/lib/libv8/v8/src/ia32/code-stubs-ia32.cc +675 -377
  343. data/lib/libv8/v8/src/ia32/code-stubs-ia32.h +8 -69
  344. data/lib/libv8/v8/src/ia32/codegen-ia32.cc +1 -0
  345. data/lib/libv8/v8/src/ia32/codegen-ia32.h +0 -2
  346. data/lib/libv8/v8/src/ia32/cpu-ia32.cc +3 -2
  347. data/lib/libv8/v8/src/ia32/deoptimizer-ia32.cc +28 -3
  348. data/lib/libv8/v8/src/ia32/disasm-ia32.cc +21 -10
  349. data/lib/libv8/v8/src/ia32/frames-ia32.h +6 -5
  350. data/lib/libv8/v8/src/ia32/full-codegen-ia32.cc +459 -465
  351. data/lib/libv8/v8/src/ia32/ic-ia32.cc +196 -147
  352. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.cc +575 -650
  353. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.h +19 -21
  354. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.cc +7 -2
  355. data/lib/libv8/v8/src/ia32/lithium-ia32.cc +261 -256
  356. data/lib/libv8/v8/src/ia32/lithium-ia32.h +234 -335
  357. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.cc +224 -67
  358. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.h +63 -19
  359. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.cc +22 -8
  360. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.h +3 -0
  361. data/lib/libv8/v8/src/ia32/stub-cache-ia32.cc +380 -239
  362. data/lib/libv8/v8/src/ic.cc +198 -234
  363. data/lib/libv8/v8/src/ic.h +32 -30
  364. data/lib/libv8/v8/src/interpreter-irregexp.cc +6 -4
  365. data/lib/libv8/v8/src/isolate.cc +112 -95
  366. data/lib/libv8/v8/src/isolate.h +55 -71
  367. data/lib/libv8/v8/src/json-parser.h +486 -48
  368. data/lib/libv8/v8/src/json.js +28 -23
  369. data/lib/libv8/v8/src/jsregexp.cc +163 -208
  370. data/lib/libv8/v8/src/jsregexp.h +0 -1
  371. data/lib/libv8/v8/src/lithium-allocator-inl.h +29 -27
  372. data/lib/libv8/v8/src/lithium-allocator.cc +22 -17
  373. data/lib/libv8/v8/src/lithium-allocator.h +8 -8
  374. data/lib/libv8/v8/src/lithium.cc +16 -11
  375. data/lib/libv8/v8/src/lithium.h +31 -34
  376. data/lib/libv8/v8/src/liveedit.cc +111 -15
  377. data/lib/libv8/v8/src/liveedit.h +3 -4
  378. data/lib/libv8/v8/src/liveobjectlist.cc +116 -80
  379. data/lib/libv8/v8/src/liveobjectlist.h +2 -2
  380. data/lib/libv8/v8/src/log-inl.h +0 -4
  381. data/lib/libv8/v8/src/log-utils.cc +25 -143
  382. data/lib/libv8/v8/src/log-utils.h +13 -92
  383. data/lib/libv8/v8/src/log.cc +26 -249
  384. data/lib/libv8/v8/src/log.h +6 -17
  385. data/lib/libv8/v8/src/macros.py +9 -6
  386. data/lib/libv8/v8/src/mark-compact.cc +276 -56
  387. data/lib/libv8/v8/src/mark-compact.h +20 -0
  388. data/lib/libv8/v8/src/messages.js +93 -39
  389. data/lib/libv8/v8/src/mips/assembler-mips-inl.h +9 -3
  390. data/lib/libv8/v8/src/mips/assembler-mips.cc +297 -189
  391. data/lib/libv8/v8/src/mips/assembler-mips.h +121 -54
  392. data/lib/libv8/v8/src/mips/builtins-mips.cc +23 -24
  393. data/lib/libv8/v8/src/mips/code-stubs-mips.cc +484 -263
  394. data/lib/libv8/v8/src/mips/code-stubs-mips.h +8 -83
  395. data/lib/libv8/v8/src/mips/codegen-mips.h +0 -2
  396. data/lib/libv8/v8/src/mips/constants-mips.h +37 -11
  397. data/lib/libv8/v8/src/mips/deoptimizer-mips.cc +6 -1
  398. data/lib/libv8/v8/src/mips/frames-mips.h +8 -7
  399. data/lib/libv8/v8/src/mips/full-codegen-mips.cc +258 -419
  400. data/lib/libv8/v8/src/mips/ic-mips.cc +181 -121
  401. data/lib/libv8/v8/src/mips/macro-assembler-mips.cc +640 -382
  402. data/lib/libv8/v8/src/mips/macro-assembler-mips.h +94 -89
  403. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.cc +23 -10
  404. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.h +6 -1
  405. data/lib/libv8/v8/src/mips/simulator-mips.cc +249 -49
  406. data/lib/libv8/v8/src/mips/simulator-mips.h +25 -1
  407. data/lib/libv8/v8/src/mips/stub-cache-mips.cc +373 -161
  408. data/lib/libv8/v8/src/mirror-debugger.js +55 -8
  409. data/lib/libv8/v8/src/misc-intrinsics.h +89 -0
  410. data/lib/libv8/v8/src/mksnapshot.cc +36 -4
  411. data/lib/libv8/v8/src/natives.h +5 -2
  412. data/lib/libv8/v8/src/objects-debug.cc +73 -6
  413. data/lib/libv8/v8/src/objects-inl.h +529 -164
  414. data/lib/libv8/v8/src/objects-printer.cc +67 -12
  415. data/lib/libv8/v8/src/objects-visiting.cc +13 -2
  416. data/lib/libv8/v8/src/objects-visiting.h +41 -1
  417. data/lib/libv8/v8/src/objects.cc +2200 -1177
  418. data/lib/libv8/v8/src/objects.h +912 -283
  419. data/lib/libv8/v8/src/parser.cc +566 -371
  420. data/lib/libv8/v8/src/parser.h +35 -33
  421. data/lib/libv8/v8/src/platform-cygwin.cc +10 -25
  422. data/lib/libv8/v8/src/platform-freebsd.cc +4 -29
  423. data/lib/libv8/v8/src/platform-linux.cc +60 -57
  424. data/lib/libv8/v8/src/platform-macos.cc +4 -27
  425. data/lib/libv8/v8/src/platform-nullos.cc +3 -16
  426. data/lib/libv8/v8/src/platform-openbsd.cc +247 -85
  427. data/lib/libv8/v8/src/platform-posix.cc +43 -1
  428. data/lib/libv8/v8/src/platform-solaris.cc +151 -112
  429. data/lib/libv8/v8/src/platform-tls.h +1 -1
  430. data/lib/libv8/v8/src/platform-win32.cc +65 -39
  431. data/lib/libv8/v8/src/platform.h +17 -14
  432. data/lib/libv8/v8/src/preparse-data-format.h +2 -2
  433. data/lib/libv8/v8/src/preparse-data.h +8 -2
  434. data/lib/libv8/v8/src/preparser-api.cc +2 -18
  435. data/lib/libv8/v8/src/preparser.cc +106 -65
  436. data/lib/libv8/v8/src/preparser.h +26 -5
  437. data/lib/libv8/v8/src/prettyprinter.cc +25 -43
  438. data/lib/libv8/v8/src/profile-generator-inl.h +0 -4
  439. data/lib/libv8/v8/src/profile-generator.cc +213 -34
  440. data/lib/libv8/v8/src/profile-generator.h +9 -9
  441. data/lib/libv8/v8/src/property.h +1 -0
  442. data/lib/libv8/v8/src/proxy.js +74 -4
  443. data/lib/libv8/v8/src/regexp-macro-assembler.cc +10 -6
  444. data/lib/libv8/v8/src/regexp.js +16 -11
  445. data/lib/libv8/v8/src/rewriter.cc +24 -133
  446. data/lib/libv8/v8/src/runtime-profiler.cc +27 -151
  447. data/lib/libv8/v8/src/runtime-profiler.h +5 -31
  448. data/lib/libv8/v8/src/runtime.cc +1450 -681
  449. data/lib/libv8/v8/src/runtime.h +47 -31
  450. data/lib/libv8/v8/src/runtime.js +2 -1
  451. data/lib/libv8/v8/src/scanner-base.cc +358 -220
  452. data/lib/libv8/v8/src/scanner-base.h +30 -138
  453. data/lib/libv8/v8/src/scanner.cc +0 -18
  454. data/lib/libv8/v8/src/scanner.h +0 -15
  455. data/lib/libv8/v8/src/scopeinfo.cc +3 -1
  456. data/lib/libv8/v8/src/scopeinfo.h +1 -6
  457. data/lib/libv8/v8/src/scopes.cc +243 -253
  458. data/lib/libv8/v8/src/scopes.h +58 -109
  459. data/lib/libv8/v8/src/serialize.cc +12 -54
  460. data/lib/libv8/v8/src/serialize.h +47 -0
  461. data/lib/libv8/v8/src/small-pointer-list.h +25 -0
  462. data/lib/libv8/v8/src/spaces-inl.h +4 -50
  463. data/lib/libv8/v8/src/spaces.cc +64 -131
  464. data/lib/libv8/v8/src/spaces.h +19 -70
  465. data/lib/libv8/v8/src/string-stream.cc +3 -1
  466. data/lib/libv8/v8/src/string.js +10 -6
  467. data/lib/libv8/v8/src/strtod.cc +7 -3
  468. data/lib/libv8/v8/src/stub-cache.cc +59 -129
  469. data/lib/libv8/v8/src/stub-cache.h +42 -54
  470. data/lib/libv8/v8/src/third_party/valgrind/valgrind.h +1447 -1339
  471. data/lib/libv8/v8/src/token.cc +4 -4
  472. data/lib/libv8/v8/src/token.h +6 -5
  473. data/lib/libv8/v8/src/type-info.cc +173 -129
  474. data/lib/libv8/v8/src/type-info.h +40 -22
  475. data/lib/libv8/v8/src/utils.cc +25 -304
  476. data/lib/libv8/v8/src/utils.h +118 -3
  477. data/lib/libv8/v8/src/v8-counters.h +3 -6
  478. data/lib/libv8/v8/src/v8.cc +34 -27
  479. data/lib/libv8/v8/src/v8.h +7 -7
  480. data/lib/libv8/v8/src/v8conversions.cc +129 -0
  481. data/lib/libv8/v8/src/v8conversions.h +60 -0
  482. data/lib/libv8/v8/src/v8globals.h +15 -6
  483. data/lib/libv8/v8/src/v8natives.js +300 -78
  484. data/lib/libv8/v8/src/v8threads.cc +14 -6
  485. data/lib/libv8/v8/src/v8threads.h +4 -1
  486. data/lib/libv8/v8/src/v8utils.cc +360 -0
  487. data/lib/libv8/v8/src/v8utils.h +17 -66
  488. data/lib/libv8/v8/src/variables.cc +7 -12
  489. data/lib/libv8/v8/src/variables.h +12 -10
  490. data/lib/libv8/v8/src/version.cc +2 -2
  491. data/lib/libv8/v8/src/vm-state-inl.h +0 -41
  492. data/lib/libv8/v8/src/vm-state.h +0 -11
  493. data/lib/libv8/v8/src/weakmap.js +103 -0
  494. data/lib/libv8/v8/src/x64/assembler-x64.h +6 -3
  495. data/lib/libv8/v8/src/x64/builtins-x64.cc +25 -22
  496. data/lib/libv8/v8/src/x64/code-stubs-x64.cc +523 -250
  497. data/lib/libv8/v8/src/x64/code-stubs-x64.h +8 -71
  498. data/lib/libv8/v8/src/x64/codegen-x64.cc +1 -0
  499. data/lib/libv8/v8/src/x64/codegen-x64.h +0 -2
  500. data/lib/libv8/v8/src/x64/cpu-x64.cc +2 -1
  501. data/lib/libv8/v8/src/x64/deoptimizer-x64.cc +40 -8
  502. data/lib/libv8/v8/src/x64/disasm-x64.cc +12 -10
  503. data/lib/libv8/v8/src/x64/frames-x64.h +7 -6
  504. data/lib/libv8/v8/src/x64/full-codegen-x64.cc +310 -415
  505. data/lib/libv8/v8/src/x64/ic-x64.cc +180 -117
  506. data/lib/libv8/v8/src/x64/lithium-codegen-x64.cc +411 -523
  507. data/lib/libv8/v8/src/x64/lithium-codegen-x64.h +11 -6
  508. data/lib/libv8/v8/src/x64/lithium-x64.cc +191 -216
  509. data/lib/libv8/v8/src/x64/lithium-x64.h +112 -263
  510. data/lib/libv8/v8/src/x64/macro-assembler-x64.cc +177 -61
  511. data/lib/libv8/v8/src/x64/macro-assembler-x64.h +23 -7
  512. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.cc +21 -9
  513. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.h +6 -0
  514. data/lib/libv8/v8/src/x64/stub-cache-x64.cc +273 -107
  515. data/lib/libv8/v8/src/zone.cc +31 -22
  516. data/lib/libv8/v8/src/zone.h +12 -6
  517. data/lib/libv8/v8/tools/codemap.js +8 -0
  518. data/lib/libv8/v8/tools/gcmole/Makefile +43 -0
  519. data/lib/libv8/v8/tools/gcmole/gcmole.lua +0 -2
  520. data/lib/libv8/v8/tools/gdb-v8-support.py +154 -0
  521. data/lib/libv8/v8/tools/grokdump.py +44 -35
  522. data/lib/libv8/v8/tools/gyp/v8.gyp +94 -248
  523. data/lib/libv8/v8/tools/js2c.py +83 -52
  524. data/lib/libv8/v8/tools/linux-tick-processor +4 -6
  525. data/lib/libv8/v8/tools/ll_prof.py +3 -3
  526. data/lib/libv8/v8/tools/oom_dump/README +3 -1
  527. data/lib/libv8/v8/tools/presubmit.py +11 -4
  528. data/lib/libv8/v8/tools/profile.js +46 -2
  529. data/lib/libv8/v8/tools/splaytree.js +11 -0
  530. data/lib/libv8/v8/tools/stats-viewer.py +15 -11
  531. data/lib/libv8/v8/tools/test-wrapper-gypbuild.py +227 -0
  532. data/lib/libv8/v8/tools/test.py +28 -8
  533. data/lib/libv8/v8/tools/tickprocessor.js +0 -16
  534. data/lib/libv8/version.rb +1 -1
  535. data/libv8.gemspec +2 -2
  536. metadata +31 -19
  537. data/lib/libv8/scons/engine/SCons/Tool/f03.py +0 -63
  538. data/lib/libv8/v8/src/json-parser.cc +0 -504
@@ -59,35 +59,14 @@ class TranscendentalCacheStub: public CodeStub {
59
59
  };
60
60
 
61
61
 
62
- class ToBooleanStub: public CodeStub {
63
- public:
64
- explicit ToBooleanStub(Register tos) : tos_(tos) { }
65
-
66
- void Generate(MacroAssembler* masm);
67
-
68
- private:
69
- Register tos_;
70
- Major MajorKey() { return ToBoolean; }
71
- int MinorKey() { return tos_.code(); }
72
- };
73
-
74
-
75
62
  class UnaryOpStub: public CodeStub {
76
63
  public:
77
- UnaryOpStub(Token::Value op, UnaryOverwriteMode mode)
64
+ UnaryOpStub(Token::Value op,
65
+ UnaryOverwriteMode mode,
66
+ UnaryOpIC::TypeInfo operand_type = UnaryOpIC::UNINITIALIZED)
78
67
  : op_(op),
79
68
  mode_(mode),
80
- operand_type_(UnaryOpIC::UNINITIALIZED),
81
- name_(NULL) {
82
- }
83
-
84
- UnaryOpStub(
85
- int key,
86
- UnaryOpIC::TypeInfo operand_type)
87
- : op_(OpBits::decode(key)),
88
- mode_(ModeBits::decode(key)),
89
- operand_type_(operand_type),
90
- name_(NULL) {
69
+ operand_type_(operand_type) {
91
70
  }
92
71
 
93
72
  private:
@@ -97,20 +76,7 @@ class UnaryOpStub: public CodeStub {
97
76
  // Operand type information determined at runtime.
98
77
  UnaryOpIC::TypeInfo operand_type_;
99
78
 
100
- char* name_;
101
-
102
- const char* GetName();
103
-
104
- #ifdef DEBUG
105
- void Print() {
106
- PrintF("UnaryOpStub %d (op %s), "
107
- "(mode %d, runtime_type_info %s)\n",
108
- MinorKey(),
109
- Token::String(op_),
110
- static_cast<int>(mode_),
111
- UnaryOpIC::GetName(operand_type_));
112
- }
113
- #endif
79
+ virtual void PrintName(StringStream* stream);
114
80
 
115
81
  class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {};
116
82
  class OpBits: public BitField<Token::Value, 1, 7> {};
@@ -164,8 +130,7 @@ class BinaryOpStub: public CodeStub {
164
130
  : op_(op),
165
131
  mode_(mode),
166
132
  operands_type_(BinaryOpIC::UNINITIALIZED),
167
- result_type_(BinaryOpIC::UNINITIALIZED),
168
- name_(NULL) {
133
+ result_type_(BinaryOpIC::UNINITIALIZED) {
169
134
  use_fpu_ = CpuFeatures::IsSupported(FPU);
170
135
  ASSERT(OpBits::is_valid(Token::NUM_TOKENS));
171
136
  }
@@ -178,8 +143,7 @@ class BinaryOpStub: public CodeStub {
178
143
  mode_(ModeBits::decode(key)),
179
144
  use_fpu_(FPUBits::decode(key)),
180
145
  operands_type_(operands_type),
181
- result_type_(result_type),
182
- name_(NULL) { }
146
+ result_type_(result_type) { }
183
147
 
184
148
  private:
185
149
  enum SmiCodeGenerateHeapNumberResults {
@@ -195,20 +159,7 @@ class BinaryOpStub: public CodeStub {
195
159
  BinaryOpIC::TypeInfo operands_type_;
196
160
  BinaryOpIC::TypeInfo result_type_;
197
161
 
198
- char* name_;
199
-
200
- const char* GetName();
201
-
202
- #ifdef DEBUG
203
- void Print() {
204
- PrintF("BinaryOpStub %d (op %s), "
205
- "(mode %d, runtime_type_info %s)\n",
206
- MinorKey(),
207
- Token::String(op_),
208
- static_cast<int>(mode_),
209
- BinaryOpIC::GetName(operands_type_));
210
- }
211
- #endif
162
+ virtual void PrintName(StringStream* stream);
212
163
 
213
164
  // Minor key encoding in 16 bits RRRTTTVOOOOOOOMM.
214
165
  class ModeBits: public BitField<OverwriteMode, 0, 2> {};
@@ -395,12 +346,6 @@ class WriteInt32ToHeapNumberStub : public CodeStub {
395
346
  }
396
347
 
397
348
  void Generate(MacroAssembler* masm);
398
-
399
- const char* GetName() { return "WriteInt32ToHeapNumberStub"; }
400
-
401
- #ifdef DEBUG
402
- void Print() { PrintF("WriteInt32ToHeapNumberStub\n"); }
403
- #endif
404
349
  };
405
350
 
406
351
 
@@ -427,14 +372,6 @@ class NumberToStringStub: public CodeStub {
427
372
  int MinorKey() { return 0; }
428
373
 
429
374
  void Generate(MacroAssembler* masm);
430
-
431
- const char* GetName() { return "NumberToStringStub"; }
432
-
433
- #ifdef DEBUG
434
- void Print() {
435
- PrintF("NumberToStringStub\n");
436
- }
437
- #endif
438
375
  };
439
376
 
440
377
 
@@ -452,8 +389,6 @@ class RegExpCEntryStub: public CodeStub {
452
389
  int MinorKey() { return 0; }
453
390
 
454
391
  bool NeedsImmovableCode() { return true; }
455
-
456
- const char* GetName() { return "RegExpCEntryStub"; }
457
392
  };
458
393
 
459
394
  // Trampoline stub to call into native code. To call safely into native code
@@ -474,13 +409,10 @@ class DirectCEntryStub: public CodeStub {
474
409
  int MinorKey() { return 0; }
475
410
 
476
411
  bool NeedsImmovableCode() { return true; }
477
-
478
- const char* GetName() { return "DirectCEntryStub"; }
479
412
  };
480
413
 
481
414
  class FloatingPointHelper : public AllStatic {
482
415
  public:
483
-
484
416
  enum Destination {
485
417
  kFPURegisters,
486
418
  kCoreRegisters
@@ -658,13 +590,6 @@ class StringDictionaryLookupStub: public CodeStub {
658
590
  StringDictionary::kHeaderSize +
659
591
  StringDictionary::kElementsStartIndex * kPointerSize;
660
592
 
661
-
662
- #ifdef DEBUG
663
- void Print() {
664
- PrintF("StringDictionaryLookupStub\n");
665
- }
666
- #endif
667
-
668
593
  Major MajorKey() { return StringDictionaryNegativeLookup; }
669
594
 
670
595
  int MinorKey() {
@@ -60,9 +60,7 @@ class CodeGenerator: public AstVisitor {
60
60
  // Print the code after compiling it.
61
61
  static void PrintCode(Handle<Code> code, CompilationInfo* info);
62
62
 
63
- #ifdef ENABLE_LOGGING_AND_PROFILING
64
63
  static bool ShouldGenerateLog(Expression* type);
65
- #endif
66
64
 
67
65
  static void SetFunctionInfo(Handle<JSFunction> fun,
68
66
  FunctionLiteral* lit,
@@ -1,4 +1,4 @@
1
- // Copyright 2010 the V8 project authors. All rights reserved.
1
+ // Copyright 2011 the V8 project authors. All rights reserved.
2
2
  // Redistribution and use in source and binary forms, with or without
3
3
  // modification, are permitted provided that the following conditions are
4
4
  // met:
@@ -93,13 +93,27 @@ static const int kInvalidFPUControlRegister = -1;
93
93
  static const uint32_t kFPUInvalidResult = (uint32_t) (1 << 31) - 1;
94
94
 
95
95
  // FCSR constants.
96
- static const uint32_t kFCSRFlagMask = (1 << 6) - 1;
97
- static const uint32_t kFCSRFlagShift = 2;
98
- static const uint32_t kFCSRInexactFlagBit = 1 << 0;
99
- static const uint32_t kFCSRUnderflowFlagBit = 1 << 1;
100
- static const uint32_t kFCSROverflowFlagBit = 1 << 2;
101
- static const uint32_t kFCSRDivideByZeroFlagBit = 1 << 3;
102
- static const uint32_t kFCSRInvalidOpFlagBit = 1 << 4;
96
+ static const uint32_t kFCSRInexactFlagBit = 2;
97
+ static const uint32_t kFCSRUnderflowFlagBit = 3;
98
+ static const uint32_t kFCSROverflowFlagBit = 4;
99
+ static const uint32_t kFCSRDivideByZeroFlagBit = 5;
100
+ static const uint32_t kFCSRInvalidOpFlagBit = 6;
101
+
102
+ static const uint32_t kFCSRInexactFlagMask = 1 << kFCSRInexactFlagBit;
103
+ static const uint32_t kFCSRUnderflowFlagMask = 1 << kFCSRUnderflowFlagBit;
104
+ static const uint32_t kFCSROverflowFlagMask = 1 << kFCSROverflowFlagBit;
105
+ static const uint32_t kFCSRDivideByZeroFlagMask = 1 << kFCSRDivideByZeroFlagBit;
106
+ static const uint32_t kFCSRInvalidOpFlagMask = 1 << kFCSRInvalidOpFlagBit;
107
+
108
+ static const uint32_t kFCSRFlagMask =
109
+ kFCSRInexactFlagMask |
110
+ kFCSRUnderflowFlagMask |
111
+ kFCSROverflowFlagMask |
112
+ kFCSRDivideByZeroFlagMask |
113
+ kFCSRInvalidOpFlagMask;
114
+
115
+ static const uint32_t kFCSRExceptionFlagMask =
116
+ kFCSRFlagMask ^ kFCSRInexactFlagMask;
103
117
 
104
118
  // Helper functions for converting between register numbers and names.
105
119
  class Registers {
@@ -119,7 +133,6 @@ class Registers {
119
133
  static const int32_t kMinValue = 0x80000000;
120
134
 
121
135
  private:
122
-
123
136
  static const char* names_[kNumSimuRegisters];
124
137
  static const RegisterAlias aliases_[];
125
138
  };
@@ -139,7 +152,6 @@ class FPURegisters {
139
152
  };
140
153
 
141
154
  private:
142
-
143
155
  static const char* names_[kNumFPURegisters];
144
156
  static const RegisterAlias aliases_[];
145
157
  };
@@ -158,6 +170,18 @@ enum SoftwareInterruptCodes {
158
170
  call_rt_redirected = 0xfffff
159
171
  };
160
172
 
173
+ // On MIPS Simulator breakpoints can have different codes:
174
+ // - Breaks between 0 and kMaxWatchpointCode are treated as simple watchpoints,
175
+ // the simulator will run through them and print the registers.
176
+ // - Breaks between kMaxWatchpointCode and kMaxStopCode are treated as stop()
177
+ // instructions (see Assembler::stop()).
178
+ // - Breaks larger than kMaxStopCode are simple breaks, dropping you into the
179
+ // debugger.
180
+ static const uint32_t kMaxWatchpointCode = 31;
181
+ static const uint32_t kMaxStopCode = 127;
182
+ STATIC_ASSERT(kMaxWatchpointCode < kMaxStopCode);
183
+
184
+
161
185
  // ----- Fields offset and length.
162
186
  static const int kOpcodeShift = 26;
163
187
  static const int kOpcodeBits = 6;
@@ -177,6 +201,8 @@ static const int kImm16Shift = 0;
177
201
  static const int kImm16Bits = 16;
178
202
  static const int kImm26Shift = 0;
179
203
  static const int kImm26Bits = 26;
204
+ static const int kImm28Shift = 0;
205
+ static const int kImm28Bits = 28;
180
206
 
181
207
  static const int kFsShift = 11;
182
208
  static const int kFsBits = 5;
@@ -196,6 +222,7 @@ static const int kFBtrueBits = 1;
196
222
  static const int kOpcodeMask = ((1 << kOpcodeBits) - 1) << kOpcodeShift;
197
223
  static const int kImm16Mask = ((1 << kImm16Bits) - 1) << kImm16Shift;
198
224
  static const int kImm26Mask = ((1 << kImm26Bits) - 1) << kImm26Shift;
225
+ static const int kImm28Mask = ((1 << kImm28Bits) - 1) << kImm28Shift;
199
226
  static const int kRsFieldMask = ((1 << kRsBits) - 1) << kRsShift;
200
227
  static const int kRtFieldMask = ((1 << kRtBits) - 1) << kRtShift;
201
228
  static const int kRdFieldMask = ((1 << kRdBits) - 1) << kRdShift;
@@ -736,4 +763,3 @@ static const int kDoubleAlignmentMask = kDoubleAlignment - 1;
736
763
  } } // namespace v8::internal
737
764
 
738
765
  #endif // #ifndef V8_MIPS_CONSTANTS_H_
739
-
@@ -39,7 +39,7 @@ namespace v8 {
39
39
  namespace internal {
40
40
 
41
41
 
42
- int Deoptimizer::table_entry_size_ = 10;
42
+ const int Deoptimizer::table_entry_size_ = 10;
43
43
 
44
44
 
45
45
  int Deoptimizer::patch_size() {
@@ -78,6 +78,11 @@ void Deoptimizer::DoComputeFrame(TranslationIterator* iterator,
78
78
  }
79
79
 
80
80
 
81
+ void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
82
+ UNIMPLEMENTED();
83
+ }
84
+
85
+
81
86
  void Deoptimizer::EntryGenerator::Generate() {
82
87
  UNIMPLEMENTED();
83
88
  }
@@ -59,10 +59,10 @@ static const RegList kCalleeSaved =
59
59
  // Saved temporaries.
60
60
  1 << 16 | 1 << 17 | 1 << 18 | 1 << 19 |
61
61
  1 << 20 | 1 << 21 | 1 << 22 | 1 << 23 |
62
- // gp, sp, fp.
63
- 1 << 28 | 1 << 29 | 1 << 30;
62
+ // fp.
63
+ 1 << 30;
64
64
 
65
- static const int kNumCalleeSaved = 11;
65
+ static const int kNumCalleeSaved = 9;
66
66
 
67
67
 
68
68
  // Number of registers for which space is reserved in safepoints. Must be a
@@ -121,10 +121,11 @@ static const int kSafepointRegisterStackIndexMap[kNumRegs] = {
121
121
 
122
122
  class StackHandlerConstants : public AllStatic {
123
123
  public:
124
- static const int kNextOffset = 0 * kPointerSize;
125
- static const int kStateOffset = 1 * kPointerSize;
126
- static const int kFPOffset = 2 * kPointerSize;
127
- static const int kPCOffset = 3 * kPointerSize;
124
+ static const int kNextOffset = 0 * kPointerSize;
125
+ static const int kStateOffset = 1 * kPointerSize;
126
+ static const int kContextOffset = 2 * kPointerSize;
127
+ static const int kFPOffset = 3 * kPointerSize;
128
+ static const int kPCOffset = 4 * kPointerSize;
128
129
 
129
130
  static const int kSize = kPCOffset + kPointerSize;
130
131
  };
@@ -55,7 +55,6 @@ namespace internal {
55
55
 
56
56
 
57
57
  static unsigned GetPropertyId(Property* property) {
58
- if (property->is_synthetic()) return AstNode::kNoNumber;
59
58
  return property->id();
60
59
  }
61
60
 
@@ -101,16 +100,18 @@ class JumpPatchSite BASE_EMBEDDED {
101
100
  }
102
101
 
103
102
  void EmitPatchInfo() {
104
- int delta_to_patch_site = masm_->InstructionsGeneratedSince(&patch_site_);
105
- Register reg = Register::from_code(delta_to_patch_site / kImm16Mask);
106
- __ andi(at, reg, delta_to_patch_site % kImm16Mask);
103
+ if (patch_site_.is_bound()) {
104
+ int delta_to_patch_site = masm_->InstructionsGeneratedSince(&patch_site_);
105
+ Register reg = Register::from_code(delta_to_patch_site / kImm16Mask);
106
+ __ andi(at, reg, delta_to_patch_site % kImm16Mask);
107
107
  #ifdef DEBUG
108
- info_emitted_ = true;
108
+ info_emitted_ = true;
109
109
  #endif
110
+ } else {
111
+ __ nop(); // Signals no inlined code.
112
+ }
110
113
  }
111
114
 
112
- bool is_bound() const { return patch_site_.is_bound(); }
113
-
114
115
  private:
115
116
  MacroAssembler* masm_;
116
117
  Label patch_site_;
@@ -137,6 +138,7 @@ class JumpPatchSite BASE_EMBEDDED {
137
138
  void FullCodeGenerator::Generate(CompilationInfo* info) {
138
139
  ASSERT(info_ == NULL);
139
140
  info_ = info;
141
+ scope_ = info->scope();
140
142
  SetFunctionPosition(function());
141
143
  Comment cmnt(masm_, "[ function compiled by full code generator");
142
144
 
@@ -147,20 +149,20 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
147
149
  }
148
150
  #endif
149
151
 
150
- // Strict mode functions need to replace the receiver with undefined
151
- // when called as functions (without an explicit receiver
152
- // object). t1 is zero for method calls and non-zero for function
153
- // calls.
154
- if (info->is_strict_mode()) {
152
+ // Strict mode functions and builtins need to replace the receiver
153
+ // with undefined when called as functions (without an explicit
154
+ // receiver object). t1 is zero for method calls and non-zero for
155
+ // function calls.
156
+ if (info->is_strict_mode() || info->is_native()) {
155
157
  Label ok;
156
158
  __ Branch(&ok, eq, t1, Operand(zero_reg));
157
- int receiver_offset = scope()->num_parameters() * kPointerSize;
159
+ int receiver_offset = info->scope()->num_parameters() * kPointerSize;
158
160
  __ LoadRoot(a2, Heap::kUndefinedValueRootIndex);
159
161
  __ sw(a2, MemOperand(sp, receiver_offset));
160
162
  __ bind(&ok);
161
163
  }
162
164
 
163
- int locals_count = scope()->num_stack_slots();
165
+ int locals_count = info->scope()->num_stack_slots();
164
166
 
165
167
  __ Push(ra, fp, cp, a1);
166
168
  if (locals_count > 0) {
@@ -180,7 +182,7 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
180
182
  bool function_in_register = true;
181
183
 
182
184
  // Possibly allocate a local context.
183
- int heap_slots = scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
185
+ int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
184
186
  if (heap_slots > 0) {
185
187
  Comment cmnt(masm_, "[ Allocate local context");
186
188
  // Argument to NewContext is the function, which is in a1.
@@ -189,14 +191,14 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
189
191
  FastNewContextStub stub(heap_slots);
190
192
  __ CallStub(&stub);
191
193
  } else {
192
- __ CallRuntime(Runtime::kNewContext, 1);
194
+ __ CallRuntime(Runtime::kNewFunctionContext, 1);
193
195
  }
194
196
  function_in_register = false;
195
197
  // Context is returned in both v0 and cp. It replaces the context
196
198
  // passed to us. It's saved in the stack and kept live in cp.
197
199
  __ sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
198
200
  // Copy any necessary parameters into the context.
199
- int num_parameters = scope()->num_parameters();
201
+ int num_parameters = info->scope()->num_parameters();
200
202
  for (int i = 0; i < num_parameters; i++) {
201
203
  Slot* slot = scope()->parameter(i)->AsSlot();
202
204
  if (slot != NULL && slot->type() == Slot::CONTEXT) {
@@ -228,27 +230,28 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
228
230
  __ mov(a3, a1);
229
231
  }
230
232
  // Receiver is just before the parameters on the caller's stack.
231
- int offset = scope()->num_parameters() * kPointerSize;
233
+ int num_parameters = info->scope()->num_parameters();
234
+ int offset = num_parameters * kPointerSize;
232
235
  __ Addu(a2, fp,
233
236
  Operand(StandardFrameConstants::kCallerSPOffset + offset));
234
- __ li(a1, Operand(Smi::FromInt(scope()->num_parameters())));
237
+ __ li(a1, Operand(Smi::FromInt(num_parameters)));
235
238
  __ Push(a3, a2, a1);
236
239
 
237
240
  // Arguments to ArgumentsAccessStub:
238
241
  // function, receiver address, parameter count.
239
242
  // The stub will rewrite receiever and parameter count if the previous
240
243
  // stack frame was an arguments adapter frame.
241
- ArgumentsAccessStub stub(
242
- is_strict_mode() ? ArgumentsAccessStub::NEW_STRICT
243
- : ArgumentsAccessStub::NEW_NON_STRICT);
244
+ ArgumentsAccessStub::Type type;
245
+ if (is_strict_mode()) {
246
+ type = ArgumentsAccessStub::NEW_STRICT;
247
+ } else if (function()->has_duplicate_parameters()) {
248
+ type = ArgumentsAccessStub::NEW_NON_STRICT_SLOW;
249
+ } else {
250
+ type = ArgumentsAccessStub::NEW_NON_STRICT_FAST;
251
+ }
252
+ ArgumentsAccessStub stub(type);
244
253
  __ CallStub(&stub);
245
254
 
246
- Variable* arguments_shadow = scope()->arguments_shadow();
247
- if (arguments_shadow != NULL) {
248
- // Duplicate the value; move-to-slot operation might clobber registers.
249
- __ mov(a3, v0);
250
- Move(arguments_shadow->AsSlot(), a3, a1, a2);
251
- }
252
255
  Move(arguments->AsSlot(), v0, a1, a2);
253
256
  }
254
257
 
@@ -348,7 +351,7 @@ void FullCodeGenerator::EmitReturnSequence() {
348
351
  { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_);
349
352
  // Here we use masm_-> instead of the __ macro to avoid the code coverage
350
353
  // tool from instrumenting as we rely on the code size here.
351
- int32_t sp_delta = (scope()->num_parameters() + 1) * kPointerSize;
354
+ int32_t sp_delta = (info_->scope()->num_parameters() + 1) * kPointerSize;
352
355
  CodeGenerator::RecordPositions(masm_, function()->end_position() - 1);
353
356
  __ RecordJSReturn();
354
357
  masm_->mov(sp, fp);
@@ -386,7 +389,7 @@ void FullCodeGenerator::TestContext::Plug(Slot* slot) const {
386
389
  // For simplicity we always test the accumulator register.
387
390
  codegen()->Move(result_register(), slot);
388
391
  codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
389
- codegen()->DoTest(true_label_, false_label_, fall_through_);
392
+ codegen()->DoTest(this);
390
393
  }
391
394
 
392
395
 
@@ -420,7 +423,7 @@ void FullCodeGenerator::TestContext::Plug(Heap::RootListIndex index) const {
420
423
  if (true_label_ != fall_through_) __ Branch(true_label_);
421
424
  } else {
422
425
  __ LoadRoot(result_register(), index);
423
- codegen()->DoTest(true_label_, false_label_, fall_through_);
426
+ codegen()->DoTest(this);
424
427
  }
425
428
  }
426
429
 
@@ -467,7 +470,7 @@ void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const {
467
470
  } else {
468
471
  // For simplicity we always test the accumulator register.
469
472
  __ li(result_register(), Operand(lit));
470
- codegen()->DoTest(true_label_, false_label_, fall_through_);
473
+ codegen()->DoTest(this);
471
474
  }
472
475
  }
473
476
 
@@ -503,7 +506,7 @@ void FullCodeGenerator::TestContext::DropAndPlug(int count,
503
506
  __ Drop(count);
504
507
  __ Move(result_register(), reg);
505
508
  codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
506
- codegen()->DoTest(true_label_, false_label_, fall_through_);
509
+ codegen()->DoTest(this);
507
510
  }
508
511
 
509
512
 
@@ -581,7 +584,8 @@ void FullCodeGenerator::TestContext::Plug(bool flag) const {
581
584
  }
582
585
 
583
586
 
584
- void FullCodeGenerator::DoTest(Label* if_true,
587
+ void FullCodeGenerator::DoTest(Expression* condition,
588
+ Label* if_true,
585
589
  Label* if_false,
586
590
  Label* fall_through) {
587
591
  if (CpuFeatures::IsSupported(FPU)) {
@@ -692,105 +696,77 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
692
696
  Comment cmnt(masm_, "[ Declaration");
693
697
  ASSERT(variable != NULL); // Must have been resolved.
694
698
  Slot* slot = variable->AsSlot();
695
- Property* prop = variable->AsProperty();
696
-
697
- if (slot != NULL) {
698
- switch (slot->type()) {
699
- case Slot::PARAMETER:
700
- case Slot::LOCAL:
701
- if (mode == Variable::CONST) {
702
- __ LoadRoot(t0, Heap::kTheHoleValueRootIndex);
703
- __ sw(t0, MemOperand(fp, SlotOffset(slot)));
704
- } else if (function != NULL) {
705
- VisitForAccumulatorValue(function);
706
- __ sw(result_register(), MemOperand(fp, SlotOffset(slot)));
707
- }
708
- break;
709
-
710
- case Slot::CONTEXT:
711
- // We bypass the general EmitSlotSearch because we know more about
712
- // this specific context.
713
-
714
- // The variable in the decl always resides in the current function
715
- // context.
716
- ASSERT_EQ(0, scope()->ContextChainLength(variable->scope()));
717
- if (FLAG_debug_code) {
718
- // Check that we're not inside a 'with'.
719
- __ lw(a1, ContextOperand(cp, Context::FCONTEXT_INDEX));
720
- __ Check(eq, "Unexpected declaration in current context.",
721
- a1, Operand(cp));
722
- }
723
- if (mode == Variable::CONST) {
724
- __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
725
- __ sw(at, ContextOperand(cp, slot->index()));
726
- // No write barrier since the_hole_value is in old space.
727
- } else if (function != NULL) {
728
- VisitForAccumulatorValue(function);
729
- __ sw(result_register(), ContextOperand(cp, slot->index()));
730
- int offset = Context::SlotOffset(slot->index());
731
- // We know that we have written a function, which is not a smi.
732
- __ mov(a1, cp);
733
- __ RecordWrite(a1, Operand(offset), a2, result_register());
734
- }
735
- break;
736
-
737
- case Slot::LOOKUP: {
738
- __ li(a2, Operand(variable->name()));
739
- // Declaration nodes are always introduced in one of two modes.
740
- ASSERT(mode == Variable::VAR ||
741
- mode == Variable::CONST);
742
- PropertyAttributes attr =
743
- (mode == Variable::VAR) ? NONE : READ_ONLY;
744
- __ li(a1, Operand(Smi::FromInt(attr)));
745
- // Push initial value, if any.
746
- // Note: For variables we must not push an initial value (such as
747
- // 'undefined') because we may have a (legal) redeclaration and we
748
- // must not destroy the current value.
749
- if (mode == Variable::CONST) {
750
- __ LoadRoot(a0, Heap::kTheHoleValueRootIndex);
751
- __ Push(cp, a2, a1, a0);
752
- } else if (function != NULL) {
753
- __ Push(cp, a2, a1);
754
- // Push initial value for function declaration.
755
- VisitForStackValue(function);
756
- } else {
757
- ASSERT(Smi::FromInt(0) == 0);
758
- // No initial value!
759
- __ mov(a0, zero_reg); // Operand(Smi::FromInt(0)));
760
- __ Push(cp, a2, a1, a0);
761
- }
762
- __ CallRuntime(Runtime::kDeclareContextSlot, 4);
763
- break;
699
+ ASSERT(slot != NULL);
700
+ switch (slot->type()) {
701
+ case Slot::PARAMETER:
702
+ case Slot::LOCAL:
703
+ if (mode == Variable::CONST) {
704
+ __ LoadRoot(t0, Heap::kTheHoleValueRootIndex);
705
+ __ sw(t0, MemOperand(fp, SlotOffset(slot)));
706
+ } else if (function != NULL) {
707
+ VisitForAccumulatorValue(function);
708
+ __ sw(result_register(), MemOperand(fp, SlotOffset(slot)));
764
709
  }
765
- }
710
+ break;
766
711
 
767
- } else if (prop != NULL) {
768
- // A const declaration aliasing a parameter is an illegal redeclaration.
769
- ASSERT(mode != Variable::CONST);
770
- if (function != NULL) {
771
- // We are declaring a function that rewrites to a property.
772
- // Use (keyed) IC to set the initial value. We cannot visit the
773
- // rewrite because it's shared and we risk recording duplicate AST
774
- // IDs for bailouts from optimized code.
775
- ASSERT(prop->obj()->AsVariableProxy() != NULL);
776
- { AccumulatorValueContext for_object(this);
777
- EmitVariableLoad(prop->obj()->AsVariableProxy()->var());
712
+ case Slot::CONTEXT:
713
+ // We bypass the general EmitSlotSearch because we know more about
714
+ // this specific context.
715
+
716
+ // The variable in the decl always resides in the current function
717
+ // context.
718
+ ASSERT_EQ(0, scope()->ContextChainLength(variable->scope()));
719
+ if (FLAG_debug_code) {
720
+ // Check that we're not inside a with or catch context.
721
+ __ lw(a1, FieldMemOperand(cp, HeapObject::kMapOffset));
722
+ __ LoadRoot(t0, Heap::kWithContextMapRootIndex);
723
+ __ Check(ne, "Declaration in with context.",
724
+ a1, Operand(t0));
725
+ __ LoadRoot(t0, Heap::kCatchContextMapRootIndex);
726
+ __ Check(ne, "Declaration in catch context.",
727
+ a1, Operand(t0));
778
728
  }
729
+ if (mode == Variable::CONST) {
730
+ __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
731
+ __ sw(at, ContextOperand(cp, slot->index()));
732
+ // No write barrier since the_hole_value is in old space.
733
+ } else if (function != NULL) {
734
+ VisitForAccumulatorValue(function);
735
+ __ sw(result_register(), ContextOperand(cp, slot->index()));
736
+ int offset = Context::SlotOffset(slot->index());
737
+ // We know that we have written a function, which is not a smi.
738
+ __ mov(a1, cp);
739
+ __ RecordWrite(a1, Operand(offset), a2, result_register());
740
+ }
741
+ break;
779
742
 
780
- __ push(result_register());
781
- VisitForAccumulatorValue(function);
782
- __ mov(a0, result_register());
783
- __ pop(a2);
784
-
785
- ASSERT(prop->key()->AsLiteral() != NULL &&
786
- prop->key()->AsLiteral()->handle()->IsSmi());
787
- __ li(a1, Operand(prop->key()->AsLiteral()->handle()));
788
-
789
- Handle<Code> ic = is_strict_mode()
790
- ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
791
- : isolate()->builtins()->KeyedStoreIC_Initialize();
792
- EmitCallIC(ic, RelocInfo::CODE_TARGET, AstNode::kNoNumber);
793
- // Value in v0 is ignored (declarations are statements).
743
+ case Slot::LOOKUP: {
744
+ __ li(a2, Operand(variable->name()));
745
+ // Declaration nodes are always introduced in one of two modes.
746
+ ASSERT(mode == Variable::VAR ||
747
+ mode == Variable::CONST ||
748
+ mode == Variable::LET);
749
+ PropertyAttributes attr = (mode == Variable::CONST) ? READ_ONLY : NONE;
750
+ __ li(a1, Operand(Smi::FromInt(attr)));
751
+ // Push initial value, if any.
752
+ // Note: For variables we must not push an initial value (such as
753
+ // 'undefined') because we may have a (legal) redeclaration and we
754
+ // must not destroy the current value.
755
+ if (mode == Variable::CONST) {
756
+ __ LoadRoot(a0, Heap::kTheHoleValueRootIndex);
757
+ __ Push(cp, a2, a1, a0);
758
+ } else if (function != NULL) {
759
+ __ Push(cp, a2, a1);
760
+ // Push initial value for function declaration.
761
+ VisitForStackValue(function);
762
+ } else {
763
+ ASSERT(Smi::FromInt(0) == 0);
764
+ // No initial value!
765
+ __ mov(a0, zero_reg); // Operand(Smi::FromInt(0)));
766
+ __ Push(cp, a2, a1, a0);
767
+ }
768
+ __ CallRuntime(Runtime::kDeclareContextSlot, 4);
769
+ break;
794
770
  }
795
771
  }
796
772
  }
@@ -864,7 +840,8 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
864
840
  // Record position before stub call for type feedback.
865
841
  SetSourcePosition(clause->position());
866
842
  Handle<Code> ic = CompareIC::GetUninitialized(Token::EQ_STRICT);
867
- EmitCallIC(ic, &patch_site, clause->CompareId());
843
+ __ Call(ic, RelocInfo::CODE_TARGET, clause->CompareId());
844
+ patch_site.EmitPatchInfo();
868
845
 
869
846
  __ Branch(&next_test, ne, v0, Operand(zero_reg));
870
847
  __ Drop(1); // Switch value is no longer needed.
@@ -876,7 +853,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
876
853
  __ bind(&next_test);
877
854
  __ Drop(1); // Switch value is no longer needed.
878
855
  if (default_clause == NULL) {
879
- __ Branch(nested_statement.break_target());
856
+ __ Branch(nested_statement.break_label());
880
857
  } else {
881
858
  __ Branch(default_clause->body_target());
882
859
  }
@@ -890,7 +867,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
890
867
  VisitStatements(clause->statements());
891
868
  }
892
869
 
893
- __ bind(nested_statement.break_target());
870
+ __ bind(nested_statement.break_label());
894
871
  PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
895
872
  }
896
873
 
@@ -918,7 +895,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
918
895
  Label convert, done_convert;
919
896
  __ JumpIfSmi(a0, &convert);
920
897
  __ GetObjectType(a0, a1, a1);
921
- __ Branch(&done_convert, hs, a1, Operand(FIRST_JS_OBJECT_TYPE));
898
+ __ Branch(&done_convert, ge, a1, Operand(FIRST_SPEC_OBJECT_TYPE));
922
899
  __ bind(&convert);
923
900
  __ push(a0);
924
901
  __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
@@ -1016,7 +993,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
1016
993
  // Load the current count to a0, load the length to a1.
1017
994
  __ lw(a0, MemOperand(sp, 0 * kPointerSize));
1018
995
  __ lw(a1, MemOperand(sp, 1 * kPointerSize));
1019
- __ Branch(loop_statement.break_target(), hs, a0, Operand(a1));
996
+ __ Branch(loop_statement.break_label(), hs, a0, Operand(a1));
1020
997
 
1021
998
  // Get the current entry of the array into register a3.
1022
999
  __ lw(a2, MemOperand(sp, 2 * kPointerSize));
@@ -1043,7 +1020,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
1043
1020
  __ push(a3); // Current entry.
1044
1021
  __ InvokeBuiltin(Builtins::FILTER_KEY, CALL_FUNCTION);
1045
1022
  __ mov(a3, result_register());
1046
- __ Branch(loop_statement.continue_target(), eq, a3, Operand(zero_reg));
1023
+ __ Branch(loop_statement.continue_label(), eq, a3, Operand(zero_reg));
1047
1024
 
1048
1025
  // Update the 'each' property or variable from the possibly filtered
1049
1026
  // entry in register a3.
@@ -1059,7 +1036,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
1059
1036
 
1060
1037
  // Generate code for the going to the next element by incrementing
1061
1038
  // the index (smi) stored on top of the stack.
1062
- __ bind(loop_statement.continue_target());
1039
+ __ bind(loop_statement.continue_label());
1063
1040
  __ pop(a0);
1064
1041
  __ Addu(a0, a0, Operand(Smi::FromInt(1)));
1065
1042
  __ push(a0);
@@ -1068,7 +1045,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
1068
1045
  __ Branch(&loop);
1069
1046
 
1070
1047
  // Remove the pointers stored on the stack.
1071
- __ bind(loop_statement.break_target());
1048
+ __ bind(loop_statement.break_label());
1072
1049
  __ Drop(5);
1073
1050
 
1074
1051
  // Exit and decrement the loop depth.
@@ -1107,7 +1084,7 @@ void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info,
1107
1084
 
1108
1085
  void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
1109
1086
  Comment cmnt(masm_, "[ VariableProxy");
1110
- EmitVariableLoad(expr->var());
1087
+ EmitVariableLoad(expr);
1111
1088
  }
1112
1089
 
1113
1090
 
@@ -1128,8 +1105,7 @@ void FullCodeGenerator::EmitLoadGlobalSlotCheckExtensions(
1128
1105
  __ Branch(slow, ne, temp, Operand(zero_reg));
1129
1106
  }
1130
1107
  // Load next context in chain.
1131
- __ lw(next, ContextOperand(current, Context::CLOSURE_INDEX));
1132
- __ lw(next, FieldMemOperand(next, JSFunction::kContextOffset));
1108
+ __ lw(next, ContextOperand(current, Context::PREVIOUS_INDEX));
1133
1109
  // Walk the rest of the chain without clobbering cp.
1134
1110
  current = next;
1135
1111
  }
@@ -1153,8 +1129,7 @@ void FullCodeGenerator::EmitLoadGlobalSlotCheckExtensions(
1153
1129
  __ lw(temp, ContextOperand(next, Context::EXTENSION_INDEX));
1154
1130
  __ Branch(slow, ne, temp, Operand(zero_reg));
1155
1131
  // Load next context in chain.
1156
- __ lw(next, ContextOperand(next, Context::CLOSURE_INDEX));
1157
- __ lw(next, FieldMemOperand(next, JSFunction::kContextOffset));
1132
+ __ lw(next, ContextOperand(next, Context::PREVIOUS_INDEX));
1158
1133
  __ Branch(&loop);
1159
1134
  __ bind(&fast);
1160
1135
  }
@@ -1165,7 +1140,7 @@ void FullCodeGenerator::EmitLoadGlobalSlotCheckExtensions(
1165
1140
  ? RelocInfo::CODE_TARGET
1166
1141
  : RelocInfo::CODE_TARGET_CONTEXT;
1167
1142
  Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
1168
- EmitCallIC(ic, mode, AstNode::kNoNumber);
1143
+ __ Call(ic, mode);
1169
1144
  }
1170
1145
 
1171
1146
 
@@ -1184,8 +1159,7 @@ MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(
1184
1159
  __ lw(temp, ContextOperand(context, Context::EXTENSION_INDEX));
1185
1160
  __ Branch(slow, ne, temp, Operand(zero_reg));
1186
1161
  }
1187
- __ lw(next, ContextOperand(context, Context::CLOSURE_INDEX));
1188
- __ lw(next, FieldMemOperand(next, JSFunction::kContextOffset));
1162
+ __ lw(next, ContextOperand(context, Context::PREVIOUS_INDEX));
1189
1163
  // Walk the rest of the chain without clobbering cp.
1190
1164
  context = next;
1191
1165
  }
@@ -1246,7 +1220,7 @@ void FullCodeGenerator::EmitDynamicLoadFromSlotFastCase(
1246
1220
  __ li(a0, Operand(key_literal->handle()));
1247
1221
  Handle<Code> ic =
1248
1222
  isolate()->builtins()->KeyedLoadIC_Initialize();
1249
- EmitCallIC(ic, RelocInfo::CODE_TARGET, GetPropertyId(property));
1223
+ __ Call(ic, RelocInfo::CODE_TARGET, GetPropertyId(property));
1250
1224
  __ Branch(done);
1251
1225
  }
1252
1226
  }
@@ -1255,24 +1229,27 @@ void FullCodeGenerator::EmitDynamicLoadFromSlotFastCase(
1255
1229
  }
1256
1230
 
1257
1231
 
1258
- void FullCodeGenerator::EmitVariableLoad(Variable* var) {
1259
- // Four cases: non-this global variables, lookup slots, all other
1260
- // types of slots, and parameters that rewrite to explicit property
1261
- // accesses on the arguments object.
1232
+ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) {
1233
+ // Record position before possible IC call.
1234
+ SetSourcePosition(proxy->position());
1235
+ Variable* var = proxy->var();
1236
+
1237
+ // Three cases: non-this global variables, lookup slots, and all other
1238
+ // types of slots.
1262
1239
  Slot* slot = var->AsSlot();
1263
- Property* property = var->AsProperty();
1240
+ ASSERT((var->is_global() && !var->is_this()) == (slot == NULL));
1264
1241
 
1265
- if (var->is_global() && !var->is_this()) {
1242
+ if (slot == NULL) {
1266
1243
  Comment cmnt(masm_, "Global variable");
1267
1244
  // Use inline caching. Variable name is passed in a2 and the global
1268
1245
  // object (receiver) in a0.
1269
1246
  __ lw(a0, GlobalObjectOperand());
1270
1247
  __ li(a2, Operand(var->name()));
1271
1248
  Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
1272
- EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT, AstNode::kNoNumber);
1249
+ __ Call(ic, RelocInfo::CODE_TARGET_CONTEXT);
1273
1250
  context()->Plug(v0);
1274
1251
 
1275
- } else if (slot != NULL && slot->type() == Slot::LOOKUP) {
1252
+ } else if (slot->type() == Slot::LOOKUP) {
1276
1253
  Label done, slow;
1277
1254
 
1278
1255
  // Generate code for loading from variables potentially shadowed
@@ -1288,7 +1265,7 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var) {
1288
1265
 
1289
1266
  context()->Plug(v0);
1290
1267
 
1291
- } else if (slot != NULL) {
1268
+ } else {
1292
1269
  Comment cmnt(masm_, (slot->type() == Slot::CONTEXT)
1293
1270
  ? "Context slot"
1294
1271
  : "Stack slot");
@@ -1305,31 +1282,6 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var) {
1305
1282
  } else {
1306
1283
  context()->Plug(slot);
1307
1284
  }
1308
- } else {
1309
- Comment cmnt(masm_, "Rewritten parameter");
1310
- ASSERT_NOT_NULL(property);
1311
- // Rewritten parameter accesses are of the form "slot[literal]".
1312
- // Assert that the object is in a slot.
1313
- Variable* object_var = property->obj()->AsVariableProxy()->AsVariable();
1314
- ASSERT_NOT_NULL(object_var);
1315
- Slot* object_slot = object_var->AsSlot();
1316
- ASSERT_NOT_NULL(object_slot);
1317
-
1318
- // Load the object.
1319
- Move(a1, object_slot);
1320
-
1321
- // Assert that the key is a smi.
1322
- Literal* key_literal = property->key()->AsLiteral();
1323
- ASSERT_NOT_NULL(key_literal);
1324
- ASSERT(key_literal->handle()->IsSmi());
1325
-
1326
- // Load the key.
1327
- __ li(a0, Operand(key_literal->handle()));
1328
-
1329
- // Call keyed load IC. It has arguments key and receiver in a0 and a1.
1330
- Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
1331
- EmitCallIC(ic, RelocInfo::CODE_TARGET, GetPropertyId(property));
1332
- context()->Plug(v0);
1333
1285
  }
1334
1286
  }
1335
1287
 
@@ -1440,7 +1392,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
1440
1392
  Handle<Code> ic = is_strict_mode()
1441
1393
  ? isolate()->builtins()->StoreIC_Initialize_Strict()
1442
1394
  : isolate()->builtins()->StoreIC_Initialize();
1443
- EmitCallIC(ic, RelocInfo::CODE_TARGET, key->id());
1395
+ __ Call(ic, RelocInfo::CODE_TARGET, key->id());
1444
1396
  PrepareForBailoutForId(key->id(), NO_REGISTERS);
1445
1397
  } else {
1446
1398
  VisitForEffect(value);
@@ -1548,9 +1500,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
1548
1500
 
1549
1501
  // Update the write barrier for the array store with v0 as the scratch
1550
1502
  // register.
1551
- __ li(a2, Operand(offset));
1552
- // TODO(PJ): double check this RecordWrite call.
1553
- __ RecordWrite(a1, a2, result_register());
1503
+ __ RecordWrite(a1, Operand(offset), a2, result_register());
1554
1504
 
1555
1505
  PrepareForBailoutForId(expr->GetIdForElement(i), NO_REGISTERS);
1556
1506
  }
@@ -1573,7 +1523,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
1573
1523
  }
1574
1524
 
1575
1525
  // Left-hand side can only be a property, a global or a (parameter or local)
1576
- // slot. Variables with rewrite to .arguments are treated as KEYED_PROPERTY.
1526
+ // slot.
1577
1527
  enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY };
1578
1528
  LhsKind assign_type = VARIABLE;
1579
1529
  Property* property = expr->target()->AsProperty();
@@ -1600,27 +1550,13 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
1600
1550
  case KEYED_PROPERTY:
1601
1551
  // We need the key and receiver on both the stack and in v0 and a1.
1602
1552
  if (expr->is_compound()) {
1603
- if (property->is_arguments_access()) {
1604
- VariableProxy* obj_proxy = property->obj()->AsVariableProxy();
1605
- __ lw(v0, EmitSlotSearch(obj_proxy->var()->AsSlot(), v0));
1606
- __ push(v0);
1607
- __ li(v0, Operand(property->key()->AsLiteral()->handle()));
1608
- } else {
1609
- VisitForStackValue(property->obj());
1610
- VisitForAccumulatorValue(property->key());
1611
- }
1553
+ VisitForStackValue(property->obj());
1554
+ VisitForAccumulatorValue(property->key());
1612
1555
  __ lw(a1, MemOperand(sp, 0));
1613
1556
  __ push(v0);
1614
1557
  } else {
1615
- if (property->is_arguments_access()) {
1616
- VariableProxy* obj_proxy = property->obj()->AsVariableProxy();
1617
- __ lw(a1, EmitSlotSearch(obj_proxy->var()->AsSlot(), v0));
1618
- __ li(v0, Operand(property->key()->AsLiteral()->handle()));
1619
- __ Push(a1, v0);
1620
- } else {
1621
- VisitForStackValue(property->obj());
1622
- VisitForStackValue(property->key());
1623
- }
1558
+ VisitForStackValue(property->obj());
1559
+ VisitForStackValue(property->key());
1624
1560
  }
1625
1561
  break;
1626
1562
  }
@@ -1631,7 +1567,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
1631
1567
  { AccumulatorValueContext context(this);
1632
1568
  switch (assign_type) {
1633
1569
  case VARIABLE:
1634
- EmitVariableLoad(expr->target()->AsVariableProxy()->var());
1570
+ EmitVariableLoad(expr->target()->AsVariableProxy());
1635
1571
  PrepareForBailout(expr->target(), TOS_REG);
1636
1572
  break;
1637
1573
  case NAMED_PROPERTY:
@@ -1698,7 +1634,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
1698
1634
  __ li(a2, Operand(key->handle()));
1699
1635
  // Call load IC. It has arguments receiver and property name a0 and a2.
1700
1636
  Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
1701
- EmitCallIC(ic, RelocInfo::CODE_TARGET, GetPropertyId(prop));
1637
+ __ Call(ic, RelocInfo::CODE_TARGET, GetPropertyId(prop));
1702
1638
  }
1703
1639
 
1704
1640
 
@@ -1707,7 +1643,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
1707
1643
  __ mov(a0, result_register());
1708
1644
  // Call keyed load IC. It has arguments key and receiver in a0 and a1.
1709
1645
  Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
1710
- EmitCallIC(ic, RelocInfo::CODE_TARGET, GetPropertyId(prop));
1646
+ __ Call(ic, RelocInfo::CODE_TARGET, GetPropertyId(prop));
1711
1647
  }
1712
1648
 
1713
1649
 
@@ -1735,7 +1671,8 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
1735
1671
 
1736
1672
  __ bind(&stub_call);
1737
1673
  BinaryOpStub stub(op, mode);
1738
- EmitCallIC(stub.GetCode(), &patch_site, expr->id());
1674
+ __ Call(stub.GetCode(), RelocInfo::CODE_TARGET, expr->id());
1675
+ patch_site.EmitPatchInfo();
1739
1676
  __ jmp(&done);
1740
1677
 
1741
1678
  __ bind(&smi_case);
@@ -1816,7 +1753,9 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr,
1816
1753
  __ mov(a0, result_register());
1817
1754
  __ pop(a1);
1818
1755
  BinaryOpStub stub(op, mode);
1819
- EmitCallIC(stub.GetCode(), NULL, expr->id());
1756
+ JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
1757
+ __ Call(stub.GetCode(), RelocInfo::CODE_TARGET, expr->id());
1758
+ patch_site.EmitPatchInfo();
1820
1759
  context()->Plug(v0);
1821
1760
  }
1822
1761
 
@@ -1830,7 +1769,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) {
1830
1769
  }
1831
1770
 
1832
1771
  // Left-hand side can only be a property, a global or a (parameter or local)
1833
- // slot. Variables with rewrite to .arguments are treated as KEYED_PROPERTY.
1772
+ // slot.
1834
1773
  enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY };
1835
1774
  LhsKind assign_type = VARIABLE;
1836
1775
  Property* prop = expr->AsProperty();
@@ -1856,30 +1795,20 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) {
1856
1795
  Handle<Code> ic = is_strict_mode()
1857
1796
  ? isolate()->builtins()->StoreIC_Initialize_Strict()
1858
1797
  : isolate()->builtins()->StoreIC_Initialize();
1859
- EmitCallIC(ic, RelocInfo::CODE_TARGET, AstNode::kNoNumber);
1798
+ __ Call(ic);
1860
1799
  break;
1861
1800
  }
1862
1801
  case KEYED_PROPERTY: {
1863
1802
  __ push(result_register()); // Preserve value.
1864
- if (prop->is_synthetic()) {
1865
- ASSERT(prop->obj()->AsVariableProxy() != NULL);
1866
- ASSERT(prop->key()->AsLiteral() != NULL);
1867
- { AccumulatorValueContext for_object(this);
1868
- EmitVariableLoad(prop->obj()->AsVariableProxy()->var());
1869
- }
1870
- __ mov(a2, result_register());
1871
- __ li(a1, Operand(prop->key()->AsLiteral()->handle()));
1872
- } else {
1873
- VisitForStackValue(prop->obj());
1874
- VisitForAccumulatorValue(prop->key());
1875
- __ mov(a1, result_register());
1876
- __ pop(a2);
1877
- }
1803
+ VisitForStackValue(prop->obj());
1804
+ VisitForAccumulatorValue(prop->key());
1805
+ __ mov(a1, result_register());
1806
+ __ pop(a2);
1878
1807
  __ pop(a0); // Restore value.
1879
1808
  Handle<Code> ic = is_strict_mode()
1880
1809
  ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
1881
1810
  : isolate()->builtins()->KeyedStoreIC_Initialize();
1882
- EmitCallIC(ic, RelocInfo::CODE_TARGET, AstNode::kNoNumber);
1811
+ __ Call(ic);
1883
1812
  break;
1884
1813
  }
1885
1814
  }
@@ -1890,8 +1819,6 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) {
1890
1819
 
1891
1820
  void FullCodeGenerator::EmitVariableAssignment(Variable* var,
1892
1821
  Token::Value op) {
1893
- // Left-hand sides that rewrite to explicit property accesses do not reach
1894
- // here.
1895
1822
  ASSERT(var != NULL);
1896
1823
  ASSERT(var->is_global() || var->AsSlot() != NULL);
1897
1824
 
@@ -1906,7 +1833,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
1906
1833
  Handle<Code> ic = is_strict_mode()
1907
1834
  ? isolate()->builtins()->StoreIC_Initialize_Strict()
1908
1835
  : isolate()->builtins()->StoreIC_Initialize();
1909
- EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT, AstNode::kNoNumber);
1836
+ __ Call(ic, RelocInfo::CODE_TARGET_CONTEXT);
1910
1837
 
1911
1838
  } else if (op == Token::INIT_CONST) {
1912
1839
  // Like var declarations, const declarations are hoisted to function
@@ -1927,17 +1854,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
1927
1854
  __ Branch(&skip, ne, a1, Operand(t0));
1928
1855
  __ sw(result_register(), MemOperand(fp, SlotOffset(slot)));
1929
1856
  break;
1930
- case Slot::CONTEXT: {
1931
- __ lw(a1, ContextOperand(cp, Context::FCONTEXT_INDEX));
1932
- __ lw(a2, ContextOperand(a1, slot->index()));
1933
- __ LoadRoot(t0, Heap::kTheHoleValueRootIndex);
1934
- __ Branch(&skip, ne, a2, Operand(t0));
1935
- __ sw(result_register(), ContextOperand(a1, slot->index()));
1936
- int offset = Context::SlotOffset(slot->index());
1937
- __ mov(a3, result_register()); // Preserve the stored value in v0.
1938
- __ RecordWrite(a1, Operand(offset), a3, a2);
1939
- break;
1940
- }
1857
+ case Slot::CONTEXT:
1941
1858
  case Slot::LOOKUP:
1942
1859
  __ push(result_register());
1943
1860
  __ li(a0, Operand(slot->var()->name()));
@@ -2014,7 +1931,7 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
2014
1931
  Handle<Code> ic = is_strict_mode()
2015
1932
  ? isolate()->builtins()->StoreIC_Initialize_Strict()
2016
1933
  : isolate()->builtins()->StoreIC_Initialize();
2017
- EmitCallIC(ic, RelocInfo::CODE_TARGET, expr->id());
1934
+ __ Call(ic, RelocInfo::CODE_TARGET, expr->id());
2018
1935
 
2019
1936
  // If the assignment ends an initialization block, revert to fast case.
2020
1937
  if (expr->ends_initialization_block()) {
@@ -2066,7 +1983,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
2066
1983
  Handle<Code> ic = is_strict_mode()
2067
1984
  ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
2068
1985
  : isolate()->builtins()->KeyedStoreIC_Initialize();
2069
- EmitCallIC(ic, RelocInfo::CODE_TARGET, expr->id());
1986
+ __ Call(ic, RelocInfo::CODE_TARGET, expr->id());
2070
1987
 
2071
1988
  // If the assignment ends an initialization block, revert to fast case.
2072
1989
  if (expr->ends_initialization_block()) {
@@ -2119,7 +2036,7 @@ void FullCodeGenerator::EmitCallWithIC(Call* expr,
2119
2036
  InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
2120
2037
  Handle<Code> ic =
2121
2038
  isolate()->stub_cache()->ComputeCallInitialize(arg_count, in_loop, mode);
2122
- EmitCallIC(ic, mode, expr->id());
2039
+ __ Call(ic, mode, expr->id());
2123
2040
  RecordJSReturnSite(expr);
2124
2041
  // Restore context register.
2125
2042
  __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
@@ -2153,7 +2070,7 @@ void FullCodeGenerator::EmitKeyedCallWithIC(Call* expr,
2153
2070
  Handle<Code> ic =
2154
2071
  isolate()->stub_cache()->ComputeKeyedCallInitialize(arg_count, in_loop);
2155
2072
  __ lw(a2, MemOperand(sp, (arg_count + 1) * kPointerSize)); // Key.
2156
- EmitCallIC(ic, RelocInfo::CODE_TARGET, expr->id());
2073
+ __ Call(ic, RelocInfo::CODE_TARGET, expr->id());
2157
2074
  RecordJSReturnSite(expr);
2158
2075
  // Restore context register.
2159
2076
  __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
@@ -2193,7 +2110,8 @@ void FullCodeGenerator::EmitResolvePossiblyDirectEval(ResolveEvalFlag flag,
2193
2110
  __ push(a1);
2194
2111
 
2195
2112
  // Push the receiver of the enclosing function and do runtime call.
2196
- __ lw(a1, MemOperand(fp, (2 + scope()->num_parameters()) * kPointerSize));
2113
+ int receiver_offset = 2 + info_->scope()->num_parameters();
2114
+ __ lw(a1, MemOperand(fp, receiver_offset * kPointerSize));
2197
2115
  __ push(a1);
2198
2116
  // Push the strict mode flag.
2199
2117
  __ li(a1, Operand(Smi::FromInt(strict_mode_flag())));
@@ -2310,9 +2228,9 @@ void FullCodeGenerator::VisitCall(Call* expr) {
2310
2228
  __ bind(&done);
2311
2229
  // Push function.
2312
2230
  __ push(v0);
2313
- // Push global receiver.
2314
- __ lw(a1, GlobalObjectOperand());
2315
- __ lw(a1, FieldMemOperand(a1, GlobalObject::kGlobalReceiverOffset));
2231
+ // The receiver is implicitly the global receiver. Indicate this
2232
+ // by passing the hole to the call function stub.
2233
+ __ LoadRoot(a1, Heap::kTheHoleValueRootIndex);
2316
2234
  __ push(a1);
2317
2235
  __ bind(&call);
2318
2236
  }
@@ -2333,36 +2251,10 @@ void FullCodeGenerator::VisitCall(Call* expr) {
2333
2251
  EmitCallWithIC(expr, key->handle(), RelocInfo::CODE_TARGET);
2334
2252
  } else {
2335
2253
  // Call to a keyed property.
2336
- // For a synthetic property use keyed load IC followed by function call,
2337
- // for a regular property use keyed EmitCallIC.
2338
- if (prop->is_synthetic()) {
2339
- // Do not visit the object and key subexpressions (they are shared
2340
- // by all occurrences of the same rewritten parameter).
2341
- ASSERT(prop->obj()->AsVariableProxy() != NULL);
2342
- ASSERT(prop->obj()->AsVariableProxy()->var()->AsSlot() != NULL);
2343
- Slot* slot = prop->obj()->AsVariableProxy()->var()->AsSlot();
2344
- MemOperand operand = EmitSlotSearch(slot, a1);
2345
- __ lw(a1, operand);
2346
-
2347
- ASSERT(prop->key()->AsLiteral() != NULL);
2348
- ASSERT(prop->key()->AsLiteral()->handle()->IsSmi());
2349
- __ li(a0, Operand(prop->key()->AsLiteral()->handle()));
2350
-
2351
- // Record source code position for IC call.
2352
- SetSourcePosition(prop->position());
2353
-
2354
- Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
2355
- EmitCallIC(ic, RelocInfo::CODE_TARGET, GetPropertyId(prop));
2356
- __ lw(a1, GlobalObjectOperand());
2357
- __ lw(a1, FieldMemOperand(a1, GlobalObject::kGlobalReceiverOffset));
2358
- __ Push(v0, a1); // Function, receiver.
2359
- EmitCallWithStub(expr, NO_CALL_FUNCTION_FLAGS);
2360
- } else {
2361
- { PreservePositionScope scope(masm()->positions_recorder());
2362
- VisitForStackValue(prop->obj());
2363
- }
2364
- EmitKeyedCallWithIC(expr, prop->key());
2254
+ { PreservePositionScope scope(masm()->positions_recorder());
2255
+ VisitForStackValue(prop->obj());
2365
2256
  }
2257
+ EmitKeyedCallWithIC(expr, prop->key());
2366
2258
  }
2367
2259
  } else {
2368
2260
  { PreservePositionScope scope(masm()->positions_recorder());
@@ -2477,9 +2369,10 @@ void FullCodeGenerator::EmitIsObject(ZoneList<Expression*>* args) {
2477
2369
  __ And(at, a1, Operand(1 << Map::kIsUndetectable));
2478
2370
  __ Branch(if_false, ne, at, Operand(zero_reg));
2479
2371
  __ lbu(a1, FieldMemOperand(a2, Map::kInstanceTypeOffset));
2480
- __ Branch(if_false, lt, a1, Operand(FIRST_JS_OBJECT_TYPE));
2372
+ __ Branch(if_false, lt, a1, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE));
2481
2373
  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
2482
- Split(le, a1, Operand(LAST_JS_OBJECT_TYPE), if_true, if_false, fall_through);
2374
+ Split(le, a1, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE),
2375
+ if_true, if_false, fall_through);
2483
2376
 
2484
2377
  context()->Plug(if_true, if_false);
2485
2378
  }
@@ -2500,7 +2393,7 @@ void FullCodeGenerator::EmitIsSpecObject(ZoneList<Expression*>* args) {
2500
2393
  __ JumpIfSmi(v0, if_false);
2501
2394
  __ GetObjectType(v0, a1, a1);
2502
2395
  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
2503
- Split(ge, a1, Operand(FIRST_JS_OBJECT_TYPE),
2396
+ Split(ge, a1, Operand(FIRST_SPEC_OBJECT_TYPE),
2504
2397
  if_true, if_false, fall_through);
2505
2398
 
2506
2399
  context()->Plug(if_true, if_false);
@@ -2738,7 +2631,7 @@ void FullCodeGenerator::EmitArguments(ZoneList<Expression*>* args) {
2738
2631
  // parameter count in a0.
2739
2632
  VisitForAccumulatorValue(args->at(0));
2740
2633
  __ mov(a1, v0);
2741
- __ li(a0, Operand(Smi::FromInt(scope()->num_parameters())));
2634
+ __ li(a0, Operand(Smi::FromInt(info_->scope()->num_parameters())));
2742
2635
  ArgumentsAccessStub stub(ArgumentsAccessStub::READ_ELEMENT);
2743
2636
  __ CallStub(&stub);
2744
2637
  context()->Plug(v0);
@@ -2750,7 +2643,7 @@ void FullCodeGenerator::EmitArgumentsLength(ZoneList<Expression*>* args) {
2750
2643
 
2751
2644
  Label exit;
2752
2645
  // Get the number of formal parameters.
2753
- __ li(v0, Operand(Smi::FromInt(scope()->num_parameters())));
2646
+ __ li(v0, Operand(Smi::FromInt(info_->scope()->num_parameters())));
2754
2647
 
2755
2648
  // Check if the calling frame is an arguments adaptor frame.
2756
2649
  __ lw(a2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
@@ -2779,14 +2672,15 @@ void FullCodeGenerator::EmitClassOf(ZoneList<Expression*>* args) {
2779
2672
  // Check that the object is a JS object but take special care of JS
2780
2673
  // functions to make sure they have 'Function' as their class.
2781
2674
  __ GetObjectType(v0, v0, a1); // Map is now in v0.
2782
- __ Branch(&null, lt, a1, Operand(FIRST_JS_OBJECT_TYPE));
2675
+ __ Branch(&null, lt, a1, Operand(FIRST_SPEC_OBJECT_TYPE));
2783
2676
 
2784
- // As long as JS_FUNCTION_TYPE is the last instance type and it is
2785
- // right after LAST_JS_OBJECT_TYPE, we can avoid checking for
2786
- // LAST_JS_OBJECT_TYPE.
2787
- ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
2788
- ASSERT(JS_FUNCTION_TYPE == LAST_JS_OBJECT_TYPE + 1);
2789
- __ Branch(&function, eq, a1, Operand(JS_FUNCTION_TYPE));
2677
+ // As long as LAST_CALLABLE_SPEC_OBJECT_TYPE is the last instance type, and
2678
+ // FIRST_CALLABLE_SPEC_OBJECT_TYPE comes right after
2679
+ // LAST_NONCALLABLE_SPEC_OBJECT_TYPE, we can avoid checking for the latter.
2680
+ STATIC_ASSERT(LAST_TYPE == LAST_CALLABLE_SPEC_OBJECT_TYPE);
2681
+ STATIC_ASSERT(FIRST_CALLABLE_SPEC_OBJECT_TYPE ==
2682
+ LAST_NONCALLABLE_SPEC_OBJECT_TYPE + 1);
2683
+ __ Branch(&function, ge, a1, Operand(FIRST_CALLABLE_SPEC_OBJECT_TYPE));
2790
2684
 
2791
2685
  // Check if the constructor in the map is a function.
2792
2686
  __ lw(v0, FieldMemOperand(v0, Map::kConstructorOffset));
@@ -2806,7 +2700,7 @@ void FullCodeGenerator::EmitClassOf(ZoneList<Expression*>* args) {
2806
2700
 
2807
2701
  // Objects with a non-function constructor have class 'Object'.
2808
2702
  __ bind(&non_function_constructor);
2809
- __ LoadRoot(v0, Heap::kfunction_class_symbolRootIndex);
2703
+ __ LoadRoot(v0, Heap::kObject_symbolRootIndex);
2810
2704
  __ jmp(&done);
2811
2705
 
2812
2706
  // Non-JS objects have class null.
@@ -2829,13 +2723,12 @@ void FullCodeGenerator::EmitLog(ZoneList<Expression*>* args) {
2829
2723
  // with '%2s' (see Logger::LogRuntime for all the formats).
2830
2724
  // 2 (array): Arguments to the format string.
2831
2725
  ASSERT_EQ(args->length(), 3);
2832
- #ifdef ENABLE_LOGGING_AND_PROFILING
2833
2726
  if (CodeGenerator::ShouldGenerateLog(args->at(0))) {
2834
2727
  VisitForStackValue(args->at(1));
2835
2728
  VisitForStackValue(args->at(2));
2836
2729
  __ CallRuntime(Runtime::kLog, 2);
2837
2730
  }
2838
- #endif
2731
+
2839
2732
  // Finally, we're expected to leave a value on the top of the stack.
2840
2733
  __ LoadRoot(v0, Heap::kUndefinedValueRootIndex);
2841
2734
  context()->Plug(v0);
@@ -3184,7 +3077,8 @@ void FullCodeGenerator::EmitCallFunction(ZoneList<Expression*>* args) {
3184
3077
  // InvokeFunction requires the function in a1. Move it in there.
3185
3078
  __ mov(a1, result_register());
3186
3079
  ParameterCount count(arg_count);
3187
- __ InvokeFunction(a1, count, CALL_FUNCTION);
3080
+ __ InvokeFunction(a1, count, CALL_FUNCTION,
3081
+ NullCallWrapper(), CALL_AS_METHOD);
3188
3082
  __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
3189
3083
  context()->Plug(v0);
3190
3084
  }
@@ -3443,9 +3337,7 @@ void FullCodeGenerator::EmitFastAsciiArrayJoin(ZoneList<Expression*>* args) {
3443
3337
  __ Branch(&bailout, ne, scratch2, Operand(JS_ARRAY_TYPE));
3444
3338
 
3445
3339
  // Check that the array has fast elements.
3446
- __ lbu(scratch2, FieldMemOperand(scratch1, Map::kBitField2Offset));
3447
- __ And(scratch3, scratch2, Operand(1 << Map::kHasFastElements));
3448
- __ Branch(&bailout, eq, scratch3, Operand(zero_reg));
3340
+ __ CheckFastElements(scratch1, scratch2, &bailout);
3449
3341
 
3450
3342
  // If the array has length zero, return the empty string.
3451
3343
  __ lw(array_length, FieldMemOperand(array, JSArray::kLengthOffset));
@@ -3681,7 +3573,7 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
3681
3573
  isolate()->stub_cache()->ComputeCallInitialize(arg_count,
3682
3574
  NOT_IN_LOOP,
3683
3575
  mode);
3684
- EmitCallIC(ic, mode, expr->id());
3576
+ __ Call(ic, mode, expr->id());
3685
3577
  // Restore context register.
3686
3578
  __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
3687
3579
  } else {
@@ -3700,18 +3592,12 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
3700
3592
  Variable* var = expr->expression()->AsVariableProxy()->AsVariable();
3701
3593
 
3702
3594
  if (prop != NULL) {
3703
- if (prop->is_synthetic()) {
3704
- // Result of deleting parameters is false, even when they rewrite
3705
- // to accesses on the arguments object.
3706
- context()->Plug(false);
3707
- } else {
3708
- VisitForStackValue(prop->obj());
3709
- VisitForStackValue(prop->key());
3710
- __ li(a1, Operand(Smi::FromInt(strict_mode_flag())));
3711
- __ push(a1);
3712
- __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
3713
- context()->Plug(v0);
3714
- }
3595
+ VisitForStackValue(prop->obj());
3596
+ VisitForStackValue(prop->key());
3597
+ __ li(a1, Operand(Smi::FromInt(strict_mode_flag())));
3598
+ __ push(a1);
3599
+ __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
3600
+ context()->Plug(v0);
3715
3601
  } else if (var != NULL) {
3716
3602
  // Delete of an unqualified identifier is disallowed in strict mode
3717
3603
  // but "delete this" is.
@@ -3824,7 +3710,7 @@ void FullCodeGenerator::EmitUnaryOperation(UnaryOperation* expr,
3824
3710
  VisitForAccumulatorValue(expr->expression());
3825
3711
  SetSourcePosition(expr->position());
3826
3712
  __ mov(a0, result_register());
3827
- EmitCallIC(stub.GetCode(), NULL, expr->id());
3713
+ __ Call(stub.GetCode(), RelocInfo::CODE_TARGET, expr->id());
3828
3714
  context()->Plug(v0);
3829
3715
  }
3830
3716
 
@@ -3841,7 +3727,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
3841
3727
  }
3842
3728
 
3843
3729
  // Expression can only be a property, a global or a (parameter or local)
3844
- // slot. Variables with rewrite to .arguments are treated as KEYED_PROPERTY.
3730
+ // slot.
3845
3731
  enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY };
3846
3732
  LhsKind assign_type = VARIABLE;
3847
3733
  Property* prop = expr->expression()->AsProperty();
@@ -3856,7 +3742,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
3856
3742
  if (assign_type == VARIABLE) {
3857
3743
  ASSERT(expr->expression()->AsVariableProxy()->var() != NULL);
3858
3744
  AccumulatorValueContext context(this);
3859
- EmitVariableLoad(expr->expression()->AsVariableProxy()->var());
3745
+ EmitVariableLoad(expr->expression()->AsVariableProxy());
3860
3746
  } else {
3861
3747
  // Reserve space for result of postfix operation.
3862
3748
  if (expr->is_postfix() && !context()->IsEffect()) {
@@ -3869,15 +3755,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
3869
3755
  __ push(v0);
3870
3756
  EmitNamedPropertyLoad(prop);
3871
3757
  } else {
3872
- if (prop->is_arguments_access()) {
3873
- VariableProxy* obj_proxy = prop->obj()->AsVariableProxy();
3874
- __ lw(v0, EmitSlotSearch(obj_proxy->var()->AsSlot(), v0));
3875
- __ push(v0);
3876
- __ li(v0, Operand(prop->key()->AsLiteral()->handle()));
3877
- } else {
3878
- VisitForStackValue(prop->obj());
3879
- VisitForAccumulatorValue(prop->key());
3880
- }
3758
+ VisitForStackValue(prop->obj());
3759
+ VisitForAccumulatorValue(prop->key());
3881
3760
  __ lw(a1, MemOperand(sp, 0));
3882
3761
  __ push(v0);
3883
3762
  EmitKeyedPropertyLoad(prop);
@@ -3942,7 +3821,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
3942
3821
  SetSourcePosition(expr->position());
3943
3822
 
3944
3823
  BinaryOpStub stub(Token::ADD, NO_OVERWRITE);
3945
- EmitCallIC(stub.GetCode(), &patch_site, expr->CountId());
3824
+ __ Call(stub.GetCode(), RelocInfo::CODE_TARGET, expr->CountId());
3825
+ patch_site.EmitPatchInfo();
3946
3826
  __ bind(&done);
3947
3827
 
3948
3828
  // Store the value returned in v0.
@@ -3974,7 +3854,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
3974
3854
  Handle<Code> ic = is_strict_mode()
3975
3855
  ? isolate()->builtins()->StoreIC_Initialize_Strict()
3976
3856
  : isolate()->builtins()->StoreIC_Initialize();
3977
- EmitCallIC(ic, RelocInfo::CODE_TARGET, expr->id());
3857
+ __ Call(ic, RelocInfo::CODE_TARGET, expr->id());
3978
3858
  PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
3979
3859
  if (expr->is_postfix()) {
3980
3860
  if (!context()->IsEffect()) {
@@ -3992,7 +3872,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
3992
3872
  Handle<Code> ic = is_strict_mode()
3993
3873
  ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
3994
3874
  : isolate()->builtins()->KeyedStoreIC_Initialize();
3995
- EmitCallIC(ic, RelocInfo::CODE_TARGET, expr->id());
3875
+ __ Call(ic, RelocInfo::CODE_TARGET, expr->id());
3996
3876
  PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
3997
3877
  if (expr->is_postfix()) {
3998
3878
  if (!context()->IsEffect()) {
@@ -4016,7 +3896,7 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
4016
3896
  Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
4017
3897
  // Use a regular load, not a contextual load, to avoid a reference
4018
3898
  // error.
4019
- EmitCallIC(ic, RelocInfo::CODE_TARGET, AstNode::kNoNumber);
3899
+ __ Call(ic);
4020
3900
  PrepareForBailout(expr, TOS_REG);
4021
3901
  context()->Plug(v0);
4022
3902
  } else if (proxy != NULL &&
@@ -4039,30 +3919,17 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
4039
3919
  context()->Plug(v0);
4040
3920
  } else {
4041
3921
  // This expression cannot throw a reference error at the top level.
4042
- context()->HandleExpression(expr);
3922
+ VisitInCurrentContext(expr);
4043
3923
  }
4044
3924
  }
4045
3925
 
4046
-
4047
- bool FullCodeGenerator::TryLiteralCompare(Token::Value op,
4048
- Expression* left,
4049
- Expression* right,
4050
- Label* if_true,
4051
- Label* if_false,
4052
- Label* fall_through) {
4053
- if (op != Token::EQ && op != Token::EQ_STRICT) return false;
4054
-
4055
- // Check for the pattern: typeof <expression> == <string literal>.
4056
- Literal* right_literal = right->AsLiteral();
4057
- if (right_literal == NULL) return false;
4058
- Handle<Object> right_literal_value = right_literal->handle();
4059
- if (!right_literal_value->IsString()) return false;
4060
- UnaryOperation* left_unary = left->AsUnaryOperation();
4061
- if (left_unary == NULL || left_unary->op() != Token::TYPEOF) return false;
4062
- Handle<String> check = Handle<String>::cast(right_literal_value);
4063
-
3926
+ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr,
3927
+ Handle<String> check,
3928
+ Label* if_true,
3929
+ Label* if_false,
3930
+ Label* fall_through) {
4064
3931
  { AccumulatorValueContext context(this);
4065
- VisitForTypeofValue(left_unary->expression());
3932
+ VisitForTypeofValue(expr);
4066
3933
  }
4067
3934
  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
4068
3935
 
@@ -4085,6 +3952,10 @@ bool FullCodeGenerator::TryLiteralCompare(Token::Value op,
4085
3952
  __ Branch(if_true, eq, v0, Operand(at));
4086
3953
  __ LoadRoot(at, Heap::kFalseValueRootIndex);
4087
3954
  Split(eq, v0, Operand(at), if_true, if_false, fall_through);
3955
+ } else if (FLAG_harmony_typeof &&
3956
+ check->Equals(isolate()->heap()->null_symbol())) {
3957
+ __ LoadRoot(at, Heap::kNullValueRootIndex);
3958
+ Split(eq, v0, Operand(at), if_true, if_false, fall_through);
4088
3959
  } else if (check->Equals(isolate()->heap()->undefined_symbol())) {
4089
3960
  __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
4090
3961
  __ Branch(if_true, eq, v0, Operand(at));
@@ -4097,18 +3968,20 @@ bool FullCodeGenerator::TryLiteralCompare(Token::Value op,
4097
3968
  } else if (check->Equals(isolate()->heap()->function_symbol())) {
4098
3969
  __ JumpIfSmi(v0, if_false);
4099
3970
  __ GetObjectType(v0, a1, v0); // Leave map in a1.
4100
- Split(ge, v0, Operand(FIRST_FUNCTION_CLASS_TYPE),
3971
+ Split(ge, v0, Operand(FIRST_CALLABLE_SPEC_OBJECT_TYPE),
4101
3972
  if_true, if_false, fall_through);
4102
3973
 
4103
3974
  } else if (check->Equals(isolate()->heap()->object_symbol())) {
4104
3975
  __ JumpIfSmi(v0, if_false);
4105
- __ LoadRoot(at, Heap::kNullValueRootIndex);
4106
- __ Branch(if_true, eq, v0, Operand(at));
3976
+ if (!FLAG_harmony_typeof) {
3977
+ __ LoadRoot(at, Heap::kNullValueRootIndex);
3978
+ __ Branch(if_true, eq, v0, Operand(at));
3979
+ }
4107
3980
  // Check for JS objects => true.
4108
3981
  __ GetObjectType(v0, v0, a1);
4109
- __ Branch(if_false, lo, a1, Operand(FIRST_JS_OBJECT_TYPE));
3982
+ __ Branch(if_false, lt, a1, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE));
4110
3983
  __ lbu(a1, FieldMemOperand(v0, Map::kInstanceTypeOffset));
4111
- __ Branch(if_false, hs, a1, Operand(FIRST_FUNCTION_CLASS_TYPE));
3984
+ __ Branch(if_false, gt, a1, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE));
4112
3985
  // Check for undetectable objects => false.
4113
3986
  __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
4114
3987
  __ And(a1, a1, Operand(1 << Map::kIsUndetectable));
@@ -4116,8 +3989,18 @@ bool FullCodeGenerator::TryLiteralCompare(Token::Value op,
4116
3989
  } else {
4117
3990
  if (if_false != fall_through) __ jmp(if_false);
4118
3991
  }
3992
+ }
3993
+
4119
3994
 
4120
- return true;
3995
+ void FullCodeGenerator::EmitLiteralCompareUndefined(Expression* expr,
3996
+ Label* if_true,
3997
+ Label* if_false,
3998
+ Label* fall_through) {
3999
+ VisitForAccumulatorValue(expr);
4000
+ PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
4001
+
4002
+ __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
4003
+ Split(eq, v0, Operand(at), if_true, if_false, fall_through);
4121
4004
  }
4122
4005
 
4123
4006
 
@@ -4137,14 +4020,12 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
4137
4020
 
4138
4021
  // First we try a fast inlined version of the compare when one of
4139
4022
  // the operands is a literal.
4140
- Token::Value op = expr->op();
4141
- Expression* left = expr->left();
4142
- Expression* right = expr->right();
4143
- if (TryLiteralCompare(op, left, right, if_true, if_false, fall_through)) {
4023
+ if (TryLiteralCompare(expr, if_true, if_false, fall_through)) {
4144
4024
  context()->Plug(if_true, if_false);
4145
4025
  return;
4146
4026
  }
4147
4027
 
4028
+ Token::Value op = expr->op();
4148
4029
  VisitForStackValue(expr->left());
4149
4030
  switch (op) {
4150
4031
  case Token::IN:
@@ -4218,7 +4099,8 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
4218
4099
  // Record position and call the compare IC.
4219
4100
  SetSourcePosition(expr->position());
4220
4101
  Handle<Code> ic = CompareIC::GetUninitialized(op);
4221
- EmitCallIC(ic, &patch_site, expr->id());
4102
+ __ Call(ic, RelocInfo::CODE_TARGET, expr->id());
4103
+ patch_site.EmitPatchInfo();
4222
4104
  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
4223
4105
  Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through);
4224
4106
  }
@@ -4277,70 +4159,6 @@ Register FullCodeGenerator::context_register() {
4277
4159
  }
4278
4160
 
4279
4161
 
4280
- void FullCodeGenerator::EmitCallIC(Handle<Code> ic,
4281
- RelocInfo::Mode mode,
4282
- unsigned ast_id) {
4283
- ASSERT(mode == RelocInfo::CODE_TARGET ||
4284
- mode == RelocInfo::CODE_TARGET_CONTEXT);
4285
- Counters* counters = isolate()->counters();
4286
- switch (ic->kind()) {
4287
- case Code::LOAD_IC:
4288
- __ IncrementCounter(counters->named_load_full(), 1, a1, a2);
4289
- break;
4290
- case Code::KEYED_LOAD_IC:
4291
- __ IncrementCounter(counters->keyed_load_full(), 1, a1, a2);
4292
- break;
4293
- case Code::STORE_IC:
4294
- __ IncrementCounter(counters->named_store_full(), 1, a1, a2);
4295
- break;
4296
- case Code::KEYED_STORE_IC:
4297
- __ IncrementCounter(counters->keyed_store_full(), 1, a1, a2);
4298
- default:
4299
- break;
4300
- }
4301
- if (ast_id == kNoASTId || mode == RelocInfo::CODE_TARGET_CONTEXT) {
4302
- __ Call(ic, mode);
4303
- } else {
4304
- ASSERT(mode == RelocInfo::CODE_TARGET);
4305
- mode = RelocInfo::CODE_TARGET_WITH_ID;
4306
- __ CallWithAstId(ic, mode, ast_id);
4307
- }
4308
- }
4309
-
4310
-
4311
- void FullCodeGenerator::EmitCallIC(Handle<Code> ic,
4312
- JumpPatchSite* patch_site,
4313
- unsigned ast_id) {
4314
- Counters* counters = isolate()->counters();
4315
- switch (ic->kind()) {
4316
- case Code::LOAD_IC:
4317
- __ IncrementCounter(counters->named_load_full(), 1, a1, a2);
4318
- break;
4319
- case Code::KEYED_LOAD_IC:
4320
- __ IncrementCounter(counters->keyed_load_full(), 1, a1, a2);
4321
- break;
4322
- case Code::STORE_IC:
4323
- __ IncrementCounter(counters->named_store_full(), 1, a1, a2);
4324
- break;
4325
- case Code::KEYED_STORE_IC:
4326
- __ IncrementCounter(counters->keyed_store_full(), 1, a1, a2);
4327
- default:
4328
- break;
4329
- }
4330
-
4331
- if (ast_id == kNoASTId) {
4332
- __ Call(ic, RelocInfo::CODE_TARGET);
4333
- } else {
4334
- __ CallWithAstId(ic, RelocInfo::CODE_TARGET_WITH_ID, ast_id);
4335
- }
4336
- if (patch_site != NULL && patch_site->is_bound()) {
4337
- patch_site->EmitPatchInfo();
4338
- } else {
4339
- __ nop(); // Signals no inlined code.
4340
- }
4341
- }
4342
-
4343
-
4344
4162
  void FullCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
4345
4163
  ASSERT_EQ(POINTER_SIZE_ALIGN(frame_offset), frame_offset);
4346
4164
  __ sw(value, MemOperand(fp, frame_offset));
@@ -4352,6 +4170,27 @@ void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
4352
4170
  }
4353
4171
 
4354
4172
 
4173
+ void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
4174
+ Scope* declaration_scope = scope()->DeclarationScope();
4175
+ if (declaration_scope->is_global_scope()) {
4176
+ // Contexts nested in the global context have a canonical empty function
4177
+ // as their closure, not the anonymous closure containing the global
4178
+ // code. Pass a smi sentinel and let the runtime look up the empty
4179
+ // function.
4180
+ __ li(at, Operand(Smi::FromInt(0)));
4181
+ } else if (declaration_scope->is_eval_scope()) {
4182
+ // Contexts created by a call to eval have the same closure as the
4183
+ // context calling eval, not the anonymous closure containing the eval
4184
+ // code. Fetch it from the context.
4185
+ __ lw(at, ContextOperand(cp, Context::CLOSURE_INDEX));
4186
+ } else {
4187
+ ASSERT(declaration_scope->is_function_scope());
4188
+ __ lw(at, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
4189
+ }
4190
+ __ push(at);
4191
+ }
4192
+
4193
+
4355
4194
  // ----------------------------------------------------------------------------
4356
4195
  // Non-local control flow support.
4357
4196