Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build tape optimization #601

Open
arakov opened this issue Aug 24, 2023 · 0 comments
Open

Build tape optimization #601

arakov opened this issue Aug 24, 2023 · 0 comments

Comments

@arakov
Copy link
Member

arakov commented Aug 24, 2023

  • extra temporal variables

  • boxing an array, assigning to the local variable - get rid of double assigning

  • dirty_ptr := dirty_ptr + int

  • copy a sub array to another array - starting

  • copy a sub array to another array

  • tuple / array unboxing

  • optimization single dispatching

  • String.prop:Length[1]

  • optimization sealed dispatching

  • optimization xstore sp:0, 0 and xstore sp:1, 0 - should be replaced with xor operation

  • comparing Handle with WindowHandle should be native

  • optimize Amicable pairs

  • getting / setting a prop field - should be done directly if it is trivial getter / setter

  • unused allocated variable should be removed to spare stack

  • BuildKey::CopyingAccField, 0

  • get rid of extra assigning here:

    class A
    {
        object field;
    
        object Value
           = field;
    
        constructor(value)
        {
           field := value;
        }
    }
    
    public program()
    {
       A a := new A(2);
    
       var val := *a;
    }
    

The output is:

>@function program.function:#invoke
       xflush       sp:0
       open           :4, :0
       store        fp:1
       xstore       sp:0, intconst:2
       set       class:sandbox'$private'A
       mov        mssg:function:#constructor[1]
       call       mssg:function:#constructor[1], class:sandbox'$private'A#class
       store        fp:3  // an extra save?
       store        fp:2   
       store        sp:0
       mov        mssg:prop:Value[1]
       call         vt:0
       store        fp:3
       peek         fp:1
Lab00:     nop
       close          :0
       quit           
@end
@arakov arakov added this to the ELENA 6.0 milestone Aug 24, 2023
arakov added a commit that referenced this issue Nov 15, 2023
[FIXED]#601 - bytecode optimization
@arakov arakov mentioned this issue Feb 10, 2024
1 task
arakov added a commit that referenced this issue Feb 10, 2024
* starting a new iteration - 19

* [FIXED]do not box the target for direct extension call

* [FIXED]resolving an extension without parameters

* working on #604

* house keeping : rolling back changes for tracing the error

* [FIXED]#604 - using byref handler for extensions

* [ADDED]optimization : looking ahead for operand expressions if byref handler can be used

* [IDE][FIXED]debugger : step inside a nested class / closure

* [FIXED]#624 - GC routine

* [ADDED]inplace default / conversion constructors
[ADDED]built-in variable default

* [DELETED]get rid of embeddable method attribute

* [ADDED]opcodes : xsave n, xsave offs, n

* simplify constant assigning

* [ADDED]inplace call of the conversion constructor

* [FIXED]ecv formatting: insert spaces into the first space; fix display with byte code

* [ADDED]pointer h := UnsafePointer.Empty; - embeddable constructor call

* [ADDED]#629 : Post increment/decrement operators

* refactoring script grammar

* refactoring script support

* refactoring scripts

* refactoring lscript

* [FIXED]script engine : bookmark resolving

* working on the script routines

* tracing

* [FIXED]in-place constructors

* working on default support

* working on in-place constructor call

* refactoring compiler code

* [FIXED]built-in variable default

* [FIXED]#630 - Nil reference cannot be assigned to struct

* fixing code

* house keeping

* working on script samples

* working on script samples

* working on script samples

* [FIXED]bytecode optimization

* [FIXED]#132 anagram sample

* [FIXED]#132 - anagram sample

* working on gui samples

* [ADDED]gui controls
[ADDED]elenasm for Linux

* [FIXED]#623 - Overriding property set accessor
[FIXED]#601 - bytecode optimization

* [ADDED]#629 - Read-only fields
[FIXED]#613 - bytecode optimization

* [FIXED]"this self" for an extension
[ADDED]system : Int8Number, UShortNumber

* [FIXED]#508 - working on multi-value assigning
[FIXED]#86 - primitive operations : int + long

* [ADDED]meta command #load, #clear
[ADDED]#563:Extended statement templates

* fixing warnings for the standard library

* [FIXED]syntax for multi value method

* refactoring rosetta code samples

* refactoring code to support nullable types

* #562 - implementing nullable return type
@arakov arakov mentioned this issue Feb 10, 2024
1 task
arakov added a commit that referenced this issue May 7, 2024
* [ADDED] #635 : new entry point to invoke the functionality from another program
* [ADDED] ecv-cli : adding a filter for listing members
* [FIXED] aarch64 : xstorefir opcode
* fixing xstorefir
* aarch64 assembler : supporting MOVN
* #635 : working on second example calc
* fixing ppc64le open opcode
* [ADDED] new option : auto-preloaded module extension
* [FIXED] reducing the total size of an executable (almost by half) by ignoring module extensions by default
* [FIXED]toJson extension
* [FIXED]try statement does not allocate an exception
* [FIXED]toJson extension
* [FIXED] #401 - += operator with array
* [FIXED] #488 : Declaring auto struct variable
* [FIXED] #522 : single dispatch variadic message
* [ADDED] #646 : Calling own method directly without target
* [FIXED] #630 : 64bit GC routine - expanding header
* [FIXED] x86-64 : calling from external
* [ADDED] chat sample
* [FIXED] #608 : single dispatch for constructors
* [ADDED] #651 : Template Expression - typecasting
* [ADDED]a static method must have an access to private methods
* fixing exprtree1 tutorial sample
* [FIXED] #504 : Support an array operation with external function arguments
* [FIXED] #589 : Supporting ?: operator inside ??
* [ADDED] #569 : Ignoring order of declaration
* #601 : optimize: if (nil == name) {} else {}
* IDE : fixing background issue
* [FIXED]elt-cli : fixing support for extension methods
* [FIXED] xhookdpr for x86-64 mode
* x86-64 : fixing elenavm & elt
* [ADDED] syntax highlighting
@arakov arakov mentioned this issue May 7, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant