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

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

Issue 1961393002: VM: Optimized code for all of [External]{One|Two}ByteString::codeUnitAt. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comment Created 4 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
« no previous file with comments | « runtime/vm/aot_optimizer.cc ('k') | runtime/vm/flow_graph_inliner.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/constant_propagator.h" 5 #include "vm/constant_propagator.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/flow_graph_compiler.h" 9 #include "vm/flow_graph_compiler.h"
10 #include "vm/flow_graph_range_analysis.h" 10 #include "vm/flow_graph_range_analysis.h"
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 void ConstantPropagator::VisitNativeCall(NativeCallInstr* instr) { 597 void ConstantPropagator::VisitNativeCall(NativeCallInstr* instr) {
598 SetValue(instr, non_constant_); 598 SetValue(instr, non_constant_);
599 } 599 }
600 600
601 601
602 void ConstantPropagator::VisitDebugStepCheck(DebugStepCheckInstr* instr) { 602 void ConstantPropagator::VisitDebugStepCheck(DebugStepCheckInstr* instr) {
603 // Nothing to do. 603 // Nothing to do.
604 } 604 }
605 605
606 606
607 void ConstantPropagator::VisitStringFromCharCode( 607 void ConstantPropagator::VisitOneByteStringFromCharCode(
608 StringFromCharCodeInstr* instr) { 608 OneByteStringFromCharCodeInstr* instr) {
609 const Object& o = instr->char_code()->definition()->constant_value(); 609 const Object& o = instr->char_code()->definition()->constant_value();
610 if (o.IsNull() || IsNonConstant(o)) { 610 if (o.IsNull() || IsNonConstant(o)) {
611 SetValue(instr, non_constant_); 611 SetValue(instr, non_constant_);
612 } else if (IsConstant(o)) { 612 } else if (IsConstant(o)) {
613 const intptr_t ch_code = Smi::Cast(o).Value(); 613 const intptr_t ch_code = Smi::Cast(o).Value();
614 ASSERT(ch_code >= 0); 614 ASSERT(ch_code >= 0);
615 if (ch_code < Symbols::kMaxOneCharCodeSymbol) { 615 if (ch_code < Symbols::kMaxOneCharCodeSymbol) {
616 RawString** table = Symbols::PredefinedAddress(); 616 RawString** table = Symbols::PredefinedAddress();
617 SetValue(instr, String::ZoneHandle(Z, table[ch_code])); 617 SetValue(instr, String::ZoneHandle(Z, table[ch_code]));
618 } else { 618 } else {
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after
1680 graph_->MergeBlocks(); 1680 graph_->MergeBlocks();
1681 GrowableArray<BitVector*> dominance_frontier; 1681 GrowableArray<BitVector*> dominance_frontier;
1682 graph_->ComputeDominators(&dominance_frontier); 1682 graph_->ComputeDominators(&dominance_frontier);
1683 1683
1684 if (FLAG_trace_constant_propagation) { 1684 if (FLAG_trace_constant_propagation) {
1685 FlowGraphPrinter::PrintGraph("After CP", graph_); 1685 FlowGraphPrinter::PrintGraph("After CP", graph_);
1686 } 1686 }
1687 } 1687 }
1688 1688
1689 } // namespace dart 1689 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/aot_optimizer.cc ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698