summary refs log tree commit diff stats
path: root/compiler/suggest.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2024-04-19 00:52:30 +0800
committerGitHub <noreply@github.com>2024-04-18 18:52:30 +0200
commit9e1d0d15137c6439d886406293a25eaa16b600c5 (patch)
treeb74463823f235d856e7808d546c3b59b99ad9505 /compiler/suggest.nim
parentd6823f477672e61017e9c1ce3b5221a2b80fc1b7 (diff)
downloadNim-9e1d0d15137c6439d886406293a25eaa16b600c5.tar.gz
fixes #4695; closure iterators support for JS backend (#23493)
fixes #4695

ref https://github.com/nim-lang/Nim/pull/15818

Since `nkState` is only for the main loop state labels and `nkGotoState`
is used only for dispatching the `:state` (since
https://github.com/nim-lang/Nim/pull/7770), it's feasible to rewrite the
loop body into a single case-based dispatcher, which enables support for
JS, VM backend. `nkState` Node is replaced by a label and Node pair and
`nkGotoState` is only used for intermediary processing. Backends only
need to implement `nkBreakState` and `closureIterSetupExc` to support
closure iterators.

pending https://github.com/nim-lang/Nim/pull/23484

<del> I also observed some performance boost for C backend in the
release mode (not in the danger mode though, I suppose the old
implementation is optimized into computed goto in the danger mode)
</del>

allPathsAsgnResult???
Diffstat (limited to 'compiler/suggest.nim')
0 files changed, 0 insertions, 0 deletions
131'>131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199