Chromium Code Reviews| Index: src/apinatives.js |
| diff --git a/src/apinatives.js b/src/apinatives.js |
| index 5fb36c09e7242b6289bb9d5f35551893b6e85ed8..c0ed8981735566c4dda9313991cd1a797c5859b2 100644 |
| --- a/src/apinatives.js |
| +++ b/src/apinatives.js |
| @@ -66,16 +66,17 @@ function InstantiateFunction(data, name) { |
| // We need a reference to kApiFunctionCache in the stack frame |
| // if we need to bail out from a stack overflow. |
| var cache = kApiFunctionCache; |
| + var flags = %GetTemplateField(data, kApiFlagOffset); |
| + var doNotCache = flags & (1 << kDoNotCacheBit); |
| var serialNumber = %GetTemplateField(data, kApiSerialNumberOffset); |
| var isFunctionCached = |
| - (serialNumber in cache) && (cache[serialNumber] != kUninitialized); |
| + (!doNotCache && |
| + (serialNumber in cache) && (cache[serialNumber] != kUninitialized)); |
| if (!isFunctionCached) { |
| try { |
| cache[serialNumber] = null; |
|
Michael Starzinger
2013/09/13 08:59:08
Couldn't we just remove this initialization to "nu
|
| var fun = %CreateApiFunction(data); |
| if (name) %FunctionSetName(fun, name); |
| - var flags = %GetTemplateField(data, kApiFlagOffset); |
| - var doNotCache = flags & (1 << kDoNotCacheBit); |
| if (!doNotCache) cache[serialNumber] = fun; |
| if (flags & (1 << kRemovePrototypeBit)) { |
| %FunctionRemovePrototype(fun); |