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

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

Issue 2627543004: [test] Fix test-api.cc test for caching of FunctionTemplate. (Closed)
Patch Set: Created 3 years, 11 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:
Download patch
« no previous file with comments | « src/objects.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 dd9d0ebd1afec84f8cd45b34785f7a7f563fe561..fb857874ac0bc9b8ae6d6e179e09cdbee6b2704b 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -23619,20 +23619,15 @@ THREADED_TEST(FunctionNew) {
CHECK(env->Global()->Set(env.local(), v8_str("func"), func).FromJust());
Local<Value> result = CompileRun("func();");
CHECK(v8::Integer::New(isolate, 17)->Equals(env.local(), result).FromJust());
- i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
- // Verify function not cached
- auto serial_number = handle(
+ // Serial number should be invalid => should not be cached.
+ auto serial_number =
i::Smi::cast(i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*func))
->shared()
->get_api_func_data()
- ->serial_number()),
- i_isolate);
- auto slow_cache = i_isolate->slow_template_instantiations_cache();
- CHECK(slow_cache->FindEntry(static_cast<uint32_t>(serial_number->value())) ==
- i::UnseededNumberDictionary::kNotFound);
- auto fast_cache = i_isolate->fast_template_instantiations_cache();
- CHECK(fast_cache->get(static_cast<uint32_t>(serial_number->value()))
- ->IsUndefined(i_isolate));
+ ->serial_number())
+ ->value();
+ CHECK_EQ(i::FunctionTemplateInfo::kInvalidSerialNumber, serial_number);
+
// 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/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698