Skip to content

Commit fa2ddee

Browse files
committed
Rename 'ManagedPythonClass' to 'PythonManagedClass'.
1 parent 3047905 commit fa2ddee

19 files changed

+125
-125
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
import com.oracle.graal.python.builtins.objects.method.PMethod;
4848
import com.oracle.graal.python.builtins.objects.module.PythonModule;
4949
import com.oracle.graal.python.builtins.objects.object.PythonObject;
50-
import com.oracle.graal.python.builtins.objects.type.ManagedPythonClass;
50+
import com.oracle.graal.python.builtins.objects.type.PythonManagedClass;
5151
import com.oracle.graal.python.nodes.BuiltinNames;
5252
import com.oracle.graal.python.nodes.NodeFactory;
5353
import com.oracle.graal.python.nodes.PGuards;
@@ -398,9 +398,9 @@ protected SourceSection findSourceLocation(PythonContext context, Object value)
398398
return callable.getCallTarget().getRootNode().getSourceSection();
399399
} else if (value instanceof PCode) {
400400
return ((PCode) value).getRootNode().getSourceSection();
401-
} else if (value instanceof ManagedPythonClass) {
402-
for (String k : ((ManagedPythonClass) value).getAttributeNames()) {
403-
Object attrValue = ReadAttributeFromDynamicObjectNode.doSlowPath(((ManagedPythonClass) value).getStorage(), k);
401+
} else if (value instanceof PythonManagedClass) {
402+
for (String k : ((PythonManagedClass) value).getAttributeNames()) {
403+
Object attrValue = ReadAttributeFromDynamicObjectNode.doSlowPath(((PythonManagedClass) value).getStorage(), k);
404404
SourceSection attrSourceLocation = findSourceLocation(context, attrValue);
405405
if (attrSourceLocation != null) {
406406
return attrSourceLocation;

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
import com.oracle.graal.python.builtins.objects.tuple.PTuple;
120120
import com.oracle.graal.python.builtins.objects.type.PythonAbstractClass;
121121
import com.oracle.graal.python.builtins.objects.type.LazyPythonClass;
122-
import com.oracle.graal.python.builtins.objects.type.ManagedPythonClass;
122+
import com.oracle.graal.python.builtins.objects.type.PythonManagedClass;
123123
import com.oracle.graal.python.builtins.objects.type.PythonBuiltinClass;
124124
import com.oracle.graal.python.builtins.objects.type.PythonClass;
125125
import com.oracle.graal.python.builtins.objects.type.TypeNodes;
@@ -1353,21 +1353,21 @@ Object doDirectConstruct(@SuppressWarnings("unused") PNone ignored, Object[] arg
13531353
}
13541354

13551355
@Specialization(limit = "getCallSiteInlineCacheMaxDepth()", guards = {"self == cachedSelf", "!self.needsNativeAllocation()"})
1356-
Object doObjectDirect(@SuppressWarnings("unused") ManagedPythonClass self, Object[] varargs, PKeyword[] kwargs,
1357-
@Cached("self") ManagedPythonClass cachedSelf) {
1356+
Object doObjectDirect(@SuppressWarnings("unused") PythonManagedClass self, Object[] varargs, PKeyword[] kwargs,
1357+
@Cached("self") PythonManagedClass cachedSelf) {
13581358
return doObjectIndirect(cachedSelf, varargs, kwargs);
13591359
}
13601360

13611361
@Specialization(guards = "!self.needsNativeAllocation()", replaces = "doObjectDirect")
1362-
Object doObjectIndirect(ManagedPythonClass self, Object[] varargs, PKeyword[] kwargs) {
1362+
Object doObjectIndirect(PythonManagedClass self, Object[] varargs, PKeyword[] kwargs) {
13631363
if (varargs.length > 0 || kwargs.length > 0) {
13641364
// TODO: tfel: this should throw an error only if init isn't overridden
13651365
}
13661366
return factory().createPythonObject(self);
13671367
}
13681368

13691369
@Specialization(guards = "self.needsNativeAllocation()")
1370-
Object doNativeObjectIndirect(ManagedPythonClass self, Object[] varargs, PKeyword[] kwargs,
1370+
Object doNativeObjectIndirect(PythonManagedClass self, Object[] varargs, PKeyword[] kwargs,
13711371
@Cached("create()") GetMroNode getMroNode) {
13721372
if (varargs.length > 0 || kwargs.length > 0) {
13731373
// TODO: tfel: this should throw an error only if init isn't overridden
@@ -2030,7 +2030,7 @@ private ReadCallerFrameNode getReadCallerFrameNode() {
20302030
return readCallerFrameNode;
20312031
}
20322032

2033-
private void addNativeSlots(ManagedPythonClass pythonClass, PTuple slots) {
2033+
private void addNativeSlots(PythonManagedClass pythonClass, PTuple slots) {
20342034
if (callAddNativeSlotsNode == null) {
20352035
CompilerDirectives.transferToInterpreterAndInvalidate();
20362036
callAddNativeSlotsNode = insert(CExtNodes.PCallCapiFunction.create(NativeCAPISymbols.FUN_ADD_NATIVE_SLOTS));
@@ -2046,7 +2046,7 @@ private CastToListNode getCastToListNode() {
20462046
return castToList;
20472047
}
20482048

2049-
private boolean addDictIfNative(ManagedPythonClass pythonClass) {
2049+
private boolean addDictIfNative(PythonManagedClass pythonClass) {
20502050
boolean addedNewDict = false;
20512051
if (pythonClass.needsNativeAllocation()) {
20522052
for (Object cls : getMro(pythonClass)) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
import com.oracle.graal.python.builtins.objects.tuple.PTuple;
121121
import com.oracle.graal.python.builtins.objects.type.PythonAbstractClass;
122122
import com.oracle.graal.python.builtins.objects.type.LazyPythonClass;
123-
import com.oracle.graal.python.builtins.objects.type.ManagedPythonClass;
123+
import com.oracle.graal.python.builtins.objects.type.PythonManagedClass;
124124
import com.oracle.graal.python.builtins.objects.type.PythonBuiltinClass;
125125
import com.oracle.graal.python.builtins.objects.type.PythonClass;
126126
import com.oracle.graal.python.builtins.objects.type.TypeNodes;
@@ -1375,7 +1375,7 @@ abstract static class PyTruffle_Set_SulongType extends NativeBuiltin {
13751375

13761376
@Specialization
13771377
Object doPythonObject(PythonClassNativeWrapper klass, Object ptr) {
1378-
((ManagedPythonClass) klass.getPythonObject()).setSulongType(ptr);
1378+
((PythonManagedClass) klass.getPythonObject()).setSulongType(ptr);
13791379
return ptr;
13801380
}
13811381
}
@@ -1392,7 +1392,7 @@ Object doNativeWrapper(PythonClassNativeWrapper nativeWrapper, Object getBufferP
13921392
}
13931393

13941394
@Specialization
1395-
Object doPythonObject(ManagedPythonClass obj, Object getBufferProc, Object releaseBufferProc) {
1395+
Object doPythonObject(PythonManagedClass obj, Object getBufferProc, Object releaseBufferProc) {
13961396
return doNativeWrapper(obj.getNativeWrapper(), getBufferProc, releaseBufferProc);
13971397
}
13981398
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/CExtNodes.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
import com.oracle.graal.python.builtins.objects.ints.PInt;
7575
import com.oracle.graal.python.builtins.objects.str.PString;
7676
import com.oracle.graal.python.builtins.objects.type.PythonAbstractClass;
77-
import com.oracle.graal.python.builtins.objects.type.ManagedPythonClass;
77+
import com.oracle.graal.python.builtins.objects.type.PythonManagedClass;
7878
import com.oracle.graal.python.builtins.objects.type.PythonBuiltinClass;
7979
import com.oracle.graal.python.builtins.objects.type.TypeNodes;
8080
import com.oracle.graal.python.builtins.objects.type.TypeNodes.GetNameNode;
@@ -322,14 +322,14 @@ Object doNativeNull(PythonNativeNull object) {
322322
}
323323

324324
@Specialization(guards = "object == cachedObject", limit = "3")
325-
Object doPythonClass(@SuppressWarnings("unused") ManagedPythonClass object,
326-
@SuppressWarnings("unused") @Cached("object") ManagedPythonClass cachedObject,
325+
Object doPythonClass(@SuppressWarnings("unused") PythonManagedClass object,
326+
@SuppressWarnings("unused") @Cached("object") PythonManagedClass cachedObject,
327327
@Cached("wrapNativeClass(object)") PythonClassNativeWrapper wrapper) {
328328
return wrapper;
329329
}
330330

331331
@Specialization(replaces = "doPythonClass")
332-
Object doPythonClassUncached(ManagedPythonClass object,
332+
Object doPythonClassUncached(PythonManagedClass object,
333333
@Cached("create()") TypeNodes.GetNameNode getNameNode) {
334334
return PythonClassNativeWrapper.wrap(object, getNameNode.execute(object));
335335
}
@@ -360,7 +360,7 @@ Object run(Object obj) {
360360
return obj;
361361
}
362362

363-
protected static PythonClassNativeWrapper wrapNativeClass(ManagedPythonClass object) {
363+
protected static PythonClassNativeWrapper wrapNativeClass(PythonManagedClass object) {
364364
return PythonClassNativeWrapper.wrap(object, GetNameNode.doSlowPath(object));
365365
}
366366

@@ -384,8 +384,8 @@ public static Object doSlowPath(Object o) {
384384
return PythonNativeObject.cast(o).getPtr();
385385
} else if (o instanceof PythonNativeNull) {
386386
return ((PythonNativeNull) o).getPtr();
387-
} else if (o instanceof ManagedPythonClass) {
388-
return wrapNativeClass((ManagedPythonClass) o);
387+
} else if (o instanceof PythonManagedClass) {
388+
return wrapNativeClass((PythonManagedClass) o);
389389
} else if (o instanceof PythonAbstractObject) {
390390
assert !PGuards.isClass(o);
391391
return PythonObjectNativeWrapper.wrapSlowPath((PythonAbstractObject) o);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/NativeWrappers.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
import com.oracle.graal.python.builtins.objects.dict.PDict;
4747
import com.oracle.graal.python.builtins.objects.ints.PInt;
4848
import com.oracle.graal.python.builtins.objects.str.PString;
49-
import com.oracle.graal.python.builtins.objects.type.ManagedPythonClass;
49+
import com.oracle.graal.python.builtins.objects.type.PythonManagedClass;
5050
import com.oracle.truffle.api.Assumption;
5151
import com.oracle.truffle.api.CompilerAsserts;
5252
import com.oracle.truffle.api.interop.ForeignAccess;
@@ -277,15 +277,15 @@ public static PrimitiveNativeWrapper createDouble(double val) {
277277
}
278278

279279
/**
280-
* Used to wrap {@link ManagedPythonClass} when used in native code. This wrapper mimics the
280+
* Used to wrap {@link PythonManagedClass} when used in native code. This wrapper mimics the
281281
* correct shape of the corresponding native type {@code struct _typeobject}.
282282
*/
283283
public static class PythonClassNativeWrapper extends PythonObjectNativeWrapper {
284284
private final CStringWrapper nameWrapper;
285285
private Object getBufferProc;
286286
private Object releaseBufferProc;
287287

288-
public PythonClassNativeWrapper(ManagedPythonClass object, String typeName) {
288+
public PythonClassNativeWrapper(PythonManagedClass object, String typeName) {
289289
super(object);
290290
this.nameWrapper = new CStringWrapper(typeName);
291291
}
@@ -310,7 +310,7 @@ public void setReleaseBufferProc(Object releaseBufferProc) {
310310
this.releaseBufferProc = releaseBufferProc;
311311
}
312312

313-
public static PythonClassNativeWrapper wrap(ManagedPythonClass obj, String typeName) {
313+
public static PythonClassNativeWrapper wrap(PythonManagedClass obj, String typeName) {
314314
// important: native wrappers are cached
315315
PythonClassNativeWrapper nativeWrapper = obj.getNativeWrapper();
316316
if (nativeWrapper == null) {
@@ -327,13 +327,13 @@ public String toString() {
327327
}
328328

329329
/**
330-
* Used to wrap {@link ManagedPythonClass} just for the time when a natively defined type is
330+
* Used to wrap {@link PythonManagedClass} just for the time when a natively defined type is
331331
* processed in {@code PyType_Ready} and we need to pass the mirroring managed class to native
332332
* to marry these two objects.
333333
*/
334334
public static class PythonClassInitNativeWrapper extends PythonObjectNativeWrapper {
335335

336-
public PythonClassInitNativeWrapper(ManagedPythonClass object) {
336+
public PythonClassInitNativeWrapper(PythonManagedClass object) {
337337
super(object);
338338
}
339339

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/PyBufferProcsWrapperMR.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
import com.oracle.graal.python.builtins.objects.cext.NativeWrappers.PythonClassNativeWrapper;
4646
import com.oracle.graal.python.builtins.objects.cext.PyBufferProcsWrapperMRFactory.GetBufferProcsNodeGen;
4747
import com.oracle.graal.python.builtins.objects.type.PythonAbstractClass;
48-
import com.oracle.graal.python.builtins.objects.type.ManagedPythonClass;
48+
import com.oracle.graal.python.builtins.objects.type.PythonManagedClass;
4949
import com.oracle.graal.python.nodes.PNodeWithContext;
5050
import com.oracle.truffle.api.CompilerDirectives;
5151
import com.oracle.truffle.api.dsl.Specialization;
@@ -76,7 +76,7 @@ abstract static class GetBufferProcsNode extends PNodeWithContext {
7676
public abstract Object execute(PythonAbstractClass clazz, String key);
7777

7878
@Specialization
79-
Object doManagedClass(ManagedPythonClass clazz, String key) {
79+
Object doManagedClass(PythonManagedClass clazz, String key) {
8080
// translate key to attribute name
8181
PythonClassNativeWrapper nativeWrapper = clazz.getNativeWrapper();
8282

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/PyNumberMethodsWrapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
package com.oracle.graal.python.builtins.objects.cext;
4242

4343
import com.oracle.graal.python.builtins.objects.cext.NativeWrappers.PythonNativeWrapper;
44-
import com.oracle.graal.python.builtins.objects.type.ManagedPythonClass;
44+
import com.oracle.graal.python.builtins.objects.type.PythonManagedClass;
4545
import com.oracle.truffle.api.interop.ForeignAccess;
4646
import com.oracle.truffle.api.interop.TruffleObject;
4747

@@ -50,7 +50,7 @@
5050
*/
5151
public class PyNumberMethodsWrapper extends PythonNativeWrapper {
5252

53-
public PyNumberMethodsWrapper(ManagedPythonClass delegate) {
53+
public PyNumberMethodsWrapper(PythonManagedClass delegate) {
5454
super(delegate);
5555
}
5656

@@ -63,7 +63,7 @@ public ForeignAccess getForeignAccess() {
6363
return PyNumberMethodsWrapperMRForeign.ACCESS;
6464
}
6565

66-
public ManagedPythonClass getPythonClass() {
67-
return (ManagedPythonClass) getDelegate();
66+
public PythonManagedClass getPythonClass() {
67+
return (PythonManagedClass) getDelegate();
6868
}
6969
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/PyNumberMethodsWrapperMR.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
import com.oracle.graal.python.builtins.objects.cext.CExtNodes.ToSulongNode;
5959
import com.oracle.graal.python.builtins.objects.cext.PyNumberMethodsWrapperMRFactory.ReadMethodNodeGen;
60-
import com.oracle.graal.python.builtins.objects.type.ManagedPythonClass;
60+
import com.oracle.graal.python.builtins.objects.type.PythonManagedClass;
6161
import com.oracle.graal.python.nodes.PNodeWithContext;
6262
import com.oracle.graal.python.nodes.attributes.LookupAttributeInMRONode;
6363
import com.oracle.truffle.api.CompilerDirectives;
@@ -78,7 +78,7 @@ abstract static class ReadNode extends Node {
7878

7979
public Object access(PyNumberMethodsWrapper object, String key) {
8080
// translate key to attribute name
81-
ManagedPythonClass delegate = object.getPythonClass();
81+
PythonManagedClass delegate = object.getPythonClass();
8282
return getToSulongNode().execute(readMethodNode.execute(delegate, key));
8383
}
8484

@@ -93,10 +93,10 @@ private ToSulongNode getToSulongNode() {
9393

9494
abstract static class ReadMethodNode extends PNodeWithContext {
9595

96-
public abstract Object execute(ManagedPythonClass clazz, String key);
96+
public abstract Object execute(PythonManagedClass clazz, String key);
9797

9898
@Specialization(limit = "99", guards = {"eq(cachedKey, key)"})
99-
Object getMethod(ManagedPythonClass clazz, @SuppressWarnings("unused") String key,
99+
Object getMethod(PythonManagedClass clazz, @SuppressWarnings("unused") String key,
100100
@Cached("key") @SuppressWarnings("unused") String cachedKey,
101101
@Cached("createLookupNode(cachedKey)") LookupAttributeInMRONode lookupNode) {
102102
if (lookupNode != null) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/PySequenceMethodsWrapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
package com.oracle.graal.python.builtins.objects.cext;
4242

4343
import com.oracle.graal.python.builtins.objects.cext.NativeWrappers.PythonNativeWrapper;
44-
import com.oracle.graal.python.builtins.objects.type.ManagedPythonClass;
44+
import com.oracle.graal.python.builtins.objects.type.PythonManagedClass;
4545
import com.oracle.truffle.api.interop.ForeignAccess;
4646
import com.oracle.truffle.api.interop.TruffleObject;
4747

@@ -50,7 +50,7 @@
5050
*/
5151
public class PySequenceMethodsWrapper extends PythonNativeWrapper {
5252

53-
public PySequenceMethodsWrapper(ManagedPythonClass delegate) {
53+
public PySequenceMethodsWrapper(PythonManagedClass delegate) {
5454
super(delegate);
5555
}
5656

@@ -63,7 +63,7 @@ public ForeignAccess getForeignAccess() {
6363
return PySequenceMethodsWrapperMRForeign.ACCESS;
6464
}
6565

66-
public ManagedPythonClass getPythonClass() {
67-
return (ManagedPythonClass) getDelegate();
66+
public PythonManagedClass getPythonClass() {
67+
return (PythonManagedClass) getDelegate();
6868
}
6969
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/PySequenceMethodsWrapperMR.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
package com.oracle.graal.python.builtins.objects.cext;
4242

4343
import com.oracle.graal.python.builtins.objects.cext.CExtNodes.ToSulongNode;
44-
import com.oracle.graal.python.builtins.objects.type.ManagedPythonClass;
44+
import com.oracle.graal.python.builtins.objects.type.PythonManagedClass;
4545
import com.oracle.graal.python.nodes.SpecialMethodNames;
4646
import com.oracle.graal.python.nodes.attributes.LookupAttributeInMRONode;
4747
import com.oracle.truffle.api.CompilerDirectives;
@@ -60,7 +60,7 @@ abstract static class ReadNode extends Node {
6060
@Child private ToSulongNode toSulongNode;
6161

6262
public Object access(PySequenceMethodsWrapper object, String key) {
63-
ManagedPythonClass delegate = object.getPythonClass();
63+
PythonManagedClass delegate = object.getPythonClass();
6464
Object result;
6565
switch (key) {
6666
case NativeMemberNames.SQ_REPEAT:

0 commit comments

Comments
 (0)