From c507d50f191347b466be06ffd548e724adf036fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Tue, 12 Mar 2019 21:27:03 +0100 Subject: [PATCH] Order assembled output --- .travis.yml | 19 +++++++++++++------ src/tools/assembler.rkt | 12 +++++++----- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index e1d47aa..39873d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,21 @@ -# Doesn't work yet, because there is no 'wabt' package in Ubuntu yet -# This will have to wait until disco. -# TODO: Add racket. +# - racket version in xenial is too old; need bionic? +# - 'wabt' package is only in Ubuntu disco language: node_js node_js: - "node" +dist: xenial +install: + - wget https://github.com/WebAssembly/wabt/releases/download/1.0.10/wabt-1.0.10-linux.tar.gz -O wabt-1.0.10-linux.tar.gz + - tar xzf wabt-1.0.10-linux.tar.gz + - export PATH=$PWD/wabt-1.0.10:$PATH + - yarn script: - - yarn build - - yarn test + - make + - make check cache: yarn addons: apt: packages: - - wabt + - make + - racket + # - wabt diff --git a/src/tools/assembler.rkt b/src/tools/assembler.rkt index f056c10..391c476 100644 --- a/src/tools/assembler.rkt +++ b/src/tools/assembler.rkt @@ -46,11 +46,13 @@ (define (priority x) (cond ((eq? x 'module) 0) - ((and (list? x) (eq? (car x) 'import)) 1) - ((and (list? x) (eq? (car x) 'table)) 2) - ((and (list? x) (eq? (car x) 'memory)) 2) - ((and (list? x) (eq? (car x) 'global)) 3) - (else 100))) + ((and (list? x) (eq? (car x) 'import)) 1000000) + ((and (list? x) (eq? (car x) 'table)) 2000000) + ((and (list? x) (eq? (car x) 'memory)) 2000000) + ((and (list? x) (eq? (car x) 'global)) 3000000) + ((and (list? x) (eq? (car x) 'elem)) (+ 4000000 (car (cdr (car (cdr x)))))) + ((and (list? x) (eq? (car x) 'data)) (+ 5000000 (car (cdr (car (cdr x)))))) + (else 100000000))) (define (wasm-assemble module) (display