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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void holder::set_##name(bool value) { \ | 127 void holder::set_##name(bool value) { \ |
128 set_##field(BooleanBit::set(field(), offset, value)); \ | 128 set_##field(BooleanBit::set(field(), offset, value)); \ |
129 } | 129 } |
130 | 130 |
131 | 131 |
132 bool Object::IsFixedArrayBase() { | 132 bool Object::IsFixedArrayBase() { |
133 return IsFixedArray() || IsFixedDoubleArray(); | 133 return IsFixedArray() || IsFixedDoubleArray(); |
134 } | 134 } |
135 | 135 |
136 | 136 |
137 // External objects are not extensible, so the map check is enough. | |
138 bool Object::IsExternal() { | |
139 return Object::IsHeapObject() && | |
140 HeapObject::cast(this)->map() == | |
141 HeapObject::cast(this)->GetHeap()->external_map(); | |
142 } | |
143 | |
144 | |
145 bool Object::IsInstanceOf(FunctionTemplateInfo* expected) { | 137 bool Object::IsInstanceOf(FunctionTemplateInfo* expected) { |
146 // There is a constraint on the object; check. | 138 // There is a constraint on the object; check. |
147 if (!this->IsJSObject()) return false; | 139 if (!this->IsJSObject()) return false; |
148 // Fetch the constructor function of the object. | 140 // Fetch the constructor function of the object. |
149 Object* cons_obj = JSObject::cast(this)->map()->constructor(); | 141 Object* cons_obj = JSObject::cast(this)->map()->constructor(); |
150 if (!cons_obj->IsJSFunction()) return false; | 142 if (!cons_obj->IsJSFunction()) return false; |
151 JSFunction* fun = JSFunction::cast(cons_obj); | 143 JSFunction* fun = JSFunction::cast(cons_obj); |
152 // Iterate through the chain of inheriting function templates to | 144 // Iterate through the chain of inheriting function templates to |
153 // see if the required one occurs. | 145 // see if the required one occurs. |
154 for (Object* type = fun->shared()->function_data(); | 146 for (Object* type = fun->shared()->function_data(); |
(...skipping 5406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5561 #undef WRITE_UINT32_FIELD | 5553 #undef WRITE_UINT32_FIELD |
5562 #undef READ_SHORT_FIELD | 5554 #undef READ_SHORT_FIELD |
5563 #undef WRITE_SHORT_FIELD | 5555 #undef WRITE_SHORT_FIELD |
5564 #undef READ_BYTE_FIELD | 5556 #undef READ_BYTE_FIELD |
5565 #undef WRITE_BYTE_FIELD | 5557 #undef WRITE_BYTE_FIELD |
5566 | 5558 |
5567 | 5559 |
5568 } } // namespace v8::internal | 5560 } } // namespace v8::internal |
5569 | 5561 |
5570 #endif // V8_OBJECTS_INL_H_ | 5562 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |