[Subversion] / BytecodeAssembler / peak / util / assembler.py  

Log of /BytecodeAssembler/peak/util/assembler.py

Parent Directory

No default branch
Bookmark a link to HEAD: (view) (download) (as text)


Revision 2782 - (view) (download) (as text) - [select for diffs]
Modified Wed Feb 22 16:11:55 2017 UTC (7 years, 2 months ago) by pje
File length: 40371 byte(s)
Diff to previous 2778 , to selected 2632
Fix BUILD_CLASS stack calculation

Revision 2778 - (view) (download) (as text) - [select for diffs]
Modified Mon Apr 13 19:21:57 2015 UTC (9 years ago) by pje
File length: 40371 byte(s)
Diff to previous 2768 , to selected 2632
Export ord (Forgot to check this one in)

Revision 2768 - (view) (download) (as text) - [select for diffs]
Modified Thu Apr 9 17:40:32 2015 UTC (9 years ago) by pje
File length: 40358 byte(s)
Diff to previous 2756 , to selected 2632
Add 3.x slice support; fix misc. shallow test failures

Revision 2756 - (view) (download) (as text) - [select for diffs]
Modified Sat Apr 4 22:31:28 2015 UTC (9 years, 1 month ago) by pje
File length: 40025 byte(s)
Diff to previous 2754 , to selected 2632
Move POP_EXCEPT earlier so TryExcept can be an expression

Revision 2754 - (view) (download) (as text) - [select for diffs]
Modified Sat Apr 4 21:02:59 2015 UTC (9 years, 1 month ago) by pje
File length: 40023 byte(s)
Diff to previous 2753 , to selected 2632
Fix TryExcept() for Python 3+

Revision 2753 - (view) (download) (as text) - [select for diffs]
Modified Sat Apr 4 18:18:03 2015 UTC (9 years, 1 month ago) by pje
File length: 39750 byte(s)
Diff to previous 2745 , to selected 2632
Emulate DUP_TOPX(2) on Python 3; fix bytes warning

Revision 2745 - (view) (download) (as text) - [select for diffs]
Modified Sat Apr 4 05:58:18 2015 UTC (9 years, 1 month ago) by pje
File length: 39445 byte(s)
Diff to previous 2738 , to selected 2632
BINARY_DIVIDE and UNARY_CONVERT for Python 3

Revision 2738 - (view) (download) (as text) - [select for diffs]
Modified Sat Apr 4 03:16:09 2015 UTC (9 years, 1 month ago) by pje
File length: 39449 byte(s)
Diff to previous 2733 , to selected 2632
Provide BINARY_DIVIDE and UNARY_CONVERT polyfills for Python 3

Revision 2733 - (view) (download) (as text) - [select for diffs]
Modified Sat Apr 4 00:53:52 2015 UTC (9 years, 1 month ago) by pje
File length: 39142 byte(s)
Diff to previous 2632
Experimental Python 3 support (3.1/3.2 test failures are shallow)

Revision 2632 - (view) (download) (as text) - [selected]
Modified Mon Aug 2 19:36:55 2010 UTC (13 years, 9 months ago) by pje
File length: 38568 byte(s)
Diff to previous 2630
Make tests pass even with -O or -OO

Revision 2630 - (view) (download) (as text) - [select for diffs]
Modified Mon Aug 2 19:27:33 2010 UTC (13 years, 9 months ago) by pje
File length: 38532 byte(s)
Diff to previous 2628 , to selected 2632
Full 2.7 support!

Revision 2628 - (view) (download) (as text) - [select for diffs]
Modified Mon Aug 2 18:31:16 2010 UTC (13 years, 9 months ago) by pje
File length: 38389 byte(s)
Diff to previous 2627 , to selected 2632
Clean tests!

Revision 2627 - (view) (download) (as text) - [select for diffs]
Modified Mon Aug 2 18:16:27 2010 UTC (13 years, 9 months ago) by pje
File length: 38337 byte(s)
Diff to previous 2626 , to selected 2632
Smooth over dump differences between 2.6 and 2.7

