DescriptionRefactor 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 #
Messages
Total messages: 24 (9 generated)
|