2015-05-04 19:11:51 +00:00
|
|
|
//: Since different layers all carve out different parts of various namespaces
|
|
|
|
//: (recipes, memory, etc.) for their own use, there's no previous place where
|
2015-05-04 19:19:53 +00:00
|
|
|
//: we can lay out the big picture of what uses what. So we'll do that here
|
|
|
|
//: and just have to manually remember to update it when we move boundaries
|
|
|
|
//: around.
|
2015-05-04 19:11:51 +00:00
|
|
|
//:
|
|
|
|
//:: Memory
|
|
|
|
//:
|
|
|
|
//: Location 0 - unused (since it can help uncover bugs)
|
2015-05-04 19:19:53 +00:00
|
|
|
//: Locations 1-899 - reserved for tests
|
2016-10-22 23:56:07 +00:00
|
|
|
//: Locations 900-999 - reserved for predefined globals in Mu scenarios, like keyboard, screen, etc.
|
2017-07-09 21:34:17 +00:00
|
|
|
:(before "End Reset")
|
2015-05-04 20:09:38 +00:00
|
|
|
assert(Max_variables_in_scenarios == 900);
|
2015-05-04 19:11:51 +00:00
|
|
|
//: Locations 1000 ('Reserved_for_tests') onward - available to the allocator in chunks of size Initial_memory_per_routine.
|
2015-05-04 20:09:38 +00:00
|
|
|
assert(Reserved_for_tests == 1000);
|
|
|
|
|
2015-05-04 19:11:51 +00:00
|
|
|
//:: Recipes
|
|
|
|
//:
|
|
|
|
//: 0 - unused (IDLE; do nothing)
|
2015-07-18 20:48:49 +00:00
|
|
|
//: 1-199 - primitives
|
|
|
|
assert(MAX_PRIMITIVE_RECIPES < 200);
|
|
|
|
//: 200-999 - defined in .mu files as sequences of primitives
|
2015-07-25 04:41:26 +00:00
|
|
|
assert(Next_recipe_ordinal == 1000);
|
2015-05-04 19:11:51 +00:00
|
|
|
//: 1000 onwards - reserved for tests, cleared between tests
|
2015-05-22 01:57:25 +00:00
|
|
|
|
|
|
|
//:: Depths for tracing
|
|
|
|
//:
|
2019-02-25 08:17:46 +00:00
|
|
|
//: 0 - errors
|
|
|
|
//: 1-99 - app-level trace statements in Mu
|
|
|
|
//: 100-9999 - call-stack statements (mostly label run)
|
|
|
|
assert(Initial_callstack_depth == 100);
|
2015-11-29 05:44:13 +00:00
|
|
|
|
|
|
|
//:: Summary of transforms and their dependencies
|
|
|
|
//: begin transforms
|
2015-11-29 06:17:47 +00:00
|
|
|
//: begin instruction inserting transforms
|
|
|
|
//: 52 insert fragments
|
|
|
|
//: ↳ 52.2 check fragments
|
|
|
|
//: ---
|
2015-11-29 07:58:43 +00:00
|
|
|
//: 53 rewrite 'stash' instructions
|
2015-11-29 06:17:47 +00:00
|
|
|
//: end instruction inserting transforms
|
2015-11-29 05:44:13 +00:00
|
|
|
//:
|
2015-11-29 06:17:47 +00:00
|
|
|
//: begin instruction modifying transforms
|
2015-11-29 06:37:19 +00:00
|
|
|
//: 56.2 check header ingredients
|
2016-03-08 09:30:14 +00:00
|
|
|
//: ↳ 56.4 fill in return ingredients
|
2016-02-26 04:58:55 +00:00
|
|
|
//: 48 check or set types by name
|
2015-11-29 06:30:10 +00:00
|
|
|
//:
|
2015-11-29 06:41:19 +00:00
|
|
|
//: begin type modifying transforms
|
2015-11-29 07:19:45 +00:00
|
|
|
//: 56.3 deduce types from header
|
2015-11-29 07:11:21 +00:00
|
|
|
//: ---
|
|
|
|
//: 30 check or set invalid containers
|
2015-11-29 06:41:19 +00:00
|
|
|
//: end type modifying transforms
|
2016-02-26 04:58:55 +00:00
|
|
|
//: ↱ 46 collect surrounding spaces
|
|
|
|
//: ↳ 42 transform names
|
|
|
|
//: ↳ 57 static dispatch
|
2015-11-29 06:48:57 +00:00
|
|
|
//: ---
|
2015-11-29 06:17:47 +00:00
|
|
|
//: 13 update instruction operation
|
|
|
|
//: 40 transform braces
|
|
|
|
//: 41 transform labels
|
|
|
|
//: end instruction modifying transforms
|
2016-02-26 04:58:55 +00:00
|
|
|
//: ↳ 60 check immutable ingredients
|
2015-11-29 05:44:13 +00:00
|
|
|
//:
|
2015-11-29 06:17:47 +00:00
|
|
|
//: begin checks
|
2015-11-29 06:30:10 +00:00
|
|
|
//: ---
|
2015-11-29 06:17:47 +00:00
|
|
|
//: 21 check instruction
|
2016-02-26 04:58:55 +00:00
|
|
|
//: ↳ 61 check indirect calls against header
|
|
|
|
//: ↳ 56 check calls against header
|
2015-11-29 06:17:47 +00:00
|
|
|
//: ↳ 43 transform 'new' to 'allocate'
|
2016-02-26 04:58:55 +00:00
|
|
|
//: 30 check merge calls
|
2016-03-08 09:30:14 +00:00
|
|
|
//: 36 check types of return instructions
|
2016-02-26 04:58:55 +00:00
|
|
|
//: 43 check default space
|
2016-03-08 09:30:14 +00:00
|
|
|
//: 56 check return instructions against header
|
2015-11-29 06:17:47 +00:00
|
|
|
//: end checks
|
2015-11-29 05:44:13 +00:00
|
|
|
//: end transforms
|
2015-11-29 19:43:25 +00:00
|
|
|
|
|
|
|
//:: Summary of type-checking in different phases
|
|
|
|
//: when dispatching instructions we accept first recipe that:
|
|
|
|
//: strictly matches all types
|
|
|
|
//: maps literal 0 or literal 1 to boolean for some ingredients
|
|
|
|
//: performs some other acceptable type conversion
|
|
|
|
//: literal 0 -> address
|
|
|
|
//: literal -> character
|
|
|
|
//: when checking instructions we ensure that types match, and that literals map to some scalar
|
|
|
|
//: (address can only map to literal 0)
|
|
|
|
//: (boolean can only map to literal 0 or literal 1)
|
|
|
|
//: (but conditionals can take any scalar)
|
|
|
|
//: at runtime we perform no checks
|