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

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

Issue 22629005: Add a performance assert that we do not emit a null check for smi class-ids. Instead we should use … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flow_graph_allocator.h" 10 #include "vm/flow_graph_allocator.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return externalizable ? EffectSet::Externalization() : EffectSet::None(); 126 return externalizable ? EffectSet::Externalization() : EffectSet::None();
127 } 127 }
128 128
129 129
130 bool CheckClassInstr::IsNullCheck() const { 130 bool CheckClassInstr::IsNullCheck() const {
131 if (unary_checks().NumberOfChecks() != 1) { 131 if (unary_checks().NumberOfChecks() != 1) {
132 return false; 132 return false;
133 } 133 }
134 CompileType* in_type = value()->Type(); 134 CompileType* in_type = value()->Type();
135 const intptr_t cid = unary_checks().GetCidAt(0); 135 const intptr_t cid = unary_checks().GetCidAt(0);
136 // Performance check: use CheckSmiInstr instead.
137 ASSERT(cid != kSmiCid);
136 return in_type->is_nullable() && (in_type->ToNullableCid() == cid); 138 return in_type->is_nullable() && (in_type->ToNullableCid() == cid);
137 } 139 }
138 140
139 141
140 bool GuardFieldInstr::AttributesEqual(Instruction* other) const { 142 bool GuardFieldInstr::AttributesEqual(Instruction* other) const {
141 return field().raw() == other->AsGuardField()->field().raw(); 143 return field().raw() == other->AsGuardField()->field().raw();
142 } 144 }
143 145
144 146
145 bool AssertAssignableInstr::AttributesEqual(Instruction* other) const { 147 bool AssertAssignableInstr::AttributesEqual(Instruction* other) const {
(...skipping 2453 matching lines...) Expand 10 before | Expand all | Expand 10 after
2599 default: 2601 default:
2600 UNREACHABLE(); 2602 UNREACHABLE();
2601 } 2603 }
2602 return kPowRuntimeEntry; 2604 return kPowRuntimeEntry;
2603 } 2605 }
2604 2606
2605 2607
2606 #undef __ 2608 #undef __
2607 2609
2608 } // namespace dart 2610 } // 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