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
parent f81b06dd
...@@ -363,12 +363,14 @@ void MacroAssembler::Bfi(Register dst, ...@@ -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); ASSERT(lsb < 32);
if (!CpuFeatures::IsSupported(ARMv7) || predictable_code_size()) { if (!CpuFeatures::IsSupported(ARMv7) || predictable_code_size()) {
int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1); int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1);
bic(dst, dst, Operand(mask)); bic(dst, src, Operand(mask));
} else { } else {
Move(dst, src, cond);
bfc(dst, lsb, width, cond); bfc(dst, lsb, width, cond);
} }
} }
...@@ -3497,7 +3499,7 @@ void MacroAssembler::CheckPageFlag( ...@@ -3497,7 +3499,7 @@ void MacroAssembler::CheckPageFlag(
int mask, int mask,
Condition cc, Condition cc,
Label* condition_met) { Label* condition_met) {
and_(scratch, object, Operand(~Page::kPageAlignmentMask)); Bfc(scratch, object, 0, kPageSizeBits);
ldr(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset)); ldr(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset));
tst(scratch, Operand(mask)); tst(scratch, Operand(mask));
b(cc, condition_met); b(cc, condition_met);
......
...@@ -154,7 +154,7 @@ class MacroAssembler: public Assembler { ...@@ -154,7 +154,7 @@ class MacroAssembler: public Assembler {
int lsb, int lsb,
int width, int width,
Condition cond = al); 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, void Usat(Register dst, int satpos, const Operand& src,
Condition cond = al); Condition cond = al);
......
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