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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 bool Object::NonFailureIsHeapObject() { | 174 bool Object::NonFailureIsHeapObject() { |
175 ASSERT(!this->IsFailure()); | 175 ASSERT(!this->IsFailure()); |
176 return (reinterpret_cast<intptr_t>(this) & kSmiTagMask) != 0; | 176 return (reinterpret_cast<intptr_t>(this) & kSmiTagMask) != 0; |
177 } | 177 } |
178 | 178 |
179 | 179 |
180 TYPE_CHECKER(HeapNumber, HEAP_NUMBER_TYPE) | 180 TYPE_CHECKER(HeapNumber, HEAP_NUMBER_TYPE) |
181 TYPE_CHECKER(Symbol, SYMBOL_TYPE) | 181 TYPE_CHECKER(Symbol, SYMBOL_TYPE) |
182 | 182 |
183 | 183 |
184 bool Object::IsName() { | |
185 return Object::IsHeapObject() | |
186 && HeapObject::cast(this)->map()->instance_type() <= LAST_NAME_TYPE; | |
187 } | |
188 | |
189 | |
190 bool Object::IsString() { | 184 bool Object::IsString() { |
191 return Object::IsHeapObject() | 185 return Object::IsHeapObject() |
192 && HeapObject::cast(this)->map()->instance_type() < FIRST_NONSTRING_TYPE; | 186 && HeapObject::cast(this)->map()->instance_type() < FIRST_NONSTRING_TYPE; |
193 } | 187 } |
194 | 188 |
195 | 189 |
| 190 bool Object::IsName() { |
| 191 return IsString() || IsSymbol(); |
| 192 } |
| 193 |
| 194 |
| 195 bool Object::IsUniqueName() { |
| 196 return IsInternalizedString() || IsSymbol(); |
| 197 } |
| 198 |
| 199 |
196 bool Object::IsSpecObject() { | 200 bool Object::IsSpecObject() { |
197 return Object::IsHeapObject() | 201 return Object::IsHeapObject() |
198 && HeapObject::cast(this)->map()->instance_type() >= FIRST_SPEC_OBJECT_TYPE; | 202 && HeapObject::cast(this)->map()->instance_type() >= FIRST_SPEC_OBJECT_TYPE; |
199 } | 203 } |
200 | 204 |
201 | 205 |
202 bool Object::IsSpecFunction() { | 206 bool Object::IsSpecFunction() { |
203 if (!Object::IsHeapObject()) return false; | 207 if (!Object::IsHeapObject()) return false; |
204 InstanceType type = HeapObject::cast(this)->map()->instance_type(); | 208 InstanceType type = HeapObject::cast(this)->map()->instance_type(); |
205 return type == JS_FUNCTION_TYPE || type == JS_FUNCTION_PROXY_TYPE; | 209 return type == JS_FUNCTION_TYPE || type == JS_FUNCTION_PROXY_TYPE; |
(...skipping 5694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5900 #undef WRITE_UINT32_FIELD | 5904 #undef WRITE_UINT32_FIELD |
5901 #undef READ_SHORT_FIELD | 5905 #undef READ_SHORT_FIELD |
5902 #undef WRITE_SHORT_FIELD | 5906 #undef WRITE_SHORT_FIELD |
5903 #undef READ_BYTE_FIELD | 5907 #undef READ_BYTE_FIELD |
5904 #undef WRITE_BYTE_FIELD | 5908 #undef WRITE_BYTE_FIELD |
5905 | 5909 |
5906 | 5910 |
5907 } } // namespace v8::internal | 5911 } } // namespace v8::internal |
5908 | 5912 |
5909 #endif // V8_OBJECTS_INL_H_ | 5913 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |