void interpretCmdLine(const char *textbuf, int textlen, char *methodname) { PyrString *string; if (compiledOK) { PyrSlot slot; string = newPyrStringN(gMainVMGlobals->gc, textlen, 0, false); memcpy(string->s, textbuf, textlen); SetObject(&slotRawInterpreter(&gMainVMGlobals->process->interpreter)->cmdLine, string); gMainVMGlobals->gc->GCWrite(slotRawObject(&gMainVMGlobals->process->interpreter), string); SetObject(&slot, gMainVMGlobals->process); //#if __profile__ // ProfilerInit(collectSummary, microsecondsTimeBase, 500, 100); //#endif slotCopy((++gMainVMGlobals->sp), &slot); runInterpreter(gMainVMGlobals, getsym(methodname), 1); //#if __profile__ // ProfilerDump("\pErase2.prof"); // ProfilerTerm(); //#endif } else { postfl("Library has not been compiled successfully.\n"); } }
void QcApplication::interpret( const QString &str, bool print ) { QtCollider::lockLang(); if( compiledOK ) { VMGlobals *g = gMainVMGlobals; PyrString *strObj = newPyrString( g->gc, str.toStdString().c_str(), 0, true ); SetObject(&slotRawInterpreter(&g->process->interpreter)->cmdLine, strObj); g->gc->GCWrite(slotRawObject(&g->process->interpreter), strObj); runLibrary( print ? SC_SYM(interpretPrintCmdLine) : SC_SYM(interpretCmdLine) ); } QtCollider::unlockLang(); }
void SC_LanguageClient::setCmdLine(const char* buf, size_t size) { if (isLibraryCompiled()) { lock(); if (isLibraryCompiled()) { VMGlobals *g = gMainVMGlobals; PyrString* strobj = newPyrStringN(g->gc, size, 0, true); memcpy(strobj->s, buf, size); SetObject(&slotRawInterpreter(&g->process->interpreter)->cmdLine, strobj); g->gc->GCWriteNew(slotRawObject(&g->process->interpreter), strobj); // we know strobj is white so we can use GCWriteNew } unlock(); } }