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

Unified Diff: src/trusted/service_runtime/arch/mips/nacl_syscall.S

Issue 12218089: Remove nacl_user[] array lookup from syscall code path on x86-64 and MIPS (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 7 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: src/trusted/service_runtime/arch/mips/nacl_syscall.S
diff --git a/src/trusted/service_runtime/arch/mips/nacl_syscall.S b/src/trusted/service_runtime/arch/mips/nacl_syscall.S
index 089e57d1f7dd2d02740b2f5dfba345418a721f64..5aaef5ea6250cd271395841d9fb82ae44f5927f6 100644
--- a/src/trusted/service_runtime/arch/mips/nacl_syscall.S
+++ b/src/trusted/service_runtime/arch/mips/nacl_syscall.S
@@ -88,22 +88,13 @@ DEFINE_GLOBAL_HIDDEN_IDENTIFIER(NaClSyscallSeg):
sw $t5, -8($sp)
/* Load the __thread variable's offset into a3. */
- lui $a3, %tprel_hi(gNaClThreadIdx)
- addiu $a3, $a3, %tprel_lo(gNaClThreadIdx)
+ lui $a3, %tprel_hi(nacl_current_thread)
+ addiu $a3, $a3, %tprel_lo(nacl_current_thread)
- /* Fetch the thread-local variable holding the thread index. */
+ /* Fetch the thread-local variable: set a0 = nacl_current_thread */
rdhwr $v1, $29
addu $a3, $v1, $a3
- lw $a1, 0($a3)
-
- /*
- * Load the nacl_user entry of this thread.
- * a0 = nacl_user[a1*4]
- */
- lw $a0,%got(nacl_user)($28)
- sll $a1, $a1, 2
- addu $a0, $a0, $a1
- lw $a0, 0($a0)
+ lw $a0, 0($a3)
DEFINE_GLOBAL_HIDDEN_IDENTIFIER(NaClSyscallThreadCaptureFault):
sw $s0, NACL_THREAD_CONTEXT_OFFSET_S0($a0)

Powered by Google App Engine
This is Rietveld 408576698