v8/test/inspector/debugger/step-into-expected.txt

1030 lines
14 KiB
Plaintext
Raw Normal View History

Checks possible break locations.
Running test: testEval
break at:
function testEval() {
#eval('// comment only');
eval('// comment only\n');
break at:
// comment onl#y
break at:
eval('// comment only');
#eval('// comment only\n');
}
break at:
// comment only#
break at:
eval('// comment only\n');
#}
Running test: testProcedure
break at:
function testProcedure() {
#procedure();
}
break at:
function procedure() {
var a = #1;
var b = 2;
break at:
var a = 1;
var b = #2;
}
break at:
var b = 2;
#}
break at:
procedure();
#}
Running test: testIf
break at:
var a;
if (true) #a = true;
if (!a) {
break at:
if (true) a = true;
#if (!a) {
a = true;
break at:
} else {
#a = false;
}
break at:
}
#if (returnTrue()) {
a = false;
break at:
function returnTrue() {
#return true;
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
function returnTrue() {
return true;#
}
break at:
if (returnTrue()) {
#a = false;
} else {
break at:
}
#}
Running test: testEmptyFunction
break at:
function testEmptyFunction() {
#emptyFunction();
}
break at:
function emptyFunction() {#}
break at:
emptyFunction();
#}
Running test: testCallArguments
break at:
function testCallArguments() {
#twoArguments(emptyFunction(), emptyFunction());
}
break at:
function emptyFunction() {#}
break at:
function testCallArguments() {
twoArguments(emptyFunction(), #emptyFunction());
}
break at:
function emptyFunction() {#}
break at:
function testCallArguments() {
#twoArguments(emptyFunction(), emptyFunction());
}
break at:
function twoArguments(a1, a2) {
#}
break at:
twoArguments(emptyFunction(), emptyFunction());
#}
Running test: testNested
break at:
}
#nested1();
}
break at:
}
#return nested2();
}
break at:
}
#nested3();
return;
break at:
function nested3() {
#}
nested3();
break at:
nested3();
#return;
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
nested3();
return;#
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
}
return nested2();#
}
break at:
nested1();
#}
Running test: testCallAtReturn
break at:
function testCallAtReturn() {
#return returnCall();
}
break at:
function returnCall() {
#return return42();
}
break at:
function return42() {
#return 42;
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
function return42() {
return 42;#
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
function returnCall() {
return return42();#
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
function testCallAtReturn() {
return returnCall();#
}
Running test: testWith
break at:
function testWith() {
#with (returnObject()) {
foo();
break at:
function returnObject() {
#return ({ foo: () => 42 });
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
function returnObject() {
return ({ foo: () => 42 });#
}
break at:
with (returnObject()) {
#foo();
}
break at:
function returnObject() {
return ({ foo: () => #42 });
}
break at:
function returnObject() {
return ({ foo: () => 42# });
}
break at:
}
#with({}) {
return;
break at:
with({}) {
#return;
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
with({}) {
return;#
}
Running test: testForLoop
break at:
function testForLoop() {
for (var i = #0; i < 1; ++i) {}
for (var i = 0; i < 1; ++i) i;
break at:
function testForLoop() {
for (var i = 0; i #< 1; ++i) {}
for (var i = 0; i < 1; ++i) i;
break at:
function testForLoop() {
for (var i = 0; i < 1; ++#i) {}
for (var i = 0; i < 1; ++i) i;
break at:
function testForLoop() {
for (var i = 0; i #< 1; ++i) {}
for (var i = 0; i < 1; ++i) i;
break at:
for (var i = 0; i < 1; ++i) {}
for (var i = #0; i < 1; ++i) i;
for (var i = 0; i < 0; ++i) {}
break at:
for (var i = 0; i < 1; ++i) {}
for (var i = 0; i #< 1; ++i) i;
for (var i = 0; i < 0; ++i) {}
break at:
for (var i = 0; i < 1; ++i) {}
for (var i = 0; i < 1; ++i) #i;
for (var i = 0; i < 0; ++i) {}
break at:
for (var i = 0; i < 1; ++i) {}
for (var i = 0; i < 1; ++#i) i;
for (var i = 0; i < 0; ++i) {}
break at:
for (var i = 0; i < 1; ++i) {}
for (var i = 0; i #< 1; ++i) i;
for (var i = 0; i < 0; ++i) {}
break at:
for (var i = 0; i < 1; ++i) i;
for (var i = #0; i < 0; ++i) {}
}
break at:
for (var i = 0; i < 1; ++i) i;
for (var i = 0; i #< 0; ++i) {}
}
break at:
for (var i = 0; i < 0; ++i) {}
#}
Running test: testForOfLoop
break at:
function testForOfLoop() {
for (var k of #[]) {}
for (var k of [1]) k;
break at:
function testForOfLoop() {
for (var #k of []) {}
for (var k of [1]) k;
break at:
for (var k of []) {}
for (var k of #[1]) k;
var a = [];
break at:
for (var k of []) {}
for (var #k of [1]) k;
var a = [];
break at:
for (var k of []) {}
for (var k of [1]) #k;
var a = [];
break at:
for (var k of []) {}
for (var #k of [1]) k;
var a = [];
break at:
for (var k of [1]) k;
var a = #[];
for (var k of a) {}
break at:
var a = [];
for (var k of #a) {}
}
break at:
var a = [];
for (var #k of a) {}
}
break at:
for (var k of a) {}
#}
Running test: testForInLoop
break at:
function testForInLoop() {
var o = #{};
for (var k in o) {}
break at:
var o = {};
for (var k in #o) {}
for (var k in o) k;
break at:
var o = {};
for (var #k in o) {}
for (var k in o) k;
break at:
for (var k in o) {}
for (var k in #o) k;
for (var k in { a:1 }) {}
break at:
for (var k in o) {}
for (var #k in o) k;
for (var k in { a:1 }) {}
break at:
for (var k in o) k;
for (var k in #{ a:1 }) {}
for (var k in { a:1 }) k;
break at:
for (var k in o) k;
for (var #k in { a:1 }) {}
for (var k in { a:1 }) k;
break at:
for (var k in { a:1 }) {}
for (var k in #{ a:1 }) k;
}
break at:
for (var k in { a:1 }) {}
for (var #k in { a:1 }) k;
}
break at:
for (var k in { a:1 }) {}
for (var k in { a:1 }) #k;
}
break at:
for (var k in { a:1 }) {}
for (var #k in { a:1 }) k;
}
break at:
for (var k in { a:1 }) k;
#}
Running test: testSimpleExpressions
break at:
1 + 2 + 3;
var a = #1;
++a;
break at:
var a = 1;
#++a;
a--;
break at:
++a;
#a--;
}
break at:
a--;
#}
Running test: testGetter
break at:
function testGetter() {
#getterFoo();
}
break at:
Object.defineProperty(this, 'getterFoo', {
get: () => #return42
});
break at:
Object.defineProperty(this, 'getterFoo', {
get: () => return42#
});
break at:
function testGetter() {
#getterFoo();
}
break at:
function return42() {
#return 42;
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
function return42() {
return 42;#
}
break at:
getterFoo();
#}
Running test: testChainedCalls
break at:
function testChainedCalls() {
#obj.foo().boo()();
}
break at:
var obj = {
foo: () => (#{
boo: () => return42
break at:
boo: () => return42
})#
};
break at:
function testChainedCalls() {
obj.foo().#boo()();
}
break at:
foo: () => ({
boo: () => #return42
})
break at:
foo: () => ({
boo: () => return42#
})
break at:
function testChainedCalls() {
obj.foo().boo()#();
}
break at:
function return42() {
#return 42;
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
function return42() {
return 42;#
}
break at:
obj.foo().boo()();
#}
Running test: testChainedWithNative
break at:
function testChainedWithNative() {
#Array.from([1]).concat([2]).map(v => v * 2);
}
break at:
function testChainedWithNative() {
Array.from([1]).concat([2]).map(v => v #* 2);
}
break at:
function testChainedWithNative() {
Array.from([1]).concat([2]).map(v => v * 2#);
}
break at:
function testChainedWithNative() {
Array.from([1]).concat([2]).map(v => v #* 2);
}
break at:
function testChainedWithNative() {
Array.from([1]).concat([2]).map(v => v * 2#);
}
break at:
Array.from([1]).concat([2]).map(v => v * 2);
#}
Running test: testPromiseThen
break at:
function testPromiseThen() {
#return Promise.resolve().then(v => v * 2).then(v => v * 2);
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
function testPromiseThen() {
return Promise.resolve().then(v => v * 2).then(v => v * 2);#
}
Running test: testSwitch
break at:
function testSwitch() {
for (var i = #0; i < 3; ++i) {
switch(i) {
break at:
function testSwitch() {
for (var i = 0; i #< 3; ++i) {
switch(i) {
break at:
for (var i = 0; i < 3; ++i) {
#switch(i) {
case 0: continue;
break at:
switch(i) {
case 0: #continue;
case 1: return42(); break;
break at:
function testSwitch() {
for (var i = 0; i < 3; ++#i) {
switch(i) {
break at:
function testSwitch() {
for (var i = 0; i #< 3; ++i) {
switch(i) {
break at:
for (var i = 0; i < 3; ++i) {
#switch(i) {
case 0: continue;
break at:
case 0: continue;
case 1: #return42(); break;
default: return;
break at:
function return42() {
#return 42;
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
function return42() {
return 42;#
}
break at:
case 0: continue;
case 1: return42(); #break;
default: return;
break at:
function testSwitch() {
for (var i = 0; i < 3; ++#i) {
switch(i) {
break at:
function testSwitch() {
for (var i = 0; i #< 3; ++i) {
switch(i) {
break at:
for (var i = 0; i < 3; ++i) {
#switch(i) {
case 0: continue;
break at:
case 1: return42(); break;
default: #return;
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
case 1: return42(); break;
default: return;#
}
Running test: testGenerator
break at:
function testGenerator() {
var gen = #idMaker();
return42();
break at:
function* idMaker() {
#yield 1;
yield 2;
break at:
gen.next().value;
#debugger;
gen.next().value;
break at:
debugger;
#gen.next().value;
return42();
break at:
yield 1;
#yield 2;
yield 3;
break at:
yield 2;
#yield 3;
}
break at:
yield 3;
#}
break at:
gen.next().value;
#}
Running test: testCaughtException
break at:
try {
#throwException()
} catch (e) {
break at:
function throwException() {
#throw new Error();
}
break at:
} catch (e) {
#return;
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
} catch (e) {
return;#
}
Running test: testClasses
break at:
}
#new Lion().speak();
}
break at:
constructor(name) {
#super(name);
}
break at:
constructor(name) {
#this.name = name;
}
break at:
this.name = name;
#}
break at:
super(name);
#}
break at:
}
new Lion().#speak();
}
break at:
speak() {
#super.speak();
}
break at:
speak() {
#}
}
break at:
super.speak();
#}
}
break at:
new Lion().speak();
#}
Running test: testAsyncAwait
break at:
async function testAsyncAwait() {
#await asyncFoo();
await awaitBoo();
break at:
async function asyncFoo() {
#await Promise.resolve().then(v => v * 2);
return42();
break at:
function return42() {
#return 42;
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
function return42() {
return 42;#
}
break at:
async function asyncBoo() {
#await Promise.resolve();
}
Running test: testPromiseAsyncWithCode
break at:
var nextTest;
var testPromise = #new Promise(resolve => nextTest = resolve);
async function main() {
break at:
var nextTest;
var testPromise = new Promise(resolve => nextTest #= resolve);
async function main() {
break at:
var nextTest;
var testPromise = new Promise(resolve => nextTest = resolve#);
async function main() {
break at:
}
#main();
return testPromise;
break at:
}
#setTimeout(returnCall, 0);
await foo();
break at:
setTimeout(returnCall, 0);
#await foo();
await foo();
break at:
var resolveNested;
var p = #new Promise(resolve => resolveNested = resolve);
setTimeout(resolveNested, 0);
break at:
var resolveNested;
var p = new Promise(resolve => resolveNested #= resolve);
setTimeout(resolveNested, 0);
break at:
var resolveNested;
var p = new Promise(resolve => resolveNested = resolve#);
setTimeout(resolveNested, 0);
break at:
var p = new Promise(resolve => resolveNested = resolve);
#setTimeout(resolveNested, 0);
await p;
break at:
setTimeout(resolveNested, 0);
#await p;
}
break at:
var resolveNested;
var p = #new Promise(resolve => resolveNested = resolve);
setTimeout(resolveNested, 0);
break at:
var resolveNested;
var p = new Promise(resolve => resolveNested #= resolve);
setTimeout(resolveNested, 0);
break at:
var resolveNested;
var p = new Promise(resolve => resolveNested = resolve#);
setTimeout(resolveNested, 0);
break at:
var p = new Promise(resolve => resolveNested = resolve);
#setTimeout(resolveNested, 0);
await p;
break at:
setTimeout(resolveNested, 0);
#await p;
}
Running test: testPromiseComplex
break at:
var nextTest;
var testPromise = #new Promise(resolve => nextTest = resolve);
async function main() {
break at:
var nextTest;
var testPromise = new Promise(resolve => nextTest #= resolve);
async function main() {
break at:
var nextTest;
var testPromise = new Promise(resolve => nextTest = resolve#);
async function main() {
break at:
}
#main();
return testPromise;
break at:
}
var x = #1;
var y = 2;
break at:
var x = 1;
var y = #2;
returnFunction(emptyFunction(), x++, --y, x => 2 * x, returnCall())().a = await foo((a => 2 *a)(5));
break at:
var y = 2;
#returnFunction(emptyFunction(), x++, --y, x => 2 * x, returnCall())().a = await foo((a => 2 *a)(5));
nextTest();
break at:
function emptyFunction() {#}
break at:
var y = 2;
returnFunction(emptyFunction(), x++, --y, x => 2 * x, #returnCall())().a = await foo((a => 2 *a)(5));
nextTest();
break at:
function returnCall() {
#return return42();
}
break at:
function return42() {
#return 42;
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
function return42() {
return 42;#
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
function returnCall() {
return return42();#
}
break at:
var y = 2;
#returnFunction(emptyFunction(), x++, --y, x => 2 * x, returnCall())().a = await foo((a => 2 *a)(5));
nextTest();
break at:
function returnFunction() {
#return returnObject;
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
function returnFunction() {
return returnObject;#
}
break at:
var y = 2;
returnFunction(emptyFunction(), x++, --y, x => 2 * x, returnCall())#().a = await foo((a => 2 *a)(5));
nextTest();
break at:
function returnObject() {
#return ({ foo: () => 42 });
}
break at:
[inspector] improve return position of explicit return in non-async function Goal of this CL: explicit return from non-async function has position after return expression as return position (will unblock [1]). BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods. If one of these methods is called then next generated bytecode will get passed position. It's general treatment for most cases. Unfortunately it doesn't work for Returns: - debugger requires source positions exactly on kReturn bytecode in stepping implementation, - BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn generates more then one bytecode and general solution will put return position on first generated bytecode, - it's not easy to split BuildReturn function into two parts to allow something like following in BytecodeGenerator::VisitReturnStatement since generated bytecodes are actually controlled by execution_control(). ..->BuildReturnPrologue(); ..->SetReturnPosition(stmt); ..->Return(); In this CL we pass ReturnStatement through ExecutionControl and use it for position when we emit return bytecode right here. So this CL only will improve return position for returns inside of non-async functions, I'll address async functions later. [1] https://chromium-review.googlesource.com/c/543161/ Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db Reviewed-on: https://chromium-review.googlesource.com/560738 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 17:50:09 +00:00
function returnObject() {
return ({ foo: () => 42 });#
}
break at:
var y = 2;
returnFunction(emptyFunction(), x++, --y, x => 2 * x, returnCall())().a = await foo((a => 2 *a)#(5));
nextTest();
break at:
var y = 2;
returnFunction(emptyFunction(), x++, --y, x => 2 * x, returnCall())().a = await foo((a => 2 #*a)(5));
nextTest();
break at:
var y = 2;
returnFunction(emptyFunction(), x++, --y, x => 2 * x, returnCall())().a = await foo((a => 2 *a#)(5));
nextTest();
break at:
var y = 2;
returnFunction(emptyFunction(), x++, --y, x => 2 * x, returnCall())().a = await #foo((a => 2 *a)(5));
nextTest();
break at:
async function foo() {
#await Promise.resolve();
return 42;