Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
MIPS: Fix context loading in CheckAccessGlobalProxy
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
marija.antic authored and Commit bot committed Mar 16, 2016
1 parent f9db79e commit b64bcb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/mips/macro-assembler-mips.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions src/mips64/macro-assembler-mips64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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.
Expand Down

0 comments on commit b64bcb4

Please sign in to comment.