Debian Codegraph @

rpython/jit/backend/llsupport/gcmap.py

raw symbols SCIP
1 from rpython.rtyper.lltypesystem import rffi
2 from rpython.rtyper.lltypesystem import lltype
3 from rpython.jit.backend.llsupport import jitframe
4 from rpython.rlib.rarithmetic import r_uint
5 from rpython.jit.backend.llsupport.symbolic import WORD
6
7 def allocate_gcmap(assembler, frame_depth, fixed_size):
8 size = frame_depth + fixed_size
9 malloc_size = (size // WORD // 8 + 1) + 1
10 rawgcmap = assembler.datablockwrapper.malloc_aligned(WORD * malloc_size,
11 WORD)
12 # set the length field
13 rffi.cast(rffi.CArrayPtr(lltype.Signed), rawgcmap)[0] = malloc_size - 1
14 gcmap = rffi.cast(lltype.Ptr(jitframe.GCMAP), rawgcmap)
15 # zero the area
16 for i in range(malloc_size - 1):
17 gcmap[i] = r_uint(0)
18 return gcmap