OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 // Called from RegExp if the backtrack stack limit is hit. | 198 // Called from RegExp if the backtrack stack limit is hit. |
199 // Tries to expand the stack. Returns the new stack-pointer if | 199 // Tries to expand the stack. Returns the new stack-pointer if |
200 // successful, and updates the stack_top address, or returns 0 if unable | 200 // successful, and updates the stack_top address, or returns 0 if unable |
201 // to grow the stack. | 201 // to grow the stack. |
202 // This function must not trigger a garbage collection. | 202 // This function must not trigger a garbage collection. |
203 static Address GrowStack(Address stack_pointer, Address* stack_top); | 203 static Address GrowStack(Address stack_pointer, Address* stack_top); |
204 | 204 |
205 static const byte* StringCharacterPosition(String* subject, int start_index); | 205 static const byte* StringCharacterPosition(String* subject, int start_index); |
206 | 206 |
| 207 // Byte map of ASCII characters with a 0xff if the character is a word |
| 208 // character (digit, letter or underscore) and 0x00 otherwise. |
| 209 // Used by generated RegExp code. |
| 210 static byte word_character_map[128]; |
| 211 |
| 212 static Address word_character_map_address() { |
| 213 return &word_character_map[0]; |
| 214 } |
| 215 |
207 static Result Execute(Code* code, | 216 static Result Execute(Code* code, |
208 String* input, | 217 String* input, |
209 int start_offset, | 218 int start_offset, |
210 const byte* input_start, | 219 const byte* input_start, |
211 const byte* input_end, | 220 const byte* input_end, |
212 int* output, | 221 int* output, |
213 bool at_start); | 222 bool at_start); |
214 }; | 223 }; |
215 | 224 |
216 #endif // V8_NATIVE_REGEXP | 225 #endif // V8_NATIVE_REGEXP |
217 | 226 |
218 } } // namespace v8::internal | 227 } } // namespace v8::internal |
219 | 228 |
220 #endif // V8_REGEXP_MACRO_ASSEMBLER_H_ | 229 #endif // V8_REGEXP_MACRO_ASSEMBLER_H_ |
OLD | NEW |