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

Issue 2863643004: [regexp] Avoid runtime call on OOB lastIndex values (Closed)

Created:
3 years, 7 months ago by jgruber
Modified:
3 years, 7 months ago
Reviewers:
Jakob Kummerow
CC:
v8-reviews_googlegroups.com, Yang, Dan Ehrenberg
Target Ref:
refs/heads/master
Project:
v8
Visibility:
Public.

Description

[regexp] Avoid runtime call on OOB lastIndex values At this point, last_index is definitely a canonicalized non-negative number, which implies that any non-Smi last_index is greater than the maximal string length. That in turn means that the matcher will definitely fail, and we can avoid the expensive runtime call. BUG=v8:6365, v8:6344 Review-Url: https://codereview.chromium.org/2863643004 Cr-Commit-Position: refs/heads/master@{#45143} Committed: https://chromium.googlesource.com/v8/v8/+/2fd1afc0c8128148b74b3d9ff7b39c084c7dd90b

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add IsNumberPositive assert #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -5 lines) Patch
M src/builtins/builtins-regexp-gen.cc View 1 2 chunks +11 lines, -5 lines 0 comments Download
M src/code-stub-assembler.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/code-stub-assembler.cc View 1 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (13 generated)
jgruber
3 years, 7 months ago (2017-05-05 15:29:59 UTC) #4
Jakob Kummerow
LGTM with a nit. https://codereview.chromium.org/2863643004/diff/1/src/builtins/builtins-regexp-gen.cc File src/builtins/builtins-regexp-gen.cc (right): https://codereview.chromium.org/2863643004/diff/1/src/builtins/builtins-regexp-gen.cc#newcode252 src/builtins/builtins-regexp-gen.cc:252: CSA_ASSERT(this, IsNumber(last_index)); nit: you can ...
3 years, 7 months ago (2017-05-05 15:35:55 UTC) #6
jgruber
https://codereview.chromium.org/2863643004/diff/1/src/builtins/builtins-regexp-gen.cc File src/builtins/builtins-regexp-gen.cc (right): https://codereview.chromium.org/2863643004/diff/1/src/builtins/builtins-regexp-gen.cc#newcode252 src/builtins/builtins-regexp-gen.cc:252: CSA_ASSERT(this, IsNumber(last_index)); On 2017/05/05 15:35:55, Jakob Kummerow wrote: > ...
3 years, 7 months ago (2017-05-05 15:53:33 UTC) #11
Jakob Kummerow
lgtm
3 years, 7 months ago (2017-05-05 15:55:51 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2863643004/20001
3 years, 7 months ago (2017-05-05 16:43:12 UTC) #16
commit-bot: I haz the power
3 years, 7 months ago (2017-05-05 16:44:52 UTC) #19
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/v8/v8/+/2fd1afc0c8128148b74b3d9ff7b39c084c7...

Powered by Google App Engine
This is Rietveld 408576698