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

Side by Side Diff: pkg/compiler/lib/src/ssa/codegen.dart

Issue 1126063002: Recognize unmodifiable lists (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/ssa/nodes.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 ssa; 5 part of ssa;
6 6
7 class SsaCodeGeneratorTask extends CompilerTask { 7 class SsaCodeGeneratorTask extends CompilerTask {
8 8
9 final JavaScriptBackend backend; 9 final JavaScriptBackend backend;
10 final SourceInformationFactory sourceInformationFactory; 10 final SourceInformationFactory sourceInformationFactory;
(...skipping 2314 matching lines...) Expand 10 before | Expand all | Expand 10 after
2325 checkExtendableArray(input); 2325 checkExtendableArray(input);
2326 } 2326 }
2327 return; 2327 return;
2328 } else if (element == backend.jsFixedArrayClass) { 2328 } else if (element == backend.jsFixedArrayClass) {
2329 if (negative) { 2329 if (negative) {
2330 checkExtendableArray(input); 2330 checkExtendableArray(input);
2331 } else { 2331 } else {
2332 checkFixedArray(input); 2332 checkFixedArray(input);
2333 } 2333 }
2334 return; 2334 return;
2335 } else if (element == backend.jsUnmodifiableArrayClass) {
2336 if (negative) {
2337 checkMutableArray(input);
2338 } else {
2339 checkImmutableArray(input);
2340 }
2341 return;
2335 } 2342 }
2336 if (interceptor != null) { 2343 if (interceptor != null) {
2337 checkTypeViaProperty(interceptor, type, negative); 2344 checkTypeViaProperty(interceptor, type, negative);
2338 } else { 2345 } else {
2339 checkTypeViaProperty(input, type, negative); 2346 checkTypeViaProperty(input, type, negative);
2340 } 2347 }
2341 } 2348 }
2342 2349
2343 void checkTypeViaProperty(HInstruction input, DartType type, bool negative) { 2350 void checkTypeViaProperty(HInstruction input, DartType type, bool negative) {
2344 registry.registerIsCheck(type); 2351 registry.registerIsCheck(type);
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
2718 js.PropertyAccess accessHelper(String name) { 2725 js.PropertyAccess accessHelper(String name) {
2719 Element helper = backend.findHelper(name); 2726 Element helper = backend.findHelper(name);
2720 if (helper == null) { 2727 if (helper == null) {
2721 // For mocked-up tests. 2728 // For mocked-up tests.
2722 return js.js('(void 0).$name'); 2729 return js.js('(void 0).$name');
2723 } 2730 }
2724 registry.registerStaticUse(helper); 2731 registry.registerStaticUse(helper);
2725 return backend.emitter.staticFunctionAccess(helper); 2732 return backend.emitter.staticFunctionAccess(helper);
2726 } 2733 }
2727 } 2734 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698