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

Side by Side Diff: src/interpreter-irregexp.cc

Issue 17409: Check for empty repetitions. (Closed)
Patch Set: Created 11 years, 11 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
OLDNEW
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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 pc += BC_CHECK_REGISTER_LT_LENGTH; 372 pc += BC_CHECK_REGISTER_LT_LENGTH;
373 } 373 }
374 break; 374 break;
375 BYTECODE(CHECK_REGISTER_GE) 375 BYTECODE(CHECK_REGISTER_GE)
376 if (registers[pc[1]] >= Load16(pc + 2)) { 376 if (registers[pc[1]] >= Load16(pc + 2)) {
377 pc = code_base + Load32(pc + 4); 377 pc = code_base + Load32(pc + 4);
378 } else { 378 } else {
379 pc += BC_CHECK_REGISTER_GE_LENGTH; 379 pc += BC_CHECK_REGISTER_GE_LENGTH;
380 } 380 }
381 break; 381 break;
382 BYTECODE(CHECK_REGISTER_EQ_POS)
383 if (registers[pc[1]] == current) {
384 pc = code_base + Load32(pc + 2);
385 } else {
386 pc += BC_CHECK_REGISTER_EQ_POS_LENGTH;
387 }
388 break;
382 BYTECODE(LOOKUP_MAP1) { 389 BYTECODE(LOOKUP_MAP1) {
383 // Look up character in a bitmap. If we find a 0, then jump to the 390 // Look up character in a bitmap. If we find a 0, then jump to the
384 // location at pc + 7. Otherwise fall through! 391 // location at pc + 7. Otherwise fall through!
385 int index = current_char - Load16(pc + 1); 392 int index = current_char - Load16(pc + 1);
386 byte map = code_base[Load32(pc + 3) + (index >> 3)]; 393 byte map = code_base[Load32(pc + 3) + (index >> 3)];
387 map = ((map >> (index & 7)) & 1); 394 map = ((map >> (index & 7)) & 1);
388 if (map == 0) { 395 if (map == 0) {
389 pc = code_base + Load32(pc + 7); 396 pc = code_base + Load32(pc + 7);
390 } else { 397 } else {
391 pc += BC_LOOKUP_MAP1_LENGTH; 398 pc += BC_LOOKUP_MAP1_LENGTH;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 if (start_position != 0) previous_char = subject_vector[start_position - 1]; 528 if (start_position != 0) previous_char = subject_vector[start_position - 1];
522 return RawMatch(code_base, 529 return RawMatch(code_base,
523 subject_vector, 530 subject_vector,
524 registers, 531 registers,
525 start_position, 532 start_position,
526 previous_char); 533 previous_char);
527 } 534 }
528 } 535 }
529 536
530 } } // namespace v8::internal 537 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/bytecodes-irregexp.h ('k') | src/jsregexp.h » ('j') | src/jsregexp.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698