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

Issue 15037: Experimental: use the Result class to manage the lifetime of registers... (Closed)

Created:
12 years ago by Kevin Millikin (Chromium)
Modified:
9 years, 7 months ago
Reviewers:
William Hesse
CC:
v8-dev
Visibility:
Public.

Description

Experimental: use the Result class to manage the lifetime of registers returned by the register allocator. It was simplest to move it to the register allocator source file. Implemented copy constructor and assignment operator for results. Some minor cleanup. Committed: http://code.google.com/p/v8/source/detail?r=1004

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+210 lines, -162 lines) Patch
M src/codegen-ia32.cc View 1 chunk +5 lines, -6 lines 2 comments Download
M src/register-allocator-ia32.h View 3 chunks +92 lines, -7 lines 2 comments Download
M src/register-allocator-ia32.cc View 1 chunk +70 lines, -18 lines 3 comments Download
M src/virtual-frame-ia32.h View 2 chunks +4 lines, -62 lines 0 comments Download
M src/virtual-frame-ia32.cc View 1 8 chunks +39 lines, -69 lines 2 comments Download

Messages

Total messages: 3 (0 generated)
Kevin Millikin (Chromium)
This turns out to be a useful step on the way to handling jump targets ...
12 years ago (2008-12-18 15:44:38 UTC) #1
William Hesse
Mainly I have suggestions for further additions, and the existing code LGTM. http://codereview.chromium.org/15037/diff/206/12 File src/codegen-ia32.cc ...
12 years ago (2008-12-19 08:41:03 UTC) #2
Kevin Millikin (Chromium)
12 years ago (2008-12-19 08:48:11 UTC) #3
http://codereview.chromium.org/15037/diff/206/12
File src/codegen-ia32.cc (right):

http://codereview.chromium.org/15037/diff/206/12#newcode2672
Line 2672: frame_->Push(&temp);
On 2008/12/19 08:41:03, William Hesse wrote:
> I thought this was in the assembler's Set() function.  Once we have constant
> folding, the attacker can put a 32-bit SMI in the code by x = bad_word - 1 +
1. 
> Can this be put in Set() instead?

Possibly, but there's probably a better way.  Ideally (once we have constant
folding :)) we will just track whether values are "contaminated" by originating
with source literals.

MacroAssembler::Set is too low-level for that.  It doesn't have any idea about
where the operand originated, and it's too late to figure it out by the time
it's called.

http://codereview.chromium.org/15037/diff/206/8
File src/register-allocator-ia32.cc (right):

http://codereview.chromium.org/15037/diff/206/8#newcode93
Line 93: Use(edi);
On 2008/12/19 08:41:03, William Hesse wrote:
> Pretty sad, that we use all of these. :(

Those are the callee-save registers at JS function calls.  Of those, edi isn't
actually reserved.  We can free up esi too.

We have to come up with a better way to track reserved registers, too.

http://codereview.chromium.org/15037/diff/206/11
File src/register-allocator-ia32.h (right):

http://codereview.chromium.org/15037/diff/206/11#newcode94
Line 94: 
On 2008/12/19 08:41:03, William Hesse wrote:
> Do we also want ToRegister(Register target)?

Ultimately, yes.  It was in a withdrawn change I sent out a few days ago, and
it'll pop up again soon.

http://codereview.chromium.org/15037/diff/206/9
File src/virtual-frame-ia32.cc (right):

http://codereview.chromium.org/15037/diff/206/9#newcode349
Line 349: frame_registers_.count(element.reg().code()) > 1)) {
On 2008/12/19 08:41:03, William Hesse wrote:
> Shouldn't we overload count() and is_used() to take
> a Register, as well as a code?  We have so many occurrences
> of is_used(x.reg().code()).

Good idea.  You want to do it :)

Powered by Google App Engine
This is Rietveld 408576698