SpiderMonkey Internal

SpiderMonkey Internal

JSObject

1
2
3
4
5
6
7
8
9
10
11
12
13
// Class Hierarchy
// ---------------
// Property maps have the following C++ class hierarchy:
//
// PropMap (abstract)
// |
// +-- SharedPropMap (abstract)
// | |
// | +-- CompactPropMap
// | |
// | +-- NormalPropMap
// |
// +-- DictionaryPropMap

The PropertyInfo contains the slot index of the property.

1
obj->getSlot(prop.slot());
1
2
3
4
5
6
7
8
9
10
11
12
class NativeObject : public JSObject {
// ...
const Value& getSlot(uint32_t slot) const {
MOZ_ASSERT(slotInRange(slot));
uint32_t fixed = numFixedSlots();
if (slot < fixed) {
return fixedSlots()[slot];
}
return slots_[slot - fixed];
}
// ...
}

[To be continued]