Commit Graph

200 Commits

Author SHA1 Message Date
Alex Shelkovnykov
c6580f30da jets: add bloq helper function 2023-09-04 15:27:36 -06:00
Alex Shelkovnykov
bb244ee52b jets: add checked helper functions 2023-09-04 15:27:36 -06:00
Alex Shelkovnykov
a90b23d263 hoon, jets: add +mas 2023-09-04 15:27:28 -06:00
Alex Shelkovnykov
15656c1fe2 jets: move shared functions into jets::util(::test) 2023-09-04 15:27:28 -06:00
Alex Shelkovnykov
5a2e4eec57 hoon, jets: add +cap 2023-09-04 15:27:14 -06:00
Alex Shelkovnykov
104fffca96 noun: move slot lookup into noun crate 2023-09-01 16:12:27 -06:00
Alex Shelkovnykov
0cf41842e3 jets: add advanced test for mink jet 2023-08-22 12:21:41 -06:00
Alex Shelkovnykov
d510a33c02 jets: add mink jet 2023-08-21 10:49:37 -06:00
Alex Shelkovnykov
19048014a3 ares: add %hand, %hunk, %lose, and %mean hints 2023-08-16 16:31:00 -06:00
Alex Shelkovnykov
554885975a ares: add mean stack and %slog hint 2023-08-16 16:30:57 -06:00
Alex Shelkovnykov
bae335275b ares: refactor hints to use option; fix hint tag bug 2023-08-16 16:30:22 -06:00
Alex Shelkovnykov
b804a549a8 stack: fix minor bug in split stack setup 2023-08-16 16:30:17 -06:00
Alex Shelkovnykov
995f64da8c
Merge pull request #63 from ashelkovnykov/tests
Unit tests for the PMA
2023-08-15 16:18:58 -06:00
Alex Shelkovnykov
47644d16dc pma: add unit/integration tests 2023-08-15 16:11:23 -06:00
Jonathan Paprocki
81a7eb780c split: implements split stack
see docs/stack.md for information about this change.

split: replace Polarity enum with pointer check

we can check polarity with West === FP < AP,
East === FP > AP.

we panic when the pointers are equal.

split: pre_copy step before preserve() calls

we need to save the stored frame_pointer and alloc_pointer before
preserve calls, which will otherwise overwrite them.

split: copy_west(), now with stack_pointer!

when copying, we can forget the lightweight stack in the current frame
and start a new one adjacent to from-space used for traversing nouns
in from-space.

split: working split stack

this commit works with hurray.jam and decrement.jam.

there's at least one thing left: I don't think the implementation of
hamt::preserve() is correct, but hurray.jam and decrement.jam don't use
it so it doesn't detect it. the comment there explains whats wrong.

I also need to double check copy_pma() still.
 This is the commit message #52:

split: hamt::preserve() and free_alloc

hamt::preserve() needs to allocate in the current frame after we've
already said we can no longer allocate (once pre_copy() has been
called). so does e.g. copy_west(), since it moves the lightweight
stack into this same area. we can unify this interface but I want
to explore the ergonomics of making this free allocation stuff usable
for the programmer without having to think about whether or not
pre_copy() has already been called.

split: add boolean for pre_copy()

alternative: use an enum to say whether the lightweight stack grows
westward or eastward, and that the reserved slots for the previous
frame's pointers are adjacent to the frame_pointer or alloc_pointer. not
sure which is the better choice yet.

split: panic when allocating at the wrong time

when pc == false, we aren't in copying mode (basically when we're
copying allocations to the previous frame to get ready to pop the
frame). therefore we should panic if we try to allocate in the previous
frame.

similarly, when pc == true, we're no longer allowed to allocate in the
current frame, but we can allocate in the previous frame. therefore we
should panic if we try to allocate in the current frame.

split: use prev_stack_pointer_pointer()

we'd like the programmer to not have to think about whether the frame is
in copying mode or not, so every time we want the previous frame's stack
pointer we should just called prev_stack_pointer_pointer() instead of
trying to remember if we need slot_pointer or free_slot.

we still use slot_pointer and free_slot for pushing and popping stack
frames, since we're in the midst of changing the pointers that would
determine where prev_stack_pointer_pointer() would look.

split: polarity of lw stack changes in pre_copy

It was waiting until copy_west/copy_east to do this - this makes it more
clear that the lightweight stack is different after pre_copy() is called

split: simplify is_west

asking this to panic in case of equality is assigning it too much
responsibility. it should just say whether or not a frame is west.

 This is the commit message #76:

split: copy_pma isn't in cleanup mode

we don't need to move the lightweight stack since we're not allocating
in a previous frame, but into the PMA

split: revise pre_copy() usage

pre_copy() is no longer public. instead, it is called at the start of
any NockStack method which could potentially be the first function called when
getting ready to pop a stack frame (preserve() and functions that
allocate in the previous frame).

main: trailing bytes of cued jamfile are zeroes

this was already the case, but it was doing so incorrectly.

