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

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

Issue 574683002: Use ConstExp for storing constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 2 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 static const String LENGTH_NAME = "length"; 306 static const String LENGTH_NAME = "length";
307 static const String JS_OBJECT_NAME = "_jsObject"; 307 static const String JS_OBJECT_NAME = "_jsObject";
308 static const String KEYS_NAME = "_keys"; 308 static const String KEYS_NAME = "_keys";
309 static const String PROTO_VALUE = "_protoValue"; 309 static const String PROTO_VALUE = "_protoValue";
310 static const String JS_DATA_NAME = "_jsData"; 310 static const String JS_DATA_NAME = "_jsData";
311 311
312 final ListConstant keyList; 312 final ListConstant keyList;
313 final Constant protoValue; 313 final Constant protoValue;
314 final bool onlyStringKeys; 314 final bool onlyStringKeys;
315 315
316 JavaScriptMapConstant(DartType type, 316 JavaScriptMapConstant(InterfaceType type,
317 ListConstant keyList, 317 ListConstant keyList,
318 List<Constant> values, 318 List<Constant> values,
319 this.protoValue, 319 this.protoValue,
320 this.onlyStringKeys) 320 this.onlyStringKeys)
321 : this.keyList = keyList, 321 : this.keyList = keyList,
322 super(type, keyList.entries, values); 322 super(type, keyList.entries, values);
323 bool get isMap => true; 323 bool get isMap => true;
324 324
325 TypeMask computeMask(Compiler compiler) { 325 TypeMask computeMask(Compiler compiler) {
326 return compiler.typesTask.constMapType; 326 return compiler.typesTask.constMapType;
327 } 327 }
328 328
329 List<Constant> getDependencies() { 329 List<Constant> getDependencies() {
330 List<Constant> result = <Constant>[]; 330 List<Constant> result = <Constant>[];
331 if (onlyStringKeys) { 331 if (onlyStringKeys) {
332 result.add(keyList); 332 result.add(keyList);
333 } else { 333 } else {
334 // Add the keys individually to avoid generating an unused list constant 334 // Add the keys individually to avoid generating an unused list constant
335 // for the keys. 335 // for the keys.
336 result.addAll(keys); 336 result.addAll(keys);
337 } 337 }
338 result.addAll(values); 338 result.addAll(values);
339 return result; 339 return result;
340 } 340 }
341 } 341 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698