Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: src/ia32/stub-cache-ia32.cc

Issue 519035: Use cmov instructions to avoid some conditional branches in stub code.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/stub-cache-ia32.cc
===================================================================
--- src/ia32/stub-cache-ia32.cc (revision 3528)
+++ src/ia32/stub-cache-ia32.cc (working copy)
@@ -1900,17 +1900,23 @@
// depending on the this.x = ...; assignment in the function.
for (int i = 0; i < shared->this_property_assignments_count(); i++) {
if (shared->IsThisPropertyAssignmentArgument(i)) {
- Label not_passed;
- // Set the property to undefined.
- __ mov(Operand(edx, i * kPointerSize), edi);
// Check if the argument assigned to the property is actually passed.
+ // If argument is not passed the property is set to undefined,
+ // otherwise find it on the stack.
int arg_number = shared->GetThisPropertyAssignmentArgument(i);
+ __ mov(ebx, edi);
__ cmp(eax, arg_number);
- __ j(below_equal, &not_passed);
- // Argument passed - find it on the stack.
- __ mov(ebx, Operand(ecx, arg_number * -kPointerSize));
+ if (CpuFeatures::IsSupported(CMOV)) {
+ CpuFeatures::Scope use_cmov(CMOV);
+ __ cmov(above, ebx, Operand(ecx, arg_number * -kPointerSize));
+ } else {
+ Label not_passed;
+ __ j(below_equal, &not_passed);
+ __ mov(ebx, Operand(ecx, arg_number * -kPointerSize));
+ __ bind(&not_passed);
+ }
+ // Store value in the property.
__ mov(Operand(edx, i * kPointerSize), ebx);
- __ bind(&not_passed);
} else {
// Set the property to the constant value.
Handle<Object> constant(shared->GetThisPropertyAssignmentConstant(i));
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698