Mercurial > hg > truffle
diff src/share/vm/utilities/ostream.hpp @ 6646:c38f13903fdf
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ just before the NPG (no perm gen) changeset
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 29 Oct 2012 21:10:04 +0100 |
parents | 4ee06e614636 |
children | 0598674c0056 |
line wrap: on
line diff
--- a/src/share/vm/utilities/ostream.hpp Mon Oct 29 20:02:54 2012 +0100 +++ b/src/share/vm/utilities/ostream.hpp Mon Oct 29 21:10:04 2012 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,9 +59,11 @@ outputStream(int width, bool has_time_stamps); // indentation - void indent(); + outputStream& indent(); void inc() { _indentation++; }; void dec() { _indentation--; }; + void inc(int n) { _indentation += n; }; + void dec(int n) { _indentation -= n; }; int indentation() const { return _indentation; } void set_indentation(int i) { _indentation = i; } void fill_to(int col); @@ -84,6 +86,7 @@ void print_raw(const char* str, int len) { write(str, len); } void print_raw_cr(const char* str) { write(str, strlen(str)); cr(); } void print_raw_cr(const char* str, int len){ write(str, len); cr(); } + void print_data(void* data, size_t len, bool with_ascii); void put(char ch); void sp(int count = 1); void cr(); @@ -122,6 +125,19 @@ extern outputStream* tty; // tty output extern outputStream* gclog_or_tty; // stream for gc log if -Xloggc:<f>, or tty +class streamIndentor : public StackObj { + private: + outputStream* _str; + int _amount; + + public: + streamIndentor(outputStream* str, int amt = 2) : _str(str), _amount(amt) { + _str->inc(_amount); + } + ~streamIndentor() { _str->dec(_amount); } +}; + + // advisory locking for the shared tty stream: class ttyLocker: StackObj { friend class ttyUnlocker;