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" |
14 #include "courgette/disassembler.h" | 15 #include "courgette/disassembler.h" |
15 #include "courgette/label_manager.h" | 16 #include "courgette/label_manager.h" |
16 #include "courgette/memory_allocator.h" | 17 #include "courgette/memory_allocator.h" |
17 #include "courgette/types_elf.h" | 18 #include "courgette/types_elf.h" |
18 | 19 |
19 namespace courgette { | 20 namespace courgette { |
20 | 21 |
21 // Stream indexes. | 22 // Stream indexes. |
22 const int kStreamMisc = 0; | 23 const int kStreamMisc = 0; |
23 const int kStreamOps = 1; | 24 const int kStreamOps = 1; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 UInt32Vector rel32_ix_; | 134 UInt32Vector rel32_ix_; |
134 UInt32Vector abs32_ix_; | 135 UInt32Vector abs32_ix_; |
135 | 136 |
136 // Table of the addresses containing abs32 relocations; computed during | 137 // Table of the addresses containing abs32 relocations; computed during |
137 // assembly, used to generate base relocation table. | 138 // assembly, used to generate base relocation table. |
138 UInt32Vector abs32_relocs_; | 139 UInt32Vector abs32_relocs_; |
139 | 140 |
140 DISALLOW_COPY_AND_ASSIGN(EncodedProgram); | 141 DISALLOW_COPY_AND_ASSIGN(EncodedProgram); |
141 }; | 142 }; |
142 | 143 |
| 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 |
143 } // namespace courgette | 149 } // namespace courgette |
144 #endif // COURGETTE_ENCODED_PROGRAM_H_ | 150 #endif // COURGETTE_ENCODED_PROGRAM_H_ |
OLD | NEW |