Age | Commit message (Collapse) | Author |
|
Use the same approach as we do for stackmaps to reduce the size.
It saves 4.0 MB from non-debuggable boot.oat (AOSP).
It does not affect debuggable boot.oat.
It saves 3.6 MB (of 96.6 MB) from /system/framework/arm/ (GOOG).
It saves 0.6 MB (of 26.7 MB) from /system/framework/oat/arm/ (GOOG).
Field loads from inline-info get around 5% slower.
(based on the time it takes to load all inline-infos from boot.oat)
Change-Id: I67b0fa5eef74c1fdb013680d0231fd44ea696176
|
|
Use only the minimum number of bits required to store stack map data.
For example, if native_pc needs 5 bits and dex_pc needs 3 bits, they
will share the first byte of the stack map entry.
The header is changed to store bit offsets of the fields rather than
byte sizes. Offsets also make it easier to access later fields without
calculating sum of all previous sizes.
All of the header fields are byte sized or encoded as ULEB128 instead
of the previous fixed size encoding. This shrinks it by about half.
It saves 3.6 MB from non-debuggable boot.oat (AOSP).
It saves 3.1 MB from debuggable boot.oat (AOSP).
It saves 2.8 MB (of 99.4 MB) from /system/framework/arm/ (GOOG).
It saves 1.0 MB (of 27.8 MB) from /system/framework/oat/arm/ (GOOG).
Field loads from stackmaps seem to get around 10% faster.
(based on the time it takes to load all stackmap entries from boot.oat)
Bug: 27640410
Change-Id: I8bf0996b4eb24300c1b0dfc6e9d99fe85d04a1b7
|
|
Read all stack map data back after we write it and DCHECK the content.
Change-Id: Ia679594ac9e5805f6d4c56686030af153b45ea8b
|
|
Allow passing ArenaAllocatorAdapter (or any other allocator)
to HashSet/HashMap and create appropriate Arena- aliases.
Use the ArenaHashMap in StackMapsStream.
Update arena allocator adapters' construct()/destroy() to
C++11 std::allocator<> API.
Change-Id: I18544f718f84c6d6580228dd35297daf7f6afb5e
|
|
Implement dchecked_vector<> template that DCHECK()s element
access and insert()/emplace()/erase() positions. Change the
ArenaVector<> and ScopedArenaVector<> aliases to use the new
template instead of std::vector<>. Remove DCHECK()s that
have now become unnecessary from the Optimizing compiler.
Change-Id: Ib8506bd30d223f68f52bd4476c76d9991acacadc
|
|
And completely remove the deprecated GrowableArray.
Replace GrowableArray with ArenaVector in code generators
and related classes and tag arena allocations.
Label arrays use direct allocations from ArenaAllocator
because Label is non-copyable and non-movable and as such
cannot be really held in a container. The GrowableArray
never actually constructed them, instead relying on the
zero-initialized storage from the arena allocator to be
correct. We now actually construct the labels.
Also avoid StackMapStream::ComputeDexRegisterMapSize() being
passed null references, even though unused.
Change-Id: I26a46fdd406b23a3969300a67739d55528df8bf4
|
|
Try to remove dependencies where they are not necessary.
Change-Id: I5ff35cb17aea369bed3725b1610b50d7eb05b81e
|
|
This reverts commit fbeb4aede0ddc5b1e6a5a3a40cc6266fe8518c98.
Adjust block label positions. Bad catch block labels were the
reason for the revert.
Change-Id: Ia6950d639d46b9da6b07f3ade63ab46d03d63310
|
|
This reverts commit f38caa68cce551fb153dff37d01db518e58ed00f.
Change-Id: Id88b82cc949d288cfcdb3c401b96f884b777fc40
Reason: broke the tests.
|
|
Change-Id: Iecc91418bb4ee1c957f42fefb737d0ee2ba960e7
|
|
Change-Id: I474f3a89f6c7ee5c7accd21791b1c1e311104158
|
|
Operations on CodeInfo and StackMap objects repeatedly read encoding
information from the MemoryRegion. Since these are 3-bit-loads of
values that never change, caching them can measurably reduce compile
times.
According to benchmarks, this patch saves 1-3% on armv7, 2-4% on x86,
and 0-1% on x64.
Change-Id: I46b197513601325d8bab562cc80100c00ec28a3b
|
|
This will be needed to recover the call stack.
Change-Id: I2fe10785eb1167939c8cce1862b2d7f4066e16ec
|
|
Change-Id: I9956091775cedc609fdae7dec1433fcb8858a477
|
|
- transform AddStackMapEntry into BeginStackMapEntry/EndStackMapEntry.
This allows for nicer code and less assumptions when searching for equal
dex register maps.
- store the components sizes and their start positions as fields to
avoid re-computation.
- store the current stack map entry as a field to avoid the copy
semantic when updating its value in the stack maps array.
- remove redundant methods and fix visibility for the remaining ones.
Change-Id: Ica2d2969d7e15993bdbf8bc41d9df083cddafd24
|
|
It's big enough now to separate the implementation from the header.
It also enables faster compilation time for experiments.
Change-Id: Ica0c72994d5e461c62c32628010f46f9e5c46b57
|
|
dex_register might be >= the width of the map hash. Shifting by that
value would be undefined behavior. Constrain the value to within the
valid range.
Change-Id: I9037c5c7ec554850ba3385585aca96fde1d50387
|
|
dex_pc, native_pc_offset, dex_register_map_offset, inline_info_offset,
and register_mask can now be encoded in 1, 2, 3, or 4 bytes.
Change-Id: I15f93e8226ce374204d44c5a80a9fd89bda2687c
|
|
- For each CodeInfo object (i.e. for each method), compute a
variable index size location catalog of unique Dex
register locations. In Dex register maps, instead of
storing the actual location of a (live) Dex register,
store the index of the location catalog entry containing
that Dex register location.
- Adjust art::StackMapStream,
art::CheckReferenceMapVisitor::CheckOptimizedMethod,
art::StackVisitor::GetVRegFromOptimizedCode, and
art::StackVisitor::SetVRegFromOptimizedCode.
- Add LoadBits and StoreBits methods to art::MemoryRegion
to load and store a block of adjacent bits in a memory
region.
- Update compiler/optimizing/stack_map_test.cc.
- Remove the default value for parameter EmptyFn of
art::HashMap. This default value did not seem to make
sense, as it would create an "empty function" for type Key
by default, whereas art::HashMap expects an "empty
function" for type std::pair<Key, Value>.
Change-Id: Id9e49d7756c253ce41c36630cd832208d06c2e28
|
|
If two stack maps have the same dex register map then one of them will
reference the register map from the other instead of owning an
independent copy.
This saves around 1.5% of space.
Change-Id: Ic2c2c81210c6c45a5c5f650f7ba82a46ff6f45e4
|
|
First step towards the compression of the StackMap (not
the DexRegisterMap). Next step will be to just use what is
needed (instead of byte -> word).
Change-Id: I4f81b2d05bf5cc508585e16fbbed1bafbc850e2e
|
|
Now that we can have a mix of Quick and Optimized code in an .oat
file, a CodeInfo object is not necessarily word aligned.
Change-Id: Ic6c5d1a2c6e20363436726a0708b0764b5a76caf
|
|
Change-Id: Id9aafcc13c1a085c17ce65d704c67b73f9de695d
|
|
- moved environment recording from code generator to stack map stream
- added creation/loading factory methods for the DexRegisterMap (hides
internal details)
- added new tests
Change-Id: Ic8b6d044f0d8255c6759c19a41df332ef37876fe
|
|
Instead of word-aligning every stack map region, as well as
the Dex register maps region of a CodeInfo object, just
align the whole CodeInfo region itself.
Change-Id: Ia35d213d2bd184729aa0d048874c76f7bc6da0f6
|
|
In art::StackMapStream::ComputeStackMapSize, compute the
size of a CodeInfo's stack maps region using the stack
mask size, not the maximum element of the stack mask.
Also, rename this method as
art::StackMapStream::ComputeStackMapsSize to make it clear
it that it covers all the stack maps of the CodeInfo item,
not just one stack map.
Change-Id: Icad21946dbca6e1ade2b82c9c2c535fdfed110a9
|
|
Plus some cosmetic changes.
Change-Id: I45e805aa87c2ef8fe8907eaae726cd2188b54897
|
|
- Replace the current list-based (fixed-size) Dex register
encoding in stack maps emitted by the optimizing compiler
with another list-based variable-size Dex register
encoding compressing short locations on 1 byte (3 bits for
the location kind, 5 bits for the value); other (large)
values remain encoded on 5 bytes.
- In addition, use slot offsets instead of byte offsets to
encode the location of Dex registers placed in stack
slots at small offsets, as it enables more values to use
the short (1-byte wide) encoding instead of the large
(5-byte wide) one.
- Rename art::DexRegisterMap::LocationKind as
art::DexRegisterLocation::Kind, turn it into a
strongly-typed enum based on a uint8_t, and extend it to
support new kinds (kInStackLargeOffset and
kConstantLargeValue).
- Move art::DexRegisterEntry from
compiler/optimizing/stack_map_stream.h to
runtime/stack_map.h and rename it as
art::DexRegisterLocation.
- Adjust art::StackMapStream,
art::CodeGenerator::RecordPcInfo,
art::CheckReferenceMapVisitor::CheckOptimizedMethod,
art::StackVisitor::GetVRegFromOptimizedCode, and
art::StackVisitor::SetVRegFromOptimizedCode.
- Implement unaligned memory accesses in art::MemoryRegion.
- Use them to manipulate data in Dex register maps.
- Adjust oatdump to support the new Dex register encoding.
- Update compiler/optimizing/stack_map_test.cc.
Change-Id: Icefaa2e2b36b3c80bb1b882fe7ea2f77ba85c505
|
|
A few elements are not displayed yet (stack mask, inline info) though.
Change-Id: I5e51a801c580169abc5d1ef43ad581aadc110754
|
|
With the recent move to gcc 4.9, we are hitting alignment
SIGBUS on ARM. The reason is that gcc will optimize two consecutive
32bits loads into one 64bits load, and the instruction (ldrd)
will fail if the data is not aligned.
Also removed the emission of mapping table when a method is optimized.
The information can be found in the StackMap itself.
Change-Id: Icf79406c18a3f4db3c05d52fc2c0dd2e35bf0f8f
|
|
Enable -Wno-conversion-null, -Wredundant-decls and -Wshadow in general,
and -Wunused-but-set-parameter for GCC builds.
Change-Id: I81bbdd762213444673c65d85edae594a523836e5
|
|
Don't do "if (ptr)". Use const. Use DISALLOW_COPY_AND_ASSIGN. Avoid public
member variables.
Move ValueObject to base and use in ELF builder.
Tidy VectorOutputStream to not use non-const reference arguments.
Change-Id: I2c727c3fc61769c3726de7cfb68b2d6eb4477e53
|
|
Now most of the methods supported by the compiler can be optimized,
instead of using the baseline.
Change-Id: I80ab36a34913fa4e7dd576c7bf55af63594dc1fa
|
|
Fixes stack_map_test.
Change-Id: Ibd6659b589ec595a7af21ad3d727c0ab2dceb45c
|
|
Encodes stack mask, register mask, dex register values, and inlining
info. The encoding is currently very straightforward: there is no
clever encoding, nor compression.
Change-Id: I5fd9ae28189a5513cd9e3c8d52c648463207643d
|