当前位置: 首页>>代码示例>>C++>>正文


C++ MemoryWriter::writeDWord方法代码示例

本文整理汇总了C++中MemoryWriter::writeDWord方法的典型用法代码示例。如果您正苦于以下问题:C++ MemoryWriter::writeDWord方法的具体用法?C++ MemoryWriter::writeDWord怎么用?C++ MemoryWriter::writeDWord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MemoryWriter的用法示例。


在下文中一共展示了MemoryWriter::writeDWord方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: allocateVMT

void JITCompiler32 :: allocateVMT(MemoryWriter& vmtWriter, size_t flags, size_t vmtLength)
{
   alignCode(&vmtWriter, VA_ALIGNMENT, false);   

   // create VMT header:
   //   dummy package reference
   vmtWriter.writeDWord(0);

   //   vmt length
   vmtWriter.writeDWord(vmtLength);

   //   vmt flags
   vmtWriter.writeDWord(flags);

   //   dummy class reference
   vmtWriter.writeDWord(0);

   int position = vmtWriter.Position();

   size_t vmtSize = 0;
   if (test(flags, elStandartVMT)) {
      // + VMT length
      vmtSize = vmtLength * sizeof(VMTEntry);
   }

   vmtWriter.writeBytes(0, vmtSize);

   vmtWriter.seek(position);
}
开发者ID:,项目名称:,代码行数:29,代码来源:

示例2: writeTrailItem

inline int writeTrailItem(MemoryWriter& writer, int nonterminal, int next)
{
   int offset = writer.Position();
   writer.writeDWord(nonterminal);
   writer.writeDWord(next);

   return offset;
}
开发者ID:,项目名称:,代码行数:8,代码来源:

示例3: writeReference

void Instance::ImageReferenceHelper :: writeReference(MemoryWriter& writer, ref_t reference, size_t disp, _Module* module)
{
   size_t pos = reference & ~mskAnyRef;
   if (test(reference, mskRelCodeRef)) {
      writer.writeDWord(pos - writer.Position() - 4);
   }
   else writer.writeDWord((test(reference, mskRDataRef) ? _statBase : _codeBase) + pos + disp);
}
开发者ID:bencz,项目名称:cpu-simulator,代码行数:8,代码来源:elenamachine.cpp

示例4: writeDerivationItem

inline int writeDerivationItem(MemoryWriter& writer, int key, int terminal, int trace)
{
   int offset = writer.Position();
   writer.writeDWord(key);
   writer.writeDWord(terminal);
   writer.writeDWord(trace);

   return offset;
}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例5: writeCommand

void ECodesAssembler :: writeCommand(ByteCommand command, MemoryWriter& writer)
{
   writer.writeByte(command.code);
   if (command.code >= 0x20) {
      writer.writeDWord(command.argument);
   }
   if (command.code >= 0xE0) {
      writer.writeDWord(command.additional);
   }
}
开发者ID:sanyaade-teachings,项目名称:elena-lang,代码行数:10,代码来源:ecassembler.cpp

示例6: writeCommand

