Chromium Code Reviews| 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_FULL_CODEGEN_H_ | 5 #ifndef V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
| 6 #define V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 6 #define V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
| 10 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 class FullCodeGenerator: public AstVisitor { | 30 class FullCodeGenerator: public AstVisitor { |
| 31 public: | 31 public: |
| 32 FullCodeGenerator(MacroAssembler* masm, CompilationInfo* info) | 32 FullCodeGenerator(MacroAssembler* masm, CompilationInfo* info) |
| 33 : masm_(masm), | 33 : masm_(masm), |
| 34 info_(info), | 34 info_(info), |
| 35 isolate_(info->isolate()), | 35 isolate_(info->isolate()), |
| 36 zone_(info->zone()), | 36 zone_(info->zone()), |
| 37 scope_(info->scope()), | 37 scope_(info->scope()), |
| 38 nesting_stack_(NULL), | 38 nesting_stack_(NULL), |
| 39 loop_depth_(0), | 39 loop_depth_(0), |
| 40 try_catch_depth_(0), | 40 try_catch_depth_(0), |
|
Michael Starzinger
2016/07/12 14:11:12
nit: This variable should no longer be needed, let
| |
| 41 operand_stack_depth_(0), | 41 operand_stack_depth_(0), |
| 42 globals_(NULL), | 42 globals_(NULL), |
| 43 context_(NULL), | 43 context_(NULL), |
| 44 bailout_entries_(info->HasDeoptimizationSupport() | 44 bailout_entries_(info->HasDeoptimizationSupport() |
| 45 ? info->literal()->ast_node_count() | 45 ? info->literal()->ast_node_count() |
| 46 : 0, | 46 : 0, |
| 47 info->zone()), | 47 info->zone()), |
| 48 back_edges_(2, info->zone()), | 48 back_edges_(2, info->zone()), |
| 49 handler_table_(info->zone()), | 49 handler_table_(info->zone()), |
| 50 source_position_table_builder_(info->isolate(), info->zone(), | 50 source_position_table_builder_(info->isolate(), info->zone(), |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 680 | 680 |
| 681 void SetConstructCallPosition(Expression* expr) { | 681 void SetConstructCallPosition(Expression* expr) { |
| 682 // Currently call and construct calls are treated the same wrt debugging. | 682 // Currently call and construct calls are treated the same wrt debugging. |
| 683 SetCallPosition(expr); | 683 SetCallPosition(expr); |
| 684 } | 684 } |
| 685 | 685 |
| 686 void RecordStatementPosition(int pos); | 686 void RecordStatementPosition(int pos); |
| 687 void RecordPosition(int pos); | 687 void RecordPosition(int pos); |
| 688 | 688 |
| 689 // Non-local control flow support. | 689 // Non-local control flow support. |
| 690 void EnterTryBlock(int handler_index, Label* handler); | 690 void EnterTryBlock(int handler_index, Label* handler, bool catch_predicted); |
| 691 void ExitTryBlock(int handler_index); | 691 void ExitTryBlock(int handler_index); |
| 692 void EnterFinallyBlock(); | 692 void EnterFinallyBlock(); |
| 693 void ExitFinallyBlock(); | 693 void ExitFinallyBlock(); |
| 694 void ClearPendingMessage(); | 694 void ClearPendingMessage(); |
| 695 | 695 |
| 696 void EmitContinue(Statement* target); | 696 void EmitContinue(Statement* target); |
| 697 void EmitBreak(Statement* target); | 697 void EmitBreak(Statement* target); |
| 698 | 698 |
| 699 // Loop nesting counter. | 699 // Loop nesting counter. |
| 700 int loop_depth() { return loop_depth_; } | 700 int loop_depth() { return loop_depth_; } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 767 BailoutId id; | 767 BailoutId id; |
| 768 unsigned pc; | 768 unsigned pc; |
| 769 uint32_t loop_depth; | 769 uint32_t loop_depth; |
| 770 }; | 770 }; |
| 771 | 771 |
| 772 struct HandlerTableEntry { | 772 struct HandlerTableEntry { |
| 773 unsigned range_start; | 773 unsigned range_start; |
| 774 unsigned range_end; | 774 unsigned range_end; |
| 775 unsigned handler_offset; | 775 unsigned handler_offset; |
| 776 int stack_depth; | 776 int stack_depth; |
| 777 int try_catch_depth; | 777 bool catch_predicted; |
| 778 }; | 778 }; |
| 779 | 779 |
| 780 class ExpressionContext BASE_EMBEDDED { | 780 class ExpressionContext BASE_EMBEDDED { |
| 781 public: | 781 public: |
| 782 explicit ExpressionContext(FullCodeGenerator* codegen) | 782 explicit ExpressionContext(FullCodeGenerator* codegen) |
| 783 : masm_(codegen->masm()), old_(codegen->context()), codegen_(codegen) { | 783 : masm_(codegen->masm()), old_(codegen->context()), codegen_(codegen) { |
| 784 codegen->set_new_context(this); | 784 codegen->set_new_context(this); |
| 785 } | 785 } |
| 786 | 786 |
| 787 virtual ~ExpressionContext() { | 787 virtual ~ExpressionContext() { |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 962 }; | 962 }; |
| 963 | 963 |
| 964 MacroAssembler* masm_; | 964 MacroAssembler* masm_; |
| 965 CompilationInfo* info_; | 965 CompilationInfo* info_; |
| 966 Isolate* isolate_; | 966 Isolate* isolate_; |
| 967 Zone* zone_; | 967 Zone* zone_; |
| 968 Scope* scope_; | 968 Scope* scope_; |
| 969 Label return_label_; | 969 Label return_label_; |
| 970 NestedStatement* nesting_stack_; | 970 NestedStatement* nesting_stack_; |
| 971 int loop_depth_; | 971 int loop_depth_; |
| 972 int try_catch_depth_; | 972 int try_catch_depth_; |
|
Michael Starzinger
2016/07/12 14:11:12
nit: This variable should no longer be needed, let
| |
| 973 int operand_stack_depth_; | 973 int operand_stack_depth_; |
| 974 ZoneList<Handle<Object> >* globals_; | 974 ZoneList<Handle<Object> >* globals_; |
| 975 const ExpressionContext* context_; | 975 const ExpressionContext* context_; |
| 976 ZoneList<BailoutEntry> bailout_entries_; | 976 ZoneList<BailoutEntry> bailout_entries_; |
| 977 ZoneList<BackEdgeEntry> back_edges_; | 977 ZoneList<BackEdgeEntry> back_edges_; |
| 978 ZoneVector<HandlerTableEntry> handler_table_; | 978 ZoneVector<HandlerTableEntry> handler_table_; |
| 979 SourcePositionTableBuilder source_position_table_builder_; | 979 SourcePositionTableBuilder source_position_table_builder_; |
| 980 int ic_total_count_; | 980 int ic_total_count_; |
| 981 Handle<Cell> profiling_counter_; | 981 Handle<Cell> profiling_counter_; |
| 982 | 982 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1056 Address start_; | 1056 Address start_; |
| 1057 Address instruction_start_; | 1057 Address instruction_start_; |
| 1058 uint32_t length_; | 1058 uint32_t length_; |
| 1059 }; | 1059 }; |
| 1060 | 1060 |
| 1061 | 1061 |
| 1062 } // namespace internal | 1062 } // namespace internal |
| 1063 } // namespace v8 | 1063 } // namespace v8 |
| 1064 | 1064 |
| 1065 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 1065 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
| OLD | NEW |