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/_sharkNativeWrapper.cpp.incl" 28 29 using namespace llvm; 30 31 void SharkNativeWrapper::initialize(const char *name) { 32 // Create the function 33 _function = Function::Create( 34 SharkType::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 *base_pc = ai++; 43 base_pc->setName("base_pc"); 44 code_buffer()->set_base_pc(base_pc); 45 Argument *thread = ai++; 46 thread->setName("thread"); 47 set_thread(thread); | 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 "shark/llvmHeaders.hpp" 28 #include "shark/sharkNativeWrapper.hpp" 29 #include "shark/sharkType.hpp" 30 31 using namespace llvm; 32 33 void SharkNativeWrapper::initialize(const char *name) { 34 // Create the function 35 _function = Function::Create( 36 SharkType::entry_point_type(), 37 GlobalVariable::InternalLinkage, 38 name); 39 40 // Get our arguments 41 Function::arg_iterator ai = function()->arg_begin(); 42 Argument *method = ai++; 43 method->setName("method"); 44 Argument *base_pc = ai++; 45 base_pc->setName("base_pc"); 46 code_buffer()->set_base_pc(base_pc); 47 Argument *thread = ai++; 48 thread->setName("thread"); 49 set_thread(thread); |