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

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

Issue 2199593003: Add kind to ConstantValue. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 4 years, 4 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 | « pkg/compiler/lib/src/constants/values.dart ('k') | pkg/compiler/lib/src/js_backend/namer.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 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant); 7 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant);
8 8
9 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array); 9 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array);
10 10
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 262 }
263 263
264 @override 264 @override
265 jsAst.Expression visitInterceptor(InterceptorConstantValue constant, [_]) { 265 jsAst.Expression visitInterceptor(InterceptorConstantValue constant, [_]) {
266 ClassElement interceptorClass = constant.dispatchedType.element; 266 ClassElement interceptorClass = constant.dispatchedType.element;
267 return backend.emitter.interceptorPrototypeAccess(interceptorClass); 267 return backend.emitter.interceptorPrototypeAccess(interceptorClass);
268 } 268 }
269 269
270 @override 270 @override
271 jsAst.Expression visitSynthetic(SyntheticConstantValue constant, [_]) { 271 jsAst.Expression visitSynthetic(SyntheticConstantValue constant, [_]) {
272 switch (constant.kind) { 272 switch (constant.valueKind) {
273 case SyntheticConstantKind.DUMMY_INTERCEPTOR: 273 case SyntheticConstantKind.DUMMY_INTERCEPTOR:
274 case SyntheticConstantKind.EMPTY_VALUE: 274 case SyntheticConstantKind.EMPTY_VALUE:
275 return new jsAst.LiteralNumber('0'); 275 return new jsAst.LiteralNumber('0');
276 case SyntheticConstantKind.TYPEVARIABLE_REFERENCE: 276 case SyntheticConstantKind.TYPEVARIABLE_REFERENCE:
277 case SyntheticConstantKind.NAME: 277 case SyntheticConstantKind.NAME:
278 return constant.payload; 278 return constant.payload;
279 default: 279 default:
280 reporter.internalError(NO_LOCATION_SPANNABLE, 280 reporter.internalError(NO_LOCATION_SPANNABLE,
281 "Unexpected DummyConstantKind ${constant.kind}"); 281 "Unexpected DummyConstantKind ${constant.kind}");
282 return null; 282 return null;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 [value, argumentList]); 322 [value, argumentList]);
323 } 323 }
324 return value; 324 return value;
325 } 325 }
326 326
327 @override 327 @override
328 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { 328 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) {
329 return constantReferenceGenerator(constant.referenced); 329 return constantReferenceGenerator(constant.referenced);
330 } 330 }
331 } 331 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/constants/values.dart ('k') | pkg/compiler/lib/src/js_backend/namer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698