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

Unified Diff: src/js/regexp.js

Issue 2367963002: Revert of [turbofan] ChangeFloat64ToTagged shouldn't canonicalize. (Closed)
Patch Set: 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 | « src/compiler/simplified-operator.cc ('k') | src/runtime/runtime-test.cc » ('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 b3d28bab50af3f1d33398fde9ef6c98b2334df32..396b694ea65a35a03292a2a0d964690297121397 100644
--- a/src/js/regexp.js
+++ b/src/js/regexp.js
@@ -178,20 +178,11 @@
var sticky = TO_BOOLEAN(REGEXP_STICKY(this));
var updateLastIndex = global || sticky;
if (updateLastIndex) {
- // TODO(jgruber): This is actually ToLength in the spec, but we bailout
- // to the runtime in %_RegExpExec if lastIndex is not a Smi, so we are
- // smart here and trick both TurboFan and Crankshaft to produce a Smi.
- // This is a terrible hack, and correct for subtle reasons; it's a clear
- // indicator that we need a predictable RegExp implementation where we
- // don't need to add specific work-arounds for certain compiler issues.
- lastIndex = +this.lastIndex;
+ lastIndex = TO_LENGTH(this.lastIndex);
if (lastIndex > string.length) {
this.lastIndex = 0;
return null;
- } else if (lastIndex <= 0) {
- lastIndex = 0;
- }
- lastIndex = lastIndex|0;
+ }
} else {
lastIndex = 0;
}
« no previous file with comments | « src/compiler/simplified-operator.cc ('k') | src/runtime/runtime-test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698