Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: tools/gen-postmortem-metadata.py

Issue 1435643002: Make gen-postmortem-metadata.py more reliable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/objects.h ('K') | « src/objects.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # 3 #
4 # Copyright 2012 the V8 project authors. All rights reserved. 4 # Copyright 2012 the V8 project authors. All rights reserved.
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are 6 # modification, are permitted provided that the following conditions are
7 # met: 7 # met:
8 # 8 #
9 # * Redistributions of source code must retain the above copyright 9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 if (in_insttype and line.startswith('};')): 257 if (in_insttype and line.startswith('};')):
258 in_insttype = False; 258 in_insttype = False;
259 continue; 259 continue;
260 260
261 line = re.sub('//.*', '', line.rstrip().lstrip()); 261 line = re.sub('//.*', '', line.rstrip().lstrip());
262 262
263 if (in_insttype): 263 if (in_insttype):
264 typestr += line; 264 typestr += line;
265 continue; 265 continue;
266 266
267 match = re.match('class (\w[^\s:]*)(: public (\w[^\s{]*))?\s*{', 267 match = re.match('class (\w[^:]*)(: public (\w[^{]*))?\s*{\s*/\* POSTMORTEM',
268 line); 268 line);
269 269
270 if (match): 270 if (match):
271 klass = match.group(1); 271 klass = match.group(1).rstrip().lstrip();
272 pklass = match.group(3); 272 pklass = match.group(3);
273 if (pklass):
274 pklass = pklass.rstrip().lstrip();
273 klasses[klass] = { 'parent': pklass }; 275 klasses[klass] = { 'parent': pklass };
274 276
275 # 277 #
276 # Process the instance type declaration. 278 # Process the instance type declaration.
277 # 279 #
278 entries = typestr.split(','); 280 entries = typestr.split(',');
279 for entry in entries: 281 for entry in entries:
280 types[re.sub('\s*=.*', '', entry).lstrip()] = True; 282 types[re.sub('\s*=.*', '', entry).lstrip()] = True;
281 283
282 # 284 #
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 537
536 out.write(footer); 538 out.write(footer);
537 539
538 if (len(sys.argv) < 4): 540 if (len(sys.argv) < 4):
539 print('usage: %s output.cc objects.h objects-inl.h' % sys.argv[0]); 541 print('usage: %s output.cc objects.h objects-inl.h' % sys.argv[0]);
540 sys.exit(2); 542 sys.exit(2);
541 543
542 load_objects(); 544 load_objects();
543 load_fields(); 545 load_fields();
544 emit_config(); 546 emit_config();
OLDNEW
« src/objects.h ('K') | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698