Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: src/full-codegen.h

Issue 749633002: harmony-scoping: make assignment to 'const' a late error. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment update Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_FULL_CODEGEN_H_ 5 #ifndef V8_FULL_CODEGEN_H_
6 #define V8_FULL_CODEGEN_H_ 6 #define V8_FULL_CODEGEN_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 void EmitInlineSmiBinaryOp(BinaryOperation* expr, 579 void EmitInlineSmiBinaryOp(BinaryOperation* expr,
580 Token::Value op, 580 Token::Value op,
581 OverwriteMode mode, 581 OverwriteMode mode,
582 Expression* left, 582 Expression* left,
583 Expression* right); 583 Expression* right);
584 584
585 // Assign to the given expression as if via '='. The right-hand-side value 585 // Assign to the given expression as if via '='. The right-hand-side value
586 // is expected in the accumulator. 586 // is expected in the accumulator.
587 void EmitAssignment(Expression* expr); 587 void EmitAssignment(Expression* expr);
588 588
589 // Shall an error be thrown if assignment with 'op' operation is perfomed
590 // on this variable in given language mode?
591 static bool IsSignallingAssignmentToConst(Variable* var, Token::Value op,
592 StrictMode strict_mode) {
593 if (var->mode() == CONST) return op != Token::INIT_CONST;
594
595 if (var->mode() == CONST_LEGACY) {
596 return strict_mode == STRICT && op != Token::INIT_CONST_LEGACY;
597 }
598
599 return false;
600 }
601
589 // Complete a variable assignment. The right-hand-side value is expected 602 // Complete a variable assignment. The right-hand-side value is expected
590 // in the accumulator. 603 // in the accumulator.
591 void EmitVariableAssignment(Variable* var, 604 void EmitVariableAssignment(Variable* var,
592 Token::Value op); 605 Token::Value op);
593 606
594 // Helper functions to EmitVariableAssignment 607 // Helper functions to EmitVariableAssignment
595 void EmitStoreToStackLocalOrContextSlot(Variable* var, 608 void EmitStoreToStackLocalOrContextSlot(Variable* var,
596 MemOperand location); 609 MemOperand location);
597 610
598 // Complete a named property assignment. The receiver is expected on top 611 // Complete a named property assignment. The receiver is expected on top
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 1036
1024 Address start_; 1037 Address start_;
1025 Address instruction_start_; 1038 Address instruction_start_;
1026 uint32_t length_; 1039 uint32_t length_;
1027 }; 1040 };
1028 1041
1029 1042
1030 } } // namespace v8::internal 1043 } } // namespace v8::internal
1031 1044
1032 #endif // V8_FULL_CODEGEN_H_ 1045 #endif // V8_FULL_CODEGEN_H_
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698