|
|
Created:
6 years, 2 months ago by Erik Corry Chromium.org Modified:
6 years, 2 months ago CC:
blink-reviews, blink-reviews-bindings_chromium.org, arv+blink Base URL:
https://chromium.googlesource.com/chromium/blink.git@master Project:
blink Visibility:
Public. |
DescriptionCollect use counter for v8BreakIterator
BUG=
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=183757
Patch Set 1 #
Total comments: 4
Patch Set 2 : Switch to callingExecutionContext #Messages
Total messages: 13 (3 generated)
erikcorry@chromium.org changed reviewers: + marja@chromium.org
Now that https://codereview.chromium.org/619913002/ has rolled into Chromium we can complete the support on the Blink side. PTAL.
lgtm
haraken@chromium.org changed reviewers: + haraken@chromium.org
https://codereview.chromium.org/639703003/diff/1/Source/bindings/core/v8/V8Pe... File Source/bindings/core/v8/V8PerIsolateData.cpp (right): https://codereview.chromium.org/639703003/diff/1/Source/bindings/core/v8/V8Pe... Source/bindings/core/v8/V8PerIsolateData.cpp:60: UseCounter::count(currentExecutionContext(isolate), UseCounter::BreakIterator); Are you sure that you want to use currentExecutionContext, not callingExecutionContext? We normally use callingExecutionContext for UseCounter::count. (To be honest, I don't think the difference matters in most cases.)
https://codereview.chromium.org/639703003/diff/1/Source/bindings/core/v8/V8Pe... File Source/bindings/core/v8/V8PerIsolateData.cpp (right): https://codereview.chromium.org/639703003/diff/1/Source/bindings/core/v8/V8Pe... Source/bindings/core/v8/V8PerIsolateData.cpp:60: UseCounter::count(currentExecutionContext(isolate), UseCounter::BreakIterator); On 2014/10/14 11:01:41, haraken wrote: > > Are you sure that you want to use currentExecutionContext, not > callingExecutionContext? We normally use callingExecutionContext for > UseCounter::count. > > (To be honest, I don't think the difference matters in most cases.) I'm doing the same as the kUseAsm counter does. I'm not sure what the difference is?
(I don't know where the difference would matter either) https://codereview.chromium.org/639703003/diff/1/Source/bindings/core/v8/V8Pe... File Source/bindings/core/v8/V8PerIsolateData.cpp (right): https://codereview.chromium.org/639703003/diff/1/Source/bindings/core/v8/V8Pe... Source/bindings/core/v8/V8PerIsolateData.cpp:60: UseCounter::count(currentExecutionContext(isolate), UseCounter::BreakIterator); On 2014/10/14 11:21:00, Erik Corry Chromium.org wrote: > On 2014/10/14 11:01:41, haraken wrote: > > > > Are you sure that you want to use currentExecutionContext, not > > callingExecutionContext? We normally use callingExecutionContext for > > UseCounter::count. > > > > (To be honest, I don't think the difference matters in most cases.) > > I'm doing the same as the kUseAsm counter does. I'm not sure what the > difference is? haraken@: ultimately both get associated to the FrameHost (we use the Context to get the Document and get the FrameHost from it); is it possible that they'd get associated to different FrameHosts?
https://codereview.chromium.org/639703003/diff/1/Source/bindings/core/v8/V8Pe... File Source/bindings/core/v8/V8PerIsolateData.cpp (right): https://codereview.chromium.org/639703003/diff/1/Source/bindings/core/v8/V8Pe... Source/bindings/core/v8/V8PerIsolateData.cpp:60: UseCounter::count(currentExecutionContext(isolate), UseCounter::BreakIterator); On 2014/10/14 11:23:20, marja wrote: > On 2014/10/14 11:21:00, Erik Corry http://Chromium.org wrote: > > On 2014/10/14 11:01:41, haraken wrote: > > > > > > Are you sure that you want to use currentExecutionContext, not > > > callingExecutionContext? We normally use callingExecutionContext for > > > UseCounter::count. > > > > > > (To be honest, I don't think the difference matters in most cases.) > > > > I'm doing the same as the kUseAsm counter does. I'm not sure what the > > difference is? > > haraken@: ultimately both get associated to the FrameHost (we use the Context to > get the Document and get the FrameHost from it); is it possible that they'd get > associated to different FrameHosts? If the current execution context is a document of an iframe and the calling execution context is a document of the iframe's parent frame, it's possible that the FrameHosts differ. The question is for which document we want to count UseCounters. We normally count UseCounters for the parent frame, and thus we normally use callingExecutionContext(). So I think these two end up with different results, but I'm not sure if the difference matters. If you don't have a strong reason to use currentExecutionContext(), I'd prefer using callingExecutionContext() in both kUseAsm and kBreakIterator for consistency.
On 2014/10/14 11:29:43, haraken wrote: > https://codereview.chromium.org/639703003/diff/1/Source/bindings/core/v8/V8Pe... > File Source/bindings/core/v8/V8PerIsolateData.cpp (right): > > https://codereview.chromium.org/639703003/diff/1/Source/bindings/core/v8/V8Pe... > Source/bindings/core/v8/V8PerIsolateData.cpp:60: > UseCounter::count(currentExecutionContext(isolate), UseCounter::BreakIterator); > On 2014/10/14 11:23:20, marja wrote: > > On 2014/10/14 11:21:00, Erik Corry http://Chromium.org wrote: > > > On 2014/10/14 11:01:41, haraken wrote: > > > > > > > > Are you sure that you want to use currentExecutionContext, not > > > > callingExecutionContext? We normally use callingExecutionContext for > > > > UseCounter::count. > > > > > > > > (To be honest, I don't think the difference matters in most cases.) > > > > > > I'm doing the same as the kUseAsm counter does. I'm not sure what the > > > difference is? > > > > haraken@: ultimately both get associated to the FrameHost (we use the Context > to > > get the Document and get the FrameHost from it); is it possible that they'd > get > > associated to different FrameHosts? > > If the current execution context is a document of an iframe and the calling > execution context is a document of the iframe's parent frame, it's possible that > the FrameHosts differ. The question is for which document we want to count > UseCounters. We normally count UseCounters for the parent frame, and thus we > normally use callingExecutionContext(). > > So I think these two end up with different results, but I'm not sure if the > difference matters. If you don't have a strong reason to use > currentExecutionContext(), I'd prefer using callingExecutionContext() in both > kUseAsm and kBreakIterator for consistency. V8PerIsolateData.cpp is the only place we're using currentExecutionContext() :)
The CQ bit was checked by erikcorry@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/639703003/50001
Message was sent while issue was closed.
Committed patchset #2 (id:50001) as 183757
Message was sent while issue was closed.
LGTM |