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

Side by Side Diff: runtime/vm/flow_graph.cc

Issue 14935005: Implement a variation of scalar replacement for non-escaping allocations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comments Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph.h ('k') | runtime/vm/flow_graph_allocator.h » ('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 #include "vm/flow_graph.h" 5 #include "vm/flow_graph.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/flow_graph_builder.h" 8 #include "vm/flow_graph_builder.h"
9 #include "vm/intermediate_language.h" 9 #include "vm/intermediate_language.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 11 matching lines...) Expand all
22 current_ssa_temp_index_(0), 22 current_ssa_temp_index_(0),
23 max_block_id_(max_block_id), 23 max_block_id_(max_block_id),
24 parsed_function_(builder.parsed_function()), 24 parsed_function_(builder.parsed_function()),
25 num_copied_params_(builder.num_copied_params()), 25 num_copied_params_(builder.num_copied_params()),
26 num_non_copied_params_(builder.num_non_copied_params()), 26 num_non_copied_params_(builder.num_non_copied_params()),
27 num_stack_locals_(builder.num_stack_locals()), 27 num_stack_locals_(builder.num_stack_locals()),
28 graph_entry_(graph_entry), 28 graph_entry_(graph_entry),
29 preorder_(), 29 preorder_(),
30 postorder_(), 30 postorder_(),
31 reverse_postorder_(), 31 reverse_postorder_(),
32 block_effects_(NULL) { 32 block_effects_(NULL),
33 licm_allowed_(true) {
33 DiscoverBlocks(); 34 DiscoverBlocks();
34 } 35 }
35 36
36 37
37 ConstantInstr* FlowGraph::GetConstant(const Object& object) { 38 ConstantInstr* FlowGraph::GetConstant(const Object& object) {
38 // Check if the constant is already in the pool. 39 // Check if the constant is already in the pool.
39 GrowableArray<Definition*>* pool = graph_entry_->initial_definitions(); 40 GrowableArray<Definition*>* pool = graph_entry_->initial_definitions();
40 for (intptr_t i = 0; i < pool->length(); ++i) { 41 for (intptr_t i = 0; i < pool->length(); ++i) {
41 ConstantInstr* constant = (*pool)[i]->AsConstant(); 42 ConstantInstr* constant = (*pool)[i]->AsConstant();
42 if ((constant != NULL) && (constant->value().raw() == object.raw())) { 43 if ((constant != NULL) && (constant->value().raw() == object.raw())) {
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 } 1057 }
1057 1058
1058 1059
1059 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, 1060 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from,
1060 BlockEntryInstr* to) const { 1061 BlockEntryInstr* to) const {
1061 return available_at_[to->postorder_number()]->Contains( 1062 return available_at_[to->postorder_number()]->Contains(
1062 from->postorder_number()); 1063 from->postorder_number());
1063 } 1064 }
1064 1065
1065 } // namespace dart 1066 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph.h ('k') | runtime/vm/flow_graph_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698