diff options
author | Refael Ackermann <refack@gmail.com> | 2019-05-28 08:46:21 -0400 |
---|---|---|
committer | Refael Ackermann <refack@gmail.com> | 2019-06-01 09:55:12 -0400 |
commit | ed74896b1fae1c163b3906163f3bf46326618ddb (patch) | |
tree | 7fb05c5a19808e0c5cd95837528e9005999cf540 /deps/v8/tools | |
parent | 2a850cd0664a4eee51f44d0bb8c2f7a3fe444154 (diff) | |
download | android-node-v8-ed74896b1fae1c163b3906163f3bf46326618ddb.tar.gz android-node-v8-ed74896b1fae1c163b3906163f3bf46326618ddb.tar.bz2 android-node-v8-ed74896b1fae1c163b3906163f3bf46326618ddb.zip |
deps: update V8 to 7.5.288.22
PR-URL: https://github.com/nodejs/node/pull/27375
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'deps/v8/tools')
49 files changed, 3358 insertions, 1625 deletions
diff --git a/deps/v8/tools/adb-d8.py b/deps/v8/tools/adb-d8.py index 416714692c..4d4390fe05 100755 --- a/deps/v8/tools/adb-d8.py +++ b/deps/v8/tools/adb-d8.py @@ -158,7 +158,7 @@ def Main(): # command. adb = os.path.join( script_dir, - "../third_party/android_tools/sdk/platform-tools/adb" + "../third_party/android_sdk/public/platform-tools/adb" ) # Read off any command line flags before build_dir (or --). Do this diff --git a/deps/v8/tools/clusterfuzz/testdata/failure_output.txt b/deps/v8/tools/clusterfuzz/testdata/failure_output.txt index 49431aec30..27440742e8 100644 --- a/deps/v8/tools/clusterfuzz/testdata/failure_output.txt +++ b/deps/v8/tools/clusterfuzz/testdata/failure_output.txt @@ -9,9 +9,9 @@ # Compared x64,ignition with x64,ignition_turbo # # Flags of x64,ignition: ---abort_on_stack_or_string_length_overflow --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --wasm-num-compilation-tasks=0 --suppress-asm-messages --random-seed 12345 --turbo-filter=~ --noopt --liftoff --no-wasm-tier-up +--abort-on-stack-or-string-length-overflow --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --no-wasm-async-compilation --suppress-asm-messages --random-seed 12345 --turbo-filter=~ --noopt --liftoff --no-wasm-tier-up # Flags of x64,ignition_turbo: ---abort_on_stack_or_string_length_overflow --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --wasm-num-compilation-tasks=0 --suppress-asm-messages --random-seed 12345 --stress-scavenge=100 +--abort-on-stack-or-string-length-overflow --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --no-wasm-async-compilation --suppress-asm-messages --random-seed 12345 --stress-scavenge=100 # # Difference: - unknown diff --git a/deps/v8/tools/clusterfuzz/testdata/sanity_check_output.txt b/deps/v8/tools/clusterfuzz/testdata/sanity_check_output.txt index d37e3dbf1b..72bf95d0b1 100644 --- a/deps/v8/tools/clusterfuzz/testdata/sanity_check_output.txt +++ b/deps/v8/tools/clusterfuzz/testdata/sanity_check_output.txt @@ -9,9 +9,9 @@ # Compared x64,ignition with x64,ignition_turbo # # Flags of x64,ignition: ---abort_on_stack_or_string_length_overflow --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --wasm-num-compilation-tasks=0 --suppress-asm-messages --random-seed 12345 --turbo-filter=~ --noopt --liftoff --no-wasm-tier-up +--abort-on-stack-or-string-length-overflow --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --no-wasm-async-compilation --suppress-asm-messages --random-seed 12345 --turbo-filter=~ --noopt --liftoff --no-wasm-tier-up # Flags of x64,ignition_turbo: ---abort_on_stack_or_string_length_overflow --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --wasm-num-compilation-tasks=0 --suppress-asm-messages --random-seed 12345 --stress-scavenge=100 +--abort-on-stack-or-string-length-overflow --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --no-wasm-async-compilation --suppress-asm-messages --random-seed 12345 --stress-scavenge=100 # # Difference: - unknown diff --git a/deps/v8/tools/clusterfuzz/v8_foozzie.py b/deps/v8/tools/clusterfuzz/v8_foozzie.py index 563c4643ae..26b189e27f 100755 --- a/deps/v8/tools/clusterfuzz/v8_foozzie.py +++ b/deps/v8/tools/clusterfuzz/v8_foozzie.py @@ -103,9 +103,9 @@ PREAMBLE = [ ARCH_MOCKS = os.path.join(BASE_PATH, 'v8_mock_archs.js') SANITY_CHECKS = os.path.join(BASE_PATH, 'v8_sanity_checks.js') -FLAGS = ['--abort_on_stack_or_string_length_overflow', '--expose-gc', +FLAGS = ['--abort-on-stack-or-string-length-overflow', '--expose-gc', '--allow-natives-syntax', '--invoke-weak-callbacks', '--omit-quit', - '--es-staging', '--wasm-num-compilation-tasks=0', + '--es-staging', '--no-wasm-async-compilation', '--suppress-asm-messages'] SUPPORTED_ARCHS = ['ia32', 'x64', 'arm', 'arm64'] diff --git a/deps/v8/tools/gcmole/Makefile b/deps/v8/tools/gcmole/Makefile index ee43c00d20..e1bde684a6 100644 --- a/deps/v8/tools/gcmole/Makefile +++ b/deps/v8/tools/gcmole/Makefile @@ -27,16 +27,20 @@ # This is Makefile for clang plugin part of gcmole tool. See README. -LLVM_INCLUDE:=$(LLVM_SRC_ROOT)/include -CLANG_INCLUDE:=$(LLVM_SRC_ROOT)/tools/clang/include +LLVM_SRC_INCLUDE:=$(LLVM_SRC_ROOT)/include +LLVM_BUILD_INCLUDE:=$(BUILD_ROOT)/include +CLANG_SRC_INCLUDE:=$(CLANG_SRC_ROOT)/include +CLANG_BUILD_INCLUDE:=$(BUILD_ROOT)/tools/clang/include libgcmole.so: gcmole.cc - $(CXX) -I$(LLVM_INCLUDE) -I$(CLANG_INCLUDE) -I. -D_DEBUG \ + $(CXX) -I$(LLVM_BUILD_INCLUDE) -I$(LLVM_SRC_INCLUDE) \ + -I$(CLANG_BUILD_INCLUDE) -I$(CLANG_SRC_INCLUDE) -I. -D_DEBUG \ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS \ -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -fno-exceptions \ -fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing \ -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter \ - -Wwrite-strings -std=c++0x -shared -o libgcmole.so gcmole.cc + -Wwrite-strings -static-libstdc++ -std=c++0x -shared -o libgcmole.so \ + gcmole.cc clean: $(RM) libgcmole.so diff --git a/deps/v8/tools/gcmole/README b/deps/v8/tools/gcmole/README index 37f8afbd6f..7e25da3aa1 100644 --- a/deps/v8/tools/gcmole/README +++ b/deps/v8/tools/gcmole/README @@ -5,12 +5,12 @@ dependent GC-unsafe places in the V8 codebase. For example the following code is GC-unsafe: -Handle<Object> Foo(); // Assume Foo can trigger a GC. -void Bar(Object*, Object*); + Handle<Object> Foo(); // Assume Foo can trigger a GC. + void Bar(Object*, Object*); -Handle<Object> baz; -baz->Qux(*Foo()); // (a) -Bar(*Foo(), *baz); // (b) + Handle<Object> baz; + baz->Qux(*Foo()); // (a) + Bar(*Foo(), *baz); // (b) Both in cases (a) and (b) compiler is free to evaluate call arguments (that includes receiver) in any order. That means it can dereference baz before @@ -19,20 +19,30 @@ on the stack. PREREQUISITES ----------------------------------------------------------------- -1) Install Lua 5.1 +(1) Install Lua 5.1 -2) Get LLVM 2.9 and Clang 2.9 sources and build them. + $ sudo apt-get install lua5.1 -Follow the instructions on http://clang.llvm.org/get_started.html. +(2) Get LLVM 8.0 and Clang 8.0 sources and build them. -Make sure to pass --enable-optimized to configure to get Release build -instead of a Debug one. + Follow the instructions on http://clang.llvm.org/get_started.html. -3) Build gcmole Clang plugin (libgcmole.so) + Make sure to pass -DCMAKE_BUILD_TYPE=Release to cmake to get Release build + instead of a Debug one. -In the tools/gcmole execute the following command: +(3) Build gcmole Clang plugin (libgcmole.so) -LLVM_SRC_ROOT=<path-to-llvm-source-root> make + In the tools/gcmole directory execute the following command: + + $ BUILD_ROOT=<path> LLVM_SRC_ROOT=<path> CLANG_SRC_ROOT=<path> make + +(*) Note that steps (2) and (3) can also be achieved by just using the included + bootstrapping script in this directory: + + $ ./tools/gcmole/bootstrap.sh + + This will use "third_party/llvm+clang-build" as a build directory and checkout + required sources in the "third_party" directory. USING GCMOLE ------------------------------------------------------------------ @@ -60,3 +70,41 @@ warning. Messages "Failed to resolve v8::internal::Object" are benign and can be ignored. If any errors were found driver exits with non-zero status. + +PACKAGING --------------------------------------------------------------------- + +gcmole is deployed on V8's buildbot infrastructure to run it as part of the +continuous integration. A pre-built package of gcmole together with Clang is +hosted on Google Cloud Storage for this purpose. To update this package to a +newer version, use the provided packaging script: + + $ ./tools/gcmole/package.sh + +This will create a new "tools/gcmole/gcmole-tools.tar.gz" package with the +corresponding SHA1 sum suitable to be used for this purpose. It assumes that +Clang was built in "third_party/llvm+clang-build" (e.g. by the bootstrapping +script "bootstrap.sh" mentioned above). + +TROUBLESHOOTING --------------------------------------------------------------- + +gcmole is tighly coupled with the AST structure that Clang produces. Therefore +when upgrading to a newer Clang version, it might start producing bogus output +or completely stop outputting warnings. In such occasion, one might start the +debugging process by checking weather a new AST node type is introduced which +is currently not supported by gcmole. Insert the following code at the end of +the FunctionAnalyzer::VisitExpr method to see the unsupported AST class(es) +and the source position which generates them: + + if (expr) { + clang::Stmt::StmtClass stmtClass = expr->getStmtClass(); + d_.Report(clang::FullSourceLoc(expr->getExprLoc(), sm_), + d_.getCustomDiagID(clang::DiagnosticsEngine::Remark, "%0")) << stmtClass; + } + +For instance, gcmole currently doesn't support AtomicExprClass statements +introduced for atomic operations. + +A convenient way to observe the AST generated by Clang is to pass the following +flags when invoking clang++ + + -Xclang -ast-dump -fsyntax-only diff --git a/deps/v8/tools/gcmole/bootstrap.sh b/deps/v8/tools/gcmole/bootstrap.sh index ac6593c67a..05ab1cbb8e 100755 --- a/deps/v8/tools/gcmole/bootstrap.sh +++ b/deps/v8/tools/gcmole/bootstrap.sh @@ -27,16 +27,18 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# This script will build libgcmole.so. Building a recent clang needs a -# recent GCC, so if you explicitly want to use GCC 4.8, use: -# -# CC=gcc-4.8 CPP=cpp-4.8 CXX=g++-4.8 CXXFLAGS=-static-libstdc++ CXXCPP=cpp-4.8 ./bootstrap.sh +# This script will build libgcmole.so as well as a corresponding recent +# version of Clang and LLVM. The Clang will be built with the locally +# installed compiler and statically link against the local libstdc++ so +# that the resulting binary is easier transferable between different +# environments. -CLANG_RELEASE=3.5 +CLANG_RELEASE=8.0 -THIS_DIR="$(dirname "${0}")" +THIS_DIR="$(readlink -f "$(dirname "${0}")")" LLVM_DIR="${THIS_DIR}/../../third_party/llvm" -CLANG_DIR="${LLVM_DIR}/tools/clang" +CLANG_DIR="${THIS_DIR}/../../third_party/clang" +BUILD_DIR="${THIS_DIR}/../../third_party/llvm+clang-build" LLVM_REPO_URL=${LLVM_URL:-https://llvm.org/svn/llvm-project} @@ -70,7 +72,7 @@ if [[ "${OS}" = "Darwin" ]] && xcodebuild -version | grep -q 'Xcode 3.2' ; then fi fi -echo Getting LLVM r"${CLANG_RELEASE}" in "${LLVM_DIR}" +echo Getting LLVM release "${CLANG_RELEASE}" in "${LLVM_DIR}" if ! svn co --force \ "${LLVM_REPO_URL}/llvm/branches/release_${CLANG_RELEASE/./}" \ "${LLVM_DIR}"; then @@ -81,7 +83,7 @@ if ! svn co --force \ "${LLVM_DIR}" fi -echo Getting clang r"${CLANG_RELEASE}" in "${CLANG_DIR}" +echo Getting clang release "${CLANG_RELEASE}" in "${CLANG_DIR}" svn co --force \ "${LLVM_REPO_URL}/cfe/branches/release_${CLANG_RELEASE/./}" \ "${CLANG_DIR}" @@ -97,33 +99,32 @@ elif [ "${OS}" = "Darwin" ]; then fi # Build clang. -cd "${LLVM_DIR}" -if [[ ! -f ./config.status ]]; then - ../llvm/configure \ - --enable-optimized \ - --disable-threads \ - --disable-pthreads \ - --without-llvmgcc \ - --without-llvmgxx +if [ ! -e "${BUILD_DIR}" ]; then + mkdir "${BUILD_DIR}" fi - +cd "${BUILD_DIR}" +cmake -DCMAKE_CXX_FLAGS="-static-libstdc++" -DLLVM_ENABLE_TERMINFO=OFF \ + -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=clang "${LLVM_DIR}" MACOSX_DEPLOYMENT_TARGET=10.5 make -j"${NUM_JOBS}" + +# Strip the clang binary. STRIP_FLAGS= if [ "${OS}" = "Darwin" ]; then # See http://crbug.com/256342 STRIP_FLAGS=-x fi -strip ${STRIP_FLAGS} Release+Asserts/bin/clang +strip ${STRIP_FLAGS} bin/clang cd - # Build libgcmole.so make -C "${THIS_DIR}" clean -make -C "${THIS_DIR}" LLVM_SRC_ROOT="${LLVM_DIR}" libgcmole.so +make -C "${THIS_DIR}" LLVM_SRC_ROOT="${LLVM_DIR}" \ + CLANG_SRC_ROOT="${CLANG_DIR}" BUILD_ROOT="${BUILD_DIR}" libgcmole.so set +x echo echo You can now run gcmole using this command: echo -echo CLANG_BIN=\"third_party/llvm/Release+Asserts/bin\" lua tools/gcmole/gcmole.lua +echo CLANG_BIN=\"third_party/llvm+clang-build/bin\" lua tools/gcmole/gcmole.lua echo diff --git a/deps/v8/tools/gcmole/gcmole-test.cc b/deps/v8/tools/gcmole/gcmole-test.cc new file mode 100644 index 0000000000..b0a341bb55 --- /dev/null +++ b/deps/v8/tools/gcmole/gcmole-test.cc @@ -0,0 +1,71 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "src/handles-inl.h" +#include "src/handles.h" +#include "src/isolate.h" +#include "src/objects/maybe-object.h" +#include "src/objects/object-macros.h" + +namespace v8 { +namespace internal { + +Handle<Object> CauseGC(Handle<Object> obj, Isolate* isolate) { + isolate->heap()->CollectGarbage(OLD_SPACE, GarbageCollectionReason::kTesting); + + return obj; +} + +void TwoArgumentsFunction(Object a, Object b) { + a->Print(); + b->Print(); +} + +void TestTwoArguments(Isolate* isolate) { + Handle<JSObject> obj1 = isolate->factory()->NewJSObjectWithNullProto(); + Handle<JSObject> obj2 = isolate->factory()->NewJSObjectWithNullProto(); + TwoArgumentsFunction(*CauseGC(obj1, isolate), *CauseGC(obj2, isolate)); +} + +void TwoSizeTArgumentsFunction(size_t a, size_t b) { + USE(a); + USE(b); +} + +void TestTwoSizeTArguments(Isolate* isolate) { + Handle<JSObject> obj1 = isolate->factory()->NewJSObjectWithNullProto(); + Handle<JSObject> obj2 = isolate->factory()->NewJSObjectWithNullProto(); + TwoSizeTArgumentsFunction(sizeof(*CauseGC(obj1, isolate)), + sizeof(*CauseGC(obj2, isolate))); +} + +class SomeObject : public Object { + public: + void Method(Object a) { a->Print(); } + + SomeObject& operator=(const Object& b) { + this->Print(); + return *this; + } + + DECL_CAST(SomeObject) + + OBJECT_CONSTRUCTORS(SomeObject, Object); +}; + +void TestMethodCall(Isolate* isolate) { + SomeObject obj; + Handle<SomeObject> so = handle(obj, isolate); + Handle<JSObject> obj1 = isolate->factory()->NewJSObjectWithNullProto(); + so->Method(*CauseGC(obj1, isolate)); +} + +void TestOperatorCall(Isolate* isolate) { + SomeObject obj; + Handle<JSObject> obj1 = isolate->factory()->NewJSObjectWithNullProto(); + obj = *CauseGC(obj1, isolate); +} + +} // namespace internal +} // namespace v8 diff --git a/deps/v8/tools/gcmole/gcmole-tools.tar.gz.sha1 b/deps/v8/tools/gcmole/gcmole-tools.tar.gz.sha1 index f9e3e01b6d..718e967e3b 100644 --- a/deps/v8/tools/gcmole/gcmole-tools.tar.gz.sha1 +++ b/deps/v8/tools/gcmole/gcmole-tools.tar.gz.sha1 @@ -1 +1 @@ -a21e6b0d08afcfe454042c2c1fbf1d1738caf129
\ No newline at end of file +3d4ba1759c3d5bc7e98c466d24fa0c43f186ba79
\ No newline at end of file diff --git a/deps/v8/tools/gcmole/gcmole.cc b/deps/v8/tools/gcmole/gcmole.cc index f7a6c94c29..6631583478 100644 --- a/deps/v8/tools/gcmole/gcmole.cc +++ b/deps/v8/tools/gcmole/gcmole.cc @@ -458,7 +458,9 @@ class CallProps { CallProps() : env_(NULL) { } void SetEffect(int arg, ExprEffect in) { - if (in.hasGC()) gc_.set(arg); + if (in.hasGC()) { + gc_.set(arg); + } if (in.hasRawDef()) raw_def_.set(arg); if (in.hasRawUse()) raw_use_.set(arg); if (in.env() != NULL) { @@ -472,17 +474,24 @@ class CallProps { ExprEffect ComputeCumulativeEffect(bool result_is_raw) { ExprEffect out = ExprEffect::NoneWithEnv(env_); - if (gc_.any()) out.setGC(); + if (gc_.any()) { + out.setGC(); + } if (raw_use_.any()) out.setRawUse(); if (result_is_raw) out.setRawDef(); return out; } bool IsSafe() { - if (!gc_.any()) return true; + if (!gc_.any()) { + return true; + } std::bitset<kMaxNumberOfArguments> raw = (raw_def_ | raw_use_); - if (!raw.any()) return true; - return gc_.count() == 1 && !((raw ^ gc_).any()); + if (!raw.any()) { + return true; + } + bool result = gc_.count() == 1 && !((raw ^ gc_).any()); + return result; } private: @@ -537,20 +546,19 @@ static std::string THIS ("this"); class FunctionAnalyzer { public: FunctionAnalyzer(clang::MangleContext* ctx, - clang::DeclarationName handle_decl_name, clang::CXXRecordDecl* object_decl, + clang::CXXRecordDecl* maybe_object_decl, clang::CXXRecordDecl* smi_decl, clang::DiagnosticsEngine& d, clang::SourceManager& sm, bool dead_vars_analysis) : ctx_(ctx), - handle_decl_name_(handle_decl_name), object_decl_(object_decl), + maybe_object_decl_(maybe_object_decl), smi_decl_(smi_decl), d_(d), sm_(sm), block_(NULL), dead_vars_analysis_(dead_vars_analysis) {} - // -------------------------------------------------------------------------- // Expressions // -------------------------------------------------------------------------- @@ -574,6 +582,7 @@ class FunctionAnalyzer { VISIT(CharacterLiteral); VISIT(ChooseExpr); VISIT(CompoundLiteralExpr); + VISIT(ConstantExpr); VISIT(CXXBindTemporaryExpr); VISIT(CXXBoolLiteralExpr); VISIT(CXXConstructExpr); @@ -598,9 +607,11 @@ class FunctionAnalyzer { VISIT(FloatingLiteral); VISIT(GNUNullExpr); VISIT(ImaginaryLiteral); + VISIT(ImplicitCastExpr); VISIT(ImplicitValueInitExpr); VISIT(InitListExpr); VISIT(IntegerLiteral); + VISIT(MaterializeTemporaryExpr); VISIT(MemberExpr); VISIT(OffsetOfExpr); VISIT(OpaqueValueExpr); @@ -616,6 +627,7 @@ class FunctionAnalyzer { VISIT(SubstNonTypeTemplateParmPackExpr); VISIT(TypeTraitExpr); VISIT(UnaryOperator); + VISIT(UnaryExprOrTypeTraitExpr); VISIT(VAArgExpr); #undef VISIT @@ -685,6 +697,7 @@ class FunctionAnalyzer { llvm::cast<clang::DeclRefExpr>(expr)->getDecl()->getNameAsString(); return true; } + return false; } @@ -701,14 +714,6 @@ class FunctionAnalyzer { case clang::BO_LOr: return ExprEffect::Merge(VisitExpr(lhs, env), VisitExpr(rhs, env)); - case clang::BO_Assign: { - std::string var_name; - if (IsRawPointerVar(lhs, &var_name)) { - return VisitExpr(rhs, env).Define(var_name); - } - return Par(expr, 2, exprs, env); - } - default: return Par(expr, 2, exprs, env); } @@ -718,6 +723,10 @@ class FunctionAnalyzer { return VisitExpr(expr->getSubExpr(), env); } + DECL_VISIT_EXPR(MaterializeTemporaryExpr) { + return VisitExpr(expr->GetTemporaryExpr(), env); + } + DECL_VISIT_EXPR(CXXConstructExpr) { return VisitArguments<>(expr, env); } @@ -740,6 +749,12 @@ class FunctionAnalyzer { return VisitExpr(expr->getSubExpr(), env); } + DECL_VISIT_EXPR(ImplicitCastExpr) { + return VisitExpr(expr->getSubExpr(), env); + } + + DECL_VISIT_EXPR(ConstantExpr) { return VisitExpr(expr->getSubExpr(), env); } + DECL_VISIT_EXPR(InitListExpr) { return Seq(expr, expr->getNumInits(), expr->getInits(), env); } @@ -761,11 +776,11 @@ class FunctionAnalyzer { } DECL_VISIT_EXPR(UnaryOperator) { - // TODO We are treating all expressions that look like &raw_pointer_var - // as definitions of raw_pointer_var. This should be changed to - // recognize less generic pattern: + // TODO(mstarzinger): We are treating all expressions that look like + // {&raw_pointer_var} as definitions of {raw_pointer_var}. This should be + // changed to recognize less generic pattern: // - // if (maybe_object->ToObject(&obj)) return maybe_object; + // if (maybe_object->ToObject(&obj)) return maybe_object; // if (expr->getOpcode() == clang::UO_AddrOf) { std::string var_name; @@ -776,6 +791,14 @@ class FunctionAnalyzer { return VisitExpr(expr->getSubExpr(), env); } + DECL_VISIT_EXPR(UnaryExprOrTypeTraitExpr) { + if (expr->isArgumentType()) { + return ExprEffect::None(); + } + + return VisitExpr(expr->getArgumentExpr(), env); + } + DECL_VISIT_EXPR(CastExpr) { return VisitExpr(expr->getSubExpr(), env); } @@ -796,7 +819,8 @@ class FunctionAnalyzer { if (!props.IsSafe()) ReportUnsafe(parent, BAD_EXPR_MSG); - return props.ComputeCumulativeEffect(IsRawPointerType(parent->getType())); + return props.ComputeCumulativeEffect( + RepresentsRawPointerType(parent->getType())); } ExprEffect Seq(clang::Stmt* parent, @@ -816,7 +840,7 @@ class FunctionAnalyzer { const clang::QualType& var_type, const std::string& var_name, const Environment& env) { - if (IsRawPointerType(var_type)) { + if (RepresentsRawPointerType(var_type)) { if (!env.IsAlive(var_name) && dead_vars_analysis_) { ReportUnsafe(parent, DEAD_VAR_MSG); } @@ -840,7 +864,8 @@ class FunctionAnalyzer { CallProps props; VisitArguments<>(call, &props, env); if (!props.IsSafe()) ReportUnsafe(call, BAD_EXPR_MSG); - return props.ComputeCumulativeEffect(IsRawPointerType(call->getType())); + return props.ComputeCumulativeEffect( + RepresentsRawPointerType(call->getType())); } template<typename ExprType> @@ -864,12 +889,25 @@ class FunctionAnalyzer { props.SetEffect(0, VisitExpr(receiver, env)); } - VisitArguments<>(call, &props, env); + std::string var_name; + clang::CXXOperatorCallExpr* opcall = + llvm::dyn_cast_or_null<clang::CXXOperatorCallExpr>(call); + if (opcall != NULL && opcall->isAssignmentOp() && + IsRawPointerVar(opcall->getArg(0), &var_name)) { + // TODO(mstarzinger): We are treating all assignment operator calls with + // the left hand side looking like {raw_pointer_var} as safe independent + // of the concrete assignment operator implementation. This should be + // changed to be more narrow only if the assignment operator of the base + // {Object} or {HeapObject} class was used, which we know to be safe. + props.SetEffect(1, VisitExpr(call->getArg(1), env).Define(var_name)); + } else { + VisitArguments<>(call, &props, env); + } if (!props.IsSafe()) ReportUnsafe(call, BAD_EXPR_MSG); - ExprEffect out = - props.ComputeCumulativeEffect(IsRawPointerType(call->getType())); + ExprEffect out = props.ComputeCumulativeEffect( + RepresentsRawPointerType(call->getType())); clang::FunctionDecl* callee = call->getDirectCallee(); if ((callee != NULL) && KnownToCauseGC(ctx_, callee)) { @@ -1104,45 +1142,88 @@ class FunctionAnalyzer { } } - bool IsDerivedFrom(clang::CXXRecordDecl* record, - clang::CXXRecordDecl* base) { + bool IsDerivedFrom(const clang::CXXRecordDecl* record, + const clang::CXXRecordDecl* base) { return (record == base) || record->isDerivedFrom(base); } - bool IsRawPointerType(clang::QualType qtype) { - const clang::PointerType* type = - llvm::dyn_cast_or_null<clang::PointerType>(qtype.getTypePtrOrNull()); - if (type == NULL) return false; + const clang::CXXRecordDecl* GetDefinitionOrNull( + const clang::CXXRecordDecl* record) { + if (record == NULL) { + return NULL; + } - const clang::TagType* pointee = - ToTagType(type->getPointeeType().getTypePtr()); - if (pointee == NULL) return false; + if (!InV8Namespace(record)) return NULL; + + if (!record->hasDefinition()) { + return NULL; + } + + return record->getDefinition(); + } + + bool IsRawPointerType(const clang::PointerType* type) { + const clang::CXXRecordDecl* record = type->getPointeeCXXRecordDecl(); + + const clang::CXXRecordDecl* definition = GetDefinitionOrNull(record); + if (!definition) { + return false; + } + + // TODO(mstarzinger): Unify the common parts of {IsRawPointerType} and + // {IsInternalPointerType} once gcmole is up and running again. + bool result = (IsDerivedFrom(record, object_decl_) && + !IsDerivedFrom(record, smi_decl_)) || + IsDerivedFrom(record, maybe_object_decl_); + return result; + } - clang::CXXRecordDecl* record = - llvm::dyn_cast_or_null<clang::CXXRecordDecl>(pointee->getDecl()); - if (record == NULL) return false; + bool IsInternalPointerType(clang::QualType qtype) { + if (qtype.isNull()) { + return false; + } + if (qtype->isNullPtrType()) { + return true; + } - if (!InV8Namespace(record)) return false; + const clang::CXXRecordDecl* record = qtype->getAsCXXRecordDecl(); - if (!record->hasDefinition()) return false; + const clang::CXXRecordDecl* definition = GetDefinitionOrNull(record); + if (!definition) { + return false; + } - record = record->getDefinition(); + // TODO(mstarzinger): Unify the common parts of {IsRawPointerType} and + // {IsInternalPointerType} once gcmole is up and running again. + bool result = (IsDerivedFrom(record, object_decl_) && + !IsDerivedFrom(record, smi_decl_)) || + IsDerivedFrom(record, maybe_object_decl_); + return result; + } - return IsDerivedFrom(record, object_decl_) && - !IsDerivedFrom(record, smi_decl_); + // Returns weather the given type is a raw pointer or a wrapper around + // such. For V8 that means Object and MaybeObject instances. + bool RepresentsRawPointerType(clang::QualType qtype) { + const clang::PointerType* pointer_type = + llvm::dyn_cast_or_null<clang::PointerType>(qtype.getTypePtrOrNull()); + if (pointer_type != NULL) { + return IsRawPointerType(pointer_type); + } else { + return IsInternalPointerType(qtype); + } } Environment VisitDecl(clang::Decl* decl, const Environment& env) { if (clang::VarDecl* var = llvm::dyn_cast<clang::VarDecl>(decl)) { Environment out = var->hasInit() ? VisitStmt(var->getInit(), env) : env; - if (IsRawPointerType(var->getType())) { + if (RepresentsRawPointerType(var->getType())) { out = out.Define(var->getNameAsString()); } return out; } - // TODO: handle other declarations? + // TODO(mstarzinger): handle other declarations? return env; } @@ -1199,8 +1280,8 @@ class FunctionAnalyzer { clang::MangleContext* ctx_; - clang::DeclarationName handle_decl_name_; clang::CXXRecordDecl* object_decl_; + clang::CXXRecordDecl* maybe_object_decl_; clang::CXXRecordDecl* smi_decl_; clang::DiagnosticsEngine& d_; @@ -1231,23 +1312,34 @@ class ProblemsFinder : public clang::ASTConsumer, r.ResolveNamespace("v8").ResolveNamespace("internal"). Resolve<clang::CXXRecordDecl>("Object"); + clang::CXXRecordDecl* maybe_object_decl = + r.ResolveNamespace("v8") + .ResolveNamespace("internal") + .Resolve<clang::CXXRecordDecl>("MaybeObject"); + clang::CXXRecordDecl* smi_decl = r.ResolveNamespace("v8").ResolveNamespace("internal"). Resolve<clang::CXXRecordDecl>("Smi"); if (object_decl != NULL) object_decl = object_decl->getDefinition(); + if (maybe_object_decl != NULL) + maybe_object_decl = maybe_object_decl->getDefinition(); + if (smi_decl != NULL) smi_decl = smi_decl->getDefinition(); - if (object_decl != NULL && smi_decl != NULL) { + if (object_decl != NULL && smi_decl != NULL && maybe_object_decl != NULL) { function_analyzer_ = new FunctionAnalyzer( - clang::ItaniumMangleContext::create(ctx, d_), r.ResolveName("Handle"), - object_decl, smi_decl, d_, sm_, dead_vars_analysis_); + clang::ItaniumMangleContext::create(ctx, d_), object_decl, + maybe_object_decl, smi_decl, d_, sm_, dead_vars_analysis_); TraverseDecl(ctx.getTranslationUnitDecl()); } else { if (object_decl == NULL) { llvm::errs() << "Failed to resolve v8::internal::Object\n"; } + if (maybe_object_decl == NULL) { + llvm::errs() << "Failed to resolve v8::internal::MaybeObject\n"; + } if (smi_decl == NULL) { llvm::errs() << "Failed to resolve v8::internal::Smi\n"; } @@ -1271,9 +1363,10 @@ class ProblemsFinder : public clang::ASTConsumer, template<typename ConsumerType> class Action : public clang::PluginASTAction { protected: - clang::ASTConsumer *CreateASTConsumer(clang::CompilerInstance &CI, - llvm::StringRef InFile) { - return new ConsumerType(CI.getDiagnostics(), CI.getSourceManager(), args_); + virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer( + clang::CompilerInstance& CI, llvm::StringRef InFile) { + return std::unique_ptr<clang::ASTConsumer>( + new ConsumerType(CI.getDiagnostics(), CI.getSourceManager(), args_)); } bool ParseArgs(const clang::CompilerInstance &CI, diff --git a/deps/v8/tools/gcmole/package.sh b/deps/v8/tools/gcmole/package.sh new file mode 100644 index 0000000000..6206e7bb2e --- /dev/null +++ b/deps/v8/tools/gcmole/package.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +# Copyright 2019 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This script will package a built gcmole plugin together with the +# corresponding clang binary into an archive which can be used on the +# buildbot infrastructure to be run against V8 checkouts. + +THIS_DIR="$(readlink -f "$(dirname "${0}")")" + +PACKAGE_DIR="${THIS_DIR}/../../tools/gcmole/gcmole-tools" +PACKAGE_FILE="${THIS_DIR}/../../tools/gcmole/gcmole-tools.tar.gz" +PACKAGE_SUM="${THIS_DIR}/../../tools/gcmole/gcmole-tools.tar.gz.sha1" +BUILD_DIR="${THIS_DIR}/../../third_party/llvm+clang-build" + +# Echo all commands +set -x + +# Copy all required files +mkdir -p "${PACKAGE_DIR}/bin" +cp "${BUILD_DIR}/bin/clang++" "${PACKAGE_DIR}/bin" +mkdir -p "${PACKAGE_DIR}/lib" +cp -r "${BUILD_DIR}/lib/clang" "${PACKAGE_DIR}/lib" +cp "${THIS_DIR}/libgcmole.so" "${PACKAGE_DIR}" + +# Generate the archive +cd "$(dirname "${PACKAGE_DIR}")" +tar -c -z -f "${PACKAGE_FILE}" "$(basename "${PACKAGE_DIR}")" + +# Generate checksum +sha1sum "${PACKAGE_FILE}" | awk '{print $1}' > "${PACKAGE_SUM}" + +set +x + +echo +echo You can find a packaged version of gcmole here: +echo +echo $(readlink -f "${PACKAGE_FILE}") +echo +echo You can now run gcmole using this command: +echo +echo CLANG_BIN="tools/gcmole/gcmole-tools/bin" lua tools/gcmole/gcmole.lua +echo diff --git a/deps/v8/tools/gdbinit b/deps/v8/tools/gdbinit index c45bc6df33..6c3778fca7 100644 --- a/deps/v8/tools/gdbinit +++ b/deps/v8/tools/gdbinit @@ -107,8 +107,8 @@ end # Search for a pointer inside all valid pages. define space_find set $space = $arg0 - set $current_page = $space->anchor()->next_page() - while ($current_page != $space->anchor()) + set $current_page = $space->first_page() + while ($current_page != 0) printf "# Searching in %p - %p\n", $current_page->area_start(), $current_page->area_end()-1 find $current_page->area_start(), $current_page->area_end()-1, $arg1 set $current_page = $current_page->next_page() diff --git a/deps/v8/tools/gen-postmortem-metadata.py b/deps/v8/tools/gen-postmortem-metadata.py index 4fef2b3400..9145e15fdf 100644 --- a/deps/v8/tools/gen-postmortem-metadata.py +++ b/deps/v8/tools/gen-postmortem-metadata.py @@ -85,10 +85,6 @@ consts_misc = [ { 'name': 'SmiTagMask', 'value': 'kSmiTagMask' }, { 'name': 'SmiValueShift', 'value': 'kSmiTagSize' }, { 'name': 'SmiShiftSize', 'value': 'kSmiShiftSize' }, - { 'name': 'SystemPointerSize', 'value': 'kSystemPointerSize' }, - { 'name': 'SystemPointerSizeLog2', 'value': 'kSystemPointerSizeLog2' }, - { 'name': 'TaggedSize', 'value': 'kTaggedSize' }, - { 'name': 'TaggedSizeLog2', 'value': 'kTaggedSizeLog2' }, { 'name': 'OddballFalse', 'value': 'Oddball::kFalse' }, { 'name': 'OddballTrue', 'value': 'Oddball::kTrue' }, @@ -165,8 +161,6 @@ consts_misc = [ 'value': 'Map::NumberOfOwnDescriptorsBits::kMask' }, { 'name': 'bit_field3_number_of_own_descriptors_shift', 'value': 'Map::NumberOfOwnDescriptorsBits::kShift' }, - { 'name': 'class_Map__instance_descriptors_offset', - 'value': 'Map::kDescriptorsOffset' }, { 'name': 'off_fp_context_or_frame_type', 'value': 'CommonFrameConstants::kContextOrFrameTypeOffset'}, @@ -399,12 +393,14 @@ def load_objects_from_file(objfilename, checktypes): typestr += line; continue; - match = re.match('class (\w[^:]*)(: public (\w[^{]*))?\s*{\s*', - line); + match = re.match(r'class(?:\s+V8_EXPORT(?:_PRIVATE)?)?' + r'\s+(\w[^:]*)' + r'(?:: public (\w[^{]*))?\s*{\s*', + line); if (match): klass = match.group(1).strip(); - pklass = match.group(3); + pklass = match.group(2); if (pklass): pklass = pklass.strip(); klasses[klass] = { 'parent': pklass }; diff --git a/deps/v8/tools/locs.py b/deps/v8/tools/locs.py index 05793d698d..bd1609dc7f 100755 --- a/deps/v8/tools/locs.py +++ b/deps/v8/tools/locs.py @@ -13,22 +13,28 @@ from __future__ import print_function import argparse import json +import multiprocessing import os import re import subprocess import sys import tempfile import time +from collections import defaultdict +from concurrent.futures import ThreadPoolExecutor from pathlib import Path +# for py2/py3 compatibility +try: + FileNotFoundError +except NameError: + FileNotFoundError = IOError + ARGPARSE = argparse.ArgumentParser( - description=("A script that computes LoC for a build dir or from a" - "compile_commands.json file"), + description=("A script that computes LoC for a build dir"), epilog="""Examples: Count with default settings for build in out/Default: locs.py --build-dir out/Default - Count with default settings according to given compile_commands file: - locs.py --compile-commands compile_commands.json Count only a custom group of files settings for build in out/Default: tools/locs.py --build-dir out/Default --group src-compiler '\.\./\.\./src/compiler' @@ -54,19 +60,14 @@ ARGPARSE.add_argument( ARGPARSE.add_argument( '--build-dir', type=str, - default="", - help="Use specified build dir and generate necessary files") + help="Use specified build dir and generate necessary files", + required=True) ARGPARSE.add_argument( '--echocmd', action='store_true', default=False, help="output command used to compute LoC") ARGPARSE.add_argument( - '--compile-commands', - type=str, - default='compile_commands.json', - help="Use specified compile_commands.json file") -ARGPARSE.add_argument( '--only', action='append', default=[], @@ -115,6 +116,11 @@ ARGPARSE.add_argument( default=0, const=3, help="Output results for each file separately") +ARGPARSE.add_argument( + '--jobs', + type=int, + default=multiprocessing.cpu_count(), + help="Process specified number of files concurrently") ARGS = vars(ARGPARSE.parse_args()) @@ -126,37 +132,46 @@ def MaxWidth(strings): return max_width -def GenerateCompileCommandsAndBuild(build_dir, compile_commands_file, out): +def GenerateCompileCommandsAndBuild(build_dir, out): if not os.path.isdir(build_dir): print("Error: Specified build dir {} is not a directory.".format( build_dir), file=sys.stderr) exit(1) - compile_commands_file = "{}/compile_commands.json".format(build_dir) + autoninja = "autoninja -C {}".format(build_dir) + if subprocess.call(autoninja, shell=True, stdout=out) != 0: + print("Error: Building {} failed.".format(build_dir), file=sys.stderr) + exit(1) + + compile_commands_file = "{}/compile_commands.json".format(build_dir) print("Generating compile commands in {}.".format( compile_commands_file), file=out) - ninja = "ninja -C {} -t compdb cxx cc > {}".format( build_dir, compile_commands_file) if subprocess.call(ninja, shell=True, stdout=out) != 0: print("Error: Cound not generate {} for {}.".format( - compile_commands_file, build_dir), file=sys.stderr) + compile_commands_file, build_dir), file=sys.stderr) exit(1) - autoninja = "autoninja -C {} v8_generated_cc_files".format(build_dir) - if subprocess.call(autoninja, shell=True, stdout=out) != 0: - print("Error: Building target 'v8_generated_cc_files'" - " failed for {}.".format(build_dir), file=sys.stderr) + ninja_deps_file = "{}/ninja-deps.txt".format(build_dir) + print("Generating ninja dependencies in {}.".format( + ninja_deps_file), file=out) + ninja = "ninja -C {} -t deps > {}".format( + build_dir, ninja_deps_file) + if subprocess.call(ninja, shell=True, stdout=out) != 0: + print("Error: Cound not generate {} for {}.".format( + ninja_deps_file, build_dir), file=sys.stderr) exit(1) - return compile_commands_file + return compile_commands_file, ninja_deps_file + -def fmt_bytes(bytes): - if bytes > 1024*1024*1024: - return int(bytes / (1024*1024)), "MB" - elif bytes > 1024*1024: - return int(bytes / (1024)), "kB" - return int(bytes), " B" +def fmt_bytes(num_bytes): + if num_bytes > 1024*1024*1024: + return int(num_bytes / (1024*1024)), "MB" + elif num_bytes > 1024*1024: + return int(num_bytes / (1024)), "kB" + return int(num_bytes), " B" class CompilationData: @@ -175,13 +190,15 @@ class CompilationData: return "{:>9,} LoC ({:>7,} {}) to {:>12,} LoC ({:>7,} {}) ({:>5.0f}x)".format( self.loc, in_bytes, in_unit, self.expanded, exp_bytes, exp_unit, self.ratio()) + class File(CompilationData): - def __init__(self, file, loc, in_bytes, expanded, expanded_bytes): + def __init__(self, file, target, loc, in_bytes, expanded, expanded_bytes): super().__init__(loc, in_bytes, expanded, expanded_bytes) self.file = file + self.target = target def to_string(self): - return "{} {}".format(super().to_string(), self.file) + return "{} {} {}".format(super().to_string(), self.file, self.target) class Group(CompilationData): @@ -245,6 +262,8 @@ class Results: def __init__(self): self.groups = SetupReportGroups() self.units = {} + self.source_dependencies = {} + self.header_dependents = {} def track(self, filename): is_tracked = False @@ -253,8 +272,8 @@ class Results: is_tracked = True return is_tracked - def recordFile(self, filename, loc, in_bytes, expanded, expanded_bytes): - unit = File(filename, loc, in_bytes, expanded, expanded_bytes) + def recordFile(self, filename, targetname, loc, in_bytes, expanded, expanded_bytes): + unit = File(filename, targetname, loc, in_bytes, expanded, expanded_bytes) self.units[filename] = unit for group in self.groups.values(): group.account(unit) @@ -270,17 +289,23 @@ class Results: for unit in sorted(list(self.units.values()), key=key, reverse=reverse)[:count]: print(unit.to_string(), file=out) + def addHeaderDeps(self, source_dependencies, header_dependents): + self.source_dependencies = source_dependencies + self.header_dependents = header_dependents + class LocsEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, File): - return {"file": o.file, "loc": o.loc, "in_bytes": o.in_bytes, + return {"file": o.file, "target": o.target, "loc": o.loc, "in_bytes": o.in_bytes, "expanded": o.expanded, "expanded_bytes": o.expanded_bytes} if isinstance(o, Group): return {"name": o.name, "loc": o.loc, "in_bytes": o.in_bytes, "expanded": o.expanded, "expanded_bytes": o.expanded_bytes} if isinstance(o, Results): - return {"groups": o.groups, "units": o.units} + return {"groups": o.groups, "units": o.units, + "source_dependencies": o.source_dependencies, + "header_dependents": o.header_dependents} return json.JSONEncoder.default(self, o) @@ -290,7 +315,8 @@ class StatusLine: def print(self, statusline, end="\r", file=sys.stdout): self.max_width = max(self.max_width, len(statusline)) - print("{0:<{1}}".format(statusline, self.max_width), end=end, file=file, flush=True) + print("{0:<{1}}".format(statusline, self.max_width), + end=end, file=file, flush=True) class CommandSplitter: @@ -299,72 +325,110 @@ class CommandSplitter: "([^\\s]*\\s+)?(?P<clangcmd>[^\\s]*clang.*)" " -c (?P<infile>.*) -o (?P<outfile>.*)") - def process(self, compilation_unit, temp_file_name): + def process(self, compilation_unit): cmd = self.cmd_pattern.match(compilation_unit['command']) - outfilename = cmd.group('outfile') + ".cc" + outfilename = cmd.group('outfile') infilename = cmd.group('infile') infile = Path(compilation_unit['directory']).joinpath(infilename) - outfile = Path(str(temp_file_name)).joinpath(outfilename) - return [cmd.group('clangcmd'), infilename, infile, outfile] + return (cmd.group('clangcmd'), infilename, infile, outfilename) + + +def parse_ninja_deps(ninja_deps): + source_dependencies = {} + header_dependents = defaultdict(int) + current_target = None + for line in ninja_deps: + line = line.rstrip() + # Ignore empty lines + if not line: + current_target = None + continue + if line[0] == ' ': + # New dependency + if len(line) < 5 or line[0:4] != ' ' or line[5] == ' ': + sys.exit('Lines must have no indentation or exactly four ' + + 'spaces.') + dep = line[4:] + if not re.search(r"\.(h|hpp)$", dep): + continue + header_dependents[dep] += 1 + continue + # New target + colon_pos = line.find(':') + if colon_pos < 0: + sys.exit('Unindented line must have a colon') + if current_target is not None: + sys.exit('Missing empty line before new target') + current_target = line[0:colon_pos] + match = re.search(r"#deps (\d+)", line) + deps_number = match.group(1) + source_dependencies[current_target] = int(deps_number) + + return (source_dependencies, header_dependents) def Main(): - compile_commands_file = ARGS['compile_commands'] out = sys.stdout if ARGS['json']: out = sys.stderr - if ARGS['build_dir']: - compile_commands_file = GenerateCompileCommandsAndBuild( - ARGS['build_dir'], compile_commands_file, out) + compile_commands_file, ninja_deps_file = GenerateCompileCommandsAndBuild( + ARGS['build_dir'], out) + + result = Results() + status = StatusLine() try: with open(compile_commands_file) as file: - data = json.load(file) + compile_commands = json.load(file) + with open(ninja_deps_file) as file: + source_dependencies, header_dependents = parse_ninja_deps(file) + result.addHeaderDeps(source_dependencies, header_dependents) except FileNotFoundError: - print("Error: Cannot read '{}'. Consult --help to get started.") + print("Error: Cannot read '{}'. Consult --help to get started.".format( + ninja_deps_file)) exit(1) - result = Results() - status = StatusLine() + cmd_splitter = CommandSplitter() + + def count_lines_of_unit(ikey): + i, key = ikey + if not result.track(key['file']): + return + message = "[{}/{}] Counting LoCs of {}".format( + i, len(compile_commands), key['file']) + status.print(message, file=out) + clangcmd, infilename, infile, outfilename = cmd_splitter.process(key) + if not infile.is_file(): + return + + clangcmd = clangcmd + " -E -P " + \ + str(infile) + " -o /dev/stdout | sed '/^\\s*$/d' | wc -lc" + loccmd = ("cat {} | sed '\\;^\\s*//;d' | sed '\\;^/\\*;d'" + " | sed '/^\\*/d' | sed '/^\\s*$/d' | wc -lc") + loccmd = loccmd.format(infile) + runcmd = " {} ; {}".format(clangcmd, loccmd) + if ARGS['echocmd']: + print(runcmd) + process = subprocess.Popen( + runcmd, shell=True, cwd=key['directory'], stdout=subprocess.PIPE) + p = {'process': process, 'infile': infilename, 'outfile': outfilename} + output, _ = p['process'].communicate() + expanded, expanded_bytes, loc, in_bytes = list(map(int, output.split())) + result.recordFile(p['infile'], p['outfile'], loc, + in_bytes, expanded, expanded_bytes) with tempfile.TemporaryDirectory(dir='/tmp/', prefix="locs.") as temp: - processes = [] start = time.time() - cmd_splitter = CommandSplitter() - for i, key in enumerate(data): - if not result.track(key['file']): - continue - status.print("[{}/{}] Counting LoCs of {}".format(i, len(data), key['file']), - file=out) - clangcmd, infilename, infile, outfile = cmd_splitter.process(key, temp) - outfile.parent.mkdir(parents=True, exist_ok=True) - if infile.is_file(): - clangcmd = clangcmd + " -E -P " + \ - str(infile) + " -o /dev/stdout | sed '/^\\s*$/d' | wc -lc" - loccmd = ("cat {} | sed '\\;^\\s*//;d' | sed '\\;^/\\*;d'" - " | sed '/^\\*/d' | sed '/^\\s*$/d' | wc -lc").format( - infile) - runcmd = " {} ; {}".format(clangcmd, loccmd) - if ARGS['echocmd']: - print(runcmd) - p = subprocess.Popen( - runcmd, shell=True, cwd=key['directory'], stdout=subprocess.PIPE) - processes.append({'process': p, 'infile': infilename}) - - for i, p in enumerate(processes): - status.print("[{}/{}] Summing up {}".format( - i, len(processes), p['infile']), file=out) - output, err = p['process'].communicate() - expanded, expanded_bytes, loc, in_bytes = list(map(int, output.split())) - result.recordFile(p['infile'], loc, in_bytes, expanded, expanded_bytes) + with ThreadPoolExecutor(max_workers=ARGS['jobs']) as executor: + list(executor.map(count_lines_of_unit, enumerate(compile_commands))) end = time.time() if ARGS['json']: print(json.dumps(result, ensure_ascii=False, cls=LocsEncoder)) status.print("Processed {:,} files in {:,.2f} sec.".format( - len(processes), end-start), end="\n", file=out) + len(compile_commands), end-start), end="\n", file=out) result.printGroupResults(file=out) if ARGS['largest']: diff --git a/deps/v8/tools/node/fetch_deps.py b/deps/v8/tools/node/fetch_deps.py index cc740c3d97..c87e7a5e0c 100755 --- a/deps/v8/tools/node/fetch_deps.py +++ b/deps/v8/tools/node/fetch_deps.py @@ -35,6 +35,7 @@ GCLIENT_SOLUTION = [ "v8/test/test262/harness" : None, "v8/third_party/android_ndk" : None, "v8/third_party/android_tools" : None, + "v8/third_party/android_sdk" : None, "v8/third_party/catapult" : None, "v8/third_party/colorama/src" : None, "v8/third_party/fuchsia-sdk" : None, diff --git a/deps/v8/tools/release/auto_roll.py b/deps/v8/tools/release/auto_roll.py index d6ede67082..829aefb4ce 100755 --- a/deps/v8/tools/release/auto_roll.py +++ b/deps/v8/tools/release/auto_roll.py @@ -17,13 +17,17 @@ ROLL_SUMMARY = ("Summary of changes available at:\n" ISSUE_MSG = ( """Please follow these instructions for assigning/CC'ing issues: -https://github.com/v8/v8/wiki/Triaging%20issues +https://v8.dev/docs/triage-issues Please close rolling in case of a roll revert: https://v8-roll.appspot.com/ This only works with a Google account. -CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux-blink-rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;luci.chromium.try:android_optional_gpu_tests_rel""") +CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux-blink-rel +CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux_optional_gpu_tests_rel +CQ_INCLUDE_TRYBOTS=luci.chromium.try:mac_optional_gpu_tests_rel +CQ_INCLUDE_TRYBOTS=luci.chromium.try:win_optional_gpu_tests_rel +CQ_INCLUDE_TRYBOTS=luci.chromium.try:android_optional_gpu_tests_rel""") class Preparation(Step): MESSAGE = "Preparation." diff --git a/deps/v8/tools/release/filter_build_files.py b/deps/v8/tools/release/filter_build_files.py index 032848e3cc..1afabe8262 100755 --- a/deps/v8/tools/release/filter_build_files.py +++ b/deps/v8/tools/release/filter_build_files.py @@ -23,6 +23,10 @@ import sys EXECUTABLE_FILES = [ 'd8', +] + +# Additional executable files added only to ref archive type. +REFBUILD_EXECUTABLE_FILES = [ 'cctest', ] @@ -52,7 +56,7 @@ def main(argv): help='Path to an output file. The files will ' 'be stored in json list with absolute paths.') parser.add_argument('-t', '--type', - choices=['all', 'exe', 'lib'], default='all', + choices=['all', 'exe', 'lib', 'ref'], default='all', help='Specifies the archive type.') args = parser.parse_args() @@ -61,8 +65,8 @@ def main(argv): args.dir = os.path.abspath(args.dir) - # Skip libraries for exe archive type. - if args.type == 'exe': + # Skip libraries for exe and ref archive types. + if args.type in ('exe', 'ref'): library_files = [] else: library_files = LIBRARY_FILES[args.platform] @@ -73,6 +77,9 @@ def main(argv): else: executable_files = EXECUTABLE_FILES + if args.type == 'ref': + executable_files.extend(REFBUILD_EXECUTABLE_FILES) + list_of_files = [] def add_files_from_globs(globs): list_of_files.extend(itertools.chain(*map(glob.iglob, globs))) diff --git a/deps/v8/tools/release/test_scripts.py b/deps/v8/tools/release/test_scripts.py index c1a571ca24..62158d9552 100755 --- a/deps/v8/tools/release/test_scripts.py +++ b/deps/v8/tools/release/test_scripts.py @@ -1001,13 +1001,17 @@ Summary of changes available at: https://chromium.googlesource.com/v8/v8/+log/last_rol..roll_hsh Please follow these instructions for assigning/CC'ing issues: -https://github.com/v8/v8/wiki/Triaging%20issues +https://v8.dev/docs/triage-issues Please close rolling in case of a roll revert: https://v8-roll.appspot.com/ This only works with a Google account. -CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux-blink-rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;luci.chromium.try:android_optional_gpu_tests_rel +CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux-blink-rel +CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux_optional_gpu_tests_rel +CQ_INCLUDE_TRYBOTS=luci.chromium.try:mac_optional_gpu_tests_rel +CQ_INCLUDE_TRYBOTS=luci.chromium.try:win_optional_gpu_tests_rel +CQ_INCLUDE_TRYBOTS=luci.chromium.try:android_optional_gpu_tests_rel TBR=reviewer@chromium.org""" diff --git a/deps/v8/tools/run-perf.sh b/deps/v8/tools/run-perf.sh index 83750936c8..0317a9a1ec 100755 --- a/deps/v8/tools/run-perf.sh +++ b/deps/v8/tools/run-perf.sh @@ -55,4 +55,4 @@ perf record -R \ -e $EVENT_TYPE \ -c $SAMPLE_EVERY_N_CYCLES \ --call-graph $CALL_GRAPH_METHOD \ - -i "$COMMAND" --perf_basic_prof "$@" + -i "$COMMAND" --perf-basic-prof "$@" diff --git a/deps/v8/tools/run-wasm-api-tests.py b/deps/v8/tools/run-wasm-api-tests.py new file mode 100644 index 0000000000..46e13d3255 --- /dev/null +++ b/deps/v8/tools/run-wasm-api-tests.py @@ -0,0 +1,163 @@ +#!/usr/bin/env python +# +# Copyright 2019 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +"""\ +Helper script for compiling and running the Wasm C/C++ API examples. + +Usage: tools/run-wasm-api-tests.py outdir tempdir [filters...] + +"outdir" is the build output directory containing libwee8, e.g. out/x64.release +"tempdir" is a temporary dir where this script may put its artifacts. It is +the caller's responsibility to clean it up afterwards. + +By default, this script builds and runs all examples, both the respective +C and C++ versions, both with GCC ("gcc" and "g++" binaries found in $PATH) +and V8's bundled Clang in third_party/llvm-build/. You can use any number +of "filters" arguments to run only a subset: + - "c": run C versions of examples + - "cc": run C++ versions of examples + - "gcc": compile with GCC + - "clang": compile with Clang + - "hello" etc.: run "hello" example +""" + +from __future__ import print_function + +import os +import shutil +import subprocess +import sys + +CFLAGS = "-DDEBUG -Wall -Werror -O0 -fsanitize=address" + +CHECKOUT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +WASM_PATH = os.path.join(CHECKOUT_PATH, "third_party", "wasm-api") +CLANG_PATH = os.path.join(CHECKOUT_PATH, "third_party", "llvm-build", + "Release+Asserts", "bin") + +EXAMPLES = ["hello", "callback", "trap", "reflect", "global", "table", + "memory", "finalize", "serialize", "threads"] + +CLANG = { + "name": "Clang", + "c": os.path.join(CLANG_PATH, "clang"), + "cc": os.path.join(CLANG_PATH, "clang++"), + "ldflags": "-fsanitize-memory-track-origins -fsanitize-memory-use-after-dtor", +} +GCC = { + "name": "GCC", + "c": "gcc", + "cc": "g++", + "ldflags": "", +} + +C = { + "name": "C", + "suffix": "c", + "cflags": "", +} +CXX = { + "name": "C++", + "suffix": "cc", + "cflags": "-std=c++11", +} + +MIN_ARGS = 3 # Script, outdir, tempdir + +def _Call(cmd_list, silent=False): + cmd = " ".join(cmd_list) + if not silent: print("# %s" % cmd) + return subprocess.call(cmd, shell=True) + +class Runner(object): + def __init__(self, name, outdir, tempdir): + self.name = name + self.outdir = outdir + self.tempdir = tempdir + self.src_file_basename = os.path.join(WASM_PATH, "example", name) + self.dst_file_basename = os.path.join(tempdir, name) + self.lib_file = os.path.join(outdir, "obj", "libwee8.a") + if not os.path.exists(self.lib_file): + print("libwee8 library not found, make sure to pass the outdir as " + "first argument; see --help") + sys.exit(1) + src_wasm_file = self.src_file_basename + ".wasm" + dst_wasm_file = self.dst_file_basename + ".wasm" + shutil.copyfile(src_wasm_file, dst_wasm_file) + + def _Error(self, step, lang, compiler): + print("Error: %s failed. To repro: tools/run-wasm-api-tests.py " + "%s %s %s %s %s" % + (step, self.outdir, self.tempdir, self.name, lang, + compiler["name"].lower())) + + + def CompileAndRun(self, compiler, language): + print("==== %s %s/%s ====" % + (self.name, language["name"], compiler["name"])) + lang = language["suffix"] + src_file = self.src_file_basename + "." + lang + exe_file = self.dst_file_basename + "-" + lang + obj_file = exe_file + ".o" + # Compile. + c = _Call([compiler[lang], "-c", language["cflags"], CFLAGS, + "-I", WASM_PATH, "-o", obj_file, src_file]) + if c: return self._Error("compilation", lang, compiler) + # Link. + c = _Call([compiler["cc"], CFLAGS, compiler["ldflags"], obj_file, + "-o", exe_file, self.lib_file, "-ldl -pthread"]) + if c: return self._Error("linking", lang, compiler) + # Execute. + exe_file = "./%s-%s" % (self.name, lang) + c = _Call(["cd", self.tempdir, ";", exe_file]) + if c: return self._Error("execution", lang, compiler) + return 0 + +def Main(args): + if (len(args) < MIN_ARGS or args[1] in ("-h", "--help", "help")): + print(__doc__) + return 1 + + outdir = sys.argv[1] + tempdir = sys.argv[2] + result = 0 + examples = EXAMPLES + compilers = (GCC, CLANG) + languages = (C, CXX) + if len(args) > MIN_ARGS: + custom_compilers = [] + custom_languages = [] + custom_examples = [] + for i in range(MIN_ARGS, len(args)): + arg = args[i] + if arg == "c" and C not in custom_languages: + custom_languages.append(C) + elif arg in ("cc", "cpp", "cxx", "c++") and CXX not in custom_languages: + custom_languages.append(CXX) + elif arg in ("gcc", "g++") and GCC not in custom_compilers: + custom_compilers.append(GCC) + elif arg in ("clang", "clang++") and CLANG not in custom_compilers: + custom_compilers.append(CLANG) + elif arg in EXAMPLES and arg not in custom_examples: + custom_examples.append(arg) + else: + print("Didn't understand '%s'" % arg) + return 1 + if custom_compilers: + compilers = custom_compilers + if custom_languages: + languages = custom_languages + if custom_examples: + examples = custom_examples + for example in examples: + runner = Runner(example, outdir, tempdir) + for compiler in compilers: + for language in languages: + c = runner.CompileAndRun(compiler, language) + if c: result = c + return result + +if __name__ == "__main__": + sys.exit(Main(sys.argv)) diff --git a/deps/v8/tools/run_perf.py b/deps/v8/tools/run_perf.py index 88856d1530..9e05be99e5 100755 --- a/deps/v8/tools/run_perf.py +++ b/deps/v8/tools/run_perf.py @@ -19,6 +19,10 @@ The suite json format is expected to be: "test_flags": [<flag to the test file>, ...], "run_count": <how often will this suite run (optional)>, "run_count_XXX": <how often will this suite run for arch XXX (optional)>, + "timeout": <how long test is allowed to run>, + "timeout_XXX": <how long test is allowed run run for arch XXX>, + "retry_count": <how many times to retry failures (in addition to first try)", + "retry_count_XXX": <how many times to retry failures for arch XXX> "resources": [<js file to be moved to android device>, ...] "main": <main js perf runner file>, "results_regexp": <optional regexp>, @@ -104,6 +108,7 @@ from __future__ import print_function from functools import reduce from collections import OrderedDict +import datetime import json import logging import math @@ -124,16 +129,16 @@ except NameError: # Python 3 basestring = str ARCH_GUESS = utils.DefaultArch() -SUPPORTED_ARCHS = ["arm", - "ia32", - "mips", - "mipsel", - "x64", - "arm64"] - -GENERIC_RESULTS_RE = re.compile(r"^RESULT ([^:]+): ([^=]+)= ([^ ]+) ([^ ]*)$") -RESULT_STDDEV_RE = re.compile(r"^\{([^\}]+)\}$") -RESULT_LIST_RE = re.compile(r"^\[([^\]]+)\]$") +SUPPORTED_ARCHS = ['arm', + 'ia32', + 'mips', + 'mipsel', + 'x64', + 'arm64'] + +GENERIC_RESULTS_RE = re.compile(r'^RESULT ([^:]+): ([^=]+)= ([^ ]+) ([^ ]*)$') +RESULT_STDDEV_RE = re.compile(r'^\{([^\}]+)\}$') +RESULT_LIST_RE = re.compile(r'^\[([^\]]+)\]$') TOOLS_BASE = os.path.abspath(os.path.dirname(__file__)) INFRA_FAILURE_RETCODE = 87 @@ -157,17 +162,26 @@ class Results(object): def __init__(self, traces=None, errors=None): self.traces = traces or [] self.errors = errors or [] + self.timeouts = [] + self.near_timeouts = [] # > 90% of the max runtime def ToDict(self): - return {"traces": self.traces, "errors": self.errors} + return { + 'traces': self.traces, + 'errors': self.errors, + 'timeouts': self.timeouts, + 'near_timeouts': self.near_timeouts, + } def WriteToFile(self, file_name): - with open(file_name, "w") as f: + with open(file_name, 'w') as f: f.write(json.dumps(self.ToDict())) def __add__(self, other): self.traces += other.traces self.errors += other.errors + self.timeouts += other.timeouts + self.near_timeouts += other.near_timeouts return self def __str__(self): # pragma: no cover @@ -188,7 +202,7 @@ class Measurement(object): self.stddev_regexp = stddev_regexp self.results = [] self.errors = [] - self.stddev = "" + self.stddev = '' self.process_size = False def ConsumeOutput(self, stdout): @@ -196,28 +210,28 @@ class Measurement(object): result = re.search(self.results_regexp, stdout, re.M).group(1) self.results.append(str(float(result))) except ValueError: - self.errors.append("Regexp \"%s\" returned a non-numeric for test %s." + self.errors.append('Regexp "%s" returned a non-numeric for test %s.' % (self.results_regexp, self.name)) except: - self.errors.append("Regexp \"%s\" didn't match for test %s." + self.errors.append('Regexp "%s" did not match for test %s.' % (self.results_regexp, self.name)) try: if self.stddev_regexp and self.stddev: - self.errors.append("Test %s should only run once since a stddev " - "is provided by the test." % self.name) + self.errors.append('Test %s should only run once since a stddev ' + 'is provided by the test.' % self.name) if self.stddev_regexp: self.stddev = re.search(self.stddev_regexp, stdout, re.M).group(1) except: - self.errors.append("Regexp \"%s\" didn't match for test %s." + self.errors.append('Regexp "%s" did not match for test %s.' % (self.stddev_regexp, self.name)) def GetResults(self): return Results([{ - "graphs": self.graphs, - "units": self.units, - "results": self.results, - "stddev": self.stddev, + 'graphs': self.graphs, + 'units': self.units, + 'results': self.results, + 'stddev': self.stddev, }], self.errors) @@ -255,7 +269,7 @@ def RunResultsProcessor(results_processor, stdout, count): stderr=subprocess.PIPE, ) result, _ = p.communicate(input=stdout) - logging.info(">>> Processed stdout (#%d):\n%s", count, result) + logging.info('>>> Processed stdout (#%d):\n%s', count, result) return result @@ -267,7 +281,7 @@ def AccumulateResults( Args: graph_names: List of names that configure the base path of the traces. E.g. ['v8', 'Octane']. - trace_configs: List of "TraceConfig" instances. Each trace config defines + trace_configs: List of 'TraceConfig' instances. Each trace config defines how to perform a measurement. iter_output: Iterator over the standard output of each test run. perform_measurement: Whether to actually run tests and perform measurements. @@ -275,7 +289,7 @@ def AccumulateResults( and trybot, but want to ignore second run on CI without having to spread this logic throughout the script. calc_total: Boolean flag to speficy the calculation of a summary trace. - Returns: A "Results" object. + Returns: A 'Results' object. """ measurements = [ trace.CreateMeasurement(perform_measurement) for trace in trace_configs] @@ -289,21 +303,21 @@ def AccumulateResults( return res # Assume all traces have the same structure. - if len(set(map(lambda t: len(t["results"]), res.traces))) != 1: - res.errors.append("Not all traces have the same number of results.") + if len(set(map(lambda t: len(t['results']), res.traces))) != 1: + res.errors.append('Not all traces have the same number of results.') return res # Calculate the geometric means for all traces. Above we made sure that # there is at least one trace and that the number of results is the same # for each trace. - n_results = len(res.traces[0]["results"]) - total_results = [GeometricMean(t["results"][i] for t in res.traces) + n_results = len(res.traces[0]['results']) + total_results = [GeometricMean(t['results'][i] for t in res.traces) for i in range(0, n_results)] res.traces.append({ - "graphs": graph_names + ["Total"], - "units": res.traces[0]["units"], - "results": total_results, - "stddev": "", + 'graphs': graph_names + ['Total'], + 'units': res.traces[0]['units'], + 'results': total_results, + 'stddev': '', }) return res @@ -317,7 +331,7 @@ def AccumulateGenericResults(graph_names, suite_units, iter_output): ['v8', 'Octane']. suite_units: Measurement default units as defined by the benchmark suite. iter_output: Iterator over the standard output of each test run. - Returns: A "Results" object. + Returns: A 'Results' object. """ traces = OrderedDict() for stdout in iter_output(): @@ -327,7 +341,7 @@ def AccumulateGenericResults(graph_names, suite_units, iter_output): for line in stdout.strip().splitlines(): match = GENERIC_RESULTS_RE.match(line) if match: - stddev = "" + stddev = '' graph = match.group(1) trace = match.group(2) body = match.group(3) @@ -336,10 +350,10 @@ def AccumulateGenericResults(graph_names, suite_units, iter_output): match_list = RESULT_LIST_RE.match(body) errors = [] if match_stddev: - result, stddev = map(str.strip, match_stddev.group(1).split(",")) + result, stddev = map(str.strip, match_stddev.group(1).split(',')) results = [result] elif match_list: - results = map(str.strip, match_list.group(1).split(",")) + results = map(str.strip, match_list.group(1).split(',')) else: results = [body.strip()] @@ -347,17 +361,17 @@ def AccumulateGenericResults(graph_names, suite_units, iter_output): results = map(lambda r: str(float(r)), results) except ValueError: results = [] - errors = ["Found non-numeric in %s" % - "/".join(graph_names + [graph, trace])] + errors = ['Found non-numeric in %s' % + '/'.join(graph_names + [graph, trace])] trace_result = traces.setdefault(trace, Results([{ - "graphs": graph_names + [graph, trace], - "units": (units or suite_units).strip(), - "results": [], - "stddev": "", + 'graphs': graph_names + [graph, trace], + 'units': (units or suite_units).strip(), + 'results': [], + 'stddev': '', }], errors)) - trace_result.traces[0]["results"].extend(results) - trace_result.traces[0]["stddev"] = stddev + trace_result.traces[0]['results'].extend(results) + trace_result.traces[0]['stddev'] = stddev return reduce(lambda r, t: r + t, traces.itervalues(), Results()) @@ -373,11 +387,12 @@ class Node(object): class DefaultSentinel(Node): """Fake parent node with all default values.""" - def __init__(self, binary = "d8"): + def __init__(self, binary = 'd8'): super(DefaultSentinel, self).__init__() self.binary = binary self.run_count = 10 self.timeout = 60 + self.retry_count = 0 self.path = [] self.graphs = [] self.flags = [] @@ -387,7 +402,7 @@ class DefaultSentinel(Node): self.results_processor = None self.results_regexp = None self.stddev_regexp = None - self.units = "score" + self.units = 'score' self.total = False self.owners = [] @@ -401,34 +416,36 @@ class GraphConfig(Node): super(GraphConfig, self).__init__() self._suite = suite - assert isinstance(suite.get("path", []), list) - assert isinstance(suite.get("owners", []), list) - assert isinstance(suite["name"], basestring) - assert isinstance(suite.get("flags", []), list) - assert isinstance(suite.get("test_flags", []), list) - assert isinstance(suite.get("resources", []), list) + assert isinstance(suite.get('path', []), list) + assert isinstance(suite.get('owners', []), list) + assert isinstance(suite['name'], basestring) + assert isinstance(suite.get('flags', []), list) + assert isinstance(suite.get('test_flags', []), list) + assert isinstance(suite.get('resources', []), list) # Accumulated values. - self.path = parent.path[:] + suite.get("path", []) - self.graphs = parent.graphs[:] + [suite["name"]] - self.flags = parent.flags[:] + suite.get("flags", []) - self.test_flags = parent.test_flags[:] + suite.get("test_flags", []) - self.owners = parent.owners[:] + suite.get("owners", []) + self.path = parent.path[:] + suite.get('path', []) + self.graphs = parent.graphs[:] + [suite['name']] + self.flags = parent.flags[:] + suite.get('flags', []) + self.test_flags = parent.test_flags[:] + suite.get('test_flags', []) + self.owners = parent.owners[:] + suite.get('owners', []) # Values independent of parent node. - self.resources = suite.get("resources", []) + self.resources = suite.get('resources', []) # Descrete values (with parent defaults). - self.binary = suite.get("binary", parent.binary) - self.run_count = suite.get("run_count", parent.run_count) - self.run_count = suite.get("run_count_%s" % arch, self.run_count) - self.timeout = suite.get("timeout", parent.timeout) - self.timeout = suite.get("timeout_%s" % arch, self.timeout) - self.units = suite.get("units", parent.units) - self.total = suite.get("total", parent.total) + self.binary = suite.get('binary', parent.binary) + self.run_count = suite.get('run_count', parent.run_count) + self.run_count = suite.get('run_count_%s' % arch, self.run_count) + self.retry_count = suite.get('retry_count', parent.retry_count) + self.retry_count = suite.get('retry_count_%s' % arch, self.retry_count) + self.timeout = suite.get('timeout', parent.timeout) + self.timeout = suite.get('timeout_%s' % arch, self.timeout) + self.units = suite.get('units', parent.units) + self.total = suite.get('total', parent.total) self.results_processor = suite.get( - "results_processor", parent.results_processor) - self.process_size = suite.get("process_size", parent.process_size) + 'results_processor', parent.results_processor) + self.process_size = suite.get('process_size', parent.process_size) # A regular expression for results. If the parent graph provides a # regexp and the current suite has none, a string place holder for the @@ -436,17 +453,17 @@ class GraphConfig(Node): # TODO(machenbach): Currently that makes only sense for the leaf level. # Multiple place holders for multiple levels are not supported. if parent.results_regexp: - regexp_default = parent.results_regexp % re.escape(suite["name"]) + regexp_default = parent.results_regexp % re.escape(suite['name']) else: regexp_default = None - self.results_regexp = suite.get("results_regexp", regexp_default) + self.results_regexp = suite.get('results_regexp', regexp_default) # A similar regular expression for the standard deviation (optional). if parent.stddev_regexp: - stddev_default = parent.stddev_regexp % re.escape(suite["name"]) + stddev_default = parent.stddev_regexp % re.escape(suite['name']) else: stddev_default = None - self.stddev_regexp = suite.get("stddev_regexp", stddev_default) + self.stddev_regexp = suite.get('stddev_regexp', stddev_default) class TraceConfig(GraphConfig): @@ -471,9 +488,14 @@ class TraceConfig(GraphConfig): class RunnableConfig(GraphConfig): """Represents a runnable suite definition (i.e. has a main file). """ + def __init__(self, suite, parent, arch): + super(RunnableConfig, self).__init__(suite, parent, arch) + self.has_timeouts = False + self.has_near_timeouts = False + @property def main(self): - return self._suite.get("main", "") + return self._suite.get('main', '') def PostProcess(self, stdouts_iter): if self.results_processor: @@ -494,17 +516,17 @@ class RunnableConfig(GraphConfig): os.chdir(os.path.join(suite_dir, bench_dir)) def GetCommandFlags(self, extra_flags=None): - suffix = ["--"] + self.test_flags if self.test_flags else [] + suffix = ['--'] + self.test_flags if self.test_flags else [] return self.flags + (extra_flags or []) + [self.main] + suffix def GetCommand(self, cmd_prefix, shell_dir, extra_flags=None): # TODO(machenbach): This requires +.exe if run on windows. extra_flags = extra_flags or [] if self.binary != 'd8' and '--prof' in extra_flags: - logging.info("Profiler supported only on a benchmark run with d8") + logging.info('Profiler supported only on a benchmark run with d8') if self.process_size: - cmd_prefix = ["/usr/bin/time", "--format=MaxMemory: %MKB"] + cmd_prefix + cmd_prefix = ['/usr/bin/time', '--format=MaxMemory: %MKB'] + cmd_prefix if self.binary.endswith('.py'): # Copy cmd_prefix instead of update (+=). cmd_prefix = cmd_prefix + [sys.executable] @@ -572,23 +594,23 @@ def MakeGraphConfig(suite, arch, parent): if isinstance(parent, RunnableConfig): # Below a runnable can only be traces. return TraceConfig(suite, parent, arch) - elif suite.get("main") is not None: + elif suite.get('main') is not None: # A main file makes this graph runnable. Empty strings are accepted. - if suite.get("tests"): + if suite.get('tests'): # This graph has subgraphs (traces). return RunnableConfig(suite, parent, arch) else: # This graph has no subgraphs, it's a leaf. return RunnableTraceConfig(suite, parent, arch) - elif suite.get("generic"): + elif suite.get('generic'): # This is a generic suite definition. It is either a runnable executable # or has a main js file. return RunnableGenericConfig(suite, parent, arch) - elif suite.get("tests"): + elif suite.get('tests'): # This is neither a leaf nor a runnable. return GraphConfig(suite, parent, arch) else: # pragma: no cover - raise Exception("Invalid suite configuration.") + raise Exception('Invalid suite configuration.') def BuildGraphConfigs(suite, arch, parent): @@ -597,11 +619,11 @@ def BuildGraphConfigs(suite, arch, parent): """ # TODO(machenbach): Implement notion of cpu type? - if arch not in suite.get("archs", SUPPORTED_ARCHS): + if arch not in suite.get('archs', SUPPORTED_ARCHS): return None graph = MakeGraphConfig(suite, arch, parent) - for subsuite in suite.get("tests", []): + for subsuite in suite.get('tests', []): BuildGraphConfigs(subsuite, arch, graph) parent.AppendChild(graph) return graph @@ -619,7 +641,7 @@ def FlattenRunnables(node, node_cb): for result in FlattenRunnables(child, node_cb): yield result else: # pragma: no cover - raise Exception("Invalid suite configuration.") + raise Exception('Invalid suite configuration.') class Platform(object): @@ -647,6 +669,14 @@ class Platform(object): def _Run(self, runnable, count, secondary=False): raise NotImplementedError() # pragma: no cover + def _TimedRun(self, runnable, count, secondary=False): + runnable_start_time = datetime.datetime.utcnow() + stdout = self._Run(runnable, count, secondary) + runnable_duration = datetime.datetime.utcnow() - runnable_start_time + if runnable_duration.total_seconds() > 0.9 * runnable.timeout: + runnable.has_near_timeouts = True + return stdout + def Run(self, runnable, count): """Execute the benchmark's main file. @@ -658,9 +688,9 @@ class Platform(object): Returns: A tuple with the two benchmark outputs. The latter will be None if options.shell_dir_secondary was not specified. """ - stdout = self._Run(runnable, count, secondary=False) + stdout = self._TimedRun(runnable, count, secondary=False) if self.shell_dir_secondary: - return stdout, self._Run(runnable, count, secondary=True) + return stdout, self._TimedRun(runnable, count, secondary=True) else: return stdout, None @@ -674,9 +704,9 @@ class DesktopPlatform(Platform): command.setup(utils.GuessOS(), options.device) if options.prioritize or options.affinitize != None: - self.command_prefix = ["schedtool"] + self.command_prefix = ['schedtool'] if options.prioritize: - self.command_prefix += ["-n", "-20"] + self.command_prefix += ['-n', '-20'] if options.affinitize != None: # schedtool expects a bit pattern when setting affinity, where each # bit set to '1' corresponds to a core where the process may run on. @@ -684,8 +714,8 @@ class DesktopPlatform(Platform): # a core number, we need to map to said bit pattern. cpu = int(options.affinitize) core = 1 << cpu - self.command_prefix += ["-a", ("0x%x" % core)] - self.command_prefix += ["-e"] + self.command_prefix += ['-a', ('0x%x' % core)] + self.command_prefix += ['-e'] def PreExecution(self): pass @@ -700,32 +730,33 @@ class DesktopPlatform(Platform): def _Run(self, runnable, count, secondary=False): suffix = ' - secondary' if secondary else '' shell_dir = self.shell_dir_secondary if secondary else self.shell_dir - title = ">>> %%s (#%d)%s:" % ((count + 1), suffix) + title = '>>> %%s (#%d)%s:' % ((count + 1), suffix) cmd = runnable.GetCommand(self.command_prefix, shell_dir, self.extra_flags) try: output = cmd.execute() except OSError: # pragma: no cover - logging.exception(title % "OSError") + logging.exception(title % 'OSError') raise - logging.info(title % "Stdout" + "\n%s", output.stdout) + logging.info(title % 'Stdout' + '\n%s', output.stdout) if output.stderr: # pragma: no cover # Print stderr for debugging. - logging.info(title % "Stderr" + "\n%s", output.stderr) + logging.info(title % 'Stderr' + '\n%s', output.stderr) if output.timed_out: - logging.warning(">>> Test timed out after %ss.", runnable.timeout) + logging.warning('>>> Test timed out after %ss.', runnable.timeout) + runnable.has_timeouts = True raise TestFailedError() if output.exit_code != 0: - logging.warning(">>> Test crashed.") + logging.warning('>>> Test crashed.') raise TestFailedError() if '--prof' in self.extra_flags: - os_prefix = {"linux": "linux", "macos": "mac"}.get(utils.GuessOS()) + os_prefix = {'linux': 'linux', 'macos': 'mac'}.get(utils.GuessOS()) if os_prefix: - tick_tools = os.path.join(TOOLS_BASE, "%s-tick-processor" % os_prefix) - subprocess.check_call(tick_tools + " --only-summary", shell=True) + tick_tools = os.path.join(TOOLS_BASE, '%s-tick-processor' % os_prefix) + subprocess.check_call(tick_tools + ' --only-summary', shell=True) else: # pragma: no cover logging.warning( - "Profiler option currently supported on Linux and Mac OS.") + 'Profiler option currently supported on Linux and Mac OS.') # time outputs to stderr if runnable.process_size: @@ -754,13 +785,13 @@ class AndroidPlatform(Platform): # pragma: no cover bench_rel = os.path.normpath(os.path.join(*node.path)) bench_abs = os.path.join(suite_dir, bench_rel) else: - bench_rel = "." + bench_rel = '.' bench_abs = suite_dir - self.driver.push_executable(self.shell_dir, "bin", node.binary) + self.driver.push_executable(self.shell_dir, 'bin', node.binary) if self.shell_dir_secondary: self.driver.push_executable( - self.shell_dir_secondary, "bin_secondary", node.binary) + self.shell_dir_secondary, 'bin_secondary', node.binary) if isinstance(node, RunnableConfig): self.driver.push_file(bench_abs, node.main, bench_rel) @@ -769,15 +800,15 @@ class AndroidPlatform(Platform): # pragma: no cover def _Run(self, runnable, count, secondary=False): suffix = ' - secondary' if secondary else '' - target_dir = "bin_secondary" if secondary else "bin" - title = ">>> %%s (#%d)%s:" % ((count + 1), suffix) + target_dir = 'bin_secondary' if secondary else 'bin' + title = '>>> %%s (#%d)%s:' % ((count + 1), suffix) self.driver.drop_ram_caches() # Relative path to benchmark directory. if runnable.path: bench_rel = os.path.normpath(os.path.join(*runnable.path)) else: - bench_rel = "." + bench_rel = '.' logcat_file = None if self.options.dump_logcats_to: @@ -796,18 +827,19 @@ class AndroidPlatform(Platform): # pragma: no cover timeout=runnable.timeout, logcat_file=logcat_file, ) - logging.info(title % "Stdout" + "\n%s", stdout) + logging.info(title % 'Stdout' + '\n%s', stdout) except android.CommandFailedException as e: - logging.info(title % "Stdout" + "\n%s", e.output) + logging.info(title % 'Stdout' + '\n%s', e.output) logging.warning('>>> Test crashed.') raise TestFailedError() except android.TimeoutException as e: if e.output is not None: - logging.info(title % "Stdout" + "\n%s", e.output) - logging.warning(">>> Test timed out after %ss.", runnable.timeout) + logging.info(title % 'Stdout' + '\n%s', e.output) + logging.warning('>>> Test timed out after %ss.', runnable.timeout) + runnable.has_timeouts = True raise TestFailedError() if runnable.process_size: - return stdout + "MaxMemory: Unsupported" + return stdout + 'MaxMemory: Unsupported' return stdout class CustomMachineConfiguration: @@ -835,44 +867,44 @@ class CustomMachineConfiguration: @staticmethod def GetASLR(): try: - with open("/proc/sys/kernel/randomize_va_space", "r") as f: + with open('/proc/sys/kernel/randomize_va_space', 'r') as f: return int(f.readline().strip()) except Exception: - logging.exception("Failed to get current ASLR settings.") + logging.exception('Failed to get current ASLR settings.') raise @staticmethod def SetASLR(value): try: - with open("/proc/sys/kernel/randomize_va_space", "w") as f: + with open('/proc/sys/kernel/randomize_va_space', 'w') as f: f.write(str(value)) except Exception: logging.exception( - "Failed to update ASLR to %s. Are we running under sudo?", value) + 'Failed to update ASLR to %s. Are we running under sudo?', value) raise new_value = CustomMachineConfiguration.GetASLR() if value != new_value: - raise Exception("Present value is %s" % new_value) + raise Exception('Present value is %s' % new_value) @staticmethod def GetCPUCoresRange(): try: - with open("/sys/devices/system/cpu/present", "r") as f: + with open('/sys/devices/system/cpu/present', 'r') as f: indexes = f.readline() - r = map(int, indexes.split("-")) + r = map(int, indexes.split('-')) if len(r) == 1: return range(r[0], r[0] + 1) return range(r[0], r[1] + 1) except Exception: - logging.exception("Failed to retrieve number of CPUs.") + logging.exception('Failed to retrieve number of CPUs.') raise @staticmethod def GetCPUPathForId(cpu_index): - ret = "/sys/devices/system/cpu/cpu" + ret = '/sys/devices/system/cpu/cpu' ret += str(cpu_index) - ret += "/cpufreq/scaling_governor" + ret += '/cpufreq/scaling_governor' return ret @staticmethod @@ -882,17 +914,17 @@ class CustomMachineConfiguration: ret = None for cpu_index in cpu_indices: cpu_device = CustomMachineConfiguration.GetCPUPathForId(cpu_index) - with open(cpu_device, "r") as f: + with open(cpu_device, 'r') as f: # We assume the governors of all CPUs are set to the same value val = f.readline().strip() if ret == None: ret = val elif ret != val: - raise Exception("CPU cores have differing governor settings") + raise Exception('CPU cores have differing governor settings') return ret except Exception: - logging.exception("Failed to get the current CPU governor. Is the CPU " - "governor disabled? Check BIOS.") + logging.exception('Failed to get the current CPU governor. Is the CPU ' + 'governor disabled? Check BIOS.') raise @staticmethod @@ -901,123 +933,124 @@ class CustomMachineConfiguration: cpu_indices = CustomMachineConfiguration.GetCPUCoresRange() for cpu_index in cpu_indices: cpu_device = CustomMachineConfiguration.GetCPUPathForId(cpu_index) - with open(cpu_device, "w") as f: + with open(cpu_device, 'w') as f: f.write(value) except Exception: - logging.exception("Failed to change CPU governor to %s. Are we " - "running under sudo?", value) + logging.exception('Failed to change CPU governor to %s. Are we ' + 'running under sudo?', value) raise cur_value = CustomMachineConfiguration.GetCPUGovernor() if cur_value != value: - raise Exception("Could not set CPU governor. Present value is %s" + raise Exception('Could not set CPU governor. Present value is %s' % cur_value ) def Main(args): parser = optparse.OptionParser() - parser.add_option("--android-build-tools", help="Deprecated.") - parser.add_option("--arch", - help=("The architecture to run tests for, " - "'auto' or 'native' for auto-detect"), - default="x64") - parser.add_option("--buildbot", - help="Adapt to path structure used on buildbots and adds " - "timestamps/level to all logged status messages", - default=False, action="store_true") - parser.add_option("-d", "--device", - help="The device ID to run Android tests on. If not given " - "it will be autodetected.") - parser.add_option("--extra-flags", - help="Additional flags to pass to the test executable", - default="") - parser.add_option("--json-test-results", - help="Path to a file for storing json results.") - parser.add_option("--json-test-results-secondary", - "--json-test-results-no-patch", # TODO(sergiyb): Deprecate. - help="Path to a file for storing json results from run " - "without patch or for reference build run.") - parser.add_option("--outdir", help="Base directory with compile output", - default="out") - parser.add_option("--outdir-secondary", - "--outdir-no-patch", # TODO(sergiyb): Deprecate. - help="Base directory with compile output without patch or " - "for reference build") - parser.add_option("--binary-override-path", - help="JavaScript engine binary. By default, d8 under " - "architecture-specific build dir. " - "Not supported in conjunction with outdir-secondary.") - parser.add_option("--prioritize", - help="Raise the priority to nice -20 for the benchmarking " - "process.Requires Linux, schedtool, and sudo privileges.", - default=False, action="store_true") - parser.add_option("--affinitize", - help="Run benchmarking process on the specified core. " - "For example: " - "--affinitize=0 will run the benchmark process on core 0. " - "--affinitize=3 will run the benchmark process on core 3. " - "Requires Linux, schedtool, and sudo privileges.", + parser.add_option('--android-build-tools', help='Deprecated.') + parser.add_option('--arch', + help=('The architecture to run tests for, ' + '"auto" or "native" for auto-detect'), + default='x64') + parser.add_option('--buildbot', + help='Adapt to path structure used on buildbots and adds ' + 'timestamps/level to all logged status messages', + default=False, action='store_true') + parser.add_option('-d', '--device', + help='The device ID to run Android tests on. If not given ' + 'it will be autodetected.') + parser.add_option('--extra-flags', + help='Additional flags to pass to the test executable', + default='') + parser.add_option('--json-test-results', + help='Path to a file for storing json results.') + parser.add_option('--json-test-results-secondary', + '--json-test-results-no-patch', # TODO(sergiyb): Deprecate. + help='Path to a file for storing json results from run ' + 'without patch or for reference build run.') + parser.add_option('--outdir', help='Base directory with compile output', + default='out') + parser.add_option('--outdir-secondary', + '--outdir-no-patch', # TODO(sergiyb): Deprecate. + help='Base directory with compile output without patch or ' + 'for reference build') + parser.add_option('--binary-override-path', + help='JavaScript engine binary. By default, d8 under ' + 'architecture-specific build dir. ' + 'Not supported in conjunction with outdir-secondary.') + parser.add_option('--prioritize', + help='Raise the priority to nice -20 for the benchmarking ' + 'process.Requires Linux, schedtool, and sudo privileges.', + default=False, action='store_true') + parser.add_option('--affinitize', + help='Run benchmarking process on the specified core. ' + 'For example: ' + '--affinitize=0 will run the benchmark process on core 0. ' + '--affinitize=3 will run the benchmark process on core 3. ' + 'Requires Linux, schedtool, and sudo privileges.', default=None) - parser.add_option("--noaslr", - help="Disable ASLR for the duration of the benchmarked " - "process. Requires Linux and sudo privileges.", - default=False, action="store_true") - parser.add_option("--cpu-governor", - help="Set cpu governor to specified policy for the " - "duration of the benchmarked process. Typical options: " - "'powersave' for more stable results, or 'performance' " - "for shorter completion time of suite, with potentially " - "more noise in results.") - parser.add_option("--filter", - help="Only run the benchmarks beginning with this string. " - "For example: " - "--filter=JSTests/TypedArrays/ will run only TypedArray " - "benchmarks from the JSTests suite.", - default="") - parser.add_option("--run-count-multiplier", default=1, type="int", - help="Multipled used to increase number of times each test " - "is retried.") - parser.add_option("--dump-logcats-to", - help="Writes logcat output from each test into specified " - "directory. Only supported for android targets.") + parser.add_option('--noaslr', + help='Disable ASLR for the duration of the benchmarked ' + 'process. Requires Linux and sudo privileges.', + default=False, action='store_true') + parser.add_option('--cpu-governor', + help='Set cpu governor to specified policy for the ' + 'duration of the benchmarked process. Typical options: ' + '"powersave" for more stable results, or "performance" ' + 'for shorter completion time of suite, with potentially ' + 'more noise in results.') + parser.add_option('--filter', + help='Only run the benchmarks beginning with this string. ' + 'For example: ' + '--filter=JSTests/TypedArrays/ will run only TypedArray ' + 'benchmarks from the JSTests suite.', + default='') + parser.add_option('--run-count-multiplier', default=1, type='int', + help='Multipled used to increase number of times each test ' + 'is retried.') + parser.add_option('--dump-logcats-to', + help='Writes logcat output from each test into specified ' + 'directory. Only supported for android targets.') (options, args) = parser.parse_args(args) - logging.basicConfig(level=logging.INFO, format="%(levelname)-8s %(message)s") + logging.basicConfig( + level=logging.INFO, format='%(asctime)s %(levelname)-8s %(message)s') if len(args) == 0: # pragma: no cover parser.print_help() return INFRA_FAILURE_RETCODE - if options.arch in ["auto", "native"]: # pragma: no cover + if options.arch in ['auto', 'native']: # pragma: no cover options.arch = ARCH_GUESS if not options.arch in SUPPORTED_ARCHS: # pragma: no cover - logging.error("Unknown architecture %s", options.arch) + logging.error('Unknown architecture %s', options.arch) return INFRA_FAILURE_RETCODE if (options.json_test_results_secondary and not options.outdir_secondary): # pragma: no cover - logging.error("For writing secondary json test results, a secondary outdir " - "patch must be specified.") + logging.error('For writing secondary json test results, a secondary outdir ' + 'patch must be specified.') return INFRA_FAILURE_RETCODE - workspace = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) + workspace = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) if options.buildbot: - build_config = "Release" + build_config = 'Release' else: - build_config = "%s.release" % options.arch + build_config = '%s.release' % options.arch if options.binary_override_path == None: options.shell_dir = os.path.join(workspace, options.outdir, build_config) - default_binary_name = "d8" + default_binary_name = 'd8' else: if not os.path.isfile(options.binary_override_path): - logging.error("binary-override-path must be a file name") + logging.error('binary-override-path must be a file name') return INFRA_FAILURE_RETCODE if options.outdir_secondary: - logging.error("specify either binary-override-path or outdir-secondary") + logging.error('specify either binary-override-path or outdir-secondary') return INFRA_FAILURE_RETCODE options.shell_dir = os.path.abspath( os.path.dirname(options.binary_override_path)) @@ -1052,14 +1085,14 @@ def Main(args): disable_aslr = options.noaslr) as conf: for path in args: if not os.path.exists(path): # pragma: no cover - results.errors.append("Configuration file %s does not exist." % path) + results.errors.append('Configuration file %s does not exist.' % path) continue with open(path) as f: suite = json.loads(f.read()) # If no name is given, default to the file name without .json. - suite.setdefault("name", os.path.splitext(os.path.basename(path))[0]) + suite.setdefault('name', os.path.splitext(os.path.basename(path))[0]) # Setup things common to one test suite. platform.PreExecution() @@ -1074,28 +1107,38 @@ def Main(args): # Traverse graph/trace tree and iterate over all runnables. for runnable in FlattenRunnables(root, NodeCB): - runnable_name = "/".join(runnable.graphs) + runnable_name = '/'.join(runnable.graphs) if (not runnable_name.startswith(options.filter) and - runnable_name + "/" != options.filter): + runnable_name + '/' != options.filter): continue - logging.info(">>> Running suite: %s", runnable_name) + logging.info('>>> Running suite: %s', runnable_name) def Runner(): """Output generator that reruns several times.""" total_runs = runnable.run_count * options.run_count_multiplier for i in range(0, max(1, total_runs)): - # TODO(machenbach): Allow timeout per arch like with run_count per - # arch. - try: - yield platform.Run(runnable, i) - except TestFailedError: - have_failed_tests[0] = True + attempts_left = runnable.retry_count + 1 + while attempts_left: + try: + yield platform.Run(runnable, i) + except TestFailedError: + attempts_left -= 1 + if not attempts_left: # ignore failures until last attempt + have_failed_tests[0] = True + else: + logging.info('>>> Retrying suite: %s', runnable_name) + else: + break # Let runnable iterate over all runs and handle output. result, result_secondary = runnable.Run( Runner, trybot=options.shell_dir_secondary) results += result results_secondary += result_secondary + if runnable.has_timeouts: + results.timeouts.append(runnable_name) + if runnable.has_near_timeouts: + results.near_timeouts.append(runnable_name) platform.PostExecution() if options.json_test_results: @@ -1123,5 +1166,5 @@ def MainWrapper(): return INFRA_FAILURE_RETCODE -if __name__ == "__main__": # pragma: no cover +if __name__ == '__main__': # pragma: no cover sys.exit(MainWrapper()) diff --git a/deps/v8/tools/testrunner/base_runner.py b/deps/v8/tools/testrunner/base_runner.py index e31eb69ca5..214268631a 100644 --- a/deps/v8/tools/testrunner/base_runner.py +++ b/deps/v8/tools/testrunner/base_runner.py @@ -244,6 +244,11 @@ class BaseTestRunner(object): self.mode_options = None self.target_os = None + @property + def framework_name(self): + """String name of the base-runner subclass, used in test results.""" + raise NotImplementedError() + def execute(self, sys_args=None): if sys_args is None: # pragma: no cover sys_args = sys.argv[1:] @@ -336,9 +341,6 @@ class BaseTestRunner(object): "color, mono)") parser.add_option("--json-test-results", help="Path to a file for storing json results.") - parser.add_option("--junitout", help="File name of the JUnit output") - parser.add_option("--junittestsuite", default="v8tests", - help="The testsuite name in the JUnit output file") parser.add_option("--exit-after-n-failures", type="int", default=100, help="Exit after the first N failures instead of " "running all tests. Pass 0 to disable this feature.") @@ -630,7 +632,8 @@ class BaseTestRunner(object): if options.verbose: print('>>> Loading test suite: %s' % name) suite = testsuite.TestSuite.Load( - os.path.join(options.test_root, name), test_config) + os.path.join(options.test_root, name), test_config, + self.framework_name) if self._is_testsuite_supported(suite, options): tests = suite.load_tests_from_disk(variables) @@ -773,11 +776,9 @@ class BaseTestRunner(object): def _create_progress_indicators(self, test_count, options): procs = [PROGRESS_INDICATORS[options.progress]()] - if options.junitout: - procs.append(progress.JUnitTestProgressIndicator(options.junitout, - options.junittestsuite)) if options.json_test_results: procs.append(progress.JsonTestProgressIndicator( + self.framework_name, options.json_test_results, self.build_config.arch, self.mode_options.execution_mode)) diff --git a/deps/v8/tools/testrunner/local/command.py b/deps/v8/tools/testrunner/local/command.py index 8c0264e335..5eb0d8b20a 100644 --- a/deps/v8/tools/testrunner/local/command.py +++ b/deps/v8/tools/testrunner/local/command.py @@ -155,6 +155,25 @@ class BaseCommand(object): class PosixCommand(BaseCommand): + # TODO(machenbach): Use base process start without shell once + # https://crbug.com/v8/8889 is resolved. + def _start_process(self): + def wrapped(arg): + if set('() \'"') & set(arg): + return "'%s'" % arg.replace("'", "'\"'\"'") + return arg + try: + return subprocess.Popen( + args=' '.join(map(wrapped, self._get_popen_args())), + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env=self._get_env(), + shell=True, + ) + except Exception as e: + sys.stderr.write('Error executing: %s\n' % self) + raise e + def _kill_process(self, process): process.kill() diff --git a/deps/v8/tools/testrunner/local/junit_output.py b/deps/v8/tools/testrunner/local/junit_output.py deleted file mode 100644 index 52f31ec422..0000000000 --- a/deps/v8/tools/testrunner/local/junit_output.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2013 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. - - -import xml.etree.ElementTree as xml - - -class JUnitTestOutput: - def __init__(self, test_suite_name): - self.root = xml.Element("testsuite") - self.root.attrib["name"] = test_suite_name - - def HasRunTest(self, test_name, test_cmd, test_duration, test_failure): - testCaseElement = xml.Element("testcase") - testCaseElement.attrib["name"] = test_name - testCaseElement.attrib["cmd"] = test_cmd - testCaseElement.attrib["time"] = str(round(test_duration, 3)) - if len(test_failure): - failureElement = xml.Element("failure") - failureElement.text = test_failure - testCaseElement.append(failureElement) - self.root.append(testCaseElement) - - def FinishAndWrite(self, f): - xml.ElementTree(self.root).write(f, "UTF-8") diff --git a/deps/v8/tools/testrunner/local/testsuite.py b/deps/v8/tools/testrunner/local/testsuite.py index 8656c1636d..1bfc0317fe 100644 --- a/deps/v8/tools/testrunner/local/testsuite.py +++ b/deps/v8/tools/testrunner/local/testsuite.py @@ -241,15 +241,16 @@ def _load_testsuite_module(name, root): class TestSuite(object): @staticmethod - def Load(root, test_config): + def Load(root, test_config, framework_name): name = root.split(os.path.sep)[-1] with _load_testsuite_module(name, root) as module: - return module.GetSuite(name, root, test_config) + return module.GetSuite(name, root, test_config, framework_name) - def __init__(self, name, root, test_config): + def __init__(self, name, root, test_config, framework_name): self.name = name # string self.root = root # string containing path self.test_config = test_config + self.framework_name = framework_name # name of the test runner impl self.tests = None # list of TestCase objects self.statusfile = None diff --git a/deps/v8/tools/testrunner/local/testsuite_unittest.py b/deps/v8/tools/testrunner/local/testsuite_unittest.py index 1cca79c205..b74fef1842 100755 --- a/deps/v8/tools/testrunner/local/testsuite_unittest.py +++ b/deps/v8/tools/testrunner/local/testsuite_unittest.py @@ -37,7 +37,8 @@ class TestSuiteTest(unittest.TestCase): verbose=False, ) - self.suite = TestSuite.Load(self.test_root, self.test_config) + self.suite = TestSuite.Load( + self.test_root, self.test_config, "standard_runner") def testLoadingTestSuites(self): self.assertEquals(self.suite.name, "fake_testsuite") diff --git a/deps/v8/tools/testrunner/local/variants.py b/deps/v8/tools/testrunner/local/variants.py index b3e446fb3f..ed9b1b87f5 100644 --- a/deps/v8/tools/testrunner/local/variants.py +++ b/deps/v8/tools/testrunner/local/variants.py @@ -7,19 +7,22 @@ ALL_VARIANT_FLAGS = { "code_serializer": [["--cache=code"]], "default": [[]], "future": [["--future"]], - "gc_stats": [["--gc_stats=1"]], + "gc_stats": [["--gc-stats=1"]], # Alias of exhaustive variants, but triggering new test framework features. "infra_staging": [[]], "interpreted_regexp": [["--regexp-interpret-all"]], "jitless": [["--jitless"]], - "no_liftoff": [["--no-wasm-tier-up"]], "minor_mc": [["--minor-mc"]], # No optimization means disable all optimizations. OptimizeFunctionOnNextCall # would not force optimization too. It turns into a Nop. Please see # https://chromium-review.googlesource.com/c/452620/ for more discussion. - "nooptimization": [["--noopt"]], + # For WebAssembly, we test "Liftoff-only" in the nooptimization variant and + # "TurboFan-only" in the stress variant. The WebAssembly configuration is + # independent of JS optimizations, so we can combine those configs. + "nooptimization": [["--no-opt", "--liftoff", "--no-wasm-tier-up"]], "slow_path": [["--force-slow-path"]], - "stress": [["--stress-opt", "--always-opt"]], + "stress": [["--stress-opt", "--always-opt", "--no-liftoff", + "--no-wasm-tier-up"]], "stress_background_compile": [["--stress-background-compile"]], "stress_incremental_marking": [["--stress-incremental-marking"]], # Trigger stress sampling allocation profiler with sample interval = 2^14 diff --git a/deps/v8/tools/testrunner/num_fuzzer.py b/deps/v8/tools/testrunner/num_fuzzer.py index e51966b5cf..d4e92a61e8 100755 --- a/deps/v8/tools/testrunner/num_fuzzer.py +++ b/deps/v8/tools/testrunner/num_fuzzer.py @@ -33,6 +33,10 @@ class NumFuzzer(base_runner.BaseTestRunner): def __init__(self, *args, **kwargs): super(NumFuzzer, self).__init__(*args, **kwargs) + @property + def framework_name(self): + return 'num_fuzzer' + def _add_parser_options(self, parser): parser.add_option("--fuzzer-random-seed", default=0, help="Default seed for initializing fuzzer random " diff --git a/deps/v8/tools/testrunner/outproc/mkgrokdump.py b/deps/v8/tools/testrunner/outproc/mkgrokdump.py index 8efde1226f..4013023776 100644 --- a/deps/v8/tools/testrunner/outproc/mkgrokdump.py +++ b/deps/v8/tools/testrunner/outproc/mkgrokdump.py @@ -20,7 +20,7 @@ class OutProc(base.OutProc): diff = difflib.unified_diff(expected_lines, actual_lines, lineterm="", fromfile="expected_path") diffstring = '\n'.join(diff) - if diffstring is not "": + if diffstring != "": if "generated from a non-shipping build" in output.stdout: return False if not "generated from a shipping build" in output.stdout: diff --git a/deps/v8/tools/testrunner/standard_runner.py b/deps/v8/tools/testrunner/standard_runner.py index 300340ed98..2a08d2d97e 100755 --- a/deps/v8/tools/testrunner/standard_runner.py +++ b/deps/v8/tools/testrunner/standard_runner.py @@ -29,34 +29,34 @@ from testrunner.utils import random_utils ARCH_GUESS = utils.DefaultArch() -VARIANTS = ["default"] +VARIANTS = ['default'] MORE_VARIANTS = [ - "jitless", - "stress", - "stress_background_compile", - "stress_incremental_marking", + 'jitless', + 'stress', + 'stress_background_compile', + 'stress_incremental_marking', ] VARIANT_ALIASES = { # The default for developer workstations. - "dev": VARIANTS, + 'dev': VARIANTS, # Additional variants, run on all bots. - "more": MORE_VARIANTS, - # Shortcut for the two above ("more" first - it has the longer running tests). - "exhaustive": MORE_VARIANTS + VARIANTS, + 'more': MORE_VARIANTS, + # Shortcut for the two above ('more' first - it has the longer running tests). + 'exhaustive': MORE_VARIANTS + VARIANTS, # Additional variants, run on a subset of bots. - "extra": ["nooptimization", "future", "no_liftoff", "no_wasm_traps"], + 'extra': ['nooptimization', 'future', 'no_wasm_traps'], } -GC_STRESS_FLAGS = ["--gc-interval=500", "--stress-compaction", - "--concurrent-recompilation-queue-length=64", - "--concurrent-recompilation-delay=500", - "--concurrent-recompilation", - "--stress-flush-bytecode"] +GC_STRESS_FLAGS = ['--gc-interval=500', '--stress-compaction', + '--concurrent-recompilation-queue-length=64', + '--concurrent-recompilation-delay=500', + '--concurrent-recompilation', + '--stress-flush-bytecode'] -RANDOM_GC_STRESS_FLAGS = ["--random-gc-interval=5000", - "--stress-compaction-random"] +RANDOM_GC_STRESS_FLAGS = ['--random-gc-interval=5000', + '--stress-compaction-random'] PREDICTABLE_WRAPPER = os.path.join( @@ -64,296 +64,300 @@ PREDICTABLE_WRAPPER = os.path.join( class StandardTestRunner(base_runner.BaseTestRunner): - def __init__(self, *args, **kwargs): - super(StandardTestRunner, self).__init__(*args, **kwargs) - - self.sancov_dir = None - self._variants = None - - def _get_default_suite_names(self): - return ['default'] - - def _add_parser_options(self, parser): - parser.add_option("--novfp3", - help="Indicates that V8 was compiled without VFP3" - " support", - default=False, action="store_true") - - # Variants - parser.add_option("--no-variants", "--novariants", - help="Deprecated. " - "Equivalent to passing --variants=default", - default=False, dest="no_variants", action="store_true") - parser.add_option("--variants", - help="Comma-separated list of testing variants;" - " default: \"%s\"" % ",".join(VARIANTS)) - parser.add_option("--exhaustive-variants", - default=False, action="store_true", - help="Deprecated. " - "Equivalent to passing --variants=exhaustive") - - # Filters - parser.add_option("--slow-tests", default="dontcare", - help="Regard slow tests (run|skip|dontcare)") - parser.add_option("--pass-fail-tests", default="dontcare", - help="Regard pass|fail tests (run|skip|dontcare)") - parser.add_option("--quickcheck", default=False, action="store_true", - help=("Quick check mode (skip slow tests)")) - parser.add_option("--dont-skip-slow-simulator-tests", - help="Don't skip more slow tests when using a" - " simulator.", - default=False, action="store_true", - dest="dont_skip_simulator_slow_tests") - - # Stress modes - parser.add_option("--gc-stress", - help="Switch on GC stress mode", - default=False, action="store_true") - parser.add_option("--random-gc-stress", - help="Switch on random GC stress mode", - default=False, action="store_true") - parser.add_option("--random-seed-stress-count", default=1, type="int", - dest="random_seed_stress_count", - help="Number of runs with different random seeds. Only " - "with test processors: 0 means infinite " - "generation.") - - # Noop - parser.add_option("--cfi-vptr", - help="Run tests with UBSAN cfi_vptr option.", - default=False, action="store_true") - parser.add_option("--infra-staging", help="Use new test runner features", - dest='infra_staging', default=None, - action="store_true") - parser.add_option("--no-infra-staging", - help="Opt out of new test runner features", - dest='infra_staging', default=None, - action="store_false") - parser.add_option("--no-sorting", "--nosorting", - help="Don't sort tests according to duration of last" - " run.", - default=False, dest="no_sorting", action="store_true") - parser.add_option("--no-presubmit", "--nopresubmit", - help='Skip presubmit checks (deprecated)', - default=False, dest="no_presubmit", action="store_true") - - # Unimplemented for test processors - parser.add_option("--sancov-dir", - help="Directory where to collect coverage data") - parser.add_option("--cat", help="Print the source of the tests", - default=False, action="store_true") - parser.add_option("--flakiness-results", - help="Path to a file for storing flakiness json.") - parser.add_option("--time", help="Print timing information after running", - default=False, action="store_true") - parser.add_option("--warn-unused", help="Report unused rules", - default=False, action="store_true") - parser.add_option("--report", default=False, action="store_true", - help="Print a summary of the tests to be run") - - - def _process_options(self, options): - if options.sancov_dir: - self.sancov_dir = options.sancov_dir - if not os.path.exists(self.sancov_dir): - print("sancov-dir %s doesn't exist" % self.sancov_dir) - raise base_runner.TestRunnerError() - - if options.gc_stress: - options.extra_flags += GC_STRESS_FLAGS - - if options.random_gc_stress: - options.extra_flags += RANDOM_GC_STRESS_FLAGS - - if self.build_config.asan: - options.extra_flags.append("--invoke-weak-callbacks") - options.extra_flags.append("--omit-quit") - - if self.build_config.no_snap: - # Speed up slow nosnap runs. Allocation verification is covered by - # running mksnapshot on other builders. - options.extra_flags.append("--no-turbo-verify-allocation") - - if options.novfp3: - options.extra_flags.append("--noenable-vfp3") - - if options.no_variants: # pragma: no cover - print ("Option --no-variants is deprecated. " - "Pass --variants=default instead.") - assert not options.variants - options.variants = "default" - - if options.exhaustive_variants: # pragma: no cover - # TODO(machenbach): Switch infra to --variants=exhaustive after M65. - print ("Option --exhaustive-variants is deprecated. " - "Pass --variants=exhaustive instead.") - # This is used on many bots. It includes a larger set of default - # variants. - # Other options for manipulating variants still apply afterwards. - assert not options.variants - options.variants = "exhaustive" - - if options.quickcheck: - assert not options.variants - options.variants = "stress,default" - options.slow_tests = "skip" - options.pass_fail_tests = "skip" - - if self.build_config.predictable: - options.variants = "default" - options.extra_flags.append("--predictable") - options.extra_flags.append("--verify_predictable") - options.extra_flags.append("--no-inline-new") - # Add predictable wrapper to command prefix. - options.command_prefix = ( - [sys.executable, PREDICTABLE_WRAPPER] + options.command_prefix) - - # TODO(machenbach): Figure out how to test a bigger subset of variants on - # msan. - if self.build_config.msan: - options.variants = "default" - - if options.variants == "infra_staging": - options.variants = "exhaustive" - - self._variants = self._parse_variants(options.variants) - - def CheckTestMode(name, option): # pragma: no cover - if not option in ["run", "skip", "dontcare"]: - print("Unknown %s mode %s" % (name, option)) - raise base_runner.TestRunnerError() - CheckTestMode("slow test", options.slow_tests) - CheckTestMode("pass|fail test", options.pass_fail_tests) - if self.build_config.no_i18n: - base_runner.TEST_MAP["bot_default"].remove("intl") - base_runner.TEST_MAP["default"].remove("intl") - # TODO(machenbach): uncomment after infra side lands. - # base_runner.TEST_MAP["d8_default"].remove("intl") - - def _parse_variants(self, aliases_str): - # Use developer defaults if no variant was specified. - aliases_str = aliases_str or 'dev' - aliases = aliases_str.split(',') - user_variants = set(reduce( - list.__add__, [VARIANT_ALIASES.get(a, [a]) for a in aliases])) - - result = [v for v in ALL_VARIANTS if v in user_variants] - if len(result) == len(user_variants): - return result - - for v in user_variants: - if v not in ALL_VARIANTS: - print('Unknown variant: %s' % v) - raise base_runner.TestRunnerError() - assert False, 'Unreachable' - - def _setup_env(self): - super(StandardTestRunner, self)._setup_env() - - symbolizer_option = self._get_external_symbolizer_option() - - if self.sancov_dir: - os.environ['ASAN_OPTIONS'] = ":".join([ - 'coverage=1', - 'coverage_dir=%s' % self.sancov_dir, - symbolizer_option, - "allow_user_segv_handler=1", - ]) - - def _get_statusfile_variables(self, options): - variables = ( - super(StandardTestRunner, self)._get_statusfile_variables(options)) - - simulator_run = ( - not options.dont_skip_simulator_slow_tests and - self.build_config.arch in [ - 'arm64', 'arm', 'mipsel', 'mips', 'mips64', 'mips64el', 'ppc', - 'ppc64', 's390', 's390x'] and - bool(ARCH_GUESS) and - self.build_config.arch != ARCH_GUESS) - - variables.update({ - 'gc_stress': options.gc_stress or options.random_gc_stress, - 'gc_fuzzer': options.random_gc_stress, - 'novfp3': options.novfp3, - 'simulator_run': simulator_run, - }) - return variables - - def _do_execute(self, tests, args, options): - jobs = options.j - - print('>>> Running with test processors') - loader = LoadProc(tests) - results = self._create_result_tracker(options) - indicators = self._create_progress_indicators( - tests.test_count_estimate, options) - - outproc_factory = None - if self.build_config.predictable: - outproc_factory = predictable.get_outproc - execproc = ExecutionProc(jobs, outproc_factory) - sigproc = self._create_signal_proc() - - procs = [ - loader, - NameFilterProc(args) if args else None, - StatusFileFilterProc(options.slow_tests, options.pass_fail_tests), - VariantProc(self._variants), - StatusFileFilterProc(options.slow_tests, options.pass_fail_tests), - self._create_predictable_filter(), - self._create_shard_proc(options), - self._create_seed_proc(options), - sigproc, - ] + indicators + [ - results, - self._create_timeout_proc(options), - self._create_rerun_proc(options), - execproc, - ] - - self._prepare_procs(procs) - - loader.load_initial_tests(initial_batch_size=options.j*2) - - # This starts up worker processes and blocks until all tests are - # processed. - execproc.run() - - for indicator in indicators: - indicator.finished() - - - if tests.test_count_estimate: - percentage = float(results.total) / tests.test_count_estimate * 100 - else: - percentage = 0 - - print (('>>> %d base tests produced %d (%d%s)' - ' non-filtered tests') % ( - tests.test_count_estimate, results.total, percentage, '%')) - - print('>>> %d tests ran' % (results.total - results.remaining)) - - exit_code = utils.EXIT_CODE_PASS - if results.failed: - exit_code = utils.EXIT_CODE_FAILURES - if not results.total: - exit_code = utils.EXIT_CODE_NO_TESTS - - # Indicate if a SIGINT or SIGTERM happened. - return max(exit_code, sigproc.exit_code) - - def _create_predictable_filter(self): - if not self.build_config.predictable: - return None - return predictable.PredictableFilterProc() - - def _create_seed_proc(self, options): - if options.random_seed_stress_count == 1: - return None - return SeedProc(options.random_seed_stress_count, options.random_seed, - options.j * 4) + def __init__(self, *args, **kwargs): + super(StandardTestRunner, self).__init__(*args, **kwargs) + + self.sancov_dir = None + self._variants = None + + @property + def framework_name(self): + return 'standard_runner' + + def _get_default_suite_names(self): + return ['default'] + + def _add_parser_options(self, parser): + parser.add_option('--novfp3', + help='Indicates that V8 was compiled without VFP3' + ' support', + default=False, action='store_true') + + # Variants + parser.add_option('--no-variants', '--novariants', + help='Deprecated. ' + 'Equivalent to passing --variants=default', + default=False, dest='no_variants', action='store_true') + parser.add_option('--variants', + help='Comma-separated list of testing variants;' + ' default: "%s"' % ','.join(VARIANTS)) + parser.add_option('--exhaustive-variants', + default=False, action='store_true', + help='Deprecated. ' + 'Equivalent to passing --variants=exhaustive') + + # Filters + parser.add_option('--slow-tests', default='dontcare', + help='Regard slow tests (run|skip|dontcare)') + parser.add_option('--pass-fail-tests', default='dontcare', + help='Regard pass|fail tests (run|skip|dontcare)') + parser.add_option('--quickcheck', default=False, action='store_true', + help=('Quick check mode (skip slow tests)')) + parser.add_option('--dont-skip-slow-simulator-tests', + help='Don\'t skip more slow tests when using a' + ' simulator.', + default=False, action='store_true', + dest='dont_skip_simulator_slow_tests') + + # Stress modes + parser.add_option('--gc-stress', + help='Switch on GC stress mode', + default=False, action='store_true') + parser.add_option('--random-gc-stress', + help='Switch on random GC stress mode', + default=False, action='store_true') + parser.add_option('--random-seed-stress-count', default=1, type='int', + dest='random_seed_stress_count', + help='Number of runs with different random seeds. Only ' + 'with test processors: 0 means infinite ' + 'generation.') + + # Noop + parser.add_option('--cfi-vptr', + help='Run tests with UBSAN cfi_vptr option.', + default=False, action='store_true') + parser.add_option('--infra-staging', help='Use new test runner features', + dest='infra_staging', default=None, + action='store_true') + parser.add_option('--no-infra-staging', + help='Opt out of new test runner features', + dest='infra_staging', default=None, + action='store_false') + parser.add_option('--no-sorting', '--nosorting', + help='Don\'t sort tests according to duration of last' + ' run.', + default=False, dest='no_sorting', action='store_true') + parser.add_option('--no-presubmit', '--nopresubmit', + help='Skip presubmit checks (deprecated)', + default=False, dest='no_presubmit', action='store_true') + + # Unimplemented for test processors + parser.add_option('--sancov-dir', + help='Directory where to collect coverage data') + parser.add_option('--cat', help='Print the source of the tests', + default=False, action='store_true') + parser.add_option('--flakiness-results', + help='Path to a file for storing flakiness json.') + parser.add_option('--time', help='Print timing information after running', + default=False, action='store_true') + parser.add_option('--warn-unused', help='Report unused rules', + default=False, action='store_true') + parser.add_option('--report', default=False, action='store_true', + help='Print a summary of the tests to be run') + + + def _process_options(self, options): + if options.sancov_dir: + self.sancov_dir = options.sancov_dir + if not os.path.exists(self.sancov_dir): + print('sancov-dir %s doesn\'t exist' % self.sancov_dir) + raise base_runner.TestRunnerError() + + if options.gc_stress: + options.extra_flags += GC_STRESS_FLAGS + + if options.random_gc_stress: + options.extra_flags += RANDOM_GC_STRESS_FLAGS + + if self.build_config.asan: + options.extra_flags.append('--invoke-weak-callbacks') + options.extra_flags.append('--omit-quit') + + if self.build_config.no_snap: + # Speed up slow nosnap runs. Allocation verification is covered by + # running mksnapshot on other builders. + options.extra_flags.append('--no-turbo-verify-allocation') + + if options.novfp3: + options.extra_flags.append('--noenable-vfp3') + + if options.no_variants: # pragma: no cover + print ('Option --no-variants is deprecated. ' + 'Pass --variants=default instead.') + assert not options.variants + options.variants = 'default' + + if options.exhaustive_variants: # pragma: no cover + # TODO(machenbach): Switch infra to --variants=exhaustive after M65. + print ('Option --exhaustive-variants is deprecated. ' + 'Pass --variants=exhaustive instead.') + # This is used on many bots. It includes a larger set of default + # variants. + # Other options for manipulating variants still apply afterwards. + assert not options.variants + options.variants = 'exhaustive' + + if options.quickcheck: + assert not options.variants + options.variants = 'stress,default' + options.slow_tests = 'skip' + options.pass_fail_tests = 'skip' + + if self.build_config.predictable: + options.variants = 'default' + options.extra_flags.append('--predictable') + options.extra_flags.append('--verify-predictable') + options.extra_flags.append('--no-inline-new') + # Add predictable wrapper to command prefix. + options.command_prefix = ( + [sys.executable, PREDICTABLE_WRAPPER] + options.command_prefix) + + # TODO(machenbach): Figure out how to test a bigger subset of variants on + # msan. + if self.build_config.msan: + options.variants = 'default' + + if options.variants == 'infra_staging': + options.variants = 'exhaustive' + + self._variants = self._parse_variants(options.variants) + + def CheckTestMode(name, option): # pragma: no cover + if not option in ['run', 'skip', 'dontcare']: + print('Unknown %s mode %s' % (name, option)) + raise base_runner.TestRunnerError() + CheckTestMode('slow test', options.slow_tests) + CheckTestMode('pass|fail test', options.pass_fail_tests) + if self.build_config.no_i18n: + base_runner.TEST_MAP['bot_default'].remove('intl') + base_runner.TEST_MAP['default'].remove('intl') + # TODO(machenbach): uncomment after infra side lands. + # base_runner.TEST_MAP['d8_default'].remove('intl') + + def _parse_variants(self, aliases_str): + # Use developer defaults if no variant was specified. + aliases_str = aliases_str or 'dev' + aliases = aliases_str.split(',') + user_variants = set(reduce( + list.__add__, [VARIANT_ALIASES.get(a, [a]) for a in aliases])) + + result = [v for v in ALL_VARIANTS if v in user_variants] + if len(result) == len(user_variants): + return result + + for v in user_variants: + if v not in ALL_VARIANTS: + print('Unknown variant: %s' % v) + raise base_runner.TestRunnerError() + assert False, 'Unreachable' + + def _setup_env(self): + super(StandardTestRunner, self)._setup_env() + + symbolizer_option = self._get_external_symbolizer_option() + + if self.sancov_dir: + os.environ['ASAN_OPTIONS'] = ':'.join([ + 'coverage=1', + 'coverage_dir=%s' % self.sancov_dir, + symbolizer_option, + 'allow_user_segv_handler=1', + ]) + + def _get_statusfile_variables(self, options): + variables = ( + super(StandardTestRunner, self)._get_statusfile_variables(options)) + + simulator_run = ( + not options.dont_skip_simulator_slow_tests and + self.build_config.arch in [ + 'arm64', 'arm', 'mipsel', 'mips', 'mips64', 'mips64el', 'ppc', + 'ppc64', 's390', 's390x'] and + bool(ARCH_GUESS) and + self.build_config.arch != ARCH_GUESS) + + variables.update({ + 'gc_stress': options.gc_stress or options.random_gc_stress, + 'gc_fuzzer': options.random_gc_stress, + 'novfp3': options.novfp3, + 'simulator_run': simulator_run, + }) + return variables + + def _do_execute(self, tests, args, options): + jobs = options.j + + print('>>> Running with test processors') + loader = LoadProc(tests) + results = self._create_result_tracker(options) + indicators = self._create_progress_indicators( + tests.test_count_estimate, options) + + outproc_factory = None + if self.build_config.predictable: + outproc_factory = predictable.get_outproc + execproc = ExecutionProc(jobs, outproc_factory) + sigproc = self._create_signal_proc() + + procs = [ + loader, + NameFilterProc(args) if args else None, + StatusFileFilterProc(options.slow_tests, options.pass_fail_tests), + VariantProc(self._variants), + StatusFileFilterProc(options.slow_tests, options.pass_fail_tests), + self._create_predictable_filter(), + self._create_shard_proc(options), + self._create_seed_proc(options), + sigproc, + ] + indicators + [ + results, + self._create_timeout_proc(options), + self._create_rerun_proc(options), + execproc, + ] + + self._prepare_procs(procs) + + loader.load_initial_tests(initial_batch_size=options.j*2) + + # This starts up worker processes and blocks until all tests are + # processed. + execproc.run() + + for indicator in indicators: + indicator.finished() + + + if tests.test_count_estimate: + percentage = float(results.total) / tests.test_count_estimate * 100 + else: + percentage = 0 + + print (('>>> %d base tests produced %d (%d%s)' + ' non-filtered tests') % ( + tests.test_count_estimate, results.total, percentage, '%')) + + print('>>> %d tests ran' % (results.total - results.remaining)) + + exit_code = utils.EXIT_CODE_PASS + if results.failed: + exit_code = utils.EXIT_CODE_FAILURES + if not results.total: + exit_code = utils.EXIT_CODE_NO_TESTS + + # Indicate if a SIGINT or SIGTERM happened. + return max(exit_code, sigproc.exit_code) + + def _create_predictable_filter(self): + if not self.build_config.predictable: + return None + return predictable.PredictableFilterProc() + + def _create_seed_proc(self, options): + if options.random_seed_stress_count == 1: + return None + return SeedProc(options.random_seed_stress_count, options.random_seed, + options.j * 4) if __name__ == '__main__': diff --git a/deps/v8/tools/testrunner/testproc/progress.py b/deps/v8/tools/testrunner/testproc/progress.py index daa05c4a21..46e3a2e4d8 100644 --- a/deps/v8/tools/testrunner/testproc/progress.py +++ b/deps/v8/tools/testrunner/testproc/progress.py @@ -11,7 +11,6 @@ import sys import time from . import base -from ..local import junit_output def print_failure_header(test): @@ -259,47 +258,8 @@ class MonochromeProgressIndicator(CompactProgressIndicator): print(("\r" + (" " * last_length) + "\r"), end='') -class JUnitTestProgressIndicator(ProgressIndicator): - def __init__(self, junitout, junittestsuite): - super(JUnitTestProgressIndicator, self).__init__() - self._requirement = base.DROP_PASS_STDOUT - - self.outputter = junit_output.JUnitTestOutput(junittestsuite) - if junitout: - self.outfile = open(junitout, "w") - else: - self.outfile = sys.stdout - - def _on_result_for(self, test, result): - # TODO(majeski): Support for dummy/grouped results - fail_text = "" - output = result.output - if result.has_unexpected_output: - stdout = output.stdout.strip() - if len(stdout): - fail_text += "stdout:\n%s\n" % stdout - stderr = output.stderr.strip() - if len(stderr): - fail_text += "stderr:\n%s\n" % stderr - fail_text += "Command: %s" % result.cmd.to_string() - if output.HasCrashed(): - fail_text += "exit code: %d\n--- CRASHED ---" % output.exit_code - if output.HasTimedOut(): - fail_text += "--- TIMEOUT ---" - self.outputter.HasRunTest( - test_name=str(test), - test_cmd=result.cmd.to_string(relative=True), - test_duration=output.duration, - test_failure=fail_text) - - def finished(self): - self.outputter.FinishAndWrite(self.outfile) - if self.outfile != sys.stdout: - self.outfile.close() - - class JsonTestProgressIndicator(ProgressIndicator): - def __init__(self, json_test_results, arch, mode): + def __init__(self, framework_name, json_test_results, arch, mode): super(JsonTestProgressIndicator, self).__init__() # We want to drop stdout/err for all passed tests on the first try, but we # need to get outputs for all runs after the first one. To accommodate that, @@ -307,6 +267,7 @@ class JsonTestProgressIndicator(ProgressIndicator): # keep_output set to True in the RerunProc. self._requirement = base.DROP_PASS_STDOUT + self.framework_name = framework_name self.json_test_results = json_test_results self.arch = arch self.mode = mode @@ -347,6 +308,8 @@ class JsonTestProgressIndicator(ProgressIndicator): "random_seed": test.random_seed, "target_name": test.get_shell(), "variant": test.variant, + "variant_flags": test.variant_flags, + "framework_name": self.framework_name, }) def finished(self): diff --git a/deps/v8/tools/testrunner/testproc/timeout.py b/deps/v8/tools/testrunner/testproc/timeout.py index 84ddc656e2..54dc60e9b4 100644 --- a/deps/v8/tools/testrunner/testproc/timeout.py +++ b/deps/v8/tools/testrunner/testproc/timeout.py @@ -25,4 +25,5 @@ class TimeoutProc(base.TestProcObserver): def _on_event(self): if not self.is_stopped: if time.time() - self._start > self._duration_sec: + print('>>> Total timeout reached.') self.stop() diff --git a/deps/v8/tools/tracing/proto-converter/.gitignore b/deps/v8/tools/tracing/proto-converter/.gitignore new file mode 100644 index 0000000000..b7f03ffd32 --- /dev/null +++ b/deps/v8/tools/tracing/proto-converter/.gitignore @@ -0,0 +1 @@ +proto-to-json.js
\ No newline at end of file diff --git a/deps/v8/tools/tracing/proto-converter/.nvmrc b/deps/v8/tools/tracing/proto-converter/.nvmrc new file mode 100644 index 0000000000..a7b32add2f --- /dev/null +++ b/deps/v8/tools/tracing/proto-converter/.nvmrc @@ -0,0 +1 @@ +v11.9.0 diff --git a/deps/v8/tools/tracing/proto-converter/package-lock.json b/deps/v8/tools/tracing/proto-converter/package-lock.json new file mode 100644 index 0000000000..52e52b318f --- /dev/null +++ b/deps/v8/tools/tracing/proto-converter/package-lock.json @@ -0,0 +1,123 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=", + "dev": true + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "dev": true + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "dev": true + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=", + "dev": true + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "dev": true, + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=", + "dev": true + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=", + "dev": true + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=", + "dev": true + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=", + "dev": true + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=", + "dev": true + }, + "@types/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", + "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==", + "dev": true + }, + "@types/node": { + "version": "11.11.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.4.tgz", + "integrity": "sha512-02tIL+QIi/RW4E5xILdoAMjeJ9kYq5t5S2vciUdFPXv/ikFTb0zK8q9vXkg4+WAJuYXGiVT1H28AkD2C+IkXVw==", + "dev": true + }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", + "dev": true + }, + "protobufjs": { + "version": "6.8.8", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", + "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", + "dev": true, + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "@types/node": "^10.1.0", + "long": "^4.0.0" + }, + "dependencies": { + "@types/node": { + "version": "10.14.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.1.tgz", + "integrity": "sha512-Rymt08vh1GaW4vYB6QP61/5m/CFLGnFZP++bJpWbiNxceNa6RBipDmb413jvtSf/R1gg5a/jQVl2jY4XVRscEA==", + "dev": true + } + } + }, + "typescript": { + "version": "3.3.4000", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", + "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "dev": true + } + } +} diff --git a/deps/v8/tools/tracing/proto-converter/package.json b/deps/v8/tools/tracing/proto-converter/package.json new file mode 100644 index 0000000000..41401a11aa --- /dev/null +++ b/deps/v8/tools/tracing/proto-converter/package.json @@ -0,0 +1,11 @@ +{ + "private": true, + "scripts": { + "build": "tsc proto-to-json.ts" + }, + "devDependencies": { + "@types/node": "^11.11.4", + "protobufjs": "^6.8.8", + "typescript": "^3.3.4000" + } +} diff --git a/deps/v8/tools/tracing/proto-converter/proto-to-json.ts b/deps/v8/tools/tracing/proto-converter/proto-to-json.ts new file mode 100644 index 0000000000..2427410fd4 --- /dev/null +++ b/deps/v8/tools/tracing/proto-converter/proto-to-json.ts @@ -0,0 +1,132 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import * as fs from 'fs'; +import * as path from 'path'; +import { Root } from 'protobufjs'; + +// Requirements: node 10.4.0+, npm + +// Setup: +// (nvm is optional, you can also just install node manually) +// $ nvm use +// $ npm install +// $ npm run build + +// Usage: node proto-to-json.js path_to_trace.proto input_file output_file + +// Converts a binary proto file to a 'Trace Event Format' compatible .json file +// that can be used with chrome://tracing. Documentation of this format: +// https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU + +// Attempts to reproduce the logic of the JSONTraceWriter in V8 in terms of the +// JSON fields it will include/exclude based on the data present in the trace +// event. + +// TODO(petermarshall): Replace with Array#flat once it lands in Node.js. +const flatten = <T>(a: T[], b: T[]) => { a.push(...b); return a; } + +// Convert a string representing an int or uint (64 bit) to a Number or throw +// if the value won't fit. +function parseIntOrThrow(int: string) { + if (BigInt(int) > Number.MAX_SAFE_INTEGER) { + throw new Error("Loss of int precision"); + } + return Number(int); +} + +function uint64AsHexString(val : string) : string { + return "0x" + BigInt(val).toString(16); +} + +function parseArgValue(arg: any) : any { + if (arg.jsonValue) { + return JSON.parse(arg.jsonValue); + } + if (typeof arg.stringValue !== 'undefined') { + return arg.stringValue; + } + if (typeof arg.uintValue !== 'undefined') { + return parseIntOrThrow(arg.uintValue); + } + if (typeof arg.intValue !== 'undefined') { + return parseIntOrThrow(arg.intValue); + } + if (typeof arg.boolValue !== 'undefined') { + return arg.boolValue; + } + if (typeof arg.doubleValue !== 'undefined') { + // Handle [-]Infinity and NaN which protobufjs outputs as strings here. + return typeof arg.doubleValue === 'string' ? + arg.doubleValue : Number(arg.doubleValue); + } + if (typeof arg.pointerValue !== 'undefined') { + return uint64AsHexString(arg.pointerValue); + } +} + +// These come from +// https://cs.chromium.org/chromium/src/base/trace_event/common/trace_event_common.h +const TRACE_EVENT_FLAG_HAS_ID: number = 1 << 1; +const TRACE_EVENT_FLAG_FLOW_IN: number = 1 << 8; +const TRACE_EVENT_FLAG_FLOW_OUT: number = 1 << 9; + +async function main() { + const root = new Root(); + const { resolvePath } = root; + const numDirectoriesToStrip = 2; + let initialOrigin: string|null; + root.resolvePath = (origin, target) => { + if (!origin) { + initialOrigin = target; + for (let i = 0; i <= numDirectoriesToStrip; i++) { + initialOrigin = path.dirname(initialOrigin); + } + return resolvePath(origin, target); + } + return path.resolve(initialOrigin!, target); + }; + const traceProto = await root.load(process.argv[2]); + const Trace = traceProto.lookupType("Trace"); + const payload = await fs.promises.readFile(process.argv[3]); + const msg = Trace.decode(payload).toJSON(); + const output = { + traceEvents: msg.packet + .filter((packet: any) => !!packet.chromeEvents) + .map((packet: any) => packet.chromeEvents.traceEvents) + .map((traceEvents: any) => traceEvents.map((e: any) => { + + const bind_id = (e.flags & (TRACE_EVENT_FLAG_FLOW_IN | + TRACE_EVENT_FLAG_FLOW_OUT)) ? e.bindId : undefined; + const scope = (e.flags & TRACE_EVENT_FLAG_HAS_ID) && e.scope ? + e.scope : undefined; + + return { + pid: e.processId, + tid: e.threadId, + ts: parseIntOrThrow(e.timestamp), + tts: parseIntOrThrow(e.threadTimestamp), + ph: String.fromCodePoint(e.phase), + cat: e.categoryGroupName, + name: e.name, + dur: parseIntOrThrow(e.duration), + tdur: parseIntOrThrow(e.threadDuration), + bind_id: bind_id, + flow_in: e.flags & TRACE_EVENT_FLAG_FLOW_IN ? true : undefined, + flow_out: e.flags & TRACE_EVENT_FLAG_FLOW_OUT ? true : undefined, + scope: scope, + id: (e.flags & TRACE_EVENT_FLAG_HAS_ID) ? + uint64AsHexString(e.id) : undefined, + args: (e.args || []).reduce((js_args: any, proto_arg: any) => { + js_args[proto_arg.name] = parseArgValue(proto_arg); + return js_args; + }, {}) + }; + })) + .reduce(flatten, []) + }; + await fs.promises.writeFile(process.argv[4], JSON.stringify(output, null, 2)); +} + +main().catch(console.error); diff --git a/deps/v8/tools/tracing/proto-converter/tsconfig.json b/deps/v8/tools/tracing/proto-converter/tsconfig.json new file mode 100644 index 0000000000..defc4ef82a --- /dev/null +++ b/deps/v8/tools/tracing/proto-converter/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "lib": ["es6","dom"], + "outDir": "lib", + "rootDir": "src", + "strict": true, + "esModuleInterop": true, + "resolveJsonModule": true + } +} diff --git a/deps/v8/tools/turbolizer/package-lock.json b/deps/v8/tools/turbolizer/package-lock.json index 69b7d3bd7f..9c8049fdb5 100644 --- a/deps/v8/tools/turbolizer/package-lock.json +++ b/deps/v8/tools/turbolizer/package-lock.json @@ -330,18 +330,20 @@ } }, "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "requires": { - "arr-flatten": "^1.0.1" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" }, "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" + }, "array-back": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", @@ -360,9 +362,9 @@ } }, "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" }, "arrify": { "version": "1.0.1", @@ -376,12 +378,22 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + }, "async-limiter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", "dev": true }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" + }, "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", @@ -426,6 +438,56 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, "basic-auth": { "version": "1.1.0", "resolved": "http://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz", @@ -449,13 +511,30 @@ } }, "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "browser-stdout": { @@ -487,6 +566,22 @@ "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", "dev": true }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, "cache-content-type": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz", @@ -528,6 +623,27 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "cli-commands": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/cli-commands/-/cli-commands-0.4.0.tgz", @@ -556,6 +672,15 @@ "type-is": "^1.6.16" } }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -632,6 +757,11 @@ "integrity": "sha512-BXcgq+wzr2htmBmnT7cL7YHzPAWketWbr4kozjoM9kWe4sk3+zMgjcH0HO+EddjDlEw2LZysqLpVRwbF318tDw==", "dev": true }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, "compressible": { "version": "2.0.15", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.15.tgz", @@ -669,6 +799,11 @@ "keygrip": "~1.0.2" } }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" + }, "copy-to": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/copy-to/-/copy-to-2.0.1.tgz", @@ -954,6 +1089,11 @@ "ms": "2.0.0" } }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", @@ -988,6 +1128,43 @@ "integrity": "sha1-HKb/7dvO8XFd16riXHYW+a4iky8=", "dev": true }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, "delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -1043,9 +1220,9 @@ "dev": true }, "estree-walker": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", - "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==" + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.0.tgz", + "integrity": "sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw==" }, "esutils": { "version": "2.0.2", @@ -1060,44 +1237,142 @@ "dev": true }, "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "requires": { - "is-posix-bracket": "^0.1.0" + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } } }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "requires": { - "fill-range": "^2.1.0" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } } }, "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "requires": { - "is-extglob": "^1.0.0" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } } }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=" - }, "fill-range": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", - "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^3.0.0", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "find-replace": { @@ -1115,12 +1390,12 @@ "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "requires": { - "for-in": "^1.0.1" + "map-cache": "^0.2.2" } }, "fresh": { @@ -1151,6 +1426,11 @@ "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", @@ -1165,23 +1445,6 @@ "path-is-absolute": "^1.0.0" } }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "requires": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "requires": { - "is-glob": "^2.0.0" - } - }, "graceful-fs": { "version": "4.1.15", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", @@ -1208,6 +1471,35 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", @@ -1267,22 +1559,62 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "requires": { - "is-primitive": "^2.0.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } } }, "is-extendable": { @@ -1290,47 +1622,47 @@ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" - }, "is-generator-function": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", "integrity": "sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw==", "dev": true }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "requires": { - "is-extglob": "^1.0.0" - } - }, "is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=" }, "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "requires": { "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } } }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=" + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "^3.0.1" + } }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" }, "is-wsl": { "version": "1.1.0", @@ -1344,12 +1676,9 @@ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "requires": { - "isarray": "1.0.0" - } + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" }, "js-tokens": { "version": "3.0.2", @@ -1404,12 +1733,9 @@ "dev": true }, "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" }, "koa": { "version": "2.6.1", @@ -1942,10 +2268,18 @@ "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", "dev": true }, - "math-random": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", - "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==" + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "requires": { + "object-visit": "^1.0.0" + } }, "media-typer": { "version": "0.3.0", @@ -1960,23 +2294,23 @@ "dev": true }, "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" } }, "mime-db": { @@ -2009,6 +2343,25 @@ "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, "mkdirp": { "version": "0.5.1", "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -2081,8 +2434,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "mz": { "version": "2.7.0", @@ -2095,6 +2447,24 @@ "thenify-all": "^1.0.0" } }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, "negotiator": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", @@ -2110,27 +2480,54 @@ "semver": "^5.5.0" } }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "requires": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" + "isobject": "^3.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "requires": { + "isobject": "^3.0.1" } }, "on-finished": { @@ -2172,23 +2569,17 @@ "is-wsl": "^1.1.0" } }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "requires": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - } - }, "parseurl": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", "dev": true }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -2212,10 +2603,10 @@ "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", "dev": true }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" }, "process-nextick-args": { "version": "2.0.0", @@ -2229,28 +2620,6 @@ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, - "randomatic": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", - "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", - "requires": { - "is-number": "^4.0.0", - "kind-of": "^6.0.0", - "math-random": "^1.0.1" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" - } - } - }, "raw-body": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", @@ -2298,19 +2667,15 @@ "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", "dev": true }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "requires": { - "is-equal-shallow": "^0.1.3" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" } }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" - }, "repeat-element": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", @@ -2374,6 +2739,16 @@ } } }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + }, "rollup": { "version": "0.68.2", "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.68.2.tgz", @@ -2394,23 +2769,38 @@ } }, "rollup-plugin-typescript2": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.19.3.tgz", - "integrity": "sha512-lsRqfBCZhMl/tq9AT5YnQvzQWzXtnx3EQYFcHD72gul7nyyoOrzx5yCEH20smpw58v6UkHHZz03FbdLEPoHWjA==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.20.1.tgz", + "integrity": "sha512-uxA5JQNOfmJ9rsO0yJKTObb1t4nNYUexCg9zxhEKF+NzZwljYWdfgrA06UzA24cOk8fQjGEe7Q5+Vge2vFlnnw==", "requires": { "fs-extra": "7.0.1", - "resolve": "1.8.1", - "rollup-pluginutils": "2.3.3", + "resolve": "1.10.0", + "rollup-pluginutils": "2.4.1", "tslib": "1.9.3" + }, + "dependencies": { + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, + "resolve": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", + "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "requires": { + "path-parse": "^1.0.6" + } + } } }, "rollup-pluginutils": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz", - "integrity": "sha512-2XZwja7b6P5q4RZ5FhyX1+f46xi1Z3qBKigLRZ6VTZjwbN0K1IFGMlwm06Uu0Emcre2Z63l77nq/pzn+KxIEoA==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.4.1.tgz", + "integrity": "sha512-wesMQ9/172IJDIW/lYWm0vW0LiKe5Ekjws481R7z9WTRtmO59cqyM/2uUlxvf6yzm/fElFmHUobeQOYz46dZJw==", "requires": { - "estree-walker": "^0.5.2", - "micromatch": "^2.3.11" + "estree-walker": "^0.6.0", + "micromatch": "^3.1.10" } }, "rw": { @@ -2424,6 +2814,14 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "requires": { + "ret": "~0.1.10" + } + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -2473,18 +2871,161 @@ } } }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "setprototypeof": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", "dev": true }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, "source-map-support": { "version": "0.5.9", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", @@ -2495,12 +3036,44 @@ "source-map": "^0.6.0" } }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "requires": { + "extend-shallow": "^3.0.0" + } + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", @@ -2679,6 +3252,44 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, "toidentifier": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", @@ -2795,6 +3406,38 @@ "integrity": "sha512-2/pGDQD/q1iJWlrj357aEKGIlRvHirm81x04lsg51hreiohy2snAXoFc9dIHFWEx9LsfOVA5K7lUGM9rcUqwlQ==", "dev": true }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -2806,6 +3449,52 @@ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "dev": true }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" + } + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/deps/v8/tools/turbolizer/package.json b/deps/v8/tools/turbolizer/package.json index 511d10cf71..2213fe3f6a 100644 --- a/deps/v8/tools/turbolizer/package.json +++ b/deps/v8/tools/turbolizer/package.json @@ -17,7 +17,7 @@ "d3": "^5.7.0", "rollup": "^0.68.2", "rollup-plugin-node-resolve": "^4.0.0", - "rollup-plugin-typescript2": "^0.19.3" + "rollup-plugin-typescript2": "^0.20.1" }, "repository": { "type": "git", diff --git a/deps/v8/tools/turbolizer/src/sequence-view.ts b/deps/v8/tools/turbolizer/src/sequence-view.ts index a796707c74..b0a85f1bd3 100644 --- a/deps/v8/tools/turbolizer/src/sequence-view.ts +++ b/deps/v8/tools/turbolizer/src/sequence-view.ts @@ -165,6 +165,7 @@ export class SequenceView extends TextView { } const sequenceBlock = createElement("div", "schedule-block"); + sequenceBlock.classList.toggle("deferred", block.deferred); const blockId = createElement("div", ["block-id", "com", "clickable"], block.id); blockId.onclick = mkBlockLinkHandler(block.id); diff --git a/deps/v8/tools/unittests/run_perf_test.py b/deps/v8/tools/unittests/run_perf_test.py index f1028dee6a..5e009ebd6b 100755 --- a/deps/v8/tools/unittests/run_perf_test.py +++ b/deps/v8/tools/unittests/run_perf_test.py @@ -9,12 +9,12 @@ from __future__ import print_function from collections import namedtuple import coverage import json -from mock import MagicMock, patch +import mock import os -from os import path, sys import platform import shutil import subprocess +import sys import tempfile import unittest @@ -25,78 +25,77 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) RUN_PERF = os.path.join(BASE_DIR, 'run_perf.py') TEST_DATA = os.path.join(BASE_DIR, 'unittests', 'testdata') -TEST_WORKSPACE = path.join(tempfile.gettempdir(), "test-v8-run-perf") +TEST_WORKSPACE = os.path.join(tempfile.gettempdir(), 'test-v8-run-perf') V8_JSON = { - "path": ["."], - "owners": ["username@chromium.org"], - "binary": "d7", - "flags": ["--flag"], - "main": "run.js", - "run_count": 1, - "results_regexp": "^%s: (.+)$", - "tests": [ - {"name": "Richards"}, - {"name": "DeltaBlue"}, + 'path': ['.'], + 'owners': ['username@chromium.org'], + 'binary': 'd7', + 'flags': ['--flag'], + 'main': 'run.js', + 'run_count': 1, + 'results_regexp': '^%s: (.+)$', + 'tests': [ + {'name': 'Richards'}, + {'name': 'DeltaBlue'}, ] } V8_NESTED_SUITES_JSON = { - "path": ["."], - "owners": ["username@chromium.org"], - "flags": ["--flag"], - "run_count": 1, - "units": "score", - "tests": [ - {"name": "Richards", - "path": ["richards"], - "binary": "d7", - "main": "run.js", - "resources": ["file1.js", "file2.js"], - "run_count": 2, - "results_regexp": "^Richards: (.+)$"}, - {"name": "Sub", - "path": ["sub"], - "tests": [ - {"name": "Leaf", - "path": ["leaf"], - "run_count_x64": 3, - "units": "ms", - "main": "run.js", - "results_regexp": "^Simple: (.+) ms.$"}, + 'path': ['.'], + 'owners': ['username@chromium.org'], + 'flags': ['--flag'], + 'run_count': 1, + 'units': 'score', + 'tests': [ + {'name': 'Richards', + 'path': ['richards'], + 'binary': 'd7', + 'main': 'run.js', + 'resources': ['file1.js', 'file2.js'], + 'run_count': 2, + 'results_regexp': '^Richards: (.+)$'}, + {'name': 'Sub', + 'path': ['sub'], + 'tests': [ + {'name': 'Leaf', + 'path': ['leaf'], + 'run_count_x64': 3, + 'units': 'ms', + 'main': 'run.js', + 'results_regexp': '^Simple: (.+) ms.$'}, ] }, - {"name": "DeltaBlue", - "path": ["delta_blue"], - "main": "run.js", - "flags": ["--flag2"], - "results_regexp": "^DeltaBlue: (.+)$"}, - {"name": "ShouldntRun", - "path": ["."], - "archs": ["arm"], - "main": "run.js"}, + {'name': 'DeltaBlue', + 'path': ['delta_blue'], + 'main': 'run.js', + 'flags': ['--flag2'], + 'results_regexp': '^DeltaBlue: (.+)$'}, + {'name': 'ShouldntRun', + 'path': ['.'], + 'archs': ['arm'], + 'main': 'run.js'}, ] } V8_GENERIC_JSON = { - "path": ["."], - "owners": ["username@chromium.org"], - "binary": "cc", - "flags": ["--flag"], - "generic": True, - "run_count": 1, - "units": "ms", + 'path': ['.'], + 'owners': ['username@chromium.org'], + 'binary': 'cc', + 'flags': ['--flag'], + 'generic': True, + 'run_count': 1, + 'units': 'ms', } -Output = namedtuple("Output", "stdout, stderr, timed_out, exit_code") +Output = namedtuple('Output', 'stdout, stderr, timed_out, exit_code') class PerfTest(unittest.TestCase): @classmethod def setUpClass(cls): - cls.base = path.dirname(path.dirname(path.abspath(__file__))) - sys.path.append(cls.base) + sys.path.insert(0, BASE_DIR) cls._cov = coverage.coverage( - include=([os.path.join(cls.base, "run_perf.py")])) + include=([os.path.join(BASE_DIR, 'run_perf.py')])) cls._cov.start() import run_perf from testrunner.local import command @@ -106,56 +105,56 @@ class PerfTest(unittest.TestCase): @classmethod def tearDownClass(cls): cls._cov.stop() - print("") + print('') print(cls._cov.report()) def setUp(self): self.maxDiff = None - if path.exists(TEST_WORKSPACE): + if os.path.exists(TEST_WORKSPACE): shutil.rmtree(TEST_WORKSPACE) os.makedirs(TEST_WORKSPACE) def tearDown(self): - patch.stopall() - if path.exists(TEST_WORKSPACE): + mock.patch.stopall() + if os.path.exists(TEST_WORKSPACE): shutil.rmtree(TEST_WORKSPACE) def _WriteTestInput(self, json_content): - self._test_input = path.join(TEST_WORKSPACE, "test.json") - with open(self._test_input, "w") as f: + self._test_input = os.path.join(TEST_WORKSPACE, 'test.json') + with open(self._test_input, 'w') as f: f.write(json.dumps(json_content)) def _MockCommand(self, *args, **kwargs): # Fake output for each test run. test_outputs = [Output(stdout=arg, stderr=None, - timed_out=kwargs.get("timed_out", False), - exit_code=kwargs.get("exit_code", 0)) + timed_out=kwargs.get('timed_out', False), + exit_code=kwargs.get('exit_code', 0)) for arg in args[1]] def create_cmd(*args, **kwargs): - cmd = MagicMock() + cmd = mock.MagicMock() def execute(*args, **kwargs): return test_outputs.pop() - cmd.execute = MagicMock(side_effect=execute) + cmd.execute = mock.MagicMock(side_effect=execute) return cmd - patch.object( + mock.patch.object( run_perf.command, 'PosixCommand', - MagicMock(side_effect=create_cmd)).start() + mock.MagicMock(side_effect=create_cmd)).start() # Check that d8 is called from the correct cwd for each test run. - dirs = [path.join(TEST_WORKSPACE, arg) for arg in args[0]] + dirs = [os.path.join(TEST_WORKSPACE, arg) for arg in args[0]] def chdir(*args, **kwargs): self.assertEquals(dirs.pop(), args[0]) - os.chdir = MagicMock(side_effect=chdir) + os.chdir = mock.MagicMock(side_effect=chdir) - subprocess.check_call = MagicMock() - platform.system = MagicMock(return_value='Linux') + subprocess.check_call = mock.MagicMock() + platform.system = mock.MagicMock(return_value='Linux') def _CallMain(self, *args): - self._test_output = path.join(TEST_WORKSPACE, "results.json") + self._test_output = os.path.join(TEST_WORKSPACE, 'results.json') all_args=[ - "--json-test-results", + '--json-test-results', self._test_output, self._test_input, ] @@ -168,17 +167,17 @@ class PerfTest(unittest.TestCase): def _VerifyResults(self, suite, units, traces, file_name=None): self.assertEquals([ - {"units": units, - "graphs": [suite, trace["name"]], - "results": trace["results"], - "stddev": trace["stddev"]} for trace in traces], - self._LoadResults(file_name)["traces"]) + {'units': units, + 'graphs': [suite, trace['name']], + 'results': trace['results'], + 'stddev': trace['stddev']} for trace in traces], + self._LoadResults(file_name)['traces']) def _VerifyErrors(self, errors): - self.assertEquals(errors, self._LoadResults()["errors"]) + self.assertEquals(errors, self._LoadResults()['errors']) def _VerifyMock(self, binary, *args, **kwargs): - shell = path.join(path.dirname(self.base), binary) + shell = os.path.join(os.path.dirname(BASE_DIR), binary) command.Command.assert_called_with( cmd_prefix=[], shell=shell, @@ -190,7 +189,7 @@ class PerfTest(unittest.TestCase): for arg, actual in zip(args, command.Command.call_args_list): expected = { 'cmd_prefix': [], - 'shell': path.join(path.dirname(self.base), arg[0]), + 'shell': os.path.join(os.path.dirname(BASE_DIR), arg[0]), 'args': list(arg[1:]), 'timeout': kwargs.get('timeout', 60) } @@ -198,305 +197,324 @@ class PerfTest(unittest.TestCase): def testOneRun(self): self._WriteTestInput(V8_JSON) - self._MockCommand(["."], ["x\nRichards: 1.234\nDeltaBlue: 10657567\ny\n"]) + self._MockCommand(['.'], ['x\nRichards: 1.234\nDeltaBlue: 10657567\ny\n']) self.assertEquals(0, self._CallMain()) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": ["1.234"], "stddev": ""}, - {"name": "DeltaBlue", "results": ["10657567.0"], "stddev": ""}, + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': ['1.234'], 'stddev': ''}, + {'name': 'DeltaBlue', 'results': ['10657567.0'], 'stddev': ''}, ]) self._VerifyErrors([]) - self._VerifyMock(path.join("out", "x64.release", "d7"), "--flag", "run.js") + self._VerifyMock( + os.path.join('out', 'x64.release', 'd7'), '--flag', 'run.js') def testOneRunWithTestFlags(self): test_input = dict(V8_JSON) - test_input["test_flags"] = ["2", "test_name"] + test_input['test_flags'] = ['2', 'test_name'] self._WriteTestInput(test_input) - self._MockCommand(["."], ["Richards: 1.234\nDeltaBlue: 10657567"]) + self._MockCommand(['.'], ['Richards: 1.234\nDeltaBlue: 10657567']) self.assertEquals(0, self._CallMain()) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": ["1.234"], "stddev": ""}, - {"name": "DeltaBlue", "results": ["10657567.0"], "stddev": ""}, + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': ['1.234'], 'stddev': ''}, + {'name': 'DeltaBlue', 'results': ['10657567.0'], 'stddev': ''}, ]) self._VerifyErrors([]) - self._VerifyMock(path.join("out", "x64.release", "d7"), "--flag", "run.js", - "--", "2", "test_name") + self._VerifyMock(os.path.join( + 'out', 'x64.release', 'd7'), '--flag', 'run.js', '--', '2', 'test_name') def testTwoRuns_Units_SuiteName(self): test_input = dict(V8_JSON) - test_input["run_count"] = 2 - test_input["name"] = "v8" - test_input["units"] = "ms" + test_input['run_count'] = 2 + test_input['name'] = 'v8' + test_input['units'] = 'ms' self._WriteTestInput(test_input) - self._MockCommand([".", "."], - ["Richards: 100\nDeltaBlue: 200\n", - "Richards: 50\nDeltaBlue: 300\n"]) + self._MockCommand(['.', '.'], + ['Richards: 100\nDeltaBlue: 200\n', + 'Richards: 50\nDeltaBlue: 300\n']) self.assertEquals(0, self._CallMain()) - self._VerifyResults("v8", "ms", [ - {"name": "Richards", "results": ["50.0", "100.0"], "stddev": ""}, - {"name": "DeltaBlue", "results": ["300.0", "200.0"], "stddev": ""}, + self._VerifyResults('v8', 'ms', [ + {'name': 'Richards', 'results': ['50.0', '100.0'], 'stddev': ''}, + {'name': 'DeltaBlue', 'results': ['300.0', '200.0'], 'stddev': ''}, ]) self._VerifyErrors([]) - self._VerifyMock(path.join("out", "x64.release", "d7"), "--flag", "run.js") + self._VerifyMock(os.path.join( + 'out', 'x64.release', 'd7'), '--flag', 'run.js') def testTwoRuns_SubRegexp(self): test_input = dict(V8_JSON) - test_input["run_count"] = 2 - del test_input["results_regexp"] - test_input["tests"][0]["results_regexp"] = "^Richards: (.+)$" - test_input["tests"][1]["results_regexp"] = "^DeltaBlue: (.+)$" + test_input['run_count'] = 2 + del test_input['results_regexp'] + test_input['tests'][0]['results_regexp'] = '^Richards: (.+)$' + test_input['tests'][1]['results_regexp'] = '^DeltaBlue: (.+)$' self._WriteTestInput(test_input) - self._MockCommand([".", "."], - ["Richards: 100\nDeltaBlue: 200\n", - "Richards: 50\nDeltaBlue: 300\n"]) + self._MockCommand(['.', '.'], + ['Richards: 100\nDeltaBlue: 200\n', + 'Richards: 50\nDeltaBlue: 300\n']) self.assertEquals(0, self._CallMain()) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": ["50.0", "100.0"], "stddev": ""}, - {"name": "DeltaBlue", "results": ["300.0", "200.0"], "stddev": ""}, + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': ['50.0', '100.0'], 'stddev': ''}, + {'name': 'DeltaBlue', 'results': ['300.0', '200.0'], 'stddev': ''}, ]) self._VerifyErrors([]) - self._VerifyMock(path.join("out", "x64.release", "d7"), "--flag", "run.js") + self._VerifyMock(os.path.join( + 'out', 'x64.release', 'd7'), '--flag', 'run.js') def testNestedSuite(self): self._WriteTestInput(V8_NESTED_SUITES_JSON) - self._MockCommand(["delta_blue", "sub/leaf", "richards"], - ["DeltaBlue: 200\n", - "Simple: 1 ms.\n", - "Simple: 2 ms.\n", - "Simple: 3 ms.\n", - "Richards: 100\n", - "Richards: 50\n"]) + self._MockCommand(['delta_blue', 'sub/leaf', 'richards'], + ['DeltaBlue: 200\n', + 'Simple: 1 ms.\n', + 'Simple: 2 ms.\n', + 'Simple: 3 ms.\n', + 'Richards: 100\n', + 'Richards: 50\n']) self.assertEquals(0, self._CallMain()) self.assertEquals([ - {"units": "score", - "graphs": ["test", "Richards"], - "results": ["50.0", "100.0"], - "stddev": ""}, - {"units": "ms", - "graphs": ["test", "Sub", "Leaf"], - "results": ["3.0", "2.0", "1.0"], - "stddev": ""}, - {"units": "score", - "graphs": ["test", "DeltaBlue"], - "results": ["200.0"], - "stddev": ""}, - ], self._LoadResults()["traces"]) + {'units': 'score', + 'graphs': ['test', 'Richards'], + 'results': ['50.0', '100.0'], + 'stddev': ''}, + {'units': 'ms', + 'graphs': ['test', 'Sub', 'Leaf'], + 'results': ['3.0', '2.0', '1.0'], + 'stddev': ''}, + {'units': 'score', + 'graphs': ['test', 'DeltaBlue'], + 'results': ['200.0'], + 'stddev': ''}, + ], self._LoadResults()['traces']) self._VerifyErrors([]) self._VerifyMockMultiple( - (path.join("out", "x64.release", "d7"), "--flag", "run.js"), - (path.join("out", "x64.release", "d7"), "--flag", "run.js"), - (path.join("out", "x64.release", "d8"), "--flag", "run.js"), - (path.join("out", "x64.release", "d8"), "--flag", "run.js"), - (path.join("out", "x64.release", "d8"), "--flag", "run.js"), - (path.join("out", "x64.release", "d8"), "--flag", "--flag2", "run.js")) + (os.path.join('out', 'x64.release', 'd7'), '--flag', 'run.js'), + (os.path.join('out', 'x64.release', 'd7'), '--flag', 'run.js'), + (os.path.join('out', 'x64.release', 'd8'), '--flag', 'run.js'), + (os.path.join('out', 'x64.release', 'd8'), '--flag', 'run.js'), + (os.path.join('out', 'x64.release', 'd8'), '--flag', 'run.js'), + (os.path.join('out', 'x64.release', 'd8'), + '--flag', '--flag2', 'run.js')) def testOneRunStdDevRegExp(self): test_input = dict(V8_JSON) - test_input["stddev_regexp"] = "^%s\-stddev: (.+)$" + test_input['stddev_regexp'] = '^%s\-stddev: (.+)$' self._WriteTestInput(test_input) - self._MockCommand(["."], ["Richards: 1.234\nRichards-stddev: 0.23\n" - "DeltaBlue: 10657567\nDeltaBlue-stddev: 106\n"]) + self._MockCommand(['.'], ['Richards: 1.234\nRichards-stddev: 0.23\n' + 'DeltaBlue: 10657567\nDeltaBlue-stddev: 106\n']) self.assertEquals(0, self._CallMain()) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": ["1.234"], "stddev": "0.23"}, - {"name": "DeltaBlue", "results": ["10657567.0"], "stddev": "106"}, + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': ['1.234'], 'stddev': '0.23'}, + {'name': 'DeltaBlue', 'results': ['10657567.0'], 'stddev': '106'}, ]) self._VerifyErrors([]) - self._VerifyMock(path.join("out", "x64.release", "d7"), "--flag", "run.js") + self._VerifyMock( + os.path.join('out', 'x64.release', 'd7'), '--flag', 'run.js') def testTwoRunsStdDevRegExp(self): test_input = dict(V8_JSON) - test_input["stddev_regexp"] = "^%s\-stddev: (.+)$" - test_input["run_count"] = 2 + test_input['stddev_regexp'] = '^%s\-stddev: (.+)$' + test_input['run_count'] = 2 self._WriteTestInput(test_input) - self._MockCommand(["."], ["Richards: 3\nRichards-stddev: 0.7\n" - "DeltaBlue: 6\nDeltaBlue-boom: 0.9\n", - "Richards: 2\nRichards-stddev: 0.5\n" - "DeltaBlue: 5\nDeltaBlue-stddev: 0.8\n"]) + self._MockCommand(['.'], ['Richards: 3\nRichards-stddev: 0.7\n' + 'DeltaBlue: 6\nDeltaBlue-boom: 0.9\n', + 'Richards: 2\nRichards-stddev: 0.5\n' + 'DeltaBlue: 5\nDeltaBlue-stddev: 0.8\n']) self.assertEquals(1, self._CallMain()) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": ["2.0", "3.0"], "stddev": "0.7"}, - {"name": "DeltaBlue", "results": ["5.0", "6.0"], "stddev": "0.8"}, + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': ['2.0', '3.0'], 'stddev': '0.7'}, + {'name': 'DeltaBlue', 'results': ['5.0', '6.0'], 'stddev': '0.8'}, ]) self._VerifyErrors( - ["Test test/Richards should only run once since a stddev is provided " - "by the test.", - "Test test/DeltaBlue should only run once since a stddev is provided " - "by the test.", - "Regexp \"^DeltaBlue\-stddev: (.+)$\" didn't match for test " - "test/DeltaBlue."]) - self._VerifyMock(path.join("out", "x64.release", "d7"), "--flag", "run.js") + ['Test test/Richards should only run once since a stddev is provided ' + 'by the test.', + 'Test test/DeltaBlue should only run once since a stddev is provided ' + 'by the test.', + 'Regexp "^DeltaBlue\-stddev: (.+)$" did not match for test ' + 'test/DeltaBlue.']) + self._VerifyMock( + os.path.join('out', 'x64.release', 'd7'), '--flag', 'run.js') def testBuildbot(self): self._WriteTestInput(V8_JSON) - self._MockCommand(["."], ["Richards: 1.234\nDeltaBlue: 10657567\n"]) - self.assertEquals(0, self._CallMain("--buildbot")) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": ["1.234"], "stddev": ""}, - {"name": "DeltaBlue", "results": ["10657567.0"], "stddev": ""}, + self._MockCommand(['.'], ['Richards: 1.234\nDeltaBlue: 10657567\n']) + mock.patch.object( + run_perf.Platform, 'ReadBuildConfig', + mock.MagicMock(return_value={'is_android': False})).start() + self.assertEquals(0, self._CallMain('--buildbot')) + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': ['1.234'], 'stddev': ''}, + {'name': 'DeltaBlue', 'results': ['10657567.0'], 'stddev': ''}, ]) self._VerifyErrors([]) - self._VerifyMock(path.join("out", "Release", "d7"), "--flag", "run.js") + self._VerifyMock(os.path.join('out', 'Release', 'd7'), '--flag', 'run.js') def testBuildbotWithTotal(self): test_input = dict(V8_JSON) - test_input["total"] = True + test_input['total'] = True self._WriteTestInput(test_input) - self._MockCommand(["."], ["Richards: 1.234\nDeltaBlue: 10657567\n"]) - self.assertEquals(0, self._CallMain("--buildbot")) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": ["1.234"], "stddev": ""}, - {"name": "DeltaBlue", "results": ["10657567.0"], "stddev": ""}, - {"name": "Total", "results": ["3626.49109719"], "stddev": ""}, + self._MockCommand(['.'], ['Richards: 1.234\nDeltaBlue: 10657567\n']) + mock.patch.object( + run_perf.Platform, 'ReadBuildConfig', + mock.MagicMock(return_value={'is_android': False})).start() + self.assertEquals(0, self._CallMain('--buildbot')) + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': ['1.234'], 'stddev': ''}, + {'name': 'DeltaBlue', 'results': ['10657567.0'], 'stddev': ''}, + {'name': 'Total', 'results': ['3626.49109719'], 'stddev': ''}, ]) self._VerifyErrors([]) - self._VerifyMock(path.join("out", "Release", "d7"), "--flag", "run.js") + self._VerifyMock(os.path.join('out', 'Release', 'd7'), '--flag', 'run.js') def testBuildbotWithTotalAndErrors(self): test_input = dict(V8_JSON) - test_input["total"] = True + test_input['total'] = True self._WriteTestInput(test_input) - self._MockCommand(["."], ["x\nRichards: bla\nDeltaBlue: 10657567\ny\n"]) - self.assertEquals(1, self._CallMain("--buildbot")) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": [], "stddev": ""}, - {"name": "DeltaBlue", "results": ["10657567.0"], "stddev": ""}, + self._MockCommand(['.'], ['x\nRichards: bla\nDeltaBlue: 10657567\ny\n']) + mock.patch.object( + run_perf.Platform, 'ReadBuildConfig', + mock.MagicMock(return_value={'is_android': False})).start() + self.assertEquals(1, self._CallMain('--buildbot')) + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': [], 'stddev': ''}, + {'name': 'DeltaBlue', 'results': ['10657567.0'], 'stddev': ''}, ]) self._VerifyErrors( - ["Regexp \"^Richards: (.+)$\" " - "returned a non-numeric for test test/Richards.", - "Not all traces have the same number of results."]) - self._VerifyMock(path.join("out", "Release", "d7"), "--flag", "run.js") + ['Regexp "^Richards: (.+)$" ' + 'returned a non-numeric for test test/Richards.', + 'Not all traces have the same number of results.']) + self._VerifyMock(os.path.join('out', 'Release', 'd7'), '--flag', 'run.js') def testRegexpNoMatch(self): self._WriteTestInput(V8_JSON) - self._MockCommand(["."], ["x\nRichaards: 1.234\nDeltaBlue: 10657567\ny\n"]) + self._MockCommand(['.'], ['x\nRichaards: 1.234\nDeltaBlue: 10657567\ny\n']) self.assertEquals(1, self._CallMain()) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": [], "stddev": ""}, - {"name": "DeltaBlue", "results": ["10657567.0"], "stddev": ""}, + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': [], 'stddev': ''}, + {'name': 'DeltaBlue', 'results': ['10657567.0'], 'stddev': ''}, ]) self._VerifyErrors( - ["Regexp \"^Richards: (.+)$\" didn't match for test test/Richards."]) - self._VerifyMock(path.join("out", "x64.release", "d7"), "--flag", "run.js") + ['Regexp "^Richards: (.+)$" did not match for test test/Richards.']) + self._VerifyMock( + os.path.join('out', 'x64.release', 'd7'), '--flag', 'run.js') def testOneRunGeneric(self): test_input = dict(V8_GENERIC_JSON) self._WriteTestInput(test_input) - self._MockCommand(["."], [ - "RESULT Infra: Constant1= 11 count\n" - "RESULT Infra: Constant2= [10,5,10,15] count\n" - "RESULT Infra: Constant3= {12,1.2} count\n" - "RESULT Infra: Constant4= [10,5,error,15] count\n"]) + self._MockCommand(['.'], [ + 'RESULT Infra: Constant1= 11 count\n' + 'RESULT Infra: Constant2= [10,5,10,15] count\n' + 'RESULT Infra: Constant3= {12,1.2} count\n' + 'RESULT Infra: Constant4= [10,5,error,15] count\n']) self.assertEquals(1, self._CallMain()) self.assertEquals([ - {"units": "count", - "graphs": ["test", "Infra", "Constant1"], - "results": ["11.0"], - "stddev": ""}, - {"units": "count", - "graphs": ["test", "Infra", "Constant2"], - "results": ["10.0", "5.0", "10.0", "15.0"], - "stddev": ""}, - {"units": "count", - "graphs": ["test", "Infra", "Constant3"], - "results": ["12.0"], - "stddev": "1.2"}, - {"units": "count", - "graphs": ["test", "Infra", "Constant4"], - "results": [], - "stddev": ""}, - ], self._LoadResults()["traces"]) - self._VerifyErrors(["Found non-numeric in test/Infra/Constant4"]) - self._VerifyMock(path.join("out", "x64.release", "cc"), "--flag", "") + {'units': 'count', + 'graphs': ['test', 'Infra', 'Constant1'], + 'results': ['11.0'], + 'stddev': ''}, + {'units': 'count', + 'graphs': ['test', 'Infra', 'Constant2'], + 'results': ['10.0', '5.0', '10.0', '15.0'], + 'stddev': ''}, + {'units': 'count', + 'graphs': ['test', 'Infra', 'Constant3'], + 'results': ['12.0'], + 'stddev': '1.2'}, + {'units': 'count', + 'graphs': ['test', 'Infra', 'Constant4'], + 'results': [], + 'stddev': ''}, + ], self._LoadResults()['traces']) + self._VerifyErrors(['Found non-numeric in test/Infra/Constant4']) + self._VerifyMock(os.path.join('out', 'x64.release', 'cc'), '--flag', '') def testOneRunCrashed(self): self._WriteTestInput(V8_JSON) self._MockCommand( - ["."], ["x\nRichards: 1.234\nDeltaBlue: 10657567\ny\n"], exit_code=1) + ['.'], ['x\nRichards: 1.234\nDeltaBlue: 10657567\ny\n'], exit_code=1) self.assertEquals(1, self._CallMain()) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": [], "stddev": ""}, - {"name": "DeltaBlue", "results": [], "stddev": ""}, + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': [], 'stddev': ''}, + {'name': 'DeltaBlue', 'results': [], 'stddev': ''}, ]) self._VerifyErrors([]) - self._VerifyMock(path.join("out", "x64.release", "d7"), "--flag", "run.js") + self._VerifyMock( + os.path.join('out', 'x64.release', 'd7'), '--flag', 'run.js') def testOneRunTimingOut(self): test_input = dict(V8_JSON) - test_input["timeout"] = 70 + test_input['timeout'] = 70 self._WriteTestInput(test_input) - self._MockCommand(["."], [""], timed_out=True) + self._MockCommand(['.'], [''], timed_out=True) self.assertEquals(1, self._CallMain()) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": [], "stddev": ""}, - {"name": "DeltaBlue", "results": [], "stddev": ""}, + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': [], 'stddev': ''}, + {'name': 'DeltaBlue', 'results': [], 'stddev': ''}, ]) self._VerifyErrors([]) - self._VerifyMock( - path.join("out", "x64.release", "d7"), "--flag", "run.js", timeout=70) + self._VerifyMock(os.path.join('out', 'x64.release', 'd7'), + '--flag', 'run.js', timeout=70) - # Simple test that mocks out the android platform. Testing the platform would - # require lots of complicated mocks for the android tools. def testAndroid(self): self._WriteTestInput(V8_JSON) - # FIXME(machenbach): This is not test-local! - platform = run_perf.AndroidPlatform - platform.PreExecution = MagicMock(return_value=None) - platform.PostExecution = MagicMock(return_value=None) - platform.PreTests = MagicMock(return_value=None) - platform.Run = MagicMock( - return_value=("Richards: 1.234\nDeltaBlue: 10657567\n", None)) - run_perf.AndroidPlatform = MagicMock(return_value=platform) - with patch.object(run_perf.Platform, 'ReadBuildConfig', - MagicMock(return_value={'is_android': True})): - self.assertEquals(0, self._CallMain("--arch", "arm")) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": ["1.234"], "stddev": ""}, - {"name": "DeltaBlue", "results": ["10657567.0"], "stddev": ""}, + mock.patch('run_perf.AndroidPlatform.PreExecution').start() + mock.patch('run_perf.AndroidPlatform.PostExecution').start() + mock.patch('run_perf.AndroidPlatform.PreTests').start() + mock.patch( + 'run_perf.AndroidPlatform.Run', + return_value=( + 'Richards: 1.234\nDeltaBlue: 10657567\n', None)).start() + mock.patch('testrunner.local.android._Driver', autospec=True).start() + mock.patch( + 'run_perf.Platform.ReadBuildConfig', + return_value={'is_android': True}).start() + self.assertEquals(0, self._CallMain('--arch', 'arm')) + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': ['1.234'], 'stddev': ''}, + {'name': 'DeltaBlue', 'results': ['10657567.0'], 'stddev': ''}, ]) def testTwoRuns_Trybot(self): test_input = dict(V8_JSON) - test_input["run_count"] = 2 + test_input['run_count'] = 2 self._WriteTestInput(test_input) - self._MockCommand([".", ".", ".", "."], - ["Richards: 100\nDeltaBlue: 200\n", - "Richards: 200\nDeltaBlue: 20\n", - "Richards: 50\nDeltaBlue: 200\n", - "Richards: 100\nDeltaBlue: 20\n"]) - test_output_secondary = path.join(TEST_WORKSPACE, "results_secondary.json") + self._MockCommand(['.', '.', '.', '.'], + ['Richards: 100\nDeltaBlue: 200\n', + 'Richards: 200\nDeltaBlue: 20\n', + 'Richards: 50\nDeltaBlue: 200\n', + 'Richards: 100\nDeltaBlue: 20\n']) + test_output_secondary = os.path.join( + TEST_WORKSPACE, 'results_secondary.json') self.assertEquals(0, self._CallMain( - "--outdir-secondary", "out-secondary", - "--json-test-results-secondary", test_output_secondary, + '--outdir-secondary', 'out-secondary', + '--json-test-results-secondary', test_output_secondary, )) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": ["100.0", "200.0"], "stddev": ""}, - {"name": "DeltaBlue", "results": ["20.0", "20.0"], "stddev": ""}, + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': ['100.0', '200.0'], 'stddev': ''}, + {'name': 'DeltaBlue', 'results': ['20.0', '20.0'], 'stddev': ''}, ]) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": ["50.0", "100.0"], "stddev": ""}, - {"name": "DeltaBlue", "results": ["200.0", "200.0"], "stddev": ""}, + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': ['50.0', '100.0'], 'stddev': ''}, + {'name': 'DeltaBlue', 'results': ['200.0', '200.0'], 'stddev': ''}, ], test_output_secondary) self._VerifyErrors([]) self._VerifyMockMultiple( - (path.join("out", "x64.release", "d7"), "--flag", "run.js"), - (path.join("out-secondary", "x64.release", "d7"), "--flag", "run.js"), - (path.join("out", "x64.release", "d7"), "--flag", "run.js"), - (path.join("out-secondary", "x64.release", "d7"), "--flag", "run.js"), + (os.path.join('out', 'x64.release', 'd7'), '--flag', 'run.js'), + (os.path.join('out-secondary', 'x64.release', 'd7'), + '--flag', 'run.js'), + (os.path.join('out', 'x64.release', 'd7'), '--flag', 'run.js'), + (os.path.join('out-secondary', 'x64.release', 'd7'), + '--flag', 'run.js'), ) def testWrongBinaryWithProf(self): test_input = dict(V8_JSON) self._WriteTestInput(test_input) - self._MockCommand(["."], ["x\nRichards: 1.234\nDeltaBlue: 10657567\ny\n"]) - self.assertEquals(0, self._CallMain("--extra-flags=--prof")) - self._VerifyResults("test", "score", [ - {"name": "Richards", "results": ["1.234"], "stddev": ""}, - {"name": "DeltaBlue", "results": ["10657567.0"], "stddev": ""}, + self._MockCommand(['.'], ['x\nRichards: 1.234\nDeltaBlue: 10657567\ny\n']) + self.assertEquals(0, self._CallMain('--extra-flags=--prof')) + self._VerifyResults('test', 'score', [ + {'name': 'Richards', 'results': ['1.234'], 'stddev': ''}, + {'name': 'DeltaBlue', 'results': ['10657567.0'], 'stddev': ''}, ]) self._VerifyErrors([]) - self._VerifyMock(path.join("out", "x64.release", "d7"), - "--flag", "--prof", "run.js") + self._VerifyMock(os.path.join('out', 'x64.release', 'd7'), + '--flag', '--prof', 'run.js') def testUnzip(self): def Gen(): @@ -510,18 +528,18 @@ class PerfTest(unittest.TestCase): ### System tests def _RunPerf(self, mocked_d8, test_json): - output_json = path.join(TEST_WORKSPACE, "output.json") + output_json = os.path.join(TEST_WORKSPACE, 'output.json') args = [ - sys.executable, RUN_PERF, - "--binary-override-path", os.path.join(TEST_DATA, mocked_d8), - "--json-test-results", output_json, + os.sys.executable, RUN_PERF, + '--binary-override-path', os.path.join(TEST_DATA, mocked_d8), + '--json-test-results', output_json, os.path.join(TEST_DATA, test_json), ] subprocess.check_output(args) return self._LoadResults(output_json) def testNormal(self): - results = self._RunPerf("d8_mocked1.py", "test1.json") + results = self._RunPerf('d8_mocked1.py', 'test1.json') self.assertEquals([], results['errors']) self.assertEquals([ { @@ -539,7 +557,7 @@ class PerfTest(unittest.TestCase): ], results['traces']) def testResultsProcessor(self): - results = self._RunPerf("d8_mocked2.py", "test2.json") + results = self._RunPerf('d8_mocked2.py', 'test2.json') self.assertEquals([], results['errors']) self.assertEquals([ { @@ -557,7 +575,7 @@ class PerfTest(unittest.TestCase): ], results['traces']) def testResultsProcessorNested(self): - results = self._RunPerf("d8_mocked2.py", "test3.json") + results = self._RunPerf('d8_mocked2.py', 'test3.json') self.assertEquals([], results['errors']) self.assertEquals([ { diff --git a/deps/v8/tools/unittests/run_tests_test.py b/deps/v8/tools/unittests/run_tests_test.py index ffe440447d..93b10f5fd9 100755 --- a/deps/v8/tools/unittests/run_tests_test.py +++ b/deps/v8/tools/unittests/run_tests_test.py @@ -513,7 +513,7 @@ class SystemTest(unittest.TestCase): self.assertIn( 'Done running sweet/bananas default: FAIL', result.stdout, result) self.assertIn('Test had no allocation output', result.stdout, result) - self.assertIn('--predictable --verify_predictable', result.stdout, result) + self.assertIn('--predictable --verify-predictable', result.stdout, result) self.assertEqual(1, result.returncode, result) def testSlowArch(self): diff --git a/deps/v8/tools/unittests/testdata/expected_test_results1.json b/deps/v8/tools/unittests/testdata/expected_test_results1.json index 7f6742e4cc..bba3f04e96 100644 --- a/deps/v8/tools/unittests/testdata/expected_test_results1.json +++ b/deps/v8/tools/unittests/testdata/expected_test_results1.json @@ -16,6 +16,7 @@ "--random-seed=123", "--nohard-abort" ], + "framework_name": "standard_runner", "name": "sweet/strawberries", "random_seed": 123, "result": "FAIL", @@ -23,7 +24,8 @@ "stderr": "", "stdout": "--test strawberries --random-seed=123 --nohard-abort\n", "target_name": "d8_mocked.py", - "variant": "default" + "variant": "default", + "variant_flags": [] }, { "command": "/usr/bin/python out/Release/d8_mocked.py --test strawberries --random-seed=123 --nohard-abort", @@ -38,6 +40,7 @@ "--random-seed=123", "--nohard-abort" ], + "framework_name": "standard_runner", "name": "sweet/strawberries", "random_seed": 123, "result": "FAIL", @@ -45,7 +48,8 @@ "stderr": "", "stdout": "--test strawberries --random-seed=123 --nohard-abort\n", "target_name": "d8_mocked.py", - "variant": "default" + "variant": "default", + "variant_flags": [] }, { "command": "/usr/bin/python out/Release/d8_mocked.py --test strawberries --random-seed=123 --nohard-abort", @@ -60,6 +64,7 @@ "--random-seed=123", "--nohard-abort" ], + "framework_name": "standard_runner", "name": "sweet/strawberries", "random_seed": 123, "result": "FAIL", @@ -67,7 +72,8 @@ "stderr": "", "stdout": "--test strawberries --random-seed=123 --nohard-abort\n", "target_name": "d8_mocked.py", - "variant": "default" + "variant": "default", + "variant_flags": [] } ], "slowest_tests": [ diff --git a/deps/v8/tools/unittests/testdata/expected_test_results2.json b/deps/v8/tools/unittests/testdata/expected_test_results2.json index 95224befdd..bbbb90f4ac 100644 --- a/deps/v8/tools/unittests/testdata/expected_test_results2.json +++ b/deps/v8/tools/unittests/testdata/expected_test_results2.json @@ -15,6 +15,7 @@ "--random-seed=123", "--nohard-abort" ], + "framework_name": "standard_runner", "name": "sweet/bananaflakes", "random_seed": 123, "result": "FAIL", @@ -22,7 +23,8 @@ "stderr": "", "stdout": "bananaflakes --random-seed=123 --nohard-abort\n", "target_name": "d8_mocked.py", - "variant": "default" + "variant": "default", + "variant_flags": [] }, { "command": "/usr/bin/python out/Release/d8_mocked.py bananaflakes --random-seed=123 --nohard-abort", @@ -36,6 +38,7 @@ "--random-seed=123", "--nohard-abort" ], + "framework_name": "standard_runner", "name": "sweet/bananaflakes", "random_seed": 123, "result": "PASS", @@ -43,7 +46,8 @@ "stderr": "", "stdout": "bananaflakes --random-seed=123 --nohard-abort\n", "target_name": "d8_mocked.py", - "variant": "default" + "variant": "default", + "variant_flags": [] } ], "slowest_tests": [ diff --git a/deps/v8/tools/v8_presubmit.py b/deps/v8/tools/v8_presubmit.py index 67105394c7..ff72b62e22 100755 --- a/deps/v8/tools/v8_presubmit.py +++ b/deps/v8/tools/v8_presubmit.py @@ -366,7 +366,7 @@ class TorqueLintProcessor(CacheableSourceFileProcessor): return name.endswith('.tq') def GetPathsToSearch(self): - dirs = ['third-party', 'src'] + dirs = ['third_party', 'src'] test_dirs = ['torque'] return dirs + [join('test', dir) for dir in test_dirs] @@ -522,7 +522,8 @@ class SourceProcessor(SourceFileProcessor): if match: print("%s Flags should use '-' (not '_')" % name) result = False - if not "mjsunit/mjsunit.js" in name: + if (not "mjsunit/mjsunit.js" in name and + not "mjsunit/mjsunit_numfuzz.js" in name): if ASSERT_OPTIMIZED_PATTERN.search(contents) and \ not FLAGS_ENABLE_OPT.search(contents): print("%s Flag --opt should be set if " \ @@ -658,6 +659,7 @@ def PyTests(workspace): join(workspace, 'tools', 'clusterfuzz', 'v8_foozzie_test.py'), join(workspace, 'tools', 'release', 'test_scripts.py'), join(workspace, 'tools', 'unittests', 'run_tests_test.py'), + join(workspace, 'tools', 'unittests', 'run_perf_test.py'), join(workspace, 'tools', 'testrunner', 'testproc', 'variant_unittest.py'), ]: print('Running ' + script) diff --git a/deps/v8/tools/v8heapconst.py b/deps/v8/tools/v8heapconst.py index 9a0f323a0b..b891154e33 100644 --- a/deps/v8/tools/v8heapconst.py +++ b/deps/v8/tools/v8heapconst.py @@ -59,78 +59,80 @@ INSTANCE_TYPES = { 95: "ASYNC_GENERATOR_REQUEST_TYPE", 96: "CLASS_POSITIONS_TYPE", 97: "DEBUG_INFO_TYPE", - 98: "FUNCTION_TEMPLATE_INFO_TYPE", - 99: "FUNCTION_TEMPLATE_RARE_DATA_TYPE", - 100: "INTERCEPTOR_INFO_TYPE", - 101: "INTERPRETER_DATA_TYPE", - 102: "MODULE_INFO_ENTRY_TYPE", - 103: "MODULE_TYPE", - 104: "OBJECT_TEMPLATE_INFO_TYPE", - 105: "PROMISE_CAPABILITY_TYPE", - 106: "PROMISE_REACTION_TYPE", - 107: "PROTOTYPE_INFO_TYPE", - 108: "SCRIPT_TYPE", - 109: "STACK_FRAME_INFO_TYPE", - 110: "STACK_TRACE_FRAME_TYPE", - 111: "TUPLE2_TYPE", - 112: "TUPLE3_TYPE", - 113: "ARRAY_BOILERPLATE_DESCRIPTION_TYPE", - 114: "WASM_DEBUG_INFO_TYPE", - 115: "WASM_EXCEPTION_TAG_TYPE", - 116: "WASM_EXPORTED_FUNCTION_DATA_TYPE", - 117: "CALLABLE_TASK_TYPE", - 118: "CALLBACK_TASK_TYPE", - 119: "PROMISE_FULFILL_REACTION_JOB_TASK_TYPE", - 120: "PROMISE_REJECT_REACTION_JOB_TASK_TYPE", - 121: "PROMISE_RESOLVE_THENABLE_JOB_TASK_TYPE", - 122: "FINALIZATION_GROUP_CLEANUP_JOB_TASK_TYPE", - 123: "ALLOCATION_SITE_TYPE", - 124: "EMBEDDER_DATA_ARRAY_TYPE", - 125: "FIXED_ARRAY_TYPE", - 126: "OBJECT_BOILERPLATE_DESCRIPTION_TYPE", - 127: "HASH_TABLE_TYPE", - 128: "ORDERED_HASH_MAP_TYPE", - 129: "ORDERED_HASH_SET_TYPE", - 130: "ORDERED_NAME_DICTIONARY_TYPE", - 131: "NAME_DICTIONARY_TYPE", - 132: "GLOBAL_DICTIONARY_TYPE", - 133: "NUMBER_DICTIONARY_TYPE", - 134: "SIMPLE_NUMBER_DICTIONARY_TYPE", - 135: "STRING_TABLE_TYPE", - 136: "EPHEMERON_HASH_TABLE_TYPE", - 137: "SCOPE_INFO_TYPE", - 138: "SCRIPT_CONTEXT_TABLE_TYPE", - 139: "AWAIT_CONTEXT_TYPE", - 140: "BLOCK_CONTEXT_TYPE", - 141: "CATCH_CONTEXT_TYPE", - 142: "DEBUG_EVALUATE_CONTEXT_TYPE", - 143: "EVAL_CONTEXT_TYPE", - 144: "FUNCTION_CONTEXT_TYPE", - 145: "MODULE_CONTEXT_TYPE", - 146: "NATIVE_CONTEXT_TYPE", - 147: "SCRIPT_CONTEXT_TYPE", - 148: "WITH_CONTEXT_TYPE", - 149: "WEAK_FIXED_ARRAY_TYPE", - 150: "TRANSITION_ARRAY_TYPE", - 151: "CALL_HANDLER_INFO_TYPE", - 152: "CELL_TYPE", - 153: "CODE_DATA_CONTAINER_TYPE", - 154: "DESCRIPTOR_ARRAY_TYPE", - 155: "FEEDBACK_CELL_TYPE", - 156: "FEEDBACK_VECTOR_TYPE", - 157: "LOAD_HANDLER_TYPE", - 158: "PREPARSE_DATA_TYPE", - 159: "PROPERTY_ARRAY_TYPE", - 160: "PROPERTY_CELL_TYPE", - 161: "SHARED_FUNCTION_INFO_TYPE", - 162: "SMALL_ORDERED_HASH_MAP_TYPE", - 163: "SMALL_ORDERED_HASH_SET_TYPE", - 164: "SMALL_ORDERED_NAME_DICTIONARY_TYPE", - 165: "STORE_HANDLER_TYPE", - 166: "UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_TYPE", - 167: "UNCOMPILED_DATA_WITH_PREPARSE_DATA_TYPE", - 168: "WEAK_ARRAY_LIST_TYPE", - 169: "WEAK_CELL_TYPE", + 98: "ENUM_CACHE_TYPE", + 99: "FUNCTION_TEMPLATE_INFO_TYPE", + 100: "FUNCTION_TEMPLATE_RARE_DATA_TYPE", + 101: "INTERCEPTOR_INFO_TYPE", + 102: "INTERPRETER_DATA_TYPE", + 103: "MODULE_INFO_ENTRY_TYPE", + 104: "MODULE_TYPE", + 105: "OBJECT_TEMPLATE_INFO_TYPE", + 106: "PROMISE_CAPABILITY_TYPE", + 107: "PROMISE_REACTION_TYPE", + 108: "PROTOTYPE_INFO_TYPE", + 109: "SCRIPT_TYPE", + 110: "STACK_FRAME_INFO_TYPE", + 111: "STACK_TRACE_FRAME_TYPE", + 112: "TUPLE2_TYPE", + 113: "TUPLE3_TYPE", + 114: "ARRAY_BOILERPLATE_DESCRIPTION_TYPE", + 115: "WASM_DEBUG_INFO_TYPE", + 116: "WASM_EXCEPTION_TAG_TYPE", + 117: "WASM_EXPORTED_FUNCTION_DATA_TYPE", + 118: "CALLABLE_TASK_TYPE", + 119: "CALLBACK_TASK_TYPE", + 120: "PROMISE_FULFILL_REACTION_JOB_TASK_TYPE", + 121: "PROMISE_REJECT_REACTION_JOB_TASK_TYPE", + 122: "PROMISE_RESOLVE_THENABLE_JOB_TASK_TYPE", + 123: "FINALIZATION_GROUP_CLEANUP_JOB_TASK_TYPE", + 124: "ALLOCATION_SITE_TYPE", + 125: "EMBEDDER_DATA_ARRAY_TYPE", + 126: "FIXED_ARRAY_TYPE", + 127: "OBJECT_BOILERPLATE_DESCRIPTION_TYPE", + 128: "CLOSURE_FEEDBACK_CELL_ARRAY_TYPE", + 129: "HASH_TABLE_TYPE", + 130: "ORDERED_HASH_MAP_TYPE", + 131: "ORDERED_HASH_SET_TYPE", + 132: "ORDERED_NAME_DICTIONARY_TYPE", + 133: "NAME_DICTIONARY_TYPE", + 134: "GLOBAL_DICTIONARY_TYPE", + 135: "NUMBER_DICTIONARY_TYPE", + 136: "SIMPLE_NUMBER_DICTIONARY_TYPE", + 137: "STRING_TABLE_TYPE", + 138: "EPHEMERON_HASH_TABLE_TYPE", + 139: "SCOPE_INFO_TYPE", + 140: "SCRIPT_CONTEXT_TABLE_TYPE", + 141: "AWAIT_CONTEXT_TYPE", + 142: "BLOCK_CONTEXT_TYPE", + 143: "CATCH_CONTEXT_TYPE", + 144: "DEBUG_EVALUATE_CONTEXT_TYPE", + 145: "EVAL_CONTEXT_TYPE", + 146: "FUNCTION_CONTEXT_TYPE", + 147: "MODULE_CONTEXT_TYPE", + 148: "NATIVE_CONTEXT_TYPE", + 149: "SCRIPT_CONTEXT_TYPE", + 150: "WITH_CONTEXT_TYPE", + 151: "WEAK_FIXED_ARRAY_TYPE", + 152: "TRANSITION_ARRAY_TYPE", + 153: "CALL_HANDLER_INFO_TYPE", + 154: "CELL_TYPE", + 155: "CODE_DATA_CONTAINER_TYPE", + 156: "DESCRIPTOR_ARRAY_TYPE", + 157: "FEEDBACK_CELL_TYPE", + 158: "FEEDBACK_VECTOR_TYPE", + 159: "LOAD_HANDLER_TYPE", + 160: "PREPARSE_DATA_TYPE", + 161: "PROPERTY_ARRAY_TYPE", + 162: "PROPERTY_CELL_TYPE", + 163: "SHARED_FUNCTION_INFO_TYPE", + 164: "SMALL_ORDERED_HASH_MAP_TYPE", + 165: "SMALL_ORDERED_HASH_SET_TYPE", + 166: "SMALL_ORDERED_NAME_DICTIONARY_TYPE", + 167: "STORE_HANDLER_TYPE", + 168: "UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_TYPE", + 169: "UNCOMPILED_DATA_WITH_PREPARSE_DATA_TYPE", + 170: "WEAK_ARRAY_LIST_TYPE", + 171: "WEAK_CELL_TYPE", 1024: "JS_PROXY_TYPE", 1025: "JS_GLOBAL_OBJECT_TYPE", 1026: "JS_GLOBAL_PROXY_TYPE", @@ -191,247 +193,248 @@ INSTANCE_TYPES = { # List of known V8 maps. KNOWN_MAPS = { - ("RO_SPACE", 0x00139): (74, "FreeSpaceMap"), - ("RO_SPACE", 0x00189): (68, "MetaMap"), - ("RO_SPACE", 0x00209): (67, "NullMap"), - ("RO_SPACE", 0x00271): (154, "DescriptorArrayMap"), - ("RO_SPACE", 0x002d1): (149, "WeakFixedArrayMap"), - ("RO_SPACE", 0x00321): (88, "OnePointerFillerMap"), - ("RO_SPACE", 0x00371): (88, "TwoPointerFillerMap"), - ("RO_SPACE", 0x003f1): (67, "UninitializedMap"), - ("RO_SPACE", 0x00461): (8, "OneByteInternalizedStringMap"), - ("RO_SPACE", 0x00501): (67, "UndefinedMap"), - ("RO_SPACE", 0x00561): (65, "HeapNumberMap"), - ("RO_SPACE", 0x005e1): (67, "TheHoleMap"), - ("RO_SPACE", 0x00689): (67, "BooleanMap"), - ("RO_SPACE", 0x00761): (72, "ByteArrayMap"), - ("RO_SPACE", 0x007b1): (125, "FixedArrayMap"), - ("RO_SPACE", 0x00801): (125, "FixedCOWArrayMap"), - ("RO_SPACE", 0x00851): (127, "HashTableMap"), - ("RO_SPACE", 0x008a1): (64, "SymbolMap"), - ("RO_SPACE", 0x008f1): (40, "OneByteStringMap"), - ("RO_SPACE", 0x00941): (137, "ScopeInfoMap"), - ("RO_SPACE", 0x00991): (161, "SharedFunctionInfoMap"), - ("RO_SPACE", 0x009e1): (69, "CodeMap"), - ("RO_SPACE", 0x00a31): (144, "FunctionContextMap"), - ("RO_SPACE", 0x00a81): (152, "CellMap"), - ("RO_SPACE", 0x00ad1): (160, "GlobalPropertyCellMap"), - ("RO_SPACE", 0x00b21): (71, "ForeignMap"), - ("RO_SPACE", 0x00b71): (150, "TransitionArrayMap"), - ("RO_SPACE", 0x00bc1): (156, "FeedbackVectorMap"), - ("RO_SPACE", 0x00c61): (67, "ArgumentsMarkerMap"), - ("RO_SPACE", 0x00d01): (67, "ExceptionMap"), - ("RO_SPACE", 0x00da1): (67, "TerminationExceptionMap"), - ("RO_SPACE", 0x00e49): (67, "OptimizedOutMap"), - ("RO_SPACE", 0x00ee9): (67, "StaleRegisterMap"), - ("RO_SPACE", 0x00f59): (146, "NativeContextMap"), - ("RO_SPACE", 0x00fa9): (145, "ModuleContextMap"), - ("RO_SPACE", 0x00ff9): (143, "EvalContextMap"), - ("RO_SPACE", 0x01049): (147, "ScriptContextMap"), - ("RO_SPACE", 0x01099): (139, "AwaitContextMap"), - ("RO_SPACE", 0x010e9): (140, "BlockContextMap"), - ("RO_SPACE", 0x01139): (141, "CatchContextMap"), - ("RO_SPACE", 0x01189): (148, "WithContextMap"), - ("RO_SPACE", 0x011d9): (142, "DebugEvaluateContextMap"), - ("RO_SPACE", 0x01229): (138, "ScriptContextTableMap"), - ("RO_SPACE", 0x01279): (87, "FeedbackMetadataArrayMap"), - ("RO_SPACE", 0x012c9): (125, "ArrayListMap"), - ("RO_SPACE", 0x01319): (66, "BigIntMap"), - ("RO_SPACE", 0x01369): (126, "ObjectBoilerplateDescriptionMap"), - ("RO_SPACE", 0x013b9): (73, "BytecodeArrayMap"), - ("RO_SPACE", 0x01409): (153, "CodeDataContainerMap"), - ("RO_SPACE", 0x01459): (86, "FixedDoubleArrayMap"), - ("RO_SPACE", 0x014a9): (132, "GlobalDictionaryMap"), - ("RO_SPACE", 0x014f9): (155, "ManyClosuresCellMap"), - ("RO_SPACE", 0x01549): (125, "ModuleInfoMap"), - ("RO_SPACE", 0x01599): (70, "MutableHeapNumberMap"), - ("RO_SPACE", 0x015e9): (131, "NameDictionaryMap"), - ("RO_SPACE", 0x01639): (155, "NoClosuresCellMap"), - ("RO_SPACE", 0x01689): (155, "NoFeedbackCellMap"), - ("RO_SPACE", 0x016d9): (133, "NumberDictionaryMap"), - ("RO_SPACE", 0x01729): (155, "OneClosureCellMap"), - ("RO_SPACE", 0x01779): (128, "OrderedHashMapMap"), - ("RO_SPACE", 0x017c9): (129, "OrderedHashSetMap"), - ("RO_SPACE", 0x01819): (130, "OrderedNameDictionaryMap"), - ("RO_SPACE", 0x01869): (158, "PreparseDataMap"), - ("RO_SPACE", 0x018b9): (159, "PropertyArrayMap"), - ("RO_SPACE", 0x01909): (151, "SideEffectCallHandlerInfoMap"), - ("RO_SPACE", 0x01959): (151, "SideEffectFreeCallHandlerInfoMap"), - ("RO_SPACE", 0x019a9): (151, "NextCallSideEffectFreeCallHandlerInfoMap"), - ("RO_SPACE", 0x019f9): (134, "SimpleNumberDictionaryMap"), - ("RO_SPACE", 0x01a49): (125, "SloppyArgumentsElementsMap"), - ("RO_SPACE", 0x01a99): (162, "SmallOrderedHashMapMap"), - ("RO_SPACE", 0x01ae9): (163, "SmallOrderedHashSetMap"), - ("RO_SPACE", 0x01b39): (164, "SmallOrderedNameDictionaryMap"), - ("RO_SPACE", 0x01b89): (135, "StringTableMap"), - ("RO_SPACE", 0x01bd9): (166, "UncompiledDataWithoutPreparseDataMap"), - ("RO_SPACE", 0x01c29): (167, "UncompiledDataWithPreparseDataMap"), - ("RO_SPACE", 0x01c79): (168, "WeakArrayListMap"), - ("RO_SPACE", 0x01cc9): (136, "EphemeronHashTableMap"), - ("RO_SPACE", 0x01d19): (124, "EmbedderDataArrayMap"), - ("RO_SPACE", 0x01d69): (169, "WeakCellMap"), - ("RO_SPACE", 0x01db9): (58, "NativeSourceStringMap"), - ("RO_SPACE", 0x01e09): (32, "StringMap"), - ("RO_SPACE", 0x01e59): (41, "ConsOneByteStringMap"), - ("RO_SPACE", 0x01ea9): (33, "ConsStringMap"), - ("RO_SPACE", 0x01ef9): (45, "ThinOneByteStringMap"), - ("RO_SPACE", 0x01f49): (37, "ThinStringMap"), - ("RO_SPACE", 0x01f99): (35, "SlicedStringMap"), - ("RO_SPACE", 0x01fe9): (43, "SlicedOneByteStringMap"), - ("RO_SPACE", 0x02039): (34, "ExternalStringMap"), - ("RO_SPACE", 0x02089): (42, "ExternalOneByteStringMap"), - ("RO_SPACE", 0x020d9): (50, "UncachedExternalStringMap"), - ("RO_SPACE", 0x02129): (0, "InternalizedStringMap"), - ("RO_SPACE", 0x02179): (2, "ExternalInternalizedStringMap"), - ("RO_SPACE", 0x021c9): (10, "ExternalOneByteInternalizedStringMap"), - ("RO_SPACE", 0x02219): (18, "UncachedExternalInternalizedStringMap"), - ("RO_SPACE", 0x02269): (26, "UncachedExternalOneByteInternalizedStringMap"), - ("RO_SPACE", 0x022b9): (58, "UncachedExternalOneByteStringMap"), - ("RO_SPACE", 0x02309): (76, "FixedUint8ArrayMap"), - ("RO_SPACE", 0x02359): (75, "FixedInt8ArrayMap"), - ("RO_SPACE", 0x023a9): (78, "FixedUint16ArrayMap"), - ("RO_SPACE", 0x023f9): (77, "FixedInt16ArrayMap"), - ("RO_SPACE", 0x02449): (80, "FixedUint32ArrayMap"), - ("RO_SPACE", 0x02499): (79, "FixedInt32ArrayMap"), - ("RO_SPACE", 0x024e9): (81, "FixedFloat32ArrayMap"), - ("RO_SPACE", 0x02539): (82, "FixedFloat64ArrayMap"), - ("RO_SPACE", 0x02589): (83, "FixedUint8ClampedArrayMap"), - ("RO_SPACE", 0x025d9): (85, "FixedBigUint64ArrayMap"), - ("RO_SPACE", 0x02629): (84, "FixedBigInt64ArrayMap"), - ("RO_SPACE", 0x02679): (67, "SelfReferenceMarkerMap"), - ("RO_SPACE", 0x026e1): (111, "Tuple2Map"), - ("RO_SPACE", 0x02781): (113, "ArrayBoilerplateDescriptionMap"), - ("RO_SPACE", 0x02ac1): (100, "InterceptorInfoMap"), - ("RO_SPACE", 0x04fe1): (89, "AccessCheckInfoMap"), - ("RO_SPACE", 0x05031): (90, "AccessorInfoMap"), - ("RO_SPACE", 0x05081): (91, "AccessorPairMap"), - ("RO_SPACE", 0x050d1): (92, "AliasedArgumentsEntryMap"), - ("RO_SPACE", 0x05121): (93, "AllocationMementoMap"), - ("RO_SPACE", 0x05171): (94, "AsmWasmDataMap"), - ("RO_SPACE", 0x051c1): (95, "AsyncGeneratorRequestMap"), - ("RO_SPACE", 0x05211): (96, "ClassPositionsMap"), - ("RO_SPACE", 0x05261): (97, "DebugInfoMap"), - ("RO_SPACE", 0x052b1): (98, "FunctionTemplateInfoMap"), - ("RO_SPACE", 0x05301): (99, "FunctionTemplateRareDataMap"), - ("RO_SPACE", 0x05351): (101, "InterpreterDataMap"), - ("RO_SPACE", 0x053a1): (102, "ModuleInfoEntryMap"), - ("RO_SPACE", 0x053f1): (103, "ModuleMap"), - ("RO_SPACE", 0x05441): (104, "ObjectTemplateInfoMap"), - ("RO_SPACE", 0x05491): (105, "PromiseCapabilityMap"), - ("RO_SPACE", 0x054e1): (106, "PromiseReactionMap"), - ("RO_SPACE", 0x05531): (107, "PrototypeInfoMap"), - ("RO_SPACE", 0x05581): (108, "ScriptMap"), - ("RO_SPACE", 0x055d1): (109, "StackFrameInfoMap"), - ("RO_SPACE", 0x05621): (110, "StackTraceFrameMap"), - ("RO_SPACE", 0x05671): (112, "Tuple3Map"), - ("RO_SPACE", 0x056c1): (114, "WasmDebugInfoMap"), - ("RO_SPACE", 0x05711): (115, "WasmExceptionTagMap"), - ("RO_SPACE", 0x05761): (116, "WasmExportedFunctionDataMap"), - ("RO_SPACE", 0x057b1): (117, "CallableTaskMap"), - ("RO_SPACE", 0x05801): (118, "CallbackTaskMap"), - ("RO_SPACE", 0x05851): (119, "PromiseFulfillReactionJobTaskMap"), - ("RO_SPACE", 0x058a1): (120, "PromiseRejectReactionJobTaskMap"), - ("RO_SPACE", 0x058f1): (121, "PromiseResolveThenableJobTaskMap"), - ("RO_SPACE", 0x05941): (122, "FinalizationGroupCleanupJobTaskMap"), - ("RO_SPACE", 0x05991): (123, "AllocationSiteWithWeakNextMap"), - ("RO_SPACE", 0x059e1): (123, "AllocationSiteWithoutWeakNextMap"), - ("RO_SPACE", 0x05a31): (157, "LoadHandler1Map"), - ("RO_SPACE", 0x05a81): (157, "LoadHandler2Map"), - ("RO_SPACE", 0x05ad1): (157, "LoadHandler3Map"), - ("RO_SPACE", 0x05b21): (165, "StoreHandler0Map"), - ("RO_SPACE", 0x05b71): (165, "StoreHandler1Map"), - ("RO_SPACE", 0x05bc1): (165, "StoreHandler2Map"), - ("RO_SPACE", 0x05c11): (165, "StoreHandler3Map"), - ("MAP_SPACE", 0x00139): (1057, "ExternalMap"), - ("MAP_SPACE", 0x00189): (1073, "JSMessageObjectMap"), + ("read_only_space", 0x00139): (74, "FreeSpaceMap"), + ("read_only_space", 0x00189): (68, "MetaMap"), + ("read_only_space", 0x00209): (67, "NullMap"), + ("read_only_space", 0x00271): (156, "DescriptorArrayMap"), + ("read_only_space", 0x002d1): (151, "WeakFixedArrayMap"), + ("read_only_space", 0x00321): (88, "OnePointerFillerMap"), + ("read_only_space", 0x00371): (88, "TwoPointerFillerMap"), + ("read_only_space", 0x003f1): (67, "UninitializedMap"), + ("read_only_space", 0x00461): (8, "OneByteInternalizedStringMap"), + ("read_only_space", 0x00501): (67, "UndefinedMap"), + ("read_only_space", 0x00561): (65, "HeapNumberMap"), + ("read_only_space", 0x005e1): (67, "TheHoleMap"), + ("read_only_space", 0x00689): (67, "BooleanMap"), + ("read_only_space", 0x00761): (72, "ByteArrayMap"), + ("read_only_space", 0x007b1): (126, "FixedArrayMap"), + ("read_only_space", 0x00801): (126, "FixedCOWArrayMap"), + ("read_only_space", 0x00851): (129, "HashTableMap"), + ("read_only_space", 0x008a1): (64, "SymbolMap"), + ("read_only_space", 0x008f1): (40, "OneByteStringMap"), + ("read_only_space", 0x00941): (139, "ScopeInfoMap"), + ("read_only_space", 0x00991): (163, "SharedFunctionInfoMap"), + ("read_only_space", 0x009e1): (69, "CodeMap"), + ("read_only_space", 0x00a31): (146, "FunctionContextMap"), + ("read_only_space", 0x00a81): (154, "CellMap"), + ("read_only_space", 0x00ad1): (162, "GlobalPropertyCellMap"), + ("read_only_space", 0x00b21): (71, "ForeignMap"), + ("read_only_space", 0x00b71): (152, "TransitionArrayMap"), + ("read_only_space", 0x00bc1): (158, "FeedbackVectorMap"), + ("read_only_space", 0x00c61): (67, "ArgumentsMarkerMap"), + ("read_only_space", 0x00d01): (67, "ExceptionMap"), + ("read_only_space", 0x00da1): (67, "TerminationExceptionMap"), + ("read_only_space", 0x00e49): (67, "OptimizedOutMap"), + ("read_only_space", 0x00ee9): (67, "StaleRegisterMap"), + ("read_only_space", 0x00f59): (148, "NativeContextMap"), + ("read_only_space", 0x00fa9): (147, "ModuleContextMap"), + ("read_only_space", 0x00ff9): (145, "EvalContextMap"), + ("read_only_space", 0x01049): (149, "ScriptContextMap"), + ("read_only_space", 0x01099): (141, "AwaitContextMap"), + ("read_only_space", 0x010e9): (142, "BlockContextMap"), + ("read_only_space", 0x01139): (143, "CatchContextMap"), + ("read_only_space", 0x01189): (150, "WithContextMap"), + ("read_only_space", 0x011d9): (144, "DebugEvaluateContextMap"), + ("read_only_space", 0x01229): (140, "ScriptContextTableMap"), + ("read_only_space", 0x01279): (128, "ClosureFeedbackCellArrayMap"), + ("read_only_space", 0x012c9): (87, "FeedbackMetadataArrayMap"), + ("read_only_space", 0x01319): (126, "ArrayListMap"), + ("read_only_space", 0x01369): (66, "BigIntMap"), + ("read_only_space", 0x013b9): (127, "ObjectBoilerplateDescriptionMap"), + ("read_only_space", 0x01409): (73, "BytecodeArrayMap"), + ("read_only_space", 0x01459): (155, "CodeDataContainerMap"), + ("read_only_space", 0x014a9): (86, "FixedDoubleArrayMap"), + ("read_only_space", 0x014f9): (134, "GlobalDictionaryMap"), + ("read_only_space", 0x01549): (157, "ManyClosuresCellMap"), + ("read_only_space", 0x01599): (126, "ModuleInfoMap"), + ("read_only_space", 0x015e9): (70, "MutableHeapNumberMap"), + ("read_only_space", 0x01639): (133, "NameDictionaryMap"), + ("read_only_space", 0x01689): (157, "NoClosuresCellMap"), + ("read_only_space", 0x016d9): (135, "NumberDictionaryMap"), + ("read_only_space", 0x01729): (157, "OneClosureCellMap"), + ("read_only_space", 0x01779): (130, "OrderedHashMapMap"), + ("read_only_space", 0x017c9): (131, "OrderedHashSetMap"), + ("read_only_space", 0x01819): (132, "OrderedNameDictionaryMap"), + ("read_only_space", 0x01869): (160, "PreparseDataMap"), + ("read_only_space", 0x018b9): (161, "PropertyArrayMap"), + ("read_only_space", 0x01909): (153, "SideEffectCallHandlerInfoMap"), + ("read_only_space", 0x01959): (153, "SideEffectFreeCallHandlerInfoMap"), + ("read_only_space", 0x019a9): (153, "NextCallSideEffectFreeCallHandlerInfoMap"), + ("read_only_space", 0x019f9): (136, "SimpleNumberDictionaryMap"), + ("read_only_space", 0x01a49): (126, "SloppyArgumentsElementsMap"), + ("read_only_space", 0x01a99): (164, "SmallOrderedHashMapMap"), + ("read_only_space", 0x01ae9): (165, "SmallOrderedHashSetMap"), + ("read_only_space", 0x01b39): (166, "SmallOrderedNameDictionaryMap"), + ("read_only_space", 0x01b89): (137, "StringTableMap"), + ("read_only_space", 0x01bd9): (168, "UncompiledDataWithoutPreparseDataMap"), + ("read_only_space", 0x01c29): (169, "UncompiledDataWithPreparseDataMap"), + ("read_only_space", 0x01c79): (170, "WeakArrayListMap"), + ("read_only_space", 0x01cc9): (138, "EphemeronHashTableMap"), + ("read_only_space", 0x01d19): (125, "EmbedderDataArrayMap"), + ("read_only_space", 0x01d69): (171, "WeakCellMap"), + ("read_only_space", 0x01db9): (58, "NativeSourceStringMap"), + ("read_only_space", 0x01e09): (32, "StringMap"), + ("read_only_space", 0x01e59): (41, "ConsOneByteStringMap"), + ("read_only_space", 0x01ea9): (33, "ConsStringMap"), + ("read_only_space", 0x01ef9): (45, "ThinOneByteStringMap"), + ("read_only_space", 0x01f49): (37, "ThinStringMap"), + ("read_only_space", 0x01f99): (35, "SlicedStringMap"), + ("read_only_space", 0x01fe9): (43, "SlicedOneByteStringMap"), + ("read_only_space", 0x02039): (34, "ExternalStringMap"), + ("read_only_space", 0x02089): (42, "ExternalOneByteStringMap"), + ("read_only_space", 0x020d9): (50, "UncachedExternalStringMap"), + ("read_only_space", 0x02129): (0, "InternalizedStringMap"), + ("read_only_space", 0x02179): (2, "ExternalInternalizedStringMap"), + ("read_only_space", 0x021c9): (10, "ExternalOneByteInternalizedStringMap"), + ("read_only_space", 0x02219): (18, "UncachedExternalInternalizedStringMap"), + ("read_only_space", 0x02269): (26, "UncachedExternalOneByteInternalizedStringMap"), + ("read_only_space", 0x022b9): (58, "UncachedExternalOneByteStringMap"), + ("read_only_space", 0x02309): (76, "FixedUint8ArrayMap"), + ("read_only_space", 0x02359): (75, "FixedInt8ArrayMap"), + ("read_only_space", 0x023a9): (78, "FixedUint16ArrayMap"), + ("read_only_space", 0x023f9): (77, "FixedInt16ArrayMap"), + ("read_only_space", 0x02449): (80, "FixedUint32ArrayMap"), + ("read_only_space", 0x02499): (79, "FixedInt32ArrayMap"), + ("read_only_space", 0x024e9): (81, "FixedFloat32ArrayMap"), + ("read_only_space", 0x02539): (82, "FixedFloat64ArrayMap"), + ("read_only_space", 0x02589): (83, "FixedUint8ClampedArrayMap"), + ("read_only_space", 0x025d9): (85, "FixedBigUint64ArrayMap"), + ("read_only_space", 0x02629): (84, "FixedBigInt64ArrayMap"), + ("read_only_space", 0x02679): (67, "SelfReferenceMarkerMap"), + ("read_only_space", 0x026e1): (98, "EnumCacheMap"), + ("read_only_space", 0x02781): (114, "ArrayBoilerplateDescriptionMap"), + ("read_only_space", 0x02ad1): (101, "InterceptorInfoMap"), + ("read_only_space", 0x050b9): (89, "AccessCheckInfoMap"), + ("read_only_space", 0x05109): (90, "AccessorInfoMap"), + ("read_only_space", 0x05159): (91, "AccessorPairMap"), + ("read_only_space", 0x051a9): (92, "AliasedArgumentsEntryMap"), + ("read_only_space", 0x051f9): (93, "AllocationMementoMap"), + ("read_only_space", 0x05249): (94, "AsmWasmDataMap"), + ("read_only_space", 0x05299): (95, "AsyncGeneratorRequestMap"), + ("read_only_space", 0x052e9): (96, "ClassPositionsMap"), + ("read_only_space", 0x05339): (97, "DebugInfoMap"), + ("read_only_space", 0x05389): (99, "FunctionTemplateInfoMap"), + ("read_only_space", 0x053d9): (100, "FunctionTemplateRareDataMap"), + ("read_only_space", 0x05429): (102, "InterpreterDataMap"), + ("read_only_space", 0x05479): (103, "ModuleInfoEntryMap"), + ("read_only_space", 0x054c9): (104, "ModuleMap"), + ("read_only_space", 0x05519): (105, "ObjectTemplateInfoMap"), + ("read_only_space", 0x05569): (106, "PromiseCapabilityMap"), + ("read_only_space", 0x055b9): (107, "PromiseReactionMap"), + ("read_only_space", 0x05609): (108, "PrototypeInfoMap"), + ("read_only_space", 0x05659): (109, "ScriptMap"), + ("read_only_space", 0x056a9): (110, "StackFrameInfoMap"), + ("read_only_space", 0x056f9): (111, "StackTraceFrameMap"), + ("read_only_space", 0x05749): (112, "Tuple2Map"), + ("read_only_space", 0x05799): (113, "Tuple3Map"), + ("read_only_space", 0x057e9): (115, "WasmDebugInfoMap"), + ("read_only_space", 0x05839): (116, "WasmExceptionTagMap"), + ("read_only_space", 0x05889): (117, "WasmExportedFunctionDataMap"), + ("read_only_space", 0x058d9): (118, "CallableTaskMap"), + ("read_only_space", 0x05929): (119, "CallbackTaskMap"), + ("read_only_space", 0x05979): (120, "PromiseFulfillReactionJobTaskMap"), + ("read_only_space", 0x059c9): (121, "PromiseRejectReactionJobTaskMap"), + ("read_only_space", 0x05a19): (122, "PromiseResolveThenableJobTaskMap"), + ("read_only_space", 0x05a69): (123, "FinalizationGroupCleanupJobTaskMap"), + ("read_only_space", 0x05ab9): (124, "AllocationSiteWithWeakNextMap"), + ("read_only_space", 0x05b09): (124, "AllocationSiteWithoutWeakNextMap"), + ("read_only_space", 0x05b59): (159, "LoadHandler1Map"), + ("read_only_space", 0x05ba9): (159, "LoadHandler2Map"), + ("read_only_space", 0x05bf9): (159, "LoadHandler3Map"), + ("read_only_space", 0x05c49): (167, "StoreHandler0Map"), + ("read_only_space", 0x05c99): (167, "StoreHandler1Map"), + ("read_only_space", 0x05ce9): (167, "StoreHandler2Map"), + ("read_only_space", 0x05d39): (167, "StoreHandler3Map"), + ("map_space", 0x00139): (1057, "ExternalMap"), + ("map_space", 0x00189): (1073, "JSMessageObjectMap"), } # List of known V8 objects. KNOWN_OBJECTS = { - ("RO_SPACE", 0x001d9): "NullValue", - ("RO_SPACE", 0x00259): "EmptyDescriptorArray", - ("RO_SPACE", 0x002c1): "EmptyWeakFixedArray", - ("RO_SPACE", 0x003c1): "UninitializedValue", - ("RO_SPACE", 0x004d1): "UndefinedValue", - ("RO_SPACE", 0x00551): "NanValue", - ("RO_SPACE", 0x005b1): "TheHoleValue", - ("RO_SPACE", 0x00649): "HoleNanValue", - ("RO_SPACE", 0x00659): "TrueValue", - ("RO_SPACE", 0x00709): "FalseValue", - ("RO_SPACE", 0x00751): "empty_string", - ("RO_SPACE", 0x00c11): "EmptyScopeInfo", - ("RO_SPACE", 0x00c21): "EmptyFixedArray", - ("RO_SPACE", 0x00c31): "ArgumentsMarker", - ("RO_SPACE", 0x00cd1): "Exception", - ("RO_SPACE", 0x00d71): "TerminationException", - ("RO_SPACE", 0x00e19): "OptimizedOut", - ("RO_SPACE", 0x00eb9): "StaleRegister", - ("RO_SPACE", 0x026c9): "EmptyEnumCache", - ("RO_SPACE", 0x02731): "EmptyPropertyArray", - ("RO_SPACE", 0x02741): "EmptyByteArray", - ("RO_SPACE", 0x02751): "EmptyObjectBoilerplateDescription", - ("RO_SPACE", 0x02769): "EmptyArrayBoilerplateDescription", - ("RO_SPACE", 0x027d1): "EmptyFixedUint8Array", - ("RO_SPACE", 0x027f1): "EmptyFixedInt8Array", - ("RO_SPACE", 0x02811): "EmptyFixedUint16Array", - ("RO_SPACE", 0x02831): "EmptyFixedInt16Array", - ("RO_SPACE", 0x02851): "EmptyFixedUint32Array", - ("RO_SPACE", 0x02871): "EmptyFixedInt32Array", - ("RO_SPACE", 0x02891): "EmptyFixedFloat32Array", - ("RO_SPACE", 0x028b1): "EmptyFixedFloat64Array", - ("RO_SPACE", 0x028d1): "EmptyFixedUint8ClampedArray", - ("RO_SPACE", 0x028f1): "EmptyFixedBigUint64Array", - ("RO_SPACE", 0x02911): "EmptyFixedBigInt64Array", - ("RO_SPACE", 0x02931): "EmptySloppyArgumentsElements", - ("RO_SPACE", 0x02951): "EmptySlowElementDictionary", - ("RO_SPACE", 0x02999): "EmptyOrderedHashMap", - ("RO_SPACE", 0x029c1): "EmptyOrderedHashSet", - ("RO_SPACE", 0x029e9): "EmptyFeedbackMetadata", - ("RO_SPACE", 0x029f9): "EmptyPropertyCell", - ("RO_SPACE", 0x02a21): "EmptyPropertyDictionary", - ("RO_SPACE", 0x02a71): "NoOpInterceptorInfo", - ("RO_SPACE", 0x02b11): "EmptyWeakArrayList", - ("RO_SPACE", 0x02b29): "InfinityValue", - ("RO_SPACE", 0x02b39): "MinusZeroValue", - ("RO_SPACE", 0x02b49): "MinusInfinityValue", - ("RO_SPACE", 0x02b59): "SelfReferenceMarker", - ("RO_SPACE", 0x02bb1): "OffHeapTrampolineRelocationInfo", - ("RO_SPACE", 0x02bc9): "HashSeed", - ("OLD_SPACE", 0x00139): "ArgumentsIteratorAccessor", - ("OLD_SPACE", 0x001a9): "ArrayLengthAccessor", - ("OLD_SPACE", 0x00219): "BoundFunctionLengthAccessor", - ("OLD_SPACE", 0x00289): "BoundFunctionNameAccessor", - ("OLD_SPACE", 0x002f9): "ErrorStackAccessor", - ("OLD_SPACE", 0x00369): "FunctionArgumentsAccessor", - ("OLD_SPACE", 0x003d9): "FunctionCallerAccessor", - ("OLD_SPACE", 0x00449): "FunctionNameAccessor", - ("OLD_SPACE", 0x004b9): "FunctionLengthAccessor", - ("OLD_SPACE", 0x00529): "FunctionPrototypeAccessor", - ("OLD_SPACE", 0x00599): "StringLengthAccessor", - ("OLD_SPACE", 0x00609): "InvalidPrototypeValidityCell", - ("OLD_SPACE", 0x00619): "EmptyScript", - ("OLD_SPACE", 0x00699): "ManyClosuresCell", - ("OLD_SPACE", 0x006a9): "NoFeedbackCell", - ("OLD_SPACE", 0x006b9): "ArrayConstructorProtector", - ("OLD_SPACE", 0x006c9): "NoElementsProtector", - ("OLD_SPACE", 0x006f1): "IsConcatSpreadableProtector", - ("OLD_SPACE", 0x00701): "ArraySpeciesProtector", - ("OLD_SPACE", 0x00729): "TypedArraySpeciesProtector", - ("OLD_SPACE", 0x00751): "RegExpSpeciesProtector", - ("OLD_SPACE", 0x00779): "PromiseSpeciesProtector", - ("OLD_SPACE", 0x007a1): "StringLengthProtector", - ("OLD_SPACE", 0x007b1): "ArrayIteratorProtector", - ("OLD_SPACE", 0x007d9): "ArrayBufferDetachingProtector", - ("OLD_SPACE", 0x00801): "PromiseHookProtector", - ("OLD_SPACE", 0x00829): "PromiseResolveProtector", - ("OLD_SPACE", 0x00839): "MapIteratorProtector", - ("OLD_SPACE", 0x00861): "PromiseThenProtector", - ("OLD_SPACE", 0x00889): "SetIteratorProtector", - ("OLD_SPACE", 0x008b1): "StringIteratorProtector", - ("OLD_SPACE", 0x008d9): "SingleCharacterStringCache", - ("OLD_SPACE", 0x010e9): "StringSplitCache", - ("OLD_SPACE", 0x018f9): "RegExpMultipleCache", - ("OLD_SPACE", 0x02109): "BuiltinsConstantsTable", + ("read_only_space", 0x001d9): "NullValue", + ("read_only_space", 0x00259): "EmptyDescriptorArray", + ("read_only_space", 0x002c1): "EmptyWeakFixedArray", + ("read_only_space", 0x003c1): "UninitializedValue", + ("read_only_space", 0x004d1): "UndefinedValue", + ("read_only_space", 0x00551): "NanValue", + ("read_only_space", 0x005b1): "TheHoleValue", + ("read_only_space", 0x00649): "HoleNanValue", + ("read_only_space", 0x00659): "TrueValue", + ("read_only_space", 0x00709): "FalseValue", + ("read_only_space", 0x00751): "empty_string", + ("read_only_space", 0x00c11): "EmptyScopeInfo", + ("read_only_space", 0x00c21): "EmptyFixedArray", + ("read_only_space", 0x00c31): "ArgumentsMarker", + ("read_only_space", 0x00cd1): "Exception", + ("read_only_space", 0x00d71): "TerminationException", + ("read_only_space", 0x00e19): "OptimizedOut", + ("read_only_space", 0x00eb9): "StaleRegister", + ("read_only_space", 0x026c9): "EmptyEnumCache", + ("read_only_space", 0x02731): "EmptyPropertyArray", + ("read_only_space", 0x02741): "EmptyByteArray", + ("read_only_space", 0x02751): "EmptyObjectBoilerplateDescription", + ("read_only_space", 0x02769): "EmptyArrayBoilerplateDescription", + ("read_only_space", 0x027d1): "EmptyClosureFeedbackCellArray", + ("read_only_space", 0x027e1): "EmptyFixedUint8Array", + ("read_only_space", 0x02801): "EmptyFixedInt8Array", + ("read_only_space", 0x02821): "EmptyFixedUint16Array", + ("read_only_space", 0x02841): "EmptyFixedInt16Array", + ("read_only_space", 0x02861): "EmptyFixedUint32Array", + ("read_only_space", 0x02881): "EmptyFixedInt32Array", + ("read_only_space", 0x028a1): "EmptyFixedFloat32Array", + ("read_only_space", 0x028c1): "EmptyFixedFloat64Array", + ("read_only_space", 0x028e1): "EmptyFixedUint8ClampedArray", + ("read_only_space", 0x02901): "EmptyFixedBigUint64Array", + ("read_only_space", 0x02921): "EmptyFixedBigInt64Array", + ("read_only_space", 0x02941): "EmptySloppyArgumentsElements", + ("read_only_space", 0x02961): "EmptySlowElementDictionary", + ("read_only_space", 0x029a9): "EmptyOrderedHashMap", + ("read_only_space", 0x029d1): "EmptyOrderedHashSet", + ("read_only_space", 0x029f9): "EmptyFeedbackMetadata", + ("read_only_space", 0x02a09): "EmptyPropertyCell", + ("read_only_space", 0x02a31): "EmptyPropertyDictionary", + ("read_only_space", 0x02a81): "NoOpInterceptorInfo", + ("read_only_space", 0x02b21): "EmptyWeakArrayList", + ("read_only_space", 0x02b39): "InfinityValue", + ("read_only_space", 0x02b49): "MinusZeroValue", + ("read_only_space", 0x02b59): "MinusInfinityValue", + ("read_only_space", 0x02b69): "SelfReferenceMarker", + ("read_only_space", 0x02bc1): "OffHeapTrampolineRelocationInfo", + ("read_only_space", 0x02bd9): "HashSeed", + ("old_space", 0x00139): "ArgumentsIteratorAccessor", + ("old_space", 0x001a9): "ArrayLengthAccessor", + ("old_space", 0x00219): "BoundFunctionLengthAccessor", + ("old_space", 0x00289): "BoundFunctionNameAccessor", + ("old_space", 0x002f9): "ErrorStackAccessor", + ("old_space", 0x00369): "FunctionArgumentsAccessor", + ("old_space", 0x003d9): "FunctionCallerAccessor", + ("old_space", 0x00449): "FunctionNameAccessor", + ("old_space", 0x004b9): "FunctionLengthAccessor", + ("old_space", 0x00529): "FunctionPrototypeAccessor", + ("old_space", 0x00599): "StringLengthAccessor", + ("old_space", 0x00609): "InvalidPrototypeValidityCell", + ("old_space", 0x00619): "EmptyScript", + ("old_space", 0x00699): "ManyClosuresCell", + ("old_space", 0x006b1): "ArrayConstructorProtector", + ("old_space", 0x006c1): "NoElementsProtector", + ("old_space", 0x006e9): "IsConcatSpreadableProtector", + ("old_space", 0x006f9): "ArraySpeciesProtector", + ("old_space", 0x00721): "TypedArraySpeciesProtector", + ("old_space", 0x00749): "RegExpSpeciesProtector", + ("old_space", 0x00771): "PromiseSpeciesProtector", + ("old_space", 0x00799): "StringLengthProtector", + ("old_space", 0x007a9): "ArrayIteratorProtector", + ("old_space", 0x007d1): "ArrayBufferDetachingProtector", + ("old_space", 0x007f9): "PromiseHookProtector", + ("old_space", 0x00821): "PromiseResolveProtector", + ("old_space", 0x00831): "MapIteratorProtector", + ("old_space", 0x00859): "PromiseThenProtector", + ("old_space", 0x00881): "SetIteratorProtector", + ("old_space", 0x008a9): "StringIteratorProtector", + ("old_space", 0x008d1): "SingleCharacterStringCache", + ("old_space", 0x010e1): "StringSplitCache", + ("old_space", 0x018f1): "RegExpMultipleCache", + ("old_space", 0x02101): "BuiltinsConstantsTable", } # List of known V8 Frame Markers. diff --git a/deps/v8/tools/whitespace.txt b/deps/v8/tools/whitespace.txt index b6459552b1..1747d02022 100644 --- a/deps/v8/tools/whitespace.txt +++ b/deps/v8/tools/whitespace.txt @@ -1,10 +1,10 @@ You can modify this file to create no-op changelists. -Try to write something funny. And please don't add trailing whitespace.. +Try to write something funny. And please don't add trailing whitespace. A Smi balks into a war and says: "I'm so deoptimized today!" The doubles heard this and started to unbox. The Smi looked at them when a crazy v8-autoroll account showed up... The autoroller bought a round of Himbeerbrause. Suddenly..... -The bartender starts to shake the bottles............................ +The bartender starts to shake the bottles.................................... diff --git a/deps/v8/tools/windbg.js b/deps/v8/tools/windbg.js new file mode 100644 index 0000000000..a82c753772 --- /dev/null +++ b/deps/v8/tools/windbg.js @@ -0,0 +1,238 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/*============================================================================= + This is a convenience script for debugging with WinDbg (akin to gdbinit) + It can be loaded into WinDbg with: .scriptload full_path\windbg.js + + To printout the help message below into the debugger's command window: + !help +=============================================================================*/ + +function help() { + print("--------------------------------------------------------------------"); + print(" LIVE debugging only"); + print("--------------------------------------------------------------------"); + print(" !jlh(\"local_handle_var_name\")"); + print(" prints object held by the handle"); + print(" e.g. !jlh(\"key\") or !jlh(\"this->receiver_\")"); + print(" !job(address_or_taggedint)"); + print(" prints object at the address, e.g. !job(0x235cb869f9)"); + print(" !jobs(start_address, count)"); + print(" prints 'count' objects from a continuous range of Object pointers"); + print(" e.g. !jobs(0x5f7270, 42)"); + print(" !jst() or !jst"); + print(" prints javascript stack (output goes into the console)"); + print(" !jsbp() or !jsbp"); + print(" sets bp in v8::internal::Execution::Call (begin user's script)"); + print(""); + print("--------------------------------------------------------------------"); + print(" to run any function from this script (live or postmortem):"); + print(""); + print(" dx @$scriptContents.function_name(args)"); + print(" e.g. dx @$scriptContents.pointer_size()"); + print(" e.g. dx @$scriptContents.module_name('v8_test')"); + print("--------------------------------------------------------------------"); +} + + +/*============================================================================= + Output +=============================================================================*/ +function print(s) { + host.diagnostics.debugLog(s + "\n"); +} + +function print_filtered(obj, filter) { + for (let line of obj) { + if (!filter || line.indexOf(filter) != -1) { + print(line); + } + } +} + +function inspect(s) { + for (var k of Reflect.ownKeys(s)) { + print(k + " => " + Reflect.get(s, k)); + } +} + + +/*============================================================================= + Utils (postmortem and live) +=============================================================================*/ +function cast(address, type_name) { + return host.createTypedObject(address, module_name(), type_name); +} + +// Failed to figure out how to get pointer size from the debugger's data model, +// so we parse it out from sizeof(void*) output. +function pointer_size() { + let ctl = host.namespace.Debugger.Utility.Control; + let sizeof = ctl.ExecuteCommand("?? sizeof(void*)"); + let output = ""; + for (output of sizeof) {} // unsigned int64 8 + return parseInt(output.trim().split(" ").pop()); +} + +function poi(address) { + try { + // readMemoryValues throws if cannot read from 'address'. + return host.memory.readMemoryValues(address, 1, pointer_size())[0]; + } + catch (e){} +} + +function get_register(name) { + return host.namespace.Debugger.State.DebuggerVariables.curthread + .Registers.User[name]; +} + +// In debug builds v8 code is compiled into v8.dll, and in release builds +// the code is compiled directly into the executable. If you are debugging some +// other embedder, invoke module_name explicitly from the debugger and provide +// the module name to use. +const known_exes = ["d8", "unittests", "mksnapshot", "chrome", "chromium"]; +let module_name_cache; +function module_name(use_this_module) { + if (use_this_module) { + module_name_cache = use_this_module; + } + + if (!module_name_cache) { + let v8 = host.namespace.Debugger.State.DebuggerVariables.curprocess + .Modules.Where( + function(m) { + return m.Name.indexOf("\\v8.dll") !== -1; + }); + + if (v8) { + module_name_cache = "v8"; + } + else { + for (let exe_name in known_exes) { + let exe = host.namespace.Debugger.State.DebuggerVariables.curprocess + .Modules.Where( + function(m) { + return m.Name.indexOf(`\\${exe_name}.exe`) !== -1; + }); + if (exe) { + module_name_cache = exe_name; + break; + } + } + } + } + return module_name_cache; +}; + +function make_call(fn) { + // .call resets current frame to the top one, so have to manually remember + // and restore it after making the call. + let curframe = host.namespace.Debugger.State.DebuggerVariables.curframe; + let ctl = host.namespace.Debugger.Utility.Control; + let output = ctl.ExecuteCommand(`.call ${fn};g`); + curframe.SwitchTo(); + return output; +} + +// Skips the meta output about the .call invocation. +function make_call_and_print_return(fn) { + let output = make_call(fn); + let print_line = false; + for (let line of output) { + if (print_line) { + print(line); + break; + } + if (line.includes(".call returns")) { + print_line = true; + } + } +} + + +/*============================================================================= + Wrappers around V8's printing functions and other utils for live-debugging +=============================================================================*/ + +/*----------------------------------------------------------------------------- + 'address' should be an int (so in hex must include '0x' prefix). +-----------------------------------------------------------------------------*/ +function print_object(address) { + let output = make_call(`_v8_internal_Print_Object(${address})`); + + // skip the first few lines with meta info of .call command + let skip_line = true; + for (let line of output) { + if (!skip_line) { + print(line); + continue; + } + if (line.includes("deadlocks and corruption of the debuggee")) { + skip_line = false; + } + } +} + +/*----------------------------------------------------------------------------- + 'handle_to_object' should be a name of a Handle which can be a local + variable or it can be a member variable like "this->receiver_". +-----------------------------------------------------------------------------*/ +function print_object_from_handle(handle_to_object) { + let handle = host.evaluateExpression(handle_to_object); + let location = handle.location_; + let pobj = poi(location.address); + print_object(pobj); +} + +/*----------------------------------------------------------------------------- + 'start_address' should be an int (so in hex must include '0x' prefix), it can + point at any continuous memory that contains Object pointers. +-----------------------------------------------------------------------------*/ +function print_objects_array(start_address, count) { + let ctl = host.namespace.Debugger.Utility.Control; + let psize = pointer_size(); + let addr_int = start_address; + for (let i = 0; i < count; i++) { + const addr_hex = `0x${addr_int.toString(16)}`; + + // TODO: Tried using createPointerObject but it throws unknown exception + // from ChakraCore. Why? + //let obj = host.createPointerObject(addr_hex, module, "void*"); + + let output = ctl.ExecuteCommand(`dp ${addr_hex} l1`); + let item = ""; + for (item of output) {} // 005f7270 34604101 + let deref = `0x${item.split(" ").pop()}`; + print(`${addr_hex} -> ${deref}`); + print_object(deref); + + addr_int += psize; + } +} + +function print_js_stack() { + make_call("_v8_internal_Print_StackTrace()"); +} + +function set_user_js_bp() { + let ctl = host.namespace.Debugger.Utility.Control; + ctl.ExecuteCommand(`bp ${module_name()}!v8::internal::Execution::Call`) +} + +/*============================================================================= + Initialize short aliased names for the most common commands +=============================================================================*/ +function initializeScript() { + return [ + new host.functionAlias(help, "help"), + new host.functionAlias(print_object_from_handle, "jlh"), + new host.functionAlias(print_object, "job"), + new host.functionAlias(print_objects_array, "jobs"), + new host.functionAlias(print_js_stack, "jst"), + + new host.functionAlias(set_user_js_bp, "jsbp"), + ] +} |