aboutsummaryrefslogtreecommitdiff
path: root/backendC
diff options
context:
space:
mode:
authorjohnvg2005-01-12 16:17:59 +0000
committerjohnvg2005-01-12 16:17:59 +0000
commit0174e68d1aef9cd1bb36a46df205cdf1f1645576 (patch)
tree1bdc16f4b31f55cb443fbb9035e57092ad1249e9 /backendC
parentchanged version number and name of university (diff)
improve names used by the time profiler for functions generated for
case, if and lambda expressions git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1505 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'backendC')
-rw-r--r--backendC/CleanCompilerSources/checksupport.c12
-rw-r--r--backendC/CleanCompilerSources/codegen.c2
-rw-r--r--backendC/CleanCompilerSources/instructions.c30
-rw-r--r--backendC/CleanCompilerSources/instructions.h5
4 files changed, 41 insertions, 8 deletions
diff --git a/backendC/CleanCompilerSources/checksupport.c b/backendC/CleanCompilerSources/checksupport.c
index 3b654f2..d7ebdf0 100644
--- a/backendC/CleanCompilerSources/checksupport.c
+++ b/backendC/CleanCompilerSources/checksupport.c
@@ -393,18 +393,18 @@ void PrintSymbolOfIdent (Ident sid, unsigned line_nr, File file)
if (line_nr > 0){
FPrintF (file, " [line: %u]", line_nr);
- if (*end_name == '\0')
- return;
} else {
FPutC (cTypeDelimiter, file);
-
PrintName (next_char, end_name, line_nr, file);
-
- if (*end_name == '\0')
- return;
}
+ if (*end_name == '\0')
+ return;
+# ifdef CLEAN2
+ next_char = end_name;
+# else
next_char = end_name + 1;
+# endif
} else
FPutC (cTypeDelimiter, file);
diff --git a/backendC/CleanCompilerSources/codegen.c b/backendC/CleanCompilerSources/codegen.c
index 5c177b7..3eaf5da 100644
--- a/backendC/CleanCompilerSources/codegen.c
+++ b/backendC/CleanCompilerSources/codegen.c
@@ -673,7 +673,7 @@ static void CodeRule (ImpRuleP rule)
GenFunctionDescriptorAndExportNodeAndDescriptor (rule_sdef);
if (DoTimeProfiling)
- GenPB (rule_sdef->sdef_ident->ident_name);
+ GenPB_ident (rule_sdef->sdef_ident,rule_sdef->sdef_line);
if (rule_sdef->sdef_exported && rule_sdef->sdef_calledwithrootnode && ExpectsResultNode (resultstate))
MakeSymbolLabel (&ea_lab,CurrentModule,ea_pref,rule_sdef,0);
diff --git a/backendC/CleanCompilerSources/instructions.c b/backendC/CleanCompilerSources/instructions.c
index 9ed5958..b2bb6ba 100644
--- a/backendC/CleanCompilerSources/instructions.c
+++ b/backendC/CleanCompilerSources/instructions.c
@@ -607,6 +607,7 @@ enum {
#define Ipush_b "push_b"
#define Ijsr_eval "jsr_eval"
+#define Ijsr_ap "jsr_ap"
#define Ipop_a "pop_a"
#define Ipop_b "pop_b"
@@ -638,6 +639,7 @@ enum {
#define Ijmp_eval "jmp_eval"
#define Ijmp_eval_upd "jmp_eval_upd"
+#define Ijmp_ap "jmp_ap"
#define Ihalt "halt"
@@ -668,6 +670,7 @@ static void put_instruction_code (int instruction_code)
FPutC (instruction_code,OutFile);
}
+#define Da "a"
#define Dkeep "keep"
#define Dd "d"
#define Do "o"
@@ -2188,11 +2191,23 @@ void GenJsrEval (int offset)
put_arguments_n_b (offset);
}
+void GenJsrAp (int n_args)
+{
+ put_instruction_b (jsr_ap);
+ put_arguments_n_b (n_args);
+}
+
void GenJmpEval (void)
{
put_instruction (Ijmp_eval);
}
+void GenJmpAp (int n_args)
+{
+ put_instruction_b (jmp_ap);
+ put_arguments_n_b (n_args);
+}
+
void GenPopA (int nr)
{
if (nr > 0){
@@ -2633,6 +2648,13 @@ void GenNodeEntryDirective (int arity,Label label,Label label2)
}
}
+void GenApplyEntryDirective (int arity,Label label)
+{
+ put_directive_b (a);
+ put_arguments_n__b (arity);
+ GenLabel (label);
+}
+
void GenLazyRecordNodeEntryDirective (int arity,Label label)
{
if (DoStackLayout){
@@ -3667,6 +3689,14 @@ void GenPB (char *function_name)
FPrintF (OutFile,"\"%s\"",function_name);
}
+void GenPB_ident (IdentP ident,unsigned int line_n)
+{
+ put_directive_ (Dpb);
+ PutCOutFile ('\"');
+ PrintSymbolOfIdent (ident,line_n,OutFile);
+ PutCOutFile ('\"');
+}
+
void GenPB_with_line_number (char *function_name,int line_number)
{
put_directive_ (Dpb);
diff --git a/backendC/CleanCompilerSources/instructions.h b/backendC/CleanCompilerSources/instructions.h
index e42914b..67768ad 100644
--- a/backendC/CleanCompilerSources/instructions.h
+++ b/backendC/CleanCompilerSources/instructions.h
@@ -87,8 +87,9 @@ void GenPushA (int offset);
void GenPushB (int offset);
void GenJsrEval (int offset);
+void GenJsrAp (int n_args);
void GenJmpEval (void);
-
+void GenJmpAp (int n_args);
void GenPopA (int nr);
void GenPopB (int nr);
@@ -157,6 +158,7 @@ void GenOStackLayout (int asize,int bsize,Args fun_args);
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);
void GenLazyRecordNodeEntryDirective (int arity,Label label);
void GenFieldNodeEntryDirective (int arity, Label label, Label label2,char *record_name);
void GenConstructorDescriptorAndExport (SymbDef sdef);
@@ -213,6 +215,7 @@ void GenFillCaf (Label label,int a_stack_size,int b_stack_size);
void GenCaf (Label label,int a_stack_size,int b_stack_size);
void GenPB (char *function_name);
+void GenPB_ident (IdentP ident,unsigned int line_n);
void GenPB_with_line_number (char *function_name,int line_number);
void GenPD (void);
void GenPN (void);