Commit 52d39f8
committed
IRGen: enable the dynamic cast optimization on Windows
This accommodates lazy initialization of class metadata for the dynamic
cast elision optimization. In the case of a lazy initialization, we
cannot assume that we are able to directly access the metadata through
a GEP, instead we should go through the type metadata accessor.
Although this is a slight bit more expensive, the hot-path of this is
roughly a function call + pointer check (if the value is in the cache,
we just return, otherwise we will have to initialize the type metadata
the first time around).
Special thanks to @atrick for the discussion, pointers, and general help
with trying to enable this optimization!1 parent d51401c commit 52d39f8
1 file changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
1061 | 1062 | | |
1062 | 1063 | | |
1063 | 1064 | | |
1064 | | - | |
1065 | | - | |
| 1065 | + | |
| 1066 | + | |
1066 | 1067 | | |
1067 | 1068 | | |
1068 | 1069 | | |
| |||
1089 | 1090 | | |
1090 | 1091 | | |
1091 | 1092 | | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
1092 | 1104 | | |
1093 | 1105 | | |
1094 | 1106 | | |
| |||
0 commit comments