Reverting 2909,2908
authorsgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 17 Sep 2009 07:58:49 +0000 (07:58 +0000)
committersgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 17 Sep 2009 07:58:49 +0000 (07:58 +0000)
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2910 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/ia32/builtins-ia32.cc

index c019b1f3c7cb467173e674125804de5f3d4c74b5..2db8fbec374541eef67f61bb93dfb4602d149fae 100644 (file)
@@ -740,10 +740,7 @@ static void AllocateEmptyJSArray(MacroAssembler* masm,
   __ mov(FieldOperand(scratch1, Array::kLengthOffset), Immediate(holes));
 
   // Fill the FixedArray with the hole value. Inline the code if short.
-  // Reconsider loop unfolding if kPreallocatedArrayElements gets changed.
-  static const int kLoopUnfoldLimit = 4;
-  ASSERT(kPreallocatedArrayElements <= kLoopUnfoldLimit);
-  if (holes <= kLoopUnfoldLimit) {
+  if (holes <= 4) {
     // Use a scratch register here to have only one reloc info when unfolding
     // the loop.
     __ mov(scratch3, Factory::the_hole_value());
@@ -1071,7 +1068,7 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
     __ Assert(equal, "Unexpected initial map for Array function");
   }
 
-  // Run the native code for the Array function called as a normal function.
+  // Run the native code for the Array function called as constructor.
   ArrayNativeCode(masm, false, &generic_array_code);
 
   // Jump to the generic array code in case the specialized code cannot handle
@@ -1113,6 +1110,7 @@ void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) {
   // Jump to the generic construct code in case the specialized code cannot
   // handle the construction.
   __ bind(&generic_constructor);
+  GenerateLoadArrayFunction(masm, edi);
   Code* code = Builtins::builtin(Builtins::JSConstructStubGeneric);
   Handle<Code> generic_construct_stub(code);
   __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET);