| Index: test/cctest/test-debug.cc
|
| diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
|
| index 8d06b1b66e3fa4f949ed024a7c52a57a678df4b4..e4ac9bec110dbbc6fa1f7c6ab9237abfd1713cae 100644
|
| --- a/test/cctest/test-debug.cc
|
| +++ b/test/cctest/test-debug.cc
|
| @@ -140,6 +140,21 @@ static v8::Local<v8::Function> CompileFunction(DebugLocalContext* env,
|
| return CompileFunction(env->GetIsolate(), source, function_name);
|
| }
|
|
|
| +static void SetDebugEventListener(
|
| + v8::Isolate* isolate, v8::Debug::EventCallback that,
|
| + v8::Local<v8::Value> data = v8::Local<v8::Value>()) {
|
| + i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
| + i::HandleScope scope(i_isolate);
|
| + if (that == nullptr) {
|
| + i_isolate->debug()->SetDebugDelegate(nullptr, false);
|
| + } else {
|
| + i::Handle<i::Object> i_data = i_isolate->factory()->undefined_value();
|
| + if (!data.IsEmpty()) i_data = v8::Utils::OpenHandle(*data);
|
| + i::NativeDebugDelegate* delegate =
|
| + new i::NativeDebugDelegate(i_isolate, that, i_data);
|
| + i_isolate->debug()->SetDebugDelegate(delegate, true);
|
| + }
|
| +}
|
|
|
| // Is there any debug info for the function?
|
| static bool HasDebugInfo(v8::Local<v8::Function> fun) {
|
| @@ -821,7 +836,7 @@ static void DebugEventBreak(
|
| CcTest::CollectGarbage(v8::internal::NEW_SPACE);
|
|
|
| // Set the break flag again to come back here as soon as possible.
|
| - v8::Debug::DebugBreak(CcTest::isolate());
|
| + v8::debug::DebugBreak(CcTest::isolate());
|
| }
|
| }
|
|
|
| @@ -845,7 +860,7 @@ static void DebugEventBreakMax(
|
| break_point_hit_count++;
|
|
|
| // Set the break flag again to come back here as soon as possible.
|
| - v8::Debug::DebugBreak(v8_isolate);
|
| + v8::debug::DebugBreak(v8_isolate);
|
|
|
| } else if (terminate_after_max_break_point_hit) {
|
| // Terminate execution after the last break if requested.
|
| @@ -924,8 +939,7 @@ TEST(BreakPointICStore) {
|
| DebugLocalContext env;
|
| v8::HandleScope scope(env->GetIsolate());
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| - DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
|
| v8::Local<v8::Function> foo =
|
| CompileFunction(&env, "function foo(){bar=0;}", "foo");
|
|
|
| @@ -945,7 +959,7 @@ TEST(BreakPointICStore) {
|
| foo->Call(env.context(), env->Global(), 0, NULL).ToLocalChecked();
|
| CHECK_EQ(2, break_point_hit_count);
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| + SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| }
|
|
|
| @@ -955,8 +969,7 @@ TEST(BreakPointICLoad) {
|
| break_point_hit_count = 0;
|
| DebugLocalContext env;
|
| v8::HandleScope scope(env->GetIsolate());
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| - DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
|
|
|
| CompileRunChecked(env->GetIsolate(), "bar=1");
|
| v8::Local<v8::Function> foo =
|
| @@ -978,7 +991,7 @@ TEST(BreakPointICLoad) {
|
| foo->Call(env.context(), env->Global(), 0, NULL).ToLocalChecked();
|
| CHECK_EQ(2, break_point_hit_count);
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| + SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| }
|
|
|
| @@ -988,8 +1001,7 @@ TEST(BreakPointICCall) {
|
| break_point_hit_count = 0;
|
| DebugLocalContext env;
|
| v8::HandleScope scope(env->GetIsolate());
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| - DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
|
| CompileRunChecked(env->GetIsolate(), "function bar(){}");
|
| v8::Local<v8::Function> foo =
|
| CompileFunction(&env, "function foo(){bar();}", "foo");
|
| @@ -1010,7 +1022,7 @@ TEST(BreakPointICCall) {
|
| foo->Call(env.context(), env->Global(), 0, NULL).ToLocalChecked();
|
| CHECK_EQ(2, break_point_hit_count);
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| + SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| }
|
|
|
| @@ -1020,8 +1032,7 @@ TEST(BreakPointICCallWithGC) {
|
| break_point_hit_count = 0;
|
| DebugLocalContext env;
|
| v8::HandleScope scope(env->GetIsolate());
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| - DebugEventBreakPointCollectGarbage);
|
| + SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointCollectGarbage);
|
| CompileRunChecked(env->GetIsolate(), "function bar(){return 1;}");
|
| v8::Local<v8::Function> foo =
|
| CompileFunction(&env, "function foo(){return bar();}", "foo");
|
| @@ -1052,7 +1063,7 @@ TEST(BreakPointICCallWithGC) {
|
| foo->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| CHECK_EQ(2, break_point_hit_count);
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| + SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| }
|
|
|
| @@ -1062,8 +1073,7 @@ TEST(BreakPointConstructCallWithGC) {
|
| break_point_hit_count = 0;
|
| DebugLocalContext env;
|
| v8::HandleScope scope(env->GetIsolate());
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| - DebugEventBreakPointCollectGarbage);
|
| + SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointCollectGarbage);
|
| CompileRunChecked(env->GetIsolate(), "function bar(){ this.x = 1;}");
|
| v8::Local<v8::Function> foo =
|
| CompileFunction(&env, "function foo(){return new bar(1).x;}", "foo");
|
| @@ -1094,7 +1104,7 @@ TEST(BreakPointConstructCallWithGC) {
|
| foo->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| CHECK_EQ(2, break_point_hit_count);
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| + SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| }
|
|
|
| @@ -1114,9 +1124,7 @@ TEST(BreakPointReturn) {
|
| frame_source_column_source,
|
| "frame_source_column");
|
|
|
| -
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| - DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
|
| v8::Local<v8::Function> foo =
|
| CompileFunction(&env, "function foo(){}", "foo");
|
| v8::Local<v8::Context> context = env.context();
|
| @@ -1141,7 +1149,7 @@ TEST(BreakPointReturn) {
|
| foo->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| CHECK_EQ(2, break_point_hit_count);
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| + SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| }
|
|
|
| @@ -1165,8 +1173,7 @@ TEST(GCDuringBreakPointProcessing) {
|
| v8::HandleScope scope(env->GetIsolate());
|
| v8::Local<v8::Context> context = env.context();
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| - DebugEventBreakPointCollectGarbage);
|
| + SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointCollectGarbage);
|
| v8::Local<v8::Function> foo;
|
|
|
| // Test IC store break point with garbage collection.
|
| @@ -1194,7 +1201,7 @@ TEST(GCDuringBreakPointProcessing) {
|
| SetBreakPoint(foo, 0);
|
| CallWithBreakPoints(context, env->Global(), foo, 1, 25);
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| + SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| }
|
|
|
| @@ -1230,8 +1237,7 @@ TEST(BreakPointSurviveGC) {
|
| v8::HandleScope scope(env->GetIsolate());
|
| v8::Local<v8::Context> context = env.context();
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| - DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
|
| v8::Local<v8::Function> foo;
|
|
|
| // Test IC store break point with garbage collection.
|
| @@ -1276,8 +1282,7 @@ TEST(BreakPointSurviveGC) {
|
| }
|
| CallAndGC(context, env->Global(), foo);
|
|
|
| -
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| + SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| }
|
|
|
| @@ -1291,7 +1296,7 @@ TEST(BreakPointThroughJavaScript) {
|
| v8::Local<v8::Context> context = env.context();
|
| env.ExposeDebug();
|
|
|
| - v8::Debug::SetDebugEventListener(isolate, DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(isolate, DebugEventBreakPointHitCount);
|
| CompileRunChecked(isolate, "function bar(){}");
|
| CompileFunction(isolate, "function foo(){bar();bar();}", "foo");
|
| // 012345678901234567890
|
| @@ -1329,7 +1334,7 @@ TEST(BreakPointThroughJavaScript) {
|
| foo->Run(context).ToLocalChecked();
|
| CHECK_EQ(8, break_point_hit_count);
|
|
|
| - v8::Debug::SetDebugEventListener(isolate, nullptr);
|
| + SetDebugEventListener(isolate, nullptr);
|
| CheckDebuggerUnloaded(isolate);
|
|
|
| // Make sure that the break point numbers are consecutive.
|
| @@ -1348,7 +1353,7 @@ TEST(ScriptBreakPointByNameThroughJavaScript) {
|
| v8::Local<v8::Context> context = env.context();
|
| env.ExposeDebug();
|
|
|
| - v8::Debug::SetDebugEventListener(isolate, DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(isolate, DebugEventBreakPointHitCount);
|
|
|
| v8::Local<v8::String> script = v8_str(isolate,
|
| "function f() {\n"
|
| @@ -1434,7 +1439,7 @@ TEST(ScriptBreakPointByNameThroughJavaScript) {
|
| g->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| CHECK_EQ(0, break_point_hit_count);
|
|
|
| - v8::Debug::SetDebugEventListener(isolate, nullptr);
|
| + SetDebugEventListener(isolate, nullptr);
|
| CheckDebuggerUnloaded(isolate);
|
|
|
| // Make sure that the break point numbers are consecutive.
|
| @@ -1455,7 +1460,7 @@ TEST(ScriptBreakPointByIdThroughJavaScript) {
|
| v8::Local<v8::Context> context = env.context();
|
| env.ExposeDebug();
|
|
|
| - v8::Debug::SetDebugEventListener(isolate, DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(isolate, DebugEventBreakPointHitCount);
|
|
|
| v8::Local<v8::String> source = v8_str(isolate,
|
| "function f() {\n"
|
| @@ -1543,7 +1548,7 @@ TEST(ScriptBreakPointByIdThroughJavaScript) {
|
| g->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| CHECK_EQ(0, break_point_hit_count);
|
|
|
| - v8::Debug::SetDebugEventListener(isolate, nullptr);
|
| + SetDebugEventListener(isolate, nullptr);
|
| CheckDebuggerUnloaded(isolate);
|
|
|
| // Make sure that the break point numbers are consecutive.
|
| @@ -1565,7 +1570,7 @@ TEST(EnableDisableScriptBreakPoint) {
|
| v8::Local<v8::Context> context = env.context();
|
| env.ExposeDebug();
|
|
|
| - v8::Debug::SetDebugEventListener(isolate, DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(isolate, DebugEventBreakPointHitCount);
|
|
|
| v8::Local<v8::String> script = v8_str(isolate,
|
| "function f() {\n"
|
| @@ -1601,7 +1606,7 @@ TEST(EnableDisableScriptBreakPoint) {
|
| f->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| CHECK_EQ(2, break_point_hit_count);
|
|
|
| - v8::Debug::SetDebugEventListener(isolate, nullptr);
|
| + SetDebugEventListener(isolate, nullptr);
|
| CheckDebuggerUnloaded(isolate);
|
| }
|
|
|
| @@ -1613,8 +1618,7 @@ TEST(ConditionalScriptBreakPoint) {
|
| v8::HandleScope scope(env->GetIsolate());
|
| env.ExposeDebug();
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| - DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
|
|
|
| v8::Local<v8::String> script = v8_str(env->GetIsolate(),
|
| "count = 0;\n"
|
| @@ -1658,7 +1662,7 @@ TEST(ConditionalScriptBreakPoint) {
|
| }
|
| CHECK_EQ(5, break_point_hit_count);
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| + SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| }
|
|
|
| @@ -1670,8 +1674,7 @@ TEST(ScriptBreakPointMultiple) {
|
| v8::HandleScope scope(env->GetIsolate());
|
| env.ExposeDebug();
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| - DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
|
|
|
| v8::Local<v8::Context> context = env.context();
|
| v8::Local<v8::Function> f;
|
| @@ -1735,7 +1738,7 @@ TEST(ScriptBreakPointMultiple) {
|
| g->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| CHECK_EQ(2, break_point_hit_count);
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| + SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| }
|
|
|
| @@ -1747,8 +1750,7 @@ TEST(ScriptBreakPointLineOffset) {
|
| v8::HandleScope scope(env->GetIsolate());
|
| env.ExposeDebug();
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| - DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
|
|
|
| v8::Local<v8::Context> context = env.context();
|
| v8::Local<v8::Function> f;
|
| @@ -1801,7 +1803,7 @@ TEST(ScriptBreakPointLineOffset) {
|
| f->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| CHECK_EQ(1, break_point_hit_count);
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| + SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| }
|
|
|
| @@ -1817,8 +1819,7 @@ TEST(ScriptBreakPointLine) {
|
| frame_function_name_source,
|
| "frame_function_name");
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| - DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
|
|
|
| v8::Local<v8::Context> context = env.context();
|
| v8::Local<v8::Function> f;
|
| @@ -1916,7 +1917,7 @@ TEST(ScriptBreakPointLine) {
|
| ClearBreakPointFromJS(env->GetIsolate(), sbp5);
|
| ClearBreakPointFromJS(env->GetIsolate(), sbp6);
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| + SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| }
|
|
|
| @@ -1927,8 +1928,7 @@ TEST(ScriptBreakPointLineTopLevel) {
|
| v8::HandleScope scope(env->GetIsolate());
|
| env.ExposeDebug();
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| - DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
|
|
|
| v8::Local<v8::Context> context = env.context();
|
| v8::Local<v8::String> script =
|
| @@ -1961,7 +1961,7 @@ TEST(ScriptBreakPointLineTopLevel) {
|
| CompileRunWithOrigin(script, "test.html");
|
| CHECK_EQ(0, break_point_hit_count);
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| + SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| }
|
|
|
| @@ -1973,8 +1973,7 @@ TEST(ScriptBreakPointTopLevelCrash) {
|
| v8::HandleScope scope(env->GetIsolate());
|
| env.ExposeDebug();
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| - DebugEventBreakPointHitCount);
|
| + SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
|
|
|
| CompileRunWithOrigin(
|
| "function f() {\n"
|
| @@ -1994,7 +1993,7 @@ TEST(ScriptBreakPointTopLevelCrash) {
|
| ClearBreakPointFromJS(env->GetIsolate(), sbp1);
|
| ClearBreakPointFromJS(env->GetIsolate(), sbp2);
|
|
|
| - v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| + SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| }
|
|
|
| @@ -3954,7 +3953,7 @@ TEST(DebugBreak) {
|
| f3->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
|
|
| // Set the debug break flag.
|
| - v8::Debug::DebugBreak(env->GetIsolate());
|
| + v8::debug::DebugBreak(env->GetIsolate());
|
|
|
| // Call all functions with different argument count.
|
| break_point_hit_count = 0;
|
| @@ -3989,11 +3988,11 @@ TEST(DisableBreak) {
|
| v8::Local<v8::Function> f = CompileFunction(&env, src, "f");
|
|
|
| // Set, test and cancel debug break.
|
| - v8::Debug::DebugBreak(env->GetIsolate());
|
| + v8::debug::DebugBreak(env->GetIsolate());
|
| v8::Debug::CancelDebugBreak(env->GetIsolate());
|
|
|
| // Set the debug break flag.
|
| - v8::Debug::DebugBreak(env->GetIsolate());
|
| + v8::debug::DebugBreak(env->GetIsolate());
|
|
|
| // Call all functions with different argument count.
|
| break_point_hit_count = 0;
|
| @@ -4001,7 +4000,7 @@ TEST(DisableBreak) {
|
| CHECK_EQ(1, break_point_hit_count);
|
|
|
| {
|
| - v8::Debug::DebugBreak(env->GetIsolate());
|
| + v8::debug::DebugBreak(env->GetIsolate());
|
| i::Isolate* isolate = reinterpret_cast<i::Isolate*>(env->GetIsolate());
|
| v8::internal::DisableBreak disable_break(isolate->debug());
|
| f->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| @@ -4047,7 +4046,7 @@ TEST(NoBreakWhenBootstrapping) {
|
| v8::Debug::SetDebugEventListener(isolate, DebugEventCounter);
|
|
|
| // Set the debug break flag.
|
| - v8::Debug::DebugBreak(isolate);
|
| + v8::debug::DebugBreak(isolate);
|
| break_point_hit_count = 0;
|
| {
|
| // Create a context with an extension to make sure that some JavaScript
|
| @@ -4593,7 +4592,7 @@ TEST(NoHiddenProperties) {
|
|
|
|
|
| TEST(SetDebugEventListenerOnUninitializedVM) {
|
| - v8::Debug::SetDebugEventListener(CcTest::isolate(), DummyDebugEventListener);
|
| + EnableDebugger(CcTest::isolate());
|
| }
|
|
|
| // Source for a JavaScript function which returns the data parameter of a
|
| @@ -4623,9 +4622,9 @@ v8::Local<v8::Function> debugger_call_with_closure;
|
| // in the debugger.
|
| static void CheckFrameCount(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
| v8::Local<v8::Context> context = args.GetIsolate()->GetCurrentContext();
|
| - CHECK(v8::Debug::Call(context, frame_count).ToLocalChecked()->IsNumber());
|
| + CHECK(v8::debug::Call(context, frame_count).ToLocalChecked()->IsNumber());
|
| CHECK_EQ(args[0]->Int32Value(context).FromJust(),
|
| - v8::Debug::Call(context, frame_count)
|
| + v8::debug::Call(context, frame_count)
|
| .ToLocalChecked()
|
| ->Int32Value(context)
|
| .FromJust());
|
| @@ -4637,9 +4636,9 @@ static void CheckFrameCount(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
| static void CheckSourceLine(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
| v8::Local<v8::Context> context = args.GetIsolate()->GetCurrentContext();
|
| CHECK(
|
| - v8::Debug::Call(context, frame_source_line).ToLocalChecked()->IsNumber());
|
| + v8::debug::Call(context, frame_source_line).ToLocalChecked()->IsNumber());
|
| CHECK_EQ(args[0]->Int32Value(context).FromJust(),
|
| - v8::Debug::Call(context, frame_source_line)
|
| + v8::debug::Call(context, frame_source_line)
|
| .ToLocalChecked()
|
| ->Int32Value(context)
|
| .FromJust());
|
| @@ -4653,13 +4652,13 @@ static void CheckDataParameter(
|
| const v8::FunctionCallbackInfo<v8::Value>& args) {
|
| v8::Local<v8::String> data = v8_str(args.GetIsolate(), "Test");
|
| v8::Local<v8::Context> context = args.GetIsolate()->GetCurrentContext();
|
| - CHECK(v8::Debug::Call(context, debugger_call_with_data, data)
|
| + CHECK(v8::debug::Call(context, debugger_call_with_data, data)
|
| .ToLocalChecked()
|
| ->IsString());
|
|
|
| for (int i = 0; i < 3; i++) {
|
| v8::TryCatch catcher(args.GetIsolate());
|
| - CHECK(v8::Debug::Call(context, debugger_call_with_data).IsEmpty());
|
| + CHECK(v8::debug::Call(context, debugger_call_with_data).IsEmpty());
|
| CHECK(catcher.HasCaught());
|
| CHECK(catcher.Exception()->IsString());
|
| }
|
| @@ -4669,10 +4668,10 @@ static void CheckDataParameter(
|
| // Function to test using a JavaScript with closure in the debugger.
|
| static void CheckClosure(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
| v8::Local<v8::Context> context = args.GetIsolate()->GetCurrentContext();
|
| - CHECK(v8::Debug::Call(context, debugger_call_with_closure)
|
| + CHECK(v8::debug::Call(context, debugger_call_with_closure)
|
| .ToLocalChecked()
|
| ->IsNumber());
|
| - CHECK_EQ(3, v8::Debug::Call(context, debugger_call_with_closure)
|
| + CHECK_EQ(3, v8::debug::Call(context, debugger_call_with_closure)
|
| .ToLocalChecked()
|
| ->Int32Value(context)
|
| .FromJust());
|
| @@ -4741,7 +4740,7 @@ TEST(CallFunctionInDebugger) {
|
| // no JavaScript frames.
|
| CHECK(v8::Integer::New(isolate, 0)
|
| ->Equals(context,
|
| - v8::Debug::Call(context, frame_count).ToLocalChecked())
|
| + v8::debug::Call(context, frame_count).ToLocalChecked())
|
| .FromJust());
|
|
|
| // Test that the number of frames can be retrieved.
|
| @@ -5102,7 +5101,7 @@ static void DebugBreakEventListener(const v8::Debug::EventDetails& details) {
|
| if (details.GetEvent() == v8::Break) {
|
| event_listener_break_hit_count++;
|
| if (event_listener_break_hit_count == 1) {
|
| - v8::Debug::DebugBreak(details.GetIsolate());
|
| + v8::debug::DebugBreak(details.GetIsolate());
|
| }
|
| }
|
| }
|
| @@ -5170,7 +5169,7 @@ static void DebugEventDebugBreak(
|
|
|
| // Keep forcing breaks.
|
| if (break_point_hit_count < 20) {
|
| - v8::Debug::DebugBreak(CcTest::isolate());
|
| + v8::debug::DebugBreak(CcTest::isolate());
|
| }
|
| }
|
| }
|
| @@ -5201,7 +5200,7 @@ TEST(RegExpDebugBreak) {
|
| CHECK_EQ(12, result->Int32Value(context).FromJust());
|
|
|
| v8::Debug::SetDebugEventListener(env->GetIsolate(), DebugEventDebugBreak);
|
| - v8::Debug::DebugBreak(env->GetIsolate());
|
| + v8::debug::DebugBreak(env->GetIsolate());
|
| result = f->Call(context, env->Global(), argc, argv).ToLocalChecked();
|
|
|
| // Check that there was only one break event. Matching RegExp should not
|
| @@ -5283,7 +5282,7 @@ TEST(AfterCompileEventWhenEventListenerIsReset) {
|
|
|
| v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| AfterCompileEventListener);
|
| - v8::Debug::DebugBreak(env->GetIsolate());
|
| + v8::debug::DebugBreak(env->GetIsolate());
|
| v8::Script::Compile(context, v8_str(env->GetIsolate(), script))
|
| .ToLocalChecked()
|
| ->Run(context)
|
| @@ -5376,7 +5375,7 @@ TEST(BreakEventWhenEventListenerIsReset) {
|
|
|
| v8::Debug::SetDebugEventListener(env->GetIsolate(),
|
| AfterCompileEventListener);
|
| - v8::Debug::DebugBreak(env->GetIsolate());
|
| + v8::debug::DebugBreak(env->GetIsolate());
|
| v8::Local<v8::Function> f = v8::Local<v8::Function>::Cast(
|
| env->Global()
|
| ->Get(context, v8_str(env->GetIsolate(), "f"))
|
| @@ -5491,7 +5490,7 @@ TEST(NoDebugBreakInAfterCompileEventListener) {
|
| v8::Debug::SetDebugEventListener(env->GetIsolate(), BreakEventListener);
|
|
|
| // Set the debug break flag.
|
| - v8::Debug::DebugBreak(env->GetIsolate());
|
| + v8::debug::DebugBreak(env->GetIsolate());
|
|
|
| // Create a function for testing stepping.
|
| const char* src = "function f() { eval('var x = 10;'); } ";
|
| @@ -5501,7 +5500,7 @@ TEST(NoDebugBreakInAfterCompileEventListener) {
|
| CHECK_EQ(1, break_point_hit_count);
|
|
|
| // Set the debug break flag again.
|
| - v8::Debug::DebugBreak(env->GetIsolate());
|
| + v8::debug::DebugBreak(env->GetIsolate());
|
| f->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| // There should be one more break event when the script is evaluated in 'f'.
|
| CHECK_EQ(2, break_point_hit_count);
|
| @@ -5530,7 +5529,7 @@ TEST(DebugBreakFunctionApply) {
|
| v8::Debug::SetDebugEventListener(env->GetIsolate(), DebugEventBreakMax);
|
|
|
| // Set the debug break flag before calling the code using function.apply.
|
| - v8::Debug::DebugBreak(env->GetIsolate());
|
| + v8::debug::DebugBreak(env->GetIsolate());
|
|
|
| // Limit the number of debug breaks. This is a regression test for issue 493
|
| // where this test would enter an infinite loop.
|
| @@ -5688,7 +5687,7 @@ static void DebugEventBreakDeoptimize(
|
| }
|
| }
|
|
|
| - v8::Debug::DebugBreak(CcTest::isolate());
|
| + v8::debug::DebugBreak(CcTest::isolate());
|
| }
|
| }
|
|
|
| @@ -5719,7 +5718,7 @@ TEST(DeoptimizeDuringDebugBreak) {
|
| f->Call(context, v8::Undefined(env->GetIsolate()), 0, NULL).ToLocalChecked();
|
|
|
| // Set debug break and call bar again.
|
| - v8::Debug::DebugBreak(env->GetIsolate());
|
| + v8::debug::DebugBreak(env->GetIsolate());
|
| f->Call(context, v8::Undefined(env->GetIsolate()), 0, NULL).ToLocalChecked();
|
|
|
| CHECK(debug_event_break_deoptimize_done);
|
| @@ -5793,7 +5792,7 @@ static void DebugEventBreakWithOptimizedStack(
|
| static void ScheduleBreak(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
| v8::Debug::SetDebugEventListener(args.GetIsolate(),
|
| DebugEventBreakWithOptimizedStack);
|
| - v8::Debug::DebugBreak(args.GetIsolate());
|
| + v8::debug::DebugBreak(args.GetIsolate());
|
| }
|
|
|
|
|
| @@ -5866,7 +5865,7 @@ static void TestDebugBreakInLoop(const char* loop_head,
|
| CompileRun(buffer.start());
|
|
|
| // Set the debug break to enter the debugger as soon as possible.
|
| - v8::Debug::DebugBreak(CcTest::isolate());
|
| + v8::debug::DebugBreak(CcTest::isolate());
|
|
|
| // Call function with infinite loop.
|
| CompileRun("f();");
|
| @@ -6115,7 +6114,7 @@ TEST(LiveEditEnabled) {
|
| v8::internal::FLAG_allow_natives_syntax = true;
|
| LocalContext env;
|
| v8::HandleScope scope(env->GetIsolate());
|
| - v8::Debug::SetLiveEditEnabled(env->GetIsolate(), true);
|
| + v8::debug::SetLiveEditEnabled(env->GetIsolate(), true);
|
| CompileRun("%LiveEditCompareStrings('', '')");
|
| }
|
|
|
| @@ -6124,7 +6123,7 @@ TEST(LiveEditDisabled) {
|
| v8::internal::FLAG_allow_natives_syntax = true;
|
| LocalContext env;
|
| v8::HandleScope scope(env->GetIsolate());
|
| - v8::Debug::SetLiveEditEnabled(env->GetIsolate(), false);
|
| + v8::debug::SetLiveEditEnabled(env->GetIsolate(), false);
|
| CompileRun("%LiveEditCompareStrings('', '')");
|
| }
|
|
|
| @@ -6171,7 +6170,7 @@ static void DebugBreakStackTraceListener(
|
|
|
|
|
| static void AddDebugBreak(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
| - v8::Debug::DebugBreak(args.GetIsolate());
|
| + v8::debug::DebugBreak(args.GetIsolate());
|
| }
|
|
|
|
|
| @@ -6238,7 +6237,7 @@ TEST(DebugBreakOffThreadTerminate) {
|
| TerminationThread terminator(isolate);
|
| terminator.Start();
|
| v8::TryCatch try_catch(env->GetIsolate());
|
| - v8::Debug::DebugBreak(isolate);
|
| + v8::debug::DebugBreak(isolate);
|
| CompileRun("while (true);");
|
| CHECK(try_catch.HasTerminated());
|
| }
|
| @@ -6459,8 +6458,9 @@ TEST(DisableTailCallElimination) {
|
|
|
| DebugLocalContext env;
|
| v8::Isolate* isolate = env->GetIsolate();
|
| + i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
| v8::HandleScope scope(isolate);
|
| - CHECK(v8::Debug::IsTailCallEliminationEnabled(isolate));
|
| + CHECK(i_isolate->is_tail_call_elimination_enabled());
|
|
|
| CompileRun(
|
| "'use strict'; \n"
|
| @@ -6497,12 +6497,12 @@ TEST(DisableTailCallElimination) {
|
| "");
|
| ExpectInt32("h();", 2);
|
| ExpectInt32("h(); %OptimizeFunctionOnNextCall(g); h();", 2);
|
| - v8::Debug::SetTailCallEliminationEnabled(isolate, false);
|
| - CHECK(!v8::Debug::IsTailCallEliminationEnabled(isolate));
|
| + i_isolate->SetTailCallEliminationEnabled(false);
|
| + CHECK(!i_isolate->is_tail_call_elimination_enabled());
|
| ExpectInt32("h();", 1);
|
| ExpectInt32("h(); %OptimizeFunctionOnNextCall(g); h();", 1);
|
| - v8::Debug::SetTailCallEliminationEnabled(isolate, true);
|
| - CHECK(v8::Debug::IsTailCallEliminationEnabled(isolate));
|
| + i_isolate->SetTailCallEliminationEnabled(true);
|
| + CHECK(i_isolate->is_tail_call_elimination_enabled());
|
| ExpectInt32("h();", 2);
|
| ExpectInt32("h(); %OptimizeFunctionOnNextCall(g); h();", 2);
|
| }
|
| @@ -6517,8 +6517,9 @@ TEST(DebugStepNextTailCallEliminiation) {
|
| DebugLocalContext env;
|
| env.ExposeDebug();
|
| v8::Isolate* isolate = env->GetIsolate();
|
| + i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
| v8::HandleScope scope(isolate);
|
| - CHECK(v8::Debug::IsTailCallEliminationEnabled(isolate));
|
| + CHECK(i_isolate->is_tail_call_elimination_enabled());
|
|
|
| const char* source =
|
| "'use strict'; \n"
|
| @@ -6554,7 +6555,7 @@ TEST(DebugStepNextTailCallEliminiation) {
|
| ExpectNull("exception");
|
| ExpectString("JSON.stringify(log)", "[\"a4\",\"b2\",\"c4\",\"c11\",\"d0\"]");
|
|
|
| - v8::Debug::SetTailCallEliminationEnabled(isolate, false);
|
| + i_isolate->SetTailCallEliminationEnabled(false);
|
| CompileRun(
|
| "log = []; \n"
|
| "Debug.setListener(listener); \n"
|
|
|