1 /* 2 * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. 3 * Copyright 2008, 2009 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/_sharkFunction.cpp.incl" 28 29 using namespace llvm; 30 31 void SharkFunction::initialize(const char *name) { 32 // Create the function 33 _function = Function::Create( 34 entry_point_type(), 35 GlobalVariable::InternalLinkage, 36 name); 37 38 // Get our arguments 39 Function::arg_iterator ai = function()->arg_begin(); 40 Argument *method = ai++; 41 method->setName("method"); 42 Argument *osr_buf = NULL; 43 if (is_osr()) { 44 osr_buf = ai++; 45 osr_buf->setName("osr_buf"); 46 } 47 Argument *base_pc = ai++; | 1 /* 2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 3 * Copyright 2008, 2009 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 "ci/ciTypeFlow.hpp" 28 #include "memory/allocation.hpp" 29 #include "shark/llvmHeaders.hpp" 30 #include "shark/llvmValue.hpp" 31 #include "shark/sharkBuilder.hpp" 32 #include "shark/sharkEntry.hpp" 33 #include "shark/sharkFunction.hpp" 34 #include "shark/sharkState.hpp" 35 #include "shark/sharkTopLevelBlock.hpp" 36 #include "shark/shark_globals.hpp" 37 #include "utilities/debug.hpp" 38 39 using namespace llvm; 40 41 void SharkFunction::initialize(const char *name) { 42 // Create the function 43 _function = Function::Create( 44 entry_point_type(), 45 GlobalVariable::InternalLinkage, 46 name); 47 48 // Get our arguments 49 Function::arg_iterator ai = function()->arg_begin(); 50 Argument *method = ai++; 51 method->setName("method"); 52 Argument *osr_buf = NULL; 53 if (is_osr()) { 54 osr_buf = ai++; 55 osr_buf->setName("osr_buf"); 56 } 57 Argument *base_pc = ai++; |