本文整理汇总了C++中ObjectVisitor::call方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectVisitor::call方法的具体用法?C++ ObjectVisitor::call怎么用?C++ ObjectVisitor::call使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectVisitor
的用法示例。
在下文中一共展示了ObjectVisitor::call方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void CompiledMethod::Info::visit(Object* obj, ObjectVisitor& visit) {
auto_visit(obj, visit);
visit_inliners(obj, visit);
CompiledMethod* cm = as<CompiledMethod>(obj);
if(!cm->backend_method_) return;
VMMethod* vmm = cm->backend_method_;
#ifdef ENABLE_LLVM
if(cm->jit_data()) {
cm->jit_data()->visit_all(visit);
}
for(int i = 0; i < VMMethod::cMaxSpecializations; i++) {
if(vmm->specializations[i].jit_data) {
vmm->specializations[i].jit_data->visit_all(visit);
}
}
#endif
for(size_t i = 0; i < vmm->inline_cache_count(); i++) {
InlineCache* cache = &vmm->caches[i];
MethodCacheEntry* mce = cache->cache_;
if(mce) visit.call(mce);
for(int i = 0; i < cTrackedICHits; i++) {
Module* mod = cache->seen_classes_[i].klass();
if(mod) visit.call(mod);
}
}
}
示例2:
void Tuple::Info::visit(Object* obj, ObjectVisitor& visit) {
Tuple* tup = as<Tuple>(obj);
for(size_t i = 0; i < tup->num_fields(); i++) {
visit.call(tup->field[i]);
}
}
示例3:
void PackedObject::Info::visit(Object* obj, ObjectVisitor& visit) {
PackedObject* po = reinterpret_cast<PackedObject*>(obj);
size_t fields = to_fields(object_size(obj));
Object** body = po->body_as_array();
for(size_t i = 0; i < fields; i++) {
visit.call(body[i]);
}
}
示例4:
void VariableScope::Info::visit(Object* obj, ObjectVisitor& visit) {
auto_visit(obj, visit);
VariableScope* vs = as<VariableScope>(obj);
if(!vs->isolated()) {
Object** ary = vs->stack_locals();
size_t locals = vs->number_of_locals();
for(size_t i = 0; i < locals; i++) {
visit.call(ary[i]);
}
}
}
示例5:
void Regexp::Info::visit(Object* obj, ObjectVisitor& visit) {
auto_visit(obj, visit);
Regexp* reg_o = force_as<Regexp>(obj);
regex_t* reg = reg_o->onig_data;
if(!reg) return;
ByteArray* reg_ba = ByteArray::from_body(reg);
visit.call(reg_ba);
if(reg->p) {
ByteArray* ba = ByteArray::from_body(reg->p);
visit.call(ba);
}
if(reg->exact) {
ByteArray* ba = ByteArray::from_body(reg->exact);
visit.call(ba);
}
if(reg->int_map) {
ByteArray* ba = ByteArray::from_body(reg->int_map);
visit.call(ba);
}
if(reg->int_map_backward) {
ByteArray* ba = ByteArray::from_body(reg->int_map_backward);
visit.call(ba);
}
if(reg->repeat_range) {
ByteArray* ba = ByteArray::from_body(reg->repeat_range);
visit.call(ba);
}
}