Skip to content

Commit

Permalink
Merged: Avoid compiler/LTO bug on arm
Browse files Browse the repository at this point in the history
Merged: [wasm] Try to avoid LTO bug on arm
Revision: 241294fe186c126cfcc3d9bf99023b808daf7701

Merged: cpu-arm: Add noinline to cache flushing logic
Revision: e0e36ba0791624db71b92ee1bcaa3d02b6c0ab01

BUG=chromium:952759
LOG=N
NOTRY=true
NOPRESUBMIT=true
NOTREECHECKS=true
R=jkummerow@chromium.org

Change-Id: I15357d13a9609c1b82fa1108330b36c4bd7a95fe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588463
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/branch-heads/7.5@{#12}
Cr-Branched-From: 35b9bf5-refs/heads/7.5.288@{#1}
Cr-Branched-From: 912b391-refs/heads/master@{#60911}
  • Loading branch information
backes authored and Commit Bot committed Apr 30, 2019
1 parent 79c70dd commit e03f1f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/arm/cpu-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
namespace v8 {
namespace internal {

void CpuFeatures::FlushICache(void* start, size_t size) {
// The inlining of this seems to trigger an LTO bug that clobbers a register on
// arm, see https://crbug.com/952759#c6.
__attribute__((noinline)) void CpuFeatures::FlushICache(void* start,
size_t size) {
#if !defined(USE_SIMULATOR)
#if V8_OS_QNX
msync(start, size, MS_SYNC | MS_INVALIDATE_ICACHE);
Expand Down
8 changes: 5 additions & 3 deletions src/wasm/wasm-code-manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -718,9 +718,6 @@ std::unique_ptr<WasmCode> NativeModule::AddCodeWithCodeSpace(
}
}

// Flush the i-cache after relocation.
FlushInstructionCache(dst_code_bytes.start(), dst_code_bytes.size());

std::unique_ptr<WasmCode> code{new WasmCode{
this, index, dst_code_bytes, stack_slots, tagged_parameter_slots,
safepoint_table_offset, handler_table_offset, constant_pool_offset,
Expand All @@ -731,6 +728,11 @@ std::unique_ptr<WasmCode> NativeModule::AddCodeWithCodeSpace(

code->RegisterTrapHandlerData();

// Flush the i-cache for the region holding the relocated code.
// Do this last, as this seems to trigger an LTO bug that clobbers a register
// on arm, see https://crbug.com/952759#c6.
FlushInstructionCache(dst_code_bytes.start(), dst_code_bytes.size());

return code;
}

Expand Down

0 comments on commit e03f1f8

Please sign in to comment.