OLD | NEW |
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 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2158 boolean_value_(double_value != 0 && !std::isnan(double_value)), | 2158 boolean_value_(double_value != 0 && !std::isnan(double_value)), |
2159 int32_value_(DoubleToInt32(double_value)), | 2159 int32_value_(DoubleToInt32(double_value)), |
2160 double_value_(double_value) { | 2160 double_value_(double_value) { |
2161 has_smi_value_ = has_int32_value_ && Smi::IsValid(int32_value_); | 2161 has_smi_value_ = has_int32_value_ && Smi::IsValid(int32_value_); |
2162 Initialize(r); | 2162 Initialize(r); |
2163 } | 2163 } |
2164 | 2164 |
2165 | 2165 |
2166 void HConstant::Initialize(Representation r) { | 2166 void HConstant::Initialize(Representation r) { |
2167 if (r.IsNone()) { | 2167 if (r.IsNone()) { |
2168 if (has_int32_value_) { | 2168 if (has_smi_value_) { |
| 2169 r = Representation::Smi(); |
| 2170 } else if (has_int32_value_) { |
2169 r = Representation::Integer32(); | 2171 r = Representation::Integer32(); |
2170 } else if (has_double_value_) { | 2172 } else if (has_double_value_) { |
2171 r = Representation::Double(); | 2173 r = Representation::Double(); |
2172 } else { | 2174 } else { |
2173 r = Representation::Tagged(); | 2175 r = Representation::Tagged(); |
2174 } | 2176 } |
2175 } | 2177 } |
2176 set_representation(r); | 2178 set_representation(r); |
2177 SetFlag(kUseGVN); | 2179 SetFlag(kUseGVN); |
2178 if (representation().IsInteger32()) { | 2180 if (representation().IsInteger32()) { |
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3793 case kBackingStore: | 3795 case kBackingStore: |
3794 if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString()); | 3796 if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString()); |
3795 stream->Add("[backing-store]"); | 3797 stream->Add("[backing-store]"); |
3796 break; | 3798 break; |
3797 } | 3799 } |
3798 | 3800 |
3799 stream->Add("@%d", offset()); | 3801 stream->Add("@%d", offset()); |
3800 } | 3802 } |
3801 | 3803 |
3802 } } // namespace v8::internal | 3804 } } // namespace v8::internal |
OLD | NEW |