Skip to content

Commit 53831cf

Browse files
authored
flambda-backend: Enable Domain module fully on runtime5 (#2464)
1 parent a5c4719 commit 53831cf

File tree

5 files changed

+383
-265
lines changed

5 files changed

+383
-265
lines changed

asmcomp/amd64/emit.mlp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ let emit_instr env fallthrough i =
932932
I.movzx (res8 i 0) (res i 0)
933933
| Lop (Idls_get) ->
934934
if Config.runtime5
935-
then I.mov (domain_field Domainstate.Domain_dls_root) (res i 0)
935+
then I.mov (domain_field Domainstate.Domain_dls_root) (res i 0)
936936
else Misc.fatal_error "Idls_get not implemented in runtime4."
937937
| Lreloadretaddr ->
938938
()

middle_end/semantics_of_primitives.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ let for_primitive (prim : Clambda_primitives.primitive) =
160160
| Pget_header _ -> No_effects, No_coeffects
161161
| Pdls_get ->
162162
(* only read *)
163-
No_effects, No_coeffects
163+
No_effects, Has_coeffects
164164

165165
type return_type =
166166
| Float

runtime4/domain.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,40 @@ CAMLprim value caml_ml_condition_broadcast(value wrapper)
175175

176176
return (*caml_hook_condition_broadcast)(wrapper);
177177
}
178+
179+
/* Dummy implementations to enable [Stdlib.Domain] to link. */
180+
181+
CAMLprim value caml_recommended_domain_count(void)
182+
{
183+
caml_failwith("Domains not supported on runtime4");
184+
}
185+
186+
CAMLprim value caml_ml_domain_cpu_relax(void)
187+
{
188+
caml_failwith("Domains not supported on runtime4");
189+
}
190+
191+
CAMLprim value caml_init_domain_self(void)
192+
{
193+
caml_failwith("Domains not supported on runtime4");
194+
}
195+
196+
CAMLprim value caml_domain_spawn(void)
197+
{
198+
caml_failwith("Domains not supported on runtime4");
199+
}
200+
201+
CAMLprim value caml_ml_domain_id(void)
202+
{
203+
caml_failwith("Domains not supported on runtime4");
204+
}
205+
206+
CAMLprim value caml_domain_dls_set(void)
207+
{
208+
caml_failwith("Domains not supported on runtime4");
209+
}
210+
211+
CAMLprim value caml_domain_dls_get(void)
212+
{
213+
caml_failwith("Domains not supported on runtime4");
214+
}

0 commit comments

Comments
 (0)