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 29 matching lines...) Expand all Loading... |
40 try_catch_depth_(0), | 40 try_catch_depth_(0), |
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 ic_total_count_(0) { | 51 ic_total_count_(0) { |
51 DCHECK(!info->IsStub()); | 52 DCHECK(!info->IsStub()); |
52 Initialize(); | 53 Initialize(); |
53 } | 54 } |
54 | 55 |
55 void Initialize(); | 56 void Initialize(); |
56 | 57 |
57 static bool MakeCode(CompilationInfo* info); | 58 static bool MakeCode(CompilationInfo* info); |
58 | 59 |
59 // Encode bailout state and pc-offset as a BitField<type, start, size>. | 60 // Encode bailout state and pc-offset as a BitField<type, start, size>. |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 void SetExpressionAsStatementPosition(Expression* expr); | 679 void SetExpressionAsStatementPosition(Expression* expr); |
679 | 680 |
680 void SetCallPosition(Expression* expr, | 681 void SetCallPosition(Expression* expr, |
681 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 682 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
682 | 683 |
683 void SetConstructCallPosition(Expression* expr) { | 684 void SetConstructCallPosition(Expression* expr) { |
684 // Currently call and construct calls are treated the same wrt debugging. | 685 // Currently call and construct calls are treated the same wrt debugging. |
685 SetCallPosition(expr); | 686 SetCallPosition(expr); |
686 } | 687 } |
687 | 688 |
| 689 void RecordStatementPosition(int pos); |
| 690 void RecordPosition(int pos); |
| 691 |
688 // Non-local control flow support. | 692 // Non-local control flow support. |
689 void EnterTryBlock(int handler_index, Label* handler); | 693 void EnterTryBlock(int handler_index, Label* handler); |
690 void ExitTryBlock(int handler_index); | 694 void ExitTryBlock(int handler_index); |
691 void EnterFinallyBlock(); | 695 void EnterFinallyBlock(); |
692 void ExitFinallyBlock(); | 696 void ExitFinallyBlock(); |
693 void ClearPendingMessage(); | 697 void ClearPendingMessage(); |
694 | 698 |
695 void EmitContinue(Statement* target); | 699 void EmitContinue(Statement* target); |
696 void EmitBreak(Statement* target); | 700 void EmitBreak(Statement* target); |
697 | 701 |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 int loop_depth_; | 974 int loop_depth_; |
971 int try_catch_depth_; | 975 int try_catch_depth_; |
972 int operand_stack_depth_; | 976 int operand_stack_depth_; |
973 ZoneList<Handle<Object> >* globals_; | 977 ZoneList<Handle<Object> >* globals_; |
974 Handle<FixedArray> modules_; | 978 Handle<FixedArray> modules_; |
975 int module_index_; | 979 int module_index_; |
976 const ExpressionContext* context_; | 980 const ExpressionContext* context_; |
977 ZoneList<BailoutEntry> bailout_entries_; | 981 ZoneList<BailoutEntry> bailout_entries_; |
978 ZoneList<BackEdgeEntry> back_edges_; | 982 ZoneList<BackEdgeEntry> back_edges_; |
979 ZoneVector<HandlerTableEntry> handler_table_; | 983 ZoneVector<HandlerTableEntry> handler_table_; |
| 984 SourcePositionTableBuilder source_position_table_builder_; |
980 int ic_total_count_; | 985 int ic_total_count_; |
981 Handle<Cell> profiling_counter_; | 986 Handle<Cell> profiling_counter_; |
982 | 987 |
983 friend class NestedStatement; | 988 friend class NestedStatement; |
984 | 989 |
985 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); | 990 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); |
986 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); | 991 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); |
987 }; | 992 }; |
988 | 993 |
989 | 994 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 Address start_; | 1061 Address start_; |
1057 Address instruction_start_; | 1062 Address instruction_start_; |
1058 uint32_t length_; | 1063 uint32_t length_; |
1059 }; | 1064 }; |
1060 | 1065 |
1061 | 1066 |
1062 } // namespace internal | 1067 } // namespace internal |
1063 } // namespace v8 | 1068 } // namespace v8 |
1064 | 1069 |
1065 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 1070 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
OLD | NEW |