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

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

Issue 11262032: Add 'part of' in dart2js code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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;
6
5 const DART_CONSTANT_SYSTEM = const DartConstantSystem(); 7 const DART_CONSTANT_SYSTEM = const DartConstantSystem();
6 8
7 class BitNotOperation implements UnaryOperation { 9 class BitNotOperation implements UnaryOperation {
8 final SourceString name = const SourceString('~'); 10 final SourceString name = const SourceString('~');
9 bool isUserDefinable() => true; 11 bool isUserDefinable() => true;
10 const BitNotOperation(); 12 const BitNotOperation();
11 Constant fold(Constant constant) { 13 Constant fold(Constant constant) {
12 if (constant.isInt()) { 14 if (constant.isInt()) {
13 IntConstant intConstant = constant; 15 IntConstant intConstant = constant;
14 return DART_CONSTANT_SYSTEM.createInt(~intConstant.value); 16 return DART_CONSTANT_SYSTEM.createInt(~intConstant.value);
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 bool isInt(Constant constant) => constant.isInt(); 364 bool isInt(Constant constant) => constant.isInt();
363 bool isDouble(Constant constant) => constant.isDouble(); 365 bool isDouble(Constant constant) => constant.isDouble();
364 bool isString(Constant constant) => constant.isString(); 366 bool isString(Constant constant) => constant.isString();
365 bool isBool(Constant constant) => constant.isBool(); 367 bool isBool(Constant constant) => constant.isBool();
366 bool isNull(Constant constant) => constant.isNull(); 368 bool isNull(Constant constant) => constant.isNull();
367 369
368 bool isSubtype(Compiler compiler, DartType s, DartType t) { 370 bool isSubtype(Compiler compiler, DartType s, DartType t) {
369 return compiler.types.isSubtype(s, t); 371 return compiler.types.isSubtype(s, t);
370 } 372 }
371 } 373 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/constant_system.dart ('k') | lib/compiler/implementation/constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698