From 5163c94e3a527f8ff96fa85d541532a3b82b3960 Mon Sep 17 00:00:00 2001 From: arookas Date: Mon, 22 Feb 2016 20:43:44 -0500 Subject: [PATCH] Removed compiler parameter for relocations Since relocations are linked with the binary formatter directly, and each already does a keep/back restore, no point in doing that again when closing them. --- ssc/compiler.cs | 2 +- ssc/scope.cs | 4 ++-- ssc/symbol.cs | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ssc/compiler.cs b/ssc/compiler.cs index 8ff892d..5bc3dc7 100644 --- a/ssc/compiler.cs +++ b/ssc/compiler.cs @@ -131,7 +131,7 @@ namespace arookas { #endif void CompileRelocations() { foreach (var symbol in mContext.SymbolTable) { - symbol.CloseRelocations(this); + symbol.CloseRelocations(); } } void CompileData() { diff --git a/ssc/scope.cs b/ssc/scope.cs index 0c67263..11a5974 100644 --- a/ssc/scope.cs +++ b/ssc/scope.cs @@ -53,7 +53,7 @@ namespace arookas { mStack.Add(new sunScope(type)); } #endif - public void Pop(sunCompiler compiler) { + public void Pop() { if (Count > 1) { #if SSC_SCOPES if (Top.Type == sunScopeType.Script) { @@ -62,7 +62,7 @@ namespace arookas { #else // close relocations while we still have references to the symbols foreach (var variable in Top) { - variable.CloseRelocations(compiler); + variable.CloseRelocations(); } #endif mStack.RemoveAt(Count - 1); diff --git a/ssc/symbol.cs b/ssc/symbol.cs index 685ab62..72d678f 100644 --- a/ssc/symbol.cs +++ b/ssc/symbol.cs @@ -90,12 +90,10 @@ namespace arookas { } mRelocations.Add(relocation); } - public void CloseRelocations(sunCompiler compiler) { - compiler.Binary.Keep(); + public void CloseRelocations() { foreach (var relocation in mRelocations) { relocation.Relocate(); } - compiler.Binary.Back(); } public static sunSymbolModifiers GetModifiers(sunNode modifierlist) { @@ -202,7 +200,7 @@ namespace arookas { } mBody.Compile(compiler); compiler.Binary.WriteRET0(); - compiler.Context.Scopes.Pop(compiler); + compiler.Context.Scopes.Pop(); ++mCompiles; } public override sunRelocation CreateCallSite(sunCompiler compiler, int argCount) {