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

Issue 6219001: Split LInstruction into multiple variant to make our LIR more compact.... (Closed)

Created:
9 years, 11 months ago by fschneider
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Split LInstruction into multiple variant to make our LIR more compact. This change introduces LTemplateInstruction which is a specialized version of LInstruction and takes one template parameter to indicate whether the instruction produces a result operand. All instruction that do not have a result inherit from LTemplateInstruction<0>. Instructions that have a result operand from LTemplateInstruction<1> All the Define* function only operate on instructions with a result. For this to work I also refactored the places where we do LInstruction* result = new Lxyy into Lxyz* result = new Lxyz Committed: http://code.google.com/p/v8/source/detail?r=6245

Patch Set 1 #

Total comments: 5

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+273 lines, -248 lines) Patch
M src/ia32/lithium-ia32.h View 1 59 chunks +171 lines, -147 lines 0 comments Download
M src/ia32/lithium-ia32.cc View 1 44 chunks +102 lines, -100 lines 0 comments Download
M src/lithium-allocator.h View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
fschneider
This is a first step towards a bigger refactoring. Please have a look.
9 years, 11 months ago (2011-01-10 10:53:44 UTC) #1
Kevin Millikin (Chromium)
The approach LGTM, and this if fine as a work in progress. I think the ...
9 years, 11 months ago (2011-01-10 11:41:44 UTC) #2
fschneider
9 years, 11 months ago (2011-01-10 11:55:57 UTC) #3
http://codereview.chromium.org/6219001/diff/1/src/ia32/lithium-ia32.h
File src/ia32/lithium-ia32.h (right):

http://codereview.chromium.org/6219001/diff/1/src/ia32/lithium-ia32.h#newcode312
src/ia32/lithium-ia32.h:312: virtual void set_result(LOperand* operand) = 0;
On 2011/01/10 11:41:44, Kevin Millikin wrote:
> Maybe we should put these only on the Result=1 specialization as non-virtual
> member functions.  We could have a static casting function that checks types
in
> debug builds but that has no overhead in release builds, rather than incurring
a
> small overhead for each access.

Done.

http://codereview.chromium.org/6219001/diff/1/src/ia32/lithium-ia32.h#newcode337
src/ia32/lithium-ia32.h:337: template <int Result = 0>
On 2011/01/10 11:41:44, Kevin Millikin wrote:
> I think I'd rather have two separate specializations than the default
parameter.

Done.

Powered by Google App Engine
This is Rietveld 408576698