Skip to content

Commit 408eece

Browse files
committed
Rebase fixes
1 parent fddd776 commit 408eece

File tree

7 files changed

+14
-20
lines changed

7 files changed

+14
-20
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/MathModuleBuiltins.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2612,10 +2612,9 @@ Object isqrtPInt(PInt x,
26122612

26132613
@Specialization(guards = "!isInteger(x)")
26142614
Object doGeneral(VirtualFrame frame, Object x,
2615-
@Cached("createBinaryProfile()") ConditionProfile hasFrame,
26162615
@CachedLibrary(limit = "1") PythonObjectLibrary lib,
26172616
@Cached IsqrtNode recursiveNode) {
2618-
return recursiveNode.execute(frame, lib.asIndexWithFrame(x, hasFrame, frame));
2617+
return recursiveNode.execute(frame, lib.asIndexWithFrame(x, frame));
26192618
}
26202619

26212620
@TruffleBoundary

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/exception/BaseExceptionBuiltins.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,11 @@ public abstract static class ReduceNode extends PythonUnaryBuiltinNode {
319319
@Specialization(limit = "1")
320320
Object reduce(VirtualFrame frame, PBaseException self,
321321
@CachedLibrary("self") PythonObjectLibrary lib,
322-
@Cached ArgsNode argsNode) {
322+
@Cached ArgsNode argsNode,
323+
@Cached DictNode dictNode) {
323324
Object clazz = lib.getLazyPythonClass(self);
324325
Object args = argsNode.executeObject(frame, self, PNone.NO_VALUE);
325-
Object dict = lib.lookupAttributeOnTypeStrict(self, __DICT__);
326+
Object dict = dictNode.execute(frame, self, PNone.NO_VALUE);
326327
return factory().createTuple(new Object[]{clazz, args, dict});
327328
}
328329
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/method/MethodBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ Object reprMethod(VirtualFrame frame, PMethod method,
143143
Object func = method.getFunction();
144144
String defname = "?";
145145

146-
Object funcName = pol.lookupAttribute(func, __QUALNAME__);
146+
Object funcName = pol.lookupAttribute(func, frame, __QUALNAME__);
147147
if (funcName == PNone.NO_VALUE) {
148-
funcName = pol.lookupAttribute(func, __NAME__);
148+
funcName = pol.lookupAttribute(func, frame, __NAME__);
149149
}
150150

151151
try {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/method/PBuiltinMethod.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public boolean isCallable() {
6969
}
7070

7171
@ExportMessage
72+
@SuppressWarnings("static-method")
7273
boolean isHashable() {
7374
return true;
7475
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/method/PMethod.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ protected boolean hasSourceLocation(@CachedLibrary("this.function") InteropLibra
8181
}
8282

8383
@ExportMessage
84+
@SuppressWarnings("static-method")
8485
boolean isHashable() {
8586
return true;
8687
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/module/ModuleBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,15 @@ public PNone module(PythonModule self, String name, Object doc,
142142
@GenerateNodeFactory
143143
public abstract static class ModuleDirNode extends PythonUnaryBuiltinNode {
144144
@Specialization
145-
Object dir(PythonModule self,
145+
Object dir(VirtualFrame frame, PythonModule self,
146146
@Cached CastToJavaStringNode castToJavaStringNode,
147147
@Cached IsBuiltinClassProfile isDictProfile,
148148
@Cached HashingCollectionNodes.GetDictStorageNode getDictStorageNode,
149149
@Cached ListNodes.ConstructListNode constructListNode,
150150
@Cached CallNode callNode,
151151
@CachedLibrary(limit = "1") HashingStorageLibrary hashLib,
152152
@CachedLibrary(limit = "1") PythonObjectLibrary pol) {
153-
Object dict = pol.lookupAttribute(self, __DICT__);
153+
Object dict = pol.lookupAttribute(self, frame, __DICT__);
154154
if (isDict(dict, isDictProfile)) {
155155
HashingStorage dictStorage = getDictStorageNode.execute((PHashingCollection) dict);
156156
Object dirFunc = hashLib.getItem(dictStorage, __DIR__);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type/TypeNodes.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ private boolean compatibleWithBase(VirtualFrame frame, Object child, Object pare
754754
}
755755

756756
// instead of child->tp_dictoffset == parent->tp_dictoffset
757-
if (hasDict(child) != hasDict(parent)) {
757+
if (hasDict(frame, child) != hasDict(frame, parent)) {
758758
return false;
759759
}
760760

@@ -828,16 +828,16 @@ private String getTypeName(Object clazz) {
828828
}
829829

830830
private Object getSlotsFromDict(VirtualFrame frame, Object type) {
831-
Object dict = getDictNode().executeObject(frame, type, __DICT__);
831+
Object dict = getObjectLibrary().lookupAttribute(type, frame, __DICT__);
832832
if (dict != PNone.NO_VALUE) {
833833
HashingStorage storage = getDictStorageNode().execute((PHashingCollection) dict);
834834
return getHashingStorageLibrary().getItem(storage, __SLOTS__);
835835
}
836836
return null;
837837
}
838838

839-
private boolean hasDict(Object obj) {
840-
return getObjectLibrary().lookupAttributeOnType(obj, __DICT__) != PNone.NO_VALUE;
839+
private boolean hasDict(VirtualFrame frame, Object type) {
840+
return getObjectLibrary().lookupAttribute(type, frame, __DICT__) != PNone.NO_VALUE;
841841
}
842842

843843
private GetObjectArrayNode getObjectArrayNode() {
@@ -856,14 +856,6 @@ private PythonObjectLibrary getObjectLibrary() {
856856
return objectLibrary;
857857
}
858858

859-
private LookupAndCallBinaryNode getDictNode() {
860-
if (getDictNode == null) {
861-
CompilerDirectives.transferToInterpreterAndInvalidate();
862-
getDictNode = insert(LookupAndCallBinaryNode.create(__GETATTRIBUTE__));
863-
}
864-
return getDictNode;
865-
}
866-
867859
private GetDictStorageNode getDictStorageNode() {
868860
if (getDictStorageNode == null) {
869861
CompilerDirectives.transferToInterpreterAndInvalidate();

0 commit comments

Comments
 (0)