Index: src/factory.h |
diff --git a/src/factory.h b/src/factory.h |
index 677e7083f9e46f99c3a46d4992a832ea22f21883..8f2a76f784e6363c89aea8c276e00f5f7e5bed56 100644 |
--- a/src/factory.h |
+++ b/src/factory.h |
@@ -282,6 +282,7 @@ class Factory V8_FINAL { |
Handle<ConstantPoolArray> array); |
// Numbers (e.g. literals) are pretenured by the parser. |
+ // The return value may be a smi or a heap number. |
Handle<Object> NewNumber(double value, |
PretenureFlag pretenure = NOT_TENURED); |
@@ -497,7 +498,10 @@ class Factory V8_FINAL { |
Handle<String> NumberToString(Handle<Object> number, |
bool check_number_string_cache = true); |
- Handle<String> Uint32ToString(uint32_t value); |
+ |
+ Handle<String> Uint32ToString(uint32_t value) { |
+ return NumberToString(NewNumberFromUint(value)); |
+ } |
enum ApiInstanceType { |
JavaScriptObject, |
@@ -640,6 +644,13 @@ class Factory V8_FINAL { |
Handle<MapCache> AddToMapCache(Handle<Context> context, |
Handle<FixedArray> keys, |
Handle<Map> map); |
+ |
+ // Attempt to find the number in a small cache. If we finds it, return |
+ // the string representation of the number. Otherwise return undefined. |
+ Handle<Object> GetNumberStringCache(Handle<Object> number); |
+ |
+ // Update the cache with a new number-string pair. |
+ void SetNumberStringCache(Handle<Object> number, Handle<String> string); |
}; |
} } // namespace v8::internal |