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

Side by Side Diff: build/android/gyp/jar_toc.py

Issue 1232063008: Run javap with a bigger NewSize to fix crash when processing robolectric.jar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months 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
« no previous file with comments | « no previous file | 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 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Creates a TOC file from a Java jar. 7 """Creates a TOC file from a Java jar.
8 8
9 The TOC file contains the non-package API of the jar. This includes all 9 The TOC file contains the non-package API of the jar. This includes all
10 public/protected/package classes/functions/members and the values of static 10 public/protected/package classes/functions/members and the values of static
(...skipping 26 matching lines...) Expand all
37 return classes 37 return classes
38 38
39 39
40 def CallJavap(classpath, classes): 40 def CallJavap(classpath, classes):
41 javap_cmd = [ 41 javap_cmd = [
42 'javap', 42 'javap',
43 '-package', # Show public/protected/package. 43 '-package', # Show public/protected/package.
44 # -verbose is required to get constant values (which can be inlined in 44 # -verbose is required to get constant values (which can be inlined in
45 # dependents). 45 # dependents).
46 '-verbose', 46 '-verbose',
47 '-J-XX:NewSize=4m',
47 '-classpath', classpath 48 '-classpath', classpath
48 ] + classes 49 ] + classes
49 return build_utils.CheckOutput(javap_cmd) 50 return build_utils.CheckOutput(javap_cmd)
50 51
51 52
52 def ExtractToc(disassembled_classes): 53 def ExtractToc(disassembled_classes):
53 # javap output is structured by indent (2-space) levels. 54 # javap output is structured by indent (2-space) levels.
54 good_patterns = [ 55 good_patterns = [
55 '^[^ ]', # This includes all class/function/member signatures. 56 '^[^ ]', # This includes all class/function/member signatures.
56 '^ SourceFile:', 57 '^ SourceFile:',
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 build_utils.WriteDepfile( 116 build_utils.WriteDepfile(
116 options.depfile, 117 options.depfile,
117 build_utils.GetPythonDependencies()) 118 build_utils.GetPythonDependencies())
118 119
119 if options.stamp: 120 if options.stamp:
120 build_utils.Touch(options.stamp) 121 build_utils.Touch(options.stamp)
121 122
122 123
123 if __name__ == '__main__': 124 if __name__ == '__main__':
124 sys.exit(main()) 125 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698