- // *Sigh*, If the JIT is enabled we need to track the stubRountine (of type CodeLocationLabel),
- // If the JIT is not in use we don't actually need the variable (that said, if the JIT is not in use we don't
- // curently actually use PolymorphicAccessStructureLists, which we should). Anyway, this seems like the best
- // solution for now - will need to something smarter if/when we actually want mixed-mode operation.
-#if ENABLE(JIT)
- typedef CodeLocationLabel PolymorphicAccessStructureListStubRoutineType;
-#else
- typedef void* PolymorphicAccessStructureListStubRoutineType;
-#endif
-
- class JSCell;
- class Structure;
- class StructureChain;
-
- // Structure used by op_get_by_id_self_list and op_get_by_id_proto_list instruction to hold data off the main opcode stream.
- struct PolymorphicAccessStructureList {
- WTF_MAKE_FAST_ALLOCATED;
- public:
- struct PolymorphicStubInfo {
- bool isChain;
- PolymorphicAccessStructureListStubRoutineType stubRoutine;
- WriteBarrier<Structure> base;
- union {
- WriteBarrierBase<Structure> proto;
- WriteBarrierBase<StructureChain> chain;
- } u;
-
- PolymorphicStubInfo()
- {
- u.proto.clear();
- }
-
- void set(JSGlobalData& globalData, JSCell* owner, PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base)
- {
- stubRoutine = _stubRoutine;
- base.set(globalData, owner, _base);
- u.proto.clear();
- isChain = false;
- }
-
- void set(JSGlobalData& globalData, JSCell* owner, PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base, Structure* _proto)
- {
- stubRoutine = _stubRoutine;
- base.set(globalData, owner, _base);
- u.proto.set(globalData, owner, _proto);
- isChain = false;
- }
-
- void set(JSGlobalData& globalData, JSCell* owner, PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base, StructureChain* _chain)
- {
- stubRoutine = _stubRoutine;
- base.set(globalData, owner, _base);
- u.chain.set(globalData, owner, _chain);
- isChain = true;
- }
- } list[POLYMORPHIC_LIST_CACHE_SIZE];