Commit e0447f99 authored by Mircea Trofin's avatar Mircea Trofin Committed by Commit Bot

[wasm] Flush the instruction cache on the WasmCodeManager

Flush the icache after JIT-ing using the WasmCodeManager. Also, re-enable
tests that were previously failing on Linux ARM.

Bug: v8:7138
Change-Id: I8e18b80dba58df173a2360f8ac365ee5daaf3239
Reviewed-on: https://chromium-review.googlesource.com/802961
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49800}
parent 2b14a3f7
......@@ -290,6 +290,9 @@ WasmCode* NativeModule::AddOwnedCode(
auto insert_before = std::upper_bound(owned_code_.begin(), owned_code_.end(),
code, owned_code_comparer_);
owned_code_.insert(insert_before, std::move(code));
wasm_code_manager_->FlushICache(ret->instructions().start(),
ret->instructions().size());
return ret;
}
......@@ -904,6 +907,11 @@ intptr_t WasmCodeManager::remaining_uncommitted() const {
return remaining_uncommitted_.Value();
}
void WasmCodeManager::FlushICache(Address start, size_t size) {
Assembler::FlushICache(reinterpret_cast<internal::Isolate*>(isolate_), start,
size);
}
} // namespace wasm
} // namespace internal
} // namespace v8
......
......@@ -361,6 +361,10 @@ class V8_EXPORT_PRIVATE WasmCodeManager final {
WasmCode* GetCodeFromStartAddress(Address pc) const;
intptr_t remaining_uncommitted() const;
// TODO(mtrofin): replace this API with an alternative that is Isolate-
// independent.
void FlushICache(Address start, size_t size);
private:
friend class NativeModule;
......@@ -383,6 +387,8 @@ class V8_EXPORT_PRIVATE WasmCodeManager final {
// worth requesting a GC on memory pressure.
size_t active_ = 0;
base::AtomicNumber<intptr_t> remaining_uncommitted_;
// TODO(mtrofin): remove the dependency on isolate.
v8::Isolate* isolate_;
};
......
......@@ -385,10 +385,4 @@
'test-dtoa/*': [SKIP],
}], # variant == wasm_traps
##############################################################################
# BUG(v8:7138).
['arch == arm and not simulator_run and variant == wasm_traps', {
'*': [SKIP],
}], # arch == arm and not simulator_run and variant == wasm_traps
]
......@@ -36,10 +36,4 @@
# tested standalone.
'fail/modules-skip*': [SKIP],
}], # ALWAYS
##############################################################################
# BUG(v8:7138).
['arch == arm and not simulator_run and variant == wasm_traps', {
'*': [SKIP],
}], # arch == arm and not simulator_run and variant == wasm_traps
]
......@@ -744,12 +744,6 @@
'wasm/liftoff': [SKIP],
}], # arch != x64 and arch != ia32
##############################################################################
# BUG(v8:7138).
['arch == arm and not simulator_run and variant == wasm_traps', {
'*': [SKIP],
}], # arch == arm and not simulator_run and variant == wasm_traps
##############################################################################
['variant == liftoff', {
# In the liftoff variant, liftoff compilation happens even though the test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment