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

Issue 10830131: Adding deopt info to code object. (Closed)

Created:
8 years, 4 months ago by srdjan
Modified:
8 years, 4 months ago
Reviewers:
siva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Adding deopt info to code object. Committed: https://code.google.com/p/dart/source/detail?r=10189

Patch Set 1 #

Total comments: 11

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+260 lines, -16 lines) Patch
M runtime/vm/code_descriptors.h View 1 2 chunks +5 lines, -1 line 0 comments Download
M runtime/vm/code_descriptors.cc View 1 1 chunk +15 lines, -0 lines 0 comments Download
M runtime/vm/object.h View 1 8 chunks +80 lines, -6 lines 0 comments Download
M runtime/vm/object.cc View 1 12 chunks +113 lines, -9 lines 0 comments Download
M runtime/vm/raw_object.h View 1 3 chunks +15 lines, -0 lines 0 comments Download
M runtime/vm/raw_object.cc View 1 2 chunks +16 lines, -0 lines 0 comments Download
M runtime/vm/raw_object_snapshot.cc View 1 1 chunk +16 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
srdjan
8 years, 4 months ago (2012-08-02 00:15:31 UTC) #1
siva
One question regarding mapping the index into the deopt info array as the to-index. LGTM ...
8 years, 4 months ago (2012-08-02 16:57:37 UTC) #2
srdjan
8 years, 4 months ago (2012-08-02 17:51:44 UTC) #3
https://chromiumcodereview.appspot.com/10830131/diff/1/runtime/vm/code_descri...
File runtime/vm/code_descriptors.h (right):

https://chromiumcodereview.appspot.com/10830131/diff/1/runtime/vm/code_descri...
runtime/vm/code_descriptors.h:21: intptr_t try_index;        // Try block index
of PC.
On 2012/08/02 16:57:37, asiva wrote:
> update the comment to indicate it is try block index or deopt array index.

Done.

https://chromiumcodereview.appspot.com/10830131/diff/1/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://chromiumcodereview.appspot.com/10830131/diff/1/runtime/vm/object.cc#n...
runtime/vm/object.cc:6922: 
On 2012/08/02 16:57:37, asiva wrote:
> For better readability it might make sense to also have a
> intptr_t DeoptInfo::ToIndex(intptr_t index) const {
>   return index;
> }
> 
> method  and use this consistently instead of index directly.

Done

https://chromiumcodereview.appspot.com/10830131/diff/1/runtime/vm/object.cc#n...
runtime/vm/object.cc:7081:
result.set_object_table(Array::Handle(Array::Empty()));
On 2012/08/02 16:57:37, asiva wrote:
> Is there an advantage to initializing these to empty arrays as opposed to
> leaving them as null objects?
> 
> I am presuming you would have to do a set_deopt_info_array and
set_object_table
> after generating code for the method at that point you could set them to empty
> arrays if there is no deopt info at all for the method.

Removed code, setting them to NULL.

https://chromiumcodereview.appspot.com/10830131/diff/1/runtime/vm/object.h
File runtime/vm/object.h (right):

https://chromiumcodereview.appspot.com/10830131/diff/1/runtime/vm/object.h#ne...
runtime/vm/object.h:2434: // 'index' corresponds to target, to-index.
On 2012/08/02 16:57:37, asiva wrote:
> We have one deopt_info array per code object and we will have multiple
deopt-ix
> pc descriptor entries pointing into this deopt info array. For the first pc
> descriptor entry I can see how index and to-index map nicely but for the
> subsequent ones you would have to do subtract index from the start index
right?
> I am little confused by this maybe you can explain offline.

Discussed offline. There is another level of indirection: deopt-ix points to an
array of DeoptInfo objects.

https://chromiumcodereview.appspot.com/10830131/diff/1/runtime/vm/raw_object.cc
File runtime/vm/raw_object.cc (right):

https://chromiumcodereview.appspot.com/10830131/diff/1/runtime/vm/raw_object....
runtime/vm/raw_object.cc:236: intptr_t num_handlers =
Smi::Value(raw_handlers->ptr()->length_);
On 2012/08/02 16:57:37, asiva wrote:
> num_handlers => num_entries ?
> as these are not exception handler entries but just deopt entries.
> 
> similarly instead of raw_handlers raw_deoptinfo

Done.

Powered by Google App Engine
This is Rietveld 408576698