src/share/vm/runtime/vframe_hp.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 # include "incls/_precompiled.incl"
  26 # include "incls/_vframe_hp.cpp.incl"


















  27 
  28 
  29 // ------------- compiledVFrame --------------
  30 
  31 StackValueCollection* compiledVFrame::locals() const {
  32   // Natives has no scope
  33   if (scope() == NULL) return new StackValueCollection(0);
  34   GrowableArray<ScopeValue*>*  scv_list = scope()->locals();
  35   if (scv_list == NULL) return new StackValueCollection(0);
  36 
  37   // scv_list is the list of ScopeValues describing the JVM stack state.
  38   // There is one scv_list entry for every JVM stack state in use.
  39   int length = scv_list->length();
  40   StackValueCollection* result = new StackValueCollection(length);
  41   // In rare instances set_locals may have occurred in which case
  42   // there are local values that are not described by the ScopeValue anymore
  43   GrowableArray<jvmtiDeferredLocalVariable*>* deferred = NULL;
  44   GrowableArray<jvmtiDeferredLocalVariableSet*>* list = thread()->deferred_locals();
  45   if (list != NULL ) {
  46     // In real life this never happens or is typically a single element search


   1 /*
   2  * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "code/codeCache.hpp"
  27 #include "code/debugInfoRec.hpp"
  28 #include "code/nmethod.hpp"
  29 #include "code/pcDesc.hpp"
  30 #include "code/scopeDesc.hpp"
  31 #include "interpreter/interpreter.hpp"
  32 #include "interpreter/oopMapCache.hpp"
  33 #include "oops/instanceKlass.hpp"
  34 #include "oops/oop.inline.hpp"
  35 #include "runtime/basicLock.hpp"
  36 #include "runtime/handles.inline.hpp"
  37 #include "runtime/monitorChunk.hpp"
  38 #include "runtime/signature.hpp"
  39 #include "runtime/stubRoutines.hpp"
  40 #include "runtime/vframeArray.hpp"
  41 #include "runtime/vframe_hp.hpp"
  42 #ifdef COMPILER2
  43 #include "opto/matcher.hpp"
  44 #endif
  45 
  46 
  47 // ------------- compiledVFrame --------------
  48 
  49 StackValueCollection* compiledVFrame::locals() const {
  50   // Natives has no scope
  51   if (scope() == NULL) return new StackValueCollection(0);
  52   GrowableArray<ScopeValue*>*  scv_list = scope()->locals();
  53   if (scv_list == NULL) return new StackValueCollection(0);
  54 
  55   // scv_list is the list of ScopeValues describing the JVM stack state.
  56   // There is one scv_list entry for every JVM stack state in use.
  57   int length = scv_list->length();
  58   StackValueCollection* result = new StackValueCollection(length);
  59   // In rare instances set_locals may have occurred in which case
  60   // there are local values that are not described by the ScopeValue anymore
  61   GrowableArray<jvmtiDeferredLocalVariable*>* deferred = NULL;
  62   GrowableArray<jvmtiDeferredLocalVariableSet*>* list = thread()->deferred_locals();
  63   if (list != NULL ) {
  64     // In real life this never happens or is typically a single element search