Skip to content

Commit

Permalink
Fix the basic benchmark by:
Browse files Browse the repository at this point in the history
1. Changing the limit of ObjectPropertyWriteNode.writeProperty() from 1 to 2.
2. Stop invalidating the writtenToAssumption in ClassInstanceObject.
  • Loading branch information
skinny85 committed Dec 31, 2023
1 parent 1246489 commit 4b4072f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@
public abstract class ObjectPropertyWriteNode extends Node {
public abstract Object executePropertyWrite(Object target, Object property, Object rvalue);

@Specialization(guards = "interopLibrary.isMemberWritable(target, propertyName)", limit = "1")
// yes, this has to be limit=2 - limit=1 makes the benchmark slow (!)
@Specialization(guards = "interopLibrary.isMemberWritable(target, propertyName)", limit = "2")
protected Object writeProperty(Object target, String propertyName, Object rvalue,
@CachedLibrary("target") InteropLibrary interopLibrary) {
try {
interopLibrary.writeMember(target, propertyName, rvalue);
return rvalue;
} catch (UnknownIdentifierException e) {
return Undefined.INSTANCE;
} catch (UnsupportedMessageException | UnsupportedTypeException e) {
} catch (UnsupportedMessageException | UnsupportedTypeException | UnknownIdentifierException e) {
throw new EasyScriptException(this, e.getMessage());
}
return rvalue;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ boolean isMemberInsertable(String member,
@ExportMessage
void writeMember(String member, Object value,
@CachedLibrary("this") DynamicObjectLibrary dynamicObjectLibrary) {
this.writtenToAssumption.invalidate();
// this.writtenToAssumption.invalidate();
dynamicObjectLibrary.put(this, member, value);
}
}

0 comments on commit 4b4072f

Please sign in to comment.