Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Unified Diff: src/factory.h

Issue 240293002: Handlify number-related allocators. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698