src/share/vm/shark/sharkCacheDecache.cpp

Print this page


   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/_sharkCacheDecache.cpp.incl"






  28 
  29 using namespace llvm;
  30 
  31 void SharkDecacher::start_frame() {
  32   // Start recording the debug information
  33   _pc_offset = code_buffer()->create_unique_offset();
  34   _oopmap = new OopMap(
  35     oopmap_slot_munge(stack()->oopmap_frame_size()),
  36     oopmap_slot_munge(arg_size()));
  37   debug_info()->add_safepoint(pc_offset(), oopmap());
  38 }
  39 
  40 void SharkDecacher::start_stack(int stack_depth) {
  41   // Create the array we'll record our stack slots in
  42   _exparray = new GrowableArray<ScopeValue*>(stack_depth);
  43 
  44   // Set the stack pointer
  45   stack()->CreateStoreStackPointer(
  46     builder()->CreatePtrToInt(
  47       stack()->slot_addr(


   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/ciMethod.hpp"
  28 #include "code/debugInfoRec.hpp"
  29 #include "shark/llvmValue.hpp"
  30 #include "shark/sharkBuilder.hpp"
  31 #include "shark/sharkCacheDecache.hpp"
  32 #include "shark/sharkFunction.hpp"
  33 #include "shark/sharkState.hpp"
  34 
  35 using namespace llvm;
  36 
  37 void SharkDecacher::start_frame() {
  38   // Start recording the debug information
  39   _pc_offset = code_buffer()->create_unique_offset();
  40   _oopmap = new OopMap(
  41     oopmap_slot_munge(stack()->oopmap_frame_size()),
  42     oopmap_slot_munge(arg_size()));
  43   debug_info()->add_safepoint(pc_offset(), oopmap());
  44 }
  45 
  46 void SharkDecacher::start_stack(int stack_depth) {
  47   // Create the array we'll record our stack slots in
  48   _exparray = new GrowableArray<ScopeValue*>(stack_depth);
  49 
  50   // Set the stack pointer
  51   stack()->CreateStoreStackPointer(
  52     builder()->CreatePtrToInt(
  53       stack()->slot_addr(