OLD | NEW |
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 3019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3030 | 3030 |
3031 // If we came here, we need to see if we are the array function. | 3031 // If we came here, we need to see if we are the array function. |
3032 // If we didn't have a matching function, and we didn't find the megamorph | 3032 // If we didn't have a matching function, and we didn't find the megamorph |
3033 // sentinel, then we have in the slot either some other function or an | 3033 // sentinel, then we have in the slot either some other function or an |
3034 // AllocationSite. Do a map check on the object in ecx. | 3034 // AllocationSite. Do a map check on the object in ecx. |
3035 __ ldr(r5, FieldMemOperand(r4, 0)); | 3035 __ ldr(r5, FieldMemOperand(r4, 0)); |
3036 __ CompareRoot(r5, Heap::kAllocationSiteMapRootIndex); | 3036 __ CompareRoot(r5, Heap::kAllocationSiteMapRootIndex); |
3037 __ b(ne, &miss); | 3037 __ b(ne, &miss); |
3038 | 3038 |
3039 // Make sure the function is the Array() function | 3039 // Make sure the function is the Array() function |
3040 __ LoadArrayFunction(r4); | 3040 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r4); |
3041 __ cmp(r1, r4); | 3041 __ cmp(r1, r4); |
3042 __ b(ne, &megamorphic); | 3042 __ b(ne, &megamorphic); |
3043 __ jmp(&done); | 3043 __ jmp(&done); |
3044 | 3044 |
3045 __ bind(&miss); | 3045 __ bind(&miss); |
3046 | 3046 |
3047 // A monomorphic miss (i.e, here the cache is not uninitialized) goes | 3047 // A monomorphic miss (i.e, here the cache is not uninitialized) goes |
3048 // megamorphic. | 3048 // megamorphic. |
3049 __ CompareRoot(r4, Heap::kTheHoleValueRootIndex); | 3049 __ CompareRoot(r4, Heap::kTheHoleValueRootIndex); |
3050 __ b(eq, &initialize); | 3050 __ b(eq, &initialize); |
3051 // MegamorphicSentinel is an immortal immovable object (undefined) so no | 3051 // MegamorphicSentinel is an immortal immovable object (undefined) so no |
3052 // write-barrier is needed. | 3052 // write-barrier is needed. |
3053 __ bind(&megamorphic); | 3053 __ bind(&megamorphic); |
3054 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); | 3054 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); |
3055 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 3055 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
3056 __ str(ip, FieldMemOperand(r4, FixedArray::kHeaderSize)); | 3056 __ str(ip, FieldMemOperand(r4, FixedArray::kHeaderSize)); |
3057 __ jmp(&done); | 3057 __ jmp(&done); |
3058 | 3058 |
3059 // An uninitialized cache is patched with the function or sentinel to | 3059 // An uninitialized cache is patched with the function or sentinel to |
3060 // indicate the ElementsKind if function is the Array constructor. | 3060 // indicate the ElementsKind if function is the Array constructor. |
3061 __ bind(&initialize); | 3061 __ bind(&initialize); |
3062 // Make sure the function is the Array() function | 3062 // Make sure the function is the Array() function |
3063 __ LoadArrayFunction(r4); | 3063 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r4); |
3064 __ cmp(r1, r4); | 3064 __ cmp(r1, r4); |
3065 __ b(ne, ¬_array_function); | 3065 __ b(ne, ¬_array_function); |
3066 | 3066 |
3067 // The target function is the Array constructor, | 3067 // The target function is the Array constructor, |
3068 // Create an AllocationSite if we don't already have it, store it in the slot. | 3068 // Create an AllocationSite if we don't already have it, store it in the slot. |
3069 { | 3069 { |
3070 FrameScope scope(masm, StackFrame::INTERNAL); | 3070 FrameScope scope(masm, StackFrame::INTERNAL); |
3071 | 3071 |
3072 // Arguments register must be smi-tagged to call out. | 3072 // Arguments register must be smi-tagged to call out. |
3073 __ SmiTag(r0); | 3073 __ SmiTag(r0); |
(...skipping 2506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5580 MemOperand(fp, 6 * kPointerSize), | 5580 MemOperand(fp, 6 * kPointerSize), |
5581 NULL); | 5581 NULL); |
5582 } | 5582 } |
5583 | 5583 |
5584 | 5584 |
5585 #undef __ | 5585 #undef __ |
5586 | 5586 |
5587 } } // namespace v8::internal | 5587 } } // namespace v8::internal |
5588 | 5588 |
5589 #endif // V8_TARGET_ARCH_ARM | 5589 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |