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/heap/heap.h" | 5 #include "src/heap/heap.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1486 | 1486 |
1487 | 1487 |
1488 static bool IsUnscavengedHeapObject(Heap* heap, Object** p) { | 1488 static bool IsUnscavengedHeapObject(Heap* heap, Object** p) { |
1489 return heap->InNewSpace(*p) && | 1489 return heap->InNewSpace(*p) && |
1490 !HeapObject::cast(*p)->map_word().IsForwardingAddress(); | 1490 !HeapObject::cast(*p)->map_word().IsForwardingAddress(); |
1491 } | 1491 } |
1492 | 1492 |
1493 | 1493 |
1494 static bool IsUnmodifiedHeapObject(Object** p) { | 1494 static bool IsUnmodifiedHeapObject(Object** p) { |
1495 Object* object = *p; | 1495 Object* object = *p; |
1496 if (object->IsSmi()) return true; | |
mythria
2015/12/02 09:45:49
I thought we can collect all Smi objects. If you t
mythria
2015/12/02 09:45:49
I am a little surprised that we have Smi objects t
jochen (gone - plz use gerrit)
2015/12/02 09:48:28
actually, I think we should return false for all o
mythria
2015/12/02 12:32:38
Done.
| |
1496 DCHECK(object->IsHeapObject()); | 1497 DCHECK(object->IsHeapObject()); |
mythria
2015/12/02 09:45:49
I think we could remove this DCHECK right? or is i
jochen (gone - plz use gerrit)
2015/12/02 09:48:28
you can remove it
mythria
2015/12/02 12:32:38
Done.
| |
1497 HeapObject* heap_object = HeapObject::cast(object); | 1498 HeapObject* heap_object = HeapObject::cast(object); |
1498 if (!object->IsJSObject()) return false; | 1499 if (!object->IsJSObject()) return false; |
1499 Object* obj_constructor = (JSObject::cast(object))->map()->GetConstructor(); | 1500 Object* obj_constructor = (JSObject::cast(object))->map()->GetConstructor(); |
1500 if (!obj_constructor->IsJSFunction()) return false; | 1501 if (!obj_constructor->IsJSFunction()) return false; |
1501 JSFunction* constructor = JSFunction::cast(obj_constructor); | 1502 JSFunction* constructor = JSFunction::cast(obj_constructor); |
1502 if (constructor != nullptr && | 1503 if (constructor != nullptr && |
1503 constructor->initial_map() == heap_object->map()) { | 1504 constructor->initial_map() == heap_object->map()) { |
1504 return true; | 1505 return true; |
1505 } | 1506 } |
1506 return false; | 1507 return false; |
(...skipping 4592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6099 } | 6100 } |
6100 | 6101 |
6101 | 6102 |
6102 // static | 6103 // static |
6103 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6104 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6104 return StaticVisitorBase::GetVisitorId(map); | 6105 return StaticVisitorBase::GetVisitorId(map); |
6105 } | 6106 } |
6106 | 6107 |
6107 } // namespace internal | 6108 } // namespace internal |
6108 } // namespace v8 | 6109 } // namespace v8 |
OLD | NEW |