libv8 3.3.10.4 → 3.5.10.beta1
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -163,29 +163,30 @@ class MacroAssembler: public Assembler {
|
|
163
163
|
const ParameterCount& expected,
|
164
164
|
const ParameterCount& actual,
|
165
165
|
InvokeFlag flag,
|
166
|
-
const CallWrapper& call_wrapper
|
167
|
-
CallKind call_kind
|
166
|
+
const CallWrapper& call_wrapper,
|
167
|
+
CallKind call_kind);
|
168
168
|
|
169
169
|
void InvokeCode(Handle<Code> code,
|
170
170
|
const ParameterCount& expected,
|
171
171
|
const ParameterCount& actual,
|
172
172
|
RelocInfo::Mode rmode,
|
173
173
|
InvokeFlag flag,
|
174
|
-
const CallWrapper& call_wrapper
|
175
|
-
CallKind call_kind
|
174
|
+
const CallWrapper& call_wrapper,
|
175
|
+
CallKind call_kind);
|
176
176
|
|
177
177
|
// Invoke the JavaScript function in the given register. Changes the
|
178
178
|
// current context to the context in the function before invoking.
|
179
179
|
void InvokeFunction(Register function,
|
180
180
|
const ParameterCount& actual,
|
181
181
|
InvokeFlag flag,
|
182
|
-
const CallWrapper& call_wrapper
|
183
|
-
CallKind call_kind
|
182
|
+
const CallWrapper& call_wrapper,
|
183
|
+
CallKind call_kind);
|
184
184
|
|
185
185
|
void InvokeFunction(JSFunction* function,
|
186
186
|
const ParameterCount& actual,
|
187
187
|
InvokeFlag flag,
|
188
|
-
const CallWrapper& call_wrapper
|
188
|
+
const CallWrapper& call_wrapper,
|
189
|
+
CallKind call_kind);
|
189
190
|
|
190
191
|
// Invoke specified builtin JavaScript function. Adds an entry to
|
191
192
|
// the unresolved list if the name does not resolve.
|
@@ -208,6 +209,9 @@ class MacroAssembler: public Assembler {
|
|
208
209
|
void SafeSet(Register dst, const Immediate& x);
|
209
210
|
void SafePush(const Immediate& x);
|
210
211
|
|
212
|
+
// Compare a register against a known root, e.g. undefined, null, true, ...
|
213
|
+
void CompareRoot(Register with, Heap::RootListIndex index);
|
214
|
+
|
211
215
|
// Compare object type for heap object.
|
212
216
|
// Incoming register is heap_object and outgoing register is map.
|
213
217
|
void CmpObjectType(Register heap_object, InstanceType type, Register map);
|
@@ -215,6 +219,12 @@ class MacroAssembler: public Assembler {
|
|
215
219
|
// Compare instance type for map.
|
216
220
|
void CmpInstanceType(Register map, InstanceType type);
|
217
221
|
|
222
|
+
// Check if a map for a JSObject indicates that the object has fast elements.
|
223
|
+
// Jump to the specified label if it does not.
|
224
|
+
void CheckFastElements(Register map,
|
225
|
+
Label* fail,
|
226
|
+
Label::Distance distance = Label::kFar);
|
227
|
+
|
218
228
|
// Check if the map of an object is equal to a specified map and branch to
|
219
229
|
// label if not. Skip the smi check if not required (object is known to be a
|
220
230
|
// heap object)
|
@@ -265,8 +275,8 @@ class MacroAssembler: public Assembler {
|
|
265
275
|
|
266
276
|
// Smi tagging support.
|
267
277
|
void SmiTag(Register reg) {
|
268
|
-
|
269
|
-
|
278
|
+
STATIC_ASSERT(kSmiTag == 0);
|
279
|
+
STATIC_ASSERT(kSmiTagSize == 1);
|
270
280
|
add(reg, Operand(reg));
|
271
281
|
}
|
272
282
|
void SmiUntag(Register reg) {
|
@@ -275,21 +285,32 @@ class MacroAssembler: public Assembler {
|
|
275
285
|
|
276
286
|
// Modifies the register even if it does not contain a Smi!
|
277
287
|
void SmiUntag(Register reg, Label* is_smi) {
|
278
|
-
|
288
|
+
STATIC_ASSERT(kSmiTagSize == 1);
|
279
289
|
sar(reg, kSmiTagSize);
|
280
|
-
|
290
|
+
STATIC_ASSERT(kSmiTag == 0);
|
281
291
|
j(not_carry, is_smi);
|
282
292
|
}
|
283
293
|
|
284
294
|
// Jump the register contains a smi.
|
285
|
-
inline void JumpIfSmi(Register value,
|
295
|
+
inline void JumpIfSmi(Register value,
|
296
|
+
Label* smi_label,
|
297
|
+
Label::Distance distance = Label::kFar) {
|
298
|
+
test(value, Immediate(kSmiTagMask));
|
299
|
+
j(zero, smi_label, distance);
|
300
|
+
}
|
301
|
+
// Jump if the operand is a smi.
|
302
|
+
inline void JumpIfSmi(Operand value,
|
303
|
+
Label* smi_label,
|
304
|
+
Label::Distance distance = Label::kFar) {
|
286
305
|
test(value, Immediate(kSmiTagMask));
|
287
|
-
j(zero, smi_label);
|
306
|
+
j(zero, smi_label, distance);
|
288
307
|
}
|
289
308
|
// Jump if register contain a non-smi.
|
290
|
-
inline void JumpIfNotSmi(Register value,
|
309
|
+
inline void JumpIfNotSmi(Register value,
|
310
|
+
Label* not_smi_label,
|
311
|
+
Label::Distance distance = Label::kFar) {
|
291
312
|
test(value, Immediate(kSmiTagMask));
|
292
|
-
j(not_zero, not_smi_label);
|
313
|
+
j(not_zero, not_smi_label, distance);
|
293
314
|
}
|
294
315
|
|
295
316
|
void LoadInstanceDescriptors(Register map, Register descriptors);
|
@@ -334,6 +355,15 @@ class MacroAssembler: public Assembler {
|
|
334
355
|
Label* miss);
|
335
356
|
|
336
357
|
|
358
|
+
void LoadFromNumberDictionary(Label* miss,
|
359
|
+
Register elements,
|
360
|
+
Register key,
|
361
|
+
Register r0,
|
362
|
+
Register r1,
|
363
|
+
Register r2,
|
364
|
+
Register result);
|
365
|
+
|
366
|
+
|
337
367
|
// ---------------------------------------------------------------------------
|
338
368
|
// Allocation support
|
339
369
|
|
@@ -416,6 +446,17 @@ class MacroAssembler: public Assembler {
|
|
416
446
|
Register scratch2,
|
417
447
|
Label* gc_required);
|
418
448
|
|
449
|
+
// Allocate a raw sliced string object. Only the map field of the result is
|
450
|
+
// initialized.
|
451
|
+
void AllocateSlicedString(Register result,
|
452
|
+
Register scratch1,
|
453
|
+
Register scratch2,
|
454
|
+
Label* gc_required);
|
455
|
+
void AllocateAsciiSlicedString(Register result,
|
456
|
+
Register scratch1,
|
457
|
+
Register scratch2,
|
458
|
+
Label* gc_required);
|
459
|
+
|
419
460
|
// Copy memory, byte-by-byte, from source to destination. Not optimized for
|
420
461
|
// long or aligned copies.
|
421
462
|
// The contents of index and scratch are destroyed.
|
@@ -540,10 +581,10 @@ class MacroAssembler: public Assembler {
|
|
540
581
|
|
541
582
|
// Prepares stack to put arguments (aligns and so on). Reserves
|
542
583
|
// space for return value if needed (assumes the return value is a handle).
|
543
|
-
//
|
544
|
-
//
|
545
|
-
//
|
546
|
-
void PrepareCallApiFunction(int argc
|
584
|
+
// Arguments must be stored in ApiParameterOperand(0), ApiParameterOperand(1)
|
585
|
+
// etc. Saves context (esi). If space was reserved for return value then
|
586
|
+
// stores the pointer to the reserved slot into esi.
|
587
|
+
void PrepareCallApiFunction(int argc);
|
547
588
|
|
548
589
|
// Calls an API function. Allocates HandleScope, extracts
|
549
590
|
// returned value from handle and propagates exceptions.
|
@@ -584,6 +625,9 @@ class MacroAssembler: public Assembler {
|
|
584
625
|
|
585
626
|
void Move(Register target, Handle<Object> value);
|
586
627
|
|
628
|
+
// Push a handle value.
|
629
|
+
void Push(Handle<Object> handle) { push(handle); }
|
630
|
+
|
587
631
|
Handle<Object> CodeObject() {
|
588
632
|
ASSERT(!code_object_.is_null());
|
589
633
|
return code_object_;
|
@@ -1065,12 +1065,13 @@ int RegExpMacroAssemblerIA32::CheckStackGuardState(Address* return_address,
|
|
1065
1065
|
}
|
1066
1066
|
|
1067
1067
|
// Prepare for possible GC.
|
1068
|
-
HandleScope handles;
|
1068
|
+
HandleScope handles(isolate);
|
1069
1069
|
Handle<Code> code_handle(re_code);
|
1070
1070
|
|
1071
1071
|
Handle<String> subject(frame_entry<String*>(re_frame, kInputString));
|
1072
|
+
|
1072
1073
|
// Current string.
|
1073
|
-
bool is_ascii = subject->
|
1074
|
+
bool is_ascii = subject->IsAsciiRepresentationUnderneath();
|
1074
1075
|
|
1075
1076
|
ASSERT(re_code->instruction_start() <= *return_address);
|
1076
1077
|
ASSERT(*return_address <=
|
@@ -1079,7 +1080,7 @@ int RegExpMacroAssemblerIA32::CheckStackGuardState(Address* return_address,
|
|
1079
1080
|
MaybeObject* result = Execution::HandleStackGuardInterrupt();
|
1080
1081
|
|
1081
1082
|
if (*code_handle != re_code) { // Return address no longer valid
|
1082
|
-
int delta =
|
1083
|
+
int delta = code_handle->address() - re_code->address();
|
1083
1084
|
// Overwrite the return address on the stack.
|
1084
1085
|
*return_address += delta;
|
1085
1086
|
}
|
@@ -1088,8 +1089,20 @@ int RegExpMacroAssemblerIA32::CheckStackGuardState(Address* return_address,
|
|
1088
1089
|
return EXCEPTION;
|
1089
1090
|
}
|
1090
1091
|
|
1092
|
+
Handle<String> subject_tmp = subject;
|
1093
|
+
int slice_offset = 0;
|
1094
|
+
|
1095
|
+
// Extract the underlying string and the slice offset.
|
1096
|
+
if (StringShape(*subject_tmp).IsCons()) {
|
1097
|
+
subject_tmp = Handle<String>(ConsString::cast(*subject_tmp)->first());
|
1098
|
+
} else if (StringShape(*subject_tmp).IsSliced()) {
|
1099
|
+
SlicedString* slice = SlicedString::cast(*subject_tmp);
|
1100
|
+
subject_tmp = Handle<String>(slice->parent());
|
1101
|
+
slice_offset = slice->offset();
|
1102
|
+
}
|
1103
|
+
|
1091
1104
|
// String might have changed.
|
1092
|
-
if (
|
1105
|
+
if (subject_tmp->IsAsciiRepresentation() != is_ascii) {
|
1093
1106
|
// If we changed between an ASCII and an UC16 string, the specialized
|
1094
1107
|
// code cannot be used, and we need to restart regexp matching from
|
1095
1108
|
// scratch (including, potentially, compiling a new version of the code).
|
@@ -1100,8 +1113,8 @@ int RegExpMacroAssemblerIA32::CheckStackGuardState(Address* return_address,
|
|
1100
1113
|
// be a sequential or external string with the same content.
|
1101
1114
|
// Update the start and end pointers in the stack frame to the current
|
1102
1115
|
// location (whether it has actually moved or not).
|
1103
|
-
ASSERT(StringShape(*
|
1104
|
-
StringShape(*
|
1116
|
+
ASSERT(StringShape(*subject_tmp).IsSequential() ||
|
1117
|
+
StringShape(*subject_tmp).IsExternal());
|
1105
1118
|
|
1106
1119
|
// The original start address of the characters to match.
|
1107
1120
|
const byte* start_address = frame_entry<const byte*>(re_frame, kInputStart);
|
@@ -1109,13 +1122,14 @@ int RegExpMacroAssemblerIA32::CheckStackGuardState(Address* return_address,
|
|
1109
1122
|
// Find the current start address of the same character at the current string
|
1110
1123
|
// position.
|
1111
1124
|
int start_index = frame_entry<int>(re_frame, kStartIndex);
|
1112
|
-
const byte* new_address = StringCharacterPosition(*
|
1125
|
+
const byte* new_address = StringCharacterPosition(*subject_tmp,
|
1126
|
+
start_index + slice_offset);
|
1113
1127
|
|
1114
1128
|
if (start_address != new_address) {
|
1115
1129
|
// If there is a difference, update the object pointer and start and end
|
1116
1130
|
// addresses in the RegExp stack frame to match the new value.
|
1117
1131
|
const byte* end_address = frame_entry<const byte* >(re_frame, kInputEnd);
|
1118
|
-
int byte_length = end_address - start_address;
|
1132
|
+
int byte_length = static_cast<int>(end_address - start_address);
|
1119
1133
|
frame_entry<const String*>(re_frame, kInputString) = *subject;
|
1120
1134
|
frame_entry<const byte*>(re_frame, kInputStart) = new_address;
|
1121
1135
|
frame_entry<const byte*>(re_frame, kInputEnd) = new_address + byte_length;
|
@@ -129,7 +129,7 @@ static MaybeObject* GenerateDictionaryNegativeLookup(MacroAssembler* masm,
|
|
129
129
|
__ j(not_zero, miss_label);
|
130
130
|
|
131
131
|
// Check that receiver is a JSObject.
|
132
|
-
__ CmpInstanceType(r0,
|
132
|
+
__ CmpInstanceType(r0, FIRST_SPEC_OBJECT_TYPE);
|
133
133
|
__ j(below, miss_label);
|
134
134
|
|
135
135
|
// Load properties array.
|
@@ -188,8 +188,7 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
|
|
188
188
|
ASSERT(extra2.is(no_reg));
|
189
189
|
|
190
190
|
// Check that the receiver isn't a smi.
|
191
|
-
__
|
192
|
-
__ j(zero, &miss);
|
191
|
+
__ JumpIfSmi(receiver, &miss);
|
193
192
|
|
194
193
|
// Get the map of the receiver and compute the hash.
|
195
194
|
__ mov(scratch, FieldOperand(name, String::kHashFieldOffset));
|
@@ -249,8 +248,7 @@ void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm,
|
|
249
248
|
Register scratch,
|
250
249
|
Label* miss_label) {
|
251
250
|
// Check that the receiver isn't a smi.
|
252
|
-
__
|
253
|
-
__ j(zero, miss_label);
|
251
|
+
__ JumpIfSmi(receiver, miss_label);
|
254
252
|
|
255
253
|
// Check that the object is a JS array.
|
256
254
|
__ CmpObjectType(receiver, JS_ARRAY_TYPE, scratch);
|
@@ -270,13 +268,12 @@ static void GenerateStringCheck(MacroAssembler* masm,
|
|
270
268
|
Label* smi,
|
271
269
|
Label* non_string_object) {
|
272
270
|
// Check that the object isn't a smi.
|
273
|
-
__
|
274
|
-
__ j(zero, smi);
|
271
|
+
__ JumpIfSmi(receiver, smi);
|
275
272
|
|
276
273
|
// Check that the object is a string.
|
277
274
|
__ mov(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
|
278
275
|
__ movzx_b(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset));
|
279
|
-
|
276
|
+
STATIC_ASSERT(kNotStringTag != 0);
|
280
277
|
__ test(scratch, Immediate(kNotStringTag));
|
281
278
|
__ j(not_zero, non_string_object);
|
282
279
|
}
|
@@ -462,7 +459,7 @@ static MaybeObject* GenerateFastApiCall(MacroAssembler* masm,
|
|
462
459
|
// it's not controlled by GC.
|
463
460
|
const int kApiStackSpace = 4;
|
464
461
|
|
465
|
-
__ PrepareCallApiFunction(kApiArgc + kApiStackSpace
|
462
|
+
__ PrepareCallApiFunction(kApiArgc + kApiStackSpace);
|
466
463
|
|
467
464
|
__ mov(ApiParameterOperand(1), eax); // v8::Arguments::implicit_args_.
|
468
465
|
__ add(Operand(eax), Immediate(argc * kPointerSize));
|
@@ -488,10 +485,12 @@ class CallInterceptorCompiler BASE_EMBEDDED {
|
|
488
485
|
public:
|
489
486
|
CallInterceptorCompiler(StubCompiler* stub_compiler,
|
490
487
|
const ParameterCount& arguments,
|
491
|
-
Register name
|
488
|
+
Register name,
|
489
|
+
Code::ExtraICState extra_ic_state)
|
492
490
|
: stub_compiler_(stub_compiler),
|
493
491
|
arguments_(arguments),
|
494
|
-
name_(name)
|
492
|
+
name_(name),
|
493
|
+
extra_ic_state_(extra_ic_state) {}
|
495
494
|
|
496
495
|
MaybeObject* Compile(MacroAssembler* masm,
|
497
496
|
JSObject* object,
|
@@ -507,8 +506,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
|
|
507
506
|
ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
|
508
507
|
|
509
508
|
// Check that the receiver isn't a smi.
|
510
|
-
__
|
511
|
-
__ j(zero, miss);
|
509
|
+
__ JumpIfSmi(receiver, miss);
|
512
510
|
|
513
511
|
CallOptimization optimization(lookup);
|
514
512
|
|
@@ -616,8 +614,11 @@ class CallInterceptorCompiler BASE_EMBEDDED {
|
|
616
614
|
GenerateFastApiCall(masm, optimization, arguments_.immediate());
|
617
615
|
if (result->IsFailure()) return result;
|
618
616
|
} else {
|
617
|
+
CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
|
618
|
+
? CALL_AS_FUNCTION
|
619
|
+
: CALL_AS_METHOD;
|
619
620
|
__ InvokeFunction(optimization.constant_function(), arguments_,
|
620
|
-
JUMP_FUNCTION);
|
621
|
+
JUMP_FUNCTION, NullCallWrapper(), call_kind);
|
621
622
|
}
|
622
623
|
|
623
624
|
// Deferred code for fast API call case---clean preallocated space.
|
@@ -696,6 +697,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
|
|
696
697
|
StubCompiler* stub_compiler_;
|
697
698
|
const ParameterCount& arguments_;
|
698
699
|
Register name_;
|
700
|
+
Code::ExtraICState extra_ic_state_;
|
699
701
|
};
|
700
702
|
|
701
703
|
|
@@ -732,8 +734,7 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
|
|
732
734
|
Register scratch,
|
733
735
|
Label* miss_label) {
|
734
736
|
// Check that the object isn't a smi.
|
735
|
-
__
|
736
|
-
__ j(zero, miss_label);
|
737
|
+
__ JumpIfSmi(receiver_reg, miss_label);
|
737
738
|
|
738
739
|
// Check that the map of the object hasn't changed.
|
739
740
|
__ cmp(FieldOperand(receiver_reg, HeapObject::kMapOffset),
|
@@ -1014,8 +1015,7 @@ void StubCompiler::GenerateLoadField(JSObject* object,
|
|
1014
1015
|
String* name,
|
1015
1016
|
Label* miss) {
|
1016
1017
|
// Check that the receiver isn't a smi.
|
1017
|
-
__
|
1018
|
-
__ j(zero, miss);
|
1018
|
+
__ JumpIfSmi(receiver, miss);
|
1019
1019
|
|
1020
1020
|
// Check the prototype chain.
|
1021
1021
|
Register reg =
|
@@ -1039,8 +1039,7 @@ MaybeObject* StubCompiler::GenerateLoadCallback(JSObject* object,
|
|
1039
1039
|
String* name,
|
1040
1040
|
Label* miss) {
|
1041
1041
|
// Check that the receiver isn't a smi.
|
1042
|
-
__
|
1043
|
-
__ j(zero, miss);
|
1042
|
+
__ JumpIfSmi(receiver, miss);
|
1044
1043
|
|
1045
1044
|
// Check that the maps haven't changed.
|
1046
1045
|
Register reg =
|
@@ -1083,7 +1082,7 @@ MaybeObject* StubCompiler::GenerateLoadCallback(JSObject* object,
|
|
1083
1082
|
const int kStackSpace = 5;
|
1084
1083
|
const int kApiArgc = 2;
|
1085
1084
|
|
1086
|
-
__ PrepareCallApiFunction(kApiArgc
|
1085
|
+
__ PrepareCallApiFunction(kApiArgc);
|
1087
1086
|
__ mov(ApiParameterOperand(0), ebx); // name.
|
1088
1087
|
__ add(Operand(ebx), Immediate(kPointerSize));
|
1089
1088
|
__ mov(ApiParameterOperand(1), ebx); // arguments pointer.
|
@@ -1106,8 +1105,7 @@ void StubCompiler::GenerateLoadConstant(JSObject* object,
|
|
1106
1105
|
String* name,
|
1107
1106
|
Label* miss) {
|
1108
1107
|
// Check that the receiver isn't a smi.
|
1109
|
-
__
|
1110
|
-
__ j(zero, miss);
|
1108
|
+
__ JumpIfSmi(receiver, miss);
|
1111
1109
|
|
1112
1110
|
// Check that the maps haven't changed.
|
1113
1111
|
CheckPrototypes(object, receiver, holder,
|
@@ -1133,8 +1131,7 @@ void StubCompiler::GenerateLoadInterceptor(JSObject* object,
|
|
1133
1131
|
ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined());
|
1134
1132
|
|
1135
1133
|
// Check that the receiver isn't a smi.
|
1136
|
-
__
|
1137
|
-
__ j(zero, miss);
|
1134
|
+
__ JumpIfSmi(receiver, miss);
|
1138
1135
|
|
1139
1136
|
// So far the most popular follow ups for interceptor loads are FIELD
|
1140
1137
|
// and CALLBACKS, so inline only them, other cases may be added
|
@@ -1284,8 +1281,7 @@ void CallStubCompiler::GenerateGlobalReceiverCheck(JSObject* object,
|
|
1284
1281
|
// object which can only happen for contextual calls. In this case,
|
1285
1282
|
// the receiver cannot be a smi.
|
1286
1283
|
if (object != holder) {
|
1287
|
-
__
|
1288
|
-
__ j(zero, miss);
|
1284
|
+
__ JumpIfSmi(edx, miss);
|
1289
1285
|
}
|
1290
1286
|
|
1291
1287
|
// Check that the maps haven't changed.
|
@@ -1311,8 +1307,7 @@ void CallStubCompiler::GenerateLoadFunctionFromCell(JSGlobalPropertyCell* cell,
|
|
1311
1307
|
// the nice side effect that multiple closures based on the same
|
1312
1308
|
// function can all use this call IC. Before we load through the
|
1313
1309
|
// function, we have to verify that it still is a function.
|
1314
|
-
__
|
1315
|
-
__ j(zero, miss);
|
1310
|
+
__ JumpIfSmi(edi, miss);
|
1316
1311
|
__ CmpObjectType(edi, JS_FUNCTION_TYPE, ebx);
|
1317
1312
|
__ j(not_equal, miss);
|
1318
1313
|
|
@@ -1360,8 +1355,7 @@ MUST_USE_RESULT MaybeObject* CallStubCompiler::CompileCallField(
|
|
1360
1355
|
__ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
|
1361
1356
|
|
1362
1357
|
// Check that the receiver isn't a smi.
|
1363
|
-
__
|
1364
|
-
__ j(zero, &miss);
|
1358
|
+
__ JumpIfSmi(edx, &miss);
|
1365
1359
|
|
1366
1360
|
// Do the right check and compute the holder register.
|
1367
1361
|
Register reg = CheckPrototypes(object, edx, holder, ebx, eax, edi,
|
@@ -1370,8 +1364,7 @@ MUST_USE_RESULT MaybeObject* CallStubCompiler::CompileCallField(
|
|
1370
1364
|
GenerateFastPropertyLoad(masm(), edi, reg, holder, index);
|
1371
1365
|
|
1372
1366
|
// Check that the function really is a function.
|
1373
|
-
__
|
1374
|
-
__ j(zero, &miss);
|
1367
|
+
__ JumpIfSmi(edi, &miss);
|
1375
1368
|
__ CmpObjectType(edi, JS_FUNCTION_TYPE, ebx);
|
1376
1369
|
__ j(not_equal, &miss);
|
1377
1370
|
|
@@ -1383,7 +1376,11 @@ MUST_USE_RESULT MaybeObject* CallStubCompiler::CompileCallField(
|
|
1383
1376
|
}
|
1384
1377
|
|
1385
1378
|
// Invoke the function.
|
1386
|
-
|
1379
|
+
CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
|
1380
|
+
? CALL_AS_FUNCTION
|
1381
|
+
: CALL_AS_METHOD;
|
1382
|
+
__ InvokeFunction(edi, arguments(), JUMP_FUNCTION,
|
1383
|
+
NullCallWrapper(), call_kind);
|
1387
1384
|
|
1388
1385
|
// Handle call cache miss.
|
1389
1386
|
__ bind(&miss);
|
@@ -1422,8 +1419,7 @@ MaybeObject* CallStubCompiler::CompileArrayPushCall(Object* object,
|
|
1422
1419
|
__ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
|
1423
1420
|
|
1424
1421
|
// Check that the receiver isn't a smi.
|
1425
|
-
__
|
1426
|
-
__ j(zero, &miss);
|
1422
|
+
__ JumpIfSmi(edx, &miss);
|
1427
1423
|
|
1428
1424
|
CheckPrototypes(JSObject::cast(object), edx,
|
1429
1425
|
holder, ebx,
|
@@ -1471,8 +1467,7 @@ MaybeObject* CallStubCompiler::CompileArrayPushCall(Object* object,
|
|
1471
1467
|
__ mov(Operand(edx, 0), ecx);
|
1472
1468
|
|
1473
1469
|
// Check if value is a smi.
|
1474
|
-
__
|
1475
|
-
__ j(not_zero, &with_write_barrier);
|
1470
|
+
__ JumpIfNotSmi(ecx, &with_write_barrier);
|
1476
1471
|
|
1477
1472
|
__ bind(&exit);
|
1478
1473
|
__ ret((argc + 1) * kPointerSize);
|
@@ -1575,8 +1570,7 @@ MaybeObject* CallStubCompiler::CompileArrayPopCall(Object* object,
|
|
1575
1570
|
__ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
|
1576
1571
|
|
1577
1572
|
// Check that the receiver isn't a smi.
|
1578
|
-
__
|
1579
|
-
__ j(zero, &miss);
|
1573
|
+
__ JumpIfSmi(edx, &miss);
|
1580
1574
|
CheckPrototypes(JSObject::cast(object), edx,
|
1581
1575
|
holder, ebx,
|
1582
1576
|
eax, edi, name, &miss);
|
@@ -1835,8 +1829,7 @@ MaybeObject* CallStubCompiler::CompileStringFromCharCodeCall(
|
|
1835
1829
|
__ mov(edx, Operand(esp, 2 * kPointerSize));
|
1836
1830
|
|
1837
1831
|
STATIC_ASSERT(kSmiTag == 0);
|
1838
|
-
__
|
1839
|
-
__ j(zero, &miss);
|
1832
|
+
__ JumpIfSmi(edx, &miss);
|
1840
1833
|
|
1841
1834
|
CheckPrototypes(JSObject::cast(object), edx, holder, ebx, eax, edi, name,
|
1842
1835
|
&miss);
|
@@ -1853,8 +1846,7 @@ MaybeObject* CallStubCompiler::CompileStringFromCharCodeCall(
|
|
1853
1846
|
// Check the code is a smi.
|
1854
1847
|
Label slow;
|
1855
1848
|
STATIC_ASSERT(kSmiTag == 0);
|
1856
|
-
__
|
1857
|
-
__ j(not_zero, &slow);
|
1849
|
+
__ JumpIfNotSmi(code, &slow);
|
1858
1850
|
|
1859
1851
|
// Convert the smi code to uint16.
|
1860
1852
|
__ and_(code, Immediate(Smi::FromInt(0xffff)));
|
@@ -1869,7 +1861,11 @@ MaybeObject* CallStubCompiler::CompileStringFromCharCodeCall(
|
|
1869
1861
|
// Tail call the full function. We do not have to patch the receiver
|
1870
1862
|
// because the function makes no use of it.
|
1871
1863
|
__ bind(&slow);
|
1872
|
-
|
1864
|
+
CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
|
1865
|
+
? CALL_AS_FUNCTION
|
1866
|
+
: CALL_AS_METHOD;
|
1867
|
+
__ InvokeFunction(function, arguments(), JUMP_FUNCTION,
|
1868
|
+
NullCallWrapper(), call_kind);
|
1873
1869
|
|
1874
1870
|
__ bind(&miss);
|
1875
1871
|
// ecx: function name.
|
@@ -1915,8 +1911,7 @@ MaybeObject* CallStubCompiler::CompileMathFloorCall(Object* object,
|
|
1915
1911
|
__ mov(edx, Operand(esp, 2 * kPointerSize));
|
1916
1912
|
|
1917
1913
|
STATIC_ASSERT(kSmiTag == 0);
|
1918
|
-
__
|
1919
|
-
__ j(zero, &miss);
|
1914
|
+
__ JumpIfSmi(edx, &miss);
|
1920
1915
|
|
1921
1916
|
CheckPrototypes(JSObject::cast(object), edx, holder, ebx, eax, edi, name,
|
1922
1917
|
&miss);
|
@@ -1932,8 +1927,7 @@ MaybeObject* CallStubCompiler::CompileMathFloorCall(Object* object,
|
|
1932
1927
|
// Check if the argument is a smi.
|
1933
1928
|
Label smi;
|
1934
1929
|
STATIC_ASSERT(kSmiTag == 0);
|
1935
|
-
__
|
1936
|
-
__ j(zero, &smi);
|
1930
|
+
__ JumpIfSmi(eax, &smi);
|
1937
1931
|
|
1938
1932
|
// Check if the argument is a heap number and load its value into xmm0.
|
1939
1933
|
Label slow;
|
@@ -1999,7 +1993,8 @@ MaybeObject* CallStubCompiler::CompileMathFloorCall(Object* object,
|
|
1999
1993
|
// Tail call the full function. We do not have to patch the receiver
|
2000
1994
|
// because the function makes no use of it.
|
2001
1995
|
__ bind(&slow);
|
2002
|
-
__ InvokeFunction(function, arguments(), JUMP_FUNCTION
|
1996
|
+
__ InvokeFunction(function, arguments(), JUMP_FUNCTION,
|
1997
|
+
NullCallWrapper(), CALL_AS_METHOD);
|
2003
1998
|
|
2004
1999
|
__ bind(&miss);
|
2005
2000
|
// ecx: function name.
|
@@ -2039,8 +2034,7 @@ MaybeObject* CallStubCompiler::CompileMathAbsCall(Object* object,
|
|
2039
2034
|
__ mov(edx, Operand(esp, 2 * kPointerSize));
|
2040
2035
|
|
2041
2036
|
STATIC_ASSERT(kSmiTag == 0);
|
2042
|
-
__
|
2043
|
-
__ j(zero, &miss);
|
2037
|
+
__ JumpIfSmi(edx, &miss);
|
2044
2038
|
|
2045
2039
|
CheckPrototypes(JSObject::cast(object), edx, holder, ebx, eax, edi, name,
|
2046
2040
|
&miss);
|
@@ -2056,8 +2050,7 @@ MaybeObject* CallStubCompiler::CompileMathAbsCall(Object* object,
|
|
2056
2050
|
// Check if the argument is a smi.
|
2057
2051
|
Label not_smi;
|
2058
2052
|
STATIC_ASSERT(kSmiTag == 0);
|
2059
|
-
__
|
2060
|
-
__ j(not_zero, ¬_smi);
|
2053
|
+
__ JumpIfNotSmi(eax, ¬_smi);
|
2061
2054
|
|
2062
2055
|
// Set ebx to 1...1 (== -1) if the argument is negative, or to 0...0
|
2063
2056
|
// otherwise.
|
@@ -2104,7 +2097,8 @@ MaybeObject* CallStubCompiler::CompileMathAbsCall(Object* object,
|
|
2104
2097
|
// Tail call the full function. We do not have to patch the receiver
|
2105
2098
|
// because the function makes no use of it.
|
2106
2099
|
__ bind(&slow);
|
2107
|
-
__ InvokeFunction(function, arguments(), JUMP_FUNCTION
|
2100
|
+
__ InvokeFunction(function, arguments(), JUMP_FUNCTION,
|
2101
|
+
NullCallWrapper(), CALL_AS_METHOD);
|
2108
2102
|
|
2109
2103
|
__ bind(&miss);
|
2110
2104
|
// ecx: function name.
|
@@ -2142,8 +2136,7 @@ MaybeObject* CallStubCompiler::CompileFastApiCall(
|
|
2142
2136
|
__ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
|
2143
2137
|
|
2144
2138
|
// Check that the receiver isn't a smi.
|
2145
|
-
__
|
2146
|
-
__ j(zero, &miss_before_stack_reserved);
|
2139
|
+
__ JumpIfSmi(edx, &miss_before_stack_reserved);
|
2147
2140
|
|
2148
2141
|
Counters* counters = isolate()->counters();
|
2149
2142
|
__ IncrementCounter(counters->call_const(), 1);
|
@@ -2178,11 +2171,12 @@ MaybeObject* CallStubCompiler::CompileFastApiCall(
|
|
2178
2171
|
}
|
2179
2172
|
|
2180
2173
|
|
2181
|
-
MaybeObject* CallStubCompiler::CompileCallConstant(
|
2182
|
-
|
2183
|
-
|
2184
|
-
|
2185
|
-
|
2174
|
+
MaybeObject* CallStubCompiler::CompileCallConstant(
|
2175
|
+
Object* object,
|
2176
|
+
JSObject* holder,
|
2177
|
+
JSFunction* function,
|
2178
|
+
String* name,
|
2179
|
+
CheckType check) {
|
2186
2180
|
// ----------- S t a t e -------------
|
2187
2181
|
// -- ecx : name
|
2188
2182
|
// -- esp[0] : return address
|
@@ -2210,8 +2204,7 @@ MaybeObject* CallStubCompiler::CompileCallConstant(Object* object,
|
|
2210
2204
|
|
2211
2205
|
// Check that the receiver isn't a smi.
|
2212
2206
|
if (check != NUMBER_CHECK) {
|
2213
|
-
__
|
2214
|
-
__ j(zero, &miss);
|
2207
|
+
__ JumpIfSmi(edx, &miss);
|
2215
2208
|
}
|
2216
2209
|
|
2217
2210
|
// Make sure that it's okay not to patch the on stack receiver
|
@@ -2260,8 +2253,7 @@ MaybeObject* CallStubCompiler::CompileCallConstant(Object* object,
|
|
2260
2253
|
} else {
|
2261
2254
|
Label fast;
|
2262
2255
|
// Check that the object is a smi or a heap number.
|
2263
|
-
__
|
2264
|
-
__ j(zero, &fast);
|
2256
|
+
__ JumpIfSmi(edx, &fast);
|
2265
2257
|
__ CmpObjectType(edx, HEAP_NUMBER_TYPE, eax);
|
2266
2258
|
__ j(not_equal, &miss);
|
2267
2259
|
__ bind(&fast);
|
@@ -2300,7 +2292,11 @@ MaybeObject* CallStubCompiler::CompileCallConstant(Object* object,
|
|
2300
2292
|
UNREACHABLE();
|
2301
2293
|
}
|
2302
2294
|
|
2303
|
-
|
2295
|
+
CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
|
2296
|
+
? CALL_AS_FUNCTION
|
2297
|
+
: CALL_AS_METHOD;
|
2298
|
+
__ InvokeFunction(function, arguments(), JUMP_FUNCTION,
|
2299
|
+
NullCallWrapper(), call_kind);
|
2304
2300
|
|
2305
2301
|
// Handle call cache miss.
|
2306
2302
|
__ bind(&miss);
|
@@ -2335,7 +2331,7 @@ MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object,
|
|
2335
2331
|
// Get the receiver from the stack.
|
2336
2332
|
__ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
|
2337
2333
|
|
2338
|
-
CallInterceptorCompiler compiler(this, arguments(), ecx);
|
2334
|
+
CallInterceptorCompiler compiler(this, arguments(), ecx, extra_ic_state_);
|
2339
2335
|
MaybeObject* result = compiler.Compile(masm(),
|
2340
2336
|
object,
|
2341
2337
|
holder,
|
@@ -2352,8 +2348,7 @@ MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object,
|
|
2352
2348
|
__ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
|
2353
2349
|
|
2354
2350
|
// Check that the function really is a function.
|
2355
|
-
__
|
2356
|
-
__ j(zero, &miss);
|
2351
|
+
__ JumpIfSmi(eax, &miss);
|
2357
2352
|
__ CmpObjectType(eax, JS_FUNCTION_TYPE, ebx);
|
2358
2353
|
__ j(not_equal, &miss);
|
2359
2354
|
|
@@ -2366,7 +2361,11 @@ MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object,
|
|
2366
2361
|
|
2367
2362
|
// Invoke the function.
|
2368
2363
|
__ mov(edi, eax);
|
2369
|
-
|
2364
|
+
CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
|
2365
|
+
? CALL_AS_FUNCTION
|
2366
|
+
: CALL_AS_METHOD;
|
2367
|
+
__ InvokeFunction(edi, arguments(), JUMP_FUNCTION,
|
2368
|
+
NullCallWrapper(), call_kind);
|
2370
2369
|
|
2371
2370
|
// Handle load cache miss.
|
2372
2371
|
__ bind(&miss);
|
@@ -2383,8 +2382,7 @@ MaybeObject* CallStubCompiler::CompileCallGlobal(
|
|
2383
2382
|
GlobalObject* holder,
|
2384
2383
|
JSGlobalPropertyCell* cell,
|
2385
2384
|
JSFunction* function,
|
2386
|
-
String* name
|
2387
|
-
Code::ExtraICState extra_ic_state) {
|
2385
|
+
String* name) {
|
2388
2386
|
// ----------- S t a t e -------------
|
2389
2387
|
// -- ecx : name
|
2390
2388
|
// -- esp[0] : return address
|
@@ -2427,7 +2425,7 @@ MaybeObject* CallStubCompiler::CompileCallGlobal(
|
|
2427
2425
|
__ IncrementCounter(counters->call_global_inline(), 1);
|
2428
2426
|
ASSERT(function->is_compiled());
|
2429
2427
|
ParameterCount expected(function->shared()->formal_parameter_count());
|
2430
|
-
CallKind call_kind = CallICBase::Contextual::decode(
|
2428
|
+
CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
|
2431
2429
|
? CALL_AS_FUNCTION
|
2432
2430
|
: CALL_AS_METHOD;
|
2433
2431
|
if (V8::UseCrankshaft()) {
|
@@ -2498,8 +2496,7 @@ MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object,
|
|
2498
2496
|
Label miss;
|
2499
2497
|
|
2500
2498
|
// Check that the object isn't a smi.
|
2501
|
-
__
|
2502
|
-
__ j(zero, &miss);
|
2499
|
+
__ JumpIfSmi(edx, &miss);
|
2503
2500
|
|
2504
2501
|
// Check that the map of the object hasn't changed.
|
2505
2502
|
__ cmp(FieldOperand(edx, HeapObject::kMapOffset),
|
@@ -2548,8 +2545,7 @@ MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
|
|
2548
2545
|
Label miss;
|
2549
2546
|
|
2550
2547
|
// Check that the object isn't a smi.
|
2551
|
-
__
|
2552
|
-
__ j(zero, &miss);
|
2548
|
+
__ JumpIfSmi(edx, &miss);
|
2553
2549
|
|
2554
2550
|
// Check that the map of the object hasn't changed.
|
2555
2551
|
__ cmp(FieldOperand(edx, HeapObject::kMapOffset),
|
@@ -2675,18 +2671,18 @@ MaybeObject* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
|
|
2675
2671
|
}
|
2676
2672
|
|
2677
2673
|
|
2678
|
-
MaybeObject* KeyedStoreStubCompiler::
|
2679
|
-
Map* receiver_map) {
|
2674
|
+
MaybeObject* KeyedStoreStubCompiler::CompileStoreElement(Map* receiver_map) {
|
2680
2675
|
// ----------- S t a t e -------------
|
2681
2676
|
// -- eax : value
|
2682
2677
|
// -- ecx : key
|
2683
2678
|
// -- edx : receiver
|
2684
2679
|
// -- esp[0] : return address
|
2685
2680
|
// -----------------------------------
|
2686
|
-
bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
|
2687
|
-
MaybeObject* maybe_stub =
|
2688
|
-
KeyedStoreFastElementStub(is_js_array).TryGetCode();
|
2689
2681
|
Code* stub;
|
2682
|
+
JSObject::ElementsKind elements_kind = receiver_map->elements_kind();
|
2683
|
+
bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE;
|
2684
|
+
MaybeObject* maybe_stub =
|
2685
|
+
KeyedStoreElementStub(is_jsarray, elements_kind).TryGetCode();
|
2690
2686
|
if (!maybe_stub->To(&stub)) return maybe_stub;
|
2691
2687
|
__ DispatchMap(edx,
|
2692
2688
|
Handle<Map>(receiver_map),
|
@@ -2741,8 +2737,7 @@ MaybeObject* LoadStubCompiler::CompileLoadNonexistent(String* name,
|
|
2741
2737
|
Label miss;
|
2742
2738
|
|
2743
2739
|
// Check that the receiver isn't a smi.
|
2744
|
-
__
|
2745
|
-
__ j(zero, &miss);
|
2740
|
+
__ JumpIfSmi(eax, &miss);
|
2746
2741
|
|
2747
2742
|
ASSERT(last->IsGlobalObject() || last->HasFastProperties());
|
2748
2743
|
|
@@ -2894,8 +2889,7 @@ MaybeObject* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
|
|
2894
2889
|
// object which can only happen for contextual loads. In this case,
|
2895
2890
|
// the receiver cannot be a smi.
|
2896
2891
|
if (object != holder) {
|
2897
|
-
__
|
2898
|
-
__ j(zero, &miss);
|
2892
|
+
__ JumpIfSmi(eax, &miss);
|
2899
2893
|
}
|
2900
2894
|
|
2901
2895
|
// Check that the maps haven't changed.
|
@@ -3139,14 +3133,15 @@ MaybeObject* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
|
|
3139
3133
|
}
|
3140
3134
|
|
3141
3135
|
|
3142
|
-
MaybeObject* KeyedLoadStubCompiler::
|
3136
|
+
MaybeObject* KeyedLoadStubCompiler::CompileLoadElement(Map* receiver_map) {
|
3143
3137
|
// ----------- S t a t e -------------
|
3144
3138
|
// -- eax : key
|
3145
3139
|
// -- edx : receiver
|
3146
3140
|
// -- esp[0] : return address
|
3147
3141
|
// -----------------------------------
|
3148
|
-
MaybeObject* maybe_stub = KeyedLoadFastElementStub().TryGetCode();
|
3149
3142
|
Code* stub;
|
3143
|
+
JSObject::ElementsKind elements_kind = receiver_map->elements_kind();
|
3144
|
+
MaybeObject* maybe_stub = KeyedLoadElementStub(elements_kind).TryGetCode();
|
3150
3145
|
if (!maybe_stub->To(&stub)) return maybe_stub;
|
3151
3146
|
__ DispatchMap(edx,
|
3152
3147
|
Handle<Map>(receiver_map),
|
@@ -3211,8 +3206,7 @@ MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) {
|
|
3211
3206
|
// Load the initial map and verify that it is in fact a map.
|
3212
3207
|
__ mov(ebx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset));
|
3213
3208
|
// Will both indicate a NULL and a Smi.
|
3214
|
-
__
|
3215
|
-
__ j(zero, &generic_stub_call);
|
3209
|
+
__ JumpIfSmi(ebx, &generic_stub_call);
|
3216
3210
|
__ CmpObjectType(ebx, MAP_TYPE, ecx);
|
3217
3211
|
__ j(not_equal, &generic_stub_call);
|
3218
3212
|
|
@@ -3327,61 +3321,71 @@ MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) {
|
|
3327
3321
|
}
|
3328
3322
|
|
3329
3323
|
|
3330
|
-
|
3331
|
-
|
3324
|
+
#undef __
|
3325
|
+
#define __ ACCESS_MASM(masm)
|
3326
|
+
|
3327
|
+
|
3328
|
+
void KeyedLoadStubCompiler::GenerateLoadDictionaryElement(
|
3329
|
+
MacroAssembler* masm) {
|
3332
3330
|
// ----------- S t a t e -------------
|
3333
3331
|
// -- eax : key
|
3334
3332
|
// -- edx : receiver
|
3335
3333
|
// -- esp[0] : return address
|
3336
3334
|
// -----------------------------------
|
3337
|
-
|
3338
|
-
KeyedLoadExternalArrayStub(array_type).TryGetCode();
|
3339
|
-
Code* stub;
|
3340
|
-
if (!maybe_stub->To(&stub)) return maybe_stub;
|
3341
|
-
__ DispatchMap(edx,
|
3342
|
-
Handle<Map>(receiver->map()),
|
3343
|
-
Handle<Code>(stub),
|
3344
|
-
DO_SMI_CHECK);
|
3335
|
+
Label slow, miss_force_generic;
|
3345
3336
|
|
3346
|
-
|
3347
|
-
|
3337
|
+
// This stub is meant to be tail-jumped to, the receiver must already
|
3338
|
+
// have been verified by the caller to not be a smi.
|
3339
|
+
__ JumpIfNotSmi(eax, &miss_force_generic);
|
3340
|
+
__ mov(ebx, eax);
|
3341
|
+
__ SmiUntag(ebx);
|
3342
|
+
__ mov(ecx, FieldOperand(edx, JSObject::kElementsOffset));
|
3348
3343
|
|
3349
|
-
//
|
3350
|
-
|
3351
|
-
|
3344
|
+
// Push receiver on the stack to free up a register for the dictionary
|
3345
|
+
// probing.
|
3346
|
+
__ push(edx);
|
3347
|
+
__ LoadFromNumberDictionary(&slow,
|
3348
|
+
ecx,
|
3349
|
+
eax,
|
3350
|
+
ebx,
|
3351
|
+
edx,
|
3352
|
+
edi,
|
3353
|
+
eax);
|
3354
|
+
// Pop receiver before returning.
|
3355
|
+
__ pop(edx);
|
3356
|
+
__ ret(0);
|
3352
3357
|
|
3358
|
+
__ bind(&slow);
|
3359
|
+
__ pop(edx);
|
3353
3360
|
|
3354
|
-
MaybeObject* ExternalArrayStoreStubCompiler::CompileStore(
|
3355
|
-
JSObject* receiver, ExternalArrayType array_type) {
|
3356
3361
|
// ----------- S t a t e -------------
|
3357
3362
|
// -- eax : value
|
3358
3363
|
// -- ecx : key
|
3359
3364
|
// -- edx : receiver
|
3360
3365
|
// -- esp[0] : return address
|
3361
3366
|
// -----------------------------------
|
3362
|
-
MaybeObject* maybe_stub =
|
3363
|
-
KeyedStoreExternalArrayStub(array_type).TryGetCode();
|
3364
|
-
Code* stub;
|
3365
|
-
if (!maybe_stub->To(&stub)) return maybe_stub;
|
3366
|
-
__ DispatchMap(edx,
|
3367
|
-
Handle<Map>(receiver->map()),
|
3368
|
-
Handle<Code>(stub),
|
3369
|
-
DO_SMI_CHECK);
|
3370
3367
|
|
3371
|
-
Handle<Code>
|
3372
|
-
|
3373
|
-
|
3374
|
-
return GetCode();
|
3375
|
-
}
|
3368
|
+
Handle<Code> slow_ic =
|
3369
|
+
masm->isolate()->builtins()->KeyedLoadIC_Slow();
|
3370
|
+
__ jmp(slow_ic, RelocInfo::CODE_TARGET);
|
3376
3371
|
|
3372
|
+
__ bind(&miss_force_generic);
|
3373
|
+
// ----------- S t a t e -------------
|
3374
|
+
// -- eax : value
|
3375
|
+
// -- ecx : key
|
3376
|
+
// -- edx : receiver
|
3377
|
+
// -- esp[0] : return address
|
3378
|
+
// -----------------------------------
|
3377
3379
|
|
3378
|
-
|
3379
|
-
|
3380
|
+
Handle<Code> miss_force_generic_ic =
|
3381
|
+
masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
|
3382
|
+
__ jmp(miss_force_generic_ic, RelocInfo::CODE_TARGET);
|
3383
|
+
}
|
3380
3384
|
|
3381
3385
|
|
3382
3386
|
void KeyedLoadStubCompiler::GenerateLoadExternalArray(
|
3383
3387
|
MacroAssembler* masm,
|
3384
|
-
|
3388
|
+
JSObject::ElementsKind elements_kind) {
|
3385
3389
|
// ----------- S t a t e -------------
|
3386
3390
|
// -- eax : key
|
3387
3391
|
// -- edx : receiver
|
@@ -3393,41 +3397,40 @@ void KeyedLoadStubCompiler::GenerateLoadExternalArray(
|
|
3393
3397
|
// have been verified by the caller to not be a smi.
|
3394
3398
|
|
3395
3399
|
// Check that the key is a smi.
|
3396
|
-
__
|
3397
|
-
__ j(not_zero, &miss_force_generic);
|
3400
|
+
__ JumpIfNotSmi(eax, &miss_force_generic);
|
3398
3401
|
|
3399
3402
|
// Check that the index is in range.
|
3400
|
-
__ mov(ecx, eax);
|
3401
|
-
__ SmiUntag(ecx); // Untag the index.
|
3402
3403
|
__ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset));
|
3403
|
-
__ cmp(
|
3404
|
+
__ cmp(eax, FieldOperand(ebx, ExternalArray::kLengthOffset));
|
3404
3405
|
// Unsigned comparison catches both negative and too-large values.
|
3405
3406
|
__ j(above_equal, &miss_force_generic);
|
3406
3407
|
__ mov(ebx, FieldOperand(ebx, ExternalArray::kExternalPointerOffset));
|
3407
3408
|
// ebx: base pointer of external storage
|
3408
|
-
switch (
|
3409
|
-
case
|
3410
|
-
__
|
3409
|
+
switch (elements_kind) {
|
3410
|
+
case JSObject::EXTERNAL_BYTE_ELEMENTS:
|
3411
|
+
__ SmiUntag(eax); // Untag the index.
|
3412
|
+
__ movsx_b(eax, Operand(ebx, eax, times_1, 0));
|
3411
3413
|
break;
|
3412
|
-
case
|
3413
|
-
case
|
3414
|
-
__
|
3414
|
+
case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
|
3415
|
+
case JSObject::EXTERNAL_PIXEL_ELEMENTS:
|
3416
|
+
__ SmiUntag(eax); // Untag the index.
|
3417
|
+
__ movzx_b(eax, Operand(ebx, eax, times_1, 0));
|
3415
3418
|
break;
|
3416
|
-
case
|
3417
|
-
__ movsx_w(eax, Operand(ebx,
|
3419
|
+
case JSObject::EXTERNAL_SHORT_ELEMENTS:
|
3420
|
+
__ movsx_w(eax, Operand(ebx, eax, times_1, 0));
|
3418
3421
|
break;
|
3419
|
-
case
|
3420
|
-
__ movzx_w(eax, Operand(ebx,
|
3422
|
+
case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
|
3423
|
+
__ movzx_w(eax, Operand(ebx, eax, times_1, 0));
|
3421
3424
|
break;
|
3422
|
-
case
|
3423
|
-
case
|
3424
|
-
__ mov(ecx, Operand(ebx,
|
3425
|
+
case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS:
|
3426
|
+
case JSObject::EXTERNAL_INT_ELEMENTS:
|
3427
|
+
__ mov(ecx, Operand(ebx, eax, times_2, 0));
|
3425
3428
|
break;
|
3426
|
-
case
|
3427
|
-
__ fld_s(Operand(ebx,
|
3429
|
+
case JSObject::EXTERNAL_FLOAT_ELEMENTS:
|
3430
|
+
__ fld_s(Operand(ebx, eax, times_2, 0));
|
3428
3431
|
break;
|
3429
|
-
case
|
3430
|
-
__ fld_d(Operand(ebx,
|
3432
|
+
case JSObject::EXTERNAL_DOUBLE_ELEMENTS:
|
3433
|
+
__ fld_d(Operand(ebx, eax, times_4, 0));
|
3431
3434
|
break;
|
3432
3435
|
default:
|
3433
3436
|
UNREACHABLE();
|
@@ -3439,17 +3442,17 @@ void KeyedLoadStubCompiler::GenerateLoadExternalArray(
|
|
3439
3442
|
// For floating-point array type:
|
3440
3443
|
// FP(0): value
|
3441
3444
|
|
3442
|
-
if (
|
3443
|
-
|
3445
|
+
if (elements_kind == JSObject::EXTERNAL_INT_ELEMENTS ||
|
3446
|
+
elements_kind == JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS) {
|
3444
3447
|
// For the Int and UnsignedInt array types, we need to see whether
|
3445
3448
|
// the value can be represented in a Smi. If not, we need to convert
|
3446
3449
|
// it to a HeapNumber.
|
3447
3450
|
Label box_int;
|
3448
|
-
if (
|
3451
|
+
if (elements_kind == JSObject::EXTERNAL_INT_ELEMENTS) {
|
3449
3452
|
__ cmp(ecx, 0xC0000000);
|
3450
3453
|
__ j(sign, &box_int);
|
3451
3454
|
} else {
|
3452
|
-
ASSERT_EQ(
|
3455
|
+
ASSERT_EQ(JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS, elements_kind);
|
3453
3456
|
// The test is different for unsigned int values. Since we need
|
3454
3457
|
// the value to be in the range of a positive smi, we can't
|
3455
3458
|
// handle either of the top two bits being set in the value.
|
@@ -3465,12 +3468,12 @@ void KeyedLoadStubCompiler::GenerateLoadExternalArray(
|
|
3465
3468
|
|
3466
3469
|
// Allocate a HeapNumber for the int and perform int-to-double
|
3467
3470
|
// conversion.
|
3468
|
-
if (
|
3471
|
+
if (elements_kind == JSObject::EXTERNAL_INT_ELEMENTS) {
|
3469
3472
|
__ push(ecx);
|
3470
3473
|
__ fild_s(Operand(esp, 0));
|
3471
3474
|
__ pop(ecx);
|
3472
3475
|
} else {
|
3473
|
-
|
3476
|
+
ASSERT_EQ(JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS, elements_kind);
|
3474
3477
|
// Need to zero-extend the value.
|
3475
3478
|
// There's no fild variant for unsigned values, so zero-extend
|
3476
3479
|
// to a 64-bit int manually.
|
@@ -3486,8 +3489,8 @@ void KeyedLoadStubCompiler::GenerateLoadExternalArray(
|
|
3486
3489
|
__ mov(eax, ecx);
|
3487
3490
|
__ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
|
3488
3491
|
__ ret(0);
|
3489
|
-
} else if (
|
3490
|
-
|
3492
|
+
} else if (elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS ||
|
3493
|
+
elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS) {
|
3491
3494
|
// For the floating-point array type, we need to always allocate a
|
3492
3495
|
// HeapNumber.
|
3493
3496
|
__ AllocateHeapNumber(ecx, ebx, edi, &failed_allocation);
|
@@ -3537,7 +3540,7 @@ void KeyedLoadStubCompiler::GenerateLoadExternalArray(
|
|
3537
3540
|
|
3538
3541
|
void KeyedStoreStubCompiler::GenerateStoreExternalArray(
|
3539
3542
|
MacroAssembler* masm,
|
3540
|
-
|
3543
|
+
JSObject::ElementsKind elements_kind) {
|
3541
3544
|
// ----------- S t a t e -------------
|
3542
3545
|
// -- eax : key
|
3543
3546
|
// -- edx : receiver
|
@@ -3549,14 +3552,11 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
|
|
3549
3552
|
// have been verified by the caller to not be a smi.
|
3550
3553
|
|
3551
3554
|
// Check that the key is a smi.
|
3552
|
-
__
|
3553
|
-
__ j(not_zero, &miss_force_generic);
|
3555
|
+
__ JumpIfNotSmi(ecx, &miss_force_generic);
|
3554
3556
|
|
3555
3557
|
// Check that the index is in range.
|
3556
3558
|
__ mov(edi, FieldOperand(edx, JSObject::kElementsOffset));
|
3557
|
-
__
|
3558
|
-
__ SmiUntag(ebx);
|
3559
|
-
__ cmp(ebx, FieldOperand(edi, ExternalArray::kLengthOffset));
|
3559
|
+
__ cmp(ecx, FieldOperand(edi, ExternalArray::kLengthOffset));
|
3560
3560
|
// Unsigned comparison catches both negative and too-large values.
|
3561
3561
|
__ j(above_equal, &slow);
|
3562
3562
|
|
@@ -3566,52 +3566,46 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
|
|
3566
3566
|
// edx: receiver
|
3567
3567
|
// ecx: key
|
3568
3568
|
// edi: elements array
|
3569
|
-
|
3570
|
-
|
3571
|
-
|
3572
|
-
__
|
3573
|
-
|
3574
|
-
__ j(not_equal, &check_heap_number);
|
3569
|
+
if (elements_kind == JSObject::EXTERNAL_PIXEL_ELEMENTS) {
|
3570
|
+
__ JumpIfNotSmi(eax, &slow);
|
3571
|
+
} else {
|
3572
|
+
__ JumpIfNotSmi(eax, &check_heap_number);
|
3573
|
+
}
|
3575
3574
|
|
3576
3575
|
// smi case
|
3577
|
-
__ mov(
|
3578
|
-
__ SmiUntag(
|
3576
|
+
__ mov(ebx, eax); // Preserve the value in eax as the return value.
|
3577
|
+
__ SmiUntag(ebx);
|
3579
3578
|
__ mov(edi, FieldOperand(edi, ExternalArray::kExternalPointerOffset));
|
3580
|
-
//
|
3581
|
-
switch (
|
3582
|
-
case
|
3583
|
-
|
3584
|
-
|
3585
|
-
|
3586
|
-
__ j(zero, &done, Label::kNear);
|
3587
|
-
__ setcc(negative, ecx); // 1 if negative, 0 if positive.
|
3588
|
-
__ dec_b(ecx); // 0 if negative, 255 if positive.
|
3589
|
-
__ bind(&done);
|
3590
|
-
}
|
3591
|
-
__ mov_b(Operand(edi, ebx, times_1, 0), ecx);
|
3579
|
+
// edi: base pointer of external storage
|
3580
|
+
switch (elements_kind) {
|
3581
|
+
case JSObject::EXTERNAL_PIXEL_ELEMENTS:
|
3582
|
+
__ ClampUint8(ebx);
|
3583
|
+
__ SmiUntag(ecx);
|
3584
|
+
__ mov_b(Operand(edi, ecx, times_1, 0), ebx);
|
3592
3585
|
break;
|
3593
|
-
case
|
3594
|
-
case
|
3595
|
-
__
|
3586
|
+
case JSObject::EXTERNAL_BYTE_ELEMENTS:
|
3587
|
+
case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
|
3588
|
+
__ SmiUntag(ecx);
|
3589
|
+
__ mov_b(Operand(edi, ecx, times_1, 0), ebx);
|
3596
3590
|
break;
|
3597
|
-
case
|
3598
|
-
case
|
3599
|
-
__ mov_w(Operand(edi,
|
3591
|
+
case JSObject::EXTERNAL_SHORT_ELEMENTS:
|
3592
|
+
case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
|
3593
|
+
__ mov_w(Operand(edi, ecx, times_1, 0), ebx);
|
3600
3594
|
break;
|
3601
|
-
case
|
3602
|
-
case
|
3603
|
-
__ mov(Operand(edi,
|
3595
|
+
case JSObject::EXTERNAL_INT_ELEMENTS:
|
3596
|
+
case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS:
|
3597
|
+
__ mov(Operand(edi, ecx, times_2, 0), ebx);
|
3604
3598
|
break;
|
3605
|
-
case
|
3606
|
-
case
|
3599
|
+
case JSObject::EXTERNAL_FLOAT_ELEMENTS:
|
3600
|
+
case JSObject::EXTERNAL_DOUBLE_ELEMENTS:
|
3607
3601
|
// Need to perform int-to-float conversion.
|
3608
|
-
__ push(
|
3602
|
+
__ push(ebx);
|
3609
3603
|
__ fild_s(Operand(esp, 0));
|
3610
|
-
__ pop(
|
3611
|
-
if (
|
3612
|
-
__ fstp_s(Operand(edi,
|
3613
|
-
} else { //
|
3614
|
-
__ fstp_d(Operand(edi,
|
3604
|
+
__ pop(ebx);
|
3605
|
+
if (elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) {
|
3606
|
+
__ fstp_s(Operand(edi, ecx, times_2, 0));
|
3607
|
+
} else { // elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS.
|
3608
|
+
__ fstp_d(Operand(edi, ecx, times_4, 0));
|
3615
3609
|
}
|
3616
3610
|
break;
|
3617
3611
|
default:
|
@@ -3621,13 +3615,12 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
|
|
3621
3615
|
__ ret(0); // Return the original value.
|
3622
3616
|
|
3623
3617
|
// TODO(danno): handle heap number -> pixel array conversion
|
3624
|
-
if (
|
3618
|
+
if (elements_kind != JSObject::EXTERNAL_PIXEL_ELEMENTS) {
|
3625
3619
|
__ bind(&check_heap_number);
|
3626
3620
|
// eax: value
|
3627
3621
|
// edx: receiver
|
3628
3622
|
// ecx: key
|
3629
3623
|
// edi: elements array
|
3630
|
-
// ebx: untagged index
|
3631
3624
|
__ cmp(FieldOperand(eax, HeapObject::kMapOffset),
|
3632
3625
|
Immediate(masm->isolate()->factory()->heap_number_map()));
|
3633
3626
|
__ j(not_equal, &slow);
|
@@ -3636,15 +3629,14 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
|
|
3636
3629
|
// +/-Infinity into integer arrays basically undefined. For more
|
3637
3630
|
// reproducible behavior, convert these to zero.
|
3638
3631
|
__ mov(edi, FieldOperand(edi, ExternalArray::kExternalPointerOffset));
|
3639
|
-
// ebx: untagged index
|
3640
3632
|
// edi: base pointer of external storage
|
3641
|
-
if (
|
3633
|
+
if (elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) {
|
3642
3634
|
__ fld_d(FieldOperand(eax, HeapNumber::kValueOffset));
|
3643
|
-
__ fstp_s(Operand(edi,
|
3635
|
+
__ fstp_s(Operand(edi, ecx, times_2, 0));
|
3644
3636
|
__ ret(0);
|
3645
|
-
} else if (
|
3637
|
+
} else if (elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS) {
|
3646
3638
|
__ fld_d(FieldOperand(eax, HeapNumber::kValueOffset));
|
3647
|
-
__ fstp_d(Operand(edi,
|
3639
|
+
__ fstp_d(Operand(edi, ecx, times_4, 0));
|
3648
3640
|
__ ret(0);
|
3649
3641
|
} else {
|
3650
3642
|
// Perform float-to-int conversion with truncation (round-to-zero)
|
@@ -3655,31 +3647,24 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
|
|
3655
3647
|
// (code-stubs-ia32.cc) is roughly what is needed here though the
|
3656
3648
|
// conversion failure case does not need to be handled.
|
3657
3649
|
if (CpuFeatures::IsSupported(SSE2)) {
|
3658
|
-
if (
|
3659
|
-
|
3650
|
+
if (elements_kind != JSObject::EXTERNAL_INT_ELEMENTS &&
|
3651
|
+
elements_kind != JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS) {
|
3660
3652
|
ASSERT(CpuFeatures::IsSupported(SSE2));
|
3661
3653
|
CpuFeatures::Scope scope(SSE2);
|
3662
|
-
__ cvttsd2si(
|
3654
|
+
__ cvttsd2si(ebx, FieldOperand(eax, HeapNumber::kValueOffset));
|
3663
3655
|
// ecx: untagged integer value
|
3664
|
-
switch (
|
3665
|
-
case
|
3666
|
-
|
3667
|
-
|
3668
|
-
|
3669
|
-
|
3670
|
-
|
3671
|
-
|
3672
|
-
__ bind(&done);
|
3673
|
-
}
|
3674
|
-
__ mov_b(Operand(edi, ebx, times_1, 0), ecx);
|
3675
|
-
break;
|
3676
|
-
case kExternalByteArray:
|
3677
|
-
case kExternalUnsignedByteArray:
|
3678
|
-
__ mov_b(Operand(edi, ebx, times_1, 0), ecx);
|
3656
|
+
switch (elements_kind) {
|
3657
|
+
case JSObject::EXTERNAL_PIXEL_ELEMENTS:
|
3658
|
+
__ ClampUint8(ebx);
|
3659
|
+
// Fall through.
|
3660
|
+
case JSObject::EXTERNAL_BYTE_ELEMENTS:
|
3661
|
+
case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
|
3662
|
+
__ SmiUntag(ecx);
|
3663
|
+
__ mov_b(Operand(edi, ecx, times_1, 0), ebx);
|
3679
3664
|
break;
|
3680
|
-
case
|
3681
|
-
case
|
3682
|
-
__ mov_w(Operand(edi,
|
3665
|
+
case JSObject::EXTERNAL_SHORT_ELEMENTS:
|
3666
|
+
case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
|
3667
|
+
__ mov_w(Operand(edi, ecx, times_1, 0), ebx);
|
3683
3668
|
break;
|
3684
3669
|
default:
|
3685
3670
|
UNREACHABLE();
|
@@ -3696,7 +3681,7 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
|
|
3696
3681
|
__ fld_d(FieldOperand(eax, HeapNumber::kValueOffset));
|
3697
3682
|
__ sub(Operand(esp), Immediate(2 * kPointerSize));
|
3698
3683
|
__ fisttp_d(Operand(esp, 0));
|
3699
|
-
__ pop(
|
3684
|
+
__ pop(ebx);
|
3700
3685
|
__ add(Operand(esp), Immediate(kPointerSize));
|
3701
3686
|
} else {
|
3702
3687
|
ASSERT(CpuFeatures::IsSupported(SSE2));
|
@@ -3707,15 +3692,15 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
|
|
3707
3692
|
// Note: we could do better for signed int arrays.
|
3708
3693
|
__ movd(xmm0, FieldOperand(eax, HeapNumber::kValueOffset));
|
3709
3694
|
// We will need the key if we have to make the slow runtime call.
|
3710
|
-
__ push(
|
3711
|
-
__ LoadPowerOf2(xmm1,
|
3712
|
-
__ pop(
|
3695
|
+
__ push(ebx);
|
3696
|
+
__ LoadPowerOf2(xmm1, ebx, 31);
|
3697
|
+
__ pop(ebx);
|
3713
3698
|
__ ucomisd(xmm1, xmm0);
|
3714
3699
|
__ j(above_equal, &slow);
|
3715
|
-
__ cvttsd2si(
|
3700
|
+
__ cvttsd2si(ebx, Operand(xmm0));
|
3716
3701
|
}
|
3717
|
-
//
|
3718
|
-
__ mov(Operand(edi,
|
3702
|
+
// ebx: untagged integer value
|
3703
|
+
__ mov(Operand(edi, ecx, times_2, 0), ebx);
|
3719
3704
|
}
|
3720
3705
|
__ ret(0); // Return original value.
|
3721
3706
|
}
|
@@ -3751,8 +3736,6 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
|
|
3751
3736
|
}
|
3752
3737
|
|
3753
3738
|
|
3754
|
-
|
3755
|
-
|
3756
3739
|
void KeyedLoadStubCompiler::GenerateLoadFastElement(MacroAssembler* masm) {
|
3757
3740
|
// ----------- S t a t e -------------
|
3758
3741
|
// -- eax : key
|
@@ -3765,8 +3748,7 @@ void KeyedLoadStubCompiler::GenerateLoadFastElement(MacroAssembler* masm) {
|
|
3765
3748
|
// have been verified by the caller to not be a smi.
|
3766
3749
|
|
3767
3750
|
// Check that the key is a smi.
|
3768
|
-
__
|
3769
|
-
__ j(not_zero, &miss_force_generic);
|
3751
|
+
__ JumpIfNotSmi(eax, &miss_force_generic);
|
3770
3752
|
|
3771
3753
|
// Get the elements array.
|
3772
3754
|
__ mov(ecx, FieldOperand(edx, JSObject::kElementsOffset));
|
@@ -3791,10 +3773,76 @@ void KeyedLoadStubCompiler::GenerateLoadFastElement(MacroAssembler* masm) {
|
|
3791
3773
|
}
|
3792
3774
|
|
3793
3775
|
|
3776
|
+
void KeyedLoadStubCompiler::GenerateLoadFastDoubleElement(
|
3777
|
+
MacroAssembler* masm) {
|
3778
|
+
// ----------- S t a t e -------------
|
3779
|
+
// -- eax : key
|
3780
|
+
// -- edx : receiver
|
3781
|
+
// -- esp[0] : return address
|
3782
|
+
// -----------------------------------
|
3783
|
+
Label miss_force_generic, slow_allocate_heapnumber;
|
3784
|
+
|
3785
|
+
// This stub is meant to be tail-jumped to, the receiver must already
|
3786
|
+
// have been verified by the caller to not be a smi.
|
3787
|
+
|
3788
|
+
// Check that the key is a smi.
|
3789
|
+
__ JumpIfNotSmi(eax, &miss_force_generic);
|
3790
|
+
|
3791
|
+
// Get the elements array.
|
3792
|
+
__ mov(ecx, FieldOperand(edx, JSObject::kElementsOffset));
|
3793
|
+
__ AssertFastElements(ecx);
|
3794
|
+
|
3795
|
+
// Check that the key is within bounds.
|
3796
|
+
__ cmp(eax, FieldOperand(ecx, FixedDoubleArray::kLengthOffset));
|
3797
|
+
__ j(above_equal, &miss_force_generic);
|
3798
|
+
|
3799
|
+
// Check for the hole
|
3800
|
+
uint32_t offset = FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32);
|
3801
|
+
__ cmp(FieldOperand(ecx, eax, times_4, offset), Immediate(kHoleNanUpper32));
|
3802
|
+
__ j(equal, &miss_force_generic);
|
3803
|
+
|
3804
|
+
// Always allocate a heap number for the result.
|
3805
|
+
if (CpuFeatures::IsSupported(SSE2)) {
|
3806
|
+
CpuFeatures::Scope use_sse2(SSE2);
|
3807
|
+
__ movdbl(xmm0, FieldOperand(ecx, eax, times_4,
|
3808
|
+
FixedDoubleArray::kHeaderSize));
|
3809
|
+
} else {
|
3810
|
+
__ fld_d(FieldOperand(ecx, eax, times_4, FixedDoubleArray::kHeaderSize));
|
3811
|
+
}
|
3812
|
+
__ AllocateHeapNumber(ecx, ebx, edi, &slow_allocate_heapnumber);
|
3813
|
+
// Set the value.
|
3814
|
+
if (CpuFeatures::IsSupported(SSE2)) {
|
3815
|
+
CpuFeatures::Scope use_sse2(SSE2);
|
3816
|
+
__ movdbl(FieldOperand(ecx, HeapNumber::kValueOffset), xmm0);
|
3817
|
+
} else {
|
3818
|
+
__ fstp_d(FieldOperand(ecx, HeapNumber::kValueOffset));
|
3819
|
+
}
|
3820
|
+
__ mov(eax, ecx);
|
3821
|
+
__ ret(0);
|
3822
|
+
|
3823
|
+
__ bind(&slow_allocate_heapnumber);
|
3824
|
+
// A value was pushed on the floating point stack before the allocation, if
|
3825
|
+
// the allocation fails it needs to be removed.
|
3826
|
+
if (!CpuFeatures::IsSupported(SSE2)) {
|
3827
|
+
__ ffree();
|
3828
|
+
__ fincstp();
|
3829
|
+
}
|
3830
|
+
Handle<Code> slow_ic =
|
3831
|
+
masm->isolate()->builtins()->KeyedLoadIC_Slow();
|
3832
|
+
__ jmp(slow_ic, RelocInfo::CODE_TARGET);
|
3833
|
+
|
3834
|
+
__ bind(&miss_force_generic);
|
3835
|
+
Handle<Code> miss_ic =
|
3836
|
+
masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
|
3837
|
+
__ jmp(miss_ic, RelocInfo::CODE_TARGET);
|
3838
|
+
}
|
3839
|
+
|
3840
|
+
|
3794
3841
|
void KeyedStoreStubCompiler::GenerateStoreFastElement(MacroAssembler* masm,
|
3795
3842
|
bool is_js_array) {
|
3796
3843
|
// ----------- S t a t e -------------
|
3797
|
-
// -- eax :
|
3844
|
+
// -- eax : value
|
3845
|
+
// -- ecx : key
|
3798
3846
|
// -- edx : receiver
|
3799
3847
|
// -- esp[0] : return address
|
3800
3848
|
// -----------------------------------
|
@@ -3804,8 +3852,7 @@ void KeyedStoreStubCompiler::GenerateStoreFastElement(MacroAssembler* masm,
|
|
3804
3852
|
// have been verified by the caller to not be a smi.
|
3805
3853
|
|
3806
3854
|
// Check that the key is a smi.
|
3807
|
-
__
|
3808
|
-
__ j(not_zero, &miss_force_generic);
|
3855
|
+
__ JumpIfNotSmi(ecx, &miss_force_generic);
|
3809
3856
|
|
3810
3857
|
// Get the elements array and make sure it is a fast element array, not 'cow'.
|
3811
3858
|
__ mov(edi, FieldOperand(edx, JSObject::kElementsOffset));
|
@@ -3840,6 +3887,100 @@ void KeyedStoreStubCompiler::GenerateStoreFastElement(MacroAssembler* masm,
|
|
3840
3887
|
}
|
3841
3888
|
|
3842
3889
|
|
3890
|
+
void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(
|
3891
|
+
MacroAssembler* masm,
|
3892
|
+
bool is_js_array) {
|
3893
|
+
// ----------- S t a t e -------------
|
3894
|
+
// -- eax : value
|
3895
|
+
// -- ecx : key
|
3896
|
+
// -- edx : receiver
|
3897
|
+
// -- esp[0] : return address
|
3898
|
+
// -----------------------------------
|
3899
|
+
Label miss_force_generic, smi_value, is_nan, maybe_nan;
|
3900
|
+
Label have_double_value, not_nan;
|
3901
|
+
|
3902
|
+
// This stub is meant to be tail-jumped to, the receiver must already
|
3903
|
+
// have been verified by the caller to not be a smi.
|
3904
|
+
|
3905
|
+
// Check that the key is a smi.
|
3906
|
+
__ JumpIfNotSmi(ecx, &miss_force_generic);
|
3907
|
+
|
3908
|
+
// Get the elements array.
|
3909
|
+
__ mov(edi, FieldOperand(edx, JSObject::kElementsOffset));
|
3910
|
+
__ AssertFastElements(edi);
|
3911
|
+
|
3912
|
+
if (is_js_array) {
|
3913
|
+
// Check that the key is within bounds.
|
3914
|
+
__ cmp(ecx, FieldOperand(edx, JSArray::kLengthOffset)); // smis.
|
3915
|
+
} else {
|
3916
|
+
// Check that the key is within bounds.
|
3917
|
+
__ cmp(ecx, FieldOperand(edi, FixedArray::kLengthOffset)); // smis.
|
3918
|
+
}
|
3919
|
+
__ j(above_equal, &miss_force_generic);
|
3920
|
+
|
3921
|
+
__ JumpIfSmi(eax, &smi_value, Label::kNear);
|
3922
|
+
|
3923
|
+
__ CheckMap(eax,
|
3924
|
+
masm->isolate()->factory()->heap_number_map(),
|
3925
|
+
&miss_force_generic,
|
3926
|
+
DONT_DO_SMI_CHECK);
|
3927
|
+
|
3928
|
+
// Double value, canonicalize NaN.
|
3929
|
+
uint32_t offset = HeapNumber::kValueOffset + sizeof(kHoleNanLower32);
|
3930
|
+
__ cmp(FieldOperand(eax, offset), Immediate(kNaNOrInfinityLowerBoundUpper32));
|
3931
|
+
__ j(greater_equal, &maybe_nan, Label::kNear);
|
3932
|
+
|
3933
|
+
__ bind(¬_nan);
|
3934
|
+
ExternalReference canonical_nan_reference =
|
3935
|
+
ExternalReference::address_of_canonical_non_hole_nan();
|
3936
|
+
if (CpuFeatures::IsSupported(SSE2)) {
|
3937
|
+
CpuFeatures::Scope use_sse2(SSE2);
|
3938
|
+
__ movdbl(xmm0, FieldOperand(eax, HeapNumber::kValueOffset));
|
3939
|
+
__ bind(&have_double_value);
|
3940
|
+
__ movdbl(FieldOperand(edi, ecx, times_4, FixedDoubleArray::kHeaderSize),
|
3941
|
+
xmm0);
|
3942
|
+
__ ret(0);
|
3943
|
+
} else {
|
3944
|
+
__ fld_d(FieldOperand(eax, HeapNumber::kValueOffset));
|
3945
|
+
__ bind(&have_double_value);
|
3946
|
+
__ fstp_d(FieldOperand(edi, ecx, times_4, FixedDoubleArray::kHeaderSize));
|
3947
|
+
__ ret(0);
|
3948
|
+
}
|
3949
|
+
|
3950
|
+
__ bind(&maybe_nan);
|
3951
|
+
// Could be NaN or Infinity. If fraction is not zero, it's NaN, otherwise
|
3952
|
+
// it's an Infinity, and the non-NaN code path applies.
|
3953
|
+
__ j(greater, &is_nan, Label::kNear);
|
3954
|
+
__ cmp(FieldOperand(eax, HeapNumber::kValueOffset), Immediate(0));
|
3955
|
+
__ j(zero, ¬_nan);
|
3956
|
+
__ bind(&is_nan);
|
3957
|
+
if (CpuFeatures::IsSupported(SSE2)) {
|
3958
|
+
CpuFeatures::Scope use_sse2(SSE2);
|
3959
|
+
__ movdbl(xmm0, Operand::StaticVariable(canonical_nan_reference));
|
3960
|
+
} else {
|
3961
|
+
__ fld_d(Operand::StaticVariable(canonical_nan_reference));
|
3962
|
+
}
|
3963
|
+
__ jmp(&have_double_value, Label::kNear);
|
3964
|
+
|
3965
|
+
__ bind(&smi_value);
|
3966
|
+
// Value is a smi. convert to a double and store.
|
3967
|
+
// Preserve original value.
|
3968
|
+
__ mov(edx, eax);
|
3969
|
+
__ SmiUntag(edx);
|
3970
|
+
__ push(edx);
|
3971
|
+
__ fild_s(Operand(esp, 0));
|
3972
|
+
__ pop(edx);
|
3973
|
+
__ fstp_d(FieldOperand(edi, ecx, times_4, FixedDoubleArray::kHeaderSize));
|
3974
|
+
__ ret(0);
|
3975
|
+
|
3976
|
+
// Handle store cache miss, replacing the ic with the generic stub.
|
3977
|
+
__ bind(&miss_force_generic);
|
3978
|
+
Handle<Code> ic_force_generic =
|
3979
|
+
masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
|
3980
|
+
__ jmp(ic_force_generic, RelocInfo::CODE_TARGET);
|
3981
|
+
}
|
3982
|
+
|
3983
|
+
|
3843
3984
|
#undef __
|
3844
3985
|
|
3845
3986
|
} } // namespace v8::internal
|