diff options
| author | Cliff Click <cliffc@acm.org> | 2025-04-11 09:06:29 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2025-04-11 09:06:29 -0700 |
| commit | 94f43b86a3240c0af1db2b0fd0429e6ef98d04b7 (patch) | |
| tree | 96af14a40b7a1fb8c7fa7f01a7e8e62e29446f07 | |
| parent | fbbf5e3c095ba27cf0b504151ccda57cc4520e6e (diff) | |
| download | Simple-94f43b86a3240c0af1db2b0fd0429e6ef98d04b7.tar.gz Simple-94f43b86a3240c0af1db2b0fd0429e6ef98d04b7.zip | |
Update ASimpleReply3.md
| -rw-r--r-- | ASimpleReply/ASimpleReply3.md | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/ASimpleReply/ASimpleReply3.md b/ASimpleReply/ASimpleReply3.md index 0d77ca87..395f4b77 100644 --- a/ASimpleReply/ASimpleReply3.md +++ b/ASimpleReply/ASimpleReply3.md @@ -34,9 +34,11 @@ foo (o) { I added the "throw deopt", which I assume Dadal implies when `x` and `y` are none of `Map1, Map2, Map3`. -Dadal then adds: "Here, it's not like any of the type-checks when loading `y` -could be removed. Well, in some cases, we do things like double-diamond -elimination to remove some checks, but often it's not possible." +Dadal then adds: + +> "Here, it's not like any of the type-checks when loading `y` could be +> removed. Well, in some cases, we do things like double-diamond elimination to +> remove some checks, but often it's not possible." C2 sees this kind of pattern fairly often as well; generally replacing `o.map == Map1` with `o instanceof Map1`; not that it matters. C2 uses a "unzipping" @@ -85,14 +87,17 @@ foo (o) { } ``` -Dadal: "If `bar` isn't inlined, then we have to assume that `bar` could change -the shape of `o`, and thus a type-check is needed before loading `y`." +Dadal: + +> "If `bar` isn't inlined, then we have to assume that `bar` could change +> the shape of `o`, and thus a type-check is needed before loading `y`." In a similar situation C2 will do the same. Of course, for sufficiently hot `foo` and modest `bar`, inlining is the answer. This makes me wonder if C2's inlininhg budget is substantially higher than V8's. -Dadal: "Oh, and `bar` could be changing the shape of `o` only some times" +Dadal: +> "Oh, and `bar` could be changing the shape of `o` only some times" In any of these "sometimes Bad Things Happens" situations, C2's go-to answer is to register a dependency and deopt if the Bad Thing happens. The set of Bad |
