diff options
author | Myles Borins <mylesborins@google.com> | 2017-08-01 11:36:44 -0500 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2017-08-01 15:23:15 -0500 |
commit | 0a66b223e149a841669bfad5598e4254589730cb (patch) | |
tree | 5ec050f7f78aafbf5b1e0e50d639fb843141e162 /deps/v8/tools/gen-postmortem-metadata.py | |
parent | 1782b3836ba58ef0da6b687f2bb970c0bd8199ad (diff) | |
download | android-node-v8-0a66b223e149a841669bfad5598e4254589730cb.tar.gz android-node-v8-0a66b223e149a841669bfad5598e4254589730cb.tar.bz2 android-node-v8-0a66b223e149a841669bfad5598e4254589730cb.zip |
deps: update V8 to 6.0.286.52
PR-URL: https://github.com/nodejs/node/pull/14004
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/v8/tools/gen-postmortem-metadata.py')
-rw-r--r-- | deps/v8/tools/gen-postmortem-metadata.py | 60 |
1 files changed, 35 insertions, 25 deletions
diff --git a/deps/v8/tools/gen-postmortem-metadata.py b/deps/v8/tools/gen-postmortem-metadata.py index 0e3d088fbb..e793a91865 100644 --- a/deps/v8/tools/gen-postmortem-metadata.py +++ b/deps/v8/tools/gen-postmortem-metadata.py @@ -335,15 +335,9 @@ def get_base_class(klass): return get_base_class(k['parent']); # -# Loads class hierarchy and type information from "objects.h". +# Loads class hierarchy and type information from "objects.h" etc. # def load_objects(): - objfilename = sys.argv[2]; - objfile = open(objfilename, 'r'); - in_insttype = False; - - typestr = ''; - # # Construct a dictionary for the classes we're sure should be present. # @@ -351,11 +345,29 @@ def load_objects(): for klass in expected_classes: checktypes[klass] = True; + + for filename in sys.argv[2:]: + if not filename.endswith("-inl.h"): + load_objects_from_file(filename, checktypes) + + if (len(checktypes) > 0): + for klass in checktypes: + print('error: expected class \"%s\" not found' % klass); + + sys.exit(1); + + +def load_objects_from_file(objfilename, checktypes): + objfile = open(objfilename, 'r'); + in_insttype = False; + + typestr = ''; + # - # Iterate objects.h line-by-line to collect type and class information. - # For types, we accumulate a string representing the entire InstanceType - # enum definition and parse it later because it's easier to do so - # without the embedded newlines. + # Iterate the header file line-by-line to collect type and class + # information. For types, we accumulate a string representing the entire + # InstanceType enum definition and parse it later because it's easier to + # do so without the embedded newlines. # for line in objfile: if (line.startswith('enum InstanceType {')): @@ -482,13 +494,6 @@ def load_objects(): if (cctype in checktypes): del checktypes[cctype]; - if (len(checktypes) > 0): - for klass in checktypes: - print('error: expected class \"%s\" not found' % klass); - - sys.exit(1); - - # # For a given macro call, pick apart the arguments and return an object # describing the corresponding output constant. See load_fields(). @@ -509,7 +514,7 @@ def parse_field(call): if (kind == 'ACCESSORS' or kind == 'ACCESSORS_GCSAFE'): klass = args[0]; field = args[1]; - dtype = args[2]; + dtype = args[2].replace('<', '_').replace('>', '_') offset = args[3]; return ({ @@ -528,11 +533,19 @@ def parse_field(call): }); # -# Load field offset information from objects-inl.h. +# Load field offset information from objects-inl.h etc. # def load_fields(): - inlfilename = sys.argv[3]; - inlfile = open(inlfilename, 'r'); + for filename in sys.argv[2:]: + if filename.endswith("-inl.h"): + load_fields_from_file(filename) + + for body in extras_accessors: + fields.append(parse_field('ACCESSORS(%s)' % body)); + + +def load_fields_from_file(filename): + inlfile = open(filename, 'r'); # # Each class's fields and the corresponding offsets are described in the @@ -584,9 +597,6 @@ def load_fields(): fields.append(parse_field(current)); current = ''; - for body in extras_accessors: - fields.append(parse_field('ACCESSORS(%s)' % body)); - # # Emit a block of constants. # |