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

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

Issue 12855004: MIPS: 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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/codegen-mips.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 4854 matching lines...) Expand 10 before | Expand all | Expand 10 after
4865 4865
4866 // 2. Backing store. 4866 // 2. Backing store.
4867 __ sll(t6, a2, 1); 4867 __ sll(t6, a2, 1);
4868 __ Addu(t5, t5, Operand(t6)); 4868 __ Addu(t5, t5, Operand(t6));
4869 __ Addu(t5, t5, Operand(FixedArray::kHeaderSize)); 4869 __ Addu(t5, t5, Operand(FixedArray::kHeaderSize));
4870 4870
4871 // 3. Arguments object. 4871 // 3. Arguments object.
4872 __ Addu(t5, t5, Operand(Heap::kArgumentsObjectSize)); 4872 __ Addu(t5, t5, Operand(Heap::kArgumentsObjectSize));
4873 4873
4874 // Do the allocation of all three objects in one go. 4874 // Do the allocation of all three objects in one go.
4875 __ AllocateInNewSpace(t5, v0, a3, t0, &runtime, TAG_OBJECT); 4875 __ Allocate(t5, v0, a3, t0, &runtime, TAG_OBJECT);
4876 4876
4877 // v0 = address of new object(s) (tagged) 4877 // v0 = address of new object(s) (tagged)
4878 // a2 = argument count (tagged) 4878 // a2 = argument count (tagged)
4879 // Get the arguments boilerplate from the current native context into t0. 4879 // Get the arguments boilerplate from the current native context into t0.
4880 const int kNormalOffset = 4880 const int kNormalOffset =
4881 Context::SlotOffset(Context::ARGUMENTS_BOILERPLATE_INDEX); 4881 Context::SlotOffset(Context::ARGUMENTS_BOILERPLATE_INDEX);
4882 const int kAliasedOffset = 4882 const int kAliasedOffset =
4883 Context::SlotOffset(Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX); 4883 Context::SlotOffset(Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX);
4884 4884
4885 __ lw(t0, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 4885 __ lw(t0, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
5056 Label add_arguments_object; 5056 Label add_arguments_object;
5057 __ bind(&try_allocate); 5057 __ bind(&try_allocate);
5058 __ Branch(&add_arguments_object, eq, a1, Operand(zero_reg)); 5058 __ Branch(&add_arguments_object, eq, a1, Operand(zero_reg));
5059 __ srl(a1, a1, kSmiTagSize); 5059 __ srl(a1, a1, kSmiTagSize);
5060 5060
5061 __ Addu(a1, a1, Operand(FixedArray::kHeaderSize / kPointerSize)); 5061 __ Addu(a1, a1, Operand(FixedArray::kHeaderSize / kPointerSize));
5062 __ bind(&add_arguments_object); 5062 __ bind(&add_arguments_object);
5063 __ Addu(a1, a1, Operand(Heap::kArgumentsObjectSizeStrict / kPointerSize)); 5063 __ Addu(a1, a1, Operand(Heap::kArgumentsObjectSizeStrict / kPointerSize));
5064 5064
5065 // Do the allocation of both objects in one go. 5065 // Do the allocation of both objects in one go.
5066 __ AllocateInNewSpace(a1, 5066 __ Allocate(a1, v0, a2, a3, &runtime,
5067 v0, 5067 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS));
5068 a2,
5069 a3,
5070 &runtime,
5071 static_cast<AllocationFlags>(TAG_OBJECT |
5072 SIZE_IN_WORDS));
5073 5068
5074 // Get the arguments boilerplate from the current native context. 5069 // Get the arguments boilerplate from the current native context.
5075 __ lw(t0, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 5070 __ lw(t0, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
5076 __ lw(t0, FieldMemOperand(t0, GlobalObject::kNativeContextOffset)); 5071 __ lw(t0, FieldMemOperand(t0, GlobalObject::kNativeContextOffset));
5077 __ lw(t0, MemOperand(t0, Context::SlotOffset( 5072 __ lw(t0, MemOperand(t0, Context::SlotOffset(
5078 Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX))); 5073 Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX)));
5079 5074
5080 // Copy the JS object part. 5075 // Copy the JS object part.
5081 __ CopyFields(v0, t0, a3.bit(), JSObject::kHeaderSize / kPointerSize); 5076 __ CopyFields(v0, t0, a3.bit(), JSObject::kHeaderSize / kPointerSize);
5082 5077
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
5582 // Smi-tagging is equivalent to multiplying by 2. 5577 // Smi-tagging is equivalent to multiplying by 2.
5583 // Allocate RegExpResult followed by FixedArray with size in ebx. 5578 // Allocate RegExpResult followed by FixedArray with size in ebx.
5584 // JSArray: [Map][empty properties][Elements][Length-smi][index][input] 5579 // JSArray: [Map][empty properties][Elements][Length-smi][index][input]
5585 // Elements: [Map][Length][..elements..] 5580 // Elements: [Map][Length][..elements..]
5586 // Size of JSArray with two in-object properties and the header of a 5581 // Size of JSArray with two in-object properties and the header of a
5587 // FixedArray. 5582 // FixedArray.
5588 int objects_size = 5583 int objects_size =
5589 (JSRegExpResult::kSize + FixedArray::kHeaderSize) / kPointerSize; 5584 (JSRegExpResult::kSize + FixedArray::kHeaderSize) / kPointerSize;
5590 __ srl(t1, a1, kSmiTagSize + kSmiShiftSize); 5585 __ srl(t1, a1, kSmiTagSize + kSmiShiftSize);
5591 __ Addu(a2, t1, Operand(objects_size)); 5586 __ Addu(a2, t1, Operand(objects_size));
5592 __ AllocateInNewSpace( 5587 __ Allocate(
5593 a2, // In: Size, in words. 5588 a2, // In: Size, in words.
5594 v0, // Out: Start of allocation (tagged). 5589 v0, // Out: Start of allocation (tagged).
5595 a3, // Scratch register. 5590 a3, // Scratch register.
5596 t0, // Scratch register. 5591 t0, // Scratch register.
5597 &slowcase, 5592 &slowcase,
5598 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS)); 5593 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS));
5599 // v0: Start of allocated area, object-tagged. 5594 // v0: Start of allocated area, object-tagged.
5600 // a1: Number of elements in array, as smi. 5595 // a1: Number of elements in array, as smi.
5601 // t1: Number of elements, untagged. 5596 // t1: Number of elements, untagged.
5602 5597
(...skipping 2600 matching lines...) Expand 10 before | Expand all | Expand 10 after
8203 __ Pop(ra, t1, a1); 8198 __ Pop(ra, t1, a1);
8204 __ Ret(); 8199 __ Ret();
8205 } 8200 }
8206 8201
8207 8202
8208 #undef __ 8203 #undef __
8209 8204
8210 } } // namespace v8::internal 8205 } } // namespace v8::internal
8211 8206
8212 #endif // V8_TARGET_ARCH_MIPS 8207 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698