A toy compiler that translates SysY (a subset of C language) into ARMv7a, implemented in Java15.

Related tags

JSON java compiler sysy
Overview

北京航空航天大学 No Segmentation Fault Work 队作品。

ayame

A toy compiler that translates SysY (a subset of C language) into ARMv7a.

ayame

Build

javac -encoding UTF-8 $(find . -name "*.java") -cp lib/antlr4-runtime-4.8.jar:lib/argparse4j-0.9.0.jar

Usage

java -classpath src:lib/antlr4-runtime-4.8.jar:lib/argparse4j-0.9.0.jar Compiler -S {sy_file} -o {asm_file} [-O2]

Architecture

architecture

Passes

  • 中层
    • 全局值编号 (GVN)
    • 全局代码移动 (GCM)
    • 过程内死代码删除
    • 过程间死代码删除
    • 函数内联
    • LCSSA
    • 删除无用循环
    • 循环展开
    • 局部数组提升&标记常量数组
    • 全局变量局部化
    • 分支优化
    • 静态分支预测瞎蒙
    • 归纳变量强度削弱
    • 循环合并
  • 底层
    • Codegen (消除 Phi 指令/除法优化)
    • 图着色寄存器分配
    • 窥孔优化
    • 指令调度
    • 合并基本块(条件执行)

Performance

performance

Special Thank

Special thank to @lynzrand for designing the icon for Ayame.

You might also like...

Compiler that compiles our language flowg to g-code (4th semester project)

flowg FlowG is a language that greatly simplifies manual g-code programming. It is a high-level language that supports functions, for loops, if statem

Jun 15, 2022

Java Compiler for the MiniJava language

Java Compiler for the MiniJava language Setup Our project requires the following tools with the specified versions. Tool Version Java = 14 Maven 3 Th

Dec 5, 2022

Simple way of causing a bsod using the native api implemented into a 1.12.2 Forge mod

Simple-BSOD-Mod Simple way of causing a bsod using the native api implemented into a 1.12.2 Forge mod. Dowload It HERE To make your own you can go to

Dec 28, 2022

This application can recognize the sign language alphabets and help people who do not understand sign language to communicate with the speech and hearing impaired.

This application can recognize the sign language alphabets and help people who do not understand sign language to communicate with the speech and hearing impaired.

Sign Language Recognition App This application can recognize the sign language alphabets and help people who do not understand sign language to commun

Oct 7, 2021

Kotlin-decompiled - (Almost) every single language construct of the Kotlin programming language compiled to JVM bytecode and then decompiled to Java again for better readability

Kotlin: Decompiled (Almost) every single language construct of the Kotlin programming language compiled to JVM bytecode and then decompiled to Java ag

Dec 14, 2022

Jamal is a macro language (JAmal MAcro Language)

Jamal is a macro language (JAmal MAcro Language)

Jamal Macro Language Jamal is a complex text processor with a wide variety of possible use. The first version of Jamal was developed 20 years ago in P

Dec 20, 2022

Log analyser / visualiser for Java HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface.

JITWatch Log analyser and visualiser for the HotSpot JIT compiler. Video introduction to JITWatch video Slides from my LJC lightning talk on JITWatch

Jan 3, 2023

Compiler of Java bytecode to JavaScript

TeaVM See documentation at the project web site. Useful links: Getting started Gallery Flavour source code repository Site source code repository Disc

Jan 3, 2023

Log analyser / visualiser for Java HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface.

JITWatch Log analyser and visualiser for the HotSpot JIT compiler. Video introduction to JITWatch video Slides from my LJC lightning talk on JITWatch

Jan 3, 2023

Spring Native provides beta support for compiling Spring applications to native executables using GraalVM native-image compiler.

Spring Native provides beta support for compiling Spring applications to native executables using GraalVM native-image compiler.

Spring Native provides beta support for compiling Spring applications to native executables using GraalVM native-image compiler.

Jan 6, 2023

A simple hierarchical state machine compiler that generates C.

Makina is a hierarchical state machine source-to-source translator. It takes state machine descriptions as input and produces C language implementations of those state machines.

Oct 17, 2022

Using ANTLR4 in the Course on Compiler Theory at software.nju.edu.cn

