/[svn]/linuxsampler/trunk/src/scriptvm/ScriptVM.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/scriptvm/ScriptVM.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2594 by schoenebeck, Thu Jun 5 00:16:25 2014 UTC revision 2611 by schoenebeck, Mon Jun 9 19:20:37 2014 UTC
# Line 110  namespace LinuxSampler { Line 110  namespace LinuxSampler {
110          context->createScanner(is);          context->createScanner(is);
111    
112          InstrScript_parse(context);          InstrScript_parse(context);
113          std::cout << "Allocating " << context->globalIntVarCount * sizeof(int) << " bytes of global int VM memory.\n";          dmsg(2,("Allocating %d bytes of global int VM memory.\n", context->globalIntVarCount * sizeof(int)));
114          std::cout << "Allocating " << context->globalStrVarCount << " of global VM string variables.\n";          dmsg(2,("Allocating %d of global VM string variables.\n", context->globalStrVarCount));
115          if (!context->globalIntMemory)          if (!context->globalIntMemory)
116              context->globalIntMemory = new ArrayList<int>();              context->globalIntMemory = new ArrayList<int>();
117          if (!context->globalStrMemory)          if (!context->globalStrMemory)
# Line 152  namespace LinuxSampler { Line 152  namespace LinuxSampler {
152                  _requiredMaxStackSizeFor(&*parserCtx->handlers);                  _requiredMaxStackSizeFor(&*parserCtx->handlers);
153          }          }
154          execCtx->stack.resize(parserCtx->requiredMaxStackSize);          execCtx->stack.resize(parserCtx->requiredMaxStackSize);
155          std::cout << "Created VM exec context with "          dmsg(2,("Created VM exec context with %d bytes VM stack size.\n",
156                    << parserCtx->requiredMaxStackSize * sizeof(ExecContext::StackFrame)                  parserCtx->requiredMaxStackSize * sizeof(ExecContext::StackFrame)));
                   << " bytes VM stack size.\n";  
157          //printf("execCtx=0x%lx\n", (uint64_t)execCtx);          //printf("execCtx=0x%lx\n", (uint64_t)execCtx);
158          const int polySize = parserCtx->polyphonicIntVarCount;          const int polySize = parserCtx->polyphonicIntVarCount;
159          execCtx->polyphonicIntMemory.resize(polySize);          execCtx->polyphonicIntMemory.resize(polySize);
160          memset(&execCtx->polyphonicIntMemory[0], 0, polySize * sizeof(int));          memset(&execCtx->polyphonicIntMemory[0], 0, polySize * sizeof(int));
161    
162          std::cout << "Allocated " << polySize * sizeof(int)          dmsg(2,("Allocated %d bytes polyphonic memory.\n", polySize * sizeof(int)));
                   << " bytes polyphonic memory.\n";  
163          return execCtx;          return execCtx;
164      }      }
165    
# Line 200  namespace LinuxSampler { Line 198  namespace LinuxSampler {
198              return VMExecStatus_t(VM_EXEC_NOT_RUNNING | VM_EXEC_ERROR);              return VMExecStatus_t(VM_EXEC_NOT_RUNNING | VM_EXEC_ERROR);
199          }          }
200    
201            // a ParserContext object is always tied to exactly one ScriptVM object
202            assert(m_parserContext->functionProvider == this);
203    
204          ExecContext* ctx = dynamic_cast<ExecContext*>(execContex);          ExecContext* ctx = dynamic_cast<ExecContext*>(execContex);
205          if (!ctx) {          if (!ctx) {
206              std::cerr << "Invalid VM exec context.\n";              std::cerr << "Invalid VM exec context.\n";

Legend:
Removed from v.2594  
changed lines
  Added in v.2611

  ViewVC Help
Powered by ViewVC