Chromium Code Reviews| Index: runtime/vm/flow_graph_compiler_ia32.cc |
| =================================================================== |
| --- runtime/vm/flow_graph_compiler_ia32.cc (revision 8696) |
| +++ runtime/vm/flow_graph_compiler_ia32.cc (working copy) |
| @@ -71,6 +71,31 @@ |
| } |
| +// TODO(srdjan): For Math.sqrt read type feedback in Math.sqrt and decide |
| +// if the argument is double, smi or something else. |
|
srdjan
2012/06/14 23:30:08
Math.sqrt is a static method, we do not collect ty
regis
2012/06/15 00:33:59
Removed TODO.
|
| +void FlowGraphCompiler::GenerateInlinedMathSqrt(Label* done) { |
| + Label smi_to_double, call_method; |
| + __ movl(EAX, Address(ESP, 0)); |
| + __ testl(EAX, Immediate(kSmiTagMask)); |
| + __ j(ZERO, &smi_to_double, Assembler::kNearJump); |
| + __ CompareClassId(EAX, kDouble, EBX); |
| + __ j(NOT_EQUAL, &call_method, Assembler::kNearJump); |
| + __ movsd(XMM1, FieldAddress(EAX, Double::value_offset())); |
| + __ sqrtsd(XMM0, XMM1); |
| + // TODO(regis): Should we cache double_class in FlowGraphCompiler instance? |
|
srdjan
2012/06/14 23:30:08
Yes, there are also similar TODO's for vegorov.
regis
2012/06/15 00:33:59
Done.
|
| + const Class& double_class = |
| + Class::ZoneHandle(Isolate::Current()->object_store()->double_class()); |
| + AssemblerMacros::TryAllocate(assembler_, |
| + double_class, |
| + &call_method, |
| + EAX); // Result register. |
| + __ movsd(FieldAddress(EAX, Double::value_offset()), XMM0); |
| + __ jmp(done); |
| + __ Bind(&smi_to_double); |
|
srdjan
2012/06/14 23:30:08
Add comment: Smi to Double calls static method?
Wh
regis
2012/06/15 00:33:59
Done.
|
| + __ Bind(&call_method); |
| +} |
| + |
| + |
| void FlowGraphCompiler::GenerateCallRuntime(intptr_t cid, |
| intptr_t token_index, |
| intptr_t try_index, |