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

Unified Diff: src/heap.h

Issue 652041: IA32: Native access to TranscendentalCache for sin/cos. (Closed)
Patch Set: Updated to head. Removed dead code. Ignore first patch. Created 10 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
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_;
« no previous file with comments | « src/codegen.cc ('k') | src/ia32/assembler-ia32.h » ('j') | src/ia32/codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698