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

Unified Diff: src/heap-inl.h

Issue 157503002: A64: Synchronize with r18444. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months 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/heap.cc ('k') | src/heap-profiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap-inl.h
diff --git a/src/heap-inl.h b/src/heap-inl.h
index 3229aeecc3096fa74bc9f022616eb277b4e79d58..3dce348727477c260c894f3710956e4fe0e2ce8f 100644
--- a/src/heap-inl.h
+++ b/src/heap-inl.h
@@ -484,12 +484,21 @@ void Heap::ScavengePointer(HeapObject** p) {
void Heap::UpdateAllocationSiteFeedback(HeapObject* object) {
- if (FLAG_allocation_site_pretenuring && object->IsJSObject()) {
- AllocationMemento* memento = AllocationMemento::FindForJSObject(
- JSObject::cast(object), true);
+ if (FLAG_allocation_site_pretenuring &&
+ AllocationSite::CanTrack(object->map()->instance_type())) {
+ AllocationMemento* memento = AllocationMemento::FindForHeapObject(
+ object, true);
if (memento != NULL) {
ASSERT(memento->IsValid());
- memento->GetAllocationSite()->IncrementMementoFoundCount();
+ bool add_to_scratchpad =
+ memento->GetAllocationSite()->IncrementMementoFoundCount();
+ Heap* heap = object->GetIsolate()->heap();
+ if (add_to_scratchpad && heap->allocation_sites_scratchpad_length <
+ kAllocationSiteScratchpadSize) {
+ heap->allocation_sites_scratchpad[
+ heap->allocation_sites_scratchpad_length++] =
+ memento->GetAllocationSite();
+ }
}
}
}
@@ -747,56 +756,6 @@ void Heap::CompletelyClearInstanceofCache() {
}
-MaybeObject* TranscendentalCache::Get(Type type, double input) {
- SubCache* cache = caches_[type];
- if (cache == NULL) {
- caches_[type] = cache = new SubCache(isolate_, type);
- }
- return cache->Get(input);
-}
-
-
-Address TranscendentalCache::cache_array_address() {
- return reinterpret_cast<Address>(caches_);
-}
-
-
-double TranscendentalCache::SubCache::Calculate(double input) {
- switch (type_) {
- case LOG:
- return fast_log(input);
- default:
- UNREACHABLE();
- return 0.0; // Never happens.
- }
-}
-
-
-MaybeObject* TranscendentalCache::SubCache::Get(double input) {
- Converter c;
- c.dbl = input;
- int hash = Hash(c);
- Element e = elements_[hash];
- if (e.in[0] == c.integers[0] &&
- e.in[1] == c.integers[1]) {
- ASSERT(e.output != NULL);
- isolate_->counters()->transcendental_cache_hit()->Increment();
- return e.output;
- }
- double answer = Calculate(input);
- isolate_->counters()->transcendental_cache_miss()->Increment();
- Object* heap_number;
- { MaybeObject* maybe_heap_number =
- isolate_->heap()->AllocateHeapNumber(answer);
- if (!maybe_heap_number->ToObject(&heap_number)) return maybe_heap_number;
- }
- elements_[hash].in[0] = c.integers[0];
- elements_[hash].in[1] = c.integers[1];
- elements_[hash].output = heap_number;
- return heap_number;
-}
-
-
AlwaysAllocateScope::AlwaysAllocateScope() {
// We shouldn't hit any nested scopes, because that requires
// non-handle code to call handle code. The code still works but
« no previous file with comments | « src/heap.cc ('k') | src/heap-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698