Mercurial > hg > truffle
comparison src/share/vm/classfile/classFileStream.hpp @ 20804:7848fc12602b
Merge with jdk8u40-b25
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Tue, 07 Apr 2015 14:58:49 +0200 |
parents | 89152779163c bb239308be67 |
children |
comparison
equal
deleted
inserted
replaced
20184:84105dcdb05b | 20804:7848fc12602b |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2014, 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. |
51 class ClassFileStream: public ResourceObj { | 51 class ClassFileStream: public ResourceObj { |
52 private: | 52 private: |
53 u1* _buffer_start; // Buffer bottom | 53 u1* _buffer_start; // Buffer bottom |
54 u1* _buffer_end; // Buffer top (one past last element) | 54 u1* _buffer_end; // Buffer top (one past last element) |
55 u1* _current; // Current buffer position | 55 u1* _current; // Current buffer position |
56 char* _source; // Source of stream (directory name, ZIP/JAR archive name) | 56 const char* _source; // Source of stream (directory name, ZIP/JAR archive name) |
57 bool _need_verify; // True if verification is on for the class file | 57 bool _need_verify; // True if verification is on for the class file |
58 | 58 |
59 void truncated_file_error(TRAPS); | 59 void truncated_file_error(TRAPS); |
60 public: | 60 public: |
61 // Constructor | 61 // Constructor |
62 ClassFileStream(u1* buffer, int length, char* source); | 62 ClassFileStream(u1* buffer, int length, const char* source); |
63 | 63 |
64 // Buffer access | 64 // Buffer access |
65 u1* buffer() const { return _buffer_start; } | 65 u1* buffer() const { return _buffer_start; } |
66 int length() const { return _buffer_end - _buffer_start; } | 66 int length() const { return _buffer_end - _buffer_start; } |
67 u1* current() const { return _current; } | 67 u1* current() const { return _current; } |
68 void set_current(u1* pos) { _current = pos; } | 68 void set_current(u1* pos) { _current = pos; } |
69 char* source() const { return _source; } | 69 const char* source() const { return _source; } |
70 void set_verify(bool flag) { _need_verify = flag; } | 70 void set_verify(bool flag) { _need_verify = flag; } |
71 | 71 |
72 void check_truncated_file(bool b, TRAPS) { | 72 void check_truncated_file(bool b, TRAPS) { |
73 if (b) { | 73 if (b) { |
74 truncated_file_error(THREAD); | 74 truncated_file_error(THREAD); |