Revision 2626 - (view) (download) (as text) - [select for diffs]
Modified Mon Aug 2 17:56:52 2010 UTC (13 years, 9 months ago) by pje
File length: 37891 byte(s)
Diff to previous 2622 , to selected 2632
Switch to symbolic disassembly, so we can mask 2.6/2.7 differences.

Revision 2622 - (view) (download) (as text) - [select for diffs]
Modified Mon Aug 2 07:32:33 2010 UTC (13 years, 9 months ago) by pje
File length: 35605 byte(s)
Diff to previous 2621 , to selected 2632
Grody hack for LIST_APPEND in 2.7; this really needs better handling,
but first I want the tests to pass...

Revision 2621 - (view) (download) (as text) - [select for diffs]
Modified Mon Aug 2 07:15:25 2010 UTC (13 years, 9 months ago) by pje
File length: 35331 byte(s)
Diff to previous 2619 , to selected 2632
Return labels from simulated jumps

Revision 2619 - (view) (download) (as text) - [select for diffs]
Modified Mon Aug 2 06:57:15 2010 UTC (13 years, 9 months ago) by pje
File length: 35259 byte(s)
Diff to previous 2575 , to selected 2632
Quick draft at a hack to support old JUMP_IF opcodes on Python 2.7, and 
to support the JUMP_IF_*_OR_POP opcodes on older Pythons.  Still needs 
some work to support the OR_POP variants on 2.7, though, and some test 
adjustments for both BytecodeAssembler and PEAK-Rules

Revision 2575 - (view) (download) (as text) - [select for diffs]
Modified Tue Aug 12 18:09:37 2008 UTC (15 years, 8 months ago) by pje
File length: 34259 byte(s)
Diff to previous 2573 , to selected 2632
Fix incorrect stack size calculation for ``MAKE_CLOSURE`` on Python 2.5+

Revision 2573 - (view) (download) (as text) - [select for diffs]
Modified Mon Aug 4 22:17:03 2008 UTC (15 years, 9 months ago) by pje
File length: 34205 byte(s)
Diff to previous 2571 , to selected 2632
Fix broken closure-building on Python 2.4/2.3

Revision 2571 - (view) (download) (as text) - [select for diffs]
Modified Mon Aug 4 21:47:49 2008 UTC (15 years, 9 months ago) by pje
File length: 34171 byte(s)
Diff to previous 2472 , to selected 2632
Add ListComp, LCAppend, If, Function, For, UnpackSequence,
LocalAssign, YieldStmt, nested scopes, Code.from_spec(),
and more.  See README for details. 

Revision 2472 - (view) (download) (as text) - [select for diffs]
Modified Sun Jan 6 15:28:56 2008 UTC (16 years, 4 months ago) by pje
File length: 26913 byte(s)
Diff to previous 2459 , to selected 2632
Give generated methods names (for easier debugging)

Revision 2459 - (view) (download) (as text) - [select for diffs]
Modified Sun Dec 30 20:58:03 2007 UTC (16 years, 4 months ago) by pje
File length: 26552 byte(s)
Diff to previous 2457 , to selected 2632
Fix stack level tracking for "try" block of try/except:
the POP_BLOCK *always* resets the stack to its original
size, so the stack level prior to the POP_BLOCK must be
ignored.

Revision 2457 - (view) (download) (as text) - [select for diffs]
Modified Sun Dec 30 20:10:36 2007 UTC (16 years, 4 months ago) by pje
File length: 26571 byte(s)
Diff to previous 2453 , to selected 2632
Added TryFinally, TryExcept, Suite, and made Suite([])
return Pass.  Documented Pass.

Revision 2453 - (view) (download) (as text) - [select for diffs]
Modified Sat Dec 29 19:29:57 2007 UTC (16 years, 4 months ago) by pje
File length: 25277 byte(s)
Diff to previous 2451 , to selected 2632
Cleanup wide-address jumps to allow code size>64K, as long
as the jump target is known.  Forward jumps are limited to
jumping over a maximum span of 64K bytes.  (This was always
true, but bad code could be generated before, whereas now
an assertion error is raised if the maximum span is exceeded.)

