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

Side by Side Diff: courgette/instruction_utils.h

Issue 2854113002: [Courgette] Reduce AssemblyProgram to reduce Courgette-apply RAM floor and disk churn. (Closed)
Patch Set: Update courgette_fuzzer in libfuzzer. Created 3 years, 7 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/encoded_program_fuzz_unittest.cc ('k') | courgette/patch_generator_x86_32.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_INSTRUCTION_UTILS_H_ 5 #ifndef COURGETTE_INSTRUCTION_UTILS_H_
6 #define COURGETTE_INSTRUCTION_UTILS_H_ 6 #define COURGETTE_INSTRUCTION_UTILS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 virtual CheckBool EmitAbs64(Label* label) = 0; 54 virtual CheckBool EmitAbs64(Label* label) = 0;
55 55
56 private: 56 private:
57 DISALLOW_COPY_AND_ASSIGN(InstructionReceptor); 57 DISALLOW_COPY_AND_ASSIGN(InstructionReceptor);
58 }; 58 };
59 59
60 // A rerunable callback that emit instructions to a provided receptor. Returns 60 // A rerunable callback that emit instructions to a provided receptor. Returns
61 // true on success, and false otherwise. 61 // true on success, and false otherwise.
62 using InstructionGenerator = base::Callback<CheckBool(InstructionReceptor*)>; 62 using InstructionGenerator = base::Callback<CheckBool(InstructionReceptor*)>;
63 63
64 // A counter that increments via .push_back(), so it can be passed via template
65 // to substitute std::vector<T>, to count elements instead of storing them.
66 template <typename T>
67 class CountingVector {
68 public:
69 CountingVector() {}
70
71 void push_back(const T& /* unused */) { ++size_; }
72 size_t size() const { return size_; }
73
74 private:
75 size_t size_ = 0;
76 };
77
64 } // namespace courgette 78 } // namespace courgette
65 79
66 #endif // COURGETTE_INSTRUCTION_UTILS_H_ 80 #endif // COURGETTE_INSTRUCTION_UTILS_H_
OLDNEW
« no previous file with comments | « courgette/encoded_program_fuzz_unittest.cc ('k') | courgette/patch_generator_x86_32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698