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

Unified Diff: test/cctest/test-api.cc

Issue 988283003: use a hash table for the function cache as blink is leaking functiontemplates (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 | « src/contexts.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 0ee53ba8abe69ff385d1f166772ac4cdd00d24d3..b9c5ee1e84d61210c498f3e07f9df5685e36c5a4 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -20038,15 +20038,15 @@ THREADED_TEST(FunctionNew) {
env->Global()->Set(v8_str("func"), func);
Local<Value> result = CompileRun("func();");
CHECK(v8::Integer::New(isolate, 17)->Equals(result));
- // Verify function not cached
- int serial_number =
- i::Smi::cast(v8::Utils::OpenHandle(*func)
- ->shared()->get_api_func_data()->serial_number())->value();
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
- i::Handle<i::FixedArray> cache(i_isolate->native_context()->function_cache());
- if (serial_number < cache->length()) {
- CHECK(cache->get(serial_number)->IsUndefined());
- }
+ // Verify function not cached
+ auto serial_number = handle(i::Smi::cast(v8::Utils::OpenHandle(*func)
+ ->shared()
+ ->get_api_func_data()
+ ->serial_number()),
+ i_isolate);
+ auto cache = i_isolate->function_cache();
+ CHECK(cache->Lookup(serial_number)->IsTheHole());
// Verify that each Function::New creates a new function instance
Local<Object> data2 = v8::Object::New(isolate);
function_new_expected_env = data2;
« no previous file with comments | « src/contexts.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698