Index: src/x64/codegen-x64.cc |
diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc |
index dc999b5780b6711d58bcc75898b284b9651687f3..c8f1c04a6d7532d705eaa8b4df1b8df6808b0a32 100644 |
--- a/src/x64/codegen-x64.cc |
+++ b/src/x64/codegen-x64.cc |
@@ -8824,7 +8824,10 @@ ModuloFunction CreateModuloFunction() { |
CodeDesc desc; |
masm.GetCode(&desc); |
- // Call the function from C++. |
+ // Make sure that the compiled code is visible to all threads before |
+ // returning the pointer to it. |
+ MemoryBarrier(); |
+ // Call the function from C++ through this pointer. |
return FUNCTION_CAST<ModuloFunction>(buffer); |
} |