Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/p/codegen/InterfaceCastSnippet.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 PPCINTERFACECASTSNIPPET_INCL
24
#define PPCINTERFACECASTSNIPPET_INCL
25
26
#include "codegen/Snippet.hpp"
27
#include "p/codegen/PPCInstruction.hpp"
28
29
namespace TR {
30
31
class PPCInterfaceCastSnippet : public TR::Snippet
32
{
33
TR::Instruction *_upperInstruction, *_lowerInstruction;
34
TR::LabelSymbol *_restartLabel;
35
TR::LabelSymbol *_trueLabel;
36
TR::LabelSymbol *_falseLabel;
37
TR::LabelSymbol *_doneLabel;
38
TR::LabelSymbol *_callLabel;
39
bool _testCastClassIsSuper;
40
bool _checkCast;
41
bool _needsResult;
42
int32_t _offsetClazz;
43
int32_t _offsetCastClassCache;
44
45
public:
46
47
PPCInterfaceCastSnippet(TR::CodeGenerator *cg, TR::Node *n, TR::LabelSymbol *restartLabel, TR::LabelSymbol *snippetLabel, TR::LabelSymbol *trueLabel, TR::LabelSymbol *falseLabel, TR::LabelSymbol *doneLabel, TR::LabelSymbol *callLabel, bool testCastClassIsSuper, bool checkcast, int32_t offsetClazz, int32_t offsetCastClassCache, bool needsResult);
48
49
bool isCheckCast() { return _checkCast;};
50
51
bool getTestCastClassIsSuper() {return _testCastClassIsSuper;}
52
bool getNeedsResult() {return _needsResult;}
53
54
TR::LabelSymbol *getDoneLabel() {return _doneLabel;}
55
TR::LabelSymbol *getTrueLabel() {return _trueLabel;}
56
TR::LabelSymbol *getFalseLabel() {return _falseLabel;}
57
TR::LabelSymbol *getReStartLabel() {return _restartLabel;}
58
TR::LabelSymbol *setReStartLabel(TR::LabelSymbol *l) {return (_restartLabel = l);}
59
60
TR::Instruction *getUpperInstruction() {return _upperInstruction;}
61
TR::Instruction *setUpperInstruction(TR::Instruction *pi) { return (_upperInstruction = pi);}
62
63
TR::Instruction *getLowerInstruction() {return _lowerInstruction;}
64
TR::Instruction *setLowerInstruction(TR::Instruction *pi) { return (_lowerInstruction = pi);}
65
66
virtual Kind getKind() { return IsInterfaceCastSnippet; }
67
virtual uint8_t *emitSnippetBody();
68
virtual uint32_t getLength(int32_t estimatedSnippetStart);
69
};
70
71
}
72
73
#endif
74
75
76