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

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

Issue 184383003: The Array function must be looked up in the native context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove the misleading LoadGlobalContext on ia32 Created 6 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/ia32/macro-assembler-ia32.cc ('k') | src/mips/macro-assembler-mips.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 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 3166 matching lines...) Expand 10 before | Expand all | Expand 10 after
3177 3177
3178 // If we came here, we need to see if we are the array function. 3178 // If we came here, we need to see if we are the array function.
3179 // If we didn't have a matching function, and we didn't find the megamorph 3179 // If we didn't have a matching function, and we didn't find the megamorph
3180 // sentinel, then we have in the slot either some other function or an 3180 // sentinel, then we have in the slot either some other function or an
3181 // AllocationSite. Do a map check on the object in a3. 3181 // AllocationSite. Do a map check on the object in a3.
3182 __ lw(t1, FieldMemOperand(t0, 0)); 3182 __ lw(t1, FieldMemOperand(t0, 0));
3183 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); 3183 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex);
3184 __ Branch(&miss, ne, t1, Operand(at)); 3184 __ Branch(&miss, ne, t1, Operand(at));
3185 3185
3186 // Make sure the function is the Array() function 3186 // Make sure the function is the Array() function
3187 __ LoadArrayFunction(t0); 3187 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, t0);
3188 __ Branch(&megamorphic, ne, a1, Operand(t0)); 3188 __ Branch(&megamorphic, ne, a1, Operand(t0));
3189 __ jmp(&done); 3189 __ jmp(&done);
3190 3190
3191 __ bind(&miss); 3191 __ bind(&miss);
3192 3192
3193 // A monomorphic miss (i.e, here the cache is not uninitialized) goes 3193 // A monomorphic miss (i.e, here the cache is not uninitialized) goes
3194 // megamorphic. 3194 // megamorphic.
3195 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 3195 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
3196 __ Branch(&initialize, eq, t0, Operand(at)); 3196 __ Branch(&initialize, eq, t0, Operand(at));
3197 // MegamorphicSentinel is an immortal immovable object (undefined) so no 3197 // MegamorphicSentinel is an immortal immovable object (undefined) so no
3198 // write-barrier is needed. 3198 // write-barrier is needed.
3199 __ bind(&megamorphic); 3199 __ bind(&megamorphic);
3200 __ sll(t0, a3, kPointerSizeLog2 - kSmiTagSize); 3200 __ sll(t0, a3, kPointerSizeLog2 - kSmiTagSize);
3201 __ Addu(t0, a2, Operand(t0)); 3201 __ Addu(t0, a2, Operand(t0));
3202 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); 3202 __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
3203 __ sw(at, FieldMemOperand(t0, FixedArray::kHeaderSize)); 3203 __ sw(at, FieldMemOperand(t0, FixedArray::kHeaderSize));
3204 __ jmp(&done); 3204 __ jmp(&done);
3205 3205
3206 // An uninitialized cache is patched with the function or sentinel to 3206 // An uninitialized cache is patched with the function or sentinel to
3207 // indicate the ElementsKind if function is the Array constructor. 3207 // indicate the ElementsKind if function is the Array constructor.
3208 __ bind(&initialize); 3208 __ bind(&initialize);
3209 // Make sure the function is the Array() function 3209 // Make sure the function is the Array() function
3210 __ LoadArrayFunction(t0); 3210 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, t0);
3211 __ Branch(&not_array_function, ne, a1, Operand(t0)); 3211 __ Branch(&not_array_function, ne, a1, Operand(t0));
3212 3212
3213 // The target function is the Array constructor. 3213 // The target function is the Array constructor.
3214 // Create an AllocationSite if we don't already have it, store it in the slot. 3214 // Create an AllocationSite if we don't already have it, store it in the slot.
3215 { 3215 {
3216 FrameScope scope(masm, StackFrame::INTERNAL); 3216 FrameScope scope(masm, StackFrame::INTERNAL);
3217 const RegList kSavedRegs = 3217 const RegList kSavedRegs =
3218 1 << 4 | // a0 3218 1 << 4 | // a0
3219 1 << 5 | // a1 3219 1 << 5 | // a1
3220 1 << 6 | // a2 3220 1 << 6 | // a2
(...skipping 2539 matching lines...) Expand 10 before | Expand all | Expand 10 after
5760 MemOperand(fp, 6 * kPointerSize), 5760 MemOperand(fp, 6 * kPointerSize),
5761 NULL); 5761 NULL);
5762 } 5762 }
5763 5763
5764 5764
5765 #undef __ 5765 #undef __
5766 5766
5767 } } // namespace v8::internal 5767 } } // namespace v8::internal
5768 5768
5769 #endif // V8_TARGET_ARCH_MIPS 5769 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698