Minero Aoki
015bd34c4c
r4842@macbookpro: aamine | 2009-05-13 04:35:34 +0900
...
updated
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4211 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-17 02:27:31 +00:00
Minero Aoki
5576b83389
r4835@macbookpro: aamine | 2009-05-11 03:18:42 +0900
...
updated
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4208 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 18:18:53 +00:00
Minero Aoki
3a7d40e63d
r4826@macbookpro: aamine | 2009-05-11 01:40:01 +0900
...
* net/loveruby/cflat/sysdep/x86/CodeGenerator.java: use PeepholeOptimizer directly.
* net/loveruby/cflat/asm/PeepholeOptimizer.java -> net/loveruby/cflat/sysdep/x86
* net/loveruby/cflat/asm/AsmOptimizer.java: removed.
* net/loveruby/cflat/codegenerator/CodeGeneratorOptions.java: should not provide PeepholeOptimizer, just provide optimizationLevel.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4204 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 16:49:47 +00:00
Minero Aoki
703b44faf5
r4824@macbookpro: aamine | 2009-05-11 01:09:13 +0900
...
* net/loveruby/cflat/compiler/IRGenerator.java: generate address expression for LHS expr.
* net/loveruby/cflat/sysdep/x86/CodeGenerator.java: remove #compileLHS. Just compile LHS expr.
* net/loveruby/cflat/ir/Addr.java: is a constant address now.
* net/loveruby/cflat/ir/Var.java: is not a constant address now.
* net/loveruby/cflat/ir/Expr.java: new base method #addressNode.
* net/loveruby/cflat/ir/Mem.java: override #addressNode.
* net/loveruby/cflat/ir/Var.java: ditto.
* net/loveruby/cflat/ir/Addr.java: ditto.
* net/loveruby/cflat/ir/Expr.java: new base method #getEntityForce.
* net/loveruby/cflat/ir/Var.java: override #getEntityForce.
* net/loveruby/cflat/ir/Addr.java: ditto.
* net/loveruby/cflat/ir/Call.java: get function entity by Expr#getEntityForce.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4202 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 16:49:45 +00:00
Minero Aoki
135881389d
r4810@macbookpro: aamine | 2009-05-10 20:27:32 +0900
...
updated
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4196 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 14:51:55 +00:00
Minero Aoki
2d674669d8
r4809@macbookpro: aamine | 2009-05-10 20:25:51 +0900
...
updated
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4195 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 14:51:54 +00:00
Minero Aoki
bdb0e3cf16
r4745@macbookpro: aamine | 2009-05-06 14:52:27 +0900
...
updated
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4180 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-08 10:40:51 +00:00
Minero Aoki
d0d97c01d6
all ToDo completed
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4090 1b9489fe-b721-0410-924e-b54b9192deb8
2008-11-16 15:02:27 +00:00
Minero Aoki
1f47ab6771
* net/loveruby/cflat/compiler/TypeResolver.java: "f = puts" implies "f = &puts", adjust type for such expressions.
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4088 1b9489fe-b721-0410-924e-b54b9192deb8
2008-11-16 13:29:35 +00:00
Minero Aoki
5659150c08
resolved: make compiler mode enum.
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4087 1b9489fe-b721-0410-924e-b54b9192deb8
2008-11-16 12:30:46 +00:00
Minero Aoki
83dcd37243
* net/loveruby/cflat/compiler/DereferenceChecker.java: We do not need to check an OpAssignNode as operator, because this class only check references.
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4085 1b9489fe-b721-0410-924e-b54b9192deb8
2008-11-16 11:20:19 +00:00
Minero Aoki
15469d899f
updated
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4084 1b9489fe-b721-0410-924e-b54b9192deb8
2008-11-16 11:12:38 +00:00
Minero Aoki
aa030b42b7
* net/loveruby/cflat/compiler/CodeGenerator.java: should access file-local gvar directly (with @GOTOFF) in PIE.
...
* net/loveruby/cflat/ast/Entity.java: all entities should have memref or address.
* net/loveruby/cflat/ast/Variable.java: ditto.
* net/loveruby/cflat/ast/DefinedVariable.java: ditto.
* net/loveruby/cflat/ast/UndefinedVariable.java: ditto.
* net/loveruby/cflat/ast/Function.java: ditto.
* net/loveruby/cflat/ast/DefinedFunction.java: ditto.
* import/stdlib.hb: add new declarations.
* import/unistd.hb: add new declarations.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4082 1b9489fe-b721-0410-924e-b54b9192deb8
2008-11-16 11:01:10 +00:00
Minero Aoki
6b24625a87
* net/loveruby/cflat/compiler/Options.java: new option --readonly-plt.
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4076 1b9489fe-b721-0410-924e-b54b9192deb8
2008-11-02 09:27:05 +00:00
Minero Aoki
97204851c7
updated
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4075 1b9489fe-b721-0410-924e-b54b9192deb8
2008-10-25 22:22:16 +00:00
Minero Aoki
244c52e425
updated
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4073 1b9489fe-b721-0410-924e-b54b9192deb8
2008-10-24 18:52:49 +00:00
Minero Aoki
715ec649f9
updated
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4068 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-28 18:56:28 +00:00
Minero Aoki
1d35dd1665
* net/loveruby/cflat/compiler/Compiler.java: implement -shared.
...
* net/loveruby/cflat/compiler/Options.java: new option -shared.
* net/loveruby/cflat/compiler/CodeGeneratorOptions.java: ditto.
* net/loveruby/cflat/compiler/SourceFile.java: new method #linkedFileName.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4065 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-27 22:07:04 +00:00
Minero Aoki
fb81b25c2d
updated
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4060 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-27 20:23:44 +00:00
Minero Aoki
f94faf7fde
* net/loveruby/cflat/compiler/CodeGenerator.java: remove unused labels.
...
* net/loveruby/cflat/asm/AsmStatistics.java: collect label usage.
* net/loveruby/cflat/asm/DirectMemoryReference.java: support collectStatistics.
* net/loveruby/cflat/asm/Literal.java: ditto.
* net/loveruby/cflat/asm/LabelRef.java: ditto.
* net/loveruby/cflat/asm/IntegerLiteral.java: ditto.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4054 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-23 16:10:42 +00:00
Minero Aoki
8f3e39031a
* net/loveruby/cflat/ast/Function.java: refactoring: new method #label.
...
* net/loveruby/cflat/compiler/CodeGenerator.java (prologue): omit loop when no-verboseAsm.
* test: check "puts = NULL" and "stdin = NULL" are compilable (of course "puts = NULL" causes segv).
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4043 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-21 09:14:34 +00:00
Minero Aoki
556d917fff
* net/loveruby/cflat/compiler/CodeGenerator.java: optimize constant load.
...
* net/loveruby/cflat/asm/ImmediateValue.java: accept any Literal.
* net/loveruby/cflat/ast/LiteralNode.java: new method #asmLiteral.
* net/loveruby/cflat/ast/CastNode.java: is not constant when cast is effective.
* net/loveruby/cflat/compiler/Compiler.java: new option --verbose-asm.
* net/loveruby/cflat/compiler/Options.java: ditto.
* net/loveruby/cflat/compiler/CodeGenerator.java: ditto.
* net/loveruby/cflat/asm/Assembler.java: new method #indentComment, #unindentComment.
* net/loveruby/cflat/asm/AsmComment.java: indent comments.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4041 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-20 20:43:34 +00:00
Minero Aoki
076d0dea13
* net/loveruby/cflat/compiler/Options.java: new option -O0, -O, -O1, -O2, -Os.
...
* net/loveruby/cflat/asm/AsmOptimizer.java: new interface to switch optimizer dynamicly.
* net/loveruby/cflat/compiler/PeepholeOptimizer.java -> asm/PeepholeOptimizer.java
* net/loveruby/cflat/compiler/CodeGenerator.java: parameterize AsmOptimizer.
* net/loveruby/cflat/ast/AST.java: holds a typeTable.
* net/loveruby/cflat/compiler/Compiler.java: follow AST change.
* net/loveruby/cflat/compiler/TypeResolver.java: ditto.
* net/loveruby/cflat/compiler/TypeChecker.java: ditto.
* net/loveruby/cflat/compiler/LocalReferenceResolver.java: ditto.
* net/loveruby/cflat/compiler/DereferenceChecker.java: ditto.
* net/loveruby/cflat/compiler/JumpResolver.java: ditto.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4039 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-20 15:13:09 +00:00
Minero Aoki
c3bf6f1344
* net/loveruby/cflat/compiler/CodeGenerator.java: apply peep-hole optimization.
...
* net/loveruby/cflat/compiler/PeepholeOptimizer.java: new class.
* net/loveruby/cflat/asm/Assembler.java: export list (List<Assembly>).
* net/loveruby/cflat/asm/Instruction.java: new method #build to build an Instruction from the instruction object.
* net/loveruby/cflat/asm/OperandPattern.java: new interface.
* net/loveruby/cflat/asm/AsmOperand.java: impelements OperandPattern.
* net/loveruby/cflat/asm/Register.java: implements #isRegister.
* net/loveruby/cflat/asm/ImmediateValue.java: implement #equals to allow matching immediate integer value.
* net/loveruby/cflat/asm/IntegerLiteral.java: implement #equals.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4038 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-20 13:53:34 +00:00
Minero Aoki
390af239ce
add item
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4034 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-15 18:52:26 +00:00
Minero Aoki
5c673e2b7d
* net/loveruby/cflat/compiler/TypeChecker.java: reject statements whose type is struct/union/allocated array.
...
* test: test invalid statement expression.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4032 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-15 18:42:46 +00:00
Minero Aoki
e6c0c1e3c0
updated
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4031 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-15 18:24:16 +00:00
Minero Aoki
47d4b13b1e
* net/loveruby/cflat/asm/Literal.java: does not inherit AsmOperand.
...
* net/loveruby/cflat/asm/Assembler.java: do not use Literals in instruction operand.
* net/loveruby/cflat/asm/ImmediateValue.java: accept only Literals.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4029 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-15 18:12:46 +00:00
Minero Aoki
a95ad7b451
* net/loveruby/cflat/asm/Symbol.java -> LabelRef.java
...
* net/loveruby/cflat/asm/*.java: Symbol -> LabelRef.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4028 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-15 17:53:12 +00:00
Minero Aoki
de82f43658
* net/loveruby/cflat/asm/AsmEntity.java -> AsmOperand.java
...
* net/loveruby/cflat/*/*.java: AsmEntity -> AsmOperand.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4027 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-15 17:49:29 +00:00
Minero Aoki
19ca32a89d
* net/loveruby/cflat/asm/Address.java -> MemoryReference.java
...
* net/loveruby/cflat/asm/DirectAddress.java -> DirectMemoryReference.java
* net/loveruby/cflat/asm/IndirectAddress.java -> IndirectMemoryReference.java
* net/loveruby/cflat/compiler/CodeGenerator.java: Address -> MemoryReference.
* net/loveruby/cflat/asm/AsmEntity.java: ditto.
* net/loveruby/cflat/asm/AbsoluteAddress.java: ditto.
* net/loveruby/cflat/ast/Entity.java: ditto.
* net/loveruby/cflat/ast/Variable.java: ditto.
* net/loveruby/cflat/ast/DefinedVariable.java: ditto.
* net/loveruby/cflat/ast/UndefinedVariable.java: ditto.
* net/loveruby/cflat/ast/Function.java: ditto.
* net/loveruby/cflat/ast/ExprNode.java: ditto.
* net/loveruby/cflat/ast/VariableNode.java: ditto.
* net/loveruby/cflat/ast/CastNode.java: ditto.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4026 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-15 17:37:49 +00:00
Minero Aoki
7314d4bf6f
* net/loveruby/cflat/asm/Assembler.java: objectify instructions, directives, comments and labels.
...
* net/loveruby/cflat/asm/Label.java: inherits Assembly instead of AsmEntity.
* net/loveruby/cflat/asm/Address.java: new method #isAddress.
* net/loveruby/cflat/asm/ImmediateValue.java: accept Literals.
* net/loveruby/cflat/asm/AbsoluteAddress.java: new file.
* net/loveruby/cflat/asm/AsmComment.java: new file.
* net/loveruby/cflat/asm/Assembly.java: new file.
* net/loveruby/cflat/asm/Directive.java: new file.
* net/loveruby/cflat/asm/Reference.java -> DirectAddress.java: new file.
* net/loveruby/cflat/asm/SimpleAddress.java, CompositeAddress.java -> IndirectAddress.java
* net/loveruby/cflat/asm/Instruction.java: new file.
* net/loveruby/cflat/asm/IntegerLiteral.java: new file.
* net/loveruby/cflat/asm/Literal.java: new file.
* net/loveruby/cflat/asm/Symbol.java: new file.
* net/loveruby/cflat/compiler/CodeGenerator.java: follow asm changes.
* net/loveruby/cflat/ast/UndefinedVariable.java:
* net/loveruby/cflat/ast/Function.java
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4022 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-15 15:21:14 +00:00
Minero Aoki
ae0f46cee4
* net/loveruby/cflat/compiler/Compiler.java: link libcbc on making executables.
...
* Makefile: new file.
* lib/Makefile: new file to build libcbc.a.
* test: test varargs.
* install.sh: new file.
* README: change install.sh usage.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4021 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-15 12:19:11 +00:00
Minero Aoki
97ff5aafe0
* cbc -> bin/cbc
...
* cbci -> bin/cbci.rb
* bin/cbci.sh: new file.
* lib/libcbc.cb: new file.
* build.properties: create jar file in lib/.
* install.sh: new file.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4018 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-14 16:19:44 +00:00
Minero Aoki
7524fb4468
updated
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4017 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-14 16:07:31 +00:00
Minero Aoki
688d709302
* net/loveruby/cflat/compiler/Compiler.java: use CflatToken to dump token list.
...
* net/loveruby/cflat/compiler/CodeGenerator.java: show stmt line in assembly.
* net/loveruby/cflat/parser/Parser.jj: pass a Token to the Location.
* net/loveruby/cflat/ast/AST.java: use CflatToken.
* net/loveruby/cflat/ast/Location.java: use CflatToken.
* net/loveruby/cflat/ast/CflatToken.java: new file.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4015 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-14 11:08:26 +00:00
Minero Aoki
b79d20d4c3
* net/loveruby/cflat/ast/UndefinedVariable.java: should not append '$' for extern symbol address.
...
* import/stdio.hb: add va_list functions.
* import/stdarg.hb: new file.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4014 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-13 20:36:34 +00:00
Minero Aoki
64e9e0f34a
add task
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4012 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-13 18:33:29 +00:00
Minero Aoki
85f7003bf5
updated
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4011 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-13 18:32:43 +00:00
Minero Aoki
6f9d7714f5
write all FIXMEs
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4005 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-06 23:46:36 +00:00
Minero Aoki
9ea468d3db
* net/loveruby/cflat/compiler/CodeGenerator.java: split compileLHS by using visitor pattern.
...
* net/loveruby/cflat/ast/ASTLHSVisitor.java: new interface.
* net/loveruby/cflat/ast/DereferenceNode.java: implement #acceptLHS.
* net/loveruby/cflat/ast/ArefNode.java: ditto.
* net/loveruby/cflat/ast/PtrMemberNode.java: ditto.
* net/loveruby/cflat/ast/MemberNode.java: ditto.
* net/loveruby/cflat/ast/Node.java: ditto.
* net/loveruby/cflat/ast/VariableNode.java: ditto.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4003 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-06 23:06:41 +00:00
Minero Aoki
0206623cad
* net/loveruby/cflat/compiler/CodeGenerator.java: calculate LHS value on AX, not BX.
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4001 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-06 21:50:59 +00:00
Minero Aoki
a6c6112b29
* net/loveruby/cflat/utils/TextUtils.java (toUnsigned): simplify.
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3998 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-06 17:57:27 +00:00
Minero Aoki
960d30f461
* net/loveruby/cflat/asm/Register.java (lowerByteRegister): check wheather the register has lower-byte register or not.
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3996 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-06 16:21:41 +00:00
Minero Aoki
cd988128cc
* net/loveruby/cflat/compiler/CodeGenerator.java: implement cast.
...
* net/loveruby/cflat/asm/Assembler.java: new method #movsx, #movzx.
* net/loveruby/cflat/type/PointerType.java: provide #isSigned for cast.
* net/loveruby/cflat/type/ArrayType.java: ditto.
* net/loveruby/cflat/type/UserType.java: ditto.
* test: test cast operation.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3995 1b9489fe-b721-0410-924e-b54b9192deb8
2008-09-06 15:59:02 +00:00
Minero Aoki
553623b53f
updated
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3992 1b9489fe-b721-0410-924e-b54b9192deb8
2008-08-31 16:55:27 +00:00
Minero Aoki
94002785bd
updated
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3989 1b9489fe-b721-0410-924e-b54b9192deb8
2008-08-31 16:27:25 +00:00
Minero Aoki
458679c32b
change file format
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3987 1b9489fe-b721-0410-924e-b54b9192deb8
2008-08-31 15:04:19 +00:00
Minero Aoki
c846043242
updated
...
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3980 1b9489fe-b721-0410-924e-b54b9192deb8
2008-08-31 10:39:58 +00:00
Minero Aoki
0229e05728
* net/loveruby/cflat/ast/Declarations.java: reject duplicated symbols to support duplicated import.
...
* net/loveruby/cflat/compiler/LibraryLoader.java: should return previous loaded symbols for the same import file.
* test: test duplicated import.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3978 1b9489fe-b721-0410-924e-b54b9192deb8
2008-08-31 06:18:26 +00:00