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

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

Issue 2759393005: Cleanup change. (Closed)
Patch Set: Created 3 years, 9 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/intermediate_language.cc ('k') | runtime/vm/object.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 #ifndef DART_PRECOMPILED_RUNTIME 4 #ifndef DART_PRECOMPILED_RUNTIME
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 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 if (cls.NumTypeArguments() > 0) { 1204 if (cls.NumTypeArguments() > 0) {
1205 return Bool::null(); 1205 return Bool::null();
1206 } 1206 }
1207 // As of Dart 1.5, the Null type is a subtype of (and is more specific than) 1207 // As of Dart 1.5, the Null type is a subtype of (and is more specific than)
1208 // any type. However, we are checking instances here and not types. The 1208 // any type. However, we are checking instances here and not types. The
1209 // null instance is only an instance of Null, Object, and dynamic. 1209 // null instance is only an instance of Null, Object, and dynamic.
1210 const bool is_subtype = 1210 const bool is_subtype =
1211 cls.IsNullClass() 1211 cls.IsNullClass()
1212 ? (type_class.IsNullClass() || type_class.IsObjectClass() || 1212 ? (type_class.IsNullClass() || type_class.IsObjectClass() ||
1213 type_class.IsDynamicClass()) 1213 type_class.IsDynamicClass())
1214 : cls.IsSubtypeOf(TypeArguments::Handle(Z), type_class, 1214 : cls.IsSubtypeOf(Object::null_type_arguments(), type_class,
1215 TypeArguments::Handle(Z), NULL, NULL, Heap::kOld); 1215 Object::null_type_arguments(), NULL, NULL,
1216 Heap::kOld);
1216 results->Add(cls.id()); 1217 results->Add(cls.id());
1217 results->Add(is_subtype); 1218 results->Add(is_subtype);
1218 if (prev.IsNull()) { 1219 if (prev.IsNull()) {
1219 prev = Bool::Get(is_subtype).raw(); 1220 prev = Bool::Get(is_subtype).raw();
1220 } else { 1221 } else {
1221 if (is_subtype != prev.value()) { 1222 if (is_subtype != prev.value()) {
1222 results_differ = true; 1223 results_differ = true;
1223 } 1224 }
1224 } 1225 }
1225 } 1226 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 // necessary. 1298 // necessary.
1298 // TODO(srdjan): Do also for other than 'int' type. 1299 // TODO(srdjan): Do also for other than 'int' type.
1299 static bool TryExpandTestCidsResult(ZoneGrowableArray<intptr_t>* results, 1300 static bool TryExpandTestCidsResult(ZoneGrowableArray<intptr_t>* results,
1300 const AbstractType& type) { 1301 const AbstractType& type) {
1301 ASSERT(results->length() >= 2); // At least on eentry. 1302 ASSERT(results->length() >= 2); // At least on eentry.
1302 const ClassTable& class_table = *Isolate::Current()->class_table(); 1303 const ClassTable& class_table = *Isolate::Current()->class_table();
1303 if ((*results)[0] != kSmiCid) { 1304 if ((*results)[0] != kSmiCid) {
1304 const Class& cls = Class::Handle(class_table.At(kSmiCid)); 1305 const Class& cls = Class::Handle(class_table.At(kSmiCid));
1305 const Class& type_class = Class::Handle(type.type_class()); 1306 const Class& type_class = Class::Handle(type.type_class());
1306 const bool smi_is_subtype = 1307 const bool smi_is_subtype =
1307 cls.IsSubtypeOf(TypeArguments::Handle(), type_class, 1308 cls.IsSubtypeOf(Object::null_type_arguments(), type_class,
1308 TypeArguments::Handle(), NULL, NULL, Heap::kOld); 1309 Object::null_type_arguments(), NULL, NULL, Heap::kOld);
1309 results->Add((*results)[results->length() - 2]); 1310 results->Add((*results)[results->length() - 2]);
1310 results->Add((*results)[results->length() - 2]); 1311 results->Add((*results)[results->length() - 2]);
1311 for (intptr_t i = results->length() - 3; i > 1; --i) { 1312 for (intptr_t i = results->length() - 3; i > 1; --i) {
1312 (*results)[i] = (*results)[i - 2]; 1313 (*results)[i] = (*results)[i - 2];
1313 } 1314 }
1314 (*results)[0] = kSmiCid; 1315 (*results)[0] = kSmiCid;
1315 (*results)[1] = smi_is_subtype; 1316 (*results)[1] = smi_is_subtype;
1316 } 1317 }
1317 1318
1318 ASSERT(type.IsInstantiated() && !type.IsMalformedOrMalbounded()); 1319 ASSERT(type.IsInstantiated() && !type.IsMalformedOrMalbounded());
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
1868 // Discard the environment from the original instruction because the store 1869 // Discard the environment from the original instruction because the store
1869 // can't deoptimize. 1870 // can't deoptimize.
1870 instr->RemoveEnvironment(); 1871 instr->RemoveEnvironment();
1871 ReplaceCall(instr, store); 1872 ReplaceCall(instr, store);
1872 return true; 1873 return true;
1873 } 1874 }
1874 1875
1875 1876
1876 } // namespace dart 1877 } // namespace dart
1877 #endif // DART_PRECOMPILED_RUNTIME 1878 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698