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

Side by Side Diff: vm/flow_graph_optimizer.cc

Issue 11648006: Create read only handles for empty_array and sentinel objects (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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
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_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/flow_graph_builder.h" 9 #include "vm/flow_graph_builder.h"
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
(...skipping 3476 matching lines...) Expand 10 before | Expand all | Expand 10 after
3487 } 3487 }
3488 return changed; 3488 return changed;
3489 } 3489 }
3490 3490
3491 3491
3492 ConstantPropagator::ConstantPropagator( 3492 ConstantPropagator::ConstantPropagator(
3493 FlowGraph* graph, 3493 FlowGraph* graph,
3494 const GrowableArray<BlockEntryInstr*>& ignored) 3494 const GrowableArray<BlockEntryInstr*>& ignored)
3495 : FlowGraphVisitor(ignored), 3495 : FlowGraphVisitor(ignored),
3496 graph_(graph), 3496 graph_(graph),
3497 unknown_(Object::ZoneHandle(Object::transition_sentinel())), 3497 unknown_(Object::transition_sentinel()),
3498 non_constant_(Object::ZoneHandle(Object::sentinel())), 3498 non_constant_(Object::sentinel()),
3499 reachable_(new BitVector(graph->preorder().length())), 3499 reachable_(new BitVector(graph->preorder().length())),
3500 definition_marks_(new BitVector(graph->max_virtual_register_number())), 3500 definition_marks_(new BitVector(graph->max_virtual_register_number())),
3501 block_worklist_(), 3501 block_worklist_(),
3502 definition_worklist_() {} 3502 definition_worklist_() {}
3503 3503
3504 3504
3505 void ConstantPropagator::Optimize(FlowGraph* graph) { 3505 void ConstantPropagator::Optimize(FlowGraph* graph) {
3506 GrowableArray<BlockEntryInstr*> ignored; 3506 GrowableArray<BlockEntryInstr*> ignored;
3507 ConstantPropagator cp(graph, ignored); 3507 ConstantPropagator cp(graph, ignored);
3508 cp.Analyze(); 3508 cp.Analyze();
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
4333 4333
4334 if (FLAG_trace_constant_propagation) { 4334 if (FLAG_trace_constant_propagation) {
4335 OS::Print("\n==== After constant propagation ====\n"); 4335 OS::Print("\n==== After constant propagation ====\n");
4336 FlowGraphPrinter printer(*graph_); 4336 FlowGraphPrinter printer(*graph_);
4337 printer.PrintBlocks(); 4337 printer.PrintBlocks();
4338 } 4338 }
4339 } 4339 }
4340 4340
4341 4341
4342 } // namespace dart 4342 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698