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.py31
1 files changed, 23 insertions, 8 deletions
diff --git a/deps/v8/tools/gen-postmortem-metadata.py b/deps/v8/tools/gen-postmortem-metadata.py
index ceaf7798fd..725af52c7d 100644
--- a/deps/v8/tools/gen-postmortem-metadata.py
+++ b/deps/v8/tools/gen-postmortem-metadata.py
@@ -49,7 +49,6 @@
# for py2/py3 compatibility
from __future__ import print_function
-import io
import re
import sys
@@ -286,6 +285,7 @@ extras_accessors = [
'Code, instruction_start, uintptr_t, kHeaderSize',
'Code, instruction_size, int, kInstructionSizeOffset',
'String, length, int32_t, kLengthOffset',
+ 'DescriptorArray, header_size, uintptr_t, kHeaderSize',
];
#
@@ -296,7 +296,8 @@ extras_accessors = [
expected_classes = [
'ConsString', 'FixedArray', 'HeapNumber', 'JSArray', 'JSFunction',
'JSObject', 'JSRegExp', 'JSPrimitiveWrapper', 'Map', 'Oddball', 'Script',
- 'SeqOneByteString', 'SharedFunctionInfo', 'ScopeInfo', 'JSPromise'
+ 'SeqOneByteString', 'SharedFunctionInfo', 'ScopeInfo', 'JSPromise',
+ 'DescriptorArray'
];
@@ -383,10 +384,12 @@ def load_objects():
def load_objects_from_file(objfilename, checktypes):
- objfile = io.open(objfilename, 'r', encoding='utf-8');
+ objfile = open(objfilename, 'r');
in_insttype = False;
+ in_torque_insttype = False
typestr = '';
+ torque_typestr = ''
uncommented_file = ''
#
@@ -400,16 +403,28 @@ def load_objects_from_file(objfilename, checktypes):
in_insttype = True;
continue;
+ if (line.startswith('#define TORQUE_ASSIGNED_INSTANCE_TYPE_LIST')):
+ in_torque_insttype = True
+ continue
+
if (in_insttype and line.startswith('};')):
in_insttype = False;
continue;
+ if (in_torque_insttype and (not line or line.isspace())):
+ in_torque_insttype = False
+ continue
+
line = re.sub('//.*', '', line.strip());
if (in_insttype):
typestr += line;
continue;
+ if (in_torque_insttype):
+ torque_typestr += line
+ continue
+
uncommented_file += '\n' + line
for match in re.finditer(r'\nclass(?:\s+V8_EXPORT(?:_PRIVATE)?)?'
@@ -437,6 +452,9 @@ def load_objects_from_file(objfilename, checktypes):
entries = typestr.split(',');
for entry in entries:
types[re.sub('\s*=.*', '', entry).lstrip()] = True;
+ entries = torque_typestr.split('\\')
+ for entry in entries:
+ types[re.sub(r' *V\(|\) *', '', entry)] = True
#
# Infer class names for each type based on a systematic transformation.
@@ -446,10 +464,7 @@ def load_objects_from_file(objfilename, checktypes):
# way around.
#
for type in types:
- #
- # REGEXP behaves like REG_EXP, as in JS_REGEXP_TYPE => JSRegExp.
- #
- usetype = re.sub('_REGEXP_', '_REG_EXP_', type);
+ usetype = type
#
# Remove the "_TYPE" suffix and then convert to camel case,
@@ -578,7 +593,7 @@ def load_fields():
def load_fields_from_file(filename):
- inlfile = io.open(filename, 'r', encoding='utf-8');
+ inlfile = open(filename, 'r');
#
# Each class's fields and the corresponding offsets are described in the