Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use separate read attribute nodes for different fixed keys.
  • Loading branch information
woess committed Nov 17, 2025
commit 1c039dc2b5335551cb2801f6b1e99b0bbb93d615
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ static Object getattribute(VirtualFrame frame, PythonModule self, TruffleString
@Bind Node inliningTarget,
@Cached IsBuiltinObjectProfile isAttrError,
@Cached ReadAttributeFromModuleNode readGetattr,
@Cached ReadAttributeFromModuleNode readName,
@Cached ReadAttributeFromModuleNode readSpec,
@Cached ReadAttributeFromObjectNode readInitializing,
@Cached InlinedConditionProfile customGetAttr,
@Cached CallNode callNode,
Expand All @@ -291,13 +293,13 @@ static Object getattribute(VirtualFrame frame, PythonModule self, TruffleString
} else {
TruffleString moduleName;
try {
moduleName = castNameToStringNode.execute(inliningTarget, readGetattr.execute(self, T___NAME__));
moduleName = castNameToStringNode.execute(inliningTarget, readName.execute(self, T___NAME__));
} catch (CannotCastException ce) {
// we just don't have the module name
moduleName = null;
}
if (moduleName != null) {
Object moduleSpec = readGetattr.execute(self, T___SPEC__);
Object moduleSpec = readSpec.execute(self, T___SPEC__);
if (moduleSpec != PNone.NO_VALUE) {
Object isInitializing = readInitializing.execute(moduleSpec, T__INITIALIZING);
if (isInitializing != PNone.NO_VALUE && castToBooleanNode.execute(frame, isInitializing)) {
Expand Down