diff options
author | Tor Norbye <tnorbye@google.com> | 2012-07-19 17:56:44 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-07-23 15:06:38 -0700 |
commit | 4ca1c4d2c780b345854b9824963cd6cf930a7276 (patch) | |
tree | 03dd0ead35bf58c73761c082e0d3d8fa89075766 /eclipse/scripts | |
parent | df97f7f5c9f5148d32dac2e2ed98bc6862fe5fc6 (diff) | |
download | sdk-4ca1c4d2c780b345854b9824963cd6cf930a7276.zip sdk-4ca1c4d2c780b345854b9824963cd6cf930a7276.tar.gz sdk-4ca1c4d2c780b345854b9824963cd6cf930a7276.tar.bz2 |
Add bytecode method call dispatch for lint rules
This changeset adds shared dispatch for bytecode based rules. We
already have this for XML and Java source trees: detectors can
register interest in a particular element or attribute name, or a
particular method call name, and then the source is processed in a
single pass, and a quick map lookup dispatches to any detectors
interested in that particular item.
This has the important property that adding new detectors does not
linearly slow down lint: it does not process each XML document an
extra time for each newly added rule: the new rule just adds one more
entry into a dispatch table, and only for the specifically interesting
tag name (for example) is there an extra dispatch to the new detector.
This changeset adds a similar mechanism for the ASM based bytecode
detectors. Until now, each detector would be handed the class node of
the outer class. This changeset adds a couple of new dispatch methods:
First, a way to register interests in method calls of a particular
type, and second, a way to registere interest in types of ASM nodes.
In addition to the new visitor, this changeset rewrites a couple of
detectors to use the new dispatch approach (there are new detectors in
the pipeline which will also take advantage of this), and cleans up
handling of positions a bit.
Change-Id: Ib115bd3418b6c63bdcd49fec046e91a73daf38a9
Diffstat (limited to 'eclipse/scripts')
0 files changed, 0 insertions, 0 deletions