本文整理汇总了C#中ILCompiler.DependencyAnalysis.ObjectDataBuilder.EmitLong方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectDataBuilder.EmitLong方法的具体用法?C# ObjectDataBuilder.EmitLong怎么用?C# ObjectDataBuilder.EmitLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILCompiler.DependencyAnalysis.ObjectDataBuilder
的用法示例。
在下文中一共展示了ObjectDataBuilder.EmitLong方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetData
public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false)
{
ObjectDataBuilder objData = new ObjectDataBuilder(factory);
// The interface dispatch cell has an alignment requirement of 2 * [Pointer size] as part of the
// synchronization mechanism of the two values in the runtime.
objData.Alignment = _targetMethod.Context.Target.PointerSize * 2;
objData.DefinedSymbols.Add(this);
objData.EmitPointerReloc(factory.ExternSymbol("RhpInitialDynamicInterfaceDispatch"));
// The second cell field uses the two lower-order bits to communicate the contents.
// We add 1 to signal IDC_CachePointerIsInterfacePointer. See src\Native\Runtime\inc\rhbinder.h.
objData.EmitPointerReloc(factory.NecessaryTypeSymbol(_targetMethod.OwningType), 1);
// End the run of dispatch cells
objData.EmitZeroPointer();
// Avoid consulting VTable slots until they're guaranteed complete during final data emission
if (!relocsOnly)
{
int interfaceMethodSlot = VirtualMethodSlotHelper.GetVirtualMethodSlot(factory, _targetMethod);
if (factory.Target.PointerSize == 8)
{
objData.EmitLong(interfaceMethodSlot);
}
else
{
throw new NotImplementedException();
}
}
return objData.ToObjectData();
}
示例2: GetData
public override ObjectData GetData(NodeFactory factory, bool relocsOnly)
{
ObjectDataBuilder dataBuilder = new ObjectDataBuilder(factory);
dataBuilder.Alignment = 16;
dataBuilder.DefinedSymbols.Add(this);
bool hasPointers = NumSeries > 0;
if (hasPointers)
{
for (int i = ((_runLengths.Length / 2) * 2) - 1; i >= 0; i--)
{
if (_targetPointerSize == 4)
{
dataBuilder.EmitInt(_runLengths[i]);
}
else
{
dataBuilder.EmitLong(_runLengths[i]);
}
}
if (_targetPointerSize == 4)
{
dataBuilder.EmitInt(NumSeries);
}
else
{
dataBuilder.EmitLong(NumSeries);
}
}
int totalSize = 0;
foreach (int run in _runLengths)
{
totalSize += run * _targetPointerSize;
}
dataBuilder.EmitShort(0); // ComponentSize is always 0
if (hasPointers)
dataBuilder.EmitShort(0x20); // TypeFlags.HasPointers
else
dataBuilder.EmitShort(0x00);
totalSize = Math.Max(totalSize, _targetPointerSize * 3); // minimum GC eetype size is 3 pointers
dataBuilder.EmitInt(totalSize);
return dataBuilder.ToObjectData();
}