From 3d53fe769945bddef43a51582f91d62ee6613fc7 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Wed, 14 Sep 2011 22:14:29 -0400 Subject: [PATCH] continuing to grab at low-hanging fruit. --- compiler/compiler.rkt | 2 +- compiler/il-structs.rkt | 2 +- js-assembler/assemble-perform-statement.rkt | 3 +-- js-assembler/runtime-src/runtime.js | 6 +++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/compiler/compiler.rkt b/compiler/compiler.rkt index bfe9a99..c837e56 100644 --- a/compiler/compiler.rkt +++ b/compiler/compiler.rkt @@ -1423,7 +1423,7 @@ ;; Compiled branch - (make-PerformStatement (make-CheckClosureAndArity! (make-Reg 'argcount))) + (make-PerformStatement (make-CheckClosureAndArity!)) (compile-compiled-procedure-application cenv number-of-arguments 'dynamic diff --git a/compiler/il-structs.rkt b/compiler/il-structs.rkt index 2783aa5..3ac98ed 100644 --- a/compiler/il-structs.rkt +++ b/compiler/il-structs.rkt @@ -365,7 +365,7 @@ ;; Check the closure procedure value in 'proc and make sure it's a closure ;; that can accept the right arguments (stored as a number in the argcount register.). -(define-struct: CheckClosureAndArity! ([num-args : OpArg]) +(define-struct: CheckClosureAndArity! () #:transparent) diff --git a/js-assembler/assemble-perform-statement.rkt b/js-assembler/assemble-perform-statement.rkt index eda1874..0350085 100644 --- a/js-assembler/assemble-perform-statement.rkt +++ b/js-assembler/assemble-perform-statement.rkt @@ -22,8 +22,7 @@ [(CheckClosureAndArity!? op) - (format "RT.checkClosureAndArity(M, ~a);" - (assemble-oparg (CheckClosureAndArity!-num-args op)))] + "RT.checkClosureAndArity(M);"] [(ExtendEnvironment/Prefix!? op) (let: ([names : (Listof (U Symbol False GlobalBucket ModuleVariable)) (ExtendEnvironment/Prefix!-names op)]) diff --git a/js-assembler/runtime-src/runtime.js b/js-assembler/runtime-src/runtime.js index d63d890..a6e815d 100644 --- a/js-assembler/runtime-src/runtime.js +++ b/js-assembler/runtime-src/runtime.js @@ -655,12 +655,12 @@ - var checkClosureAndArity = function(M, n) { + var checkClosureAndArity = function(M) { if(!(M.proc instanceof Closure)){ raiseOperatorIsNotClosure(M,M.proc); } - if(!isArityMatching(M.proc.racketArity,n)) { - raiseArityMismatchError(M, M.proc,n); + if(!isArityMatching(M.proc.racketArity,M.a)) { + raiseArityMismatchError(M, M.proc,M.a); } };