| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COURGETTE_ENCODED_PROGRAM_H_ | 5 #ifndef COURGETTE_ENCODED_PROGRAM_H_ |
| 6 #define COURGETTE_ENCODED_PROGRAM_H_ | 6 #define COURGETTE_ENCODED_PROGRAM_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "courgette/disassembler.h" | 14 #include "courgette/disassembler.h" |
| 16 #include "courgette/label_manager.h" | 15 #include "courgette/label_manager.h" |
| 17 #include "courgette/memory_allocator.h" | 16 #include "courgette/memory_allocator.h" |
| 18 #include "courgette/types_elf.h" | 17 #include "courgette/types_elf.h" |
| 19 | 18 |
| 20 namespace courgette { | 19 namespace courgette { |
| 21 | 20 |
| 22 // Stream indexes. | 21 // Stream indexes. |
| 23 const int kStreamMisc = 0; | 22 const int kStreamMisc = 0; |
| 24 const int kStreamOps = 1; | 23 const int kStreamOps = 1; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 UInt32Vector rel32_ix_; | 133 UInt32Vector rel32_ix_; |
| 135 UInt32Vector abs32_ix_; | 134 UInt32Vector abs32_ix_; |
| 136 | 135 |
| 137 // Table of the addresses containing abs32 relocations; computed during | 136 // Table of the addresses containing abs32 relocations; computed during |
| 138 // assembly, used to generate base relocation table. | 137 // assembly, used to generate base relocation table. |
| 139 UInt32Vector abs32_relocs_; | 138 UInt32Vector abs32_relocs_; |
| 140 | 139 |
| 141 DISALLOW_COPY_AND_ASSIGN(EncodedProgram); | 140 DISALLOW_COPY_AND_ASSIGN(EncodedProgram); |
| 142 }; | 141 }; |
| 143 | 142 |
| 144 // Deserializes program from a stream set to |*output|. Returns C_OK if | |
| 145 // successful, otherwise assigns |*output| to null and returns an error status. | |
| 146 Status ReadEncodedProgram(SourceStreamSet* source, | |
| 147 scoped_ptr<EncodedProgram>* output); | |
| 148 | |
| 149 } // namespace courgette | 143 } // namespace courgette |
| 150 | |
| 151 #endif // COURGETTE_ENCODED_PROGRAM_H_ | 144 #endif // COURGETTE_ENCODED_PROGRAM_H_ |
| OLD | NEW |