Ejemplo n.º 1
0
  Object* CompiledMethod::jit_now(STATE) {
    return Qfalse;
#ifdef ENABLE_LLVM
    if(backend_method_ == NULL) {
      internalize(state);
    }

    if(state->shared.config.jit_show_compiling) {
      std::cout << "[[[ JIT compiling " << full_name(state)->c_str() << " ]]]\n";
    }

    LLVMState* ls = LLVMState::get(state);

    jit::Compiler jit;
    jit.compile_method(ls, this, backend_method_);

    if(jit.generate_function(ls)) {
      backend_method_->set_jitted(jit.llvm_function(),
                                  jit.code_bytes(), jit.function_pointer());
      return Qtrue;
    }
#endif

    return Qfalse;
  }
Ejemplo n.º 2
0
  Object* CompiledMethod::set_breakpoint(STATE, Fixnum* ip, Object* bp) {
    int i = ip->to_native();
    if(backend_method_ == NULL) {
      if(!internalize(state)) return Primitives::failure();
    }
    if(!backend_method_->validate_ip(state, i)) return Primitives::failure();

    if(breakpoints_->nil_p()) {
      breakpoints(state, LookupTable::create(state));
    }

    breakpoints_->store(state, ip, bp);
    backend_method_->debugging = 1;
    backend_method_->run = VMMethod::debugger_interpreter;
    return ip;
  }
Ejemplo n.º 3
0
  Object* CompiledMethod::jit_soon(STATE) {
    return Qfalse;
#ifdef ENABLE_LLVM
    if(backend_method_ == NULL) {
      internalize(state);
    }

    if(state->shared.config.jit_show_compiling) {
      std::cout << "[[[ JIT queueing " << full_name(state)->c_str() << " ]]]\n";
    }

    LLVMState::get(state)->compile_soon(state, this);
    return Qtrue;
#else
    return Qfalse;
#endif
  }
Ejemplo n.º 4
0
 lbool context::optimize() {
     if (m_pareto) {
         return execute_pareto();
     }
     if (m_box_index != UINT_MAX) {
         return execute_box();
     }
     clear_state();
     init_solver(); 
     import_scoped_state(); 
     normalize();
     internalize();
     update_solver();
     solver& s = get_solver();
     for (unsigned i = 0; i < m_hard_constraints.size(); ++i) {
         TRACE("opt", tout << "Hard constraint: " << mk_ismt2_pp(m_hard_constraints[i].get(), m) << std::endl;);
         s.assert_expr(m_hard_constraints[i].get());
     }