oop processOopClass::TWAINS_prim(objVectorOop resultArg, bool stepping, oop stop, void *FH) { if (SignalInterface::are_self_signals_blocked()) warning("_TWAINS: signals are blocked (with _BlockSignals)"); Process* proc= TWAINS_receiver_check(FH); if (proc == NULL) return NULL; if (!TWAINS_result_vector_check( resultArg, FH)) return NULL; vframeOop stop_vfo= TWAINS_stop_activation_check(proc, stop, FH); if (stop_vfo == vframeOop(badOop)) return NULL; if (!TWAINS_parallel_check(FH)) return NULL; preemptCause = cNoCause; twainsProcess = currentProcess; if (PendingSelfSignals::are_any_pending() && !SignalInterface::are_self_signals_blocked()) { // return immediately - have unhandled signals preemptCause = cSignal; } else if (proc != twainsProcess) { TWAINS_transfer_to_another_process(proc, resultArg, stepping, stop_vfo); } else { TWAINS_await_signal(); } twainsProcess = NULL; oop res = get_result(resultArg); LOG_EVENT3("TWAINS: res = %#lx { %#lx, %#lx, ... }", res, resultArg->obj_at(0), resultArg->obj_at(1)); preemptCause = cNoCause; return res; }
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); }
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; }