From bfa3f5ba3930fb3919d94e97929a2b962d104e10 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 2 Jun 2017 00:44:32 -0700 Subject: 3900 --- html/032array.cc.html | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'html/032array.cc.html') diff --git a/html/032array.cc.html b/html/032array.cc.html index ea348527..cf144ab1 100644 --- a/html/032array.cc.html +++ b/html/032array.cc.html @@ -114,7 +114,7 @@ if ('onhashchange' in window) { 49 } 50 :(before "End Primitive Recipe Implementations") 51 case CREATE_ARRAY: { - 52 reagent/*copy*/ product = current_instruction().products.at(0); + 52 reagent/*copy*/ product = current_instruction().products.at(0); 53 // Update CREATE_ARRAY product in Run 54 int base_address = product.value; 55 type_tree* array_length_from_type = product.type->right->right; @@ -171,7 +171,7 @@ if ('onhashchange' in window) { 106 :(before "End size_of(reagent r) Special-cases") 107 if (!r.type->atom && r.type->left->atom && r.type->left->value == get(Type_ordinal, "array")) { 108 if (!r.type->right) { -109 ¦ raise << maybe(current_recipe_name()) << "'" << r.original_string << "' is an array of what?\n" << end(); +109 ¦ raise << maybe(current_recipe_name()) << "'" << r.original_string << "' is an array of what?\n" << end(); 110 ¦ return 1; 111 } 112 return /*space for length*/1 + array_length(r)*size_of(array_element(r.type)); @@ -239,8 +239,8 @@ if ('onhashchange' in window) { 174 //: disable the size mismatch check for 'merge' instructions since containers 175 //: can contain arrays, and since we already do plenty of checking for them 176 :(before "End size_mismatch(x) Special-cases") -177 if (current_call().running_step_index < SIZE(get(Recipe, current_call().running_recipe).steps) -178 ¦ && current_instruction().operation == MERGE) { +177 if (current_call().running_step_index < SIZE(get(Recipe, current_call().running_recipe).steps) +178 ¦ && current_instruction().operation == MERGE) { 179 return false; 180 } 181 @@ -414,19 +414,19 @@ if ('onhashchange' in window) { 349 } 350 :(before "End Primitive Recipe Implementations") 351 case INDEX: { -352 reagent/*copy*/ base = current_instruction().ingredients.at(0); +352 reagent/*copy*/ base = current_instruction().ingredients.at(0); 353 // Update INDEX base in Run 354 int base_address = base.value; 355 trace(9998, "run") << "base address is " << base_address << end(); 356 if (base_address == 0) { -357 ¦ raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); +357 ¦ raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); 358 ¦ break; 359 } -360 reagent/*copy*/ index = current_instruction().ingredients.at(1); +360 reagent/*copy*/ index = current_instruction().ingredients.at(1); 361 // Update INDEX index in Run 362 vector<double> index_val(read_memory(index)); 363 if (index_val.at(0) < 0 || index_val.at(0) >= get_or_insert(Memory, base_address)) { -364 ¦ raise << maybe(current_recipe_name()) << "invalid index " << no_scientific(index_val.at(0)) << " in '" << to_original_string(current_instruction()) << "'\n" << end(); +364 ¦ raise << maybe(current_recipe_name()) << "invalid index " << no_scientific(index_val.at(0)) << " in '" << to_original_string(current_instruction()) << "'\n" << end(); 365 ¦ break; 366 } 367 reagent/*local*/ element; @@ -605,18 +605,18 @@ if ('onhashchange' in window) { 540 } 541 :(before "End Primitive Recipe Implementations") 542 case PUT_INDEX: { -543 reagent/*copy*/ base = current_instruction().ingredients.at(0); +543 reagent/*copy*/ base = current_instruction().ingredients.at(0); 544 // Update PUT_INDEX base in Run 545 int base_address = base.value; 546 if (base_address == 0) { -547 ¦ raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); +547 ¦ raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); 548 ¦ break; 549 } -550 reagent/*copy*/ index = current_instruction().ingredients.at(1); +550 reagent/*copy*/ index = current_instruction().ingredients.at(1); 551 // Update PUT_INDEX index in Run 552 vector<double> index_val(read_memory(index)); 553 if (index_val.at(0) < 0 || index_val.at(0) >= get_or_insert(Memory, base_address)) { -554 ¦ raise << maybe(current_recipe_name()) << "invalid index " << no_scientific(index_val.at(0)) << " in '" << to_original_string(current_instruction()) << "'\n" << end(); +554 ¦ raise << maybe(current_recipe_name()) << "invalid index " << no_scientific(index_val.at(0)) << " in '" << to_original_string(current_instruction()) << "'\n" << end(); 555 ¦ break; 556 } 557 int address = base_address + /*skip length*/1 + index_val.at(0)*size_of(array_element(base.type)); @@ -624,7 +624,7 @@ if ('onhashchange' in window) { 559 // optimization: directly write the element rather than updating 'product' 560 // and writing the entire array 561 write_products = false; -562 vector<double> value = read_memory(current_instruction().ingredients.at(2)); +562 vector<double> value = read_memory(current_instruction().ingredients.at(2)); 563 // Write Memory in PUT_INDEX in Run 564 for (int i = 0; i < SIZE(value); ++i) { 565 ¦ trace(9999, "mem") << "storing " << no_scientific(value.at(i)) << " in location " << address+i << end(); @@ -705,10 +705,10 @@ if ('onhashchange' in window) { 640 } 641 :(before "End Primitive Recipe Implementations") 642 case LENGTH: { -643 reagent/*copy*/ array = current_instruction().ingredients.at(0); +643 reagent/*copy*/ array = current_instruction().ingredients.at(0); 644 // Update LENGTH array in Run 645 if (array.value == 0) { -646 ¦ raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); +646 ¦ raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); 647 ¦ break; 648 } 649 products.resize(1); @@ -719,7 +719,7 @@ if ('onhashchange' in window) { 654 //: optimization: none of the instructions in this layer use 'ingredients' so 655 //: stop copying potentially huge arrays into it. 656 :(before "End should_copy_ingredients Special-cases") -657 recipe_ordinal r = current_instruction().operation; +657 recipe_ordinal r = current_instruction().operation; 658 if (r == CREATE_ARRAY || r == INDEX || r == PUT_INDEX || r == LENGTH) 659 return false; -- cgit 1.4.1-2-gfad0