Backend.h 5.0 KB

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