From bfa543bd11401b6fe398fa7f406a722daae65569 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 23 Jan 2010 22:37:07 +0000 Subject: [PATCH] fix problem initializing tail buffer; fix JIT checking of unsafe-f{l,64}vector-ref unboxing; fix error message for unbound variables (merge to 4.2.4) svn: r17788 --- src/mzscheme/src/eval.c | 8 +++++--- src/mzscheme/src/jit.c | 5 +++-- src/mzscheme/src/thread.c | 3 +++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/mzscheme/src/eval.c b/src/mzscheme/src/eval.c index 0c3fb115a4..6c88404a6f 100644 --- a/src/mzscheme/src/eval.c +++ b/src/mzscheme/src/eval.c @@ -6994,7 +6994,7 @@ static Scheme_Object *check_top(const char *when, Scheme_Object *form, Scheme_Co if (bad || !scheme_lookup_in_table(env->genv->toplevel, (const char *)SCHEME_STX_SYM(c))) { GC_CAN_IGNORE const char *reason; if (env->genv->phase == 1) { - reason = "unbound identifier in module (transformer environment)"; + reason = "unbound identifier in module (in phase 1, transformer environment)"; /* Check in the run-time environment */ if (scheme_lookup_in_table(env->genv->template_env->toplevel, (const char *)SCHEME_STX_SYM(c))) { reason = ("unbound identifier in module (in the transformer environment, which does" @@ -7004,9 +7004,11 @@ static Scheme_Object *check_top(const char *when, Scheme_Object *form, Scheme_Co reason = ("unbound identifier in module (in the transformer environment, which does" " not include the macro definition that is visible to run-time expressions)"); } - } else + } else if (env->genv->phase == 0) reason = "unbound identifier in module"; - scheme_wrong_syntax(when, NULL, c, reason); + else + reason = "unbound identifier in module (in phase %d)"; + scheme_wrong_syntax(when, NULL, c, reason, env->genv->phase); } } } diff --git a/src/mzscheme/src/jit.c b/src/mzscheme/src/jit.c index edfa649a1a..54d941fb42 100644 --- a/src/mzscheme/src/jit.c +++ b/src/mzscheme/src/jit.c @@ -4217,8 +4217,9 @@ static int can_unbox_inline(Scheme_Object *obj, int fuel, int regs, int unsafely Scheme_App3_Rec *app = (Scheme_App3_Rec *)obj; if (!is_inline_unboxable_op(app->rator, SCHEME_PRIM_IS_BINARY_INLINED, unsafely, 0)) return 0; - if (IS_NAMED_PRIM(app->rator, "unsafe-f64vector-ref") - || IS_NAMED_PRIM(app->rator, "unsafe-flvector-ref")) { + if ((SCHEME_PRIM_PROC_FLAGS(app->rator) & SCHEME_PRIM_IS_BINARY_INLINED) + && (IS_NAMED_PRIM(app->rator, "unsafe-f64vector-ref") + || IS_NAMED_PRIM(app->rator, "unsafe-flvector-ref"))) { if (is_unboxing_immediate(app->rand1, 1) && is_unboxing_immediate(app->rand1, 2)) { return 1; diff --git a/src/mzscheme/src/thread.c b/src/mzscheme/src/thread.c index 50376edce3..db2bde86dc 100644 --- a/src/mzscheme/src/thread.c +++ b/src/mzscheme/src/thread.c @@ -2296,6 +2296,9 @@ static Scheme_Thread *make_thread(Scheme_Config *config, scheme_first_thread = process; } + if (!buffer_init_size) /* => before place init */ + buffer_init_size = INIT_TB_SIZE; + { Scheme_Object **tb; tb = MALLOC_N(Scheme_Object *, buffer_init_size);