diff options
author | Ali Ijaz Sheikh <ofrobots@google.com> | 2015-11-30 21:22:40 -0800 |
---|---|---|
committer | Ali Ijaz Sheikh <ofrobots@google.com> | 2015-12-04 00:06:01 -0800 |
commit | 8a43a3d7619fde59f0d1f2fad05d8ae7d1732b02 (patch) | |
tree | 8698af91526d0eac90840dcba1e5b565160105c4 /deps/v8/tools | |
parent | 8a2acd4cc9807510786b4b6f7ad3a947aeb3a14c (diff) | |
download | node-new-8a43a3d7619fde59f0d1f2fad05d8ae7d1732b02.tar.gz |
deps: upgrade V8 to 4.7.80.24
Pick up the latest branch head for V8 4.7:
https://github.com/v8/v8/commit/be169f8df059040e6a53ec1dd4579d8bca2167b5
Full change history for the 4.7 branch:
https://chromium.googlesource.com/v8/v8.git/+log/branch-heads/4.7
V8 blog post about what is new on V8 4.7:
http://v8project.blogspot.de/2015/10/v8-release-47.html
PR-URL: https://github.com/nodejs/node/pull/4106
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: targos - Michaƫl Zasso <mic.besace@gmail.com>
Reviewed-By: rvagg - Rod Vagg <rod@vagg.org>
Diffstat (limited to 'deps/v8/tools')
-rw-r--r-- | deps/v8/tools/cfi/blacklist.txt | 4 | ||||
-rwxr-xr-x | deps/v8/tools/check-name-clashes.py | 118 | ||||
-rwxr-xr-x | deps/v8/tools/eval_gc_nvp.py | 151 | ||||
-rwxr-xr-x | deps/v8/tools/fuzz-harness.sh | 4 | ||||
-rw-r--r-- | deps/v8/tools/gen-postmortem-metadata.py | 72 | ||||
-rw-r--r-- | deps/v8/tools/gyp/v8.gyp | 245 | ||||
-rwxr-xr-x | deps/v8/tools/js2c.py | 9 | ||||
-rwxr-xr-x | deps/v8/tools/presubmit.py | 84 | ||||
-rwxr-xr-x | deps/v8/tools/release/merge_to_branch.py | 5 | ||||
-rwxr-xr-x | deps/v8/tools/run-deopt-fuzzer.py | 1 | ||||
-rwxr-xr-x | deps/v8/tools/run_perf.py | 12 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/local/commands.py | 18 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/local/progress.py | 1 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/local/statusfile.py | 2 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/local/testsuite.py | 2 | ||||
-rw-r--r-- | deps/v8/tools/tickprocessor-driver.js | 3 | ||||
-rw-r--r-- | deps/v8/tools/tickprocessor.js | 68 | ||||
-rwxr-xr-x | deps/v8/tools/try_perf.py | 51 | ||||
-rw-r--r-- | deps/v8/tools/unittests/run_perf_test.py | 18 | ||||
-rw-r--r-- | deps/v8/tools/whitespace.txt | 2 |
20 files changed, 473 insertions, 397 deletions
diff --git a/deps/v8/tools/cfi/blacklist.txt b/deps/v8/tools/cfi/blacklist.txt new file mode 100644 index 0000000000..0ad565eafb --- /dev/null +++ b/deps/v8/tools/cfi/blacklist.txt @@ -0,0 +1,4 @@ +# All std:: types +# This should be possible to remove, if/when we build against +# a statically linked libc++. +type:std::*
\ No newline at end of file diff --git a/deps/v8/tools/check-name-clashes.py b/deps/v8/tools/check-name-clashes.py deleted file mode 100755 index 25f3aace55..0000000000 --- a/deps/v8/tools/check-name-clashes.py +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env python -# Copyright 2014 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 js2c -import os -import re -import sys - -FILENAME = "src/runtime/runtime.h" -LISTHEAD = re.compile(r"#define\s+(FOR_EACH_\w+)\((\w+)\)") -LISTBODY = re.compile(r".*\\$") - - -class Function(object): - def __init__(self, match): - self.name = match.group(1).strip() - -def ListMacroRe(list): - macro = LISTHEAD.match(list[0]).group(2) - re_string = "\s*%s\((\w+)" % macro - return re.compile(re_string) - - -def FindLists(filename): - lists = [] - current_list = [] - mode = "SEARCHING" - with open(filename, "r") as f: - for line in f: - if mode == "SEARCHING": - match = LISTHEAD.match(line) - if match: - mode = "APPENDING" - current_list.append(line) - else: - current_list.append(line) - match = LISTBODY.match(line) - if not match: - mode = "SEARCHING" - lists.append(current_list) - current_list = [] - return lists - - -# Detects runtime functions by parsing FILENAME. -def FindRuntimeFunctions(): - functions = [] - lists = FindLists(FILENAME) - for list in lists: - function_re = ListMacroRe(list) - for line in list: - match = function_re.match(line) - if match: - functions.append(Function(match)) - return functions - - -class Builtin(object): - def __init__(self, match): - self.name = match.group(1) - - -def FindJSNatives(): - PATH = "src" - fileslist = [] - for (root, dirs, files) in os.walk(PATH): - for f in files: - if f.endswith(".js"): - fileslist.append(os.path.join(root, f)) - natives = [] - regexp = re.compile("^function (\w+)\s*\((.*?)\) {") - matches = 0 - for filename in fileslist: - with open(filename, "r") as f: - file_contents = f.read() - file_contents = js2c.ExpandInlineMacros(file_contents) - lines = file_contents.split("\n") - partial_line = "" - for line in lines: - if line.startswith("function") and not '{' in line: - partial_line += line.rstrip() - continue - if partial_line: - partial_line += " " + line.strip() - if '{' in line: - line = partial_line - partial_line = "" - else: - continue - match = regexp.match(line) - if match: - natives.append(Builtin(match)) - return natives - - -def Main(): - functions = FindRuntimeFunctions() - natives = FindJSNatives() - errors = 0 - runtime_map = {} - for f in functions: - runtime_map[f.name] = 1 - for b in natives: - if b.name in runtime_map: - print("JS_Native/Runtime_Function name clash: %s" % b.name) - errors += 1 - - if errors > 0: - return 1 - print("Runtime/Natives name clashes: checked %d/%d functions, all good." % - (len(functions), len(natives))) - return 0 - - -if __name__ == "__main__": - sys.exit(Main()) diff --git a/deps/v8/tools/eval_gc_nvp.py b/deps/v8/tools/eval_gc_nvp.py new file mode 100755 index 0000000000..8a9b8e7072 --- /dev/null +++ b/deps/v8/tools/eval_gc_nvp.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python +# +# Copyright 2015 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 is used to analyze GCTracer's NVP output.""" + + +from argparse import ArgumentParser +from copy import deepcopy +from gc_nvp_common import split_nvp +from math import log +from sys import stdin + + +class LinearBucket: + def __init__(self, granularity): + self.granularity = granularity + + def value_to_bucket(self, value): + return int(value / self.granularity) + + def bucket_to_range(self, bucket): + return (bucket * self.granularity, (bucket + 1) * self.granularity) + + +class Log2Bucket: + def __init__(self, start): + self.start = int(log(start, 2)) - 1 + + def value_to_bucket(self, value): + index = int(log(value, 2)) + index -= self.start + if index < 0: + index = 0 + return index + + def bucket_to_range(self, bucket): + if bucket == 0: + return (0, 2 ** (self.start + 1)) + bucket += self.start + return (2 ** bucket, 2 ** (bucket + 1)) + + +class Histogram: + def __init__(self, bucket_trait, fill_empty): + self.histogram = {} + self.fill_empty = fill_empty + self.bucket_trait = bucket_trait + + def add(self, key): + index = self.bucket_trait.value_to_bucket(key) + if index not in self.histogram: + self.histogram[index] = 0 + self.histogram[index] += 1 + + def __str__(self): + ret = [] + keys = self.histogram.keys() + keys.sort() + last = keys[len(keys) - 1] + for i in range(0, last + 1): + (min_value, max_value) = self.bucket_trait.bucket_to_range(i) + if i == keys[0]: + keys.pop(0) + ret.append(" [{0},{1}[: {2}".format( + str(min_value), str(max_value), self.histogram[i])) + else: + if self.fill_empty: + ret.append(" [{0},{1}[: {2}".format( + str(min_value), str(max_value), 0)) + return "\n".join(ret) + + +class Category: + def __init__(self, key, histogram): + self.key = key + self.values = [] + self.histogram = histogram + + def process_entry(self, entry): + if self.key in entry: + self.values.append(float(entry[self.key])) + if self.histogram: + self.histogram.add(float(entry[self.key])) + + def __str__(self): + ret = [self.key] + ret.append(" len: {0}".format(len(self.values))) + if len(self.values) > 0: + ret.append(" min: {0}".format(min(self.values))) + ret.append(" max: {0}".format(max(self.values))) + ret.append(" avg: {0}".format(sum(self.values) / len(self.values))) + if self.histogram: + ret.append(str(self.histogram)) + return "\n".join(ret) + + +def main(): + parser = ArgumentParser(description="Process GCTracer's NVP output") + parser.add_argument('keys', metavar='KEY', type=str, nargs='+', + help='the keys of NVPs to process') + parser.add_argument('--histogram-type', metavar='<linear|log2>', + type=str, nargs='?', default="linear", + help='histogram type to use (default: linear)') + linear_group = parser.add_argument_group('linear histogram specific') + linear_group.add_argument('--linear-histogram-granularity', + metavar='GRANULARITY', type=int, nargs='?', + default=5, + help='histogram granularity (default: 5)') + log2_group = parser.add_argument_group('log2 histogram specific') + log2_group.add_argument('--log2-histogram-init-bucket', metavar='START', + type=int, nargs='?', default=64, + help='initial buck size (default: 64)') + parser.add_argument('--histogram-omit-empty-buckets', + dest='histogram_omit_empty', + action='store_true', + help='omit empty histogram buckets') + parser.add_argument('--no-histogram', dest='histogram', + action='store_false', help='do not print histogram') + parser.set_defaults(histogram=True) + parser.set_defaults(histogram_omit_empty=False) + args = parser.parse_args() + + histogram = None + if args.histogram: + bucket_trait = None + if args.histogram_type == "log2": + bucket_trait = Log2Bucket(args.log2_histogram_init_bucket) + else: + bucket_trait = LinearBucket(args.linear_histogram_granularity) + histogram = Histogram(bucket_trait, not args.histogram_omit_empty) + + categories = [ Category(key, deepcopy(histogram)) + for key in args.keys ] + + while True: + line = stdin.readline() + if not line: + break + obj = split_nvp(line) + for category in categories: + category.process_entry(obj) + + for category in categories: + print(category) + + +if __name__ == '__main__': + main() diff --git a/deps/v8/tools/fuzz-harness.sh b/deps/v8/tools/fuzz-harness.sh index cef59868a9..31023de3ab 100755 --- a/deps/v8/tools/fuzz-harness.sh +++ b/deps/v8/tools/fuzz-harness.sh @@ -85,7 +85,9 @@ python -u "$jsfunfuzz_dir/jsfunfuzz/multi_timed_run.py" 300 \ "$d8" $flags "$jsfunfuzz_dir/jsfunfuzz/jsfunfuzz.js" exit_code=$(cat w* | grep " looking good" -c) exit_code=$((100-exit_code)) -tar -cjf fuzz-results-$(date +%Y%m%d%H%M%S).tar.bz2 err-* w* +archive=fuzz-results-$(date +%Y%m%d%H%M%S).tar.bz2 +echo "Creating archive $archive" +tar -cjf $archive err-* w* rm -f err-* w* echo "Total failures: $exit_code" diff --git a/deps/v8/tools/gen-postmortem-metadata.py b/deps/v8/tools/gen-postmortem-metadata.py index e3c9dbe076..1b6a6bbcf0 100644 --- a/deps/v8/tools/gen-postmortem-metadata.py +++ b/deps/v8/tools/gen-postmortem-metadata.py @@ -98,30 +98,6 @@ consts_misc = [ 'value': 'PropertyDetails::FieldIndexField::kMask' }, { 'name': 'prop_index_shift', 'value': 'PropertyDetails::FieldIndexField::kShift' }, - { 'name': 'prop_representation_mask', - 'value': 'PropertyDetails::RepresentationField::kMask' }, - { 'name': 'prop_representation_shift', - 'value': 'PropertyDetails::RepresentationField::kShift' }, - { 'name': 'prop_representation_integer8', - 'value': 'Representation::Kind::kInteger8' }, - { 'name': 'prop_representation_uinteger8', - 'value': 'Representation::Kind::kUInteger8' }, - { 'name': 'prop_representation_integer16', - 'value': 'Representation::Kind::kInteger16' }, - { 'name': 'prop_representation_uinteger16', - 'value': 'Representation::Kind::kUInteger16' }, - { 'name': 'prop_representation_smi', - 'value': 'Representation::Kind::kSmi' }, - { 'name': 'prop_representation_integer32', - 'value': 'Representation::Kind::kInteger32' }, - { 'name': 'prop_representation_double', - 'value': 'Representation::Kind::kDouble' }, - { 'name': 'prop_representation_heapobject', - 'value': 'Representation::Kind::kHeapObject' }, - { 'name': 'prop_representation_tagged', - 'value': 'Representation::Kind::kTagged' }, - { 'name': 'prop_representation_external', - 'value': 'Representation::Kind::kExternal' }, { 'name': 'prop_desc_key', 'value': 'DescriptorArray::kDescriptorKey' }, @@ -145,10 +121,6 @@ consts_misc = [ 'value': 'Map::ElementsKindBits::kShift' }, { 'name': 'bit_field3_dictionary_map_shift', 'value': 'Map::DictionaryMap::kShift' }, - { 'name': 'bit_field3_number_of_own_descriptors_mask', - 'value': 'Map::NumberOfOwnDescriptorsBits::kMask' }, - { 'name': 'bit_field3_number_of_own_descriptors_shift', - 'value': 'Map::NumberOfOwnDescriptorsBits::kShift' }, { 'name': 'off_fp_context', 'value': 'StandardFrameConstants::kContextOffset' }, @@ -167,37 +139,20 @@ consts_misc = [ 'value': 'ScopeInfo::kStackLocalCount' }, { 'name': 'scopeinfo_idx_ncontextlocals', 'value': 'ScopeInfo::kContextLocalCount' }, - { 'name': 'scopeinfo_idx_ncontextglobals', - 'value': 'ScopeInfo::kContextGlobalCount' }, { 'name': 'scopeinfo_idx_first_vars', 'value': 'ScopeInfo::kVariablePartIndex' }, - - { 'name': 'sharedfunctioninfo_start_position_mask', - 'value': 'SharedFunctionInfo::kStartPositionMask' }, - { 'name': 'sharedfunctioninfo_start_position_shift', - 'value': 'SharedFunctionInfo::kStartPositionShift' }, - - { 'name': 'jsarray_buffer_was_neutered_mask', - 'value': 'JSArrayBuffer::WasNeutered::kMask' }, - { 'name': 'jsarray_buffer_was_neutered_shift', - 'value': 'JSArrayBuffer::WasNeutered::kShift' }, ]; # # The following useful fields are missing accessors, so we define fake ones. # extras_accessors = [ - 'JSFunction, context, Context, kContextOffset', - 'Context, closure_index, int, CLOSURE_INDEX', - 'Context, global_object_index, int, GLOBAL_OBJECT_INDEX', - 'Context, previous_index, int, PREVIOUS_INDEX', - 'Context, min_context_slots, int, MIN_CONTEXT_SLOTS', 'HeapObject, map, Map, kMapOffset', 'JSObject, elements, Object, kElementsOffset', 'FixedArray, data, uintptr_t, kHeaderSize', - 'JSTypedArray, length, Object, kLengthOffset', 'JSArrayBuffer, backing_store, Object, kBackingStoreOffset', 'JSArrayBufferView, byte_offset, Object, kByteOffsetOffset', + 'JSTypedArray, length, Object, kLengthOffset', 'Map, instance_attributes, int, kInstanceAttributesOffset', 'Map, inobject_properties_or_constructor_function_index, int, kInObjectPropertiesOrConstructorFunctionIndexOffset', 'Map, instance_size, int, kInstanceSizeOffset', @@ -207,7 +162,6 @@ extras_accessors = [ 'Map, prototype, Object, kPrototypeOffset', 'NameDictionaryShape, prefix_size, int, kPrefixSize', 'NameDictionaryShape, entry_size, int, kEntrySize', - 'NameDictionary, prefix_start_index, int, kPrefixStartIndex', 'SeededNumberDictionaryShape, prefix_size, int, kPrefixSize', 'UnseededNumberDictionaryShape, prefix_size, int, kPrefixSize', 'NumberDictionaryShape, entry_size, int, kEntrySize', @@ -219,7 +173,6 @@ extras_accessors = [ 'SeqOneByteString, chars, char, kHeaderSize', 'SeqTwoByteString, chars, char, kHeaderSize', 'SharedFunctionInfo, code, Code, kCodeOffset', - 'SharedFunctionInfo, scope_info, ScopeInfo, kScopeInfoOffset', 'SlicedString, parent, String, kParentOffset', 'Code, instruction_start, uintptr_t, kHeaderSize', 'Code, instruction_size, int, kInstructionSizeOffset', @@ -274,20 +227,6 @@ footer = ''' ''' # -# Get the base class -# -def get_base_class(klass): - if (klass == 'Object'): - return klass; - - if (not (klass in klasses)): - return None; - - k = klasses[klass]; - - return get_base_class(k['parent']); - -# # Loads class hierarchy and type information from "objects.h". # def load_objects(): @@ -325,14 +264,12 @@ def load_objects(): typestr += line; continue; - match = re.match('class (\w[^:]*)(: public (\w[^{]*))?\s*{\s*', + match = re.match('class (\w[^\s:]*)(: public (\w[^\s{]*))?\s*{', line); if (match): - klass = match.group(1).rstrip().lstrip(); + klass = match.group(1); pklass = match.group(3); - if (pklass): - pklass = pklass.rstrip().lstrip(); klasses[klass] = { 'parent': pklass }; # @@ -583,9 +520,6 @@ def emit_config(): keys.sort(); for klassname in keys: pklass = klasses[klassname]['parent']; - bklass = get_base_class(klassname); - if (bklass != 'Object'): - continue; if (pklass == None): continue; diff --git a/deps/v8/tools/gyp/v8.gyp b/deps/v8/tools/gyp/v8.gyp index 1e5705d7a5..bcb580167e 100644 --- a/deps/v8/tools/gyp/v8.gyp +++ b/deps/v8/tools/gyp/v8.gyp @@ -30,8 +30,10 @@ 'icu_use_data_file_flag%': 0, 'v8_code': 1, 'v8_random_seed%': 314159265, + 'v8_vector_stores%': 0, 'embed_script%': "", 'v8_extra_library_files%': [], + 'v8_experimental_extra_library_files%': [], 'mksnapshot_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot<(EXECUTABLE_SUFFIX)', }, 'includes': ['../../build/toolchain.gypi', '../../build/features.gypi'], @@ -182,6 +184,7 @@ '<(SHARED_INTERMEDIATE_DIR)/code-stub-libraries.cc', '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries.cc', '<(SHARED_INTERMEDIATE_DIR)/extras-libraries.cc', + '<(SHARED_INTERMEDIATE_DIR)/experimental-extras-libraries.cc', '<(INTERMEDIATE_DIR)/snapshot.cc', ], 'actions': [ @@ -203,12 +206,15 @@ ['v8_random_seed!=0', { 'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'], }], + ['v8_vector_stores!=0', { + 'mksnapshot_flags': ['--vector-stores'], + }], ], }, 'action': [ '<(mksnapshot_exec)', '<@(mksnapshot_flags)', - '<@(INTERMEDIATE_DIR)/snapshot.cc', + '--startup_src', '<@(INTERMEDIATE_DIR)/snapshot.cc', '<(embed_script)', ], }, @@ -228,6 +234,7 @@ '<(SHARED_INTERMEDIATE_DIR)/code-stub-libraries.cc', '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries.cc', '<(SHARED_INTERMEDIATE_DIR)/extras-libraries.cc', + '<(SHARED_INTERMEDIATE_DIR)/experimental-extras-libraries.cc', '../../src/snapshot/snapshot-empty.cc', ], 'conditions': [ @@ -304,6 +311,9 @@ ['v8_random_seed!=0', { 'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'], }], + ['v8_vector_stores!=0', { + 'mksnapshot_flags': ['--vector-stores'], + }], ], }, 'conditions': [ @@ -311,25 +321,21 @@ 'target_conditions': [ ['_toolset=="host"', { 'outputs': [ - '<(INTERMEDIATE_DIR)/snapshot.cc', '<(PRODUCT_DIR)/snapshot_blob_host.bin', ], 'action': [ '<(mksnapshot_exec)', '<@(mksnapshot_flags)', - '<@(INTERMEDIATE_DIR)/snapshot.cc', '--startup_blob', '<(PRODUCT_DIR)/snapshot_blob_host.bin', '<(embed_script)', ], }, { 'outputs': [ - '<(INTERMEDIATE_DIR)/snapshot.cc', '<(PRODUCT_DIR)/snapshot_blob.bin', ], 'action': [ '<(mksnapshot_exec)', '<@(mksnapshot_flags)', - '<@(INTERMEDIATE_DIR)/snapshot.cc', '--startup_blob', '<(PRODUCT_DIR)/snapshot_blob.bin', '<(embed_script)', ], @@ -337,13 +343,11 @@ ], }, { 'outputs': [ - '<(INTERMEDIATE_DIR)/snapshot.cc', '<(PRODUCT_DIR)/snapshot_blob.bin', ], 'action': [ '<(mksnapshot_exec)', '<@(mksnapshot_flags)', - '<@(INTERMEDIATE_DIR)/snapshot.cc', '--startup_blob', '<(PRODUCT_DIR)/snapshot_blob.bin', '<(embed_script)', ], @@ -385,8 +389,6 @@ '../../src/allocation.h', '../../src/allocation-site-scopes.cc', '../../src/allocation-site-scopes.h', - '../../src/allocation-tracker.cc', - '../../src/allocation-tracker.h', '../../src/api.cc', '../../src/api.h', '../../src/api-natives.cc', @@ -397,14 +399,17 @@ '../../src/assembler.h', '../../src/assert-scope.h', '../../src/assert-scope.cc', - '../../src/ast-value-factory.cc', - '../../src/ast-value-factory.h', + '../../src/ast-expression-visitor.cc', + '../../src/ast-expression-visitor.h', '../../src/ast-literal-reindexer.cc', '../../src/ast-literal-reindexer.h', '../../src/ast-numbering.cc', '../../src/ast-numbering.h', + '../../src/ast-value-factory.cc', + '../../src/ast-value-factory.h', '../../src/ast.cc', '../../src/ast.h', + '../../src/atomic-utils.h', '../../src/background-parsing-task.cc', '../../src/background-parsing-task.h', '../../src/bailout-reason.cc', @@ -429,14 +434,11 @@ '../../src/char-predicates-inl.h', '../../src/char-predicates.h', '../../src/checks.h', - '../../src/circular-queue-inl.h', - '../../src/circular-queue.h', '../../src/code-factory.cc', '../../src/code-factory.h', '../../src/code-stubs.cc', '../../src/code-stubs.h', '../../src/code-stubs-hydrogen.cc', - '../../src/code.h', '../../src/codegen.cc', '../../src/codegen.h', '../../src/compilation-cache.cc', @@ -455,6 +457,8 @@ '../../src/compiler/ast-loop-assignment-analyzer.h', '../../src/compiler/basic-block-instrumentor.cc', '../../src/compiler/basic-block-instrumentor.h', + '../../src/compiler/bytecode-graph-builder.cc', + '../../src/compiler/bytecode-graph-builder.h', '../../src/compiler/change-lowering.cc', '../../src/compiler/change-lowering.h', '../../src/compiler/c-linkage.cc', @@ -536,6 +540,8 @@ '../../src/compiler/linkage.h', '../../src/compiler/liveness-analyzer.cc', '../../src/compiler/liveness-analyzer.h', + '../../src/compiler/live-range-separator.cc', + '../../src/compiler/live-range-separator.h', '../../src/compiler/load-elimination.cc', '../../src/compiler/load-elimination.h', '../../src/compiler/loop-analysis.cc', @@ -573,8 +579,6 @@ '../../src/compiler/pipeline.h', '../../src/compiler/pipeline-statistics.cc', '../../src/compiler/pipeline-statistics.h', - '../../src/compiler/preprocess-live-ranges.cc', - '../../src/compiler/preprocess-live-ranges.h', '../../src/compiler/raw-machine-assembler.cc', '../../src/compiler/raw-machine-assembler.h', '../../src/compiler/register-allocator.cc', @@ -614,6 +618,7 @@ '../../src/compiler.h', '../../src/context-measure.cc', '../../src/context-measure.h', + '../../src/contexts-inl.h', '../../src/contexts.cc', '../../src/contexts.h', '../../src/conversions-inl.h', @@ -621,9 +626,6 @@ '../../src/conversions.h', '../../src/counters.cc', '../../src/counters.h', - '../../src/cpu-profiler-inl.h', - '../../src/cpu-profiler.cc', - '../../src/cpu-profiler.h', '../../src/date.cc', '../../src/date.h', '../../src/dateparser-inl.h', @@ -696,11 +698,8 @@ '../../src/handles.cc', '../../src/handles.h', '../../src/hashmap.h', - '../../src/heap-profiler.cc', - '../../src/heap-profiler.h', - '../../src/heap-snapshot-generator-inl.h', - '../../src/heap-snapshot-generator.cc', - '../../src/heap-snapshot-generator.h', + '../../src/heap/array-buffer-tracker.cc', + '../../src/heap/array-buffer-tracker.h', '../../src/heap/memory-reducer.cc', '../../src/heap/memory-reducer.h', '../../src/heap/gc-idle-time-handler.cc', @@ -710,17 +709,26 @@ '../../src/heap/heap-inl.h', '../../src/heap/heap.cc', '../../src/heap/heap.h', - '../../src/heap/identity-map.cc', - '../../src/heap/identity-map.h', '../../src/heap/incremental-marking-inl.h', + '../../src/heap/incremental-marking-job.cc', + '../../src/heap/incremental-marking-job.h', '../../src/heap/incremental-marking.cc', '../../src/heap/incremental-marking.h', '../../src/heap/mark-compact-inl.h', '../../src/heap/mark-compact.cc', '../../src/heap/mark-compact.h', + '../../src/heap/object-stats.cc', + '../../src/heap/object-stats.h', '../../src/heap/objects-visiting-inl.h', '../../src/heap/objects-visiting.cc', '../../src/heap/objects-visiting.h', + '../../src/heap/scavenge-job.h', + '../../src/heap/scavenge-job.cc', + '../../src/heap/scavenger-inl.h', + '../../src/heap/scavenger.cc', + '../../src/heap/scavenger.h', + '../../src/heap/slots-buffer.cc', + '../../src/heap/slots-buffer.h', '../../src/heap/spaces-inl.h', '../../src/heap/spaces.cc', '../../src/heap/spaces.h', @@ -796,6 +804,8 @@ '../../src/ic/ic.h', '../../src/ic/ic-compiler.cc', '../../src/ic/ic-compiler.h', + '../../src/identity-map.cc', + '../../src/identity-map.h', '../../src/interface-descriptors.cc', '../../src/interface-descriptors.h', '../../src/interpreter/bytecodes.cc', @@ -804,8 +814,11 @@ '../../src/interpreter/bytecode-generator.h', '../../src/interpreter/bytecode-array-builder.cc', '../../src/interpreter/bytecode-array-builder.h', + '../../src/interpreter/bytecode-array-iterator.cc', + '../../src/interpreter/bytecode-array-iterator.h', '../../src/interpreter/interpreter.cc', '../../src/interpreter/interpreter.h', + '../../src/isolate-inl.h', '../../src/isolate.cc', '../../src/isolate.h', '../../src/json-parser.h', @@ -858,9 +871,25 @@ '../../src/preparser.h', '../../src/prettyprinter.cc', '../../src/prettyprinter.h', - '../../src/profile-generator-inl.h', - '../../src/profile-generator.cc', - '../../src/profile-generator.h', + '../../src/profiler/allocation-tracker.cc', + '../../src/profiler/allocation-tracker.h', + '../../src/profiler/circular-queue-inl.h', + '../../src/profiler/circular-queue.h', + '../../src/profiler/cpu-profiler-inl.h', + '../../src/profiler/cpu-profiler.cc', + '../../src/profiler/cpu-profiler.h', + '../../src/profiler/heap-profiler.cc', + '../../src/profiler/heap-profiler.h', + '../../src/profiler/heap-snapshot-generator-inl.h', + '../../src/profiler/heap-snapshot-generator.cc', + '../../src/profiler/heap-snapshot-generator.h', + '../../src/profiler/profile-generator-inl.h', + '../../src/profiler/profile-generator.cc', + '../../src/profiler/profile-generator.h', + '../../src/profiler/sampler.cc', + '../../src/profiler/sampler.h', + '../../src/profiler/unbound-queue-inl.h', + '../../src/profiler/unbound-queue.h', '../../src/property-details.h', '../../src/property.cc', '../../src/property.h', @@ -897,6 +926,7 @@ '../../src/runtime/runtime-generator.cc', '../../src/runtime/runtime-i18n.cc', '../../src/runtime/runtime-internal.cc', + '../../src/runtime/runtime-interpreter.cc', '../../src/runtime/runtime-json.cc', '../../src/runtime/runtime-literals.cc', '../../src/runtime/runtime-liveedit.cc', @@ -904,6 +934,7 @@ '../../src/runtime/runtime-numbers.cc', '../../src/runtime/runtime-object.cc', '../../src/runtime/runtime-observe.cc', + '../../src/runtime/runtime-operators.cc', '../../src/runtime/runtime-proxy.cc', '../../src/runtime/runtime-regexp.cc', '../../src/runtime/runtime-scopes.cc', @@ -918,8 +949,6 @@ '../../src/runtime/runtime.h', '../../src/safepoint-table.cc', '../../src/safepoint-table.h', - '../../src/sampler.cc', - '../../src/sampler.h', '../../src/scanner-character-streams.cc', '../../src/scanner-character-streams.h', '../../src/scanner.cc', @@ -967,13 +996,17 @@ '../../src/types-inl.h', '../../src/types.cc', '../../src/types.h', + '../../src/typing-asm.cc', + '../../src/typing-asm.h', + '../../src/typing-reset.cc', + '../../src/typing-reset.h', '../../src/typing.cc', '../../src/typing.h', - '../../src/unbound-queue-inl.h', - '../../src/unbound-queue.h', '../../src/unicode-inl.h', '../../src/unicode.cc', '../../src/unicode.h', + '../../src/unicode-cache-inl.h', + '../../src/unicode-cache.h', '../../src/unicode-decoder.cc', '../../src/unicode-decoder.h', '../../src/unique.h', @@ -991,6 +1024,7 @@ '../../src/version.h', '../../src/vm-state-inl.h', '../../src/vm-state.h', + '../../src/zone-type-cache.h', '../../src/zone.cc', '../../src/zone.h', '../../src/zone-allocator.h', @@ -1221,7 +1255,7 @@ '../../src/regexp/mips/regexp-macro-assembler-mips.h', ], }], - ['v8_target_arch=="mips64el"', { + ['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', { 'sources': [ ### gcmole(arch:mips64el) ### '../../src/mips64/assembler-mips64.cc', '../../src/mips64/assembler-mips64.h', @@ -1714,6 +1748,7 @@ '<(SHARED_INTERMEDIATE_DIR)/libraries-code-stub.bin', '<(SHARED_INTERMEDIATE_DIR)/libraries-experimental.bin', '<(SHARED_INTERMEDIATE_DIR)/libraries-extras.bin', + '<(SHARED_INTERMEDIATE_DIR)/libraries-experimental-extras.bin', ], 'conditions': [ ['want_separate_host_toolset==1', { @@ -1820,7 +1855,6 @@ '../../src/harmony-regexp.js', '../../src/harmony-reflect.js', '../../src/harmony-spread.js', - '../../src/harmony-object.js', '../../src/harmony-object-observe.js', '../../src/harmony-sharedarraybuffer.js', '../../src/harmony-simd.js', @@ -1834,6 +1868,7 @@ 'libraries_code_stub_bin_file': '<(SHARED_INTERMEDIATE_DIR)/libraries-code-stub.bin', 'libraries_experimental_bin_file': '<(SHARED_INTERMEDIATE_DIR)/libraries-experimental.bin', 'libraries_extras_bin_file': '<(SHARED_INTERMEDIATE_DIR)/libraries-extras.bin', + 'libraries_experimental_extras_bin_file': '<(SHARED_INTERMEDIATE_DIR)/libraries-experimental-extras.bin', }, 'actions': [ { @@ -1843,9 +1878,7 @@ '<@(library_files)', '<@(i18n_library_files)' ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/libraries.cc', - ], + 'outputs': ['<(SHARED_INTERMEDIATE_DIR)/libraries.cc'], 'action': [ 'python', '../../tools/js2c.py', @@ -1854,13 +1887,24 @@ '<@(library_files)', '<@(i18n_library_files)' ], - 'conditions': [ - [ 'v8_use_external_startup_data==1', { - 'outputs': ['<@(libraries_bin_file)'], - 'action': [ - '--startup_blob', '<@(libraries_bin_file)', - ], - }], + }, + { + 'action_name': 'js2c_bin', + 'inputs': [ + '../../tools/js2c.py', + '<@(library_files)', + '<@(i18n_library_files)' + ], + 'outputs': ['<@(libraries_bin_file)'], + 'action': [ + 'python', + '../../tools/js2c.py', + '<(SHARED_INTERMEDIATE_DIR)/libraries.cc', + 'CORE', + '<@(library_files)', + '<@(i18n_library_files)', + '--startup_blob', '<@(libraries_bin_file)', + '--nojs', ], }, { @@ -1869,9 +1913,7 @@ '../../tools/js2c.py', '<@(experimental_library_files)', ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries.cc', - ], + 'outputs': ['<(SHARED_INTERMEDIATE_DIR)/experimental-libraries.cc'], 'action': [ 'python', '../../tools/js2c.py', @@ -1879,13 +1921,22 @@ 'EXPERIMENTAL', '<@(experimental_library_files)' ], - 'conditions': [ - [ 'v8_use_external_startup_data==1', { - 'outputs': ['<@(libraries_experimental_bin_file)'], - 'action': [ - '--startup_blob', '<@(libraries_experimental_bin_file)' - ], - }], + }, + { + 'action_name': 'js2c_experimental_bin', + 'inputs': [ + '../../tools/js2c.py', + '<@(experimental_library_files)', + ], + 'outputs': ['<@(libraries_experimental_bin_file)'], + 'action': [ + 'python', + '../../tools/js2c.py', + '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries.cc', + 'EXPERIMENTAL', + '<@(experimental_library_files)', + '--startup_blob', '<@(libraries_experimental_bin_file)', + '--nojs', ], }, { @@ -1894,9 +1945,7 @@ '../../tools/js2c.py', '<@(code_stub_library_files)', ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/code-stub-libraries.cc', - ], + 'outputs': ['<(SHARED_INTERMEDIATE_DIR)/code-stub-libraries.cc'], 'action': [ 'python', '../../tools/js2c.py', @@ -1904,13 +1953,22 @@ 'CODE_STUB', '<@(code_stub_library_files)' ], - 'conditions': [ - [ 'v8_use_external_startup_data==1', { - 'outputs': ['<@(libraries_code_stub_bin_file)'], - 'action': [ - '--startup_blob', '<@(libraries_code_stub_bin_file)' - ], - }], + }, + { + 'action_name': 'js2c_code_stubs_bin', + 'inputs': [ + '../../tools/js2c.py', + '<@(code_stub_library_files)', + ], + 'outputs': ['<@(libraries_code_stub_bin_file)'], + 'action': [ + 'python', + '../../tools/js2c.py', + '<(SHARED_INTERMEDIATE_DIR)/code-stub-libraries.cc', + 'CODE_STUB', + '<@(code_stub_library_files)', + '--startup_blob', '<@(libraries_code_stub_bin_file)', + '--nojs', ], }, { @@ -1919,23 +1977,64 @@ '../../tools/js2c.py', '<@(v8_extra_library_files)', ], - 'outputs': [ + 'outputs': ['<(SHARED_INTERMEDIATE_DIR)/extras-libraries.cc'], + 'action': [ + 'python', + '../../tools/js2c.py', '<(SHARED_INTERMEDIATE_DIR)/extras-libraries.cc', + 'EXTRAS', + '<@(v8_extra_library_files)', ], + }, + { + 'action_name': 'js2c_extras_bin', + 'inputs': [ + '../../tools/js2c.py', + '<@(v8_extra_library_files)', + ], + 'outputs': ['<@(libraries_extras_bin_file)'], 'action': [ 'python', '../../tools/js2c.py', '<(SHARED_INTERMEDIATE_DIR)/extras-libraries.cc', 'EXTRAS', '<@(v8_extra_library_files)', + '--startup_blob', '<@(libraries_extras_bin_file)', + '--nojs', ], - 'conditions': [ - [ 'v8_use_external_startup_data==1', { - 'outputs': ['<@(libraries_extras_bin_file)'], - 'action': [ - '--startup_blob', '<@(libraries_extras_bin_file)', - ], - }], + }, + { + 'action_name': 'js2c_experimental_extras', + 'inputs': [ + '../../tools/js2c.py', + '<@(v8_experimental_extra_library_files)', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/experimental-extras-libraries.cc', + ], + 'action': [ + 'python', + '../../tools/js2c.py', + '<(SHARED_INTERMEDIATE_DIR)/experimental-extras-libraries.cc', + 'EXPERIMENTAL_EXTRAS', + '<@(v8_experimental_extra_library_files)', + ], + }, + { + 'action_name': 'js2c_experimental_extras_bin', + 'inputs': [ + '../../tools/js2c.py', + '<@(v8_experimental_extra_library_files)', + ], + 'outputs': ['<@(libraries_experimental_extras_bin_file)'], + 'action': [ + 'python', + '../../tools/js2c.py', + '<(SHARED_INTERMEDIATE_DIR)/experimental-extras-libraries.cc', + 'EXPERIMENTAL_EXTRAS', + '<@(v8_experimental_extra_library_files)', + '--startup_blob', '<@(libraries_experimental_extras_bin_file)', + '--nojs', ], }, ], diff --git a/deps/v8/tools/js2c.py b/deps/v8/tools/js2c.py index c280537379..bd50692bb8 100755 --- a/deps/v8/tools/js2c.py +++ b/deps/v8/tools/js2c.py @@ -31,10 +31,9 @@ # char arrays. It is used for embedded JavaScript code in the V8 # library. -import os, re, sys, string +import os, re import optparse import jsmin -import bz2 import textwrap @@ -108,6 +107,9 @@ def ExpandMacroDefinition(lines, pos, name_pattern, macro, expander): mapping = { } def add_arg(str): # Remember to expand recursively in the arguments + if arg_index[0] >= len(macro.args): + lineno = lines.count(os.linesep, 0, start) + 1 + raise Error('line %s: Too many arguments for macro "%s"' % (lineno, name_pattern.pattern)) replacement = expander(str.strip()) mapping[macro.args[arg_index[0]]] = replacement arg_index[0] += 1 @@ -583,7 +585,8 @@ def main(): help="file to write the startup blob to.") parser.add_option("--js", help="writes a JS file output instead of a C file", - action="store_true") + action="store_true", default=False, dest='js') + parser.add_option("--nojs", action="store_false", default=False, dest='js') parser.set_usage("""js2c out.cc type sources.js ... out.cc: C code to be generated. type: type parameter for NativesCollection template. diff --git a/deps/v8/tools/presubmit.py b/deps/v8/tools/presubmit.py index a835e61792..338c708548 100755 --- a/deps/v8/tools/presubmit.py +++ b/deps/v8/tools/presubmit.py @@ -45,62 +45,25 @@ import subprocess import multiprocessing from subprocess import PIPE -# Disabled LINT rules and reason. +# Special LINT rules diverging from default and reason. +# build/header_guard: Our guards have the form "V8_FOO_H_", not "SRC_FOO_H_". # build/include_what_you_use: Started giving false positives for variables -# named "string" and "map" assuming that you needed to include STL headers. - -ENABLED_LINT_RULES = """ -build/class -build/deprecated -build/endif_comment -build/forward_decl -build/include_alpha -build/include_order -build/printf_format -build/storage_class -legal/copyright -readability/boost -readability/braces -readability/casting -readability/constructors -readability/fn_size -readability/function -readability/multiline_comment -readability/multiline_string -readability/streams -readability/todo -readability/utf8 -runtime/arrays -runtime/casting -runtime/deprecated_fn -runtime/explicit -runtime/int -runtime/memset -runtime/mutex -runtime/nonconf -runtime/printf -runtime/printf_format -runtime/rtti -runtime/sizeof -runtime/string -runtime/virtual -runtime/vlog -whitespace/blank_line -whitespace/braces -whitespace/comma -whitespace/comments -whitespace/ending_newline -whitespace/indent -whitespace/labels -whitespace/line_length -whitespace/newline -whitespace/operators -whitespace/parens -whitespace/tab -whitespace/todo -""".split() - +# named "string" and "map" assuming that you needed to include STL headers. # TODO(bmeurer): Fix and re-enable readability/check +# TODO(mstarzinger): Fix and re-enable readability/namespace + +LINT_RULES = """ +-build/header_guard ++build/include_alpha +-build/include_what_you_use +-build/namespaces +-readability/check +-readability/inheritance +-readability/namespace +-readability/nolint ++readability/streams +-runtime/references +""".split() LINT_OUTPUT_PATTERN = re.compile(r'^.+[:(]\d+[:)]|^Done processing') FLAGS_LINE = re.compile("//\s*Flags:.*--([A-z0-9-])+_[A-z0-9].*\n") @@ -256,15 +219,15 @@ class CppLintProcessor(SourceFileProcessor): print 'No changes in files detected. Skipping cpplint check.' return True - filt = '-,' + ",".join(['+' + n for n in ENABLED_LINT_RULES]) - command = [sys.executable, 'cpplint.py', '--filter', filt] + filters = ",".join([n for n in LINT_RULES]) + command = [sys.executable, 'cpplint.py', '--filter', filters] cpplint = self.GetCpplintScript(join(path, "tools")) if cpplint is None: print('Could not find cpplint.py. Make sure ' 'depot_tools is installed and in the path.') sys.exit(1) - command = [sys.executable, cpplint, '--filter', filt] + command = [sys.executable, cpplint, '--filter', filters] commands = join([command + [file] for file in files]) count = multiprocessing.cpu_count() @@ -438,12 +401,6 @@ class SourceProcessor(SourceFileProcessor): return success -def CheckRuntimeVsNativesNameClashes(workspace): - code = subprocess.call( - [sys.executable, join(workspace, "tools", "check-name-clashes.py")]) - return code == 0 - - def CheckExternalReferenceRegistration(workspace): code = subprocess.call( [sys.executable, join(workspace, "tools", "external-reference-check.py")]) @@ -495,7 +452,6 @@ def Main(): print "Running copyright header, trailing whitespaces and " \ "two empty lines between declarations check..." success = SourceProcessor().Run(workspace) and success - success = CheckRuntimeVsNativesNameClashes(workspace) and success success = CheckExternalReferenceRegistration(workspace) and success if success: return 0 diff --git a/deps/v8/tools/release/merge_to_branch.py b/deps/v8/tools/release/merge_to_branch.py index 5fe3ba4251..378a9fd135 100755 --- a/deps/v8/tools/release/merge_to_branch.py +++ b/deps/v8/tools/release/merge_to_branch.py @@ -104,9 +104,8 @@ class CreateCommitMessage(Step): def RunStep(self): - # Stringify: [123, 234] -> "r123, r234" - self["revision_list"] = ", ".join(map(lambda s: "r%s" % s, - self["full_revision_list"])) + # Stringify: ["abcde", "12345"] -> "abcde, 12345" + self["revision_list"] = ", ".join(self["full_revision_list"]) if not self["revision_list"]: # pragma: no cover self.Die("Revision list is empty.") diff --git a/deps/v8/tools/run-deopt-fuzzer.py b/deps/v8/tools/run-deopt-fuzzer.py index 7fbf402d95..89474d8162 100755 --- a/deps/v8/tools/run-deopt-fuzzer.py +++ b/deps/v8/tools/run-deopt-fuzzer.py @@ -398,6 +398,7 @@ def Execute(arch, mode, args, options, suites, workspace): "msan": False, "dcheck_always_on": options.dcheck_always_on, "novfp3": False, + "predictable": False, "byteorder": sys.byteorder, } all_tests = [] diff --git a/deps/v8/tools/run_perf.py b/deps/v8/tools/run_perf.py index 31331686fa..a8cc3fab71 100755 --- a/deps/v8/tools/run_perf.py +++ b/deps/v8/tools/run_perf.py @@ -102,6 +102,7 @@ import math import optparse import os import re +import subprocess import sys from testrunner.local import commands @@ -120,6 +121,7 @@ SUPPORTED_ARCHS = ["arm", 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__)) def LoadAndroidBuildTools(path): # pragma: no cover @@ -457,7 +459,10 @@ class RunnableConfig(GraphConfig): def GetCommand(self, shell_dir, extra_flags=None): # TODO(machenbach): This requires +.exe if run on windows. + extra_flags = extra_flags or [] cmd = [os.path.join(shell_dir, self.binary)] + if self.binary != 'd8' and '--prof' in extra_flags: + print "Profiler supported only on a benchmark run with d8" return cmd + self.GetCommandFlags(extra_flags=extra_flags) def Run(self, runner, trybot): @@ -640,6 +645,13 @@ class DesktopPlatform(Platform): print output.stderr if output.timed_out: print ">>> Test timed out after %ss." % runnable.timeout + if '--prof' in self.extra_flags: + 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) + else: # pragma: no cover + print "Profiler option currently supported on Linux and Mac OS." return output.stdout diff --git a/deps/v8/tools/testrunner/local/commands.py b/deps/v8/tools/testrunner/local/commands.py index 6aac3ffad5..a4df32c52a 100644 --- a/deps/v8/tools/testrunner/local/commands.py +++ b/deps/v8/tools/testrunner/local/commands.py @@ -61,12 +61,18 @@ def RunProcess(verbose, timeout, args, **rest): error_mode = SEM_NOGPFAULTERRORBOX prev_error_mode = Win32SetErrorMode(error_mode) Win32SetErrorMode(error_mode | prev_error_mode) - process = subprocess.Popen( - args=popen_args, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - **rest - ) + + try: + process = subprocess.Popen( + args=popen_args, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + **rest + ) + except Exception as e: + sys.stderr.write("Error executing: %s\n" % popen_args) + raise e + if (utils.IsWindows() and prev_error_mode != SEM_INVALID_VALUE): Win32SetErrorMode(prev_error_mode) diff --git a/deps/v8/tools/testrunner/local/progress.py b/deps/v8/tools/testrunner/local/progress.py index 60ec635262..85d93285eb 100644 --- a/deps/v8/tools/testrunner/local/progress.py +++ b/deps/v8/tools/testrunner/local/progress.py @@ -375,6 +375,7 @@ class JsonTestProgressIndicator(ProgressIndicator): # TODO(machenbach): This stores only the global random seed from the # context and not possible overrides when using random-seed stress. "random_seed": self.random_seed, + "target_name": test.suite.shell(), "variant": test.variant, }) diff --git a/deps/v8/tools/testrunner/local/statusfile.py b/deps/v8/tools/testrunner/local/statusfile.py index 62c959be29..bfa53c5348 100644 --- a/deps/v8/tools/testrunner/local/statusfile.py +++ b/deps/v8/tools/testrunner/local/statusfile.py @@ -56,7 +56,7 @@ DEFS = {FAIL_OK: [FAIL, OKAY], VARIABLES = {ALWAYS: True} for var in ["debug", "release", "big", "little", "android_arm", "android_arm64", "android_ia32", "android_x87", - "android_x64", "arm", "arm64", "ia32", "mips", "mipsel", + "android_x64", "arm", "arm64", "ia32", "mips", "mipsel", "mips64", "mips64el", "x64", "x87", "nacl_ia32", "nacl_x64", "ppc", "ppc64", "macos", "windows", "linux", "aix"]: VARIABLES[var] = var diff --git a/deps/v8/tools/testrunner/local/testsuite.py b/deps/v8/tools/testrunner/local/testsuite.py index c8e43521e7..e0fff0d11a 100644 --- a/deps/v8/tools/testrunner/local/testsuite.py +++ b/deps/v8/tools/testrunner/local/testsuite.py @@ -226,7 +226,7 @@ class TestSuite(object): continue if len(argpath) == 1 or (len(argpath) == 2 and argpath[1] == '*'): return # Don't filter, run all tests in this suite. - path = os.path.sep.join(argpath[1:]) + path = '/'.join(argpath[1:]) if path[-1] == '*': path = path[:-1] globs.append(path) diff --git a/deps/v8/tools/tickprocessor-driver.js b/deps/v8/tools/tickprocessor-driver.js index 946f543219..dc8a87d9ec 100644 --- a/deps/v8/tools/tickprocessor-driver.js +++ b/deps/v8/tools/tickprocessor-driver.js @@ -77,6 +77,7 @@ var tickProcessor = new TickProcessor( params.range, sourceMap, params.timedRange, - params.pairwiseTimedRange); + params.pairwiseTimedRange, + params.onlySummary); tickProcessor.processLogFile(params.logFileName); tickProcessor.printStatistics(); diff --git a/deps/v8/tools/tickprocessor.js b/deps/v8/tools/tickprocessor.js index d857573855..600d2eeb7b 100644 --- a/deps/v8/tools/tickprocessor.js +++ b/deps/v8/tools/tickprocessor.js @@ -156,7 +156,8 @@ function TickProcessor( range, sourceMap, timedRange, - pairwiseTimedRange) { + pairwiseTimedRange, + onlySummary) { LogReader.call(this, { 'shared-library': { parsers: [null, parseInt, parseInt], processor: this.processSharedLibrary }, @@ -247,6 +248,7 @@ function TickProcessor( this.generation_ = 1; this.currentProducerProfile_ = null; + this.onlySummary_ = onlySummary; }; inherits(TickProcessor, LogReader); @@ -456,29 +458,30 @@ TickProcessor.prototype.printStatistics = function() { if (this.ignoreUnknown_) { totalTicks -= this.ticks_.unaccounted; } + var printAllTicks = !this.onlySummary_; // Count library ticks var flatViewNodes = flatView.head.children; var self = this; var libraryTicks = 0; - this.printHeader('Shared libraries'); + if(printAllTicks) this.printHeader('Shared libraries'); this.printEntries(flatViewNodes, totalTicks, null, function(name) { return self.isSharedLibrary(name); }, - function(rec) { libraryTicks += rec.selfTime; }); + function(rec) { libraryTicks += rec.selfTime; }, printAllTicks); var nonLibraryTicks = totalTicks - libraryTicks; var jsTicks = 0; - this.printHeader('JavaScript'); + if(printAllTicks) this.printHeader('JavaScript'); this.printEntries(flatViewNodes, totalTicks, nonLibraryTicks, function(name) { return self.isJsCode(name); }, - function(rec) { jsTicks += rec.selfTime; }); + function(rec) { jsTicks += rec.selfTime; }, printAllTicks); var cppTicks = 0; - this.printHeader('C++'); + if(printAllTicks) this.printHeader('C++'); this.printEntries(flatViewNodes, totalTicks, nonLibraryTicks, function(name) { return self.isCppCode(name); }, - function(rec) { cppTicks += rec.selfTime; }); + function(rec) { cppTicks += rec.selfTime; }, printAllTicks); this.printHeader('Summary'); this.printLine('JavaScript', jsTicks, totalTicks, nonLibraryTicks); @@ -490,25 +493,27 @@ TickProcessor.prototype.printStatistics = function() { this.ticks_.total, null); } - print('\n [C++ entry points]:'); - print(' ticks cpp total name'); - var c_entry_functions = this.profile_.getCEntryProfile(); - var total_c_entry = c_entry_functions[0].ticks; - for (var i = 1; i < c_entry_functions.length; i++) { - c = c_entry_functions[i]; - this.printLine(c.name, c.ticks, total_c_entry, totalTicks); - } + if(printAllTicks) { + print('\n [C++ entry points]:'); + print(' ticks cpp total name'); + var c_entry_functions = this.profile_.getCEntryProfile(); + var total_c_entry = c_entry_functions[0].ticks; + for (var i = 1; i < c_entry_functions.length; i++) { + c = c_entry_functions[i]; + this.printLine(c.name, c.ticks, total_c_entry, totalTicks); + } - this.printHeavyProfHeader(); - var heavyProfile = this.profile_.getBottomUpProfile(); - var heavyView = this.viewBuilder_.buildView(heavyProfile); - // To show the same percentages as in the flat profile. - heavyView.head.totalTime = totalTicks; - // Sort by total time, desc, then by name, desc. - heavyView.sort(function(rec1, rec2) { - return rec2.totalTime - rec1.totalTime || - (rec2.internalFuncName < rec1.internalFuncName ? -1 : 1); }); - this.printHeavyProfile(heavyView.head.children); + this.printHeavyProfHeader(); + var heavyProfile = this.profile_.getBottomUpProfile(); + var heavyView = this.viewBuilder_.buildView(heavyProfile); + // To show the same percentages as in the flat profile. + heavyView.head.totalTime = totalTicks; + // Sort by total time, desc, then by name, desc. + heavyView.sort(function(rec1, rec2) { + return rec2.totalTime - rec1.totalTime || + (rec2.internalFuncName < rec1.internalFuncName ? -1 : 1); }); + this.printHeavyProfile(heavyView.head.children); + } }; @@ -600,13 +605,15 @@ TickProcessor.prototype.formatFunctionName = function(funcName) { }; TickProcessor.prototype.printEntries = function( - profile, totalTicks, nonLibTicks, filterP, callback) { + profile, totalTicks, nonLibTicks, filterP, callback, printAllTicks) { var that = this; this.processProfile(profile, filterP, function (rec) { if (rec.selfTime == 0) return; callback(rec); var funcName = that.formatFunctionName(rec.internalFuncName); - that.printLine(funcName, rec.selfTime, totalTicks, nonLibTicks); + if(printAllTicks) { + that.printLine(funcName, rec.selfTime, totalTicks, nonLibTicks); + } }); }; @@ -884,7 +891,9 @@ function ArgumentsProcessor(args) { '--timed-range': ['timedRange', true, 'Ignore ticks before first and after last Date.now() call'], '--pairwise-timed-range': ['pairwiseTimedRange', true, - 'Ignore ticks outside pairs of Date.now() calls'] + 'Ignore ticks outside pairs of Date.now() calls'], + '--only-summary': ['onlySummary', true, + 'Print only tick summary, exclude other information'] }; this.argsDispatch_['--js'] = this.argsDispatch_['-j']; this.argsDispatch_['--gc'] = this.argsDispatch_['-g']; @@ -908,7 +917,8 @@ ArgumentsProcessor.DEFAULTS = { range: 'auto,auto', distortion: 0, timedRange: false, - pairwiseTimedRange: false + pairwiseTimedRange: false, + onlySummary: false }; diff --git a/deps/v8/tools/try_perf.py b/deps/v8/tools/try_perf.py index 5969ff0032..14b2329f74 100755 --- a/deps/v8/tools/try_perf.py +++ b/deps/v8/tools/try_perf.py @@ -4,13 +4,10 @@ # found in the LICENSE file. import argparse -import find_depot_tools +import os +import subprocess import sys -find_depot_tools.add_depot_tools_to_path() - -from git_cl import Changelist - BOTS = { '--arm32': 'v8_arm32_perf_try', '--linux32': 'v8_linux32_perf_try', @@ -23,13 +20,19 @@ BOTS = { } DEFAULT_BOTS = [ + 'v8_arm32_perf_try', 'v8_linux32_perf_try', 'v8_linux64_haswell_perf_try', + 'v8_nexus10_perf_try', ] +V8_BASE = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) + def main(): parser = argparse.ArgumentParser(description='') - parser.add_argument("benchmarks", nargs="+", help="The benchmarks to run.") + parser.add_argument('benchmarks', nargs='+', help='The benchmarks to run.') + parser.add_argument('--extra-flags', default='', + help='Extra flags to be passed to the executable.') for option in sorted(BOTS): parser.add_argument( option, dest='bots', action='append_const', const=BOTS[option], @@ -39,31 +42,25 @@ def main(): print 'No trybots specified. Using default %s.' % ','.join(DEFAULT_BOTS) options.bots = DEFAULT_BOTS - cl = Changelist() - if not cl.GetIssue(): - print 'Need to upload first' + if not options.benchmarks: + print 'Please specify the benchmarks to run as arguments.' return 1 - props = cl.GetIssueProperties() - if props.get('closed'): - print 'Cannot send tryjobs for a closed CL' - return 1 + assert '"' not in options.extra_flags and '\'' not in options.extra_flags, ( + 'Invalid flag specification.') - if props.get('private'): - print 'Cannot use trybots with private issue' - return 1 + # Ensure depot_tools are updated. + subprocess.check_output( + 'gclient', shell=True, stderr=subprocess.STDOUT, cwd=V8_BASE) - if not options.benchmarks: - print 'Please specify the benchmarks to run as arguments.' - return 1 + cmd = ['git cl try -m internal.client.v8'] + cmd += ['-b %s' % bot for bot in options.bots] + benchmarks = ['"%s"' % benchmark for benchmark in options.benchmarks] + cmd += ['-p \'testfilter=[%s]\'' % ','.join(benchmarks)] + if options.extra_flags: + cmd += ['-p \'extra_flags="%s"\'' % options.extra_flags] + subprocess.check_call(' '.join(cmd), shell=True, cwd=V8_BASE) - masters = { - 'internal.client.v8': dict((b, options.benchmarks) for b in options.bots), - } - cl.RpcServer().trigger_distributed_try_jobs( - cl.GetIssue(), cl.GetMostRecentPatchset(), cl.GetBranch(), - False, None, masters) - return 0 -if __name__ == "__main__": # pragma: no cover +if __name__ == '__main__': # pragma: no cover sys.exit(main()) diff --git a/deps/v8/tools/unittests/run_perf_test.py b/deps/v8/tools/unittests/run_perf_test.py index f3e5aff49f..1a4d73857a 100644 --- a/deps/v8/tools/unittests/run_perf_test.py +++ b/deps/v8/tools/unittests/run_perf_test.py @@ -10,7 +10,9 @@ from mock import DEFAULT from mock import MagicMock import os from os import path, sys +import platform import shutil +import subprocess import tempfile import unittest @@ -129,6 +131,9 @@ class PerfTest(unittest.TestCase): self.assertEquals(dirs.pop(), args[0]) os.chdir = MagicMock(side_effect=chdir) + subprocess.check_call = MagicMock() + platform.system = MagicMock(return_value='Linux') + def _CallMain(self, *args): self._test_output = path.join(TEST_WORKSPACE, "results.json") all_args=[ @@ -448,6 +453,19 @@ class PerfTest(unittest.TestCase): (path.join("out-no-patch", "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._VerifyErrors([]) + self._VerifyMock(path.join("out", "x64.release", "d7"), + "--flag", "--prof", "run.js") + def testUnzip(self): def Gen(): for i in [1, 2, 3]: diff --git a/deps/v8/tools/whitespace.txt b/deps/v8/tools/whitespace.txt index d1395f5d91..5a830c0e12 100644 --- a/deps/v8/tools/whitespace.txt +++ b/deps/v8/tools/whitespace.txt @@ -5,4 +5,4 @@ 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 Smi looked at them when a crazy v8-autoroll account showed up. |