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

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

Issue 11861007: Move indexSet and unary operators to the new interceptor mechanism. (Closed) Base URL: http://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
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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 328 }
329 apply(left, right) => identical(left, right); 329 apply(left, right) => identical(left, right);
330 } 330 }
331 331
332 /** 332 /**
333 * A constant system implementing the Dart semantics. This system relies on 333 * A constant system implementing the Dart semantics. This system relies on
334 * the underlying runtime-system. That is, if dart2js is run in an environment 334 * the underlying runtime-system. That is, if dart2js is run in an environment
335 * that doesn't correctly implement Dart's semantics this constant system will 335 * that doesn't correctly implement Dart's semantics this constant system will
336 * not return the correct values. 336 * not return the correct values.
337 */ 337 */
338 class DartConstantSystem implements ConstantSystem { 338 class DartConstantSystem extends ConstantSystem {
339 const add = const AddOperation(); 339 const add = const AddOperation();
340 const bitAnd = const BitAndOperation(); 340 const bitAnd = const BitAndOperation();
341 const bitNot = const BitNotOperation(); 341 const bitNot = const BitNotOperation();
342 const bitOr = const BitOrOperation(); 342 const bitOr = const BitOrOperation();
343 const bitXor = const BitXorOperation(); 343 const bitXor = const BitXorOperation();
344 const booleanAnd = const BooleanAndOperation(); 344 const booleanAnd = const BooleanAndOperation();
345 const booleanOr = const BooleanOrOperation(); 345 const booleanOr = const BooleanOrOperation();
346 const divide = const DivideOperation(); 346 const divide = const DivideOperation();
347 const equal = const EqualsOperation(); 347 const equal = const EqualsOperation();
348 const greaterEqual = const GreaterEqualOperation(); 348 const greaterEqual = const GreaterEqualOperation();
(...skipping 22 matching lines...) Expand all
371 bool isInt(Constant constant) => constant.isInt(); 371 bool isInt(Constant constant) => constant.isInt();
372 bool isDouble(Constant constant) => constant.isDouble(); 372 bool isDouble(Constant constant) => constant.isDouble();
373 bool isString(Constant constant) => constant.isString(); 373 bool isString(Constant constant) => constant.isString();
374 bool isBool(Constant constant) => constant.isBool(); 374 bool isBool(Constant constant) => constant.isBool();
375 bool isNull(Constant constant) => constant.isNull(); 375 bool isNull(Constant constant) => constant.isNull();
376 376
377 bool isSubtype(Compiler compiler, DartType s, DartType t) { 377 bool isSubtype(Compiler compiler, DartType s, DartType t) {
378 return compiler.types.isSubtype(s, t); 378 return compiler.types.isSubtype(s, t);
379 } 379 }
380 } 380 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698