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

Unified Diff: src/hydrogen-instructions.h

Issue 9487010: Explicitly use a Zone when allocating Range. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index a0df009fb1faae6d2ac3e1bf48eceb3d5aac4757..c05069ea91f76fc6fcd51f0c5b5868f14ebdbb78 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -236,10 +236,14 @@ class Range: public ZoneObject {
int32_t upper() const { return upper_; }
int32_t lower() const { return lower_; }
Range* next() const { return next_; }
- Range* CopyClearLower() const { return new Range(kMinInt, upper_); }
- Range* CopyClearUpper() const { return new Range(lower_, kMaxInt); }
- Range* Copy() const {
- Range* result = new Range(lower_, upper_);
+ Range* CopyClearLower(Zone* zone) const {
+ return new(zone) Range(kMinInt, upper_);
+ }
+ Range* CopyClearUpper(Zone* zone) const {
+ return new(zone) Range(lower_, kMaxInt);
+ }
+ Range* Copy(Zone* zone) const {
+ Range* result = new(zone) Range(lower_, upper_);
result->set_can_be_minus_zero(CanBeMinusZero());
return result;
}
@@ -683,9 +687,9 @@ class HValue: public ZoneObject {
Range* range() const { return range_; }
bool HasRange() const { return range_ != NULL; }
- void AddNewRange(Range* r);
+ void AddNewRange(Range* r, Zone* zone);
void RemoveLastAddedRange();
- void ComputeInitialRange();
+ void ComputeInitialRange(Zone* zone);
// Representation helpers.
virtual Representation RequiredInputRepresentation(int index) = 0;
@@ -730,7 +734,7 @@ class HValue: public ZoneObject {
return false;
}
virtual void RepresentationChanged(Representation to) { }
- virtual Range* InferRange();
+ virtual Range* InferRange(Zone* zone);
virtual void DeleteFromGraph() = 0;
virtual void InternalSetOperandAt(int index, HValue* value) = 0;
void clear_block() {
@@ -1208,7 +1212,7 @@ class HChange: public HUnaryOperation {
return from();
}
- virtual Range* InferRange();
+ virtual Range* InferRange(Zone* zone);
virtual void PrintDataTo(StringStream* stream);
@@ -2299,7 +2303,7 @@ class HPhi: public HValue {
return Representation::None();
}
- virtual Range* InferRange();
+ virtual Range* InferRange(Zone* zone);
virtual Representation RequiredInputRepresentation(int index) {
return representation();
}
@@ -2477,7 +2481,7 @@ class HConstant: public HTemplateInstruction<0> {
DECLARE_CONCRETE_INSTRUCTION(Constant)
protected:
- virtual Range* InferRange();
+ virtual Range* InferRange(Zone* zone);
virtual bool DataEquals(HValue* other) {
HConstant* other_constant = HConstant::cast(other);
@@ -3155,7 +3159,7 @@ class HAdd: public HArithmeticBinaryOperation {
protected:
virtual bool DataEquals(HValue* other) { return true; }
- virtual Range* InferRange();
+ virtual Range* InferRange(Zone* zone);
};
@@ -3178,7 +3182,7 @@ class HSub: public HArithmeticBinaryOperation {
protected:
virtual bool DataEquals(HValue* other) { return true; }
- virtual Range* InferRange();
+ virtual Range* InferRange(Zone* zone);
};
@@ -3206,7 +3210,7 @@ class HMul: public HArithmeticBinaryOperation {
protected:
virtual bool DataEquals(HValue* other) { return true; }
- virtual Range* InferRange();
+ virtual Range* InferRange(Zone* zone);
};
@@ -3239,7 +3243,7 @@ class HMod: public HArithmeticBinaryOperation {
protected:
virtual bool DataEquals(HValue* other) { return true; }
- virtual Range* InferRange();
+ virtual Range* InferRange(Zone* zone);
};
@@ -3264,7 +3268,7 @@ class HDiv: public HArithmeticBinaryOperation {
protected:
virtual bool DataEquals(HValue* other) { return true; }
- virtual Range* InferRange();
+ virtual Range* InferRange(Zone* zone);
};
@@ -3296,7 +3300,7 @@ class HBitwise: public HBitwiseBinaryOperation {
return op() == HBitwise::cast(other)->op();
}
- virtual Range* InferRange();
+ virtual Range* InferRange(Zone* zone);
private:
Token::Value op_;
@@ -3308,7 +3312,7 @@ class HShl: public HBitwiseBinaryOperation {
HShl(HValue* context, HValue* left, HValue* right)
: HBitwiseBinaryOperation(context, left, right) { }
- virtual Range* InferRange();
+ virtual Range* InferRange(Zone* zone);
static HInstruction* NewHShl(Zone* zone,
HValue* context,
@@ -3327,7 +3331,7 @@ class HShr: public HBitwiseBinaryOperation {
HShr(HValue* context, HValue* left, HValue* right)
: HBitwiseBinaryOperation(context, left, right) { }
- virtual Range* InferRange();
+ virtual Range* InferRange(Zone* zone);
static HInstruction* NewHShr(Zone* zone,
HValue* context,
@@ -3346,7 +3350,7 @@ class HSar: public HBitwiseBinaryOperation {
HSar(HValue* context, HValue* left, HValue* right)
: HBitwiseBinaryOperation(context, left, right) { }
- virtual Range* InferRange();
+ virtual Range* InferRange(Zone* zone);
static HInstruction* NewHSar(Zone* zone,
HValue* context,
@@ -3936,7 +3940,7 @@ class HLoadKeyedSpecializedArrayElement: public HTemplateInstruction<2> {
HValue* key() { return OperandAt(1); }
ElementsKind elements_kind() const { return elements_kind_; }
- virtual Range* InferRange();
+ virtual Range* InferRange(Zone* zone);
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement)
@@ -4304,8 +4308,8 @@ class HStringCharCodeAt: public HTemplateInstruction<3> {
protected:
virtual bool DataEquals(HValue* other) { return true; }
- virtual Range* InferRange() {
- return new Range(0, String::kMaxUC16CharCode);
+ virtual Range* InferRange(Zone* zone) {
+ return new(zone) Range(0, String::kMaxUC16CharCode);
}
};
@@ -4357,8 +4361,8 @@ class HStringLength: public HUnaryOperation {
protected:
virtual bool DataEquals(HValue* other) { return true; }
- virtual Range* InferRange() {
- return new Range(0, String::kMaxLength);
+ virtual Range* InferRange(Zone* zone) {
+ return new(zone) Range(0, String::kMaxLength);
}
};
« 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