Skip to content

Commit cab80fa

Browse files
committed
Revert dict checks
1 parent 15e496f commit cab80fa

File tree

6 files changed

+17
-317
lines changed

6 files changed

+17
-317
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_io.py

Lines changed: 0 additions & 275 deletions
This file was deleted.

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/PythonLanguage.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -705,11 +705,7 @@ public Shape getBuiltinTypeInstanceShape(PythonBuiltinClassType type) {
705705
Shape shape = builtinTypeInstanceShapes[ordinal];
706706
if (shape == null) {
707707
CompilerDirectives.transferToInterpreterAndInvalidate();
708-
Shape.DerivedBuilder shapeBuilder = Shape.newBuilder(getEmptyShape()).addConstantProperty(HiddenAttributes.CLASS, type, 0);
709-
if (!type.isBuiltinWithDict()) {
710-
shapeBuilder.shapeFlags(PythonObject.HAS_SLOTS_BUT_NO_DICT_FLAG);
711-
}
712-
shape = shapeBuilder.build();
708+
shape = Shape.newBuilder(getEmptyShape()).addConstantProperty(HiddenAttributes.CLASS, type, 0).build();
713709
builtinTypeInstanceShapes[ordinal] = shape;
714710
}
715711
return shape;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/PythonBuiltinClassType.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,11 @@ public enum PythonBuiltinClassType implements TruffleObject {
253253
// plain name without module
254254
private final String printName;
255255
private final boolean basetype;
256-
private final boolean isBuiltinWithDict;
257256

258257
// initialized in static constructor
259258
@CompilationFinal private PythonBuiltinClassType base;
260259

261-
PythonBuiltinClassType(String name, boolean isPublic, String module, boolean basetype, boolean isBuiltinWithDict) {
260+
PythonBuiltinClassType(String name, boolean isPublic, String module, boolean basetype) {
262261
this.name = name;
263262
this.publicInModule = isPublic ? module : null;
264263
if (module != null && module != BuiltinNames.BUILTINS) {
@@ -267,11 +266,6 @@ public enum PythonBuiltinClassType implements TruffleObject {
267266
printName = name;
268267
}
269268
this.basetype = basetype;
270-
this.isBuiltinWithDict = isBuiltinWithDict;
271-
}
272-
273-
PythonBuiltinClassType(String name, boolean isPublic, String module, boolean baseType) {
274-
this(name, isPublic, module, baseType, false);
275269
}
276270

277271
PythonBuiltinClassType(String name, String publicInModule, boolean basetype) {
@@ -306,10 +300,6 @@ public PythonBuiltinClassType getBase() {
306300
return base;
307301
}
308302

309-
public boolean isBuiltinWithDict() {
310-
return isBuiltinWithDict;
311-
}
312-
313303
public String getPublicInModule() {
314304
return publicInModule;
315305
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/PRaiseNode.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,6 @@ PException doPythonManagedClass(PythonManagedClass exceptionType, @SuppressWarni
183183
throw raiseExceptionObject(factory.createBaseException(exceptionType), language);
184184
}
185185

186-
@Specialization(guards = "isNoValue(cause)")
187-
PException doPythonManagedClass(PythonManagedClass exceptionType, @SuppressWarnings("unused") PNone cause, String format, Object[] arguments,
188-
@Shared("factory") @Cached PythonObjectFactory factory,
189-
@Shared("language") @CachedLanguage PythonLanguage language) {
190-
assert format != null;
191-
throw raiseExceptionObject(factory.createBaseException(exceptionType, format, arguments), language);
192-
}
193-
194186
@Specialization(guards = {"isNoValue(cause)", "isNoValue(format)", "arguments.length > 0"})
195187
PException doBuiltinType(PythonBuiltinClassType type, @SuppressWarnings("unused") PNone cause, @SuppressWarnings("unused") PNone format, Object[] arguments,
196188
@Shared("factory") @Cached PythonObjectFactory factory,

0 commit comments

Comments
 (0)