From ffc9e66b3505990009e47b461eb03d3eb1635258 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 5 Nov 2017 02:00:26 -0800 Subject: 4109 --- html/032array.cc.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'html/032array.cc.html') diff --git a/html/032array.cc.html b/html/032array.cc.html index 82126414..6e0fdf4a 100644 --- a/html/032array.cc.html +++ b/html/032array.cc.html @@ -122,7 +122,7 @@ if ('onhashchange' in window) { 57 ¦ array_length_from_type = array_length_from_type->left; 58 int array_length = to_integer(array_length_from_type->name); 59 // initialize array length, so that size_of will work - 60 trace(9999, "mem") << "storing " << array_length << " in location " << base_address << end(); + 60 trace("mem") << "storing " << array_length << " in location " << base_address << end(); 61 put(Memory, base_address, array_length); // in array elements 62 int size = size_of(product); // in locations 63 trace(9998, "run") << "creating array of size " << size << end(); @@ -289,7 +289,7 @@ if ('onhashchange' in window) { 224 reagent container("x:point"); 225 CHECK(!contains_key(Container_metadata, container.type)); 226 // scanning an address to an array of the container precomputes the size of the container -227 reagent r("x:address:array:point"); +227 reagent r("x:address:array:point"); 228 compute_container_sizes(r, ""); 229 CHECK(contains_key(Container_metadata, container.type)); 230 CHECK_EQ(get(Container_metadata, container.type).size, 2); @@ -313,7 +313,7 @@ if ('onhashchange' in window) { 248 reagent container("x:point"); 249 int old_size = SIZE(Container_metadata); 250 // scanning an address to an array of the container precomputes the size of the container -251 reagent r("x:address:array:point:10"); +251 reagent r("x:address:array:point:10"); 252 compute_container_sizes(r, ""); 253 CHECK(contains_key(Container_metadata, container.type)); 254 CHECK_EQ(get(Container_metadata, container.type).size, 2); @@ -326,7 +326,7 @@ if ('onhashchange' in window) { 261 reagent container("x:point"); 262 int old_size = SIZE(Container_metadata); 263 // scanning repeated address and array types modifying the container precomputes the size of the container -264 reagent r("x:address:array:address:array:point:10"); +264 reagent r("x:address:array:address:array:point:10"); 265 compute_container_sizes(r, ""); 266 CHECK(contains_key(Container_metadata, container.type)); 267 CHECK_EQ(get(Container_metadata, container.type).size, 2); @@ -339,7 +339,7 @@ if ('onhashchange' in window) { 274 reagent container("x:point"); 275 int old_size = SIZE(Container_metadata); 276 // scanning address to array with a typo -277 reagent r("x:address:array:adress:number"); +277 reagent r("x:address:array:adress:number"); 278 compute_container_sizes(r, ""); // should not crash 279 // no non-container types precomputed 280 CHECK_EQ(SIZE(Container_metadata), old_size); @@ -359,11 +359,11 @@ if ('onhashchange' in window) { 294 295 :(scenario index_compound_element) 296 def main [ -297 {1: (array (address number) 3)} <- create-array +297 {1: (array (address number) 3)} <- create-array 298 2:num <- copy 14 299 3:num <- copy 15 300 4:num <- copy 16 -301 5:address:num <- index {1: (array (address number) 3)}, 0 +301 5:address:num <- index {1: (array (address number) 3)}, 0 302 ] 303 +mem: storing 14 in location 5 304 @@ -416,7 +416,7 @@ if ('onhashchange' in window) { 351 reagent/*copy*/ base = current_instruction().ingredients.at(0); 352 // Update INDEX base in Run 353 int base_address = base.value; -354 trace(9998, "run") << "base address is " << base_address << end(); +354 trace(9998, "run") << "base address is " << base_address << end(); 355 if (base_address == 0) { 356 ¦ raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); 357 ¦ break; @@ -477,7 +477,7 @@ if ('onhashchange' in window) { 412 put(Memory, 2, 14); 413 put(Memory, 3, 15); 414 put(Memory, 4, 16); -415 reagent x("1:array:address:num"); // 3 types, but not a static array +415 reagent x("1:array:address:num"); // 3 types, but not a static array 416 populate_value(x); 417 CHECK_EQ(array_length(x), 3); 418 } @@ -618,15 +618,15 @@ if ('onhashchange' in window) { 553 ¦ raise << maybe(current_recipe_name()) << "invalid index " << no_scientific(index_val.at(0)) << " in '" << to_original_string(current_instruction()) << "'\n" << end(); 554 ¦ break; 555 } -556 int address = base_address + /*skip length*/1 + index_val.at(0)*size_of(array_element(base.type)); -557 trace(9998, "run") << "address to copy to is " << address << end(); +556 int address = base_address + /*skip length*/1 + index_val.at(0)*size_of(array_element(base.type)); +557 trace(9998, "run") << "address to copy to is " << address << end(); 558 // optimization: directly write the element rather than updating 'product' 559 // and writing the entire array 560 write_products = false; 561 vector<double> value = read_memory(current_instruction().ingredients.at(2)); 562 // Write Memory in PUT_INDEX in Run 563 for (int i = 0; i < SIZE(value); ++i) { -564 ¦ trace(9999, "mem") << "storing " << no_scientific(value.at(i)) << " in location " << address+i << end(); +564 ¦ trace("mem") << "storing " << no_scientific(value.at(i)) << " in location " << address+i << end(); 565 ¦ put(Memory, address+i, value.at(i)); 566 } 567 break; -- cgit 1.4.1-2-gfad0