forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpCodeUtil.h
More file actions
52 lines (46 loc) · 2.12 KB
/
OpCodeUtil.h
File metadata and controls
52 lines (46 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once
namespace Js
{
class OpCodeUtil
{
public:
static char16 const * GetOpCodeName(OpCode op);
static bool IsCallOp(OpCode op);
static bool IsProfiledCallOp(OpCode op);
static bool IsProfiledCallOpWithICIndex(OpCode op);
static bool IsProfiledReturnTypeCallOp(OpCode op);
// OpCode conversion functions
static void ConvertOpToNonProfiled(OpCode& op);
static void ConvertNonCallOpToProfiled(OpCode& op);
static void ConvertNonCallOpToProfiledWithICIndex(OpCode& op);
static void ConvertNonCallOpToNonProfiled(OpCode& op);
static void ConvertNonCallOpToNonProfiledWithICIndex(OpCode& op);
static OpCode ConvertProfiledCallOpToNonProfiled(OpCode op);
static OpCode ConvertProfiledReturnTypeCallOpToNonProfiled(OpCode op);
static OpCode ConvertCallOpToProfiled(OpCode op, bool withICIndex = false);
static OpCode ConvertCallOpToProfiledReturnType(OpCode op);
static bool IsValidByteCodeOpcode(OpCode op);
static bool IsValidOpcode(OpCode op);
static bool IsPrefixOpcode(OpCode op);
static bool IsSmallEncodedOpcode(OpCode op);
static uint EncodedSize(OpCode op, LayoutSize layoutSize);
static OpLayoutType GetOpCodeLayout(OpCode op);
private:
#if DBG_DUMP || ENABLE_DEBUG_CONFIG_OPTIONS
static char16 const * const OpCodeNames[(int)Js::OpCode::MaxByteSizedOpcodes + 1];
static char16 const * const ExtendedOpCodeNames[];
static char16 const * const BackendOpCodeNames[];
#endif
static OpLayoutType const OpCodeLayouts[];
static OpLayoutType const ExtendedOpCodeLayouts[];
static OpLayoutType const BackendOpCodeLayouts[];
#if DBG
static OpCode DebugConvertProfiledCallToNonProfiled(OpCode op);
static OpCode DebugConvertProfiledReturnTypeCallToNonProfiled(OpCode op);
#endif
};
};