1. 27 Oct, 2009 4 commits
  2. 26 Oct, 2009 1 commit
  3. 23 Oct, 2009 1 commit
    • kmillikin@chromium.org's avatar
      Simple toplevel code generator support for short-circuited boolean OR · e82a07c0
      kmillikin@chromium.org authored
      in a non-test (ie, value or effect) context.  (It is implicitly not in
      a test context because the code generator does not support expressions
      in a test context yet.)
      
      Compilation is essentially the same as in the optimized code
      generator.  The expression (e0 || e1) is compiled as if it were
      (let (temp = e0) temp ? temp : e1).
      
      On ia32 and x64 a single shared ToBoolean stub is used to convert a
      value to a flag.  The inlined checks assumed by the stub are reordered
      to compare to undefined (the common case in toplevel code?) first.  On
      ARM a call to the runtime is used.  In the interest of code size no
      checks are yet inlined on ARM.
      
      Review URL: http://codereview.chromium.org/334006
      
      git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3118 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
      e82a07c0
  4. 22 Oct, 2009 2 commits
  5. 21 Oct, 2009 2 commits
  6. 19 Oct, 2009 1 commit
    • 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
  7. 16 Oct, 2009 1 commit
  8. 15 Oct, 2009 3 commits
  9. 14 Oct, 2009 1 commit
    • kmillikin@chromium.org's avatar
      Initial infrastructure for fast compilation of top-level code. The · f74e7235
      kmillikin@chromium.org authored
      fast code generator is optimized for compilation time and code size.
      
      Currently it is only implemented on IA32.  It is potentially triggered
      for any code in the global scope (including code eval'd in the global
      scope).  It performs a syntactic check and chooses to compile in fast
      mode if the AST contains only supported constructs and matches some
      other constraints.
      
      Initially supported constructs are
      
      * ExpressionStatement,
      * ReturnStatement,
      * VariableProxy (variable references) to parameters and
          stack-allocated locals,
      * Assignment with lhs a parameter or stack-allocated local, and
      * Literal
      
      This allows compilation of literals at the top level and not much
      else.
      
      All intermediate values are allocated to temporaries and the stack is
      used for all temporaries.  The extra memory traffic is a known issue.
      
      The code generated for 'true' is:
      
       0  push ebp
       1  mov ebp,esp
       3  push esi
       4  push edi
       5  push 0xf5cca135             ;; object: 0xf5cca135 <undefined>
      10  cmp esp,[0x8277efc]
      16  jnc 27  (0xf5cbbb1b)
      22  call 0xf5cac960             ;; code: STUB, StackCheck, minor: 0
      27  push 0xf5cca161             ;; object: 0xf5cca161 <true>
      32  mov eax,[esp]
      35  mov [ebp+0xf4],eax
      38  pop eax
      39  mov eax,[ebp+0xf4]
      42  mov esp,ebp                 ;; js return
      44  pop ebp
      45  ret 0x4
      48  mov eax,0xf5cca135          ;; object: 0xf5cca135 <undefined>
      53  mov esp,ebp                 ;; js return
      55  pop ebp
      56  ret 0x4
      
      Review URL: http://codereview.chromium.org/273050
      
      git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3067 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
      f74e7235