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

Unified Diff: runtime/vm/intermediate_language.h

Issue 11043020: Add fast 64-bit bitwise negation to the IA32 optimizing compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed bug in the optimizer that prevented optimization Created 8 years, 2 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
===================================================================
--- runtime/vm/intermediate_language.h (revision 13214)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -259,6 +259,7 @@
M(UnboxInteger) \
M(BoxInteger) \
M(UnboxedMintBinaryOp) \
+ M(UnboxedMintUnaryOp) \
M(CheckArrayBound) \
M(Constraint) \
@@ -515,6 +516,7 @@
friend class UnboxDoubleInstr;
friend class UnboxedDoubleBinaryOpInstr;
friend class UnboxedMintBinaryOpInstr;
+ friend class UnboxedMintUnaryOpInstr;
friend class MathSqrtInstr;
friend class CheckClassInstr;
friend class CheckSmiInstr;
@@ -3583,6 +3585,61 @@
};
+class UnboxedMintUnaryOpInstr : public TemplateDefinition<1> {
+ public:
+ UnboxedMintUnaryOpInstr(Token::Kind op_kind,
+ Value* value,
+ InstanceCallInstr* instance_call)
+ : op_kind_(op_kind) {
+ ASSERT(value != NULL);
+ ASSERT(op_kind == Token::kBIT_NOT);
+ inputs_[0] = value;
+ deopt_id_ = instance_call->deopt_id();
+ }
+
+ Value* value() const { return inputs_[0]; }
+
+ Token::Kind op_kind() const { return op_kind_; }
+
+ virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+ virtual bool CanDeoptimize() const { return false; }
+
+ virtual bool HasSideEffect() const { return false; }
+
+ virtual bool AffectedBySideEffect() const { return false; }
+
+ virtual bool AttributesEqual(Instruction* other) const {
+ return op_kind() == other->AsUnboxedMintUnaryOp()->op_kind();
+ }
+
+ virtual intptr_t ResultCid() const;
+ virtual RawAbstractType* CompileType() const;
+
+ virtual Representation representation() const {
+ return kUnboxedMint;
+ }
+
+ virtual Representation RequiredInputRepresentation(intptr_t idx) const {
+ ASSERT(idx == 0);
+ return kUnboxedMint;
+ }
+
+ virtual intptr_t DeoptimizationTarget() const {
+ // Direct access since this instuction cannot deoptimize, and the deopt-id
+ // was inherited from another instuction that could deoptimize.
+ return deopt_id_;
+ }
+
+ DECLARE_INSTRUCTION(UnboxedMintUnaryOp)
+
+ private:
+ const Token::Kind op_kind_;
+
+ DISALLOW_COPY_AND_ASSIGN(UnboxedMintUnaryOpInstr);
+};
+
+
class BinarySmiOpInstr : public TemplateDefinition<2> {
public:
BinarySmiOpInstr(Token::Kind op_kind,

Powered by Google App Engine
This is Rietveld 408576698