BackendOpCodeAttr.h 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. namespace OpCodeAttr
  6. {
  7. // True if the opcode has side effect other then assigning to the dst
  8. bool HasSideEffects(Js::OpCode opcode);
  9. // True if the opcode has not side-effect and always produces the same value for a given input
  10. bool CanCSE(Js::OpCode opcode);
  11. // True if the opcode implicitly (may) use any the fields
  12. bool UseAllFields(Js::OpCode opcode);
  13. // True if the opcode don't allow temp numbers sources (e.g. StFld, Ret, StElem)
  14. bool NonTempNumberSources(Js::OpCode opcode);
  15. // !NonTempSources
  16. bool TempNumberSources(Js::OpCode opcode);
  17. // True if the opcode can use a temporary stack slot for it's number result
  18. bool TempNumberProducing(Js::OpCode opcode);
  19. // True if the source number may assign directly to the dest number
  20. bool TempNumberTransfer(Js::OpCode opcode);
  21. // True if the opcode allows temp object sources
  22. bool TempObjectSources(Js::OpCode opcode);
  23. // True if the opcode can generate object on the stack
  24. bool TempObjectProducing(Js::OpCode opcode);
  25. // True if the opcode can generate object on the stack and will once marked so other temp object/number can be stored
  26. bool TempObjectCanStoreTemp(Js::OpCode opcode);
  27. // True if the source object may assign directly to the dest object
  28. bool TempObjectTransfer(Js::OpCode opcode);
  29. // True for call instructions
  30. bool CallInstr(Js::OpCode opcode);
  31. // True for call instructions which may get inlined
  32. bool InlineCallInstr(Js::OpCode opcode);
  33. // True if evaluation/read/write of operand may cause implicit call
  34. bool OpndHasImplicitCall(Js::OpCode opcode);
  35. // True if the opcode can do optimizations on property syms.
  36. bool FastFldInstr(Js::OpCode opcode);
  37. // True if the opcode requires a bailout record.
  38. bool BailOutRec(Js::OpCode opcode);
  39. // True if the opcode can only appear in the byte code
  40. bool ByteCodeOnly(Js::OpCode opcode);
  41. // True if the opcode can only appear in the back end
  42. bool BackEndOnly(Js::OpCode opcode);
  43. // True if the opcode does not transfer value from src to dst (only some opcode are marked property)
  44. bool DoNotTransfer(Js::OpCode opcode);
  45. // True if the opcode may have implicit call
  46. bool HasImplicitCall(Js::OpCode opcode);
  47. // True if the opcode is a profiled variant
  48. bool IsProfiledOp(Js::OpCode opcode);
  49. // True if the opcode is a profiled variant with an inline cache index
  50. bool IsProfiledOpWithICIndex(Js::OpCode opcode);
  51. // True if the opcode is a math helper, such as sin, cos, pow,..
  52. bool IsInlineBuiltIn(Js::OpCode opcode);
  53. // True if the opcode may transfer a non-integer value from the non-constant source to the destination
  54. bool NonIntTransfer(Js::OpCode opcode);
  55. // True if the opcode converts its srcs to int32 or a narrower int type, and produces an int32
  56. bool IsInt32(Js::OpCode opcode);
  57. // True if the opcode always produces a number
  58. bool ProducesNumber(Js::OpCode opcode);
  59. // False if the opcode results in jump to end of the function and there cannot be fallthrough.
  60. bool HasFallThrough(Js::OpCode opcode);
  61. // True if we need to generate bailout after this opcode when in debug mode (b/o on return from helper).
  62. bool NeedsPostOpDbgBailOut(Js::OpCode opcode);
  63. // True if the opcode has a small/large layout
  64. bool HasMultiSizeLayout(Js::OpCode opcode);
  65. // True if the opcode has a profiled version of the opcode
  66. bool HasProfiledOp(Js::OpCode opcode);
  67. // True if the opcode has a profiled version of the opcode with an inline cache index
  68. bool HasProfiledOpWithICIndex(Js::OpCode opcode);
  69. // True if the opcode will never fallthrough (e.g. guaranteed bailout)
  70. bool HasDeadFallThrough(Js::OpCode opcode);
  71. // True if the opcode can use fixed fields
  72. bool CanLoadFixedFields(Js::OpCode opcode);
  73. };