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

Unified Diff: runtime/vm/intermediate_language.h

Issue 12218181: Recognize pattern (a << b) & c with c being a positive Smi and allow left shift to truncate the res… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 18705)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -3669,7 +3669,8 @@
Value* left,
Value* right,
InstanceCallInstr* instance_call)
- : op_kind_(op_kind) {
+ : op_kind_(op_kind),
+ instance_call_(instance_call) {
ASSERT(left != NULL);
ASSERT(right != NULL);
inputs_[0] = left;
@@ -3682,6 +3683,8 @@
Token::Kind op_kind() const { return op_kind_; }
+ InstanceCallInstr* instance_call() const { return instance_call_; }
+
virtual void PrintOperandsTo(BufferFormatter* f) const;
virtual bool CanDeoptimize() const {
@@ -3693,6 +3696,7 @@
virtual bool AffectedBySideEffect() const { return false; }
virtual bool AttributesEqual(Instruction* other) const {
+ ASSERT(other->IsBinaryMintOp());
return op_kind() == other->AsBinaryMintOp()->op_kind();
}
@@ -3719,6 +3723,7 @@
private:
const Token::Kind op_kind_;
+ InstanceCallInstr* instance_call_;
DISALLOW_COPY_AND_ASSIGN(BinaryMintOpInstr);
};
@@ -3844,7 +3849,8 @@
Value* right)
: op_kind_(op_kind),
instance_call_(instance_call),
- overflow_(true) {
+ overflow_(true),
+ is_truncating_(false) {
ASSERT(left != NULL);
ASSERT(right != NULL);
inputs_[0] = left;
@@ -3878,6 +3884,11 @@
overflow_ = overflow;
}
+ void set_is_truncating(bool value) {
+ is_truncating_ = value;
+ }
+ bool is_truncating() const { return is_truncating_; }
+
void PrintTo(BufferFormatter* f) const;
virtual void InferRange();
@@ -3892,6 +3903,7 @@
const Token::Kind op_kind_;
InstanceCallInstr* instance_call_;
bool overflow_;
+ bool is_truncating_;
DISALLOW_COPY_AND_ASSIGN(BinarySmiOpInstr);
};

Powered by Google App Engine
This is Rietveld 408576698