equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2016, 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. |
353 virtual bool reading() const = 0; |
353 virtual bool reading() const = 0; |
354 |
354 |
355 // Read/write the void pointer pointed to by p. |
355 // Read/write the void pointer pointed to by p. |
356 virtual void do_ptr(void** p) = 0; |
356 virtual void do_ptr(void** p) = 0; |
357 |
357 |
|
358 // Read/write the 32-bit unsigned integer pointed to by p. |
|
359 virtual void do_u4(u4* p) = 0; |
|
360 |
358 // Read/write the region specified. |
361 // Read/write the region specified. |
359 virtual void do_region(u_char* start, size_t size) = 0; |
362 virtual void do_region(u_char* start, size_t size) = 0; |
360 |
363 |
361 // Check/write the tag. If reading, then compare the tag against |
364 // Check/write the tag. If reading, then compare the tag against |
362 // the passed in value and fail is they don't match. This allows |
365 // the passed in value and fail is they don't match. This allows |
363 // for verification that sections of the serialized data are of the |
366 // for verification that sections of the serialized data are of the |
364 // correct length. |
367 // correct length. |
365 virtual void do_tag(int tag) = 0; |
368 virtual void do_tag(int tag) = 0; |
|
369 |
|
370 bool writing() { |
|
371 return !reading(); |
|
372 } |
366 }; |
373 }; |
367 |
374 |
368 class SymbolClosure : public StackObj { |
375 class SymbolClosure : public StackObj { |
369 public: |
376 public: |
370 virtual void do_symbol(Symbol**) = 0; |
377 virtual void do_symbol(Symbol**) = 0; |