diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index d554ec65d2..de51f8a1ee 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -22,6 +22,7 @@ *~ .cpplint-cache .d8_history +.*.sw? bsuite d8 d8_g @@ -46,7 +47,7 @@ shell_g /test/mozilla/data /test/mozilla/downloaded_* /test/test262/data -/test/test262/test262-* +/test/test262/tc39-test262-* /third_party /tools/jsfunfuzz /tools/jsfunfuzz.zip diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index 597b0ff0ae..4ef2bcca33 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -17,8 +17,10 @@ Opera Software ASA Akinori MUSHA Alexander Botero-Lowry Alexander Karpinsky +Alexandre Rames Alexandre Vassalotti Andreas Anyuru +Baptiste Afsa Bert Belder Burcu Dogan Craig Schlenter @@ -31,6 +33,7 @@ Fedor Indutny Filipe David Manana Haitao Feng Ioseb Dzmanashvili +Jacob Bramley Jan de Mooij Jay Freeman James Pike @@ -59,6 +62,7 @@ Sandro Santilli Sanjoy Das Subrato K De Tobias Burnus +Vincent Belliard Vlad Burlik Xi Qian Yuqiang Xian diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 1d3f139e11..879515d743 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,402 @@ +2014-03-28: Version 3.25.30 + + NativeContext::map_cache reference should be strong in heap snapshots + (Chromium issue 357060). + + Performance and stability improvements on all platforms. + + +2014-03-27: Version 3.25.29 + + Performance and stability improvements on all platforms. + + +2014-03-27: Version 3.25.28 + + Performance and stability improvements on all platforms. + + +2014-03-26: Version 3.25.27 + + Promise constructor should not be enumerable (Chromium issue 352597). + + Performance and stability improvements on all platforms. + + +2014-03-26: Version 3.25.26 + + Performance and stability improvements on all platforms. + + +2014-03-25: Version 3.25.25 + + Roll ICU 239289:258359 and add support for external ICU data tables + (issue 3142, Chromium issue 72633). + + Performance and stability improvements on all platforms. + + +2014-03-25: Version 3.25.24 + + Add support for per-isolate private symbols. + + No longer OOM on invalid string length (issue 3060). + + Remove Failure::OutOfMemory propagation and + V8::IgnoreOutOfMemoryException (issue 3060). + + Tentative Windows dll build fix: Don't V8_EXPORT ScriptCompiler::Source + (issue 3228). + + Performance and stability improvements on all platforms. + + +2014-03-24: Version 3.25.23 + + Rename A64 port to ARM64 port (Chromium issue 354405). + + Fix missing access check in Runtime_SetPrototype (Chromium issue + 354123). + + Fix polymorphic hydrogen handling of SLOPPY_ARGUMENTS_ELEMENTS (Chromium + issue 354391). + + Performance and stability improvements on all platforms. + + +2014-03-20: Version 3.25.22 + + Increase the "local variables in a function" limit (issue 3205). + + Implement ES6 symbol registry and predefined symbols. + + Throw exception on invalid string length instead of OOM (Chromium issue + 349329). + + Performance and stability improvements on all platforms. + + +2014-03-20: Version 3.25.21 + + Performance and stability improvements on all platforms. + + +2014-03-20: Version 3.25.20 + + Fix polymorphic keyed loads for SLOPPY_ARGUMENTS_ELEMENTS (Chromium + issue 350867). + + Performance and stability improvements on all platforms. + + +2014-03-19: Version 3.25.19 + + Performance and stability improvements on all platforms. + + +2014-03-19: Version 3.25.18 + + Performance and stability improvements on all platforms. + + +2014-03-19: Version 3.25.17 + + Performance and stability improvements on all platforms. + + +2014-03-18: Version 3.25.16 + + Apply numeric casts correctly in typed arrays and related code (Chromium + issue 353004). + + Performance and stability improvements on all platforms. + + +2014-03-18: Version 3.25.15 + + Don't generate keyed store ICs for global proxies (Chromium issue + 352983). + + MIPS: Make invalid LHSs a parse-time (reference) error (Chromium issue + 351658). + + Make invalid LHSs a parse-time (reference) error (Chromium issue + 351658). + + Add Promises/A+ Compliance Test Suite (Chromium issue 347095). + + Split Promise API into Promise/Resolver. + + Performance and stability improvements on all platforms. + + +2014-03-17: Version 3.25.14 + + Performance and stability improvements on all platforms. + + +2014-03-17: Version 3.25.13 + + Move profiler callback interfaces from v8.h to v8-profiler.h. + + Performance and stability improvements on all platforms. + + +2014-03-14: Version 3.25.12 + + PromiseCoerce should deal with an error during accessing "then" + (Chromium issue 347095). + + Propagate updated offsets in BoundsCheckBbData (Chromium issue 350863). + + Add regression test for range analysis bug (issue 3204). + + Continued fix for 351257. Reusing the feedback vector is too complex + (Chromium issue 351257). + + StopCpuProfiling should return non-const CpuProfile (issue 3213). + + Allow for compiling with xcode 5.1 (which doesn't have gcc anymore). + + Performance and stability improvements on all platforms. + + +2014-03-14: Version 3.25.11 + + MIPS: Remove uses of CanBeNegative() in HMod (issue 3204). + + MIPS: Remove uses of RangeCanInclude() in flooring division by power of + 2 (issue 3204). + + MIPS: Fix uses of range analysis results in HChange (issue 3204). + + Make translation of modulus operation '--stress-opt'-proof (Chromium + issue 352059). + + Remove uses of CanBeNegative() in HMod (issue 3204). + + Remove uses of RangeCanInclude() in flooring division by power of 2 + (issue 3204). + + Fix uses of range analysis results in HChange (issue 3204). + + Performance and stability improvements on all platforms. + + +2014-03-14: Version 3.25.10 + + This version was not committed due to script failures. + + +2014-03-13: Version 3.25.9 + + Reland "Enable Object.observe by default" again (issue 2409). + + Use intrinsics for builtin ArrayBuffer property accesses (Chromium issue + 351787). + + Performance and stability improvements on all platforms. + + +2014-03-12: Version 3.25.8 + + Fix HIsSmiAndBranch::KnownSuccessorBlock() by deleting it (Chromium + issue 351320). + + Fix handling of polymorphic array accesses with constant index (Chromium + issue 351319). + + Fix lazy deopt after tagged binary ops (Chromium issue 350434). + + MIPS: Cleanup some of the range uses in ModI/DivI (issue 3204). + + Fix issue with getOwnPropertySymbols and hidden properties (Chromium + issue 350864). + + Cleanup some of the range uses in ModI/DivI (issue 3204). + + PromiseCoerce should ignore primitive values (Chromium issue 347095). + + Use a per-isolate cache for the date object JS bits (Chromium issue + 348856). + + Performance and stability improvements on all platforms. + + +2014-03-11: Version 3.25.7 + + Promise.all and Promise.race should reject non-array parameter (Chromium + issue 347453). + + Promise.all and Promise race should use "then" rather than "chain" + (Chromium issue 347427). + + Merge the "Compute Minus Zero Checks" phase into the range analysis + (issue 3204). + + Performance and stability improvements on all platforms. + + +2014-03-10: Version 3.25.6 + + Replace the recursion in PropagateMinusZeroChecks() with a loop and a + worklist (issue 3204). + + Reland "Enable Object.observe by default" (issue 2409). + + Enable Object.observe by default (issue 2409). + + AllocationTracker now maintains a map from address range to stack trace + that allocated the range. When snapshot is generated the map is used to + find construction stack trace for an object using its address (Chromium + issue 277984). + + Introduce Runtime_GetAllScopesDetails to get all scopes at once for a + frame (Chromium issue 340285). + + Reduce heavy runtime calls from debug mirrors (Chromium issue 340285). + + Check and clear date cache in DateCurrentTime, DateLocalTimezone and + getTimezoneOffset (Chromium issue 142141). + + Performance and stability improvements on all platforms. + + +2014-03-06: Version 3.25.5 + + Fix HConstants with Smi-ranged HeapNumber values (Chromium issue + 349878). + + Fix issues with JSON stringify replacer array (issues 3200, 3201). + + Performance and stability improvements on all platforms. + + +2014-03-05: Version 3.25.4 + + x64: Fix LMathMinMax for constant Smi right-hand operands (Chromium + issue 349079). + + Performance and stability improvements on all platforms. + + +2014-03-04: Version 3.25.3 + + Clear optimized code cache in shared function info when code gets + deoptimized (Chromium issue 343609). + + Fixed constant folding for Math.clz32 (Chromium issue 347906). + + Fix JSObject::PrintTransitions (Chromium issue 347912). + + Fix handling of constant global variable assignments (Chromium issue + 347904). + + Removed bogus ASSERT (Chromium issue 347542). + + Mark HCompareMap as having Tagged representation (Chromium issue + 346636). + + Fix crasher in Object.getOwnPropertySymbols (Chromium issue 346141). + + Fix the bit massaging code in CompleteParserRecorder::WriteNumber + (Chromium issue 346221). + + Don't eliminate loads with incompatible types or representations + (Chromium issue 346343). + + Check that after a weak callback, the handle is either dead or strong + (Chromium issue 346061). + + Lazy preparsing vs. lazy parsing fix (Chromium issue 346207). + + Performance and stability improvements on all platforms. + + +2014-02-25: Version 3.25.2 + + Fix the bit massaging code in CompleteParserRecorder::WriteNumber + (Chromium issue 346221). + + Revert r19455 "Load target types and handlers before IC computation." + (Chromium issue 346149). + + Don't eliminate loads with incompatible types or representations + (Chromium issue 346343). + + Fix for a smi stores optimization on x64 with a regression test + (Chromium issue 345715). + + Check that after a weak callback, the handle is either dead or strong + (Chromium issue 346061). + + negative bounds checking on realm calls (Chromium issue 344285). + + Lazy preparsing vs. lazy parsing fix (Chromium issue 346207). + + Fix optimistic BCE to back off after deopt (issue 3176). + + Performance and stability improvements on all platforms. + + +2014-02-21: Version 3.25.1 + + Performance and stability improvements on all platforms. + + +2014-02-19: Version 3.25.0 + + ES6: Tighten up Object.prototype.__proto__ (issue 3064). + + Fix Hydrogen bounds check elimination (Chromium issue 344186). + + Performance and stability improvements on all platforms. + + +2014-02-19: Version 3.24.40 + + A64: Let the MacroAssembler resolve branches to distant targets (issue + 3148). + + Fixed and improved code for integral division. Fixed and extended tests + (issue 3151). + + MIPS: Fix assignment of function name constant (issue 3138). + + Fix assignment of function name constant (issue 3138). + + Performance and stability improvements on all platforms. + + +2014-02-14: Version 3.24.39 + + Introduce --job-based-sweeping flag and use individual jobs for sweeping + if set (issue 3104). + + Performance and stability improvements on all platforms. + + +2014-02-13: Version 3.24.38 + + Merge experimental/a64 to bleeding_edge (issue 3113). + + Performance and stability improvements on all platforms. + + +2014-02-12: Version 3.24.37 + + Fix spec violations in JSON.stringify wrt replacer array (issue 3135). + + Performance and stability improvements on all platforms. + + +2014-02-11: Version 3.24.36 + + Fix inconsistencies wrt whitespaces (issue 3109). + + Performance and stability improvements on all platforms. + + 2014-02-10: Version 3.24.35 Fix inconsistencies wrt whitespaces (issue 3109). diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 66d21eb364..353c5c8b34 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -8,7 +8,7 @@ deps = { "http://gyp.googlecode.com/svn/trunk@1831", "v8/third_party/icu": - "https://src.chromium.org/chrome/trunk/deps/third_party/icu46@239289", + "https://src.chromium.org/chrome/trunk/deps/third_party/icu46@258359", } deps_os = { diff --git a/deps/v8/LICENSE b/deps/v8/LICENSE index 2e516bab62..2f5bce8369 100644 --- a/deps/v8/LICENSE +++ b/deps/v8/LICENSE @@ -26,7 +26,7 @@ are: These libraries have their own licenses; we recommend you read them, as their terms may differ from the terms below. -Copyright 2006-2012, the V8 project authors. All rights reserved. +Copyright 2014, the V8 project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/deps/v8/Makefile b/deps/v8/Makefile index 2f47fa9a88..cdf5d74832 100644 --- a/deps/v8/Makefile +++ b/deps/v8/Makefile @@ -136,7 +136,16 @@ endif # deprecation_warnings=on ifeq ($(deprecationwarnings), on) GYPFLAGS += -Dv8_deprecation_warnings=1 -endif +endif +# asan=/path/to/clang++ +ifneq ($(strip $(asan)),) + GYPFLAGS += -Dasan=1 + export CXX="$(asan)" + export CXX_host="$(asan)" + export LINK="$(asan)" + export ASAN_SYMBOLIZER_PATH="$(dir $(asan))llvm-symbolizer" +endif + # arm specific flags. # arm_version= ifneq ($(strip $(arm_version)),) @@ -223,11 +232,11 @@ endif # Architectures and modes to be compiled. Consider these to be internal # variables, don't override them (use the targets instead). -ARCHES = ia32 x64 arm mipsel +ARCHES = ia32 x64 arm arm64 mipsel DEFAULT_ARCHES = ia32 x64 arm MODES = release debug optdebug DEFAULT_MODES = release debug -ANDROID_ARCHES = android_ia32 android_arm android_mipsel +ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel NACL_ARCHES = nacl_ia32 nacl_x64 # List of files that trigger Makefile regeneration: @@ -247,13 +256,15 @@ NACL_BUILDS = $(foreach mode,$(MODES), \ $(addsuffix .$(mode),$(NACL_ARCHES))) # Generates corresponding test targets, e.g. "ia32.release.check". CHECKS = $(addsuffix .check,$(BUILDS)) +QUICKCHECKS = $(addsuffix .quickcheck,$(BUILDS)) ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS)) NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS)) # File where previously used GYPFLAGS are stored. ENVFILE = $(OUTDIR)/environment .PHONY: all check clean dependencies $(ENVFILE).new native \ - qc quickcheck \ + qc quickcheck $(QUICKCHECKS) \ + $(addsuffix .quickcheck,$(MODES)) $(addsuffix .quickcheck,$(ARCHES)) \ $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ @@ -332,6 +343,18 @@ $(CHECKS): $$(basename $$@) @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ --arch-and-mode=$(basename $@) $(TESTFLAGS) +$(addsuffix .quickcheck,$(MODES)): $$(basename $$@) + @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ + --mode=$(basename $@) $(TESTFLAGS) --quickcheck + +$(addsuffix .quickcheck,$(ARCHES)): $$(basename $$@) + @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ + --arch=$(basename $@) $(TESTFLAGS) --quickcheck + +$(QUICKCHECKS): $$(basename $$@) + @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ + --arch-and-mode=$(basename $@) $(TESTFLAGS) --quickcheck + $(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@) @tools/android-sync.sh $(basename $@) $(OUTDIR) \ $(shell pwd) $(ANDROID_V8) @@ -358,12 +381,17 @@ native.check: native @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ --arch-and-mode=. $(TESTFLAGS) -FASTTESTMODES = ia32.release,x64.release,ia32.optdebug,x64.optdebug,arm.optdebug +SUPERFASTTESTMODES = ia32.release +FASTTESTMODES = $(SUPERFASTTESTMODES),x64.release,ia32.optdebug,x64.optdebug,arm.optdebug,arm64.release +FASTCOMPILEMODES = $(FASTTESTMODES),arm64.optdebug COMMA = , EMPTY = SPACE = $(EMPTY) $(EMPTY) -quickcheck: $(subst $(COMMA),$(SPACE),$(FASTTESTMODES)) +quickcheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES)) + tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ + --arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) --quickcheck \ + --download-data mozilla webkit tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ --arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) --quickcheck qc: quickcheck @@ -392,7 +420,7 @@ $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ -Ibuild/standalone.gypi --depth=. \ -Dv8_target_arch=$(subst .,,$(suffix $(basename $@))) \ - -Dv8_optimized_debug=$(if $(findstring optdebug,$@),2,0) \ + $(if $(findstring optdebug,$@),-Dv8_optimized_debug=2,) \ -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS) $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) @@ -446,4 +474,4 @@ dependencies: --revision 1831 svn checkout --force \ https://src.chromium.org/chrome/trunk/deps/third_party/icu46 \ - third_party/icu --revision 239289 + third_party/icu --revision 258359 diff --git a/deps/v8/Makefile.android b/deps/v8/Makefile.android index fad5fe9943..f4e144f280 100644 --- a/deps/v8/Makefile.android +++ b/deps/v8/Makefile.android @@ -26,7 +26,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Those definitions should be consistent with the main Makefile -ANDROID_ARCHES = android_ia32 android_arm android_mipsel +ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel MODES = release debug # Generates all combinations of ANDROID ARCHES and MODES, @@ -49,24 +49,40 @@ endif ifeq ($(ARCH), android_arm) DEFINES = target_arch=arm v8_target_arch=arm android_target_arch=arm DEFINES += arm_neon=0 arm_version=7 - TOOLCHAIN_ARCH = arm-linux-androideabi-4.6 + TOOLCHAIN_ARCH = arm-linux-androideabi + TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) + TOOLCHAIN_VER = 4.6 else - ifeq ($(ARCH), android_mipsel) - DEFINES = target_arch=mipsel v8_target_arch=mipsel android_target_arch=mips - DEFINES += mips_arch_variant=mips32r2 - TOOLCHAIN_ARCH = mipsel-linux-android-4.6 + ifeq ($(ARCH), android_arm64) + DEFINES = target_arch=arm64 v8_target_arch=arm64 android_target_arch=arm64 + TOOLCHAIN_ARCH = aarch64-linux-android + TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) + TOOLCHAIN_VER = 4.8 else - ifeq ($(ARCH), android_ia32) - DEFINES = target_arch=ia32 v8_target_arch=ia32 android_target_arch=x86 - TOOLCHAIN_ARCH = x86-4.6 + ifeq ($(ARCH), android_mipsel) + DEFINES = target_arch=mipsel v8_target_arch=mipsel + DEFINES += android_target_arch=mips mips_arch_variant=mips32r2 + TOOLCHAIN_ARCH = mipsel-linux-android + TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) + TOOLCHAIN_VER = 4.6 + else - $(error Target architecture "${ARCH}" is not supported) + ifeq ($(ARCH), android_ia32) + DEFINES = target_arch=ia32 v8_target_arch=ia32 android_target_arch=x86 + TOOLCHAIN_ARCH = x86 + TOOLCHAIN_PREFIX = i686-linux-android + TOOLCHAIN_VER = 4.6 + else + $(error Target architecture "${ARCH}" is not supported) + endif endif endif endif -TOOLCHAIN_PATH = ${ANDROID_NDK_ROOT}/toolchains/${TOOLCHAIN_ARCH}/prebuilt +TOOLCHAIN_PATH = \ + ${ANDROID_NDK_ROOT}/toolchains/${TOOLCHAIN_ARCH}-${TOOLCHAIN_VER}/prebuilt ANDROID_TOOLCHAIN ?= ${TOOLCHAIN_PATH}/${TOOLCHAIN_DIR} + ifeq ($(wildcard $(ANDROID_TOOLCHAIN)),) $(error Cannot find Android toolchain in "${ANDROID_TOOLCHAIN}". Please \ check that ANDROID_NDK_ROOT and ANDROID_NDK_HOST_ARCH are set \ @@ -79,23 +95,23 @@ DEFINES += host_os=${HOST_OS} .SECONDEXPANSION: $(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@ @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ - CXX="$(ANDROID_TOOLCHAIN)/bin/*-g++" \ - AR="$(ANDROID_TOOLCHAIN)/bin/*-ar" \ - RANLIB="$(ANDROID_TOOLCHAIN)/bin/*-ranlib" \ - CC="$(ANDROID_TOOLCHAIN)/bin/*-gcc" \ - LD="$(ANDROID_TOOLCHAIN)/bin/*-ld" \ - LINK="$(ANDROID_TOOLCHAIN)/bin/*-g++" \ - BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ - python -c "print raw_input().capitalize()") \ - builddir="$(shell pwd)/$(OUTDIR)/$@" + CXX="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-g++" \ + AR="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-ar" \ + RANLIB="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-ranlib" \ + CC="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-gcc" \ + LD="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-ld" \ + LINK="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-g++" \ + BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ + python -c "print raw_input().capitalize()") \ + builddir="$(shell pwd)/$(OUTDIR)/$@" # Android GYP file generation targets. ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_BUILDS)) $(ANDROID_MAKEFILES): GYP_GENERATORS=make-android \ GYP_DEFINES="${DEFINES}" \ - CC="${ANDROID_TOOLCHAIN}/bin/*-gcc" \ - CXX="${ANDROID_TOOLCHAIN}/bin/*-g++" \ + CC="${ANDROID_TOOLCHAIN}/bin/${TOOLCHAIN_PREFIX}-gcc" \ + CXX="${ANDROID_TOOLCHAIN}/bin/${TOOLCHAIN_PREFIX}-g++" \ PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \ build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \ diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py index fe15157dde..4f7a960097 100644 --- a/deps/v8/PRESUBMIT.py +++ b/deps/v8/PRESUBMIT.py @@ -98,3 +98,12 @@ def CheckChangeOnCommit(input_api, output_api): input_api, output_api, json_url='http://v8-status.appspot.com/current?format=json')) return results + + +def GetPreferredTryMasters(project, change): + return { + 'tryserver.v8': { + 'v8_mac_rel': set(['defaulttests']), + 'v8_win_rel': set(['defaulttests']), + }, + } diff --git a/deps/v8/build/all.gyp b/deps/v8/build/all.gyp index 5fbd8c28e7..3860379ea9 100644 --- a/deps/v8/build/all.gyp +++ b/deps/v8/build/all.gyp @@ -16,6 +16,7 @@ ['component!="shared_library"', { 'dependencies': [ '../tools/lexer-shell.gyp:lexer-shell', + '../tools/lexer-shell.gyp:parser-shell', ], }], ] diff --git a/deps/v8/build/android.gypi b/deps/v8/build/android.gypi index 0ea899d6ed..9570f444f9 100644 --- a/deps/v8/build/android.gypi +++ b/deps/v8/build/android.gypi @@ -184,6 +184,16 @@ '-L<(android_stlport_libs)/x86', ], }], + ['target_arch=="x64"', { + 'ldflags': [ + '-L<(android_stlport_libs)/x86_64', + ], + }], + ['target_arch=="arm64"', { + 'ldflags': [ + '-L<(android_stlport_libs)/arm64-v8a', + ], + }], ], }], ['target_arch=="ia32"', { @@ -208,10 +218,19 @@ ], 'target_conditions': [ ['_type=="executable"', { + 'conditions': [ + ['target_arch=="arm64"', { + 'ldflags': [ + '-Wl,-dynamic-linker,/system/bin/linker64', + ], + }, { + 'ldflags': [ + '-Wl,-dynamic-linker,/system/bin/linker', + ], + }] + ], 'ldflags': [ '-Bdynamic', - '-Wl,-dynamic-linker,/system/bin/linker', - '-Wl,--gc-sections', '-Wl,-z,nocopyreloc', # crtbegin_dynamic.o should be the last item in ldflags. '<(android_lib)/crtbegin_dynamic.o', @@ -238,8 +257,15 @@ }], # _toolset=="target" # Settings for building host targets using the system toolchain. ['_toolset=="host"', { - 'cflags': [ '-m32', '-pthread' ], - 'ldflags': [ '-m32', '-pthread' ], + 'conditions': [ + ['target_arch=="x64"', { + 'cflags': [ '-m64', '-pthread' ], + 'ldflags': [ '-m64', '-pthread' ], + }, { + 'cflags': [ '-m32', '-pthread' ], + 'ldflags': [ '-m32', '-pthread' ], + }], + ], 'ldflags!': [ '-Wl,-z,noexecstack', '-Wl,--gc-sections', diff --git a/deps/v8/build/features.gypi b/deps/v8/build/features.gypi index f0e7212096..85b8a38465 100644 --- a/deps/v8/build/features.gypi +++ b/deps/v8/build/features.gypi @@ -115,7 +115,7 @@ 'Release': { 'variables': { 'v8_enable_extra_checks%': 0, - 'v8_enable_handle_zapping%': 0, + 'v8_enable_handle_zapping%': 1, }, 'conditions': [ ['v8_enable_extra_checks==1', { diff --git a/deps/v8/build/standalone.gypi b/deps/v8/build/standalone.gypi index bcfce39ada..6ff0170b9c 100644 --- a/deps/v8/build/standalone.gypi +++ b/deps/v8/build/standalone.gypi @@ -34,6 +34,7 @@ 'variables': { 'component%': 'static_library', 'clang%': 0, + 'asan%': 0, 'visibility%': 'hidden', 'v8_enable_backtrace%': 0, 'v8_enable_i18n_support%': 1, @@ -52,7 +53,11 @@ # to gyp. 'host_arch%': ' /dev/null 2>&1 < /dev/null) && echo "-m64" || true)', }, - 'cflags': [ '<(m64flag)' ], - 'ldflags': [ '<(m64flag)' ], + 'conditions': [ + ['((OS!="android" and OS!="qnx") or clang==1)', { + 'cflags': [ '<(m64flag)' ], + 'ldflags': [ '<(m64flag)' ], + }], + ], }] ], }], @@ -513,7 +523,8 @@ OS=="qnx"', { 'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter', '-Wnon-virtual-dtor', '-Woverloaded-virtual', - '<(wno_array_bounds)' ], + '<(wno_array_bounds)', + ], 'conditions': [ ['v8_optimized_debug==0', { 'cflags!': [ diff --git a/deps/v8/include/v8-debug.h b/deps/v8/include/v8-debug.h old mode 100755 new mode 100644 diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 46752e968d..1691f29739 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -35,6 +35,9 @@ */ namespace v8 { +class HeapGraphNode; +struct HeapStatsUpdate; + typedef uint32_t SnapshotObjectId; /** @@ -158,12 +161,18 @@ class V8_EXPORT CpuProfiler { * |record_samples| parameter controls whether individual samples should * be recorded in addition to the aggregated tree. */ + void StartProfiling(Handle title, bool record_samples = false); + + /** Deprecated. Use StartProfiling instead. */ void StartCpuProfiling(Handle title, bool record_samples = false); /** * Stops collecting CPU profile with a given title and returns it. * If the title given is empty, finishes the last profile started. */ + CpuProfile* StopProfiling(Handle title); + + /** Deprecated. Use StopProfiling instead. */ const CpuProfile* StopCpuProfiling(Handle title); /** @@ -179,9 +188,6 @@ class V8_EXPORT CpuProfiler { }; -class HeapGraphNode; - - /** * HeapSnapshotEdge represents a directed connection between heap * graph nodes: from retainers to retained nodes. @@ -257,7 +263,11 @@ class V8_EXPORT HeapGraphNode { SnapshotObjectId GetId() const; /** Returns node's own size, in bytes. */ - int GetSelfSize() const; + V8_DEPRECATED("Use GetShallowSize instead", + int GetSelfSize() const); + + /** Returns node's own size, in bytes. */ + size_t GetShallowSize() const; /** Returns child nodes count of the node. */ int GetChildrenCount() const; @@ -267,6 +277,37 @@ class V8_EXPORT HeapGraphNode { }; +/** + * An interface for exporting data from V8, using "push" model. + */ +class V8_EXPORT OutputStream { // NOLINT + public: + enum WriteResult { + kContinue = 0, + kAbort = 1 + }; + virtual ~OutputStream() {} + /** Notify about the end of stream. */ + virtual void EndOfStream() = 0; + /** Get preferred output chunk size. Called only once. */ + virtual int GetChunkSize() { return 1024; } + /** + * Writes the next chunk of snapshot data into the stream. Writing + * can be stopped by returning kAbort as function result. EndOfStream + * will not be called in case writing was aborted. + */ + virtual WriteResult WriteAsciiChunk(char* data, int size) = 0; + /** + * Writes the next chunk of heap stats data into the stream. Writing + * can be stopped by returning kAbort as function result. EndOfStream + * will not be called in case writing was aborted. + */ + virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate* data, int count) { + return kAbort; + }; +}; + + /** * HeapSnapshots record the state of the JS heap at some moment. */ @@ -334,7 +375,24 @@ class V8_EXPORT HeapSnapshot { }; -class RetainedObjectInfo; +/** + * An interface for reporting progress and controlling long-running + * activities. + */ +class V8_EXPORT ActivityControl { // NOLINT + public: + enum ControlOption { + kContinue = 0, + kAbort = 1 + }; + virtual ~ActivityControl() {} + /** + * Notify about current progress. The activity can be stopped by + * returning kAbort as the callback result. + */ + virtual ControlOption ReportProgressValue(int done, int total) = 0; +}; + /** * Interface for controlling heap profiling. Instance of the diff --git a/deps/v8/include/v8-util.h b/deps/v8/include/v8-util.h new file mode 100644 index 0000000000..3f8cc6d269 --- /dev/null +++ b/deps/v8/include/v8-util.h @@ -0,0 +1,355 @@ +// Copyright 2014 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef V8_UTIL_H_ +#define V8_UTIL_H_ + +#include "v8.h" +#include + +/** + * Support for Persistent containers. + * + * C++11 embedders can use STL containers with UniquePersistent values, + * but pre-C++11 does not support the required move semantic and hence + * may want these container classes. + */ +namespace v8 { + +typedef uintptr_t PersistentContainerValue; +static const uintptr_t kPersistentContainerNotFound = 0; + + +/** + * A default trait implemenation for PersistentValueMap which uses std::map + * as a backing map. + * + * Users will have to implement their own weak callbacks & dispose traits. + */ +template +class StdMapTraits { + public: + // STL map & related: + typedef std::map Impl; + typedef typename Impl::iterator Iterator; + + static bool Empty(Impl* impl) { return impl->empty(); } + static size_t Size(Impl* impl) { return impl->size(); } + static void Swap(Impl& a, Impl& b) { std::swap(a, b); } // NOLINT + static Iterator Begin(Impl* impl) { return impl->begin(); } + static Iterator End(Impl* impl) { return impl->end(); } + static K Key(Iterator it) { return it->first; } + static PersistentContainerValue Value(Iterator it) { return it->second; } + static PersistentContainerValue Set(Impl* impl, K key, + PersistentContainerValue value) { + std::pair res = impl->insert(std::make_pair(key, value)); + PersistentContainerValue old_value = kPersistentContainerNotFound; + if (!res.second) { + old_value = res.first->second; + res.first->second = value; + } + return old_value; + } + static PersistentContainerValue Get(Impl* impl, K key) { + Iterator it = impl->find(key); + if (it == impl->end()) return kPersistentContainerNotFound; + return it->second; + } + static PersistentContainerValue Remove(Impl* impl, K key) { + Iterator it = impl->find(key); + if (it == impl->end()) return kPersistentContainerNotFound; + PersistentContainerValue value = it->second; + impl->erase(it); + return value; + } +}; + + +/** + * A default trait implementation for PersistentValueMap, which inherits + * a std:map backing map from StdMapTraits and holds non-weak persistent + * objects. + * + * Users have to implement their own dispose trait. + */ +template +class StrongMapTraits : public StdMapTraits { + public: + // Weak callback & friends: + static const bool kIsWeak = false; + typedef typename StdMapTraits::Impl Impl; + typedef void WeakCallbackDataType; + static WeakCallbackDataType* WeakCallbackParameter( + Impl* impl, const K& key, Local value); + static Impl* ImplFromWeakCallbackData( + const WeakCallbackData& data); + static K KeyFromWeakCallbackData( + const WeakCallbackData& data); + static void DisposeCallbackData(WeakCallbackDataType* data); +}; + + +/** + * A default trait implementation for PersistentValueMap, with a std::map + * backing map, non-weak persistents as values, and no special dispose + * handling. Can be used as-is. + */ +template +class DefaultPersistentValueMapTraits : public StrongMapTraits { + public: + typedef typename StrongMapTraits::Impl Impl; + static void Dispose(Isolate* isolate, UniquePersistent value, + Impl* impl, K key) { } +}; + + +/** + * A map wrapper that allows using UniquePersistent as a mapped value. + * C++11 embedders don't need this class, as they can use UniquePersistent + * directly in std containers. + * + * The map relies on a backing map, whose type and accessors are described + * by the Traits class. The backing map will handle values of type + * PersistentContainerValue, with all conversion into and out of V8 + * handles being transparently handled by this class. + */ +template +class PersistentValueMap { + public: + V8_INLINE explicit PersistentValueMap(Isolate* isolate) : isolate_(isolate) {} + + V8_INLINE ~PersistentValueMap() { Clear(); } + + V8_INLINE Isolate* GetIsolate() { return isolate_; } + + /** + * Return size of the map. + */ + V8_INLINE size_t Size() { return Traits::Size(&impl_); } + + /** + * Return whether the map holds weak persistents. + */ + V8_INLINE bool IsWeak() { return Traits::kIsWeak; } + + /** + * Get value stored in map. + */ + V8_INLINE Local Get(const K& key) { + return Local::New(isolate_, FromVal(Traits::Get(&impl_, key))); + } + + /** + * Check whether a value is contained in the map. + */ + V8_INLINE bool Contains(const K& key) { + return Traits::Get(&impl_, key) != 0; + } + + /** + * Get value stored in map and set it in returnValue. + * Return true if a value was found. + */ + V8_INLINE bool SetReturnValue(const K& key, + ReturnValue& returnValue) { + PersistentContainerValue value = Traits::Get(&impl_, key); + bool hasValue = value != 0; + if (hasValue) { + returnValue.SetInternal( + *reinterpret_cast(FromVal(value))); + } + return hasValue; + } + + /** + * Call Isolate::SetReference with the given parent and the map value. + */ + V8_INLINE void SetReference(const K& key, + const Persistent& parent) { + GetIsolate()->SetReference( + reinterpret_cast(parent.val_), + reinterpret_cast(FromVal(Traits::Get(&impl_, key)))); + } + + /** + * Put value into map. Depending on Traits::kIsWeak, the value will be held + * by the map strongly or weakly. + * Returns old value as UniquePersistent. + */ + UniquePersistent Set(const K& key, Local value) { + UniquePersistent persistent(isolate_, value); + return SetUnique(key, &persistent); + } + + /** + * Put value into map, like Set(const K&, Local). + */ + UniquePersistent Set(const K& key, UniquePersistent value) { + return SetUnique(key, &value); + } + + /** + * Return value for key and remove it from the map. + */ + V8_INLINE UniquePersistent Remove(const K& key) { + return Release(Traits::Remove(&impl_, key)).Pass(); + } + + /** + * Traverses the map repeatedly, + * in case side effects of disposal cause insertions. + **/ + void Clear() { + typedef typename Traits::Iterator It; + HandleScope handle_scope(isolate_); + // TODO(dcarney): figure out if this swap and loop is necessary. + while (!Traits::Empty(&impl_)) { + typename Traits::Impl impl; + Traits::Swap(impl_, impl); + for (It i = Traits::Begin(&impl); i != Traits::End(&impl); ++i) { + Traits::Dispose(isolate_, Release(Traits::Value(i)).Pass(), &impl, + Traits::Key(i)); + } + } + } + + private: + PersistentValueMap(PersistentValueMap&); + void operator=(PersistentValueMap&); + + /** + * Put the value into the map, and set the 'weak' callback when demanded + * by the Traits class. + */ + UniquePersistent SetUnique(const K& key, UniquePersistent* persistent) { + if (Traits::kIsWeak) { + Local value(Local::New(isolate_, *persistent)); + persistent->template SetWeak( + Traits::WeakCallbackParameter(&impl_, key, value), WeakCallback); + } + PersistentContainerValue old_value = + Traits::Set(&impl_, key, ClearAndLeak(persistent)); + return Release(old_value).Pass(); + } + + static void WeakCallback( + const WeakCallbackData& data) { + if (Traits::kIsWeak) { + typename Traits::Impl* impl = Traits::ImplFromWeakCallbackData(data); + K key = Traits::KeyFromWeakCallbackData(data); + PersistentContainerValue value = Traits::Remove(impl, key); + Traits::Dispose(data.GetIsolate(), Release(value).Pass(), impl, key); + } + } + + V8_INLINE static V* FromVal(PersistentContainerValue v) { + return reinterpret_cast(v); + } + + V8_INLINE static PersistentContainerValue ClearAndLeak( + UniquePersistent* persistent) { + V* v = persistent->val_; + persistent->val_ = 0; + return reinterpret_cast(v); + } + + /** + * Return a container value as UniquePersistent and make sure the weak + * callback is properly disposed of. All remove functionality should go + * through this. + */ + V8_INLINE static UniquePersistent Release(PersistentContainerValue v) { + UniquePersistent p; + p.val_ = FromVal(v); + if (Traits::kIsWeak && !p.IsEmpty()) { + Traits::DisposeCallbackData( + p.template ClearWeak()); + } + return p.Pass(); + } + + Isolate* isolate_; + typename Traits::Impl impl_; +}; + + +/** + * A map that uses UniquePersistent as value and std::map as the backing + * implementation. Persistents are held non-weak. + * + * C++11 embedders don't need this class, as they can use + * UniquePersistent directly in std containers. + */ +template > +class StdPersistentValueMap : public PersistentValueMap { + public: + explicit StdPersistentValueMap(Isolate* isolate) + : PersistentValueMap(isolate) {} +}; + + +/** + * Empty default implementations for StrongTraits methods. + * + * These should not be necessary, since they're only used in code that + * is surrounded by if(Traits::kIsWeak), which for StrongMapTraits is + * compile-time false. Most compilers can live without them; however + * the compiler we use from 64-bit Win differs. + * + * TODO(vogelheim): Remove these once they're no longer necessary. + */ +template +typename StrongMapTraits::WeakCallbackDataType* + StrongMapTraits::WeakCallbackParameter( + Impl* impl, const K& key, Local value) { + return NULL; +} + + +template +typename StrongMapTraits::Impl* + StrongMapTraits::ImplFromWeakCallbackData( + const WeakCallbackData& data) { + return NULL; +} + + +template +K StrongMapTraits::KeyFromWeakCallbackData( + const WeakCallbackData& data) { + return K(); +} + + +template +void StrongMapTraits::DisposeCallbackData(WeakCallbackDataType* data) { +} + +} // namespace v8 + +#endif // V8_UTIL_H_ diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index fe3b020417..608e3c52c3 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -108,6 +108,7 @@ class ObjectTemplate; class Platform; class Primitive; class RawOperationDescriptor; +class Script; class Signature; class StackFrame; class StackTrace; @@ -127,10 +128,12 @@ template class PersistentBase; template > class Persistent; template class UniquePersistent; +template class PersistentValueMap; template class WeakCallbackObject; class FunctionTemplate; class ObjectTemplate; class Data; +template class FunctionCallbackInfo; template class PropertyCallbackInfo; class StackTrace; class StackFrame; @@ -140,6 +143,7 @@ class ObjectOperationDescriptor; class RawOperationDescriptor; class CallHandlerHelper; class EscapableHandleScope; +template class ReturnValue; namespace internal { class Arguments; @@ -412,6 +416,7 @@ template class Local : public Handle { template friend class internal::CustomArguments; friend class HandleScope; friend class EscapableHandleScope; + template friend class PersistentValueMap; V8_INLINE static Local New(Isolate* isolate, T* that); }; @@ -527,7 +532,11 @@ template class PersistentBase { P* parameter, typename WeakCallbackData::Callback callback); - V8_INLINE void ClearWeak(); + template + V8_INLINE P* ClearWeak(); + + // TODO(dcarney): remove this. + V8_INLINE void ClearWeak() { ClearWeak(); } /** * Marks the reference to this object independent. Garbage collector is free @@ -576,6 +585,8 @@ template class PersistentBase { template friend class UniquePersistent; template friend class PersistentBase; template friend class ReturnValue; + template friend class PersistentValueMap; + friend class Object; explicit V8_INLINE PersistentBase(T* val) : val_(val) {} PersistentBase(PersistentBase& other); // NOLINT @@ -743,7 +754,7 @@ class UniquePersistent : public PersistentBase { }; public: - /** + /** * A UniquePersistent with no storage cell. */ V8_INLINE UniquePersistent() : PersistentBase(0) { } @@ -781,6 +792,7 @@ class UniquePersistent : public PersistentBase { template V8_INLINE UniquePersistent& operator=(UniquePersistent rhs) { TYPE_CHECK(T, S); + this->Reset(); this->val_ = rhs.val_; rhs.val_ = 0; return *this; @@ -998,114 +1010,188 @@ class ScriptOrigin { /** - * A compiled JavaScript script. + * A compiled JavaScript script, not yet tied to a Context. */ -class V8_EXPORT Script { +class V8_EXPORT UnboundScript { public: /** - * Compiles the specified script (context-independent). - * - * \param source Script source code. - * \param origin Script origin, owned by caller, no references are kept - * when New() returns - * \param pre_data Pre-parsing data, as obtained by ScriptData::PreCompile() - * using pre_data speeds compilation if it's done multiple times. - * Owned by caller, no references are kept when New() returns. - * \param script_data Arbitrary data associated with script. Using - * this has same effect as calling SetData(), but allows data to be - * available to compile event handlers. - * \return Compiled script object (context independent; when run it - * will use the currently entered context). + * Binds the script to the currently entered context. */ - static Local + +Dump %(dump_name)s + + + +
+ + +
+
+
+""" + + +WEB_FOOTER = """ + + +""" + + +class WebParameterError(Exception): + def __init__(self, message): + Exception.__init__(self, message) + + +class InspectionWebHandler(BaseHTTPServer.BaseHTTPRequestHandler): + def formatter(self, query_components): + name = query_components.get("dump", [None])[0] + return self.server.get_dump_formatter(name) + + def send_success_html_headers(self): + self.send_response(200) + self.send_header("Cache-Control", "no-cache, no-store, must-revalidate") + self.send_header("Pragma", "no-cache") + self.send_header("Expires", "0") + self.send_header('Content-type','text/html') + self.end_headers() + return + + def do_GET(self): + try: + parsedurl = urlparse.urlparse(self.path) + query_components = urlparse.parse_qs(parsedurl.query) + if parsedurl.path == "/dumps.html": + self.send_success_html_headers() + self.server.output_dumps(self.wfile) + elif parsedurl.path == "/summary.html": + self.send_success_html_headers() + self.formatter(query_components).output_summary(self.wfile) + elif parsedurl.path == "/info.html": + self.send_success_html_headers() + self.formatter(query_components).output_info(self.wfile) + elif parsedurl.path == "/modules.html": + self.send_success_html_headers() + self.formatter(query_components).output_modules(self.wfile) + elif parsedurl.path == "/search.html": + address = query_components.get("val", []) + if len(address) != 1: + self.send_error(404, "Invalid params") + return + self.send_success_html_headers() + self.formatter(query_components).output_search_res( + self.wfile, address[0]) + elif parsedurl.path == "/disasm.html": + address = query_components.get("val", []) + exact = query_components.get("exact", ["on"]) + if len(address) != 1: + self.send_error(404, "Invalid params") + return + self.send_success_html_headers() + self.formatter(query_components).output_disasm( + self.wfile, address[0], exact[0]) + elif parsedurl.path == "/data.html": + address = query_components.get("val", []) + datakind = query_components.get("type", ["address"]) + if len(address) == 1 and len(datakind) == 1: + self.send_success_html_headers() + self.formatter(query_components).output_data( + self.wfile, address[0], datakind[0]) + else: + self.send_error(404,'Invalid params') + elif parsedurl.path == "/setdumpdesc": + name = query_components.get("dump", [""]) + description = query_components.get("description", [""]) + if len(name) == 1 and len(description) == 1: + name = name[0] + description = description[0] + if self.server.set_dump_desc(name, description): + self.send_success_html_headers() + self.wfile.write("OK") + return + self.send_error(404,'Invalid params') + elif parsedurl.path == "/setcomment": + address = query_components.get("address", []) + comment = query_components.get("comment", [""]) + if len(address) == 1 and len(comment) == 1: + address = address[0] + comment = comment[0] + self.formatter(query_components).set_comment(address, comment) + self.send_success_html_headers() + self.wfile.write("OK") + else: + self.send_error(404,'Invalid params') + elif parsedurl.path == "/setpageaddress": + kind = query_components.get("kind", []) + address = query_components.get("address", [""]) + if len(kind) == 1 and len(address) == 1: + kind = kind[0] + address = address[0] + self.formatter(query_components).set_page_address(kind, address) + self.send_success_html_headers() + self.wfile.write("OK") + else: + self.send_error(404,'Invalid params') + else: + self.send_error(404,'File Not Found: %s' % self.path) + + except IOError: + self.send_error(404,'File Not Found: %s' % self.path) + + except WebParameterError as e: + self.send_error(404, 'Web parameter error: %s' % e.message) + + +HTML_REG_FORMAT = "%s: %s\n" + + +class InspectionWebFormatter(object): + CONTEXT_FULL = 0 + CONTEXT_SHORT = 1 + + def __init__(self, switches, minidump_name, http_server): + self.dumpfilename = os.path.split(minidump_name)[1] + self.encfilename = urllib.urlencode({ 'dump' : self.dumpfilename }) + self.reader = MinidumpReader(switches, minidump_name) + self.server = http_server + + # Set up the heap + exception_thread = self.reader.thread_map[self.reader.exception.thread_id] + stack_top = self.reader.ExceptionSP() + stack_bottom = exception_thread.stack.start + \ + exception_thread.stack.memory.data_size + stack_map = {self.reader.ExceptionIP(): -1} + for slot in xrange(stack_top, stack_bottom, self.reader.PointerSize()): + maybe_address = self.reader.ReadUIntPtr(slot) + if not maybe_address in stack_map: + stack_map[maybe_address] = slot + self.heap = V8Heap(self.reader, stack_map) + + self.padawan = InspectionPadawan(self.reader, self.heap) + self.comments = InspectionInfo(minidump_name, self.reader) + self.padawan.known_first_data_page = ( + self.comments.get_page_address("datapage")) + self.padawan.known_first_map_page = ( + self.comments.get_page_address("mappage")) + self.padawan.known_first_pointer_page = ( + self.comments.get_page_address("pointerpage")) + + def set_comment(self, straddress, comment): + try: + address = int(straddress, 0) + self.comments.set_comment(address, comment) + except ValueError: + print "Invalid address" + + def set_page_address(self, kind, straddress): + try: + address = int(straddress, 0) + if kind == "datapage": + self.padawan.known_first_data_page = address + elif kind == "mappage": + self.padawan.known_first_map_page = address + elif kind == "pointerpage": + self.padawan.known_first_pointer_page = address + self.comments.save_page_address(kind, address) + except ValueError: + print "Invalid address" + + def td_from_address(self, f, address): + f.write("" % self.comments.get_style_class_string(address)) + + def format_address(self, maybeaddress, straddress = None): + if maybeaddress is None: + return "not in dump" + else: + if straddress is None: + straddress = "0x" + self.reader.FormatIntPtr(maybeaddress) + style_class = "" + if not self.reader.IsValidAddress(maybeaddress): + style_class = " class=\"nodump\"" + return ("%s" % + (style_class, self.encfilename, straddress, straddress)) + + def output_header(self, f): + f.write(WEB_HEADER % + { "query_dump" : self.encfilename, + "dump_name" : cgi.escape(self.dumpfilename) }) + + def output_footer(self, f): + f.write(WEB_FOOTER) + + MAX_CONTEXT_STACK = 4096 + + def output_summary(self, f): + self.output_header(f) + f.write('
') + self.output_context(f, InspectionWebFormatter.CONTEXT_SHORT) + self.output_disasm_pc(f) + + # Output stack + exception_thread = self.reader.thread_map[self.reader.exception.thread_id] + stack_bottom = exception_thread.stack.start + \ + min(exception_thread.stack.memory.data_size, self.MAX_CONTEXT_STACK) + stack_top = self.reader.ExceptionSP() + self.output_words(f, stack_top - 16, stack_bottom, stack_top, "Stack") + + f.write('
') + self.output_footer(f) + return + + def output_info(self, f): + self.output_header(f) + f.write("

Dump info

\n") + f.write("Description: ") + self.server.output_dump_desc_field(f, self.dumpfilename) + f.write("
\n") + f.write("Filename: ") + f.write("%s
\n" % (self.dumpfilename)) + dt = datetime.datetime.fromtimestamp(self.reader.header.time_date_stampt) + f.write("Timestamp: %s
\n" % dt.strftime('%Y-%m-%d %H:%M:%S')) + self.output_context(f, InspectionWebFormatter.CONTEXT_FULL) + self.output_address_ranges(f) + self.output_footer(f) + return + + def output_address_ranges(self, f): + regions = {} + def print_region(_reader, start, size, _location): + regions[start] = size + self.reader.ForEachMemoryRegion(print_region) + f.write("

Available memory regions

\n") + f.write('
') + f.write("\n") + f.write("") + f.write("") + f.write("") + f.write("") + f.write("\n") + for start in sorted(regions): + size = regions[start] + f.write("") + f.write("" % self.format_address(start)) + f.write("" % self.format_address(start + size)) + f.write("" % size) + f.write("\n") + f.write("
Start addressEnd addressNumber of bytes
%s %s %d
\n") + f.write('
') + return + + def output_module_details(self, f, module): + f.write("%s" % GetModuleName(self.reader, module)) + file_version = GetVersionString(module.version_info.dwFileVersionMS, + module.version_info.dwFileVersionLS) + product_version = GetVersionString(module.version_info.dwProductVersionMS, + module.version_info.dwProductVersionLS) + f.write("
  \n") + f.write("base: %s" % self.reader.FormatIntPtr(module.base_of_image)) + f.write("
  \n") + f.write(" end: %s" % self.reader.FormatIntPtr(module.base_of_image + + module.size_of_image)) + f.write("
  \n") + f.write(" file version: %s" % file_version) + f.write("
  \n") + f.write(" product version: %s" % product_version) + f.write("
  \n") + time_date_stamp = datetime.datetime.fromtimestamp(module.time_date_stamp) + f.write(" timestamp: %s" % time_date_stamp) + f.write("
\n"); + + def output_modules(self, f): + self.output_header(f) + f.write('
') + for module in self.reader.module_list.modules: + self.output_module_details(f, module) + f.write("
") + self.output_footer(f) + return + + def output_context(self, f, details): + exception_thread = self.reader.thread_map[self.reader.exception.thread_id] + f.write("

Exception context

") + f.write('
\n') + f.write("Thread id: %d" % exception_thread.id) + f.write("   Exception code: %08X\n" % + self.reader.exception.exception.code) + if details == InspectionWebFormatter.CONTEXT_FULL: + if self.reader.exception.exception.parameter_count > 0: + f.write("   Exception parameters: \n") + for i in xrange(0, self.reader.exception.exception.parameter_count): + f.write("%08x" % self.reader.exception.exception.information[i]) + f.write("

\n") + + for r in CONTEXT_FOR_ARCH[self.reader.arch]: + f.write(HTML_REG_FORMAT % + (r, self.format_address(self.reader.Register(r)))) + # TODO(vitalyr): decode eflags. + if self.reader.arch == MD_CPU_ARCHITECTURE_ARM: + f.write("cpsr: %s" % bin(self.reader.exception_context.cpsr)[2:]) + else: + f.write("eflags: %s" % + bin(self.reader.exception_context.eflags)[2:]) + f.write('
\n') + return + + def align_down(self, a, size): + alignment_correction = a % size + return a - alignment_correction + + def align_up(self, a, size): + alignment_correction = (size - 1) - ((a + size - 1) % size) + return a + alignment_correction + + def format_object(self, address): + heap_object = self.padawan.SenseObject(address) + return cgi.escape(str(heap_object or "")) + + def output_data(self, f, straddress, datakind): + try: + self.output_header(f) + address = int(straddress, 0) + if not self.reader.IsValidAddress(address): + f.write("

Address 0x%x not found in the dump.

" % address) + return + region = self.reader.FindRegion(address) + if datakind == "address": + self.output_words(f, region[0], region[0] + region[1], address, "Dump") + elif datakind == "ascii": + self.output_ascii(f, region[0], region[0] + region[1], address) + self.output_footer(f) + + except ValueError: + f.write("

Unrecognized address format \"%s\".

" % straddress) + return + + def output_words(self, f, start_address, end_address, + highlight_address, desc): + region = self.reader.FindRegion(highlight_address) + if region is None: + f.write("

Address 0x%x not found in the dump.

\n" % + (highlight_address)) + return + size = self.heap.PointerSize() + start_address = self.align_down(start_address, size) + low = self.align_down(region[0], size) + high = self.align_up(region[0] + region[1], size) + if start_address < low: + start_address = low + end_address = self.align_up(end_address, size) + if end_address > high: + end_address = high + + expand = "" + if start_address != low or end_address != high: + expand = ("(" + " more..." + " )" % + (self.encfilename, highlight_address)) + + f.write("

%s 0x%x - 0x%x, " + "highlighting 0x%x %s

\n" % + (desc, start_address, end_address, highlight_address, expand)) + f.write('
') + f.write("\n") + + for slot in xrange(start_address, end_address, size): + heap_object = "" + maybe_address = None + end_region = region[0] + region[1] + if slot < region[0] or slot + size > end_region: + straddress = "0x" + for i in xrange(end_region, slot + size): + straddress += "??" + for i in reversed( + xrange(max(slot, region[0]), min(slot + size, end_region))): + straddress += "%02x" % self.reader.ReadU8(i) + for i in xrange(slot, region[0]): + straddress += "??" + else: + maybe_address = self.reader.ReadUIntPtr(slot) + straddress = self.format_address(maybe_address) + if maybe_address: + heap_object = self.format_object(maybe_address) + + address_fmt = "%s \n" + if slot == highlight_address: + f.write("\n") + address_fmt = "%s \n" + elif slot < highlight_address and highlight_address < slot + size: + f.write("\n") + address_fmt = "%s \n" + else: + f.write("\n") + + f.write(" \n") + f.write(" ") + self.td_from_address(f, slot) + f.write(address_fmt % self.format_address(slot)) + f.write(" ") + self.td_from_address(f, maybe_address) + f.write(":  %s  \n" % straddress) + f.write(" \n") + f.write(" \n" % (heap_object or '')) + f.write("\n") + f.write("
") + self.output_comment_box(f, "da-", slot) + f.write("") + if maybe_address != None: + self.output_comment_box( + f, "sv-" + self.reader.FormatIntPtr(slot), maybe_address) + f.write(" %s
\n") + f.write("
") + return + + def output_ascii(self, f, start_address, end_address, highlight_address): + region = self.reader.FindRegion(highlight_address) + if region is None: + f.write("

Address %x not found in the dump.

" % + highlight_address) + return + if start_address < region[0]: + start_address = region[0] + if end_address > region[0] + region[1]: + end_address = region[0] + region[1] + + expand = "" + if start_address != region[0] or end_address != region[0] + region[1]: + link = ("data.html?%s&val=0x%x&type=ascii#highlight" % + (self.encfilename, highlight_address)) + expand = "(more...)" % link + + f.write("

ASCII dump 0x%x - 0x%x, highlighting 0x%x %s

" % + (start_address, end_address, highlight_address, expand)) + + line_width = 64 + + f.write('
') + + start = self.align_down(start_address, line_width) + + for address in xrange(start, end_address): + if address % 64 == 0: + if address != start: + f.write("
") + f.write("0x%08x: " % address) + if address < start_address: + f.write(" ") + else: + if address == highlight_address: + f.write("") + code = self.reader.ReadU8(address) + if code < 127 and code >= 32: + f.write("&#") + f.write(str(code)) + f.write(";") + else: + f.write("·") + if address == highlight_address: + f.write("") + f.write("
") + return + + def output_disasm(self, f, straddress, strexact): + try: + self.output_header(f) + address = int(straddress, 0) + if not self.reader.IsValidAddress(address): + f.write("

Address 0x%x not found in the dump.

" % address) + return + region = self.reader.FindRegion(address) + self.output_disasm_range( + f, region[0], region[0] + region[1], address, strexact == "on") + self.output_footer(f) + except ValueError: + f.write("

Unrecognized address format \"%s\".

" % straddress) + return + + def output_disasm_range( + self, f, start_address, end_address, highlight_address, exact): + region = self.reader.FindRegion(highlight_address) + if start_address < region[0]: + start_address = region[0] + if end_address > region[0] + region[1]: + end_address = region[0] + region[1] + count = end_address - start_address + lines = self.reader.GetDisasmLines(start_address, count) + found = False + if exact: + for line in lines: + if line[0] + start_address == highlight_address: + found = True + break + if not found: + start_address = highlight_address + count = end_address - start_address + lines = self.reader.GetDisasmLines(highlight_address, count) + expand = "" + if start_address != region[0] or end_address != region[0] + region[1]: + exactness = "" + if exact and not found and end_address == region[0] + region[1]: + exactness = "&exact=off" + expand = ("(more...)" % + (self.encfilename, exactness, highlight_address)) + + f.write("

Disassembling 0x%x - 0x%x, highlighting 0x%x %s

" % + (start_address, end_address, highlight_address, expand)) + f.write('
') + f.write("\n"); + for i in xrange(0, len(lines)): + line = lines[i] + next_address = count + if i + 1 < len(lines): + next_line = lines[i + 1] + next_address = next_line[0] + self.format_disasm_line( + f, start_address, line, next_address, highlight_address) + f.write("
\n") + f.write("
") + return + + def annotate_disasm_addresses(self, line): + extra = [] + for m in ADDRESS_RE.finditer(line): + maybe_address = int(m.group(0), 16) + formatted_address = self.format_address(maybe_address, m.group(0)) + line = line.replace(m.group(0), formatted_address) + object_info = self.padawan.SenseObject(maybe_address) + if not object_info: + continue + extra.append(cgi.escape(str(object_info))) + if len(extra) == 0: + return line + return ("%s ;; %s" % + (line, ", ".join(extra))) + + def format_disasm_line( + self, f, start, line, next_address, highlight_address): + line_address = start + line[0] + address_fmt = " %s\n" + if line_address == highlight_address: + f.write("\n") + address_fmt = " %s\n" + elif (line_address < highlight_address and + highlight_address < next_address + start): + f.write("\n") + address_fmt = " %s\n" + else: + f.write("\n") + num_bytes = next_address - line[0] + stack_slot = self.heap.stack_map.get(line_address) + marker = "" + if stack_slot: + marker = "=>" + op_offset = 3 * num_bytes - 1 + + code = line[1] + # Compute the actual call target which the disassembler is too stupid + # to figure out (it adds the call offset to the disassembly offset rather + # than the absolute instruction address). + if self.heap.reader.arch == MD_CPU_ARCHITECTURE_X86: + if code.startswith("e8"): + words = code.split() + if len(words) > 6 and words[5] == "call": + offset = int(words[4] + words[3] + words[2] + words[1], 16) + target = (line_address + offset + 5) & 0xFFFFFFFF + code = code.replace(words[6], "0x%08x" % target) + # TODO(jkummerow): port this hack to ARM and x64. + + opcodes = code[:op_offset] + code = self.annotate_disasm_addresses(code[op_offset:]) + f.write(" ") + self.output_comment_box(f, "codel-", line_address) + f.write("\n") + f.write(address_fmt % marker) + f.write(" ") + self.td_from_address(f, line_address) + f.write("%s (+0x%x)\n" % + (self.format_address(line_address), line[0])) + f.write(" : %s \n" % opcodes) + f.write(" %s\n" % code) + f.write("\n") + + def output_comment_box(self, f, prefix, address): + f.write("" % + (prefix, + self.reader.FormatIntPtr(address), + cgi.escape(self.comments.get_comment(address)) or "")) + + MAX_FOUND_RESULTS = 100 + + def output_find_results(self, f, results): + f.write("Addresses") + toomany = len(results) > self.MAX_FOUND_RESULTS + if toomany: + f.write("(found %i results, displaying only first %i)" % + (len(results), self.MAX_FOUND_RESULTS)) + f.write(": \n") + results = sorted(results) + results = results[:min(len(results), self.MAX_FOUND_RESULTS)] + for address in results: + f.write("%s\n" % + (self.comments.get_style_class_string(address), + self.format_address(address))) + if toomany: + f.write("...\n") + + + def output_page_info(self, f, page_kind, page_address, my_page_address): + if my_page_address == page_address and page_address != 0: + f.write("Marked first %s page.\n" % page_kind) + else: + f.write("" % page_kind) + f.write("Marked first %s page." % page_kind) + f.write("\n") + f.write("\n" % page_kind) + return + + def output_search_res(self, f, straddress): + try: + self.output_header(f) + f.write("

Search results for %s

" % straddress) + + address = int(straddress, 0) + + f.write("Comment: ") + self.output_comment_box(f, "search-", address) + f.write("
\n") + + page_address = address & ~self.heap.PageAlignmentMask() + + f.write("Page info: \n") + self.output_page_info(f, "data", self.padawan.known_first_data_page, \ + page_address) + self.output_page_info(f, "map", self.padawan.known_first_map_page, \ + page_address) + self.output_page_info(f, "pointer", \ + self.padawan.known_first_pointer_page, \ + page_address) + + if not self.reader.IsValidAddress(address): + f.write("

The contents at address %s not found in the dump.

" % \ + straddress) + else: + # Print as words + self.output_words(f, address - 8, address + 32, address, "Dump") + + # Print as ASCII + f.write("
\n") + self.output_ascii(f, address, address + 256, address) + + # Print as code + f.write("
\n") + self.output_disasm_range(f, address - 16, address + 16, address, True) + + aligned_res, unaligned_res = self.reader.FindWordList(address) + + if len(aligned_res) > 0: + f.write("

Occurrences of 0x%x at aligned addresses

\n" % + address) + self.output_find_results(f, aligned_res) + + if len(unaligned_res) > 0: + f.write("

Occurrences of 0x%x at unaligned addresses

\n" % \ + address) + self.output_find_results(f, unaligned_res) + + if len(aligned_res) + len(unaligned_res) == 0: + f.write("

No occurences of 0x%x found in the dump

\n" % address) + + self.output_footer(f) + + except ValueError: + f.write("

Unrecognized address format \"%s\".

" % straddress) + return + + def output_disasm_pc(self, f): + address = self.reader.ExceptionIP() + if not self.reader.IsValidAddress(address): + return + self.output_disasm_range(f, address - 16, address + 16, address, True) + + +WEB_DUMPS_HEADER = """ + + + + + + + + +Dump list + + + +""" + +WEB_DUMPS_FOOTER = """ + + +""" + +DUMP_FILE_RE = re.compile(r"[-_0-9a-zA-Z][-\._0-9a-zA-Z]*\.dmp$") + + +class InspectionWebServer(BaseHTTPServer.HTTPServer): + def __init__(self, port_number, switches, minidump_name): + BaseHTTPServer.HTTPServer.__init__( + self, ('', port_number), InspectionWebHandler) + splitpath = os.path.split(minidump_name) + self.dumppath = splitpath[0] + self.dumpfilename = splitpath[1] + self.default_formatter = InspectionWebFormatter( + switches, minidump_name, self) + self.formatters = { self.dumpfilename : self.default_formatter } + self.switches = switches + + def output_dump_desc_field(self, f, name): + try: + descfile = open(os.path.join(self.dumppath, name + ".desc"), "r") + desc = descfile.readline() + descfile.close() + except IOError: + desc = "" + f.write("\n" % + (cgi.escape(name), desc)) + + def set_dump_desc(self, name, description): + if not DUMP_FILE_RE.match(name): + return False + fname = os.path.join(self.dumppath, name) + if not os.path.isfile(fname): + return False + fname = fname + ".desc" + descfile = open(fname, "w") + descfile.write(description) + descfile.close() + return True + + def get_dump_formatter(self, name): + if name is None: + return self.default_formatter + else: + if not DUMP_FILE_RE.match(name): + raise WebParameterError("Invalid name '%s'" % name) + formatter = self.formatters.get(name, None) + if formatter is None: + try: + formatter = InspectionWebFormatter( + self.switches, os.path.join(self.dumppath, name), self) + self.formatters[name] = formatter + except IOError: + raise WebParameterError("Could not open dump '%s'" % name) + return formatter + + def output_dumps(self, f): + f.write(WEB_DUMPS_HEADER) + f.write("

List of available dumps

") + f.write("\n") + f.write("") + f.write("") + f.write("") + f.write("") + f.write("") + dumps_by_time = {} + for fname in os.listdir(self.dumppath): + if DUMP_FILE_RE.match(fname): + mtime = os.stat(os.path.join(self.dumppath, fname)).st_mtime + fnames = dumps_by_time.get(mtime, []) + fnames.append(fname) + dumps_by_time[mtime] = fnames + + for mtime in sorted(dumps_by_time, reverse=True): + fnames = dumps_by_time[mtime] + for fname in fnames: + f.write("\n") + f.write("\n" % ( + (urllib.urlencode({ 'dump' : fname }), fname))) + f.write("") + f.write("") + f.write("\n") + f.write("
NameFile timeComment
%s   ") + f.write(datetime.datetime.fromtimestamp(mtime)) + f.write("   ") + self.output_dump_desc_field(f, fname) + f.write("
\n") + f.write(WEB_DUMPS_FOOTER) + return class InspectionShell(cmd.Cmd): def __init__(self, reader, heap): @@ -1996,6 +3123,8 @@ if __name__ == "__main__": parser = optparse.OptionParser(USAGE) parser.add_option("-s", "--shell", dest="shell", action="store_true", help="start an interactive inspector shell") + parser.add_option("-w", "--web", dest="web", action="store_true", + help="start a web server on localhost:%i" % PORT_NUMBER) parser.add_option("-c", "--command", dest="command", default="", help="run an interactive inspector shell command and exit") parser.add_option("-f", "--full", dest="full", action="store_true", @@ -2014,4 +3143,14 @@ if __name__ == "__main__": if len(args) != 1: parser.print_help() sys.exit(1) - AnalyzeMinidump(options, args[0]) + if options.web: + try: + server = InspectionWebServer(PORT_NUMBER, options, args[0]) + print 'Started httpserver on port ' , PORT_NUMBER + webbrowser.open('http://localhost:%i/summary.html' % PORT_NUMBER) + server.serve_forever() + except KeyboardInterrupt: + print '^C received, shutting down the web server' + server.socket.close() + else: + AnalyzeMinidump(options, args[0]) diff --git a/deps/v8/tools/gyp/v8.gyp b/deps/v8/tools/gyp/v8.gyp index d78853789c..f7bdf52b96 100644 --- a/deps/v8/tools/gyp/v8.gyp +++ b/deps/v8/tools/gyp/v8.gyp @@ -27,6 +27,7 @@ { 'variables': { + 'icu_use_data_file_flag%': 0, 'v8_code': 1, 'v8_random_seed%': 314159265, }, @@ -258,6 +259,7 @@ '../../src/assembler.cc', '../../src/assembler.h', '../../src/assert-scope.h', + '../../src/assert-scope.cc', '../../src/ast.cc', '../../src/ast.h', '../../src/atomicops.h', @@ -343,6 +345,7 @@ '../../src/factory.h', '../../src/fast-dtoa.cc', '../../src/fast-dtoa.h', + '../../src/feedback-slots.h', '../../src/fixed-dtoa.cc', '../../src/fixed-dtoa.h', '../../src/flag-definitions.h', @@ -406,8 +409,6 @@ '../../src/hydrogen-mark-deoptimize.h', '../../src/hydrogen-mark-unreachable.cc', '../../src/hydrogen-mark-unreachable.h', - '../../src/hydrogen-minus-zero.cc', - '../../src/hydrogen-minus-zero.h', '../../src/hydrogen-osr.cc', '../../src/hydrogen-osr.h', '../../src/hydrogen-range-analysis.cc', @@ -420,6 +421,8 @@ '../../src/hydrogen-representation-changes.h', '../../src/hydrogen-sce.cc', '../../src/hydrogen-sce.h', + '../../src/hydrogen-store-elimination.cc', + '../../src/hydrogen-store-elimination.h', '../../src/hydrogen-uint32-analysis.cc', '../../src/hydrogen-uint32-analysis.h', '../../src/i18n.cc', @@ -645,6 +648,52 @@ '../../src/arm/stub-cache-arm.cc', ], }], + ['v8_target_arch=="arm64"', { + 'sources': [ ### gcmole(arch:arm64) ### + '../../src/arm64/assembler-arm64.cc', + '../../src/arm64/assembler-arm64.h', + '../../src/arm64/assembler-arm64-inl.h', + '../../src/arm64/builtins-arm64.cc', + '../../src/arm64/codegen-arm64.cc', + '../../src/arm64/codegen-arm64.h', + '../../src/arm64/code-stubs-arm64.cc', + '../../src/arm64/code-stubs-arm64.h', + '../../src/arm64/constants-arm64.h', + '../../src/arm64/cpu-arm64.cc', + '../../src/arm64/cpu-arm64.h', + '../../src/arm64/debug-arm64.cc', + '../../src/arm64/decoder-arm64.cc', + '../../src/arm64/decoder-arm64.h', + '../../src/arm64/decoder-arm64-inl.h', + '../../src/arm64/deoptimizer-arm64.cc', + '../../src/arm64/disasm-arm64.cc', + '../../src/arm64/disasm-arm64.h', + '../../src/arm64/frames-arm64.cc', + '../../src/arm64/frames-arm64.h', + '../../src/arm64/full-codegen-arm64.cc', + '../../src/arm64/ic-arm64.cc', + '../../src/arm64/instructions-arm64.cc', + '../../src/arm64/instructions-arm64.h', + '../../src/arm64/instrument-arm64.cc', + '../../src/arm64/instrument-arm64.h', + '../../src/arm64/lithium-arm64.cc', + '../../src/arm64/lithium-arm64.h', + '../../src/arm64/lithium-codegen-arm64.cc', + '../../src/arm64/lithium-codegen-arm64.h', + '../../src/arm64/lithium-gap-resolver-arm64.cc', + '../../src/arm64/lithium-gap-resolver-arm64.h', + '../../src/arm64/macro-assembler-arm64.cc', + '../../src/arm64/macro-assembler-arm64.h', + '../../src/arm64/macro-assembler-arm64-inl.h', + '../../src/arm64/regexp-macro-assembler-arm64.cc', + '../../src/arm64/regexp-macro-assembler-arm64.h', + '../../src/arm64/simulator-arm64.cc', + '../../src/arm64/simulator-arm64.h', + '../../src/arm64/stub-cache-arm64.cc', + '../../src/arm64/utils-arm64.cc', + '../../src/arm64/utils-arm64.h', + ], + }], ['v8_target_arch=="ia32" or v8_target_arch=="mac" or OS=="mac"', { 'sources': [ ### gcmole(arch:ia32) ### '../../src/ia32/assembler-ia32-inl.h', @@ -972,6 +1021,17 @@ '../../src/default-platform.h', ], }], + ['icu_use_data_file_flag==1', { + 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'], + }, { # else icu_use_data_file_flag !=1 + 'conditions': [ + ['OS=="win"', { + 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'], + }, { + 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'], + }], + ], + }], ], }, { @@ -1013,6 +1073,9 @@ '../../src/regexp.js', '../../src/arraybuffer.js', '../../src/typedarray.js', + '../../src/weak_collection.js', + '../../src/promise.js', + '../../src/object-observe.js', '../../src/macros.py', ], 'experimental_library_files': [ @@ -1020,8 +1083,6 @@ '../../src/symbol.js', '../../src/proxy.js', '../../src/collection.js', - '../../src/object-observe.js', - '../../src/promise.js', '../../src/generator.js', '../../src/array-iterator.js', '../../src/harmony-string.js', diff --git a/deps/v8/tools/lexer-shell.cc b/deps/v8/tools/lexer-shell.cc index 0610e7f70d..e2e4a9c252 100644 --- a/deps/v8/tools/lexer-shell.cc +++ b/deps/v8/tools/lexer-shell.cc @@ -26,7 +26,6 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -#include #include #include #include @@ -35,53 +34,18 @@ #include "v8.h" #include "api.h" -#include "ast.h" -#include "char-predicates-inl.h" #include "messages.h" #include "platform.h" #include "runtime.h" #include "scanner-character-streams.h" #include "scopeinfo.h" +#include "shell-utils.h" #include "string-stream.h" #include "scanner.h" using namespace v8::internal; -enum Encoding { - LATIN1, - UTF8, - UTF16 -}; - - -const byte* ReadFile(const char* name, Isolate* isolate, - int* size, int repeat) { - FILE* file = fopen(name, "rb"); - *size = 0; - if (file == NULL) return NULL; - - fseek(file, 0, SEEK_END); - int file_size = ftell(file); - rewind(file); - - *size = file_size * repeat; - - byte* chars = new byte[*size + 1]; - for (int i = 0; i < file_size;) { - int read = static_cast(fread(&chars[i], 1, file_size - i, file)); - i += read; - } - fclose(file); - - for (int i = file_size; i < *size; i++) { - chars[i] = chars[i - file_size]; - } - chars[*size] = 0; - - return chars; -} - class BaselineScanner { public: @@ -92,7 +56,7 @@ class BaselineScanner { int repeat) : stream_(NULL) { int length = 0; - source_ = ReadFile(fname, isolate, &length, repeat); + source_ = ReadFileAndRepeat(fname, &length, repeat); unicode_cache_ = new UnicodeCache(); scanner_ = new Scanner(unicode_cache_); switch (encoding) { @@ -104,6 +68,7 @@ class BaselineScanner { Vector( reinterpret_cast(source_), length / 2)); + CHECK_NOT_EMPTY_HANDLE(isolate, result); stream_ = new GenericStringUtf16CharacterStream(result, 0, result->length()); break; @@ -111,6 +76,7 @@ class BaselineScanner { case LATIN1: { Handle result = isolate->factory()->NewStringFromOneByte( Vector(source_, length)); + CHECK_NOT_EMPTY_HANDLE(isolate, result); stream_ = new GenericStringUtf16CharacterStream(result, 0, result->length()); break; diff --git a/deps/v8/tools/lexer-shell.gyp b/deps/v8/tools/lexer-shell.gyp index 8e6ab7a844..623a503a0a 100644 --- a/deps/v8/tools/lexer-shell.gyp +++ b/deps/v8/tools/lexer-shell.gyp @@ -51,6 +51,29 @@ ], 'sources': [ 'lexer-shell.cc', + 'shell-utils.h', + ], + }, + { + 'target_name': 'parser-shell', + 'type': 'executable', + 'dependencies': [ + '../tools/gyp/v8.gyp:v8', + ], + 'conditions': [ + ['v8_enable_i18n_support==1', { + 'dependencies': [ + '<(icu_gyp_path):icui18n', + '<(icu_gyp_path):icuuc', + ], + }], + ], + 'include_dirs+': [ + '../src', + ], + 'sources': [ + 'parser-shell.cc', + 'shell-utils.h', ], }, ], diff --git a/deps/v8/tools/merge-to-branch.sh b/deps/v8/tools/merge-to-branch.sh index ccdae6c9bc..4e8a86c834 100755 --- a/deps/v8/tools/merge-to-branch.sh +++ b/deps/v8/tools/merge-to-branch.sh @@ -235,7 +235,6 @@ if [ $START_STEP -le $CURRENT_STEP ] ; then echo ">>> Step $CURRENT_STEP: Apply patches for selected revisions." restore_if_unset "MERGE_TO_BRANCH" restore_patch_commit_hashes_if_unset "PATCH_COMMIT_HASHES" - rm -f "$TOUCHED_FILES_FILE" for HASH in ${PATCH_COMMIT_HASHES[@]} ; do echo "Applying patch for $HASH to $MERGE_TO_BRANCH..." git log -1 -p $HASH > "$TEMPORARY_PATCH_FILE" diff --git a/deps/v8/tools/parser-shell.cc b/deps/v8/tools/parser-shell.cc new file mode 100644 index 0000000000..4da15fc7e3 --- /dev/null +++ b/deps/v8/tools/parser-shell.cc @@ -0,0 +1,171 @@ +// Copyright 2014 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include +#include +#include +#include "v8.h" + +#include "api.h" +#include "compiler.h" +#include "scanner-character-streams.h" +#include "shell-utils.h" +#include "parser.h" +#include "preparse-data-format.h" +#include "preparse-data.h" +#include "preparser.h" + +using namespace v8::internal; + +enum TestMode { + PreParseAndParse, + PreParse, + Parse +}; + +std::pair RunBaselineParser( + const char* fname, Encoding encoding, int repeat, v8::Isolate* isolate, + v8::Handle context, TestMode test_mode) { + int length = 0; + const byte* source = ReadFileAndRepeat(fname, &length, repeat); + v8::Handle source_handle; + switch (encoding) { + case UTF8: { + source_handle = v8::String::NewFromUtf8( + isolate, reinterpret_cast(source)); + break; + } + case UTF16: { + source_handle = v8::String::NewFromTwoByte( + isolate, reinterpret_cast(source), + v8::String::kNormalString, length / 2); + break; + } + case LATIN1: { + source_handle = v8::String::NewFromOneByte(isolate, source); + break; + } + } + v8::ScriptData* cached_data = NULL; + TimeDelta preparse_time, parse_time; + if (test_mode == PreParseAndParse || test_mode == PreParse) { + ElapsedTimer timer; + timer.Start(); + cached_data = v8::ScriptData::PreCompile(source_handle); + preparse_time = timer.Elapsed(); + if (cached_data == NULL || cached_data->HasError()) { + fprintf(stderr, "Preparsing failed\n"); + return std::make_pair(TimeDelta(), TimeDelta()); + } + } + if (test_mode == PreParseAndParse || test_mode == Parse) { + Handle str = v8::Utils::OpenHandle(*source_handle); + i::Isolate* internal_isolate = str->GetIsolate(); + Handle