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

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

Issue 663453005: Log code event for deserialized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/serialize.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-serialize.cc
diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc
index e73e426c4d00782b99bb414a4a0a345969312738..6697252b3e1590d1064fd94c5cd79cd389efc964 100644
--- a/test/cctest/test-serialize.cc
+++ b/test/cctest/test-serialize.cc
@@ -1162,6 +1162,17 @@ TEST(SerializeToplevelExternalScriptName) {
}
+static bool toplevel_test_code_event_found = false;
+
+
+static void SerializerCodeEventListener(const v8::JitCodeEvent* event) {
+ if (event->type == v8::JitCodeEvent::CODE_ADDED &&
+ memcmp(event->name.str, "Script:~test", 12) == 0) {
+ toplevel_test_code_event_found = true;
+ }
+}
+
+
TEST(SerializeToplevelIsolates) {
FLAG_serialize_toplevel = true;
@@ -1194,6 +1205,9 @@ TEST(SerializeToplevelIsolates) {
isolate1->Dispose();
v8::Isolate* isolate2 = v8::Isolate::New();
+ isolate2->SetJitCodeEventHandler(v8::kJitCodeEventDefault,
+ SerializerCodeEventListener);
+ toplevel_test_code_event_found = false;
{
v8::Isolate::Scope iscope(isolate2);
v8::HandleScope scope(isolate2);
@@ -1212,6 +1226,7 @@ TEST(SerializeToplevelIsolates) {
v8::Local<v8::Value> result = script->BindToCurrentContext()->Run();
CHECK(result->ToString()->Equals(v8_str("abcdef")));
}
+ DCHECK(toplevel_test_code_event_found);
isolate2->Dispose();
}
« no previous file with comments | « src/serialize.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698