X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..fb8617cde5834786bd4e4afd579883e4acf5666e:/bytecode/Instruction.h?ds=sidebyside diff --git a/bytecode/Instruction.h b/bytecode/Instruction.h index 1fab106..bcef7fb 100644 --- a/bytecode/Instruction.h +++ b/bytecode/Instruction.h @@ -29,30 +29,41 @@ #ifndef Instruction_h #define Instruction_h +#include "MacroAssembler.h" #include "Opcode.h" #include "Structure.h" #include -#define POLYMORPHIC_LIST_CACHE_SIZE 4 +#define POLYMORPHIC_LIST_CACHE_SIZE 8 namespace JSC { + // *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 { + struct PolymorphicAccessStructureList : FastAllocBase { struct PolymorphicStubInfo { bool isChain; - void* stubRoutine; + PolymorphicAccessStructureListStubRoutineType stubRoutine; Structure* base; union { Structure* proto; StructureChain* chain; } u; - void set(void* _stubRoutine, Structure* _base) + void set(PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base) { stubRoutine = _stubRoutine; base = _base; @@ -60,7 +71,7 @@ namespace JSC { isChain = false; } - void set(void* _stubRoutine, Structure* _base, Structure* _proto) + void set(PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base, Structure* _proto) { stubRoutine = _stubRoutine; base = _base; @@ -68,7 +79,7 @@ namespace JSC { isChain = false; } - void set(void* _stubRoutine, Structure* _base, StructureChain* _chain) + void set(PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base, StructureChain* _chain) { stubRoutine = _stubRoutine; base = _base; @@ -77,17 +88,17 @@ namespace JSC { } } list[POLYMORPHIC_LIST_CACHE_SIZE]; - PolymorphicAccessStructureList(void* stubRoutine, Structure* firstBase) + PolymorphicAccessStructureList(PolymorphicAccessStructureListStubRoutineType stubRoutine, Structure* firstBase) { list[0].set(stubRoutine, firstBase); } - PolymorphicAccessStructureList(void* stubRoutine, Structure* firstBase, Structure* firstProto) + PolymorphicAccessStructureList(PolymorphicAccessStructureListStubRoutineType stubRoutine, Structure* firstBase, Structure* firstProto) { list[0].set(stubRoutine, firstBase, firstProto); } - PolymorphicAccessStructureList(void* stubRoutine, Structure* firstBase, StructureChain* firstChain) + PolymorphicAccessStructureList(PolymorphicAccessStructureListStubRoutineType stubRoutine, Structure* firstBase, StructureChain* firstChain) { list[0].set(stubRoutine, firstBase, firstChain); }