Skip to content

Commit

Permalink
Bug 1279312 - Use TLS pointer for the stack limit check. r=luke
Browse files Browse the repository at this point in the history
Get the stack limit from TlsData::stackLimit instead of
SymbolicAddress::StackLimit. Since the TLS pointer register is available at
every function prologue, the over-recursion check is the same cost as using the
statically linked address.
  • Loading branch information
Jakob Stoklund Olesen committed Jul 25, 2016
1 parent 64f8ceb commit 95b71cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/src/jit/CodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8983,8 +8983,10 @@ CodeGenerator::generateWasm(wasm::SigIdDesc sigId, wasm::FuncOffsets* offsets)
// pushing framePushed to catch cases with really large frames.
Label onOverflow;
if (!omitOverRecursedCheck()) {
// Get the per-thread stack limit from the TlsData struct pointed
// to by the WasmTlsReg hidden argument register.
masm.branchPtr(Assembler::AboveOrEqual,
wasm::SymbolicAddress::StackLimit,
Address(WasmTlsReg, offsetof(wasm::TlsData, stackLimit)),
masm.getStackPointer(),
&onOverflow);
}
Expand Down

0 comments on commit 95b71cc

Please sign in to comment.