Skip to content

Commit

Permalink
[Truffle] "Fix" regression on psd-compose-linear-dodge.
Browse files Browse the repository at this point in the history
* The code path is unused once warmed up, yet it affects peak perf by about 40%.
* The differences are a few guards and going through the node dispatch.
  • Loading branch information
eregon committed May 15, 2015
1 parent afbe8c7 commit df5438f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ private DispatchNode doRubyBasicObject(
CompilerDirectives.transferToInterpreter();
singletonClassNode = insert(SingletonClassNodeGen.create(getContext(), getSourceSection(), null));
}
RubyClass moduleSingletonClass = singletonClassNode.executeSingletonClass(frame, module);
// RubyClass moduleSingletonClass = singletonClassNode.executeSingletonClass(frame, module);
RubyClass moduleSingletonClass = singletonClassNode.getNormalObjectSingletonClass(module);

// But we want to check the module assumption, not its singleton class assumption.
return new CachedBoxedDispatchNode(getContext(), methodName, first,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ protected RubyClass singletonClass(RubyClass rubyClass) {

@Specialization(guards = { "!isNil(object)", "!isRubyBignum(object)", "!isRubySymbol(object)", "!isRubyClass(object)" })
protected RubyClass singletonClass(RubyBasicObject object) {
return getNormalObjectSingletonClass(object);
}

public RubyClass getNormalObjectSingletonClass(RubyBasicObject object) {
CompilerAsserts.neverPartOfCompilation();

if (object.getMetaClass().isSingleton()) {
Expand Down

0 comments on commit df5438f

Please sign in to comment.