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

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

Issue 2112973002: Remove invalid assertion in the optimizer (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: added const Created 4 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
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/parser.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/jit_optimizer.h" 5 #include "vm/jit_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/branch_optimizer.h" 8 #include "vm/branch_optimizer.h"
9 #include "vm/cha.h" 9 #include "vm/cha.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 2757 matching lines...) Expand 10 before | Expand all | Expand 10 after
2768 } 2768 }
2769 } 2769 }
2770 } 2770 }
2771 } 2771 }
2772 } 2772 }
2773 2773
2774 2774
2775 void JitOptimizer::VisitStoreInstanceField( 2775 void JitOptimizer::VisitStoreInstanceField(
2776 StoreInstanceFieldInstr* instr) { 2776 StoreInstanceFieldInstr* instr) {
2777 if (instr->IsUnboxedStore()) { 2777 if (instr->IsUnboxedStore()) {
2778 ASSERT(instr->is_initialization());
2779 // Determine if this field should be unboxed based on the usage of getter 2778 // Determine if this field should be unboxed based on the usage of getter
2780 // and setter functions: The heuristic requires that the setter has a 2779 // and setter functions: The heuristic requires that the setter has a
2781 // usage count of at least 1/kGetterSetterRatio of the getter usage count. 2780 // usage count of at least 1/kGetterSetterRatio of the getter usage count.
2782 // This is to avoid unboxing fields where the setter is never or rarely 2781 // This is to avoid unboxing fields where the setter is never or rarely
2783 // executed. 2782 // executed.
2784 const Field& field = instr->field(); 2783 const Field& field = instr->field();
2785 const String& field_name = String::Handle(Z, field.name()); 2784 const String& field_name = String::Handle(Z, field.name());
2786 const Class& owner = Class::Handle(Z, field.Owner()); 2785 const Class& owner = Class::Handle(Z, field.Owner());
2787 const Function& getter = 2786 const Function& getter =
2788 Function::Handle(Z, owner.LookupGetterFunction(field_name)); 2787 Function::Handle(Z, owner.LookupGetterFunction(field_name));
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
2946 2945
2947 // Discard the environment from the original instruction because the store 2946 // Discard the environment from the original instruction because the store
2948 // can't deoptimize. 2947 // can't deoptimize.
2949 instr->RemoveEnvironment(); 2948 instr->RemoveEnvironment();
2950 ReplaceCall(instr, store); 2949 ReplaceCall(instr, store);
2951 return true; 2950 return true;
2952 } 2951 }
2953 2952
2954 2953
2955 } // namespace dart 2954 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698