Skip to content

Commit 62d7710

Browse files
committed
Disable Branch tests on DSL interpreter; look into most of remaining TODOs
1 parent d74573b commit 62d7710

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/generator/CommonGeneratorBuiltins.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ static Object genericBytecodeDSL(VirtualFrame frame, Node inliningTarget, PGener
268268
arguments = prepareArguments(self);
269269
} else {
270270
// Subsequent invocations: call a continuation root node.
271-
// TODO: forward arguments into the continuation frame (e.g., exception state).
272271
arguments = new Object[]{continuation.getFrame(), sendValue};
273272
}
274273

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/compiler/bytecode_dsl/RootNodeCompiler.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,6 +2399,10 @@ public Void visit(StmtTy.Assert node) {
23992399

24002400
// --------------------- assign ------------------------
24012401

2402+
/**
2403+
* Generates code to store the value produced by {@link #generateValue} into the visited
2404+
* expression.
2405+
*/
24022406
public class StoreVisitor implements BaseBytecodeDSLVisitor<Void> {
24032407
private final Builder b = StatementCompiler.this.b;
24042408
private final Runnable generateValue;
@@ -2441,12 +2445,21 @@ public Void visit(ExprTy.Subscript node) {
24412445
return null;
24422446
}
24432447

2448+
/**
2449+
* This method unpacks the rhs (a sequence/iterable) to the elements on the lhs
2450+
* (specified by {@code nodes}.
2451+
*/
24442452
private void visitIterableAssign(ExprTy[] nodes) {
24452453
b.beginBlock();
24462454

2447-
// TODO if it is a variable directly, use that variable instead of going to a temp
2455+
/**
2456+
* The rhs should be fully evaluated and unpacked into the expected number of
2457+
* elements before storing values into the lhs (e.g., if an lhs element is f().attr,
2458+
* but computing or unpacking rhs throws, f() is not computed). Thus, the unpacking
2459+
* step stores the unpacked values into intermediate variables, and then those
2460+
* variables are copied into the lhs elements afterward.
2461+
*/
24482462
BytecodeLocal[] targets = new BytecodeLocal[nodes.length];
2449-
24502463
for (int i = 0; i < targets.length; i++) {
24512464
targets[i] = b.createLocal();
24522465
}
@@ -3838,7 +3851,6 @@ private ConstantValue foldConstantOp(ExprTy value) {
38383851
private ConstantValue foldUnaryOpConstant(ExprTy.UnaryOp unaryOp) {
38393852
assert unaryOp.op == UnaryOpTy.USub;
38403853
assert unaryOp.operand instanceof ExprTy.Constant : unaryOp.operand;
3841-
// TODO: why does the version in Compiler.java save and restore locations?
38423854
ExprTy.Constant c = (ExprTy.Constant) unaryOp.operand;
38433855
ConstantValue ret = c.value.negate();
38443856
assert ret != null;
@@ -3851,7 +3863,6 @@ private ConstantValue foldUnaryOpConstant(ExprTy.UnaryOp unaryOp) {
38513863
private ConstantValue foldBinOpComplexConstant(ExprTy.BinOp binOp) {
38523864
assert (binOp.left instanceof ExprTy.UnaryOp || binOp.left instanceof ExprTy.Constant) && binOp.right instanceof ExprTy.Constant : binOp.left + " " + binOp.right;
38533865
assert binOp.op == OperatorTy.Sub || binOp.op == OperatorTy.Add;
3854-
// TODO: why does the version in Compiler.java save and restore locations?
38553866
ConstantValue left;
38563867
if (binOp.left instanceof ExprTy.UnaryOp) {
38573868
left = foldUnaryOpConstant((ExprTy.UnaryOp) binOp.left);

graalpython/lib-python/3/test/support/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,17 @@ def impl_detail(msg=None, **guards):
10561056
msg = msg.format(' or '.join(guardnames))
10571057
return unittest.skip(msg)
10581058

1059+
def bytecode_dsl_excluded(test):
1060+
"""
1061+
Decorator for tests that don't apply to the Bytecode DSL interpreter.
1062+
"""
1063+
try:
1064+
if sys.implementation.name == 'graalpy' and __graalpython__.is_bytecode_dsl_interpreter:
1065+
return unittest.skip("implementation detail not available on the Bytecode DSL interpreter")
1066+
except NameError:
1067+
pass
1068+
return test
1069+
10591070
def _parse_guards(guards):
10601071
# Returns a tuple ({platform_name: run_me}, default_value)
10611072
if not guards:

graalpython/lib-python/3/test/test_sys_settrace.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,7 @@ def no_jump_without_trace_function():
18691869
raise AssertionError("Trace-function-less jump failed to fail")
18701870

18711871

1872+
@support.bytecode_dsl_excluded
18721873
class JumpTestCase(unittest.TestCase):
18731874
def setUp(self):
18741875
self.addCleanup(sys.settrace, sys.gettrace())

0 commit comments

Comments
 (0)