| OLD | NEW |
| 1 # Copyright 2008 the V8 project authors. All rights reserved. | 1 # Copyright 2008 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 | 59 |
| 60 class JSCodeEntry(CodeEntry): | 60 class JSCodeEntry(CodeEntry): |
| 61 | 61 |
| 62 def __init__(self, start_addr, name, type, size): | 62 def __init__(self, start_addr, name, type, size): |
| 63 CodeEntry.__init__(self, start_addr, name) | 63 CodeEntry.__init__(self, start_addr, name) |
| 64 self.type = type | 64 self.type = type |
| 65 self.size = size | 65 self.size = size |
| 66 | 66 |
| 67 def ToString(self): | 67 def ToString(self): |
| 68 return self.name + ' ' + self.type | 68 name = self.name |
| 69 if name == '': name = '<anonymous>' |
| 70 return self.type + ': ' + name |
| 69 | 71 |
| 70 | 72 |
| 71 class TickProcessor(object): | 73 class TickProcessor(object): |
| 72 | 74 |
| 73 def __init__(self): | 75 def __init__(self): |
| 74 self.log_file = '' | 76 self.log_file = '' |
| 75 self.deleted_code = [] | 77 self.deleted_code = [] |
| 76 self.vm_extent = {} | 78 self.vm_extent = {} |
| 77 self.js_entries = splaytree.SplayTree() | 79 self.js_entries = splaytree.SplayTree() |
| 78 self.cpp_entries = splaytree.SplayTree() | 80 self.cpp_entries = splaytree.SplayTree() |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 else: | 197 else: |
| 196 non_library_percentage = entry.tick_count * 100.0 / number_of_non_libr
ary_ticks | 198 non_library_percentage = entry.tick_count * 100.0 / number_of_non_libr
ary_ticks |
| 197 print(' %(total)5.1f%% %(nonlib)6.1f%% %(name)s' % { | 199 print(' %(total)5.1f%% %(nonlib)6.1f%% %(name)s' % { |
| 198 'total' : total_percentage, | 200 'total' : total_percentage, |
| 199 'nonlib' : non_library_percentage, | 201 'nonlib' : non_library_percentage, |
| 200 'name' : entry.ToString() | 202 'name' : entry.ToString() |
| 201 }) | 203 }) |
| 202 | 204 |
| 203 if __name__ == '__main__': | 205 if __name__ == '__main__': |
| 204 sys.exit('You probably want to run windows-tick-processor.py or linux-tick-pro
cessor.py.') | 206 sys.exit('You probably want to run windows-tick-processor.py or linux-tick-pro
cessor.py.') |
| OLD | NEW |