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

Side by Side Diff: src/hydrogen-instructions.h

Issue 15952004: Improve range analysis for modulo operations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added comment. Better parentheses. Removed wrong intersection. Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 Range* Copy(Zone* zone) const { 256 Range* Copy(Zone* zone) const {
257 Range* result = new(zone) Range(lower_, upper_); 257 Range* result = new(zone) Range(lower_, upper_);
258 result->set_can_be_minus_zero(CanBeMinusZero()); 258 result->set_can_be_minus_zero(CanBeMinusZero());
259 return result; 259 return result;
260 } 260 }
261 int32_t Mask() const; 261 int32_t Mask() const;
262 void set_can_be_minus_zero(bool b) { can_be_minus_zero_ = b; } 262 void set_can_be_minus_zero(bool b) { can_be_minus_zero_ = b; }
263 bool CanBeMinusZero() const { return CanBeZero() && can_be_minus_zero_; } 263 bool CanBeMinusZero() const { return CanBeZero() && can_be_minus_zero_; }
264 bool CanBeZero() const { return upper_ >= 0 && lower_ <= 0; } 264 bool CanBeZero() const { return upper_ >= 0 && lower_ <= 0; }
265 bool CanBeNegative() const { return lower_ < 0; } 265 bool CanBeNegative() const { return lower_ < 0; }
266 bool CanBePositive() const { return upper_ > 0; }
266 bool Includes(int value) const { return lower_ <= value && upper_ >= value; } 267 bool Includes(int value) const { return lower_ <= value && upper_ >= value; }
267 bool IsMostGeneric() const { 268 bool IsMostGeneric() const {
268 return lower_ == kMinInt && upper_ == kMaxInt && CanBeMinusZero(); 269 return lower_ == kMinInt && upper_ == kMaxInt && CanBeMinusZero();
269 } 270 }
270 bool IsInSmiRange() const { 271 bool IsInSmiRange() const {
271 return lower_ >= Smi::kMinValue && upper_ <= Smi::kMaxValue; 272 return lower_ >= Smi::kMinValue && upper_ <= Smi::kMaxValue;
272 } 273 }
273 void KeepOrder(); 274 void KeepOrder();
274 #ifdef DEBUG 275 #ifdef DEBUG
275 void Verify() const; 276 void Verify() const;
(...skipping 6214 matching lines...) Expand 10 before | Expand all | Expand 10 after
6490 virtual bool IsDeletable() const { return true; } 6491 virtual bool IsDeletable() const { return true; }
6491 }; 6492 };
6492 6493
6493 6494
6494 #undef DECLARE_INSTRUCTION 6495 #undef DECLARE_INSTRUCTION
6495 #undef DECLARE_CONCRETE_INSTRUCTION 6496 #undef DECLARE_CONCRETE_INSTRUCTION
6496 6497
6497 } } // namespace v8::internal 6498 } } // namespace v8::internal
6498 6499
6499 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6500 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698