Mercurial > hg > truffle
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultCallTarget.java @ 13705:ac5b0f31f7a2
Truffle API-change: FrameDescriptors are now stored in the RootNode in a final field instead of the CallTarget.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 17 Jan 2014 17:06:08 +0100 |
parents | ecf152c6bd16 |
children | a12017c18d5d |
comparison
equal
deleted
inserted
replaced
13704:10a2d66262ae | 13705:ac5b0f31f7a2 |
---|---|
29 import com.oracle.truffle.api.nodes.*; | 29 import com.oracle.truffle.api.nodes.*; |
30 | 30 |
31 public class DefaultCallTarget extends CallTarget { | 31 public class DefaultCallTarget extends CallTarget { |
32 | 32 |
33 protected final RootNode rootNode; | 33 protected final RootNode rootNode; |
34 protected final FrameDescriptor frameDescriptor; | |
35 | 34 |
36 public DefaultCallTarget(RootNode function, FrameDescriptor frameDescriptor) { | 35 public DefaultCallTarget(RootNode function) { |
37 this.rootNode = function; | 36 this.rootNode = function; |
38 this.frameDescriptor = frameDescriptor; | |
39 this.rootNode.setCallTarget(this); | 37 this.rootNode.setCallTarget(this); |
40 } | 38 } |
41 | 39 |
42 @Override | 40 @Override |
43 public String toString() { | 41 public String toString() { |
44 return rootNode.toString(); | 42 return rootNode.toString(); |
45 } | 43 } |
46 | 44 |
47 @Override | 45 @Override |
48 public Object call(PackedFrame caller, Arguments args) { | 46 public Object call(PackedFrame caller, Arguments args) { |
49 VirtualFrame frame = new DefaultVirtualFrame(frameDescriptor, caller, args); | 47 VirtualFrame frame = new DefaultVirtualFrame(rootNode.getFrameDescriptor(), caller, args); |
50 return rootNode.execute(frame); | 48 return rootNode.execute(frame); |
51 } | |
52 | |
53 public FrameDescriptor getFrameDescriptor() { | |
54 return frameDescriptor; | |
55 } | 49 } |
56 | 50 |
57 public RootNode getRootNode() { | 51 public RootNode getRootNode() { |
58 return rootNode; | 52 return rootNode; |
59 } | 53 } |