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

Side by Side Diff: src/jsregexp.cc

Issue 12406: Case independent back references. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/regexp2000/
Patch Set: Created 12 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-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 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 1467
1468 1468
1469 bool BackReferenceNode::Emit(RegExpCompiler* compiler) { 1469 bool BackReferenceNode::Emit(RegExpCompiler* compiler) {
1470 RegExpMacroAssembler* macro = compiler->macro_assembler(); 1470 RegExpMacroAssembler* macro = compiler->macro_assembler();
1471 Bind(macro); 1471 Bind(macro);
1472 // Check whether the registers are uninitialized and always 1472 // Check whether the registers are uninitialized and always
1473 // succeed if they are. 1473 // succeed if they are.
1474 macro->IfRegisterLT(start_reg_, 0, on_success()->label()); 1474 macro->IfRegisterLT(start_reg_, 0, on_success()->label());
1475 macro->IfRegisterLT(end_reg_, 0, on_success()->label()); 1475 macro->IfRegisterLT(end_reg_, 0, on_success()->label());
1476 ASSERT_EQ(start_reg_ + 1, end_reg_); 1476 ASSERT_EQ(start_reg_ + 1, end_reg_);
1477 macro->CheckNotBackReference(start_reg_, on_failure_->label()); 1477 if (!compiler->is_case_independent()) {
Christian Plesner Hansen 2008/11/25 08:18:45 Why negate the condition?
1478 macro->CheckNotBackReference(start_reg_, on_failure_->label());
1479 } else {
1480 macro->CheckNotBackReferenceCaseIndependent(start_reg_,
1481 on_failure_->label());
1482 }
1478 return on_success()->GoTo(compiler); 1483 return on_success()->GoTo(compiler);
1479 } 1484 }
1480 1485
1481 1486
1482 // ------------------------------------------------------------------- 1487 // -------------------------------------------------------------------
1483 // Dot/dotty output 1488 // Dot/dotty output
1484 1489
1485 1490
1486 #ifdef DEBUG 1491 #ifdef DEBUG
1487 1492
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
2590 byte codes[1024]; 2595 byte codes[1024];
2591 IrregexpAssembler assembler(Vector<byte>(codes, 1024)); 2596 IrregexpAssembler assembler(Vector<byte>(codes, 1024));
2592 RegExpMacroAssemblerIrregexp macro_assembler(&assembler); 2597 RegExpMacroAssemblerIrregexp macro_assembler(&assembler);
2593 return compiler.Assemble(&macro_assembler, 2598 return compiler.Assemble(&macro_assembler,
2594 node, 2599 node,
2595 input->capture_count); 2600 input->capture_count);
2596 } 2601 }
2597 2602
2598 2603
2599 }} // namespace v8::internal 2604 }} // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698