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

Unified Diff: runtime/vm/intermediate_language.h

Issue 562203005: Inline toDouble calls on mints (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/flow_graph_type_propagator.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
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index f84ee20bfe69e4951b9a45076e072f27e4d778ea..e7933fcb63c2cf75952bee0dfd8a3d0db7d4bc2c 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -476,6 +476,7 @@ class EmbeddedArray<T, 0> {
M(CheckStackOverflow) \
M(SmiToDouble) \
M(Int32ToDouble) \
+ M(MintToDouble) \
M(DoubleToInteger) \
M(DoubleToSmi) \
M(DoubleToDouble) \
@@ -908,6 +909,7 @@ FOR_EACH_ABSTRACT_INSTRUCTION(INSTRUCTION_TYPE_CHECK)
friend class InstanceOfInstr;
friend class PolymorphicInstanceCallInstr;
friend class SmiToDoubleInstr;
+ friend class MintToDoubleInstr;
friend class DoubleToIntegerInstr;
friend class BranchSimplifier;
friend class BlockEntryInstr;
@@ -7223,8 +7225,6 @@ class SmiToDoubleInstr : public TemplateDefinition<1> {
return kUnboxedDouble;
}
- virtual intptr_t ArgumentCount() const { return 1; }
-
virtual bool CanDeoptimize() const { return false; }
virtual bool AllowsCSE() const { return true; }
@@ -7275,6 +7275,49 @@ class Int32ToDoubleInstr : public TemplateDefinition<1> {
};
+class MintToDoubleInstr : public TemplateDefinition<1> {
+ public:
+ MintToDoubleInstr(Value* value, intptr_t deopt_id)
+ : deopt_id_(deopt_id) {
+ SetInputAt(0, value);
+ }
+
+ Value* value() const { return inputs_[0]; }
+
+ DECLARE_INSTRUCTION(MintToDouble)
+ virtual CompileType ComputeType() const;
+
+ virtual Representation RequiredInputRepresentation(intptr_t index) const {
+ ASSERT(index == 0);
+ return kUnboxedMint;
+ }
+
+ virtual Representation representation() const {
+ return kUnboxedDouble;
+ }
+
+ virtual intptr_t DeoptimizationTarget() const {
+ // Direct access since this instruction cannot deoptimize, and the deopt-id
+ // was inherited from another instruction that could deoptimize.
+ return deopt_id_;
+ }
+
+ virtual bool CanDeoptimize() const { return false; }
+
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
+ virtual bool AttributesEqual(Instruction* other) const { return true; }
+
+ virtual bool MayThrow() const { return false; }
+
+ private:
+ const intptr_t deopt_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(MintToDoubleInstr);
+};
+
+
class DoubleToIntegerInstr : public TemplateDefinition<1> {
public:
DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call)
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698