Reviewers: fschneider,
Description:
Make HConstant a bit more compact.
Please review this at http://codereview.chromium.org/6850031/
Affected files:
M src/hydrogen-instructions.h
M src/hydrogen-instructions.cc
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index
032ca7691dc6b908cbc09e1b563fc41979d74614..3b01f5761227bdc393e7ad0a755192341f93b288
100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -1017,10 +1017,9 @@ void HEnterInlined::PrintDataTo(StringStream*
stream) {
HConstant::HConstant(Handle<Object> handle, Representation r)
: handle_(handle),
- constant_type_(HType::TypeFromValue(handle)),
has_int32_value_(false),
- int32_value_(0),
has_double_value_(false),
+ int32_value_(0),
double_value_(0) {
set_representation(r);
SetFlag(kUseGVN);
@@ -1435,7 +1434,7 @@ HType HPhi::CalculateInferredType() {
HType HConstant::CalculateInferredType() {
- return constant_type_;
+ return HType::TypeFromValue(handle_);
}
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index
a623775f2f8aa68dddb9fbd3c93703321bfde43f..b37a046af056368178b3ada2b3404d9879b3beb8
100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -1990,14 +1990,13 @@ class HConstant: public HTemplateInstruction<0> {
private:
Handle<Object> handle_;
- HType constant_type_;
// The following two values represent the int32 and the double value of
the
// given constant if there is a lossless conversion between the constant
// and the specific representation.
- bool has_int32_value_;
+ bool has_int32_value_ : 1;
+ bool has_double_value_ : 1;
int32_t int32_value_;
- bool has_double_value_;
double double_value_;
};
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev