From f2f0fae36fadd764c4f5133b4e20f4ea8ebcc3f7 Mon Sep 17 00:00:00 2001 From: Mattia Giambirtone Date: Thu, 2 Jun 2022 01:50:06 +0200 Subject: [PATCH] Fixed inverse parameter ordering (whoops) --- src/config.nim | 2 +- src/frontend/compiler.nim | 10 +--------- src/main.nim | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/config.nim b/src/config.nim index 6014eb9..1fda235 100644 --- a/src/config.nim +++ b/src/config.nim @@ -27,7 +27,7 @@ when len(PEON_COMMIT_HASH) != 40: const PEON_BRANCH* = "master" when len(PEON_BRANCH) > 255: {.fatal: "The git branch name's length must be less than or equal to 255 characters".} -const DEBUG_TRACE_VM* = true # Traces VM execution +const DEBUG_TRACE_VM* = false # Traces VM execution const DEBUG_TRACE_GC* = false # Traces the garbage collector (TODO) const DEBUG_TRACE_ALLOCATION* = false # Traces memory allocation/deallocation const DEBUG_TRACE_COMPILER* = false # Traces the compiler diff --git a/src/frontend/compiler.nim b/src/frontend/compiler.nim index d1c85ce..dcad9ad 100644 --- a/src/frontend/compiler.nim +++ b/src/frontend/compiler.nim @@ -803,15 +803,7 @@ proc generateCall(self: Compiler, fn: Name, args: seq[Expression]) = self.emitByte(LoadReturnAddress) let pos = self.chunk.code.len() self.emitBytes(0.toQuad()) - for argument in reversed(args): - # We pass the arguments in reverse because - # we delegate the callee with popping them - # off the operand stack when they're invoked, - # rather than doing it ourselves. The reason - # for this is that the VM can always find the - # function object at a constant location in the - # stack frame instead of needing extra math to - # skip the arguments + for argument in args: self.expression(argument) self.emitByte(Call) # Creates a new call frame var size = 2 # We start at 2 because each call frame diff --git a/src/main.nim b/src/main.nim index bdd3b58..450c44b 100644 --- a/src/main.nim +++ b/src/main.nim @@ -30,7 +30,7 @@ proc getLineEditor: LineEditor # Handy dandy compile-time constants const debugLexer = false const debugParser = false -const debugCompiler = true +const debugCompiler = false const debugSerializer = false const debugRuntime = false