コード例 #1
0
ファイル: objVectorOop.cpp プロジェクト: ardeujho/self
oop objVectorOopClass::ov_at_put_prim(oop rcvr, oop indexOop, oop contents) {
  if (!rcvr->is_objVector()) return ErrorCodes::vmString_prim_error(BADTYPEERROR);
  if (!indexOop->is_smi()) return ErrorCodes::vmString_prim_error(BADTYPEERROR);
  smi index = smiOop(indexOop)->value();
  if (unsigned(index) >= unsigned(objVectorOop(rcvr)->length()))
    return ErrorCodes::vmString_prim_error(BADINDEXERROR);
  objVectorOop(rcvr)->obj_at_put(index, contents);
  return rcvr;
}
コード例 #2
0
void graph_creator::do_edge(call_graph_edge* e) {
  oop node_oop;
  if (e->is_fold_edge()) {
    node_oop = clone_fold_edge_pt((fold_edge*) e);
  } else {
    call_graph_node* n = e->callee;
    if (n->is_method_node()) {
      node_oop = clone_method_pt((method_node*) n);
    } else if (n->is_block_node()) {
      node_oop = clone_block_pt((block_node*) n);
    } else if (n->is_prim_node()) {
      node_oop = clone_prim_node_pt((prim_node*) n);
    } else if (n->is_access_node()) {
      node_oop = clone_access_node_pt((access_node*) n);
    } else if (n->is_leaf_node()) {
      node_oop = clone_leaf_node_pt((leaf_node*) n);
    } else {
      fatal("unexpected node type in call graph");
    }
  }
  if (node_oop == failedAllocationOop) {
    out_of_memory= true;
    return;
  }
  if (parent) {
    assert(parent->is_objVector(), "should be an objVector");
    // fill in an element in the parent vector
    objVectorOop p = objVectorOop(parent);
    assert( p->obj_at(index * 2    ) == NULL, "already there\n");
    assert( p->obj_at(index * 2 + 1) == NULL, "already there\n");
    p->obj_at_put(index * 2,     as_smiOop(e->bci));
    p->obj_at_put(index * 2 + 1, node_oop);
    index++;
  } 
  else {
    assert(_root == NULL, "_root already set");
    _root = node_oop;
  }
  
  next_parent = node_oop;
}
コード例 #3
0
ファイル: objVectorOop.cpp プロジェクト: ardeujho/self
oop objVectorOopClass::ov_size_prim(oop rcvr) {
  if (!rcvr->is_objVector()) return ErrorCodes::vmString_prim_error(BADTYPEERROR);
  return as_smiOop(objVectorOop(rcvr)->length());
}