13 /* Allocates memory */
14 code_block *compile_profiling_stub(cell word_)
16 gc_root<word> word(word_);
18 jit jit(WORD_TYPE,word.value());
19 jit.emit_with(userenv[JIT_PROFILING],word.value());
21 return jit.to_code_block();
24 /* Allocates memory */
25 static void set_profiling(bool profiling)
27 if(profiling == profiling_p)
30 profiling_p = profiling;
32 /* Push everything to tenured space so that we can heap scan
33 and allocate profiling blocks if necessary */
36 gc_root<array> words(find_all_words());
39 cell length = array_capacity(words.untagged());
40 for(i = 0; i < length; i++)
42 tagged<word> word(array_nth(words.untagged(),i));
44 word->counter = tag_fixnum(0);
45 update_word_xt(word.value());
48 /* Update XTs in code heap */
49 iterate_code_heap(relocate_code_block);
54 set_profiling(to_boolean(dpop()));