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

Issue 2797993006: [turbofan] Add type to the allocation operator. (Closed)

Created:
3 years, 8 months ago by Jarin
Modified:
3 years, 8 months ago
Reviewers:
Benedikt Meurer
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
v8
Visibility:
Public.

Description

[turbofan] Add type to the allocation operator. This gives us more precise type information, so we can avoid some type guards to refine the type information back. The motivation for this is to help escape analysis by not introducing redundant type guards (which escape analysis cannot handle yet even though it could and should do). Motivating example: In the example below, the out-of-object property array for properties fld5 and fld6 gets type Any when it is created by "o.fld5 = 5" (for object literals, we store 4 properties in-objeca, the rest goes out of object). When we run load elimination for the load the out-of-object property array (to store 6 into o.fld6), load elimination inserts TypeGuard to enforce the Type::Internal() type. This makes escape analysis bail out on this object, and we do not eliminate the object creation. function f() { var o = {}; o.fld1 = 1; o.fld2 = 2; o.fld3 = 3; o.fld4 = 4; o.fld5 = 5; o.fld6 = 6; } f(); f(); %OptimizeFunctionOnNextCall(f); f(); Review-Url: https://codereview.chromium.org/2797993006 Cr-Commit-Position: refs/heads/master@{#44470} Committed: https://chromium.googlesource.com/v8/v8/+/e97b29a4c5741f11318416877fc43c3c8cea93a2

Patch Set 1 #

Patch Set 2 : Rename #

Total comments: 11

Patch Set 3 : Address review comments #

Patch Set 4 : Remove caching #

Unified diffs Side-by-side diffs Delta from patch set Stats (+70 lines, -43 lines) Patch
M src/compiler/graph-assembler.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/compiler/js-builtin-reducer.cc View 4 chunks +4 lines, -6 lines 0 comments Download
M src/compiler/js-create-lowering.cc View 1 chunk +1 line, -4 lines 0 comments Download
M src/compiler/js-native-context-specialization.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M src/compiler/js-typed-lowering.cc View 1 chunk +1 line, -2 lines 0 comments Download
M src/compiler/simplified-operator.h View 1 2 2 chunks +23 lines, -1 line 0 comments Download
M src/compiler/simplified-operator.cc View 1 2 3 3 chunks +30 lines, -21 lines 0 comments Download
M src/compiler/typer.cc View 1 chunk +3 lines, -1 line 0 comments Download
M test/unittests/compiler/escape-analysis-unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M test/unittests/compiler/load-elimination-unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 18 (12 generated)
Jarin
Could you take a look, please?
3 years, 8 months ago (2017-04-06 11:58:08 UTC) #4
Benedikt Meurer
https://codereview.chromium.org/2797993006/diff/20001/src/compiler/js-native-context-specialization.cc File src/compiler/js-native-context-specialization.cc (right): https://codereview.chromium.org/2797993006/diff/20001/src/compiler/js-native-context-specialization.cc#newcode1523 src/compiler/js-native-context-specialization.cc:1523: simplified()->Allocate(Type::Number(), NOT_TENURED), This should be Type::OtherInternal(). A MutableHeapNumber is ...
3 years, 8 months ago (2017-04-06 12:08:05 UTC) #5
Jarin
https://codereview.chromium.org/2797993006/diff/20001/src/compiler/js-native-context-specialization.cc File src/compiler/js-native-context-specialization.cc (right): https://codereview.chromium.org/2797993006/diff/20001/src/compiler/js-native-context-specialization.cc#newcode1523 src/compiler/js-native-context-specialization.cc:1523: simplified()->Allocate(Type::Number(), NOT_TENURED), On 2017/04/06 12:08:05, Benedikt Meurer wrote: > ...
3 years, 8 months ago (2017-04-06 15:11:29 UTC) #10
Benedikt Meurer
THank you, LGTM! https://codereview.chromium.org/2797993006/diff/20001/src/compiler/simplified-operator.h File src/compiler/simplified-operator.h (right): https://codereview.chromium.org/2797993006/diff/20001/src/compiler/simplified-operator.h#newcode249 src/compiler/simplified-operator.h:249: Type* type; On 2017/04/06 15:11:29, Jarin ...
3 years, 8 months ago (2017-04-06 17:22:28 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2797993006/60001
3 years, 8 months ago (2017-04-07 08:20:36 UTC) #15
commit-bot: I haz the power
3 years, 8 months ago (2017-04-07 08:32:23 UTC) #18
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/v8/v8/+/e97b29a4c5741f11318416877fc43c3c8ce...

Powered by Google App Engine
This is Rietveld 408576698