From 81c7659360a156fd34c0a4dd9ed3c3ece2a0f678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Thu, 23 Jul 2015 10:08:10 +0200 Subject: [PATCH] compiler.cfg.instructions: rename ##allocation to allocation-insn, because it's nicer if all instruction unions have the -insn suffix and the ## prefix is reserved for tuples --- basis/compiler/cfg/alias-analysis/alias-analysis.factor | 2 +- basis/compiler/cfg/gc-checks/gc-checks.factor | 6 +++--- basis/compiler/cfg/instructions/instructions-docs.factor | 6 +++++- basis/compiler/cfg/instructions/instructions.factor | 8 ++++---- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/basis/compiler/cfg/alias-analysis/alias-analysis.factor b/basis/compiler/cfg/alias-analysis/alias-analysis.factor index b12014e60e..1cf8f5f83f 100644 --- a/basis/compiler/cfg/alias-analysis/alias-analysis.factor +++ b/basis/compiler/cfg/alias-analysis/alias-analysis.factor @@ -171,7 +171,7 @@ M: insn analyze-aliases ; M: vreg-insn analyze-aliases def-acs ; -M: ##allocation analyze-aliases +M: allocation-insn analyze-aliases #! A freshly allocated object is distinct from any other #! object. dup dst>> set-new-ac ; diff --git a/basis/compiler/cfg/gc-checks/gc-checks.factor b/basis/compiler/cfg/gc-checks/gc-checks.factor index cc31e74eda..1bed3c2bea 100644 --- a/basis/compiler/cfg/gc-checks/gc-checks.factor +++ b/basis/compiler/cfg/gc-checks/gc-checks.factor @@ -11,7 +11,7 @@ IN: compiler.cfg.gc-checks : insert-gc-check? ( bb -- ? ) dup kill-block?>> - [ drop f ] [ instructions>> [ ##allocation? ] any? ] if ; + [ drop f ] [ instructions>> [ allocation-insn? ] any? ] if ; : blocks-with-gc ( cfg -- bbs ) post-order [ insert-gc-check? ] filter ; @@ -25,7 +25,7 @@ GENERIC# gc-check-offsets* 1 ( call-index seen-allocation? insn n -- call-index M: ##callback-inputs gc-check-offsets* gc-check-here ; M: ##phi gc-check-offsets* gc-check-here ; M: gc-map-insn gc-check-offsets* gc-check-here ; -M: ##allocation gc-check-offsets* 3drop t ; +M: allocation-insn gc-check-offsets* 3drop t ; M: insn gc-check-offsets* 2drop ; : gc-check-offsets ( insns -- seq ) @@ -53,7 +53,7 @@ M: ##box-alien allocation-size* drop 5 cells ; M: ##box-displaced-alien allocation-size* drop 5 cells ; : allocation-size ( insns -- n ) - [ ##allocation? ] filter + [ allocation-insn? ] filter [ allocation-size* data-alignment get align ] map-sum ; : add-gc-checks ( insns-seq -- ) diff --git a/basis/compiler/cfg/instructions/instructions-docs.factor b/basis/compiler/cfg/instructions/instructions-docs.factor index b5dc550655..defe3e10cc 100644 --- a/basis/compiler/cfg/instructions/instructions-docs.factor +++ b/basis/compiler/cfg/instructions/instructions-docs.factor @@ -260,6 +260,9 @@ HELP: ##write-barrier HELP: alien-call-insn { $class-description "Union class of all alien call instructions." } ; +HELP: allocation-insn +{ $class-description "Union class of all instructions that allocate memory." } ; + HELP: def-is-use-insn { $class-description "Union class of instructions that have complex expansions and require that the output registers are not equal to any of the input registers." } ; @@ -336,7 +339,6 @@ $nl ##box-long-long ##callback-inputs ##callback-outputs - ##local-allot ##unbox ##unbox-alien ##unbox-any-c-ptr @@ -348,6 +350,8 @@ $nl ##allot ##call-gc ##check-nursery-branch + ##local-allot + allocation-insn gc-map gc-map-insn diff --git a/basis/compiler/cfg/instructions/instructions.factor b/basis/compiler/cfg/instructions/instructions.factor index 1c445605d2..a2eb8ec8f7 100644 --- a/basis/compiler/cfg/instructions/instructions.factor +++ b/basis/compiler/cfg/instructions/instructions.factor @@ -813,10 +813,10 @@ VREG-INSN: ##reload def: dst literal: rep src ; -UNION: ##allocation -##allot -##box-alien -##box-displaced-alien ; +UNION: allocation-insn + ##allot + ##box-alien + ##box-displaced-alien ; UNION: conditional-branch-insn ##compare-branch