Ejemplo n.º 1
0
void Value::set_obj(Oop* value) {
  // due to garbage collection considerations object immediates
  // are always put in a register
  GUARANTEE(type() == T_OBJECT || type() == T_ARRAY, "check type");
  // assign a register to this value
  if (value->is_null()) {
    set_where(T_IMMEDIATE);
    set_must_be_null();
    set_not_on_heap();
    _low = 0;
  } else {
    assign_register();
    // move the immediate object into the register
    Compiler::code_generator()->move(*this, value);
    if (!ObjectHeap::contains_moveable(value->obj())) {
      set_not_on_heap();
    }
#if ENABLE_COMPILER_TYPE_INFO
    FarClass::Raw value_class = value->blueprint();
    GUARANTEE(value_class.not_null(), "Sanity");
    if (value_class.is_java_class()) {
      JavaClass::Raw java_class = value_class.obj();
      set_class_id(java_class().class_id());
      set_is_exact_type();
    }
#else
    if (value->is_string()) {
      set_is_string();
    }
#endif
    set_must_be_nonnull();
  }
}
Ejemplo n.º 2
0
 void try_to_assign_register() {
   assign_register();
 }
Ejemplo n.º 3
0
 //we will load the array length into the same register
 //when jump into the jit code through a osr entry, so we check
 //the location of the VirtualStackFrame whether a register has been
 //bundle with it.
 void try_to_assign_register() {
   if (!is_not_first_time_access()) {
     assign_register();
   }
 }