]> sourceware.org Git - systemtap.git/commit - stringtable.h
string_ref rework: use global stringtable
authorFrank Ch. Eigler <fche@redhat.com>
Wed, 5 Aug 2015 16:26:29 +0000 (12:26 -0400)
committerAbegail Jakop <ajakop@redhat.com>
Tue, 18 Aug 2015 15:02:23 +0000 (11:02 -0400)
commitaa389a190e2ad44ced2868409ea643e4baf6f8a9
tree8f347c253c03432cb3cd8523783856cb65de5359
parentac671210ea9e6382c7dab10794bf62051f9cf787
string_ref rework: use global stringtable

Returning partly to an older model of parser input processing: the
parser::input_contents goes back to a plain string, which may be
modified gradually by $/@ expansion etc.  While string_refs cannot be
made based on that, they don't need to be either, since the
input_contents is a temporary member variable and will be disposed of
when the parser dies.

So we switch back to the prior general logic of
lexer::input_{put,get,peek}, which worked OK.  To populate token
content string_refs, we use a global stringtable (a *set<string>)
against which long-lived string_refs may be issued with a new intern()
call.  The input file contents are amongst those strings interned.
(Many other repeated string uses in the translator could probably
benefit from intern/string_ref'ing, and there are optimization
opportunities within the stringtable implementation proper.)

(While en route, mass-dropped a bunch of unnecessary namespace
prefixes in some affected files.  Sorry for the diff noise.)
parse.cxx
parse.h
session.cxx
session.h
staptree.cxx
staptree.h
stringtable.cxx [new file with mode: 0644]
stringtable.h [new file with mode: 0644]
This page took 0.02785 seconds and 5 git commands to generate.