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.
- data/lib/libv8/scons/CHANGES.txt +24 -231
- data/lib/libv8/scons/LICENSE.txt +1 -1
- data/lib/libv8/scons/MANIFEST +0 -1
- data/lib/libv8/scons/PKG-INFO +1 -1
- data/lib/libv8/scons/README.txt +9 -9
- data/lib/libv8/scons/RELEASE.txt +75 -77
- data/lib/libv8/scons/engine/SCons/Action.py +6 -22
- data/lib/libv8/scons/engine/SCons/Builder.py +2 -2
- data/lib/libv8/scons/engine/SCons/CacheDir.py +2 -2
- data/lib/libv8/scons/engine/SCons/Debug.py +2 -2
- data/lib/libv8/scons/engine/SCons/Defaults.py +10 -24
- data/lib/libv8/scons/engine/SCons/Environment.py +19 -118
- data/lib/libv8/scons/engine/SCons/Errors.py +2 -2
- data/lib/libv8/scons/engine/SCons/Executor.py +2 -2
- data/lib/libv8/scons/engine/SCons/Job.py +2 -2
- data/lib/libv8/scons/engine/SCons/Memoize.py +2 -2
- data/lib/libv8/scons/engine/SCons/Node/Alias.py +2 -2
- data/lib/libv8/scons/engine/SCons/Node/FS.py +121 -281
- data/lib/libv8/scons/engine/SCons/Node/Python.py +2 -2
- data/lib/libv8/scons/engine/SCons/Node/__init__.py +5 -6
- data/lib/libv8/scons/engine/SCons/Options/BoolOption.py +2 -2
- data/lib/libv8/scons/engine/SCons/Options/EnumOption.py +2 -2
- data/lib/libv8/scons/engine/SCons/Options/ListOption.py +2 -2
- data/lib/libv8/scons/engine/SCons/Options/PackageOption.py +2 -2
- data/lib/libv8/scons/engine/SCons/Options/PathOption.py +2 -2
- data/lib/libv8/scons/engine/SCons/Options/__init__.py +2 -2
- data/lib/libv8/scons/engine/SCons/PathList.py +2 -2
- data/lib/libv8/scons/engine/SCons/Platform/__init__.py +2 -2
- data/lib/libv8/scons/engine/SCons/Platform/aix.py +2 -2
- data/lib/libv8/scons/engine/SCons/Platform/cygwin.py +2 -2
- data/lib/libv8/scons/engine/SCons/Platform/darwin.py +3 -27
- data/lib/libv8/scons/engine/SCons/Platform/hpux.py +2 -2
- data/lib/libv8/scons/engine/SCons/Platform/irix.py +2 -2
- data/lib/libv8/scons/engine/SCons/Platform/os2.py +2 -2
- data/lib/libv8/scons/engine/SCons/Platform/posix.py +2 -2
- data/lib/libv8/scons/engine/SCons/Platform/sunos.py +2 -2
- data/lib/libv8/scons/engine/SCons/Platform/win32.py +2 -2
- data/lib/libv8/scons/engine/SCons/SConf.py +2 -2
- data/lib/libv8/scons/engine/SCons/SConsign.py +3 -9
- data/lib/libv8/scons/engine/SCons/Scanner/C.py +2 -2
- data/lib/libv8/scons/engine/SCons/Scanner/D.py +2 -2
- data/lib/libv8/scons/engine/SCons/Scanner/Dir.py +2 -2
- data/lib/libv8/scons/engine/SCons/Scanner/Fortran.py +2 -2
- data/lib/libv8/scons/engine/SCons/Scanner/IDL.py +2 -2
- data/lib/libv8/scons/engine/SCons/Scanner/LaTeX.py +2 -5
- data/lib/libv8/scons/engine/SCons/Scanner/Prog.py +2 -2
- data/lib/libv8/scons/engine/SCons/Scanner/RC.py +3 -3
- data/lib/libv8/scons/engine/SCons/Scanner/__init__.py +2 -2
- data/lib/libv8/scons/engine/SCons/Script/Interactive.py +2 -2
- data/lib/libv8/scons/engine/SCons/Script/Main.py +11 -82
- data/lib/libv8/scons/engine/SCons/Script/SConsOptions.py +5 -5
- data/lib/libv8/scons/engine/SCons/Script/SConscript.py +2 -2
- data/lib/libv8/scons/engine/SCons/Script/__init__.py +2 -2
- data/lib/libv8/scons/engine/SCons/Sig.py +2 -2
- data/lib/libv8/scons/engine/SCons/Subst.py +2 -2
- data/lib/libv8/scons/engine/SCons/Taskmaster.py +2 -10
- data/lib/libv8/scons/engine/SCons/Tool/386asm.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/BitKeeper.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/CVS.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/FortranCommon.py +2 -19
- data/lib/libv8/scons/engine/SCons/Tool/JavaCommon.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/MSCommon/__init__.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/MSCommon/arch.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/MSCommon/common.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/MSCommon/netframework.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/MSCommon/sdk.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vc.py +6 -9
- data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vs.py +2 -29
- data/lib/libv8/scons/engine/SCons/Tool/Perforce.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/PharLapCommon.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/RCS.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/SCCS.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/Subversion.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/__init__.py +3 -3
- data/lib/libv8/scons/engine/SCons/Tool/aixc++.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/aixcc.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/aixf77.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/aixlink.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/applelink.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/ar.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/as.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/bcc32.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/c++.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/cc.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/cvf.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/default.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/dmd.py +7 -24
- data/lib/libv8/scons/engine/SCons/Tool/dvi.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/dvipdf.py +2 -3
- data/lib/libv8/scons/engine/SCons/Tool/dvips.py +2 -3
- data/lib/libv8/scons/engine/SCons/Tool/f77.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/f90.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/f95.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/filesystem.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/fortran.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/g++.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/g77.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/gas.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/gcc.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/gfortran.py +3 -3
- data/lib/libv8/scons/engine/SCons/Tool/gnulink.py +3 -2
- data/lib/libv8/scons/engine/SCons/Tool/gs.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/hpc++.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/hpcc.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/hplink.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/icc.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/icl.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/ifl.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/ifort.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/ilink.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/ilink32.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/install.py +3 -57
- data/lib/libv8/scons/engine/SCons/Tool/intelc.py +25 -65
- data/lib/libv8/scons/engine/SCons/Tool/ipkg.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/jar.py +3 -9
- data/lib/libv8/scons/engine/SCons/Tool/javac.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/javah.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/latex.py +2 -3
- data/lib/libv8/scons/engine/SCons/Tool/lex.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/link.py +5 -6
- data/lib/libv8/scons/engine/SCons/Tool/linkloc.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/m4.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/masm.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/midl.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/mingw.py +10 -31
- data/lib/libv8/scons/engine/SCons/Tool/mslib.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/mslink.py +9 -61
- data/lib/libv8/scons/engine/SCons/Tool/mssdk.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/msvc.py +11 -21
- data/lib/libv8/scons/engine/SCons/Tool/msvs.py +59 -477
- data/lib/libv8/scons/engine/SCons/Tool/mwcc.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/mwld.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/nasm.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/packaging/__init__.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/packaging/ipk.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/packaging/msi.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/packaging/rpm.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/packaging/src_tarbz2.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/packaging/src_targz.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/packaging/src_zip.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/packaging/tarbz2.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/packaging/targz.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/packaging/zip.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/pdf.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/pdflatex.py +2 -3
- data/lib/libv8/scons/engine/SCons/Tool/pdftex.py +2 -3
- data/lib/libv8/scons/engine/SCons/Tool/qt.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/rmic.py +3 -9
- data/lib/libv8/scons/engine/SCons/Tool/rpcgen.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/rpm.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/sgiar.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/sgic++.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/sgicc.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/sgilink.py +3 -2
- data/lib/libv8/scons/engine/SCons/Tool/sunar.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/sunc++.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/suncc.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/sunf77.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/sunf90.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/sunf95.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/sunlink.py +3 -2
- data/lib/libv8/scons/engine/SCons/Tool/swig.py +5 -6
- data/lib/libv8/scons/engine/SCons/Tool/tar.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/tex.py +43 -96
- data/lib/libv8/scons/engine/SCons/Tool/textfile.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/tlib.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/wix.py +2 -2
- data/lib/libv8/scons/engine/SCons/Tool/yacc.py +2 -12
- data/lib/libv8/scons/engine/SCons/Tool/zip.py +2 -2
- data/lib/libv8/scons/engine/SCons/Util.py +3 -3
- data/lib/libv8/scons/engine/SCons/Variables/BoolVariable.py +2 -2
- data/lib/libv8/scons/engine/SCons/Variables/EnumVariable.py +3 -3
- data/lib/libv8/scons/engine/SCons/Variables/ListVariable.py +2 -2
- data/lib/libv8/scons/engine/SCons/Variables/PackageVariable.py +2 -2
- data/lib/libv8/scons/engine/SCons/Variables/PathVariable.py +2 -2
- data/lib/libv8/scons/engine/SCons/Variables/__init__.py +2 -2
- data/lib/libv8/scons/engine/SCons/Warnings.py +2 -2
- data/lib/libv8/scons/engine/SCons/__init__.py +6 -6
- data/lib/libv8/scons/engine/SCons/compat/__init__.py +2 -2
- data/lib/libv8/scons/engine/SCons/compat/_scons_builtins.py +2 -2
- data/lib/libv8/scons/engine/SCons/compat/_scons_collections.py +2 -2
- data/lib/libv8/scons/engine/SCons/compat/_scons_dbm.py +2 -2
- data/lib/libv8/scons/engine/SCons/compat/_scons_hashlib.py +2 -2
- data/lib/libv8/scons/engine/SCons/compat/_scons_io.py +2 -2
- data/lib/libv8/scons/engine/SCons/cpp.py +2 -2
- data/lib/libv8/scons/engine/SCons/dblite.py +1 -4
- data/lib/libv8/scons/engine/SCons/exitfuncs.py +2 -2
- data/lib/libv8/scons/scons-time.1 +3 -3
- data/lib/libv8/scons/scons.1 +1164 -1170
- data/lib/libv8/scons/sconsign.1 +3 -3
- data/lib/libv8/scons/script/scons +22 -22
- data/lib/libv8/scons/script/scons-time +2 -2
- data/lib/libv8/scons/script/scons.bat +4 -7
- data/lib/libv8/scons/script/sconsign +20 -21
- data/lib/libv8/scons/setup.cfg +1 -0
- data/lib/libv8/scons/setup.py +40 -38
- data/lib/libv8/v8/.gitignore +1 -1
- data/lib/libv8/v8/AUTHORS +2 -0
- data/lib/libv8/v8/ChangeLog +387 -0
- data/lib/libv8/v8/Makefile +171 -0
- data/lib/libv8/v8/SConstruct +124 -51
- data/lib/libv8/v8/build/README.txt +31 -14
- data/lib/libv8/v8/build/all.gyp +11 -4
- data/lib/libv8/v8/build/armu.gypi +6 -2
- data/lib/libv8/v8/build/common.gypi +240 -94
- data/lib/libv8/v8/build/gyp_v8 +32 -4
- data/lib/libv8/v8/build/standalone.gypi +200 -0
- data/lib/libv8/v8/include/v8-debug.h +0 -0
- data/lib/libv8/v8/include/v8-profiler.h +8 -11
- data/lib/libv8/v8/include/v8.h +191 -108
- data/lib/libv8/v8/preparser/SConscript +2 -2
- data/lib/libv8/v8/preparser/preparser-process.cc +3 -3
- data/lib/libv8/v8/preparser/preparser.gyp +42 -0
- data/lib/libv8/v8/src/SConscript +33 -8
- data/lib/libv8/v8/src/accessors.cc +77 -43
- data/lib/libv8/v8/src/api.cc +393 -191
- data/lib/libv8/v8/src/api.h +4 -8
- data/lib/libv8/v8/src/apinatives.js +15 -3
- data/lib/libv8/v8/src/arguments.h +8 -0
- data/lib/libv8/v8/src/arm/assembler-arm.cc +120 -120
- data/lib/libv8/v8/src/arm/assembler-arm.h +92 -43
- data/lib/libv8/v8/src/arm/builtins-arm.cc +32 -39
- data/lib/libv8/v8/src/arm/code-stubs-arm.cc +572 -351
- data/lib/libv8/v8/src/arm/code-stubs-arm.h +8 -77
- data/lib/libv8/v8/src/arm/codegen-arm.h +0 -2
- data/lib/libv8/v8/src/arm/deoptimizer-arm.cc +50 -30
- data/lib/libv8/v8/src/arm/disasm-arm.cc +1 -1
- data/lib/libv8/v8/src/arm/frames-arm.h +9 -5
- data/lib/libv8/v8/src/arm/full-codegen-arm.cc +331 -432
- data/lib/libv8/v8/src/arm/ic-arm.cc +192 -124
- data/lib/libv8/v8/src/arm/lithium-arm.cc +216 -232
- data/lib/libv8/v8/src/arm/lithium-arm.h +106 -259
- data/lib/libv8/v8/src/arm/lithium-codegen-arm.cc +633 -642
- data/lib/libv8/v8/src/arm/lithium-codegen-arm.h +4 -4
- data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.cc +1 -3
- data/lib/libv8/v8/src/arm/macro-assembler-arm.cc +260 -185
- data/lib/libv8/v8/src/arm/macro-assembler-arm.h +45 -25
- data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.cc +25 -13
- data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.h +3 -0
- data/lib/libv8/v8/src/arm/stub-cache-arm.cc +413 -226
- data/lib/libv8/v8/src/array.js +38 -18
- data/lib/libv8/v8/src/assembler.cc +12 -5
- data/lib/libv8/v8/src/assembler.h +15 -9
- data/lib/libv8/v8/src/ast-inl.h +34 -25
- data/lib/libv8/v8/src/ast.cc +141 -72
- data/lib/libv8/v8/src/ast.h +255 -181
- data/lib/libv8/v8/src/bignum.cc +3 -4
- data/lib/libv8/v8/src/bootstrapper.cc +55 -11
- data/lib/libv8/v8/src/bootstrapper.h +3 -2
- data/lib/libv8/v8/src/builtins.cc +8 -2
- data/lib/libv8/v8/src/builtins.h +4 -0
- data/lib/libv8/v8/src/cached-powers.cc +8 -4
- data/lib/libv8/v8/src/checks.h +3 -3
- data/lib/libv8/v8/src/code-stubs.cc +173 -28
- data/lib/libv8/v8/src/code-stubs.h +104 -148
- data/lib/libv8/v8/src/codegen.cc +8 -8
- data/lib/libv8/v8/src/compilation-cache.cc +2 -47
- data/lib/libv8/v8/src/compilation-cache.h +0 -10
- data/lib/libv8/v8/src/compiler.cc +27 -16
- data/lib/libv8/v8/src/compiler.h +13 -18
- data/lib/libv8/v8/src/contexts.cc +107 -72
- data/lib/libv8/v8/src/contexts.h +70 -34
- data/lib/libv8/v8/src/conversions-inl.h +572 -14
- data/lib/libv8/v8/src/conversions.cc +9 -707
- data/lib/libv8/v8/src/conversions.h +23 -12
- data/lib/libv8/v8/src/cpu-profiler-inl.h +2 -19
- data/lib/libv8/v8/src/cpu-profiler.cc +4 -21
- data/lib/libv8/v8/src/cpu-profiler.h +8 -17
- data/lib/libv8/v8/src/d8-debug.cc +5 -3
- data/lib/libv8/v8/src/d8-debug.h +6 -7
- data/lib/libv8/v8/src/d8-posix.cc +1 -10
- data/lib/libv8/v8/src/d8.cc +721 -219
- data/lib/libv8/v8/src/d8.gyp +37 -12
- data/lib/libv8/v8/src/d8.h +141 -19
- data/lib/libv8/v8/src/d8.js +17 -8
- data/lib/libv8/v8/src/date.js +16 -5
- data/lib/libv8/v8/src/dateparser-inl.h +242 -39
- data/lib/libv8/v8/src/dateparser.cc +38 -4
- data/lib/libv8/v8/src/dateparser.h +170 -28
- data/lib/libv8/v8/src/debug-agent.cc +5 -3
- data/lib/libv8/v8/src/debug-agent.h +11 -7
- data/lib/libv8/v8/src/debug-debugger.js +65 -34
- data/lib/libv8/v8/src/debug.cc +30 -60
- data/lib/libv8/v8/src/debug.h +5 -3
- data/lib/libv8/v8/src/deoptimizer.cc +227 -10
- data/lib/libv8/v8/src/deoptimizer.h +133 -9
- data/lib/libv8/v8/src/disassembler.cc +22 -14
- data/lib/libv8/v8/src/diy-fp.cc +4 -3
- data/lib/libv8/v8/src/diy-fp.h +3 -3
- data/lib/libv8/v8/src/elements.cc +634 -0
- data/lib/libv8/v8/src/elements.h +95 -0
- data/lib/libv8/v8/src/execution.cc +5 -21
- data/lib/libv8/v8/src/extensions/experimental/break-iterator.cc +3 -1
- data/lib/libv8/v8/src/extensions/experimental/break-iterator.h +1 -1
- data/lib/libv8/v8/src/extensions/experimental/collator.cc +6 -2
- data/lib/libv8/v8/src/extensions/experimental/collator.h +1 -2
- data/lib/libv8/v8/src/extensions/experimental/datetime-format.cc +384 -0
- data/lib/libv8/v8/src/extensions/experimental/datetime-format.h +83 -0
- data/lib/libv8/v8/src/extensions/experimental/experimental.gyp +18 -7
- data/lib/libv8/v8/src/extensions/experimental/i18n-extension.cc +12 -16
- data/lib/libv8/v8/src/extensions/experimental/i18n-extension.h +1 -1
- data/lib/libv8/v8/src/extensions/experimental/i18n-js2c.py +126 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n-locale.cc +3 -4
- data/lib/libv8/v8/src/extensions/experimental/i18n-locale.h +1 -1
- data/lib/libv8/v8/src/{shell.h → extensions/experimental/i18n-natives.h} +8 -20
- data/lib/libv8/v8/src/extensions/experimental/i18n-utils.cc +45 -1
- data/lib/libv8/v8/src/extensions/experimental/i18n-utils.h +21 -1
- data/lib/libv8/v8/src/extensions/experimental/i18n.js +211 -11
- data/lib/libv8/v8/src/extensions/experimental/language-matcher.cc +4 -3
- data/lib/libv8/v8/src/extensions/experimental/language-matcher.h +1 -1
- data/lib/libv8/v8/src/extensions/experimental/number-format.cc +374 -0
- data/lib/libv8/v8/src/extensions/experimental/number-format.h +71 -0
- data/lib/libv8/v8/src/factory.cc +89 -18
- data/lib/libv8/v8/src/factory.h +36 -8
- data/lib/libv8/v8/src/flag-definitions.h +11 -44
- data/lib/libv8/v8/src/frames-inl.h +8 -1
- data/lib/libv8/v8/src/frames.cc +39 -3
- data/lib/libv8/v8/src/frames.h +10 -3
- data/lib/libv8/v8/src/full-codegen.cc +311 -293
- data/lib/libv8/v8/src/full-codegen.h +183 -143
- data/lib/libv8/v8/src/func-name-inferrer.cc +29 -15
- data/lib/libv8/v8/src/func-name-inferrer.h +19 -9
- data/lib/libv8/v8/src/gdb-jit.cc +658 -55
- data/lib/libv8/v8/src/gdb-jit.h +6 -2
- data/lib/libv8/v8/src/global-handles.cc +368 -312
- data/lib/libv8/v8/src/global-handles.h +29 -36
- data/lib/libv8/v8/src/globals.h +3 -1
- data/lib/libv8/v8/src/handles.cc +43 -69
- data/lib/libv8/v8/src/handles.h +21 -16
- data/lib/libv8/v8/src/heap-inl.h +11 -13
- data/lib/libv8/v8/src/heap-profiler.cc +0 -999
- data/lib/libv8/v8/src/heap-profiler.h +0 -303
- data/lib/libv8/v8/src/heap.cc +366 -141
- data/lib/libv8/v8/src/heap.h +87 -26
- data/lib/libv8/v8/src/hydrogen-instructions.cc +192 -81
- data/lib/libv8/v8/src/hydrogen-instructions.h +711 -482
- data/lib/libv8/v8/src/hydrogen.cc +1146 -629
- data/lib/libv8/v8/src/hydrogen.h +100 -64
- data/lib/libv8/v8/src/ia32/assembler-ia32.cc +19 -0
- data/lib/libv8/v8/src/ia32/assembler-ia32.h +15 -2
- data/lib/libv8/v8/src/ia32/builtins-ia32.cc +34 -39
- data/lib/libv8/v8/src/ia32/code-stubs-ia32.cc +675 -377
- data/lib/libv8/v8/src/ia32/code-stubs-ia32.h +8 -69
- data/lib/libv8/v8/src/ia32/codegen-ia32.cc +1 -0
- data/lib/libv8/v8/src/ia32/codegen-ia32.h +0 -2
- data/lib/libv8/v8/src/ia32/cpu-ia32.cc +3 -2
- data/lib/libv8/v8/src/ia32/deoptimizer-ia32.cc +28 -3
- data/lib/libv8/v8/src/ia32/disasm-ia32.cc +21 -10
- data/lib/libv8/v8/src/ia32/frames-ia32.h +6 -5
- data/lib/libv8/v8/src/ia32/full-codegen-ia32.cc +459 -465
- data/lib/libv8/v8/src/ia32/ic-ia32.cc +196 -147
- data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.cc +575 -650
- data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.h +19 -21
- data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.cc +7 -2
- data/lib/libv8/v8/src/ia32/lithium-ia32.cc +261 -256
- data/lib/libv8/v8/src/ia32/lithium-ia32.h +234 -335
- data/lib/libv8/v8/src/ia32/macro-assembler-ia32.cc +224 -67
- data/lib/libv8/v8/src/ia32/macro-assembler-ia32.h +63 -19
- data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.cc +22 -8
- data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.h +3 -0
- data/lib/libv8/v8/src/ia32/stub-cache-ia32.cc +380 -239
- data/lib/libv8/v8/src/ic.cc +198 -234
- data/lib/libv8/v8/src/ic.h +32 -30
- data/lib/libv8/v8/src/interpreter-irregexp.cc +6 -4
- data/lib/libv8/v8/src/isolate.cc +112 -95
- data/lib/libv8/v8/src/isolate.h +55 -71
- data/lib/libv8/v8/src/json-parser.h +486 -48
- data/lib/libv8/v8/src/json.js +28 -23
- data/lib/libv8/v8/src/jsregexp.cc +163 -208
- data/lib/libv8/v8/src/jsregexp.h +0 -1
- data/lib/libv8/v8/src/lithium-allocator-inl.h +29 -27
- data/lib/libv8/v8/src/lithium-allocator.cc +22 -17
- data/lib/libv8/v8/src/lithium-allocator.h +8 -8
- data/lib/libv8/v8/src/lithium.cc +16 -11
- data/lib/libv8/v8/src/lithium.h +31 -34
- data/lib/libv8/v8/src/liveedit.cc +111 -15
- data/lib/libv8/v8/src/liveedit.h +3 -4
- data/lib/libv8/v8/src/liveobjectlist.cc +116 -80
- data/lib/libv8/v8/src/liveobjectlist.h +2 -2
- data/lib/libv8/v8/src/log-inl.h +0 -4
- data/lib/libv8/v8/src/log-utils.cc +25 -143
- data/lib/libv8/v8/src/log-utils.h +13 -92
- data/lib/libv8/v8/src/log.cc +26 -249
- data/lib/libv8/v8/src/log.h +6 -17
- data/lib/libv8/v8/src/macros.py +9 -6
- data/lib/libv8/v8/src/mark-compact.cc +276 -56
- data/lib/libv8/v8/src/mark-compact.h +20 -0
- data/lib/libv8/v8/src/messages.js +93 -39
- data/lib/libv8/v8/src/mips/assembler-mips-inl.h +9 -3
- data/lib/libv8/v8/src/mips/assembler-mips.cc +297 -189
- data/lib/libv8/v8/src/mips/assembler-mips.h +121 -54
- data/lib/libv8/v8/src/mips/builtins-mips.cc +23 -24
- data/lib/libv8/v8/src/mips/code-stubs-mips.cc +484 -263
- data/lib/libv8/v8/src/mips/code-stubs-mips.h +8 -83
- data/lib/libv8/v8/src/mips/codegen-mips.h +0 -2
- data/lib/libv8/v8/src/mips/constants-mips.h +37 -11
- data/lib/libv8/v8/src/mips/deoptimizer-mips.cc +6 -1
- data/lib/libv8/v8/src/mips/frames-mips.h +8 -7
- data/lib/libv8/v8/src/mips/full-codegen-mips.cc +258 -419
- data/lib/libv8/v8/src/mips/ic-mips.cc +181 -121
- data/lib/libv8/v8/src/mips/macro-assembler-mips.cc +640 -382
- data/lib/libv8/v8/src/mips/macro-assembler-mips.h +94 -89
- data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.cc +23 -10
- data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.h +6 -1
- data/lib/libv8/v8/src/mips/simulator-mips.cc +249 -49
- data/lib/libv8/v8/src/mips/simulator-mips.h +25 -1
- data/lib/libv8/v8/src/mips/stub-cache-mips.cc +373 -161
- data/lib/libv8/v8/src/mirror-debugger.js +55 -8
- data/lib/libv8/v8/src/misc-intrinsics.h +89 -0
- data/lib/libv8/v8/src/mksnapshot.cc +36 -4
- data/lib/libv8/v8/src/natives.h +5 -2
- data/lib/libv8/v8/src/objects-debug.cc +73 -6
- data/lib/libv8/v8/src/objects-inl.h +529 -164
- data/lib/libv8/v8/src/objects-printer.cc +67 -12
- data/lib/libv8/v8/src/objects-visiting.cc +13 -2
- data/lib/libv8/v8/src/objects-visiting.h +41 -1
- data/lib/libv8/v8/src/objects.cc +2200 -1177
- data/lib/libv8/v8/src/objects.h +912 -283
- data/lib/libv8/v8/src/parser.cc +566 -371
- data/lib/libv8/v8/src/parser.h +35 -33
- data/lib/libv8/v8/src/platform-cygwin.cc +10 -25
- data/lib/libv8/v8/src/platform-freebsd.cc +4 -29
- data/lib/libv8/v8/src/platform-linux.cc +60 -57
- data/lib/libv8/v8/src/platform-macos.cc +4 -27
- data/lib/libv8/v8/src/platform-nullos.cc +3 -16
- data/lib/libv8/v8/src/platform-openbsd.cc +247 -85
- data/lib/libv8/v8/src/platform-posix.cc +43 -1
- data/lib/libv8/v8/src/platform-solaris.cc +151 -112
- data/lib/libv8/v8/src/platform-tls.h +1 -1
- data/lib/libv8/v8/src/platform-win32.cc +65 -39
- data/lib/libv8/v8/src/platform.h +17 -14
- data/lib/libv8/v8/src/preparse-data-format.h +2 -2
- data/lib/libv8/v8/src/preparse-data.h +8 -2
- data/lib/libv8/v8/src/preparser-api.cc +2 -18
- data/lib/libv8/v8/src/preparser.cc +106 -65
- data/lib/libv8/v8/src/preparser.h +26 -5
- data/lib/libv8/v8/src/prettyprinter.cc +25 -43
- data/lib/libv8/v8/src/profile-generator-inl.h +0 -4
- data/lib/libv8/v8/src/profile-generator.cc +213 -34
- data/lib/libv8/v8/src/profile-generator.h +9 -9
- data/lib/libv8/v8/src/property.h +1 -0
- data/lib/libv8/v8/src/proxy.js +74 -4
- data/lib/libv8/v8/src/regexp-macro-assembler.cc +10 -6
- data/lib/libv8/v8/src/regexp.js +16 -11
- data/lib/libv8/v8/src/rewriter.cc +24 -133
- data/lib/libv8/v8/src/runtime-profiler.cc +27 -151
- data/lib/libv8/v8/src/runtime-profiler.h +5 -31
- data/lib/libv8/v8/src/runtime.cc +1450 -681
- data/lib/libv8/v8/src/runtime.h +47 -31
- data/lib/libv8/v8/src/runtime.js +2 -1
- data/lib/libv8/v8/src/scanner-base.cc +358 -220
- data/lib/libv8/v8/src/scanner-base.h +30 -138
- data/lib/libv8/v8/src/scanner.cc +0 -18
- data/lib/libv8/v8/src/scanner.h +0 -15
- data/lib/libv8/v8/src/scopeinfo.cc +3 -1
- data/lib/libv8/v8/src/scopeinfo.h +1 -6
- data/lib/libv8/v8/src/scopes.cc +243 -253
- data/lib/libv8/v8/src/scopes.h +58 -109
- data/lib/libv8/v8/src/serialize.cc +12 -54
- data/lib/libv8/v8/src/serialize.h +47 -0
- data/lib/libv8/v8/src/small-pointer-list.h +25 -0
- data/lib/libv8/v8/src/spaces-inl.h +4 -50
- data/lib/libv8/v8/src/spaces.cc +64 -131
- data/lib/libv8/v8/src/spaces.h +19 -70
- data/lib/libv8/v8/src/string-stream.cc +3 -1
- data/lib/libv8/v8/src/string.js +10 -6
- data/lib/libv8/v8/src/strtod.cc +7 -3
- data/lib/libv8/v8/src/stub-cache.cc +59 -129
- data/lib/libv8/v8/src/stub-cache.h +42 -54
- data/lib/libv8/v8/src/third_party/valgrind/valgrind.h +1447 -1339
- data/lib/libv8/v8/src/token.cc +4 -4
- data/lib/libv8/v8/src/token.h +6 -5
- data/lib/libv8/v8/src/type-info.cc +173 -129
- data/lib/libv8/v8/src/type-info.h +40 -22
- data/lib/libv8/v8/src/utils.cc +25 -304
- data/lib/libv8/v8/src/utils.h +118 -3
- data/lib/libv8/v8/src/v8-counters.h +3 -6
- data/lib/libv8/v8/src/v8.cc +34 -27
- data/lib/libv8/v8/src/v8.h +7 -7
- data/lib/libv8/v8/src/v8conversions.cc +129 -0
- data/lib/libv8/v8/src/v8conversions.h +60 -0
- data/lib/libv8/v8/src/v8globals.h +15 -6
- data/lib/libv8/v8/src/v8natives.js +300 -78
- data/lib/libv8/v8/src/v8threads.cc +14 -6
- data/lib/libv8/v8/src/v8threads.h +4 -1
- data/lib/libv8/v8/src/v8utils.cc +360 -0
- data/lib/libv8/v8/src/v8utils.h +17 -66
- data/lib/libv8/v8/src/variables.cc +7 -12
- data/lib/libv8/v8/src/variables.h +12 -10
- data/lib/libv8/v8/src/version.cc +2 -2
- data/lib/libv8/v8/src/vm-state-inl.h +0 -41
- data/lib/libv8/v8/src/vm-state.h +0 -11
- data/lib/libv8/v8/src/weakmap.js +103 -0
- data/lib/libv8/v8/src/x64/assembler-x64.h +6 -3
- data/lib/libv8/v8/src/x64/builtins-x64.cc +25 -22
- data/lib/libv8/v8/src/x64/code-stubs-x64.cc +523 -250
- data/lib/libv8/v8/src/x64/code-stubs-x64.h +8 -71
- data/lib/libv8/v8/src/x64/codegen-x64.cc +1 -0
- data/lib/libv8/v8/src/x64/codegen-x64.h +0 -2
- data/lib/libv8/v8/src/x64/cpu-x64.cc +2 -1
- data/lib/libv8/v8/src/x64/deoptimizer-x64.cc +40 -8
- data/lib/libv8/v8/src/x64/disasm-x64.cc +12 -10
- data/lib/libv8/v8/src/x64/frames-x64.h +7 -6
- data/lib/libv8/v8/src/x64/full-codegen-x64.cc +310 -415
- data/lib/libv8/v8/src/x64/ic-x64.cc +180 -117
- data/lib/libv8/v8/src/x64/lithium-codegen-x64.cc +411 -523
- data/lib/libv8/v8/src/x64/lithium-codegen-x64.h +11 -6
- data/lib/libv8/v8/src/x64/lithium-x64.cc +191 -216
- data/lib/libv8/v8/src/x64/lithium-x64.h +112 -263
- data/lib/libv8/v8/src/x64/macro-assembler-x64.cc +177 -61
- data/lib/libv8/v8/src/x64/macro-assembler-x64.h +23 -7
- data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.cc +21 -9
- data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.h +6 -0
- data/lib/libv8/v8/src/x64/stub-cache-x64.cc +273 -107
- data/lib/libv8/v8/src/zone.cc +31 -22
- data/lib/libv8/v8/src/zone.h +12 -6
- data/lib/libv8/v8/tools/codemap.js +8 -0
- data/lib/libv8/v8/tools/gcmole/Makefile +43 -0
- data/lib/libv8/v8/tools/gcmole/gcmole.lua +0 -2
- data/lib/libv8/v8/tools/gdb-v8-support.py +154 -0
- data/lib/libv8/v8/tools/grokdump.py +44 -35
- data/lib/libv8/v8/tools/gyp/v8.gyp +94 -248
- data/lib/libv8/v8/tools/js2c.py +83 -52
- data/lib/libv8/v8/tools/linux-tick-processor +4 -6
- data/lib/libv8/v8/tools/ll_prof.py +3 -3
- data/lib/libv8/v8/tools/oom_dump/README +3 -1
- data/lib/libv8/v8/tools/presubmit.py +11 -4
- data/lib/libv8/v8/tools/profile.js +46 -2
- data/lib/libv8/v8/tools/splaytree.js +11 -0
- data/lib/libv8/v8/tools/stats-viewer.py +15 -11
- data/lib/libv8/v8/tools/test-wrapper-gypbuild.py +227 -0
- data/lib/libv8/v8/tools/test.py +28 -8
- data/lib/libv8/v8/tools/tickprocessor.js +0 -16
- data/lib/libv8/version.rb +1 -1
- data/libv8.gemspec +2 -2
- metadata +31 -19
- data/lib/libv8/scons/engine/SCons/Tool/f03.py +0 -63
- data/lib/libv8/v8/src/json-parser.cc +0 -504
|
@@ -125,18 +125,17 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
|
|
|
125
125
|
__ movq(rcx, Operand(rsp, 1 * kPointerSize));
|
|
126
126
|
|
|
127
127
|
// Setup the object header.
|
|
128
|
-
__ LoadRoot(kScratchRegister, Heap::
|
|
128
|
+
__ LoadRoot(kScratchRegister, Heap::kFunctionContextMapRootIndex);
|
|
129
129
|
__ movq(FieldOperand(rax, HeapObject::kMapOffset), kScratchRegister);
|
|
130
130
|
__ Move(FieldOperand(rax, FixedArray::kLengthOffset), Smi::FromInt(length));
|
|
131
131
|
|
|
132
132
|
// Setup the fixed slots.
|
|
133
133
|
__ Set(rbx, 0); // Set to NULL.
|
|
134
134
|
__ movq(Operand(rax, Context::SlotOffset(Context::CLOSURE_INDEX)), rcx);
|
|
135
|
-
__ movq(Operand(rax, Context::SlotOffset(Context::
|
|
136
|
-
__ movq(Operand(rax, Context::SlotOffset(Context::PREVIOUS_INDEX)), rbx);
|
|
135
|
+
__ movq(Operand(rax, Context::SlotOffset(Context::PREVIOUS_INDEX)), rsi);
|
|
137
136
|
__ movq(Operand(rax, Context::SlotOffset(Context::EXTENSION_INDEX)), rbx);
|
|
138
137
|
|
|
139
|
-
// Copy the global object from the
|
|
138
|
+
// Copy the global object from the previous context.
|
|
140
139
|
__ movq(rbx, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
|
|
141
140
|
__ movq(Operand(rax, Context::SlotOffset(Context::GLOBAL_INDEX)), rbx);
|
|
142
141
|
|
|
@@ -152,7 +151,7 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
|
|
|
152
151
|
|
|
153
152
|
// Need to collect. Call into runtime system.
|
|
154
153
|
__ bind(&gc);
|
|
155
|
-
__ TailCallRuntime(Runtime::
|
|
154
|
+
__ TailCallRuntime(Runtime::kNewFunctionContext, 1, 1);
|
|
156
155
|
}
|
|
157
156
|
|
|
158
157
|
|
|
@@ -231,69 +230,139 @@ void FastCloneShallowArrayStub::Generate(MacroAssembler* masm) {
|
|
|
231
230
|
}
|
|
232
231
|
|
|
233
232
|
|
|
233
|
+
// The stub expects its argument on the stack and returns its result in tos_:
|
|
234
|
+
// zero for false, and a non-zero value for true.
|
|
234
235
|
void ToBooleanStub::Generate(MacroAssembler* masm) {
|
|
235
|
-
Label
|
|
236
|
-
|
|
236
|
+
Label patch;
|
|
237
|
+
const Register argument = rax;
|
|
238
|
+
const Register map = rdx;
|
|
239
|
+
|
|
240
|
+
if (!types_.IsEmpty()) {
|
|
241
|
+
__ movq(argument, Operand(rsp, 1 * kPointerSize));
|
|
242
|
+
}
|
|
237
243
|
|
|
238
244
|
// undefined -> false
|
|
239
|
-
|
|
240
|
-
__ j(equal, &false_result);
|
|
245
|
+
CheckOddball(masm, UNDEFINED, Heap::kUndefinedValueRootIndex, false);
|
|
241
246
|
|
|
242
247
|
// Boolean -> its value
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
// Undetectable => false.
|
|
264
|
-
__ movzxbq(rbx, FieldOperand(rdx, Map::kBitFieldOffset));
|
|
265
|
-
__ and_(rbx, Immediate(1 << Map::kIsUndetectable));
|
|
266
|
-
__ j(not_zero, &false_result, Label::kNear);
|
|
267
|
-
|
|
268
|
-
// JavaScript object => true.
|
|
269
|
-
__ cmpq(rcx, Immediate(FIRST_JS_OBJECT_TYPE));
|
|
270
|
-
__ j(above_equal, &true_result, Label::kNear);
|
|
271
|
-
|
|
272
|
-
// String value => false iff empty.
|
|
273
|
-
__ cmpq(rcx, Immediate(FIRST_NONSTRING_TYPE));
|
|
274
|
-
__ j(above_equal, ¬_string, Label::kNear);
|
|
275
|
-
__ movq(rdx, FieldOperand(rax, String::kLengthOffset));
|
|
276
|
-
__ SmiTest(rdx);
|
|
277
|
-
__ j(zero, &false_result, Label::kNear);
|
|
278
|
-
__ jmp(&true_result, Label::kNear);
|
|
248
|
+
CheckOddball(masm, BOOLEAN, Heap::kFalseValueRootIndex, false);
|
|
249
|
+
CheckOddball(masm, BOOLEAN, Heap::kTrueValueRootIndex, true);
|
|
250
|
+
|
|
251
|
+
// 'null' -> false.
|
|
252
|
+
CheckOddball(masm, NULL_TYPE, Heap::kNullValueRootIndex, false);
|
|
253
|
+
|
|
254
|
+
if (types_.Contains(SMI)) {
|
|
255
|
+
// Smis: 0 -> false, all other -> true
|
|
256
|
+
Label not_smi;
|
|
257
|
+
__ JumpIfNotSmi(argument, ¬_smi, Label::kNear);
|
|
258
|
+
// argument contains the correct return value already
|
|
259
|
+
if (!tos_.is(argument)) {
|
|
260
|
+
__ movq(tos_, argument);
|
|
261
|
+
}
|
|
262
|
+
__ ret(1 * kPointerSize);
|
|
263
|
+
__ bind(¬_smi);
|
|
264
|
+
} else if (types_.NeedsMap()) {
|
|
265
|
+
// If we need a map later and have a Smi -> patch.
|
|
266
|
+
__ JumpIfSmi(argument, &patch, Label::kNear);
|
|
267
|
+
}
|
|
279
268
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
269
|
+
if (types_.NeedsMap()) {
|
|
270
|
+
__ movq(map, FieldOperand(argument, HeapObject::kMapOffset));
|
|
271
|
+
|
|
272
|
+
if (types_.CanBeUndetectable()) {
|
|
273
|
+
__ testb(FieldOperand(map, Map::kBitFieldOffset),
|
|
274
|
+
Immediate(1 << Map::kIsUndetectable));
|
|
275
|
+
// Undetectable -> false.
|
|
276
|
+
Label not_undetectable;
|
|
277
|
+
__ j(zero, ¬_undetectable, Label::kNear);
|
|
278
|
+
__ Set(tos_, 0);
|
|
279
|
+
__ ret(1 * kPointerSize);
|
|
280
|
+
__ bind(¬_undetectable);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
289
283
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
284
|
+
if (types_.Contains(SPEC_OBJECT)) {
|
|
285
|
+
// spec object -> true.
|
|
286
|
+
Label not_js_object;
|
|
287
|
+
__ CmpInstanceType(map, FIRST_SPEC_OBJECT_TYPE);
|
|
288
|
+
__ j(below, ¬_js_object, Label::kNear);
|
|
289
|
+
// argument contains the correct return value already.
|
|
290
|
+
if (!tos_.is(argument)) {
|
|
291
|
+
__ Set(tos_, 1);
|
|
292
|
+
}
|
|
293
|
+
__ ret(1 * kPointerSize);
|
|
294
|
+
__ bind(¬_js_object);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (types_.Contains(STRING)) {
|
|
298
|
+
// String value -> false iff empty.
|
|
299
|
+
Label not_string;
|
|
300
|
+
__ CmpInstanceType(map, FIRST_NONSTRING_TYPE);
|
|
301
|
+
__ j(above_equal, ¬_string, Label::kNear);
|
|
302
|
+
__ movq(tos_, FieldOperand(argument, String::kLengthOffset));
|
|
303
|
+
__ ret(1 * kPointerSize); // the string length is OK as the return value
|
|
304
|
+
__ bind(¬_string);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
if (types_.Contains(HEAP_NUMBER)) {
|
|
308
|
+
// heap number -> false iff +0, -0, or NaN.
|
|
309
|
+
Label not_heap_number, false_result;
|
|
310
|
+
__ CompareRoot(map, Heap::kHeapNumberMapRootIndex);
|
|
311
|
+
__ j(not_equal, ¬_heap_number, Label::kNear);
|
|
312
|
+
__ xorps(xmm0, xmm0);
|
|
313
|
+
__ ucomisd(xmm0, FieldOperand(argument, HeapNumber::kValueOffset));
|
|
314
|
+
__ j(zero, &false_result, Label::kNear);
|
|
315
|
+
// argument contains the correct return value already.
|
|
316
|
+
if (!tos_.is(argument)) {
|
|
317
|
+
__ Set(tos_, 1);
|
|
318
|
+
}
|
|
319
|
+
__ ret(1 * kPointerSize);
|
|
320
|
+
__ bind(&false_result);
|
|
321
|
+
__ Set(tos_, 0);
|
|
322
|
+
__ ret(1 * kPointerSize);
|
|
323
|
+
__ bind(¬_heap_number);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
__ bind(&patch);
|
|
327
|
+
GenerateTypeTransition(masm);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
void ToBooleanStub::CheckOddball(MacroAssembler* masm,
|
|
332
|
+
Type type,
|
|
333
|
+
Heap::RootListIndex value,
|
|
334
|
+
bool result) {
|
|
335
|
+
const Register argument = rax;
|
|
336
|
+
if (types_.Contains(type)) {
|
|
337
|
+
// If we see an expected oddball, return its ToBoolean value tos_.
|
|
338
|
+
Label different_value;
|
|
339
|
+
__ CompareRoot(argument, value);
|
|
340
|
+
__ j(not_equal, &different_value, Label::kNear);
|
|
341
|
+
if (!result) {
|
|
342
|
+
// If we have to return zero, there is no way around clearing tos_.
|
|
343
|
+
__ Set(tos_, 0);
|
|
344
|
+
} else if (!tos_.is(argument)) {
|
|
345
|
+
// If we have to return non-zero, we can re-use the argument if it is the
|
|
346
|
+
// same register as the result, because we never see Smi-zero here.
|
|
347
|
+
__ Set(tos_, 1);
|
|
348
|
+
}
|
|
349
|
+
__ ret(1 * kPointerSize);
|
|
350
|
+
__ bind(&different_value);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
void ToBooleanStub::GenerateTypeTransition(MacroAssembler* masm) {
|
|
356
|
+
__ pop(rcx); // Get return address, operand is now on top of stack.
|
|
357
|
+
__ Push(Smi::FromInt(tos_.code()));
|
|
358
|
+
__ Push(Smi::FromInt(types_.ToByte()));
|
|
359
|
+
__ push(rcx); // Push return address.
|
|
360
|
+
// Patch the caller to an appropriate specialized stub and return the
|
|
361
|
+
// operation result to the caller of the stub.
|
|
362
|
+
__ TailCallExternalReference(
|
|
363
|
+
ExternalReference(IC_Utility(IC::kToBoolean_Patch), masm->isolate()),
|
|
364
|
+
3,
|
|
365
|
+
1);
|
|
297
366
|
}
|
|
298
367
|
|
|
299
368
|
|
|
@@ -406,12 +475,6 @@ void IntegerConvert(MacroAssembler* masm,
|
|
|
406
475
|
}
|
|
407
476
|
|
|
408
477
|
|
|
409
|
-
Handle<Code> GetUnaryOpStub(int key, UnaryOpIC::TypeInfo type_info) {
|
|
410
|
-
UnaryOpStub stub(key, type_info);
|
|
411
|
-
return stub.GetCode();
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
|
|
415
478
|
void UnaryOpStub::Generate(MacroAssembler* masm) {
|
|
416
479
|
switch (operand_type_) {
|
|
417
480
|
case UnaryOpIC::UNINITIALIZED:
|
|
@@ -432,12 +495,10 @@ void UnaryOpStub::Generate(MacroAssembler* masm) {
|
|
|
432
495
|
|
|
433
496
|
void UnaryOpStub::GenerateTypeTransition(MacroAssembler* masm) {
|
|
434
497
|
__ pop(rcx); // Save return address.
|
|
435
|
-
|
|
436
|
-
//
|
|
437
|
-
// Push this stub's key. Although the operation and the type info are
|
|
438
|
-
// encoded into the key, the encoding is opaque, so push them too.
|
|
439
|
-
__ Push(Smi::FromInt(MinorKey()));
|
|
498
|
+
|
|
499
|
+
__ push(rax); // the operand
|
|
440
500
|
__ Push(Smi::FromInt(op_));
|
|
501
|
+
__ Push(Smi::FromInt(mode_));
|
|
441
502
|
__ Push(Smi::FromInt(operand_type_));
|
|
442
503
|
|
|
443
504
|
__ push(rcx); // Push return address.
|
|
@@ -445,10 +506,7 @@ void UnaryOpStub::GenerateTypeTransition(MacroAssembler* masm) {
|
|
|
445
506
|
// Patch the caller to an appropriate specialized stub and return the
|
|
446
507
|
// operation result to the caller of the stub.
|
|
447
508
|
__ TailCallExternalReference(
|
|
448
|
-
ExternalReference(IC_Utility(IC::kUnaryOp_Patch),
|
|
449
|
-
masm->isolate()),
|
|
450
|
-
4,
|
|
451
|
-
1);
|
|
509
|
+
ExternalReference(IC_Utility(IC::kUnaryOp_Patch), masm->isolate()), 4, 1);
|
|
452
510
|
}
|
|
453
511
|
|
|
454
512
|
|
|
@@ -655,33 +713,17 @@ void UnaryOpStub::GenerateGenericCodeFallback(MacroAssembler* masm) {
|
|
|
655
713
|
}
|
|
656
714
|
|
|
657
715
|
|
|
658
|
-
|
|
659
|
-
if (name_ != NULL) return name_;
|
|
660
|
-
const int kMaxNameLength = 100;
|
|
661
|
-
name_ = Isolate::Current()->bootstrapper()->AllocateAutoDeletedArray(
|
|
662
|
-
kMaxNameLength);
|
|
663
|
-
if (name_ == NULL) return "OOM";
|
|
716
|
+
void UnaryOpStub::PrintName(StringStream* stream) {
|
|
664
717
|
const char* op_name = Token::Name(op_);
|
|
665
718
|
const char* overwrite_name = NULL; // Make g++ happy.
|
|
666
719
|
switch (mode_) {
|
|
667
720
|
case UNARY_NO_OVERWRITE: overwrite_name = "Alloc"; break;
|
|
668
721
|
case UNARY_OVERWRITE: overwrite_name = "Overwrite"; break;
|
|
669
722
|
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
overwrite_name,
|
|
675
|
-
UnaryOpIC::GetName(operand_type_));
|
|
676
|
-
return name_;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
Handle<Code> GetBinaryOpStub(int key,
|
|
681
|
-
BinaryOpIC::TypeInfo type_info,
|
|
682
|
-
BinaryOpIC::TypeInfo result_type_info) {
|
|
683
|
-
BinaryOpStub stub(key, type_info, result_type_info);
|
|
684
|
-
return stub.GetCode();
|
|
723
|
+
stream->Add("UnaryOpStub_%s_%s_%s",
|
|
724
|
+
op_name,
|
|
725
|
+
overwrite_name,
|
|
726
|
+
UnaryOpIC::GetName(operand_type_));
|
|
685
727
|
}
|
|
686
728
|
|
|
687
729
|
|
|
@@ -742,12 +784,7 @@ void BinaryOpStub::Generate(MacroAssembler* masm) {
|
|
|
742
784
|
}
|
|
743
785
|
|
|
744
786
|
|
|
745
|
-
|
|
746
|
-
if (name_ != NULL) return name_;
|
|
747
|
-
const int kMaxNameLength = 100;
|
|
748
|
-
name_ = Isolate::Current()->bootstrapper()->AllocateAutoDeletedArray(
|
|
749
|
-
kMaxNameLength);
|
|
750
|
-
if (name_ == NULL) return "OOM";
|
|
787
|
+
void BinaryOpStub::PrintName(StringStream* stream) {
|
|
751
788
|
const char* op_name = Token::Name(op_);
|
|
752
789
|
const char* overwrite_name;
|
|
753
790
|
switch (mode_) {
|
|
@@ -756,13 +793,10 @@ const char* BinaryOpStub::GetName() {
|
|
|
756
793
|
case OVERWRITE_LEFT: overwrite_name = "OverwriteLeft"; break;
|
|
757
794
|
default: overwrite_name = "UnknownOverwrite"; break;
|
|
758
795
|
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
overwrite_name,
|
|
764
|
-
BinaryOpIC::GetName(operands_type_));
|
|
765
|
-
return name_;
|
|
796
|
+
stream->Add("BinaryOpStub_%s_%s_%s",
|
|
797
|
+
op_name,
|
|
798
|
+
overwrite_name,
|
|
799
|
+
BinaryOpIC::GetName(operands_type_));
|
|
766
800
|
}
|
|
767
801
|
|
|
768
802
|
|
|
@@ -1959,49 +1993,288 @@ void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
|
|
|
1959
1993
|
}
|
|
1960
1994
|
|
|
1961
1995
|
|
|
1962
|
-
void ArgumentsAccessStub::
|
|
1996
|
+
void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) {
|
|
1997
|
+
// Stack layout:
|
|
1998
|
+
// rsp[0] : return address
|
|
1999
|
+
// rsp[8] : number of parameters (tagged)
|
|
2000
|
+
// rsp[16] : receiver displacement
|
|
2001
|
+
// rsp[24] : function
|
|
2002
|
+
// Registers used over the whole function:
|
|
2003
|
+
// rbx: the mapped parameter count (untagged)
|
|
2004
|
+
// rax: the allocated object (tagged).
|
|
2005
|
+
|
|
2006
|
+
Factory* factory = masm->isolate()->factory();
|
|
2007
|
+
|
|
2008
|
+
__ SmiToInteger64(rbx, Operand(rsp, 1 * kPointerSize));
|
|
2009
|
+
// rbx = parameter count (untagged)
|
|
2010
|
+
|
|
2011
|
+
// Check if the calling frame is an arguments adaptor frame.
|
|
2012
|
+
Label runtime;
|
|
2013
|
+
Label adaptor_frame, try_allocate;
|
|
2014
|
+
__ movq(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
|
|
2015
|
+
__ movq(rcx, Operand(rdx, StandardFrameConstants::kContextOffset));
|
|
2016
|
+
__ Cmp(rcx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
|
2017
|
+
__ j(equal, &adaptor_frame);
|
|
2018
|
+
|
|
2019
|
+
// No adaptor, parameter count = argument count.
|
|
2020
|
+
__ movq(rcx, rbx);
|
|
2021
|
+
__ jmp(&try_allocate, Label::kNear);
|
|
2022
|
+
|
|
2023
|
+
// We have an adaptor frame. Patch the parameters pointer.
|
|
2024
|
+
__ bind(&adaptor_frame);
|
|
2025
|
+
__ SmiToInteger64(rcx,
|
|
2026
|
+
Operand(rdx,
|
|
2027
|
+
ArgumentsAdaptorFrameConstants::kLengthOffset));
|
|
2028
|
+
__ lea(rdx, Operand(rdx, rcx, times_pointer_size,
|
|
2029
|
+
StandardFrameConstants::kCallerSPOffset));
|
|
2030
|
+
__ movq(Operand(rsp, 2 * kPointerSize), rdx);
|
|
2031
|
+
|
|
2032
|
+
// rbx = parameter count (untagged)
|
|
2033
|
+
// rcx = argument count (untagged)
|
|
2034
|
+
// Compute the mapped parameter count = min(rbx, rcx) in rbx.
|
|
2035
|
+
__ cmpq(rbx, rcx);
|
|
2036
|
+
__ j(less_equal, &try_allocate, Label::kNear);
|
|
2037
|
+
__ movq(rbx, rcx);
|
|
2038
|
+
|
|
2039
|
+
__ bind(&try_allocate);
|
|
2040
|
+
|
|
2041
|
+
// Compute the sizes of backing store, parameter map, and arguments object.
|
|
2042
|
+
// 1. Parameter map, has 2 extra words containing context and backing store.
|
|
2043
|
+
const int kParameterMapHeaderSize =
|
|
2044
|
+
FixedArray::kHeaderSize + 2 * kPointerSize;
|
|
2045
|
+
Label no_parameter_map;
|
|
2046
|
+
__ testq(rbx, rbx);
|
|
2047
|
+
__ j(zero, &no_parameter_map, Label::kNear);
|
|
2048
|
+
__ lea(r8, Operand(rbx, times_pointer_size, kParameterMapHeaderSize));
|
|
2049
|
+
__ bind(&no_parameter_map);
|
|
2050
|
+
|
|
2051
|
+
// 2. Backing store.
|
|
2052
|
+
__ lea(r8, Operand(r8, rcx, times_pointer_size, FixedArray::kHeaderSize));
|
|
2053
|
+
|
|
2054
|
+
// 3. Arguments object.
|
|
2055
|
+
__ addq(r8, Immediate(Heap::kArgumentsObjectSize));
|
|
2056
|
+
|
|
2057
|
+
// Do the allocation of all three objects in one go.
|
|
2058
|
+
__ AllocateInNewSpace(r8, rax, rdx, rdi, &runtime, TAG_OBJECT);
|
|
2059
|
+
|
|
2060
|
+
// rax = address of new object(s) (tagged)
|
|
2061
|
+
// rcx = argument count (untagged)
|
|
2062
|
+
// Get the arguments boilerplate from the current (global) context into rdi.
|
|
2063
|
+
Label has_mapped_parameters, copy;
|
|
2064
|
+
__ movq(rdi, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
|
|
2065
|
+
__ movq(rdi, FieldOperand(rdi, GlobalObject::kGlobalContextOffset));
|
|
2066
|
+
__ testq(rbx, rbx);
|
|
2067
|
+
__ j(not_zero, &has_mapped_parameters, Label::kNear);
|
|
2068
|
+
|
|
2069
|
+
const int kIndex = Context::ARGUMENTS_BOILERPLATE_INDEX;
|
|
2070
|
+
__ movq(rdi, Operand(rdi, Context::SlotOffset(kIndex)));
|
|
2071
|
+
__ jmp(©, Label::kNear);
|
|
2072
|
+
|
|
2073
|
+
const int kAliasedIndex = Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX;
|
|
2074
|
+
__ bind(&has_mapped_parameters);
|
|
2075
|
+
__ movq(rdi, Operand(rdi, Context::SlotOffset(kAliasedIndex)));
|
|
2076
|
+
__ bind(©);
|
|
2077
|
+
|
|
2078
|
+
// rax = address of new object (tagged)
|
|
2079
|
+
// rbx = mapped parameter count (untagged)
|
|
2080
|
+
// rcx = argument count (untagged)
|
|
2081
|
+
// rdi = address of boilerplate object (tagged)
|
|
2082
|
+
// Copy the JS object part.
|
|
2083
|
+
for (int i = 0; i < JSObject::kHeaderSize; i += kPointerSize) {
|
|
2084
|
+
__ movq(rdx, FieldOperand(rdi, i));
|
|
2085
|
+
__ movq(FieldOperand(rax, i), rdx);
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
// Setup the callee in-object property.
|
|
2089
|
+
STATIC_ASSERT(Heap::kArgumentsCalleeIndex == 1);
|
|
2090
|
+
__ movq(rdx, Operand(rsp, 3 * kPointerSize));
|
|
2091
|
+
__ movq(FieldOperand(rax, JSObject::kHeaderSize +
|
|
2092
|
+
Heap::kArgumentsCalleeIndex * kPointerSize),
|
|
2093
|
+
rdx);
|
|
2094
|
+
|
|
2095
|
+
// Use the length (smi tagged) and set that as an in-object property too.
|
|
2096
|
+
// Note: rcx is tagged from here on.
|
|
2097
|
+
STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0);
|
|
2098
|
+
__ Integer32ToSmi(rcx, rcx);
|
|
2099
|
+
__ movq(FieldOperand(rax, JSObject::kHeaderSize +
|
|
2100
|
+
Heap::kArgumentsLengthIndex * kPointerSize),
|
|
2101
|
+
rcx);
|
|
2102
|
+
|
|
2103
|
+
// Setup the elements pointer in the allocated arguments object.
|
|
2104
|
+
// If we allocated a parameter map, edi will point there, otherwise to the
|
|
2105
|
+
// backing store.
|
|
2106
|
+
__ lea(rdi, Operand(rax, Heap::kArgumentsObjectSize));
|
|
2107
|
+
__ movq(FieldOperand(rax, JSObject::kElementsOffset), rdi);
|
|
2108
|
+
|
|
2109
|
+
// rax = address of new object (tagged)
|
|
2110
|
+
// rbx = mapped parameter count (untagged)
|
|
2111
|
+
// rcx = argument count (tagged)
|
|
2112
|
+
// rdi = address of parameter map or backing store (tagged)
|
|
2113
|
+
|
|
2114
|
+
// Initialize parameter map. If there are no mapped arguments, we're done.
|
|
2115
|
+
Label skip_parameter_map;
|
|
2116
|
+
__ testq(rbx, rbx);
|
|
2117
|
+
__ j(zero, &skip_parameter_map);
|
|
2118
|
+
|
|
2119
|
+
__ LoadRoot(kScratchRegister, Heap::kNonStrictArgumentsElementsMapRootIndex);
|
|
2120
|
+
// rbx contains the untagged argument count. Add 2 and tag to write.
|
|
2121
|
+
__ movq(FieldOperand(rdi, FixedArray::kMapOffset), kScratchRegister);
|
|
2122
|
+
__ Integer64PlusConstantToSmi(r9, rbx, 2);
|
|
2123
|
+
__ movq(FieldOperand(rdi, FixedArray::kLengthOffset), r9);
|
|
2124
|
+
__ movq(FieldOperand(rdi, FixedArray::kHeaderSize + 0 * kPointerSize), rsi);
|
|
2125
|
+
__ lea(r9, Operand(rdi, rbx, times_pointer_size, kParameterMapHeaderSize));
|
|
2126
|
+
__ movq(FieldOperand(rdi, FixedArray::kHeaderSize + 1 * kPointerSize), r9);
|
|
2127
|
+
|
|
2128
|
+
// Copy the parameter slots and the holes in the arguments.
|
|
2129
|
+
// We need to fill in mapped_parameter_count slots. They index the context,
|
|
2130
|
+
// where parameters are stored in reverse order, at
|
|
2131
|
+
// MIN_CONTEXT_SLOTS .. MIN_CONTEXT_SLOTS+parameter_count-1
|
|
2132
|
+
// The mapped parameter thus need to get indices
|
|
2133
|
+
// MIN_CONTEXT_SLOTS+parameter_count-1 ..
|
|
2134
|
+
// MIN_CONTEXT_SLOTS+parameter_count-mapped_parameter_count
|
|
2135
|
+
// We loop from right to left.
|
|
2136
|
+
Label parameters_loop, parameters_test;
|
|
2137
|
+
|
|
2138
|
+
// Load tagged parameter count into r9.
|
|
2139
|
+
__ movq(r9, Operand(rsp, 1 * kPointerSize));
|
|
2140
|
+
__ Move(r8, Smi::FromInt(Context::MIN_CONTEXT_SLOTS));
|
|
2141
|
+
__ addq(r8, Operand(rsp, 3 * kPointerSize));
|
|
2142
|
+
__ subq(r8, r9);
|
|
2143
|
+
__ Move(r11, factory->the_hole_value());
|
|
2144
|
+
__ movq(rdx, rdi);
|
|
2145
|
+
__ SmiToInteger64(kScratchRegister, r9);
|
|
2146
|
+
__ lea(rdi, Operand(rdi, kScratchRegister,
|
|
2147
|
+
times_pointer_size,
|
|
2148
|
+
kParameterMapHeaderSize));
|
|
2149
|
+
// r9 = loop variable (tagged)
|
|
2150
|
+
// r8 = mapping index (tagged)
|
|
2151
|
+
// r11 = the hole value
|
|
2152
|
+
// rdx = address of parameter map (tagged)
|
|
2153
|
+
// rdi = address of backing store (tagged)
|
|
2154
|
+
__ jmp(¶meters_test, Label::kNear);
|
|
2155
|
+
|
|
2156
|
+
__ bind(¶meters_loop);
|
|
2157
|
+
__ SmiSubConstant(r9, r9, Smi::FromInt(1));
|
|
2158
|
+
__ SmiToInteger64(kScratchRegister, r9);
|
|
2159
|
+
__ movq(FieldOperand(rdx, kScratchRegister,
|
|
2160
|
+
times_pointer_size,
|
|
2161
|
+
kParameterMapHeaderSize),
|
|
2162
|
+
r8);
|
|
2163
|
+
__ movq(FieldOperand(rdi, kScratchRegister,
|
|
2164
|
+
times_pointer_size,
|
|
2165
|
+
FixedArray::kHeaderSize),
|
|
2166
|
+
r11);
|
|
2167
|
+
__ SmiAddConstant(r8, r8, Smi::FromInt(1));
|
|
2168
|
+
__ bind(¶meters_test);
|
|
2169
|
+
__ SmiTest(r9);
|
|
2170
|
+
__ j(not_zero, ¶meters_loop, Label::kNear);
|
|
2171
|
+
|
|
2172
|
+
__ bind(&skip_parameter_map);
|
|
2173
|
+
|
|
2174
|
+
// rcx = argument count (tagged)
|
|
2175
|
+
// rdi = address of backing store (tagged)
|
|
2176
|
+
// Copy arguments header and remaining slots (if there are any).
|
|
2177
|
+
__ Move(FieldOperand(rdi, FixedArray::kMapOffset),
|
|
2178
|
+
factory->fixed_array_map());
|
|
2179
|
+
__ movq(FieldOperand(rdi, FixedArray::kLengthOffset), rcx);
|
|
2180
|
+
|
|
2181
|
+
Label arguments_loop, arguments_test;
|
|
2182
|
+
__ movq(r8, rbx);
|
|
2183
|
+
__ movq(rdx, Operand(rsp, 2 * kPointerSize));
|
|
2184
|
+
// Untag rcx and r8 for the loop below.
|
|
2185
|
+
__ SmiToInteger64(rcx, rcx);
|
|
2186
|
+
__ SmiToInteger64(r8, r8);
|
|
2187
|
+
__ lea(kScratchRegister, Operand(r8, times_pointer_size, 0));
|
|
2188
|
+
__ subq(rdx, kScratchRegister);
|
|
2189
|
+
__ jmp(&arguments_test, Label::kNear);
|
|
2190
|
+
|
|
2191
|
+
__ bind(&arguments_loop);
|
|
2192
|
+
__ subq(rdx, Immediate(kPointerSize));
|
|
2193
|
+
__ movq(r9, Operand(rdx, 0));
|
|
2194
|
+
__ movq(FieldOperand(rdi, r8,
|
|
2195
|
+
times_pointer_size,
|
|
2196
|
+
FixedArray::kHeaderSize),
|
|
2197
|
+
r9);
|
|
2198
|
+
__ addq(r8, Immediate(1));
|
|
2199
|
+
|
|
2200
|
+
__ bind(&arguments_test);
|
|
2201
|
+
__ cmpq(r8, rcx);
|
|
2202
|
+
__ j(less, &arguments_loop, Label::kNear);
|
|
2203
|
+
|
|
2204
|
+
// Return and remove the on-stack parameters.
|
|
2205
|
+
__ ret(3 * kPointerSize);
|
|
2206
|
+
|
|
2207
|
+
// Do the runtime call to allocate the arguments object.
|
|
2208
|
+
// rcx = argument count (untagged)
|
|
2209
|
+
__ bind(&runtime);
|
|
2210
|
+
__ Integer32ToSmi(rcx, rcx);
|
|
2211
|
+
__ movq(Operand(rsp, 1 * kPointerSize), rcx); // Patch argument count.
|
|
2212
|
+
__ TailCallRuntime(Runtime::kNewStrictArgumentsFast, 3, 1);
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
|
|
2216
|
+
void ArgumentsAccessStub::GenerateNewNonStrictSlow(MacroAssembler* masm) {
|
|
2217
|
+
// esp[0] : return address
|
|
2218
|
+
// esp[8] : number of parameters
|
|
2219
|
+
// esp[16] : receiver displacement
|
|
2220
|
+
// esp[24] : function
|
|
2221
|
+
|
|
2222
|
+
// Check if the calling frame is an arguments adaptor frame.
|
|
2223
|
+
Label runtime;
|
|
2224
|
+
__ movq(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
|
|
2225
|
+
__ movq(rcx, Operand(rdx, StandardFrameConstants::kContextOffset));
|
|
2226
|
+
__ Cmp(rcx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
|
2227
|
+
__ j(not_equal, &runtime);
|
|
2228
|
+
|
|
2229
|
+
// Patch the arguments.length and the parameters pointer.
|
|
2230
|
+
__ movq(rcx, Operand(rdx, ArgumentsAdaptorFrameConstants::kLengthOffset));
|
|
2231
|
+
__ movq(Operand(rsp, 1 * kPointerSize), rcx);
|
|
2232
|
+
__ SmiToInteger64(rcx, rcx);
|
|
2233
|
+
__ lea(rdx, Operand(rdx, rcx, times_pointer_size,
|
|
2234
|
+
StandardFrameConstants::kCallerSPOffset));
|
|
2235
|
+
__ movq(Operand(rsp, 2 * kPointerSize), rdx);
|
|
2236
|
+
|
|
2237
|
+
__ bind(&runtime);
|
|
2238
|
+
__ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1);
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
|
|
2242
|
+
void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) {
|
|
1963
2243
|
// rsp[0] : return address
|
|
1964
2244
|
// rsp[8] : number of parameters
|
|
1965
2245
|
// rsp[16] : receiver displacement
|
|
1966
2246
|
// rsp[24] : function
|
|
1967
2247
|
|
|
1968
|
-
// The displacement is used for skipping the return address and the
|
|
1969
|
-
// frame pointer on the stack. It is the offset of the last
|
|
1970
|
-
// parameter (if any) relative to the frame pointer.
|
|
1971
|
-
static const int kDisplacement = 2 * kPointerSize;
|
|
1972
|
-
|
|
1973
2248
|
// Check if the calling frame is an arguments adaptor frame.
|
|
1974
2249
|
Label adaptor_frame, try_allocate, runtime;
|
|
1975
2250
|
__ movq(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
|
|
1976
|
-
__
|
|
1977
|
-
|
|
2251
|
+
__ movq(rcx, Operand(rdx, StandardFrameConstants::kContextOffset));
|
|
2252
|
+
__ Cmp(rcx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
|
1978
2253
|
__ j(equal, &adaptor_frame);
|
|
1979
2254
|
|
|
1980
2255
|
// Get the length from the frame.
|
|
1981
|
-
__
|
|
2256
|
+
__ movq(rcx, Operand(rsp, 1 * kPointerSize));
|
|
2257
|
+
__ SmiToInteger64(rcx, rcx);
|
|
1982
2258
|
__ jmp(&try_allocate);
|
|
1983
2259
|
|
|
1984
2260
|
// Patch the arguments.length and the parameters pointer.
|
|
1985
2261
|
__ bind(&adaptor_frame);
|
|
1986
|
-
__
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
// Do not clobber the length index for the indexing operation since
|
|
1992
|
-
// it is used compute the size for allocation later.
|
|
1993
|
-
__ lea(rdx, Operand(rdx, rcx, times_pointer_size, kDisplacement));
|
|
2262
|
+
__ movq(rcx, Operand(rdx, ArgumentsAdaptorFrameConstants::kLengthOffset));
|
|
2263
|
+
__ movq(Operand(rsp, 1 * kPointerSize), rcx);
|
|
2264
|
+
__ SmiToInteger64(rcx, rcx);
|
|
2265
|
+
__ lea(rdx, Operand(rdx, rcx, times_pointer_size,
|
|
2266
|
+
StandardFrameConstants::kCallerSPOffset));
|
|
1994
2267
|
__ movq(Operand(rsp, 2 * kPointerSize), rdx);
|
|
1995
2268
|
|
|
1996
2269
|
// Try the new space allocation. Start out with computing the size of
|
|
1997
2270
|
// the arguments object and the elements array.
|
|
1998
2271
|
Label add_arguments_object;
|
|
1999
2272
|
__ bind(&try_allocate);
|
|
2000
|
-
__
|
|
2001
|
-
__ j(zero, &add_arguments_object);
|
|
2002
|
-
__
|
|
2273
|
+
__ testq(rcx, rcx);
|
|
2274
|
+
__ j(zero, &add_arguments_object, Label::kNear);
|
|
2275
|
+
__ lea(rcx, Operand(rcx, times_pointer_size, FixedArray::kHeaderSize));
|
|
2003
2276
|
__ bind(&add_arguments_object);
|
|
2004
|
-
__
|
|
2277
|
+
__ addq(rcx, Immediate(Heap::kArgumentsObjectSizeStrict));
|
|
2005
2278
|
|
|
2006
2279
|
// Do the allocation of both objects in one go.
|
|
2007
2280
|
__ AllocateInNewSpace(rcx, rax, rdx, rbx, &runtime, TAG_OBJECT);
|
|
@@ -2009,59 +2282,51 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
|
|
|
2009
2282
|
// Get the arguments boilerplate from the current (global) context.
|
|
2010
2283
|
__ movq(rdi, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
|
|
2011
2284
|
__ movq(rdi, FieldOperand(rdi, GlobalObject::kGlobalContextOffset));
|
|
2012
|
-
|
|
2013
|
-
|
|
2285
|
+
const int offset =
|
|
2286
|
+
Context::SlotOffset(Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX);
|
|
2287
|
+
__ movq(rdi, Operand(rdi, offset));
|
|
2014
2288
|
|
|
2015
2289
|
// Copy the JS object part.
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
__ movq(rbx, FieldOperand(rdi, 2 * kPointerSize));
|
|
2020
|
-
__ movq(FieldOperand(rax, 0 * kPointerSize), kScratchRegister);
|
|
2021
|
-
__ movq(FieldOperand(rax, 1 * kPointerSize), rdx);
|
|
2022
|
-
__ movq(FieldOperand(rax, 2 * kPointerSize), rbx);
|
|
2023
|
-
|
|
2024
|
-
if (type_ == NEW_NON_STRICT) {
|
|
2025
|
-
// Setup the callee in-object property.
|
|
2026
|
-
ASSERT(Heap::kArgumentsCalleeIndex == 1);
|
|
2027
|
-
__ movq(kScratchRegister, Operand(rsp, 3 * kPointerSize));
|
|
2028
|
-
__ movq(FieldOperand(rax, JSObject::kHeaderSize +
|
|
2029
|
-
Heap::kArgumentsCalleeIndex * kPointerSize),
|
|
2030
|
-
kScratchRegister);
|
|
2290
|
+
for (int i = 0; i < JSObject::kHeaderSize; i += kPointerSize) {
|
|
2291
|
+
__ movq(rbx, FieldOperand(rdi, i));
|
|
2292
|
+
__ movq(FieldOperand(rax, i), rbx);
|
|
2031
2293
|
}
|
|
2032
2294
|
|
|
2033
2295
|
// Get the length (smi tagged) and set that as an in-object property too.
|
|
2034
|
-
|
|
2296
|
+
STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0);
|
|
2035
2297
|
__ movq(rcx, Operand(rsp, 1 * kPointerSize));
|
|
2036
2298
|
__ movq(FieldOperand(rax, JSObject::kHeaderSize +
|
|
2037
|
-
|
|
2299
|
+
Heap::kArgumentsLengthIndex * kPointerSize),
|
|
2038
2300
|
rcx);
|
|
2039
2301
|
|
|
2040
2302
|
// If there are no actual arguments, we're done.
|
|
2041
2303
|
Label done;
|
|
2042
|
-
__
|
|
2304
|
+
__ testq(rcx, rcx);
|
|
2043
2305
|
__ j(zero, &done);
|
|
2044
2306
|
|
|
2045
|
-
// Get the parameters pointer from the stack
|
|
2307
|
+
// Get the parameters pointer from the stack.
|
|
2046
2308
|
__ movq(rdx, Operand(rsp, 2 * kPointerSize));
|
|
2047
2309
|
|
|
2048
2310
|
// Setup the elements pointer in the allocated arguments object and
|
|
2049
2311
|
// initialize the header in the elements fixed array.
|
|
2050
|
-
__ lea(rdi, Operand(rax,
|
|
2312
|
+
__ lea(rdi, Operand(rax, Heap::kArgumentsObjectSizeStrict));
|
|
2051
2313
|
__ movq(FieldOperand(rax, JSObject::kElementsOffset), rdi);
|
|
2052
2314
|
__ LoadRoot(kScratchRegister, Heap::kFixedArrayMapRootIndex);
|
|
2053
2315
|
__ movq(FieldOperand(rdi, FixedArray::kMapOffset), kScratchRegister);
|
|
2316
|
+
|
|
2317
|
+
|
|
2054
2318
|
__ movq(FieldOperand(rdi, FixedArray::kLengthOffset), rcx);
|
|
2055
|
-
|
|
2319
|
+
// Untag the length for the loop below.
|
|
2320
|
+
__ SmiToInteger64(rcx, rcx);
|
|
2056
2321
|
|
|
2057
2322
|
// Copy the fixed array slots.
|
|
2058
2323
|
Label loop;
|
|
2059
2324
|
__ bind(&loop);
|
|
2060
|
-
__ movq(
|
|
2061
|
-
__ movq(FieldOperand(rdi, FixedArray::kHeaderSize),
|
|
2325
|
+
__ movq(rbx, Operand(rdx, -1 * kPointerSize)); // Skip receiver.
|
|
2326
|
+
__ movq(FieldOperand(rdi, FixedArray::kHeaderSize), rbx);
|
|
2062
2327
|
__ addq(rdi, Immediate(kPointerSize));
|
|
2063
2328
|
__ subq(rdx, Immediate(kPointerSize));
|
|
2064
|
-
__
|
|
2329
|
+
__ decq(rcx);
|
|
2065
2330
|
__ j(not_zero, &loop);
|
|
2066
2331
|
|
|
2067
2332
|
// Return and remove the on-stack parameters.
|
|
@@ -2070,7 +2335,7 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
|
|
|
2070
2335
|
|
|
2071
2336
|
// Do the runtime call to allocate the arguments object.
|
|
2072
2337
|
__ bind(&runtime);
|
|
2073
|
-
__ TailCallRuntime(Runtime::
|
|
2338
|
+
__ TailCallRuntime(Runtime::kNewStrictArgumentsFast, 3, 1);
|
|
2074
2339
|
}
|
|
2075
2340
|
|
|
2076
2341
|
|
|
@@ -2109,7 +2374,6 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
|
|
|
2109
2374
|
__ testq(kScratchRegister, kScratchRegister);
|
|
2110
2375
|
__ j(zero, &runtime);
|
|
2111
2376
|
|
|
2112
|
-
|
|
2113
2377
|
// Check that the first argument is a JSRegExp object.
|
|
2114
2378
|
__ movq(rax, Operand(rsp, kJSRegExpOffset));
|
|
2115
2379
|
__ JumpIfSmi(rax, &runtime);
|
|
@@ -2180,10 +2444,14 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
|
|
|
2180
2444
|
__ cmpl(rdx, rdi);
|
|
2181
2445
|
__ j(greater, &runtime);
|
|
2182
2446
|
|
|
2447
|
+
// Reset offset for possibly sliced string.
|
|
2448
|
+
__ Set(r14, 0);
|
|
2183
2449
|
// rax: RegExp data (FixedArray)
|
|
2184
2450
|
// Check the representation and encoding of the subject string.
|
|
2185
2451
|
Label seq_ascii_string, seq_two_byte_string, check_code;
|
|
2186
2452
|
__ movq(rdi, Operand(rsp, kSubjectOffset));
|
|
2453
|
+
// Make a copy of the original subject string.
|
|
2454
|
+
__ movq(r15, rdi);
|
|
2187
2455
|
__ movq(rbx, FieldOperand(rdi, HeapObject::kMapOffset));
|
|
2188
2456
|
__ movzxbl(rbx, FieldOperand(rbx, Map::kInstanceTypeOffset));
|
|
2189
2457
|
// First check for flat two byte string.
|
|
@@ -2192,28 +2460,40 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
|
|
|
2192
2460
|
STATIC_ASSERT((kStringTag | kSeqStringTag | kTwoByteStringTag) == 0);
|
|
2193
2461
|
__ j(zero, &seq_two_byte_string, Label::kNear);
|
|
2194
2462
|
// Any other flat string must be a flat ascii string.
|
|
2195
|
-
__
|
|
2463
|
+
__ andb(rbx, Immediate(kIsNotStringMask | kStringRepresentationMask));
|
|
2196
2464
|
__ j(zero, &seq_ascii_string, Label::kNear);
|
|
2197
2465
|
|
|
2198
|
-
// Check for flat cons string.
|
|
2466
|
+
// Check for flat cons string or sliced string.
|
|
2199
2467
|
// A flat cons string is a cons string where the second part is the empty
|
|
2200
2468
|
// string. In that case the subject string is just the first part of the cons
|
|
2201
2469
|
// string. Also in this case the first part of the cons string is known to be
|
|
2202
2470
|
// a sequential string or an external string.
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2471
|
+
// In the case of a sliced string its offset has to be taken into account.
|
|
2472
|
+
Label cons_string, check_encoding;
|
|
2473
|
+
STATIC_ASSERT(kConsStringTag < kExternalStringTag);
|
|
2474
|
+
STATIC_ASSERT(kSlicedStringTag > kExternalStringTag);
|
|
2475
|
+
__ cmpq(rbx, Immediate(kExternalStringTag));
|
|
2476
|
+
__ j(less, &cons_string, Label::kNear);
|
|
2477
|
+
__ j(equal, &runtime);
|
|
2478
|
+
|
|
2479
|
+
// String is sliced.
|
|
2480
|
+
__ SmiToInteger32(r14, FieldOperand(rdi, SlicedString::kOffsetOffset));
|
|
2481
|
+
__ movq(rdi, FieldOperand(rdi, SlicedString::kParentOffset));
|
|
2482
|
+
// r14: slice offset
|
|
2483
|
+
// r15: original subject string
|
|
2484
|
+
// rdi: parent string
|
|
2485
|
+
__ jmp(&check_encoding, Label::kNear);
|
|
2486
|
+
// String is a cons string, check whether it is flat.
|
|
2487
|
+
__ bind(&cons_string);
|
|
2208
2488
|
__ CompareRoot(FieldOperand(rdi, ConsString::kSecondOffset),
|
|
2209
2489
|
Heap::kEmptyStringRootIndex);
|
|
2210
2490
|
__ j(not_equal, &runtime);
|
|
2211
2491
|
__ movq(rdi, FieldOperand(rdi, ConsString::kFirstOffset));
|
|
2492
|
+
// rdi: first part of cons string or parent of sliced string.
|
|
2493
|
+
// rbx: map of first part of cons string or map of parent of sliced string.
|
|
2494
|
+
// Is first part of cons or parent of slice a flat two byte string?
|
|
2495
|
+
__ bind(&check_encoding);
|
|
2212
2496
|
__ movq(rbx, FieldOperand(rdi, HeapObject::kMapOffset));
|
|
2213
|
-
// String is a cons string with empty second part.
|
|
2214
|
-
// rdi: first part of cons string.
|
|
2215
|
-
// rbx: map of first part of cons string.
|
|
2216
|
-
// Is first part a flat two byte string?
|
|
2217
2497
|
__ testb(FieldOperand(rbx, Map::kInstanceTypeOffset),
|
|
2218
2498
|
Immediate(kStringRepresentationMask | kStringEncodingMask));
|
|
2219
2499
|
STATIC_ASSERT((kSeqStringTag | kTwoByteStringTag) == 0);
|
|
@@ -2239,9 +2519,8 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
|
|
|
2239
2519
|
__ bind(&check_code);
|
|
2240
2520
|
// Check that the irregexp code has been generated for the actual string
|
|
2241
2521
|
// encoding. If it has, the field contains a code object otherwise it contains
|
|
2242
|
-
//
|
|
2243
|
-
__
|
|
2244
|
-
__ j(not_equal, &runtime);
|
|
2522
|
+
// smi (code flushing support)
|
|
2523
|
+
__ JumpIfSmi(r11, &runtime);
|
|
2245
2524
|
|
|
2246
2525
|
// rdi: subject string
|
|
2247
2526
|
// rcx: encoding of subject string (1 if ascii, 0 if two_byte);
|
|
@@ -2311,32 +2590,40 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
|
|
|
2311
2590
|
// rbx: previous index
|
|
2312
2591
|
// rcx: encoding of subject string (1 if ascii 0 if two_byte);
|
|
2313
2592
|
// r11: code
|
|
2593
|
+
// r14: slice offset
|
|
2594
|
+
// r15: original subject string
|
|
2595
|
+
|
|
2596
|
+
// Argument 2: Previous index.
|
|
2597
|
+
__ movq(arg2, rbx);
|
|
2314
2598
|
|
|
2315
2599
|
// Argument 4: End of string data
|
|
2316
2600
|
// Argument 3: Start of string data
|
|
2317
|
-
Label setup_two_byte, setup_rest;
|
|
2601
|
+
Label setup_two_byte, setup_rest, got_length, length_not_from_slice;
|
|
2602
|
+
// Prepare start and end index of the input.
|
|
2603
|
+
// Load the length from the original sliced string if that is the case.
|
|
2604
|
+
__ addq(rbx, r14);
|
|
2605
|
+
__ SmiToInteger32(arg3, FieldOperand(r15, String::kLengthOffset));
|
|
2606
|
+
__ addq(r14, arg3); // Using arg3 as scratch.
|
|
2607
|
+
|
|
2608
|
+
// rbx: start index of the input
|
|
2609
|
+
// r14: end index of the input
|
|
2610
|
+
// r15: original subject string
|
|
2318
2611
|
__ testb(rcx, rcx); // Last use of rcx as encoding of subject string.
|
|
2319
2612
|
__ j(zero, &setup_two_byte, Label::kNear);
|
|
2320
|
-
__
|
|
2321
|
-
__ lea(arg4, FieldOperand(rdi, rcx, times_1, SeqAsciiString::kHeaderSize));
|
|
2613
|
+
__ lea(arg4, FieldOperand(rdi, r14, times_1, SeqAsciiString::kHeaderSize));
|
|
2322
2614
|
__ lea(arg3, FieldOperand(rdi, rbx, times_1, SeqAsciiString::kHeaderSize));
|
|
2323
2615
|
__ jmp(&setup_rest, Label::kNear);
|
|
2324
2616
|
__ bind(&setup_two_byte);
|
|
2325
|
-
__
|
|
2326
|
-
__ lea(arg4, FieldOperand(rdi, rcx, times_2, SeqTwoByteString::kHeaderSize));
|
|
2617
|
+
__ lea(arg4, FieldOperand(rdi, r14, times_2, SeqTwoByteString::kHeaderSize));
|
|
2327
2618
|
__ lea(arg3, FieldOperand(rdi, rbx, times_2, SeqTwoByteString::kHeaderSize));
|
|
2328
|
-
|
|
2329
2619
|
__ bind(&setup_rest);
|
|
2330
|
-
// Argument 2: Previous index.
|
|
2331
|
-
__ movq(arg2, rbx);
|
|
2332
2620
|
|
|
2333
|
-
// Argument 1:
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
//
|
|
2338
|
-
|
|
2339
|
-
#endif
|
|
2621
|
+
// Argument 1: Original subject string.
|
|
2622
|
+
// The original subject is in the previous stack frame. Therefore we have to
|
|
2623
|
+
// use rbp, which points exactly to one pointer size below the previous rsp.
|
|
2624
|
+
// (Because creating a new stack frame pushes the previous rbp onto the stack
|
|
2625
|
+
// and thereby moves up rsp by one kPointerSize.)
|
|
2626
|
+
__ movq(arg1, r15);
|
|
2340
2627
|
|
|
2341
2628
|
// Locate the code entry and call it.
|
|
2342
2629
|
__ addq(r11, Immediate(Code::kHeaderSize - kHeapObjectTag));
|
|
@@ -2712,8 +2999,8 @@ void CompareStub::Generate(MacroAssembler* masm) {
|
|
|
2712
2999
|
factory->heap_number_map());
|
|
2713
3000
|
__ j(equal, &heap_number, Label::kNear);
|
|
2714
3001
|
if (cc_ != equal) {
|
|
2715
|
-
// Call runtime on identical
|
|
2716
|
-
__ CmpObjectType(rax,
|
|
3002
|
+
// Call runtime on identical objects. Otherwise return equal.
|
|
3003
|
+
__ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx);
|
|
2717
3004
|
__ j(above_equal, ¬_identical, Label::kNear);
|
|
2718
3005
|
}
|
|
2719
3006
|
__ Set(rax, EQUAL);
|
|
@@ -2769,9 +3056,9 @@ void CompareStub::Generate(MacroAssembler* masm) {
|
|
|
2769
3056
|
// There is no test for undetectability in strict equality.
|
|
2770
3057
|
|
|
2771
3058
|
// If the first object is a JS object, we have done pointer comparison.
|
|
2772
|
-
STATIC_ASSERT(LAST_TYPE ==
|
|
3059
|
+
STATIC_ASSERT(LAST_TYPE == LAST_SPEC_OBJECT_TYPE);
|
|
2773
3060
|
Label first_non_object;
|
|
2774
|
-
__ CmpObjectType(rax,
|
|
3061
|
+
__ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx);
|
|
2775
3062
|
__ j(below, &first_non_object, Label::kNear);
|
|
2776
3063
|
// Return non-zero (eax (not rax) is not zero)
|
|
2777
3064
|
Label return_not_equal;
|
|
@@ -2784,7 +3071,7 @@ void CompareStub::Generate(MacroAssembler* masm) {
|
|
|
2784
3071
|
__ CmpInstanceType(rcx, ODDBALL_TYPE);
|
|
2785
3072
|
__ j(equal, &return_not_equal);
|
|
2786
3073
|
|
|
2787
|
-
__ CmpObjectType(rdx,
|
|
3074
|
+
__ CmpObjectType(rdx, FIRST_SPEC_OBJECT_TYPE, rcx);
|
|
2788
3075
|
__ j(above_equal, &return_not_equal);
|
|
2789
3076
|
|
|
2790
3077
|
// Check for oddballs: true, false, null, undefined.
|
|
@@ -2880,9 +3167,9 @@ void CompareStub::Generate(MacroAssembler* masm) {
|
|
|
2880
3167
|
__ lea(rcx, Operand(rax, rdx, times_1, 0));
|
|
2881
3168
|
__ testb(rcx, Immediate(kSmiTagMask));
|
|
2882
3169
|
__ j(not_zero, ¬_both_objects, Label::kNear);
|
|
2883
|
-
__ CmpObjectType(rax,
|
|
3170
|
+
__ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rbx);
|
|
2884
3171
|
__ j(below, ¬_both_objects, Label::kNear);
|
|
2885
|
-
__ CmpObjectType(rdx,
|
|
3172
|
+
__ CmpObjectType(rdx, FIRST_SPEC_OBJECT_TYPE, rcx);
|
|
2886
3173
|
__ j(below, ¬_both_objects, Label::kNear);
|
|
2887
3174
|
__ testb(FieldOperand(rbx, Map::kBitFieldOffset),
|
|
2888
3175
|
Immediate(1 << Map::kIsUndetectable));
|
|
@@ -2982,7 +3269,11 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
|
|
|
2982
3269
|
Label call_as_function;
|
|
2983
3270
|
__ CompareRoot(rax, Heap::kTheHoleValueRootIndex);
|
|
2984
3271
|
__ j(equal, &call_as_function);
|
|
2985
|
-
__ InvokeFunction(rdi,
|
|
3272
|
+
__ InvokeFunction(rdi,
|
|
3273
|
+
actual,
|
|
3274
|
+
JUMP_FUNCTION,
|
|
3275
|
+
NullCallWrapper(),
|
|
3276
|
+
CALL_AS_METHOD);
|
|
2986
3277
|
__ bind(&call_as_function);
|
|
2987
3278
|
}
|
|
2988
3279
|
__ InvokeFunction(rdi,
|
|
@@ -3001,6 +3292,7 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
|
|
|
3001
3292
|
__ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION);
|
|
3002
3293
|
Handle<Code> adaptor =
|
|
3003
3294
|
Isolate::Current()->builtins()->ArgumentsAdaptorTrampoline();
|
|
3295
|
+
__ SetCallKind(rcx, CALL_AS_METHOD);
|
|
3004
3296
|
__ Jump(adaptor, RelocInfo::CODE_TARGET);
|
|
3005
3297
|
}
|
|
3006
3298
|
|
|
@@ -3237,9 +3529,7 @@ void CEntryStub::Generate(MacroAssembler* masm) {
|
|
|
3237
3529
|
|
|
3238
3530
|
void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
|
|
3239
3531
|
Label invoke, exit;
|
|
3240
|
-
#ifdef ENABLE_LOGGING_AND_PROFILING
|
|
3241
3532
|
Label not_outermost_js, not_outermost_js_2;
|
|
3242
|
-
#endif
|
|
3243
3533
|
{ // NOLINT. Scope block confuses linter.
|
|
3244
3534
|
MacroAssembler::NoRootArrayScope uninitialized_root_register(masm);
|
|
3245
3535
|
// Setup frame.
|
|
@@ -3284,7 +3574,6 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
|
|
|
3284
3574
|
__ push(c_entry_fp_operand);
|
|
3285
3575
|
}
|
|
3286
3576
|
|
|
3287
|
-
#ifdef ENABLE_LOGGING_AND_PROFILING
|
|
3288
3577
|
// If this is the outermost JS call, set js_entry_sp value.
|
|
3289
3578
|
ExternalReference js_entry_sp(Isolate::k_js_entry_sp_address, isolate);
|
|
3290
3579
|
__ Load(rax, js_entry_sp);
|
|
@@ -3298,7 +3587,6 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
|
|
|
3298
3587
|
__ bind(¬_outermost_js);
|
|
3299
3588
|
__ Push(Smi::FromInt(StackFrame::INNER_JSENTRY_FRAME));
|
|
3300
3589
|
__ bind(&cont);
|
|
3301
|
-
#endif
|
|
3302
3590
|
|
|
3303
3591
|
// Call a faked try-block that does the invoke.
|
|
3304
3592
|
__ call(&invoke);
|
|
@@ -3342,7 +3630,6 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
|
|
|
3342
3630
|
__ PopTryHandler();
|
|
3343
3631
|
|
|
3344
3632
|
__ bind(&exit);
|
|
3345
|
-
#ifdef ENABLE_LOGGING_AND_PROFILING
|
|
3346
3633
|
// Check if the current stack frame is marked as the outermost JS frame.
|
|
3347
3634
|
__ pop(rbx);
|
|
3348
3635
|
__ Cmp(rbx, Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME));
|
|
@@ -3350,7 +3637,6 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
|
|
|
3350
3637
|
__ movq(kScratchRegister, js_entry_sp);
|
|
3351
3638
|
__ movq(Operand(kScratchRegister, 0), Immediate(0));
|
|
3352
3639
|
__ bind(¬_outermost_js_2);
|
|
3353
|
-
#endif
|
|
3354
3640
|
|
|
3355
3641
|
// Restore the top frame descriptor from the stack.
|
|
3356
3642
|
{ Operand c_entry_fp_operand = masm->ExternalOperand(c_entry_fp);
|
|
@@ -3414,9 +3700,9 @@ void InstanceofStub::Generate(MacroAssembler* masm) {
|
|
|
3414
3700
|
__ JumpIfSmi(rax, &slow);
|
|
3415
3701
|
|
|
3416
3702
|
// Check that the left hand is a JS object. Leave its map in rax.
|
|
3417
|
-
__ CmpObjectType(rax,
|
|
3703
|
+
__ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rax);
|
|
3418
3704
|
__ j(below, &slow);
|
|
3419
|
-
__ CmpInstanceType(rax,
|
|
3705
|
+
__ CmpInstanceType(rax, LAST_SPEC_OBJECT_TYPE);
|
|
3420
3706
|
__ j(above, &slow);
|
|
3421
3707
|
|
|
3422
3708
|
// Get the prototype of the function.
|
|
@@ -3441,9 +3727,9 @@ void InstanceofStub::Generate(MacroAssembler* masm) {
|
|
|
3441
3727
|
|
|
3442
3728
|
// Check that the function prototype is a JS object.
|
|
3443
3729
|
__ JumpIfSmi(rbx, &slow);
|
|
3444
|
-
__ CmpObjectType(rbx,
|
|
3730
|
+
__ CmpObjectType(rbx, FIRST_SPEC_OBJECT_TYPE, kScratchRegister);
|
|
3445
3731
|
__ j(below, &slow);
|
|
3446
|
-
__ CmpInstanceType(kScratchRegister,
|
|
3732
|
+
__ CmpInstanceType(kScratchRegister, LAST_SPEC_OBJECT_TYPE);
|
|
3447
3733
|
__ j(above, &slow);
|
|
3448
3734
|
|
|
3449
3735
|
// Register mapping:
|
|
@@ -3559,15 +3845,8 @@ int CompareStub::MinorKey() {
|
|
|
3559
3845
|
|
|
3560
3846
|
// Unfortunately you have to run without snapshots to see most of these
|
|
3561
3847
|
// names in the profile since most compare stubs end up in the snapshot.
|
|
3562
|
-
|
|
3848
|
+
void CompareStub::PrintName(StringStream* stream) {
|
|
3563
3849
|
ASSERT(lhs_.is(no_reg) && rhs_.is(no_reg));
|
|
3564
|
-
|
|
3565
|
-
if (name_ != NULL) return name_;
|
|
3566
|
-
const int kMaxNameLength = 100;
|
|
3567
|
-
name_ = Isolate::Current()->bootstrapper()->AllocateAutoDeletedArray(
|
|
3568
|
-
kMaxNameLength);
|
|
3569
|
-
if (name_ == NULL) return "OOM";
|
|
3570
|
-
|
|
3571
3850
|
const char* cc_name;
|
|
3572
3851
|
switch (cc_) {
|
|
3573
3852
|
case less: cc_name = "LT"; break;
|
|
@@ -3578,35 +3857,12 @@ const char* CompareStub::GetName() {
|
|
|
3578
3857
|
case not_equal: cc_name = "NE"; break;
|
|
3579
3858
|
default: cc_name = "UnknownCondition"; break;
|
|
3580
3859
|
}
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
if (strict_ && (
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
const char* never_nan_nan_name = "";
|
|
3588
|
-
if (never_nan_nan_ && (cc_ == equal || cc_ == not_equal)) {
|
|
3589
|
-
never_nan_nan_name = "_NO_NAN";
|
|
3590
|
-
}
|
|
3591
|
-
|
|
3592
|
-
const char* include_number_compare_name = "";
|
|
3593
|
-
if (!include_number_compare_) {
|
|
3594
|
-
include_number_compare_name = "_NO_NUMBER";
|
|
3595
|
-
}
|
|
3596
|
-
|
|
3597
|
-
const char* include_smi_compare_name = "";
|
|
3598
|
-
if (!include_smi_compare_) {
|
|
3599
|
-
include_smi_compare_name = "_NO_SMI";
|
|
3600
|
-
}
|
|
3601
|
-
|
|
3602
|
-
OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
|
|
3603
|
-
"CompareStub_%s%s%s%s",
|
|
3604
|
-
cc_name,
|
|
3605
|
-
strict_name,
|
|
3606
|
-
never_nan_nan_name,
|
|
3607
|
-
include_number_compare_name,
|
|
3608
|
-
include_smi_compare_name);
|
|
3609
|
-
return name_;
|
|
3860
|
+
bool is_equality = cc_ == equal || cc_ == not_equal;
|
|
3861
|
+
stream->Add("CompareStub_%s", cc_name);
|
|
3862
|
+
if (strict_ && is_equality) stream->Add("_STRICT");
|
|
3863
|
+
if (never_nan_nan_ && is_equality) stream->Add("_NO_NAN");
|
|
3864
|
+
if (!include_number_compare_) stream->Add("_NO_NUMBER");
|
|
3865
|
+
if (!include_smi_compare_) stream->Add("_NO_SMI");
|
|
3610
3866
|
}
|
|
3611
3867
|
|
|
3612
3868
|
|
|
@@ -3617,6 +3873,7 @@ void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) {
|
|
|
3617
3873
|
Label flat_string;
|
|
3618
3874
|
Label ascii_string;
|
|
3619
3875
|
Label got_char_code;
|
|
3876
|
+
Label sliced_string;
|
|
3620
3877
|
|
|
3621
3878
|
// If the receiver is a smi trigger the non-string case.
|
|
3622
3879
|
__ JumpIfSmi(object_, receiver_not_string_);
|
|
@@ -3645,25 +3902,39 @@ void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) {
|
|
|
3645
3902
|
__ j(zero, &flat_string);
|
|
3646
3903
|
|
|
3647
3904
|
// Handle non-flat strings.
|
|
3648
|
-
__
|
|
3649
|
-
|
|
3905
|
+
__ and_(result_, Immediate(kStringRepresentationMask));
|
|
3906
|
+
STATIC_ASSERT(kConsStringTag < kExternalStringTag);
|
|
3907
|
+
STATIC_ASSERT(kSlicedStringTag > kExternalStringTag);
|
|
3908
|
+
__ cmpb(result_, Immediate(kExternalStringTag));
|
|
3909
|
+
__ j(greater, &sliced_string);
|
|
3910
|
+
__ j(equal, &call_runtime_);
|
|
3650
3911
|
|
|
3651
3912
|
// ConsString.
|
|
3652
3913
|
// Check whether the right hand side is the empty string (i.e. if
|
|
3653
3914
|
// this is really a flat string in a cons string). If that is not
|
|
3654
3915
|
// the case we would rather go to the runtime system now to flatten
|
|
3655
3916
|
// the string.
|
|
3917
|
+
Label assure_seq_string;
|
|
3656
3918
|
__ CompareRoot(FieldOperand(object_, ConsString::kSecondOffset),
|
|
3657
3919
|
Heap::kEmptyStringRootIndex);
|
|
3658
3920
|
__ j(not_equal, &call_runtime_);
|
|
3659
3921
|
// Get the first of the two strings and load its instance type.
|
|
3660
3922
|
__ movq(object_, FieldOperand(object_, ConsString::kFirstOffset));
|
|
3923
|
+
__ jmp(&assure_seq_string, Label::kNear);
|
|
3924
|
+
|
|
3925
|
+
// SlicedString, unpack and add offset.
|
|
3926
|
+
__ bind(&sliced_string);
|
|
3927
|
+
__ addq(scratch_, FieldOperand(object_, SlicedString::kOffsetOffset));
|
|
3928
|
+
__ movq(object_, FieldOperand(object_, SlicedString::kParentOffset));
|
|
3929
|
+
|
|
3930
|
+
__ bind(&assure_seq_string);
|
|
3661
3931
|
__ movq(result_, FieldOperand(object_, HeapObject::kMapOffset));
|
|
3662
3932
|
__ movzxbl(result_, FieldOperand(result_, Map::kInstanceTypeOffset));
|
|
3663
3933
|
// If the first cons component is also non-flat, then go to runtime.
|
|
3664
3934
|
STATIC_ASSERT(kSeqStringTag == 0);
|
|
3665
3935
|
__ testb(result_, Immediate(kStringRepresentationMask));
|
|
3666
3936
|
__ j(not_zero, &call_runtime_);
|
|
3937
|
+
__ jmp(&flat_string);
|
|
3667
3938
|
|
|
3668
3939
|
// Check for 1-byte or 2-byte string.
|
|
3669
3940
|
__ bind(&flat_string);
|
|
@@ -3812,15 +4083,12 @@ void StringAddStub::Generate(MacroAssembler* masm) {
|
|
|
3812
4083
|
|
|
3813
4084
|
// Make sure that both arguments are strings if not known in advance.
|
|
3814
4085
|
if (flags_ == NO_STRING_ADD_FLAGS) {
|
|
3815
|
-
|
|
3816
|
-
is_smi = masm->CheckSmi(rax);
|
|
3817
|
-
__ j(is_smi, &string_add_runtime);
|
|
4086
|
+
__ JumpIfSmi(rax, &string_add_runtime);
|
|
3818
4087
|
__ CmpObjectType(rax, FIRST_NONSTRING_TYPE, r8);
|
|
3819
4088
|
__ j(above_equal, &string_add_runtime);
|
|
3820
4089
|
|
|
3821
4090
|
// First argument is a a string, test second.
|
|
3822
|
-
|
|
3823
|
-
__ j(is_smi, &string_add_runtime);
|
|
4091
|
+
__ JumpIfSmi(rdx, &string_add_runtime);
|
|
3824
4092
|
__ CmpObjectType(rdx, FIRST_NONSTRING_TYPE, r9);
|
|
3825
4093
|
__ j(above_equal, &string_add_runtime);
|
|
3826
4094
|
} else {
|
|
@@ -3977,6 +4245,8 @@ void StringAddStub::Generate(MacroAssembler* masm) {
|
|
|
3977
4245
|
__ and_(rcx, Immediate(kStringRepresentationMask));
|
|
3978
4246
|
__ cmpl(rcx, Immediate(kExternalStringTag));
|
|
3979
4247
|
__ j(equal, &string_add_runtime);
|
|
4248
|
+
// We cannot encounter sliced strings here since:
|
|
4249
|
+
STATIC_ASSERT(SlicedString::kMinLength >= String::kMinNonFlatLength);
|
|
3980
4250
|
// Now check if both strings are ascii strings.
|
|
3981
4251
|
// rax: first string
|
|
3982
4252
|
// rbx: length of resulting flat string
|
|
@@ -4369,6 +4639,9 @@ void StringHelper::GenerateHashGetHash(MacroAssembler* masm,
|
|
|
4369
4639
|
void SubStringStub::Generate(MacroAssembler* masm) {
|
|
4370
4640
|
Label runtime;
|
|
4371
4641
|
|
|
4642
|
+
if (FLAG_string_slices) {
|
|
4643
|
+
__ jmp(&runtime);
|
|
4644
|
+
}
|
|
4372
4645
|
// Stack frame on entry.
|
|
4373
4646
|
// rsp[0]: return address
|
|
4374
4647
|
// rsp[8]: to
|