Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
ca5850bb
Commit
ca5850bb
authored
Jan 12, 2005
by
John van Groningen
Browse files
improve names used by the time profiler for functions generated for
case, if and lambda expressions
parent
cff24fe0
Changes
4
Show whitespace changes
Inline
Side-by-side
backendC/CleanCompilerSources/checksupport.c
View file @
ca5850bb
...
@@ -393,18 +393,18 @@ void PrintSymbolOfIdent (Ident sid, unsigned line_nr, File file)
...
@@ -393,18 +393,18 @@ void PrintSymbolOfIdent (Ident sid, unsigned line_nr, File file)
if
(
line_nr
>
0
){
if
(
line_nr
>
0
){
FPrintF
(
file
,
" [line: %u]"
,
line_nr
);
FPrintF
(
file
,
" [line: %u]"
,
line_nr
);
if
(
*
end_name
==
'\0'
)
return
;
}
else
{
}
else
{
FPutC
(
cTypeDelimiter
,
file
);
FPutC
(
cTypeDelimiter
,
file
);
PrintName
(
next_char
,
end_name
,
line_nr
,
file
);
PrintName
(
next_char
,
end_name
,
line_nr
,
file
);
}
if
(
*
end_name
==
'\0'
)
if
(
*
end_name
==
'\0'
)
return
;
return
;
}
# ifdef CLEAN2
next_char
=
end_name
;
# else
next_char
=
end_name
+
1
;
next_char
=
end_name
+
1
;
# endif
}
else
}
else
FPutC
(
cTypeDelimiter
,
file
);
FPutC
(
cTypeDelimiter
,
file
);
...
...
backendC/CleanCompilerSources/codegen.c
View file @
ca5850bb
...
@@ -673,7 +673,7 @@ static void CodeRule (ImpRuleP rule)
...
@@ -673,7 +673,7 @@ static void CodeRule (ImpRuleP rule)
GenFunctionDescriptorAndExportNodeAndDescriptor
(
rule_sdef
);
GenFunctionDescriptorAndExportNodeAndDescriptor
(
rule_sdef
);
if
(
DoTimeProfiling
)
if
(
DoTimeProfiling
)
GenPB
(
rule_sdef
->
sdef_ident
->
i
de
nt_nam
e
);
GenPB
_ident
(
rule_sdef
->
sdef_ident
,
rule_sdef
->
s
de
f_lin
e
);
if
(
rule_sdef
->
sdef_exported
&&
rule_sdef
->
sdef_calledwithrootnode
&&
ExpectsResultNode
(
resultstate
))
if
(
rule_sdef
->
sdef_exported
&&
rule_sdef
->
sdef_calledwithrootnode
&&
ExpectsResultNode
(
resultstate
))
MakeSymbolLabel
(
&
ea_lab
,
CurrentModule
,
ea_pref
,
rule_sdef
,
0
);
MakeSymbolLabel
(
&
ea_lab
,
CurrentModule
,
ea_pref
,
rule_sdef
,
0
);
...
...
backendC/CleanCompilerSources/instructions.c
View file @
ca5850bb
...
@@ -607,6 +607,7 @@ enum {
...
@@ -607,6 +607,7 @@ enum {
#define Ipush_b "push_b"
#define Ipush_b "push_b"
#define Ijsr_eval "jsr_eval"
#define Ijsr_eval "jsr_eval"
#define Ijsr_ap "jsr_ap"
#define Ipop_a "pop_a"
#define Ipop_a "pop_a"
#define Ipop_b "pop_b"
#define Ipop_b "pop_b"
...
@@ -638,6 +639,7 @@ enum {
...
@@ -638,6 +639,7 @@ enum {
#define Ijmp_eval "jmp_eval"
#define Ijmp_eval "jmp_eval"
#define Ijmp_eval_upd "jmp_eval_upd"
#define Ijmp_eval_upd "jmp_eval_upd"
#define Ijmp_ap "jmp_ap"
#define Ihalt "halt"
#define Ihalt "halt"
...
@@ -668,6 +670,7 @@ static void put_instruction_code (int instruction_code)
...
@@ -668,6 +670,7 @@ static void put_instruction_code (int instruction_code)
FPutC
(
instruction_code
,
OutFile
);
FPutC
(
instruction_code
,
OutFile
);
}
}
#define Da "a"
#define Dkeep "keep"
#define Dkeep "keep"
#define Dd "d"
#define Dd "d"
#define Do "o"
#define Do "o"
...
@@ -2188,11 +2191,23 @@ void GenJsrEval (int offset)
...
@@ -2188,11 +2191,23 @@ void GenJsrEval (int offset)
put_arguments_n_b
(
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
)
void
GenJmpEval
(
void
)
{
{
put_instruction
(
Ijmp_eval
);
put_instruction
(
Ijmp_eval
);
}
}
void
GenJmpAp
(
int
n_args
)
{
put_instruction_b
(
jmp_ap
);
put_arguments_n_b
(
n_args
);
}
void
GenPopA
(
int
nr
)
void
GenPopA
(
int
nr
)
{
{
if
(
nr
>
0
){
if
(
nr
>
0
){
...
@@ -2633,6 +2648,13 @@ void GenNodeEntryDirective (int arity,Label label,Label label2)
...
@@ -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
)
void
GenLazyRecordNodeEntryDirective
(
int
arity
,
Label
label
)
{
{
if
(
DoStackLayout
){
if
(
DoStackLayout
){
...
@@ -3667,6 +3689,14 @@ void GenPB (char *function_name)
...
@@ -3667,6 +3689,14 @@ void GenPB (char *function_name)
FPrintF
(
OutFile
,
"
\"
%s
\"
"
,
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
)
void
GenPB_with_line_number
(
char
*
function_name
,
int
line_number
)
{
{
put_directive_
(
Dpb
);
put_directive_
(
Dpb
);
...
...
backendC/CleanCompilerSources/instructions.h
View file @
ca5850bb
...
@@ -87,8 +87,9 @@ void GenPushA (int offset);
...
@@ -87,8 +87,9 @@ void GenPushA (int offset);
void
GenPushB
(
int
offset
);
void
GenPushB
(
int
offset
);
void
GenJsrEval
(
int
offset
);
void
GenJsrEval
(
int
offset
);
void
GenJsrAp
(
int
n_args
);
void
GenJmpEval
(
void
);
void
GenJmpEval
(
void
);
void
GenJmpAp
(
int
n_args
);
void
GenPopA
(
int
nr
);
void
GenPopA
(
int
nr
);
void
GenPopB
(
int
nr
);
void
GenPopB
(
int
nr
);
...
@@ -157,6 +158,7 @@ void GenOStackLayout (int asize,int bsize,Args fun_args);
...
@@ -157,6 +158,7 @@ void GenOStackLayout (int asize,int bsize,Args fun_args);
void
GenNodeEntryDirective
(
int
arity
,
Label
label
,
Label
label2
);
void
GenNodeEntryDirective
(
int
arity
,
Label
label
,
Label
label2
);
void
GenNodeEntryDirectiveForLabelWithoutSymbol
(
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
GenNodeEntryDirectiveUnboxed
(
int
a_size
,
int
b_size
,
Label
label
,
Label
label2
);
void
GenApplyEntryDirective
(
int
arity
,
Label
label
);
void
GenLazyRecordNodeEntryDirective
(
int
arity
,
Label
label
);
void
GenLazyRecordNodeEntryDirective
(
int
arity
,
Label
label
);
void
GenFieldNodeEntryDirective
(
int
arity
,
Label
label
,
Label
label2
,
char
*
record_name
);
void
GenFieldNodeEntryDirective
(
int
arity
,
Label
label
,
Label
label2
,
char
*
record_name
);
void
GenConstructorDescriptorAndExport
(
SymbDef
sdef
);
void
GenConstructorDescriptorAndExport
(
SymbDef
sdef
);
...
@@ -213,6 +215,7 @@ void GenFillCaf (Label label,int a_stack_size,int b_stack_size);
...
@@ -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
GenCaf
(
Label
label
,
int
a_stack_size
,
int
b_stack_size
);
void
GenPB
(
char
*
function_name
);
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
GenPB_with_line_number
(
char
*
function_name
,
int
line_number
);
void
GenPD
(
void
);
void
GenPD
(
void
);
void
GenPN
(
void
);
void
GenPN
(
void
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment