From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id 9D22A3858D35 for ; Fri, 9 Jun 2023 23:04:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9D22A3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-6b2a4655352so1046882a34.3 for ; Fri, 09 Jun 2023 16:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686351895; x=1688943895; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=rRvKt5L7h8hknHGPCN1o65jEqpBuQWGXbqu6+BkIOWk=; b=JNky1lWtvWnNj4vdm7GTpxUH2+1KDprGXQ536X0lm10kLWhu7EcJ2C44gxpUOxL/lT k2jhA9W2arcESl7Uar9cnvtm2kfoSSgzYOf/NObmWs8eoPc4QRqq9Dcl1wA4Iga8Rmrk 3392dK6x0xvZgBeahKmuQYgrVaHU+6Irnu5i+rQAXMvKYZ+aaHzUXOCY4yRAiqntNhYP C1hfLx5X/GK3tHhtbgH52rlTQF4BWY8uDz6kRVOHWwM2ycw+VZ02LAJFSOVdWmthF/UY OjuD/M0YTsUJ8rPGwRk4hJElrEFnaiEYIG5lOBzPq26m74Sq4i9nIu/hlqng9azYKD2O /ZcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686351895; x=1688943895; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=rRvKt5L7h8hknHGPCN1o65jEqpBuQWGXbqu6+BkIOWk=; b=L7nq/OsfVfAYdzx+78gpB2+Em4mrC1mteqAOasYbHFGkV0rsTu4VO2Af3BuZaFecTr K+VfZGQPBAUSguL51ozYTwTm6zlkWTqx6O85a0UsMTOsBb8pkPRkdwgmfDUSJVFN/Hv5 ERmr0F6yd8D8iHbO+4LXv3NrEq2mKfa8Ia3tr9CEIcb5VxqNuVhWp5ijb95dztbDGxKa 4ZgGjt5LgtVUMMsVFEaPr9RrYz1OWJ6bb4Vm/MitfRrDxVfl0X4vwy9+pGsMCoopRc6Z 219Cd1Jv6hE1sAL9VU3SaV64fRJu0gxnDf2WMHZMZOtZ1jPomtet2kPFMTKzn5CgRBky tBUA== X-Gm-Message-State: AC+VfDyOXFAVTHjJVB2t89dZaiBYcakMH5xwPg3Obb1Prk1VYAC+f4Ms scFrNXk47cXmuuw828v3oHZEQ088ygHGSLDr4qsnsDnq X-Google-Smtp-Source: ACHHUZ6s21c8x8bWSpeSAApBXQyBdtg6CUGLawmNYazZlzAGQI9ki3ESRnYmL5ysD3G2Mcn1ZxVZE0kXEQ5kKqlr2x0= X-Received: by 2002:a05:6359:a15:b0:129:c222:439f with SMTP id el21-20020a0563590a1500b00129c222439fmr2167409rwb.18.1686351895364; Fri, 09 Jun 2023 16:04:55 -0700 (PDT) MIME-Version: 1.0 From: Joshua Saxby Date: Sat, 10 Jun 2023 00:04:43 +0100 Message-ID: Subject: Modifying the jit compiler API? To: jit@gcc.gnu.org Content-Type: multipart/alternative; boundary="000000000000b08a1f05fdba65b8" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000b08a1f05fdba65b8 Content-Type: text/plain; charset="UTF-8" Currently the JIT has two functions allowing you to compile a context either to memory or to file. But what if you want to compile to both? There doesn't seem to be any way to do this except by calling both functions separately which I believe will effectively be two separate compilations... Presumably, it should be possible to modify this part of the API to compile to some form of intermediate representation of the work that is common to both kinds of compilation, and then turn that into code in memory and in file, respectively. Anyone got any pointers for me on where in the code would be the best place for me to modify to dupport this? I did take a look in the implementation code of JIT sone weeks ago and remember seeing lots of complicated stuff regarding recordings and replays that looked relevant... A slighty simpler alteration I am also interested in making is allowing compile to file to compile to a buffer in memory as well as a file (I suppose it could be termed "compile to binary"). Maybe I should start with that... --000000000000b08a1f05fdba65b8--