Commit f7e7ba11 authored by yangguo's avatar yangguo Committed by Commit bot

[interpreter] add some expression positions.

Statement positions should overwrite expression positions if they
have the same bytecode offset.

R=mstarzinger@chromium.org, vogelheim@chromium.org
BUG=v8:4680,v8:4689
LOG=N

Review URL: https://codereview.chromium.org/1855913002

Cr-Commit-Position: refs/heads/master@{#35236}
parent 3fabe1a4
...@@ -1747,6 +1747,7 @@ void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { ...@@ -1747,6 +1747,7 @@ void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
void BytecodeGenerator::VisitVariableProxy(VariableProxy* proxy) { void BytecodeGenerator::VisitVariableProxy(VariableProxy* proxy) {
builder()->SetExpressionPosition(proxy);
VisitVariableLoad(proxy->var(), proxy->VariableFeedbackSlot()); VisitVariableLoad(proxy->var(), proxy->VariableFeedbackSlot());
} }
...@@ -2191,6 +2192,7 @@ void BytecodeGenerator::VisitAssignment(Assignment* expr) { ...@@ -2191,6 +2192,7 @@ void BytecodeGenerator::VisitAssignment(Assignment* expr) {
} }
// Store the value. // Store the value.
builder()->SetExpressionPosition(expr);
FeedbackVectorSlot slot = expr->AssignmentSlot(); FeedbackVectorSlot slot = expr->AssignmentSlot();
switch (assign_type) { switch (assign_type) {
case VARIABLE: { case VARIABLE: {
...@@ -2228,6 +2230,7 @@ void BytecodeGenerator::VisitYield(Yield* expr) { UNIMPLEMENTED(); } ...@@ -2228,6 +2230,7 @@ void BytecodeGenerator::VisitYield(Yield* expr) { UNIMPLEMENTED(); }
void BytecodeGenerator::VisitThrow(Throw* expr) { void BytecodeGenerator::VisitThrow(Throw* expr) {
VisitForAccumulatorValue(expr->exception()); VisitForAccumulatorValue(expr->exception());
builder()->SetExpressionPosition(expr);
builder()->Throw(); builder()->Throw();
// Throw statments are modeled as expression instead of statments. These are // Throw statments are modeled as expression instead of statments. These are
// converted from assignment statements in Rewriter::ReWrite pass. An // converted from assignment statements in Rewriter::ReWrite pass. An
...@@ -2240,6 +2243,7 @@ void BytecodeGenerator::VisitThrow(Throw* expr) { ...@@ -2240,6 +2243,7 @@ void BytecodeGenerator::VisitThrow(Throw* expr) {
void BytecodeGenerator::VisitPropertyLoad(Register obj, Property* expr) { void BytecodeGenerator::VisitPropertyLoad(Register obj, Property* expr) {
LhsKind property_kind = Property::GetAssignType(expr); LhsKind property_kind = Property::GetAssignType(expr);
FeedbackVectorSlot slot = expr->PropertyFeedbackSlot(); FeedbackVectorSlot slot = expr->PropertyFeedbackSlot();
builder()->SetExpressionPosition(expr);
switch (property_kind) { switch (property_kind) {
case VARIABLE: case VARIABLE:
UNREACHABLE(); UNREACHABLE();
...@@ -2748,6 +2752,7 @@ void BytecodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -2748,6 +2752,7 @@ void BytecodeGenerator::VisitCountOperation(CountOperation* expr) {
builder()->CountOperation(expr->binary_op()); builder()->CountOperation(expr->binary_op());
// Store the value. // Store the value.
builder()->SetExpressionPosition(expr);
FeedbackVectorSlot feedback_slot = expr->CountSlot(); FeedbackVectorSlot feedback_slot = expr->CountSlot();
switch (assign_type) { switch (assign_type) {
case VARIABLE: { case VARIABLE: {
...@@ -2807,6 +2812,7 @@ void BytecodeGenerator::VisitBinaryOperation(BinaryOperation* binop) { ...@@ -2807,6 +2812,7 @@ void BytecodeGenerator::VisitBinaryOperation(BinaryOperation* binop) {
void BytecodeGenerator::VisitCompareOperation(CompareOperation* expr) { void BytecodeGenerator::VisitCompareOperation(CompareOperation* expr) {
Register lhs = VisitForRegisterValue(expr->left()); Register lhs = VisitForRegisterValue(expr->left());
VisitForAccumulatorValue(expr->right()); VisitForAccumulatorValue(expr->right());
builder()->SetExpressionPosition(expr);
builder()->CompareOperation(expr->op(), lhs); builder()->CompareOperation(expr->op(), lhs);
execution_result()->SetResultInAccumulator(); execution_result()->SetResultInAccumulator();
} }
......
...@@ -140,7 +140,10 @@ void SourcePositionTableBuilder::AddEntry( ...@@ -140,7 +140,10 @@ void SourcePositionTableBuilder::AddEntry(
// Don't encode a new entry if this bytecode already has a source position // Don't encode a new entry if this bytecode already has a source position
// assigned. // assigned.
if (candidate_.bytecode_offset == entry.bytecode_offset) { if (candidate_.bytecode_offset == entry.bytecode_offset) {
if (on_duplicate == OVERWRITE_DUPLICATE) candidate_ = entry; if ((!candidate_.is_statement && entry.is_statement) ||
on_duplicate == OVERWRITE_DUPLICATE) {
candidate_ = entry;
}
return; return;
} }
......
...@@ -498,10 +498,6 @@ ...@@ -498,10 +498,6 @@
'test-heap/TestCodeFlushingIncremental': [FAIL], 'test-heap/TestCodeFlushingIncremental': [FAIL],
'test-heap/TestCodeFlushingIncrementalAbort': [PASS, ['mode == debug or dcheck_always_on == True', FAIL]], 'test-heap/TestCodeFlushingIncrementalAbort': [PASS, ['mode == debug or dcheck_always_on == True', FAIL]],
# TODO(rmcilroy,4689): Stack trace line number failures.
'test-run-jsexceptions/ThrowMessagePosition': [FAIL],
'test-api/TryCatchMixedNesting': [FAIL],
# TODO(rmcilroy,4766): Requires BytecodeGraphBuilder to track source position # TODO(rmcilroy,4766): Requires BytecodeGraphBuilder to track source position
# on nodes (behind --turbo_source_positions flag). # on nodes (behind --turbo_source_positions flag).
'test-cpu-profiler/TickLinesOptimized': [FAIL], 'test-cpu-profiler/TickLinesOptimized': [FAIL],
...@@ -527,9 +523,6 @@ ...@@ -527,9 +523,6 @@
# in interpreter. # in interpreter.
'test-heap/CompilationCacheCachingBehavior': [FAIL], 'test-heap/CompilationCacheCachingBehavior': [FAIL],
# TODO(mythria,4680): Incorrect column number on eval.
'test-api/PromiseRejectCallback': [FAIL],
# TODO(rmcilroy,4680): Fails with eager compilation due to SharedFunctionInfo # TODO(rmcilroy,4680): Fails with eager compilation due to SharedFunctionInfo
# being null in compiler.cc Renumber(), meaning MaybeDisableOptimization never # being null in compiler.cc Renumber(), meaning MaybeDisableOptimization never
# gets called. # gets called.
......
...@@ -34,14 +34,4 @@ ...@@ -34,14 +34,4 @@
# back-references). # back-references).
'strict-octal-regexp': [SKIP], 'strict-octal-regexp': [SKIP],
}], # ALWAYS }], # ALWAYS
['ignition == True', {
# TODO(4680): Some source positions are off with Ignition.
'default-parameter-tdz': [SKIP],
'default-parameter-tdz-arrow': [SKIP],
'destructuring-modify-const': [SKIP],
'overwritten-builtins': [SKIP],
'regress/regress-1527': [SKIP],
'regress/regress-3995': [SKIP],
'replacement-marker-as-argument': [SKIP],
}], # ignition == True
] ]
...@@ -759,7 +759,6 @@ ...@@ -759,7 +759,6 @@
# TODO(yangguo,4690): assertion failures in debugger tests. # TODO(yangguo,4690): assertion failures in debugger tests.
'debug-allscopes-on-debugger': [FAIL], 'debug-allscopes-on-debugger': [FAIL],
'es6/debug-stepnext-for': [FAIL], 'es6/debug-stepnext-for': [FAIL],
'es6/debug-stepin-string-template': [FAIL],
'es6/debug-promises/stepin-constructor': [FAIL], 'es6/debug-promises/stepin-constructor': [FAIL],
'es6/debug-stepin-proxies': [FAIL], 'es6/debug-stepin-proxies': [FAIL],
'regress/regress-crbug-119800': [FAIL], 'regress/regress-crbug-119800': [FAIL],
...@@ -799,10 +798,6 @@ ...@@ -799,10 +798,6 @@
# objects. # objects.
'es6/mirror-collections': [FAIL], 'es6/mirror-collections': [FAIL],
# TODO(mythria, 4680): line numbers in eval test. Column number is
# incorrect.
'regress/regress-crbug-109362': [FAIL],
# TODO(mythria, 4680): possibly problem with line numbers. # TODO(mythria, 4680): possibly problem with line numbers.
'es6/regress/regress-468661': [FAIL], 'es6/regress/regress-468661': [FAIL],
......
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