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

Side by Side Diff: runtime/vm/kernel_to_il.h

Issue 2776373002: Initial steps into streaming the kernel flowgraph (Closed)
Patch Set: Changed type Created 3 years, 8 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef RUNTIME_VM_KERNEL_TO_IL_H_ 5 #ifndef RUNTIME_VM_KERNEL_TO_IL_H_
6 #define RUNTIME_VM_KERNEL_TO_IL_H_ 6 #define RUNTIME_VM_KERNEL_TO_IL_H_
7 7
8 #if !defined(DART_PRECOMPILED_RUNTIME) 8 #if !defined(DART_PRECOMPILED_RUNTIME)
9 9
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 DartTypeTranslator type_translator_; 714 DartTypeTranslator type_translator_;
715 715
716 FunctionNode* current_function_node_; 716 FunctionNode* current_function_node_;
717 LocalScope* current_function_scope_; 717 LocalScope* current_function_scope_;
718 LocalScope* scope_; 718 LocalScope* scope_;
719 DepthState depth_; 719 DepthState depth_;
720 720
721 intptr_t name_index_; 721 intptr_t name_index_;
722 }; 722 };
723 723
724
725 class FlowGraphBuilder : public ExpressionVisitor, public StatementVisitor { 724 class FlowGraphBuilder : public ExpressionVisitor, public StatementVisitor {
726 public: 725 public:
727 FlowGraphBuilder(TreeNode* node, 726 FlowGraphBuilder(TreeNode* node,
728 ParsedFunction* parsed_function, 727 ParsedFunction* parsed_function,
729 const ZoneGrowableArray<const ICData*>& ic_data_array, 728 const ZoneGrowableArray<const ICData*>& ic_data_array,
730 InlineExitCollector* exit_collector, 729 InlineExitCollector* exit_collector,
731 intptr_t osr_id, 730 intptr_t osr_id,
732 intptr_t first_block_id = 1); 731 intptr_t first_block_id = 1);
733 virtual ~FlowGraphBuilder(); 732 virtual ~FlowGraphBuilder();
734 733
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 intptr_t next_used_try_index_; 1043 intptr_t next_used_try_index_;
1045 1044
1046 // A chained list of catch blocks. Chaining and lookup is done by the 1045 // A chained list of catch blocks. Chaining and lookup is done by the
1047 // [CatchBlock] class. 1046 // [CatchBlock] class.
1048 CatchBlock* catch_block_; 1047 CatchBlock* catch_block_;
1049 1048
1050 ActiveClass active_class_; 1049 ActiveClass active_class_;
1051 DartTypeTranslator type_translator_; 1050 DartTypeTranslator type_translator_;
1052 ConstantEvaluator constant_evaluator_; 1051 ConstantEvaluator constant_evaluator_;
1053 1052
1053 Library* library_;
Kevin Millikin (Google) 2017/03/28 12:50:00 Instead of the Library (which we eventually won't
jensj 2017/03/29 09:30:42 I for one cannot figure out how to make it compile
1054
1054 friend class BreakableBlock; 1055 friend class BreakableBlock;
1055 friend class CatchBlock; 1056 friend class CatchBlock;
1056 friend class ConstantEvaluator; 1057 friend class ConstantEvaluator;
1057 friend class DartTypeTranslator; 1058 friend class DartTypeTranslator;
1059 friend class KernelFlowgraphBuilder;
1058 friend class ScopeBuilder; 1060 friend class ScopeBuilder;
1059 friend class SwitchBlock; 1061 friend class SwitchBlock;
1060 friend class TryCatchBlock; 1062 friend class TryCatchBlock;
1061 friend class TryFinallyBlock; 1063 friend class TryFinallyBlock;
1062 }; 1064 };
1063 1065
1066
1067 class CatchBlock {
1068 public:
1069 CatchBlock(FlowGraphBuilder* builder,
1070 LocalVariable* exception_var,
1071 LocalVariable* stack_trace_var,
1072 intptr_t catch_try_index)
1073 : builder_(builder),
1074 outer_(builder->catch_block_),
1075 exception_var_(exception_var),
1076 stack_trace_var_(stack_trace_var),
1077 catch_try_index_(catch_try_index) {
1078 builder_->catch_block_ = this;
1079 }
1080 ~CatchBlock() { builder_->catch_block_ = outer_; }
1081
1082 LocalVariable* exception_var() { return exception_var_; }
1083 LocalVariable* stack_trace_var() { return stack_trace_var_; }
1084 intptr_t catch_try_index() { return catch_try_index_; }
1085
1086 private:
1087 FlowGraphBuilder* builder_;
1088 CatchBlock* outer_;
1089 LocalVariable* exception_var_;
1090 LocalVariable* stack_trace_var_;
1091 intptr_t catch_try_index_;
1092 };
1093
1094
1064 RawObject* EvaluateMetadata(TreeNode* const kernel_node); 1095 RawObject* EvaluateMetadata(TreeNode* const kernel_node);
1065 RawObject* BuildParameterDescriptor(TreeNode* const kernel_node); 1096 RawObject* BuildParameterDescriptor(TreeNode* const kernel_node);
1066 1097
1067 1098
1068 } // namespace kernel 1099 } // namespace kernel
1069 } // namespace dart 1100 } // namespace dart
1070 1101
1071 #else // !defined(DART_PRECOMPILED_RUNTIME) 1102 #else // !defined(DART_PRECOMPILED_RUNTIME)
1072 1103
1073 #include "vm/object.h" 1104 #include "vm/object.h"
1074 #include "vm/kernel.h" 1105 #include "vm/kernel.h"
1075 1106
1076 namespace dart { 1107 namespace dart {
1077 namespace kernel { 1108 namespace kernel {
1078 1109
1079 RawObject* EvaluateMetadata(TreeNode* const kernel_node); 1110 RawObject* EvaluateMetadata(TreeNode* const kernel_node);
1080 RawObject* BuildParameterDescriptor(TreeNode* const kernel_node); 1111 RawObject* BuildParameterDescriptor(TreeNode* const kernel_node);
1081 1112
1082 } // namespace kernel 1113 } // namespace kernel
1083 } // namespace dart 1114 } // namespace dart
1084 1115
1085 #endif // !defined(DART_PRECOMPILED_RUNTIME) 1116 #endif // !defined(DART_PRECOMPILED_RUNTIME)
1086 #endif // RUNTIME_VM_KERNEL_TO_IL_H_ 1117 #endif // RUNTIME_VM_KERNEL_TO_IL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698