| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 4773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4784 __ add(r9, r9, Operand(kParameterMapHeaderSize), LeaveCC, ne); | 4784 __ add(r9, r9, Operand(kParameterMapHeaderSize), LeaveCC, ne); |
| 4785 | 4785 |
| 4786 // 2. Backing store. | 4786 // 2. Backing store. |
| 4787 __ add(r9, r9, Operand(r2, LSL, 1)); | 4787 __ add(r9, r9, Operand(r2, LSL, 1)); |
| 4788 __ add(r9, r9, Operand(FixedArray::kHeaderSize)); | 4788 __ add(r9, r9, Operand(FixedArray::kHeaderSize)); |
| 4789 | 4789 |
| 4790 // 3. Arguments object. | 4790 // 3. Arguments object. |
| 4791 __ add(r9, r9, Operand(Heap::kArgumentsObjectSize)); | 4791 __ add(r9, r9, Operand(Heap::kArgumentsObjectSize)); |
| 4792 | 4792 |
| 4793 // Do the allocation of all three objects in one go. | 4793 // Do the allocation of all three objects in one go. |
| 4794 __ AllocateInNewSpace(r9, r0, r3, r4, &runtime, TAG_OBJECT); | 4794 __ Allocate(r9, r0, r3, r4, &runtime, TAG_OBJECT); |
| 4795 | 4795 |
| 4796 // r0 = address of new object(s) (tagged) | 4796 // r0 = address of new object(s) (tagged) |
| 4797 // r2 = argument count (tagged) | 4797 // r2 = argument count (tagged) |
| 4798 // Get the arguments boilerplate from the current native context into r4. | 4798 // Get the arguments boilerplate from the current native context into r4. |
| 4799 const int kNormalOffset = | 4799 const int kNormalOffset = |
| 4800 Context::SlotOffset(Context::ARGUMENTS_BOILERPLATE_INDEX); | 4800 Context::SlotOffset(Context::ARGUMENTS_BOILERPLATE_INDEX); |
| 4801 const int kAliasedOffset = | 4801 const int kAliasedOffset = |
| 4802 Context::SlotOffset(Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX); | 4802 Context::SlotOffset(Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX); |
| 4803 | 4803 |
| 4804 __ ldr(r4, MemOperand(r8, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 4804 __ ldr(r4, MemOperand(r8, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4960 Label add_arguments_object; | 4960 Label add_arguments_object; |
| 4961 __ bind(&try_allocate); | 4961 __ bind(&try_allocate); |
| 4962 __ cmp(r1, Operand::Zero()); | 4962 __ cmp(r1, Operand::Zero()); |
| 4963 __ b(eq, &add_arguments_object); | 4963 __ b(eq, &add_arguments_object); |
| 4964 __ mov(r1, Operand(r1, LSR, kSmiTagSize)); | 4964 __ mov(r1, Operand(r1, LSR, kSmiTagSize)); |
| 4965 __ add(r1, r1, Operand(FixedArray::kHeaderSize / kPointerSize)); | 4965 __ add(r1, r1, Operand(FixedArray::kHeaderSize / kPointerSize)); |
| 4966 __ bind(&add_arguments_object); | 4966 __ bind(&add_arguments_object); |
| 4967 __ add(r1, r1, Operand(Heap::kArgumentsObjectSizeStrict / kPointerSize)); | 4967 __ add(r1, r1, Operand(Heap::kArgumentsObjectSizeStrict / kPointerSize)); |
| 4968 | 4968 |
| 4969 // Do the allocation of both objects in one go. | 4969 // Do the allocation of both objects in one go. |
| 4970 __ AllocateInNewSpace(r1, | 4970 __ Allocate(r1, r0, r2, r3, &runtime, |
| 4971 r0, | 4971 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS)); |
| 4972 r2, | |
| 4973 r3, | |
| 4974 &runtime, | |
| 4975 static_cast<AllocationFlags>(TAG_OBJECT | | |
| 4976 SIZE_IN_WORDS)); | |
| 4977 | 4972 |
| 4978 // Get the arguments boilerplate from the current native context. | 4973 // Get the arguments boilerplate from the current native context. |
| 4979 __ ldr(r4, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 4974 __ ldr(r4, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
| 4980 __ ldr(r4, FieldMemOperand(r4, GlobalObject::kNativeContextOffset)); | 4975 __ ldr(r4, FieldMemOperand(r4, GlobalObject::kNativeContextOffset)); |
| 4981 __ ldr(r4, MemOperand(r4, Context::SlotOffset( | 4976 __ ldr(r4, MemOperand(r4, Context::SlotOffset( |
| 4982 Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX))); | 4977 Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX))); |
| 4983 | 4978 |
| 4984 // Copy the JS object part. | 4979 // Copy the JS object part. |
| 4985 __ CopyFields(r0, r4, r3.bit(), JSObject::kHeaderSize / kPointerSize); | 4980 __ CopyFields(r0, r4, r3.bit(), JSObject::kHeaderSize / kPointerSize); |
| 4986 | 4981 |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5470 // Smi-tagging is equivalent to multiplying by 2. | 5465 // Smi-tagging is equivalent to multiplying by 2. |
| 5471 // Allocate RegExpResult followed by FixedArray with size in ebx. | 5466 // Allocate RegExpResult followed by FixedArray with size in ebx. |
| 5472 // JSArray: [Map][empty properties][Elements][Length-smi][index][input] | 5467 // JSArray: [Map][empty properties][Elements][Length-smi][index][input] |
| 5473 // Elements: [Map][Length][..elements..] | 5468 // Elements: [Map][Length][..elements..] |
| 5474 // Size of JSArray with two in-object properties and the header of a | 5469 // Size of JSArray with two in-object properties and the header of a |
| 5475 // FixedArray. | 5470 // FixedArray. |
| 5476 int objects_size = | 5471 int objects_size = |
| 5477 (JSRegExpResult::kSize + FixedArray::kHeaderSize) / kPointerSize; | 5472 (JSRegExpResult::kSize + FixedArray::kHeaderSize) / kPointerSize; |
| 5478 __ mov(r5, Operand(r1, LSR, kSmiTagSize + kSmiShiftSize)); | 5473 __ mov(r5, Operand(r1, LSR, kSmiTagSize + kSmiShiftSize)); |
| 5479 __ add(r2, r5, Operand(objects_size)); | 5474 __ add(r2, r5, Operand(objects_size)); |
| 5480 __ AllocateInNewSpace( | 5475 __ Allocate( |
| 5481 r2, // In: Size, in words. | 5476 r2, // In: Size, in words. |
| 5482 r0, // Out: Start of allocation (tagged). | 5477 r0, // Out: Start of allocation (tagged). |
| 5483 r3, // Scratch register. | 5478 r3, // Scratch register. |
| 5484 r4, // Scratch register. | 5479 r4, // Scratch register. |
| 5485 &slowcase, | 5480 &slowcase, |
| 5486 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS)); | 5481 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS)); |
| 5487 // r0: Start of allocated area, object-tagged. | 5482 // r0: Start of allocated area, object-tagged. |
| 5488 // r1: Number of elements in array, as smi. | 5483 // r1: Number of elements in array, as smi. |
| 5489 // r5: Number of elements, untagged. | 5484 // r5: Number of elements, untagged. |
| 5490 | 5485 |
| (...skipping 2571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8062 | 8057 |
| 8063 __ Pop(lr, r5, r1); | 8058 __ Pop(lr, r5, r1); |
| 8064 __ Ret(); | 8059 __ Ret(); |
| 8065 } | 8060 } |
| 8066 | 8061 |
| 8067 #undef __ | 8062 #undef __ |
| 8068 | 8063 |
| 8069 } } // namespace v8::internal | 8064 } } // namespace v8::internal |
| 8070 | 8065 |
| 8071 #endif // V8_TARGET_ARCH_ARM | 8066 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |