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

Issue 568053005: Split AssembleFilter into comprehensible chunks (Closed)

Created:
6 years, 3 months ago by mdempsky
Modified:
6 years, 3 months ago
CC:
chromium-reviews, jln+watch_chromium.org, leecam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Split AssembleFilter into comprehensible chunks Previously SandboxBPF constructed the CodeGen Instruction sequence primarily in one large, complex function. Additionally, it made extensive use of the CodeGen::JoinInstructions() function to conditionally arrange various bits of instructions, which made it harder to follow. This CL splits the Instruction assembly code into 5 mostly distinct functions and eliminates all use of JoinInstruction() in favor of function composition. E.g., instead of foo = gen->MakeInstruction(...); bar = gen->MakeInstruction(...); gen->JoinInstructions(foo, bar); this CL favors writing MakeFoo(MakeBar()) with the convention that Instruction-constructing functions should arrange for control to transfer to the Instruction sequence argument when complete. (I.e., "continuation-passing style": http://en.wikipedia.org/wiki/Continuation-passing_style) BUG=414363 Committed: https://crrev.com/d2283ac2cb84e59bf67ecb2cb4efa0e48602ceb5 Cr-Commit-Position: refs/heads/master@{#295015}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Respond to jln feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+205 lines, -149 lines) Patch
M sandbox/linux/seccomp-bpf/sandbox_bpf.h View 1 chunk +31 lines, -0 lines 0 comments Download
M sandbox/linux/seccomp-bpf/sandbox_bpf.cc View 1 6 chunks +174 lines, -149 lines 0 comments Download

Messages

Total messages: 12 (2 generated)
mdempsky
This is a medium-sized change that shouldn't affect behavior at all, because it just splits ...
6 years, 3 months ago (2014-09-15 21:47:26 UTC) #2
rickyz (Google)
On 2014/09/15 21:47:26, mdempsky wrote: > This is a medium-sized change that shouldn't affect behavior ...
6 years, 3 months ago (2014-09-16 01:01:41 UTC) #3
jln (very slow on Chromium)
lgtm based on Ricky's review and a reasonably quick look.
6 years, 3 months ago (2014-09-16 02:16:37 UTC) #4
jln (very slow on Chromium)
(hit the wrong button again) https://codereview.chromium.org/568053005/diff/1/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://codereview.chromium.org/568053005/diff/1/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode725 sandbox/linux/seccomp-bpf/sandbox_bpf.cc:725: "unconditionally allow sigreturn() and ...
6 years, 3 months ago (2014-09-16 02:16:49 UTC) #5
mdempsky
FYI, I also made two other minor cleanups with this patch set: 1. I extracted ...
6 years, 3 months ago (2014-09-16 05:11:59 UTC) #6
mdempsky
On 2014/09/16 01:01:41, Ricky Zhou wrote: > LGTM. This is significantly nicer to read than ...
6 years, 3 months ago (2014-09-16 05:13:39 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/568053005/20001
6 years, 3 months ago (2014-09-16 05:14:54 UTC) #9
jln (very slow on Chromium)
On 2014/09/16 05:11:59, mdempsky wrote: > FYI, I also made two other minor cleanups with ...
6 years, 3 months ago (2014-09-16 05:16:39 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:20001) as 096e8d3107b3cf017af6b342260c3c007859f343
6 years, 3 months ago (2014-09-16 05:42:52 UTC) #11
commit-bot: I haz the power
6 years, 3 months ago (2014-09-16 05:44:12 UTC) #12
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/d2283ac2cb84e59bf67ecb2cb4efa0e48602ceb5
Cr-Commit-Position: refs/heads/master@{#295015}

Powered by Google App Engine
This is Rietveld 408576698