| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index 49d379aa0b018a977da1d520d4d91c9b3823acfb..1d33bfa6126c7ed6ed889440934b0835616f1fde 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -6647,6 +6647,9 @@ void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) {
|
| if (var->mode() == CONST_LEGACY) {
|
| return Bailout(kUnsupportedConstCompoundAssignment);
|
| }
|
| + if (var->mode() == CONST) {
|
| + return Bailout(kNonInitializerAssignmentToConst);
|
| + }
|
| BindIfLive(var, Top());
|
| break;
|
|
|
| @@ -6673,9 +6676,7 @@ void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) {
|
| mode = HStoreContextSlot::kCheckDeoptimize;
|
| break;
|
| case CONST:
|
| - // This case is checked statically so no need to
|
| - // perform checks here
|
| - UNREACHABLE();
|
| + return Bailout(kNonInitializerAssignmentToConst);
|
| case CONST_LEGACY:
|
| return ast_context()->ReturnValue(Pop());
|
| default:
|
| @@ -10215,6 +10216,9 @@ void HOptimizedGraphBuilder::VisitCountOperation(CountOperation* expr) {
|
| if (var->mode() == CONST_LEGACY) {
|
| return Bailout(kUnsupportedCountOperationWithConst);
|
| }
|
| + if (var->mode() == CONST) {
|
| + return Bailout(kNonInitializerAssignmentToConst);
|
| + }
|
| // Argument of the count operation is a variable, not a property.
|
| DCHECK(prop == NULL);
|
| CHECK_ALIVE(VisitForValue(target));
|
|
|