| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 BYTECODE(CHECK_NOT_REGS_EQUAL) | 326 BYTECODE(CHECK_NOT_REGS_EQUAL) |
| 327 if (registers[pc[1]] == registers[pc[2]]) { | 327 if (registers[pc[1]] == registers[pc[2]]) { |
| 328 pc += BC_CHECK_NOT_REGS_EQUAL_LENGTH; | 328 pc += BC_CHECK_NOT_REGS_EQUAL_LENGTH; |
| 329 } else { | 329 } else { |
| 330 pc = code_base + Load32(pc + 3); | 330 pc = code_base + Load32(pc + 3); |
| 331 } | 331 } |
| 332 break; | 332 break; |
| 333 BYTECODE(CHECK_NOT_BACK_REF) { | 333 BYTECODE(CHECK_NOT_BACK_REF) { |
| 334 int from = registers[pc[1]]; | 334 int from = registers[pc[1]]; |
| 335 int len = registers[pc[1] + 1] - from; | 335 int len = registers[pc[1] + 1] - from; |
| 336 if (from < 0 || len <= 0) { |
| 337 pc += BC_CHECK_NOT_BACK_REF_LENGTH; |
| 338 break; |
| 339 } |
| 336 if (current + len > subject.length()) { | 340 if (current + len > subject.length()) { |
| 337 pc = code_base + Load32(pc + 2); | 341 pc = code_base + Load32(pc + 2); |
| 338 break; | 342 break; |
| 339 } else { | 343 } else { |
| 340 int i; | 344 int i; |
| 341 for (i = 0; i < len; i++) { | 345 for (i = 0; i < len; i++) { |
| 342 if (subject[from + i] != subject[current + i]) { | 346 if (subject[from + i] != subject[current + i]) { |
| 343 pc = code_base + Load32(pc + 2); | 347 pc = code_base + Load32(pc + 2); |
| 344 break; | 348 break; |
| 345 } | 349 } |
| 346 } | 350 } |
| 347 if (i < len) break; | 351 if (i < len) break; |
| 348 current += len; | 352 current += len; |
| 349 } | 353 } |
| 350 pc += BC_CHECK_NOT_BACK_REF_LENGTH; | 354 pc += BC_CHECK_NOT_BACK_REF_LENGTH; |
| 351 break; | 355 break; |
| 352 } | 356 } |
| 353 BYTECODE(CHECK_NOT_BACK_REF_NO_CASE) { | 357 BYTECODE(CHECK_NOT_BACK_REF_NO_CASE) { |
| 354 int from = registers[pc[1]]; | 358 int from = registers[pc[1]]; |
| 355 int len = registers[pc[1] + 1] - from; | 359 int len = registers[pc[1] + 1] - from; |
| 360 if (from < 0 || len <= 0) { |
| 361 pc += BC_CHECK_NOT_BACK_REF_NO_CASE_LENGTH; |
| 362 break; |
| 363 } |
| 356 if (current + len > subject.length()) { | 364 if (current + len > subject.length()) { |
| 357 pc = code_base + Load32(pc + 2); | 365 pc = code_base + Load32(pc + 2); |
| 358 break; | 366 break; |
| 359 } else { | 367 } else { |
| 360 if (BackRefMatchesNoCase(from, current, len, subject)) { | 368 if (BackRefMatchesNoCase(from, current, len, subject)) { |
| 361 pc += BC_CHECK_NOT_BACK_REF_NO_CASE_LENGTH; | 369 pc += BC_CHECK_NOT_BACK_REF_NO_CASE_LENGTH; |
| 362 } else { | 370 } else { |
| 363 pc = code_base + Load32(pc + 2); | 371 pc = code_base + Load32(pc + 2); |
| 364 } | 372 } |
| 365 } | 373 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 394 Vector<const uc16>(subject16->GetTwoByteData(), subject16->length()); | 402 Vector<const uc16>(subject16->GetTwoByteData(), subject16->length()); |
| 395 if (start_position != 0) previous_char = subject_vector[start_position - 1]; | 403 if (start_position != 0) previous_char = subject_vector[start_position - 1]; |
| 396 return RawMatch(code_base, | 404 return RawMatch(code_base, |
| 397 subject_vector, | 405 subject_vector, |
| 398 registers, | 406 registers, |
| 399 start_position, | 407 start_position, |
| 400 previous_char); | 408 previous_char); |
| 401 } | 409 } |
| 402 | 410 |
| 403 } } // namespace v8::internal | 411 } } // namespace v8::internal |
| OLD | NEW |