summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_visualizer.cc
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2018-01-12 15:44:43 +0000
committerDavid Brazdil <dbrazdil@google.com>2018-01-16 15:32:12 +0000
commit2b9c35be35a759ba2032692648f5bbcb1e7e78c8 (patch)
tree4825fdb4a4ecd27922dc9c945b30423534e67010 /compiler/optimizing/graph_visualizer.cc
parent6d4c343ee5db18f039aeb3e07ff8d3c1fd37c3a0 (diff)
Introduce new build tool: hiddenapi
New tool `hiddenapi` iterates over all class members inside given DEX files and modifies their access flags if their signatures appear on one of two lists - greylist and blacklist - provided as text file inputs. These access flags denote to the runtime that the marked methods/fields should be treated as internal APIs with restricted access. Two bits of information are encoded in the DEX access flags. These are encoded as unsigned LEB128 values in DEX and so as to not increase the size of the DEX, different modifiers were chosen to carry the information under different circumstances. First bit is encoded as the inversion of visibility access flags (bits 2:0). At most one of these flags can be set at any given time. Inverting these bits therefore produces a value where at least two bits are set and there is never any loss of information. Second bit is encoded differently for each given type of class member as there is no single unused bit such that setting it would not increase the size of the LEB128 encoding. - Bit 5 for fields as it carries no other meaning - Bit 5 for non-native methods, as `synchronized` can only be set on native methods - Bit 9 for native methods, as it carries no meaning and bit 8 (native) will make the LEB128 encoding at least two bytes long This tool is meant to be applied on boot class path DEX files and as such, this encoding is not part of the DEX specification and may change in the future. Access flags returned by ClassDataItemIterator are stripped of these hidden flags and thus fully transparent to the runtime. Test: m test-art-host Bug: 64382372 Change-Id: Ifc237ff8a35a8b470b7fc682a9cb879370d1e6e9
Diffstat (limited to 'compiler/optimizing/graph_visualizer.cc')
0 files changed, 0 insertions, 0 deletions