VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMAll/IEMAllN8vePython.py@ 101298

Last change on this file since 101298 was 101275, checked in by vboxsync, 18 months ago

VMM/IEM: Started on bugref:10371 ...

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
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"""
7Native recompiler side-kick for IEMAllThrdPython.py.
8
9Analyzes the each threaded function variant to see if we can we're able to
10recompile it, then provides modifies MC block code for doing so.
11"""
12
13from __future__ import print_function;
14
15__copyright__ = \
16"""
17Copyright (C) 2023 Oracle and/or its affiliates.
18
19This file is part of VirtualBox base platform packages, as
20available from https://www.virtualbox.org.
21
22This program is free software; you can redistribute it and/or
23modify it under the terms of the GNU General Public License
24as published by the Free Software Foundation, in version 3 of the
25License.
26
27This program is distributed in the hope that it will be useful, but
28WITHOUT ANY WARRANTY; without even the implied warranty of
29MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30General Public License for more details.
31
32You should have received a copy of the GNU General Public License
33along with this program; if not, see <https://www.gnu.org/licenses>.
34
35SPDX-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
45class 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
70def 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;
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette