Index: src/heap.h |
diff --git a/src/heap.h b/src/heap.h |
index 22ab875bb141de0dedffe7ea401e3d8f974c9837..1d5f26a219dc4bdbc5310f4ee0438658942e3299 100644 |
--- a/src/heap.h |
+++ b/src/heap.h |
@@ -1610,6 +1610,7 @@ class TranscendentalCache { |
if (e.in[0] == c.integers[0] && |
e.in[1] == c.integers[1]) { |
ASSERT(e.output != NULL); |
+ Counters::transcendental_cache_hit.Increment(); |
return e.output; |
} |
double answer = Calculate(input); |
@@ -1619,6 +1620,7 @@ class TranscendentalCache { |
elements_[hash].in[1] = c.integers[1]; |
elements_[hash].output = heap_number; |
} |
+ Counters::transcendental_cache_miss.Increment(); |
return heap_number; |
} |
@@ -1659,6 +1661,17 @@ class TranscendentalCache { |
hash ^= hash >> 8; |
return (hash & (kCacheSize - 1)); |
} |
+ |
+ static Address cache_array_address() { |
+ // Used to create an external reference. |
+ return reinterpret_cast<Address>(caches_); |
+ } |
+ |
+ // Allow access to the caches_ array as an ExternalReference. |
+ friend class ExternalReference; |
+ // Inline implementation of the caching. |
+ friend class TranscendentalCacheStub; |
+ |
static TranscendentalCache* caches_[kNumberOfCaches]; |
Element elements_[kCacheSize]; |
Type type_; |