WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
179376
Add super sampler begin and end bytecodes.
https://bugs.webkit.org/show_bug.cgi?id=179376
Summary
Add super sampler begin and end bytecodes.
Keith Miller
Reported
2017-11-07 10:07:40 PST
Add super sampler begin and end bytecodes.
Attachments
Patch
(34.26 KB, patch)
2017-11-07 10:08 PST
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Patch
(30.89 KB, patch)
2017-11-08 12:36 PST
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Patch for landing
(30.65 KB, patch)
2017-11-08 12:55 PST
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Keith Miller
Comment 1
2017-11-07 10:08:10 PST
Created
attachment 326219
[details]
Patch
Build Bot
Comment 2
2017-11-07 10:09:41 PST
Attachment 326219
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp:55: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:57: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 2 in 31 files If any of these errors are false positives, please file a bug against check-webkit-style.
Saam Barati
Comment 3
2017-11-07 10:15:42 PST
Comment on
attachment 326219
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=326219&action=review
> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4375 > + { > + emitIteratorNext(value.get(), nextMethod.get(), iterator.get(), node, isForAwait ? EmitAwait::Yes : EmitAwait::No); > + }
why?
> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4544 > + SuperSamplerBytecodeScope scope(*this);
Did you mean to keep these in? Maybe you want them to take an extra parameter like the SuperSamplerScope object so we can pass in true/false to actually emit the bytecode?
> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4563 > + SuperSamplerBytecodeScope scope(*this);
ditto
> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:3515 > + m_jit.load32(bitwise_cast<void*>(&g_superSamplerCount), reg); > + m_jit.add32(TrustedImm32(1), reg); > + m_jit.store32(reg, bitwise_cast<void*>(&g_superSamplerCount));
Isn't there a masm function that does this for you if you give it an address and it just uses the masm temp register?
> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:3525 > + m_jit.load32(bitwise_cast<void*>(&g_superSamplerCount), reg); > + m_jit.sub32(TrustedImm32(1), reg); > + m_jit.store32(reg, bitwise_cast<void*>(&g_superSamplerCount));
ditto
> Source/JavaScriptCore/jit/JITOpcodes.cpp:976 > + load32(bitwise_cast<void*>(&g_superSamplerCount), regT0); > + add32(TrustedImm32(1), regT0); > + store32(regT0, bitwise_cast<void*>(&g_superSamplerCount));
ditto about masm helper
> Source/JavaScriptCore/jit/JITOpcodes.cpp:983 > + load32(bitwise_cast<void*>(&g_superSamplerCount), regT0); > + sub32(TrustedImm32(1), regT0); > + store32(regT0, bitwise_cast<void*>(&g_superSamplerCount));
ditto
> Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:1717 > +LLINT_SLOW_PATH_DECL(slow_path_super_sampler_begin)
We can't do this inline in LLInt code?
Keith Miller
Comment 4
2017-11-07 10:31:59 PST
Comment on
attachment 326219
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=326219&action=review
>> Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:1717 >> +LLINT_SLOW_PATH_DECL(slow_path_super_sampler_begin) > > We can't do this inline in LLInt code?
The LLInt parser doesn't know how to handle global variables, or at least I wasn't easily able to get it to work. Also, you can't pass a address to our current constexpr code since there's no way to reinterpret_cast in a constexpr, AFAIK.
Mark Lam
Comment 5
2017-11-07 10:44:09 PST
Comment on
attachment 326219
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=326219&action=review
>> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4544 >> + SuperSamplerBytecodeScope scope(*this); > > Did you mean to keep these in? Maybe you want them to take an extra parameter like the SuperSamplerScope object so we can pass in true/false to actually emit the bytecode?
I don't think you should keep this in. It makes no sense to sample this specific case and not something else, and it doesn't make sense to sprinkle this scope indiscriminately everywhere either. So, I vote for taking this out. We should only add these scopes in our local workspace when doing profiling work.
>> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:3515 >> + m_jit.store32(reg, bitwise_cast<void*>(&g_superSamplerCount)); > > Isn't there a masm function that does this for you if you give it an address and it just uses the masm temp register?
You can use the operations that take an AbsoluteAddress as a dest.
Keith Miller
Comment 6
2017-11-07 10:45:51 PST
Comment on
attachment 326219
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=326219&action=review
>>> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4544 >>> + SuperSamplerBytecodeScope scope(*this); >> >> Did you mean to keep these in? Maybe you want them to take an extra parameter like the SuperSamplerScope object so we can pass in true/false to actually emit the bytecode? > > I don't think you should keep this in. It makes no sense to sample this specific case and not something else, and it doesn't make sense to sprinkle this scope indiscriminately everywhere either. So, I vote for taking this out. We should only add these scopes in our local workspace when doing profiling work.
I was already planning on removing this code before putting the patch up for review so there's no worries there. I just uploaded this so Saam could take a look at my current patch.
Keith Miller
Comment 7
2017-11-08 12:36:03 PST
Created
attachment 326347
[details]
Patch
Keith Miller
Comment 8
2017-11-08 12:55:07 PST
Created
attachment 326349
[details]
Patch for landing
WebKit Commit Bot
Comment 9
2017-11-08 13:26:36 PST
Comment on
attachment 326349
[details]
Patch for landing Clearing flags on attachment: 326349 Committed
r224594
: <
https://trac.webkit.org/changeset/224594
>
WebKit Commit Bot
Comment 10
2017-11-08 13:26:39 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 11
2017-11-15 09:42:55 PST
<
rdar://problem/35562293
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug