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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart

Issue 179583002: Revert "Emit named parameter information in declaration order." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_emitter/metadata_emitter.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 /// This class should morph into something that makes it easy to build 7 /// This class should morph into something that makes it easy to build
8 /// JavaScript representations of libraries, class-sides, and instance-sides. 8 /// JavaScript representations of libraries, class-sides, and instance-sides.
9 /// Initially, it is just a placeholder for code that is moved from 9 /// Initially, it is just a placeholder for code that is moved from
10 /// [CodeEmitterTask]. 10 /// [CodeEmitterTask].
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 expressions.add(code); 418 expressions.add(code);
419 419
420 List tearOffInfo = [new jsAst.LiteralString(callSelectorString)]; 420 List tearOffInfo = [new jsAst.LiteralString(callSelectorString)];
421 421
422 if (needsStubs || canTearOff) { 422 if (needsStubs || canTearOff) {
423 addParameterStubs(member, (Selector selector, jsAst.Fun function) { 423 addParameterStubs(member, (Selector selector, jsAst.Fun function) {
424 expressions.add(function); 424 expressions.add(function);
425 if (member.isInstanceMember()) { 425 if (member.isInstanceMember()) {
426 Set invokedSelectors = 426 Set invokedSelectors =
427 compiler.codegenWorld.invokedNames[member.name]; 427 compiler.codegenWorld.invokedNames[member.name];
428 //if (invokedSelectors != null && invokedSelectors.contains(selector)) {
428 expressions.add(js.string(namer.invocationName(selector))); 429 expressions.add(js.string(namer.invocationName(selector)));
430 //} else {
431 // // Don't add a stub for calling this as a regular instance method,
432 // // we only need the "call" stub for implicit closures of this
433 // // method.
434 // expressions.add("null");
435 //}
429 } else { 436 } else {
437 // Static methods don't need "named" stubs as the default arguments
438 // are inlined at call sites. But static methods might need "call"
439 // stubs for implicit closures.
430 expressions.add("null"); 440 expressions.add("null");
431 // TOOD(ahe): Since we know when reading static data versus instance 441 // TOOD(ahe): Since we know when reading static data versus instance
432 // data, we can eliminate this element. 442 // data, we can eliminate this element.
433 } 443 }
434 Set<Selector> callSelectors = compiler.codegenWorld.invokedNames[ 444 Set<Selector> callSelectors = compiler.codegenWorld.invokedNames[
435 namer.closureInvocationSelectorName]; 445 namer.closureInvocationSelectorName];
436 Selector callSelector = selector.toCallSelector(); 446 Selector callSelector = selector.toCallSelector();
437 String callSelectorString = 'null'; 447 String callSelectorString = 'null';
438 if (canTearOff && callSelectors != null && 448 if (canTearOff && callSelectors != null &&
439 callSelectors.contains(callSelector)) { 449 callSelectors.contains(callSelector)) {
(...skipping 27 matching lines...) Expand all
467 expressions 477 expressions
468 ..addAll(tearOffInfo) 478 ..addAll(tearOffInfo)
469 ..add((tearOffName == null || member.isAccessor()) 479 ..add((tearOffName == null || member.isAccessor())
470 ? js("null") : js.string(tearOffName)) 480 ? js("null") : js.string(tearOffName))
471 ..add(requiredParameterCount) 481 ..add(requiredParameterCount)
472 ..add(optionalParameterCount) 482 ..add(optionalParameterCount)
473 ..add(memberTypeExpression) 483 ..add(memberTypeExpression)
474 ..addAll(task.metadataEmitter.reifyDefaultArguments(member)); 484 ..addAll(task.metadataEmitter.reifyDefaultArguments(member));
475 485
476 if (canBeReflected || canBeApplied) { 486 if (canBeReflected || canBeApplied) {
477 parameters.forEachParameter((Element parameter) { 487 parameters.orderedForEachParameter((Element parameter) {
478 expressions.add(task.metadataEmitter.reifyName(parameter.name)); 488 expressions.add(task.metadataEmitter.reifyName(parameter.name));
479 List<MetadataAnnotation> annotations = parameter.metadata.toList(); 489 List<MetadataAnnotation> annotations = parameter.metadata.toList();
480 Iterable<int> metadataIndices = annotations.map((MetadataAnnotation a) { 490 Iterable<int> metadataIndices = annotations.map((MetadataAnnotation a) {
481 compiler.constantHandler.addCompileTimeConstantForEmission(a.value); 491 compiler.constantHandler.addCompileTimeConstantForEmission(a.value);
482 return task.metadataEmitter.reifyMetadata(a); 492 return task.metadataEmitter.reifyMetadata(a);
483 }); 493 });
484 expressions.add(metadataIndices.isNotEmpty ? metadataIndices.toList() 494 expressions.add(metadataIndices.isNotEmpty ? metadataIndices.toList()
485 : js('[]')); 495 : js('[]'));
486 }); 496 });
487 } 497 }
(...skipping 14 matching lines...) Expand all
502 expressions.add(js.string(member.name)); 512 expressions.add(js.string(member.name));
503 } 513 }
504 514
505 builder.addProperty(name, js.toExpression(expressions)); 515 builder.addProperty(name, js.toExpression(expressions));
506 } 516 }
507 517
508 void addMemberField(VariableElement member, ClassBuilder builder) { 518 void addMemberField(VariableElement member, ClassBuilder builder) {
509 // For now, do nothing. 519 // For now, do nothing.
510 } 520 }
511 } 521 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_emitter/metadata_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698