From adb8aef8f8b7c21ca40f4dad905837b899fe0f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=B7=D0=B4=D0=B0=D0=B9=D1=89=D0=B8=D0=BA?= Date: Sat, 5 Dec 2020 19:17:16 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A6=D0=B8=D0=BA=D0=BB=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=D0=BD=D0=BA=D0=B8=20=D0=BF=D1=80=D0=BE=D0=B4=D0=BE?= =?UTF-8?q?=D0=BB=D0=B6=D0=B0=D0=B5=D1=82=D1=81=D1=8F,=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B5=D1=81=D1=82=D1=8C=20=C2=AB=D1=82=D1=91?= =?UTF-8?q?=D0=BF=D0=BB=D1=8B=D0=B5=C2=BB=20=D1=84=D1=83=D0=BD=D0=BA=D1=86?= =?UTF-8?q?=D0=B8=D0=B8=20(#228)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/compiler/OptTree-Drive.ref | 15 ++++++++++++--- src/compiler/OptTree.ref | 22 ++-------------------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/src/compiler/OptTree-Drive.ref b/src/compiler/OptTree-Drive.ref index d866f958..db8dea51 100644 --- a/src/compiler/OptTree-Drive.ref +++ b/src/compiler/OptTree-Drive.ref @@ -445,9 +445,18 @@ OptFunction { (t.OptInfo (/*sentences*/) (/*functions*/)) e.Sentences > - : (t.OptInfo^ (e.Sentences^) (e.NewFunctions)) - = t.OptInfo - (Function s.ScopeClass (e.Name) Sentences e.Sentences) e.NewFunctions; + : { + (t.OptInfo^ (e.Sentences /* SAME */) (/* пусто */)) + = t.OptInfo + (ColdFunction DRIVE + s.ScopeClass (e.Name) Sentences + ); + + (t.OptInfo^ (e.Sentences^) (e.NewFunctions)) + = t.OptInfo + (Function s.ScopeClass (e.Name) Sentences e.Sentences) + e.NewFunctions; + } } /* diff --git a/src/compiler/OptTree.ref b/src/compiler/OptTree.ref index acc3c7c0..6943f962 100644 --- a/src/compiler/OptTree.ref +++ b/src/compiler/OptTree.ref @@ -78,11 +78,12 @@ $ENTRY OptTree { (define DriveLoop (if (or s.OptDrive s.OptIntrinsic) (begin - (loop-for-fix-point + (loop-for-warm-functions (pass (trace 'before Drive') (call &ExpandClosures) (call &OptTree-Drive t.OptDrive))) + (call &WarmColdFunctions DRIVE) (call &OptTree-Drive-CleanupColdCalls)) (call &ExpandClosures))) @@ -200,7 +201,6 @@ ExpandClosures-ResultTerm { $SPEC Int-Code e.arg; $SPEC Int-Command e.arg; $SPEC Int-LoopForWarmFunctions e.arg; -$SPEC Int-FixPoint e.arg; Int { @@ -264,9 +264,6 @@ Int-Command { loop-for-warm-functions e.Code = ; - loop-for-fix-point e.Code - = ; - s.Proc = : e.Code = ; @@ -320,21 +317,6 @@ Int-LoopForWarmFunctions { (e.Defines) e.Code s.Cycles (e.AST) = s.Cycles e.AST; } -Int-FixPoint { - (e.Defines) e.Code 0 (e.AST) = 0 e.AST; - - (e.Defines) e.Code s.Cycles (e.AST) - = e.AST : e.OriginAST - - = : s.Cycles^ e.AST^ - - = e.AST - : { - e.OriginAST = s.Cycles e.OriginAST; - e.AST^ = ; - }; -} - $INLINE Int-Lookup; Int-Lookup {