[interpreter] Strengthen a DCHECK.

There are no CONST function declarations. Also make check independent of variable location.

R=adamk@chromium.org, rmcilroy@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2301863002
Cr-Commit-Position: refs/heads/master@{#39182}
This commit is contained in:
neis 2016-09-05 09:02:38 -07:00 committed by Commit bot
parent c30cc0722e
commit 494e2493f2

View File

@ -946,6 +946,7 @@ void BytecodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) {
void BytecodeGenerator::VisitFunctionDeclaration(FunctionDeclaration* decl) {
Variable* variable = decl->proxy()->var();
DCHECK(variable->mode() == LET || variable->mode() == VAR);
switch (variable->location()) {
case VariableLocation::UNALLOCATED: {
FeedbackVectorSlot slot = decl->proxy()->VariableFeedbackSlot();
@ -955,8 +956,6 @@ void BytecodeGenerator::VisitFunctionDeclaration(FunctionDeclaration* decl) {
case VariableLocation::PARAMETER:
case VariableLocation::LOCAL: {
VisitForAccumulatorValue(decl->fun());
DCHECK(variable->mode() == LET || variable->mode() == VAR ||
variable->mode() == CONST);
VisitVariableAssignment(variable, Token::INIT,
FeedbackVectorSlot::Invalid());
break;