OLD | NEW |
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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 Expression* left, | 596 Expression* left, |
597 Expression* right); | 597 Expression* right); |
598 | 598 |
599 // Assign to the given expression as if via '='. The right-hand-side value | 599 // Assign to the given expression as if via '='. The right-hand-side value |
600 // is expected in the accumulator. | 600 // is expected in the accumulator. |
601 void EmitAssignment(Expression* expr); | 601 void EmitAssignment(Expression* expr); |
602 | 602 |
603 // Shall an error be thrown if assignment with 'op' operation is perfomed | 603 // Shall an error be thrown if assignment with 'op' operation is perfomed |
604 // on this variable in given language mode? | 604 // on this variable in given language mode? |
605 static bool IsSignallingAssignmentToConst(Variable* var, Token::Value op, | 605 static bool IsSignallingAssignmentToConst(Variable* var, Token::Value op, |
606 StrictMode strict_mode) { | 606 LanguageMode language_mode) { |
607 if (var->mode() == CONST) return op != Token::INIT_CONST; | 607 if (var->mode() == CONST) return op != Token::INIT_CONST; |
608 | 608 |
609 if (var->mode() == CONST_LEGACY) { | 609 if (var->mode() == CONST_LEGACY) { |
610 return strict_mode == STRICT && op != Token::INIT_CONST_LEGACY; | 610 return is_strict(language_mode) && op != Token::INIT_CONST_LEGACY; |
611 } | 611 } |
612 | 612 |
613 return false; | 613 return false; |
614 } | 614 } |
615 | 615 |
616 // Complete a variable assignment. The right-hand-side value is expected | 616 // Complete a variable assignment. The right-hand-side value is expected |
617 // in the accumulator. | 617 // in the accumulator. |
618 void EmitVariableAssignment(Variable* var, | 618 void EmitVariableAssignment(Variable* var, |
619 Token::Value op); | 619 Token::Value op); |
620 | 620 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 | 679 |
680 MacroAssembler* masm() { return masm_; } | 680 MacroAssembler* masm() { return masm_; } |
681 | 681 |
682 class ExpressionContext; | 682 class ExpressionContext; |
683 const ExpressionContext* context() { return context_; } | 683 const ExpressionContext* context() { return context_; } |
684 void set_new_context(const ExpressionContext* context) { context_ = context; } | 684 void set_new_context(const ExpressionContext* context) { context_ = context; } |
685 | 685 |
686 Handle<Script> script() { return info_->script(); } | 686 Handle<Script> script() { return info_->script(); } |
687 bool is_eval() { return info_->is_eval(); } | 687 bool is_eval() { return info_->is_eval(); } |
688 bool is_native() { return info_->is_native(); } | 688 bool is_native() { return info_->is_native(); } |
689 StrictMode strict_mode() { return function()->strict_mode(); } | 689 LanguageMode language_mode() { return function()->language_mode(); } |
690 FunctionLiteral* function() { return info_->function(); } | 690 FunctionLiteral* function() { return info_->function(); } |
691 Scope* scope() { return scope_; } | 691 Scope* scope() { return scope_; } |
692 | 692 |
693 static Register result_register(); | 693 static Register result_register(); |
694 static Register context_register(); | 694 static Register context_register(); |
695 | 695 |
696 // Set fields in the stack frame. Offsets are the frame pointer relative | 696 // Set fields in the stack frame. Offsets are the frame pointer relative |
697 // offsets defined in, e.g., StandardFrameConstants. | 697 // offsets defined in, e.g., StandardFrameConstants. |
698 void StoreToFrameField(int frame_offset, Register value); | 698 void StoreToFrameField(int frame_offset, Register value); |
699 | 699 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 | 1050 |
1051 Address start_; | 1051 Address start_; |
1052 Address instruction_start_; | 1052 Address instruction_start_; |
1053 uint32_t length_; | 1053 uint32_t length_; |
1054 }; | 1054 }; |
1055 | 1055 |
1056 | 1056 |
1057 } } // namespace v8::internal | 1057 } } // namespace v8::internal |
1058 | 1058 |
1059 #endif // V8_FULL_CODEGEN_H_ | 1059 #endif // V8_FULL_CODEGEN_H_ |
OLD | NEW |