equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2019, 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. |
36 } |
36 } |
37 |
37 |
38 ClassFileStream::ClassFileStream(const u1* buffer, |
38 ClassFileStream::ClassFileStream(const u1* buffer, |
39 int length, |
39 int length, |
40 const char* source, |
40 const char* source, |
41 bool verify_stream) : |
41 bool verify_stream, |
|
42 bool from_boot_loader_modules_image) : |
42 _buffer_start(buffer), |
43 _buffer_start(buffer), |
43 _buffer_end(buffer + length), |
44 _buffer_end(buffer + length), |
44 _current(buffer), |
45 _current(buffer), |
45 _source(source), |
46 _source(source), |
46 _need_verify(verify_stream) {} |
47 _need_verify(verify_stream), |
|
48 _from_boot_loader_modules_image(from_boot_loader_modules_image) {} |
47 |
49 |
48 const u1* ClassFileStream::clone_buffer() const { |
50 const u1* ClassFileStream::clone_buffer() const { |
49 u1* const new_buffer_start = NEW_RESOURCE_ARRAY(u1, length()); |
51 u1* const new_buffer_start = NEW_RESOURCE_ARRAY(u1, length()); |
50 memcpy(new_buffer_start, _buffer_start, length()); |
52 memcpy(new_buffer_start, _buffer_start, length()); |
51 return new_buffer_start; |
53 return new_buffer_start; |
67 const ClassFileStream* ClassFileStream::clone() const { |
69 const ClassFileStream* ClassFileStream::clone() const { |
68 const u1* const new_buffer_start = clone_buffer(); |
70 const u1* const new_buffer_start = clone_buffer(); |
69 return new ClassFileStream(new_buffer_start, |
71 return new ClassFileStream(new_buffer_start, |
70 length(), |
72 length(), |
71 clone_source(), |
73 clone_source(), |
72 need_verify()); |
74 need_verify(), |
|
75 from_boot_loader_modules_image()); |
73 } |
76 } |
74 |
77 |
75 uint64_t ClassFileStream::compute_fingerprint() const { |
78 uint64_t ClassFileStream::compute_fingerprint() const { |
76 int classfile_size = length(); |
79 int classfile_size = length(); |
77 int classfile_crc = ClassLoader::crc32(0, (const char*)buffer(), length()); |
80 int classfile_crc = ClassLoader::crc32(0, (const char*)buffer(), length()); |