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

Unified Diff: src/apinatives.js

Issue 23513048: Don't lookup the cache for the result of Function::New (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | test/cctest/test-api.cc » ('j') | test/cctest/test-api.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/apinatives.js
diff --git a/src/apinatives.js b/src/apinatives.js
index 5fb36c09e7242b6289bb9d5f35551893b6e85ed8..c87d45c83fadcac9bbe8edbdfc3f3b19768f547c 100644
--- a/src/apinatives.js
+++ b/src/apinatives.js
@@ -66,16 +66,16 @@ 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);
yhirano 2013/09/13 05:54:56 Let's wrap this line.
yusukesuzuki 2013/09/13 06:03:06 Done.
if (!isFunctionCached) {
try {
cache[serialNumber] = null;
yusukesuzuki 2013/09/13 05:52:00 Because of this, `(serialNumber in cache) && (cach
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);
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698