Commit 211d569a authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

[parser] Remove incorrect UseCounter code for LabeledExpressionStatement

As noted in the attached bug, accurately counting this would require
significant changes to the parser and is thus infeasible.

Bug: v8:7211
Change-Id: I61f14c948f50e0f97e596a9696d72a3570ad588a
Reviewed-on: https://chromium-review.googlesource.com/853214Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50393}
parent eada5175
......@@ -5176,11 +5176,6 @@ ParserBase<Impl>::ParseExpressionOrLabelledStatement(
// Parsed expression statement, followed by semicolon.
ExpectSemicolon(CHECK_OK);
if (labels != nullptr) {
// TODO(adamk): Also measure in the PreParser by passing something
// non-null as |labels|.
impl()->CountUsage(v8::Isolate::kLabeledExpressionStatement);
}
return factory()->NewExpressionStatement(expr, pos);
}
......
......@@ -60,31 +60,6 @@ TEST(AssigmentExpressionLHSIsCall) {
use_counts[v8::Isolate::kAssigmentExpressionLHSIsCallInStrict] = 0;
}
TEST(LabeledExpressionStatement) {
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope scope(isolate);
LocalContext env;
int use_counts[v8::Isolate::kUseCounterFeatureCount] = {};
global_use_counts = use_counts;
CcTest::isolate()->SetUseCounterCallback(MockUseCounterCallback);
CompileRun("typeof a");
CHECK_EQ(0, use_counts[v8::Isolate::kLabeledExpressionStatement]);
CompileRun("foo: null");
CHECK_EQ(1, use_counts[v8::Isolate::kLabeledExpressionStatement]);
CompileRun("foo: bar: baz: undefined");
CHECK_EQ(2, use_counts[v8::Isolate::kLabeledExpressionStatement]);
CompileRun(
"foo: if (false);"
"bar: { }"
"baz: switch (false) { }"
"bat: do { } while (false);");
CHECK_EQ(2, use_counts[v8::Isolate::kLabeledExpressionStatement]);
}
} // namespace test_usecounters
} // namespace internal
} // namespace v8
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