aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-03-05 02:09:51 +0000
committerdos-reis <gdr@axiomatics.org>2010-03-05 02:09:51 +0000
commitf1c8a8db20dce5e74796e409d5bc7bec2d8793d5 (patch)
treee6d6ba7f4fc22135395dfad949ebd50954ad152d /src/interp
parent82eaa6d96dbadd85f23913a80f163544517af5b0 (diff)
downloadopen-axiom-f1c8a8db20dce5e74796e409d5bc7bec2d8793d5.tar.gz
* interp/sys-globals.boot ($optimizeRep): Define.
* interp/sys-driver.boot (initializeGlobalState): Sey domain representation inlining if requested. * interp/c-util.boot (setCompilerOptimizations): Set domain representation inlining if at optimization level 3. * algebra/constant.spad.pamphlet (AlgebraicNumber): Remove assignment to Rep. Tidy. * algebra/Makefile.pamphlet: Add dependencies.
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