Skip to content

Commit

Permalink
Нюансы профилировщика и некоторые другие нюансы
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazdaywik committed Mar 5, 2018
1 parent 0c90f23 commit 9fac618
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/compiler/HighLevelRASL-Condition.sref
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ $ENTRY SentenceTail{
)
: e.CmdSentenceCommands

= e.CondResultCommands e.CmdSentenceCommands
= e.CondResultCommands
(#CmdProfilerStopSentence)
(#CmdProfileFunction)
e.CmdSentenceCommands
: e.SentenceCommands

= s.StackTop e.SentenceCommands;
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/HighLevelRASL.sref
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $ENTRY HighLevelRASL {
((e.Pattern) e.Conditions (e.Result))
= <Map
{
(#Condition (e.Name) (e.Result^) (e.Pattern^))
(#Condition (e.Name^) (e.Result^) (e.Pattern^))
= (#CmdEnum #GN-Local e.Name);
}
e.Conditions
Expand Down
1 change: 1 addition & 0 deletions src/compiler/Opcodes.sref
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ $ENTRY NumberFromOpcode{
#CmdPerformNative = 109;
#CmdScale = 111;
#CmdVariableDebugOffset = 112;
#CmdSpliceToFreeList-Range = 115;
}

$ENTRY NumberFromBracket{
Expand Down
14 changes: 12 additions & 2 deletions src/srlib/refalrts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ refalrts::Iter refalrts::call_left(
refalrts::Iter right_bracket = last;
refalrts::Iter function = next(left_bracket);

assert(left_bracket->link_info == right_bracket);
// TODO: проверить после завершения разработки условий
//assert(left_bracket->link_info == right_bracket);

if (next(function) != right_bracket) {
res_first = next(function);
Expand Down Expand Up @@ -2007,7 +2008,16 @@ int refalrts::profiler::reverse_compare(

void refalrts::profiler::start_generated_function() {
clock_t now = clock();
refalrts_profiler_assert_eq(g_current_state, cInRuntime);
// TODO: проверить после завершения разработки условий
//refalrts_profiler_assert_eq(g_current_state, cInRuntime);
switch (g_current_state) {
case cInRuntime:
case cInResultLinear:
break;

default:
refalrts_switch_default_violation(g_current_state);
}
g_counters[cCounter_RuntimeTime] += (now - g_prev_cutoff);
g_prev_cutoff = now;
g_current_state = cInPatternLinear;
Expand Down

0 comments on commit 9fac618

Please sign in to comment.