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

Issue 2755973002: [type profile] Collect return types. (Closed)

Created:
3 years, 9 months ago by Franzi
Modified:
3 years, 9 months ago
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
v8
Visibility:
Public.

Description

[type profile] Collect return types. Collect type information of return values. Use *one* feedback slot per function for all its return statements. For assignments, we currently use several slots per function, because not all assignments refer to the same variable. Instead of the variable names, pass the source location and print the function name. Add an integration test for --type-profile that checks for crashes. Remove type feedback for assignments for now as it convolutes the output. ************ Function with 2 return statements ******** function testFunction(param, flag) { // We want to test 2 different return positions in one function. if (flag) { var first_var = param; return first_var; } var second_var = param; return second_var; } testFunction({}); testFunction(123, true); testFunction('hello'); testFunction(undefined); ******************************************************* ************* Sample Output *************************** Function: testFunction 424: Object 374: number 424: string 424: undefined ******************************************************* Missing work: * Handle fall-off returns * Collect types for parameters * Remove duplicates from the list of collected types and use a common base class. BUG=v8:5935 Review-Url: https://codereview.chromium.org/2755973002 Cr-Commit-Position: refs/heads/master@{#43956} Committed: https://chromium.googlesource.com/v8/v8/+/de04df74129bba5539c6b887a2d2c81015fff866

Patch Set 1 #

Patch Set 2 : Fix off by 2 error. #

Patch Set 3 : Handle non variables. #

Patch Set 4 : One slot per function. #

Patch Set 5 : Output function name for return types. #

Patch Set 6 : Clean up. #

Total comments: 18

Patch Set 7 : Address review comments. #

Patch Set 8 : Use the source position. #

Total comments: 4

Patch Set 9 : Delete unnecessary checks. #

Patch Set 10 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+553 lines, -71 lines) Patch
M src/ast/ast.h View 1 2 3 4 5 2 chunks +11 lines, -0 lines 0 comments Download
M src/ast/ast-numbering.cc View 1 2 3 4 5 6 4 chunks +15 lines, -0 lines 0 comments Download
M src/compiler/bytecode-graph-builder.cc View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
M src/feedback-vector.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M src/feedback-vector.cc View 1 2 3 4 5 6 7 8 3 chunks +13 lines, -4 lines 0 comments Download
M src/interpreter/bytecode-array-builder.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/interpreter/bytecode-array-builder.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M src/interpreter/bytecode-generator.cc View 1 2 3 4 5 6 5 chunks +10 lines, -25 lines 0 comments Download
M src/interpreter/bytecodes.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/interpreter/interpreter-generator.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M src/runtime/runtime-object.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -3 lines 0 comments Download
M test/message/type-profile/collect-type-profile.js View 1 2 3 4 5 6 2 chunks +25 lines, -14 lines 0 comments Download
M test/message/type-profile/collect-type-profile.out View 1 2 3 4 5 6 7 1 chunk +15 lines, -15 lines 0 comments Download
A test/mjsunit/type-profile.js View 1 2 3 4 5 6 1 chunk +451 lines, -0 lines 0 comments Download

Messages

