Skip to content

Commit 9a73b34

Browse files
committed
Address review feedback
1 parent 3424d96 commit 9a73b34

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/compiler/CompilerTests.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,11 @@ public void testTupleLiteralNonConstant() {
562562
doTest("(1, 2, [3])");
563563
}
564564

565+
@Test
566+
public void testTupleLiteralMixedIntegers() {
567+
doTest("(1, 17179869184, 3)");
568+
}
569+
565570
@Test
566571
public void testTupleLiteralExpand() {
567572
doTest("(1, 2, 3, *a, 5)");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Disassembly of <module>:
2+
000000 0 LOAD_CONST_COLLECTION 0 ([1, 17179869184, 3] type long into tuple)
3+
000000 3 RETURN_VALUE

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
import com.oracle.graal.python.compiler.CodeUnit;
6060
import com.oracle.graal.python.compiler.CompilationUnit;
6161
import com.oracle.graal.python.compiler.Compiler;
62-
import com.oracle.graal.python.compiler.ErrorCallbackImpl;
62+
import com.oracle.graal.python.compiler.RaisePythonExceptionErrorCallback;
6363
import com.oracle.graal.python.nodes.HiddenAttributes;
6464
import com.oracle.graal.python.nodes.PRootNode;
6565
import com.oracle.graal.python.nodes.RootNodeFactory;
@@ -499,7 +499,7 @@ private CallTarget parseForBytecodeInterpreter(ParsingRequest request) {
499499
}
500500

501501
public RootCallTarget parseForBytecodeInterpreter(PythonContext context, Source source, InputType type, boolean topLevel, int optimize, boolean interactiveTerminal) {
502-
ErrorCallbackImpl errorCb = new ErrorCallbackImpl(source, PythonOptions.isPExceptionWithJavaStacktrace(this));
502+
RaisePythonExceptionErrorCallback errorCb = new RaisePythonExceptionErrorCallback(source, PythonOptions.isPExceptionWithJavaStacktrace(this));
503503
try {
504504
Parser parser = Compiler.createParser(source.getCharacters().toString(), errorCb, type, interactiveTerminal);
505505
Compiler compiler = new Compiler(errorCb);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/compiler/ErrorCallbackImpl.java renamed to graalpython/com.oracle.graal.python/src/com/oracle/graal/python/compiler/RaisePythonExceptionErrorCallback.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@
6868
import com.oracle.truffle.api.source.SourceSection;
6969
import com.oracle.truffle.api.strings.TruffleString;
7070

71-
public class ErrorCallbackImpl implements ErrorCallback {
71+
public class RaisePythonExceptionErrorCallback implements ErrorCallback {
7272

7373
private static final TruffleString DEFAULT_FILENAME = tsLiteral("<string>");
7474

7575
private final Source source;
7676
private final boolean withJavaStackTrace;
7777
private List<DeprecationWarning> deprecationWarnings;
7878

79-
public ErrorCallbackImpl(Source source, boolean withJavaStackTrace) {
79+
public RaisePythonExceptionErrorCallback(Source source, boolean withJavaStackTrace) {
8080
this.source = source;
8181
this.withJavaStackTrace = withJavaStackTrace;
8282
}
@@ -198,9 +198,9 @@ public void triggerDeprecationWarnings() {
198198

199199
@TruffleBoundary
200200
private void triggerDeprecationWarningsBoundary() {
201+
PythonModule warnings = PythonContext.get(null).lookupBuiltinModule(T__WARNINGS);
201202
for (DeprecationWarning warning : deprecationWarnings) {
202203
try {
203-
PythonModule warnings = PythonContext.get(null).lookupBuiltinModule(T__WARNINGS);
204204
PyObjectCallMethodObjArgs.getUncached().execute(null, warnings, WarningsModuleBuiltins.T_WARN_EXPLICIT, //
205205
warning.message, PythonBuiltinClassType.DeprecationWarning, getFilename(), warning.sourceRange.startLine);
206206
} catch (PException e) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode/PBytecodeRootNode.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@
8989
import com.oracle.graal.python.builtins.objects.slice.SliceNodesFactory.CreateSliceNodeGen;
9090
import com.oracle.graal.python.compiler.BinaryOpsConstants;
9191
import com.oracle.graal.python.compiler.CodeUnit;
92-
import com.oracle.graal.python.compiler.ErrorCallbackImpl;
9392
import com.oracle.graal.python.compiler.FormatOptions;
9493
import com.oracle.graal.python.compiler.OpCodes;
9594
import com.oracle.graal.python.compiler.OpCodes.CollectionBits;
9695
import com.oracle.graal.python.compiler.OpCodesConstants;
9796
import com.oracle.graal.python.compiler.QuickeningTypes;
97+
import com.oracle.graal.python.compiler.RaisePythonExceptionErrorCallback;
9898
import com.oracle.graal.python.compiler.UnaryOpsConstants;
9999
import com.oracle.graal.python.lib.PyObjectAsciiNode;
100100
import com.oracle.graal.python.lib.PyObjectAsciiNodeGen;
@@ -437,7 +437,8 @@ public final class PBytecodeRootNode extends PRootNode implements BytecodeOSRNod
437437
private final CodeUnit co;
438438
private final Source source;
439439
private SourceSection sourceSection;
440-
private final ErrorCallbackImpl parserErrorCallback; // For deferred deprecation warnings
440+
// For deferred deprecation warnings
441+
private final RaisePythonExceptionErrorCallback parserErrorCallback;
441442

442443
@CompilationFinal(dimensions = 1) final byte[] bytecode;
443444
@CompilationFinal(dimensions = 1) private final Object[] consts;
@@ -541,12 +542,12 @@ private static Signature makeSignature(CodeUnit co) {
541542
}
542543

543544
@TruffleBoundary
544-
public PBytecodeRootNode(TruffleLanguage<?> language, CodeUnit co, Source source, ErrorCallbackImpl parserErrorCallback) {
545+
public PBytecodeRootNode(TruffleLanguage<?> language, CodeUnit co, Source source, RaisePythonExceptionErrorCallback parserErrorCallback) {
545546
this(language, makeFrameDescriptor(co), makeSignature(co), co, source, parserErrorCallback);
546547
}
547548

548549
@TruffleBoundary
549-
public PBytecodeRootNode(TruffleLanguage<?> language, FrameDescriptor fd, Signature sign, CodeUnit co, Source source, ErrorCallbackImpl parserErrorCallback) {
550+
public PBytecodeRootNode(TruffleLanguage<?> language, FrameDescriptor fd, Signature sign, CodeUnit co, Source source, RaisePythonExceptionErrorCallback parserErrorCallback) {
550551
super(language, fd);
551552
((FrameInfo) fd.getInfo()).rootNode = this;
552553
this.celloffset = co.varnames.length;

0 commit comments

Comments
 (0)