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

Unified Diff: src/hydrogen-instructions.h

Issue 9286002: Eliminate overflow check after integer add and sub if result is truncated to int32. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Eliminate overflow check after integer add and sub if result is truncated to int32. Created 8 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
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
===================================================================
--- src/hydrogen-instructions.h (revision 10863)
+++ src/hydrogen-instructions.h (working copy)
@@ -645,6 +645,9 @@
void ClearFlag(Flag f) { flags_ &= ~(1 << f); }
bool CheckFlag(Flag f) const { return (flags_ & (1 << f)) != 0; }
+ // Returns true if the flag specified is set for all uses, false otherwise.
+ bool CheckUsesForFlag(Flag f);
+
GVNFlagSet gvn_flags() const { return gvn_flags_; }
void SetGVNFlag(GVNFlag f) { gvn_flags_.Add(f); }
void ClearGVNFlag(GVNFlag f) { gvn_flags_.Remove(f); }
@@ -824,6 +827,8 @@
bool has_position() const { return position_ != RelocInfo::kNoPosition; }
void set_position(int position) { position_ = position; }
+ bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); }
+
virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0;
#ifdef DEBUG
@@ -1121,10 +1126,6 @@
return reinterpret_cast<HUnaryOperation*>(value);
}
- virtual bool CanTruncateToInt32() const {
- return CheckFlag(kTruncatingToInt32);
- }
-
HValue* value() { return OperandAt(0); }
virtual void PrintDataTo(StringStream* stream);
};
@@ -1248,16 +1249,13 @@
: HUnaryOperation(value) {
set_representation(Representation::Integer32());
SetFlag(kUseGVN);
+ SetFlag(kTruncatingToInt32);
}
virtual Representation RequiredInputRepresentation(int index) {
return Representation::None();
}
- virtual bool CanTruncateToInt32() const {
- return true;
- }
-
virtual HValue* Canonicalize() {
if (value()->representation().IsInteger32()) {
return value();
@@ -3154,6 +3152,8 @@
virtual HType CalculateInferredType();
+ virtual HValue* Canonicalize();
+
DECLARE_CONCRETE_INSTRUCTION(Add)
protected:
@@ -3172,6 +3172,8 @@
virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
+ virtual HValue* Canonicalize();
+
static HInstruction* NewHSub(Zone* zone,
HValue* context,
HValue* left,
@@ -3257,7 +3259,6 @@
virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
-
static HInstruction* NewHDiv(Zone* zone,
HValue* context,
HValue* left,
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698