OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2323 | 2323 |
2324 Object* js_string; | 2324 Object* js_string; |
2325 MaybeObject* maybe_js_string = AllocateStringFromAscii(CStrVector(str)); | 2325 MaybeObject* maybe_js_string = AllocateStringFromAscii(CStrVector(str)); |
2326 if (maybe_js_string->ToObject(&js_string)) { | 2326 if (maybe_js_string->ToObject(&js_string)) { |
2327 SetNumberStringCache(number, String::cast(js_string)); | 2327 SetNumberStringCache(number, String::cast(js_string)); |
2328 } | 2328 } |
2329 return maybe_js_string; | 2329 return maybe_js_string; |
2330 } | 2330 } |
2331 | 2331 |
2332 | 2332 |
| 2333 MaybeObject* Heap::Uint32ToString(uint32_t value, |
| 2334 bool check_number_string_cache) { |
| 2335 Object* number; |
| 2336 MaybeObject* maybe = NumberFromUint32(value); |
| 2337 if (!maybe->To<Object>(&number)) return maybe; |
| 2338 return NumberToString(number, check_number_string_cache); |
| 2339 } |
| 2340 |
| 2341 |
2333 Map* Heap::MapForExternalArrayType(ExternalArrayType array_type) { | 2342 Map* Heap::MapForExternalArrayType(ExternalArrayType array_type) { |
2334 return Map::cast(roots_[RootIndexForExternalArrayType(array_type)]); | 2343 return Map::cast(roots_[RootIndexForExternalArrayType(array_type)]); |
2335 } | 2344 } |
2336 | 2345 |
2337 | 2346 |
2338 Heap::RootListIndex Heap::RootIndexForExternalArrayType( | 2347 Heap::RootListIndex Heap::RootIndexForExternalArrayType( |
2339 ExternalArrayType array_type) { | 2348 ExternalArrayType array_type) { |
2340 switch (array_type) { | 2349 switch (array_type) { |
2341 case kExternalByteArray: | 2350 case kExternalByteArray: |
2342 return kExternalByteArrayMapRootIndex; | 2351 return kExternalByteArrayMapRootIndex; |
(...skipping 3761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6104 } | 6113 } |
6105 | 6114 |
6106 | 6115 |
6107 void ExternalStringTable::TearDown() { | 6116 void ExternalStringTable::TearDown() { |
6108 new_space_strings_.Free(); | 6117 new_space_strings_.Free(); |
6109 old_space_strings_.Free(); | 6118 old_space_strings_.Free(); |
6110 } | 6119 } |
6111 | 6120 |
6112 | 6121 |
6113 } } // namespace v8::internal | 6122 } } // namespace v8::internal |
OLD | NEW |