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

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
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.h
===================================================================
--- src/heap.h (revision 6110)
+++ src/heap.h (working copy)
@@ -1999,9 +1999,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();
@@ -2012,6 +2022,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;
}
@@ -2041,7 +2052,9 @@
struct Element {
uint32_t in[2];
Object* output;
+ double untagged_output;
};
+ static const int kElementSize = sizeof(Element); // NOLINT
union Converter {
double dbl;
uint32_t integers[2];
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698