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

Unified Diff: runtime/vm/intermediate_language.h

Issue 22999011: Add double unary operation (negate). This is a replica of the destrpyed CL https://chromiumcoderevi… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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_arm.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 26168)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -581,6 +581,7 @@
M(CloneContext) \
M(BinarySmiOp) \
M(UnarySmiOp) \
+ M(UnaryDoubleOp) \
M(CheckStackOverflow) \
M(SmiToDouble) \
M(DoubleToInteger) \
@@ -920,6 +921,7 @@
friend class BinaryMintOpInstr;
friend class BinarySmiOpInstr;
friend class UnarySmiOpInstr;
+ friend class UnaryDoubleOpInstr;
friend class ShiftMintOpInstr;
friend class UnaryMintOpInstr;
friend class MathUnaryInstr;
@@ -4714,7 +4716,7 @@
: op_kind_(op_kind) {
SetInputAt(0, left);
SetInputAt(1, right);
- // Overrided generated deopt_id.
+ // Overriden generated deopt_id.
deopt_id_ = deopt_id;
}
@@ -6053,6 +6055,58 @@
};
+// Handles only NEGATE.
+class UnaryDoubleOpInstr : public TemplateDefinition<1> {
+ public:
+ UnaryDoubleOpInstr(Token::Kind op_kind,
+ Value* value,
+ intptr_t deopt_id)
+ : op_kind_(op_kind) {
+ ASSERT(op_kind == Token::kNEGATE);
+ SetInputAt(0, value);
+ // Overriden generated deopt_id.
+ deopt_id_ = deopt_id;
+ }
+
+ Value* value() const { return inputs_[0]; }
+ Token::Kind op_kind() const { return op_kind_; }
+
+ virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+ DECLARE_INSTRUCTION(UnaryDoubleOp)
+ virtual CompileType ComputeType() const;
+
+ virtual bool CanDeoptimize() const { return false; }
+
+ 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 Representation representation() const {
+ return kUnboxedDouble;
+ }
+
+ virtual Representation RequiredInputRepresentation(intptr_t idx) const {
+ ASSERT(idx == 0);
+ return kUnboxedDouble;
+ }
+
+ 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 Token::Kind op_kind_;
+
+ DISALLOW_COPY_AND_ASSIGN(UnaryDoubleOpInstr);
+};
+
+
class CheckStackOverflowInstr : public TemplateInstruction<0> {
public:
CheckStackOverflowInstr(intptr_t token_pos, intptr_t loop_depth)
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698