comparison src/share/vm/runtime/frame.hpp @ 3336:2e038ad0c1d0

7009361: JSR 292 Invalid value on stack on solaris-sparc with -Xcomp Reviewed-by: kvn, twisti
author never
date Mon, 02 May 2011 18:53:37 -0700
parents 1d1603768966
children 167b70ff3abc
comparison
equal deleted inserted replaced
3335:49d67a090fe2 3336:2e038ad0c1d0
58 #endif 58 #endif
59 59
60 typedef class BytecodeInterpreter* interpreterState; 60 typedef class BytecodeInterpreter* interpreterState;
61 61
62 class CodeBlob; 62 class CodeBlob;
63 class FrameValues;
63 class vframeArray; 64 class vframeArray;
64 65
65 66
66 // A frame represents a physical stack frame (an activation). Frames 67 // A frame represents a physical stack frame (an activation). Frames
67 // can be C or Java frames, and the Java frames can be interpreted or 68 // can be C or Java frames, and the Java frames can be interpreted or
379 380
380 // For debugging 381 // For debugging
381 private: 382 private:
382 const char* print_name() const; 383 const char* print_name() const;
383 384
385 void describe_pd(FrameValues& values, int frame_no);
386
384 public: 387 public:
385 void print_value() const { print_value_on(tty,NULL); } 388 void print_value() const { print_value_on(tty,NULL); }
386 void print_value_on(outputStream* st, JavaThread *thread) const; 389 void print_value_on(outputStream* st, JavaThread *thread) const;
387 void print_on(outputStream* st) const; 390 void print_on(outputStream* st) const;
388 void interpreter_frame_print_on(outputStream* st) const; 391 void interpreter_frame_print_on(outputStream* st) const;
389 void print_on_error(outputStream* st, char* buf, int buflen, bool verbose = false) const; 392 void print_on_error(outputStream* st, char* buf, int buflen, bool verbose = false) const;
393
394 // Add annotated descriptions of memory locations belonging to this frame to values
395 void describe(FrameValues& values, int frame_no);
390 396
391 // Conversion from an VMReg to physical stack location 397 // Conversion from an VMReg to physical stack location
392 oop* oopmapreg_to_location(VMReg reg, const RegisterMap* regmap) const; 398 oop* oopmapreg_to_location(VMReg reg, const RegisterMap* regmap) const;
393 399
394 // Oops-do's 400 // Oops-do's
470 # include "frame_ppc.hpp" 476 # include "frame_ppc.hpp"
471 #endif 477 #endif
472 478
473 }; 479 };
474 480
481 #ifdef ASSERT
482 // A simple class to describe a location on the stack
483 class FrameValue VALUE_OBJ_CLASS_SPEC {
484 public:
485 intptr_t* location;
486 char* description;
487 int owner;
488 int priority;
489 };
490
491
492 // A collection of described stack values that can print a symbolic
493 // description of the stack memory. Interpreter frame values can be
494 // in the caller frames so all the values are collected first and then
495 // sorted before being printed.
496 class FrameValues {
497 private:
498 GrowableArray<FrameValue> _values;
499
500 static int compare(FrameValue* a, FrameValue* b) {
501 if (a->location == b->location) {
502 return a->priority - b->priority;
503 }
504 return a->location - b->location;
505 }
506
507 public:
508 // Used by frame functions to describe locations.
509 void describe(int owner, intptr_t* location, const char* description, int priority = 0);
510
511 bool validate();
512 void print();
513 };
514
515 #endif
475 516
476 // 517 //
477 // StackFrameStream iterates through the frames of a thread starting from 518 // StackFrameStream iterates through the frames of a thread starting from
478 // top most frame. It automatically takes care of updating the location of 519 // top most frame. It automatically takes care of updating the location of
479 // all (callee-saved) registers. Notice: If a thread is stopped at 520 // all (callee-saved) registers. Notice: If a thread is stopped at