1 /* |
1 /* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
44 public: |
44 public: |
45 static BytecodeClosure* std_closure(); // a printing closure |
45 static BytecodeClosure* std_closure(); // a printing closure |
46 static BytecodeClosure* closure() { return _closure; } |
46 static BytecodeClosure* closure() { return _closure; } |
47 static void set_closure(BytecodeClosure* closure) { _closure = closure; } |
47 static void set_closure(BytecodeClosure* closure) { _closure = closure; } |
48 |
48 |
49 static void trace(methodHandle method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st = tty); |
49 static void trace(const methodHandle& method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st = tty); |
50 static void trace(methodHandle method, address bcp, outputStream* st = tty); |
50 static void trace(const methodHandle& method, address bcp, outputStream* st = tty); |
51 }; |
51 }; |
52 |
52 |
53 |
53 |
54 // For each bytecode, a BytecodeClosure's trace() routine will be called. |
54 // For each bytecode, a BytecodeClosure's trace() routine will be called. |
55 |
55 |
56 class BytecodeClosure { |
56 class BytecodeClosure { |
57 public: |
57 public: |
58 virtual void trace(methodHandle method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st) = 0; |
58 virtual void trace(const methodHandle& method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st) = 0; |
59 virtual void trace(methodHandle method, address bcp, outputStream* st) = 0; |
59 virtual void trace(const methodHandle& method, address bcp, outputStream* st) = 0; |
60 }; |
60 }; |
61 |
61 |
62 #endif // SHARE_VM_INTERPRETER_BYTECODETRACER_HPP |
62 #endif // SHARE_VM_INTERPRETER_BYTECODETRACER_HPP |