Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1872)

Side by Side Diff: courgette/assembly_program.h

Issue 613893002: Fix more MSVC warnings, courgette/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: static_cast Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « courgette/adjustment_method_2.cc ('k') | courgette/assembly_program.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_ASSEMBLY_PROGRAM_H_ 5 #ifndef COURGETTE_ASSEMBLY_PROGRAM_H_
6 #define COURGETTE_ASSEMBLY_PROGRAM_H_ 6 #define COURGETTE_ASSEMBLY_PROGRAM_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // Generates an ELF style relocation table for ARM. 80 // Generates an ELF style relocation table for ARM.
81 CheckBool EmitElfARMRelocationInstruction() WARN_UNUSED_RESULT; 81 CheckBool EmitElfARMRelocationInstruction() WARN_UNUSED_RESULT;
82 82
83 // Following instruction will be assembled at address 'rva'. 83 // Following instruction will be assembled at address 'rva'.
84 CheckBool EmitOriginInstruction(RVA rva) WARN_UNUSED_RESULT; 84 CheckBool EmitOriginInstruction(RVA rva) WARN_UNUSED_RESULT;
85 85
86 // Generates a single byte of data or machine instruction. 86 // Generates a single byte of data or machine instruction.
87 CheckBool EmitByteInstruction(uint8 byte) WARN_UNUSED_RESULT; 87 CheckBool EmitByteInstruction(uint8 byte) WARN_UNUSED_RESULT;
88 88
89 // Generates multiple bytes of data or machine instructions. 89 // Generates multiple bytes of data or machine instructions.
90 CheckBool EmitBytesInstruction(const uint8* value, uint32 len) 90 CheckBool EmitBytesInstruction(const uint8* value, size_t len)
91 WARN_UNUSED_RESULT; 91 WARN_UNUSED_RESULT;
92 92
93 // Generates 4-byte relative reference to address of 'label'. 93 // Generates 4-byte relative reference to address of 'label'.
94 CheckBool EmitRel32(Label* label) WARN_UNUSED_RESULT; 94 CheckBool EmitRel32(Label* label) WARN_UNUSED_RESULT;
95 95
96 // Generates 4-byte relative reference to address of 'label' for 96 // Generates 4-byte relative reference to address of 'label' for
97 // ARM. 97 // ARM.
98 CheckBool EmitRel32ARM(uint16 op, Label* label, const uint8* arm_op, 98 CheckBool EmitRel32ARM(uint16 op, Label* label, const uint8* arm_op,
99 uint16 op_size) WARN_UNUSED_RESULT; 99 uint16 op_size) WARN_UNUSED_RESULT;
100 100
(...skipping 21 matching lines...) Expand all
122 // otherwise returns NULL. 122 // otherwise returns NULL.
123 Label* InstructionAbs32Label(const Instruction* instruction) const; 123 Label* InstructionAbs32Label(const Instruction* instruction) const;
124 124
125 // Returns the label if the instruction contains and rel32 offset, 125 // Returns the label if the instruction contains and rel32 offset,
126 // otherwise returns NULL. 126 // otherwise returns NULL.
127 Label* InstructionRel32Label(const Instruction* instruction) const; 127 Label* InstructionRel32Label(const Instruction* instruction) const;
128 128
129 // Trim underused labels 129 // Trim underused labels
130 CheckBool TrimLabels(); 130 CheckBool TrimLabels();
131 131
132 void PrintLabelCounts(RVAToLabel* labels);
133 void CountRel32ARM();
134
135 private: 132 private:
136 ExecutableType kind_; 133 ExecutableType kind_;
137 134
138 CheckBool Emit(Instruction* instruction) WARN_UNUSED_RESULT; 135 CheckBool Emit(Instruction* instruction) WARN_UNUSED_RESULT;
139 136
140 static const int kLabelLowerLimit; 137 static const int kLabelLowerLimit;
141 138
142 // Looks up a label or creates a new one. Might return NULL. 139 // Looks up a label or creates a new one. Might return NULL.
143 Label* FindLabel(RVA rva, RVAToLabel* labels); 140 Label* FindLabel(RVA rva, RVAToLabel* labels);
144 141
(...skipping 14 matching lines...) Expand all
159 // We have separate label spaces for addresses referenced by rel32 labels and 156 // We have separate label spaces for addresses referenced by rel32 labels and
160 // abs32 labels. This is somewhat arbitrary. 157 // abs32 labels. This is somewhat arbitrary.
161 RVAToLabel rel32_labels_; 158 RVAToLabel rel32_labels_;
162 RVAToLabel abs32_labels_; 159 RVAToLabel abs32_labels_;
163 160
164 DISALLOW_COPY_AND_ASSIGN(AssemblyProgram); 161 DISALLOW_COPY_AND_ASSIGN(AssemblyProgram);
165 }; 162 };
166 163
167 } // namespace courgette 164 } // namespace courgette
168 #endif // COURGETTE_ASSEMBLY_PROGRAM_H_ 165 #endif // COURGETTE_ASSEMBLY_PROGRAM_H_
OLDNEW
« no previous file with comments | « courgette/adjustment_method_2.cc ('k') | courgette/assembly_program.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698