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

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
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 43259525404313dd9dc516b2faa3a75464c6894b..71d8fc215e7bfae6a5bdf4be55dbaf9d049e3a07 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) \
@@ -904,6 +905,7 @@ FOR_EACH_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;
@@ -7232,6 +7234,51 @@ 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 intptr_t ArgumentCount() const { return 1; }
Florian Schneider 2014/09/17 11:15:32 Why is ArgumentCount 1? There should not be any pu
Cutch 2014/09/18 16:39:49 And here.
+
+ 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)

Powered by Google App Engine
This is Rietveld 408576698