Commit 6cb59037 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

Split test-debug/BreakPointBuiltin into smaller tests.

This is to better pinpoint win64 failures.

TBR=bmeurer@chromium.org

Bug: v8:178
Change-Id: If778352cad1f209927067a12d5684e62c4ead8d2
Reviewed-on: https://chromium-review.googlesource.com/955687Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51818}
parent a71e5f9a
......@@ -234,9 +234,6 @@
##############################################################################
['system == windows', {
# BUG(178). Currently crashes on Windows.
'test-debug/BreakPointBuiltin': [SKIP],
# BUG(3331). Fails on windows.
'test-heap/NoWeakHashTableLeakWithIncrementalMarking': [SKIP],
......
......@@ -1048,11 +1048,7 @@ TEST(BreakPointReturn) {
CheckDebuggerUnloaded();
}
// Test that a break point can be set at a return store location.
TEST(BreakPointBuiltin) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_block_concurrent_recompilation = true;
i::FLAG_experimental_inline_promise_constructor = true;
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
......@@ -1078,6 +1074,19 @@ TEST(BreakPointBuiltin) {
ExpectString("'b'.repeat(10)", "bbbbbbbbbb");
CHECK_EQ(2, break_point_hit_count);
SetDebugEventListener(env->GetIsolate(), nullptr);
CheckDebuggerUnloaded();
}
TEST(BreakPointJSBuiltin) {
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
v8::Local<v8::Function> builtin;
i::Handle<i::BreakPoint> bp;
// === Test JS builtin ===
break_point_hit_count = 0;
builtin = CompileRun("Array.prototype.sort").As<v8::Function>();
......@@ -1095,6 +1104,19 @@ TEST(BreakPointBuiltin) {
CompileRun("[1,2,3].sort()");
CHECK_EQ(2, break_point_hit_count);
SetDebugEventListener(env->GetIsolate(), nullptr);
CheckDebuggerUnloaded();
}
TEST(BreakPointBoundBuiltin) {
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
v8::Local<v8::Function> builtin;
i::Handle<i::BreakPoint> bp;
// === Test bound function from a builtin ===
break_point_hit_count = 0;
builtin = CompileRun(
......@@ -1114,6 +1136,19 @@ TEST(BreakPointBuiltin) {
ExpectString("boundrepeat(10)", "aaaaaaaaaa");
CHECK_EQ(1, break_point_hit_count);
SetDebugEventListener(env->GetIsolate(), nullptr);
CheckDebuggerUnloaded();
}
TEST(BreakPointConstructorBuiltin) {
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
v8::Local<v8::Function> builtin;
i::Handle<i::BreakPoint> bp;
// === Test constructor builtin (for ones with normal construct stubs) ===
break_point_hit_count = 0;
builtin = CompileRun("Promise").As<v8::Function>();
......@@ -1130,6 +1165,20 @@ TEST(BreakPointBuiltin) {
ExpectString("(new Promise(()=>{})).toString()", "[object Promise]");
CHECK_EQ(1, break_point_hit_count);
SetDebugEventListener(env->GetIsolate(), nullptr);
CheckDebuggerUnloaded();
}
TEST(BreakPointInlinedBuiltin) {
i::FLAG_allow_natives_syntax = true;
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
v8::Local<v8::Function> builtin;
i::Handle<i::BreakPoint> bp;
// === Test inlined builtin ===
break_point_hit_count = 0;
builtin = CompileRun("Math.sin").As<v8::Function>();
......@@ -1156,9 +1205,27 @@ TEST(BreakPointBuiltin) {
CompileRun("test(0.3);");
CHECK_EQ(3, break_point_hit_count);
SetDebugEventListener(env->GetIsolate(), nullptr);
CheckDebuggerUnloaded();
}
TEST(BreakPointInlineBoundBuiltin) {
i::FLAG_allow_natives_syntax = true;
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
v8::Local<v8::Function> builtin;
i::Handle<i::BreakPoint> bp;
// === Test inlined bound builtin ===
break_point_hit_count = 0;
builtin = CompileRun("String.prototype.repeat").As<v8::Function>();
builtin = CompileRun(
"var boundrepeat = String.prototype.repeat.bind('a');"
"String.prototype.repeat")
.As<v8::Function>();
CompileRun("function test(x) { return 'a' + boundrepeat(x) }");
CompileRun(
"test(4); test(5);"
......@@ -1182,6 +1249,21 @@ TEST(BreakPointBuiltin) {
CompileRun("test(9);");
CHECK_EQ(3, break_point_hit_count);
SetDebugEventListener(env->GetIsolate(), nullptr);
CheckDebuggerUnloaded();
}
TEST(BreakPointInlinedConstructorBuiltin) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_experimental_inline_promise_constructor = true;
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
v8::Local<v8::Function> builtin;
i::Handle<i::BreakPoint> bp;
// === Test inlined constructor builtin (regular construct builtin) ===
break_point_hit_count = 0;
builtin = CompileRun("Promise").As<v8::Function>();
......@@ -1208,6 +1290,21 @@ TEST(BreakPointBuiltin) {
CompileRun("test(9);");
CHECK_EQ(3, break_point_hit_count);
SetDebugEventListener(env->GetIsolate(), nullptr);
CheckDebuggerUnloaded();
}
TEST(BreakPointBuiltinConcurrentOpt) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_block_concurrent_recompilation = true;
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
v8::Local<v8::Function> builtin;
i::Handle<i::BreakPoint> bp;
// === Test concurrent optimization ===
break_point_hit_count = 0;
builtin = CompileRun("Math.sin").As<v8::Function>();
......@@ -1232,6 +1329,20 @@ TEST(BreakPointBuiltin) {
CompileRun("test(0.3);");
CHECK_EQ(1, break_point_hit_count);
SetDebugEventListener(env->GetIsolate(), nullptr);
CheckDebuggerUnloaded();
}
TEST(BreakPointBuiltinTFOperator) {
i::FLAG_allow_natives_syntax = true;
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
v8::Local<v8::Function> builtin;
i::Handle<i::BreakPoint> bp;
// === Test builtin represented as operator ===
break_point_hit_count = 0;
builtin = CompileRun("String.prototype.indexOf").As<v8::Function>();
......@@ -1258,6 +1369,19 @@ TEST(BreakPointBuiltin) {
CompileRun("test('f');");
CHECK_EQ(3, break_point_hit_count);
SetDebugEventListener(env->GetIsolate(), nullptr);
CheckDebuggerUnloaded();
}
TEST(BreakPointBuiltinNewContext) {
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
SetDebugEventListener(env->GetIsolate(), DebugEventBreakPointHitCount);
v8::Local<v8::Function> builtin;
i::Handle<i::BreakPoint> bp;
// === Test builtin from a new context ===
// This does not work with no-snapshot build.
#ifdef V8_USE_SNAPSHOT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment