當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。