Skip to content

Commit

Permalink
dfmc-llvm-back-end: Access the TEB via call in interactive mode
Browse files Browse the repository at this point in the history
* sources/dfmc/llvm-back-end/llvm-primitives-thread.dylan
  (op--teb on <llvm-back-end>): In interactive mode, generate the
   Thread Environment Block address by calling the dylan-teb auxiliary
   primitive rather than accessing the its thread-local storage
   directly.
  • Loading branch information
housel committed Jul 26, 2024
1 parent 3542296 commit b30118b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sources/dfmc/llvm-back-end/llvm-primitives-thread.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,15 @@ define runtime-variable %teb-chain :: <raw-address>
define method op--teb
(be :: <llvm-back-end>) => (teb :: <llvm-value>);
let module = be.llvm-builder-module;
llvm-runtime-variable(be, module, %teb-descriptor)
let teb-var = llvm-runtime-variable(be, module, %teb-descriptor);
if (*interactive-mode?*)
// The interactive downloader currently can't handle linking
// thread-local storage, so we emit a call to the run-time
let tebp = call-primitive(be, dylan-teb-descriptor);
ins--bitcast(be, tebp, teb-var.llvm-value-type)
else
teb-var
end if
end method;

define method op--teb
Expand Down

0 comments on commit b30118b

Please sign in to comment.