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

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

Issue 1298373002: dart2js cps: Replace interceptor calls with interceptor constants. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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/cps_ir/type_propagation.dart ('k') | no next file » | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library code_generator; 5 library code_generator;
6 6
7 import 'glue.dart'; 7 import 'glue.dart';
8 8
9 import '../../closure.dart' show ClosureClassElement; 9 import '../../closure.dart' show ClosureClassElement;
10 import '../../common/codegen.dart' show CodegenRegistry; 10 import '../../common/codegen.dart' show CodegenRegistry;
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 .withSourceInformation(sourceInformation); 219 .withSourceInformation(sourceInformation);
220 } 220 }
221 221
222 @override 222 @override
223 js.Expression visitConstant(tree_ir.Constant node) { 223 js.Expression visitConstant(tree_ir.Constant node) {
224 return buildConstant( 224 return buildConstant(
225 node.value, 225 node.value,
226 sourceInformation: node.sourceInformation); 226 sourceInformation: node.sourceInformation);
227 } 227 }
228 228
229 js.Expression compileConstant(ParameterElement parameter) {
230 return buildConstant(glue.getConstantValueForVariable(parameter));
231 }
232
233 js.Expression buildStaticInvoke(Element target, 229 js.Expression buildStaticInvoke(Element target,
234 List<js.Expression> arguments, 230 List<js.Expression> arguments,
235 {SourceInformation sourceInformation}) { 231 {SourceInformation sourceInformation}) {
236 registry.registerStaticInvocation(target.declaration); 232 registry.registerStaticInvocation(target.declaration);
237 js.Expression elementAccess = glue.staticFunctionAccess(target); 233 js.Expression elementAccess = glue.staticFunctionAccess(target);
238 return new js.Call(elementAccess, arguments, 234 return new js.Call(elementAccess, arguments,
239 sourceInformation: sourceInformation); 235 sourceInformation: sourceInformation);
240 } 236 }
241 237
242 @override 238 @override
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 js.Expression visitAwait(tree_ir.Await node) { 892 js.Expression visitAwait(tree_ir.Await node) {
897 return new js.Await(visitExpression(node.input)); 893 return new js.Await(visitExpression(node.input));
898 } 894 }
899 895
900 visitFunctionExpression(tree_ir.FunctionExpression node) { 896 visitFunctionExpression(tree_ir.FunctionExpression node) {
901 // FunctionExpressions are currently unused. 897 // FunctionExpressions are currently unused.
902 // We might need them if we want to emit raw JS nested functions. 898 // We might need them if we want to emit raw JS nested functions.
903 throw 'FunctionExpressions should not be used'; 899 throw 'FunctionExpressions should not be used';
904 } 900 }
905 } 901 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698