1 /* 2 * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. 3 * Copyright 2009, 2010 Red Hat, Inc. 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5 * 6 * This code is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public License version 2 only, as 8 * published by the Free Software Foundation. 9 * 10 * This code is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 * version 2 for more details (a copy is included in the LICENSE file that 14 * accompanied this code). 15 * 16 * You should have received a copy of the GNU General Public License version 17 * 2 along with this work; if not, write to the Free Software Foundation, 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 * 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 * or visit www.oracle.com if you need additional information or have any 22 * questions. 23 * 24 */ 25 26 #include "incls/_precompiled.incl" 27 #include "incls/_sharkContext.cpp.incl" 28 29 using namespace llvm; 30 31 SharkContext::SharkContext(const char* name) 32 : LLVMContext(), 33 _free_queue(NULL) { 34 // Create a module to build our functions into 35 _module = new Module(name, *this); 36 37 // Create basic types 38 _void_type = Type::getVoidTy(*this); 39 _bit_type = Type::getInt1Ty(*this); 40 _jbyte_type = Type::getInt8Ty(*this); 41 _jshort_type = Type::getInt16Ty(*this); 42 _jint_type = Type::getInt32Ty(*this); 43 _jlong_type = Type::getInt64Ty(*this); 44 _jfloat_type = Type::getFloatTy(*this); 45 _jdouble_type = Type::getDoubleTy(*this); 46 47 // Create compound types | 1 /* 2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 3 * Copyright 2009, 2010 Red Hat, Inc. 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5 * 6 * This code is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public License version 2 only, as 8 * published by the Free Software Foundation. 9 * 10 * This code is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 * version 2 for more details (a copy is included in the LICENSE file that 14 * accompanied this code). 15 * 16 * You should have received a copy of the GNU General Public License version 17 * 2 along with this work; if not, write to the Free Software Foundation, 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 * 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 * or visit www.oracle.com if you need additional information or have any 22 * questions. 23 * 24 */ 25 26 #include "precompiled.hpp" 27 #include "oops/arrayOop.hpp" 28 #include "oops/oop.hpp" 29 #include "shark/llvmHeaders.hpp" 30 #include "shark/sharkContext.hpp" 31 #include "utilities/globalDefinitions.hpp" 32 33 using namespace llvm; 34 35 SharkContext::SharkContext(const char* name) 36 : LLVMContext(), 37 _free_queue(NULL) { 38 // Create a module to build our functions into 39 _module = new Module(name, *this); 40 41 // Create basic types 42 _void_type = Type::getVoidTy(*this); 43 _bit_type = Type::getInt1Ty(*this); 44 _jbyte_type = Type::getInt8Ty(*this); 45 _jshort_type = Type::getInt16Ty(*this); 46 _jint_type = Type::getInt32Ty(*this); 47 _jlong_type = Type::getInt64Ty(*this); 48 _jfloat_type = Type::getFloatTy(*this); 49 _jdouble_type = Type::getDoubleTy(*this); 50 51 // Create compound types |