@@ -34,15 +34,7 @@ T_sp Lexenv_O::lookupSymbolMacro(T_sp sname) {
3434 T_sp info = this ->variableInfo (sname);
3535 if (gc::IsA<SymbolMacroVarInfo_sp>(info))
3636 return gc::As_unsafe<SymbolMacroVarInfo_sp>(info)->expander ();
37- else if (info.notnilp ()) { // global?
38- T_mv result = core__get_sysprop (sname, ext::_sym_symbolMacro);
39- MultipleValues &mvn = core::lisp_multipleValues ();
40- if (gc::As_unsafe<T_sp>(mvn.valueGet (1 , result.number_of_values ())).notnilp ()) {
41- return result;
42- } else
43- return nil<T_O>();
44- } else
45- return nil<T_O>();
37+ else return nil<T_O>();
4638}
4739
4840T_sp Lexenv_O::functionInfo (T_sp funname) {
@@ -64,14 +56,8 @@ T_sp Lexenv_O::lookupMacro(T_sp macroname) {
6456 return gc::As_unsafe<GlobalMacroInfo_sp>(info)->expander ();
6557 else if (gc::IsA<LocalMacroInfo_sp>(info))
6658 return gc::As_unsafe<LocalMacroInfo_sp>(info)->expander ();
67- else if (info.nilp ()) {
68- Symbol_sp sym = gc::As<Symbol_sp>(macroname);
69- if (sym->fboundp () && sym->macroP ())
70- return sym->symbolFunction ();
71- else
72- return nil<T_O>();
73- } else
74- return nil<T_O>();
59+ // no info
60+ else return info;
7561}
7662
7763Lexenv_sp Lexenv_O::bind_vars (List_sp vars, const Context ctxt) {
@@ -1049,7 +1035,7 @@ void compile_let(List_sp bindings, List_sp body, Lexenv_sp env, const Context ct
10491035 // FIXME: We don't need to cons actual lexenvs here.
10501036 post_binding_env = post_binding_env->bind1var (var, ctxt);
10511037 ++lexical_binding_count;
1052- ctxt.maybe_emit_make_cell (gc::As_assert<comp::LexicalVarInfo_sp>(var_info (var, post_binding_env )));
1038+ ctxt.maybe_emit_make_cell (gc::As_assert<comp::LexicalVarInfo_sp>(post_binding_env-> variableInfo (var)));
10531039 }
10541040 }
10551041 ctxt.emit_bind (lexical_binding_count, env->frameEnd ());
@@ -1087,7 +1073,7 @@ void compile_letSTAR(List_sp bindings, List_sp body, Lexenv_sp env, const Contex
10871073 } else {
10881074 size_t frame_start = new_env->frameEnd ();
10891075 new_env = new_env->bind1var (var, ctxt);
1090- ctxt.maybe_emit_make_cell (gc::As_assert<comp::LexicalVarInfo_sp>(var_info (var, new_env )));
1076+ ctxt.maybe_emit_make_cell (gc::As_assert<comp::LexicalVarInfo_sp>(new_env-> variableInfo (var)));
10911077 ctxt.assemble1 (vm_set, frame_start);
10921078 }
10931079 }
@@ -1124,11 +1110,11 @@ Lexenv_sp compile_optional_or_key_item(Symbol_sp var, T_sp defaulting_form, size
11241110 Label_sp next_label, bool var_specialp, bool supplied_specialp, const Context context,
11251111 Lexenv_sp env) {
11261112 Label_sp supplied_label = Label_O::make ();
1127- T_sp varinfo = var_info (var, env );
1113+ T_sp varinfo = env-> variableInfo (var);
11281114 T_sp supinfo = nil<T_O>();
11291115 if (supplied_var.notnilp ()) {
11301116 env = env->bind1var (supplied_var, context);
1131- supinfo = var_info (supplied_var, env );
1117+ supinfo = env-> variableInfo (supplied_var);
11321118 }
11331119 context.emit_jump_if_supplied (supplied_label, var_index);
11341120 // Emit code for the case of the variable not being supplied:
@@ -1227,7 +1213,7 @@ void compile_with_lambda_list(T_sp lambda_list, List_sp body, Lexenv_sp env, con
12271213 // We account for special declarations in outer environments/globally
12281214 // by checking the original environment - not our new one - for info.
12291215 T_sp var = it._ArgTarget ;
1230- LexicalVarInfo_sp lvinfo = gc::As_assert<LexicalVarInfo_sp>(var_info (var, new_env ));
1216+ auto lvinfo = gc::As_assert<LexicalVarInfo_sp>(new_env-> variableInfo (var));
12311217 if (special_binding_p (var, specials, env)) {
12321218 sreqs << var;
12331219 context.assemble1 (vm_ref, lvinfo->frameIndex ());
@@ -1252,7 +1238,7 @@ void compile_with_lambda_list(T_sp lambda_list, List_sp body, Lexenv_sp env, con
12521238 // Add everything to opt-key-indices.
12531239 for (auto &it : optionals) {
12541240 T_sp var = it._ArgTarget ;
1255- LexicalVarInfo_sp lvinfo = gc::As_assert<LexicalVarInfo_sp>(var_info (var, new_env ));
1241+ auto lvinfo = gc::As_assert<LexicalVarInfo_sp>(new_env-> variableInfo (var));
12561242 opt_key_indices = Cons_O::create (Cons_O::create (var, clasp_make_fixnum (lvinfo->frameIndex ())), opt_key_indices);
12571243 }
12581244 // Re-mark anything that's special in the outer context as such, so that
@@ -1290,7 +1276,7 @@ void compile_with_lambda_list(T_sp lambda_list, List_sp body, Lexenv_sp env, con
12901276 new_env = new_env->bind_vars (keyvars.cons (), context);
12911277 for (auto &it : keys) {
12921278 T_sp var = it._ArgTarget ;
1293- LexicalVarInfo_sp lvinfo = gc::As_assert<LexicalVarInfo_sp>(var_info (var, new_env ));
1279+ auto lvinfo = gc::As_assert<LexicalVarInfo_sp>(new_env-> variableInfo (var));
12941280 opt_key_indices = Cons_O::create (Cons_O::create (var, clasp_make_fixnum (lvinfo->frameIndex ())), opt_key_indices);
12951281 }
12961282 new_env = new_env->add_specials (skeys.cons ());
@@ -1331,7 +1317,7 @@ void compile_with_lambda_list(T_sp lambda_list, List_sp body, Lexenv_sp env, con
13311317 }
13321318 context.assemble1 (vm_set, new_env->frameEnd ());
13331319 new_env = new_env->bind1var (rest, context);
1334- LexicalVarInfo_sp lvinfo = gc::As_assert<LexicalVarInfo_sp>(var_info (rest, new_env ));
1320+ auto lvinfo = gc::As_assert<LexicalVarInfo_sp>(new_env-> variableInfo (rest));
13351321 if (special_binding_p (rest, specials, env)) {
13361322 context.assemble1 (vm_ref, lvinfo->frameIndex ());
13371323 context.emit_special_bind (rest);
@@ -1627,7 +1613,7 @@ void compile_tagbody(List_sp statements, Lexenv_sp env, const Context ctxt) {
16271613 List_sp new_tags = gc::As_assert<List_sp>(env->tags ());
16281614 Symbol_sp tagbody_dynenv = cl__gensym (SimpleBaseString_O::make (" TAG-DYNENV" ));
16291615 Lexenv_sp nenv = env->bind1var (tagbody_dynenv, ctxt);
1630- LexicalVarInfo_sp dynenv_info = gc::As_assert<LexicalVarInfo_sp>(var_info (tagbody_dynenv, nenv ));
1616+ auto dynenv_info = gc::As_assert<LexicalVarInfo_sp>(nenv-> variableInfo (tagbody_dynenv));
16311617 Context stmt_ctxt (ctxt, dynenv_info);
16321618 for (auto cur : statements) {
16331619 T_sp statement = oCar (cur);
@@ -1697,7 +1683,7 @@ void compile_go(T_sp tag, Lexenv_sp env, const Context ctxt) {
16971683void compile_block (Symbol_sp name, List_sp body, Lexenv_sp env, const Context ctxt) {
16981684 Symbol_sp block_dynenv = cl__gensym (SimpleBaseString_O::make (" BLOCK-DYNENV" ));
16991685 Lexenv_sp nenv = env->bind1var (block_dynenv, ctxt);
1700- LexicalVarInfo_sp dynenv_info = gc::As_assert<LexicalVarInfo_sp>(var_info (block_dynenv, nenv ));
1686+ auto dynenv_info = gc::As_assert<LexicalVarInfo_sp>(nenv-> variableInfo (block_dynenv));
17011687 Label_sp label = Label_O::make ();
17021688 Label_sp normal_label = Label_O::make ();
17031689 // Bind the dynamic environment or save SP.
0 commit comments