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

Unified Diff: src/objects.cc

Issue 109303006: Revert "Remove flag track-allocation-sites." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 9b45b3134c4ed283e60499d41e91b9d50177d62a..aa7f500c8a36198355b85b37a4ae11484f87a15f 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9191,24 +9191,26 @@ AllocationMemento* AllocationMemento::FindForHeapObject(HeapObject* object,
// checking the object immediately after the current object (if there is one)
// to see if it's an AllocationMemento.
ASSERT(object->GetHeap()->InNewSpace(object));
- Address ptr_end = (reinterpret_cast<Address>(object) - kHeapObjectTag) +
- object->Size();
- Address top;
- if (in_GC) {
- top = object->GetHeap()->new_space()->FromSpacePageHigh();
- } else {
- top = object->GetHeap()->NewSpaceTop();
- }
- if ((ptr_end + AllocationMemento::kSize) <= top) {
- // There is room in newspace for allocation info. Do we have some?
- Map** possible_allocation_memento_map =
- reinterpret_cast<Map**>(ptr_end);
- if (*possible_allocation_memento_map ==
- object->GetHeap()->allocation_memento_map()) {
- AllocationMemento* memento = AllocationMemento::cast(
- reinterpret_cast<Object*>(ptr_end + kHeapObjectTag));
- if (memento->IsValid()) {
- return memento;
+ if (FLAG_track_allocation_sites) {
+ Address ptr_end = (reinterpret_cast<Address>(object) - kHeapObjectTag) +
+ object->Size();
+ Address top;
+ if (in_GC) {
+ top = object->GetHeap()->new_space()->FromSpacePageHigh();
+ } else {
+ top = object->GetHeap()->NewSpaceTop();
+ }
+ if ((ptr_end + AllocationMemento::kSize) <= top) {
+ // There is room in newspace for allocation info. Do we have some?
+ Map** possible_allocation_memento_map =
+ reinterpret_cast<Map**>(ptr_end);
+ if (*possible_allocation_memento_map ==
+ object->GetHeap()->allocation_memento_map()) {
+ AllocationMemento* memento = AllocationMemento::cast(
+ reinterpret_cast<Object*>(ptr_end + kHeapObjectTag));
+ if (memento->IsValid()) {
+ return memento;
+ }
}
}
}
@@ -12893,7 +12895,7 @@ void JSObject::UpdateAllocationSite(Handle<JSObject> object,
MaybeObject* JSObject::UpdateAllocationSite(ElementsKind to_kind) {
- if (!IsJSArray()) {
+ if (!FLAG_track_allocation_sites || !IsJSArray()) {
return this;
}
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698