From fd7d8138a4ff5515f9b79c584a98d5c26d8ddb8a Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 2 Mar 2017 05:48:01 -0800 Subject: 3750 --- html/073wait.cc.html | 68 ++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'html/073wait.cc.html') diff --git a/html/073wait.cc.html b/html/073wait.cc.html index 914b47b8..c2569b5a 100644 --- a/html/073wait.cc.html +++ b/html/073wait.cc.html @@ -97,15 +97,15 @@ if ('onhashchange' in window) { 34 35 :(before "End Mu Test Teardown") 36 if (Passed && any_routines_waiting()) - 37 raise << Current_scenario->name << ": deadlock!\n" << end(); + 37 raise << Current_scenario->name << ": deadlock!\n" << end(); 38 :(before "End Run Routine") 39 if (any_routines_waiting()) { - 40 raise << "deadlock!\n" << end(); + 40 raise << "deadlock!\n" << end(); 41 dump_waiting_routines(); 42 } 43 :(before "End Test Teardown") 44 if (Passed && any_routines_with_error()) - 45 raise << "some routines died with errors\n" << end(); + 45 raise << "some routines died with errors\n" << end(); 46 :(code) 47 bool any_routines_waiting() { 48 for (int i = 0; i < SIZE(Routines); ++i) { @@ -141,24 +141,24 @@ if ('onhashchange' in window) { 78 :(before "End Primitive Recipe Checks") 79 case WAIT_FOR_RESET_THEN_SET: { 80 if (SIZE(inst.ingredients) != 1) { - 81 raise << maybe(get(Recipe, r).name) << "'wait-for-reset-then-set' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); + 81 raise << maybe(get(Recipe, r).name) << "'wait-for-reset-then-set' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); 82 break; 83 } 84 if (!is_mu_location(inst.ingredients.at(0))) { - 85 raise << maybe(get(Recipe, r).name) << "'wait-for-reset-then-set' requires a location ingredient, but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); + 85 raise << maybe(get(Recipe, r).name) << "'wait-for-reset-then-set' requires a location ingredient, but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); 86 } 87 break; 88 } 89 :(before "End Primitive Recipe Implementations") 90 case WAIT_FOR_RESET_THEN_SET: { 91 int loc = static_cast<int>(ingredients.at(0).at(0)); - 92 trace(9998, "run") << "wait: *" << loc << " = " << get_or_insert(Memory, loc) << end(); + 92 trace(9998, "run") << "wait: *" << loc << " = " << get_or_insert(Memory, loc) << end(); 93 if (get_or_insert(Memory, loc) == 0) { - 94 trace(9998, "run") << "location " << loc << " is already 0; setting" << end(); + 94 trace(9998, "run") << "location " << loc << " is already 0; setting" << end(); 95 put(Memory, loc, 1); 96 break; 97 } - 98 trace(9998, "run") << "waiting for location " << loc << " to reset" << end(); + 98 trace(9998, "run") << "waiting for location " << loc << " to reset" << end(); 99 Current_routine->state = WAITING; 100 Current_routine->waiting_on_location = loc; 101 break; @@ -172,11 +172,11 @@ if ('onhashchange' in window) { 109 :(before "End Primitive Recipe Checks") 110 case RESET: { 111 if (SIZE(inst.ingredients) != 1) { -112 raise << maybe(get(Recipe, r).name) << "'reset' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); +112 raise << maybe(get(Recipe, r).name) << "'reset' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); 113 break; 114 } 115 if (!is_mu_location(inst.ingredients.at(0))) { -116 raise << maybe(get(Recipe, r).name) << "'reset' requires a location ingredient, but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); +116 raise << maybe(get(Recipe, r).name) << "'reset' requires a location ingredient, but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); 117 } 118 break; 119 } @@ -184,7 +184,7 @@ if ('onhashchange' in window) { 121 case RESET: { 122 int loc = static_cast<int>(ingredients.at(0).at(0)); 123 put(Memory, loc, 0); -124 trace(9998, "run") << "reset: *" << loc << " = " << get_or_insert(Memory, loc) << end(); +124 trace(9998, "run") << "reset: *" << loc << " = " << get_or_insert(Memory, loc) << end(); 125 break; 126 } 127 @@ -195,7 +195,7 @@ if ('onhashchange' in window) { 132 if (Routines.at(i)->state != WAITING) continue; 133 int loc = Routines.at(i)->waiting_on_location; 134 if (loc && get_or_insert(Memory, loc) == 0) { -135 trace(9999, "schedule") << "waking up routine " << Routines.at(i)->id << end(); +135 trace(9999, "schedule") << "waking up routine " << Routines.at(i)->id << end(); 136 put(Memory, loc, 1); 137 Routines.at(i)->state = RUNNING; 138 Routines.at(i)->waiting_on_location = 0; @@ -221,24 +221,24 @@ if ('onhashchange' in window) { 158 :(before "End Primitive Recipe Checks") 159 case GET_LOCATION: { 160 if (SIZE(inst.ingredients) != 2) { -161 raise << maybe(get(Recipe, r).name) << "'get-location' expects exactly 2 ingredients in '" << inst.original_string << "'\n" << end(); +161 raise << maybe(get(Recipe, r).name) << "'get-location' expects exactly 2 ingredients in '" << inst.original_string << "'\n" << end(); 162 break; 163 } 164 reagent/*copy*/ base = inst.ingredients.at(0); 165 if (!canonize_type(base)) break; 166 if (!base.type) { -167 raise << maybe(get(Recipe, r).name) << "first ingredient of 'get-location' should be a container, but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); +167 raise << maybe(get(Recipe, r).name) << "first ingredient of 'get-location' should be a container, but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); 168 break; 169 } 170 const type_tree* base_root_type = base.type->atom ? base.type : base.type->left; 171 if (!base_root_type->atom || base_root_type->value == 0 || !contains_key(Type, base_root_type->value) || get(Type, base_root_type->value).kind != CONTAINER) { -172 raise << maybe(get(Recipe, r).name) << "first ingredient of 'get-location' should be a container, but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); +172 raise << maybe(get(Recipe, r).name) << "first ingredient of 'get-location' should be a container, but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); 173 break; 174 } 175 type_ordinal base_type = base.type->value; 176 const reagent& offset = inst.ingredients.at(1); 177 if (!is_literal(offset) || !is_mu_scalar(offset)) { -178 raise << maybe(get(Recipe, r).name) << "second ingredient of 'get-location' should have type 'offset', but got '" << inst.ingredients.at(1).original_string << "'\n" << end(); +178 raise << maybe(get(Recipe, r).name) << "second ingredient of 'get-location' should have type 'offset', but got '" << inst.ingredients.at(1).original_string << "'\n" << end(); 179 break; 180 } 181 int offset_value = 0; @@ -246,7 +246,7 @@ if ('onhashchange' in window) { 183 if (is_integer(offset.name)) { 184 offset_value = to_integer(offset.name); 185 if (offset_value < 0 || offset_value >= SIZE(get(Type, base_type).elements)) { -186 raise << maybe(get(Recipe, r).name) << "invalid offset " << offset_value << " for '" << get(Type, base_type).name << "'\n" << end(); +186 raise << maybe(get(Recipe, r).name) << "invalid offset " << offset_value << " for '" << get(Type, base_type).name << "'\n" << end(); 187 break; 188 } 189 } @@ -255,7 +255,7 @@ if ('onhashchange' in window) { 192 } 193 if (inst.products.empty()) break; 194 if (!is_mu_location(inst.products.at(0))) { -195 raise << maybe(get(Recipe, r).name) << "'get-location " << base.original_string << ", " << offset.original_string << "' should write to type location but '" << inst.products.at(0).name << "' has type '" << names_to_string_without_quotes(inst.products.at(0).type) << "'\n" << end(); +195 raise << maybe(get(Recipe, r).name) << "'get-location " << base.original_string << ", " << offset.original_string << "' should write to type location but '" << inst.products.at(0).name << "' has type '" << names_to_string_without_quotes(inst.products.at(0).type) << "'\n" << end(); 196 break; 197 } 198 break; @@ -266,7 +266,7 @@ if ('onhashchange' in window) { 203 canonize(base); 204 int base_address = base.value; 205 if (base_address == 0) { -206 raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); +206 raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); 207 break; 208 } 209 const type_tree* base_type = get_base_type(base.type); @@ -275,7 +275,7 @@ if ('onhashchange' in window) { 212 int result = base_address; 213 for (int i = 0; i < offset; ++i) 214 result += size_of(element_type(base.type, i)); -215 trace(9998, "run") << "address to copy is " << result << end(); +215 trace(9998, "run") << "address to copy is " << result << end(); 216 products.resize(1); 217 products.at(0).push_back(result); 218 break; @@ -388,11 +388,11 @@ if ('onhashchange' in window) { 325 :(before "End Primitive Recipe Checks") 326 case WAIT_FOR_ROUTINE: { 327 if (SIZE(inst.ingredients) != 1) { -328 raise << maybe(get(Recipe, r).name) << "'wait-for-routine' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); +328 raise << maybe(get(Recipe, r).name) << "'wait-for-routine' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); 329 break; 330 } 331 if (!is_mu_number(inst.ingredients.at(0))) { -332 raise << maybe(get(Recipe, r).name) << "first ingredient of 'wait-for-routine' should be a routine id generated by 'start-running', but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); +332 raise << maybe(get(Recipe, r).name) << "first ingredient of 'wait-for-routine' should be a routine id generated by 'start-running', but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); 333 break; 334 } 335 break; @@ -400,12 +400,12 @@ if ('onhashchange' in window) { 337 :(before "End Primitive Recipe Implementations") 338 case WAIT_FOR_ROUTINE: { 339 if (ingredients.at(0).at(0) == Current_routine->id) { -340 raise << maybe(current_recipe_name()) << "routine can't wait for itself! '" << to_original_string(current_instruction()) << "'\n" << end(); +340 raise << maybe(current_recipe_name()) << "routine can't wait for itself! '" << to_original_string(current_instruction()) << "'\n" << end(); 341 break; 342 } 343 Current_routine->state = WAITING; 344 Current_routine->waiting_on_routine = ingredients.at(0).at(0); -345 trace(9998, "run") << "waiting for routine " << ingredients.at(0).at(0) << end(); +345 trace(9998, "run") << "waiting for routine " << ingredients.at(0).at(0) << end(); 346 break; 347 } 348 @@ -423,7 +423,7 @@ if ('onhashchange' in window) { 360 const routine* waitee = Routines.at(j); 361 if (waitee->id == id && waitee->state != RUNNING && waitee->state != WAITING) { 362 // routine is COMPLETED or DISCONTINUED -363 trace(9999, "schedule") << "waking up routine " << waiter->id << end(); +363 trace(9999, "schedule") << "waking up routine " << waiter->id << end(); 364 waiter->state = RUNNING; 365 waiter->waiting_on_routine = 0; 366 } @@ -487,7 +487,7 @@ if ('onhashchange' in window) { 424 :(before "End Primitive Recipe Checks") 425 case CURRENT_ROUTINE_IS_BLOCKED: { 426 if (!inst.ingredients.empty()) { -427 raise << maybe(get(Recipe, r).name) << "'current-routine-is-blocked' should have no ingredients, but got '" << inst.original_string << "'\n" << end(); +427 raise << maybe(get(Recipe, r).name) << "'current-routine-is-blocked' should have no ingredients, but got '" << inst.original_string << "'\n" << end(); 428 break; 429 } 430 break; @@ -505,7 +505,7 @@ if ('onhashchange' in window) { 442 :(before "End Primitive Recipe Checks") 443 case CURRENT_ROUTINE_IS_UNBLOCKED: { 444 if (!inst.ingredients.empty()) { -445 raise << maybe(get(Recipe, r).name) << "'current-routine-is-unblocked' should have no ingredients, but got '" << inst.original_string << "'\n" << end(); +445 raise << maybe(get(Recipe, r).name) << "'current-routine-is-unblocked' should have no ingredients, but got '" << inst.original_string << "'\n" << end(); 446 break; 447 } 448 break; @@ -550,11 +550,11 @@ if ('onhashchange' in window) { 487 :(before "End Primitive Recipe Checks") 488 case WAIT_FOR_ROUTINE_TO_BLOCK: { 489 if (SIZE(inst.ingredients) != 1) { -490 raise << maybe(get(Recipe, r).name) << "'wait-for-routine-to-block' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); +490 raise << maybe(get(Recipe, r).name) << "'wait-for-routine-to-block' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); 491 break; 492 } 493 if (!is_mu_number(inst.ingredients.at(0))) { -494 raise << maybe(get(Recipe, r).name) << "first ingredient of 'wait-for-routine-to-block' should be a routine id generated by 'start-running', but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); +494 raise << maybe(get(Recipe, r).name) << "first ingredient of 'wait-for-routine-to-block' should be a routine id generated by 'start-running', but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); 495 break; 496 } 497 break; @@ -562,12 +562,12 @@ if ('onhashchange' in window) { 499 :(before "End Primitive Recipe Implementations") 500 case WAIT_FOR_ROUTINE_TO_BLOCK: { 501 if (ingredients.at(0).at(0) == Current_routine->id) { -502 raise << maybe(current_recipe_name()) << "routine can't wait for itself! '" << to_original_string(current_instruction()) << "'\n" << end(); +502 raise << maybe(current_recipe_name()) << "routine can't wait for itself! '" << to_original_string(current_instruction()) << "'\n" << end(); 503 break; 504 } 505 Current_routine->state = WAITING; 506 Current_routine->waiting_on_routine_to_block = ingredients.at(0).at(0); -507 trace(9998, "run") << "waiting for routine " << ingredients.at(0).at(0) << " to block" << end(); +507 trace(9998, "run") << "waiting for routine " << ingredients.at(0).at(0) << " to block" << end(); 508 break; 509 } 510 @@ -583,7 +583,7 @@ if ('onhashchange' in window) { 520 const routine* waitee = Routines.at(j); 521 if (waitee->id != id) continue; 522 if (waitee->state != RUNNING || waitee->blocked) { -523 trace(9999, "schedule") << "waking up routine " << waiter->id << " because routine " << waitee->id << " is blocked" << end(); +523 trace(9999, "schedule") << "waking up routine " << waiter->id << " because routine " << waitee->id << " is blocked" << end(); 524 waiter->state = RUNNING; 525 waiter->waiting_on_routine_to_block = 0; 526 } @@ -599,11 +599,11 @@ if ('onhashchange' in window) { 536 :(before "End Primitive Recipe Checks") 537 case RESTART: { 538 if (SIZE(inst.ingredients) != 1) { -539 raise << maybe(get(Recipe, r).name) << "'restart' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); +539 raise << maybe(get(Recipe, r).name) << "'restart' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); 540 break; 541 } 542 if (!is_mu_number(inst.ingredients.at(0))) { -543 raise << maybe(get(Recipe, r).name) << "first ingredient of 'restart' should be a routine id generated by 'start-running', but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); +543 raise << maybe(get(Recipe, r).name) << "first ingredient of 'restart' should be a routine id generated by 'start-running', but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); 544 break; 545 } 546 break; -- cgit 1.4.1-2-gfad0