未验证 提交 b2add498 编写于 作者: Z Zoltan Varga 提交者: GitHub

[mono][wasm] Add a 'wasm-gc-safepoints' option to enable the generation of GC...

[mono][wasm] Add a 'wasm-gc-safepoints' option to enable the generation of GC safe points in AOTed code on WASM. (#70520)
上级 c3618578
......@@ -11831,7 +11831,7 @@ emit_method_inner (EmitContext *ctx)
}
ctx->has_safepoints = requires_safepoint;
if (!cfg->llvm_only && mono_threads_are_safepoints_enabled () && requires_safepoint) {
if (requires_safepoint && mini_safepoints_enabled ()) {
if (!cfg->compile_aot) {
LLVMSetGC (method, "coreclr");
emit_gc_safepoint_poll (ctx->module, ctx->lmodule, cfg);
......
......@@ -41,6 +41,7 @@
#include <mono/utils/mono-conc-hashtable.h>
#include <mono/utils/mono-signal-handler.h>
#include <mono/utils/ftnptr.h>
#include <mono/utils/options.h>
#include <mono/metadata/icalls.h>
// Forward declare so that mini-*.h can have pointers to them.
......@@ -2931,7 +2932,7 @@ static inline gboolean
mini_safepoints_enabled (void)
{
#if defined (TARGET_WASM)
return FALSE;
return mono_opt_wasm_gc_safepoints;
#else
return TRUE;
#endif
......
......@@ -57,7 +57,8 @@ DEFINE_BOOL_READONLY(readonly_flag, "readonly-flag", FALSE, "Example")
#endif
*/
DEFINE_BOOL(wasm_exceptions, "wasm-exceptions", FALSE, "Enable codegen for wasm exceptions")
DEFINE_BOOL(wasm_exceptions, "wasm-exceptions", FALSE, "Enable codegen for WASM exceptions")
DEFINE_BOOL(wasm_gc_safepoints, "wasm-gc-safepoints", FALSE, "Use GC safepoints on WASM")
DEFINE_BOOL(aot_lazy_assembly_load, "aot-lazy-assembly-load", FALSE, "Load assemblies referenced by AOT images lazily")
/* Cleanup */
......
......@@ -531,6 +531,7 @@
<MonoAOTCompilerDefaultAotArguments Include="deterministic" />
<MonoAOTCompilerDefaultAotArguments Include="mattr=simd" Condition="'$(WasmSIMD)' == 'true'" />
<MonoAOTCompilerDefaultProcessArguments Include="--wasm-exceptions" Condition="'$(WasmExceptionHandling)' == 'true'" />
<MonoAOTCompilerDefaultProcessArguments Include="--wasm-gc-safepoints" Condition="'$(WasmEnableThreads)' == 'true' or '$(WasmEnablePerfTracing)' == 'true'" />
<AotProfilePath Include="$(WasmAotProfilePath)"/>
</ItemGroup>
<ItemGroup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册