| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
| (...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 // | 1199 // |
| 1200 // Here we assume that if we change *p, we replace it with a heap object | 1200 // Here we assume that if we change *p, we replace it with a heap object |
| 1201 // (i.e., the left substring of a cons string is always a heap object). | 1201 // (i.e., the left substring of a cons string is always a heap object). |
| 1202 // | 1202 // |
| 1203 // The check performed is: | 1203 // The check performed is: |
| 1204 // object->IsConsString() && !object->IsInternalizedString() && | 1204 // object->IsConsString() && !object->IsInternalizedString() && |
| 1205 // (ConsString::cast(object)->second() == HEAP->empty_string()) | 1205 // (ConsString::cast(object)->second() == HEAP->empty_string()) |
| 1206 // except the maps for the object and its possible substrings might be | 1206 // except the maps for the object and its possible substrings might be |
| 1207 // marked. | 1207 // marked. |
| 1208 HeapObject* object = HeapObject::cast(*p); | 1208 HeapObject* object = HeapObject::cast(*p); |
| 1209 if (!FLAG_clever_optimizations) return object; | |
| 1210 Map* map = object->map(); | 1209 Map* map = object->map(); |
| 1211 InstanceType type = map->instance_type(); | 1210 InstanceType type = map->instance_type(); |
| 1212 if (!IsShortcutCandidate(type)) return object; | 1211 if (!IsShortcutCandidate(type)) return object; |
| 1213 | 1212 |
| 1214 Object* second = reinterpret_cast<ConsString*>(object)->second(); | 1213 Object* second = reinterpret_cast<ConsString*>(object)->second(); |
| 1215 Heap* heap = map->GetHeap(); | 1214 Heap* heap = map->GetHeap(); |
| 1216 if (second != heap->empty_string()) { | 1215 if (second != heap->empty_string()) { |
| 1217 return object; | 1216 return object; |
| 1218 } | 1217 } |
| 1219 | 1218 |
| (...skipping 3187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4407 SlotsBuffer* buffer = *buffer_address; | 4406 SlotsBuffer* buffer = *buffer_address; |
| 4408 while (buffer != NULL) { | 4407 while (buffer != NULL) { |
| 4409 SlotsBuffer* next_buffer = buffer->next(); | 4408 SlotsBuffer* next_buffer = buffer->next(); |
| 4410 DeallocateBuffer(buffer); | 4409 DeallocateBuffer(buffer); |
| 4411 buffer = next_buffer; | 4410 buffer = next_buffer; |
| 4412 } | 4411 } |
| 4413 *buffer_address = NULL; | 4412 *buffer_address = NULL; |
| 4414 } | 4413 } |
| 4415 } | 4414 } |
| 4416 } // namespace v8::internal | 4415 } // namespace v8::internal |
| OLD | NEW |