src/share/vm/shark/sharkTopLevelBlock.cpp

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 #include "incls/_precompiled.incl"
  27 #include "incls/_sharkTopLevelBlock.cpp.incl"



















  28 
  29 using namespace llvm;
  30 
  31 void SharkTopLevelBlock::scan_for_traps() {
  32   // If typeflow found a trap then don't scan past it
  33   int limit_bci = ciblock()->has_trap() ? ciblock()->trap_bci() : limit();
  34 
  35   // Scan the bytecode for traps that are always hit
  36   iter()->reset_to_bci(start());
  37   while (iter()->next_bci() < limit_bci) {
  38     iter()->next();
  39 
  40     ciField *field;
  41     ciMethod *method;
  42     ciInstanceKlass *klass;
  43     bool will_link;
  44     bool is_field;
  45 
  46     switch (bc()) {
  47     case Bytecodes::_ldc:


   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 #include "precompiled.hpp"
  27 #include "ci/ciField.hpp"
  28 #include "ci/ciInstance.hpp"
  29 #include "ci/ciObjArrayKlass.hpp"
  30 #include "ci/ciStreams.hpp"
  31 #include "ci/ciType.hpp"
  32 #include "ci/ciTypeFlow.hpp"
  33 #include "interpreter/bytecodes.hpp"
  34 #include "memory/allocation.hpp"
  35 #include "runtime/deoptimization.hpp"
  36 #include "shark/llvmHeaders.hpp"
  37 #include "shark/llvmValue.hpp"
  38 #include "shark/sharkBuilder.hpp"
  39 #include "shark/sharkCacheDecache.hpp"
  40 #include "shark/sharkConstant.hpp"
  41 #include "shark/sharkInliner.hpp"
  42 #include "shark/sharkState.hpp"
  43 #include "shark/sharkTopLevelBlock.hpp"
  44 #include "shark/sharkValue.hpp"
  45 #include "shark/shark_globals.hpp"
  46 #include "utilities/debug.hpp"
  47 
  48 using namespace llvm;
  49 
  50 void SharkTopLevelBlock::scan_for_traps() {
  51   // If typeflow found a trap then don't scan past it
  52   int limit_bci = ciblock()->has_trap() ? ciblock()->trap_bci() : limit();
  53 
  54   // Scan the bytecode for traps that are always hit
  55   iter()->reset_to_bci(start());
  56   while (iter()->next_bci() < limit_bci) {
  57     iter()->next();
  58 
  59     ciField *field;
  60     ciMethod *method;
  61     ciInstanceKlass *klass;
  62     bool will_link;
  63     bool is_field;
  64 
  65     switch (bc()) {
  66     case Bytecodes::_ldc: