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

Issue 545007: Introduce number type information in the virtual frame. (Closed)

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

Description

Introduce number type information in the virtual frame. Each frame element gets a new attribute with number type information. A frame element can be: - smi - heap number - number (i.e. either of the above) - or something else. The type information is propagated along with all virtual frame operations. Results popped from the frame carry the number information with them. Two optimizations in the code generator make use of the new information: - GenericBinaryOpSyub omits map checks if input operands are numbers. - Boolean conversion for numbers: Emit inline code for converting a number (smi or heap number) to boolean. Do not emit call to ToBoolean stub in this case. Committed: http://code.google.com/p/v8/source/detail?r=3861

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 40

Patch Set 7 : Introduce number type information in the virtual frame. ... #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Total comments: 12

Patch Set 11 : '' #

Total comments: 6

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Patch Set 15 : '' #

Patch Set 16 : merged with latest rev. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+662 lines, -171 lines) Patch
M src/frame-element.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 chunks +23 lines, -8 lines 0 comments Download
M src/frame-element.cc View 7 8 9 10 11 12 13 14 15 1 chunk +11 lines, -0 lines 0 comments Download
M src/ia32/codegen-ia32.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +19 lines, -12 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 8 chunks +159 lines, -38 lines 0 comments Download
M src/ia32/macro-assembler-ia32.h View 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 12 13 14 15 1 chunk +11 lines, -0 lines 0 comments Download
M src/ia32/virtual-frame-ia32.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +11 lines, -6 lines 0 comments Download
M src/ia32/virtual-frame-ia32.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 10 chunks +35 lines, -15 lines 0 comments Download
M src/jump-target.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 chunks +47 lines, -3 lines 0 comments Download
M src/jump-target-inl.h View 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download
A src/number-info.h View 7 8 9 10 11 12 13 1 chunk +53 lines, -0 lines 0 comments Download
M src/register-allocator.h View 7 8 9 10 11 12 13 14 15 4 chunks +13 lines, -2 lines 0 comments Download
M src/register-allocator.cc View 7 8 9 10 11 12 13 14 15 2 chunks +21 lines, -2 lines 0 comments Download
M src/virtual-frame.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +35 lines, -11 lines 0 comments Download
M src/x64/codegen-x64.h View 10 11 12 13 14 15 3 chunks +19 lines, -12 lines 0 comments Download
M src/x64/codegen-x64.cc View 10 11 12 13 14 15 5 chunks +114 lines, -36 lines 0 comments Download
M src/x64/macro-assembler-x64.h View 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download
M src/x64/macro-assembler-x64.cc View 12 13 14 15 1 chunk +11 lines, -0 lines 0 comments Download
M src/x64/virtual-frame-x64.h View 10 11 12 13 14 15 4 chunks +13 lines, -7 lines 0 comments Download
M src/x64/virtual-frame-x64.cc View 10 11 12 13 14 15 12 chunks +45 lines, -19 lines 0 comments Download
M tools/gyp/v8.gyp View 15 1 chunk +1 line, -0 lines 0 comments Download
M tools/visual_studio/v8_base.vcproj View 15 1 chunk +4 lines, -0 lines 0 comments Download
M tools/visual_studio/v8_base_arm.vcproj View 15 1 chunk +4 lines, -0 lines 0 comments Download
M tools/visual_studio/v8_base_x64.vcproj View 15 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
fschneider
This is a first version.
10 years, 11 months ago (2010-01-12 11:39:33 UTC) #1
fschneider
Uploaded new version: - Refactored NumberInfo to be a separate class - Make use of ...
10 years, 11 months ago (2010-01-14 14:00:07 UTC) #2
Kevin Millikin (Chromium)
http://codereview.chromium.org/545007/diff/5033/6018 File src/frame-element.h (right): http://codereview.chromium.org/545007/diff/5033/6018#newcode56 src/frame-element.h:56: NumberInfo::Type number_info() { For functions like this, where every ...
10 years, 11 months ago (2010-01-14 15:47:30 UTC) #3
fschneider
Uploaded new version (ia-32 only). Tests pass. Needs another round of cleanup. - Results have ...
10 years, 11 months ago (2010-01-19 19:01:51 UTC) #4
fschneider
Uploaded new version: +Merged with latest revision. +Added debug code to verify assumptions about numbers.
10 years, 11 months ago (2010-01-28 17:34:11 UTC) #5
fschneider
Uploaded x64 version.
10 years, 10 months ago (2010-02-11 12:55:04 UTC) #6
Kevin Millikin (Chromium)
A few comments below. It basically LGTM. http://codereview.chromium.org/545007/diff/16001/17008 File src/frame-element.h (right): http://codereview.chromium.org/545007/diff/16001/17008#newcode240 src/frame-element.h:240: class CopiedField: ...
10 years, 10 months ago (2010-02-15 13:02:09 UTC) #7
fschneider
10 years, 10 months ago (2010-02-15 14:07:41 UTC) #8
Addressed comment + fixed lint errors.

http://codereview.chromium.org/545007/diff/16001/17008
File src/frame-element.h (right):

http://codereview.chromium.org/545007/diff/16001/17008#newcode240
src/frame-element.h:240: class CopiedField: public BitField<uint32_t, 3, 1> {};
On 2010/02/15 13:02:09, Kevin Millikin wrote:
> Could you change the type to "bool" on this field and the next?

Done.

http://codereview.chromium.org/545007/diff/16001/17002
File src/ia32/codegen-ia32.cc (right):

http://codereview.chromium.org/545007/diff/16001/17002#newcode1005
src/ia32/codegen-ia32.cc:1005: bool left_is_non_smi = left.is_constant() &&
!left.handle()->IsSmi();
On 2010/02/15 13:02:09, Kevin Millikin wrote:
> This should probably be renamed to left_is_non_smi_constant.

Done.

http://codereview.chromium.org/545007/diff/16001/17002#newcode1059
src/ia32/codegen-ia32.cc:1059: if (only_numbers)
On 2010/02/15 13:02:09, Kevin Millikin wrote:
> All on one line like
> 
> if (only_numbers) info = NumberInfo::kNumber;
> 
> or else braces like
> 
> if (only_numbers) {
>   info = NumberInfo::kNumber;
> }

Done.

http://codereview.chromium.org/545007/diff/16001/17002#newcode7573
src/ia32/codegen-ia32.cc:7573: if (only_numbers_in_stub_) {
On 2010/02/15 13:02:09, Kevin Millikin wrote:
> You could also optimize the non-sse version, no?

Done. I also added a macro assembler function to emit the debug-code to avoid
code duplication for this check.

http://codereview.chromium.org/545007/diff/16001/17002#newcode7604
src/ia32/codegen-ia32.cc:7604: GenerateHeapResultAllocation(masm,
&call_runtime);
On 2010/02/15 13:02:09, Kevin Millikin wrote:
> In the only numbers case, you can do the allocation before the XMM register
load
> (because the xmm load can't fail).  I think you would have to preserve eax for
> the heap allocation or (better yet) pass a desired result register to
> GenerateHeapResultAllocation.

Doing as a separate change.

http://codereview.chromium.org/545007/diff/16001/17002#newcode8079
src/ia32/codegen-ia32.cc:8079: void
FloatingPointHelper::LoadSSE2Operands(MacroAssembler* masm) {
On 2010/02/15 13:02:09, Kevin Millikin wrote:
> If this takes a scratch register you can use the scratch register for smi
> untagging, then you don't have to retag.

Good point. I'll do this as a separate change.

http://codereview.chromium.org/545007/diff/21001/22007
File src/jump-target.cc (right):

http://codereview.chromium.org/545007/diff/21001/22007#newcode109
src/jump-target.cc:109:
element->set_number_info(NumberInfo::Combine(element->number_info(),
On 2010/02/15 13:02:09, Kevin Millikin wrote:
> I'd like a short comment here to point out that we're changing the number info
> on one of the incoming frames but that it's safe because we only use that
frame
> for emitting merge code.

Done.

http://codereview.chromium.org/545007/diff/21001/22006
File src/number-info.h (right):

http://codereview.chromium.org/545007/diff/21001/22006#newcode28
src/number-info.h:28: #ifndef V8_NUMBERINFO_H_
On 2010/02/15 13:02:09, Kevin Millikin wrote:
> The include guard should be V8_NUMBER_INFO_H_

Done.

http://codereview.chromium.org/545007/diff/21001/22006#newcode54
src/number-info.h:54: #endif  // V8_kNumberTypeINFO_H_
On 2010/02/15 13:02:09, Kevin Millikin wrote:
> Too much search and replace.

Indeed :)

Done.

Powered by Google App Engine
This is Rietveld 408576698