Merge branch 'native_boot'
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
/* QBE headers */
|
||||
#include "all.h"
|
||||
@@ -154,6 +155,8 @@ JSValue js_os_qbe(JSContext *js, JSValue self, int argc, JSValue *argv) {
|
||||
}
|
||||
|
||||
/* Run the QBE pipeline */
|
||||
struct timespec t0, t1;
|
||||
clock_gettime(CLOCK_MONOTONIC, &t0);
|
||||
parse(inf, "<ir>", qbe_dbgfile, qbe_data, qbe_func);
|
||||
fclose(inf);
|
||||
|
||||
@@ -162,6 +165,11 @@ JSValue js_os_qbe(JSContext *js, JSValue self, int argc, JSValue *argv) {
|
||||
fflush(qbe_outf);
|
||||
fclose(qbe_outf);
|
||||
qbe_outf = NULL;
|
||||
clock_gettime(CLOCK_MONOTONIC, &t1);
|
||||
double ms = (t1.tv_sec - t0.tv_sec) * 1000.0 +
|
||||
(t1.tv_nsec - t0.tv_nsec) / 1e6;
|
||||
fprintf(stderr, "[qbe_backend] os.qbe: %.1fms (%zu bytes IL -> %zu bytes asm)\n",
|
||||
ms, ir_len, out_len);
|
||||
|
||||
JS_FreeCString(js, ir);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user