Commit Graph

11 Commits

Author SHA1 Message Date
Ivan Kylchik 6ec75a705e [IR] Store original function in the IrInlinedBlock
In Native and JS, there is a special logic where the compiler saves
a copy of inlined function (see `InlineFunctionsSupport`). This copy
is used in the IR inliner. Because of that, we can't really compare
inlined function with other functions directly. We need to
get `originalFunction` first and save it.
2024-02-27 17:41:33 +00:00
Sergej Jaskiewicz acee8da283 [IR] Move coroutine-related helpers to a more appropriate place
The `isBuiltInSuspendCoroutine` and
`isBuiltInSuspendCoroutineUninterceptedOrReturn` helpers are not
inherently related to function inlining.
2024-02-23 16:26:55 +00:00
Sergej Jaskiewicz 4f44d32cc2 [JVM IR] Avoid hard-coded checks for coroutine intrinsics
Use existing helpers for that instead, and introduce a new one.
2024-02-23 16:26:55 +00:00
Ivan Kylchik 96b5d47e68 [IR] Move property needsInlining into InlineFunctionResolver
#KT-64807 Fixed
2024-02-22 09:55:58 +00:00
Ivan Kylchik 9e7ddfa191 [IR] Resolve fake overrides inside getFunctionDeclaration function
#KT-64807
2024-02-22 09:55:58 +00:00
Ivan Kylchik 2bfd1c8f23 [IR] Don't pass originalCallee to the inliner
`originalCallee` is supposed to be the owner of the original call.
It can be a fake override, and in the inliner we are using actual
function with body. Apparently we can just stick with the resolved
function.

#KT-64807
2024-02-22 09:55:58 +00:00
Ivan Kylchik 0258927d33 [IR] Forbid to use shouldExcludeFunctionFromInlining as public API
#KT-64807
2024-02-22 09:55:58 +00:00
Ivan Kylchik f1bc542d74 [IR] Change the return type of getFunctionDeclaration to be nullable
#KT-64807
2024-02-22 09:55:58 +00:00
Ivan Kylchik 91f818ba5a [IR] Transformed InlineFunctionResolver into abstract class
#KT-64807
2024-02-22 09:55:58 +00:00
Ivan Kylchik b0171dea63 [IR] Move FunctionInlining into separate module
#KT-64806 Fixed
2024-02-19 20:14:16 +00:00
Ivan Kylchik 6dccb60afe [IR] Add new module to keep all IR inline related code
#KT-64806
2024-02-19 20:14:16 +00:00