Codota Logo
VirtualFrame
Code IndexAdd Codota to your IDE (free)

How to use
VirtualFrame
in
com.oracle.truffle.api.frame

Best Java code snippets using com.oracle.truffle.api.frame.VirtualFrame (Showing top 20 results out of 315)

  • Common ways to obtain VirtualFrame
private void myMethod () {
VirtualFrame v =
  • Codota IconFrameDescriptor descriptor;Object[] arguments;new DefaultVirtualFrame(descriptor, arguments)
  • Smart code suggestions by Codota
}
origin: com.oracle.truffle/truffle-api

  @Override
  public Object execute(VirtualFrame frame) {
    return frame.getArguments()[0];
  }
}
origin: com.oracle.truffle/truffle-api

@ExplodeLoop
private void clearSlots(VirtualFrame frame) {
  FrameSlot[] slots = inputSlots;
  if (slots != null) {
    if (frame.getFrameDescriptor() == sourceFrameDescriptor) {
      for (int i = 0; i < slots.length; i++) {
        frame.setObject(slots[i], null);
      }
    }
  }
}
origin: com.oracle.truffle/truffle-api

@ExplodeLoop
protected final Object[] getSavedInputValues(VirtualFrame frame) {
  FrameSlot[] slots = inputSlots;
  if (slots == null) {
    return EMPTY_ARRAY;
  }
  Object[] inputValues;
  if (frame.getFrameDescriptor() == sourceFrameDescriptor) {
    inputValues = new Object[slots.length];
    for (int i = 0; i < slots.length; i++) {
      try {
        inputValues[i] = frame.getObject(slots[i]);
      } catch (FrameSlotTypeException e) {
        CompilerDirectives.transferToInterpreter();
        throw new AssertionError(e);
      }
    }
  } else {
    inputValues = new Object[inputSlots.length];
  }
  return inputValues;
}
origin: com.oracle.truffle/truffle-debug

@Override
protected void onEnter(VirtualFrame frame) {
  frame.setLong(timeStartedSlot, System.nanoTime());
  super.onEnter(frame);
  frame.setObject(parentCounterSlot, profiler.activeCounter);
  profiler.activeCounter = counter;
  if (CompilerDirectives.inInterpreter()) {
    counter.compiled = false;
  } else {
    counter.compiled = true;
  }
}
origin: com.oracle.truffle/truffle-api

@Override
protected void onReturnValue(VirtualFrame frame, Object result) {
  if (stepping.get()) {
    doStepAfter(frame.materialize(), result);
  }
}
origin: org.graalvm.regex/regex

public void setResultObject(VirtualFrame frame, Object result) {
  frame.setObject(props.getCaptureGroupResultFS(), result);
}
origin: com.oracle.truffle/truffle-debug

@Override
protected void onReturnValue(VirtualFrame frame, Object result) {
  long startTime;
  Counter parentCounter;
  try {
    startTime = frame.getLong(timeStartedSlot);
    parentCounter = (Counter) frame.getObject(parentCounterSlot);
  } catch (FrameSlotTypeException e) {
    throw new AssertionError();
  }
  long timeNano = System.nanoTime() - startTime;
  if (CompilerDirectives.inInterpreter()) {
    counter.interpretedTotalTime += timeNano;
  } else {
    counter.compiledTotalTime += timeNano;
  }
  // the condition if parentCounter is usually only for a root method null
  // after that it is always set. So it makes sense to speculate.
  if (parentNotNullProfile.profile(parentCounter != null)) {
    // do not speculate on parentCounter.compiled condition very likely to invalidate
    if (parentCounter.compiled) {
      parentCounter.compiledChildTime += timeNano;
    } else {
      parentCounter.interpretedChildTime += timeNano;
    }
  }
  profiler.activeCounter = parentCounter;
}
origin: com.oracle.truffle/truffle-api

