Skip to content

Commit 0ade565

Browse files
woesssteve-s
authored andcommitted
Use separate read attribute nodes for different fixed keys.
1 parent 06c4313 commit 0ade565

File tree

1 file changed

+4
-2
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/module

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ static Object getattribute(VirtualFrame frame, PythonModule self, TruffleString
278278
@Bind Node inliningTarget,
279279
@Cached IsBuiltinObjectProfile isAttrError,
280280
@Cached ReadAttributeFromModuleNode readGetattr,
281+
@Cached ReadAttributeFromModuleNode readName,
282+
@Cached ReadAttributeFromModuleNode readSpec,
281283
@Cached ReadAttributeFromObjectNode readInitializing,
282284
@Cached InlinedConditionProfile customGetAttr,
283285
@Cached CallNode callNode,
@@ -291,13 +293,13 @@ static Object getattribute(VirtualFrame frame, PythonModule self, TruffleString
291293
} else {
292294
TruffleString moduleName;
293295
try {
294-
moduleName = castNameToStringNode.execute(inliningTarget, readGetattr.execute(self, T___NAME__));
296+
moduleName = castNameToStringNode.execute(inliningTarget, readName.execute(self, T___NAME__));
295297
} catch (CannotCastException ce) {
296298
// we just don't have the module name
297299
moduleName = null;
298300
}
299301
if (moduleName != null) {
300-
Object moduleSpec = readGetattr.execute(self, T___SPEC__);
302+
Object moduleSpec = readSpec.execute(self, T___SPEC__);
301303
if (moduleSpec != PNone.NO_VALUE) {
302304
Object isInitializing = readInitializing.execute(moduleSpec, T__INITIALIZING);
303305
if (isInitializing != PNone.NO_VALUE && castToBooleanNode.execute(frame, isInitializing)) {

0 commit comments

Comments
 (0)