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


Java SArray类代码示例

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


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

示例1: doEmptyArray

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

示例2: doPartiallyEmptyArray

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

示例3: 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

示例4: doLongArray

import som.vmobjects.SArray; //导入依赖的package包/类
@Specialization(guards = "arr.isLongType()")
public final SArray doLongArray(final SArray arr, final SBlock block) {
  long[] storage = arr.getLongStorage(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

示例5: doDoubleArray

import som.vmobjects.SArray; //导入依赖的package包/类
@Specialization(guards = "arr.isDoubleType()")
public final SArray doDoubleArray(final SArray arr, final SBlock block) {
  double[] storage = arr.getDoubleStorage(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

示例6: doBooleanArray

import som.vmobjects.SArray; //导入依赖的package包/类
@Specialization(guards = "arr.isBooleanType()")
public final SArray doBooleanArray(final SArray arr, final SBlock block) {
  boolean[] storage = arr.getBooleanStorage(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

示例7: evalBlockWithArgForRemaining

import som.vmobjects.SArray; //导入依赖的package包/类
public static void evalBlockWithArgForRemaining(final SBlock block,
    final long length, final Object[] storage,
    final BlockDispatchNode blockDispatch, final Object first, final IsValue isValue) {
  if (!isValue.executeEvaluated(first)) {
    signalNotAValue();
  }
  for (int i = SArray.FIRST_IDX + 1; i < length; i++) {
    Object result = blockDispatch.executeDispatch(new Object[] {block, (long) i + 1});
    if (!isValue.executeEvaluated(result)) {
      signalNotAValue();
    } else {
      storage[i] = result;
    }
  }
}
 
开发者ID:smarr,项目名称:SOMns,代码行数:16,代码来源:ArraySetAllStrategy.java

示例8: spawnProcess

import som.vmobjects.SArray; //导入依赖的package包/类
@Specialization(guards = "procMod == ProcessesModule")
@TruffleBoundary
public final Object spawnProcess(final SImmutableObject procMod,
    final SClass procCls, final SArray arg, final Object[] argArr,
    @Cached("createIsValue()") final IsValue isVal) {
  if (!isVal.executeEvaluated(procCls)) {
    KernelObj.signalException("signalNotAValueWith:", procCls);
  }

  SSymbol sel = procCls.getMixinDefinition().getPrimaryFactorySelector();
  SInvokable disp = procCls.getMixinDefinition().getFactoryMethods().get(sel);
  SObjectWithClass obj = (SObjectWithClass) disp.invoke(argArr);

  processesPool.submit(createProcess(obj, sourceSection,
      onExec.executeShouldHalt()));
  return Nil.nilObject;
}
 
开发者ID:smarr,项目名称:SOMns,代码行数:18,代码来源:ActivitySpawn.java

示例9: performDnu

import som.vmobjects.SArray; //导入依赖的package包/类
public static Object performDnu(final Object[] arguments, final Object rcvr,
    final SClass rcvrClass, final SSymbol selector,
    final IndirectCallNode call) {
  if (VmSettings.DNU_PRINT_STACK_TRACE) {
    PrintStackTracePrim.printStackTrace(0, null);
    VM.errorPrintln("Lookup of " + selector + " failed in "
        + Types.getClassOf(rcvr).getName().getString());
  }

  // Won't use DNU caching here, because it is already a megamorphic node
  SArray argumentsArray = SArguments.getArgumentsWithoutReceiver(arguments);
  Object[] args = new Object[] {arguments[0], selector, argumentsArray};
  CallTarget target = CachedDnuNode.getDnu(rcvrClass, selector,
      SomLanguage.getVM(call.getRootNode()));
  return call.call(target, args);
}
 
开发者ID:smarr,项目名称:SOMns,代码行数:17,代码来源:AbstractGenericDispatchNode.java

示例10: interpretMethod

import som.vmobjects.SArray; //导入依赖的package包/类
private SAbstractObject interpretMethod(final SAbstractObject receiver,
    final SInvokable invokable, final SArray arguments) {
  SMethod bootstrapMethod = createBootstrapMethod();

  // Create a fake bootstrap frame with the system object on the stack
  Frame bootstrapFrame = interpreter.pushNewFrame(bootstrapMethod);
  bootstrapFrame.push(receiver);

  if (arguments != null) {
    bootstrapFrame.push(arguments);
  }

  // Invoke the initialize invokable
  invokable.invoke(bootstrapFrame, interpreter);

  // Start the interpreter
  return interpreter.start();
}
 
开发者ID:smarr,项目名称:som-java,代码行数:19,代码来源:Universe.java

示例11: initializeSystemClass

import som.vmobjects.SArray; //导入依赖的package包/类
private void initializeSystemClass(final SClass systemClass, final SClass superClass,
    final String name) {
  // Initialize the superclass hierarchy
  if (superClass != null) {
    systemClass.setSuperClass(superClass);
    systemClass.getSOMClass(this).setSuperClass(superClass.getSOMClass(this));
  } else {
    systemClass.getSOMClass(this).setSuperClass(classClass);
  }

  // Initialize the array of instance fields
  systemClass.setInstanceFields(SArray.create(new Object[0]));
  systemClass.getSOMClass(this).setInstanceFields(SArray.create(new Object[0]));

  // Initialize the array of instance invokables
  systemClass.setInstanceInvokables(SArray.create(new Object[0]));
  systemClass.getSOMClass(this).setInstanceInvokables(SArray.create(new Object[0]));

  // Initialize the name of the system class
  systemClass.setName(symbolFor(name));
  systemClass.getSOMClass(this).setName(symbolFor(name + " class"));

  // Insert the system class into the dictionary of globals
  setGlobal(systemClass.getName(), systemClass);
}
 
开发者ID:smarr,项目名称:TruffleSOM,代码行数:26,代码来源:Universe.java

示例12: doEmptyArray

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

示例13: doPartiallyEmptyArray

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

示例14: 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

示例15: doLongArray

import som.vmobjects.SArray; //导入依赖的package包/类
@Specialization(guards = "isLongType(arr)")
public final SArray doLongArray(final VirtualFrame frame,
    final SArray arr, final SBlock block) {
  long[] storage = arr.getLongStorage(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


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