Changeset 11773 in webkit for trunk/JavaScriptCore/kjs/object.h
- Timestamp:
- Dec 27, 2005, 1:24:14 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/object.h
r11566 r11773 51 51 // ECMA 262-3 8.6.1 52 52 // Property attributes 53 enum Attribute { None = 0, 54 ReadOnly = 1 << 1, // property can be only read, not written 55 DontEnum = 1 << 2, // property doesn't appear in (for .. in ..) 56 DontDelete = 1 << 3, // property can't be deleted 57 Internal = 1 << 4, // an internal property, set to bypass checks 58 Function = 1 << 5 }; // property is a function - only used by static hashtables 53 enum Attribute { None = 0, 54 ReadOnly = 1 << 1, // property can be only read, not written 55 DontEnum = 1 << 2, // property doesn't appear in (for .. in ..) 56 DontDelete = 1 << 3, // property can't be deleted 57 Internal = 1 << 4, // an internal property, set to bypass checks 58 Function = 1 << 5, // property is a function - only used by static hashtables 59 GetterSetter = 1 << 6 }; // property is a getter or setter 59 60 60 61 /** … … 503 504 void putDirect(const Identifier &propertyName, JSValue *value, int attr = 0); 504 505 void putDirect(const Identifier &propertyName, int value, int attr = 0); 505 506 507 void fillGetterPropertySlot(PropertySlot& slot, JSValue **location); 508 506 509 void defineGetter(ExecState *exec, const Identifier& propertyName, JSObject *getterFunc); 507 510 void defineSetter(ExecState *exec, const Identifier& propertyName, JSObject *setterFunc); … … 567 570 JSObject *throwError(ExecState *, ErrorType, const char *message); 568 571 JSObject *throwError(ExecState *, ErrorType); 569 570 inline bool JSCell::isObject(const ClassInfo *info) const571 {572 return isObject() && static_cast<const JSObject *>(this)->inherits(info);573 }574 572 575 573 inline JSObject::JSObject(JSObject *proto) … … 613 611 } 614 612 613 // this method is here to be after the inline declaration of JSObject::inherits 614 inline bool JSCell::isObject(const ClassInfo *info) const 615 { 616 return isObject() && static_cast<const JSObject *>(this)->inherits(info); 617 } 618 619 // this method is here to be after the inline declaration of JSCell::isObject 620 inline bool JSValue::isObject(const ClassInfo *c) const 621 { 622 return !SimpleNumber::is(this) && downcast()->isObject(c); 623 } 624 615 625 // It may seem crazy to inline a function this large but it makes a big difference 616 626 // since this is function very hot in variable lookup … … 633 643 // but it makes a big difference to property lookup that derived classes can inline their 634 644 // base class call to this. 635 inlinebool JSObject::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)645 ALWAYS_INLINE bool JSObject::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot) 636 646 { 637 647 if (JSValue **location = getDirectLocation(propertyName)) { 638 if ((*location)->type() == GetterSetterType) { 639 GetterSetterImp *gs = static_cast<GetterSetterImp *>(*location); 640 JSObject *getterFunc = gs->getGetter(); 641 if (getterFunc) 642 slot.setGetterSlot(this, getterFunc); 643 else 644 slot.setUndefined(this); 645 } else { 648 if (_prop.hasGetterSetterProperties() && location[0]->type() == GetterSetterType) 649 fillGetterPropertySlot(slot, location); 650 else 646 651 slot.setValueSlot(this, location); 647 }648 652 return true; 649 653 }
Note:
See TracChangeset
for help on using the changeset viewer.