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

Side by Side Diff: sandbox/linux/seccomp-bpf/codegen.h

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « sandbox/linux/sandbox_linux_test_sources.gypi ('k') | sandbox/linux/seccomp-bpf/codegen.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 SANDBOX_LINUX_SECCOMP_BPF_CODEGEN_H__ 5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_CODEGEN_H__
6 #define SANDBOX_LINUX_SECCOMP_BPF_CODEGEN_H__ 6 #define SANDBOX_LINUX_SECCOMP_BPF_CODEGEN_H__
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // logical beginning) of |program_|. 99 // logical beginning) of |program_|.
100 Node Append(uint16_t code, uint32_t k, size_t jt, size_t jf); 100 Node Append(uint16_t code, uint32_t k, size_t jt, size_t jf);
101 101
102 // Offset returns how many instructions exist in |program_| after |target|. 102 // Offset returns how many instructions exist in |program_| after |target|.
103 size_t Offset(Node target) const; 103 size_t Offset(Node target) const;
104 104
105 // NOTE: program_ is the compiled program in *reverse*, so that 105 // NOTE: program_ is the compiled program in *reverse*, so that
106 // indices remain stable as we add instructions. 106 // indices remain stable as we add instructions.
107 Program program_; 107 Program program_;
108 108
109 // equivalent_ stores the most recent semantically-equivalent node for each
110 // instruction in program_. A node is defined as semantically-equivalent to N
111 // if it has the same instruction code and constant as N and its successor
112 // nodes (if any) are semantically-equivalent to N's successor nodes, or
113 // if it's an unconditional jump to a node semantically-equivalent to N.
114 std::vector<Node> equivalent_;
115
109 std::map<MemoKey, Node, MemoKeyLess> memos_; 116 std::map<MemoKey, Node, MemoKeyLess> memos_;
110 117
111 DISALLOW_COPY_AND_ASSIGN(CodeGen); 118 DISALLOW_COPY_AND_ASSIGN(CodeGen);
112 }; 119 };
113 120
114 } // namespace sandbox 121 } // namespace sandbox
115 122
116 #endif // SANDBOX_LINUX_SECCOMP_BPF_CODEGEN_H__ 123 #endif // SANDBOX_LINUX_SECCOMP_BPF_CODEGEN_H__
OLDNEW
« no previous file with comments | « sandbox/linux/sandbox_linux_test_sources.gypi ('k') | sandbox/linux/seccomp-bpf/codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698