Skip to content

Commit 1e324d8

Browse files
evan.lucasofrobots
evan.lucas
authored andcommitted
deps: backport bc2e393 from v8 upstream
Original commit message: [tools] Make gen-postmortem-metadata.py more reliable Instead of basing matches off of whitespace, walk the inheritance chain and include any classes that inherit from Object. [email protected],[email protected] NOTRY=true Review URL: https://codereview.chromium.org/1435643002 Cr-Commit-Position: refs/heads/master@{#31964} This adds some missing classes to postmortem info like JSMap and JSSet. Ref: #3792 PR-URL: #4106 Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]> Reviewed-By: targos - Michaël Zasso <[email protected]> Reviewed-By: rvagg - Rod Vagg <[email protected]>
1 parent d9d050d commit 1e324d8

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

deps/v8/tools/gen-postmortem-metadata.py

+21-2
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,20 @@
273273
}
274274
'''
275275

276+
#
277+
# Get the base class
278+
#
279+
def get_base_class(klass):
280+
if (klass == 'Object'):
281+
return klass;
282+
283+
if (not (klass in klasses)):
284+
return None;
285+
286+
k = klasses[klass];
287+
288+
return get_base_class(k['parent']);
289+
276290
#
277291
# Loads class hierarchy and type information from "objects.h".
278292
#
@@ -311,12 +325,14 @@ def load_objects():
311325
typestr += line;
312326
continue;
313327

314-
match = re.match('class (\w[^\s:]*)(: public (\w[^\s{]*))?\s*{',
328+
match = re.match('class (\w[^:]*)(: public (\w[^{]*))?\s*{\s*',
315329
line);
316330

317331
if (match):
318-
klass = match.group(1);
332+
klass = match.group(1).rstrip().lstrip();
319333
pklass = match.group(3);
334+
if (pklass):
335+
pklass = pklass.rstrip().lstrip();
320336
klasses[klass] = { 'parent': pklass };
321337

322338
#
@@ -567,6 +583,9 @@ def emit_config():
567583
keys.sort();
568584
for klassname in keys:
569585
pklass = klasses[klassname]['parent'];
586+
bklass = get_base_class(klassname);
587+
if (bklass != 'Object'):
588+
continue;
570589
if (pklass == None):
571590
continue;
572591

0 commit comments

Comments
 (0)