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

Issue 997773002: Refactor Subzero initialization and add a browser callback handler. (Closed)

Created:
5 years, 9 months ago by jvoung (off chromium)
Modified:
5 years, 9 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Refactor Subzero initialization and add a browser callback handler. Handlers are represented as a "compile server" even though right now it can really only handle a single compile request. Then there can be a commandline-based server and a browser-based server. This server takes over the main thread. In the browser-based case the server can block, waiting on bytes to be pushed. This becomes a producer of bitcode bytes. The original main thread which did bitcode reading is now shifted to yet another worker thread, which is then the consumer of bitcode bytes. This uses an IRT interface for listening to messages from the browser: https://codereview.chromium.org/984713003/ TEST=Build the IRT core nexe w/ the above patch and compile w/ something like: echo """ readwrite_file objfile /tmp/temp.nexe---gcc.opt.stripped.pexe---.o rpc StreamInitWithSplit i(4) h(objfile) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) C(4,-O2\x00) * s() stream_file /usr/local/google/home/jvoung/pexe_tests/gcc.opt.stripped.pexe 65536 1000000000 rpc StreamEnd * i() s() s() s() echo "pnacl-sz complete" """ | scons-out/opt-linux-x86-32/staging/sel_universal \ -a -B scons-out/nacl_irt-x86-32/staging/irt_core.nexe \ --abort_on_error \ -- toolchain/linux_x86/pnacl_translator/translator/x86-32/bin/pnacl-sz.nexe echo """ readwrite_file nexefile /tmp/temp.nexe.tmp readonly_file objfile0 /tmp/temp.nexe---gcc.opt.stripped.pexe---.o rpc RunWithSplit i(1) h(objfile0) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(invalid) h(nexefile) * echo "ld complete" """ | /usr/local/google/home/nacl3/native_client/scons-out/opt-linux-x86-32/staging/sel_universal \ --abort_on_error \ -a -B \ scons-out/nacl_irt-x86-32/staging/irt_core.nexe \ -E NACL_IRT_OPEN_RESOURCE_BASE=toolchain/linux_x86/pnacl_translator/translator/x86-32/lib/ \ -E NACL_IRT_OPEN_RESOURCE_REMAP=libpnacl_irt_shim.a:libpnacl_irt_shim_dummy.a \ -- toolchain/linux_x86/pnacl_translator/translator/x86-32/bin/ld.nexe BUG= https://code.google.com/p/nativeclient/issues/detail?id=4091 R=kschimpf@google.com, stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=44c3a8046f4c81f9b4476f8c3c72723b584c312d

Patch Set 1 : bleh... give up on consistent output streams #

Patch Set 2 : more IRT related stuff #

Patch Set 3 : fix up more #

Patch Set 4 : stuff #

Patch Set 5 : Split it more #

Patch Set 6 : remember to EOF #

Total comments: 14

Patch Set 7 : sandbox it #

Total comments: 6

Patch Set 8 : header order, etc. #

Patch Set 9 : Makefile rules #

Patch Set 10 : fix race condition, keep debug info in standalone #

Patch Set 11 : partition flags and sort.. sort of #

Patch Set 12 : lift context creation out... stash error code in context and read from server thread #

Patch Set 13 : more stuff #

Total comments: 24

Patch Set 14 : review #

Patch Set 15 : missed one comment #

Patch Set 16 : fix error message #

Patch Set 17 : make format again #

Patch Set 18 : Rebase to the new IRT #

Patch Set 19 : format #

Patch Set 20 : Add argv note #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1158 lines, -484 lines) Patch
M Makefile View 1 chunk +2 lines, -2 lines 0 comments Download
M Makefile.standalone View 1 2 3 4 5 6 7 8 9 10 11 12 13 10 chunks +83 lines, -22 lines 0 comments Download
A src/IceBrowserCompileServer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +95 lines, -0 lines 0 comments Download
A src/IceBrowserCompileServer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +150 lines, -0 lines 0 comments Download
M src/IceClFlags.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +8 lines, -1 line 0 comments Download
A src/IceClFlags.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +304 lines, -0 lines 0 comments Download
A src/IceClFlagsExtra.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +79 lines, -0 lines 0 comments Download
A src/IceCompileServer.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +84 lines, -0 lines 0 comments Download
A src/IceCompileServer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +113 lines, -0 lines 0 comments Download
A src/IceCompiler.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +43 lines, -0 lines 0 comments Download
A src/IceCompiler.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +164 lines, -0 lines 0 comments Download
M src/IceGlobalContext.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +8 lines, -0 lines 0 comments Download
M src/IceInstX8632.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M src/IceTranslator.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M src/Makefile View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M src/main.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +22 lines, -457 lines 0 comments Download

Messages

Total messages: 24 (9 generated)
jvoung (off chromium)
Still a bunch of cleanup I want to do, but this is the rough first ...
5 years, 9 months ago (2015-03-13 02:07:52 UTC) #6
Jim Stichnoth
A few minor comments... https://codereview.chromium.org/997773002/diff/180001/Makefile.standalone File Makefile.standalone (right): https://codereview.chromium.org/997773002/diff/180001/Makefile.standalone#newcode26 Makefile.standalone:26: NACL_ROOT= $(shell readlink -e ../../../) ...
5 years, 9 months ago (2015-03-13 04:55:00 UTC) #7
Mircea Trofin
https://codereview.chromium.org/997773002/diff/200001/src/IceBrowserCompileServer.cpp File src/IceBrowserCompileServer.cpp (right): https://codereview.chromium.org/997773002/diff/200001/src/IceBrowserCompileServer.cpp#newcode101 src/IceBrowserCompileServer.cpp:101: struct PNaClSubzeroFunctions SubzeroCallbacks { are we still using the ...
5 years, 9 months ago (2015-03-13 22:01:34 UTC) #8
Jim Stichnoth
https://codereview.chromium.org/997773002/diff/200001/src/IceBrowserCompileServer.cpp File src/IceBrowserCompileServer.cpp (right): https://codereview.chromium.org/997773002/diff/200001/src/IceBrowserCompileServer.cpp#newcode101 src/IceBrowserCompileServer.cpp:101: struct PNaClSubzeroFunctions SubzeroCallbacks { On 2015/03/13 22:01:34, Mircea Trofin ...
5 years, 9 months ago (2015-03-14 02:31:05 UTC) #9
Mircea Trofin
thanks! I must have missed that On Fri, Mar 13, 2015 at 19:31 <stichnot@chromium.org> wrote: ...
5 years, 9 months ago (2015-03-14 03:20:00 UTC) #10
Karl
5 years, 9 months ago (2015-03-16 16:09:02 UTC) #11
Karl
LGTM
5 years, 9 months ago (2015-03-16 16:09:29 UTC) #12
jvoung (off chromium)
https://codereview.chromium.org/997773002/diff/180001/Makefile.standalone File Makefile.standalone (right): https://codereview.chromium.org/997773002/diff/180001/Makefile.standalone#newcode26 Makefile.standalone:26: NACL_ROOT= $(shell readlink -e ../../../) On 2015/03/13 04:55:00, stichnot ...
5 years, 9 months ago (2015-03-18 15:39:09 UTC) #13
Mircea Trofin
https://codereview.chromium.org/997773002/diff/200001/src/IceCompiler.h File src/IceCompiler.h (right): https://codereview.chromium.org/997773002/diff/200001/src/IceCompiler.h#newcode31 src/IceCompiler.h:31: void run(int argc, char **argv, CompileServer &Server); On 2015/03/18 ...
5 years, 9 months ago (2015-03-18 16:51:06 UTC) #14
Mircea Trofin
one more nit - can we automate the testing somehow? Thanks!
5 years, 9 months ago (2015-03-18 16:56:01 UTC) #15
jvoung (off chromium)
Some diffs from earlier CL: - Added Makefile.standalone target "sb" for more quickly testing that ...
5 years, 9 months ago (2015-03-25 05:22:11 UTC) #20
Jim Stichnoth
Otherwise lgtm. As for testing, I think it's probably more appropriate for the integration tests ...
5 years, 9 months ago (2015-03-25 16:34:06 UTC) #21
jvoung (off chromium)
Thanks! https://codereview.chromium.org/997773002/diff/400001/Makefile.standalone File Makefile.standalone (right): https://codereview.chromium.org/997773002/diff/400001/Makefile.standalone#newcode31 Makefile.standalone:31: NACL_ROOT ?= $(shell python -c "import sys; sys.path.insert(0, ...
5 years, 9 months ago (2015-03-25 18:14:35 UTC) #22
jvoung (off chromium)
Changed to adapt to IRT changes (ptal?)
5 years, 9 months ago (2015-03-26 22:35:38 UTC) #23
jvoung (off chromium)
5 years, 9 months ago (2015-03-27 23:29:15 UTC) #24
Message was sent while issue was closed.
Committed patchset #20 (id:540001) manually as
44c3a8046f4c81f9b4476f8c3c72723b584c312d (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698