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

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

Issue 9156001: Improved range analysis for bitwise operations. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 8 years, 11 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') | src/hydrogen-instructions.cc » ('J')
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 25 matching lines...) Expand all
36 #include "small-pointer-list.h" 36 #include "small-pointer-list.h"
37 #include "string-stream.h" 37 #include "string-stream.h"
38 #include "v8conversions.h" 38 #include "v8conversions.h"
39 #include "v8utils.h" 39 #include "v8utils.h"
40 #include "zone.h" 40 #include "zone.h"
41 41
42 namespace v8 { 42 namespace v8 {
43 namespace internal { 43 namespace internal {
44 44
45 // Forward declarations. 45 // Forward declarations.
46 class BitRange;
46 class HBasicBlock; 47 class HBasicBlock;
47 class HEnvironment; 48 class HEnvironment;
48 class HInstruction; 49 class HInstruction;
49 class HLoopInformation; 50 class HLoopInformation;
50 class HValue; 51 class HValue;
51 class LInstruction; 52 class LInstruction;
52 class LChunkBuilder; 53 class LChunkBuilder;
53 54
54 55
55 #define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \ 56 #define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 int32_t upper() const { return upper_; } 229 int32_t upper() const { return upper_; }
229 int32_t lower() const { return lower_; } 230 int32_t lower() const { return lower_; }
230 Range* next() const { return next_; } 231 Range* next() const { return next_; }
231 Range* CopyClearLower() const { return new Range(kMinInt, upper_); } 232 Range* CopyClearLower() const { return new Range(kMinInt, upper_); }
232 Range* CopyClearUpper() const { return new Range(lower_, kMaxInt); } 233 Range* CopyClearUpper() const { return new Range(lower_, kMaxInt); }
233 Range* Copy() const { 234 Range* Copy() const {
234 Range* result = new Range(lower_, upper_); 235 Range* result = new Range(lower_, upper_);
235 result->set_can_be_minus_zero(CanBeMinusZero()); 236 result->set_can_be_minus_zero(CanBeMinusZero());
236 return result; 237 return result;
237 } 238 }
238 int32_t Mask() const; 239 void ToBitRange(BitRange* bits) const;
239 void set_can_be_minus_zero(bool b) { can_be_minus_zero_ = b; } 240 void set_can_be_minus_zero(bool b) { can_be_minus_zero_ = b; }
240 bool CanBeMinusZero() const { return CanBeZero() && can_be_minus_zero_; } 241 bool CanBeMinusZero() const { return CanBeZero() && can_be_minus_zero_; }
241 bool CanBeZero() const { return upper_ >= 0 && lower_ <= 0; } 242 bool CanBeZero() const { return upper_ >= 0 && lower_ <= 0; }
242 bool CanBeNegative() const { return lower_ < 0; } 243 bool CanBeNegative() const { return lower_ < 0; }
243 bool Includes(int value) const { return lower_ <= value && upper_ >= value; } 244 bool Includes(int value) const { return lower_ <= value && upper_ >= value; }
244 bool IsMostGeneric() const { 245 bool IsMostGeneric() const {
245 return lower_ == kMinInt && upper_ == kMaxInt && CanBeMinusZero(); 246 return lower_ == kMinInt && upper_ == kMaxInt && CanBeMinusZero();
246 } 247 }
247 bool IsInSmiRange() const { 248 bool IsInSmiRange() const {
248 return lower_ >= Smi::kMinValue && upper_ <= Smi::kMaxValue; 249 return lower_ >= Smi::kMinValue && upper_ <= Smi::kMaxValue;
(...skipping 4250 matching lines...) Expand 10 before | Expand all | Expand 10 after
4499 4500
4500 DECLARE_CONCRETE_INSTRUCTION(In) 4501 DECLARE_CONCRETE_INSTRUCTION(In)
4501 }; 4502 };
4502 4503
4503 #undef DECLARE_INSTRUCTION 4504 #undef DECLARE_INSTRUCTION
4504 #undef DECLARE_CONCRETE_INSTRUCTION 4505 #undef DECLARE_CONCRETE_INSTRUCTION
4505 4506
4506 } } // namespace v8::internal 4507 } } // namespace v8::internal
4507 4508
4508 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 4509 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.cc » ('j') | src/hydrogen-instructions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698