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/036refcount.cc.html | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'html/036refcount.cc.html') diff --git a/html/036refcount.cc.html b/html/036refcount.cc.html index 1f3b3fc7..41c7a557 100644 --- a/html/036refcount.cc.html +++ b/html/036refcount.cc.html @@ -107,7 +107,7 @@ if ('onhashchange' in window) { 44 assert(new_address >= 0); 45 if (new_address == 0) return; 46 int new_refcount = get_or_insert(Memory, new_address); - 47 trace(9999, "mem") << "incrementing refcount of " << new_address << ": " << new_refcount << " -> " << new_refcount+1 << end(); + 47 trace(9999, "mem") << "incrementing refcount of " << new_address << ": " << new_refcount << " -> " << new_refcount+1 << end(); 48 put(Memory, new_address, new_refcount+1); 49 } 50 @@ -124,16 +124,16 @@ if ('onhashchange' in window) { 61 assert(old_address >= 0); 62 if (old_address) { 63 int old_refcount = get_or_insert(Memory, old_address); - 64 trace(9999, "mem") << "decrementing refcount of " << old_address << ": " << old_refcount << " -> " << old_refcount-1 << end(); + 64 trace(9999, "mem") << "decrementing refcount of " << old_address << ": " << old_refcount << " -> " << old_refcount-1 << end(); 65 --old_refcount; 66 put(Memory, old_address, old_refcount); 67 if (old_refcount < 0) { 68 tb_shutdown(); 69 cerr << "Negative refcount!!! " << old_address << ' ' << old_refcount << '\n'; 70 if (Trace_stream) { - 71 cerr << "Saving trace to last_trace.\n"; + 71 cerr << "Saving trace to last_trace.\n"; 72 ofstream fout("last_trace"); - 73 fout << Trace_stream->readable_contents(""); + 73 fout << Trace_stream->readable_contents(""); 74 fout.close(); 75 } 76 exit(0); @@ -325,7 +325,7 @@ if ('onhashchange' in window) { 262 :(code) 263 bool operator<(const set<tag_condition_info>& a, const set<tag_condition_info>& b) { 264 if (a.size() != b.size()) return a.size() < b.size(); - 265 for (set<tag_condition_info>::const_iterator pa = a.begin(), pb = b.begin(); pa != a.end(); ++pa, ++pb) { + 265 for (set<tag_condition_info>::const_iterator pa = a.begin(), pb = b.begin(); pa != a.end(); ++pa, ++pb) { 266 if (pa->offset != pb->offset) return pa->offset < pb->offset; 267 if (pa->tag != pb->tag) return pa->tag < pb->tag; 268 } @@ -338,7 +338,7 @@ if ('onhashchange' in window) { 275 } 276 bool operator<(const set<address_element_info>& a, const set<address_element_info>& b) { 277 if (a.size() != b.size()) return a.size() < b.size(); - 278 for (set<address_element_info>::const_iterator pa = a.begin(), pb = b.begin(); pa != a.end(); ++pa, ++pb) { + 278 for (set<address_element_info>::const_iterator pa = a.begin(), pb = b.begin(); pa != a.end(); ++pa, ++pb) { 279 if (pa->offset != pb->offset) return pa->offset < pb->offset; 280 } 281 return false; // equal @@ -356,10 +356,10 @@ if ('onhashchange' in window) { 293 :(code) 294 void compute_container_address_offsets(const recipe_ordinal r) { 295 recipe& caller = get(Recipe, r); - 296 trace(9992, "transform") << "--- compute address offsets for " << caller.name << end(); + 296 trace(9992, "transform") << "--- compute address offsets for " << caller.name << end(); 297 for (int i = 0; i < SIZE(caller.steps); ++i) { 298 instruction& inst = caller.steps.at(i); - 299 trace(9993, "transform") << "- compute address offsets for " << to_string(inst) << end(); + 299 trace(9993, "transform") << "- compute address offsets for " << to_string(inst) << end(); 300 for (int i = 0; i < SIZE(inst.ingredients); ++i) 301 compute_container_address_offsets(inst.ingredients.at(i), " in '"+to_original_string(inst)+"'"); 302 for (int i = 0; i < SIZE(inst.products); ++i) @@ -380,7 +380,7 @@ if ('onhashchange' in window) { 317 if (!type) return; 318 if (!type->atom) { 319 if (!type->left->atom) { - 320 raise << "invalid type " << to_string(type) << location_for_error_messages << '\n' << end(); + 320 raise << "invalid type " << to_string(type) << location_for_error_messages << '\n' << end(); 321 return; 322 } 323 if (type->left->name == "address") @@ -404,13 +404,13 @@ if ('onhashchange' in window) { 341 void compute_container_address_offsets(const type_info& container_info, const type_tree* full_type, const string& location_for_error_messages) { 342 container_metadata& metadata = get(Container_metadata, full_type); 343 if (!metadata.address.empty()) return; - 344 trace(9994, "transform") << "compute address offsets for container " << container_info.name << end(); + 344 trace(9994, "transform") << "compute address offsets for container " << container_info.name << end(); 345 append_addresses(0, full_type, metadata.address, set<tag_condition_info>(), location_for_error_messages); 346 } 347 348 void compute_exclusive_container_address_offsets(const type_info& exclusive_container_info, const type_tree* full_type, const string& location_for_error_messages) { 349 container_metadata& metadata = get(Container_metadata, full_type); - 350 trace(9994, "transform") << "compute address offsets for exclusive container " << exclusive_container_info.name << end(); + 350 trace(9994, "transform") << "compute address offsets for exclusive container " << exclusive_container_info.name << end(); 351 for (int tag = 0; tag < SIZE(exclusive_container_info.elements); ++tag) { 352 set<tag_condition_info> key; 353 key.insert(tag_condition_info(/*tag is at offset*/0, tag)); @@ -428,11 +428,11 @@ if ('onhashchange' in window) { 365 const type_info& info = get(Type, base_type->value); 366 if (info.kind == CONTAINER) { 367 for (int curr_index = 0, curr_offset = base_offset; curr_index < SIZE(info.elements); ++curr_index) { - 368 trace(9993, "transform") << "checking container " << base_type->name << ", element " << curr_index << end(); + 368 trace(9993, "transform") << "checking container " << base_type->name << ", element " << curr_index << end(); 369 reagent/*copy*/ element = element_type(type, curr_index); // not base_type 370 // Compute Container Address Offset(element) 371 if (is_mu_address(element)) { - 372 trace(9993, "transform") << "address at offset " << curr_offset << end(); + 372 trace(9993, "transform") << "address at offset " << curr_offset << end(); 373 get_or_insert(out, key).insert(address_element_info(curr_offset, new type_tree(*payload_type(element.type)))); 374 ++curr_offset; 375 } @@ -757,26 +757,26 @@ if ('onhashchange' in window) { 694 :(before "End Increment Refcounts(canonized_x)") 695 if (is_mu_container(canonized_x) || is_mu_exclusive_container(canonized_x)) { 696 const container_metadata& metadata = get(Container_metadata, canonized_x.type); - 697 for (map<set<tag_condition_info>, set<address_element_info> >::const_iterator p = metadata.address.begin(); p != metadata.address.end(); ++p) { + 697 for (map<set<tag_condition_info>, set<address_element_info> >::const_iterator p = metadata.address.begin(); p != metadata.address.end(); ++p) { 698 if (!all_match(data, p->first)) continue; - 699 for (set<address_element_info>::const_iterator info = p->second.begin(); info != p->second.end(); ++info) + 699 for (set<address_element_info>::const_iterator info = p->second.begin(); info != p->second.end(); ++info) 700 increment_refcount(data.at(info->offset)); 701 } 702 } 703 704 :(before "End Decrement Refcounts(canonized_x)") 705 if (is_mu_container(canonized_x) || is_mu_exclusive_container(canonized_x)) { - 706 trace(9999, "mem") << "need to read old value of '" << to_string(canonized_x) << "' to figure out what refcounts to decrement" << end(); + 706 trace(9999, "mem") << "need to read old value of '" << to_string(canonized_x) << "' to figure out what refcounts to decrement" << end(); 707 // read from canonized_x but without canonizing again 708 // todo: inline without running canonize all over again 709 reagent/*copy*/ tmp = canonized_x; 710 tmp.properties.push_back(pair<string, string_tree*>("raw", NULL)); 711 vector<double> data = read_memory(tmp); - 712 trace(9999, "mem") << "done reading old value of '" << to_string(canonized_x) << "'" << end(); + 712 trace(9999, "mem") << "done reading old value of '" << to_string(canonized_x) << "'" << end(); 713 const container_metadata& metadata = get(Container_metadata, canonized_x.type); - 714 for (map<set<tag_condition_info>, set<address_element_info> >::const_iterator p = metadata.address.begin(); p != metadata.address.end(); ++p) { + 714 for (map<set<tag_condition_info>, set<address_element_info> >::const_iterator p = metadata.address.begin(); p != metadata.address.end(); ++p) { 715 if (!all_match(data, p->first)) continue; - 716 for (set<address_element_info>::const_iterator info = p->second.begin(); info != p->second.end(); ++info) { + 716 for (set<address_element_info>::const_iterator info = p->second.begin(); info != p->second.end(); ++info) { 717 int element_address = get_or_insert(Memory, canonized_x.value + info->offset); 718 reagent/*local*/ element; 719 element.set_value(element_address+/*skip refcount*/1); @@ -788,7 +788,7 @@ if ('onhashchange' in window) { 725 726 :(code) 727 bool all_match(const vector<double>& data, const set<tag_condition_info>& conditions) { - 728 for (set<tag_condition_info>::const_iterator p = conditions.begin(); p != conditions.end(); ++p) { + 728 for (set<tag_condition_info>::const_iterator p = conditions.begin(); p != conditions.end(); ++p) { 729 if (data.at(p->offset) != p->tag) 730 return false; 731 } -- cgit 1.4.1-2-gfad0