| 126 | } |
| 127 | |
| 128 | Executable* Compiler::compile(JITExecutor* opr) { |
| 129 | MGB_LOCK_GUARD(m_mtx); |
| 130 | auto&& args = opr->args(); |
| 131 | auto&& args_cache = m_expr_cache[&(opr->internal_graph())]; |
| 132 | auto q = args_cache.get(args); |
| 133 | if (q.first) { |
| 134 | *q.second = do_compile(opr->internal_graph(), opr->args()); |
| 135 | } |
| 136 | return q.second->get(); |
| 137 | } |
| 138 | |
| 139 | #endif // MGB_JIT |
| 140 |