Path: blob/master/runtime/compiler/ilgen/ClassLookahead.hpp
6000 views
/*******************************************************************************1* Copyright (c) 2000, 2016 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* 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-exception20*******************************************************************************/2122#ifndef ClassLookahead_h23#define ClassLookahead_h2425#include "compile/Compilation.hpp"26#include "env/CHTable.hpp"27#include "env/VMJ9.h"2829class TR_ClassLookahead30{31public:32TR_ALLOC(TR_Memory::ClassLookahead)3334TR_ClassLookahead(TR_PersistentClassInfo *, TR_FrontEnd *, TR::Compilation *, TR::SymbolReferenceTable *);35int32_t perform();3637TR_PersistentArrayFieldInfo *getExistingArrayFieldInfo(TR::Symbol *, TR::SymbolReference *);38TR_PersistentFieldInfo *getExistingFieldInfo(TR::Symbol *, TR::SymbolReference *, bool canMorph = true);3940void findInitializerMethods(List<TR_ResolvedMethod> *, List<TR::ResolvedMethodSymbol> *, List<TR::ResolvedMethodSymbol> *, TR::ResolvedMethodSymbol **, bool *peekFailedForAnyMethod);41void initializeFieldInfo();42void updateFieldInfo();43void makeInfoPersistent();4445bool examineNode(TR::TreeTop *, TR::Node *, TR::Node *, int32_t, TR::Node *, vcount_t);46void invalidateIfEscapingLoad(TR::TreeTop *, TR::Node *, TR::Node *, int32_t, TR::Node *);47bool isProperFieldAccess(TR::Node *);48bool isPrivateFieldAccess(TR::Node *);4950TR::Compilation * comp() {return _compilation;}51TR_FrontEnd * fe() {return _fe;}52TR_J9VMBase * fej9() {return (TR_J9VMBase *)_fe; }53TR_Debug * getDebug() {return _compilation->getDebug();}5455// Checking NaN56//void TR_ClassLookahead::checkAndInvalidateNonNaNProperty(TR::Node *, TR_PersistentFieldInfo *);57//int32_t TR_ClassLookahead::mustNotContainNaN(TR::Node *);5859bool findMethod(List<TR::ResolvedMethodSymbol> *, TR::ResolvedMethodSymbol *);6061static char *getFieldSignature(TR::Compilation *, TR::Symbol *, TR::SymbolReference *, int32_t &length);6263private:64// data65//66TR_FrontEnd * _fe;67TR::Compilation * _compilation;68TR::SymbolReferenceTable * _symRefTab;69TR_OpaqueClassBlock * _classPointer;70TR_PersistentClassInfoForFields * _classFieldInfo;71TR_PersistentClassInfo * _classInfo;72TR::ResolvedMethodSymbol * _currentMethodSymbol;73bool _inFirstBlock;74bool _inInitializerMethod;75bool _inFirstInitializerMethod;76bool _inClassInitializerMethod;77bool _traceIt;78};7980#endif818283848586878889