Lines Matching defs:stack

41  * Initializes the stack top and advises the mark stack pages as needed.
43 static bool createMarkStack(GcMarkStack *stack)
45 assert(stack != NULL);
48 madvise(stack->base, length, MADV_NORMAL);
49 stack->top = stack->base;
54 * Assigns NULL to the stack top and advises the mark stack pages as
57 static void destroyMarkStack(GcMarkStack *stack)
59 assert(stack != NULL);
60 madvise(stack->base, stack->length, MADV_DONTNEED);
61 stack->top = NULL;
65 * Pops an object from the mark stack.
67 static void markStackPush(GcMarkStack *stack, const Object *obj)
69 assert(stack != NULL);
70 assert(stack->base <= stack->top);
71 assert(stack->limit > stack->top);
73 *stack->top = obj;
74 ++stack->top;
78 * Pushes an object on the mark stack.
80 static const Object *markStackPop(GcMarkStack *stack)
82 assert(stack != NULL);
83 assert(stack->base < stack->top);
84 assert(stack->limit > stack->top);
85 --stack->top;
86 return *stack->top;
93 if (!createMarkStack(&ctx->stack)) {
120 /* This object will need to go on the mark stack.
122 markStackPush(&ctx->stack, obj);
131 * need to be added to the mark stack.
143 * stack.
162 * - Interpreted stack, from top to "curFrame"
178 * - Native stack (for in-progress stuff in the VM)
190 * white objects and pushes them on the mark stack.
468 * Scan anything that's on the mark stack. We can't use the bitmaps
475 assert(ctx->stack.top >= ctx->stack.base);
476 GcMarkStack *stack = &ctx->stack;
477 while (stack->top > stack->base) {
478 const Object *obj = markStackPop(stack);
594 * live objects will be marked and the mark stack will be empty.
610 * left on the mark stack.
621 * that gray objects will be pushed onto the mark stack.
852 destroyMarkStack(&ctx->stack);