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

Side by Side Diff: src/jsregexp.cc

Issue 10383280: Remove unnecessary code for non-zero-length global regexps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 5883 matching lines...) Expand 10 before | Expand all | Expand 10 after
5894 5894
5895 // Inserted here, instead of in Assembler, because it depends on information 5895 // Inserted here, instead of in Assembler, because it depends on information
5896 // in the AST that isn't replicated in the Node structure. 5896 // in the AST that isn't replicated in the Node structure.
5897 static const int kMaxBacksearchLimit = 1024; 5897 static const int kMaxBacksearchLimit = 1024;
5898 if (is_end_anchored && 5898 if (is_end_anchored &&
5899 !is_start_anchored && 5899 !is_start_anchored &&
5900 max_length < kMaxBacksearchLimit) { 5900 max_length < kMaxBacksearchLimit) {
5901 macro_assembler.SetCurrentPositionFromEnd(max_length); 5901 macro_assembler.SetCurrentPositionFromEnd(max_length);
5902 } 5902 }
5903 5903
5904 macro_assembler.set_global(is_global); 5904 if (is_global) {
5905 macro_assembler.set_global_flag(
5906 (data->tree->min_match() > 0)
5907 ? RegExpMacroAssembler::GLOBAL_NO_ZERO_LENGTH_MATCH
5908 : RegExpMacroAssembler::GLOBAL);
5909 }
5905 5910
5906 return compiler.Assemble(&macro_assembler, 5911 return compiler.Assemble(&macro_assembler,
5907 node, 5912 node,
5908 data->capture_count, 5913 data->capture_count,
5909 pattern); 5914 pattern);
5910 } 5915 }
5911 5916
5912 5917
5913 }} // namespace v8::internal 5918 }} // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698