Commit 3e7a1c04 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

ARM: Replace branch with conditional store in function prologue.

Use conditional store to replace the receiver with undefined for
strict mode functions and builtins instead of branching code. This
has similar performance characteristics but saves one branch
instruction per strict mode function.

R=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17412 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 38e19810
......@@ -148,13 +148,10 @@ void FullCodeGenerator::Generate() {
// receiver object). r5 is zero for method calls and non-zero for
// function calls.
if (!info->is_classic_mode() || info->is_native()) {
Label ok;
__ cmp(r5, Operand::Zero());
__ b(eq, &ok);
int receiver_offset = info->scope()->num_parameters() * kPointerSize;
__ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
__ str(r2, MemOperand(sp, receiver_offset));
__ bind(&ok);
__ str(r2, MemOperand(sp, receiver_offset), ne);
}
// Open a frame scope to indicate that there is a frame on the stack. The
......
......@@ -121,13 +121,10 @@ bool LCodeGen::GeneratePrologue() {
// receiver object). r5 is zero for method calls and non-zero for
// function calls.
if (!info_->is_classic_mode() || info_->is_native()) {
Label ok;
__ cmp(r5, Operand::Zero());
__ b(eq, &ok);
int receiver_offset = scope()->num_parameters() * kPointerSize;
__ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
__ str(r2, MemOperand(sp, receiver_offset));
__ bind(&ok);
__ str(r2, MemOperand(sp, receiver_offset), ne);
}
}
......
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