本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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);
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}