sharkContext.cpp revision 1612
/*
* Copyright 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_sharkContext.cpp.incl"
using namespace llvm;
: LLVMContext(),
_free_queue(NULL) {
// Create a module to build our functions into
// Create basic types
// Create compound types
// Create mappings
for (int i = 0; i < T_CONFLICT; i++) {
switch (i) {
case T_BOOLEAN:
_to_stackType[i] = jint_type();
_to_arrayType[i] = jbyte_type();
break;
case T_BYTE:
_to_stackType[i] = jint_type();
_to_arrayType[i] = jbyte_type();
break;
case T_CHAR:
_to_stackType[i] = jint_type();
_to_arrayType[i] = jshort_type();
break;
case T_SHORT:
_to_stackType[i] = jint_type();
_to_arrayType[i] = jshort_type();
break;
case T_INT:
_to_stackType[i] = jint_type();
_to_arrayType[i] = jint_type();
break;
case T_LONG:
_to_stackType[i] = jlong_type();
_to_arrayType[i] = jlong_type();
break;
case T_FLOAT:
_to_stackType[i] = jfloat_type();
_to_arrayType[i] = jfloat_type();
break;
case T_DOUBLE:
_to_stackType[i] = jdouble_type();
_to_arrayType[i] = jdouble_type();
break;
case T_OBJECT:
case T_ARRAY:
_to_stackType[i] = oop_type();
_to_arrayType[i] = oop_type();
break;
case T_ADDRESS:
_to_stackType[i] = intptr_type();
_to_arrayType[i] = NULL;
break;
default:
_to_stackType[i] = NULL;
_to_arrayType[i] = NULL;
}
}
}
class SharkFreeQueueItem : public CHeapObj {
public:
private:
public:
return _function;
}
SharkFreeQueueItem* next() const {
return _next;
}
};
}
if (_free_queue == NULL)
return NULL;
delete item;
return function;
}