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

Unified Diff: 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: 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
Index: vm/intermediate_language.h
===================================================================
--- vm/intermediate_language.h (revision 10648)
+++ 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,48 @@
};
-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)
srdjan 2012/08/14 21:21:26 Don't need instance_call, pass int deopt_id and tr
Florian Schneider 2012/08/15 10:27:23 Since the deopt_id has to agree for correctness, I
+ : 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> {
srdjan 2012/08/14 21:21:26 Shouldn't this be TemplateComputation<1> ?
Florian Schneider 2012/08/15 10:27:23 This instruction is implemented as call with pushe
+ public:
+ explicit SmiToDoubleComp(InstanceCallComp* instance_call)
+ : instance_call_(instance_call) { }
+
+ Value* value() const { return inputs_[0]; }
Florian Schneider 2012/08/15 10:27:23 I forgot to remove this function. I'll remove it b
+
+ 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);
};

Powered by Google App Engine
This is Rietveld 408576698