OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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_BINARY_FLOWGRAPH_H_ | 5 #ifndef RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ |
6 #define RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ | 6 #define RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ |
7 | 7 |
8 #if !defined(DART_PRECOMPILED_RUNTIME) | 8 #if !defined(DART_PRECOMPILED_RUNTIME) |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 class TypeParameterScope { | 51 class TypeParameterScope { |
52 public: | 52 public: |
53 TypeParameterScope(StreamingDartTypeTranslator* translator, | 53 TypeParameterScope(StreamingDartTypeTranslator* translator, |
54 intptr_t parameters_offset, | 54 intptr_t parameters_offset, |
55 intptr_t parameters_count) | 55 intptr_t parameters_count) |
56 : parameters_offset_(parameters_offset), | 56 : parameters_offset_(parameters_offset), |
57 parameters_count_(parameters_count), | 57 parameters_count_(parameters_count), |
58 outer_(translator->type_parameter_scope_), | 58 outer_(translator->type_parameter_scope_), |
59 translator_(translator) { | 59 translator_(translator) { |
| 60 summed_outer_parameters_count_ = 0; |
| 61 if (outer_ != NULL) { |
| 62 summed_outer_parameters_count_ = |
| 63 outer_->summed_outer_parameters_count_ + outer_->parameters_count_; |
| 64 } |
60 translator_->type_parameter_scope_ = this; | 65 translator_->type_parameter_scope_ = this; |
61 } | 66 } |
62 ~TypeParameterScope() { | 67 ~TypeParameterScope() { |
63 translator_->type_parameter_scope_ = outer_; | 68 translator_->type_parameter_scope_ = outer_; |
64 } | 69 } |
65 | 70 |
66 TypeParameterScope* outer() const { return outer_; } | 71 TypeParameterScope* outer() const { return outer_; } |
67 intptr_t parameters_offset() const { return parameters_offset_; } | 72 intptr_t parameters_offset() const { return parameters_offset_; } |
68 intptr_t parameters_count() const { return parameters_count_; } | 73 intptr_t parameters_count() const { return parameters_count_; } |
| 74 intptr_t summed_outer_parameters_count() const { |
| 75 return summed_outer_parameters_count_; |
| 76 } |
69 | 77 |
70 private: | 78 private: |
71 intptr_t parameters_offset_; | 79 intptr_t parameters_offset_; |
72 intptr_t parameters_count_; | 80 intptr_t parameters_count_; |
| 81 intptr_t summed_outer_parameters_count_; |
73 TypeParameterScope* outer_; | 82 TypeParameterScope* outer_; |
74 StreamingDartTypeTranslator* translator_; | 83 StreamingDartTypeTranslator* translator_; |
75 }; | 84 }; |
76 | 85 |
77 intptr_t FindTypeParameterIndex(intptr_t parameters_offset, | 86 intptr_t FindTypeParameterIndex(intptr_t parameters_offset, |
78 intptr_t parameters_count, | 87 intptr_t parameters_count, |
79 intptr_t look_for); | 88 intptr_t look_for); |
80 | 89 |
81 StreamingFlowGraphBuilder* builder_; | 90 StreamingFlowGraphBuilder* builder_; |
82 TranslationHelper& translation_helper_; | 91 TranslationHelper& translation_helper_; |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 GrowableArray<intptr_t>* record_token_positions_in, | 351 GrowableArray<intptr_t>* record_token_positions_in, |
343 GrowableArray<intptr_t>* record_yield_positions_in); | 352 GrowableArray<intptr_t>* record_yield_positions_in); |
344 intptr_t SourceTableSize(); | 353 intptr_t SourceTableSize(); |
345 String& SourceTableUriFor(intptr_t index); | 354 String& SourceTableUriFor(intptr_t index); |
346 String& GetSourceFor(intptr_t index); | 355 String& GetSourceFor(intptr_t index); |
347 Array& GetLineStartsFor(intptr_t index); | 356 Array& GetLineStartsFor(intptr_t index); |
348 | 357 |
349 private: | 358 private: |
350 void DiscoverEnclosingElements(Zone* zone, | 359 void DiscoverEnclosingElements(Zone* zone, |
351 const Function& function, | 360 const Function& function, |
352 Function* outermost_function, | 361 Function* outermost_function); |
353 intptr_t* outermost_kernel_offset, | |
354 intptr_t* parent_class_offset); | |
355 intptr_t GetParentOffset(intptr_t offset); | |
356 void GetTypeParameterInfoForClass(intptr_t class_offset, | |
357 intptr_t* type_paremeter_counts, | |
358 intptr_t* type_paremeter_offset); | |
359 | 362 |
360 void GetTypeParameterInfoForPossibleProcedure( | |
361 intptr_t outermost_kernel_offset, | |
362 bool* member_is_procedure, | |
363 bool* is_factory_procedure, | |
364 intptr_t* member_type_parameters, | |
365 intptr_t* member_type_parameters_offset_start); | |
366 /** | 363 /** |
367 * Will return kernel offset for parent class if reading a constructor. | 364 * Will return kernel offset for parent class if reading a constructor. |
368 * Will otherwise return -1. | 365 * Will otherwise return -1. |
369 */ | 366 */ |
370 intptr_t ReadUntilFunctionNode(); | 367 intptr_t ReadUntilFunctionNode(); |
371 StringIndex GetNameFromVariableDeclaration(intptr_t kernel_offset); | 368 StringIndex GetNameFromVariableDeclaration(intptr_t kernel_offset); |
372 | 369 |
373 FlowGraph* BuildGraphOfStaticFieldInitializer(); | 370 FlowGraph* BuildGraphOfStaticFieldInitializer(); |
374 FlowGraph* BuildGraphOfFieldAccessor(LocalVariable* setter_value); | 371 FlowGraph* BuildGraphOfFieldAccessor(LocalVariable* setter_value); |
375 void SetupDefaultParameterValues(); | 372 void SetupDefaultParameterValues(); |
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 private: | 1455 private: |
1459 Reader* reader_; | 1456 Reader* reader_; |
1460 intptr_t saved_offset_; | 1457 intptr_t saved_offset_; |
1461 }; | 1458 }; |
1462 | 1459 |
1463 } // namespace kernel | 1460 } // namespace kernel |
1464 } // namespace dart | 1461 } // namespace dart |
1465 | 1462 |
1466 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 1463 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
1467 #endif // RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ | 1464 #endif // RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ |
OLD | NEW |