| 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 // ecx: start of next object | 351 // ecx: start of next object |
| 352 __ mov(eax, factory->fixed_array_map()); | 352 __ mov(eax, factory->fixed_array_map()); |
| 353 __ mov(Operand(edi, FixedArray::kMapOffset), eax); // setup the map | 353 __ mov(Operand(edi, FixedArray::kMapOffset), eax); // setup the map |
| 354 __ SmiTag(edx); | 354 __ SmiTag(edx); |
| 355 __ mov(Operand(edi, FixedArray::kLengthOffset), edx); // and length | 355 __ mov(Operand(edi, FixedArray::kLengthOffset), edx); // and length |
| 356 | 356 |
| 357 // Initialize the fields to undefined. | 357 // Initialize the fields to undefined. |
| 358 // ebx: JSObject | 358 // ebx: JSObject |
| 359 // edi: FixedArray | 359 // edi: FixedArray |
| 360 // ecx: start of next object | 360 // ecx: start of next object |
| 361 { Label loop, entry; | 361 __ mov(edx, factory->undefined_value()); |
| 362 __ mov(edx, factory->undefined_value()); | 362 __ lea(eax, Operand(edi, FixedArray::kHeaderSize)); |
| 363 __ lea(eax, Operand(edi, FixedArray::kHeaderSize)); | 363 __ InitializeFieldsWithFiller(eax, ecx, edx); |
| 364 __ jmp(&entry); | |
| 365 __ bind(&loop); | |
| 366 __ mov(Operand(eax, 0), edx); | |
| 367 __ add(eax, Immediate(kPointerSize)); | |
| 368 __ bind(&entry); | |
| 369 __ cmp(eax, ecx); | |
| 370 __ j(below, &loop); | |
| 371 } | |
| 372 | 364 |
| 373 // Store the initialized FixedArray into the properties field of | 365 // Store the initialized FixedArray into the properties field of |
| 374 // the JSObject | 366 // the JSObject |
| 375 // ebx: JSObject | 367 // ebx: JSObject |
| 376 // edi: FixedArray | 368 // edi: FixedArray |
| 377 __ or_(edi, Immediate(kHeapObjectTag)); // add the heap tag | 369 __ or_(edi, Immediate(kHeapObjectTag)); // add the heap tag |
| 378 __ mov(FieldOperand(ebx, JSObject::kPropertiesOffset), edi); | 370 __ mov(FieldOperand(ebx, JSObject::kPropertiesOffset), edi); |
| 379 | 371 |
| 380 | 372 |
| 381 // Continue with JSObject being successfully allocated | 373 // Continue with JSObject being successfully allocated |
| (...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1708 | 1700 |
| 1709 __ bind(&ok); | 1701 __ bind(&ok); |
| 1710 __ ret(0); | 1702 __ ret(0); |
| 1711 } | 1703 } |
| 1712 | 1704 |
| 1713 #undef __ | 1705 #undef __ |
| 1714 } // namespace internal | 1706 } // namespace internal |
| 1715 } // namespace v8 | 1707 } // namespace v8 |
| 1716 | 1708 |
| 1717 #endif // V8_TARGET_ARCH_IA32 | 1709 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |