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

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

Issue 1032013002: dart2js: Optimize Function.apply for 0-3 argument calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 7 /**
8 * Assigns JavaScript identifiers to Dart variables, class-names and members. 8 * Assigns JavaScript identifiers to Dart variables, class-names and members.
9 * 9 *
10 * Names are generated through three stages: 10 * Names are generated through three stages:
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 String get closureInvocationSelectorName => Compiler.CALL_OPERATOR_NAME; 410 String get closureInvocationSelectorName => Compiler.CALL_OPERATOR_NAME;
411 bool get shouldMinify => false; 411 bool get shouldMinify => false;
412 412
413 /// Returns the string that is to be used as the result of a call to 413 /// Returns the string that is to be used as the result of a call to
414 /// [JS_GET_NAME] at [node] with argument [name]. 414 /// [JS_GET_NAME] at [node] with argument [name].
415 String getNameForJsGetName(Node node, JsGetName name) { 415 String getNameForJsGetName(Node node, JsGetName name) {
416 switch (name) { 416 switch (name) {
417 case JsGetName.GETTER_PREFIX: return getterPrefix; 417 case JsGetName.GETTER_PREFIX: return getterPrefix;
418 case JsGetName.SETTER_PREFIX: return setterPrefix; 418 case JsGetName.SETTER_PREFIX: return setterPrefix;
419 case JsGetName.CALL_PREFIX: return callPrefix; 419 case JsGetName.CALL_PREFIX: return callPrefix;
420 case JsGetName.CALL_PREFIX0: return '${callPrefix}\$0';
421 case JsGetName.CALL_PREFIX1: return '${callPrefix}\$1';
422 case JsGetName.CALL_PREFIX2: return '${callPrefix}\$2';
423 case JsGetName.CALL_PREFIX3: return '${callPrefix}\$3';
420 case JsGetName.CALL_CATCH_ALL: return callCatchAllName; 424 case JsGetName.CALL_CATCH_ALL: return callCatchAllName;
421 case JsGetName.REFLECTABLE: return reflectableField; 425 case JsGetName.REFLECTABLE: return reflectableField;
422 case JsGetName.CLASS_DESCRIPTOR_PROPERTY: 426 case JsGetName.CLASS_DESCRIPTOR_PROPERTY:
423 return classDescriptorProperty; 427 return classDescriptorProperty;
424 case JsGetName.REQUIRED_PARAMETER_PROPERTY: 428 case JsGetName.REQUIRED_PARAMETER_PROPERTY:
425 return requiredParameterField; 429 return requiredParameterField;
426 case JsGetName.DEFAULT_VALUES_PROPERTY: return defaultValuesField; 430 case JsGetName.DEFAULT_VALUES_PROPERTY: return defaultValuesField;
427 case JsGetName.CALL_NAME_PROPERTY: return callNameField; 431 case JsGetName.CALL_NAME_PROPERTY: return callNameField;
428 default: 432 default:
429 compiler.reportError( 433 compiler.reportError(
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1767 if (!first) { 1771 if (!first) {
1768 sb.write('_'); 1772 sb.write('_');
1769 } 1773 }
1770 sb.write('_'); 1774 sb.write('_');
1771 visit(parameter); 1775 visit(parameter);
1772 first = true; 1776 first = true;
1773 } 1777 }
1774 } 1778 }
1775 } 1779 }
1776 } 1780 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/js_lib/js_helper.dart » ('j') | sdk/lib/_internal/compiler/js_lib/js_helper.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698