1 //: Since different layers all carve out different parts of various namespaces 2 //: (recipes, memory, etc.) for their own use, there's no previous place where 3 //: we can lay out the big picture of what uses what. So we'll do that here 4 //: and just have to manually remember to update it when we move boundaries 5 //: around. 6 //: 7 //:: Memory 8 //: 9 //: Location 0 - unused (since it can help uncover bugs) 10 //: Locations 1-899 - reserved for tests 11 //: Locations 900-999 - reserved for predefined globals in Mu scenarios, like keyboard, screen, etc. 12 :(before "End Reset") 13 assert(Max_variables_in_scenarios == 900); 14 //: Locations 1000 ('Reserved_for_tests') onward - available to the allocator in chunks of size Initial_memory_per_routine. 15 assert(Reserved_for_tests == 1000); 16 17 //:: Recipes 18 //: 19 //: 0 - unused (IDLE; do nothing) 20 //: 1-199 - primitives 21 assert(MAX_PRIMITIVE_RECIPES < 200); 22 //: 200-999 - defined in .mu files as sequences of primitives 23 assert(Next_recipe_ordinal == 1000); 24 //: 1000 onwards - reserved for tests, cleared between tests 25 26 //:: Depths for tracing 27 //: 28 //: 0 - unused 29 //: 1-100 - app-level trace statements in Mu 30 //: 101-9989 - call-stack statements (mostly label run) 31 assert(Initial_callstack_depth == 101); 32 assert(Max_callstack_depth == 9989); 33 //: 9990-9999 - intra-instruction lines (mostly label mem) 34 35 //:: Summary of transforms and their dependencies 36 //: begin transforms 37 //: begin instruction inserting transforms 38 //: 52 insert fragments 39 //: ↳ 52.2 check fragments 40 //: --- 41 //: 53 rewrite 'stash' instructions 42 //: end instruction inserting transforms 43 //: 44 //: begin instruction modifying transforms 45 //: 56.2 check header ingredients 46 //: ↳ 56.4 fill in return ingredients 47 //: 48 check or set types by name 48 //: 49 //: begin type modifying transforms 50 //: 56.3 deduce types from header 51 //: --- 52 //: 30 check or set invalid containers 53 //: end type modifying transforms 54 //: ↱ 46 collect surrounding spaces 55 //: ↳ 42 transform names 56 //: ↳ 57 static dispatch 57 //: --- 58 //: 13 update instruction operation 59 //: 40 transform braces 60 //: 41 transform labels 61 //: end instruction modifying transforms 62 //: ↳ 60 check immutable ingredients 63 //: 64 //: begin checks 65 //: --- 66 //: 21 check instruction 67 //: ↳ 61 check indirect calls against header 68 //: ↳ 56 check calls against header 69 //: ↳ 43 transform 'new' to 'allocate' 70 //: 30 check merge calls 71 //: 36 check types of return instructions 72 //: 43 check default space 73 //: 56 check return instructions against header 74 //: end checks 75 //: end transforms 76 77 //:: Summary of type-checking in different phases 78 //: when dispatching instructions we accept first recipe that: 79 //: strictly matches all types 80 //: maps literal 0 or literal 1 to boolean for some ingredients 81 //: performs some other acceptable type conversion 82 //: literal 0 -> address 83 //: literal -> character 84 //: when checking instructions we ensure that types match, and that literals map to some scalar 85 //: (address can only map to literal 0) 86