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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/constant_system_dart.dart

Issue 11773026: Update co19 status files and some small fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | sdk/lib/core/iterable.dart » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of dart2js; 5 part of dart2js;
6 6
7 const DART_CONSTANT_SYSTEM = const DartConstantSystem(); 7 const DART_CONSTANT_SYSTEM = const DartConstantSystem();
8 8
9 class BitNotOperation implements UnaryOperation { 9 class BitNotOperation implements UnaryOperation {
10 final SourceString name = const SourceString('~'); 10 final SourceString name = const SourceString('~');
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 apply(left, right) => left % right; 200 apply(left, right) => left % right;
201 } 201 }
202 202
203 class TruncatingDivideOperation extends ArithmeticNumOperation { 203 class TruncatingDivideOperation extends ArithmeticNumOperation {
204 final SourceString name = const SourceString('~/'); 204 final SourceString name = const SourceString('~/');
205 const TruncatingDivideOperation(); 205 const TruncatingDivideOperation();
206 int foldInts(int left, int right) { 206 int foldInts(int left, int right) {
207 if (right == 0) return null; 207 if (right == 0) return null;
208 return left ~/ right; 208 return left ~/ right;
209 } 209 }
210 num foldNums(num left, num right) => left ~/ right; 210 num foldNums(num left, num right) {
211 num ratio = left / right;
212 if (ratio.isNaN || ratio.isInfinite) return null;
213 return ratio.truncate().toInt();
214 }
211 apply(left, right) => left ~/ right; 215 apply(left, right) => left ~/ right;
212 } 216 }
213 217
214 class DivideOperation extends ArithmeticNumOperation { 218 class DivideOperation extends ArithmeticNumOperation {
215 final SourceString name = const SourceString('/'); 219 final SourceString name = const SourceString('/');
216 const DivideOperation(); 220 const DivideOperation();
217 num foldNums(num left, num right) => left / right; 221 num foldNums(num left, num right) => left / right;
218 bool isDivide() => true; 222 bool isDivide() => true;
219 apply(left, right) => left / right; 223 apply(left, right) => left / right;
220 } 224 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 bool isInt(Constant constant) => constant.isInt(); 368 bool isInt(Constant constant) => constant.isInt();
365 bool isDouble(Constant constant) => constant.isDouble(); 369 bool isDouble(Constant constant) => constant.isDouble();
366 bool isString(Constant constant) => constant.isString(); 370 bool isString(Constant constant) => constant.isString();
367 bool isBool(Constant constant) => constant.isBool(); 371 bool isBool(Constant constant) => constant.isBool();
368 bool isNull(Constant constant) => constant.isNull(); 372 bool isNull(Constant constant) => constant.isNull();
369 373
370 bool isSubtype(Compiler compiler, DartType s, DartType t) { 374 bool isSubtype(Compiler compiler, DartType s, DartType t) {
371 return compiler.types.isSubtype(s, t); 375 return compiler.types.isSubtype(s, t);
372 } 376 }
373 } 377 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/core/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698