summaryrefslogtreecommitdiffstats
path: root/src/oat_writer.h
diff options
context:
space:
mode:
authorjeffhao <jeffhao@google.com>2011-11-02 11:41:50 -0700
committerjeffhao <jeffhao@google.com>2011-11-02 11:41:50 -0700
commit55d782146917f9afabc98aedcab4b5874a74e55c (patch)
tree6e03f3465d504c4cd33f3f66b3ba0b548ad94368 /src/oat_writer.h
parent5d76c435082332ef79a22962386fa92a0870e378 (diff)
downloadart-55d782146917f9afabc98aedcab4b5874a74e55c.zip
art-55d782146917f9afabc98aedcab4b5874a74e55c.tar.gz
art-55d782146917f9afabc98aedcab4b5874a74e55c.tar.bz2
Added code deduplication to the oat writer.
The oat writer will reuse indexes if the code, invoke stubs, mapping tables, or vmap tables are exactly the same. This reduces the code size of the generated oat file. Change-Id: I926b1eb0a6f3d11bc14f08b0c63c89dd0bd26e2a
Diffstat (limited to 'src/oat_writer.h')
-rw-r--r--src/oat_writer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/oat_writer.h b/src/oat_writer.h
index 858a208..b8a8b47 100644
--- a/src/oat_writer.h
+++ b/src/oat_writer.h
@@ -154,6 +154,11 @@ class OatWriter {
std::vector<OatMethods*> oat_methods_;
uint32_t executable_offset_padding_length_;
+ // code mappings for deduplication
+ std::map<std::vector<uint8_t>, uint32_t> code_offsets_;
+ std::map<std::vector<uint16_t>, uint32_t> vmap_table_offsets_;
+ std::map<std::vector<uint32_t>, uint32_t> mapping_table_offsets_;
+
DISALLOW_COPY_AND_ASSIGN(OatWriter);
};