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

Side by Side Diff: src/property-details.h

Issue 184393002: Fix representation generalization for doubles. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | test/mjsunit/regress/regress-347909.js » ('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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 return Equals(other); 131 return Equals(other);
132 } 132 }
133 133
134 bool is_more_general_than(const Representation& other) const { 134 bool is_more_general_than(const Representation& other) const {
135 if (kind_ == kExternal && other.kind_ == kNone) return true; 135 if (kind_ == kExternal && other.kind_ == kNone) return true;
136 if (kind_ == kExternal && other.kind_ == kExternal) return false; 136 if (kind_ == kExternal && other.kind_ == kExternal) return false;
137 if (kind_ == kNone && other.kind_ == kExternal) return false; 137 if (kind_ == kNone && other.kind_ == kExternal) return false;
138 138
139 ASSERT(kind_ != kExternal); 139 ASSERT(kind_ != kExternal);
140 ASSERT(other.kind_ != kExternal); 140 ASSERT(other.kind_ != kExternal);
141 if (IsHeapObject()) return other.IsDouble() || other.IsNone(); 141 if (IsHeapObject()) return other.IsNone();
142 if (kind_ == kUInteger8 && other.kind_ == kInteger8) return false; 142 if (kind_ == kUInteger8 && other.kind_ == kInteger8) return false;
143 if (kind_ == kUInteger16 && other.kind_ == kInteger16) return false; 143 if (kind_ == kUInteger16 && other.kind_ == kInteger16) return false;
144 return kind_ > other.kind_; 144 return kind_ > other.kind_;
145 } 145 }
146 146
147 bool fits_into(const Representation& other) const { 147 bool fits_into(const Representation& other) const {
148 return other.is_more_general_than(*this) || other.Equals(*this); 148 return other.is_more_general_than(*this) || other.Equals(*this);
149 } 149 }
150 150
151 Representation generalize(Representation other) { 151 Representation generalize(Representation other) {
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 PropertyDetails(int value, PropertyAttributes attributes) { 320 PropertyDetails(int value, PropertyAttributes attributes) {
321 value_ = AttributesField::update(value, attributes); 321 value_ = AttributesField::update(value, attributes);
322 } 322 }
323 323
324 uint32_t value_; 324 uint32_t value_;
325 }; 325 };
326 326
327 } } // namespace v8::internal 327 } } // namespace v8::internal
328 328
329 #endif // V8_PROPERTY_DETAILS_H_ 329 #endif // V8_PROPERTY_DETAILS_H_
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-347909.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698