| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 break; | 358 break; |
| 359 } else { | 359 } else { |
| 360 if (BackRefMatchesNoCase(from, current, len, subject)) { | 360 if (BackRefMatchesNoCase(from, current, len, subject)) { |
| 361 pc += BC_CHECK_NOT_BACK_REF_NO_CASE_LENGTH; | 361 pc += BC_CHECK_NOT_BACK_REF_NO_CASE_LENGTH; |
| 362 } else { | 362 } else { |
| 363 pc = code_base + Load32(pc + 2); | 363 pc = code_base + Load32(pc + 2); |
| 364 } | 364 } |
| 365 } | 365 } |
| 366 break; | 366 break; |
| 367 } | 367 } |
| 368 BYTECODE(CHECK_NOT_AT_START) |
| 369 if (current == 0) { |
| 370 pc += BC_CHECK_NOT_AT_START_LENGTH; |
| 371 } else { |
| 372 pc = code_base + Load32(pc + 1); |
| 373 } |
| 374 break; |
| 368 default: | 375 default: |
| 369 UNREACHABLE(); | 376 UNREACHABLE(); |
| 370 break; | 377 break; |
| 371 } | 378 } |
| 372 } | 379 } |
| 373 } | 380 } |
| 374 | 381 |
| 375 | 382 |
| 376 bool IrregexpInterpreter::Match(Handle<ByteArray> code_array, | 383 bool IrregexpInterpreter::Match(Handle<ByteArray> code_array, |
| 377 Handle<String> subject16, | 384 Handle<String> subject16, |
| 378 int* registers, | 385 int* registers, |
| 379 int start_position) { | 386 int start_position) { |
| 380 ASSERT(StringShape(*subject16).IsTwoByteRepresentation()); | 387 ASSERT(StringShape(*subject16).IsTwoByteRepresentation()); |
| 381 ASSERT(subject16->IsFlat(StringShape(*subject16))); | 388 ASSERT(subject16->IsFlat(StringShape(*subject16))); |
| 382 | 389 |
| 383 AssertNoAllocation a; | 390 AssertNoAllocation a; |
| 384 const byte* code_base = code_array->GetDataStartAddress(); | 391 const byte* code_base = code_array->GetDataStartAddress(); |
| 385 uc16 previous_char = '\n'; | 392 uc16 previous_char = '\n'; |
| 386 Vector<const uc16> subject_vector = | 393 Vector<const uc16> subject_vector = |
| 387 Vector<const uc16>(subject16->GetTwoByteData(), subject16->length()); | 394 Vector<const uc16>(subject16->GetTwoByteData(), subject16->length()); |
| 388 if (start_position != 0) previous_char = subject_vector[start_position - 1]; | 395 if (start_position != 0) previous_char = subject_vector[start_position - 1]; |
| 389 return RawMatch(code_base, | 396 return RawMatch(code_base, |
| 390 subject_vector, | 397 subject_vector, |
| 391 registers, | 398 registers, |
| 392 start_position, | 399 start_position, |
| 393 previous_char); | 400 previous_char); |
| 394 } | 401 } |
| 395 | 402 |
| 396 } } // namespace v8::internal | 403 } } // namespace v8::internal |
| OLD | NEW |