write_bytes(dest.add(word_len as usize - 1), 0, 8)
copies 64 bytes of zeroes starting at the last word of the indirect
atom. this went unnoticed before split stack since allocation happened
at the west end of the memory arena. now that allocation starts at the
east end, this was causing an overflow. so the correct line is
write_bytes(dest.add(word_len as usize - 1), 0, 1)

split: memory in NockStack::new not mutable

it was before split stack, now its unnecessary and throws a compiler
warning. im confused as to why it was ever there at all, though
2023-08-11 12:54:57 -04:00
Alex Shelkovnykov
d02d0373e2 pma: add comment to document write/pwrite usage 2023-05-25 13:50:09 +00:00
Alex Shelkovnykov
1a4d5b15ec pma: fix void* arithmetic warnings 2023-05-25 13:43:05 +00:00
Alex Shelkovnykov
15948a3772 pma: fix old style function definition warnings 2023-05-25 13:38:50 +00:00
Alex Shelkovnykov
7c9e1fc393 pma: fix enum forward reference 2023-05-25 13:37:33 +00:00
Alex Shelkovnykov
56a2b1df8e pma: fix unused_result warning 2023-05-25 13:35:36 +00:00
Alex Shelkovnykov
0c56775dbe build: split build.rs profiles 2023-05-25 13:33:04 +00:00
Alex Shelkovnykov
c13e05a907 pma: fix toplevel_ref_arg linter warning 2023-05-20 19:20:14 +00:00
Alex Shelkovnykov
3245f9ea14 jets: fix toplevel_ref_arg linter warnings 2023-05-20 19:18:19 +00:00
Alex Shelkovnykov
960d3a37d7 jets: fix needless-borrow linter warning 2023-05-20 19:13:43 +00:00
Alex Shelkovnykov
da7954360e jets: fix unused-variable linter warnings 2023-05-20 19:13:37 +00:00
barter-simsum
1dd2dd2bd4 fix macos build 2023-05-18 22:04:49 -04:00
barter-simsum
b4aece5692 clang warnings 2023-05-18 22:04:49 -04:00
barter-simsum
5e91015f18 lint 2023-05-18 22:04:49 -04:00
barter-simsum
9df8d89901 comment explaining bp() 2023-05-18 22:04:49 -04:00
barter-simsum
3055552ef1 fix errant multi-page alloc assert
shared pages don't contain an offset. This must have accidentally been included
in the loop when it should have preceded it
2023-05-18 22:04:49 -04:00
barter-simsum
eb12e25ef2 prefix pma types with PMA + typedef prior to defn 2023-05-18 22:04:49 -04:00
barter-simsum
8d70e8d67e misc 2023-05-18 20:21:18 -04:00
barter-simsum
7b0cd288d5 unhook PMA from event lifecycle. use DoubleJam for persistence 2023-05-18 20:21:18 -04:00
Alex Shelkovnykov
78dcbd2d22 remove test files from before merge into ares repo 2023-05-18 20:21:18 -04:00
Alex Shelkovnykov
40852a1c86 replace accidentally deleted pwrite 2023-05-18 20:21:18 -04:00
barter-simsum
e83302376f at last no sigsegv due to fubar _pma_state->metadata refactor 2023-05-18 20:21:18 -04:00
barter-simsum
f3772c0be0 misc 2023-05-18 20:21:18 -04:00
barter-simsum
de52547506 _pma_state->metadata mem leak 2023-05-18 20:21:18 -04:00
barter-simsum
15c4af135c philip's pma changes inter alia 2023-05-18 20:21:18 -04:00
Alex Shelkovnykov
6374895d84 Move PMA code into Ares from separate repo 2023-05-08 08:58:01 -04:00
Aurimas Blažulionis
54661e9ed9
Comment bits check in rev jet 2023-04-22 21:06:35 +03:00
Aurimas Blažulionis
bb17526f9e
Normalize noun in jet rev 2023-04-20 23:25:39 +03:00
Aurimas Blažulionis
c9ff3ce67c
Add rev jet 2023-03-28 21:04:13 +03:00
Peter McEvoy
2a553a4aa8
Merge pull request #40 from urbit/peter/remove-dyn
Replace dynamic trait objects with static type parameters
2023-03-15 17:00:52 -04:00
Peter McEvoy
c422207864 Revert use std:: formatting changes 2023-03-15 10:24:03 -04:00
Edward Amsden
d5bb18946c
Merge branch 'status' into peter/remove-dyn 2023-03-14 23:03:09 -05:00
Philip Monk
b4d007174e Merge remote-tracking branch 'origin/peter/lint' into philip/pma 2023-03-14 20:55:58 -07:00
Philip Monk
6ecec97810 [ares] remove pma_malloc integration until further work 2023-03-14 20:51:53 -07:00
Peter McEvoy
f8b05fc53b Add leading _ to jet_name parameter 2023-03-14 18:27:03 -04:00
Peter McEvoy
be2af44231 Remove unused lifetime from Cell::tail_as_mut() 2023-03-14 18:26:21 -04:00