]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler: add ##safepoint IR insn
authorJoe Groff <arcata@gmail.com>
Tue, 18 Oct 2011 05:43:19 +0000 (22:43 -0700)
committerJoe Groff <arcata@gmail.com>
Fri, 28 Oct 2011 04:14:46 +0000 (21:14 -0700)
basis/compiler/cfg/instructions/instructions.factor
basis/compiler/cfg/scheduling/scheduling.factor
basis/compiler/codegen/codegen.factor
basis/cpu/architecture/architecture.factor
basis/cpu/x86/32/32.factor
basis/cpu/x86/64/64.factor

index 29d9f4a5fd544ce71377ebd80033d7c97001a7d6..812e206c958c6843b6d61099fa40be39141c2288 100644 (file)
@@ -84,6 +84,8 @@ INSN: ##epilogue ;
 
 INSN: ##return ;
 
+INSN: ##safepoint ;
+
 ! Dummy instruction that simply inhibits TCO
 INSN: ##no-tco ;
 
index 68effe02f510d81783568a6e78734836f94f9db3..05c738d8fd0472a7b141c80a9d50bde25cfae260 100644 (file)
@@ -57,6 +57,7 @@ UNION: final-insn
 ##branch
 ##dispatch
 conditional-branch-insn
+##safepoint
 ##epilogue ##return
 ##callback-outputs ;
 
index 53fdb458c6a89a2632a0a96c57ee8f24f19913b9..3434085685fc00d30efbca912add888bc93b153e 100755 (executable)
@@ -160,6 +160,7 @@ CODEGEN: ##inc-r %inc-r
 CODEGEN: ##call %call
 CODEGEN: ##jump %jump
 CODEGEN: ##return %return
+CODEGEN: ##safepoint %safepoint
 CODEGEN: ##slot %slot
 CODEGEN: ##slot-imm %slot-imm
 CODEGEN: ##set-slot %set-slot
index 265bb8894e3029ab1c50392b798b9be60b788559..561787e2ba01d5cff461c162eb530c85e09734c0 100644 (file)
@@ -495,6 +495,8 @@ HOOK: %call-gc cpu ( gc-map -- )
 HOOK: %prologue cpu ( n -- )
 HOOK: %epilogue cpu ( n -- )
 
+HOOK: %safepoint cpu ( -- )
+
 HOOK: test-instruction? cpu ( -- ? )
 
 M: object test-instruction? f ;
index d12d16181dbb251019cb52a826cb58815ebe04db..eba669b909ea5c49a31169b213b492602a79b127 100755 (executable)
@@ -218,6 +218,9 @@ M:: x86.32 stack-cleanup ( stack-size return abi -- n )
 M: x86.32 %cleanup ( n -- )
     [ ESP swap SUB ] unless-zero ;
 
+M: x86.32 %safepoint
+    0 EAX MOVABS rc-absolute rel-safepoint ;
+
 M: x86.32 dummy-stack-params? f ;
 
 M: x86.32 dummy-int-params? f ;
index b675107bce4e0991091b999a0bae99efb27ed6c5..c7ef46aac2aac9f2c729cbea1921159d69672e92 100644 (file)
@@ -130,6 +130,9 @@ M: x86.64 stack-cleanup 3drop 0 ;
 
 M: x86.64 %cleanup 0 assert= ;
 
+M: x86.64 %safepoint
+    0 [RIP+] EAX MOV rc-relative rel-safepoint ;
+
 M: x86.64 long-long-on-stack? f ;
 
 M: x86.64 float-on-stack? f ;