From fc521f6f7b94ebf2cf1e4e901e064024cf8a5652 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Tue, 28 Feb 2012 23:33:03 -0500 Subject: [PATCH] still trying to optimizing module variable lookup --- js-assembler/assemble-helpers.rkt | 2 +- js-assembler/assemble-perform-statement.rkt | 4 ++-- version.rkt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js-assembler/assemble-helpers.rkt b/js-assembler/assemble-helpers.rkt index 8bff99b..1746067 100644 --- a/js-assembler/assemble-helpers.rkt +++ b/js-assembler/assemble-helpers.rkt @@ -262,7 +262,7 @@ (define (assemble-prefix-reference a-ref) (cond [(EnvPrefixReference-modvar? a-ref) - (format "M.e[M.e.length-~a][~a].prefix[M.e[M.e.length-~a][~a].offset]" + (format "M.e[M.e.length-~a][~a][0][M.e[M.e.length-~a][~a][1]]" (add1 (EnvPrefixReference-depth a-ref)) (EnvPrefixReference-pos a-ref) (add1 (EnvPrefixReference-depth a-ref)) diff --git a/js-assembler/assemble-perform-statement.rkt b/js-assembler/assemble-perform-statement.rkt index 1ad4aa1..bec15f7 100644 --- a/js-assembler/assemble-perform-statement.rkt +++ b/js-assembler/assemble-perform-statement.rkt @@ -57,11 +57,11 @@ (symbol->string (ModuleLocator-name (ModuleVariable-module-name n)))) - (format "{moduleName:~s,name:~s,prefix:M.modules[~s].prefix,offset:M.modules[~s].getPrefixOffset(~s)}" + (format "[M.modules[~s].prefix,M.modules[~s].getPrefixOffset(~s),{moduleName:~s,name:~s}]" + module-name module-name (symbol->string (ModuleVariable-name n)) module-name - module-name (symbol->string (ModuleVariable-name n)))])])) names) ",") diff --git a/version.rkt b/version.rkt index 96f4c60..a4056e4 100644 --- a/version.rkt +++ b/version.rkt @@ -7,4 +7,4 @@ (provide version) (: version String) -(define version "1.194") +(define version "1.195")