PPC/s390: [runtime] Reset the current context when leaving the runtime in the CEntryStub

Port 2a50797d40

Original Commit Message:

    This CL introduces a Context::kInvalidContext sentinel value to make clear that
    no context is active. We silently accept smi 0 (= nullptr) as a non-set context
    which usually was the default value making it hard to ensure whether this
    happened on purpose or not.

R=cbruni@chromium.org, joransiu@ca.ibm.com, bjaideep@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: If907db07b6e84696e3f9c1df937ed75bac54a987
Reviewed-on: https://chromium-review.googlesource.com/857587
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#50465}
This commit is contained in:
Junliang Yan 2018-01-09 12:57:03 -05:00 committed by Commit Bot
parent 7f019bb282
commit 6955512d6d
2 changed files with 3 additions and 1 deletions

View File

@ -1034,6 +1034,7 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count,
LoadP(cp, MemOperand(ip));
#ifdef DEBUG
mov(r6, Operand(Context::kInvalidContext));
mov(ip,
Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
StoreP(r6, MemOperand(ip));

View File

@ -1057,9 +1057,10 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count,
LoadP(cp, MemOperand(ip));
#ifdef DEBUG
mov(r1, Operand(Context::kInvalidContext));
mov(ip,
Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
StoreP(MemOperand(ip), Operand(0, kRelocInfo_NONEPTR), r0);
StoreP(r1, MemOperand(ip));
#endif
// Tear down the exit frame, pop the arguments, and return.