OLD | NEW |
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 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2187 // If we came here, we need to see if we are the array function. | 2187 // If we came here, we need to see if we are the array function. |
2188 // If we didn't have a matching function, and we didn't find the megamorph | 2188 // If we didn't have a matching function, and we didn't find the megamorph |
2189 // sentinel, then we have in the slot either some other function or an | 2189 // sentinel, then we have in the slot either some other function or an |
2190 // AllocationSite. Do a map check on the object in rcx. | 2190 // AllocationSite. Do a map check on the object in rcx. |
2191 Handle<Map> allocation_site_map = | 2191 Handle<Map> allocation_site_map = |
2192 masm->isolate()->factory()->allocation_site_map(); | 2192 masm->isolate()->factory()->allocation_site_map(); |
2193 __ Cmp(FieldOperand(rcx, 0), allocation_site_map); | 2193 __ Cmp(FieldOperand(rcx, 0), allocation_site_map); |
2194 __ j(not_equal, &miss); | 2194 __ j(not_equal, &miss); |
2195 | 2195 |
2196 // Make sure the function is the Array() function | 2196 // Make sure the function is the Array() function |
2197 __ LoadArrayFunction(rcx); | 2197 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, rcx); |
2198 __ cmpq(rdi, rcx); | 2198 __ cmpq(rdi, rcx); |
2199 __ j(not_equal, &megamorphic); | 2199 __ j(not_equal, &megamorphic); |
2200 __ jmp(&done); | 2200 __ jmp(&done); |
2201 | 2201 |
2202 __ bind(&miss); | 2202 __ bind(&miss); |
2203 | 2203 |
2204 // A monomorphic miss (i.e, here the cache is not uninitialized) goes | 2204 // A monomorphic miss (i.e, here the cache is not uninitialized) goes |
2205 // megamorphic. | 2205 // megamorphic. |
2206 __ Cmp(rcx, TypeFeedbackInfo::UninitializedSentinel(isolate)); | 2206 __ Cmp(rcx, TypeFeedbackInfo::UninitializedSentinel(isolate)); |
2207 __ j(equal, &initialize); | 2207 __ j(equal, &initialize); |
2208 // MegamorphicSentinel is an immortal immovable object (undefined) so no | 2208 // MegamorphicSentinel is an immortal immovable object (undefined) so no |
2209 // write-barrier is needed. | 2209 // write-barrier is needed. |
2210 __ bind(&megamorphic); | 2210 __ bind(&megamorphic); |
2211 __ Move(FieldOperand(rbx, rdx, times_pointer_size, FixedArray::kHeaderSize), | 2211 __ Move(FieldOperand(rbx, rdx, times_pointer_size, FixedArray::kHeaderSize), |
2212 TypeFeedbackInfo::MegamorphicSentinel(isolate)); | 2212 TypeFeedbackInfo::MegamorphicSentinel(isolate)); |
2213 __ jmp(&done); | 2213 __ jmp(&done); |
2214 | 2214 |
2215 // An uninitialized cache is patched with the function or sentinel to | 2215 // An uninitialized cache is patched with the function or sentinel to |
2216 // indicate the ElementsKind if function is the Array constructor. | 2216 // indicate the ElementsKind if function is the Array constructor. |
2217 __ bind(&initialize); | 2217 __ bind(&initialize); |
2218 // Make sure the function is the Array() function | 2218 // Make sure the function is the Array() function |
2219 __ LoadArrayFunction(rcx); | 2219 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, rcx); |
2220 __ cmpq(rdi, rcx); | 2220 __ cmpq(rdi, rcx); |
2221 __ j(not_equal, ¬_array_function); | 2221 __ j(not_equal, ¬_array_function); |
2222 | 2222 |
2223 // The target function is the Array constructor, | 2223 // The target function is the Array constructor, |
2224 // Create an AllocationSite if we don't already have it, store it in the slot. | 2224 // Create an AllocationSite if we don't already have it, store it in the slot. |
2225 { | 2225 { |
2226 FrameScope scope(masm, StackFrame::INTERNAL); | 2226 FrameScope scope(masm, StackFrame::INTERNAL); |
2227 | 2227 |
2228 // Arguments register must be smi-tagged to call out. | 2228 // Arguments register must be smi-tagged to call out. |
2229 __ Integer32ToSmi(rax, rax); | 2229 __ Integer32ToSmi(rax, rax); |
(...skipping 3099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5329 return_value_operand, | 5329 return_value_operand, |
5330 NULL); | 5330 NULL); |
5331 } | 5331 } |
5332 | 5332 |
5333 | 5333 |
5334 #undef __ | 5334 #undef __ |
5335 | 5335 |
5336 } } // namespace v8::internal | 5336 } } // namespace v8::internal |
5337 | 5337 |
5338 #endif // V8_TARGET_ARCH_X64 | 5338 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |