changeset 16065:87414e322d45

SlowPath a method in HotSpotTruffleRuntime
author Christian Wirth <christian.wirth@oracle.com>
date Fri, 06 Jun 2014 15:13:56 +0200
parents 87e11e4c031f
children f59498d6e8b1
files graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java	Fri Jun 06 11:17:29 2014 +0200
+++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java	Fri Jun 06 15:13:56 2014 +0200
@@ -246,9 +246,7 @@
 
     @SlowPath
     public Iterable<FrameInstance> getStackTrace() {
-        if (stackIntrospection == null) {
-            stackIntrospection = Graal.getRequiredCapability(StackIntrospection.class);
-        }
+        initStackIntrospection();
         final Iterator<InspectedFrame> frames = stackIntrospection.getStackTrace(anyFrameMethod, anyFrameMethod, 1).iterator();
         class FrameIterator implements Iterator<FrameInstance> {
 
@@ -276,10 +274,15 @@
         };
     }
 
-    public FrameInstance getCurrentFrame() {
+    private void initStackIntrospection() {
         if (stackIntrospection == null) {
             stackIntrospection = Graal.getRequiredCapability(StackIntrospection.class);
         }
+    }
+
+    @SlowPath
+    public FrameInstance getCurrentFrame() {
+        initStackIntrospection();
         Iterator<InspectedFrame> frames = stackIntrospection.getStackTrace(callTargetMethod, callTargetMethod, 0).iterator();
         if (frames.hasNext()) {
             return new HotSpotFrameInstance.CallTargetFrame(frames.next(), true);