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

Issue 57052: * String type inference using compiler framework. (Closed)

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

Description

Tracks static type of strings in frame elements and results. Uses static string type to optimize string additions.

Patch Set 1 #

Patch Set 2 : Missed som duplicate static type assignments. #

Total comments: 15

Patch Set 3 : Addressed comments. Does proper merge. #

Total comments: 25

Patch Set 4 : Changes relative to head of bleeding edge (don't do diff with earlier versions) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+462 lines, -114 lines) Patch
M src/ast.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/builtins.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/codegen-ia32.h View 1 2 3 2 chunks +4 lines, -3 lines 0 comments Download
M src/codegen-ia32.cc View 1 2 3 4 chunks +32 lines, -4 lines 0 comments Download
M src/jump-target.cc View 3 4 chunks +22 lines, -9 lines 0 comments Download
M src/prettyprinter.h View 1 chunk +1 line, -1 line 0 comments Download
M src/prettyprinter.cc View 4 chunks +5 lines, -5 lines 0 comments Download
M src/register-allocator.h View 1 2 3 4 chunks +91 lines, -5 lines 0 comments Download
M src/register-allocator.cc View 2 chunks +14 lines, -2 lines 0 comments Download
M src/register-allocator-inl.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/rewriter.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/runtime.js View 2 chunks +15 lines, -1 line 0 comments Download
M src/variables.h View 5 chunks +7 lines, -7 lines 0 comments Download
M src/variables.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/virtual-frame.h View 1 2 3 8 chunks +53 lines, -53 lines 0 comments Download
M src/virtual-frame.cc View 1 2 3 6 chunks +26 lines, -12 lines 0 comments Download
M src/virtual-frame-arm.h View 1 chunk +2 lines, -3 lines 0 comments Download
M src/virtual-frame-ia32.h View 1 chunk +1 line, -1 line 0 comments Download
M src/virtual-frame-ia32.cc View 1 2 3 3 chunks +6 lines, -3 lines 0 comments Download
A test/mjsunit/string-add.js View 1 2 1 chunk +175 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Lasse Reichstein
Not-as-big-as-seems code review, please. many of the changes comes from renaming the existing class StaticType ...
11 years, 8 months ago (2009-03-31 12:31:38 UTC) #1
William Hesse
I don't think this should be a byte, rather than a word, unless you know ...
11 years, 8 months ago (2009-03-31 13:19:59 UTC) #2
Kevin Millikin (Chromium)
Random superficial comments below. I'll take a closer look tonight or in the morning. http://codereview.chromium.org/57052/diff/40/44 ...
11 years, 8 months ago (2009-03-31 14:00:03 UTC) #3
Lasse Reichstein
http://codereview.chromium.org/57052/diff/40/49 File src/register-allocator.h (right): http://codereview.chromium.org/57052/diff/40/49#newcode56 Line 56: bool is_known() const { return static_type_ != UNKNOWN_TYPE; ...
11 years, 8 months ago (2009-03-31 16:41:49 UTC) #4
Lasse Reichstein
11 years, 8 months ago (2009-03-31 16:42:04 UTC) #5
Lasse Reichstein
Re-review, please. In particular the frame merging code has changed. http://codereview.chromium.org/57052/diff/2001/3010 File src/register-allocator.h (right): http://codereview.chromium.org/57052/diff/2001/3010#newcode45 ...
11 years, 8 months ago (2009-04-03 08:32:45 UTC) #6
Kevin Millikin (Chromium)
Does it need any changes to make ARM continue to work? http://codereview.chromium.org/57052/diff/40/49 File src/register-allocator.h (right): ...
11 years, 8 months ago (2009-04-03 09:49:22 UTC) #7
William Hesse
LGTM.
11 years, 8 months ago (2009-04-03 11:38:14 UTC) #8
Lasse Reichstein
11 years, 8 months ago (2009-04-03 12:43:21 UTC) #9
http://codereview.chromium.org/57052/diff/2001/3005
File src/jump-target.cc (right):

http://codereview.chromium.org/57052/diff/2001/3005#newcode286
Line 286: current.set_static_type(StaticType::unknown());
Changed "current" to be a pointer to the element in the frame, instead of a
copy.

http://codereview.chromium.org/57052/diff/2001/3005#newcode295
Line 295: current.set_static_type(merged_type);
And ditto.

http://codereview.chromium.org/57052/diff/2001/3010
File src/register-allocator.h (right):

http://codereview.chromium.org/57052/diff/2001/3010#newcode58
Line 58: bool is_jsstring() { return static_type_ == STRING_TYPE; }
So do I, but then the static factory method should be called string(), and that
makes the lint check barf because I use "string" without including "string.h".
Maybe I should capitalize the factory methods.

http://codereview.chromium.org/57052/diff/2001/3010#newcode63
Line 63: // if (object->IsSmi()) return smi();                 // Unused for
now.
On 2009/04/03 09:49:22, Kevin Millikin wrote:
> Go ahead and put the commented code in?  In any case, this probably deserves
a
> comment reminding that the order of comparisons is important (most specific
> first).

Done.

http://codereview.chromium.org/57052/diff/2001/3018
File src/virtual-frame.cc (right):

http://codereview.chromium.org/57052/diff/2001/3018#newcode446
Line 446: StaticType merge_type = static_type.merge(element.static_type());
I'll assert that there can't. If it turns out we are wrong, we'll have to figure
out whether the bug is in the assert or in the compiler.

http://codereview.chromium.org/57052/diff/2001/3019
File src/virtual-frame.h (right):

http://codereview.chromium.org/57052/diff/2001/3019#newcode47
Line 47: class FrameElement  {
Indeed it does.

http://codereview.chromium.org/57052/diff/2001/3019#newcode76
Line 76: return FrameElement(REGISTER, reg, is_synced != NOT_SYNCED,
static_type);
On 2009/04/03 09:49:22, Kevin Millikin wrote:
> ... so could you move the conversion from enum to bool all the way down into
the
> private constructor?

Done.

Powered by Google App Engine
This is Rietveld 408576698