Commit b64bcb41 authored by marija.antic's avatar marija.antic Committed by Commit bot

MIPS: Fix context loading in CheckAccessGlobalProxy

Various failures for MIPS were introduced by the refactoring of
the way frames are marked https://codereview.chromium.org/1696043002.

Problems were caused during context loading in CheckAccessGlobalProxy
* The value of the register at was unintentionally modified.
* Use of branch instruction instead of branch macro resulted in
  a branch instruction in forbidden slot.

BUG=

Review URL: https://codereview.chromium.org/1812463002

Cr-Commit-Position: refs/heads/master@{#34829}
parent f9db79eb
......@@ -509,6 +509,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
Register scratch,
Label* miss) {
Label same_contexts;
Register temporary = t8;
DCHECK(!holder_reg.is(scratch));
DCHECK(!holder_reg.is(at));
......@@ -521,9 +522,10 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
mov(at, fp);
bind(&load_context);
lw(scratch, MemOperand(at, CommonFrameConstants::kContextOrFrameTypeOffset));
JumpIfNotSmi(scratch, &has_context);
// Passing temporary register, otherwise JumpIfNotSmi modifies register at.
JumpIfNotSmi(scratch, &has_context, temporary);
lw(at, MemOperand(at, CommonFrameConstants::kCallerFPOffset));
b(&load_context);
Branch(&load_context);
bind(&has_context);
// In debug mode, make sure the lexical context is set.
......
......@@ -512,6 +512,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
Register scratch,
Label* miss) {
Label same_contexts;
Register temporary = t8;
DCHECK(!holder_reg.is(scratch));
DCHECK(!holder_reg.is(at));
......@@ -524,9 +525,10 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
mov(at, fp);
bind(&load_context);
ld(scratch, MemOperand(at, CommonFrameConstants::kContextOrFrameTypeOffset));
JumpIfNotSmi(scratch, &has_context);
// Passing temporary register, otherwise JumpIfNotSmi modifies register at.
JumpIfNotSmi(scratch, &has_context, temporary);
ld(at, MemOperand(at, CommonFrameConstants::kCallerFPOffset));
b(&load_context);
Branch(&load_context);
bind(&has_context);
// In debug mode, make sure the lexical context is set.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment