| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 4829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4840 else if (d > 0) return Smi::FromInt(GREATER); | 4840 else if (d > 0) return Smi::FromInt(GREATER); |
| 4841 | 4841 |
| 4842 x->TryFlatten(); | 4842 x->TryFlatten(); |
| 4843 y->TryFlatten(); | 4843 y->TryFlatten(); |
| 4844 | 4844 |
| 4845 return (x->IsFlat() && y->IsFlat()) ? FlatStringCompare(x, y) | 4845 return (x->IsFlat() && y->IsFlat()) ? FlatStringCompare(x, y) |
| 4846 : StringInputBufferCompare(x, y); | 4846 : StringInputBufferCompare(x, y); |
| 4847 } | 4847 } |
| 4848 | 4848 |
| 4849 | 4849 |
| 4850 static Object* Runtime_Math_abs(Arguments args) { | |
| 4851 NoHandleAllocation ha; | |
| 4852 ASSERT(args.length() == 1); | |
| 4853 Counters::math_abs.Increment(); | |
| 4854 | |
| 4855 CONVERT_DOUBLE_CHECKED(x, args[0]); | |
| 4856 return Heap::AllocateHeapNumber(fabs(x)); | |
| 4857 } | |
| 4858 | |
| 4859 | |
| 4860 static Object* Runtime_Math_acos(Arguments args) { | 4850 static Object* Runtime_Math_acos(Arguments args) { |
| 4861 NoHandleAllocation ha; | 4851 NoHandleAllocation ha; |
| 4862 ASSERT(args.length() == 1); | 4852 ASSERT(args.length() == 1); |
| 4863 Counters::math_acos.Increment(); | 4853 Counters::math_acos.Increment(); |
| 4864 | 4854 |
| 4865 CONVERT_DOUBLE_CHECKED(x, args[0]); | 4855 CONVERT_DOUBLE_CHECKED(x, args[0]); |
| 4866 return TranscendentalCache::Get(TranscendentalCache::ACOS, x); | 4856 return TranscendentalCache::Get(TranscendentalCache::ACOS, x); |
| 4867 } | 4857 } |
| 4868 | 4858 |
| 4869 | 4859 |
| (...skipping 3879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8749 } else { | 8739 } else { |
| 8750 // Handle last resort GC and make sure to allow future allocations | 8740 // Handle last resort GC and make sure to allow future allocations |
| 8751 // to grow the heap without causing GCs (if possible). | 8741 // to grow the heap without causing GCs (if possible). |
| 8752 Counters::gc_last_resort_from_js.Increment(); | 8742 Counters::gc_last_resort_from_js.Increment(); |
| 8753 Heap::CollectAllGarbage(false); | 8743 Heap::CollectAllGarbage(false); |
| 8754 } | 8744 } |
| 8755 } | 8745 } |
| 8756 | 8746 |
| 8757 | 8747 |
| 8758 } } // namespace v8::internal | 8748 } } // namespace v8::internal |
| OLD | NEW |