Home | History | Annotate | Download | only in quick

Lines Matching defs:Matcher

40 class Matcher {
43 typedef bool MatchFn(Matcher* matcher);
50 static bool Mark(Matcher* matcher);
52 template <bool (Matcher::*Fn)()>
53 static bool Required(Matcher* matcher);
55 template <bool (Matcher::*Fn)()>
56 static bool Repeated(Matcher* matcher); // On match, returns to the mark.
65 explicit Matcher(const DexFile::CodeItem* code_item)
80 bool Matcher::Match(const DexFile::CodeItem* code_item, MatchFn* const (&pattern)[size]) {
84 bool Matcher::Mark(Matcher* matcher) {
85 matcher->pos_ += 1u; // Advance to the next match function before marking.
86 matcher->mark_ = matcher->pos_;
90 template <bool (Matcher::*Fn)()>
91 bool Matcher::Required(Matcher* matcher) {
92 if (!(matcher->*Fn)()) {
95 matcher->pos_ += 1u;
96 matcher->instruction_ = matcher->instruction_->Next();
100 template <bool (Matcher::*Fn)()>
101 bool Matcher::Repeated(Matcher* matcher) {
102 if (!(matcher->*Fn)()) {
104 matcher->pos_ += 1u;
107 matcher->pos_ = matcher->mark_;
108 matcher->instruction_ = matcher->instruction_->Next();
113 bool Matcher::Opcode() {
118 bool Matcher::Const0() {
124 bool Matcher::IPutOnThis() {
130 bool Matcher::DoMatch(const DexFile::CodeItem* code_item, MatchFn* const* pattern, size_t size) {
131 Matcher matcher(code_item);
132 while (matcher.pos_ != size) {
133 if (!pattern[matcher.pos_](&matcher)) {
280 static Matcher::MatchFn* const kConstructorPattern[] = {
281 &Matcher::Mark,
282 &Matcher::Repeated<&Matcher::Const0>,
283 &Matcher::Required<&Matcher::Opcode<Instruction::INVOKE_DIRECT>>,
284 &Matcher::Mark,
285 &Matcher::Repeated<&Matcher::Const0>,
286 &Matcher::Repeated<&Matcher::IPutOnThis>,
287 &Matcher::Required<&Matcher::Opcode<Instruction::RETURN_VOID>>,
297 !Matcher::Match(code_item, kConstructorPattern)) {