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

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

Issue 12212050: Fix allocation of array tables (use store barrier if needed, store values directly instead of via s… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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_builder.cc ('k') | runtime/vm/intermediate_language.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) 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/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 3823 matching lines...) Expand 10 before | Expand all | Expand 10 after
3834 void ConstantPropagator::VisitAllocateObjectWithBoundsCheck( 3834 void ConstantPropagator::VisitAllocateObjectWithBoundsCheck(
3835 AllocateObjectWithBoundsCheckInstr* instr) { 3835 AllocateObjectWithBoundsCheckInstr* instr) {
3836 SetValue(instr, non_constant_); 3836 SetValue(instr, non_constant_);
3837 } 3837 }
3838 3838
3839 3839
3840 void ConstantPropagator::VisitLoadField(LoadFieldInstr* instr) { 3840 void ConstantPropagator::VisitLoadField(LoadFieldInstr* instr) {
3841 if ((instr->recognized_kind() == MethodRecognizer::kObjectArrayLength) && 3841 if ((instr->recognized_kind() == MethodRecognizer::kObjectArrayLength) &&
3842 (instr->value()->definition()->IsCreateArray())) { 3842 (instr->value()->definition()->IsCreateArray())) {
3843 const intptr_t length = 3843 const intptr_t length =
3844 instr->value()->definition()->AsCreateArray()->ArgumentCount(); 3844 instr->value()->definition()->AsCreateArray()->num_elements();
3845 const Object& result = Smi::ZoneHandle(Smi::New(length)); 3845 const Object& result = Smi::ZoneHandle(Smi::New(length));
3846 SetValue(instr, result); 3846 SetValue(instr, result);
3847 return; 3847 return;
3848 } 3848 }
3849 3849
3850 if (instr->IsImmutableLengthLoad()) { 3850 if (instr->IsImmutableLengthLoad()) {
3851 ConstantInstr* constant = instr->value()->definition()->AsConstant(); 3851 ConstantInstr* constant = instr->value()->definition()->AsConstant();
3852 if (constant != NULL) { 3852 if (constant != NULL) {
3853 if (constant->value().IsString()) { 3853 if (constant->value().IsString()) {
3854 SetValue(instr, Smi::ZoneHandle( 3854 SetValue(instr, Smi::ZoneHandle(
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
4253 4253
4254 if (FLAG_trace_constant_propagation) { 4254 if (FLAG_trace_constant_propagation) {
4255 OS::Print("\n==== After constant propagation ====\n"); 4255 OS::Print("\n==== After constant propagation ====\n");
4256 FlowGraphPrinter printer(*graph_); 4256 FlowGraphPrinter printer(*graph_);
4257 printer.PrintBlocks(); 4257 printer.PrintBlocks();
4258 } 4258 }
4259 } 4259 }
4260 4260
4261 4261
4262 } // namespace dart 4262 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698