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 7714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7725 return isolate->heap()->NumberFromDouble(floor(x)); | 7725 return isolate->heap()->NumberFromDouble(floor(x)); |
7726 } | 7726 } |
7727 | 7727 |
7728 | 7728 |
7729 RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_log) { | 7729 RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_log) { |
7730 SealHandleScope shs(isolate); | 7730 SealHandleScope shs(isolate); |
7731 ASSERT(args.length() == 1); | 7731 ASSERT(args.length() == 1); |
7732 isolate->counters()->math_log()->Increment(); | 7732 isolate->counters()->math_log()->Increment(); |
7733 | 7733 |
7734 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 7734 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
7735 return isolate->heap()->AllocateHeapNumber(fast_log(x)); | 7735 return isolate->heap()->AllocateHeapNumber(log(x)); |
7736 } | 7736 } |
7737 | 7737 |
7738 | 7738 |
7739 // Slow version of Math.pow. We check for fast paths for special cases. | 7739 // Slow version of Math.pow. We check for fast paths for special cases. |
7740 // Used if SSE2/VFP3 is not available. | 7740 // Used if SSE2/VFP3 is not available. |
7741 RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow) { | 7741 RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow) { |
7742 SealHandleScope shs(isolate); | 7742 SealHandleScope shs(isolate); |
7743 ASSERT(args.length() == 2); | 7743 ASSERT(args.length() == 2); |
7744 isolate->counters()->math_pow()->Increment(); | 7744 isolate->counters()->math_pow()->Increment(); |
7745 | 7745 |
(...skipping 7156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14902 // Handle last resort GC and make sure to allow future allocations | 14902 // Handle last resort GC and make sure to allow future allocations |
14903 // to grow the heap without causing GCs (if possible). | 14903 // to grow the heap without causing GCs (if possible). |
14904 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14904 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14905 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14905 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14906 "Runtime::PerformGC"); | 14906 "Runtime::PerformGC"); |
14907 } | 14907 } |
14908 } | 14908 } |
14909 | 14909 |
14910 | 14910 |
14911 } } // namespace v8::internal | 14911 } } // namespace v8::internal |
OLD | NEW |