Revision 2451 - (view) (download) (as text) - [select for diffs]
Modified Sat Dec 29 18:38:07 2007 UTC (16 years, 4 months ago) by pje
File length: 24885 byte(s)
Diff to previous 2234 , to selected 2632
Add Getattr() node type, fix co_filename bug in
Code.from_function().

Revision 2234 - (view) (download) (as text) - [select for diffs]
Modified Sun Sep 3 19:31:05 2006 UTC (17 years, 8 months ago) by pje
File length: 24572 byte(s)
Diff to previous 2232 , to selected 2632
Added ``And`` and ``Or`` node types.

Revision 2232 - (view) (download) (as text) - [select for diffs]
Modified Sun Sep 3 18:23:09 2006 UTC (17 years, 8 months ago) by pje
File length: 23436 byte(s)
Diff to previous 2231 , to selected 2632
Make ``Pass`` a false value.

Revision 2231 - (view) (download) (as text) - [select for diffs]
Modified Sun Sep 3 17:56:29 2006 UTC (17 years, 8 months ago) by pje
File length: 23390 byte(s)
Diff to previous 2230 , to selected 2632
Added ``Pass`` and ``Compare`` node types, and ``COMPARE_OP`` can now 
take an operator name instead of a number.

Revision 2230 - (view) (download) (as text) - [select for diffs]
Modified Sun Sep 3 15:57:44 2006 UTC (17 years, 8 months ago) by pje
File length: 22336 byte(s)
Diff to previous 2209 , to selected 2632
Nix trailing ',' from repr() of nodes.

Revision 2209 - (view) (download) (as text) - [select for diffs]
Modified Wed Jul 5 05:46:10 2006 UTC (17 years, 10 months ago) by pje
File length: 22251 byte(s)
Diff to previous 2208 , to selected 2632
All node types now descend from a ``Node`` base type.  Updated TODO.

Revision 2208 - (view) (download) (as text) - [select for diffs]
Modified Wed Jul 5 02:56:05 2006 UTC (17 years, 10 months ago) by pje
File length: 22163 byte(s)
Diff to previous 2205 , to selected 2632
Constant handling has been fixed so that it doesn't confuse equal values of
differing types (e.g. ``1.0`` and ``True``), or equal unhashable objects
(e.g. two empty lists).

