OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1760 if (value == FastI2D(int_value) && Smi::IsValid(int_value)) { | 1760 if (value == FastI2D(int_value) && Smi::IsValid(int_value)) { |
1761 return Smi::FromInt(int_value); | 1761 return Smi::FromInt(int_value); |
1762 } | 1762 } |
1763 | 1763 |
1764 // Materialize the value in the heap. | 1764 // Materialize the value in the heap. |
1765 return AllocateHeapNumber(value, pretenure); | 1765 return AllocateHeapNumber(value, pretenure); |
1766 } | 1766 } |
1767 | 1767 |
1768 | 1768 |
1769 Object* Heap::NumberToString(Object* number) { | 1769 Object* Heap::NumberToString(Object* number) { |
| 1770 Counters::number_to_string_runtime.Increment(); |
1770 Object* cached = GetNumberStringCache(number); | 1771 Object* cached = GetNumberStringCache(number); |
1771 if (cached != undefined_value()) { | 1772 if (cached != undefined_value()) { |
1772 return cached; | 1773 return cached; |
1773 } | 1774 } |
1774 | 1775 |
1775 char arr[100]; | 1776 char arr[100]; |
1776 Vector<char> buffer(arr, ARRAY_SIZE(arr)); | 1777 Vector<char> buffer(arr, ARRAY_SIZE(arr)); |
1777 const char* str; | 1778 const char* str; |
1778 if (number->IsSmi()) { | 1779 if (number->IsSmi()) { |
1779 int num = Smi::cast(number)->value(); | 1780 int num = Smi::cast(number)->value(); |
(...skipping 2437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4217 void ExternalStringTable::TearDown() { | 4218 void ExternalStringTable::TearDown() { |
4218 new_space_strings_.Free(); | 4219 new_space_strings_.Free(); |
4219 old_space_strings_.Free(); | 4220 old_space_strings_.Free(); |
4220 } | 4221 } |
4221 | 4222 |
4222 | 4223 |
4223 List<Object*> ExternalStringTable::new_space_strings_; | 4224 List<Object*> ExternalStringTable::new_space_strings_; |
4224 List<Object*> ExternalStringTable::old_space_strings_; | 4225 List<Object*> ExternalStringTable::old_space_strings_; |
4225 | 4226 |
4226 } } // namespace v8::internal | 4227 } } // namespace v8::internal |
OLD | NEW |