本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例6: doObjectSArray
import som.vmobjects.SArray; //导入方法依赖的package包/类
@Specialization(guards = "receiver.isObjectType()")
public final long doObjectSArray(final SArray receiver) {
return receiver.getObjectStorage(storageType).length;
}
示例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];
}
示例8: doObjectSArray
import som.vmobjects.SArray; //导入方法依赖的package包/类
@Specialization(guards = "isObjectType(receiver)")
public final long doObjectSArray(final SArray receiver) {
return receiver.getObjectStorage(storageType).length;
}
示例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]);
}
}
示例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]);
}
}