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 4448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4459 // Fall back to runtime if the target differs from the new target's | 4459 // Fall back to runtime if the target differs from the new target's |
4460 // initial map constructor. | 4460 // initial map constructor. |
4461 __ cmp(edi, FieldOperand(ecx, Map::kConstructorOrBackPointerOffset)); | 4461 __ cmp(edi, FieldOperand(ecx, Map::kConstructorOrBackPointerOffset)); |
4462 __ j(not_equal, &new_object); | 4462 __ j(not_equal, &new_object); |
4463 | 4463 |
4464 // Allocate the JSObject on the heap. | 4464 // Allocate the JSObject on the heap. |
4465 Label allocate, done_allocate; | 4465 Label allocate, done_allocate; |
4466 __ movzx_b(ebx, FieldOperand(ecx, Map::kInstanceSizeOffset)); | 4466 __ movzx_b(ebx, FieldOperand(ecx, Map::kInstanceSizeOffset)); |
4467 __ lea(ebx, Operand(ebx, times_pointer_size, 0)); | 4467 __ lea(ebx, Operand(ebx, times_pointer_size, 0)); |
4468 __ Allocate(ebx, eax, edi, no_reg, &allocate, NO_ALLOCATION_FLAGS); | 4468 __ Allocate(ebx, eax, edi, no_reg, &allocate, NO_ALLOCATION_FLAGS); |
| 4469 __ dec(edi); // Untag result end. |
4469 __ bind(&done_allocate); | 4470 __ bind(&done_allocate); |
4470 | 4471 |
4471 // Initialize the JSObject fields. | 4472 // Initialize the JSObject fields. |
4472 __ mov(FieldOperand(eax, JSObject::kMapOffset), ecx); | 4473 __ mov(FieldOperand(eax, JSObject::kMapOffset), ecx); |
4473 __ mov(FieldOperand(eax, JSObject::kPropertiesOffset), | 4474 __ mov(FieldOperand(eax, JSObject::kPropertiesOffset), |
4474 masm->isolate()->factory()->empty_fixed_array()); | 4475 masm->isolate()->factory()->empty_fixed_array()); |
4475 __ mov(FieldOperand(eax, JSObject::kElementsOffset), | 4476 __ mov(FieldOperand(eax, JSObject::kElementsOffset), |
4476 masm->isolate()->factory()->empty_fixed_array()); | 4477 masm->isolate()->factory()->empty_fixed_array()); |
4477 STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize); | 4478 STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize); |
4478 __ lea(ebx, FieldOperand(eax, JSObject::kHeaderSize)); | 4479 __ lea(ebx, FieldOperand(eax, JSObject::kHeaderSize)); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4609 __ bind(&no_rest_parameters); | 4610 __ bind(&no_rest_parameters); |
4610 { | 4611 { |
4611 // ----------- S t a t e ------------- | 4612 // ----------- S t a t e ------------- |
4612 // -- esi : context | 4613 // -- esi : context |
4613 // -- esp[0] : return address | 4614 // -- esp[0] : return address |
4614 // ----------------------------------- | 4615 // ----------------------------------- |
4615 | 4616 |
4616 // Allocate an empty rest parameter array. | 4617 // Allocate an empty rest parameter array. |
4617 Label allocate, done_allocate; | 4618 Label allocate, done_allocate; |
4618 __ Allocate(JSArray::kSize, eax, edx, ecx, &allocate, NO_ALLOCATION_FLAGS); | 4619 __ Allocate(JSArray::kSize, eax, edx, ecx, &allocate, NO_ALLOCATION_FLAGS); |
| 4620 __ dec(edx); // Untag result end. |
4619 __ bind(&done_allocate); | 4621 __ bind(&done_allocate); |
4620 | 4622 |
4621 // Setup the rest parameter array in rax. | 4623 // Setup the rest parameter array in rax. |
4622 __ LoadGlobalFunction(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, ecx); | 4624 __ LoadGlobalFunction(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, ecx); |
4623 __ mov(FieldOperand(eax, JSArray::kMapOffset), ecx); | 4625 __ mov(FieldOperand(eax, JSArray::kMapOffset), ecx); |
4624 __ mov(ecx, isolate()->factory()->empty_fixed_array()); | 4626 __ mov(ecx, isolate()->factory()->empty_fixed_array()); |
4625 __ mov(FieldOperand(eax, JSArray::kPropertiesOffset), ecx); | 4627 __ mov(FieldOperand(eax, JSArray::kPropertiesOffset), ecx); |
4626 __ mov(FieldOperand(eax, JSArray::kElementsOffset), ecx); | 4628 __ mov(FieldOperand(eax, JSArray::kElementsOffset), ecx); |
4627 __ mov(FieldOperand(eax, JSArray::kLengthOffset), | 4629 __ mov(FieldOperand(eax, JSArray::kLengthOffset), |
4628 Immediate(Smi::FromInt(0))); | 4630 Immediate(Smi::FromInt(0))); |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5649 kStackUnwindSpace, nullptr, return_value_operand, | 5651 kStackUnwindSpace, nullptr, return_value_operand, |
5650 NULL); | 5652 NULL); |
5651 } | 5653 } |
5652 | 5654 |
5653 #undef __ | 5655 #undef __ |
5654 | 5656 |
5655 } // namespace internal | 5657 } // namespace internal |
5656 } // namespace v8 | 5658 } // namespace v8 |
5657 | 5659 |
5658 #endif // V8_TARGET_ARCH_IA32 | 5660 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |