Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Issue 300003: Recognize in the fast-mode code generator when a subexpression is a... (Closed)

Created:
11 years, 2 months ago by Kevin Millikin (Chromium)
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Recognize in the fast-mode code generator when a subexpression is a 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. Committed: http://code.google.com/p/v8/source/detail?r=3088

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -57 lines) Patch
M src/arm/fast-codegen-arm.cc View 2 chunks +44 lines, -20 lines 0 comments Download
M src/compiler.cc View 1 chunk +1 line, -0 lines 0 comments Download
M src/fast-codegen.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M src/ia32/fast-codegen-ia32.cc View 2 chunks +44 lines, -18 lines 1 comment Download
M src/location.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/x64/fast-codegen-x64.cc View 2 chunks +44 lines, -19 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Kevin Millikin (Chromium)
11 years, 2 months ago (2009-10-19 06:44:48 UTC) #1
iposva
On 2009/10/19 06:44:48, Kevin Millikin wrote: > The generated code for ARM did not include ...
11 years, 2 months ago (2009-10-19 07:03:16 UTC) #2
William Hesse
LGTM.
11 years, 2 months ago (2009-10-19 08:54:29 UTC) #3
fschneider
11 years, 2 months ago (2009-10-19 09:21:38 UTC) #4
LGTM.

http://codereview.chromium.org/300003/diff/1/2
File src/ia32/fast-codegen-ia32.cc (right):

http://codereview.chromium.org/300003/diff/1/2#newcode183
Line 183: __ push(eax);
LGTM. As a future optimization: Do we have to push onto the stack? The result is
already stored in the variable slot. Could we set the location of the assignment
node to sth. like 'variable slot'?

Powered by Google App Engine
This is Rietveld 408576698