summaryrefslogtreecommitdiff
path: root/deps/v8/tools/gen-postmortem-metadata.py
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/tools/gen-postmortem-metadata.py')
-rw-r--r--deps/v8/tools/gen-postmortem-metadata.py60
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.
#