KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/22697/root/usr/lib64/python2.4/compiler/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/22697/root/usr/lib64/python2.4/compiler/pyassem.pyc
m
=5Dc@sdZdkZdkZdkZdkZdklZdklZl	Z	l
Z
lZdfdYZdZ
dfdYZd	Zd
ZdZdZd
efdYZdZdfdYZdZdZdfdYZdfdYZeiZdS(s/A flow graph representation for Python bytecodeN(smisc(sCO_OPTIMIZEDsCO_NEWLOCALSs
CO_VARARGSsCO_VARKEYWORDSt	FlowGraphcBstZdZdZddZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZRS(NcCs[t|_|_td|_ti|_|ii|i|ii|idS(Ntexit(	tBlocktselftcurrenttentryRtmisctSettblockstadd(R((t(/usr/lib64/python2.4/compiler/pyassem.pyt__init__
s
cCsg|ioP|io7dGt|iGHdG|iiGHdG|iiGHnt|GHn||_dS(Ntends    nexts   (Rt_debugRtreprtnexttget_childrentblock(RR((R
t
startBlocks

cCs>|djo|i}n|ii||i|dS(N(RtNoneRtnewBlockRtaddNextR(RR((R
t	nextBlocks
	cCst}|ii||S(N(RtbRRR	(RR((R
R6s	cCs|i|idS(N(RRR(R((R
tstartExitBlock;sicCs
d|_dS(Ni(RR
(R((R
t
_enable_debug@scCs
d|_dS(Ni(RR
(R((R
t_disable_debugCscGs|io
dG|GHn|dddgjo|ii|int|djo,t|dto|ii|dn|ii	|dS(Ns	itRETURN_VALUEtYIELD_VALUEii(
RR
tinstRt
addOutEdgeRtlent
isinstanceRtemit(RR((R
R!Fs

'cCsxL|iiD];}||ijoqn|ip|i|iqqWt|ih}|i
|i||i|i|jo|i|in|S(slReturn the blocks in reverse postorder

        i.e. each node appears before all of its successors
        N(
RRtelementsRRRRt
dfs_postorderRtordertreverset
fixupOrdertappend(RRR$((R
tgetBlocksInOrderOs

cCs$|i|||i||dS(s"Fixup bad order introduced by DFS.N(RtfixupOrderHonorNextRtdefault_nexttfixupOrderForward(RRR*((R
R&dscCsh}x(tt|D]}||||<qWxtdt|dD]p}||}||d}	|ip(|id|jp|id|	joqKn|}g}|}
xD|
io9|
id|jo%|i|
id|
id}
qWg}x=|D]5}|||jpt|i|||fq	W|i|ix|D]\}}|||=q]W|g||||d+x(tt|D]}||||<qWqKWdS(sFix one problem with DFS.

        The DFS uses child block, but doesn't know about the special
        "next" block.  As a result, the DFS can order blocks so that a
        block isn't next to the right block for implicit control
        transfers.
        iiN(tindextrangeRRtiRtnRR*tcurtchainteltR'tltAssertionErrortsortR%tj(RRR*R,RR1R.R6R3R/R2R0((R
R)ms@
3

cCsh}g}
g}x`|D]X}t|
||<|i||io+|id|jo|
i|g}qqW|
i|x5g}xt
t|
D]}|
|}x|D]}x|i
D]}|||josd}xA|iD]6}|ddjo|d|jo
d}q%qqW|pqn|i|||fqqWqWqW|pPn|d\}	}
|
|	jpt|
|
}|
i||
i|	|qW|2x,|
D]$}x|D]}|i|qWqWdS(s(Make sure all JUMP_FORWARDs jump forwardiitJUMP_FORWARDN(R,tchainsR0RRRR'RR*tconstraintsR-R.R3Rtct	forward_ptinstsRtgoes_beforeta_chainR4tremovetinsert(RRR*R,R:RR.R3R;R=R>RR9R8R0((R
R+sZ





'

cCs
|iiS(N(RRR"(R((R
t	getBlocksscCs|iS(s/Return nodes appropriate for use with dominatorN(RR(R((R
tgetRootscCs4g}x'|iD]}|i|iqW|S(N(R3RRARtextendtgetContainedGraphs(RRR3((R
RDs

(t__name__t
__module__RRRRRRR
RRR!R(R&R)R+RARBRD(((R
Rs 													)	.		cCsbg}|||<x>|iD]0}|i|oqn|t||}qW|i||S(s;Depth-first search of tree rooted at b, return in postorderN(R$RtseenRR:thas_keyR#R'(RRGR:R$((R
R#s


RcBsztZdZddZdZdZdZdZdZd	Z	d
Z
dZdZdZ
dZRS(NitcCsYg|_ti|_ti|_||_ti|_	g|_
tidt_dS(Ni(RR<RRtinEdgestoutEdgestlabelRt_counttbidR(RRL((R
Rs			cCs1|iod|i|ifSnd|iSdS(Ns<block %s id=%d>s
<block id=%d>(RRLRN(R((R
t__repr__s
cCs2tt|i}d|i|idi|fS(Ns<block %s %d:
%s>s
(tmaptstrRR<RLRNtjoin(RR<((R
t__str__scCsG|d}|d djo|ii|dn|ii|dS(NiitJUMPi(RtopRRKR	R<R'(RRRU((R
R!s
cCs|iS(N(RR<(R((R
tgetInstructionsscCs|ii|dS(N(RRJR	R(RR((R
t	addInEdgescCs|ii|dS(N(RRKR	R(RR((R
RscCs@|ii|t|idjpttt|idS(Ni(RRR'RRR4RPRQ(RR((R
RsRt
RAISE_VARARGSRt
JUMP_ABSOLUTER7t
CONTINUE_LOOPcCsXy|id\}}Wnttfj
odSnX||ijo
g|_ndS(sLRemove bogus edge for unconditional transfers

        Each block has a next edge that accounts for implicit control
        transfers, e.g. from a JUMP_IF_FALSE to the block that will be
        executed if the test is true.

        These edges must remain for the current assembler code to
        work. If they are removed, the dfs_postorder gets things in
        weird orders.  However, they shouldn't be there for other
        purposes, e.g. conversion to SSA form.  This method will
        remove the next edge when it follows an unconditional control
        transfer.
        iN(RR<RUtargt
IndexErrort
ValueErrort_uncond_transferR(RR[RU((R
t	pruneNext	s
	cCsP|io2|id|ijo|ii|idn|ii|iS(Ni(RRRKR?R"(R((R
Rs!cCsfg}xY|iD]N}t|djoqn|d}t|do|i|iqqW|S(sReturn all graphs contained within this block.

        For example, a MAKE_FUNCTION block will contain a reference to
        the graph for the function body.
        itgraphN(	t	containedRR<RRRUthasattrR'R`(RRaRRU((R
RD#s

(sRETURN_VALUERXsYIELD_VALUERYsJUMP_FORWARDRZ(RERFRMRRORSR!RVRWRRR^R_RRD(((R
Rs										tRAWtFLATtCONVtDONEtPyFlowGraphcBsItZeiZfdddZdZdZdZdZ	dZ
dZdd	Zd
Z
dZeiZx%eiD]ZeieieqWeiZx%eiD]ZeieieqWdZd
ZdZhZdZdZeZeZdZdZ e Z!e Z"e Z#e Z$e Z%e Z&e Z'e Z(e Z)e Z*dZ+e+Z,e+Z-dZ.e/ei0Z1dZ2xFe3i4D]5\Z5Z6e5d djoe5dZe6ee<qqW[5[6[dZ7hZ8x.e9e:eiD]Z;e;e8eie;<qW[;dZ<dZ=RS(NicCs|i||_||_d|_||_t||_||_	|ottB|_
n
d|_
g|_g|_g|_g|_g|_t|pg|_xQtt|iD]:}|i|}t|to|i|i|<qqWt|_dS(Ni(Rt
super_inittnametfilenameRt	docstringtargstgetArgCounttargcounttklasst	optimizedtCO_OPTIMIZEDtCO_NEWLOCALStflagstconststnamestfreevarstcellvarstclosuretlisttvarnamesR-RR.tvarR tTupleArgtgetNameRctstage(RRiRjRlRpRoR.R{((R
R=s,
											
cCs
||_dS(N(tdocRRk(RR((R
tsetDocstring[scCs5|i|B|_|tjo|id|_ndS(Ni(RRstflagt
CO_VARARGSRn(RR((R
tsetFlag^s
cCs|i|@odSndS(Ni(RRsR(RR((R
t	checkFlagcscCst||_dS(N(RyRuRRv(RRu((R
tsetFreeVarsgscCs
||_dS(N(RuRRw(RRu((R
tsetCellVarsjscCs|itjo|i|in|itjo|in|itjo|in|it	jo|i
SntddS(sGet a Python code objectsinconsistent PyFlowGraph stateN(RR~RctcomputeStackDepthtflattenGraphRdtconvertArgsRetmakeByteCodeRft
newCodeObjecttRuntimeError(R((R
tgetCodems
cCs|oti}|t_nd}x|iD]w}|d}|djoHnt	|djodGd|G|GH|d}q-dGd|G|G|dGH|d}q-W|o
|t_ndS(Nit
SET_LINENOis	s%3di(
tiotsyststdouttsavetpcRR<tttopnameR(RRRRRR((R
tdumpzs 	



csmhd}x*iD]}t|i|<qWhdi
d_dS(sCompute the max stack depth.

        Approach is to compute the stack effect of each basic block.
        Then find the path through the code with the largest total
        effect.
        csi|o|Snd|<||}|i}|o2tg}|D]}|||qQ~Sn)|idjpi
|Sn|SdS(NiR(RGRHRtdtdepthRtchildrentmaxt_[1]R:t	max_depthRLRR(RRR:RR(RRRRG(R
Rs
2iN(RRRRRARt	findDepthRVRGRRt	stacksize(RRRRRGR((RRGRRR
Rs
cCs|itjptg|_}d}h}h}x|iD]~}|||<xa|i
D]S}|i|t
|djo|d}q`|ddjo|d}q`q`W|||<qCWd}xtt
|D]}||}t
|djo|d}n |ddjo|d}n|d}
|ii|
o,|d}|||}	|
|	f||<q|ii|
o|
||df||<qqWt|_dS(s-Arrange the blocks in order and resolve jumpsiiRiN(RR~RcR4R<RtbeginRR(RRVRR'RR-R.Rthasjrelthas_elttopargtoffsetthasjabsRd(RRRRR<RR.RRRR((R
RsB







 cCs|itjpt|iid|i|ixtt	|i
D]r}|i
|}t	|djoL|\}}|ii|d}|o ||||f|i
|<qqMqMWt|_dS(s0Convert arguments from symbolic to concrete formiiN(RR~RdR4RtR@Rkt
sort_cellvarsR-RR<R.RRRt_converterstgetRtconvRe(RRR.RRR((R
Rs

(cCsh}x|iD]}d||<qWg}|iD]!}|i|o||q2q2~|_x|iD]
}||=qiW|i|i|_|i|i|_	dS(sHSort cellvars in the order of varnames and prune from freevars.
        iN(
tcellsRRwRiRRzRHtkeysRvRx(RRRRi((R
Rs
;
cCsvt|}xJtt|D]6}|t||jo|||jo|SqqWt|}|i||S(sReturn index of name in list, appending if necessary

        This routine uses a list instead of a dictionary, because a
        dictionary can't store two different keys if the keys have the
        same value but different types, e.g. 2 and 2L.  The compiler
        must treat these two separately, so it does an explicit type
        comparison before comparing the values.
        N(	ttypeRiRR-RRyR.RR'(RRiRyRR.R((R
t_lookupNames(
cCs3t|do|i}n|i||iS(NR(RbR[RRRRt(RR[((R
t_convert_LOAD_CONSTscCs&|i||i|i||iS(N(RRR[RuRz(RR[((R
t_convert_LOAD_FASTscCs:|idjo|i||in|i||iS(N(RRoRRR[RzRu(RR[((R
t_convert_LOAD_NAME
scCs:|idjo|i||in|i||iS(N(RRoRRR[RzRu(RR[((R
t
_convert_NAMEscCs9|i||i|i||i|i||iS(N(RRR[RuRzRx(RR[((R
t_convert_DEREFscCs&|i||i|i||iS(N(RRR[RzRx(RR[((R
t_convert_LOAD_CLOSURE%scCs|ii|S(N(Rt_cmpR,R[(RR[((R
t_convert_COMPARE_OP*si	t	_convert_cCs|itjptt|_}x|iD]}|d}t	|djo|i
|i|q1|d}|djo|i
|q1nt|\}}y|i
|i|||Wq1tj
o'|G|GH|i|G|G|GHq1Xq1Wt|_dS(NiiR(RR~ReR4t
LineAddrTabletlnotabR<RRRtaddCodetopnumRtnextLinettwobytethitloR]Rf(RRRRRRR((R
R5s&




	cCs|itjpt|it@djo
d}nt|i}|i	}|it
@o|d}nti|||i
|i|ii|it|it|i|i|i|ii|iit|it|iS(Nii(RR~RfR4RsRrtnlocalsRRzRntCO_VARKEYWORDStnewtcodeRRRt	getConststtupleRuRjRit	firstlinetgetTableRvRw(RRRn((R
ROs
	cCsQg}x>|iD]3}t|to|i}n|i|qWt|S(sReturn a tuple for the const slot of the code object

        Must convert references to code (MAKE_FUNCTION) to code
        objects recursively.
        N(	R3RRtR2R RgRR'R(RR3R2((R
R_s
(>RERFRRRhRRRRRRRRRRRRRtdisR.R	RRRRRRRRt_convert_STORE_FASTt_convert_DELETE_FASTRRt_convert_STORE_NAMEt_convert_DELETE_NAMEt_convert_IMPORT_NAMEt_convert_IMPORT_FROMt_convert_STORE_ATTRt_convert_LOAD_ATTRt_convert_DELETE_ATTRt_convert_LOAD_GLOBALt_convert_STORE_GLOBALt_convert_DELETE_GLOBALRt_convert_LOAD_DEREFt_convert_STORE_DEREFRRytcmp_opRRtlocalstitemsRitobjRRR-RtnumRR(((R
Rg:sv							
		!

		
								
			cCs|d djodSndS(NiRTi(R(R((R
tisJumplsR|cBs)tZdZdZdZdZRS(s:Helper for marking func defs with nested tuples in arglistcCs||_||_dS(N(tcountRRu(RRRu((R
Rrs	cCsd|i|ifS(NsTupleArg(%s, %s)(RRRu(R((R
ROuscCsd|iS(Ns.%d(RR(R((R
R}ws(RERFt__doc__RROR}(((R
R|ps		cCsbt|}|oKxH|D]<}t|to&tti|i}||}qqWn|S(N(
RRlRnR[R R|RtflattenRutnumNames(RlRRnR[((R
RmzscCs*t|tijptt|dS(s/Convert an int argument into high and low bytesiN(RtvalttypestIntTypeR4tdivmod(R((R
RsRcBs;tZdZdZdZdZdZdZRS(s(lnotab

    This class builds the lnotab, which is documented in compile.c.
    Here's a brief recap:

    For each SET_LINENO instruction after the first one, two bytes are
    added to lnotab.  (In some cases, multiple two-byte entries are
    added.)  The first byte is the distance in bytes between the
    instruction for the last SET_LINENO and the current SET_LINENO.
    The second byte is offset in line numbers.  If either offset is
    greater than 255, multiple two-byte entries are added -- see
    compile.c for the delicate details.
    cCs:g|_d|_d|_d|_d|_g|_dS(Ni(RRt
codeOffsetRtlastlinetlastoffR(R((R
Rs					cGsAx$|D]}|iit|qW|it||_dS(N(RlR[RRR'tchrRR(RRlR[((R
RscCs|idjo||_||_n|i|i}||i}|djo|ii	}x0|djo"|d|d|d8}q_Wx6|djo(|||d|d8}d}qW|djp
|djo||||n||_|i|_ndS(Nii(RRtlinenoRRRtaddrtlineRR'tpush(RRRRR((R
Rs(	





	cCsdi|iS(NRI(RRRR(R((R
RscCsditt|iS(NRI(RRRPRRR(R((R
Rs(RERFRRRRRR(((R
Rs
			 	tStackDepthTrackercBstZddZhdd<dd<dd<dd<d	d
<dd<dd
<d
d
<dd<dd<dd
<dd
<dd<dd<dd
<dd<dd<dd<dd<dd
<dd<dd
<dd<dd<dd<d d<d!d<d"d<d#d<d$d<d%d<d&d'<d(d'<d)d<Zd*dfd+dfgZd,Zd-Zd.Zd/Zd0Z	d1Z
d2Zd3Zd4Z
d5Zd6ZRS(7NicCs#d}d}x|D]}|d}	|o|Gn|ii|	d}|dj	o||}nxC|iD]8\}}|	t| |jo|}||}PqlqlW|djo;t||	d}
|
dj	o||
|d}qn||jo
|}n|o
|G|GHqqW|S(Nii(RtmaxDepthR<R.RtdebugRteffectRRtdeltatpatternstpatt	pat_deltaRtgetattrtmeth(RR<RRR.RRRRRR((R
Rs2



	



tPOP_TOPitDUP_TOPisSLICE+1sSLICE+2sSLICE+3is
STORE_SLICE+0s
STORE_SLICE+1s
STORE_SLICE+2s
STORE_SLICE+3isDELETE_SLICE+0sDELETE_SLICE+1sDELETE_SLICE+2sDELETE_SLICE+3tSTORE_SUBSCRt
DELETE_SUBSCRt
PRINT_ITEMRRt	EXEC_STMTtBUILD_CLASSt
STORE_NAMEt
STORE_ATTRtDELETE_ATTRtSTORE_GLOBALt	BUILD_MAPt
COMPARE_OPt
STORE_FASTtIMPORT_STARtIMPORT_NAMEtIMPORT_FROMt	LOAD_ATTRtSETUP_EXCEPTit
SETUP_FINALLYtFOR_ITERtBINARY_tLOAD_cCs|dS(Ni(R(RR((R
tUNPACK_SEQUENCEscCs	|dS(Ni(R(RR((R
tBUILD_TUPLEscCs	|dS(Ni(R(RR((R
t
BUILD_LISTscCs"t|d\}}||dS(Nii(RtargcRR(RRRR((R
t
CALL_FUNCTIONscCs|i|dS(Ni(RRR(RR((R
tCALL_FUNCTION_VARscCs|i|dS(Ni(RRR(RR((R
tCALL_FUNCTION_KW!scCs|i|dS(Ni(RRR(RR((R
tCALL_FUNCTION_VAR_KW#scCs|S(N(R(RR((R
t
MAKE_FUNCTION%scCs|S(N(R(RR((R
tMAKE_CLOSURE'scCs.|djodSn|djodSndS(Niiii(R(RR((R
tBUILD_SLICE*s

cCs|S(N(R(RR((R
tDUP_TOPX/s(RERFRRRRR
RRRRRRRRR(((R
Rs9'										(RRRRRtcompilerRtcompiler.constsRqRrRRRR#RRcRdReRfRgRR|RmRRRR(ReRRR#RfRrRRqRmRRRcRRRdRRRRRgRR|RR((R
t?s,				
	Y3	
			Bh

Anon7 - 2021