| 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 #include "courgette/adjustment_method.h" | 5 #include "courgette/adjustment_method.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 private: | 1252 private: |
| 1253 void CollectTraces(const AssemblyProgram* program, Trace* abs32, Trace* rel32, | 1253 void CollectTraces(const AssemblyProgram* program, Trace* abs32, Trace* rel32, |
| 1254 bool is_model) { | 1254 bool is_model) { |
| 1255 label_info_maker_.ResetDebugLabel(); | 1255 label_info_maker_.ResetDebugLabel(); |
| 1256 | 1256 |
| 1257 AssemblyProgram::LabelHandler abs32_handler = base::Bind( | 1257 AssemblyProgram::LabelHandler abs32_handler = base::Bind( |
| 1258 &Adjuster::ReferenceLabel, base::Unretained(this), abs32, is_model); | 1258 &Adjuster::ReferenceLabel, base::Unretained(this), abs32, is_model); |
| 1259 AssemblyProgram::LabelHandler rel32_handler = base::Bind( | 1259 AssemblyProgram::LabelHandler rel32_handler = base::Bind( |
| 1260 &Adjuster::ReferenceLabel, base::Unretained(this), rel32, is_model); | 1260 &Adjuster::ReferenceLabel, base::Unretained(this), rel32, is_model); |
| 1261 | 1261 |
| 1262 program->HandleInstructionLabels({{ABS32, abs32_handler}, | 1262 program->HandleInstructionLabels({{AssemblyOp::ABS32, abs32_handler}, |
| 1263 {ABS64, abs32_handler}, | 1263 {AssemblyOp::ABS64, abs32_handler}, |
| 1264 {REL32, rel32_handler}, | 1264 {AssemblyOp::REL32, rel32_handler}, |
| 1265 {REL32ARM, rel32_handler}}); | 1265 {AssemblyOp::REL32ARM, rel32_handler}}); |
| 1266 | 1266 |
| 1267 // TODO(sra): we could simply append all the labels in index order to | 1267 // TODO(sra): we could simply append all the labels in index order to |
| 1268 // incorporate some costing for entropy (bigger deltas) that will be | 1268 // incorporate some costing for entropy (bigger deltas) that will be |
| 1269 // introduced into the label address table by non-monotonic ordering. This | 1269 // introduced into the label address table by non-monotonic ordering. This |
| 1270 // would have some knock-on effects to parts of the algorithm that work on | 1270 // would have some knock-on effects to parts of the algorithm that work on |
| 1271 // single-occurrence labels. | 1271 // single-occurrence labels. |
| 1272 } | 1272 } |
| 1273 | 1273 |
| 1274 void Solve(const Trace& model, size_t model_end) { | 1274 void Solve(const Trace& model, size_t model_end) { |
| 1275 base::Time start_time = base::Time::Now(); | 1275 base::Time start_time = base::Time::Now(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1295 | 1295 |
| 1296 //////////////////////////////////////////////////////////////////////////////// | 1296 //////////////////////////////////////////////////////////////////////////////// |
| 1297 | 1297 |
| 1298 } // namespace adjustment_method_2 | 1298 } // namespace adjustment_method_2 |
| 1299 | 1299 |
| 1300 AdjustmentMethod* AdjustmentMethod::MakeShingleAdjustmentMethod() { | 1300 AdjustmentMethod* AdjustmentMethod::MakeShingleAdjustmentMethod() { |
| 1301 return new adjustment_method_2::Adjuster(); | 1301 return new adjustment_method_2::Adjuster(); |
| 1302 } | 1302 } |
| 1303 | 1303 |
| 1304 } // namespace courgette | 1304 } // namespace courgette |
| OLD | NEW |