]> granicus.if.org Git - re2c/commit
Disallow accidental change of tag commands that share representation.
authorUlya Trofimovich <skvadrik@gmail.com>
Wed, 2 Nov 2016 15:31:07 +0000 (15:31 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Wed, 2 Nov 2016 15:44:49 +0000 (15:44 +0000)
commitca7db03db51f3ea2b353dd0e83c0ed40be012e6c
treeebcefcaaf59a2423c4b040a221eea6baeee4cd3d
parent0af499f6ab9808ade644653f9f8556d5d12736cd
Disallow accidental change of tag commands that share representation.

After inserting commands into common index some of them may share
representations in memory. Initially commands are stored in mutable
lists, which is very convenient for tag optimizations. However,
leaving this representation after indexing is dangerous, because
accidental modification of one command may affect other commands.

This commit hides mutable lists behind indices in hash table.
Table gives read-only access to the lists.

Table index is 32-bit, which is smaller than the previous 'index'
type (a pair of pointers). So in theory command comparison has
become a little faster.
27 files changed:
re2c/Makefile.am
re2c/src/codegen/bitmap.cc
re2c/src/codegen/emit.h
re2c/src/codegen/emit_action.cc
re2c/src/codegen/go.h
re2c/src/codegen/go_construct.cc
re2c/src/codegen/go_emit.cc
re2c/src/ir/adfa/action.h
re2c/src/ir/adfa/adfa.cc
re2c/src/ir/adfa/adfa.h
re2c/src/ir/adfa/prepare.cc
re2c/src/ir/compile.cc
re2c/src/ir/dfa/dead_rules.cc
re2c/src/ir/dfa/determinization.cc
re2c/src/ir/dfa/dfa.h
re2c/src/ir/dfa/fallback_tags.cc
re2c/src/ir/dfa/minimization.cc
re2c/src/ir/dfa/tag_indexing.cc [deleted file]
re2c/src/ir/dfa/tag_interference.cc
re2c/src/ir/dfa/tag_normalization.cc [new file with mode: 0644]
re2c/src/ir/dfa/tag_optimize.cc
re2c/src/ir/dfa/tag_optimize.h
re2c/src/ir/skeleton/skeleton.cc
re2c/src/ir/tag.cc
re2c/src/ir/tag.h
re2c/src/ir/tcmd.cc [new file with mode: 0644]
re2c/src/ir/tcmd.h [new file with mode: 0644]