| 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 5394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5549 #undef WRITE_UINT32_FIELD | 5541 #undef WRITE_UINT32_FIELD |
| 5550 #undef READ_SHORT_FIELD | 5542 #undef READ_SHORT_FIELD |
| 5551 #undef WRITE_SHORT_FIELD | 5543 #undef WRITE_SHORT_FIELD |
| 5552 #undef READ_BYTE_FIELD | 5544 #undef READ_BYTE_FIELD |
| 5553 #undef WRITE_BYTE_FIELD | 5545 #undef WRITE_BYTE_FIELD |
| 5554 | 5546 |
| 5555 | 5547 |
| 5556 } } // namespace v8::internal | 5548 } } // namespace v8::internal |
| 5557 | 5549 |
| 5558 #endif // V8_OBJECTS_INL_H_ | 5550 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |