From 270316e953f7be0c530e90b2a1b568395f7de418 Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Tue, 9 Oct 2012 15:12:39 +0000 Subject: [PATCH] Improve page flag checking sequence on ARM. R=ulan@chromium.org Review URL: https://codereview.chromium.org/11090021 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12682 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/macro-assembler-arm.cc | 8 +++++--- src/arm/macro-assembler-arm.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc index cc7fc4d..1f6ec65 100644 --- a/src/arm/macro-assembler-arm.cc +++ b/src/arm/macro-assembler-arm.cc @@ -363,12 +363,14 @@ void MacroAssembler::Bfi(Register dst, } -void MacroAssembler::Bfc(Register dst, int lsb, int width, Condition cond) { +void MacroAssembler::Bfc(Register dst, Register src, int lsb, int width, + Condition cond) { ASSERT(lsb < 32); if (!CpuFeatures::IsSupported(ARMv7) || predictable_code_size()) { int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1); - bic(dst, dst, Operand(mask)); + bic(dst, src, Operand(mask)); } else { + Move(dst, src, cond); bfc(dst, lsb, width, cond); } } @@ -3497,7 +3499,7 @@ void MacroAssembler::CheckPageFlag( int mask, Condition cc, Label* condition_met) { - and_(scratch, object, Operand(~Page::kPageAlignmentMask)); + Bfc(scratch, object, 0, kPageSizeBits); ldr(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset)); tst(scratch, Operand(mask)); b(cc, condition_met); diff --git a/src/arm/macro-assembler-arm.h b/src/arm/macro-assembler-arm.h index ff0deef..c8a6a94 100644 --- a/src/arm/macro-assembler-arm.h +++ b/src/arm/macro-assembler-arm.h @@ -154,7 +154,7 @@ class MacroAssembler: public Assembler { int lsb, int width, Condition cond = al); - void Bfc(Register dst, int lsb, int width, Condition cond = al); + void Bfc(Register dst, Register src, int lsb, int width, Condition cond = al); void Usat(Register dst, int satpos, const Operand& src, Condition cond = al); -- 2.7.4