/** @since 0.8 or earlier */ @Override public String toString() { CompilerAsserts.neverPartOfCompilation("do not call FrameSlot.toString from compiled code"); return "[" + index + "," + identifier + "," + kind + "]"; } }
private static void enterSizeCheck(Object valueToReallocate, long oldSize, long newSizeEstimate) { CompilerAsserts.neverPartOfCompilation(); assert (newSizeEstimate == SIZE_UNKNOWN || newSizeEstimate > 0) : "Wrong new size estimate = " + newSizeEstimate; assert valueToReallocate != null || oldSize == 0 : "Old size must be 0 for new allocations. Was: " + oldSize; assert valueToReallocate == null || (oldSize > 0 || oldSize == SIZE_UNKNOWN) : "Old size of a re-allocated value must be positive or unknown. Was: " + oldSize; }
private ForeignAccess(Supplier<? extends RootNode> languageCheckSupplier, Factory faf) { this.factory = faf; this.initThread = null; this.languageCheckSupplier = languageCheckSupplier; CompilerAsserts.neverPartOfCompilation("do not create a ForeignAccess object from compiled code"); }
@Override public Constructor<?> getReflectionMethod() { CompilerAsserts.neverPartOfCompilation(); return reflectionConstructor; }
private boolean setValueCheck(Object value) { CompilerAsserts.neverPartOfCompilation(); LinkedList<Reference<Object>> list = valueCheck.get(); if (list == null) { list = new LinkedList<>(); valueCheck.set(list); } list.add(new WeakReference<>(value)); return true; }
/** * Assertion that the corresponding value is reduced to a constant during compilation. * * @param value the value that must be constant during compilation */ public static <T> void compilationConstant(Object value) { if (!CompilerDirectives.isCompilationConstant(value)) { neverPartOfCompilation("Value is not compilation constant"); } }
/** * Finds an existing slot. This is a slow operation. * * @param identifier the key of the slot to search for * @return the slot or <code>null</code> * @since 0.8 or earlier */ public FrameSlot findFrameSlot(Object identifier) { CompilerAsserts.neverPartOfCompilation(NEVER_PART_OF_COMPILATION_MESSAGE); return identifierToSlotMap.get(identifier); }
/** * Cancels the subscription permanently. * * @since 0.12 */ public synchronized void dispose() { CompilerAsserts.neverPartOfCompilation(); if (!disposed) { instrumenter.disposeBinding(this); disposed = true; } }
public void removeFrameSlot(Object identifier) { CompilerAsserts.neverPartOfCompilation("interpreter-only. includes hashmap operations."); assert identifierToSlotMap.containsKey(identifier); slots.remove(identifierToSlotMap.get(identifier)); identifierToSlotMap.remove(identifier); updateVersion(); getNotInFrameAssumption(identifier); }
@Override protected MethodHandle makeMethodHandle() { CompilerAsserts.neverPartOfCompilation(); try { final MethodHandle methodHandle = MethodHandles.publicLookup().unreflect(reflectionMethod); return adaptSignature(methodHandle, Modifier.isStatic(reflectionMethod.getModifiers()), reflectionMethod.getParameterCount()); } catch (IllegalAccessException e) { throw new IllegalStateException(e); } } }
public FrameSlot addFrameSlot(Object identifier, Object info, FrameSlotKind kind) { CompilerAsserts.neverPartOfCompilation("interpreter-only. includes hashmap operations."); assert !identifierToSlotMap.containsKey(identifier); FrameSlot slot = new FrameSlot(this, identifier, info, slots.size(), kind); slots.add(slot); identifierToSlotMap.put(identifier, slot); updateVersion(); invalidateNotInFrameAssumption(identifier); return slot; }
/** @since 0.8 or earlier */ protected Node() { CompilerAsserts.neverPartOfCompilation("do not create a Node from compiled code"); assert NodeClass.get(getClass()) != null; // ensure NodeClass constructor does not throw if (TruffleOptions.TraceASTJSON) { dump(this, null, null); } }
@Override public RootCallTarget createCallTarget(RootNode rootNode) { CompilerAsserts.neverPartOfCompilation(); final RootCallTarget newCallTarget = createClonedCallTarget(null, rootNode); TruffleSplittingStrategy.newTargetCreated(tvmci, newCallTarget); return newCallTarget; }
private boolean sameResultAsRegularMatchers(TRegexDFAExecutorNode executor, char c, boolean compactString, int allTransitionsMatcherResult) { CompilerAsserts.neverPartOfCompilation(); if (executor.isRegressionTestMode()) { for (int i = 0; i < matchers.length; i++) { if (matchers[i].execute(c, compactString)) { return i == allTransitionsMatcherResult; } } return allTransitionsMatcherResult == -1; } return true; }
@Override public Object invoke(Object proxy, Method method, Object[] arguments) throws Throwable { CompilerAsserts.neverPartOfCompilation(); Object[] resolvedArguments = arguments == null ? HostInteropReflect.EMPTY : arguments; if (method.equals(functionMethod)) { return target.call(languageContext, functionObj, spreadVarArgsArray(resolvedArguments)); } else { return invokeDefault(this, proxy, method, resolvedArguments); } }
@Override public void notifyTransferToInterpreter() { CompilerAsserts.neverPartOfCompilation(); if (TruffleRuntimeOptions.getValue(TraceTruffleTransferToInterpreter)) { TraceTransferToInterpreterHelper.traceTransferToInterpreter(this, this.getTruffleCompiler()); } }
private void initializeProfiledArgumentTypes(Object[] args) { CompilerAsserts.neverPartOfCompilation(); if (TruffleRuntimeOptions.getValue(SharedTruffleRuntimeOptions.TruffleArgumentTypeSpeculation)) { Class<?>[] result = new Class<?>[args.length]; for (int i = 0; i < args.length; i++) { result[i] = classOf(args[i]); } profiledArgumentTypes = result; } profiledArgumentTypesAssumption = createValidAssumption("Profiled Argument Types"); }
@Override protected MethodHandle makeMethodHandle() { CompilerAsserts.neverPartOfCompilation(); try { final MethodHandle methodHandle = MethodHandles.publicLookup().unreflectConstructor(reflectionConstructor); return adaptSignature(methodHandle, true, getParameterCount()); } catch (IllegalAccessException e) { throw new IllegalStateException(e); } } }
public void register(String name, LuaRootNode rootNode) { CompilerAsserts.neverPartOfCompilation(); LuaFunction method = lookup(name); RootCallTarget callTarget = Truffle.getRuntime().createCallTarget(rootNode); method.setCallTarget(callTarget); } }
@SuppressWarnings("deprecation") public RootCallTarget createClonedCallTarget(OptimizedCallTarget source, RootNode rootNode) { CompilerAsserts.neverPartOfCompilation(); OptimizedCallTarget target = createOptimizedCallTarget(source, rootNode); rootNode.setCallTarget(target); tvmci.onLoad(target.getRootNode()); return target; }