I think the description of the first task might be wrong:
The formulation of this sentence is quite mistakable. Think of the following situation:Each GC must trigger all WeakRefV in the store to be invalid.
Code: Alles auswählen
Store = Array(NumV(42), WeakRefV(0), Box(0), ...) Stack = List(Map('x -> 1, 'y -> 2), ...)
Your intention was probably somethink like: "The GC should not mark the target of a WeakRef"
Whereas the first quoted sentence could be interpreted correctly (having the theory of weak references in mind), this sentence is totally wrong in my opinion. I can only think of one interpretation of this sentence, saying: "After GC all WeakRefs are pointing to the invalid location". In the situation of sentence 1 it would be against (at least my) expectation if the WeakRef wouldn't point to the NumV any more although the value still exists.For this purpose, rewrite the reference in the WeakRefV to the given value INVALID_LOC.
PS: If I assume that my comments are correct, I would need to add the stack to the sweep-phase like for the moving store. Is this ok?
edit: Ok, I think, I night not need the stack for the sweep-phase