JSCBridgeToll.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Copyright (C) 2013 Sony Computer Entertainment Inc.
  2. // All Rights Reserved.
  3. #ifndef JSCBridgeToll_h
  4. #define JSCBridgeToll_h
  5. #include "BytecodeConventions.h"
  6. #include "CodeType.h"
  7. #include "DFGCommon.h"
  8. #include "SpecialPointer.h"
  9. #include "unicode/umachine.h"
  10. #include <wtf/HashMap.h>
  11. #include <wtf/StdLibExtras.h>
  12. #include <wtf/Vector.h>
  13. #include <JITBridge.h>
  14. #if ENABLE_DETACHED_JIT
  15. namespace JSC {
  16. class CodeBlock;
  17. class Identifier;
  18. class JSCBridge;
  19. class Structure;
  20. class VM;
  21. class JSCBridgeToll {
  22. public:
  23. DETACHED_JIT_MAKE_SHARED_DATA_ALLOCATED;
  24. public:
  25. JSCBridgeToll(JSCBridge::Payload *);
  26. virtual ~JSCBridgeToll();
  27. void prepare(VM *);
  28. void prepare(CodeBlock *);
  29. void prepare(JSGlobalObject *);
  30. public:
  31. struct VMToll {
  32. Structure * m_stringStructure;
  33. };
  34. struct CodeBlockToll {
  35. CodeType m_codeType;
  36. unsigned const * m_jumpTargets;
  37. size_t m_numberOfJumpTargets;
  38. DFG::CapabilityLevel m_dfgCapabilityLevel;
  39. };
  40. struct GlobalObjectToll {
  41. void * m_specialPointers[Special::TableSize];
  42. };
  43. VMToll m_vm;
  44. CodeBlockToll const & forCodeBlock(CodeBlock const *);
  45. GlobalObjectToll const & forGlobalObject(JSGlobalObject const *);
  46. private:
  47. typedef HashMap_shared<CodeBlock const *, CodeBlockToll> CodeBlockTollMap;
  48. typedef HashMap_shared<JSGlobalObject const *, GlobalObjectToll> GlobalObjectTollMap;
  49. JSCBridge::Payload * m_payload;
  50. CodeBlockTollMap m_codeBlockTollMap;
  51. GlobalObjectTollMap m_globalObjectTollMap;
  52. };
  53. } // namespace JSC
  54. #endif
  55. #endif