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

Unified Diff: src/heap.h

Issue 5720005: Add an untagged double to transcendental cache elements. They now contain an... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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
Index: src/heap.h
===================================================================
--- src/heap.h (revision 5989)
+++ src/heap.h (working copy)
@@ -1993,9 +1993,19 @@
Element e = elements_[hash];
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;
+ if (e.output != NULL) {
+ Counters::transcendental_cache_hit.Increment();
+ return e.output;
+ } else {
+ Object* heap_number;
+ { MaybeObject* maybe_heap_number =
+ Heap::AllocateHeapNumber(e.untagged_output);
+ if (!maybe_heap_number->ToObject(&heap_number))
+ return maybe_heap_number;
+ }
+ elements_[hash].output = heap_number;
+ return heap_number;
+ }
}
double answer = Calculate(input);
Counters::transcendental_cache_miss.Increment();
@@ -2006,6 +2016,7 @@
elements_[hash].in[0] = c.integers[0];
elements_[hash].in[1] = c.integers[1];
elements_[hash].output = heap_number;
+ elements_[hash].untagged_output = answer;
return heap_number;
}
@@ -2035,7 +2046,9 @@
struct Element {
uint32_t in[2];
Object* output;
+ double untagged_output;
};
+ static const int kElementSize = sizeof (Element);
Erik Corry 2010/12/13 20:26:13 There should really be some constants here that yo
union Converter {
double dbl;
uint32_t integers[2];

Powered by Google App Engine
This is Rietveld 408576698