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

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

Issue 10386090: Implement loop for global regexps in regexp assembler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix bugs, add tests, port to x64 and arm. Created 8 years, 7 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 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
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 whether the regular expression has the global flag. Exiting due to
187 // a failure in a global regexp may still mean success overall.
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698