Skip to content

Commit

Permalink
[feat] Ensure instruction stream synchronisation
Browse files Browse the repository at this point in the history
Add calls to cleanCache after code installation.
  • Loading branch information
timhartley committed Nov 28, 2019
1 parent 3a68a94 commit 7f0e93a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion com.sun.max/src/com/sun/max/vm/compiler/target/Stub.java
Expand Up @@ -180,8 +180,9 @@ public Stub(Type type, String stubName, int frameSize, byte[] code, int callPos,
}
if (!isHosted()) {
linkDirectCalls();
// Perform cache maintenance after linking calls to ensure visibility of fixed call-sites.
if (platform().target.arch.isARM() || platform().target.arch.isAarch64() || platform().target.arch.isRISCV64()) {
MaxineVM.maxine_cache_flush(codeStart().toPointer(), code().length);
cleanCache();
}
}
}
Expand All @@ -200,6 +201,7 @@ public Stub(Type type, String name, CiTargetMethod tm) {
for (CiDebugInfo info : debugInfos) {
assert info == null;
}
cleanCache();
}

@Override
Expand Down

0 comments on commit 7f0e93a

Please sign in to comment.