Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

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

Issue 6815029: Merge (7180:7265] from bleeding_edge to the experimental/gc branch.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | src/arm/codegen-arm.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 __ pop(r3); 84 __ pop(r3);
85 85
86 // Attempt to allocate new JSFunction in new space. 86 // Attempt to allocate new JSFunction in new space.
87 __ AllocateInNewSpace(JSFunction::kSize, 87 __ AllocateInNewSpace(JSFunction::kSize,
88 r0, 88 r0,
89 r1, 89 r1,
90 r2, 90 r2,
91 &gc, 91 &gc,
92 TAG_OBJECT); 92 TAG_OBJECT);
93 93
94 int map_index = strict_mode_ == kStrictMode
95 ? Context::STRICT_MODE_FUNCTION_MAP_INDEX
96 : Context::FUNCTION_MAP_INDEX;
97
94 // Compute the function map in the current global context and set that 98 // Compute the function map in the current global context and set that
95 // as the map of the allocated object. 99 // as the map of the allocated object.
96 __ ldr(r2, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 100 __ ldr(r2, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
97 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalContextOffset)); 101 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalContextOffset));
98 __ ldr(r2, MemOperand(r2, Context::SlotOffset(Context::FUNCTION_MAP_INDEX))); 102 __ ldr(r2, MemOperand(r2, Context::SlotOffset(map_index)));
99 __ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); 103 __ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset));
100 104
101 // Initialize the rest of the function. We don't have to update the 105 // Initialize the rest of the function. We don't have to update the
102 // write barrier because the allocated object is in new space. 106 // write barrier because the allocated object is in new space.
103 __ LoadRoot(r1, Heap::kEmptyFixedArrayRootIndex); 107 __ LoadRoot(r1, Heap::kEmptyFixedArrayRootIndex);
104 __ LoadRoot(r2, Heap::kTheHoleValueRootIndex); 108 __ LoadRoot(r2, Heap::kTheHoleValueRootIndex);
105 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex); 109 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex);
106 __ str(r1, FieldMemOperand(r0, JSObject::kPropertiesOffset)); 110 __ str(r1, FieldMemOperand(r0, JSObject::kPropertiesOffset));
107 __ str(r1, FieldMemOperand(r0, JSObject::kElementsOffset)); 111 __ str(r1, FieldMemOperand(r0, JSObject::kElementsOffset));
108 __ str(r2, FieldMemOperand(r0, JSFunction::kPrototypeOrInitialMapOffset)); 112 __ str(r2, FieldMemOperand(r0, JSFunction::kPrototypeOrInitialMapOffset));
(...skipping 4668 matching lines...) Expand 10 before | Expand all | Expand 10 after
4777 4781
4778 // Try the new space allocation. Start out with computing the size 4782 // Try the new space allocation. Start out with computing the size
4779 // of the arguments object and the elements array in words. 4783 // of the arguments object and the elements array in words.
4780 Label add_arguments_object; 4784 Label add_arguments_object;
4781 __ bind(&try_allocate); 4785 __ bind(&try_allocate);
4782 __ cmp(r1, Operand(0, RelocInfo::NONE)); 4786 __ cmp(r1, Operand(0, RelocInfo::NONE));
4783 __ b(eq, &add_arguments_object); 4787 __ b(eq, &add_arguments_object);
4784 __ mov(r1, Operand(r1, LSR, kSmiTagSize)); 4788 __ mov(r1, Operand(r1, LSR, kSmiTagSize));
4785 __ add(r1, r1, Operand(FixedArray::kHeaderSize / kPointerSize)); 4789 __ add(r1, r1, Operand(FixedArray::kHeaderSize / kPointerSize));
4786 __ bind(&add_arguments_object); 4790 __ bind(&add_arguments_object);
4787 __ add(r1, r1, Operand(Heap::kArgumentsObjectSize / kPointerSize)); 4791 __ add(r1, r1, Operand(GetArgumentsObjectSize() / kPointerSize));
4788 4792
4789 // Do the allocation of both objects in one go. 4793 // Do the allocation of both objects in one go.
4790 __ AllocateInNewSpace( 4794 __ AllocateInNewSpace(
4791 r1, 4795 r1,
4792 r0, 4796 r0,
4793 r2, 4797 r2,
4794 r3, 4798 r3,
4795 &runtime, 4799 &runtime,
4796 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS)); 4800 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS));
4797 4801
4798 // Get the arguments boilerplate from the current (global) context. 4802 // Get the arguments boilerplate from the current (global) context.
4799 int offset = Context::SlotOffset(Context::ARGUMENTS_BOILERPLATE_INDEX);
4800 __ ldr(r4, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 4803 __ ldr(r4, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
4801 __ ldr(r4, FieldMemOperand(r4, GlobalObject::kGlobalContextOffset)); 4804 __ ldr(r4, FieldMemOperand(r4, GlobalObject::kGlobalContextOffset));
4802 __ ldr(r4, MemOperand(r4, offset)); 4805 __ ldr(r4, MemOperand(r4,
4806 Context::SlotOffset(GetArgumentsBoilerplateIndex())));
4803 4807
4804 // Copy the JS object part. 4808 // Copy the JS object part.
4805 __ CopyFields(r0, r4, r3.bit(), JSObject::kHeaderSize / kPointerSize); 4809 __ CopyFields(r0, r4, r3.bit(), JSObject::kHeaderSize / kPointerSize);
4806 4810
4807 // Setup the callee in-object property. 4811 if (type_ == NEW_NON_STRICT) {
4808 STATIC_ASSERT(Heap::arguments_callee_index == 0); 4812 // Setup the callee in-object property.
4809 __ ldr(r3, MemOperand(sp, 2 * kPointerSize)); 4813 STATIC_ASSERT(Heap::kArgumentsCalleeIndex == 1);
4810 __ str(r3, FieldMemOperand(r0, JSObject::kHeaderSize)); 4814 __ ldr(r3, MemOperand(sp, 2 * kPointerSize));
4815 const int kCalleeOffset = JSObject::kHeaderSize +
4816 Heap::kArgumentsCalleeIndex * kPointerSize;
4817 __ str(r3, FieldMemOperand(r0, kCalleeOffset));
4818 }
4811 4819
4812 // Get the length (smi tagged) and set that as an in-object property too. 4820 // Get the length (smi tagged) and set that as an in-object property too.
4813 STATIC_ASSERT(Heap::arguments_length_index == 1); 4821 STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0);
4814 __ ldr(r1, MemOperand(sp, 0 * kPointerSize)); 4822 __ ldr(r1, MemOperand(sp, 0 * kPointerSize));
4815 __ str(r1, FieldMemOperand(r0, JSObject::kHeaderSize + kPointerSize)); 4823 __ str(r1, FieldMemOperand(r0, JSObject::kHeaderSize +
4824 Heap::kArgumentsLengthIndex * kPointerSize));
4816 4825
4817 // If there are no actual arguments, we're done. 4826 // If there are no actual arguments, we're done.
4818 Label done; 4827 Label done;
4819 __ cmp(r1, Operand(0, RelocInfo::NONE)); 4828 __ cmp(r1, Operand(0, RelocInfo::NONE));
4820 __ b(eq, &done); 4829 __ b(eq, &done);
4821 4830
4822 // Get the parameters pointer from the stack. 4831 // Get the parameters pointer from the stack.
4823 __ ldr(r2, MemOperand(sp, 1 * kPointerSize)); 4832 __ ldr(r2, MemOperand(sp, 1 * kPointerSize));
4824 4833
4825 // Setup the elements pointer in the allocated arguments object and 4834 // Setup the elements pointer in the allocated arguments object and
4826 // initialize the header in the elements fixed array. 4835 // initialize the header in the elements fixed array.
4827 __ add(r4, r0, Operand(Heap::kArgumentsObjectSize)); 4836 __ add(r4, r0, Operand(GetArgumentsObjectSize()));
4828 __ str(r4, FieldMemOperand(r0, JSObject::kElementsOffset)); 4837 __ str(r4, FieldMemOperand(r0, JSObject::kElementsOffset));
4829 __ LoadRoot(r3, Heap::kFixedArrayMapRootIndex); 4838 __ LoadRoot(r3, Heap::kFixedArrayMapRootIndex);
4830 __ str(r3, FieldMemOperand(r4, FixedArray::kMapOffset)); 4839 __ str(r3, FieldMemOperand(r4, FixedArray::kMapOffset));
4831 __ str(r1, FieldMemOperand(r4, FixedArray::kLengthOffset)); 4840 __ str(r1, FieldMemOperand(r4, FixedArray::kLengthOffset));
4832 __ mov(r1, Operand(r1, LSR, kSmiTagSize)); // Untag the length for the loop. 4841 __ mov(r1, Operand(r1, LSR, kSmiTagSize)); // Untag the length for the loop.
4833 4842
4834 // Copy the fixed array slots. 4843 // Copy the fixed array slots.
4835 Label loop; 4844 Label loop;
4836 // Setup r4 to point to the first array slot. 4845 // Setup r4 to point to the first array slot.
4837 __ add(r4, r4, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 4846 __ add(r4, r4, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
(...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after
6813 __ str(pc, MemOperand(sp, 0)); 6822 __ str(pc, MemOperand(sp, 0));
6814 __ Jump(target); // Call the C++ function. 6823 __ Jump(target); // Call the C++ function.
6815 } 6824 }
6816 6825
6817 6826
6818 #undef __ 6827 #undef __
6819 6828
6820 } } // namespace v8::internal 6829 } } // namespace v8::internal
6821 6830
6822 #endif // V8_TARGET_ARCH_ARM 6831 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/arm/codegen-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698