當前位置: 首頁>>代碼示例>>Java>>正文


Java SArray.getLongStorage方法代碼示例

本文整理匯總了Java中som.vmobjects.SArray.getLongStorage方法的典型用法代碼示例。如果您正苦於以下問題:Java SArray.getLongStorage方法的具體用法?Java SArray.getLongStorage怎麽用?Java SArray.getLongStorage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在som.vmobjects.SArray的用法示例。


在下文中一共展示了SArray.getLongStorage方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

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

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

示例3: doLongSArray

import som.vmobjects.SArray; //導入方法依賴的package包/類
@Specialization(guards = "receiver.isLongType()")
public final long doLongSArray(final VirtualFrame frame,
    final SArray receiver, final long idx) {
  try {
    return receiver.getLongStorage(storageType)[(int) idx - 1];
  } catch (IndexOutOfBoundsException e) {
    return (long) triggerException(frame, receiver, idx);
  }
}
 
開發者ID:smarr,項目名稱:SOMns,代碼行數:10,代碼來源:AtPrim.java

示例4: doLongArray

import som.vmobjects.SArray; //導入方法依賴的package包/類
@Specialization(guards = "somArray.isLongType()")
public final Object[] doLongArray(final SArray somArray,
    final Object rcvr) {
  long[] arr = somArray.getLongStorage(storageType);
  Object[] args = new Object[arr.length + 1];
  args[0] = rcvr;
  for (int i = 0; i < arr.length; i++) {
    args[i + 1] = arr[i];
  }
  return args;
}
 
開發者ID:smarr,項目名稱:SOMns,代碼行數:12,代碼來源:ToArgumentsArrayNode.java

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

示例6: doLongArray

import som.vmobjects.SArray; //導入方法依賴的package包/類
@Specialization(guards = "isLongType(somArray)")
public final Object[] doLongArray(final SArray somArray,
    final Object rcvr) {
  long[] arr = somArray.getLongStorage(storageType);
  Object[] args = new Object[arr.length + 1];
  args[0] = rcvr;
  for (int i = 0; i < arr.length; i++) {
    args[i + 1] = arr[i];
  }
  return args;
}
 
開發者ID:smarr,項目名稱:TruffleSOM,代碼行數:12,代碼來源:ToArgumentsArrayNode.java

示例7: doObjectSArray

import som.vmobjects.SArray; //導入方法依賴的package包/類
@Specialization(guards = "isLongType(receiver)")
public final Object doObjectSArray(final SArray receiver, final long index,
    final long value) {
  long idx = index - 1;
  receiver.getLongStorage(storageType)[(int) idx] = value;
  return value;
}
 
開發者ID:smarr,項目名稱:TruffleSOM,代碼行數:8,代碼來源:AtPutPrim.java

示例8: doLongSArray

import som.vmobjects.SArray; //導入方法依賴的package包/類
@Specialization(guards = {"isLongType(receiver)", "valueIsNotLong(value)"})
public final Object doLongSArray(final SArray receiver, final long index,
    final Object value) {
  long idx = index - 1;

  long[] storage = receiver.getLongStorage(storageType);
  Object[] newStorage = new Object[storage.length];
  for (int i = 0; i < storage.length; i++) {
    newStorage[i] = storage[i];
  }

  receiver.transitionTo(ArrayType.OBJECT, newStorage);
  newStorage[(int) idx] = value;
  return value;
}
 
開發者ID:smarr,項目名稱:TruffleSOM,代碼行數:16,代碼來源:AtPutPrim.java

示例9: doLongSArray

import som.vmobjects.SArray; //導入方法依賴的package包/類
@Specialization(guards = "receiver.isLongType()")
public final long doLongSArray(final SArray receiver) {
  return receiver.getLongStorage(storageType).length;
}
 
開發者ID:smarr,項目名稱:SOMns,代碼行數:5,代碼來源:SizeAndLengthPrim.java

示例10: doLongSArray

import som.vmobjects.SArray; //導入方法依賴的package包/類
@Specialization(guards = "isLongType(receiver)")
public final long doLongSArray(final SArray receiver, final long idx) {
  return receiver.getLongStorage(storageType)[(int) idx - 1];
}
 
開發者ID:smarr,項目名稱:TruffleSOM,代碼行數:5,代碼來源:AtPrim.java

示例11: doLongSArray

import som.vmobjects.SArray; //導入方法依賴的package包/類
@Specialization(guards = "isLongType(receiver)")
public final long doLongSArray(final SArray receiver) {
  return receiver.getLongStorage(storageType).length;
}
 
開發者ID:smarr,項目名稱:TruffleSOM,代碼行數:5,代碼來源:LengthPrim.java


注:本文中的som.vmobjects.SArray.getLongStorage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。