[arm] Share embedded object constant pool entries

This change reduces accumulated constant pool size on
Octane2.1 from 296kb (74170 32bit words) to 125 kb (31311
32bit words), a 57.7% reduction.

Bug: v8:8054

Change-Id: I7d6f24dadf9e11b49d028df10970fd0bc6229ad6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1672932
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62328}
This commit is contained in:
Sigurd Schneider 2019-06-24 10:56:09 +02:00 committed by Commit Bot
parent 6ddbb54fc2
commit b6607eecb0

View File

@ -4827,12 +4827,13 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
void Assembler::ConstantPoolAddEntry(int position, RelocInfo::Mode rmode,
intptr_t value) {
DCHECK(rmode != RelocInfo::CONST_POOL);
// We can share CODE_TARGETs because we don't patch the code objects anymore,
// and we make sure we emit only one reloc info for them (thus delta patching)
// will apply the delta only once. At the moment, we do not dedup code targets
// if they are wrapped in a heap object request (value == 0).
// We can share CODE_TARGETs and embedded objects, but we must make sure we
// only emit one reloc info for them (thus delta patching will apply the delta
// only once). At the moment, we do not deduplicate heap object request which
// are indicated by value == 0.
bool sharing_ok = RelocInfo::IsShareableRelocMode(rmode) ||
(rmode == RelocInfo::CODE_TARGET && value != 0);
(rmode == RelocInfo::CODE_TARGET && value != 0) ||
(RelocInfo::IsEmbeddedObjectMode(rmode) && value != 0);
DCHECK_LT(pending_32_bit_constants_.size(), kMaxNumPending32Constants);
if (pending_32_bit_constants_.empty()) {
first_const_pool_32_use_ = position;