Introducing a kUninitialized constant used for clearing the function cache.
authorolehougaard <olehougaard@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 13 Jan 2009 07:37:53 +0000 (07:37 +0000)
committerolehougaard <olehougaard@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 13 Jan 2009 07:37:53 +0000 (07:37 +0000)
Review URL: http://codereview.chromium.org/17639

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1057 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/apinatives.js
src/macros.py

index d7d49fcb92f1a187718cbba6037170a2e0436c41..2981eec5989e8ae70b4b4cbe18c76f1f389b5ba8 100644 (file)
@@ -64,8 +64,7 @@ function InstantiateFunction(data, name) {
   var cache = kApiFunctionCache;
   var serialNumber = %GetTemplateField(data, kApiSerialNumberOffset);
   var isFunctionCached =
-   (serialNumber in cache) &&
-   (cache[serialNumber] != -1);
+   (serialNumber in cache) && (cache[serialNumber] != kUninitialized);
   if (!isFunctionCached) {
     try {
       cache[serialNumber] = null;
@@ -82,7 +81,7 @@ function InstantiateFunction(data, name) {
       }
       ConfigureTemplateInstance(fun, data);
     } catch (e) {
-      cache[serialNumber] = -1;
+      cache[serialNumber] = kUninitialized;
       throw e;
     }
   }
index 5a7606a76d82f0f15b440f5674155094217c79cc..b036c638a09cc502d9007bf5e5138706997988d4 100644 (file)
@@ -61,6 +61,9 @@ const msPerMinute      = 60000;
 const msPerHour        = 3600000;
 const msPerDay         = 86400000;
 
+# For apinatives.js
+const kUninitialized = -1;
+
 # Note: kDayZeroInJulianDay = ToJulianDay(1970, 0, 1).
 const kInvalidDate        = 'Invalid Date';
 const kDayZeroInJulianDay = 2440588;