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 3567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3578 | 3578 |
3579 // For all objects but the receiver, check that the cache is empty. | 3579 // For all objects but the receiver, check that the cache is empty. |
3580 EnumLength(edx, ebx); | 3580 EnumLength(edx, ebx); |
3581 cmp(edx, Immediate(Smi::FromInt(0))); | 3581 cmp(edx, Immediate(Smi::FromInt(0))); |
3582 j(not_equal, call_runtime); | 3582 j(not_equal, call_runtime); |
3583 | 3583 |
3584 bind(&start); | 3584 bind(&start); |
3585 | 3585 |
3586 // Check that there are no elements. Register rcx contains the current JS | 3586 // Check that there are no elements. Register rcx contains the current JS |
3587 // object we've reached through the prototype chain. | 3587 // object we've reached through the prototype chain. |
| 3588 Label no_elements; |
3588 mov(ecx, FieldOperand(ecx, JSObject::kElementsOffset)); | 3589 mov(ecx, FieldOperand(ecx, JSObject::kElementsOffset)); |
3589 cmp(ecx, isolate()->factory()->empty_fixed_array()); | 3590 cmp(ecx, isolate()->factory()->empty_fixed_array()); |
| 3591 j(equal, &no_elements); |
| 3592 |
| 3593 // Second chance, the object may be using the empty slow element dictionary. |
| 3594 cmp(ecx, isolate()->factory()->empty_slow_element_dictionary()); |
3590 j(not_equal, call_runtime); | 3595 j(not_equal, call_runtime); |
3591 | 3596 |
| 3597 bind(&no_elements); |
3592 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); | 3598 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); |
3593 cmp(ecx, isolate()->factory()->null_value()); | 3599 cmp(ecx, isolate()->factory()->null_value()); |
3594 j(not_equal, &next); | 3600 j(not_equal, &next); |
3595 } | 3601 } |
3596 | 3602 |
3597 | 3603 |
3598 void MacroAssembler::TestJSArrayForAllocationMemento( | 3604 void MacroAssembler::TestJSArrayForAllocationMemento( |
3599 Register receiver_reg, | 3605 Register receiver_reg, |
3600 Register scratch_reg, | 3606 Register scratch_reg, |
3601 Label* no_memento_found) { | 3607 Label* no_memento_found) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3637 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); | 3643 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); |
3638 j(equal, found); | 3644 j(equal, found); |
3639 mov(current, FieldOperand(current, Map::kPrototypeOffset)); | 3645 mov(current, FieldOperand(current, Map::kPrototypeOffset)); |
3640 cmp(current, Immediate(factory->null_value())); | 3646 cmp(current, Immediate(factory->null_value())); |
3641 j(not_equal, &loop_again); | 3647 j(not_equal, &loop_again); |
3642 } | 3648 } |
3643 | 3649 |
3644 } } // namespace v8::internal | 3650 } } // namespace v8::internal |
3645 | 3651 |
3646 #endif // V8_TARGET_ARCH_IA32 | 3652 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |