OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 void Builtins::Generate_ArrayCode(MacroAssembler* masm) { | 1185 void Builtins::Generate_ArrayCode(MacroAssembler* masm) { |
1186 // ----------- S t a t e ------------- | 1186 // ----------- S t a t e ------------- |
1187 // -- eax : argc | 1187 // -- eax : argc |
1188 // -- esp[0] : return address | 1188 // -- esp[0] : return address |
1189 // -- esp[4] : last argument | 1189 // -- esp[4] : last argument |
1190 // ----------------------------------- | 1190 // ----------------------------------- |
1191 Label generic_array_code; | 1191 Label generic_array_code; |
1192 | 1192 |
1193 // Get the Array function. | 1193 // Get the Array function. |
1194 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, edi); | 1194 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, edi); |
1195 __ mov(edx, edi); | |
1196 | 1195 |
1197 if (FLAG_debug_code) { | 1196 if (FLAG_debug_code) { |
1198 // Initial map for the builtin Array function should be a map. | 1197 // Initial map for the builtin Array function should be a map. |
1199 __ mov(ebx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset)); | 1198 __ mov(ebx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset)); |
1200 // Will both indicate a NULL and a Smi. | 1199 // Will both indicate a NULL and a Smi. |
1201 __ test(ebx, Immediate(kSmiTagMask)); | 1200 __ test(ebx, Immediate(kSmiTagMask)); |
1202 __ Assert(not_zero, kUnexpectedInitialMapForArrayFunction); | 1201 __ Assert(not_zero, kUnexpectedInitialMapForArrayFunction); |
1203 __ CmpObjectType(ebx, MAP_TYPE, ecx); | 1202 __ CmpObjectType(ebx, MAP_TYPE, ecx); |
1204 __ Assert(equal, kUnexpectedInitialMapForArrayFunction); | 1203 __ Assert(equal, kUnexpectedInitialMapForArrayFunction); |
1205 } | 1204 } |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1549 | 1548 |
1550 __ bind(&ok); | 1549 __ bind(&ok); |
1551 __ ret(0); | 1550 __ ret(0); |
1552 } | 1551 } |
1553 | 1552 |
1554 #undef __ | 1553 #undef __ |
1555 } | 1554 } |
1556 } // namespace v8::internal | 1555 } // namespace v8::internal |
1557 | 1556 |
1558 #endif // V8_TARGET_ARCH_IA32 | 1557 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |