| 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 |
| 137 bool Object::IsInstanceOf(FunctionTemplateInfo* expected) { | 145 bool Object::IsInstanceOf(FunctionTemplateInfo* expected) { |
| 138 // There is a constraint on the object; check. | 146 // There is a constraint on the object; check. |
| 139 if (!this->IsJSObject()) return false; | 147 if (!this->IsJSObject()) return false; |
| 140 // Fetch the constructor function of the object. | 148 // Fetch the constructor function of the object. |
| 141 Object* cons_obj = JSObject::cast(this)->map()->constructor(); | 149 Object* cons_obj = JSObject::cast(this)->map()->constructor(); |
| 142 if (!cons_obj->IsJSFunction()) return false; | 150 if (!cons_obj->IsJSFunction()) return false; |
| 143 JSFunction* fun = JSFunction::cast(cons_obj); | 151 JSFunction* fun = JSFunction::cast(cons_obj); |
| 144 // Iterate through the chain of inheriting function templates to | 152 // Iterate through the chain of inheriting function templates to |
| 145 // see if the required one occurs. | 153 // see if the required one occurs. |
| 146 for (Object* type = fun->shared()->function_data(); | 154 for (Object* type = fun->shared()->function_data(); |
| (...skipping 5393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5540 #undef WRITE_UINT32_FIELD | 5548 #undef WRITE_UINT32_FIELD |
| 5541 #undef READ_SHORT_FIELD | 5549 #undef READ_SHORT_FIELD |
| 5542 #undef WRITE_SHORT_FIELD | 5550 #undef WRITE_SHORT_FIELD |
| 5543 #undef READ_BYTE_FIELD | 5551 #undef READ_BYTE_FIELD |
| 5544 #undef WRITE_BYTE_FIELD | 5552 #undef WRITE_BYTE_FIELD |
| 5545 | 5553 |
| 5546 | 5554 |
| 5547 } } // namespace v8::internal | 5555 } } // namespace v8::internal |
| 5548 | 5556 |
| 5549 #endif // V8_OBJECTS_INL_H_ | 5557 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |