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

Side by Side Diff: src/a64/code-stubs-a64.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 | « no previous file | src/a64/macro-assembler-a64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 3272 matching lines...) Expand 10 before | Expand all | Expand 10 after
3283 __ B(eq, &done); 3283 __ B(eq, &done);
3284 3284
3285 // If we came here, we need to see if we are the array function. 3285 // If we came here, we need to see if we are the array function.
3286 // If we didn't have a matching function, and we didn't find the megamorph 3286 // If we didn't have a matching function, and we didn't find the megamorph
3287 // sentinel, then we have in the slot either some other function or an 3287 // sentinel, then we have in the slot either some other function or an
3288 // AllocationSite. Do a map check on the object in ecx. 3288 // AllocationSite. Do a map check on the object in ecx.
3289 __ Ldr(x5, FieldMemOperand(x4, AllocationSite::kMapOffset)); 3289 __ Ldr(x5, FieldMemOperand(x4, AllocationSite::kMapOffset));
3290 __ JumpIfNotRoot(x5, Heap::kAllocationSiteMapRootIndex, &miss); 3290 __ JumpIfNotRoot(x5, Heap::kAllocationSiteMapRootIndex, &miss);
3291 3291
3292 // Make sure the function is the Array() function 3292 // Make sure the function is the Array() function
3293 __ LoadArrayFunction(x4); 3293 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, x4);
3294 __ Cmp(x1, x4); 3294 __ Cmp(x1, x4);
3295 __ B(ne, &megamorphic); 3295 __ B(ne, &megamorphic);
3296 __ B(&done); 3296 __ B(&done);
3297 3297
3298 __ Bind(&miss); 3298 __ Bind(&miss);
3299 3299
3300 // A monomorphic miss (i.e, here the cache is not uninitialized) goes 3300 // A monomorphic miss (i.e, here the cache is not uninitialized) goes
3301 // megamorphic. 3301 // megamorphic.
3302 __ JumpIfRoot(x4, Heap::kTheHoleValueRootIndex, &initialize); 3302 __ JumpIfRoot(x4, Heap::kTheHoleValueRootIndex, &initialize);
3303 // MegamorphicSentinel is an immortal immovable object (undefined) so no 3303 // MegamorphicSentinel is an immortal immovable object (undefined) so no
3304 // write-barrier is needed. 3304 // write-barrier is needed.
3305 __ Bind(&megamorphic); 3305 __ Bind(&megamorphic);
3306 __ Add(x4, x2, Operand::UntagSmiAndScale(x3, kPointerSizeLog2)); 3306 __ Add(x4, x2, Operand::UntagSmiAndScale(x3, kPointerSizeLog2));
3307 __ LoadRoot(x10, Heap::kUndefinedValueRootIndex); 3307 __ LoadRoot(x10, Heap::kUndefinedValueRootIndex);
3308 __ Str(x10, FieldMemOperand(x4, FixedArray::kHeaderSize)); 3308 __ Str(x10, FieldMemOperand(x4, FixedArray::kHeaderSize));
3309 __ B(&done); 3309 __ B(&done);
3310 3310
3311 // An uninitialized cache is patched with the function or sentinel to 3311 // An uninitialized cache is patched with the function or sentinel to
3312 // indicate the ElementsKind if function is the Array constructor. 3312 // indicate the ElementsKind if function is the Array constructor.
3313 __ Bind(&initialize); 3313 __ Bind(&initialize);
3314 // Make sure the function is the Array() function 3314 // Make sure the function is the Array() function
3315 __ LoadArrayFunction(x4); 3315 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, x4);
3316 __ Cmp(x1, x4); 3316 __ Cmp(x1, x4);
3317 __ B(ne, &not_array_function); 3317 __ B(ne, &not_array_function);
3318 3318
3319 // The target function is the Array constructor, 3319 // The target function is the Array constructor,
3320 // Create an AllocationSite if we don't already have it, store it in the slot. 3320 // Create an AllocationSite if we don't already have it, store it in the slot.
3321 { 3321 {
3322 FrameScope scope(masm, StackFrame::INTERNAL); 3322 FrameScope scope(masm, StackFrame::INTERNAL);
3323 CreateAllocationSiteStub create_stub; 3323 CreateAllocationSiteStub create_stub;
3324 3324
3325 // Arguments register must be smi-tagged to call out. 3325 // Arguments register must be smi-tagged to call out.
(...skipping 2470 matching lines...) Expand 10 before | Expand all | Expand 10 after
5796 MemOperand(fp, 6 * kPointerSize), 5796 MemOperand(fp, 6 * kPointerSize),
5797 NULL); 5797 NULL);
5798 } 5798 }
5799 5799
5800 5800
5801 #undef __ 5801 #undef __
5802 5802
5803 } } // namespace v8::internal 5803 } } // namespace v8::internal
5804 5804
5805 #endif // V8_TARGET_ARCH_A64 5805 #endif // V8_TARGET_ARCH_A64
OLDNEW
« no previous file with comments | « no previous file | src/a64/macro-assembler-a64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698