1.1 --- a/src/share/vm/classfile/classFileStream.hpp Thu Aug 01 03:44:03 2019 +0100 1.2 +++ b/src/share/vm/classfile/classFileStream.hpp Mon Aug 12 18:30:40 2019 +0300 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -57,15 +57,25 @@ 1.11 bool _need_verify; // True if verification is on for the class file 1.12 1.13 void truncated_file_error(TRAPS); 1.14 + 1.15 +#if INCLUDE_JFR 1.16 + u1* clone_buffer() const; 1.17 + const char* const clone_source() const; 1.18 +#endif 1.19 + 1.20 public: 1.21 // Constructor 1.22 - ClassFileStream(u1* buffer, int length, const char* source); 1.23 + ClassFileStream(u1* buffer, int length, const char* source, bool need_verify = false); 1.24 1.25 // Buffer access 1.26 u1* buffer() const { return _buffer_start; } 1.27 int length() const { return _buffer_end - _buffer_start; } 1.28 u1* current() const { return _current; } 1.29 void set_current(u1* pos) { _current = pos; } 1.30 + // for relative positioning 1.31 + juint current_offset() const { 1.32 + return (juint)(_current - _buffer_start); 1.33 + } 1.34 const char* source() const { return _source; } 1.35 void set_verify(bool flag) { _need_verify = flag; } 1.36 1.37 @@ -140,6 +150,12 @@ 1.38 1.39 // Tells whether eos is reached 1.40 bool at_eos() const { return _current == _buffer_end; } 1.41 + 1.42 +#if INCLUDE_JFR 1.43 + ClassFileStream* clone() const; 1.44 + 1.45 + bool need_verify() const { return _need_verify; } 1.46 +#endif 1.47 }; 1.48 1.49 #endif // SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP