Ejemplo n.º 1
0
  void VM::boot() {
    TypeInfo::auto_learn_fields(this);

    bootstrap_ontology();

    /* @todo Using a single default loop, revisit when many loops.
     * @todo This needs to be handled through the environment.
     * (disabled epoll backend as it frequently caused hangs on epoll_wait)
     */
    // signal_events = new event::Loop(EVFLAG_FORKCHECK | EVBACKEND_SELECT | EVBACKEND_POLL);
    // events = signal_events;

    // signal_events->start(new event::Child::Event(this));

    events = 0;
    signal_events = 0;

    VMMethod::init(this);

    /** @todo Should a thread be starting a VM or is it the other way around? */
    boot_threads();

    // Force these back to false because creating the default Thread
    // sets them to true.
    interrupts.enable_preempt = false;

    GlobalLock::debug_locking = shared.config.gil_debug;
  }
Ejemplo n.º 2
0
  void VM::initialize_as_root() {

    om = new ObjectMemory(this, shared.config);
    shared.om = om;

    allocation_tracking_ = shared.config.allocation_tracking;

    local_slab_.refill(0, 0);

    shared.set_initialized();

    shared.gc_dependent(this);

    State state(this);

    TypeInfo::auto_learn_fields(&state);

    bootstrap_ontology(&state);

    MachineCode::init(&state);

    // Setup the main Thread, which is wrapper of the main native thread
    // when the VM boots.
    thread.set(Thread::create(&state, this, G(thread), 0, true), &globals().roots);
    thread->alive(&state, cTrue);
    thread->sleep(&state, cFalse);

    VM::set_current(this, "rbx.ruby.main");
  }
Ejemplo n.º 3
0
void VM::boot() {
    TypeInfo::auto_learn_fields(this);

    bootstrap_ontology();

    VMMethod::init(this);

    // Setup the main Thread, which is a reflect of the pthread_self()
    // when the VM boots.
    boot_threads();

    GlobalLock::debug_locking = shared.config.gil_debug;
}
Ejemplo n.º 4
0
  void VM::boot() {
    TypeInfo::auto_learn_fields(this);

    bootstrap_ontology();

    VMMethod::init(this);

    /** @todo Should a thread be starting a VM or is it the other way around? */
    boot_threads();

    // Force these back to false because creating the default Thread
    // sets them to true.
    interrupts.enable_preempt = false;

    GlobalLock::debug_locking = shared.config.gil_debug;
  }
Ejemplo n.º 5
0
  VM::VM(size_t bytes) : current_mark(NULL), reuse_llvm(true) {
    config.compile_up_front = false;

    VM::register_state(this);

    user_config = new ConfigParser();

    om = new ObjectMemory(this, bytes);
    probe.set(Qnil, &globals.roots);

    MethodContext::initialize_cache(this);
    TypeInfo::init(this);

    bootstrap_ontology();

    /* @todo Using a single default loop, revisit when many loops.
     * @todo This needs to be handled through the environment.
     * (disabled epoll backend as it frequently caused hangs on epoll_wait)
     */
    signal_events = new event::Loop(EVFLAG_FORKCHECK | EVBACKEND_SELECT | EVBACKEND_POLL);
    events = signal_events;

    signal_events->start(new event::Child::Event(this));

    global_cache = new GlobalCache;

#ifdef ENABLE_LLVM
    VMLLVMMethod::init("vm/instructions.bc");
#endif
    boot_threads();

    // Force these back to false because creating the default Thread
    // sets them to true.
    interrupts.use_preempt = false;
    interrupts.enable_preempt = false;
  }