BackendOpCodeAttr.h 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 does not transfer value from src to dst (only some opcode are marked property)
  42. bool DoNotTransfer(Js::OpCode opcode);
  43. // True if the opcode may have implicit call
  44. bool HasImplicitCall(Js::OpCode opcode);
  45. // True if the opcode is a profiled variant
  46. bool IsProfiledOp(Js::OpCode opcode);
  47. // True if the opcode is a profiled variant with an inline cache index
  48. bool IsProfiledOpWithICIndex(Js::OpCode opcode);
  49. // True if the opcode is a math helper, such as sin, cos, pow,..
  50. bool IsInlineBuiltIn(Js::OpCode opcode);
  51. // True if the opcode may transfer a non-integer value from the non-constant source to the destination
  52. bool NonIntTransfer(Js::OpCode opcode);
  53. // True if the opcode converts its srcs to int32 or a narrower int type, and produces an int32
  54. bool IsInt32(Js::OpCode opcode);
  55. // True if the opcode always produces a number
  56. bool ProducesNumber(Js::OpCode opcode);
  57. // False if the opcode results in jump to end of the function and there cannot be fallthrough.
  58. bool HasFallThrough(Js::OpCode opcode);
  59. // True if we need to generate bailout after this opcode when in debug mode (b/o on return from helper).
  60. bool NeedsPostOpDbgBailOut(Js::OpCode opcode);
  61. // True if the opcode has a small/large layout
  62. bool HasMultiSizeLayout(Js::OpCode opcode);
  63. // True if the opcode has a profiled version of the opcode
  64. bool HasProfiledOp(Js::OpCode opcode);
  65. // True if the opcode has a profiled version of the opcode with an inline cache index
  66. bool HasProfiledOpWithICIndex(Js::OpCode opcode);
  67. // True if the opcode will never fallthrough (e.g. guaranteed bailout)
  68. bool HasDeadFallThrough(Js::OpCode opcode);
  69. // True if the opcode can use fixed fields
  70. bool CanLoadFixedFields(Js::OpCode opcode);
  71. #if DBG
  72. // True if the opcode can only appear in the back end
  73. bool BackEndOnly(Js::OpCode opcode);
  74. // True if the opcode load the global object
  75. bool LoadRoot(Js::OpCode opcode);
  76. #endif
  77. };