Skip to content

Commit b380d5d

Browse files
committed
[GR-23941] Use "special calls" whenever possible to avoid dispatch overhead.
PullRequest: graalpython/1009
2 parents 249c4aa + 88c7bc1 commit b380d5d

File tree

151 files changed

+14012
-13973
lines changed

Some content is hidden

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

151 files changed

+14012
-13973
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ ModuleRootNode Name: <module 'await05'> SourceSection: [0,35]`async def f():↵
3535
BlockNode SourceSection: None
3636
FunctionBodyNode SourceSection: [16,35]`foo((await smth()))`
3737
ExpressionStatementNode SourceSection: [16,35]`foo((await smth()))`
38-
PythonCallNodeGen SourceSection: [16,35]`foo((await smth()))`
39-
CallNodeGen SourceSection: None
38+
PythonCallUnary SourceSection: [16,35]`foo((await smth()))`
39+
CallUnaryMethodNodeGen SourceSection: None
40+
ReadGlobalOrBuiltinNodeGen SourceSection: [16,19]`foo`
41+
Identifier: foo
42+
ReadAttributeFromObjectNotTypeNodeGen SourceSection: None
4043
PythonCallNodeGen SourceSection: [21,33]`await smth()`
4144
CallNodeGen SourceSection: None
4245
ReadGlobalOrBuiltinNodeGen SourceSection: [27,31]`smth`
4346
Identifier: smth
4447
ReadAttributeFromObjectNotTypeNodeGen SourceSection: None
45-
ReadGlobalOrBuiltinNodeGen SourceSection: [16,19]`foo`
46-
Identifier: foo
47-
ReadAttributeFromObjectNotTypeNodeGen SourceSection: None
4848
Return Expresssion: ReadLocalVariableNode SourceSection: None
4949
Frame: [0,<return_val>,Illegal]
5050
ReadVariableFromFrameNodeGen SourceSection: None

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ ModuleRootNode Name: <module 'assert02'> SourceSection: [0,59]`def avg(marks):
4646
BinaryComparisonNodeGen SourceSection: [27,42]`len(marks) != 0`
4747
LookupAndCallBinaryNodeGen SourceSection: None
4848
Op: __ne__
49-
PythonCallNodeGen SourceSection: [27,37]`len(marks)`
50-
CallNodeGen SourceSection: None
51-
ReadLocalVariableNode SourceSection: [31,36]`marks`
52-
Frame: [0,marks,Illegal]
53-
ReadVariableFromFrameNodeGen SourceSection: None
49+
PythonCallUnary SourceSection: [27,37]`len(marks)`
50+
CallUnaryMethodNodeGen SourceSection: None
5451
ReadGlobalOrBuiltinNodeGen SourceSection: [27,30]`len`
5552
Identifier: len
5653
ReadAttributeFromObjectNotTypeNodeGen SourceSection: None
54+
ReadLocalVariableNode SourceSection: [31,36]`marks`
55+
Frame: [0,marks,Illegal]
56+
ReadVariableFromFrameNodeGen SourceSection: None
5757
IntegerLiteralNode SourceSection: [41,42]`0`
5858
Value: 0
5959
StringLiteralNode SourceSection: [43,59]`"List is empty."`

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ ModuleRootNode Name: <module 'assert03'> SourceSection: [0,47]`def avg():↵
4444
ReadAttributeFromObjectNotTypeNodeGen SourceSection: None
4545
IntegerLiteralNode SourceSection: [29,30]`0`
4646
Value: 0
47-
PythonCallNodeGen SourceSection: [32,47]`getMessage(len)`
48-
CallNodeGen SourceSection: None
49-
ReadGlobalOrBuiltinNodeGen SourceSection: [43,46]`len`
50-
Identifier: len
51-
ReadAttributeFromObjectNotTypeNodeGen SourceSection: None
47+
PythonCallUnary SourceSection: [32,47]`getMessage(len)`
48+
CallUnaryMethodNodeGen SourceSection: None
5249
ReadGlobalOrBuiltinNodeGen SourceSection: [32,42]`getMessage`
5350
Identifier: getMessage
5451
ReadAttributeFromObjectNotTypeNodeGen SourceSection: None
52+
ReadGlobalOrBuiltinNodeGen SourceSection: [43,46]`len`
53+
Identifier: len
54+
ReadAttributeFromObjectNotTypeNodeGen SourceSection: None
5555
Return Expresssion: ReadLocalVariableNode SourceSection: None
5656
Frame: [0,<return_val>,Illegal]
5757
ReadVariableFromFrameNodeGen SourceSection: None

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ ModuleRootNode Name: <module 'call02'> SourceSection: [0,6]`foo(1)`
55
FrameDescriptor: Empty
66
Documentation: None
77
InnerRootNode SourceSection: [0,6]`foo(1)`
8-
PythonCallNodeGen SourceSection: [0,6]`foo(1)`
9-
CallNodeGen SourceSection: None
10-
IntegerLiteralNode SourceSection: [4,5]`1`
11-
Value: 1
8+
PythonCallUnary SourceSection: [0,6]`foo(1)`
9+
CallUnaryMethodNodeGen SourceSection: None
1210
ReadNameNodeGen SourceSection: [0,3]`foo`
1311
Identifier: foo
12+
IntegerLiteralNode SourceSection: [4,5]`1`
13+
Value: 1

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ ModuleRootNode Name: <module 'elif01'> SourceSection: [0,96]`var = 100↵if var
2121
IntegerLiteralNode SourceSection: [20,23]`200`
2222
Value: 200
2323
ExpressionStatementNode SourceSection: [27,36]`print (2)`
24-
PythonCallNodeGen SourceSection: [27,36]`print (2)`
25-
CallNodeGen SourceSection: None
26-
IntegerLiteralNode SourceSection: [34,35]`2`
27-
Value: 2
24+
PythonCallUnary SourceSection: [27,36]`print (2)`
25+
CallUnaryMethodNodeGen SourceSection: None
2826
ReadNameNodeGen SourceSection: [27,32]`print`
2927
Identifier: print
28+
IntegerLiteralNode SourceSection: [34,35]`2`
29+
Value: 2
3030
IfNode SourceSection: None
3131
YesNodeGen SourceSection: None
3232
BinaryComparisonNodeGen SourceSection: [42,52]`var == 150`
@@ -37,11 +37,11 @@ ModuleRootNode Name: <module 'elif01'> SourceSection: [0,96]`var = 100↵if var
3737
IntegerLiteralNode SourceSection: [49,52]`150`
3838
Value: 150
3939
ExpressionStatementNode SourceSection: [56,67]`print (1.5)`
40-
PythonCallNodeGen SourceSection: [56,67]`print (1.5)`
41-
CallNodeGen SourceSection: None
42-
DoubleLiteralNode SourceSection: [63,66]`1.5`
40+
PythonCallUnary SourceSection: [56,67]`print (1.5)`
41+
CallUnaryMethodNodeGen SourceSection: None
4342
ReadNameNodeGen SourceSection: [56,61]`print`
4443
Identifier: print
44+
DoubleLiteralNode SourceSection: [63,66]`1.5`
4545
IfNode SourceSection: None
4646
YesNodeGen SourceSection: None
4747
BinaryComparisonNodeGen SourceSection: [73,83]`var == 100`
@@ -52,12 +52,12 @@ ModuleRootNode Name: <module 'elif01'> SourceSection: [0,96]`var = 100↵if var
5252
IntegerLiteralNode SourceSection: [80,83]`100`
5353
Value: 100
5454
ExpressionStatementNode SourceSection: [87,96]`print (1)`
55-
PythonCallNodeGen SourceSection: [87,96]`print (1)`
56-
CallNodeGen SourceSection: None
57-
IntegerLiteralNode SourceSection: [94,95]`1`
58-
Value: 1
55+
PythonCallUnary SourceSection: [87,96]`print (1)`
56+
CallUnaryMethodNodeGen SourceSection: None
5957
ReadNameNodeGen SourceSection: [87,92]`print`
6058
Identifier: print
59+
IntegerLiteralNode SourceSection: [94,95]`1`
60+
Value: 1
6161
BlockNode SourceSection: None
6262
SideEffect:
6363
WriteNameNodeGen SourceSection: [0,9]`var = 100`

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ ModuleRootNode Name: <module 'for02'> SourceSection: [0,31]`for i in range(210):
1616
WriteNameNodeGen SourceSection: None
1717
Identifier: i
1818
ExpressionStatementNode SourceSection: [23,31]`print(i)`
19-
PythonCallNodeGen SourceSection: [23,31]`print(i)`
20-
CallNodeGen SourceSection: None
21-
ReadNameNodeGen SourceSection: [29,30]`i`
22-
Identifier: i
19+
PythonCallUnary SourceSection: [23,31]`print(i)`
20+
CallUnaryMethodNodeGen SourceSection: None
2321
ReadNameNodeGen SourceSection: [23,28]`print`
2422
Identifier: print
23+
ReadNameNodeGen SourceSection: [29,30]`i`
24+
Identifier: i
2525
GetIteratorExpressionNodeGen SourceSection: [9,19]`range(210)`
2626
GetIteratorNodeGen SourceSection: None
27-
PythonCallNodeGen SourceSection: [9,19]`range(210)`
28-
CallNodeGen SourceSection: None
29-
IntegerLiteralNode SourceSection: [15,18]`210`
30-
Value: 210
27+
PythonCallUnary SourceSection: [9,19]`range(210)`
28+
CallUnaryMethodNodeGen SourceSection: None
3129
ReadNameNodeGen SourceSection: [9,14]`range`
3230
Identifier: range
31+
IntegerLiteralNode SourceSection: [15,18]`210`
32+
Value: 210
3333
BlockNode SourceSection: None

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ ModuleRootNode Name: <module 'for03'> SourceSection: [0,43]`for x in xrange(3):
2828
BlockNode SourceSection: None
2929
GetIteratorExpressionNodeGen SourceSection: [9,18]`xrange(3)`
3030
GetIteratorNodeGen SourceSection: None
31-
PythonCallNodeGen SourceSection: [9,18]`xrange(3)`
32-
CallNodeGen SourceSection: None
33-
IntegerLiteralNode SourceSection: [16,17]`3`
34-
Value: 3
31+
PythonCallUnary SourceSection: [9,18]`xrange(3)`
32+
CallUnaryMethodNodeGen SourceSection: None
3533
ReadNameNodeGen SourceSection: [9,15]`xrange`
3634
Identifier: xrange
35+
IntegerLiteralNode SourceSection: [16,17]`3`
36+
Value: 3
3737
BlockNode SourceSection: None

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ ModuleRootNode Name: <module 'for04'> SourceSection: [0,59]`def fn():↵ for x
5656
BlockNode SourceSection: None
5757
GetIteratorExpressionNodeGen SourceSection: [21,30]`xrange(3)`
5858
GetIteratorNodeGen SourceSection: None
59-
PythonCallNodeGen SourceSection: [21,30]`xrange(3)`
60-
CallNodeGen SourceSection: None
61-
IntegerLiteralNode SourceSection: [28,29]`3`
62-
Value: 3
59+
PythonCallUnary SourceSection: [21,30]`xrange(3)`
60+
CallUnaryMethodNodeGen SourceSection: None
6361
ReadGlobalOrBuiltinNodeGen SourceSection: [21,27]`xrange`
6462
Identifier: xrange
6563
ReadAttributeFromObjectNotTypeNodeGen SourceSection: None
64+
IntegerLiteralNode SourceSection: [28,29]`3`
65+
Value: 3
6666
BlockNode SourceSection: None
6767
Return Expresssion: ReadLocalVariableNode SourceSection: None
6868
Frame: [1,<return_val>,Illegal]

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ ModuleRootNode Name: <module 'for07'> SourceSection: [0,68]`for x in range(10):
3434
ContinueNode SourceSection: [47,55]`continue`
3535
BlockNode SourceSection: None
3636
ExpressionStatementNode SourceSection: [60,68]`print(x)`
37-
PythonCallNodeGen SourceSection: [60,68]`print(x)`
38-
CallNodeGen SourceSection: None
39-
ReadNameNodeGen SourceSection: [66,67]`x`
40-
Identifier: x
37+
PythonCallUnary SourceSection: [60,68]`print(x)`
38+
CallUnaryMethodNodeGen SourceSection: None
4139
ReadNameNodeGen SourceSection: [60,65]`print`
4240
Identifier: print
41+
ReadNameNodeGen SourceSection: [66,67]`x`
42+
Identifier: x
4343
GetIteratorExpressionNodeGen SourceSection: [9,18]`range(10)`
4444
GetIteratorNodeGen SourceSection: None
45-
PythonCallNodeGen SourceSection: [9,18]`range(10)`
46-
CallNodeGen SourceSection: None
47-
IntegerLiteralNode SourceSection: [15,17]`10`
48-
Value: 10
45+
PythonCallUnary SourceSection: [9,18]`range(10)`
46+
CallUnaryMethodNodeGen SourceSection: None
4947
ReadNameNodeGen SourceSection: [9,14]`range`
5048
Identifier: range
49+
IntegerLiteralNode SourceSection: [15,17]`10`
50+
Value: 10
5151
BlockNode SourceSection: None

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ ModuleRootNode Name: <module 'for08'> SourceSection: [0,71]`for x in range(10):
3131
ContinueNode SourceSection: [50,58]`continue`
3232
BlockNode SourceSection: None
3333
ExpressionStatementNode SourceSection: [63,71]`print(x)`
34-
PythonCallNodeGen SourceSection: [63,71]`print(x)`
35-
CallNodeGen SourceSection: None
36-
ReadNameNodeGen SourceSection: [69,70]`x`
37-
Identifier: x
34+
PythonCallUnary SourceSection: [63,71]`print(x)`
35+
CallUnaryMethodNodeGen SourceSection: None
3836
ReadNameNodeGen SourceSection: [63,68]`print`
3937
Identifier: print
38+
ReadNameNodeGen SourceSection: [69,70]`x`
39+
Identifier: x
4040
GetIteratorExpressionNodeGen SourceSection: [9,18]`range(10)`
4141
GetIteratorNodeGen SourceSection: None
42-
PythonCallNodeGen SourceSection: [9,18]`range(10)`
43-
CallNodeGen SourceSection: None
44-
IntegerLiteralNode SourceSection: [15,17]`10`
45-
Value: 10
42+
PythonCallUnary SourceSection: [9,18]`range(10)`
43+
CallUnaryMethodNodeGen SourceSection: None
4644
ReadNameNodeGen SourceSection: [9,14]`range`
4745
Identifier: range
46+
IntegerLiteralNode SourceSection: [15,17]`10`
47+
Value: 10
4848
BlockNode SourceSection: None

0 commit comments

Comments
 (0)