Commit a4a31aee authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl

remove code for old record selectors from backend

parent 11927276
......@@ -982,11 +982,7 @@ static void GenLazyFieldSelectorEntry (SymbDef field_def,StateS recstate,int tot
if (field_def->sdef_exported || ExportLocalLabels)
GenExportFieldSelector (field_def);
#ifdef NEW_SELECTOR_DESCRIPTORS
GenFieldSelectorDescriptor (field_def,offfieldstate,apos,bpos,tot_a_size,tot_b_size);
#else
GenFieldSelectorDescriptor (field_def,IsSimpleState (offfieldstate));
#endif
if (DoTimeProfiling)
GenPB (field_def->sdef_name);
......@@ -1039,18 +1035,6 @@ static void GenLazyFieldSelectorEntry (SymbDef field_def,StateS recstate,int tot
GenJsrEval (0);
#ifndef NEW_SELECTOR_DESCRIPTORS
if (IsSimpleState (offfieldstate) && offfieldstate.state_kind==OnB && !DoTimeProfiling){
LabDef gc_apply_label;
gc_apply_label=CurrentAltLabel;
gc_apply_label.lab_pref = l_pref;
GenOAStackLayout (2);
GenFieldLabelDefinition (&gc_apply_label,record_name);
}
#endif
GenPushRArgB (0, tot_a_size, tot_b_size, bpos + 1, bsize);
GenReplRArgA (tot_a_size, tot_b_size, apos + 1, asize);
......@@ -1115,36 +1099,6 @@ static void GenLazyFieldSelectorEntry (SymbDef field_def,StateS recstate,int tot
if (DoTimeProfiling)
GenPE();
#ifndef NEW_SELECTOR_DESCRIPTORS
/* generate apply entry for the garbage collector: */
if (IsSimpleState (offfieldstate)){
LabDef gc_apply_label;
gc_apply_label=CurrentAltLabel;
gc_apply_label.lab_pref = l_pref;
if (offfieldstate.state_kind==OnB){
if (DoTimeProfiling){
GenOAStackLayout (2);
GenFieldLabelDefinition (&gc_apply_label,record_name);
GenPushRArgB (0,tot_a_size,tot_b_size,bpos+1,bsize);
GenReplRArgA (tot_a_size,tot_b_size,apos+1, asize);
FillBasicFromB (offfieldstate.state_object,0,0,ReleaseAndFill);
GenPopB (ObjectSizes [offfieldstate.state_object]);
GenRtn (1,0, OnAState);
}
} else {
GenOAStackLayout (1);
GenFieldLabelDefinition (&gc_apply_label,record_name);
GenReplRArgA (tot_a_size, tot_b_size, apos + 1, asize);
GenRtn (1,0, OnAState);
}
}
#endif
}
}
......@@ -2439,18 +2393,13 @@ Bool ConvertExternalToInternalCall (int arity,StateS *const ext_function_state_p
}
}
static char g_pref[] = "g";
static void GenerateCodeForLazyTupleSelectorEntry (int argnr)
{
LabDef sellab,easellab,descriptor_label;
BuildLazyTupleSelectorLabel (&sellab, MaxNodeArity, argnr);
#ifdef NEW_SELECTOR_DESCRIPTORS
GenSelectorDescriptor (&sellab,argnr);
#else
GenSelectorDescriptor (&sellab,g_pref);
#endif
easellab = sellab;
easellab.lab_pref = ea_pref;
......@@ -2471,17 +2420,6 @@ static void GenerateCodeForLazyTupleSelectorEntry (int argnr)
GenPopA (2);
GenRtn (1,0,OnAState);
#ifndef NEW_SELECTOR_DESCRIPTORS
GenOAStackLayout (1);
sellab.lab_pref = g_pref;
GenLabelDefinition (&sellab);
GenGetNodeArity (0);
GenPushArgNr (argnr);
GenPushArgB (0);
GenUpdatePopA (0, 1);
GenRtn (1,0,OnAState);
#endif
GenOAStackLayout (2);
GenLabelDefinition (&easellab);
GenPushArg (0,1,1);
......
......@@ -25,6 +25,4 @@
#define KARBON
#define NEW_SELECTOR_DESCRIPTORS
#define LIFT_PARTIAL_APPLICATIONS_WITH_ZERO_ARITY_ARGS
......@@ -3239,8 +3239,6 @@ void GenLazyRecordDescriptorAndExport (SymbDef sdef)
}
}
#ifdef NEW_SELECTOR_DESCRIPTORS
static void print_result_descriptor_and_offsets (StateS field_state,int a_pos,int b_pos,int record_a_size,int record_b_size)
{
if (field_state.state_kind!=OnB)
......@@ -3323,70 +3321,6 @@ void GenFieldSelectorDescriptor (SymbDef sdef,StateS field_state,int a_pos,int b
FPrintF (OutFile, "\"%s.%s\"",record_name,name);
}
#else
void GenFieldSelectorDescriptor (SymbDef sdef,int has_gc_apply_entry)
{
char *name,*record_name;
int arity;
if (!DescriptorNeeded (sdef))
return;
name = sdef->sdef_name;
arity = (sdef->sdef_kind == RECORDTYPE) ? sdef->sdef_cons_arity : sdef->sdef_arity;
record_name=sdef->sdef_type->type_symbol->symb_def->sdef_name;
put_directive_ (Ddesc);
if (sdef->sdef_exported){
if (has_gc_apply_entry)
FPrintF (OutFile, "e_%s_" D_PREFIX "%s.%s e_%s_" N_PREFIX "%s.%s e_%s_" L_PREFIX "%s.%s %d 0 \"%s.%s\"",
CurrentModule,record_name,name,
CurrentModule,record_name,name,
CurrentModule,record_name,name,
arity,record_name,name);
else
FPrintF (OutFile, "e_%s_" D_PREFIX "%s.%s e_%s_" N_PREFIX "%s.%s _hnf %d 0 \"%s.%s\"",
CurrentModule,record_name,name,
CurrentModule,record_name,name,
arity,record_name,name);
} else if ((sdef->sdef_mark & SDEF_USED_LAZILY_MASK) || has_gc_apply_entry){
if (ExportLocalLabels)
FPrintF (OutFile, "e_%s_" D_PREFIX "%s.%s ",CurrentModule,record_name,name);
else if (DoDebug)
FPrintF (OutFile, D_PREFIX "%s.%s ",record_name,name);
else
FPrintF (OutFile, LOCAL_D_PREFIX "%u ", sdef->sdef_number);
if (sdef->sdef_mark & SDEF_USED_LAZILY_MASK){
if (ExportLocalLabels)
FPrintF (OutFile, "e_%s_" N_PREFIX "%s.%s ",CurrentModule,record_name,name);
else if (DoDebug)
FPrintF (OutFile, N_PREFIX "%s.%s ",record_name,name);
else
FPrintF (OutFile, N_PREFIX "%u ",sdef->sdef_number);
} else
FPrintF (OutFile, "%s ",hnf_lab.lab_name);
if (has_gc_apply_entry){
if (ExportLocalLabels)
FPrintF (OutFile, "e_%s_" L_PREFIX "%s.%s ",CurrentModule,record_name,name);
else if (DoDebug)
FPrintF (OutFile, L_PREFIX "%s.%s ",record_name,name);
else
FPrintF (OutFile, L_PREFIX "%u ",sdef->sdef_number);
} else
FPrintF (OutFile, "%s ",hnf_lab.lab_name);
FPrintF (OutFile, "%d 0 \"%s.%s\"",arity,record_name,name);
} else if (DoDebug){
FPrintF (OutFile, D_PREFIX "%s %s %s %d 0 \"%s.%s\"", name, hnf_lab.lab_name,
hnf_lab.lab_name,arity,record_name,name);
} else
FPrintF (OutFile, LOCAL_D_PREFIX "%u %s %s %d 0 \"%s.%s\"", sdef->sdef_number,
hnf_lab.lab_name, hnf_lab.lab_name, arity,record_name,name);
}
#endif
void GenModuleDescriptor (
#if WRITE_DCL_MODIFICATION_TIME
......@@ -3493,7 +3427,6 @@ void GenStart (SymbDef startsymb)
}
}
#ifdef NEW_SELECTOR_DESCRIPTORS
void GenSelectorDescriptor (Label sellab,int element_n)
{
if (sellab->lab_issymbol){
......@@ -3521,17 +3454,6 @@ void GenSelectorDescriptor (Label sellab,int element_n)
sellab->lab_name, sellab->lab_post);
}
}
#else
void GenSelectorDescriptor (Label sellab,char *g_pref)
{
put_directive_ (Ddesc);
FPrintF (OutFile, D_PREFIX "%s.%d %s%s.%d %s%s.%d 1 0 \"%s.%d\"",
sellab->lab_name, sellab->lab_post,
sellab->lab_pref, sellab->lab_name, sellab->lab_post,
g_pref, sellab->lab_name, sellab->lab_post,
sellab->lab_name, sellab->lab_post);
}
#endif
void InitFileInfo (ImpMod imod)
{
......
......@@ -184,11 +184,7 @@ void GenConstructorFunctionDescriptorAndExportNodeAndDescriptor (SymbDef sdef);
void GenFunctionDescriptorForLazyTupleRecursion (SymbDef sdef,int tuple_result_arity);
#endif
void GenLazyRecordDescriptorAndExport (SymbDef sdef);
#ifdef NEW_SELECTOR_DESCRIPTORS
void GenFieldSelectorDescriptor (SymbDef sdef,StateS field_state,int a_pos,int b_pos,int record_a_size,int record_b_size);
#else
void GenFieldSelectorDescriptor (SymbDef sdef,int has_gc_apply_entry);
#endif
void GenRecordDescriptor (SymbDef sdef);
#ifdef STRICT_LISTS
void GenUnboxedConsRecordDescriptor (SymbDef sdef,int tail_strict);
......@@ -226,11 +222,7 @@ void GenInstructions (Instructions ilist);
void GenJmpEvalUpdate (void);
#ifdef NEW_SELECTOR_DESCRIPTORS
void GenSelectorDescriptor (Label sellab,int element_n);
#else
void GenSelectorDescriptor (Label sellab,char *g_pref);
#endif
void GenGetNodeArity (int offset);
void GenPushArgNr (int argnr);
void GenPushArgB (int offset);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment