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

Issue 10825236: Replace deopt stubs location/register shuffling with using deopt-info. (Closed)

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

Description

Replace deopt stubs location/register shuffling with using deopt-info. Added deopt instruction commands. Also fixes a crash in IA32 with use_ssa where the stack is incorrect after deoptimization. Tested IA32 with and without use-ssa. Committed: https://code.google.com/p/dart/source/detail?r=10469

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 16

Patch Set 6 : #

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+323 lines, -138 lines) Patch
M runtime/vm/code_generator.cc View 1 2 3 4 5 6 chunks +146 lines, -53 lines 0 comments Download
M runtime/vm/deopt_instructions.h View 1 2 3 4 5 4 chunks +58 lines, -2 lines 0 comments Download
M runtime/vm/deopt_instructions.cc View 1 2 3 4 5 9 chunks +99 lines, -6 lines 0 comments Download
M runtime/vm/flow_graph_compiler.cc View 1 2 3 4 5 1 chunk +6 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 1 2 3 4 5 2 chunks +2 lines, -46 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 2 3 4 5 2 chunks +6 lines, -27 lines 0 comments Download
M runtime/vm/isolate.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/stub_code_ia32.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/stub_code_x64.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
srdjan
8 years, 4 months ago (2012-08-09 18:39:31 UTC) #1
siva
lgtm https://chromiumcodereview.appspot.com/10825236/diff/6007/runtime/vm/code_generator.cc File runtime/vm/code_generator.cc (right): https://chromiumcodereview.appspot.com/10825236/diff/6007/runtime/vm/code_generator.cc#newcode1420 runtime/vm/code_generator.cc:1420: intptr_t* registers_copy = new intptr_t[kNumberOfCpuRegisters]; Why did you ...
8 years, 4 months ago (2012-08-09 21:38:19 UTC) #2
srdjan
8 years, 4 months ago (2012-08-09 23:28:30 UTC) #3
Thanks!

https://chromiumcodereview.appspot.com/10825236/diff/6007/runtime/vm/code_gen...
File runtime/vm/code_generator.cc (right):

https://chromiumcodereview.appspot.com/10825236/diff/6007/runtime/vm/code_gen...
runtime/vm/code_generator.cc:1420: intptr_t* registers_copy = new
intptr_t[kNumberOfCpuRegisters];
On 2012/08/09 21:38:19, asiva wrote:
> Why did you choose to make the register copy an allocated object instead of a
> buffer in the isolate object?

I did not want to always allocate one per Isolate. In near future we will also
have XMM registers in the buffer.

https://chromiumcodereview.appspot.com/10825236/diff/6007/runtime/vm/code_gen...
runtime/vm/code_generator.cc:1427:
Isolate::Current()->set_deopt_registers_copy(registers_copy);
On 2012/08/09 21:38:19, asiva wrote:
> We should add an assert in set_deopt_registers_copy 
> ASSERT(deopt_registers_copy_ == NULL);
> to ensure that we don't go and stomp an existing value.

And prevents memory leak ... good idea, done.

https://chromiumcodereview.appspot.com/10825236/diff/6007/runtime/vm/code_gen...
runtime/vm/code_generator.cc:1454:
Isolate::Current()->SetDeoptFrameCopy(frame_copy, frame_copy_size);
On 2012/08/09 21:38:19, asiva wrote:
> Similarly assert
> ASSERT(deopt_frame_copy_ == NULL);
> in SetDeoptFrameCopy(..);

Done.

https://chromiumcodereview.appspot.com/10825236/diff/6007/runtime/vm/deopt_in...
File runtime/vm/deopt_instructions.cc (right):

https://chromiumcodereview.appspot.com/10825236/diff/6007/runtime/vm/deopt_in...
runtime/vm/deopt_instructions.cc:132:
deopt_context->ObjectAt(object_table_index_));
On 2012/08/09 21:38:19, asiva wrote:
> There will be many ConstInstr instructions so it might be more efficient to
> create the object handle in deopt_context once and use it here.

Discussed off-line, caching isolate instead.

https://chromiumcodereview.appspot.com/10825236/diff/6007/runtime/vm/deopt_in...
File runtime/vm/deopt_instructions.h (right):

https://chromiumcodereview.appspot.com/10825236/diff/6007/runtime/vm/deopt_in...
runtime/vm/deopt_instructions.h:21: // 'frame_start' points to the return
address just below the frame's
On 2012/08/09 21:38:19, asiva wrote:
> 'frame_start' -> 'to_frame_start'

Done.

https://chromiumcodereview.appspot.com/10825236/diff/6007/runtime/vm/deopt_in...
runtime/vm/deopt_instructions.h:26: intptr_t num_args);
On 2012/08/09 21:38:19, asiva wrote:
> why explicit?

Removed

https://chromiumcodereview.appspot.com/10825236/diff/6007/runtime/vm/deopt_in...
runtime/vm/deopt_instructions.h:34: ASSERT(0 <= index);
On 2012/08/09 21:38:19, asiva wrote:
> Is there a way to assert that index is valid on the higher side.

Passing additional to_frame_size and checking it here.

https://chromiumcodereview.appspot.com/10825236/diff/6007/runtime/vm/flow_gra...
File runtime/vm/flow_graph_compiler_x64.cc (right):

https://chromiumcodereview.appspot.com/10825236/diff/6007/runtime/vm/flow_gra...
runtime/vm/flow_graph_compiler_x64.cc:45: // TMP is never part od deoptimization
environment.
On 2012/08/09 21:38:19, asiva wrote:
> od -> of

Done.

Powered by Google App Engine
This is Rietveld 408576698