oop set_sic_params_prim(oop r, char* which, objVectorOop params, void* FH) { ResourceMark rm; IntBList* l = stringToList(which); if (!l) { failure(FH, SIC_PARAMS_ERROR_MSG); return 0; } fint len = params->length(); fint *n= NEW_RESOURCE_ARRAY(fint, len); fint i; for (i = 0; i < len; i++) { oop param = params->obj_at(i); if (!param->is_smi() || smiOop(param)->value() < 1) { char msg[BUFSIZ]; sprintf(msg, "arg2[%ld]: invalid parameter (not a positive integer)", long(i)); failure(FH, msg); return 0; } n[i] = smiOop(param)->value(); } oop res = get_sic_params_prim(r, which, NULL); l->clear(); for (i = 0; i < len; i++) l->push(n[i]); return res; }
int32 LabelSet::RecordLabelVectorInfo( AbstractByteCode* b, objVectorOop labels, int32 sd, int32 bci) { objVectorOop pcs= labels->clone(); // want same size as labels for (int32 i = 0, n = labels->length(); i < n; ++i) if ( RecordLabelInfo( b, labels->obj_at(i), sd, indexedBranch, bci ) == -1) return -1; return b->GenLiteral(pcs); }
oop processOopClass::NewProcess_prim(smi stackSize, oop rcvr, stringOop sel, objVectorOop args, void *FH) { ResourceMark rm; char *selector = sel->copy_null_terminated(); if (stackSize <= 0 || str_arg_count(selector) > args->length()) { prim_failure(FH, PRIMITIVEFAILEDERROR); return NULL; } Process* p; p = new Process(this, stackSize, rcvr, sel, args); return p->processObj(); }
static bool convertFloatObjVector( objVectorOop v, const char* prinName, void* FH, float*& floats, uint32& count) { count = v->length(); floats = NEW_RESOURCE_ARRAY(float, count); int badI = -1; for (int i = 0; i < count; ++i) { oop o = v->obj_at(i); floats[i] = o->is_float() ? floatOop(o)->value() : o->is_smi() ? smiOop(o)->value() : ((badI = i), (i = count), 0.0); } if (badI != -1) { static char buf[1000]; sprintf(buf, "%s failed: bad oop at: %d", prinName, badI); failure(FH, buf); return false; } return true; }