protected final Object getSavedInputValue(VirtualFrame frame, int inputIndex) {
  try {
    verifyIndex(inputIndex);
    if (inputSlots == null) {
      // never saved any value
      return null;
    }
    return frame.getObject(inputSlots[inputIndex]);
  } catch (FrameSlotTypeException e) {
    CompilerDirectives.transferToInterpreter();
    throw new AssertionError(e);
  }
}
origin: org.graalvm.truffle/truffle-api

@Override
public Object execute(VirtualFrame frame) {
  assert frameDescriptor == null || frameDescriptor == frame.getFrameDescriptor();
  assureAdopted();
  Object ret = fragment.execute(frame);
  assert checkNullOrInterop(ret);
  return ret;
}
origin: cesquivias/mumbler

@Specialization(rewriteOn = FrameSlotTypeException.class)
protected long readLong(VirtualFrame virtualFrame)
    throws FrameSlotTypeException{
  return virtualFrame.getLong(getSlot());
}
origin: sh286/LuaTruffle

@Specialization(guards = "isLongKind")
protected long writeLong(VirtualFrame frame, long value) {
  frame.setLong(getSlot(), value);
  return value;
}
origin: com.oracle.truffle/truffle-api

@Override
protected void onEnter(VirtualFrame frame) {
  if (stepping.get()) {
    doStepBefore(frame.materialize());
  }
}
origin: org.graalvm.regex/regex

public void setInput(VirtualFrame frame, Object input) {
  frame.setObject(props.getInputFS(), input);
}
origin: org.graalvm.truffle/truffle-api

protected final Object getSavedInputValue(VirtualFrame frame, int inputIndex) {
  try {
    verifyIndex(inputIndex);
    if (inputSlots == null) {
      // never saved any value
      return null;
    }
    return frame.getObject(inputSlots[inputIndex]);
  } catch (FrameSlotTypeException e) {
    CompilerDirectives.transferToInterpreter();
    throw new AssertionError(e);
  }
}
origin: com.oracle.truffle/truffle-api

@Override
public Object execute(VirtualFrame frame) {
  assert frameDescriptor == null || frameDescriptor == frame.getFrameDescriptor();
  Object ret = fragment.execute(frame);
  assert checkNullOrInterop(ret);
  return ret;
}
origin: sh286/LuaTruffle

@Specialization(rewriteOn = FrameSlotTypeException.class)
protected long readLong(VirtualFrame frame) throws FrameSlotTypeException {
  return frame.getLong(getSlot());
}
origin: cesquivias/mumbler

@Specialization(guards = "isLongKind()")
protected long writeLong(VirtualFrame virtualFrame, long value) {
  virtualFrame.setLong(this.getSlot(), value);
  return value;
}
origin: sh286/LuaTruffle

@Override
public Object execute(VirtualFrame frame) {
  Object[] args = frame.getArguments();
  if (index < args.length) {
    return args[index];
  } else {
    return LuaNull.SINGLETON;
  }
}
origin: org.graalvm.truffle/truffle-api

@ExplodeLoop
private void clearSlots(VirtualFrame frame) {
  FrameSlot[] slots = inputSlots;
  if (slots != null) {
    if (frame.getFrameDescriptor() == sourceFrameDescriptor) {
      for (int i = 0; i < slots.length; i++) {
        frame.setObject(slots[i], null);
      }
    }
  }
}
origin: org.graalvm.truffle/truffle-api

@Override
public void onReturnValue(VirtualFrame frame, Object result) {
  if (stepping.get()) {
    doReturn(frame.materialize(), result);
  }
}
com.oracle.truffle.api.frameVirtualFrame

Javadoc

Represents a frame containing values of local variables of the guest language. Instances of this type must not be stored in a field or cast to java.lang.Object. If this is necessary, the frame must be explicitly converted into a materialized frame using the VirtualFrame#materialize() method.

Most used methods

  • getArguments
  • setObject
  • getObject
  • materialize
  • getFrameDescriptor
  • getLong
  • setLong
  • getBoolean
  • getValue
  • setBoolean
  • setInt
  • setInt

Popular in Java

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • onCreateOptionsMenu (Activity)
  • runOnUiThread (Activity)
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JOptionPane (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now