src/share/vm/shark/sharkStack.hpp

Print this page


   1 /*
   2  * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2008, 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 class SharkFunction;
  27 class SharkNativeWrapper;
  28 class SharkStackWithNormalFrame;
  29 class SharkStackWithNativeFrame;
  30 
  31 class SharkStack : public SharkCompileInvariants {
  32  public:
  33   static SharkStack* CreateBuildAndPushFrame(
  34     SharkFunction* function, llvm::Value* method);
  35   static SharkStack* CreateBuildAndPushFrame(
  36     SharkNativeWrapper* wrapper, llvm::Value* method);
  37 
  38  protected:
  39   SharkStack(const SharkCompileInvariants* parent)
  40     : SharkCompileInvariants(parent) {}
  41 
  42  protected:
  43   void initialize(llvm::Value* method);
  44 
  45  protected:


 271  private:
 272   SharkNativeWrapper* wrapper() const {
 273     return _wrapper;
 274   }
 275 
 276   // Properties of the method being compiled
 277  private:
 278   int arg_size() const;
 279   int max_locals() const;
 280   int max_stack() const;
 281   int max_monitors() const;
 282 
 283   // BasicBlock creation
 284  private:
 285   llvm::BasicBlock* CreateBlock(const char* name = "") const;
 286 
 287   // Interpreter entry point for bailouts
 288  private:
 289   address interpreter_entry_point() const;
 290 };


   1 /*
   2  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2008, 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 #ifndef SHARE_VM_SHARK_SHARKSTACK_HPP
  27 #define SHARE_VM_SHARK_SHARKSTACK_HPP
  28 
  29 #include "shark/llvmHeaders.hpp"
  30 #include "shark/sharkInvariants.hpp"
  31 #include "shark/sharkType.hpp"
  32 
  33 class SharkFunction;
  34 class SharkNativeWrapper;
  35 class SharkStackWithNormalFrame;
  36 class SharkStackWithNativeFrame;
  37 
  38 class SharkStack : public SharkCompileInvariants {
  39  public:
  40   static SharkStack* CreateBuildAndPushFrame(
  41     SharkFunction* function, llvm::Value* method);
  42   static SharkStack* CreateBuildAndPushFrame(
  43     SharkNativeWrapper* wrapper, llvm::Value* method);
  44 
  45  protected:
  46   SharkStack(const SharkCompileInvariants* parent)
  47     : SharkCompileInvariants(parent) {}
  48 
  49  protected:
  50   void initialize(llvm::Value* method);
  51 
  52  protected:


 278  private:
 279   SharkNativeWrapper* wrapper() const {
 280     return _wrapper;
 281   }
 282 
 283   // Properties of the method being compiled
 284  private:
 285   int arg_size() const;
 286   int max_locals() const;
 287   int max_stack() const;
 288   int max_monitors() const;
 289 
 290   // BasicBlock creation
 291  private:
 292   llvm::BasicBlock* CreateBlock(const char* name = "") const;
 293 
 294   // Interpreter entry point for bailouts
 295  private:
 296   address interpreter_entry_point() const;
 297 };
 298 
 299 #endif // SHARE_VM_SHARK_SHARKSTACK_HPP