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

Issue 10834311: Split ToDouble into two IL instruction to make it work with SSA. (Closed)

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

Description

Split ToDouble into two IL instruction to make it work with SSA. This CL removes the bailout from SSA on smi-to-double conversions. The smi-to-double conversion is implemented as a call and requires its operand pushed, the double-to-double conversion has normal input operands. Committed: https://code.google.com/p/dart/source/detail?r=10710

Patch Set 1 #

Total comments: 17

Patch Set 2 : #

Patch Set 3 : rebased... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+115 lines, -94 lines) Patch
M runtime/vm/compiler.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.cc View 1 2 1 chunk +15 lines, -15 lines 0 comments Download
M runtime/vm/il_printer.cc View 1 2 1 chunk +0 lines, -7 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 2 2 chunks +26 lines, -11 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 1 2 1 chunk +6 lines, -1 line 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 2 2 chunks +33 lines, -30 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 2 1 chunk +34 lines, -28 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Florian Schneider
8 years, 4 months ago (2012-08-14 16:31:43 UTC) #1
srdjan
LGTM after addressing comments. https://chromiumcodereview.appspot.com/10834311/diff/1/vm/compiler.cc File vm/compiler.cc (right): https://chromiumcodereview.appspot.com/10834311/diff/1/vm/compiler.cc#newcode408 vm/compiler.cc:408: // TODO(fschneider): Print unoptimized code ...
8 years, 4 months ago (2012-08-14 21:21:26 UTC) #2
Florian Schneider
8 years, 4 months ago (2012-08-15 10:27:23 UTC) #3
https://chromiumcodereview.appspot.com/10834311/diff/1/vm/compiler.cc
File vm/compiler.cc (right):

https://chromiumcodereview.appspot.com/10834311/diff/1/vm/compiler.cc#newcode408
vm/compiler.cc:408: // TODO(fschneider): Print unoptimized code along with the
optimized code.
On 2012/08/14 21:21:26, srdjan wrote:
> Why did you remove it if you added a TODO? Did the previous disassemble not
> work?

The ia32 disassembler does not work for unoptimized code that has a patched
entry code.

https://chromiumcodereview.appspot.com/10834311/diff/1/vm/flow_graph_optimize...
File vm/flow_graph_optimizer.cc (right):

https://chromiumcodereview.appspot.com/10834311/diff/1/vm/flow_graph_optimize...
vm/flow_graph_optimizer.cc:389: (class_ids[0] == kSmiCid)) {
On 2012/08/14 21:21:26, srdjan wrote:
> No else needed, previous if terminates with a return.

Done.

https://chromiumcodereview.appspot.com/10834311/diff/1/vm/intermediate_langua...
File vm/intermediate_language.h (right):

https://chromiumcodereview.appspot.com/10834311/diff/1/vm/intermediate_langua...
vm/intermediate_language.h:1713: DoubleToDoubleComp(Value* value,
InstanceCallComp* instance_call)
On 2012/08/14 21:21:26, srdjan wrote:
> Don't need instance_call, pass int deopt_id and try_index.

Since the deopt_id has to agree for correctness, I'd rather not pass it. Both
are duplicated from the instance call.

https://chromiumcodereview.appspot.com/10834311/diff/1/vm/intermediate_langua...
vm/intermediate_language.h:1734: class SmiToDoubleComp : public
TemplateComputation<0> {
On 2012/08/14 21:21:26, srdjan wrote:
> Shouldn't this be TemplateComputation<1> ?

This instruction is implemented as call with pushed arguments. Therefore, zero
inputs. The flow graph optimizer does not remove the PushArgument instruction
for its input in this case.

https://chromiumcodereview.appspot.com/10834311/diff/1/vm/intermediate_langua...
vm/intermediate_language.h:1739: Value* value() const { return inputs_[0]; }
I forgot to remove this function. I'll remove it before committing.

https://chromiumcodereview.appspot.com/10834311/diff/1/vm/intermediate_langua...
File vm/intermediate_language_ia32.cc (right):

https://chromiumcodereview.appspot.com/10834311/diff/1/vm/intermediate_langua...
vm/intermediate_language_ia32.cc:1994: locs->set_temp(0,
Location::RequiresRegister());
On 2012/08/14 21:21:26, srdjan wrote:
> Remove both set_temp(0, ...), kNumTemps = 0.

ia32 needs a temp register for the CompareClassId.

https://chromiumcodereview.appspot.com/10834311/diff/1/vm/intermediate_langua...
vm/intermediate_language_ia32.cc:2040: Register value = EBX;
On 2012/08/14 21:21:26, srdjan wrote:
> Allocate temp for EBX and use it here.

Since this instruction is a call, we can freely use all registers as temps.

https://chromiumcodereview.appspot.com/10834311/diff/1/vm/intermediate_langua...
vm/intermediate_language_ia32.cc:2041: __ movl(value, Address(ESP, 0));
On 2012/08/14 21:21:26, srdjan wrote:
> Why not popl(value) and add value to AddDeoptStub?

This is because of a subtle problem with deoptimiation. Maybe I should add a
comment: We need to preserve the arguemt until after the deoptimization point
because the deopt info assumes that the value is on the stack.

This instruction should probably be redesigned in a future CL, once we have
deferred code for the allocation call and can inline new-space allocation of
doubles.

https://chromiumcodereview.appspot.com/10834311/diff/1/vm/intermediate_langua...
File vm/intermediate_language_x64.cc (right):

https://chromiumcodereview.appspot.com/10834311/diff/1/vm/intermediate_langua...
vm/intermediate_language_x64.cc:2048: Register value = RBX;
On 2012/08/14 21:21:26, srdjan wrote:
> Ditto as for ia32 version.

Same as x64.

Powered by Google App Engine
This is Rietveld 408576698