Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/z/codegen/ForceRecompilationSnippet.hpp
6004 views
1
/*******************************************************************************
2
* Copyright (c) 2000, 2016 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
21
*******************************************************************************/
22
23
#ifndef S390FORCERECOMPILATIONSNIPPET_INCL
24
#define S390FORCERECOMPILATIONSNIPPET_INCL
25
26
#include "codegen/Snippet.hpp"
27
#include "z/codegen/ConstantDataSnippet.hpp"
28
#include "codegen/CodeGenerator.hpp"
29
30
namespace TR { class LabelSymbol; }
31
32
namespace TR {
33
34
class S390ForceRecompilationDataSnippet : public TR::S390ConstantDataSnippet
35
{
36
// Label of Return Address in Main Line Code.
37
TR::LabelSymbol *_restartLabel;
38
39
public:
40
41
S390ForceRecompilationDataSnippet(TR::CodeGenerator *,
42
TR::Node *,
43
TR::LabelSymbol *);
44
45
virtual Kind getKind() { return IsForceRecompData; }
46
47
TR::LabelSymbol *getRestartLabel() {return _restartLabel;}
48
TR::LabelSymbol *setRestartLabel(TR::LabelSymbol *l) {return _restartLabel = l;}
49
50
virtual uint8_t *emitSnippetBody();
51
virtual uint32_t getLength(int32_t estimatedSnippetStart);
52
};
53
54
55
class S390ForceRecompilationSnippet : public TR::Snippet
56
{
57
// Label of Return Address in Main Line Code.
58
TR::LabelSymbol *_restartLabel;
59
TR::S390ForceRecompilationDataSnippet *_dataSnippet;
60
public:
61
62
S390ForceRecompilationSnippet(TR::CodeGenerator *cg,
63
TR::Node *node,
64
TR::LabelSymbol *restartlab,
65
TR::LabelSymbol *snippetlab)
66
: TR::Snippet(cg, node, snippetlab, false),
67
_restartLabel(restartlab)
68
{
69
_dataSnippet = new (cg->trHeapMemory()) TR::S390ForceRecompilationDataSnippet(cg,node,restartlab);
70
cg->addDataConstantSnippet(_dataSnippet);
71
}
72
73
virtual Kind getKind() { return IsForceRecomp; }
74
75
TR::LabelSymbol *getRestartLabel() {return _restartLabel;}
76
TR::LabelSymbol *setRestartLabel(TR::LabelSymbol *l) {return _restartLabel = l;}
77
78
TR::S390ForceRecompilationDataSnippet *getDataConstantSnippet() { return _dataSnippet; }
79
TR::S390ForceRecompilationDataSnippet *setDataConstantSnippet(TR::S390ForceRecompilationDataSnippet *snippet)
80
{
81
return _dataSnippet = snippet;
82
}
83
84
virtual uint8_t *emitSnippetBody();
85
virtual uint32_t getLength(int32_t);
86
};
87
88
}
89
90
#endif
91
92