Skip to content

Commit ecbed71

Browse files
committed
add TruffleBoundary
1 parent c495085 commit ecbed71

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,12 @@ abstract static class CharmapBuildNode extends PythonBuiltinNode {
636636
// This is replaced in the core _codecs.py with the full functionality
637637
@Specialization
638638
Object lookup(String chars) {
639+
Map<Integer, Integer> charmap = createMap(chars);
640+
return factory().createDict(charmap);
641+
}
642+
643+
@TruffleBoundary
644+
private static Map<Integer, Integer> createMap(String chars) {
639645
Map<Integer, Integer> charmap = new HashMap<>();
640646
int pos = 0;
641647
int num = 0;
@@ -646,8 +652,7 @@ Object lookup(String chars) {
646652
pos += Character.charCount(charid);
647653
num++;
648654
}
649-
650-
return factory().createDict(charmap);
655+
return charmap;
651656
}
652657
}
653658
}

0 commit comments

Comments
 (0)