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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 return false; | 184 return false; |
185 BYTECODE(SUCCEED) | 185 BYTECODE(SUCCEED) |
186 return true; | 186 return true; |
187 BYTECODE(ADVANCE_CP) | 187 BYTECODE(ADVANCE_CP) |
188 current += Load32(pc + 1); | 188 current += Load32(pc + 1); |
189 pc += BC_ADVANCE_CP_LENGTH; | 189 pc += BC_ADVANCE_CP_LENGTH; |
190 break; | 190 break; |
191 BYTECODE(GOTO) | 191 BYTECODE(GOTO) |
192 pc = code_base + Load32(pc + 1); | 192 pc = code_base + Load32(pc + 1); |
193 break; | 193 break; |
| 194 BYTECODE(CHECK_GREEDY) |
| 195 if (current == backtrack_sp[-1]) { |
| 196 backtrack_sp--; |
| 197 backtrack_stack_space++; |
| 198 pc = code_base + Load32(pc + 1); |
| 199 } else { |
| 200 pc += BC_CHECK_GREEDY_LENGTH; |
| 201 } |
| 202 break; |
194 BYTECODE(LOAD_CURRENT_CHAR) { | 203 BYTECODE(LOAD_CURRENT_CHAR) { |
195 int pos = current + Load32(pc + 1); | 204 int pos = current + Load32(pc + 1); |
196 if (pos >= subject.length()) { | 205 if (pos >= subject.length()) { |
197 pc = code_base + Load32(pc + 5); | 206 pc = code_base + Load32(pc + 5); |
198 } else { | 207 } else { |
199 current_char = subject[pos]; | 208 current_char = subject[pos]; |
200 pc += BC_LOAD_CURRENT_CHAR_LENGTH; | 209 pc += BC_LOAD_CURRENT_CHAR_LENGTH; |
201 } | 210 } |
202 break; | 211 break; |
203 } | 212 } |
| 213 BYTECODE(LOAD_CURRENT_CHAR_UNCHECKED) { |
| 214 int pos = current + Load32(pc + 1); |
| 215 current_char = subject[pos]; |
| 216 pc += BC_LOAD_CURRENT_CHAR_UNCHECKED_LENGTH; |
| 217 break; |
| 218 } |
204 BYTECODE(CHECK_CHAR) { | 219 BYTECODE(CHECK_CHAR) { |
205 int c = Load16(pc + 1); | 220 int c = Load16(pc + 1); |
206 if (c == current_char) { | 221 if (c == current_char) { |
207 pc = code_base + Load32(pc + 3); | 222 pc = code_base + Load32(pc + 3); |
208 } else { | 223 } else { |
209 pc += BC_CHECK_CHAR_LENGTH; | 224 pc += BC_CHECK_CHAR_LENGTH; |
210 } | 225 } |
211 break; | 226 break; |
212 } | 227 } |
213 BYTECODE(CHECK_NOT_CHAR) { | 228 BYTECODE(CHECK_NOT_CHAR) { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 Vector<const uc16>(subject16->GetTwoByteData(), subject16->length()); | 417 Vector<const uc16>(subject16->GetTwoByteData(), subject16->length()); |
403 if (start_position != 0) previous_char = subject_vector[start_position - 1]; | 418 if (start_position != 0) previous_char = subject_vector[start_position - 1]; |
404 return RawMatch(code_base, | 419 return RawMatch(code_base, |
405 subject_vector, | 420 subject_vector, |
406 registers, | 421 registers, |
407 start_position, | 422 start_position, |
408 previous_char); | 423 previous_char); |
409 } | 424 } |
410 | 425 |
411 } } // namespace v8::internal | 426 } } // namespace v8::internal |
OLD | NEW |