Path: blob/master/runtime/bcutil/ClassFileParser.hpp
5985 views
/*******************************************************************************1* Copyright (c) 2001, 2017 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/*23* ClassFileParser.hpp24*25* Created on: Aug 24, 200926* Author: rservant27*/2829#ifndef CLASSFILEPARSER_HPP_30#define CLASSFILEPARSER_HPP_3132/* @ddr_namespace: default */33#include "j9comp.h"34#include "j9.h"3536#include "BuildResult.hpp"3738typedef IDATA (*VerifyClassFunction) (J9PortLibrary *aPortLib, J9CfrClassFile* classfile, U_8* segment, U_8* segmentLength, U_8* freePointer, U_32 vmVerisonShifted, U_32 flags, I_32 *hasRET);3940class ROMClassCreationContext;4142class ClassFileParser43{44public:45ClassFileParser(J9PortLibrary *portLibrary, VerifyClassFunction verifyClassFunction) :46_portLibrary(portLibrary),47_verifyClassFunction(verifyClassFunction),48_j9CfrClassFile(NULL)49{50}5152BuildResult parseClassFile(ROMClassCreationContext *context, UDATA *initialBufferSize, U_8 **classFileBuffer);5354void restoreOriginalMethodBytecodes();5556J9CfrClassFile *getParsedClassFile() { return _j9CfrClassFile; }5758private:59J9PortLibrary * _portLibrary;60VerifyClassFunction _verifyClassFunction;61J9CfrClassFile *_j9CfrClassFile;62};63#endif /* CLASSFILEPARSER_HPP_ */646566