comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultCallTarget.java @ 15064:f675818d9ad0

new getStackTrace and getCurrentFrame functionality in TruffleRuntime
author Lukas Stadler <lukas.stadler@oracle.com>
date Fri, 11 Apr 2014 11:53:11 +0200
parents 64dcb92ee75a
children 083e9e4df58a
comparison
equal deleted inserted replaced
15063:36e1a11a72b3 15064:f675818d9ad0
23 * questions. 23 * questions.
24 */ 24 */
25 package com.oracle.truffle.api.impl; 25 package com.oracle.truffle.api.impl;
26 26
27 import com.oracle.truffle.api.*; 27 import com.oracle.truffle.api.*;
28 import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
28 import com.oracle.truffle.api.frame.*; 29 import com.oracle.truffle.api.frame.*;
29 import com.oracle.truffle.api.nodes.*; 30 import com.oracle.truffle.api.nodes.*;
30 31
31 /** 32 /**
32 * This is an implementation-specific class. Do not use or instantiate it. Instead, use 33 * This is an implementation-specific class. Do not use or instantiate it. Instead, use
33 * {@link TruffleRuntime#createCallTarget(RootNode)} to create a {@link RootCallTarget}. 34 * {@link TruffleRuntime#createCallTarget(RootNode)} to create a {@link RootCallTarget}.
34 */ 35 */
35 public class DefaultCallTarget extends RootCallTarget { 36 public class DefaultCallTarget extends RootCallTarget {
36 37
38 @CompilationFinal protected boolean needsMaterializedFrame = true;
39
37 protected DefaultCallTarget(RootNode function) { 40 protected DefaultCallTarget(RootNode function) {
38 super(function); 41 super(function);
39 } 42 }
40 43
41 @Override 44 @Override
42 public Object call(Object[] args) { 45 public Object call(Object[] args) {
43 VirtualFrame frame = new DefaultVirtualFrame(getRootNode().getFrameDescriptor(), args); 46 VirtualFrame frame = new DefaultVirtualFrame(getRootNode().getFrameDescriptor(), args);
44 return getRootNode().execute(frame); 47 return callProxy(frame);
48 }
49
50 @Override
51 public void setNeedsMaterializedFrame() {
52 needsMaterializedFrame = true;
45 } 53 }
46 } 54 }