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 2344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2355 // Load the global or builtins object from the current context | 2355 // Load the global or builtins object from the current context |
2356 __ LoadGlobalContext(ecx); | 2356 __ LoadGlobalContext(ecx); |
2357 // Make sure the function is the Array() function | 2357 // Make sure the function is the Array() function |
2358 __ cmp(edi, Operand(ecx, | 2358 __ cmp(edi, Operand(ecx, |
2359 Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX))); | 2359 Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX))); |
2360 __ j(not_equal, &megamorphic); | 2360 __ j(not_equal, &megamorphic); |
2361 __ jmp(&done, Label::kFar); | 2361 __ jmp(&done, Label::kFar); |
2362 | 2362 |
2363 __ bind(&miss); | 2363 __ bind(&miss); |
2364 | 2364 |
2365 // A monomorphic miss (i.e, here the cache is not uninitialized or | 2365 // A monomorphic miss (i.e, here the cache is not uninitialized) goes |
2366 // pre-monomorphic) goes megamorphic. | 2366 // megamorphic. |
2367 Label not_uninitialized; | |
2368 __ cmp(ecx, Immediate(TypeFeedbackInfo::UninitializedSentinel(isolate))); | 2367 __ cmp(ecx, Immediate(TypeFeedbackInfo::UninitializedSentinel(isolate))); |
2369 __ j(not_equal, ¬_uninitialized); | |
2370 | |
2371 // PremonomorphicSentinel is an immortal immovable object (null) so no | |
2372 // write-barrier is needed. | |
2373 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, | |
2374 FixedArray::kHeaderSize), | |
2375 Immediate(TypeFeedbackInfo::PremonomorphicSentinel(isolate))); | |
2376 __ jmp(&done, Label::kFar); | |
2377 | |
2378 // If the cache isn't uninitialized, it is either premonomorphic or | |
2379 // monomorphic. If it is premonomorphic, we initialize it thus making | |
2380 // it monomorphic. Otherwise, we go megamorphic. | |
2381 __ bind(¬_uninitialized); | |
2382 __ cmp(ecx, Immediate(TypeFeedbackInfo::PremonomorphicSentinel(isolate))); | |
2383 __ j(equal, &initialize); | 2368 __ j(equal, &initialize); |
2384 | |
2385 // MegamorphicSentinel is an immortal immovable object (undefined) so no | 2369 // MegamorphicSentinel is an immortal immovable object (undefined) so no |
2386 // write-barrier is needed. | 2370 // write-barrier is needed. |
2387 __ bind(&megamorphic); | 2371 __ bind(&megamorphic); |
2388 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, | 2372 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, |
2389 FixedArray::kHeaderSize), | 2373 FixedArray::kHeaderSize), |
2390 Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); | 2374 Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); |
2391 __ jmp(&done, Label::kFar); | 2375 __ jmp(&done, Label::kFar); |
2392 | 2376 |
2393 // An uninitialized cache is patched with the function or sentinel to | 2377 // An uninitialized cache is patched with the function or sentinel to |
2394 // indicate the ElementsKind if function is the Array constructor. | 2378 // indicate the ElementsKind if function is the Array constructor. |
(...skipping 3079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5474 Operand(ebp, 7 * kPointerSize), | 5458 Operand(ebp, 7 * kPointerSize), |
5475 NULL); | 5459 NULL); |
5476 } | 5460 } |
5477 | 5461 |
5478 | 5462 |
5479 #undef __ | 5463 #undef __ |
5480 | 5464 |
5481 } } // namespace v8::internal | 5465 } } // namespace v8::internal |
5482 | 5466 |
5483 #endif // V8_TARGET_ARCH_IA32 | 5467 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |