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

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

Issue 976053002: Fix exception for assignment to uninitialised const (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comments Created 5 years, 9 months 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/ia32/full-codegen-ia32.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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 // binary operations. 582 // binary operations.
583 void EmitInlineSmiBinaryOp(BinaryOperation* expr, 583 void EmitInlineSmiBinaryOp(BinaryOperation* expr,
584 Token::Value op, 584 Token::Value op,
585 Expression* left, 585 Expression* left,
586 Expression* right); 586 Expression* right);
587 587
588 // Assign to the given expression as if via '='. The right-hand-side value 588 // Assign to the given expression as if via '='. The right-hand-side value
589 // is expected in the accumulator. 589 // is expected in the accumulator.
590 void EmitAssignment(Expression* expr); 590 void EmitAssignment(Expression* expr);
591 591
592 // Shall an error be thrown if assignment with 'op' operation is perfomed
593 // on this variable in given language mode?
594 static bool IsSignallingAssignmentToConst(Variable* var, Token::Value op,
595 LanguageMode language_mode) {
596 if (var->mode() == CONST) return op != Token::INIT_CONST;
597
598 if (var->mode() == CONST_LEGACY) {
599 return is_strict(language_mode) && op != Token::INIT_CONST_LEGACY;
600 }
601
602 return false;
603 }
604
605 // Complete a variable assignment. The right-hand-side value is expected 592 // Complete a variable assignment. The right-hand-side value is expected
606 // in the accumulator. 593 // in the accumulator.
607 void EmitVariableAssignment(Variable* var, 594 void EmitVariableAssignment(Variable* var,
608 Token::Value op); 595 Token::Value op);
609 596
610 // Helper functions to EmitVariableAssignment 597 // Helper functions to EmitVariableAssignment
611 void EmitStoreToStackLocalOrContextSlot(Variable* var, 598 void EmitStoreToStackLocalOrContextSlot(Variable* var,
612 MemOperand location); 599 MemOperand location);
613 600
614 // Complete a named property assignment. The receiver is expected on top 601 // Complete a named property assignment. The receiver is expected on top
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 1028
1042 Address start_; 1029 Address start_;
1043 Address instruction_start_; 1030 Address instruction_start_;
1044 uint32_t length_; 1031 uint32_t length_;
1045 }; 1032 };
1046 1033
1047 1034
1048 } } // namespace v8::internal 1035 } } // namespace v8::internal
1049 1036
1050 #endif // V8_FULL_CODEGEN_H_ 1037 #endif // V8_FULL_CODEGEN_H_
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698