Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Issue 284153004: Avoid flushing the icache unnecessarily when updating target addresses in code. (Closed)

Created:
6 years, 7 months ago by rmcilroy
Modified:
6 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Avoid flushing the icache unnecessarily when updating target addresses in code. This CL updates RelocInfo update operations and set_target_address_at to enable skipping of the icache flush if it going to be batched up later. Code::CopyFrom and Code::Relocate are modified to avoid individual icache flushes since the whole code area will be flushed after the reloc info is updated. These changes reduce a regression when enabling the OOL constant pool on Arm, since this change can cause MovT/MovW instructions for relocatable targets if the constant pool is full. Scores for Mandreel latency on a Nexus 5: - OOL CP disabled: 3533 - OOL CP enabled, without this CL: 1825 - OOL CP enabled, with change: 3015 R=rodolph.perfetta@arm.com, ulan@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=21380

Patch Set 1 #

Total comments: 3

Patch Set 2 : Only skip icache flush on IC updates which can be made atomically. #

Total comments: 3

Patch Set 3 : Update SKIP_ICACHE_FLUSH_IF_ATOMIC to only skip when patching a single instruction. #

Total comments: 2

Patch Set 4 : Remove IC atomic skipICache, and implement for other arches #

Total comments: 4

Patch Set 5 : Fix intenting #

Unified diffs Side-by-side diffs Delta from patch set Stats (+207 lines, -101 lines) Patch
M src/arm/assembler-arm.h View 1 2 3 4 1 chunk +7 lines, -3 lines 0 comments Download
M src/arm/assembler-arm-inl.h View 1 2 3 7 chunks +36 lines, -22 lines 0 comments Download
M src/arm64/assembler-arm64.h View 1 2 3 1 chunk +6 lines, -2 lines 0 comments Download
M src/arm64/assembler-arm64-inl.h View 1 2 3 7 chunks +28 lines, -14 lines 0 comments Download
M src/assembler.h View 1 2 3 4 chunks +28 lines, -8 lines 0 comments Download
M src/ia32/assembler-ia32.h View 1 2 3 4 1 chunk +6 lines, -2 lines 0 comments Download
M src/ia32/assembler-ia32-inl.h View 1 2 3 7 chunks +41 lines, -21 lines 0 comments Download
M src/objects.cc View 1 2 3 2 chunks +9 lines, -7 lines 0 comments Download
M src/x64/assembler-x64.h View 1 2 3 4 1 chunk +7 lines, -3 lines 0 comments Download
M src/x64/assembler-x64-inl.h View 1 2 3 7 chunks +39 lines, -19 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
rmcilroy
With this change, the OOL constant pool regressions go away, so I should be able ...
6 years, 7 months ago (2014-05-15 17:35:02 UTC) #1
ulan
https://codereview.chromium.org/284153004/diff/1/src/ic.cc File src/ic.cc (right): https://codereview.chromium.org/284153004/diff/1/src/ic.cc#newcode866 src/ic.cc:866: set_target(*pre_monomorphic_stub(), SKIP_ICACHE_FLUSH); I am not sure whether this is ...
6 years, 7 months ago (2014-05-16 08:38:48 UTC) #2
rmcilroy
+Rodolph https://codereview.chromium.org/284153004/diff/1/src/ic.cc File src/ic.cc (right): https://codereview.chromium.org/284153004/diff/1/src/ic.cc#newcode866 src/ic.cc:866: set_target(*pre_monomorphic_stub(), SKIP_ICACHE_FLUSH); On 2014/05/16 08:38:48, ulan wrote: > ...
6 years, 7 months ago (2014-05-16 13:51:31 UTC) #3
Rodolph Perfetta (ARM)
https://codereview.chromium.org/284153004/diff/20001/src/arm/assembler-arm-inl.h File src/arm/assembler-arm-inl.h (right): https://codereview.chromium.org/284153004/diff/20001/src/arm/assembler-arm-inl.h#newcode543 src/arm/assembler-arm-inl.h:543: MemoryBarrier(); Instruction prefetching is implementation defined so what you ...
6 years, 7 months ago (2014-05-16 16:02:28 UTC) #4
rmcilroy
https://codereview.chromium.org/284153004/diff/20001/src/arm/assembler-arm-inl.h File src/arm/assembler-arm-inl.h (right): https://codereview.chromium.org/284153004/diff/20001/src/arm/assembler-arm-inl.h#newcode543 src/arm/assembler-arm-inl.h:543: MemoryBarrier(); On 2014/05/16 16:02:29, Rodolph Perfetta (ARM) wrote: > ...
6 years, 7 months ago (2014-05-16 16:15:43 UTC) #5
Rodolph Perfetta (ARM)
https://codereview.chromium.org/284153004/diff/20001/src/arm/assembler-arm-inl.h File src/arm/assembler-arm-inl.h (right): https://codereview.chromium.org/284153004/diff/20001/src/arm/assembler-arm-inl.h#newcode543 src/arm/assembler-arm-inl.h:543: MemoryBarrier(); > How about if we only need to ...
6 years, 7 months ago (2014-05-16 16:31:56 UTC) #6
rmcilroy
On 2014/05/16 16:31:56, Rodolph Perfetta (ARM) wrote: > https://codereview.chromium.org/284153004/diff/20001/src/arm/assembler-arm-inl.h > File src/arm/assembler-arm-inl.h (right): > > ...
6 years, 7 months ago (2014-05-19 11:00:26 UTC) #7
ulan
Ross, how much does "skip if atomic" improve the benchmark? > OOL CP enabled, with ...
6 years, 7 months ago (2014-05-19 11:42:51 UTC) #8
Rodolph Perfetta
On 2014/05/19 11:42:51, ulan wrote: > Ross, how much does "skip if atomic" improve the ...
6 years, 7 months ago (2014-05-19 12:35:20 UTC) #9
Rodolph Perfetta
https://codereview.chromium.org/284153004/diff/40001/src/arm/assembler-arm-inl.h File src/arm/assembler-arm-inl.h (right): https://codereview.chromium.org/284153004/diff/40001/src/arm/assembler-arm-inl.h#newcode513 src/arm/assembler-arm-inl.h:513: static uint32_t ExtractMovwImmediate(Instr instruction) { the Instruction class has ...
6 years, 7 months ago (2014-05-19 12:38:38 UTC) #10
rmcilroy
Updated to remove skipping during IC updates as discussed offline. Also added other architectures and ...
6 years, 7 months ago (2014-05-19 16:52:15 UTC) #11
ulan
Thank you, lgtm. https://codereview.chromium.org/284153004/diff/60001/src/arm/assembler-arm.h File src/arm/assembler-arm.h (right): https://codereview.chromium.org/284153004/diff/60001/src/arm/assembler-arm.h#newcode768 src/arm/assembler-arm.h:768: FLUSH_ICACHE_IF_NEEDED)); Nit: 4 space identation here ...
6 years, 7 months ago (2014-05-20 08:16:33 UTC) #12
Rodolph Perfetta (ARM)
lgtm
6 years, 7 months ago (2014-05-20 08:51:10 UTC) #13
rmcilroy
https://codereview.chromium.org/284153004/diff/60001/src/arm/assembler-arm.h File src/arm/assembler-arm.h (right): https://codereview.chromium.org/284153004/diff/60001/src/arm/assembler-arm.h#newcode768 src/arm/assembler-arm.h:768: FLUSH_ICACHE_IF_NEEDED)); On 2014/05/20 08:16:34, ulan wrote: > Nit: 4 ...
6 years, 7 months ago (2014-05-20 09:21:03 UTC) #14
rmcilroy
6 years, 7 months ago (2014-05-20 09:22:05 UTC) #15
Message was sent while issue was closed.
Committed patchset #5 manually as r21380 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698