compilers-antlr Using ANTLR4 in the Course on Compiler Theory at software.nju.edu.cn src main antlr simpleexpr (gramma SimpleExpr) simpleexprlexer (le

Dec 14, 2022

A compiler built in Java that allows to translate xml format to json.

A compiler built in Java that allows to translate xml format to json. Getting Started Welcome to the VS Code Java world. Here is a guideline to help y

Jan 6, 2022

Project for 2021-autumn Compiler course in BUAA-SCSE.

MIPSysY Compiler 词法分析 词法分析的本质是构造有限状态机扫描字符串,提取单词。本编译器采用正则表达式来提取。 基本架构是: 对于每一种单词,构造一个对应的正则表达式; 采用 | 将所有正则表达式按优先级串接起来,形成一个正则表达式:其中优先级是指 长串优先 关键字优先 首先构造映射

Dec 29, 2022

Java serialization library, proto compiler, code generator

Java serialization library, proto compiler, code generator

A java serialization library with built-in support for forward-backward compatibility (schema evolution) and validation. efficient, both in speed and

Dec 23, 2022

There are two versions of assignments(Java or C++) for the CS143-Compiler course, this repo is my Java-version solution.

Intro There are two versions of assignments(Java or C++) for the CS143-Compiler course, this repo is my Java-version solution. Course resources: This

Dec 15, 2022

LiquidLang Compiler

LiquidLang Compiler

File a suggestion, or RFC on the GitHub Issues page in this repository. RFCs should be filed when making major changes to the language and API.

Jun 6, 2022

The Liquid compiler.

The Liquid compiler.

LiquidLang Compiler Core Module, 0.0.1 dev Suggestions File a suggestion, or RFC on the GitHub Issues page in this repository. RFCs should be filed wh

Jun 6, 2022
Owner
null
The Liquid compiler.

LiquidLang Compiler Core Module, 0.0.1 dev Suggestions File a suggestion, or RFC on the GitHub Issues page in this repository. RFCs should be filed wh

Glide 9 Jun 6, 2022
A Java serialization/deserialization library to convert Java Objects into JSON and back

Gson Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to a

Google 21.7k Jan 8, 2023
A universal types-preserving Java serialization library that can convert arbitrary Java Objects into JSON and back

A universal types-preserving Java serialization library that can convert arbitrary Java Objects into JSON and back, with a transparent support of any kind of self-references and with a full Java 9 compatibility.

Andrey Mogilev 9 Dec 30, 2021
A simple java JSON deserializer that can convert a JSON into a java object in an easy way

JSavON A simple java JSON deserializer that can convert a JSON into a java object in an easy way. This library also provide a strong object convertion

null 0 Mar 18, 2022
JSON query and transformation language

JSLT JSLT is a complete query and transformation language for JSON. The language design is inspired by jq, XPath, and XQuery. JSLT can be used as: a q

Schibsted Media Group 510 Dec 30, 2022
MapNeat is a JVM library written in Kotlin that provides an easy to use DSL (Domain Specific Language) for transforming JSON to JSON, XML to JSON, POJO to JSON in a declarative way.

MapNeat is a JVM library written in Kotlin that provides an easy to use DSL (Domain Specific Language) for transforming JSON to JSON, XML to JSON, POJ

Andrei Ciobanu 59 Sep 17, 2022
A query language for JSON and a template engine to generate text output.

Josson & Jossons Josson is a query language for JSON. Jossons is a template engine to generate text output. Features and Capabilities of Josson Query

Octomix Software 16 Dec 14, 2022
For Jack language. Most of codes were commented with their usage, which can be useful for beginner to realize the running principle of a compiler for object-oriented programming language.

Instructions: Download the Java source codes Store these codes into a local folder and open this folder Click the right key of mouse and click ‘Open i

gooooooood 1.1k Jan 5, 2023
[INACTIVE] Avian is a lightweight virtual machine and class library designed to provide a useful subset of Java's features, suitable for building self-contained applications.

Avian - A lightweight Java Virtual Machine (JVM) PLEASE NOTE: This project is not currently being developed, maintained, or supported. Feel free to us

ReadyTalk 1.2k Dec 22, 2022
lazy-language-loader improves loading times when changing your language by only reloading the language instead of all the game resources!

lazy-language-loader lazy-language-loader improves loading times when changing your language by only reloading the language instead of all the game re

Shalom Ademuwagun 7 Sep 7, 2022