Skip to content

Commit 1480968

Browse files
evan.lucasMyles Borins
evan.lucas
authored and
Myles Borins
committed
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. PR-URL: #3792 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent acc1288 commit 1480968

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
@@ -271,6 +271,20 @@
271271
}
272272
'''
273273

274+
#
275+
# Get the base class
276+
#
277+
def get_base_class(klass):
278+
if (klass == 'Object'):
279+
return klass;
280+
281+
if (not (klass in klasses)):
282+
return None;
283+
284+
k = klasses[klass];
285+
286+
return get_base_class(k['parent']);
287+
274288
#
275289
# Loads class hierarchy and type information from "objects.h".
276290
#
@@ -309,12 +323,14 @@ def load_objects():
309323
typestr += line;
310324
continue;
311325

312-
match = re.match('class (\w[^\s:]*)(: public (\w[^\s{]*))?\s*{',
326+
match = re.match('class (\w[^:]*)(: public (\w[^{]*))?\s*{\s*',
313327
line);
314328

315329
if (match):
316-
klass = match.group(1);
330+
klass = match.group(1).rstrip().lstrip();
317331
pklass = match.group(3);
332+
if (pklass):
333+
pklass = pklass.rstrip().lstrip();
318334
klasses[klass] = { 'parent': pklass };
319335

320336
#
@@ -565,6 +581,9 @@ def emit_config():
565581
keys.sort();
566582
for klassname in keys:
567583
pklass = klasses[klassname]['parent'];
584+
bklass = get_base_class(klassname);
585+
if (bklass != 'Object'):
586+
continue;
568587
if (pklass == None):
569588
continue;
570589

0 commit comments

Comments
 (0)