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

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

Issue 403043002: Small tuning of unboxing heuristic. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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 | « no previous file | no next file » | 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 4379 matching lines...) Expand 10 before | Expand all | Expand 10 after
4390 const Field& field = Field::ZoneHandle(I, instr->field().raw()); 4390 const Field& field = Field::ZoneHandle(I, instr->field().raw());
4391 const String& field_name = String::Handle(I, field.name()); 4391 const String& field_name = String::Handle(I, field.name());
4392 class Class& owner = Class::Handle(I, field.owner()); 4392 class Class& owner = Class::Handle(I, field.owner());
4393 const Function& getter = 4393 const Function& getter =
4394 Function::Handle(I, owner.LookupGetterFunction(field_name)); 4394 Function::Handle(I, owner.LookupGetterFunction(field_name));
4395 const Function& setter = 4395 const Function& setter =
4396 Function::Handle(I, owner.LookupSetterFunction(field_name)); 4396 Function::Handle(I, owner.LookupSetterFunction(field_name));
4397 bool result = !getter.IsNull() 4397 bool result = !getter.IsNull()
4398 && !setter.IsNull() 4398 && !setter.IsNull()
4399 && (setter.usage_counter() > 0) 4399 && (setter.usage_counter() > 0)
4400 && (FLAG_getter_setter_ratio * setter.usage_counter() > 4400 && (FLAG_getter_setter_ratio * setter.usage_counter() >=
4401 getter.usage_counter()); 4401 getter.usage_counter());
4402 if (!result) { 4402 if (!result) {
4403 if (FLAG_trace_optimization) { 4403 if (FLAG_trace_optimization) {
4404 OS::Print("Disabling unboxing of %s\n", field.ToCString()); 4404 OS::Print("Disabling unboxing of %s\n", field.ToCString());
4405 } 4405 }
4406 field.set_is_unboxing_candidate(false); 4406 field.set_is_unboxing_candidate(false);
4407 field.DeoptimizeDependentCode(); 4407 field.DeoptimizeDependentCode();
4408 } else { 4408 } else {
4409 FlowGraph::AddToGuardedFields(flow_graph_->guarded_fields(), &field); 4409 FlowGraph::AddToGuardedFields(flow_graph_->guarded_fields(), &field);
4410 } 4410 }
(...skipping 6006 matching lines...) Expand 10 before | Expand all | Expand 10 after
10417 10417
10418 // Insert materializations at environment uses. 10418 // Insert materializations at environment uses.
10419 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { 10419 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) {
10420 CreateMaterializationAt( 10420 CreateMaterializationAt(
10421 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); 10421 exits_collector_.exits()[i], alloc, alloc->cls(), *slots);
10422 } 10422 }
10423 } 10423 }
10424 10424
10425 10425
10426 } // namespace dart 10426 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698