[webkit-reviews] review granted: [Bug 202832] Split ArithProfile into a Unary and a Binary version : [Attachment 380706] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Oct 10 17:48:55 PDT 2019
Keith Miller <keith_miller at apple.com> has granted Robin Morisset
<rmorisset at apple.com>'s request for review:
Bug 202832: Split ArithProfile into a Unary and a Binary version
https://bugs.webkit.org/show_bug.cgi?id=202832
Attachment 380706: Patch
https://bugs.webkit.org/attachment.cgi?id=380706&action=review
--- Comment #2 from Keith Miller <keith_miller at apple.com> ---
Comment on attachment 380706
--> https://bugs.webkit.org/attachment.cgi?id=380706
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=380706&action=review
r=me with question
> Source/JavaScriptCore/ChangeLog:9
> + ArithProfile was for a long time only used for add/sub/mul/div, but
recently it started being used for negate. And it will soon also have to be
used for inc and dec due to BigInt.
> + So in this patch I make a separate version that only has the data
for a single argument, and thus takes half as much memory.
Did you see an improvement in RAMification?
> Source/JavaScriptCore/bytecode/ArithProfile.cpp:158
> +void printInternal(PrintStream& out, const UnaryArithProfile& profile)
> +{
> + const char* separator = "";
> +
> + out.print("Result:<");
> + if (!profile.didObserveNonInt32()) {
> + out.print("Int32");
> + separator = "|";
> + } else {
> + if (profile.didObserveNegZeroDouble()) {
> + out.print(separator, "NegZeroDouble");
> + separator = "|";
> + }
> + if (profile.didObserveNonNegZeroDouble()) {
> + out.print(separator, "NonNegZeroDouble");
> + separator = "|";
> + }
> + if (profile.didObserveNonNumeric()) {
> + out.print(separator, "NonNumeric");
> + separator = "|";
> + }
> + if (profile.didObserveInt32Overflow()) {
> + out.print(separator, "Int32Overflow");
> + separator = "|";
> + }
> + if (profile.didObserveInt52Overflow()) {
> + out.print(separator, "Int52Overflow");
> + separator = "|";
> + }
> + if (profile.didObserveBigInt()) {
> + out.print(separator, "BigInt");
> + separator = "|";
> + }
> + }
> + out.print(">");
> +
> + out.print(" Arg ObservedType:<");
> + out.print(profile.argObservedType());
> + out.print(">");
> +
> + out.print(" Arg ResultType:<");
> +
out.print(RawPointer(bitwise_cast<void*>(static_cast<uintptr_t>(profile.argResu
ltType().bits()))));
> + out.print(">");
> +}
> +
Seems like you could template this? e.g.
template<typename BitField>
inline void printInternal(PrintStream& out, const ArithProfile<BitField>&) ...
> Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:950
> + if (!arithProfile)
> + break;
Is this ever true? It kinda seems like it from reading the code below but
that's somewhat surprising.
More information about the webkit-reviews
mailing list