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

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

Issue 883263004: Allows turning on checked mode on a per-isolate basis (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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_compiler.cc ('k') | runtime/vm/flow_graph_type_propagator.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/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/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 ASSERT(array_cid != kIllegalCid); 1192 ASSERT(array_cid != kIllegalCid);
1193 1193
1194 Definition* array = receiver; 1194 Definition* array = receiver;
1195 Definition* index = call->ArgumentAt(1); 1195 Definition* index = call->ArgumentAt(1);
1196 Definition* stored_value = call->ArgumentAt(2); 1196 Definition* stored_value = call->ArgumentAt(2);
1197 1197
1198 *entry = new(Z) TargetEntryInstr(flow_graph()->allocate_block_id(), 1198 *entry = new(Z) TargetEntryInstr(flow_graph()->allocate_block_id(),
1199 call->GetBlock()->try_index()); 1199 call->GetBlock()->try_index());
1200 (*entry)->InheritDeoptTarget(I, call); 1200 (*entry)->InheritDeoptTarget(I, call);
1201 Instruction* cursor = *entry; 1201 Instruction* cursor = *entry;
1202 if (FLAG_enable_type_checks) { 1202 if (I->TypeChecksEnabled()) {
1203 // Only type check for the value. A type check for the index is not 1203 // Only type check for the value. A type check for the index is not
1204 // needed here because we insert a deoptimizing smi-check for the case 1204 // needed here because we insert a deoptimizing smi-check for the case
1205 // the index is not a smi. 1205 // the index is not a smi.
1206 const AbstractType& value_type = 1206 const AbstractType& value_type =
1207 AbstractType::ZoneHandle(Z, target.ParameterTypeAt(2)); 1207 AbstractType::ZoneHandle(Z, target.ParameterTypeAt(2));
1208 Definition* instantiator = NULL; 1208 Definition* instantiator = NULL;
1209 Definition* type_args = NULL; 1209 Definition* type_args = NULL;
1210 switch (array_cid) { 1210 switch (array_cid) {
1211 case kArrayCid: 1211 case kArrayCid:
1212 case kGrowableObjectArrayCid: { 1212 case kGrowableObjectArrayCid: {
(...skipping 3278 matching lines...) Expand 10 before | Expand all | Expand 10 after
4491 if (!instr->can_pack_into_smi()) 4491 if (!instr->can_pack_into_smi())
4492 instr->set_representation(kUnboxedMint); 4492 instr->set_representation(kUnboxedMint);
4493 #endif 4493 #endif
4494 } 4494 }
4495 4495
4496 4496
4497 bool FlowGraphOptimizer::TryInlineInstanceSetter(InstanceCallInstr* instr, 4497 bool FlowGraphOptimizer::TryInlineInstanceSetter(InstanceCallInstr* instr,
4498 const ICData& unary_ic_data) { 4498 const ICData& unary_ic_data) {
4499 ASSERT((unary_ic_data.NumberOfChecks() > 0) && 4499 ASSERT((unary_ic_data.NumberOfChecks() > 0) &&
4500 (unary_ic_data.NumArgsTested() == 1)); 4500 (unary_ic_data.NumArgsTested() == 1));
4501 if (FLAG_enable_type_checks) { 4501 if (I->TypeChecksEnabled()) {
4502 // Checked mode setters are inlined like normal methods by conventional 4502 // Checked mode setters are inlined like normal methods by conventional
4503 // inlining. 4503 // inlining.
4504 return false; 4504 return false;
4505 } 4505 }
4506 4506
4507 ASSERT(instr->HasICData()); 4507 ASSERT(instr->HasICData());
4508 if (unary_ic_data.NumberOfChecks() == 0) { 4508 if (unary_ic_data.NumberOfChecks() == 0) {
4509 // No type feedback collected. 4509 // No type feedback collected.
4510 return false; 4510 return false;
4511 } 4511 }
(...skipping 4096 matching lines...) Expand 10 before | Expand all | Expand 10 after
8608 8608
8609 // Insert materializations at environment uses. 8609 // Insert materializations at environment uses.
8610 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { 8610 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) {
8611 CreateMaterializationAt( 8611 CreateMaterializationAt(
8612 exits_collector_.exits()[i], alloc, *slots); 8612 exits_collector_.exits()[i], alloc, *slots);
8613 } 8613 }
8614 } 8614 }
8615 8615
8616 8616
8617 } // namespace dart 8617 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698