Backend.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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. #include <wchar.h>
  7. // =================
  8. // Runtime Includes
  9. // =================
  10. #include "Runtime.h"
  11. #include "ByteCode/StatementReader.h"
  12. #include "Language/EHBailoutData.h"
  13. #include "Language/AsmJsTypes.h"
  14. #include "Language/AsmJsModule.h"
  15. #include "Language/ProfilingHelpers.h"
  16. #include "Language/FunctionCodeGenRuntimeData.h"
  17. #include "Language/ObjTypeSpecFldInfo.h"
  18. #include "Language/FunctionCodeGenJitTimeData.h"
  19. #include "Language/JavascriptMathOperators.h"
  20. #include "Language/JavascriptMathOperators.inl"
  21. #include "Language/JavascriptStackWalker.h"
  22. #include "Language/CodeGenRecyclableData.h"
  23. #include "Library/JavascriptGenerator.h"
  24. #include "Library/JavascriptRegularExpression.h"
  25. #include "Library/StackScriptFunction.h"
  26. #include "Library/JavascriptProxy.h"
  27. #include "Library/JavascriptGeneratorFunction.h"
  28. #include "Language/InterpreterStackFrame.h"
  29. #include "Library/StackScriptFunction.h"
  30. // SIMD_JS
  31. #include "Library/SimdLib.h"
  32. #include "Language/SimdOps.h"
  33. // =================
  34. // Common Includes
  35. // =================
  36. #include "DataStructures/Pair.h"
  37. #include "DataStructures/HashTable.h"
  38. // =================
  39. //
  40. // Defines
  41. //
  42. // The shld optimization is bad for AMD hardware
  43. // The lack of it is ameliorated for Intel hardware by adding BTS optimization
  44. #undef SHIFTLOAD
  45. #define Fatal() Js::Throw::FatalInternalError()
  46. // By default, do encode large user constants for security.
  47. #ifndef MD_ENCODE_LG_CONSTS
  48. #define MD_ENCODE_LG_CONSTS true
  49. #endif
  50. //
  51. // Forward refs
  52. //
  53. class Func;
  54. class Loop;
  55. //
  56. // Typedefs
  57. //
  58. const int32 IntConstMax = INT_MAX;
  59. const int32 IntConstMin = INT_MIN;
  60. const int32 Int8ConstMax = _I8_MAX;
  61. const int32 Int8ConstMin = _I8_MIN;
  62. const int32 Int16ConstMax = _I16_MAX;
  63. const int32 Int16ConstMin = _I16_MIN;
  64. const int32 Int32ConstMax = _I32_MAX;
  65. const int32 Int32ConstMin = _I32_MIN;
  66. const int32 Uint8ConstMax = _UI8_MAX;
  67. const int32 Uint8ConstMin = 0;
  68. const int32 Uint16ConstMax = _UI16_MAX;
  69. const int32 Uint16ConstMin = 0;
  70. #if defined(_M_X64) || defined(_M_ARM32_OR_ARM64)
  71. // Arm VFPv3-D32 has 32 double registers and 16 int registers total 48.
  72. // Arm64 has 32 vector registers and 32 int registers total 64.
  73. // Amd64 has 16 int and 16 xmm registers and slot for NOREG makes it 33 hence 64 bit version
  74. // for Amd64 & Arm
  75. typedef BVUnit64 BitVector;
  76. #else
  77. // x86 has only 8 int registers & 8 xmm registers
  78. // 32 bit vector is sufficient to address all the registers
  79. typedef BVUnit32 BitVector;
  80. #endif
  81. #if DBG_DUMP || defined(ENABLE_IR_VIEWER)
  82. enum IRDumpFlags
  83. {
  84. IRDumpFlags_None = 0x0,
  85. IRDumpFlags_AsmDumpMode = 0x1,
  86. IRDumpFlags_SimpleForm = 0x2,
  87. IRDumpFlags_SkipEndLine = 0x4,
  88. IRDumpFlags_SkipByteCodeOffset = 0x8,
  89. };
  90. #endif
  91. //
  92. // BackEnd includes
  93. //
  94. #include "JITTimeProfileInfo.h"
  95. #include "JITRecyclableObject.h"
  96. #include "JITTimeFixedField.h"
  97. #include "JITTimePolymorphicInlineCache.h"
  98. #include "JITTimePolymorphicInlineCacheInfo.h"
  99. #include "CodeGenWorkItemType.h"
  100. #include "CodeGenAllocators.h"
  101. #include "JITTimeConstructorCache.h"
  102. #include "JITTypeHandler.h"
  103. #include "JITType.h"
  104. #include "JITObjTypeSpecFldInfo.h"
  105. #include "ServerScriptContext.h"
  106. #include "JITOutput.h"
  107. #include "JITTimeScriptContext.h"
  108. #include "AsmJsJITInfo.h"
  109. #include "FunctionJITRuntimeInfo.h"
  110. #include "JITTimeFunctionBody.h"
  111. #include "FunctionJITTimeInfo.h"
  112. #include "JITTimeWorkItem.h"
  113. #include "NativeCodeData.h"
  114. #include "IRType.h"
  115. #include "md.h"
  116. #include "../Runtime/ByteCode/BackendOpCodeAttr.h"
  117. #include "BackendOpCodeAttrAsmJs.h"
  118. #include "JnHelperMethod.h"
  119. #include "Reg.h"
  120. #include "Sym.h"
  121. #include "SymTable.h"
  122. #include "IR.h"
  123. #include "Opnd.h"
  124. #include "IntOverflowDoesNotMatterRange.h"
  125. #include "IntConstantBounds.h"
  126. #include "ValueRelativeOffset.h"
  127. #include "IntBounds.h"
  128. #include "InductionVariable.h"
  129. #include "GlobOpt.h"
  130. #include "GlobOptIntBounds.h"
  131. #include "QueuedFullJitWorkItem.h"
  132. #include "CodeGenWorkItem.h"
  133. #include "SimpleJitProfilingHelpers.h"
  134. #if defined(_M_X64)
  135. #include "PrologEncoder.h"
  136. #endif
  137. #include "Func.h"
  138. #include "TempTracker.h"
  139. #include "FlowGraph.h"
  140. #include "PDataManager.h"
  141. #include "ServerThreadContext.h"
  142. #include "CaseNode.h"
  143. #include "SwitchIRBuilder.h"
  144. #include "IRBuilder.h"
  145. #include "IRBuilderAsmJs.h"
  146. #include "BackwardPass.h"
  147. #include "Lower.h"
  148. #include "Security.h"
  149. #include "Peeps.h"
  150. #include "LinearScan.h"
  151. #include "SimpleLayout.h"
  152. #include "Encoder.h"
  153. #include "EmitBuffer.h"
  154. #include "InterpreterThunkEmitter.h"
  155. #include "InliningHeuristics.h"
  156. #include "InliningDecider.h"
  157. #include "Inline.h"
  158. #include "NativeCodeGenerator.h"
  159. #include "Region.h"
  160. #include "BailOut.h"
  161. #include "InlineeFrameInfo.h"
  162. #include "IRViewer.h"
  163. #if DBG
  164. # include "DbCheckPostLower.h"
  165. #endif
  166. //
  167. // Inlines
  168. //
  169. #include "Sym.inl"
  170. #include "IR.inl"
  171. #include "Opnd.inl"