| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 7135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7146 return isolate->transcendental_cache()->Get(TranscendentalCache::COS, x); | 7146 return isolate->transcendental_cache()->Get(TranscendentalCache::COS, x); |
| 7147 } | 7147 } |
| 7148 | 7148 |
| 7149 | 7149 |
| 7150 RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_exp) { | 7150 RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_exp) { |
| 7151 NoHandleAllocation ha; | 7151 NoHandleAllocation ha; |
| 7152 ASSERT(args.length() == 1); | 7152 ASSERT(args.length() == 1); |
| 7153 isolate->counters()->math_exp()->Increment(); | 7153 isolate->counters()->math_exp()->Increment(); |
| 7154 | 7154 |
| 7155 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 7155 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
| 7156 return isolate->transcendental_cache()->Get(TranscendentalCache::EXP, x); | 7156 lazily_initialize_fast_exp(); |
| 7157 return isolate->heap()->NumberFromDouble(fast_exp(x)); |
| 7157 } | 7158 } |
| 7158 | 7159 |
| 7159 | 7160 |
| 7160 RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_floor) { | 7161 RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_floor) { |
| 7161 NoHandleAllocation ha; | 7162 NoHandleAllocation ha; |
| 7162 ASSERT(args.length() == 1); | 7163 ASSERT(args.length() == 1); |
| 7163 isolate->counters()->math_floor()->Increment(); | 7164 isolate->counters()->math_floor()->Increment(); |
| 7164 | 7165 |
| 7165 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 7166 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
| 7166 return isolate->heap()->NumberFromDouble(floor(x)); | 7167 return isolate->heap()->NumberFromDouble(floor(x)); |
| (...skipping 6215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13382 // Handle last resort GC and make sure to allow future allocations | 13383 // Handle last resort GC and make sure to allow future allocations |
| 13383 // to grow the heap without causing GCs (if possible). | 13384 // to grow the heap without causing GCs (if possible). |
| 13384 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13385 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13385 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13386 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13386 "Runtime::PerformGC"); | 13387 "Runtime::PerformGC"); |
| 13387 } | 13388 } |
| 13388 } | 13389 } |
| 13389 | 13390 |
| 13390 | 13391 |
| 13391 } } // namespace v8::internal | 13392 } } // namespace v8::internal |
| OLD | NEW |