| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 bool Object::IsSlicedString() { | 178 bool Object::IsSlicedString() { |
| 179 if (!IsString()) return false; | 179 if (!IsString()) return false; |
| 180 return StringShape(String::cast(this)).IsSliced(); | 180 return StringShape(String::cast(this)).IsSliced(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 | 183 |
| 184 #endif // DEBUG | 184 #endif // DEBUG |
| 185 | 185 |
| 186 | 186 |
| 187 StringShape::StringShape(String* str) | 187 StringShape::StringShape(String* str) |
| 188 : type_(str->map()->instance_type()) | 188 : type_(str->map()->instance_type()) { |
| 189 #ifdef DEBUG | 189 set_valid(); |
| 190 , valid_(true) | |
| 191 #endif // def DEBUG | |
| 192 { | |
| 193 ASSERT((type_ & kIsNotStringMask) == kStringTag); | 190 ASSERT((type_ & kIsNotStringMask) == kStringTag); |
| 194 } | 191 } |
| 195 | 192 |
| 196 | 193 |
| 197 StringShape::StringShape(Map* map) | 194 StringShape::StringShape(Map* map) |
| 198 : type_(map->instance_type()) | 195 : type_(map->instance_type()) { |
| 199 #ifdef DEBUG | 196 set_valid(); |
| 200 , valid_(true) | |
| 201 #endif // def DEBUG | |
| 202 { | |
| 203 ASSERT((type_ & kIsNotStringMask) == kStringTag); | 197 ASSERT((type_ & kIsNotStringMask) == kStringTag); |
| 204 } | 198 } |
| 205 | 199 |
| 206 | 200 |
| 207 StringShape::StringShape(InstanceType t) | 201 StringShape::StringShape(InstanceType t) |
| 208 : type_(static_cast<uint32_t>(t)) | 202 : type_(static_cast<uint32_t>(t)) { |
| 209 #ifdef DEBUG | 203 set_valid(); |
| 210 , valid_(true) | |
| 211 #endif // def DEBUG | |
| 212 { | |
| 213 ASSERT((type_ & kIsNotStringMask) == kStringTag); | 204 ASSERT((type_ & kIsNotStringMask) == kStringTag); |
| 214 } | 205 } |
| 215 | 206 |
| 216 | 207 |
| 217 bool StringShape::IsSymbol() { | 208 bool StringShape::IsSymbol() { |
| 218 ASSERT(valid()); | 209 ASSERT(valid()); |
| 219 return (type_ & kIsSymbolMask) == kSymbolTag; | 210 return (type_ & kIsSymbolMask) == kSymbolTag; |
| 220 } | 211 } |
| 221 | 212 |
| 222 | 213 |
| (...skipping 2220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2443 #undef WRITE_INT_FIELD | 2434 #undef WRITE_INT_FIELD |
| 2444 #undef READ_SHORT_FIELD | 2435 #undef READ_SHORT_FIELD |
| 2445 #undef WRITE_SHORT_FIELD | 2436 #undef WRITE_SHORT_FIELD |
| 2446 #undef READ_BYTE_FIELD | 2437 #undef READ_BYTE_FIELD |
| 2447 #undef WRITE_BYTE_FIELD | 2438 #undef WRITE_BYTE_FIELD |
| 2448 | 2439 |
| 2449 | 2440 |
| 2450 } } // namespace v8::internal | 2441 } } // namespace v8::internal |
| 2451 | 2442 |
| 2452 #endif // V8_OBJECTS_INL_H_ | 2443 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |