OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 // | 709 // |
710 // Here we assume that if we change *p, we replace it with a heap object | 710 // Here we assume that if we change *p, we replace it with a heap object |
711 // (ie, the left substring of a cons string is always a heap object). | 711 // (ie, the left substring of a cons string is always a heap object). |
712 // | 712 // |
713 // The check performed is: | 713 // The check performed is: |
714 // object->IsConsString() && !object->IsSymbol() && | 714 // object->IsConsString() && !object->IsSymbol() && |
715 // (ConsString::cast(object)->second() == HEAP->empty_string()) | 715 // (ConsString::cast(object)->second() == HEAP->empty_string()) |
716 // except the maps for the object and its possible substrings might be | 716 // except the maps for the object and its possible substrings might be |
717 // marked. | 717 // marked. |
718 HeapObject* object = HeapObject::cast(*p); | 718 HeapObject* object = HeapObject::cast(*p); |
| 719 if (!FLAG_clever_optimizations) return object; |
719 Map* map = object->map(); | 720 Map* map = object->map(); |
720 InstanceType type = map->instance_type(); | 721 InstanceType type = map->instance_type(); |
721 if ((type & kShortcutTypeMask) != kShortcutTypeTag) return object; | 722 if ((type & kShortcutTypeMask) != kShortcutTypeTag) return object; |
722 | 723 |
723 Object* second = reinterpret_cast<ConsString*>(object)->unchecked_second(); | 724 Object* second = reinterpret_cast<ConsString*>(object)->unchecked_second(); |
724 Heap* heap = map->GetHeap(); | 725 Heap* heap = map->GetHeap(); |
725 if (second != heap->empty_string()) { | 726 if (second != heap->empty_string()) { |
726 return object; | 727 return object; |
727 } | 728 } |
728 | 729 |
(...skipping 3073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3802 while (buffer != NULL) { | 3803 while (buffer != NULL) { |
3803 SlotsBuffer* next_buffer = buffer->next(); | 3804 SlotsBuffer* next_buffer = buffer->next(); |
3804 DeallocateBuffer(buffer); | 3805 DeallocateBuffer(buffer); |
3805 buffer = next_buffer; | 3806 buffer = next_buffer; |
3806 } | 3807 } |
3807 *buffer_address = NULL; | 3808 *buffer_address = NULL; |
3808 } | 3809 } |
3809 | 3810 |
3810 | 3811 |
3811 } } // namespace v8::internal | 3812 } } // namespace v8::internal |
OLD | NEW |