1 /* 2 * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. 3 * Copyright 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/_sharkInliner.cpp.incl" 28 29 using namespace llvm; 30 31 class SharkInlineBlock : public SharkBlock { 32 public: 33 SharkInlineBlock(ciMethod* target, SharkState* state) 34 : SharkBlock(state, target), 35 _outer_state(state), 36 _entry_state(new SharkState(this)) { 37 for (int i = target->max_locals() - 1; i >= 0; i--) { 38 SharkValue *value = NULL; 39 if (i < target->arg_size()) 40 value = outer_state()->pop(); 41 entry_state()->set_local(i, value); 42 } 43 } 44 45 private: 46 SharkState* _outer_state; 47 SharkState* _entry_state; | 1 /* 2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 3 * Copyright 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/ciField.hpp" 28 #include "ci/ciMethod.hpp" 29 #include "ci/ciStreams.hpp" 30 #include "interpreter/bytecodes.hpp" 31 #include "memory/allocation.hpp" 32 #include "shark/sharkBlock.hpp" 33 #include "shark/sharkConstant.hpp" 34 #include "shark/sharkInliner.hpp" 35 #include "shark/sharkIntrinsics.hpp" 36 #include "shark/sharkState.hpp" 37 #include "shark/sharkValue.hpp" 38 #include "shark/shark_globals.hpp" 39 40 using namespace llvm; 41 42 class SharkInlineBlock : public SharkBlock { 43 public: 44 SharkInlineBlock(ciMethod* target, SharkState* state) 45 : SharkBlock(state, target), 46 _outer_state(state), 47 _entry_state(new SharkState(this)) { 48 for (int i = target->max_locals() - 1; i >= 0; i--) { 49 SharkValue *value = NULL; 50 if (i < target->arg_size()) 51 value = outer_state()->pop(); 52 entry_state()->set_local(i, value); 53 } 54 } 55 56 private: 57 SharkState* _outer_state; 58 SharkState* _entry_state; |