Total messages: 92 (74 generated)
Franzi
Hi Michael, Can you have a look? Type profiling is still WIP. As discussed offline, ...
3 years, 9 months ago (2017-03-17 14:58:07 UTC) #33
Michael Starzinger
Looking got, just some minor comments. https://codereview.chromium.org/2755973002/diff/110001/src/ast/ast-numbering.cc File src/ast/ast-numbering.cc (right): https://codereview.chromium.org/2755973002/diff/110001/src/ast/ast-numbering.cc#newcode678 src/ast/ast-numbering.cc:678: type_profile_for_return_value_ = nit: ...
3 years, 9 months ago (2017-03-20 09:29:26 UTC) #37
Michael Starzinger
https://codereview.chromium.org/2755973002/diff/110001/src/runtime/runtime-object.cc File src/runtime/runtime-object.cc (right): https://codereview.chromium.org/2755973002/diff/110001/src/runtime/runtime-object.cc#newcode705 src/runtime/runtime-object.cc:705: Object* function_name = vector->shared_function_info()->name(); On 2017/03/20 09:29:26, Michael Starzinger ...
3 years, 9 months ago (2017-03-20 09:31:49 UTC) #38
ahaas
https://codereview.chromium.org/2755973002/diff/110001/src/compiler/bytecode-graph-builder.h File src/compiler/bytecode-graph-builder.h (right): https://codereview.chromium.org/2755973002/diff/110001/src/compiler/bytecode-graph-builder.h#newcode87 src/compiler/bytecode-graph-builder.h:87: Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* ...
3 years, 9 months ago (2017-03-20 09:34:43 UTC) #40
ahaas
https://codereview.chromium.org/2755973002/diff/110001/src/compiler/bytecode-graph-builder.h File src/compiler/bytecode-graph-builder.h (right): https://codereview.chromium.org/2755973002/diff/110001/src/compiler/bytecode-graph-builder.h#newcode87 src/compiler/bytecode-graph-builder.h:87: Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* ...
3 years, 9 months ago (2017-03-20 09:53:36 UTC) #41
rmcilroy
https://codereview.chromium.org/2755973002/diff/110001/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2755973002/diff/110001/src/interpreter/bytecode-generator.cc#newcode1102 src/interpreter/bytecode-generator.cc:1102: .StoreAccumulatorInRegister(position); Any reason you need to store position as ...
3 years, 9 months ago (2017-03-20 10:02:46 UTC) #43
Yang
https://codereview.chromium.org/2755973002/diff/110001/src/ast/ast.h File src/ast/ast.h (right): https://codereview.chromium.org/2755973002/diff/110001/src/ast/ast.h#newcode898 src/ast/ast.h:898: class ReturnStatement final : public JumpStatement { On 2017/03/20 ...
3 years, 9 months ago (2017-03-20 10:07:24 UTC) #44
Michael Starzinger
On 2017/03/20 10:07:24, Yang wrote: > https://codereview.chromium.org/2755973002/diff/110001/src/ast/ast.h > File src/ast/ast.h (right): > > https://codereview.chromium.org/2755973002/diff/110001/src/ast/ast.h#newcode898 > ...
3 years, 9 months ago (2017-03-20 10:15:59 UTC) #45
Yang
On 2017/03/20 10:15:59, Michael Starzinger wrote: > On 2017/03/20 10:07:24, Yang wrote: > > https://codereview.chromium.org/2755973002/diff/110001/src/ast/ast.h ...
3 years, 9 months ago (2017-03-20 10:24:42 UTC) #46
Yang
On 2017/03/20 10:24:42, Yang wrote: > On 2017/03/20 10:15:59, Michael Starzinger wrote: > > On ...
3 years, 9 months ago (2017-03-20 10:25:21 UTC) #47
rmcilroy
On 2017/03/20 10:25:21, Yang wrote: > On 2017/03/20 10:24:42, Yang wrote: > > On 2017/03/20 ...
3 years, 9 months ago (2017-03-20 11:46:49 UTC) #48
Michael Starzinger
On 2017/03/20 10:24:42, Yang wrote: > On 2017/03/20 10:15:59, Michael Starzinger wrote: > > On ...
3 years, 9 months ago (2017-03-20 12:09:15 UTC) #49
Franzi
Hi Michi, hi Ross, I addressed your comments and removed all of the extra logic ...
3 years, 9 months ago (2017-03-20 15:38:39 UTC) #69
Michael Starzinger
LGTM from my side. https://codereview.chromium.org/2755973002/diff/110001/src/ast/ast.h File src/ast/ast.h (right): https://codereview.chromium.org/2755973002/diff/110001/src/ast/ast.h#newcode898 src/ast/ast.h:898: class ReturnStatement final : public ...
3 years, 9 months ago (2017-03-20 17:12:32 UTC) #72
rmcilroy
Intepreter/ LGTM, thanks.
3 years, 9 months ago (2017-03-20 17:52:39 UTC) #73
Franzi
https://codereview.chromium.org/2755973002/diff/190001/src/feedback-vector.cc File src/feedback-vector.cc (right): https://codereview.chromium.org/2755973002/diff/190001/src/feedback-vector.cc#newcode1086 src/feedback-vector.cc:1086: if (!maybe_entry->IsTuple2()) { On 2017/03/20 17:12:32, Michael Starzinger wrote: ...
3 years, 9 months ago (2017-03-20 19:29:37 UTC) #84
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/2755973002/230001
3 years, 9 months ago (2017-03-20 19:49:40 UTC) #89
commit-bot: I haz the power
3 years, 9 months ago (2017-03-20 19:51:31 UTC) #92
Message was sent while issue was closed.
Committed patchset #10 (id:230001) as
https://chromium.googlesource.com/v8/v8/+/de04df74129bba5539c6b887a2d2c81015f...

Powered by Google App Engine
This is Rietveld 408576698