Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
11186505
Commit
11186505
authored
Feb 26, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge changes and unit tests from evan-script_fix-branch
parent
bc460480
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
323 additions
and
55 deletions
+323
-55
lib/python/Products/PythonScripts/PythonScript.py
lib/python/Products/PythonScripts/PythonScript.py
+10
-4
lib/python/Products/PythonScripts/tests/testPythonScript.py
lib/python/Products/PythonScripts/tests/testPythonScript.py
+218
-0
lib/python/Products/PythonScripts/tests/tscripts/big_boolean.ps
...thon/Products/PythonScripts/tests/tscripts/big_boolean.ps
+3
-0
lib/python/Products/PythonScripts/tests/tscripts/fibonacci.ps
...python/Products/PythonScripts/tests/tscripts/fibonacci.ps
+6
-0
lib/python/Products/PythonScripts/tests/tscripts/for_loop.ps
lib/python/Products/PythonScripts/tests/tscripts/for_loop.ps
+4
-0
lib/python/Products/PythonScripts/tests/tscripts/mutate_literals.ps
.../Products/PythonScripts/tests/tscripts/mutate_literals.ps
+14
-0
lib/python/Products/PythonScripts/tests/tscripts/tuple_unpack_assignment.ps
...s/PythonScripts/tests/tscripts/tuple_unpack_assignment.ps
+3
-0
lib/python/Products/PythonScripts/tests/tscripts/while_loop.ps
...ython/Products/PythonScripts/tests/tscripts/while_loop.ps
+4
-0
lib/python/Products/PythonScripts/zbytecodehacks/VSExec.py
lib/python/Products/PythonScripts/zbytecodehacks/VSExec.py
+13
-9
lib/python/Products/PythonScripts/zbytecodehacks/opbases.py
lib/python/Products/PythonScripts/zbytecodehacks/opbases.py
+2
-1
lib/python/Products/PythonScripts/zbytecodehacks/ops.py
lib/python/Products/PythonScripts/zbytecodehacks/ops.py
+46
-41
No files found.
lib/python/Products/PythonScripts/PythonScript.py
View file @
11186505
...
@@ -89,7 +89,7 @@ This product provides support for Script objects containing restricted
...
@@ -89,7 +89,7 @@ This product provides support for Script objects containing restricted
Python code.
Python code.
"""
"""
__version__
=
'$Revision: 1.2
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
4
$'
[
11
:
-
2
]
import
sys
,
os
,
traceback
,
re
import
sys
,
os
,
traceback
,
re
from
Globals
import
DTMLFile
,
MessageDialog
from
Globals
import
DTMLFile
,
MessageDialog
...
@@ -145,10 +145,16 @@ class PythonScript(Script, Historical, Cacheable):
...
@@ -145,10 +145,16 @@ class PythonScript(Script, Historical, Cacheable):
_params
=
_body
=
''
_params
=
_body
=
''
manage_options
=
(
manage_options
=
(
{
'label'
:
'Edit'
,
'action'
:
'ZPythonScriptHTML_editForm'
},
{
'label'
:
'Edit'
,
'action'
:
'ZPythonScriptHTML_editForm'
,
'help'
:
(
'PythonScripts'
,
'PythonScript_edit.stx'
)},
)
+
BindingsUI
.
manage_options
+
(
)
+
BindingsUI
.
manage_options
+
(
{
'label'
:
'Test'
,
'action'
:
'ZScriptHTML_tryForm'
},
{
'label'
:
'Test'
,
{
'label'
:
'Proxy'
,
'action'
:
'manage_proxyForm'
},
'action'
:
'ZScriptHTML_tryForm'
,
'help'
:
(
'PythonScripts'
,
'PythonScript_test.stx'
)},
{
'label'
:
'Proxy'
,
'action'
:
'manage_proxyForm'
,
'help'
:
(
'OFSP'
,
'DTML-DocumentOrMethod_Proxy.stx'
)},
)
+
Historical
.
manage_options
+
SimpleItem
.
manage_options
+
\
)
+
Historical
.
manage_options
+
SimpleItem
.
manage_options
+
\
Cacheable
.
manage_options
Cacheable
.
manage_options
...
...
lib/python/Products/PythonScripts/tests/testPythonScript.py
0 → 100644
View file @
11186505
##############################################################################
#
# Zope Public License (ZPL) Version 1.0
# -------------------------------------
#
# Copyright (c) Digital Creations. All rights reserved.
#
# This license has been certified as Open Source(tm).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions in source code must retain the above copyright
# notice, this list of conditions, and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions, and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# 3. Digital Creations requests that attribution be given to Zope
# in any manner possible. Zope includes a "Powered by Zope"
# button that is installed by default. While it is not a license
# violation to remove this button, it is requested that the
# attribution remain. A significant investment has been put
# into Zope, and this effort will continue if the Zope community
# continues to grow. This is one way to assure that growth.
#
# 4. All advertising materials and documentation mentioning
# features derived from or use of this software must display
# the following acknowledgement:
#
# "This product includes software developed by Digital Creations
# for use in the Z Object Publishing Environment
# (http://www.zope.org/)."
#
# In the event that the product being advertised includes an
# intact Zope distribution (with copyright and license included)
# then this clause is waived.
#
# 5. Names associated with Zope or Digital Creations must not be used to
# endorse or promote products derived from this software without
# prior written permission from Digital Creations.
#
# 6. Modified redistributions of any form whatsoever must retain
# the following acknowledgment:
#
# "This product includes software developed by Digital Creations
# for use in the Z Object Publishing Environment
# (http://www.zope.org/)."
#
# Intact (re-)distributions of any official Zope release do not
# require an external acknowledgement.
#
# 7. Modifications are encouraged but must be packaged separately as
# patches to official Zope releases. Distributions that do not
# clearly separate the patches from the original work must be clearly
# labeled as unofficial distributions. Modifications which do not
# carry the name Zope may be packaged in any form, as long as they
# conform to all of the clauses above.
#
#
# Disclaimer
#
# THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY
# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DIGITAL CREATIONS OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#
# This software consists of contributions made by Digital Creations and
# many individuals on behalf of Digital Creations. Specific
# attributions are listed in the accompanying credits file.
#
##############################################################################
import
sys
try
:
sys
.
path
.
insert
(
0
,
'.'
)
import
ZODB
except
:
sys
.
path
.
insert
(
0
,
'../../..'
)
import
ZODB
from
Products.PythonScripts.PythonScript
import
PythonScript
from
AccessControl.SecurityManagement
import
newSecurityManager
newSecurityManager
(
None
,
None
)
from
unittest
import
TestCase
,
TestSuite
,
VerboseTextTestRunner
,
makeSuite
TextTestRunner
=
VerboseTextTestRunner
# Test Classes
def
readf
(
name
):
return
open
(
'tscripts/%s%s'
%
(
name
,
'.ps'
),
'r'
).
read
()
class
TestPythonScriptNoAq
(
TestCase
):
def
_newPS
(
self
,
txt
):
ps
=
PythonScript
(
'ps'
)
ps
.
ZBindings_edit
({})
ps
.
write
(
txt
)
ps
.
_makeFunction
(
1
)
return
ps
def
testEmpty
(
self
):
empty
=
self
.
_newPS
(
''
)()
assert
empty
is
None
,
empty
def
testReturn
(
self
):
return1
=
self
.
_newPS
(
'return 1'
)()
assert
return1
==
1
,
return1
def
testReturnNone
(
self
):
none
=
self
.
_newPS
(
'return'
)()
assert
none
==
None
def
testParam1
(
self
):
txt
=
self
.
_newPS
(
'##parameters=x
\
n
return x'
)(
'txt'
)
assert
txt
==
'txt'
,
txt
def
testParam2
(
self
):
one
,
two
=
self
.
_newPS
(
'##parameters=x,y
\
n
return x,y'
)(
'one'
,
'two'
)
assert
one
==
'one'
assert
two
==
'two'
def
testParam26
(
self
):
import
string
params
=
string
.
letters
[:
26
]
sparams
=
string
.
join
(
params
,
','
)
tup
=
apply
(
self
.
_newPS
(
'##parameters=%s
\
n
return %s'
%
(
sparams
,
sparams
)),
params
)
assert
tup
==
tuple
(
params
),
(
tup
,
params
)
def
testArithmetic
(
self
):
one
=
self
.
_newPS
(
'return 1 * 5 + 4 / 2 - 6'
)()
assert
one
==
1
,
one
def
testImport
(
self
):
a
,
b
,
c
=
self
.
_newPS
(
'import string; return string.split("a b c")'
)()
assert
a
==
'a'
assert
b
==
'b'
assert
c
==
'c'
def
testWhileLoop
(
self
):
one
=
self
.
_newPS
(
readf
(
'while_loop'
))()
assert
one
==
1
def
testForLoop
(
self
):
ten
=
self
.
_newPS
(
readf
(
'for_loop'
))()
assert
ten
==
10
def
testMutateLiterals
(
self
):
l
,
d
=
self
.
_newPS
(
readf
(
'mutate_literals'
))()
assert
l
==
[
2
],
l
assert
d
==
{
'b'
:
2
}
def
testTupleUnpackAssignment
(
self
):
d
,
x
=
self
.
_newPS
(
readf
(
'tuple_unpack_assignment'
))()
assert
d
==
{
'a'
:
0
,
'b'
:
1
,
'c'
:
2
},
d
assert
x
==
3
,
x
def
testDoubleNegation
(
self
):
one
=
self
.
_newPS
(
'return not not "this"'
)()
assert
one
==
1
def
testTryExcept
(
self
):
a
,
b
=
self
.
_newPS
(
readf
(
'try_except'
))()
assert
a
==
1
assert
b
==
1
def
testBigBoolean
(
self
):
true
=
self
.
_newPS
(
readf
(
'big_boolean'
))()
assert
true
,
true
def
testFibonacci
(
self
):
r
=
self
.
_newPS
(
readf
(
'fibonacci'
))()
assert
r
==
[
1
,
1
,
2
,
3
,
5
,
8
,
13
,
21
,
34
,
55
,
89
,
144
,
233
,
377
,
610
,
987
,
1597
,
2584
,
4181
,
6765
,
10946
,
17711
,
28657
,
46368
,
75025
,
121393
,
196418
,
317811
,
514229
,
832040
,
1346269
,
2178309
,
3524578
,
5702887
,
9227465
,
14930352
,
24157817
,
39088169
,
63245986
],
r
test_classes
=
(
TestPythonScriptNoAq
,)
# unit test machinery
def
test_suite
():
ts
=
[]
for
tclass
in
test_classes
:
ts
.
append
(
makeSuite
(
tclass
,
'test'
))
return
TestSuite
(
tuple
(
ts
))
def
main
():
alltests
=
test_suite
()
runner
=
TextTestRunner
()
runner
.
run
(
alltests
)
def
debug
():
test_suite
().
debug
()
if
__name__
==
'__main__'
:
if
len
(
sys
.
argv
)
>
1
:
globals
()[
sys
.
argv
[
1
]]()
else
:
main
()
lib/python/Products/PythonScripts/tests/tscripts/big_boolean.ps
0 → 100644
View file @
11186505
mab = {'a': 1, 'b': 2}
r10 = range(10)
return r10[3:5][1] == 4 and r10[mab['b']] and 1 < mab['ab'[r10[1]]] < 3
lib/python/Products/PythonScripts/tests/tscripts/fibonacci.ps
0 → 100644
View file @
11186505
l = []
a, b = 0, 1
while b < 100000000:
l.append(b)
a, b = b, a+b
return l
lib/python/Products/PythonScripts/tests/tscripts/for_loop.ps
0 → 100644
View file @
11186505
a = 0
for x in range(10):
a = a + 1
return a
lib/python/Products/PythonScripts/tests/tscripts/mutate_literals.ps
0 → 100644
View file @
11186505
l1 = [1, 2, 3]
l2 = [l1[0], l1[1]]
l2.extend(l1)
l2.append(4)
del l2[:2]
del l2[0]
l2[-2:] = []
d = {'a': 1, 'b': l2[0]}
d['a'] = 0
del d['a']
return l2, d
lib/python/Products/PythonScripts/tests/tscripts/tuple_unpack_assignment.ps
0 → 100644
View file @
11186505
d = {}
(d['a'], d['b'], d['c'], x) = range(4)
return d, x
lib/python/Products/PythonScripts/tests/tscripts/while_loop.ps
0 → 100644
View file @
11186505
a = 0
while a < 10:
a = a + 1
return 1
lib/python/Products/PythonScripts/zbytecodehacks/VSExec.py
View file @
11186505
...
@@ -110,15 +110,18 @@ class Munge_window:
...
@@ -110,15 +110,18 @@ class Munge_window:
if
not
stack
:
if
not
stack
:
self
.
last_empty_stack
=
op
self
.
last_empty_stack
=
op
def
after_code_for
(
self
,
stack_idx
):
def
after_code_for
(
self
,
stack_idx
,
separt
=
1
):
stack
=
self
.
stack
stack
=
self
.
stack
if
stack_idx
<
0
and
len
(
stack
)
+
stack_idx
<
0
:
if
stack_idx
<
0
and
len
(
stack
)
+
stack_idx
<
0
:
whichop
=
self
.
last_empty_stack
whichop
=
self
.
last_empty_stack
if
whichop
is
None
:
if
whichop
is
None
:
return
0
return
0
else
:
else
:
whichop
=
stack
[
stack_idx
]
whichop
=
stack
[
stack_idx
][
separt
]
return
self
.
code
.
index
(
whichop
)
+
1
return
self
.
code
.
index
(
whichop
)
+
separt
def
before_code_for
(
self
,
stack_idx
):
return
self
.
after_code_for
(
stack_idx
,
separt
=
0
)
def
assert_stack_size
(
self
,
size
,
ctxt
):
def
assert_stack_size
(
self
,
size
,
ctxt
):
if
self
.
use_stack
and
len
(
self
.
stack
)
!=
size
:
if
self
.
use_stack
and
len
(
self
.
stack
)
!=
size
:
...
@@ -287,7 +290,7 @@ class Printing:
...
@@ -287,7 +290,7 @@ class Printing:
def
PRINT_ITEM
(
self
,
w
):
def
PRINT_ITEM
(
self
,
w
):
# Load the printing function before the code for the operand.
# Load the printing function before the code for the operand.
w
.
insert_code
(
self
.
print_prep
,
w
.
after_code_for
(
-
2
))
w
.
insert_code
(
self
.
print_prep
,
w
.
before_code_for
(
-
1
))
w
.
assert_stack_size
(
1
,
"at a 'print' statement"
)
w
.
assert_stack_size
(
1
,
"at a 'print' statement"
)
# Instead of printing, call our function and discard the result.
# Instead of printing, call our function and discard the result.
w
.
set_code
(
1
,
self
.
call_print2
)
w
.
set_code
(
1
,
self
.
call_print2
)
...
@@ -357,16 +360,17 @@ class AllowMapBuild:
...
@@ -357,16 +360,17 @@ class AllowMapBuild:
def
__init__
(
self
,
cb
,
w
,
fc
):
def
__init__
(
self
,
cb
,
w
,
fc
):
pass
pass
def
STORE_SUBSCR
(
self
,
w
):
def
STORE_SUBSCR
(
self
,
w
):
if
isinstance
(
w
.
stack
[
-
2
],
ops
.
BUILD_MAP
):
if
(
isinstance
(
w
.
stack
[
-
2
][
0
],
ops
.
DUP_TOP
)
and
isinstance
(
w
.
stack
[
-
4
][
0
],
ops
.
BUILD_MAP
)):
w
.
do_op
()
w
.
do_op
()
return
1
return
1
def
_get_call
(
w
):
def
_get_call
(
w
):
load_guard
=
((
ops
.
LOAD_FAST
,
ops
.
LOAD_ATTR
),
((
'$guard'
,),
(
guard
,)))
load_guard
=
((
ops
.
LOAD_FAST
,
ops
.
LOAD_ATTR
),
((
'$guard'
,),
(
guard
,)))
# Load the binary guard function before its parameters are computed.
# Load the binary guard function before its parameters are computed.
iops
=
w
.
insert_code
(
load_guard
,
w
.
after_code_for
(
-
3
))
iops
=
w
.
insert_code
(
load_guard
,
w
.
before_code_for
(
-
2
))
# Fix the execution stack to refer to the loaded function.
# Fix the execution stack to refer to the loaded function.
if
w
.
use_stack
:
w
.
stack
[
-
2
:
-
2
]
=
iops
[
1
:
]
if
w
.
use_stack
:
w
.
stack
[
-
2
:
-
2
]
=
[(
iops
[
0
],
iops
[
1
])
]
# Call guard function instead of performing binary op
# Call guard function instead of performing binary op
w
.
set_code
(
1
,
cf2
)
w
.
set_code
(
1
,
cf2
)
return
1
return
1
...
@@ -413,13 +417,13 @@ def GuardedBinaryOps(guards):
...
@@ -413,13 +417,13 @@ def GuardedBinaryOps(guards):
def
_wrap
(
w
):
def
_wrap
(
w
):
load_guard
=
((
ops
.
LOAD_FAST
,),
((
guard
,),))
load_guard
=
((
ops
.
LOAD_FAST
,),
((
guard
,),))
# Load the guard function before the guarded object, call after.
# Load the guard function before the guarded object, call after.
w
.
insert_code
(
load_guard
,
w
.
after_code_for
(
spos
-
1
))
w
.
insert_code
(
load_guard
,
w
.
before_code_for
(
spos
))
if
spos
==
0
:
if
spos
==
0
:
w
.
set_code
(
0
,
cf1
)
w
.
set_code
(
0
,
cf1
)
else
:
else
:
iops
=
w
.
insert_code
(
cf1
,
w
.
after_code_for
(
spos
))
iops
=
w
.
insert_code
(
cf1
,
w
.
after_code_for
(
spos
))
# Fix the execution stack.
# Fix the execution stack.
if
w
.
use_stack
:
w
.
stack
[
spos
]
=
iops
[
0
]
if
w
.
use_stack
:
w
.
stack
[
spos
]
=
(
w
.
stack
[
spos
][
0
],
iops
[
0
])
def
_WriteGuardWrapper
():
def
_WriteGuardWrapper
():
def
model_handler
(
self
,
*
args
):
def
model_handler
(
self
,
*
args
):
...
...
lib/python/Products/PythonScripts/zbytecodehacks/opbases.py
View file @
11186505
...
@@ -2,7 +2,8 @@ import struct,dis,new
...
@@ -2,7 +2,8 @@ import struct,dis,new
from
label
import
Label
from
label
import
Label
class
ByteCode
:
class
ByteCode
:
pass
def
consume
(
self
,
stack
,
n
):
stack
[
-
n
:]
=
[(
stack
[
-
n
][
0
],
self
)]
class
GenericOneByteCode
(
ByteCode
):
class
GenericOneByteCode
(
ByteCode
):
def
__init__
(
self
,
cs
,
code
):
def
__init__
(
self
,
cs
,
code
):
...
...
lib/python/Products/PythonScripts/zbytecodehacks/ops.py
View file @
11186505
...
@@ -72,7 +72,7 @@ class DUP_TOP(_opbases.GenericOneByteCode):
...
@@ -72,7 +72,7 @@ class DUP_TOP(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
stack
.
append
(
stack
[
-
1
]
)
stack
.
append
(
(
self
,
self
)
)
_bytecodes
[
DUP_TOP
.
opc
]
=
DUP_TOP
_bytecodes
[
DUP_TOP
.
opc
]
=
DUP_TOP
...
@@ -84,7 +84,7 @@ class UNARY_POSITIVE(_opbases.GenericOneByteCode):
...
@@ -84,7 +84,7 @@ class UNARY_POSITIVE(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
1
:]
=
[
self
]
s
elf
.
consume
(
stack
,
1
)
_bytecodes
[
UNARY_POSITIVE
.
opc
]
=
UNARY_POSITIVE
_bytecodes
[
UNARY_POSITIVE
.
opc
]
=
UNARY_POSITIVE
...
@@ -96,7 +96,7 @@ class UNARY_NEGATIVE(_opbases.GenericOneByteCode):
...
@@ -96,7 +96,7 @@ class UNARY_NEGATIVE(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
1
:]
=
[
self
]
s
elf
.
consume
(
stack
,
1
)
_bytecodes
[
UNARY_NEGATIVE
.
opc
]
=
UNARY_NEGATIVE
_bytecodes
[
UNARY_NEGATIVE
.
opc
]
=
UNARY_NEGATIVE
...
@@ -108,7 +108,7 @@ class UNARY_NOT(_opbases.GenericOneByteCode):
...
@@ -108,7 +108,7 @@ class UNARY_NOT(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
1
:]
=
[
self
]
s
elf
.
consume
(
stack
,
1
)
_bytecodes
[
UNARY_NOT
.
opc
]
=
UNARY_NOT
_bytecodes
[
UNARY_NOT
.
opc
]
=
UNARY_NOT
...
@@ -120,7 +120,7 @@ class UNARY_CONVERT(_opbases.GenericOneByteCode):
...
@@ -120,7 +120,7 @@ class UNARY_CONVERT(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
1
:]
=
[
self
]
s
elf
.
consume
(
stack
,
1
)
_bytecodes
[
UNARY_CONVERT
.
opc
]
=
UNARY_CONVERT
_bytecodes
[
UNARY_CONVERT
.
opc
]
=
UNARY_CONVERT
...
@@ -132,7 +132,7 @@ class UNARY_INVERT(_opbases.GenericOneByteCode):
...
@@ -132,7 +132,7 @@ class UNARY_INVERT(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
1
:]
=
[
self
]
s
elf
.
consume
(
stack
,
1
)
_bytecodes
[
UNARY_INVERT
.
opc
]
=
UNARY_INVERT
_bytecodes
[
UNARY_INVERT
.
opc
]
=
UNARY_INVERT
...
@@ -144,7 +144,7 @@ class BINARY_POWER(_opbases.GenericOneByteCode):
...
@@ -144,7 +144,7 @@ class BINARY_POWER(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
2
:]
=
[
self
]
s
elf
.
consume
(
stack
,
2
)
_bytecodes
[
BINARY_POWER
.
opc
]
=
BINARY_POWER
_bytecodes
[
BINARY_POWER
.
opc
]
=
BINARY_POWER
...
@@ -156,7 +156,7 @@ class BINARY_MULTIPLY(_opbases.GenericOneByteCode):
...
@@ -156,7 +156,7 @@ class BINARY_MULTIPLY(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
2
:]
=
[
self
]
s
elf
.
consume
(
stack
,
2
)
_bytecodes
[
BINARY_MULTIPLY
.
opc
]
=
BINARY_MULTIPLY
_bytecodes
[
BINARY_MULTIPLY
.
opc
]
=
BINARY_MULTIPLY
...
@@ -168,7 +168,7 @@ class BINARY_DIVIDE(_opbases.GenericOneByteCode):
...
@@ -168,7 +168,7 @@ class BINARY_DIVIDE(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
2
:]
=
[
self
]
s
elf
.
consume
(
stack
,
2
)
_bytecodes
[
BINARY_DIVIDE
.
opc
]
=
BINARY_DIVIDE
_bytecodes
[
BINARY_DIVIDE
.
opc
]
=
BINARY_DIVIDE
...
@@ -180,7 +180,7 @@ class BINARY_MODULO(_opbases.GenericOneByteCode):
...
@@ -180,7 +180,7 @@ class BINARY_MODULO(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
2
:]
=
[
self
]
s
elf
.
consume
(
stack
,
2
)
_bytecodes
[
BINARY_MODULO
.
opc
]
=
BINARY_MODULO
_bytecodes
[
BINARY_MODULO
.
opc
]
=
BINARY_MODULO
...
@@ -192,7 +192,7 @@ class BINARY_ADD(_opbases.GenericOneByteCode):
...
@@ -192,7 +192,7 @@ class BINARY_ADD(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
2
:]
=
[
self
]
s
elf
.
consume
(
stack
,
2
)
_bytecodes
[
BINARY_ADD
.
opc
]
=
BINARY_ADD
_bytecodes
[
BINARY_ADD
.
opc
]
=
BINARY_ADD
...
@@ -204,7 +204,7 @@ class BINARY_SUBTRACT(_opbases.GenericOneByteCode):
...
@@ -204,7 +204,7 @@ class BINARY_SUBTRACT(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
2
:]
=
[
self
]
s
elf
.
consume
(
stack
,
2
)
_bytecodes
[
BINARY_SUBTRACT
.
opc
]
=
BINARY_SUBTRACT
_bytecodes
[
BINARY_SUBTRACT
.
opc
]
=
BINARY_SUBTRACT
...
@@ -216,7 +216,7 @@ class BINARY_SUBSCR(_opbases.GenericOneByteCode):
...
@@ -216,7 +216,7 @@ class BINARY_SUBSCR(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
2
:]
=
[
self
]
s
elf
.
consume
(
stack
,
2
)
_bytecodes
[
BINARY_SUBSCR
.
opc
]
=
BINARY_SUBSCR
_bytecodes
[
BINARY_SUBSCR
.
opc
]
=
BINARY_SUBSCR
...
@@ -228,7 +228,7 @@ class SLICE_0(_opbases.GenericOneByteCode):
...
@@ -228,7 +228,7 @@ class SLICE_0(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
1
:]
=
[
self
]
s
elf
.
consume
(
stack
,
1
)
_bytecodes
[
SLICE_0
.
opc
]
=
SLICE_0
_bytecodes
[
SLICE_0
.
opc
]
=
SLICE_0
...
@@ -240,7 +240,7 @@ class SLICE_1(_opbases.GenericOneByteCode):
...
@@ -240,7 +240,7 @@ class SLICE_1(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
2
:]
=
[
self
]
s
elf
.
consume
(
stack
,
2
)
_bytecodes
[
SLICE_1
.
opc
]
=
SLICE_1
_bytecodes
[
SLICE_1
.
opc
]
=
SLICE_1
...
@@ -252,7 +252,7 @@ class SLICE_2(_opbases.GenericOneByteCode):
...
@@ -252,7 +252,7 @@ class SLICE_2(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
2
:]
=
[
self
]
s
elf
.
consume
(
stack
,
2
)
_bytecodes
[
SLICE_2
.
opc
]
=
SLICE_2
_bytecodes
[
SLICE_2
.
opc
]
=
SLICE_2
...
@@ -264,7 +264,7 @@ class SLICE_3(_opbases.GenericOneByteCode):
...
@@ -264,7 +264,7 @@ class SLICE_3(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
3
:]
=
[
self
]
s
elf
.
consume
(
stack
,
3
)
_bytecodes
[
SLICE_3
.
opc
]
=
SLICE_3
_bytecodes
[
SLICE_3
.
opc
]
=
SLICE_3
...
@@ -396,7 +396,7 @@ class BINARY_LSHIFT(_opbases.GenericOneByteCode):
...
@@ -396,7 +396,7 @@ class BINARY_LSHIFT(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
2
:]
=
[
self
]
s
elf
.
consume
(
stack
,
2
)
_bytecodes
[
BINARY_LSHIFT
.
opc
]
=
BINARY_LSHIFT
_bytecodes
[
BINARY_LSHIFT
.
opc
]
=
BINARY_LSHIFT
...
@@ -408,7 +408,7 @@ class BINARY_RSHIFT(_opbases.GenericOneByteCode):
...
@@ -408,7 +408,7 @@ class BINARY_RSHIFT(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
2
:]
=
[
self
]
s
elf
.
consume
(
stack
,
2
)
_bytecodes
[
BINARY_RSHIFT
.
opc
]
=
BINARY_RSHIFT
_bytecodes
[
BINARY_RSHIFT
.
opc
]
=
BINARY_RSHIFT
...
@@ -420,7 +420,8 @@ class BINARY_AND(_opbases.GenericOneByteCode):
...
@@ -420,7 +420,8 @@ class BINARY_AND(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
stack
[
-
2
:]
=
[
self
]
self
.
consume
(
stack
,
2
)
_bytecodes
[
BINARY_AND
.
opc
]
=
BINARY_AND
_bytecodes
[
BINARY_AND
.
opc
]
=
BINARY_AND
...
@@ -432,7 +433,8 @@ class BINARY_XOR(_opbases.GenericOneByteCode):
...
@@ -432,7 +433,8 @@ class BINARY_XOR(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
stack
[
-
2
:]
=
[
self
]
self
.
consume
(
stack
,
2
)
_bytecodes
[
BINARY_XOR
.
opc
]
=
BINARY_XOR
_bytecodes
[
BINARY_XOR
.
opc
]
=
BINARY_XOR
...
@@ -444,7 +446,8 @@ class BINARY_OR(_opbases.GenericOneByteCode):
...
@@ -444,7 +446,8 @@ class BINARY_OR(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
stack
[
-
2
:]
=
[
self
]
self
.
consume
(
stack
,
2
)
_bytecodes
[
BINARY_OR
.
opc
]
=
BINARY_OR
_bytecodes
[
BINARY_OR
.
opc
]
=
BINARY_OR
...
@@ -504,7 +507,7 @@ class LOAD_LOCALS(_opbases.GenericOneByteCode):
...
@@ -504,7 +507,7 @@ class LOAD_LOCALS(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
stack
.
append
(
self
)
stack
.
append
(
(
self
,
self
)
)
_bytecodes
[
LOAD_LOCALS
.
opc
]
=
LOAD_LOCALS
_bytecodes
[
LOAD_LOCALS
.
opc
]
=
LOAD_LOCALS
...
@@ -564,7 +567,7 @@ class BUILD_CLASS(_opbases.GenericOneByteCode):
...
@@ -564,7 +567,7 @@ class BUILD_CLASS(_opbases.GenericOneByteCode):
if
cs
is
not
None
:
if
cs
is
not
None
:
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
_opbases
.
GenericOneByteCode
.
__init__
(
self
,
cs
,
code
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
3
:]
=
[
self
]
s
elf
.
consume
(
stack
,
3
)
_bytecodes
[
BUILD_CLASS
.
opc
]
=
BUILD_CLASS
_bytecodes
[
BUILD_CLASS
.
opc
]
=
BUILD_CLASS
...
@@ -606,7 +609,8 @@ class UNPACK_TUPLE(_opbases.GenericThreeByteCode):
...
@@ -606,7 +609,8 @@ class UNPACK_TUPLE(_opbases.GenericThreeByteCode):
else
:
else
:
self
.
user_init
(
csorarg
)
self
.
user_init
(
csorarg
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
stack
.
append
([
self
]
*
self
.
arg
)
op
=
stack
.
pop
()[
0
]
stack
.
extend
([(
op
,
self
)]
*
self
.
arg
)
_bytecodes
[
UNPACK_TUPLE
.
opc
]
=
UNPACK_TUPLE
_bytecodes
[
UNPACK_TUPLE
.
opc
]
=
UNPACK_TUPLE
...
@@ -620,7 +624,8 @@ class UNPACK_LIST(_opbases.GenericThreeByteCode):
...
@@ -620,7 +624,8 @@ class UNPACK_LIST(_opbases.GenericThreeByteCode):
else
:
else
:
self
.
user_init
(
csorarg
)
self
.
user_init
(
csorarg
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
stack
.
append
([
self
]
*
self
.
arg
)
op
=
stack
.
pop
()[
0
]
stack
.
extend
([(
op
,
self
)]
*
self
.
arg
)
_bytecodes
[
UNPACK_LIST
.
opc
]
=
UNPACK_LIST
_bytecodes
[
UNPACK_LIST
.
opc
]
=
UNPACK_LIST
...
@@ -690,7 +695,7 @@ class LOAD_CONST(_opbases.GenericThreeByteCode):
...
@@ -690,7 +695,7 @@ class LOAD_CONST(_opbases.GenericThreeByteCode):
else
:
else
:
self
.
user_init
(
csorarg
)
self
.
user_init
(
csorarg
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
stack
.
append
(
self
)
stack
.
append
(
(
self
,
self
)
)
_bytecodes
[
LOAD_CONST
.
opc
]
=
LOAD_CONST
_bytecodes
[
LOAD_CONST
.
opc
]
=
LOAD_CONST
...
@@ -704,7 +709,7 @@ class LOAD_NAME(_opbases.NameOpcode):
...
@@ -704,7 +709,7 @@ class LOAD_NAME(_opbases.NameOpcode):
else
:
else
:
self
.
user_init
(
csorarg
)
self
.
user_init
(
csorarg
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
stack
.
append
(
self
)
stack
.
append
(
(
self
,
self
)
)
_bytecodes
[
LOAD_NAME
.
opc
]
=
LOAD_NAME
_bytecodes
[
LOAD_NAME
.
opc
]
=
LOAD_NAME
...
@@ -719,9 +724,9 @@ class BUILD_TUPLE(_opbases.GenericThreeByteCode):
...
@@ -719,9 +724,9 @@ class BUILD_TUPLE(_opbases.GenericThreeByteCode):
self
.
user_init
(
csorarg
)
self
.
user_init
(
csorarg
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
if
self
.
arg
>
0
:
if
self
.
arg
>
0
:
s
tack
[
-
self
.
arg
:]
=
[
self
]
s
elf
.
consume
(
stack
,
self
.
arg
)
else
:
else
:
stack
.
append
(
self
)
stack
.
append
(
(
self
,
self
)
)
_bytecodes
[
BUILD_TUPLE
.
opc
]
=
BUILD_TUPLE
_bytecodes
[
BUILD_TUPLE
.
opc
]
=
BUILD_TUPLE
...
@@ -736,9 +741,9 @@ class BUILD_LIST(_opbases.GenericThreeByteCode):
...
@@ -736,9 +741,9 @@ class BUILD_LIST(_opbases.GenericThreeByteCode):
self
.
user_init
(
csorarg
)
self
.
user_init
(
csorarg
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
if
self
.
arg
>
0
:
if
self
.
arg
>
0
:
s
tack
[
-
self
.
arg
:]
=
[
self
]
s
elf
.
consume
(
stack
,
self
.
arg
)
else
:
else
:
stack
.
append
(
self
)
stack
.
append
(
(
self
,
self
)
)
_bytecodes
[
BUILD_LIST
.
opc
]
=
BUILD_LIST
_bytecodes
[
BUILD_LIST
.
opc
]
=
BUILD_LIST
...
@@ -752,7 +757,7 @@ class BUILD_MAP(_opbases.GenericThreeByteCode):
...
@@ -752,7 +757,7 @@ class BUILD_MAP(_opbases.GenericThreeByteCode):
else
:
else
:
self
.
user_init
(
csorarg
)
self
.
user_init
(
csorarg
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
stack
.
append
(
self
)
stack
.
append
(
(
self
,
self
)
)
_bytecodes
[
BUILD_MAP
.
opc
]
=
BUILD_MAP
_bytecodes
[
BUILD_MAP
.
opc
]
=
BUILD_MAP
...
@@ -766,7 +771,7 @@ class LOAD_ATTR(_opbases.NameOpcode):
...
@@ -766,7 +771,7 @@ class LOAD_ATTR(_opbases.NameOpcode):
else
:
else
:
self
.
user_init
(
csorarg
)
self
.
user_init
(
csorarg
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
1
]
=
self
s
elf
.
consume
(
stack
,
1
)
_bytecodes
[
LOAD_ATTR
.
opc
]
=
LOAD_ATTR
_bytecodes
[
LOAD_ATTR
.
opc
]
=
LOAD_ATTR
...
@@ -780,7 +785,7 @@ class COMPARE_OP(_opbases.GenericThreeByteCode):
...
@@ -780,7 +785,7 @@ class COMPARE_OP(_opbases.GenericThreeByteCode):
else
:
else
:
self
.
user_init
(
csorarg
)
self
.
user_init
(
csorarg
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
2
:]
=
[
self
]
# ????
s
elf
.
consume
(
stack
,
2
)
# ????
_bytecodes
[
COMPARE_OP
.
opc
]
=
COMPARE_OP
_bytecodes
[
COMPARE_OP
.
opc
]
=
COMPARE_OP
...
@@ -794,7 +799,7 @@ class IMPORT_NAME(_opbases.NameOpcode):
...
@@ -794,7 +799,7 @@ class IMPORT_NAME(_opbases.NameOpcode):
else
:
else
:
self
.
user_init
(
csorarg
)
self
.
user_init
(
csorarg
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
stack
.
append
(
self
)
stack
.
append
(
(
self
,
self
)
)
_bytecodes
[
IMPORT_NAME
.
opc
]
=
IMPORT_NAME
_bytecodes
[
IMPORT_NAME
.
opc
]
=
IMPORT_NAME
...
@@ -912,7 +917,7 @@ class LOAD_GLOBAL(_opbases.NameOpcode):
...
@@ -912,7 +917,7 @@ class LOAD_GLOBAL(_opbases.NameOpcode):
else
:
else
:
self
.
user_init
(
csorarg
)
self
.
user_init
(
csorarg
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
stack
.
append
(
self
)
stack
.
append
(
(
self
,
self
)
)
_bytecodes
[
LOAD_GLOBAL
.
opc
]
=
LOAD_GLOBAL
_bytecodes
[
LOAD_GLOBAL
.
opc
]
=
LOAD_GLOBAL
...
@@ -980,7 +985,7 @@ class LOAD_FAST(_opbases.LocalOpcode):
...
@@ -980,7 +985,7 @@ class LOAD_FAST(_opbases.LocalOpcode):
else
:
else
:
self
.
user_init
(
csorarg
)
self
.
user_init
(
csorarg
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
stack
.
append
(
self
)
stack
.
append
(
(
self
,
self
)
)
_bytecodes
[
LOAD_FAST
.
opc
]
=
LOAD_FAST
_bytecodes
[
LOAD_FAST
.
opc
]
=
LOAD_FAST
...
@@ -1052,7 +1057,7 @@ class CALL_FUNCTION(_opbases.GenericThreeByteCode):
...
@@ -1052,7 +1057,7 @@ class CALL_FUNCTION(_opbases.GenericThreeByteCode):
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
num_keyword_args
=
self
.
arg
>>
8
num_keyword_args
=
self
.
arg
>>
8
num_regular_args
=
self
.
arg
&
0xFF
num_regular_args
=
self
.
arg
&
0xFF
s
tack
[
-
2
*
num_keyword_args
-
num_regular_args
-
1
:]
=
[
self
]
s
elf
.
consume
(
stack
,
2
*
num_keyword_args
+
num_regular_args
+
1
)
_bytecodes
[
CALL_FUNCTION
.
opc
]
=
CALL_FUNCTION
_bytecodes
[
CALL_FUNCTION
.
opc
]
=
CALL_FUNCTION
...
@@ -1066,7 +1071,7 @@ class MAKE_FUNCTION(_opbases.GenericThreeByteCode):
...
@@ -1066,7 +1071,7 @@ class MAKE_FUNCTION(_opbases.GenericThreeByteCode):
else
:
else
:
self
.
user_init
(
csorarg
)
self
.
user_init
(
csorarg
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
self
.
arg
-
1
:]
=
[
self
]
s
elf
.
consume
(
stack
,
self
.
arg
+
1
)
_bytecodes
[
MAKE_FUNCTION
.
opc
]
=
MAKE_FUNCTION
_bytecodes
[
MAKE_FUNCTION
.
opc
]
=
MAKE_FUNCTION
...
@@ -1080,7 +1085,7 @@ class BUILD_SLICE(_opbases.GenericThreeByteCode):
...
@@ -1080,7 +1085,7 @@ class BUILD_SLICE(_opbases.GenericThreeByteCode):
else
:
else
:
self
.
user_init
(
csorarg
)
self
.
user_init
(
csorarg
)
def
execute
(
self
,
stack
):
def
execute
(
self
,
stack
):
s
tack
[
-
self
.
arg
:]
=
[
self
]
s
elf
.
consume
(
stack
,
self
.
arg
)
_bytecodes
[
BUILD_SLICE
.
opc
]
=
BUILD_SLICE
_bytecodes
[
BUILD_SLICE
.
opc
]
=
BUILD_SLICE
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment