Skip to content

Commit

Permalink
[Truffle] Sort of make the dup and clone nodes suitable for compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Nov 16, 2014
1 parent b0b9cc0 commit 658390a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Expand Up @@ -496,7 +496,7 @@ public DupNode(DupNode prev) {

@Specialization
public Object dup(VirtualFrame frame, RubyBasicObject self) {
notDesignedForCompilation();
// This method is pretty crappy for compilation - it should improve with the OM

final RubyBasicObject newObject = self.getLogicalClass().newInstance(this);

Expand Down Expand Up @@ -886,7 +886,6 @@ public InitializeDupCloneNode(InitializeDupCloneNode prev) {

@Specialization
public Object initializeDup(VirtualFrame frame, RubyBasicObject self, RubyBasicObject from) {
notDesignedForCompilation();
return initializeCopyNode.call(frame, self, "initialize_copy", null, from);
}

Expand Down
Expand Up @@ -118,10 +118,8 @@ public long getObjectID() {
return objectID;
}

@CompilerDirectives.SlowPath
public void setInstanceVariables(Map<String, Object> instanceVariables) {
RubyNode.notDesignedForCompilation();

assert instanceVariables != null;
updateLayoutToMatchClass();
setFields(instanceVariables);
}
Expand Down
Expand Up @@ -62,9 +62,8 @@ public void allocateObjectStorageLocations() {
}
}

@CompilerDirectives.SlowPath
public Map<String, Object> getFields() {
CompilerAsserts.neverPartOfCompilation();

if (getObjectLayout() == null) {
return Collections.emptyMap();
}
Expand Down

0 comments on commit 658390a

Please sign in to comment.