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

generate instance member entry for instance member functions, generate abc...

generate instance member entry for instance member functions, generate abc directive .ai with the label of the entry (these entries are not yet used)
parent 91ceacbe
......@@ -717,8 +717,17 @@ static void CodeRule (ImpRuleP rule)
}
}
if (rule_sdef->sdef_mark & SDEF_USED_CURRIED_MASK)
ApplyEntry (rule->rule_state_p,rule_sdef->sdef_arity,&ea_lab,!(rule_sdef->sdef_mark & SDEF_USED_LAZILY_MASK));
if (rule_sdef->sdef_mark & SDEF_USED_CURRIED_MASK){
struct label i_label;
if (rule_sdef->sdef_mark & (SDEF_INSTANCE_RULE_WITH_FIELD_P | SDEF_RULE_INSTANCE_RULE_P) &&
generate_instance_entry (rule_sdef,rule->rule_state_p,&i_label))
{
function_called_only_curried_or_lazy_with_one_return=0;
ApplyInstanceEntry (rule->rule_state_p,rule_sdef->sdef_arity,&ea_lab,&i_label,!(rule_sdef->sdef_mark & SDEF_USED_LAZILY_MASK));
} else
ApplyEntry (rule->rule_state_p,rule_sdef->sdef_arity,&ea_lab,!(rule_sdef->sdef_mark & SDEF_USED_LAZILY_MASK));
}
if (rule_sdef->sdef_mark & SDEF_USED_LAZILY_MASK)
if (rule->rule_mark & RULE_UNBOXED_LAZY_CALL){
......
This diff is collapsed.
......@@ -96,6 +96,9 @@ extern void GenerateStatesForRecords (Symbol symbs);
extern Bool NodeEntry (StateS *const function_state_p,int arity,Label ealab,SymbDef rootsymb);
extern Bool NodeEntryUnboxed (StateS *const function_state_p,NodeP call_node_p,int args_a_size,int args_b_size,Label ealab,SymbDef rootsymb);
extern int generate_instance_entry (struct symbol_def *rule_sdef,struct state *function_state_p,struct label *i_label_p);
extern void ApplyInstanceEntry (StateS *const function_state_p,int arity,Label ea_lab,struct label *i_label_p,int ea_label_follows);
extern void ApplyEntry (StateS *const function_state_p,int arity,Label ealab,int ea_label_follows);
extern Bool ConvertExternalToInternalCall (int arity,StateS *const ext_function_state_p,StateS *const int_function_state_p,
......
......@@ -686,6 +686,7 @@ static void put_instruction_code (int instruction_code)
}
#define Da "a"
#define Dai "ai"
#define Dkeep "keep"
#define Dd "d"
#define Do "o"
......@@ -2673,14 +2674,24 @@ void GenNodeEntryDirective (int arity,Label label,Label label2)
}
}
#ifdef NEW_APPLY
void GenApplyEntryDirective (int arity,Label label)
{
put_directive_b (a);
put_arguments_n__b (arity);
GenLabel (label);
}
#endif
void GenApplyInstanceEntryDirective (int arity,Label label,Label label2)
{
put_directive_b (ai);
put_arguments_n__b (arity);
if (label==NULL)
FPutS (empty_lab.lab_name, OutFile);
else
GenLabel (label);
FPutC (' ', OutFile);
GenLabel (label2);
}
void GenLazyRecordNodeEntryDirective (int arity,Label label,Label label2)
{
......
......@@ -171,9 +171,7 @@ void GenNodeEntryDirective (int arity,Label label,Label label2);
void GenNodeEntryDirectiveForLabelWithoutSymbol (int arity,Label label,Label label2);
void GenNodeEntryDirectiveUnboxed (int a_size,int b_size,Label label,Label label2);
void GenApplyEntryDirective (int arity,Label label);
#ifdef NEW_APPLY
void GenApplyEntryDirective (int arity,Label label);
#endif
void GenApplyInstanceEntryDirective (int arity,Label label,Label label2);
void GenLazyRecordNodeEntryDirective (int arity,Label label,Label label2);
void GenFieldNodeEntryDirective (int arity, Label label, Label label2,char *record_name);
void GenConstructorDescriptorAndExport (SymbDef sdef);
......
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