package nl.tudelft.simulation.dsol.interpreter.operations; import java.io.DataInput; import java.io.IOException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import nl.tudelft.simulation.dsol.interpreter.Frame; import nl.tudelft.simulation.dsol.interpreter.Interpreter; import nl.tudelft.simulation.language.concurrent.Monitor; /** * The INVOKESPECIAL operation as defined in * https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-6.html#jvms-6.5 . *
* Copyright (c) 2002-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See * for project information https://simulation.tudelft.nl. The DSOL * project is distributed under a three-clause BSD-style license, which can be found at * * https://simulation.tudelft.nl/dsol/3.0/license.html. *
* @author Peter Jacobs * @author Alexander Verbraeck */ public class INVOKESPECIAL extends nl.tudelft.simulation.dsol.interpreter.operations.reflection.INVOKESPECIAL { /** * constructs a new INVOKESPECIAL. * @param dataInput DataInput; the dataInput * @throws IOException on IOfailure */ public INVOKESPECIAL(final DataInput dataInput) throws IOException { super(dataInput); } /** {@inheritDoc} */ @Override public final Frame execute(final Frame frame, final Object objectRef, final Method method, final Object[] arguments) throws Exception { if (Modifier.isNative(method.getModifiers())) { return super.execute(frame, objectRef, method, arguments); } if (Modifier.isSynchronized(method.getModifiers())) { Monitor.lock(objectRef); } return Interpreter.createFrame(objectRef, method, arguments); } }