Exemplo n.º 1
0
  SExpr* SPrimScope::inlineClone() {
    // clones aren't really inlined, but can call specialized version if size
    // is known
    if (!receiver->hasMap()) return NULL;

    Map* map = receiver->map();
    if (map->is_smi() || map->is_float() || map->is_string()) {
      // cloning is a no-op
      if (PrintInlining) {
        lprintf("%*s*constant-folding (eliminating) _Clone\n",
                (void*)(depth-1), "");
      }
      return receiver;
    }

    if ( map->empty_object_size() != EMPTY_SLOTS_OOP_SIZE  // inlined clone method assumes this
    ||  !map->can_inline_clone())
      return NULL;

    fint slotCount = map->length_obj_slots();
    if (slotCount < 10) {
      // replace with specialized Clone primitive
      pd = getPrimDescOfSelector(VMString[_CLONE_0 + slotCount], true);
      assert(pd->type() == InternalPrimitive, "should be internal");
    }
    return NULL;
  }
Exemplo n.º 2
0
PrimDesc* CodeGen::blockClone() {
  static PrimDesc* blkClone = NULL;
  if (blkClone == NULL)
    blkClone = getPrimDescOfSelector(VMString[BLOCK_CLONE], true);
  return blkClone;
}
Exemplo n.º 3
0
PrimDesc* CodeGen::intrCheck() {
  static PrimDesc* intCk = NULL;
  if (intCk == NULL)
    intCk = getPrimDescOfSelector(VMString[INTERRUPT_CHECK], true);
  return intCk;
}