Removed ``nil`, ``ast_curry()`` and ``folding_curry()``, replacing them with
the ``nodetype()`` decorator and ``fold_args()``; please see the docs for
more details.

DecoratorTools is required now also.

Revision 2205 - (view) (download) (as text) - [select for diffs]
Modified Tue Jul 4 22:21:25 2006 UTC (17 years, 10 months ago) by pje
File length: 20517 byte(s)
Diff to previous 2198 , to selected 2632
Added stack tracking across jumps, globally verifying stack level prediction
consistency and rejecting dead code.  It should now be impossible to 
generate unreachable code or code with inconsistent stack levels.

Revision 2198 - (view) (download) (as text) - [select for diffs]
Modified Tue Jun 20 01:34:07 2006 UTC (17 years, 10 months ago) by pje
File length: 18876 byte(s)
Diff to previous 2194 , to selected 2632
Simplify constant folding by using partial evaluation.  This makes it 
trivial to do simple constant folding for new node types and ensures 
that the results are consistent with the code that would've been 
generated in the non-folded cases.

Revision 2194 - (view) (download) (as text) - [select for diffs]
Modified Sat Jun 17 06:19:20 2006 UTC (17 years, 10 months ago) by pje
File length: 18869 byte(s)
Diff to previous 2193 , to selected 2632
Bump version to 0.1, update readme, minor cleanup.

Revision 2193 - (view) (download) (as text) - [select for diffs]
Modified Sat Jun 17 04:44:52 2006 UTC (17 years, 10 months ago) by pje
File length: 18826 byte(s)
Diff to previous 2191 , to selected 2632
Move docs and tests to README.txt.

Revision 2191 - (view) (download) (as text) - [select for diffs]
Modified Sat Jun 17 04:37:36 2006 UTC (17 years, 10 months ago) by pje
File length: 19025 byte(s)
Diff to previous 2190 , to selected 2632
Major update: lots of docs, block support, loops, break, continue,
exception handling, pseudo-"switch" statement demo, .label() renamed to 
.here(), constant folding, const_value() API, NotAConstant exception.

Revision 2190 - (view) (download) (as text) - [select for diffs]
Modified Fri Jun 16 05:56:11 2006 UTC (17 years, 10 months ago) by pje
File length: 14696 byte(s)
Diff to previous 2187 , to selected 2632
Major doc upgrade and new features: Return() nodes, code() accepts 
multiple args, and forward references can be used as code generation 
targets.  Booleans are now treated as constants.  Local() vars can now 
be references to cell/free variables, and free/cell index lookup is
fixed.  ``curry()`` is now ``ast_curry()``, and handles ``None`` 
arguments by replacing them with  special ``nil`` objects, correcting 
the problem of naively using ``None`` for AST child nodes.  And the 
documentation now covers virtually all of the package's current 
functionality.

Revision 2187 - (view) (download) (as text) - [select for diffs]
Modified Thu Jun 15 06:05:27 2006 UTC (17 years, 10 months ago) by pje
File length: 13990 byte(s)
Diff to previous 2160 , to selected 2632
Refactor the high-level API: it's now .return_() instead of .Return(),
Local() has to be used to load local variables, and virtually any 
immutable type (including strings and None) can now be used for direct 
value generation.  The high-level APIs now curry themselves so that ASTs 
can be used as dictionary keys (useful for identifying common 
subexpressions, as PEAK-Rules will need to do).

Also, added lots of documentation (although there's still quite a lot 
left to write), and fixed a couple of bugs.

Revision 2160 - (view) (download) (as text) - [select for diffs]
Modified Sun May 28 22:38:22 2006 UTC (17 years, 11 months ago) by pje
File length: 13106 byte(s)
Diff to previous 2139 , to selected 2632
Code generation, function cloning, code flags support, some
work on closures.

Revision 2139 - (view) (download) (as text) - [select for diffs]
Modified Tue May 23 05:28:31 2006 UTC (17 years, 11 months ago) by pje
File length: 8719 byte(s)
Copied from: RuleDispatch/src/dispatch/assembler.py revision 2115
Diff to previous 2112 , to selected 2632
Spin off RuleDispatch's bytecode assembler into a separate project.

Filename: RuleDispatch/src/dispatch/assembler.py
Revision 2112 - (view) (download) (as text) - [select for diffs]
Modified Thu Dec 22 05:26:05 2005 UTC (18 years, 4 months ago) by pje
File length: 8545 byte(s)
Diff to previous 2111 , to selected 2632
Added jumps, labels, and backpatching forward references, all of which 
turned out to be easier to do than I expected, as long as we assume 
the total code size is <64K.  At this point, the assembler probably has 
everything it will need for doing generic function stuff, so I probably 
won't bother with any special support for loops or try: blocks, or for 
that matter nested scopes.  At some point, the <64K limit for jump 
handling may need to be fixed, though, if we ever generate big enough 
generic functions.  (Which assumes I ever manage to generate something 
useful with this module in the first place, which is not a given at
this point.)

Filename: RuleDispatch/src/dispatch/assembler.py
Revision 2111 - (view) (download) (as text) - [select for diffs]
Added Mon Dec 19 07:32:17 2005 UTC (18 years, 4 months ago) by pje
File length: 7751 byte(s)
Diff to selected 2632
Preliminary draft of an "assembler" for Python bytecode, to be used
in later code generation of generic functions.  The only features
missing at this point are jumps, block management, and nested scope
support.  Docs are also sketchy as yet, but I wanted to get a snapshot 
into source control before I stop work on it for now.  See assembler.txt 
for examples of what's implemented so far.

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

  Diffs between and
  Type of Diff should be a

Sort log by:

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help