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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/constant_system_javascript.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 js_backend; 5 part of js_backend;
6 6
7 const JAVA_SCRIPT_CONSTANT_SYSTEM = const JavaScriptConstantSystem(); 7 const JAVA_SCRIPT_CONSTANT_SYSTEM = const JavaScriptConstantSystem();
8 8
9 class JavaScriptBitNotOperation extends BitNotOperation { 9 class JavaScriptBitNotOperation extends BitNotOperation {
10 const JavaScriptBitNotOperation(); 10 const JavaScriptBitNotOperation();
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return result; 134 return result;
135 } 135 }
136 136
137 apply(left, right) => identical(left, right); 137 apply(left, right) => identical(left, right);
138 } 138 }
139 139
140 /** 140 /**
141 * Constant system following the semantics for Dart code that has been 141 * Constant system following the semantics for Dart code that has been
142 * compiled to JavaScript. 142 * compiled to JavaScript.
143 */ 143 */
144 class JavaScriptConstantSystem implements ConstantSystem { 144 class JavaScriptConstantSystem extends ConstantSystem {
145 const int BITS31 = 0x8FFFFFFF; 145 const int BITS31 = 0x8FFFFFFF;
146 const int BITS32 = 0xFFFFFFFF; 146 const int BITS32 = 0xFFFFFFFF;
147 // The maximum integer value a double can represent without losing 147 // The maximum integer value a double can represent without losing
148 // precision. 148 // precision.
149 const int BITS53 = 0x1FFFFFFFFFFFFF; 149 const int BITS53 = 0x1FFFFFFFFFFFFF;
150 150
151 final add = const JavaScriptBinaryArithmeticOperation(const AddOperation()); 151 final add = const JavaScriptBinaryArithmeticOperation(const AddOperation());
152 final bitAnd = const JavaScriptBinaryBitOperation(const BitAndOperation()); 152 final bitAnd = const JavaScriptBinaryBitOperation(const BitAndOperation());
153 final bitNot = const JavaScriptBitNotOperation(); 153 final bitNot = const JavaScriptBitNotOperation();
154 final bitOr = const JavaScriptBinaryBitOperation(const BitOrOperation()); 154 final bitOr = const JavaScriptBinaryBitOperation(const BitOrOperation());
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // At runtime, an integer is both an integer and a double: the 231 // At runtime, an integer is both an integer and a double: the
232 // integer type check is Math.floor, which will return true only 232 // integer type check is Math.floor, which will return true only
233 // for real integers, and our double type check is 'typeof number' 233 // for real integers, and our double type check is 'typeof number'
234 // which will return true for both integers and doubles. 234 // which will return true for both integers and doubles.
235 if (s.element == compiler.intClass && t.element == compiler.doubleClass) { 235 if (s.element == compiler.intClass && t.element == compiler.doubleClass) {
236 return true; 236 return true;
237 } 237 }
238 return compiler.types.isSubtype(s, t); 238 return compiler.types.isSubtype(s, t);
239 } 239 }
240 } 240 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698