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

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

Issue 682243004: Redo "Constant fold charCodeAt via constant system" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix analysis warning Created 6 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 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 const JavaScriptBinaryArithmeticOperation(const MultiplyOperation()); 167 const JavaScriptBinaryArithmeticOperation(const MultiplyOperation());
168 final negate = const JavaScriptNegateOperation(); 168 final negate = const JavaScriptNegateOperation();
169 final not = const NotOperation(); 169 final not = const NotOperation();
170 final shiftLeft = 170 final shiftLeft =
171 const JavaScriptBinaryBitOperation(const ShiftLeftOperation()); 171 const JavaScriptBinaryBitOperation(const ShiftLeftOperation());
172 final shiftRight = const JavaScriptShiftRightOperation(); 172 final shiftRight = const JavaScriptShiftRightOperation();
173 final subtract = 173 final subtract =
174 const JavaScriptBinaryArithmeticOperation(const SubtractOperation()); 174 const JavaScriptBinaryArithmeticOperation(const SubtractOperation());
175 final truncatingDivide = const JavaScriptBinaryArithmeticOperation( 175 final truncatingDivide = const JavaScriptBinaryArithmeticOperation(
176 const TruncatingDivideOperation()); 176 const TruncatingDivideOperation());
177 final codeUnitAt = const CodeUnitAtRuntimeOperation();
177 178
178 const JavaScriptConstantSystem(); 179 const JavaScriptConstantSystem();
179 180
180 /** 181 /**
181 * Returns true if [value] will turn into NaN or infinity 182 * Returns true if [value] will turn into NaN or infinity
182 * at runtime. 183 * at runtime.
183 */ 184 */
184 bool integerBecomesNanOrInfinity(int value) { 185 bool integerBecomesNanOrInfinity(int value) {
185 double doubleValue = value.toDouble(); 186 double doubleValue = value.toDouble();
186 return doubleValue.isNaN || doubleValue.isInfinite; 187 return doubleValue.isNaN || doubleValue.isInfinite;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 if (onlyStringKeys) { 335 if (onlyStringKeys) {
335 result.add(keyList); 336 result.add(keyList);
336 } else { 337 } else {
337 // Add the keys individually to avoid generating an unused list constant 338 // Add the keys individually to avoid generating an unused list constant
338 // for the keys. 339 // for the keys.
339 result.addAll(keys); 340 result.addAll(keys);
340 } 341 }
341 result.addAll(values); 342 result.addAll(values);
342 return result; 343 return result;
343 } 344 }
344 } 345 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698