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

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

Issue 966773002: VM: Better type propagation for string objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comment and fixed MaybeNumber Created 5 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 | Annotate | Revision Log
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/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/constant_propagator.h" 8 #include "vm/constant_propagator.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 2255 matching lines...) Expand 10 before | Expand all | Expand 10 after
2266 (cid == kMintCid) || 2266 (cid == kMintCid) ||
2267 (cid == kBigintCid) || 2267 (cid == kBigintCid) ||
2268 (cid == kDoubleCid); 2268 (cid == kDoubleCid);
2269 } 2269 }
2270 2270
2271 2271
2272 static bool MaybeNumber(CompileType* type) { 2272 static bool MaybeNumber(CompileType* type) {
2273 ASSERT(Type::Handle(Type::Number()).IsMoreSpecificThan( 2273 ASSERT(Type::Handle(Type::Number()).IsMoreSpecificThan(
2274 Type::Handle(Type::Number()), NULL)); 2274 Type::Handle(Type::Number()), NULL));
2275 return type->ToAbstractType()->IsDynamicType() 2275 return type->ToAbstractType()->IsDynamicType()
2276 || type->ToAbstractType()->IsObjectType()
2276 || type->ToAbstractType()->IsTypeParameter() 2277 || type->ToAbstractType()->IsTypeParameter()
2277 || type->IsMoreSpecificThan(Type::Handle(Type::Number())); 2278 || type->IsMoreSpecificThan(Type::Handle(Type::Number()));
2278 } 2279 }
2279 2280
2280 2281
2281 // Returns a replacement for a strict comparison and signals if the result has 2282 // Returns a replacement for a strict comparison and signals if the result has
2282 // to be negated. 2283 // to be negated.
2283 static Definition* CanonicalizeStrictCompare(StrictCompareInstr* compare, 2284 static Definition* CanonicalizeStrictCompare(StrictCompareInstr* compare,
2284 bool* negated) { 2285 bool* negated) {
2285 // Use propagated cid and type information to eliminate number checks. 2286 // Use propagated cid and type information to eliminate number checks.
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
3586 case Token::kTRUNCDIV: return 0; 3587 case Token::kTRUNCDIV: return 0;
3587 case Token::kMOD: return 1; 3588 case Token::kMOD: return 1;
3588 default: UNIMPLEMENTED(); return -1; 3589 default: UNIMPLEMENTED(); return -1;
3589 } 3590 }
3590 } 3591 }
3591 3592
3592 3593
3593 #undef __ 3594 #undef __
3594 3595
3595 } // namespace dart 3596 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.cc ('k') | tests/language/vm/optimized_identical_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698