Skip to content

Commit de00f91

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 b3acbc5 commit de00f91

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
@@ -224,6 +224,20 @@
224224
}
225225
'''
226226

227+
#
228+
# Get the base class
229+
#
230+
def get_base_class(klass):
231+
if (klass == 'Object'):
232+
return klass;
233+
234+
if (not (klass in klasses)):
235+
return None;
236+
237+
k = klasses[klass];
238+
239+
return get_base_class(k['parent']);
240+
227241
#
228242
# Loads class hierarchy and type information from "objects.h".
229243
#
@@ -262,12 +276,14 @@ def load_objects():
262276
typestr += line;
263277
continue;
264278

265-
match = re.match('class (\w[^\s:]*)(: public (\w[^\s{]*))?\s*{',
279+
match = re.match('class (\w[^:]*)(: public (\w[^{]*))?\s*{\s*',
266280
line);
267281

268282
if (match):
269-
klass = match.group(1);
283+
klass = match.group(1).rstrip().lstrip();
270284
pklass = match.group(3);
285+
if (pklass):
286+
pklass = pklass.rstrip().lstrip();
271287
klasses[klass] = { 'parent': pklass };
272288

273289
#
@@ -518,6 +534,9 @@ def emit_config():
518534
keys.sort();
519535
for klassname in keys:
520536
pklass = klasses[klassname]['parent'];
537+
bklass = get_base_class(klassname);
538+
if (bklass != 'Object'):
539+
continue;
521540
if (pklass == None):
522541
continue;
523542

0 commit comments

Comments
 (0)