From: mstarzinger@chromium.org Date: Mon, 15 Jul 2013 11:41:41 +0000 (+0000) Subject: Use internal array as API function cache. X-Git-Tag: upstream/4.7.83~13376 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05992251872d4f2cf8281143c00fd69cfe70195b;p=platform%2Fupstream%2Fv8.git Use internal array as API function cache. R=yangguo@chromium.org BUG=chromium:260106 TEST=cctest/test-api/Regress260106 Review URL: https://codereview.chromium.org/19159003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15665 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/apinatives.js b/src/apinatives.js index ad1d869..ccbedd6 100644 --- a/src/apinatives.js +++ b/src/apinatives.js @@ -37,7 +37,7 @@ function CreateDate(time) { } -var kApiFunctionCache = {}; +var kApiFunctionCache = new InternalArray(); var functionCache = kApiFunctionCache; diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc index 43a243d..fa671dc 100644 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc @@ -19653,6 +19653,17 @@ THREADED_TEST(Regress2746) { } +THREADED_TEST(Regress260106) { + LocalContext context; + v8::HandleScope scope(context->GetIsolate()); + Local templ = FunctionTemplate::New(DummyCallHandler); + CompileRun("for (var i = 0; i < 128; i++) Object.prototype[i] = 0;"); + Local function = templ->GetFunction(); + CHECK(!function.IsEmpty()); + CHECK(function->IsFunction()); +} + + #ifndef WIN32 class ThreadInterruptTest { public: