From a802f0cedc7b5580d746f46ae62fcf8074ae3c49 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 2 Mar 2017 04:41:24 -0800 Subject: 3749 --- html/034address.cc.html | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'html/034address.cc.html') diff --git a/html/034address.cc.html b/html/034address.cc.html index b014ca8b..c487ff0a 100644 --- a/html/034address.cc.html +++ b/html/034address.cc.html @@ -225,25 +225,25 @@ if ('onhashchange' in window) { 163 case NEW: { 164 const recipe& caller = get(Recipe, r); 165 if (inst.ingredients.empty() || SIZE(inst.ingredients) > 2) { -166 raise << maybe(caller.name) << "'new' requires one or two ingredients, but got '" << inst.original_string << "'\n" << end(); +166 raise << maybe(caller.name) << "'new' requires one or two ingredients, but got '" << inst.original_string << "'\n" << end(); 167 break; 168 } 169 // End NEW Check Special-cases 170 const reagent& type = inst.ingredients.at(0); 171 if (!is_mu_type_literal(type)) { -172 raise << maybe(caller.name) << "first ingredient of 'new' should be a type, but got '" << type.original_string << "'\n" << end(); +172 raise << maybe(caller.name) << "first ingredient of 'new' should be a type, but got '" << type.original_string << "'\n" << end(); 173 break; 174 } 175 if (SIZE(inst.ingredients) > 1 && !is_mu_number(inst.ingredients.at(1))) { -176 raise << maybe(caller.name) << "second ingredient of 'new' should be a number (array length), but got '" << type.original_string << "'\n" << end(); +176 raise << maybe(caller.name) << "second ingredient of 'new' should be a number (array length), but got '" << type.original_string << "'\n" << end(); 177 break; 178 } 179 if (inst.products.empty()) { -180 raise << maybe(caller.name) << "result of 'new' should never be ignored\n" << end(); +180 raise << maybe(caller.name) << "result of 'new' should never be ignored\n" << end(); 181 break; 182 } 183 if (!product_of_new_is_valid(inst)) { -184 raise << maybe(caller.name) << "product of 'new' has incorrect type: '" << inst.original_string << "'\n" << end(); +184 raise << maybe(caller.name) << "product of 'new' has incorrect type: '" << inst.original_string << "'\n" << end(); 185 break; 186 } 187 break; @@ -269,7 +269,7 @@ if ('onhashchange' in window) { 207 void drop_from_type(reagent& r, string expected_type) { 208 assert(!r.type->atom); 209 if (r.type->left->name != expected_type) { -210 raise << "can't drop2 " << expected_type << " from '" << to_string(r) << "'\n" << end(); +210 raise << "can't drop2 " << expected_type << " from '" << to_string(r) << "'\n" << end(); 211 return; 212 } 213 // r.type = r.type->right @@ -320,12 +320,12 @@ if ('onhashchange' in window) { 258 //: instructions left after the transforms have run. 259 :(before "End Primitive Recipe Checks") 260 case ALLOCATE: { -261 raise << "never call 'allocate' directly'; always use 'new'\n" << end(); +261 raise << "never call 'allocate' directly'; always use 'new'\n" << end(); 262 break; 263 } 264 :(before "End Primitive Recipe Implementations") 265 case NEW: { -266 raise << "no implementation for 'new'; why wasn't it translated to 'allocate'? Please save a copy of your program and send it to Kartik.\n" << end(); +266 raise << "no implementation for 'new'; why wasn't it translated to 'allocate'? Please save a copy of your program and send it to Kartik.\n" << end(); 267 break; 268 } 269 @@ -334,7 +334,7 @@ if ('onhashchange' in window) { 272 273 :(code) 274 void transform_new_to_allocate(const recipe_ordinal r) { -275 trace(9991, "transform") << "--- convert 'new' to 'allocate' for recipe " << get(Recipe, r).name << end(); +275 trace(9991, "transform") << "--- convert 'new' to 'allocate' for recipe " << get(Recipe, r).name << end(); 276 for (int i = 0; i < SIZE(get(Recipe, r).steps); ++i) { 277 instruction& inst = get(Recipe, r).steps.at(i); 278 // Convert 'new' To 'allocate' @@ -342,7 +342,7 @@ if ('onhashchange' in window) { 280 inst.operation = ALLOCATE; 281 type_tree* type = new_type_tree(inst.ingredients.at(0).name); 282 inst.ingredients.at(0).set_value(size_of(type)); -283 trace(9992, "new") << "size of '" << inst.ingredients.at(0).name << "' is " << inst.ingredients.at(0).value << end(); +283 trace(9992, "new") << "size of '" << inst.ingredients.at(0).name << "' is " << inst.ingredients.at(0).value << end(); 284 delete type; 285 } 286 } @@ -363,7 +363,7 @@ if ('onhashchange' in window) { 301 alloc = Memory_allocated_until; 302 Memory_allocated_until += Initial_memory_per_routine; 303 alloc_max = Memory_allocated_until; -304 trace(9999, "new") << "routine allocated memory from " << alloc << " to " << alloc_max << end(); +304 trace(9999, "new") << "routine allocated memory from " << alloc << " to " << alloc_max << end(); 305 306 :(before "End Primitive Recipe Declarations") 307 ALLOCATE, @@ -375,13 +375,13 @@ if ('onhashchange' in window) { 313 int size = ingredients.at(0).at(0); 314 if (SIZE(ingredients) > 1) { 315 // array allocation -316 trace(9999, "mem") << "array length is " << ingredients.at(1).at(0) << end(); +316 trace(9999, "mem") << "array length is " << ingredients.at(1).at(0) << end(); 317 size = /*space for length*/1 + size*ingredients.at(1).at(0); 318 } 319 int result = allocate(size); 320 if (SIZE(current_instruction().ingredients) > 1) { 321 // initialize array length -322 trace(9999, "mem") << "storing " << ingredients.at(1).at(0) << " in location " << result+/*skip refcount*/1 << end(); +322 trace(9999, "mem") << "storing " << ingredients.at(1).at(0) << " in location " << result+/*skip refcount*/1 << end(); 323 put(Memory, result+/*skip refcount*/1, ingredients.at(1).at(0)); 324 } 325 products.resize(1); @@ -392,7 +392,7 @@ if ('onhashchange' in window) { 330 int allocate(int size) { 331 // include space for refcount 332 ++size; -333 trace(9999, "mem") << "allocating size " << size << end(); +333 trace(9999, "mem") << "allocating size " << size << end(); 334 //? Total_alloc += size; 335 //? ++Num_alloc; 336 // Allocate Special-cases @@ -400,10 +400,10 @@ if ('onhashchange' in window) { 338 // really crappy at the moment 339 ensure_space(size); 340 const int result = Current_routine->alloc; -341 trace(9999, "mem") << "new alloc: " << result << end(); +341 trace(9999, "mem") << "new alloc: " << result << end(); 342 // initialize allocated space 343 for (int address = result; address < result+size; ++address) { -344 trace(9999, "mem") << "storing 0 in location " << address << end(); +344 trace(9999, "mem") << "storing 0 in location " << address << end(); 345 put(Memory, address, 0); 346 } 347 Current_routine->alloc += size; @@ -437,7 +437,7 @@ if ('onhashchange' in window) { 375 Current_routine->alloc = Memory_allocated_until; 376 Memory_allocated_until += Initial_memory_per_routine; 377 Current_routine->alloc_max = Memory_allocated_until; -378 trace(9999, "new") << "routine allocated memory from " << Current_routine->alloc << " to " << Current_routine->alloc_max << end(); +378 trace(9999, "new") << "routine allocated memory from " << Current_routine->alloc << " to " << Current_routine->alloc_max << end(); 379 } 380 } 381 -- cgit 1.4.1-2-gfad0