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

Side by Side Diff: src/ia32/builtins-ia32.cc

Issue 215007: Reverting 2909,2908 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 // Initialize the FixedArray and fill it with holes. FixedArray length is not 733 // Initialize the FixedArray and fill it with holes. FixedArray length is not
734 // stored as a smi. 734 // stored as a smi.
735 // result: JSObject 735 // result: JSObject
736 // scratch1: elements array 736 // scratch1: elements array
737 // scratch2: start of next object 737 // scratch2: start of next object
738 __ mov(FieldOperand(scratch1, JSObject::kMapOffset), 738 __ mov(FieldOperand(scratch1, JSObject::kMapOffset),
739 Factory::fixed_array_map()); 739 Factory::fixed_array_map());
740 __ mov(FieldOperand(scratch1, Array::kLengthOffset), Immediate(holes)); 740 __ mov(FieldOperand(scratch1, Array::kLengthOffset), Immediate(holes));
741 741
742 // Fill the FixedArray with the hole value. Inline the code if short. 742 // Fill the FixedArray with the hole value. Inline the code if short.
743 // Reconsider loop unfolding if kPreallocatedArrayElements gets changed. 743 if (holes <= 4) {
744 static const int kLoopUnfoldLimit = 4;
745 ASSERT(kPreallocatedArrayElements <= kLoopUnfoldLimit);
746 if (holes <= kLoopUnfoldLimit) {
747 // Use a scratch register here to have only one reloc info when unfolding 744 // Use a scratch register here to have only one reloc info when unfolding
748 // the loop. 745 // the loop.
749 __ mov(scratch3, Factory::the_hole_value()); 746 __ mov(scratch3, Factory::the_hole_value());
750 for (int i = 0; i < holes; i++) { 747 for (int i = 0; i < holes; i++) {
751 __ mov(FieldOperand(scratch1, 748 __ mov(FieldOperand(scratch1,
752 FixedArray::kHeaderSize + i * kPointerSize), 749 FixedArray::kHeaderSize + i * kPointerSize),
753 scratch3); 750 scratch3);
754 } 751 }
755 } else { 752 } else {
756 Label loop, entry; 753 Label loop, entry;
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 if (FLAG_debug_code) { 1061 if (FLAG_debug_code) {
1065 // Initial map for the builtin Array function shoud be a map. 1062 // Initial map for the builtin Array function shoud be a map.
1066 __ mov(ebx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset)); 1063 __ mov(ebx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset));
1067 // Will both indicate a NULL and a Smi. 1064 // Will both indicate a NULL and a Smi.
1068 __ test(ebx, Immediate(kSmiTagMask)); 1065 __ test(ebx, Immediate(kSmiTagMask));
1069 __ Assert(not_zero, "Unexpected initial map for Array function"); 1066 __ Assert(not_zero, "Unexpected initial map for Array function");
1070 __ CmpObjectType(ebx, MAP_TYPE, ecx); 1067 __ CmpObjectType(ebx, MAP_TYPE, ecx);
1071 __ Assert(equal, "Unexpected initial map for Array function"); 1068 __ Assert(equal, "Unexpected initial map for Array function");
1072 } 1069 }
1073 1070
1074 // Run the native code for the Array function called as a normal function. 1071 // Run the native code for the Array function called as constructor.
1075 ArrayNativeCode(masm, false, &generic_array_code); 1072 ArrayNativeCode(masm, false, &generic_array_code);
1076 1073
1077 // Jump to the generic array code in case the specialized code cannot handle 1074 // Jump to the generic array code in case the specialized code cannot handle
1078 // the construction. 1075 // the construction.
1079 __ bind(&generic_array_code); 1076 __ bind(&generic_array_code);
1080 Code* code = Builtins::builtin(Builtins::ArrayCodeGeneric); 1077 Code* code = Builtins::builtin(Builtins::ArrayCodeGeneric);
1081 Handle<Code> array_code(code); 1078 Handle<Code> array_code(code);
1082 __ jmp(array_code, RelocInfo::CODE_TARGET); 1079 __ jmp(array_code, RelocInfo::CODE_TARGET);
1083 } 1080 }
1084 1081
(...skipping 21 matching lines...) Expand all
1106 __ CmpObjectType(ebx, MAP_TYPE, ecx); 1103 __ CmpObjectType(ebx, MAP_TYPE, ecx);
1107 __ Assert(equal, "Unexpected initial map for Array function"); 1104 __ Assert(equal, "Unexpected initial map for Array function");
1108 } 1105 }
1109 1106
1110 // Run the native code for the Array function called as constructor. 1107 // Run the native code for the Array function called as constructor.
1111 ArrayNativeCode(masm, false, &generic_constructor); 1108 ArrayNativeCode(masm, false, &generic_constructor);
1112 1109
1113 // Jump to the generic construct code in case the specialized code cannot 1110 // Jump to the generic construct code in case the specialized code cannot
1114 // handle the construction. 1111 // handle the construction.
1115 __ bind(&generic_constructor); 1112 __ bind(&generic_constructor);
1113 GenerateLoadArrayFunction(masm, edi);
1116 Code* code = Builtins::builtin(Builtins::JSConstructStubGeneric); 1114 Code* code = Builtins::builtin(Builtins::JSConstructStubGeneric);
1117 Handle<Code> generic_construct_stub(code); 1115 Handle<Code> generic_construct_stub(code);
1118 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); 1116 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET);
1119 } 1117 }
1120 1118
1121 1119
1122 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { 1120 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
1123 __ push(ebp); 1121 __ push(ebp);
1124 __ mov(ebp, Operand(esp)); 1122 __ mov(ebp, Operand(esp));
1125 1123
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 // Dont adapt arguments. 1227 // Dont adapt arguments.
1230 // ------------------------------------------- 1228 // -------------------------------------------
1231 __ bind(&dont_adapt_arguments); 1229 __ bind(&dont_adapt_arguments);
1232 __ jmp(Operand(edx)); 1230 __ jmp(Operand(edx));
1233 } 1231 }
1234 1232
1235 1233
1236 #undef __ 1234 #undef __
1237 1235
1238 } } // namespace v8::internal 1236 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698