Skip to content

Commit

Permalink
[Truffle] Clear Hash#initialize for compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Mar 9, 2015
1 parent d5cd768 commit 8c3f7f3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -674,23 +674,23 @@ public InitializeNode(InitializeNode prev) {

@Specialization
public RubyHash initialize(RubyHash hash, UndefinedPlaceholder defaultValue, UndefinedPlaceholder block) {
notDesignedForCompilation();
hash.setStore(null, 0, null, null);
hash.setDefaultBlock(null);

This comment has been minimized.

Copy link
@eregon

eregon Mar 9, 2015

Member

Same here.

hash.setDefaultBlock(null);
return hash;
}

@Specialization
public RubyHash initialize(RubyHash hash, UndefinedPlaceholder defaultValue, RubyProc block) {
notDesignedForCompilation();
hash.setStore(null, 0, null, null);
hash.setDefaultBlock(null);
hash.setDefaultBlock(block);

This comment has been minimized.

Copy link
@eregon

eregon Mar 9, 2015

Member

These 2 looks weird (and above).

This comment has been minimized.

Copy link
@chrisseaton

chrisseaton Mar 9, 2015

Author Contributor

Oh yeah that should be setDefaultValue. Thanks.

return hash;
}

@Specialization(guards = "!isUndefinedPlaceholder(arguments[1])")
public RubyHash initialize(RubyHash hash, Object defaultValue, UndefinedPlaceholder block) {
notDesignedForCompilation();
hash.setStore(null, 0, null, null);
hash.setDefaultValue(defaultValue);
hash.setDefaultBlock(null);
return hash;
Expand Down

0 comments on commit 8c3f7f3

Please sign in to comment.