return sizeof(callstack) + size;
}
-/* This is a little tricky. The iterator may allocate memory, so we
-keep the callstack in a GC root and use relative offsets */
-/* Allocates memory */
+// This is a little tricky. The iterator may allocate memory, so we
+// keep the callstack in a GC root and use relative offsets
+// Allocates memory
template <typename Iterator, typename Fixup>
inline void factor_vm::iterate_callstack_object(callstack* stack_,
Iterator& iterator,
Fixup& fixup) {
data_root<callstack> stack(stack_, this);
- fixnum frame_length = factor::untag_fixnum(stack->length);
+ fixnum frame_length = untag_fixnum(stack->length);
fixnum frame_offset = 0;
while (frame_offset < frame_length) {
FACTOR_ASSERT(frame_offset == frame_length);
}
-/* Allocates memory */
+// Allocates memory
template <typename Iterator>
inline void factor_vm::iterate_callstack_object(callstack* stack,
Iterator& iterator) {
iterate_callstack_object(stack, iterator, none);
}
-/* Allocates memory */
+// Iterates the callstack from innermost to outermost
+// callframe. Allocates memory
template <typename Iterator, typename Fixup>
void factor_vm::iterate_callstack(context* ctx, Iterator& iterator,
Fixup& fixup) {
cell top = ctx->callstack_top;
cell bottom = ctx->callstack_bottom;
- /* When we are translating the code block maps, all callstacks must
- be empty. */
+ // When we are translating the code block maps, all callstacks must
+ // be empty.
FACTOR_ASSERT(!Fixup::translated_code_block_map || top == bottom);
while (top < bottom) {
cell addr = *(cell*)top;
FACTOR_ASSERT(addr != 0);
- /* Only the address is valid, if the code heap has been compacted,
- owner might not point to a real code block. */
+ // Only the address is valid, if the code heap has been compacted,
+ // owner might not point to a real code block.
code_block* owner = code->code_block_for_address(addr);
code_block* fixed_owner = fixup.translate_code(owner);
FACTOR_ASSERT(top == bottom);
}
-/* Allocates memory */
+// Allocates memory
template <typename Iterator>
inline void factor_vm::iterate_callstack(context* ctx, Iterator& iterator) {
no_fixup none;