From d55e77387fd9cc3eae2f17a6c1993f3bcb061a60 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 6 Nov 2017 01:28:53 -0800 Subject: 4117 - done with delimited continuations At least this particular implementation of them. Let's play with them now for a while, see if they're fully equivalent to shift/reduce. --- html/036refcount.cc.html | 50 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 24 deletions(-) (limited to 'html/036refcount.cc.html') diff --git a/html/036refcount.cc.html b/html/036refcount.cc.html index d8667152..8cb40e7a 100644 --- a/html/036refcount.cc.html +++ b/html/036refcount.cc.html @@ -1116,30 +1116,32 @@ if ('onhashchange' in window) { 1051 initial_num_refcount_updates = Total_refcount_updates; 1052 } 1053 :(before "End Non-primitive Call(caller_frame)") -1054 Num_refcount_updates[caller_frame.running_recipe][caller_frame.running_step_index] -1055 ¦ += (Total_refcount_updates - initial_num_refcount_updates); -1056 initial_num_refcount_updates = Total_refcount_updates; -1057 :(after "Begin Return") -1058 if (Run_profiler) { -1059 Num_refcount_updates[current_call().running_recipe][current_call().running_step_index] -1060 ¦ ¦ += (Total_refcount_updates - initial_num_refcount_updates); -1061 initial_num_refcount_updates = Total_refcount_updates; -1062 } -1063 :(before "End dump_profile") -1064 fout.open("profile.refcounts"); -1065 if (fout) { -1066 for (map<recipe_ordinal, recipe>::iterator p = Recipe.begin(); p != Recipe.end(); ++p) -1067 ¦ dump_recipe_profile(p->first, p->second, fout); -1068 } -1069 fout.close(); -1070 :(code) -1071 void dump_recipe_profile(recipe_ordinal ridx, const recipe& r, ostream& out) { -1072 out << "recipe " << r.name << " [\n"; -1073 for (int i = 0; i < SIZE(r.steps); ++i) { -1074 ¦ out << std::setw(6) << Num_refcount_updates[ridx][i] << ' ' << to_string(r.steps.at(i)) << '\n'; -1075 } -1076 out << "]\n\n"; -1077 } +1054 if (Run_profiler) { +1055 Num_refcount_updates[caller_frame.running_recipe][caller_frame.running_step_index] +1056 ¦ ¦ += (Total_refcount_updates - initial_num_refcount_updates); +1057 initial_num_refcount_updates = Total_refcount_updates; +1058 } +1059 :(after "Begin Return") +1060 if (Run_profiler) { +1061 Num_refcount_updates[current_call().running_recipe][current_call().running_step_index] +1062 ¦ ¦ += (Total_refcount_updates - initial_num_refcount_updates); +1063 initial_num_refcount_updates = Total_refcount_updates; +1064 } +1065 :(before "End dump_profile") +1066 fout.open("profile.refcounts"); +1067 if (fout) { +1068 for (map<recipe_ordinal, recipe>::iterator p = Recipe.begin(); p != Recipe.end(); ++p) +1069 ¦ dump_recipe_profile(p->first, p->second, fout); +1070 } +1071 fout.close(); +1072 :(code) +1073 void dump_recipe_profile(recipe_ordinal ridx, const recipe& r, ostream& out) { +1074 out << "recipe " << r.name << " [\n"; +1075 for (int i = 0; i < SIZE(r.steps); ++i) { +1076 ¦ out << std::setw(6) << Num_refcount_updates[ridx][i] << ' ' << to_string(r.steps.at(i)) << '\n'; +1077 } +1078 out << "]\n\n"; +1079 } -- cgit 1.4.1-2-gfad0