AsmJsJITInfo.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. class AsmJsJITInfo
  7. {
  8. #ifdef ASMJS_PLAT
  9. public:
  10. AsmJsJITInfo(AsmJsDataIDL * data);
  11. WAsmJs::TypedSlotInfo GetTypedSlotInfo(WAsmJs::Types type) const;
  12. #define TYPED_SLOT_INFO_GETTER(name, type) \
  13. int Get##name##ByteOffset() const { return m_data.typedSlotInfos[WAsmJs::##type].byteOffset; }\
  14. int Get##name##ConstCount() const { return m_data.typedSlotInfos[WAsmJs::##type].constCount; }\
  15. int Get##name##TmpCount() const { return m_data.typedSlotInfos[WAsmJs::##type].tmpCount; }\
  16. int Get##name##VarCount() const { return m_data.typedSlotInfos[WAsmJs::##type].varCount; }
  17. TYPED_SLOT_INFO_GETTER(Double, FLOAT64);
  18. TYPED_SLOT_INFO_GETTER(Float, FLOAT32);
  19. TYPED_SLOT_INFO_GETTER(Int, INT32);
  20. TYPED_SLOT_INFO_GETTER(Int64, INT64);
  21. TYPED_SLOT_INFO_GETTER(Simd, SIMD);
  22. int GetTotalSizeInBytes() const;
  23. Js::ArgSlot GetArgCount() const;
  24. Js::ArgSlot GetArgByteSize() const;
  25. Js::AsmJsRetType::Which GetRetType() const;
  26. Js::AsmJsVarType::Which GetArgType(Js::ArgSlot argNum) const;
  27. #ifdef ENABLE_WASM
  28. Wasm::WasmSignature * GetWasmSignature(uint index) const;
  29. intptr_t GetWasmSignatureAddr(uint index) const;
  30. #endif
  31. bool UsesHeapBuffer() const;
  32. bool AccessNeedsBoundCheck(uint offset) const;
  33. private:
  34. Js::AsmJsVarType::Which * GetArgTypeArray() const;
  35. AsmJsDataIDL m_data;
  36. #endif
  37. };