1 | #!/usr/bin/env python
|
---|
2 | # -*- coding: utf-8 -*-
|
---|
3 | # $Id: IEMAllN8vePython.py 101275 2023-09-26 23:44:36Z vboxsync $
|
---|
4 | # pylint: disable=invalid-name
|
---|
5 |
|
---|
6 | """
|
---|
7 | Native recompiler side-kick for IEMAllThrdPython.py.
|
---|
8 |
|
---|
9 | Analyzes the each threaded function variant to see if we can we're able to
|
---|
10 | recompile it, then provides modifies MC block code for doing so.
|
---|
11 | """
|
---|
12 |
|
---|
13 | from __future__ import print_function;
|
---|
14 |
|
---|
15 | __copyright__ = \
|
---|
16 | """
|
---|
17 | Copyright (C) 2023 Oracle and/or its affiliates.
|
---|
18 |
|
---|
19 | This file is part of VirtualBox base platform packages, as
|
---|
20 | available from https://www.virtualbox.org.
|
---|
21 |
|
---|
22 | This program is free software; you can redistribute it and/or
|
---|
23 | modify it under the terms of the GNU General Public License
|
---|
24 | as published by the Free Software Foundation, in version 3 of the
|
---|
25 | License.
|
---|
26 |
|
---|
27 | This program is distributed in the hope that it will be useful, but
|
---|
28 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
29 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
30 | General Public License for more details.
|
---|
31 |
|
---|
32 | You should have received a copy of the GNU General Public License
|
---|
33 | along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
34 |
|
---|
35 | SPDX-License-Identifier: GPL-3.0-only
|
---|
36 | """
|
---|
37 | __version__ = "$Revision: 101275 $"
|
---|
38 |
|
---|
39 | # Standard python imports.
|
---|
40 | #import sys;
|
---|
41 |
|
---|
42 | #import IEMAllInstPython as iai;
|
---|
43 |
|
---|
44 |
|
---|
45 | class NativeRecompFunctionVariation(object):
|
---|
46 | """
|
---|
47 | Class that deals with transforming a threaded function variation into a
|
---|
48 | native recompiler function.
|
---|
49 | """
|
---|
50 |
|
---|
51 | def __init__(self, oVariation, sHostArch):
|
---|
52 | self.oVariation = oVariation # type: ThreadedFunctionVariation
|
---|
53 | self.sHostArch = sHostArch;
|
---|
54 |
|
---|
55 | def isRecompilable(self):
|
---|
56 | """
|
---|
57 | Predicate that returns whether the variant can be recompiled natively
|
---|
58 | (for the selected host architecture).
|
---|
59 | """
|
---|
60 | return False;
|
---|
61 |
|
---|
62 | def renderCode(self, cchIndent):
|
---|
63 | """
|
---|
64 | Returns the native recompiler function body for this threaded variant.
|
---|
65 | """
|
---|
66 | return ' ' * cchIndent + ' AssertFailed();';
|
---|
67 |
|
---|
68 |
|
---|
69 |
|
---|
70 | def analyzeVariantForNativeRecomp(oVariation,
|
---|
71 | sHostArch): # type: (ThreadedFunctionVariation, str) -> NativeRecompFunctionVariation
|
---|
72 | """
|
---|
73 | This function analyzes the threaded function variant and returns an
|
---|
74 | NativeRecompFunctionVariation instance for it, unless it's not
|
---|
75 | possible to recompile at present.
|
---|
76 |
|
---|
77 | Returns NativeRecompFunctionVariation or None.
|
---|
78 | """
|
---|
79 |
|
---|
80 | _ = oVariation;
|
---|
81 | _ = sHostArch;
|
---|
82 |
|
---|
83 | return None;
|
---|