本文整理汇总了C#中ProtoCore.InitializeContextGlobals方法的典型用法代码示例。如果您正苦于以下问题:C# ProtoCore.InitializeContextGlobals方法的具体用法?C# ProtoCore.InitializeContextGlobals怎么用?C# ProtoCore.InitializeContextGlobals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProtoCore
的用法示例。
在下文中一共展示了ProtoCore.InitializeContextGlobals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public ExecutionMirror Execute(ProtoCore.CompileTime.Context staticContext, ProtoCore.Runtime.Context runtimeContext, ProtoCore.Core core, bool isTest = true)
{
Validity.Assert(null != staticContext.SourceCode && String.Empty != staticContext.SourceCode);
int blockId = ProtoCore.DSASM.Constants.kInvalidIndex;
ProtoLanguage.CompileStateTracker compileState = Compile(staticContext, core, out blockId);
Validity.Assert(null != compileState);
if (compileState.compileSucceeded)
{
// This is the boundary between compilestate and runtime core
// Generate the executable
compileState.GenerateExecutable();
// Get the executable from the compileState
core.DSExecutable = compileState.DSExecutable;
core.Rmem.PushGlobFrame(compileState.GlobOffset);
core.RunningBlock = blockId;
core.InitializeContextGlobals(staticContext.GlobalVarList);
Validity.Assert(null != runtimeContext);
Execute(core, runtimeContext, compileState);
if (!isTest)
{
core.Heap.Free();
}
}
else
{
throw new ProtoCore.Exceptions.CompileErrorsOccured();
}
if (isTest && !core.Options.CompileToLib)
{
return new ExecutionMirror(core.CurrentExecutive.CurrentDSASMExec, core);
}
// Save the Callsite state for this execution
if (core.EnableCallsiteExecutionState)
{
ProtoCore.CallsiteExecutionState.SaveState(core.csExecutionState);
}
return null;
}
示例2: Execute
public ExecutionMirror Execute(ProtoCore.CompileTime.Context staticContext, ProtoCore.Runtime.Context runtimeContext, ProtoCore.Core core, bool isTest = true)
{
Validity.Assert(null != staticContext.SourceCode && String.Empty != staticContext.SourceCode);
int blockId = ProtoCore.DSASM.Constants.kInvalidIndex;
bool succeeded = Compile(staticContext, core, out blockId);
if (succeeded)
{
core.GenerateExecutable();
core.Rmem.PushGlobFrame(core.GlobOffset);
core.RunningBlock = blockId;
core.InitializeContextGlobals(staticContext.GlobalVarList);
Validity.Assert(null != runtimeContext);
Execute(core, runtimeContext);
if (!isTest)
{
core.Heap.Free();
}
}
else
{
throw new ProtoCore.Exceptions.CompileErrorsOccured();
}
if (isTest && !core.Options.CompileToLib)
{
return new ExecutionMirror(core.CurrentExecutive.CurrentDSASMExec, core);
}
return null;
}