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

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

Issue 1317213003: Improve async code in VM by not unnecessarily capturing parameters of async and (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Avoid duplicate aliases Created 5 years, 3 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
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 VM_FLOW_GRAPH_BUILDER_H_ 5 #ifndef VM_FLOW_GRAPH_BUILDER_H_
6 #define VM_FLOW_GRAPH_BUILDER_H_ 6 #define VM_FLOW_GRAPH_BUILDER_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/globals.h" 9 #include "platform/globals.h"
10 #include "vm/allocation.h" 10 #include "vm/allocation.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 // Manage the currently active try index. 157 // Manage the currently active try index.
158 void set_try_index(intptr_t value) { try_index_ = value; } 158 void set_try_index(intptr_t value) { try_index_ = value; }
159 intptr_t try_index() const { return try_index_; } 159 intptr_t try_index() const { return try_index_; }
160 160
161 // Manage the currently active catch-handler try index. 161 // Manage the currently active catch-handler try index.
162 void set_catch_try_index(intptr_t value) { catch_try_index_ = value; } 162 void set_catch_try_index(intptr_t value) { catch_try_index_ = value; }
163 intptr_t catch_try_index() const { return catch_try_index_; } 163 intptr_t catch_try_index() const { return catch_try_index_; }
164 164
165 intptr_t next_await_counter() { return jump_count_++; } 165 intptr_t next_await_counter() { return jump_count_++; }
166 166
167 ZoneGrowableArray<intptr_t>* await_levels() const { return await_levels_; }
168 ZoneGrowableArray<JoinEntryInstr*>* await_joins() const { 167 ZoneGrowableArray<JoinEntryInstr*>* await_joins() const {
169 return await_joins_; 168 return await_joins_;
170 } 169 }
171 170
172 void AddCatchEntry(CatchBlockEntryInstr* entry); 171 void AddCatchEntry(CatchBlockEntryInstr* entry);
173 172
174 intptr_t num_copied_params() const { 173 intptr_t num_copied_params() const {
175 return num_copied_params_; 174 return num_copied_params_;
176 } 175 }
177 intptr_t num_non_copied_params() const { 176 intptr_t num_non_copied_params() const {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 246
248 // A stack of enclosing nested statements. 247 // A stack of enclosing nested statements.
249 NestedStatement* nesting_stack_; 248 NestedStatement* nesting_stack_;
250 249
251 // The deopt id of the OSR entry or Isolate::kNoDeoptId if not compiling 250 // The deopt id of the OSR entry or Isolate::kNoDeoptId if not compiling
252 // for OSR. 251 // for OSR.
253 const intptr_t osr_id_; 252 const intptr_t osr_id_;
254 253
255 intptr_t jump_count_; 254 intptr_t jump_count_;
256 ZoneGrowableArray<JoinEntryInstr*>* await_joins_; 255 ZoneGrowableArray<JoinEntryInstr*>* await_joins_;
257 ZoneGrowableArray<intptr_t>* await_levels_;
258 256
259 DISALLOW_IMPLICIT_CONSTRUCTORS(FlowGraphBuilder); 257 DISALLOW_IMPLICIT_CONSTRUCTORS(FlowGraphBuilder);
260 }; 258 };
261 259
262 260
263 // Translate an AstNode to a control-flow graph fragment for its effects 261 // Translate an AstNode to a control-flow graph fragment for its effects
264 // (e.g., a statement or an expression in an effect context). Implements a 262 // (e.g., a statement or an expression in an effect context). Implements a
265 // function from an AstNode and next temporary index to a graph fragment 263 // function from an AstNode and next temporary index to a graph fragment
266 // with a single entry and at most one exit. The fragment is represented by 264 // with a single entry and at most one exit. The fragment is represented by
267 // an (entry, exit) pair of Instruction pointers: 265 // an (entry, exit) pair of Instruction pointers:
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 const AbstractType& dst_type, 456 const AbstractType& dst_type,
459 const String& dst_name); 457 const String& dst_name);
460 458
461 // Helpers for allocating and deallocating temporary locals on top of the 459 // Helpers for allocating and deallocating temporary locals on top of the
462 // expression stack. 460 // expression stack.
463 LocalVariable* EnterTempLocalScope(Value* value); 461 LocalVariable* EnterTempLocalScope(Value* value);
464 Definition* ExitTempLocalScope(LocalVariable* var); 462 Definition* ExitTempLocalScope(LocalVariable* var);
465 463
466 void BuildLetTempExpressions(LetNode* node); 464 void BuildLetTempExpressions(LetNode* node);
467 465
468 void BuildSyncYieldJump(LocalVariable* old_context,
469 LocalVariable* iterator_param,
470 const intptr_t old_ctx_level,
471 JoinEntryInstr* target);
472
473 void BuildAsyncJump(LocalVariable* old_context,
474 LocalVariable* continuation_result,
475 LocalVariable* continuation_error,
476 LocalVariable* continuation_stack_trace,
477 const intptr_t old_ctx_level,
478 JoinEntryInstr* target);
479
480 void BuildInstanceGetterConditional(InstanceGetterNode* node); 466 void BuildInstanceGetterConditional(InstanceGetterNode* node);
481 void BuildInstanceCallConditional(InstanceCallNode* node); 467 void BuildInstanceCallConditional(InstanceCallNode* node);
482 468
483 Isolate* isolate() const { return owner()->isolate(); } 469 Isolate* isolate() const { return owner()->isolate(); }
484 Zone* zone() const { return owner()->zone(); } 470 Zone* zone() const { return owner()->zone(); }
485 471
486 private: 472 private:
487 friend class TempLocalScope; // For ReturnDefinition. 473 friend class TempLocalScope; // For ReturnDefinition.
488 474
489 // Helper to drop the result value. 475 // Helper to drop the result value.
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 // Output parameters. 600 // Output parameters.
615 GrowableArray<TargetEntryInstr**> true_successor_addresses_; 601 GrowableArray<TargetEntryInstr**> true_successor_addresses_;
616 GrowableArray<TargetEntryInstr**> false_successor_addresses_; 602 GrowableArray<TargetEntryInstr**> false_successor_addresses_;
617 603
618 intptr_t condition_token_pos_; 604 intptr_t condition_token_pos_;
619 }; 605 };
620 606
621 } // namespace dart 607 } // namespace dart
622 608
623 #endif // VM_FLOW_GRAPH_BUILDER_H_ 609 #endif // VM_FLOW_GRAPH_BUILDER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698