• kmillikin@chromium.org's avatar
    Recognize in the fast-mode code generator when a subexpression is a · 846688f8
    kmillikin@chromium.org authored
    constant known at compile time.  Do not ever use the stack to
    materialize (non-function-argument) constants.  Currently, constants
    are only the non-materialized, non-function literals in the AST.
    
    It is a known issue that there is no test coverage for the cases of
    assigning a non-literal to a variable and returning a literal.  Those
    code paths are unreachable and tests will be added when they become
    reachable.
    
    For the code '.result = true', we had previously on ia32:
    
    27  push 0xf5c28161             ;; object: 0xf5c28161 <true>
    32  pop [ebp+0xf4]
    
    Now:
    
    27  mov eax,0xf5c26161          ;; object: 0xf5c26161 <true>
    32  mov [ebp+0xf4],eax
    
    ======== We had previously on x64:
    
    25  movq r10,0x7fb8c2f78199    ;; object: 0x7fb8c2f78199 <true>
    35  push r10
    37  pop [rbp-0x18]
    
    Now:
    
    25  movq r10,0x7fb131386199    ;; object: 0x7fb131386199 <true>
    35  movq [rbp-0x18],r10
    
    The generated code for ARM did not include the extra memory traffic.
    It was already eliminated by the ARM assembler's push/pop elimination.
    
    Review URL: http://codereview.chromium.org/300003
    
    git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3088 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
    846688f8
Name
Last commit
Last update
benchmarks Loading commit data...
include Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
ChangeLog Loading commit data...
LICENSE Loading commit data...
SConstruct Loading commit data...