From 81bee76dcb7c4a57fa21cb0692672fe2310754f6 Mon Sep 17 00:00:00 2001 From: never Date: Mon, 2 May 2011 18:53:37 -0700 Subject: 7009361: JSR 292 Invalid value on stack on solaris-sparc with -Xcomp Reviewed-by: kvn, twisti --- src/share/vm/runtime/frame.hpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'src/share/vm/runtime/frame.hpp') diff --git a/src/share/vm/runtime/frame.hpp b/src/share/vm/runtime/frame.hpp index a48c2af37..66d17a9f7 100644 --- a/src/share/vm/runtime/frame.hpp +++ b/src/share/vm/runtime/frame.hpp @@ -60,6 +60,7 @@ typedef class BytecodeInterpreter* interpreterState; class CodeBlob; +class FrameValues; class vframeArray; @@ -381,6 +382,8 @@ class frame VALUE_OBJ_CLASS_SPEC { private: const char* print_name() const; + void describe_pd(FrameValues& values, int frame_no); + public: void print_value() const { print_value_on(tty,NULL); } void print_value_on(outputStream* st, JavaThread *thread) const; @@ -388,6 +391,9 @@ class frame VALUE_OBJ_CLASS_SPEC { void interpreter_frame_print_on(outputStream* st) const; void print_on_error(outputStream* st, char* buf, int buflen, bool verbose = false) const; + // Add annotated descriptions of memory locations belonging to this frame to values + void describe(FrameValues& values, int frame_no); + // Conversion from an VMReg to physical stack location oop* oopmapreg_to_location(VMReg reg, const RegisterMap* regmap) const; @@ -472,6 +478,41 @@ class frame VALUE_OBJ_CLASS_SPEC { }; +#ifdef ASSERT +// A simple class to describe a location on the stack +class FrameValue VALUE_OBJ_CLASS_SPEC { + public: + intptr_t* location; + char* description; + int owner; + int priority; +}; + + +// A collection of described stack values that can print a symbolic +// description of the stack memory. Interpreter frame values can be +// in the caller frames so all the values are collected first and then +// sorted before being printed. +class FrameValues { + private: + GrowableArray _values; + + static int compare(FrameValue* a, FrameValue* b) { + if (a->location == b->location) { + return a->priority - b->priority; + } + return a->location - b->location; + } + + public: + // Used by frame functions to describe locations. + void describe(int owner, intptr_t* location, const char* description, int priority = 0); + + bool validate(); + void print(); +}; + +#endif // // StackFrameStream iterates through the frames of a thread starting from -- cgit v1.2.3