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

Issue 12218089: Remove nacl_user[] array lookup from syscall code path on x86-64 and MIPS (Closed)

Created:
7 years, 10 months ago by Mark Seaborn
Modified:
7 years, 9 months ago
Reviewers:
bsy
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Remove nacl_user[] array lookup from syscall code path on x86-64 and MIPS Replace the nacl_thread_index/gNaClThreadIdx TLS variable with a TLS variable that points to the NaClThreadContext directly. This saves a memory access in the syscall code path. This also reduces the number of cases in which we rely on thread indexes. Replace NaCl{Get,Set}TlsIdx() with NaCl{Get,Set}CurrentThread(). Add a cleanup step in NaClAppThreadTeardown() to unset the TLS variable. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3280 TEST=run_hello_world_test Committed: https://src.chromium.org/viewvc/native_client?view=rev&revision=10849

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+82 lines, -114 lines) Patch
M src/trusted/service_runtime/arch/arm/nacl_tls.c View 2 chunks +9 lines, -11 lines 0 comments Download
M src/trusted/service_runtime/arch/mips/nacl_syscall.S View 1 chunk +4 lines, -13 lines 0 comments Download
M src/trusted/service_runtime/arch/mips/nacl_tls.c View 2 chunks +9 lines, -11 lines 2 comments Download
M src/trusted/service_runtime/arch/x86_32/nacl_tls_32.c View 3 chunks +8 lines, -8 lines 0 comments Download
M src/trusted/service_runtime/arch/x86_64/nacl_syscall_64.S View 5 chunks +14 lines, -19 lines 0 comments Download
M src/trusted/service_runtime/arch/x86_64/nacl_tls_64.c View 6 chunks +24 lines, -20 lines 0 comments Download
M src/trusted/service_runtime/linux/thread_suspension.c View 1 chunk +1 line, -2 lines 0 comments Download
M src/trusted/service_runtime/nacl_app_thread.c View 2 chunks +2 lines, -1 line 0 comments Download
M src/trusted/service_runtime/nacl_signal_common.c View 3 chunks +7 lines, -9 lines 0 comments Download
M src/trusted/service_runtime/nacl_tls.h View 2 chunks +3 lines, -19 lines 0 comments Download
M tests/thread_capture/arch/x86_64/thread_capture_test_injection.c View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Mark Seaborn
7 years, 10 months ago (2013-02-11 16:38:34 UTC) #1
bsy
naming nit. feel free to ignore. lgtm https://codereview.chromium.org/12218089/diff/1/src/trusted/service_runtime/arch/mips/nacl_tls.c File src/trusted/service_runtime/arch/mips/nacl_tls.c (right): https://codereview.chromium.org/12218089/diff/1/src/trusted/service_runtime/arch/mips/nacl_tls.c#newcode23 src/trusted/service_runtime/arch/mips/nacl_tls.c:23: THREAD struct ...
7 years, 10 months ago (2013-02-19 19:03:08 UTC) #2
Mark Seaborn
7 years, 9 months ago (2013-03-27 00:29:07 UTC) #3
Message was sent while issue was closed.
Old review.  For the record...

https://codereview.chromium.org/12218089/diff/1/src/trusted/service_runtime/a...
File src/trusted/service_runtime/arch/mips/nacl_tls.c (right):

https://codereview.chromium.org/12218089/diff/1/src/trusted/service_runtime/a...
src/trusted/service_runtime/arch/mips/nacl_tls.c:23: THREAD struct
NaClThreadContext *nacl_current_thread;
On 2013/02/19 19:03:08, bsy wrote:
> maybe nacl_current_thread_context?

I opted to leave this as "nacl_current_thread" because NaClAppThread and
NaClThreadContext are effectively interchangeable and I'd like to rename
NaClThreadContext to something like NaClAppThreadArch at some point.

Powered by Google App Engine
This is Rietveld 408576698