本文整理汇总了C++中slot_visitor类的典型用法代码示例。如果您正苦于以下问题:C++ slot_visitor类的具体用法?C++ slot_visitor怎么用?C++ slot_visitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了slot_visitor类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: operator
void operator()(instruction_operand op)
{
code_block *compiled = op.parent_code_block();
cell old_offset = op.rel_offset() + (cell)compiled->entry_point() - code_offset;
switch(op.rel_type())
{
case RT_LITERAL:
op.store_value(data_visitor.visit_pointer(op.load_value(old_offset)));
break;
case RT_ENTRY_POINT:
case RT_ENTRY_POINT_PIC:
case RT_ENTRY_POINT_PIC_TAIL:
op.store_code_block(code_visitor(op.load_code_block(old_offset)));
break;
case RT_HERE:
op.store_value(op.load_value(old_offset) + code_offset);
break;
case RT_UNTAGGED:
break;
default:
parent->store_external_address(op);
break;
}
}
开发者ID:littledan,项目名称:Factor,代码行数:25,代码来源:image.cpp
示例2: operator
void operator()(code_block *old_address, code_block *new_address, cell size)
{
data_forwarder.visit_code_block_objects(new_address);
code_block_compaction_relocation_visitor<Fixup> visitor(parent,old_address,fixup);
new_address->each_instruction_operand(visitor);
}
开发者ID:HalfMadDad,项目名称:factor,代码行数:7,代码来源:compaction.cpp
示例3: operator
/*
next -> [entry_point]
[size]
[return address] -- x86 only, backend adds 1 to each spill location
[spill area]
...
frame -> [entry_point]
[size]
*/
void operator()(stack_frame *frame)
{
cell return_address = parent->frame_offset(frame);
if(return_address == (cell)-1)
return;
code_block *compiled = visitor->fixup.translate_code(parent->frame_code(frame));
gc_info *info = compiled->block_gc_info();
assert(return_address < compiled->size());
cell callsite = info->return_address_index(return_address);
if(callsite == (cell)-1)
return;
#ifdef DEBUG_GC_MAPS
std::cout << "call frame code block " << compiled << " with offset " << return_address << std::endl;
#endif
cell *stack_pointer = (cell *)(parent->frame_successor(frame) + 1);
u8 *bitmap = info->gc_info_bitmap();
/* Subtract old value of base pointer from every derived pointer. */
for(cell spill_slot = 0; spill_slot < info->derived_root_count; spill_slot++)
{
u32 base_pointer = info->lookup_base_pointer(callsite, spill_slot);
if(base_pointer != (u32)-1)
{
#ifdef DEBUG_GC_MAPS
std::cout << "visiting derived root " << spill_slot
<< " with base pointer " << base_pointer
<< std::endl;
#endif
stack_pointer[spill_slot] -= stack_pointer[base_pointer];
}
}
/* Update all GC roots, including base pointers. */
cell callsite_gc_roots = info->callsite_gc_roots(callsite);
for(cell spill_slot = 0; spill_slot < info->gc_root_count; spill_slot++)
{
if(bitmap_p(bitmap,callsite_gc_roots + spill_slot))
{
#ifdef DEBUG_GC_MAPS
std::cout << "visiting GC root " << spill_slot << std::endl;
#endif
visitor->visit_handle(stack_pointer + spill_slot);
}
}
/* Add the base pointers to obtain new derived pointer values. */
for(cell spill_slot = 0; spill_slot < info->derived_root_count; spill_slot++)
{
u32 base_pointer = info->lookup_base_pointer(callsite, spill_slot);
if(base_pointer != (u32)-1)
stack_pointer[spill_slot] += stack_pointer[base_pointer];
}
}
开发者ID:8byte-jose,项目名称:factor,代码行数:66,代码来源:slot_visitor.hpp
示例4: operator
/*
frame top -> [return address]
[spill area]
...
[entry_point]
[size]
*/
void operator()(void* frame_top, cell frame_size, code_block* owner,
void* addr) {
cell return_address = owner->offset(addr);
code_block* compiled =
Fixup::translated_code_block_map ? owner
: visitor->fixup.translate_code(owner);
gc_info* info = compiled->block_gc_info();
FACTOR_ASSERT(return_address < compiled->size());
cell callsite = info->return_address_index(return_address);
if (callsite == (cell)-1)
return;
#ifdef DEBUG_GC_MAPS
std::cout << "call frame code block " << compiled << " with offset "
<< return_address << std::endl;
#endif
cell* stack_pointer = (cell*)frame_top;
uint8_t* bitmap = info->gc_info_bitmap();
/* Subtract old value of base pointer from every derived pointer. */
for (cell spill_slot = 0; spill_slot < info->derived_root_count;
spill_slot++) {
uint32_t base_pointer = info->lookup_base_pointer(callsite, spill_slot);
if (base_pointer != (uint32_t)-1) {
#ifdef DEBUG_GC_MAPS
std::cout << "visiting derived root " << spill_slot
<< " with base pointer " << base_pointer << std::endl;
#endif
stack_pointer[spill_slot] -= stack_pointer[base_pointer];
}
}
/* Update all GC roots, including base pointers. */
cell callsite_gc_roots = info->callsite_gc_roots(callsite);
for (cell spill_slot = 0; spill_slot < info->gc_root_count; spill_slot++) {
if (bitmap_p(bitmap, callsite_gc_roots + spill_slot)) {
#ifdef DEBUG_GC_MAPS
std::cout << "visiting GC root " << spill_slot << std::endl;
#endif
visitor->visit_handle(stack_pointer + spill_slot);
}
}
/* Add the base pointers to obtain new derived pointer values. */
for (cell spill_slot = 0; spill_slot < info->derived_root_count;
spill_slot++) {
uint32_t base_pointer = info->lookup_base_pointer(callsite, spill_slot);
if (base_pointer != (uint32_t)-1)
stack_pointer[spill_slot] += stack_pointer[base_pointer];
}
}
开发者ID:Bigot,项目名称:factor,代码行数:61,代码来源:slot_visitor.hpp
示例5: trace_partial_objects
void trace_partial_objects(cell start, cell end, cell card_start, cell card_end)
{
if(card_start < end)
{
start += sizeof(cell);
if(start < card_start) start = card_start;
if(end > card_end) end = card_end;
cell *slot_ptr = (cell *)start;
cell *end_ptr = (cell *)end;
for(; slot_ptr < end_ptr; slot_ptr++)
data_visitor.visit_handle(slot_ptr);
}
}
开发者ID:cataska,项目名称:factor,代码行数:16,代码来源:collector.hpp
示例6: operator
/*
next -> [entry_point]
[size]
[return address] -- x86 only, backend adds 1 to each spill location
[spill area]
...
frame -> [entry_point]
[size]
*/
void operator()(stack_frame *frame)
{
cell return_address = parent->frame_offset(frame);
if(return_address == (cell)-1)
return;
code_block *compiled = visitor->fixup.translate_code(parent->frame_code(frame));
gc_info *info = compiled->block_gc_info();
assert(return_address < compiled->size());
int index = info->return_address_index(return_address);
if(index == -1)
return;
u8 *bitmap = info->gc_info_bitmap();
cell base = info->spill_slot_base(index);
cell *stack_pointer = (cell *)(parent->frame_successor(frame) + 1);
for(cell spill_slot = 0; spill_slot < info->gc_root_count; spill_slot++)
{
if(bitmap_p(bitmap,base + spill_slot))
visitor->visit_handle(&stack_pointer[spill_slot]);
}
}
开发者ID:cataska,项目名称:factor,代码行数:33,代码来源:slot_visitor.hpp
示例7: operator
void operator()(object *obj)
{
workhorse->visit_slots(obj);
}
开发者ID:cataska,项目名称:factor,代码行数:4,代码来源:objects.cpp
示例8: trace_embedded_literals
void trace_embedded_literals(code_block *compiled)
{
data_visitor.visit_embedded_literals(compiled);
}
开发者ID:cataska,项目名称:factor,代码行数:4,代码来源:collector.hpp
示例9: trace_code_block_objects
void trace_code_block_objects(code_block *compiled)
{
data_visitor.visit_code_block_objects(compiled);
}
开发者ID:cataska,项目名称:factor,代码行数:4,代码来源:collector.hpp
示例10: trace_contexts
void trace_contexts()
{
data_visitor.visit_contexts();
}
开发者ID:cataska,项目名称:factor,代码行数:4,代码来源:collector.hpp
示例11: trace_roots
void trace_roots()
{
data_visitor.visit_roots();
}
开发者ID:cataska,项目名称:factor,代码行数:4,代码来源:collector.hpp
示例12: trace_object
void trace_object(object *ptr)
{
data_visitor.visit_slots(ptr);
if(ptr->type() == ALIEN_TYPE)
((alien *)ptr)->update_address();
}
开发者ID:cataska,项目名称:factor,代码行数:6,代码来源:collector.hpp
示例13: trace_handle
void trace_handle(cell *handle)
{
data_visitor.visit_handle(handle);
}
开发者ID:cataska,项目名称:factor,代码行数:4,代码来源:collector.hpp
注:本文中的slot_visitor类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论