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

Side by Side Diff: src/regexp-macro-assembler-irregexp.cc

Issue 3850005: Use finite-length end-anchored regexps to reduce part of regexp that is searched. (Closed)
Patch Set: Addressed review comments. Created 10 years, 2 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
« no previous file with comments | « src/regexp-macro-assembler-irregexp.h ('k') | src/regexp-macro-assembler-tracer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008-2009 the V8 project authors. All rights reserved. 1 // Copyright 2008-2009 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 139
140 void RegExpMacroAssemblerIrregexp::ReadStackPointerFromRegister( 140 void RegExpMacroAssemblerIrregexp::ReadStackPointerFromRegister(
141 int register_index) { 141 int register_index) {
142 ASSERT(register_index >= 0); 142 ASSERT(register_index >= 0);
143 ASSERT(register_index <= kMaxRegister); 143 ASSERT(register_index <= kMaxRegister);
144 Emit(BC_SET_SP_TO_REGISTER, register_index); 144 Emit(BC_SET_SP_TO_REGISTER, register_index);
145 } 145 }
146 146
147 147
148 void RegExpMacroAssemblerIrregexp::SetCurrentPositionFromEnd(int by) {
149 ASSERT(is_uint24(by));
150 Emit(BC_SET_CURRENT_POSITION_FROM_END, by);
151 }
152
153
148 void RegExpMacroAssemblerIrregexp::SetRegister(int register_index, int to) { 154 void RegExpMacroAssemblerIrregexp::SetRegister(int register_index, int to) {
149 ASSERT(register_index >= 0); 155 ASSERT(register_index >= 0);
150 ASSERT(register_index <= kMaxRegister); 156 ASSERT(register_index <= kMaxRegister);
151 Emit(BC_SET_REGISTER, register_index); 157 Emit(BC_SET_REGISTER, register_index);
152 Emit32(to); 158 Emit32(to);
153 } 159 }
154 160
155 161
156 void RegExpMacroAssemblerIrregexp::AdvanceRegister(int register_index, int by) { 162 void RegExpMacroAssemblerIrregexp::AdvanceRegister(int register_index, int by) {
157 ASSERT(register_index >= 0); 163 ASSERT(register_index >= 0);
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 own_buffer_ = true; 461 own_buffer_ = true;
456 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length()); 462 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length());
457 if (old_buffer_was_our_own) { 463 if (old_buffer_was_our_own) {
458 old_buffer.Dispose(); 464 old_buffer.Dispose();
459 } 465 }
460 } 466 }
461 467
462 #endif // V8_INTERPRETED_REGEXP 468 #endif // V8_INTERPRETED_REGEXP
463 469
464 } } // namespace v8::internal 470 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/regexp-macro-assembler-irregexp.h ('k') | src/regexp-macro-assembler-tracer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698