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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/constant_system.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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/constant_system_dart.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 abstract class Operation { 7 abstract class Operation {
8 SourceString get name; 8 SourceString get name;
9 bool isUserDefinable(); 9 bool isUserDefinable();
10 } 10 }
(...skipping 30 matching lines...) Expand all
41 BinaryOperation get less; 41 BinaryOperation get less;
42 BinaryOperation get modulo; 42 BinaryOperation get modulo;
43 BinaryOperation get multiply; 43 BinaryOperation get multiply;
44 UnaryOperation get negate; 44 UnaryOperation get negate;
45 UnaryOperation get not; 45 UnaryOperation get not;
46 BinaryOperation get shiftLeft; 46 BinaryOperation get shiftLeft;
47 BinaryOperation get shiftRight; 47 BinaryOperation get shiftRight;
48 BinaryOperation get subtract; 48 BinaryOperation get subtract;
49 BinaryOperation get truncatingDivide; 49 BinaryOperation get truncatingDivide;
50 50
51 const ConstantSystem();
52
51 Constant createInt(int i); 53 Constant createInt(int i);
52 Constant createDouble(double d); 54 Constant createDouble(double d);
53 // We need a diagnostic node to report errors in case the string is malformed. 55 // We need a diagnostic node to report errors in case the string is malformed.
54 Constant createString(DartString string, Node diagnosticNode); 56 Constant createString(DartString string, Node diagnosticNode);
55 Constant createBool(bool value); 57 Constant createBool(bool value);
56 Constant createNull(); 58 Constant createNull();
57 59
58 // We need to special case the subtype check for JavaScript constant 60 // We need to special case the subtype check for JavaScript constant
59 // system because an int is a double at runtime. 61 // system because an int is a double at runtime.
60 bool isSubtype(Compiler compiler, DartType s, DartType t); 62 bool isSubtype(Compiler compiler, DartType s, DartType t);
61 63
62 /** Returns true if the [constant] is an integer at runtime. */ 64 /** Returns true if the [constant] is an integer at runtime. */
63 bool isInt(Constant constant); 65 bool isInt(Constant constant);
64 /** Returns true if the [constant] is a double at runtime. */ 66 /** Returns true if the [constant] is a double at runtime. */
65 bool isDouble(Constant constant); 67 bool isDouble(Constant constant);
66 /** Returns true if the [constant] is a string at runtime. */ 68 /** Returns true if the [constant] is a string at runtime. */
67 bool isString(Constant constant); 69 bool isString(Constant constant);
68 /** Returns true if the [constant] is a boolean at runtime. */ 70 /** Returns true if the [constant] is a boolean at runtime. */
69 bool isBool(Constant constant); 71 bool isBool(Constant constant);
70 /** Returns true if the [constant] is null at runtime. */ 72 /** Returns true if the [constant] is null at runtime. */
71 bool isNull(Constant constant); 73 bool isNull(Constant constant);
74
75 Operation lookupUnary(SourceString operator) {
76 if (operator == const SourceString('-')) return negate;
77 if (operator == const SourceString('~')) return bitNot;
78 return null;
79 }
72 } 80 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/constant_system_dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698