From ad0d0633aa1350f3d9cb0b6b31c77773053958b3 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Thu, 9 Feb 2012 01:39:19 +0000 Subject: * interp/g-opt.boot (optCall): Simplify SPADCALL of atomic function expressions. ($VMsideEffectFreeOperators): Don't include %funcall. ($simpleVMoperators): Include it. --- src/interp/g-opt.boot | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/interp/g-opt.boot') diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index ef5b6a51..0051997d 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -1,6 +1,6 @@ -- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007-2011, Gabriel Dos Reis. +-- Copyright (C) 2007-2012, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -536,8 +536,12 @@ optCall (x is ['%call,:u]) == opt := fn has OPTIMIZE => resetTo(x,FUNCALL(opt,u)) resetTo(x,u) fn is ['applyFun,name] => - x.first := 'SPADCALL - x.rest := [:a,name] + do + ident? name => + x.first := '%funcall + x.rest := [['%head,name],:a,['%tail,name]] + x.first := 'SPADCALL + x.rest := [:a,name] x fn is ['%pair,['%function,op],env] => x.first := op @@ -617,7 +621,7 @@ optSuchthat [.,:u] == ["SUCHTHAT",:u] ++ List of VM side effect free operators. $VMsideEffectFreeOperators == '(SPADfirst ASH FLOAT FLOAT_-SIGN %function %nullStream %nonNullStream - %funcall %nothing %when %false %true %otherwise %2bit %2bool + %nothing %when %false %true %otherwise %2bit %2bool %and %or %not %peq %ieq %ilt %ile %igt %ige %head %tail %integer? %beq %blt %ble %bgt %bge %bitand %bitior %bitxor %bitnot %bcompl %ilength %ibit %icst0 %icst1 %icstmin %icstmax @@ -649,7 +653,7 @@ $VMsideEffectFreeOperators == ++ List of simple VM operators $simpleVMoperators == [:$VMsideEffectFreeOperators, - :['SPADCALL,'%apply, '%gensym, '%lreverse!, '%strstc]] + :['SPADCALL,'%apply, '%funcall, '%gensym, '%lreverse!, '%strstc]] ++ Return true if the `form' is semi-simple with respect to ++ to the list of operators `ops'. -- cgit v1.2.3