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

Unified Diff: runtime/vm/intermediate_language.h

Issue 11573044: Inline Doubles truncate and round. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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_optimizer.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 16975)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -44,6 +44,8 @@
V(_StringBase, [], StringBaseCharAt, 1062366987) \
V(_IntegerImplementation, toDouble, IntegerToDouble, 733149324) \
V(_Double, toInt, DoubleToInteger, 362666636) \
+ V(_Double, truncate, DoubleTruncate, 620870996) \
+ V(_Double, round, DoubleRound, 620870996) \
V(::, sqrt, MathSqrt, 1662640002) \
// Class that recognizes the name and owner of a function and returns the
@@ -254,6 +256,7 @@
M(SmiToDouble) \
M(DoubleToInteger) \
M(DoubleToSmi) \
+ M(DoubleToDouble) \
M(CheckClass) \
M(CheckSmi) \
M(Constant) \
@@ -511,6 +514,7 @@
friend class StringCharCodeAtInstr;
friend class LICM;
friend class DoubleToSmiInstr;
+ friend class DoubleToDoubleInstr;
intptr_t deopt_id_;
intptr_t lifetime_position_; // Position used by register allocator.
@@ -4022,6 +4026,48 @@
};
+class DoubleToDoubleInstr : public TemplateDefinition<1> {
+ public:
+ DoubleToDoubleInstr(Value* value,
+ InstanceCallInstr* instance_call,
+ MethodRecognizer::Kind recognized_kind)
+ : recognized_kind_(recognized_kind) {
+ ASSERT(value != NULL);
+ inputs_[0] = value;
+ deopt_id_ = instance_call->deopt_id();
+ }
+
+ Value* value() const { return inputs_[0]; }
+
+ MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; }
+
+ DECLARE_INSTRUCTION(DoubleToDouble)
+ virtual RawAbstractType* CompileType() const;
+
+ virtual bool CanDeoptimize() const { return false; }
+
+ virtual bool HasSideEffect() const { return false; }
+
+ virtual intptr_t ResultCid() const { return kDoubleCid; }
+
+ virtual Representation representation() const {
+ return kUnboxedDouble;
+ }
+
+ virtual Representation RequiredInputRepresentation(intptr_t idx) const {
+ ASSERT(idx == 0);
+ return kUnboxedDouble;
+ }
+
+ virtual intptr_t DeoptimizationTarget() const { return deopt_id_; }
+
+ private:
+ const MethodRecognizer::Kind recognized_kind_;
+
+ DISALLOW_COPY_AND_ASSIGN(DoubleToDoubleInstr);
+};
+
+
class CheckClassInstr : public TemplateInstruction<1> {
public:
CheckClassInstr(Value* value,
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698