Commit 66308504 authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

Add use counters for IsRegExp

A spec change to simplify IsRegExp has been proposed:

https://github.com/tc39/ecma262/pull/1318

This CL adds use counters for cases in which the spec change would
alter behavior:

1. o[@@match] is trueish but o is not a JSRegExp
2. o[@@match] is falseish (but not undefined) and o is a JSRegExp

This is the Chromium side of required changes.
The V8-side CL: https://crrev.com/c/1360630

Bug: v8:8522
Change-Id: I2ec9b1a5f54f8e70a02e48f280a548871990aabd
Reviewed-on: https://chromium-review.googlesource.com/c/1360730Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarMarja Hölttä <marja@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615507}
parent 573be063
...@@ -2088,6 +2088,8 @@ enum WebFeature { ...@@ -2088,6 +2088,8 @@ enum WebFeature {
kCSSSelectorNotWithPartiallyValidList = 2647, kCSSSelectorNotWithPartiallyValidList = 2647,
kV8IDBFactory_Databases_Method = 2648, kV8IDBFactory_Databases_Method = 2648,
kOpenerNavigationDownloadCrossOriginNoGesture = 2649, kOpenerNavigationDownloadCrossOriginNoGesture = 2649,
kV8RegExpMatchIsTrueishOnNonJSRegExp = 2650,
kV8RegExpMatchIsFalseishOnJSRegExp = 2651,
// Add new features immediately above this line. Don't change assigned // Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots. // numbers of any item, and don't reuse removed slots.
......
...@@ -217,6 +217,12 @@ void UseCounterCallback(v8::Isolate* isolate, ...@@ -217,6 +217,12 @@ void UseCounterCallback(v8::Isolate* isolate,
case v8::Isolate::kOptimizedFunctionWithOneShotBytecode: case v8::Isolate::kOptimizedFunctionWithOneShotBytecode:
blink_feature = WebFeature::kV8OptimizedFunctionWithOneShotBytecode; blink_feature = WebFeature::kV8OptimizedFunctionWithOneShotBytecode;
break; break;
case v8::Isolate::kRegExpMatchIsTrueishOnNonJSRegExp:
blink_feature = WebFeature::kV8RegExpMatchIsTrueishOnNonJSRegExp;
break;
case v8::Isolate::kRegExpMatchIsFalseishOnJSRegExp:
blink_feature = WebFeature::kV8RegExpMatchIsFalseishOnJSRegExp;
break;
default: default:
// This can happen if V8 has added counters that this version of Blink // This can happen if V8 has added counters that this version of Blink
// does not know about. It's harmless. // does not know about. It's harmless.
......
...@@ -20997,6 +20997,8 @@ Called by update_net_error_codes.py.--> ...@@ -20997,6 +20997,8 @@ Called by update_net_error_codes.py.-->
<int value="2647" label="CSSSelectorNotWithPartiallyValidList"/> <int value="2647" label="CSSSelectorNotWithPartiallyValidList"/>
<int value="2648" label="V8IDBFactory_Databases_Method"/> <int value="2648" label="V8IDBFactory_Databases_Method"/>
<int value="2649" label="OpenerNavigationDownloadCrossOriginNoGesture"/> <int value="2649" label="OpenerNavigationDownloadCrossOriginNoGesture"/>
<int value="2650" label="V8RegExpMatchIsTrueishOnNonJSRegExp"/>
<int value="2651" label="V8RegExpMatchIsFalseishOnJSRegExp"/>
</enum> </enum>
<enum name="FeaturePolicyFeature"> <enum name="FeaturePolicyFeature">
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment