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

Issue 1077793003: Remove redundant variable descriptors from optimized code. (Closed)

Created:
5 years, 8 months ago by Florian Schneider
Modified:
5 years, 8 months ago
Reviewers:
srdjan, hausner
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Remove redundant variable descriptors from optimized code. The unoptimized code already contains a copy of these, so we don't need to store them in two places. R=hausner@google.com Committed: https://code.google.com/p/dart/source/detail?r=45228

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Patch Set 4 : lazy saved context #

Total comments: 6

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -22 lines) Patch
M runtime/vm/debugger.h View 1 2 3 4 3 chunks +1 line, -3 lines 0 comments Download
M runtime/vm/debugger.cc View 1 2 3 4 9 chunks +22 lines, -19 lines 0 comments Download
M runtime/vm/flow_graph_compiler.cc View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (2 generated)
Florian Schneider
5 years, 8 months ago (2015-04-14 14:24:46 UTC) #2
hausner
Two questions: 1) are the stack slots and context indices for variables guaranteed to be ...
5 years, 8 months ago (2015-04-14 15:44:30 UTC) #3
srdjan
On 2015/04/14 15:44:30, hausner wrote: > Two questions: > > 1) are the stack slots ...
5 years, 8 months ago (2015-04-14 16:06:13 UTC) #4
srdjan
https://codereview.chromium.org/1077793003/diff/1/runtime/vm/debugger.cc File runtime/vm/debugger.cc (right): https://codereview.chromium.org/1077793003/diff/1/runtime/vm/debugger.cc#newcode464 runtime/vm/debugger.cc:464: ? Code::Handle(function().unoptimized_code()).var_descriptors() unoptimized_code may not exist, you may need ...
5 years, 8 months ago (2015-04-14 16:53:01 UTC) #6
Florian Schneider
On 2015/04/14 15:44:30, hausner wrote: > Two questions: > > 1) are the stack slots ...
5 years, 8 months ago (2015-04-15 09:38:21 UTC) #7
Florian Schneider
https://codereview.chromium.org/1077793003/diff/1/runtime/vm/debugger.cc File runtime/vm/debugger.cc (right): https://codereview.chromium.org/1077793003/diff/1/runtime/vm/debugger.cc#newcode464 runtime/vm/debugger.cc:464: ? Code::Handle(function().unoptimized_code()).var_descriptors() On 2015/04/14 16:53:01, srdjan wrote: > unoptimized_code ...
5 years, 8 months ago (2015-04-15 10:07:07 UTC) #8
hausner
LGTM. I still have a bad gut feeling about having to recompile functions as a ...
5 years, 8 months ago (2015-04-15 16:11:29 UTC) #9
srdjan
https://codereview.chromium.org/1077793003/diff/20001/runtime/vm/debugger.cc File runtime/vm/debugger.cc (right): https://codereview.chromium.org/1077793003/diff/20001/runtime/vm/debugger.cc#newcode468 runtime/vm/debugger.cc:468: : code().var_descriptors(); Could this be just : var_descriptors = ...
5 years, 8 months ago (2015-04-15 16:25:45 UTC) #10
Florian Schneider
https://codereview.chromium.org/1077793003/diff/20001/runtime/vm/debugger.cc File runtime/vm/debugger.cc (right): https://codereview.chromium.org/1077793003/diff/20001/runtime/vm/debugger.cc#newcode468 runtime/vm/debugger.cc:468: : code().var_descriptors(); On 2015/04/15 16:25:45, srdjan wrote: > Could ...
5 years, 8 months ago (2015-04-16 11:37:19 UTC) #11
Florian Schneider
On 2015/04/15 16:11:29, hausner wrote: > LGTM. > > I still have a bad gut ...
5 years, 8 months ago (2015-04-16 11:44:38 UTC) #12
Florian Schneider
Matthias PTAL at latest patch: GetSavedCurrentContext now lazily computes the context and caches it in ...
5 years, 8 months ago (2015-04-16 13:08:02 UTC) #13
hausner
Now my concern is that each time a current context is needed, we allocate a ...
5 years, 8 months ago (2015-04-16 16:27:20 UTC) #14
Florian Schneider
Committed patchset #5 (id:80001) manually as r45228 (presubmit successful).
5 years, 8 months ago (2015-04-17 09:11:47 UTC) #15
Florian Schneider
5 years, 8 months ago (2015-04-17 09:12:07 UTC) #16
Message was sent while issue was closed.
https://codereview.chromium.org/1077793003/diff/60001/runtime/vm/debugger.cc
File runtime/vm/debugger.cc (right):

https://codereview.chromium.org/1077793003/diff/60001/runtime/vm/debugger.cc#...
runtime/vm/debugger.cc:521: RawContext*
ActivationFrame::GetSavedCurrentContext() {
On 2015/04/16 16:27:20, hausner wrote:
> It would be nice if this function could return an alias to the ctx_ handle
> field, or if there was another way to avoid having the caller of this function
> allocate a handle each time.

Done.

https://codereview.chromium.org/1077793003/diff/60001/runtime/vm/debugger.cc#...
runtime/vm/debugger.cc:522: if (!ctx_.IsNull()) return ctx_.raw();
On 2015/04/16 16:27:20, hausner wrote:
> What happens for functions that don't have a context? In that case, ctx_
remains
> null and we go thorugh this loop each time GetSavedCurrentContext is called.
> 
> Is there always a current context variable for each function now that it is
> stored in a stack slot instead of a dedicated register?

Yes, the context should never be null for any Dart function. If there is none,
it will be the canonical empty context.

https://codereview.chromium.org/1077793003/diff/60001/runtime/vm/debugger.cc#...
runtime/vm/debugger.cc:754: const Context& ctx =
Context::Handle(GetSavedCurrentContext());
On 2015/04/16 16:27:20, hausner wrote:
> VaraibleAt is called in a loop for each variable in each activation frame.  It
> would be nice if you didn't have to allocate a new handle each time we find a
> captured variable. (There is an implicit, somewhat expensive operation to get
to
> the current thread and zone to allocate the handle).

Done.

Powered by Google App Engine
This is Rietveld 408576698