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

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1355873003: Throw Error on unreachable code rather than a String. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/type_variable_handler.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 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 LibraryElement asyncLibrary; 274 LibraryElement asyncLibrary;
275 LibraryElement interceptorsLibrary; 275 LibraryElement interceptorsLibrary;
276 LibraryElement foreignLibrary; 276 LibraryElement foreignLibrary;
277 LibraryElement isolateHelperLibrary; 277 LibraryElement isolateHelperLibrary;
278 278
279 ClassElement closureClass; 279 ClassElement closureClass;
280 ClassElement boundClosureClass; 280 ClassElement boundClosureClass;
281 Element assertTestMethod; 281 Element assertTestMethod;
282 Element assertThrowMethod; 282 Element assertThrowMethod;
283 Element assertHelperMethod; 283 Element assertHelperMethod;
284 Element assertUnreachableMethod;
284 Element invokeOnMethod; 285 Element invokeOnMethod;
285 286
286 ClassElement jsInterceptorClass; 287 ClassElement jsInterceptorClass;
287 ClassElement jsStringClass; 288 ClassElement jsStringClass;
288 ClassElement jsArrayClass; 289 ClassElement jsArrayClass;
289 ClassElement jsNumberClass; 290 ClassElement jsNumberClass;
290 ClassElement jsIntClass; 291 ClassElement jsIntClass;
291 ClassElement jsDoubleClass; 292 ClassElement jsDoubleClass;
292 ClassElement jsNullClass; 293 ClassElement jsNullClass;
293 ClassElement jsBoolClass; 294 ClassElement jsBoolClass;
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 Element e = findHelper('boolConversionCheck'); 1191 Element e = findHelper('boolConversionCheck');
1191 if (e != null) enqueue(world, e, registry); 1192 if (e != null) enqueue(world, e, registry);
1192 } 1193 }
1193 1194
1194 if (TRACE_CALLS) { 1195 if (TRACE_CALLS) {
1195 traceHelper = findHelper( 1196 traceHelper = findHelper(
1196 TRACE_METHOD == 'console' ? 'consoleTraceHelper' : 'postTraceHelper'); 1197 TRACE_METHOD == 'console' ? 'consoleTraceHelper' : 'postTraceHelper');
1197 assert(traceHelper != null); 1198 assert(traceHelper != null);
1198 enqueueInResolution(traceHelper, registry); 1199 enqueueInResolution(traceHelper, registry);
1199 } 1200 }
1201 enqueueInResolution(assertUnreachableMethod, registry);
1200 registerCheckedModeHelpers(registry); 1202 registerCheckedModeHelpers(registry);
1201 } 1203 }
1202 1204
1203 onResolutionComplete() { 1205 onResolutionComplete() {
1204 super.onResolutionComplete(); 1206 super.onResolutionComplete();
1205 computeMembersNeededForReflection(); 1207 computeMembersNeededForReflection();
1206 rti.computeClassesNeedingRti(); 1208 rti.computeClassesNeedingRti();
1207 } 1209 }
1208 1210
1209 onTypeInferenceComplete() { 1211 onTypeInferenceComplete() {
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
2117 jsUnmodifiableArrayClass = findClass('JSUnmodifiableArray'); 2119 jsUnmodifiableArrayClass = findClass('JSUnmodifiableArray');
2118 jsPlainJavaScriptObjectClass = findClass('PlainJavaScriptObject'); 2120 jsPlainJavaScriptObjectClass = findClass('PlainJavaScriptObject');
2119 jsUnknownJavaScriptObjectClass = findClass('UnknownJavaScriptObject'); 2121 jsUnknownJavaScriptObjectClass = findClass('UnknownJavaScriptObject');
2120 jsIndexableClass = findClass('JSIndexable'); 2122 jsIndexableClass = findClass('JSIndexable');
2121 jsMutableIndexableClass = findClass('JSMutableIndexable'); 2123 jsMutableIndexableClass = findClass('JSMutableIndexable');
2122 } else if (uri == DART_JS_HELPER) { 2124 } else if (uri == DART_JS_HELPER) {
2123 initializeHelperClasses(); 2125 initializeHelperClasses();
2124 assertTestMethod = findHelper('assertTest'); 2126 assertTestMethod = findHelper('assertTest');
2125 assertThrowMethod = findHelper('assertThrow'); 2127 assertThrowMethod = findHelper('assertThrow');
2126 assertHelperMethod = findHelper('assertHelper'); 2128 assertHelperMethod = findHelper('assertHelper');
2129 assertUnreachableMethod = findHelper('assertUnreachable');
2127 2130
2128 typeLiteralClass = findClass('TypeImpl'); 2131 typeLiteralClass = findClass('TypeImpl');
2129 constMapLiteralClass = findClass('ConstantMap'); 2132 constMapLiteralClass = findClass('ConstantMap');
2130 typeVariableClass = findClass('TypeVariable'); 2133 typeVariableClass = findClass('TypeVariable');
2131 2134
2132 jsIndexingBehaviorInterface = findClass('JavaScriptIndexingBehavior'); 2135 jsIndexingBehaviorInterface = findClass('JavaScriptIndexingBehavior');
2133 2136
2134 noSideEffectsClass = findClass('NoSideEffects'); 2137 noSideEffectsClass = findClass('NoSideEffects');
2135 noThrowsClass = findClass('NoThrows'); 2138 noThrowsClass = findClass('NoThrows');
2136 noInlineClass = findClass('NoInline'); 2139 noInlineClass = findClass('NoInline');
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
3170 } 3173 }
3171 } 3174 }
3172 3175
3173 /// Records that [constant] is used by the element behind [registry]. 3176 /// Records that [constant] is used by the element behind [registry].
3174 class Dependency { 3177 class Dependency {
3175 final ConstantValue constant; 3178 final ConstantValue constant;
3176 final Element annotatedElement; 3179 final Element annotatedElement;
3177 3180
3178 const Dependency(this.constant, this.annotatedElement); 3181 const Dependency(this.constant, this.annotatedElement);
3179 } 3182 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/type_variable_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698