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

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 18774)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -241,6 +241,10 @@
Value* next_use() const { return next_use_; }
void set_next_use(Value* next) { next_use_ = next; }
+ bool IsSingleUse() const {
+ return (next_use_ == NULL) && (previous_use_ == NULL);
Florian Schneider 2013/02/21 10:30:47 We have env_use_list to keep track of environment
Kevin Millikin (Google) 2013/02/21 12:44:35 Drive by to the drive by. I think it's more natur
srdjan 2013/02/21 15:56:27 We remove environment use list lazily in register
+ }
+
Instruction* instruction() const { return instruction_; }
void set_instruction(Instruction* instruction) { instruction_ = instruction; }
@@ -3673,7 +3677,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;
@@ -3686,6 +3691,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 {
@@ -3697,6 +3704,7 @@
virtual bool AffectedBySideEffect() const { return false; }
virtual bool AttributesEqual(Instruction* other) const {
+ ASSERT(other->IsBinaryMintOp());
return op_kind() == other->AsBinaryMintOp()->op_kind();
}
@@ -3723,6 +3731,7 @@
private:
const Token::Kind op_kind_;
+ InstanceCallInstr* instance_call_;
DISALLOW_COPY_AND_ASSIGN(BinaryMintOpInstr);
};
@@ -3848,7 +3857,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;
@@ -3882,6 +3892,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();
@@ -3896,6 +3911,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