RESOLVED FIXED Bug 150878
B3 should be able to compile a Check
https://bugs.webkit.org/show_bug.cgi?id=150878
Summary B3 should be able to compile a Check
Filip Pizlo
Reported 2015-11-03 20:55:34 PST
Patch forthcoming.
Attachments
the patch (8.95 KB, patch)
2015-11-03 20:59 PST, Filip Pizlo
saam: review+
Filip Pizlo
Comment 1 2015-11-03 20:59:16 PST
Created attachment 264765 [details] the patch
WebKit Commit Bot
Comment 2 2015-11-03 21:02:22 PST
Attachment 264765 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/b3/testb3.cpp:1778: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/b3/testb3.cpp:1779: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:1781: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:1794: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:1794: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/JavaScriptCore/b3/testb3.cpp:1795: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] Total errors found: 6 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Saam Barati
Comment 3 2015-11-04 08:55:48 PST
Comment on attachment 264765 [details] the patch View in context: https://bugs.webkit.org/attachment.cgi?id=264765&action=review r=me > Source/JavaScriptCore/b3/B3LowerToAir.cpp:486 > + case ValueRep::SomeRegister: What's the difference between "Register" and "SomeRegister"? > Source/JavaScriptCore/b3/testb3.cpp:1781 > + CHECK(params.reps[0].value() == 1); I'm a bit confused here, why is this "1"?
Saam Barati
Comment 4 2015-11-04 08:56:02 PST
Comment on attachment 264765 [details] the patch View in context: https://bugs.webkit.org/attachment.cgi?id=264765&action=review r=me > Source/JavaScriptCore/b3/B3LowerToAir.cpp:486 > + case ValueRep::SomeRegister: What's the difference between "Register" and "SomeRegister"? > Source/JavaScriptCore/b3/testb3.cpp:1781 > + CHECK(params.reps[0].value() == 1); I'm a bit confused here, why is this "1"?
Filip Pizlo
Comment 5 2015-11-04 14:14:29 PST
(In reply to comment #4) > Comment on attachment 264765 [details] > the patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=264765&action=review > > r=me > > > Source/JavaScriptCore/b3/B3LowerToAir.cpp:486 > > + case ValueRep::SomeRegister: > > What's the difference between "Register" and "SomeRegister"? SomeRegister is a constraint requesting that the value ends up in a register. It means that it can end up with any register that matches the value's type (GPR for int, FPR for double). > > > Source/JavaScriptCore/b3/testb3.cpp:1781 > > + CHECK(params.reps[0].value() == 1); > > I'm a bit confused here, why is this "1"? A Check is a stackmap, so it must provide a ValueRep for each operand. The ValueRep only needs to be valid on the path where the Check "failed", i.e. its predicate was true. By convention, if you do: Check(x, y) Then we claim that x's value was 1. Note that y is optional. For y, we will provide an actual value recovery. The reason why we don't provide an honest recovery of x is that it's not actually useful for most users of Check, and it just so happens to 1 is kind of correct.
Filip Pizlo
Comment 6 2015-11-04 14:16:12 PST
Note You need to log in before you can comment on or make changes to this bug.