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

Unified Diff: src/ia32/builtins-ia32.cc

Issue 2084017: Version 2.2.11... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 10 years, 7 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/assembler-ia32-inl.h ('k') | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/builtins-ia32.cc
===================================================================
--- src/ia32/builtins-ia32.cc (revision 4699)
+++ src/ia32/builtins-ia32.cc (working copy)
@@ -27,6 +27,8 @@
#include "v8.h"
+#if defined(V8_TARGET_ARCH_IA32)
+
#include "codegen-inl.h"
namespace v8 {
@@ -806,6 +808,7 @@
Label* gc_required) {
ASSERT(scratch.is(edi)); // rep stos destination
ASSERT(!fill_with_hole || array_size.is(ecx)); // rep stos count
+ ASSERT(!fill_with_hole || !result.is(eax)); // result is never eax
// Load the initial map from the array function.
__ mov(elements_array,
@@ -863,15 +866,22 @@
if (fill_with_hole) {
__ lea(edi, Operand(elements_array,
FixedArray::kHeaderSize - kHeapObjectTag));
-
- __ push(eax);
__ mov(eax, Factory::the_hole_value());
-
__ cld();
+ // Do not use rep stos when filling less than kRepStosThreshold
+ // words.
+ const int kRepStosThreshold = 16;
+ Label loop, entry, done;
+ __ cmp(ecx, kRepStosThreshold);
+ __ j(below, &loop); // Note: ecx > 0.
__ rep_stos();
-
- // Restore saved registers.
- __ pop(eax);
+ __ jmp(&done);
+ __ bind(&loop);
+ __ stos();
+ __ bind(&entry);
+ __ cmp(edi, Operand(elements_array_end));
+ __ j(below, &loop);
+ __ bind(&done);
}
}
@@ -970,13 +980,14 @@
AllocateJSArray(masm,
edi,
ecx,
+ ebx,
eax,
- ebx,
edx,
edi,
true,
&prepare_generic_code_call);
__ IncrementCounter(&Counters::array_function_native, 1);
+ __ mov(eax, ebx);
__ pop(ebx);
if (construct_call) {
__ pop(edi);
@@ -1247,3 +1258,5 @@
#undef __
} } // namespace v8::internal
+
+#endif // V8_TARGET_ARCH_IA32
« no previous file with comments | « src/ia32/assembler-ia32-inl.h ('k') | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698