Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 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 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 // Return whether the matching (with a global regexp) will be restarted. | 177 // Return whether the matching (with a global regexp) will be restarted. |
| 178 virtual bool Succeed() = 0; | 178 virtual bool Succeed() = 0; |
| 179 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset) = 0; | 179 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset) = 0; |
| 180 virtual void ClearRegisters(int reg_from, int reg_to) = 0; | 180 virtual void ClearRegisters(int reg_from, int reg_to) = 0; |
| 181 virtual void WriteStackPointerToRegister(int reg) = 0; | 181 virtual void WriteStackPointerToRegister(int reg) = 0; |
| 182 | 182 |
| 183 // Controls the generation of large inlined constants in the code. | 183 // Controls the generation of large inlined constants in the code. |
| 184 void set_slow_safe(bool ssc) { slow_safe_compiler_ = ssc; } | 184 void set_slow_safe(bool ssc) { slow_safe_compiler_ = ssc; } |
| 185 bool slow_safe() { return slow_safe_compiler_; } | 185 bool slow_safe() { return slow_safe_compiler_; } |
| 186 | 186 |
| 187 enum GlobalFlag { NOT_GLOBAL, GLOBAL, GLOBAL_NO_ZERO_LENGTH_MATCH }; | |
|
Erik Corry
2012/06/04 08:00:11
I think GlobalMode would be better than GlobalFlag
| |
| 187 // Set whether the regular expression has the global flag. Exiting due to | 188 // Set whether the regular expression has the global flag. Exiting due to |
| 188 // a failure in a global regexp may still mean success overall. | 189 // a failure in a global regexp may still mean success overall. |
| 189 void set_global(bool global) { global_ = global; } | 190 inline void set_global_flag(GlobalFlag flag) { global_flag_ = flag; } |
| 190 bool global() { return global_; } | 191 inline bool global() { return global_flag_ != NOT_GLOBAL; } |
| 192 inline bool global_with_zero_length_match() { | |
|
Erik Corry
2012/06/04 08:00:11
global_with_zero_length_check()
| |
| 193 return global_flag_ == GLOBAL; | |
| 194 } | |
| 191 | 195 |
| 192 private: | 196 private: |
| 193 bool slow_safe_compiler_; | 197 bool slow_safe_compiler_; |
| 194 bool global_; | 198 bool global_flag_; |
| 195 }; | 199 }; |
| 196 | 200 |
| 197 | 201 |
| 198 #ifndef V8_INTERPRETED_REGEXP // Avoid compiling unused code. | 202 #ifndef V8_INTERPRETED_REGEXP // Avoid compiling unused code. |
| 199 | 203 |
| 200 class NativeRegExpMacroAssembler: public RegExpMacroAssembler { | 204 class NativeRegExpMacroAssembler: public RegExpMacroAssembler { |
| 201 public: | 205 public: |
| 202 // Type of input string to generate code for. | 206 // Type of input string to generate code for. |
| 203 enum Mode { ASCII = 1, UC16 = 2 }; | 207 enum Mode { ASCII = 1, UC16 = 2 }; |
| 204 | 208 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 258 int* output, | 262 int* output, |
| 259 int output_size, | 263 int output_size, |
| 260 Isolate* isolate); | 264 Isolate* isolate); |
| 261 }; | 265 }; |
| 262 | 266 |
| 263 #endif // V8_INTERPRETED_REGEXP | 267 #endif // V8_INTERPRETED_REGEXP |
| 264 | 268 |
| 265 } } // namespace v8::internal | 269 } } // namespace v8::internal |
| 266 | 270 |
| 267 #endif // V8_REGEXP_MACRO_ASSEMBLER_H_ | 271 #endif // V8_REGEXP_MACRO_ASSEMBLER_H_ |
| OLD | NEW |