aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/c-util.boot2
-rw-r--r--src/interp/define.boot6
-rw-r--r--src/interp/sys-driver.boot3
-rw-r--r--src/interp/sys-globals.boot7
4 files changed, 14 insertions, 4 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 34fee8df..45afea96 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1146,6 +1146,8 @@ setCompilerOptimizations level ==
$optReplaceSimpleFunctions := true
if level > 1 then
$optExportedFunctionReference := true
+ if level > 2 then
+ $optimizeRep := true
coreError '"unknown optimization level request"
diff --git a/src/interp/define.boot b/src/interp/define.boot
index e50aee3b..d25302e8 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -1443,8 +1443,10 @@ doIt(item,$predl) ==
$functorLocalParameters:= [:$functorLocalParameters,lhs]
if code is ["%LET",.,rhs',:.] and isDomainForm(rhs',$e) then
if lhs="Rep" then
- $Representation:= getRepresentation $e
- --$Representation bound by compDefineFunctor, used in compNoStacking
+ --$Representation bound by compDefineFunctor, used in compNoStacking
+ $Representation := getRepresentation $e
+ if $optimizeRep then
+ nominateForInlining $Representation
code is ["%LET",:.] =>
RPLACA(item,"setShellEntry")
rhsCode := rhs'
diff --git a/src/interp/sys-driver.boot b/src/interp/sys-driver.boot
index de08b540..1e6771d0 100644
--- a/src/interp/sys-driver.boot
+++ b/src/interp/sys-driver.boot
@@ -1,4 +1,4 @@
--- Copyright (C) 2007-2009 Gabriel Dos Reis
+-- Copyright (C) 2007-2010 Gabriel Dos Reis
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -193,6 +193,7 @@ initializeGlobalState() ==
$compileExportsOnly := getOptionValue "exports-only"
$compileDefaultsOnly := getOptionValue "defaults-only"
$reportOptimization := getOptionValue "show-insn"
+ $optimizeRep := getOptionValue "inline-rep"
setCompilerOptimizations(getOptionValue "optimize" or
$defaultOptimizationLevel)
GCMSG(NIL)
diff --git a/src/interp/sys-globals.boot b/src/interp/sys-globals.boot
index d73e5234..d2a756a7 100644
--- a/src/interp/sys-globals.boot
+++ b/src/interp/sys-globals.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2008, Gabriel Dos Reis.
+-- Copyright (C) 2007-2010, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -490,5 +490,10 @@ $compileExportsOnly := false
++ compiling categories.
$compileDefaultsOnly := false
+++ True if we should consider the representation domain (`Rep')
+++ as candidate for inlining, for the purpose of reducing
+++ abstraction penalty.
+$optimizeRep := false
+
++
$leanMode := false