OLD | NEW |
---|---|
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 virtual void SetRegister(int register_index, int to) = 0; | 176 virtual void SetRegister(int register_index, int to) = 0; |
177 virtual void Succeed() = 0; | 177 virtual void Succeed() = 0; |
178 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset) = 0; | 178 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset) = 0; |
179 virtual void ClearRegisters(int reg_from, int reg_to) = 0; | 179 virtual void ClearRegisters(int reg_from, int reg_to) = 0; |
180 virtual void WriteStackPointerToRegister(int reg) = 0; | 180 virtual void WriteStackPointerToRegister(int reg) = 0; |
181 | 181 |
182 // Controls the generation of large inlined constants in the code. | 182 // Controls the generation of large inlined constants in the code. |
183 void set_slow_safe(bool ssc) { slow_safe_compiler_ = ssc; } | 183 void set_slow_safe(bool ssc) { slow_safe_compiler_ = ssc; } |
184 bool slow_safe() { return slow_safe_compiler_; } | 184 bool slow_safe() { return slow_safe_compiler_; } |
185 | 185 |
186 // Set wether the regular expression has the global flag. Failures in a | |
Erik Corry
2012/05/11 11:01:00
A wether is a castrated billy-goat :-)
Yang
2012/05/16 14:58:47
Done. I never knew that. Learned something new tod
| |
187 // global regexp may still mean success overal. | |
Erik Corry
2012/05/11 11:01:00
overall.
Yang
2012/05/16 14:58:47
Done.
| |
188 void set_global(bool global) { global_ = global; } | |
189 bool global() { return global_; } | |
190 | |
186 private: | 191 private: |
187 bool slow_safe_compiler_; | 192 bool slow_safe_compiler_; |
193 bool global_; | |
188 }; | 194 }; |
189 | 195 |
190 | 196 |
191 #ifndef V8_INTERPRETED_REGEXP // Avoid compiling unused code. | 197 #ifndef V8_INTERPRETED_REGEXP // Avoid compiling unused code. |
192 | 198 |
193 class NativeRegExpMacroAssembler: public RegExpMacroAssembler { | 199 class NativeRegExpMacroAssembler: public RegExpMacroAssembler { |
194 public: | 200 public: |
195 // Type of input string to generate code for. | 201 // Type of input string to generate code for. |
196 enum Mode { ASCII = 1, UC16 = 2 }; | 202 enum Mode { ASCII = 1, UC16 = 2 }; |
197 | 203 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
242 static Address word_character_map_address() { | 248 static Address word_character_map_address() { |
243 return const_cast<Address>(&word_character_map[0]); | 249 return const_cast<Address>(&word_character_map[0]); |
244 } | 250 } |
245 | 251 |
246 static Result Execute(Code* code, | 252 static Result Execute(Code* code, |
247 String* input, | 253 String* input, |
248 int start_offset, | 254 int start_offset, |
249 const byte* input_start, | 255 const byte* input_start, |
250 const byte* input_end, | 256 const byte* input_end, |
251 int* output, | 257 int* output, |
258 int output_size, | |
252 Isolate* isolate); | 259 Isolate* isolate); |
253 }; | 260 }; |
254 | 261 |
255 #endif // V8_INTERPRETED_REGEXP | 262 #endif // V8_INTERPRETED_REGEXP |
256 | 263 |
257 } } // namespace v8::internal | 264 } } // namespace v8::internal |
258 | 265 |
259 #endif // V8_REGEXP_MACRO_ASSEMBLER_H_ | 266 #endif // V8_REGEXP_MACRO_ASSEMBLER_H_ |
OLD | NEW |