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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10834311: Split ToDouble into two IL instruction to make it work with SSA. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: rebased... Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 10708)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -100,7 +100,8 @@
M(UnarySmiOp, UnarySmiOpComp) \
M(NumberNegate, NumberNegateComp) \
M(CheckStackOverflow, CheckStackOverflowComp) \
- M(ToDouble, ToDoubleComp) \
+ M(DoubleToDouble, DoubleToDoubleComp) \
+ M(SmiToDouble, SmiToDoubleComp)
#define FORWARD_DECLARATION(ShortName, ClassName) class ClassName;
@@ -1707,32 +1708,46 @@
};
-class ToDoubleComp : public TemplateComputation<1> {
+class DoubleToDoubleComp : public TemplateComputation<1> {
public:
- ToDoubleComp(Value* value,
- intptr_t from,
- InstanceCallComp* instance_call)
- : from_(from), instance_call_(instance_call) {
+ DoubleToDoubleComp(Value* value, InstanceCallComp* instance_call)
+ : instance_call_(instance_call) {
ASSERT(value != NULL);
inputs_[0] = value;
}
Value* value() const { return inputs_[0]; }
- intptr_t from() const { return from_; }
InstanceCallComp* instance_call() const { return instance_call_; }
- virtual void PrintOperandsTo(BufferFormatter* f) const;
+ DECLARE_COMPUTATION(DoubleToDouble)
- DECLARE_COMPUTATION(ToDouble)
+ virtual bool CanDeoptimize() const { return true; }
+ private:
+ InstanceCallComp* instance_call_;
+
+ DISALLOW_COPY_AND_ASSIGN(DoubleToDoubleComp);
+};
+
+
+class SmiToDoubleComp : public TemplateComputation<0> {
+ public:
+ explicit SmiToDoubleComp(InstanceCallComp* instance_call)
+ : instance_call_(instance_call) { }
+
+ InstanceCallComp* instance_call() const { return instance_call_; }
+
+ DECLARE_CALL_COMPUTATION(SmiToDouble)
+
+ virtual intptr_t ArgumentCount() const { return 1; }
+
virtual bool CanDeoptimize() const { return true; }
private:
- const intptr_t from_;
InstanceCallComp* instance_call_;
- DISALLOW_COPY_AND_ASSIGN(ToDoubleComp);
+ DISALLOW_COPY_AND_ASSIGN(SmiToDoubleComp);
};
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698