Skip to content

Commit a83b28d

Browse files
committed
[GR-25584] Introduce message PythonObjectLibrary.getIterator
PullRequest: graalpython/1250
2 parents c8a8f62 + 4209793 commit a83b28d

File tree

159 files changed

+821
-1010
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+821
-1010
lines changed

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/datatype/PRangeTests.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
import static com.oracle.graal.python.test.PythonTests.assertPrints;
2929
import static org.junit.Assert.assertEquals;
3030

31-
import com.oracle.graal.python.builtins.objects.range.PIntRange;
3231
import org.junit.Before;
3332
import org.junit.Test;
3433

3534
import com.oracle.graal.python.PythonLanguage;
35+
import com.oracle.graal.python.builtins.objects.object.PythonObjectLibrary;
36+
import com.oracle.graal.python.builtins.objects.range.PIntRange;
3637
import com.oracle.graal.python.builtins.objects.range.PRange;
37-
import com.oracle.graal.python.nodes.control.GetIteratorExpressionNode.GetIteratorNode;
3838
import com.oracle.graal.python.nodes.control.GetNextNode;
3939
import com.oracle.graal.python.nodes.object.IsBuiltinClassProfile;
4040
import com.oracle.graal.python.runtime.exception.PException;
@@ -71,9 +71,7 @@ public void loopWithOnlyStop() throws UnexpectedResultException {
7171
PRange range = PythonObjectFactory.getUncached().createIntRange(10);
7272
int index = 0;
7373
TestRoot testRoot = new TestRoot(PythonLanguage.getCurrent());
74-
GetIteratorNode getIter = GetIteratorNode.create();
75-
testRoot.doInsert(getIter);
76-
Object iter = getIter.executeWith(null, range);
74+
Object iter = PythonObjectLibrary.getUncached().getIterator(range);
7775
GetNextNode next = GetNextNode.create();
7876
testRoot.doInsert(next);
7977
IsBuiltinClassProfile errorProfile = IsBuiltinClassProfile.getUncached();
@@ -95,9 +93,7 @@ public void loopWithStep() throws UnexpectedResultException {
9593
PRange range = PythonObjectFactory.getUncached().createIntRange(0, 10, 2, 5);
9694
int index = 0;
9795
TestRoot testRoot = new TestRoot(PythonLanguage.getCurrent());
98-
GetIteratorNode getIter = GetIteratorNode.create();
99-
testRoot.doInsert(getIter);
100-
Object iter = getIter.executeWith(null, range);
96+
Object iter = PythonObjectLibrary.getUncached().getIterator(range);
10197
GetNextNode next = GetNextNode.create();
10298
testRoot.doInsert(next);
10399
IsBuiltinClassProfile errorProfile = IsBuiltinClassProfile.getUncached();

graalpython/com.oracle.graal.python.test/testData/goldenFiles/AwaitAndAsyncTests/asyncFor01.tast

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ ModuleRootNode Name: <module 'asyncFor01'> SourceSection: [0,39]`async def f():
4545
ExpressionStatementNode SourceSection: [35,39]`pass`
4646
EmptyNode SourceSection: [35,39]`pass`
4747
GetIteratorExpressionNodeGen SourceSection: [31,33]`()`
48-
GetIteratorNodeGen SourceSection: None
4948
TupleLiteralNode SourceSection: [31,33]`()`
5049
PythonObjectFactoryNodeGen SourceSection: None
5150
BlockNode SourceSection: None

graalpython/com.oracle.graal.python.test/testData/goldenFiles/AwaitAndAsyncTests/asyncFor02.tast

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ ModuleRootNode Name: <module 'asyncFor02'> SourceSection: [0,42]`async def f():
6464
ExpressionStatementNode SourceSection: [38,42]`pass`
6565
EmptyNode SourceSection: [38,42]`pass`
6666
GetIteratorExpressionNodeGen SourceSection: [34,36]`()`
67-
GetIteratorNodeGen SourceSection: None
6867
TupleLiteralNode SourceSection: [34,36]`()`
6968
PythonObjectFactoryNodeGen SourceSection: None
7069
BlockNode SourceSection: None

graalpython/com.oracle.graal.python.test/testData/goldenFiles/BasicTests/for01.tast

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@ ModuleRootNode Name: <module 'for01'> SourceSection: [0,23]`for i in 'ahoj':↵
1818
ExpressionStatementNode SourceSection: [19,23]`pass`
1919
EmptyNode SourceSection: [19,23]`pass`
2020
GetIteratorExpressionNodeGen SourceSection: [9,15]`'ahoj'`
21-
GetIteratorNodeGen SourceSection: None
2221
StringLiteralNode SourceSection: [9,15]`'ahoj'`
2322
BlockNode SourceSection: None

graalpython/com.oracle.graal.python.test/testData/goldenFiles/BasicTests/for02.tast

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ ModuleRootNode Name: <module 'for02'> SourceSection: [0,31]`for i in range(210):
2727
IsBuiltinClassProfile SourceSection: None
2828
CachedDispatchFirst SourceSection: None
2929
GetIteratorExpressionNodeGen SourceSection: [9,19]`range(210)`
30-
GetIteratorNodeGen SourceSection: None
3130
PythonCallUnary SourceSection: [9,19]`range(210)`
3231
CallUnaryMethodNodeGen SourceSection: None
3332
ReadNameNodeGen SourceSection: [9,14]`range`

graalpython/com.oracle.graal.python.test/testData/goldenFiles/BasicTests/for03.tast

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ ModuleRootNode Name: <module 'for03'> SourceSection: [0,43]`for x in xrange(3):
3131
BreakNode SourceSection: [37,42]`break`
3232
BlockNode SourceSection: None
3333
GetIteratorExpressionNodeGen SourceSection: [9,18]`xrange(3)`
34-
GetIteratorNodeGen SourceSection: None
3534
PythonCallUnary SourceSection: [9,18]`xrange(3)`
3635
CallUnaryMethodNodeGen SourceSection: None
3736
ReadNameNodeGen SourceSection: [9,15]`xrange`

graalpython/com.oracle.graal.python.test/testData/goldenFiles/BasicTests/for04.tast

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ ModuleRootNode Name: <module 'for04'> SourceSection: [0,59]`def fn():↵ for x
5757
BreakNode SourceSection: [53,58]`break`
5858
BlockNode SourceSection: None
5959
GetIteratorExpressionNodeGen SourceSection: [21,30]`xrange(3)`
60-
GetIteratorNodeGen SourceSection: None
6160
PythonCallUnary SourceSection: [21,30]`xrange(3)`
6261
CallUnaryMethodNodeGen SourceSection: None
6362
ReadGlobalOrBuiltinNodeGen SourceSection: [21,27]`xrange`

graalpython/com.oracle.graal.python.test/testData/goldenFiles/BasicTests/for07.tast

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ ModuleRootNode Name: <module 'for07'> SourceSection: [0,68]`for x in range(10):
4949
IsBuiltinClassProfile SourceSection: None
5050
CachedDispatchFirst SourceSection: None
5151
GetIteratorExpressionNodeGen SourceSection: [9,18]`range(10)`
52-
GetIteratorNodeGen SourceSection: None
5352
PythonCallUnary SourceSection: [9,18]`range(10)`
5453
CallUnaryMethodNodeGen SourceSection: None
5554
ReadNameNodeGen SourceSection: [9,14]`range`

graalpython/com.oracle.graal.python.test/testData/goldenFiles/BasicTests/for08.tast

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ ModuleRootNode Name: <module 'for08'> SourceSection: [0,71]`for x in range(10):
4646
IsBuiltinClassProfile SourceSection: None
4747
CachedDispatchFirst SourceSection: None
4848
GetIteratorExpressionNodeGen SourceSection: [9,18]`range(10)`
49-
GetIteratorNodeGen SourceSection: None
5049
PythonCallUnary SourceSection: [9,18]`range(10)`
5150
CallUnaryMethodNodeGen SourceSection: None
5251
ReadNameNodeGen SourceSection: [9,14]`range`

graalpython/com.oracle.graal.python.test/testData/goldenFiles/BasicTests/for09.tast

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ ModuleRootNode Name: <module 'for09'> SourceSection: [0,94]`for i in range(1, 10
4949
IsBuiltinClassProfile SourceSection: None
5050
CachedDispatchFirst SourceSection: None
5151
GetIteratorExpressionNodeGen SourceSection: [9,21]`range(1, 10)`
52-
GetIteratorNodeGen SourceSection: None
5352
PythonCallBinary SourceSection: [9,21]`range(1, 10)`
5453
CallBinaryMethodNodeGen SourceSection: None
5554
ReadNameNodeGen SourceSection: [9,14]`range`

0 commit comments

Comments
 (0)