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

Unified Diff: test/cctest/test-profile-generator.cc

Issue 2650193002: [debugger] remove debugger statement support from FCG/CS. (Closed)
Patch Set: rebase Created 3 years, 10 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/x64/macro-assembler-x64.cc ('k') | test/debugger/debug/debug-evaluate-closure.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-profile-generator.cc
diff --git a/test/cctest/test-profile-generator.cc b/test/cctest/test-profile-generator.cc
index 412d4687c71bdc7879637568a69593b38e9118fb..2f38f02c07ca1dbdd165a13dc6f33b897a3298ce 100644
--- a/test/cctest/test-profile-generator.cc
+++ b/test/cctest/test-profile-generator.cc
@@ -697,6 +697,8 @@ TEST(LineNumber) {
}
TEST(BailoutReason) {
+ i::FLAG_allow_natives_syntax = true;
+ i::FLAG_always_opt = false;
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Context> env = CcTest::NewContext(PROFILER_EXTENSION);
v8::Context::Scope context_scope(env);
@@ -704,14 +706,21 @@ TEST(BailoutReason) {
i::ProfilerExtension::set_profiler(iprofiler.get());
CHECK_EQ(0, iprofiler->GetProfilesCount());
- v8::Local<v8::Script> script =
- v8_compile(v8_str("function Debugger() {\n"
- " debugger;\n"
- " startProfiling();\n"
- "}\n"
- "Debugger();\n"
- "stopProfiling();"));
- script->Run(v8::Isolate::GetCurrent()->GetCurrentContext()).ToLocalChecked();
+ v8::Local<v8::Function> function = CompileRun(
+ "function Debugger() {\n"
+ " startProfiling();\n"
+ "}"
+ "Debugger")
+ .As<v8::Function>();
+ i::Handle<i::JSFunction> i_function =
+ i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*function));
+ // Set a high opt count to trigger bail out.
+ i_function->shared()->set_opt_count(10000);
+
+ CompileRun(
+ "%OptimizeFunctionOnNextCall(Debugger);"
+ "Debugger();"
+ "stopProfiling()");
CHECK_EQ(1, iprofiler->GetProfilesCount());
const v8::CpuProfile* profile = i::ProfilerExtension::last_profile;
CHECK(profile);
@@ -721,11 +730,11 @@ TEST(BailoutReason) {
// The tree should look like this:
// (root)
// ""
- // kDebuggerStatement
+ // kFunctionBeingDebugged
current = PickChild(current, "");
CHECK(const_cast<v8::CpuProfileNode*>(current));
current = PickChild(current, "Debugger");
CHECK(const_cast<v8::CpuProfileNode*>(current));
- CHECK(!strcmp("DebuggerStatement", current->GetBailoutReason()));
+ CHECK(!strcmp("Deoptimized too many times", current->GetBailoutReason()));
}
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | test/debugger/debug/debug-evaluate-closure.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698