Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(894)

Side by Side Diff: src/regexp-macro-assembler-irregexp.h

Issue 9854020: RegExp: Add support for table-based character class (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2008-2009 the V8 project authors. All rights reserved. 1 // Copyright 2008-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 virtual void CheckAtStart(Label* on_at_start); 86 virtual void CheckAtStart(Label* on_at_start);
87 virtual void CheckNotAtStart(Label* on_not_at_start); 87 virtual void CheckNotAtStart(Label* on_not_at_start);
88 virtual void CheckNotCharacter(unsigned c, Label* on_not_equal); 88 virtual void CheckNotCharacter(unsigned c, Label* on_not_equal);
89 virtual void CheckNotCharacterAfterAnd(unsigned c, 89 virtual void CheckNotCharacterAfterAnd(unsigned c,
90 unsigned mask, 90 unsigned mask,
91 Label* on_not_equal); 91 Label* on_not_equal);
92 virtual void CheckNotCharacterAfterMinusAnd(uc16 c, 92 virtual void CheckNotCharacterAfterMinusAnd(uc16 c,
93 uc16 minus, 93 uc16 minus,
94 uc16 mask, 94 uc16 mask,
95 Label* on_not_equal); 95 Label* on_not_equal);
96 virtual void CheckCharacterInRange(uc16 from,
97 uc16 to,
98 Label* on_in_range);
99 virtual void CheckCharacterNotInRange(uc16 from,
100 uc16 to,
101 Label* on_not_in_range);
102 virtual void CheckBitInTable(Handle<ByteArray> table, Label* on_bit_set);
96 virtual void CheckNotBackReference(int start_reg, Label* on_no_match); 103 virtual void CheckNotBackReference(int start_reg, Label* on_no_match);
97 virtual void CheckNotBackReferenceIgnoreCase(int start_reg, 104 virtual void CheckNotBackReferenceIgnoreCase(int start_reg,
98 Label* on_no_match); 105 Label* on_no_match);
99 virtual void CheckNotRegistersEqual(int reg1, int reg2, Label* on_not_equal); 106 virtual void CheckNotRegistersEqual(int reg1, int reg2, Label* on_not_equal);
100 virtual void CheckCharacters(Vector<const uc16> str, 107 virtual void CheckCharacters(Vector<const uc16> str,
101 int cp_offset, 108 int cp_offset,
102 Label* on_failure, 109 Label* on_failure,
103 bool check_end_of_string); 110 bool check_end_of_string);
104 virtual void IfRegisterLT(int register_index, int comparand, Label* if_lt); 111 virtual void IfRegisterLT(int register_index, int comparand, Label* if_lt);
105 virtual void IfRegisterGE(int register_index, int comparand, Label* if_ge); 112 virtual void IfRegisterGE(int register_index, int comparand, Label* if_ge);
106 virtual void IfRegisterEqPos(int register_index, Label* if_eq); 113 virtual void IfRegisterEqPos(int register_index, Label* if_eq);
107 114
108 virtual IrregexpImplementation Implementation(); 115 virtual IrregexpImplementation Implementation();
109 virtual Handle<HeapObject> GetCode(Handle<String> source); 116 virtual Handle<HeapObject> GetCode(Handle<String> source);
110 117
111 private: 118 private:
112 void Expand(); 119 void Expand();
113 // Code and bitmap emission. 120 // Code and bitmap emission.
114 inline void EmitOrLink(Label* label); 121 inline void EmitOrLink(Label* label);
115 inline void Emit32(uint32_t x); 122 inline void Emit32(uint32_t x);
116 inline void Emit16(uint32_t x); 123 inline void Emit16(uint32_t x);
124 inline void Emit8(uint32_t x);
117 inline void Emit(uint32_t bc, uint32_t arg); 125 inline void Emit(uint32_t bc, uint32_t arg);
118 // Bytecode buffer. 126 // Bytecode buffer.
119 int length(); 127 int length();
120 void Copy(Address a); 128 void Copy(Address a);
121 129
122 // The buffer into which code and relocation info are generated. 130 // The buffer into which code and relocation info are generated.
123 Vector<byte> buffer_; 131 Vector<byte> buffer_;
124 // The program counter. 132 // The program counter.
125 int pc_; 133 int pc_;
126 // True if the assembler owns the buffer, false if buffer is external. 134 // True if the assembler owns the buffer, false if buffer is external.
127 bool own_buffer_; 135 bool own_buffer_;
128 Label backtrack_; 136 Label backtrack_;
129 137
130 int advance_current_start_; 138 int advance_current_start_;
131 int advance_current_offset_; 139 int advance_current_offset_;
132 int advance_current_end_; 140 int advance_current_end_;
133 141
134 static const int kInvalidPC = -1; 142 static const int kInvalidPC = -1;
135 143
136 DISALLOW_IMPLICIT_CONSTRUCTORS(RegExpMacroAssemblerIrregexp); 144 DISALLOW_IMPLICIT_CONSTRUCTORS(RegExpMacroAssemblerIrregexp);
137 }; 145 };
138 146
139 #endif // V8_INTERPRETED_REGEXP 147 #endif // V8_INTERPRETED_REGEXP
140 148
141 } } // namespace v8::internal 149 } } // namespace v8::internal
142 150
143 #endif // V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_ 151 #endif // V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698