void ECodesAssembler :: writeCommand(ByteCommand command, MemoryWriter& writer)
{
   writer.writeByte(command.code);
   if (command.code > MAX_SINGLE_ECODE) {
      writer.writeDWord(command.argument);
   }
   if (command.code > MAX_DOUBLE_ECODE) {
      writer.writeDWord(command.additional);
   }
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例7: writeTapeRecord

inline void writeTapeRecord(MemoryWriter& tape, size_t command, ident_t value1, ident_t value2)
{
   tape.writeDWord(command);
   // write total length including equal sign
   tape.writeDWord(getlength(value1) + getlength(value2) + 2);
   if (!emptystr(value1)) {
      tape.writeLiteral(value1, getlength(value1));
      tape.writeChar('=');
   }
   if (!emptystr(value2)) {
      tape.writeLiteral(value2);
   }
   else tape.writeChar((char)0);
}
开发者ID:ELENA-LANG,项目名称:elena-lang,代码行数:14,代码来源:image.cpp

示例8: writeReference

void JITLinker::ReferenceHelper :: writeReference(MemoryWriter& writer, ref_t reference, size_t disp, _Module* module)
{
   ref_t mask = reference & mskAnyRef;
   ref_t refID = reference & ~mskAnyRef;

   //// check if it is a constant, resolve it immediately
   //if (mask == mskLinkerConstant) {
   //   writer.writeDWord(getLinkerConstant(refID));
   //   return;
   //}

   if (!module)
      module = _module;

   ref_t position = writer.Position();
   writer.writeDWord(disp);

   // vmt entry offset should be resolved later
   if (mask == mskVMTEntryOffset) {
      _references->add(position, RefInfo(reference, module));
      return;
   }

   // try to resolve immediately
   void* vaddress = _owner->_loader->resolveReference(
      _owner->_loader->retrieveReference(module, refID, mask), mask);

   if (vaddress != LOADER_NOTLOADED) {
      resolveReference(writer.Memory(), position, (ref_t)vaddress, mask, _owner->_virtualMode);
   }
   // or resolve later
   else _references->add(position, RefInfo(reference, module));
}
开发者ID:sanyaade-teachings,项目名称:elena-lang,代码行数:33,代码来源:jitlinker.cpp

示例9: compileRJump

void ECodesAssembler :: compileRJump(ByteCode code, TokenInfo& token, MemoryWriter& writer, LabelInfo& info, _Module* binary)
{
   writer.writeByte(code);

   int label = 0;

   token.read();

   if (info.labels.exist(token.value)) {
      label = info.labels.get(token.value) - writer.Position() - 8;
   }
   else {
      info.fwdJumps.add(token.value, writer.Position() + 4);
   }
   size_t reference = compileRArg(token, binary);

   writer.writeDWord(reference);
   writer.writeDWord(label);
}
开发者ID:,项目名称:,代码行数:19,代码来源:

示例10: compileMccJump

void ECodesAssembler :: compileMccJump(ByteCode code, TokenInfo& token, MemoryWriter& writer, LabelInfo& info)
{
   writer.writeByte(code);

   int label = 0;

   token.read();

   if (info.labels.exist(token.value)) {
      label = info.labels.get(token.value) - writer.Position() - 8;
   }
   else {
      info.fwdJumps.add(token.value, 4 + writer.Position());
   }

   int message = token.readInteger(constants);

   writer.writeDWord(message);
   writer.writeDWord(label);
}
开发者ID:,项目名称:,代码行数:20,代码来源:

示例11: fixVMT

void JITCompiler32 :: fixVMT(MemoryWriter& vmtWriter, void* classClassVAddress, void* packageVAddress, int count, bool virtualMode)
{
   _Memory* image = vmtWriter.Memory();   

   // update class package reference if available
   if (packageVAddress != NULL) {
      int position = vmtWriter.Position();
      vmtWriter.seek(position - 0x10);

      if (virtualMode) {
         vmtWriter.writeRef((ref_t)packageVAddress, 0);
      }
      else vmtWriter.writeDWord((int)packageVAddress);

      vmtWriter.seek(position);
   }

   // update class vmt reference if available
   if (classClassVAddress != NULL) {
      vmtWriter.seek(vmtWriter.Position() - 4);

      if (virtualMode) {                                  
         vmtWriter.writeRef((ref_t)classClassVAddress, 0);
      }
      else vmtWriter.writeDWord((int)classClassVAddress);
   }

   // if in virtual mode mark method addresses as reference
   if (virtualMode) {
      ref_t entryPosition = vmtWriter.Position();
      for (int i = 0 ; i < count ; i++) {
         image->addReference(mskCodeRef, entryPosition + 4);
      
         entryPosition += 8;
      }
   }
}
开发者ID:,项目名称:,代码行数:37,代码来源:

示例12: if

void JITLinker::ReferenceHelper :: writeReference(MemoryWriter& writer, void* vaddress, bool relative, size_t disp)
{
   if (!_owner->_virtualMode) {
      ref_t address = (ref_t)vaddress;

      // calculate relative address
      if (relative)
         address -= ((ref_t)writer.Address() + 4);

      writer.writeDWord(address + disp);
   }
   else if (relative) {
      writer.writeRef(((ref_t)vaddress | mskRelCodeRef), disp);
   }
   else writer.writeRef((ref_t)vaddress, disp);
}
开发者ID:sanyaade-teachings,项目名称:elena-lang,代码行数:16,代码来源:jitlinker.cpp

示例13: compileJump

void ECodesAssembler :: compileJump(ByteCode code, TokenInfo& token, MemoryWriter& writer, LabelInfo& info)
{
   writer.writeByte(code);

   int label = 0;

   token.read();

   if (info.labels.exist(token.value)) {
      label = info.labels.get(token.value) - writer.Position() - 4;
   }
   else {
      info.fwdJumps.add(token.value, writer.Position());
   }

   writer.writeDWord(label);
}
开发者ID:,项目名称:,代码行数:17,代码来源:

示例14: allocateVariable

void JITCompiler32 :: allocateVariable(MemoryWriter& writer)
{
   writer.writeDWord(0);
}
开发者ID:,项目名称:,代码行数:4,代码来源:

示例15: writeTape

void Instance::ImageReferenceHelper :: writeTape(MemoryWriter& tape, void* vaddress, int mask)
{
   int ref = (size_t)vaddress - (test(mask, mskRDataRef) ? _statBase : _codeBase);

   tape.writeDWord(ref | mask);
}
开发者ID:bencz,项目名称:cpu-simulator,代码行数:6,代码来源:elenamachine.cpp


注:本文中的MemoryWriter::writeDWord方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。