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

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

Issue 2973633002: [kernel] Change how TypeParameterType is calculated. (Closed)
Patch Set: Rebased Created 3 years, 4 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) 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
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;
Kevin Millikin (Google) 2017/08/08 14:08:51 summed_ seems like a noise word and I wouldn't mak
jensj 2017/08/09 08:39:47 Done.
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() { translator_->type_parameter_scope_ = outer_; } 67 ~TypeParameterScope() { translator_->type_parameter_scope_ = outer_; }
63 68
64 TypeParameterScope* outer() const { return outer_; } 69 TypeParameterScope* outer() const { return outer_; }
65 intptr_t parameters_offset() const { return parameters_offset_; } 70 intptr_t parameters_offset() const { return parameters_offset_; }
66 intptr_t parameters_count() const { return parameters_count_; } 71 intptr_t parameters_count() const { return parameters_count_; }
72 intptr_t summed_outer_parameters_count() const {
73 return summed_outer_parameters_count_;
74 }
67 75
68 private: 76 private:
69 intptr_t parameters_offset_; 77 intptr_t parameters_offset_;
70 intptr_t parameters_count_; 78 intptr_t parameters_count_;
79 intptr_t summed_outer_parameters_count_;
71 TypeParameterScope* outer_; 80 TypeParameterScope* outer_;
72 StreamingDartTypeTranslator* translator_; 81 StreamingDartTypeTranslator* translator_;
73 }; 82 };
74 83
75 intptr_t FindTypeParameterIndex(intptr_t parameters_offset, 84 intptr_t FindTypeParameterIndex(intptr_t parameters_offset,
76 intptr_t parameters_count, 85 intptr_t parameters_count,
77 intptr_t look_for); 86 intptr_t look_for);
78 87
79 StreamingFlowGraphBuilder* builder_; 88 StreamingFlowGraphBuilder* builder_;
80 TranslationHelper& translation_helper_; 89 TranslationHelper& translation_helper_;
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 GrowableArray<intptr_t>* record_token_positions_in, 348 GrowableArray<intptr_t>* record_token_positions_in,
340 GrowableArray<intptr_t>* record_yield_positions_in); 349 GrowableArray<intptr_t>* record_yield_positions_in);
341 intptr_t SourceTableSize(); 350 intptr_t SourceTableSize();
342 String& SourceTableUriFor(intptr_t index); 351 String& SourceTableUriFor(intptr_t index);
343 String& GetSourceFor(intptr_t index); 352 String& GetSourceFor(intptr_t index);
344 Array& GetLineStartsFor(intptr_t index); 353 Array& GetLineStartsFor(intptr_t index);
345 354
346 private: 355 private:
347 void DiscoverEnclosingElements(Zone* zone, 356 void DiscoverEnclosingElements(Zone* zone,
348 const Function& function, 357 const Function& function,
349 Function* outermost_function, 358 Function* outermost_function);
350 intptr_t* outermost_kernel_offset,
351 intptr_t* parent_class_offset);
352 intptr_t GetParentOffset(intptr_t offset);
353 void GetTypeParameterInfoForClass(intptr_t class_offset,
354 intptr_t* type_paremeter_counts,
355 intptr_t* type_paremeter_offset);
356 359
357 void GetTypeParameterInfoForPossibleProcedure(
358 intptr_t outermost_kernel_offset,
359 bool* member_is_procedure,
360 bool* is_factory_procedure,
361 intptr_t* member_type_parameters,
362 intptr_t* member_type_parameters_offset_start);
363 /** 360 /**
364 * Will return kernel offset for parent class if reading a constructor. 361 * Will return kernel offset for parent class if reading a constructor.
365 * Will otherwise return -1. 362 * Will otherwise return -1.
366 */ 363 */
367 intptr_t ReadUntilFunctionNode(); 364 intptr_t ReadUntilFunctionNode();
368 StringIndex GetNameFromVariableDeclaration(intptr_t kernel_offset); 365 StringIndex GetNameFromVariableDeclaration(intptr_t kernel_offset);
369 366
370 FlowGraph* BuildGraphOfStaticFieldInitializer(); 367 FlowGraph* BuildGraphOfStaticFieldInitializer();
371 FlowGraph* BuildGraphOfFieldAccessor(LocalVariable* setter_value); 368 FlowGraph* BuildGraphOfFieldAccessor(LocalVariable* setter_value);
372 void SetupDefaultParameterValues(); 369 void SetupDefaultParameterValues();
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 private: 1541 private:
1545 Reader* reader_; 1542 Reader* reader_;
1546 intptr_t saved_offset_; 1543 intptr_t saved_offset_;
1547 }; 1544 };
1548 1545
1549 } // namespace kernel 1546 } // namespace kernel
1550 } // namespace dart 1547 } // namespace dart
1551 1548
1552 #endif // !defined(DART_PRECOMPILED_RUNTIME) 1549 #endif // !defined(DART_PRECOMPILED_RUNTIME)
1553 #endif // RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ 1550 #endif // RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698