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_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 __ Allocate(ebx, eax, edi, no_reg, &runtime, TAG_OBJECT); | 587 __ Allocate(ebx, eax, edi, no_reg, &runtime, TAG_OBJECT); |
588 | 588 |
589 // eax = address of new object(s) (tagged) | 589 // eax = address of new object(s) (tagged) |
590 // ecx = argument count (smi-tagged) | 590 // ecx = argument count (smi-tagged) |
591 // esp[0] = mapped parameter count (tagged) | 591 // esp[0] = mapped parameter count (tagged) |
592 // esp[4] = function | 592 // esp[4] = function |
593 // esp[8] = parameter count (tagged) | 593 // esp[8] = parameter count (tagged) |
594 // Get the arguments map from the current native context into edi. | 594 // Get the arguments map from the current native context into edi. |
595 Label has_mapped_parameters, instantiate; | 595 Label has_mapped_parameters, instantiate; |
596 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 596 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
597 __ mov(edi, FieldOperand(edi, GlobalObject::kNativeContextOffset)); | 597 __ mov(edi, FieldOperand(edi, JSGlobalObject::kNativeContextOffset)); |
598 __ mov(ebx, Operand(esp, 0 * kPointerSize)); | 598 __ mov(ebx, Operand(esp, 0 * kPointerSize)); |
599 __ test(ebx, ebx); | 599 __ test(ebx, ebx); |
600 __ j(not_zero, &has_mapped_parameters, Label::kNear); | 600 __ j(not_zero, &has_mapped_parameters, Label::kNear); |
601 __ mov( | 601 __ mov( |
602 edi, | 602 edi, |
603 Operand(edi, Context::SlotOffset(Context::SLOPPY_ARGUMENTS_MAP_INDEX))); | 603 Operand(edi, Context::SlotOffset(Context::SLOPPY_ARGUMENTS_MAP_INDEX))); |
604 __ jmp(&instantiate, Label::kNear); | 604 __ jmp(&instantiate, Label::kNear); |
605 | 605 |
606 __ bind(&has_mapped_parameters); | 606 __ bind(&has_mapped_parameters); |
607 __ mov(edi, Operand(edi, Context::SlotOffset( | 607 __ mov(edi, Operand(edi, Context::SlotOffset( |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 __ j(zero, &add_arguments_object, Label::kNear); | 791 __ j(zero, &add_arguments_object, Label::kNear); |
792 __ lea(eax, Operand(eax, times_2, FixedArray::kHeaderSize)); | 792 __ lea(eax, Operand(eax, times_2, FixedArray::kHeaderSize)); |
793 __ bind(&add_arguments_object); | 793 __ bind(&add_arguments_object); |
794 __ add(eax, Immediate(Heap::kStrictArgumentsObjectSize)); | 794 __ add(eax, Immediate(Heap::kStrictArgumentsObjectSize)); |
795 | 795 |
796 // Do the allocation of both objects in one go. | 796 // Do the allocation of both objects in one go. |
797 __ Allocate(eax, eax, ebx, no_reg, &runtime, TAG_OBJECT); | 797 __ Allocate(eax, eax, ebx, no_reg, &runtime, TAG_OBJECT); |
798 | 798 |
799 // Get the arguments map from the current native context. | 799 // Get the arguments map from the current native context. |
800 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 800 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
801 __ mov(edi, FieldOperand(edi, GlobalObject::kNativeContextOffset)); | 801 __ mov(edi, FieldOperand(edi, JSGlobalObject::kNativeContextOffset)); |
802 const int offset = Context::SlotOffset(Context::STRICT_ARGUMENTS_MAP_INDEX); | 802 const int offset = Context::SlotOffset(Context::STRICT_ARGUMENTS_MAP_INDEX); |
803 __ mov(edi, Operand(edi, offset)); | 803 __ mov(edi, Operand(edi, offset)); |
804 | 804 |
805 __ mov(FieldOperand(eax, JSObject::kMapOffset), edi); | 805 __ mov(FieldOperand(eax, JSObject::kMapOffset), edi); |
806 __ mov(FieldOperand(eax, JSObject::kPropertiesOffset), | 806 __ mov(FieldOperand(eax, JSObject::kPropertiesOffset), |
807 masm->isolate()->factory()->empty_fixed_array()); | 807 masm->isolate()->factory()->empty_fixed_array()); |
808 __ mov(FieldOperand(eax, JSObject::kElementsOffset), | 808 __ mov(FieldOperand(eax, JSObject::kElementsOffset), |
809 masm->isolate()->factory()->empty_fixed_array()); | 809 masm->isolate()->factory()->empty_fixed_array()); |
810 | 810 |
811 // Get the length (smi tagged) and set that as an in-object property too. | 811 // Get the length (smi tagged) and set that as an in-object property too. |
(...skipping 4736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5548 Operand(ebp, 7 * kPointerSize), NULL); | 5548 Operand(ebp, 7 * kPointerSize), NULL); |
5549 } | 5549 } |
5550 | 5550 |
5551 | 5551 |
5552 #undef __ | 5552 #undef __ |
5553 | 5553 |
5554 } // namespace internal | 5554 } // namespace internal |
5555 } // namespace v8 | 5555 } // namespace v8 |
5556 | 5556 |
5557 #endif // V8_TARGET_ARCH_X87 | 5557 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |