comparison graal/com.oracle.truffle.ruby.nodes/src/com/oracle/truffle/ruby/nodes/core/ModuleNodes.java @ 13706:232eb6708943

Ruby: required fixes for moving FrameDescriptor to the RootNode.
author Christian Humer <christian.humer@gmail.com>
date Mon, 20 Jan 2014 13:44:54 +0100
parents 0fbee3eb71f0
children
comparison
equal deleted inserted replaced
13705:ac5b0f31f7a2 13706:232eb6708943
94 final SelfNode self = new SelfNode(context, sourceSection); 94 final SelfNode self = new SelfNode(context, sourceSection);
95 final UninitializedReadInstanceVariableNode readInstanceVariable = new UninitializedReadInstanceVariableNode(context, sourceSection, name, self); 95 final UninitializedReadInstanceVariableNode readInstanceVariable = new UninitializedReadInstanceVariableNode(context, sourceSection, name, self);
96 96
97 final SequenceNode block = new SequenceNode(context, sourceSection, checkArity, readInstanceVariable); 97 final SequenceNode block = new SequenceNode(context, sourceSection, checkArity, readInstanceVariable);
98 98
99 final RubyRootNode pristineRoot = new RubyRootNode(sourceSection, name + "(attr_reader)", block); 99 final RubyRootNode pristineRoot = new RubyRootNode(sourceSection, null, name + "(attr_reader)", block);
100 final CallTarget callTarget = Truffle.getRuntime().createCallTarget(NodeUtil.cloneNode(pristineRoot)); 100 final CallTarget callTarget = Truffle.getRuntime().createCallTarget(NodeUtil.cloneNode(pristineRoot));
101 final InlinableMethodImplementation methodImplementation = new InlinableMethodImplementation(callTarget, null, new FrameDescriptor(), pristineRoot, true, false); 101 final InlinableMethodImplementation methodImplementation = new InlinableMethodImplementation(callTarget, null, new FrameDescriptor(), pristineRoot, true, false);
102 final RubyMethod method = new RubyMethod(sourceSection, module, new UniqueMethodIdentifier(), null, name, Visibility.PUBLIC, false, methodImplementation); 102 final RubyMethod method = new RubyMethod(sourceSection, module, new UniqueMethodIdentifier(), null, name, Visibility.PUBLIC, false, methodImplementation);
103 103
104 module.addMethod(method); 104 module.addMethod(method);
137 final ReadPreArgumentNode readArgument = new ReadPreArgumentNode(context, sourceSection, 0, false); 137 final ReadPreArgumentNode readArgument = new ReadPreArgumentNode(context, sourceSection, 0, false);
138 final UninitializedWriteInstanceVariableNode writeInstanceVariable = new UninitializedWriteInstanceVariableNode(context, sourceSection, name, self, readArgument); 138 final UninitializedWriteInstanceVariableNode writeInstanceVariable = new UninitializedWriteInstanceVariableNode(context, sourceSection, name, self, readArgument);
139 139
140 final SequenceNode block = new SequenceNode(context, sourceSection, checkArity, writeInstanceVariable); 140 final SequenceNode block = new SequenceNode(context, sourceSection, checkArity, writeInstanceVariable);
141 141
142 final RubyRootNode pristineRoot = new RubyRootNode(sourceSection, name + "(attr_writer)", block); 142 final RubyRootNode pristineRoot = new RubyRootNode(sourceSection, null, name + "(attr_writer)", block);
143 final CallTarget callTarget = Truffle.getRuntime().createCallTarget(NodeUtil.cloneNode(pristineRoot)); 143 final CallTarget callTarget = Truffle.getRuntime().createCallTarget(NodeUtil.cloneNode(pristineRoot));
144 final InlinableMethodImplementation methodImplementation = new InlinableMethodImplementation(callTarget, null, new FrameDescriptor(), pristineRoot, true, false); 144 final InlinableMethodImplementation methodImplementation = new InlinableMethodImplementation(callTarget, null, new FrameDescriptor(), pristineRoot, true, false);
145 final RubyMethod method = new RubyMethod(sourceSection, module, new UniqueMethodIdentifier(), null, name + "=", Visibility.PUBLIC, false, methodImplementation); 145 final RubyMethod method = new RubyMethod(sourceSection, module, new UniqueMethodIdentifier(), null, name + "=", Visibility.PUBLIC, false, methodImplementation);
146 146
147 module.addMethod(method); 147 module.addMethod(method);