Пример #1
0
    void gc_scan(GarbageCollector* gc) {
      utilities::thread::Mutex::LockGuard guard(mutex_);

      for(std::list<BackgroundCompileRequest*>::iterator i = pending_requests_.begin();
          i != pending_requests_.end();
          ++i)
      {
        BackgroundCompileRequest* req = *i;
        if(Object* obj = gc->saw_object(req->method())) {
          req->set_method(force_as<CompiledCode>(obj));
        }

        if(Class* receiver_class = req->receiver_class()) {
          req->set_receiver_class(as<Class>(gc->saw_object(receiver_class)));
        }

        if(BlockEnvironment* block_env = req->block_env()) {
          req->set_block_env(as<BlockEnvironment>(gc->saw_object(block_env)));
        }
      }

      if(current_compiler_) {
        jit::RuntimeDataHolder* rd = current_compiler_->context()->runtime_data_holder();
        rd->set_mark();

        ObjectMark mark(gc);
        rd->mark_all(current_req_->method(), mark);
      }
    }
Пример #2
0
    void gc_scan(GarbageCollector* gc) {
      thread::Mutex::LockGuard guard(mutex_);

      for(std::list<BackgroundCompileRequest*>::iterator i = pending_requests_.begin();
          i != pending_requests_.end();
          ++i)
      {
        BackgroundCompileRequest* req = *i;
        if(Object* obj = gc->saw_object(req->method())) {
          req->set_method(force_as<CompiledMethod>(obj));
        }

        if(Object* obj = gc->saw_object(req->extra())) {
          req->set_extra(obj);
        }
      }

      if(current_compiler_) {
        jit::RuntimeDataHolder* rd = current_compiler_->context().runtime_data_holder();
        rd->set_mark();

        ObjectMark mark(gc);
        rd->mark_all(current_req_->method(), mark);
      }
    }