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

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

Issue 232563006: Insert checks before deferred calls and accesses. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 VERBOSE_OPTIMIZER_HINTS = false; 7 const VERBOSE_OPTIMIZER_HINTS = false;
8 8
9 class JavaScriptItemCompilationContext extends ItemCompilationContext { 9 class JavaScriptItemCompilationContext extends ItemCompilationContext {
10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>();
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 void registerAbstractClassInstantiation(TreeElements elements) { 1058 void registerAbstractClassInstantiation(TreeElements elements) {
1059 enqueueInResolution(getThrowAbstractClassInstantiationError(), elements); 1059 enqueueInResolution(getThrowAbstractClassInstantiationError(), elements);
1060 // Also register the types of the arguments passed to this method. 1060 // Also register the types of the arguments passed to this method.
1061 enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, elements); 1061 enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, elements);
1062 } 1062 }
1063 1063
1064 void registerFallThroughError(TreeElements elements) { 1064 void registerFallThroughError(TreeElements elements) {
1065 enqueueInResolution(getFallThroughError(), elements); 1065 enqueueInResolution(getFallThroughError(), elements);
1066 } 1066 }
1067 1067
1068 void registerCheckDeferredIsLoaded(TreeElements elements) {
1069 enqueueInResolution(getCheckDeferredIsLoaded(), elements);
1070 // Also register the types of the arguments passed to this method.
1071 enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, elements);
1072 }
1073
1068 void enableNoSuchMethod(Enqueuer world) { 1074 void enableNoSuchMethod(Enqueuer world) {
1069 enqueue(world, getCreateInvocationMirror(), compiler.globalDependencies); 1075 enqueue(world, getCreateInvocationMirror(), compiler.globalDependencies);
1070 world.registerInvocation(compiler.noSuchMethodSelector); 1076 world.registerInvocation(compiler.noSuchMethodSelector);
1071 } 1077 }
1072 1078
1073 void registerSuperNoSuchMethod(TreeElements elements) { 1079 void registerSuperNoSuchMethod(TreeElements elements) {
1074 enqueueInResolution(getCreateInvocationMirror(), elements); 1080 enqueueInResolution(getCreateInvocationMirror(), elements);
1075 enqueueInResolution( 1081 enqueueInResolution(
1076 compiler.objectClass.lookupLocalMember(Compiler.NO_SUCH_METHOD), 1082 compiler.objectClass.lookupLocalMember(Compiler.NO_SUCH_METHOD),
1077 elements); 1083 elements);
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 } 1525 }
1520 1526
1521 Element getAssertSubtype() { 1527 Element getAssertSubtype() {
1522 return compiler.findHelper('assertSubtype'); 1528 return compiler.findHelper('assertSubtype');
1523 } 1529 }
1524 1530
1525 Element getCheckSubtypeOfRuntimeType() { 1531 Element getCheckSubtypeOfRuntimeType() {
1526 return compiler.findHelper('checkSubtypeOfRuntimeType'); 1532 return compiler.findHelper('checkSubtypeOfRuntimeType');
1527 } 1533 }
1528 1534
1535 Element getCheckDeferredIsLoaded() {
1536 return compiler.findHelper('checkDeferredIsLoaded');
1537 }
1538
1529 Element getAssertSubtypeOfRuntimeType() { 1539 Element getAssertSubtypeOfRuntimeType() {
1530 return compiler.findHelper('assertSubtypeOfRuntimeType'); 1540 return compiler.findHelper('assertSubtypeOfRuntimeType');
1531 } 1541 }
1532 1542
1533 Element getThrowNoSuchMethod() { 1543 Element getThrowNoSuchMethod() {
1534 return compiler.findHelper('throwNoSuchMethod'); 1544 return compiler.findHelper('throwNoSuchMethod');
1535 } 1545 }
1536 1546
1537 Element getCreateRuntimeType() { 1547 Element getCreateRuntimeType() {
1538 return compiler.findHelper('createRuntimeType'); 1548 return compiler.findHelper('createRuntimeType');
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1905 } 1915 }
1906 } 1916 }
1907 1917
1908 /// Records that [constant] is used by [user.element]. 1918 /// Records that [constant] is used by [user.element].
1909 class Dependency { 1919 class Dependency {
1910 final Constant constant; 1920 final Constant constant;
1911 final TreeElements user; 1921 final TreeElements user;
1912 1922
1913 const Dependency(this.constant, this.user); 1923 const Dependency(this.constant, this.user);
1914 } 1924 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698