Chromium Code Reviews

Side by Side Diff: src/arm/code-stubs-arm.cc

Issue 12440041: Generalizing remaining Allocate functions in the macro assemblers used in pretenuring. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/arm/codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4762 matching lines...)
4773 __ add(r9, r9, Operand(kParameterMapHeaderSize), LeaveCC, ne); 4773 __ add(r9, r9, Operand(kParameterMapHeaderSize), LeaveCC, ne);
4774 4774
4775 // 2. Backing store. 4775 // 2. Backing store.
4776 __ add(r9, r9, Operand(r2, LSL, 1)); 4776 __ add(r9, r9, Operand(r2, LSL, 1));
4777 __ add(r9, r9, Operand(FixedArray::kHeaderSize)); 4777 __ add(r9, r9, Operand(FixedArray::kHeaderSize));
4778 4778
4779 // 3. Arguments object. 4779 // 3. Arguments object.
4780 __ add(r9, r9, Operand(Heap::kArgumentsObjectSize)); 4780 __ add(r9, r9, Operand(Heap::kArgumentsObjectSize));
4781 4781
4782 // Do the allocation of all three objects in one go. 4782 // Do the allocation of all three objects in one go.
4783 __ AllocateInNewSpace(r9, r0, r3, r4, &runtime, TAG_OBJECT); 4783 __ Allocate(r9, r0, r3, r4, &runtime, TAG_OBJECT);
4784 4784
4785 // r0 = address of new object(s) (tagged) 4785 // r0 = address of new object(s) (tagged)
4786 // r2 = argument count (tagged) 4786 // r2 = argument count (tagged)
4787 // Get the arguments boilerplate from the current native context into r4. 4787 // Get the arguments boilerplate from the current native context into r4.
4788 const int kNormalOffset = 4788 const int kNormalOffset =
4789 Context::SlotOffset(Context::ARGUMENTS_BOILERPLATE_INDEX); 4789 Context::SlotOffset(Context::ARGUMENTS_BOILERPLATE_INDEX);
4790 const int kAliasedOffset = 4790 const int kAliasedOffset =
4791 Context::SlotOffset(Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX); 4791 Context::SlotOffset(Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX);
4792 4792
4793 __ ldr(r4, MemOperand(r8, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 4793 __ ldr(r4, MemOperand(r8, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
(...skipping 155 matching lines...)
4949 Label add_arguments_object; 4949 Label add_arguments_object;
4950 __ bind(&try_allocate); 4950 __ bind(&try_allocate);
4951 __ cmp(r1, Operand::Zero()); 4951 __ cmp(r1, Operand::Zero());
4952 __ b(eq, &add_arguments_object); 4952 __ b(eq, &add_arguments_object);
4953 __ mov(r1, Operand(r1, LSR, kSmiTagSize)); 4953 __ mov(r1, Operand(r1, LSR, kSmiTagSize));
4954 __ add(r1, r1, Operand(FixedArray::kHeaderSize / kPointerSize)); 4954 __ add(r1, r1, Operand(FixedArray::kHeaderSize / kPointerSize));
4955 __ bind(&add_arguments_object); 4955 __ bind(&add_arguments_object);
4956 __ add(r1, r1, Operand(Heap::kArgumentsObjectSizeStrict / kPointerSize)); 4956 __ add(r1, r1, Operand(Heap::kArgumentsObjectSizeStrict / kPointerSize));
4957 4957
4958 // Do the allocation of both objects in one go. 4958 // Do the allocation of both objects in one go.
4959 __ AllocateInNewSpace(r1, 4959 __ Allocate(r1,
danno 2013/03/20 22:11:09 nit: can you fix the formatting while you are here
Hannes Payer (out of office) 2013/03/25 16:04:25 Done.
4960 r0, 4960 r0,
4961 r2, 4961 r2,
4962 r3, 4962 r3,
4963 &runtime, 4963 &runtime,
4964 static_cast<AllocationFlags>(TAG_OBJECT | 4964 static_cast<AllocationFlags>(TAG_OBJECT |
4965 SIZE_IN_WORDS)); 4965 SIZE_IN_WORDS));
danno 2013/03/20 22:11:09 Fits on one line
Hannes Payer (out of office) 2013/03/25 16:04:25 Done.
4966 4966
4967 // Get the arguments boilerplate from the current native context. 4967 // Get the arguments boilerplate from the current native context.
4968 __ ldr(r4, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 4968 __ ldr(r4, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
4969 __ ldr(r4, FieldMemOperand(r4, GlobalObject::kNativeContextOffset)); 4969 __ ldr(r4, FieldMemOperand(r4, GlobalObject::kNativeContextOffset));
4970 __ ldr(r4, MemOperand(r4, Context::SlotOffset( 4970 __ ldr(r4, MemOperand(r4, Context::SlotOffset(
4971 Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX))); 4971 Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX)));
4972 4972
4973 // Copy the JS object part. 4973 // Copy the JS object part.
4974 __ CopyFields(r0, r4, r3.bit(), JSObject::kHeaderSize / kPointerSize); 4974 __ CopyFields(r0, r4, r3.bit(), JSObject::kHeaderSize / kPointerSize);
4975 4975
(...skipping 483 matching lines...)
5459 // Smi-tagging is equivalent to multiplying by 2. 5459 // Smi-tagging is equivalent to multiplying by 2.
5460 // Allocate RegExpResult followed by FixedArray with size in ebx. 5460 // Allocate RegExpResult followed by FixedArray with size in ebx.
5461 // JSArray: [Map][empty properties][Elements][Length-smi][index][input] 5461 // JSArray: [Map][empty properties][Elements][Length-smi][index][input]
5462 // Elements: [Map][Length][..elements..] 5462 // Elements: [Map][Length][..elements..]
5463 // Size of JSArray with two in-object properties and the header of a 5463 // Size of JSArray with two in-object properties and the header of a
5464 // FixedArray. 5464 // FixedArray.
5465 int objects_size = 5465 int objects_size =
5466 (JSRegExpResult::kSize + FixedArray::kHeaderSize) / kPointerSize; 5466 (JSRegExpResult::kSize + FixedArray::kHeaderSize) / kPointerSize;
5467 __ mov(r5, Operand(r1, LSR, kSmiTagSize + kSmiShiftSize)); 5467 __ mov(r5, Operand(r1, LSR, kSmiTagSize + kSmiShiftSize));
5468 __ add(r2, r5, Operand(objects_size)); 5468 __ add(r2, r5, Operand(objects_size));
5469 __ AllocateInNewSpace( 5469 __ Allocate(
5470 r2, // In: Size, in words. 5470 r2, // In: Size, in words.
5471 r0, // Out: Start of allocation (tagged). 5471 r0, // Out: Start of allocation (tagged).
5472 r3, // Scratch register. 5472 r3, // Scratch register.
5473 r4, // Scratch register. 5473 r4, // Scratch register.
5474 &slowcase, 5474 &slowcase,
5475 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS)); 5475 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS));
5476 // r0: Start of allocated area, object-tagged. 5476 // r0: Start of allocated area, object-tagged.
5477 // r1: Number of elements in array, as smi. 5477 // r1: Number of elements in array, as smi.
5478 // r5: Number of elements, untagged. 5478 // r5: Number of elements, untagged.
5479 5479
(...skipping 2571 matching lines...)
8051 8051
8052 __ Pop(lr, r5, r1); 8052 __ Pop(lr, r5, r1);
8053 __ Ret(); 8053 __ Ret();
8054 } 8054 }
8055 8055
8056 #undef __ 8056 #undef __
8057 8057
8058 } } // namespace v8::internal 8058 } } // namespace v8::internal
8059 8059
8060 #endif // V8_TARGET_ARCH_ARM 8060 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/arm/codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine