aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/reduce.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-09-19 18:01:22 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-09-19 18:01:22 -0400
commit9f704b8c6e17c96c440fb3168a91c0bdb5cb845f (patch)
tree77bfe5975c8ff044f67ec2c59dd4857883e7d91f /src/reduce.sml
parentceeeb72da04265f1f12ee0e988aaba5dcb1c3060 (diff)
Paranoid inlining prevention for FFI types at the Core level; less paranoid inlining promotion for passive values at the Mono level
Diffstat (limited to 'src/reduce.sml')
-rw-r--r--src/reduce.sml7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/reduce.sml b/src/reduce.sml
index c5733b97..f065fe2b 100644
--- a/src/reduce.sml
+++ b/src/reduce.sml
@@ -247,6 +247,11 @@ fun passive (e : exp) =
| EField (e, _, _) => passive e
| _ => false
+fun notFfi (t : con) =
+ case #1 t of
+ CFfi _ => false
+ | _ => true
+
fun kindConAndExp (namedC, namedE) =
let
fun kind env (all as (k, loc)) =
@@ -793,7 +798,7 @@ fun kindConAndExp (namedC, namedE) =
val t = con env t
in
- if passive e1' orelse count e2 <= 1 orelse ESpecialize.functionInside t then
+ if notFfi t andalso (passive e1' orelse count e2 <= 1 orelse ESpecialize.functionInside t) then
exp (KnownE e1 :: env) e2
else
(ELet (x, t, e1', exp (UnknownE :: env) e2), loc)