Chromium Code Reviews| 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]; |