Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: backport bc2e393 from v8 upstream #3792

Merged
merged 1 commit into from
Nov 14, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions deps/v8/tools/gen-postmortem-metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,20 @@
}
'''

#
# Get the base class
#
def get_base_class(klass):
if (klass == 'Object'):
return klass;

if (not (klass in klasses)):
return None;

k = klasses[klass];

return get_base_class(k['parent']);

#
# Loads class hierarchy and type information from "objects.h".
#
Expand Down Expand Up @@ -311,12 +325,14 @@ def load_objects():
typestr += line;
continue;

match = re.match('class (\w[^\s:]*)(: public (\w[^\s{]*))?\s*{',
match = re.match('class (\w[^:]*)(: public (\w[^{]*))?\s*{\s*',
line);

if (match):
klass = match.group(1);
klass = match.group(1).rstrip().lstrip();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to ask: why not just .strip()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking back on it, that is what it probably should have been...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted a patch for the same: https://codereview.chromium.org/1443963004

pklass = match.group(3);
if (pklass):
pklass = pklass.rstrip().lstrip();
klasses[klass] = { 'parent': pklass };

#
Expand Down Expand Up @@ -567,6 +583,9 @@ def emit_config():
keys.sort();
for klassname in keys:
pklass = klasses[klassname]['parent'];
bklass = get_base_class(klassname);
if (bklass != 'Object'):
continue;
if (pklass == None):
continue;

Expand Down