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) goes | 2365 // A monomorphic miss (i.e, here the cache is not uninitialized or |
2366 // megamorphic. | 2366 // pre-monomorphic) goes megamorphic. |
| 2367 Label not_uninitialized; |
2367 __ cmp(ecx, Immediate(TypeFeedbackInfo::UninitializedSentinel(isolate))); | 2368 __ 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))); |
2368 __ j(equal, &initialize); | 2383 __ j(equal, &initialize); |
| 2384 |
2369 // MegamorphicSentinel is an immortal immovable object (undefined) so no | 2385 // MegamorphicSentinel is an immortal immovable object (undefined) so no |
2370 // write-barrier is needed. | 2386 // write-barrier is needed. |
2371 __ bind(&megamorphic); | 2387 __ bind(&megamorphic); |
2372 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, | 2388 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, |
2373 FixedArray::kHeaderSize), | 2389 FixedArray::kHeaderSize), |
2374 Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); | 2390 Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); |
2375 __ jmp(&done, Label::kFar); | 2391 __ jmp(&done, Label::kFar); |
2376 | 2392 |
2377 // An uninitialized cache is patched with the function or sentinel to | 2393 // An uninitialized cache is patched with the function or sentinel to |
2378 // indicate the ElementsKind if function is the Array constructor. | 2394 // indicate the ElementsKind if function is the Array constructor. |
(...skipping 3074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5453 Operand(ebp, 7 * kPointerSize), | 5469 Operand(ebp, 7 * kPointerSize), |
5454 NULL); | 5470 NULL); |
5455 } | 5471 } |
5456 | 5472 |
5457 | 5473 |
5458 #undef __ | 5474 #undef __ |
5459 | 5475 |
5460 } } // namespace v8::internal | 5476 } } // namespace v8::internal |
5461 | 5477 |
5462 #endif // V8_TARGET_ARCH_IA32 | 5478 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |