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

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

Issue 1377453005: Cleanups and preemptively pass Heap::kOld whenever subtype testing in compiler (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: sync Created 5 years, 2 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_compiler_x64.cc ('k') | runtime/vm/intermediate_language.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/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 3990 matching lines...) Expand 10 before | Expand all | Expand 10 after
4001 bool results_differ = false; 4001 bool results_differ = false;
4002 for (int i = 0; i < ic_data.NumberOfChecks(); i++) { 4002 for (int i = 0; i < ic_data.NumberOfChecks(); i++) {
4003 cls = class_table.At(ic_data.GetReceiverClassIdAt(i)); 4003 cls = class_table.At(ic_data.GetReceiverClassIdAt(i));
4004 if (cls.NumTypeArguments() > 0) { 4004 if (cls.NumTypeArguments() > 0) {
4005 return Bool::null(); 4005 return Bool::null();
4006 } 4006 }
4007 const bool is_subtype = cls.IsSubtypeOf( 4007 const bool is_subtype = cls.IsSubtypeOf(
4008 TypeArguments::Handle(Z), 4008 TypeArguments::Handle(Z),
4009 type_class, 4009 type_class,
4010 TypeArguments::Handle(Z), 4010 TypeArguments::Handle(Z),
4011 NULL); 4011 NULL,
4012 Heap::kOld);
4012 results->Add(cls.id()); 4013 results->Add(cls.id());
4013 results->Add(is_subtype); 4014 results->Add(is_subtype);
4014 if (prev.IsNull()) { 4015 if (prev.IsNull()) {
4015 prev = Bool::Get(is_subtype).raw(); 4016 prev = Bool::Get(is_subtype).raw();
4016 } else { 4017 } else {
4017 if (is_subtype != prev.value()) { 4018 if (is_subtype != prev.value()) {
4018 results_differ = true; 4019 results_differ = true;
4019 } 4020 }
4020 } 4021 }
4021 } 4022 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
4092 static bool TryExpandTestCidsResult(ZoneGrowableArray<intptr_t>* results, 4093 static bool TryExpandTestCidsResult(ZoneGrowableArray<intptr_t>* results,
4093 const AbstractType& type) { 4094 const AbstractType& type) {
4094 ASSERT(results->length() >= 2); // At least on eentry. 4095 ASSERT(results->length() >= 2); // At least on eentry.
4095 const ClassTable& class_table = *Isolate::Current()->class_table(); 4096 const ClassTable& class_table = *Isolate::Current()->class_table();
4096 if ((*results)[0] != kSmiCid) { 4097 if ((*results)[0] != kSmiCid) {
4097 const Class& cls = Class::Handle(class_table.At(kSmiCid)); 4098 const Class& cls = Class::Handle(class_table.At(kSmiCid));
4098 const Class& type_class = Class::Handle(type.type_class()); 4099 const Class& type_class = Class::Handle(type.type_class());
4099 const bool smi_is_subtype = cls.IsSubtypeOf(TypeArguments::Handle(), 4100 const bool smi_is_subtype = cls.IsSubtypeOf(TypeArguments::Handle(),
4100 type_class, 4101 type_class,
4101 TypeArguments::Handle(), 4102 TypeArguments::Handle(),
4102 NULL); 4103 NULL,
4104 Heap::kOld);
4103 results->Add((*results)[results->length() - 2]); 4105 results->Add((*results)[results->length() - 2]);
4104 results->Add((*results)[results->length() - 2]); 4106 results->Add((*results)[results->length() - 2]);
4105 for (intptr_t i = results->length() - 3; i > 1; --i) { 4107 for (intptr_t i = results->length() - 3; i > 1; --i) {
4106 (*results)[i] = (*results)[i - 2]; 4108 (*results)[i] = (*results)[i - 2];
4107 } 4109 }
4108 (*results)[0] = kSmiCid; 4110 (*results)[0] = kSmiCid;
4109 (*results)[1] = smi_is_subtype; 4111 (*results)[1] = smi_is_subtype;
4110 } 4112 }
4111 4113
4112 ASSERT(type.IsInstantiated() && !type.IsMalformedOrMalbounded()); 4114 ASSERT(type.IsInstantiated() && !type.IsMalformedOrMalbounded());
(...skipping 4675 matching lines...) Expand 10 before | Expand all | Expand 10 after
8788 8790
8789 // Insert materializations at environment uses. 8791 // Insert materializations at environment uses.
8790 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { 8792 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) {
8791 CreateMaterializationAt( 8793 CreateMaterializationAt(
8792 exits_collector_.exits()[i], alloc, *slots); 8794 exits_collector_.exits()[i], alloc, *slots);
8793 } 8795 }
8794 } 8796 }
8795 8797
8796 8798
8797 } // namespace dart 8799 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698