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

Issue 19054006: Implement simple effect typing for variables (Closed)

Created:
7 years, 5 months ago by rossberg
Modified:
7 years, 5 months ago
Reviewers:
titzer, Jakob Kummerow
CC:
v8-dev
Visibility:
Public.

Description

Implement simple effect typing for variables For that, we maintain an abstract store typing of all variables with LOCAL location (i.e., those that do not escape the function's own scope). We treat assignments as sequential effects that modify this store. When control flow branches, we have to compute the disjunction of possible effects. To that end, we represent the store as a stack of effect sets, such that we can cheaply push and pop "local" effects when control flow has to branch. In cases of non-local control transfer from an unknown source, we currently erase all knowledge about the store. The 'switch' statement is still to come. For a formulation of the typing rules, see: https://docs.google.com/a/google.com/file/d/0B3wuXSv9YKuKeUNkVXZDemZ0Z1E ;) R=jkummerow@chromium.org BUG= Committed: http://code.google.com/p/v8/source/detail?r=15776

Patch Set 1 : Tweak #

Patch Set 2 : Minor fix #

Total comments: 8

Patch Set 3 : Comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+574 lines, -61 lines) Patch
M src/ast.h View 1 chunk +1 line, -1 line 0 comments Download
A src/effects.h View 1 2 1 chunk +361 lines, -0 lines 0 comments Download
M src/splay-tree.h View 3 chunks +11 lines, -3 lines 0 comments Download
M src/splay-tree-inl.h View 2 chunks +8 lines, -1 line 0 comments Download
M src/types.h View 1 chunk +5 lines, -0 lines 0 comments Download
M src/typing.h View 3 chunks +17 lines, -0 lines 0 comments Download
M src/typing.cc View 1 24 chunks +161 lines, -56 lines 0 comments Download
M src/zone.h View 2 chunks +3 lines, -0 lines 0 comments Download
M src/zone-inl.h View 1 chunk +6 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
rossberg
7 years, 5 months ago (2013-07-11 16:40:23 UTC) #1
titzer
Where is this mythical src/effects.h?
7 years, 5 months ago (2013-07-11 16:48:46 UTC) #2
Jakob Kummerow
LGTM with nits. https://codereview.chromium.org/19054006/diff/13001/src/effects.h File src/effects.h (right): https://codereview.chromium.org/19054006/diff/13001/src/effects.h#newcode122 src/effects.h:122: effect = Effect::Seq(locator.value(), effect, Base::isolate()); nit: ...
7 years, 5 months ago (2013-07-19 12:09:03 UTC) #3
rossberg
Committed patchset #3 manually as r15776 (presubmit successful).
7 years, 5 months ago (2013-07-19 12:54:36 UTC) #4
rossberg
7 years, 5 months ago (2013-07-19 12:54:41 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/19054006/diff/13001/src/effects.h
File src/effects.h (right):

https://codereview.chromium.org/19054006/diff/13001/src/effects.h#newcode122
src/effects.h:122: effect = Effect::Seq(locator.value(), effect,
Base::isolate());
On 2013/07/19 12:09:03, Jakob wrote:
> nit: {} please

Done.

https://codereview.chromium.org/19054006/diff/13001/src/effects.h#newcode135
src/effects.h:135: effect = Effect::Alt(locator.value(), effect,
Base::isolate());
On 2013/07/19 12:09:03, Jakob wrote:
> nit: {} please

Done.

https://codereview.chromium.org/19054006/diff/13001/src/effects.h#newcode216
src/effects.h:216: typedef ZoneSplayTree<SplayTreeConfig> Map;
On 2013/07/19 12:09:03, Jakob wrote:
> We already have a v8::internal::Map. Please use another name here. EffectsMap?

Done.

https://codereview.chromium.org/19054006/diff/13001/src/effects.h#newcode248
src/effects.h:248: explicit Effects(Zone* zone) :
On 2013/07/19 12:09:03, Jakob wrote:
> nit: ':' goes on the next line. Line break suggestion:
> 
>   explicit Effects(Zone* zone)
>       : EffectsMixin<Var,
>                      EffectsBase<Var, kNoVar>,
>                      Effects<Var, kNoVar> >(zone) {}

Done (though with fewer breaks)

Powered by Google App Engine
This is Rietveld 408576698