| 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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 | 
| 6 | 6 | 
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" | 
| 8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" | 
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" | 
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" | 
| (...skipping 4554 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4565   // Fall back to runtime if the target differs from the new target's | 4565   // Fall back to runtime if the target differs from the new target's | 
| 4566   // initial map constructor. | 4566   // initial map constructor. | 
| 4567   __ cmp(edi, FieldOperand(ecx, Map::kConstructorOrBackPointerOffset)); | 4567   __ cmp(edi, FieldOperand(ecx, Map::kConstructorOrBackPointerOffset)); | 
| 4568   __ j(not_equal, &new_object); | 4568   __ j(not_equal, &new_object); | 
| 4569 | 4569 | 
| 4570   // Allocate the JSObject on the heap. | 4570   // Allocate the JSObject on the heap. | 
| 4571   Label allocate, done_allocate; | 4571   Label allocate, done_allocate; | 
| 4572   __ movzx_b(ebx, FieldOperand(ecx, Map::kInstanceSizeOffset)); | 4572   __ movzx_b(ebx, FieldOperand(ecx, Map::kInstanceSizeOffset)); | 
| 4573   __ lea(ebx, Operand(ebx, times_pointer_size, 0)); | 4573   __ lea(ebx, Operand(ebx, times_pointer_size, 0)); | 
| 4574   __ Allocate(ebx, eax, edi, no_reg, &allocate, NO_ALLOCATION_FLAGS); | 4574   __ Allocate(ebx, eax, edi, no_reg, &allocate, NO_ALLOCATION_FLAGS); | 
|  | 4575   __ dec(edi);  // Untag result end. | 
| 4575   __ bind(&done_allocate); | 4576   __ bind(&done_allocate); | 
| 4576 | 4577 | 
| 4577   // Initialize the JSObject fields. | 4578   // Initialize the JSObject fields. | 
| 4578   __ mov(FieldOperand(eax, JSObject::kMapOffset), ecx); | 4579   __ mov(FieldOperand(eax, JSObject::kMapOffset), ecx); | 
| 4579   __ mov(FieldOperand(eax, JSObject::kPropertiesOffset), | 4580   __ mov(FieldOperand(eax, JSObject::kPropertiesOffset), | 
| 4580          masm->isolate()->factory()->empty_fixed_array()); | 4581          masm->isolate()->factory()->empty_fixed_array()); | 
| 4581   __ mov(FieldOperand(eax, JSObject::kElementsOffset), | 4582   __ mov(FieldOperand(eax, JSObject::kElementsOffset), | 
| 4582          masm->isolate()->factory()->empty_fixed_array()); | 4583          masm->isolate()->factory()->empty_fixed_array()); | 
| 4583   STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize); | 4584   STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize); | 
| 4584   __ lea(ebx, FieldOperand(eax, JSObject::kHeaderSize)); | 4585   __ lea(ebx, FieldOperand(eax, JSObject::kHeaderSize)); | 
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4715   __ bind(&no_rest_parameters); | 4716   __ bind(&no_rest_parameters); | 
| 4716   { | 4717   { | 
| 4717     // ----------- S t a t e ------------- | 4718     // ----------- S t a t e ------------- | 
| 4718     //  -- esi    : context | 4719     //  -- esi    : context | 
| 4719     //  -- esp[0] : return address | 4720     //  -- esp[0] : return address | 
| 4720     // ----------------------------------- | 4721     // ----------------------------------- | 
| 4721 | 4722 | 
| 4722     // Allocate an empty rest parameter array. | 4723     // Allocate an empty rest parameter array. | 
| 4723     Label allocate, done_allocate; | 4724     Label allocate, done_allocate; | 
| 4724     __ Allocate(JSArray::kSize, eax, edx, ecx, &allocate, NO_ALLOCATION_FLAGS); | 4725     __ Allocate(JSArray::kSize, eax, edx, ecx, &allocate, NO_ALLOCATION_FLAGS); | 
|  | 4726     __ dec(edx);  // Untag result end. | 
| 4725     __ bind(&done_allocate); | 4727     __ bind(&done_allocate); | 
| 4726 | 4728 | 
| 4727     // Setup the rest parameter array in rax. | 4729     // Setup the rest parameter array in rax. | 
| 4728     __ LoadGlobalFunction(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, ecx); | 4730     __ LoadGlobalFunction(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, ecx); | 
| 4729     __ mov(FieldOperand(eax, JSArray::kMapOffset), ecx); | 4731     __ mov(FieldOperand(eax, JSArray::kMapOffset), ecx); | 
| 4730     __ mov(ecx, isolate()->factory()->empty_fixed_array()); | 4732     __ mov(ecx, isolate()->factory()->empty_fixed_array()); | 
| 4731     __ mov(FieldOperand(eax, JSArray::kPropertiesOffset), ecx); | 4733     __ mov(FieldOperand(eax, JSArray::kPropertiesOffset), ecx); | 
| 4732     __ mov(FieldOperand(eax, JSArray::kElementsOffset), ecx); | 4734     __ mov(FieldOperand(eax, JSArray::kElementsOffset), ecx); | 
| 4733     __ mov(FieldOperand(eax, JSArray::kLengthOffset), | 4735     __ mov(FieldOperand(eax, JSArray::kLengthOffset), | 
| 4734            Immediate(Smi::FromInt(0))); | 4736            Immediate(Smi::FromInt(0))); | 
| (...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5717                            kStackUnwindSpace, nullptr, return_value_operand, | 5719                            kStackUnwindSpace, nullptr, return_value_operand, | 
| 5718                            NULL); | 5720                            NULL); | 
| 5719 } | 5721 } | 
| 5720 | 5722 | 
| 5721 #undef __ | 5723 #undef __ | 
| 5722 | 5724 | 
| 5723 }  // namespace internal | 5725 }  // namespace internal | 
| 5724 }  // namespace v8 | 5726 }  // namespace v8 | 
| 5725 | 5727 | 
| 5726 #endif  // V8_TARGET_ARCH_IA32 | 5728 #endif  // V8_TARGET_ARCH_IA32 | 
| OLD | NEW | 
|---|