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


Java SArray.getObjectStorage方法代码示例

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


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

示例1: doObjectArray

import som.vmobjects.SArray; //导入方法依赖的package包/类
@Specialization(guards = "arr.isObjectType()")
public final SArray doObjectArray(final SArray arr, final SBlock block) {
  Object[] storage = arr.getObjectStorage(storageType);
  int length = storage.length;
  try {
    if (SArray.FIRST_IDX < length) {
      execBlock(block, storage[SArray.FIRST_IDX]);
    }
    for (long i = SArray.FIRST_IDX + 1; i < length; i++) {
      execBlock(block, storage[(int) i]);
    }
  } finally {
    if (CompilerDirectives.inInterpreter()) {
      SomLoop.reportLoopCount(length, this);
    }
  }
  return arr;
}
 
开发者ID:smarr,项目名称:SOMns,代码行数:19,代码来源:DoPrim.java

示例2: doObjectArray

import som.vmobjects.SArray; //导入方法依赖的package包/类
@Specialization(guards = "isObjectType(arr)")
public final SArray doObjectArray(final VirtualFrame frame,
    final SArray arr, final SBlock block) {
  Object[] storage = arr.getObjectStorage(storageType);
  int length = storage.length;
  try {
    if (SArray.FIRST_IDX < length) {
      execBlock(frame, block, storage[SArray.FIRST_IDX]);
    }
    for (long i = SArray.FIRST_IDX + 1; i < length; i++) {
      execBlock(frame, block, storage[(int) i]);
    }
  } finally {
    if (CompilerDirectives.inInterpreter()) {
      reportLoopCount(length);
    }
  }
  return arr;
}
 
开发者ID:smarr,项目名称:TruffleSOM,代码行数:20,代码来源:DoPrim.java

示例3: doObjectSArray

import som.vmobjects.SArray; //导入方法依赖的package包/类
@Specialization(guards = "receiver.isObjectType()")
public final Object doObjectSArray(final VirtualFrame frame,
    final SArray receiver, final long idx) {
  try {
    return receiver.getObjectStorage(storageType)[(int) idx - 1];
  } catch (IndexOutOfBoundsException e) {
    return triggerException(frame, receiver, idx);
  }
}
 
开发者ID:smarr,项目名称:SOMns,代码行数:10,代码来源:AtPrim.java

示例4: doApply

import som.vmobjects.SArray; //导入方法依赖的package包/类
@Specialization
public final Object doApply(final TruffleObject fun, final SArray args) {
  Node execNode = Message.createExecute((int) size.executeEvaluated(args)).createNode();

  Object[] arguments;
  if (args.isLongType()) {
    long[] arr = args.getLongStorage(storageType);
    arguments = new Object[arr.length];
    for (int i = 0; i < arr.length; i++) {
      arguments[i] = arr[i];
    }
  } else if (args.isObjectType()) {
    arguments = args.getObjectStorage(storageType);
  } else {
    CompilerDirectives.transferToInterpreter();
    throw new NotYetImplementedException();
  }

  try {
    Object result = ForeignAccess.sendExecute(execNode, fun, arguments);
    return convert.executeEvaluated(result);
  } catch (UnsupportedTypeException | ArityException
      | UnsupportedMessageException e) {
    CompilerDirectives.transferToInterpreter();
    throw new RuntimeException(e);
  }
}
 
开发者ID:smarr,项目名称:SOMns,代码行数:28,代码来源:SystemPrims.java

示例5: doObjectSArray

import som.vmobjects.SArray; //导入方法依赖的package包/类
@Specialization(guards = "isObjectType(receiver)")
public final Object doObjectSArray(final SArray receiver, final long index,
    final Object value) {
  long idx = index - 1;
  receiver.getObjectStorage(storageType)[(int) idx] = value;
  return value;
}
 
开发者ID:smarr,项目名称:TruffleSOM,代码行数:8,代码来源:AtPutPrim.java

示例6: doObjectSArray

import som.vmobjects.SArray; //导入方法依赖的package包/类
@Specialization(guards = "receiver.isObjectType()")
public final long doObjectSArray(final SArray receiver) {
  return receiver.getObjectStorage(storageType).length;
}
 
开发者ID:smarr,项目名称:SOMns,代码行数:5,代码来源:SizeAndLengthPrim.java

示例7: doObjectSArray

import som.vmobjects.SArray; //导入方法依赖的package包/类
@Specialization(guards = "isObjectType(receiver)")
public final Object doObjectSArray(final SArray receiver, final long idx) {
  return receiver.getObjectStorage(storageType)[(int) idx - 1];
}
 
开发者ID:smarr,项目名称:TruffleSOM,代码行数:5,代码来源:AtPrim.java

示例8: doObjectSArray

import som.vmobjects.SArray; //导入方法依赖的package包/类
@Specialization(guards = "isObjectType(receiver)")
public final long doObjectSArray(final SArray receiver) {
  return receiver.getObjectStorage(storageType).length;
}
 
开发者ID:smarr,项目名称:TruffleSOM,代码行数:5,代码来源:LengthPrim.java

示例9: setInstanceFieldsOfSuper

import som.vmobjects.SArray; //导入方法依赖的package包/类
public void setInstanceFieldsOfSuper(final SArray fieldNames) {
  for (int i = 0; i < fieldNames.getObjectStorage(storageType).length; i++) {
    instanceFields.add((SSymbol) fieldNames.getObjectStorage(storageType)[i]);
  }
}
 
开发者ID:smarr,项目名称:TruffleSOM,代码行数:6,代码来源:ClassGenerationContext.java

示例10: setClassFieldsOfSuper

import som.vmobjects.SArray; //导入方法依赖的package包/类
public void setClassFieldsOfSuper(final SArray fieldNames) {
  for (int i = 0; i < fieldNames.getObjectStorage(storageType).length; i++) {
    classFields.add((SSymbol) fieldNames.getObjectStorage(storageType)[i]);
  }
}
 
开发者ID:smarr,项目名称:TruffleSOM,代码行数:6,代码来源:ClassGenerationContext.java


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