Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (C) 2011 Wayne Meissner
*
* This file is part of the JNR project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jnr.ffi.provider.jffi;
import com.kenai.jffi.CallContext;
import com.kenai.jffi.Function;
import com.kenai.jffi.ObjectParameterInfo;
import jnr.ffi.Variable;
import jnr.ffi.mapper.FromNativeContext;
import jnr.ffi.mapper.FromNativeConverter;
import jnr.ffi.mapper.ToNativeContext;
import jnr.ffi.mapper.ToNativeConverter;
import org.objectweb.asm.ClassVisitor;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import static jnr.ffi.provider.jffi.AsmUtil.boxedType;
import static jnr.ffi.provider.jffi.AsmUtil.unboxNumber;
import static jnr.ffi.provider.jffi.CodegenUtils.ci;
import static org.objectweb.asm.Opcodes.ACC_FINAL;
import static org.objectweb.asm.Opcodes.ACC_PRIVATE;
/**
*
*/
class AsmBuilder {
private final jnr.ffi.Runtime runtime;
private final String classNamePath;
private final ClassVisitor classVisitor;
private final AsmClassLoader classLoader;
private final ObjectNameGenerator functionId = new ObjectNameGenerator("functionAddress");
private final ObjectNameGenerator contextId = new ObjectNameGenerator("callContext");
private final ObjectNameGenerator toNativeConverterId = new ObjectNameGenerator("toNativeConverter");
private final ObjectNameGenerator toNativeContextId = new ObjectNameGenerator("toNativeContext");
private final ObjectNameGenerator fromNativeConverterId = new ObjectNameGenerator("fromNativeConverter");
private final ObjectNameGenerator fromNativeContextId = new ObjectNameGenerator("fromNativeContext");
private final ObjectNameGenerator objectParameterInfoId = new ObjectNameGenerator("objectParameterInfo");
private final ObjectNameGenerator variableAccessorId = new ObjectNameGenerator("variableAccessor");
private final ObjectNameGenerator genericObjectId = new ObjectNameGenerator("objectField");
private final Map toNativeConverters = new IdentityHashMap();
private final Map toNativeContexts = new IdentityHashMap();
private final Map fromNativeConverters = new IdentityHashMap();
private final Map fromNativeContexts = new IdentityHashMap();
private final Map objectParameterInfo = new HashMap();
private final Map variableAccessors = new HashMap();
private final Map callContextMap = new HashMap();
private final Map functionAddresses = new HashMap();
private final Map