Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/heap/heap.cc

Issue 1491203002: Updated the check for unmodfied objects to handle Smi Objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed review comments. Does not mark any objects that are not created via C++ API as unmodified. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 DCHECK(object->IsHeapObject()); 1496 if (object->IsSmi()) return false;
1497 HeapObject* heap_object = HeapObject::cast(object); 1497 HeapObject* heap_object = HeapObject::cast(object);
1498 if (!object->IsJSObject()) return false; 1498 if (!object->IsJSObject()) return false;
1499 Object* obj_constructor = (JSObject::cast(object))->map()->GetConstructor(); 1499 Object* obj_constructor = (JSObject::cast(object))->map()->GetConstructor();
1500 if (!obj_constructor->IsJSFunction()) return false; 1500 if (!obj_constructor->IsJSFunction()) return false;
1501 JSFunction* constructor = JSFunction::cast(obj_constructor); 1501 JSFunction* constructor = JSFunction::cast(obj_constructor);
1502 if (!constructor->shared()->IsApiFunction()) return false;
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;
1507 } 1508 }
1508 1509
1509 1510
1510 void Heap::ScavengeStoreBufferCallback(Heap* heap, MemoryChunk* page, 1511 void Heap::ScavengeStoreBufferCallback(Heap* heap, MemoryChunk* page,
1511 StoreBufferEvent event) { 1512 StoreBufferEvent event) {
(...skipping 4587 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698