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

Unified Diff: src/js/regexp.js

Issue 2370733003: [regexp] Don't cache exec method in Regexp.proto[@@split] (Closed)
Patch Set: Rebase Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5351.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/regexp.js
diff --git a/src/js/regexp.js b/src/js/regexp.js
index 396b694ea65a35a03292a2a0d964690297121397..266d6b6c529e62a4a31a034982f77c28f3b0ff32 100644
--- a/src/js/regexp.js
+++ b/src/js/regexp.js
@@ -344,9 +344,8 @@ function RegExpSubclassSplit(string, limit) {
// TODO(adamk): this fast path is wrong as we doesn't ensure that 'exec'
// is actually a data property on RegExp.prototype.
- var exec;
if (IS_REGEXP(this) && constructor === GlobalRegExp) {
- exec = this.exec;
+ var exec = this.exec;
if (exec === RegExpExecJS) {
return %_Call(RegExpSplit, this, string, limit);
}
@@ -371,9 +370,7 @@ function RegExpSubclassSplit(string, limit) {
var stringIndex = prevStringIndex;
while (stringIndex < size) {
splitter.lastIndex = stringIndex;
- result = RegExpSubclassExec(splitter, string, exec);
- // Ensure exec will be read again on the next loop through.
- exec = UNDEFINED;
+ result = RegExpSubclassExec(splitter, string);
if (IS_NULL(result)) {
stringIndex += AdvanceStringIndex(string, stringIndex, unicode);
} else {
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5351.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698